(function(en,Ts){typeof exports=="object"&&typeof module=="object"?module.exports=Ts():typeof define=="function"&&define.amd?define("agGrid",[],Ts):typeof exports=="object"?exports.agGrid=Ts():en.agGrid=Ts()})(typeof self<"u"?self:typeof globalThis<"u"?globalThis:this,()=>{var en={},Ts={exports:en};if(typeof fQ>"u")var fQ=function(t){throw new Error("Unknown module: "+t)};var Gd=Object.defineProperty,KR=Object.getOwnPropertyDescriptor,jR=Object.getOwnPropertyNames,qR=Object.prototype.hasOwnProperty,YR=(e,t)=>{for(var s in t)Gd(e,s,{get:t[s],enumerable:!0})},XR=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of jR(t))!qR.call(e,r)&&r!==s&&Gd(e,r,{get:()=>t[r],enumerable:!(i=KR(t,r))||i.enumerable});return e},ZR=e=>XR(Gd({},"__esModule",{value:!0}),e),Zf={};YR(Zf,{ALWAYS_SYNC_GLOBAL_EVENTS:()=>Qn,AdvancedFilterModule:()=>Wy,AgAbstractCellEditor:()=>Rr,AgAbstractInputField:()=>li,AgAbstractLabel:()=>Kl,AgCheckbox:()=>Vi,AgCheckboxSelector:()=>ds,AgColumn:()=>is,AgColumnGroup:()=>no,AgContentEditableField:()=>Jg,AgContentEditableFieldSelector:()=>lV,AgFilterButtonSelector:()=>oS,AgInputDateField:()=>Po,AgInputNumberField:()=>aa,AgInputNumberFieldSelector:()=>la,AgInputTextArea:()=>Gb,AgInputTextField:()=>ct,AgInputTextFieldSelector:()=>Vt,AgPickerField:()=>vc,AgPopupComponent:()=>In,AgPromise:()=>$,AgProvidedColumnGroup:()=>br,AgRadioButton:()=>Rg,AgRadioButtonSelector:()=>rG,AgSelect:()=>Ct,AgSelectSelector:()=>Wi,AgToggleButton:()=>Vr,AgToggleButtonSelector:()=>QS,AggregationModule:()=>$p,AiToolkitModule:()=>qy,AlignedGridsModule:()=>db,AllCommunityModule:()=>XS,AllEnterpriseModule:()=>WR,AutoScrollService:()=>_l,BaseColsService:()=>Lc,BaseComponentWrapper:()=>iV,BaseCreator:()=>dg,BaseGridSerializingSession:()=>ug,BaseSelectionService:()=>Xg,BatchEditModule:()=>Vx,BeanStub:()=>E,BigIntFilterModule:()=>DS,CellApiModule:()=>Qw,CellRangeType:()=>qt,CellSelectionModule:()=>hd,CellSpanModule:()=>WS,CellStyleModule:()=>Qg,CheckboxEditorModule:()=>qb,ClientSideRowModelApiModule:()=>Sb,ClientSideRowModelModule:()=>bb,ClipboardModule:()=>v1,ColumnApiModule:()=>ql,ColumnAutoSizeModule:()=>Fb,ColumnHoverModule:()=>Eb,ColumnKeyCreator:()=>Zm,ColumnMenuModule:()=>Np,ColumnsToolPanelModule:()=>E0,Component:()=>A,ContextMenuModule:()=>Hp,CssClassManager:()=>bu,CsvExportModule:()=>hg,CustomEditorModule:()=>Zb,CustomFilterModule:()=>PS,DateEditorModule:()=>jb,DateFilterModule:()=>AS,Direction:()=>Ju,DragAndDropModule:()=>Sv,DragSourceType:()=>ns,EventApiModule:()=>qg,ExcelExportModule:()=>N0,ExternalFilterModule:()=>kS,FakeHScrollComp:()=>KC,FakeVScrollComp:()=>qC,FilterButtonComp:()=>Mo,FilterComp:()=>To,FilterWrapperComp:()=>xg,FiltersToolPanelModule:()=>y1,FindModule:()=>Ox,FormulaModule:()=>Ax,GROUP_AUTO_COLUMN_ID:()=>$t,GROUP_HIERARCHY_COLUMN_ID_PREFIX:()=>rC,GridBodyCtrl:()=>nv,GridChartsModule:()=>uQ,GridCoreCreator:()=>nb,GridCtrl:()=>dv,GridHeaderCtrl:()=>NC,GridStateModule:()=>BS,GroupFilterModule:()=>m1,GroupInstanceIdCreator:()=>bh,HeaderRowContainerCtrl:()=>UC,HighlightChangesModule:()=>Yg,InfiniteRowModelModule:()=>LS,IntegratedChartsModule:()=>jf,KeyCode:()=>b,LargeTextEditorModule:()=>Xb,LicenseManager:()=>ep,LocalEventService:()=>As,LocaleModule:()=>OS,LocaleService:()=>GS,ManagedFocusFeature:()=>Ii,MasterDetailModule:()=>F1,MenuModule:()=>Wz,ModuleRegistry:()=>nl,MultiFilterModule:()=>W0,NewFiltersToolPanelModule:()=>x1,NumberEditorModule:()=>Kb,NumberFilterModule:()=>TS,PaginationModule:()=>NS,PinnedRowModel:()=>DC,PinnedRowModule:()=>HS,PivotModule:()=>G1,PositionableFeature:()=>yl,ProvidedFilter:()=>An,QuickFilterModule:()=>IS,ROW_NUMBERS_COLUMN_ID:()=>En,RangeSelectionModule:()=>wU,RefPlaceholder:()=>x,RenderApiModule:()=>zS,RichSelectModule:()=>A0,RowApiModule:()=>pb,RowAutoHeightModule:()=>_S,RowContainerCtrl:()=>rv,RowDragModule:()=>yv,RowGroupingEditModule:()=>_x,RowGroupingModule:()=>Xp,RowGroupingPanelModule:()=>f1,RowNode:()=>lt,RowNumbersModule:()=>Jp,RowSelectionModule:()=>jS,RowStyleModule:()=>qS,SELECTION_COLUMN_ID:()=>vl,STRUCTURED_SCHEMA_FEATURES:()=>yC,ScrollApiModule:()=>fb,SelectEditorModule:()=>Yb,ServerSideRowModelApiModule:()=>_1,ServerSideRowModelModule:()=>z1,ServerSideTransactionResultStatus:()=>ys,SetFilterModule:()=>G0,SideBarModule:()=>Sa,SparklinesModule:()=>Rf,StatusBarModule:()=>V0,TabGuardClassNames:()=>_n,TabGuardComp:()=>Pr,TabGuardCtrl:()=>rV,TabGuardFeature:()=>oV,TextEditorModule:()=>$b,TextFilterModule:()=>MS,TooltipModule:()=>mc,TouchListener:()=>as,TreeDataModule:()=>B1,UndoRedoEditModule:()=>Ub,ValidationModule:()=>YS,ValueCacheModule:()=>Zw,VanillaFrameworkOverrides:()=>rb,ViewportRowModelModule:()=>C1,_AgBeanStub:()=>Ke,_AgColorPicker:()=>hp,_AgColorPickerSelector:()=>a7,_AgComponentStub:()=>Pt,_AgContext:()=>AC,_AgContextMenuService:()=>Ey,_AgDialog:()=>up,_AgGroupComponent:()=>qs,_AgGroupComponentSelector:()=>Se,_AgInputRange:()=>xy,_AgInputRangeSelector:()=>Ry,_AgMenuItemComponent:()=>jc,_AgMenuItemRenderer:()=>Py,_AgMenuList:()=>qc,_AgPanel:()=>dp,_AgPositionableFeature:()=>wu,_AgSlider:()=>Nt,_AgSliderSelector:()=>Tt,_AgTabGuardComp:()=>po,_AgTabGuardFeature:()=>Hl,_AgTabbedLayout:()=>pp,_AgTooltipComponent:()=>Ab,_AgTooltipFeature:()=>gg,_AgVirtualList:()=>Sy,_AgVirtualListDragFeature:()=>yy,_BOOLEAN_MIXED_GRID_OPTIONS:()=>$h,_BaseDragAndDropService:()=>lC,_BaseDragService:()=>Cv,_BaseEnvironment:()=>tw,_BaseEventService:()=>Aw,_BasePopupService:()=>Ib,_BaseRegistry:()=>Hv,_BaseTooltipStateManager:()=>Db,_ChangedRowNodes:()=>Mr,_ColumnFilterModule:()=>Ps,_ColumnGroupModule:()=>yh,_ColumnMoveModule:()=>$l,_CsrmSsrmSharedApiModule:()=>og,_DragModule:()=>Wl,_EditCoreModule:()=>Es,_EmptyBean:()=>EP,_FOCUS_MANAGED_CLASS:()=>Au,_FilterCoreModule:()=>ha,_FilterValueModule:()=>Ic,_GET_ALL_EVENTS:()=>II,_GET_ALL_GRID_OPTIONS:()=>Gw,_GET_SHALLOW_GRID_OPTIONS:()=>_I,_HeaderComp:()=>Vw,_HorizontalResizeModule:()=>mh,_KeyboardNavigationModule:()=>ta,_MONTHS:()=>$n,_PUBLIC_EVENTS:()=>Wh,_PUBLIC_EVENT_HANDLERS_MAP:()=>rc,_PopupModule:()=>$s,_ROW_ID_PREFIX_BOTTOM_PINNED:()=>Ml,_ROW_ID_PREFIX_ROW_GROUP:()=>ku,_ROW_ID_PREFIX_TOP_PINNED:()=>Pl,_RowModelSharedApiModule:()=>ng,_STOP_PROPAGATION_CALLBACKS:()=>Ai,_SharedDragAndDropModule:()=>Oi,_SharedExportModule:()=>cg,_SharedMenuModule:()=>wg,_SharedRowSelectionModule:()=>Zg,_SortModule:()=>uc,_SsrmInfiniteSharedApiModule:()=>ag,_addAdditionalCss:()=>Dw,_addColumnDefaultAndTypes:()=>Mi,_addFocusableContainerListener:()=>ho,_addGridCommonParams:()=>N,_addOrRemoveAttribute:()=>nt,_anchorElementToMouseMoveEvent:()=>tl,_applyColumnState:()=>qe,_areCellsEqual:()=>uo,_areColIdsEqual:()=>Pn,_areEqual:()=>be,_areSortDefsEqual:()=>Rn,_asThemeImpl:()=>oA,_attemptToRestoreCellFocus:()=>_u,_batchCall:()=>Cn,_camelCaseToHumanText:()=>Jf,_canSkipShowingRowGroup:()=>Wm,_clearElement:()=>ee,_columnsMatch:()=>oi,_combineAttributesAndGridOptions:()=>WF,_consoleError:()=>to,_convertColumnEventSourceType:()=>Os,_coreThemeDefaults:()=>sw,_createAgElement:()=>$e,_createCellId:()=>ai,_createColumnTree:()=>du,_createColumnTreeWithIds:()=>Jm,_createElement:()=>re,_createGlobalRowEvent:()=>Lu,_createIcon:()=>Bs,_createIconNoSpan:()=>_,_createRowNodeSibling:()=>Gu,_createSharedTheme:()=>Zv,_csrmFirstLeaf:()=>Gi,_csrmReorderAllLeafs:()=>ph,_debounce:()=>Ce,_defaultComparator:()=>sn,_destroyColumnTree:()=>os,_doOnce:()=>Jr,_downloadFile:()=>oa,_errMsg:()=>Ft,_error:()=>Q,_escapeString:()=>pt,_exists:()=>D,_findEnterpriseCoreModule:()=>Im,_findFocusableElements:()=>Kt,_findNextFocusableElement:()=>Qe,_findTabbableParent:()=>Fl,_flatten:()=>Od,_focusGridInnerElement:()=>zu,_focusInto:()=>Ge,_focusNextGridCoreContainer:()=>Vs,_forEachChangedGroupDepthFirst:()=>Mt,_formatNumberCommas:()=>ci,_fuzzySuggestions:()=>Ro,_getAbsoluteHeight:()=>hn,_getAbsoluteRowIndex:()=>Hu,_getAbsoluteWidth:()=>bi,_getActiveDomElement:()=>ie,_getAriaPosInSet:()=>tm,_getCallbackForEvent:()=>Ym,_getCellByPosition:()=>ls,_getCellCtrlForEventTarget:()=>Hn,_getCellPositionForEvent:()=>fh,_getCellRendererDetails:()=>xr,_getCheckboxLocation:()=>ro,_getCheckboxes:()=>Fi,_getClientSideRowModel:()=>at,_getColumnState:()=>Un,_getColumnStateFromColDef:()=>Sl,_getColumnsFromTree:()=>wl,_getDateParts:()=>Dr,_getDefaultFloatingFilterType:()=>yg,_getDefaultSimpleFilter:()=>xc,_getDisplaySortForColumn:()=>lu,_getDocument:()=>me,_getEditorRendererDetails:()=>pu,_getEnableColumnSelection:()=>Ei,_getFillHandle:()=>pl,_getFilterDetails:()=>fu,_getFilterModel:()=>We,_getFilterParamsForDataType:()=>yc,_getFirstRow:()=>Fr,_getFloatingFilterCompDetails:()=>mu,_getFloatingFiltersHeight:()=>Dl,_getGlobalGridOption:()=>Xd,_getGrandTotalRow:()=>Ri,_getGridOption:()=>$F,_getGridRegisteredModules:()=>Dm,_getGroupAggFiltering:()=>xi,_getGroupSelection:()=>xn,_getGroupSelectsDescendants:()=>Pi,_getGroupTotalRowCallback:()=>vr,_getHeaderCheckbox:()=>yn,_getHeaderClassesFromColDef:()=>Al,_getHeaderRowCount:()=>VC,_getInnerCellRendererDetails:()=>Tn,_getInnerHeight:()=>un,_getInnerWidth:()=>gr,_getIsRowSelectable:()=>fl,_getLastRow:()=>Er,_getLocaleTextFromFunc:()=>vm,_getLocaleTextFromMap:()=>wm,_getLocaleTextFunc:()=>Kd,_getMaxConcurrentDatasourceRequests:()=>iu,_getNormalisedMousePosition:()=>Wn,_getPageBody:()=>cr,_getParamType:()=>$v,_getRootNode:()=>It,_getRowAbove:()=>Yt,_getRowBelow:()=>Je,_getRowContainerClass:()=>ch,_getRowContainerOptions:()=>go,_getRowCtrlForEventTarget:()=>sh,_getRowHeightAsNumber:()=>Et,_getRowHeightForNode:()=>Ze,_getRowIdCallback:()=>Is,_getRowNode:()=>Ve,_getRowSelectionMode:()=>wr,_getRowSpanContainerClass:()=>tv,_getRowViewportClass:()=>lh,_getServerSideRowModel:()=>co,_getShouldDisplayTooltip:()=>na,_getSortDefFromColDef:()=>hu,_getSortDefFromInput:()=>Ut,_getSuppressMultiRanges:()=>$m,_getToolPanelClassesFromColDef:()=>qu,_getViewportRowModel:()=>jE,_getWindow:()=>Xr,_interpretAsRightClick:()=>ml,_isAnimateRows:()=>Cr,_isBrowserFirefox:()=>Di,_isBrowserSafari:()=>Ss,_isCellSelectionEnabled:()=>mt,_isClientSideRowModel:()=>ae,_isColumnMenuAnchoringEnabled:()=>au,_isColumnsSortingCoupledToGroup:()=>ws,_isComponent:()=>ao,_isDomLayout:()=>je,_isElementInEventPath:()=>el,_isElementOverflowingCallback:()=>ti,_isEventFromPrintableCharacter:()=>Il,_isExpressionString:()=>lr,_isFocusableFormField:()=>Zr,_isFullWidthGroupRow:()=>hl,_isGetRowHeightFunction:()=>dl,_isGroupHideColumnsUntilExpanded:()=>su,_isGroupMultiAutoColumn:()=>Sn,_isGroupRowsSticky:()=>bn,_isGroupUseEntireRow:()=>ul,_isIOSUserAgent:()=>ni,_isKeyboardMode:()=>Dn,_isLegacyMenuEnabled:()=>He,_isMultiRowSelection:()=>ks,_isNodeOrElement:()=>fn,_isNothingFocused:()=>ms,_isPromise:()=>aC,_isRowBefore:()=>ze,_isRowNumbers:()=>si,_isRowSelection:()=>Lt,_isSameRow:()=>ve,_isServerSideRowModel:()=>ft,_isSetFilterByDefault:()=>nu,_isShowTooltipWhenTruncated:()=>Fo,_isSortDirectionValid:()=>ii,_isSortTypeValid:()=>Cl,_isStopPropagationForAgGrid:()=>Gt,_isUseApplyButton:()=>lo,_isUsingNewCellSelectionAPI:()=>Um,_isUsingNewRowSelectionAPI:()=>gl,_isVisible:()=>Ne,_jsonEquals:()=>Ds,_last:()=>W,_loadTemplate:()=>Xa,_logPreInitWarn:()=>Nm,_makeNull:()=>Ae,_mergeDeep:()=>Oe,_missing:()=>ne,_normalizeSortDirection:()=>Fn,_normalizeSortType:()=>rs,_observeResize:()=>vs,_paramToVariableName:()=>Xl,_paramValueToCss:()=>Xv,_parseBigIntOrNull:()=>et,_parseDateTimeFromString:()=>_e,_placeCaretAtEnd:()=>Qa,_preInitErrMsg:()=>cl,_prevOrNextDisplayedRow:()=>kn,_processOnChange:()=>UF,_radioCssClass:()=>dn,_refreshFilterUi:()=>ca,_refreshHandlerAndUi:()=>bc,_registerModule:()=>so,_removeAllFromArray:()=>za,_removeAriaExpanded:()=>Bd,_removeAriaSort:()=>nm,_removeFromArray:()=>De,_removeFromParent:()=>ue,_requestAnimationFrame:()=>Rt,_resetColumnState:()=>xh,_selectAllCells:()=>rh,_serialiseDate:()=>tt,_setAriaActiveDescendant:()=>Vd,_setAriaChecked:()=>Hd,_setAriaColCount:()=>rm,_setAriaColIndex:()=>$a,_setAriaColSpan:()=>Nd,_setAriaControls:()=>Ka,_setAriaControlsAndLabel:()=>ja,_setAriaDescribedBy:()=>rn,_setAriaDisabled:()=>nn,_setAriaExpanded:()=>ot,_setAriaHasPopup:()=>lm,_setAriaHidden:()=>Ua,_setAriaInvalid:()=>Wa,_setAriaLabel:()=>de,_setAriaLabelledBy:()=>Cs,_setAriaLevel:()=>on,_setAriaOrientation:()=>lF,_setAriaPosInSet:()=>ln,_setAriaRole:()=>Ie,_setAriaRowCount:()=>im,_setAriaRowIndex:()=>dr,_setAriaSelected:()=>cn,_setAriaSetSize:()=>an,_setAriaSort:()=>om,_setColMenuVisible:()=>da,_setDisabled:()=>wi,_setDisplayed:()=>V,_setFixedWidth:()=>ts,_setScrollLeft:()=>pr,_setUmd:()=>Am,_setVisible:()=>zd,_sharedThemeDefaults:()=>Uv,_shouldUpdateColVisibilityAfterGroup:()=>ru,_skipFocusableContainerListenerForAgGrid:()=>OC,_stopPropagationForAgGrid:()=>Ee,_suppressCellMouseEvent:()=>Nn,_themeAlpineParams:()=>xw,_themeBalhamParams:()=>Rw,_themeMaterialParams:()=>Ew,_themeQuartzParams:()=>Sw,_toString:()=>es,_toStringOrNull:()=>Xe,_translate:()=>il,_translateForFilter:()=>jt,_unwrapUserComp:()=>Us,_updateColsMap:()=>Mn,_updateColumnState:()=>uu,_updateFilterModel:()=>Sc,_waitUntil:()=>qd,_warn:()=>F,_warnOnce:()=>ss,agTestIdFor:()=>z,buttonStyleAlpine:()=>nw,buttonStyleBalham:()=>aw,buttonStyleBase:()=>rw,buttonStyleQuartz:()=>ow,checkboxStyleDefault:()=>qn,colorSchemeDark:()=>VA,colorSchemeDarkBlue:()=>zA,colorSchemeDarkWarm:()=>NA,colorSchemeLight:()=>AA,colorSchemeLightCold:()=>GA,colorSchemeLightWarm:()=>kA,colorSchemeVariable:()=>Yn,columnDropStyleBordered:()=>tc,columnDropStylePlain:()=>Vh,convertColumnGroupState:()=>rk,convertColumnState:()=>lb,createGrid:()=>gQ,createPart:()=>he,createTheme:()=>jn,distributeGroupValue:()=>Hx,exportMultipleSheetsAsExcel:()=>ZN,getGridApi:()=>sk,getGridElement:()=>ik,getMultipleSheetsAsExcel:()=>lp,iconOverrides:()=>KA,iconSetAlpine:()=>dw,iconSetBalham:()=>cw,iconSetMaterial:()=>uw,iconSetQuartz:()=>sc,iconSetQuartzBold:()=>XA,iconSetQuartzLight:()=>YA,iconSetQuartzRegular:()=>fw,inputStyleBase:()=>eI,inputStyleBordered:()=>ic,inputStyleUnderlined:()=>mw,isColumn:()=>bs,isColumnGroup:()=>Le,isColumnGroupAutoCol:()=>Sr,isColumnSelectionCol:()=>Gs,isCombinedFilterModel:()=>vu,isProvidedColumnGroup:()=>Re,isRowNumberCol:()=>Fe,isSpecialCol:()=>yr,onRowHeightChanged:()=>hc,provideGlobalGridOptions:()=>RF,resetRowHeights:()=>gc,setupAgTestIds:()=>sV,styleMaterial:()=>Fw,tabStyleAlpine:()=>ww,tabStyleBase:()=>oI,tabStyleMaterial:()=>vw,tabStyleQuartz:()=>Cw,tabStyleRolodex:()=>bw,themeAlpine:()=>gI,themeBalham:()=>fI,themeMaterial:()=>vI,themeQuartz:()=>yw,wrapAgTestIdFor:()=>X4}),Ts.exports=ZR(Zf);function W(e){if(e?.length)return e[e.length-1]}function be(e,t,s){if(e===t)return!0;if(!e||!t)return e==null&&t==null;const i=e.length;if(i!==t.length)return!1;for(let r=0;r=0&&e.splice(s,1)}function za(e,t){let s=0,i=0;for(;s=0;i--)e.splice(s,0,t[i])}function Od(e){return[].concat.apply([],e)}var Ae=e=>e==null||e===""?null:e;function D(e){return e!=null&&e!==""}function ne(e){return!D(e)}var Xe=e=>e!=null&&typeof e.toString=="function"?e.toString():null,Ds=(e,t)=>{const s=e?JSON.stringify(e):null,i=t?JSON.stringify(t):null;return s===i},sn=(e,t,s=!1)=>e==null?t==null?0:-1:t==null?1:(typeof e=="object"&&e.toNumber&&(e=e.toNumber()),typeof t=="object"&&t.toNumber&&(t=t.toNumber()),!s||typeof e!="string"?e>t?1:e{const l=i?()=>i.wrapIncoming(a):a;t?this.dispatchAsync(l):l()},o=this.getListeners(s,t,!1);if((o?.size??0)>0){const a=new Set(o);for(const l of a)o?.has(l)&&r(()=>l(e))}const n=this.getGlobalListeners(t);if(n.size>0){const a=new Set(n);for(const l of a)r(()=>l(s,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)},s=this.frameworkOverrides;s?s.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}},QR=/[&<>"']/g,JR={"&":"&","<":"<",">":">",'"':""","'":"'"};function es(e){return e?.toString().toString()??null}function pt(e){return es(e)?.replace(QR,t=>JR[t])??null}function lr(e){return typeof e=="string"&&e.startsWith("=")&&e.length>1}function Jf(e){if(!e||e==null)return null;const t=/([a-z])([A-Z])/g,s=/([A-Z]+)([A-Z])([a-z])/g;return e.replace(t,"$1 $2").replace(s,"$1 $2$3").replace(/\./g," ").split(" ").map(r=>r.substring(0,1).toUpperCase()+(r.length>1?r.substring(1,r.length):"")).join(" ")}function It(e){return e.eRootDiv.getRootNode()}function ie(e){return It(e).activeElement}function me(e){const{gos:t,eRootDiv:s}=e;let i=null;const r=t.get("getDocument");return r&&D(r)?i=r():s&&(i=s.ownerDocument),i&&D(i)?i:document}function ms(e){const t=ie(e);return t===null||t===me(e).body}function Xr(e){return me(e).defaultView||window}function cr(e){let t=null,s=null;try{t=me(e).fullscreenElement}catch{}finally{t||(t=It(e));const i=t.querySelector("body");i?s=i:t instanceof ShadowRoot?s=t:t instanceof Document?s=t?.documentElement:s=t}return s}function eF(e){return cr(e)?.clientWidth??(window.innerWidth||-1)}function tF(e){return cr(e)?.clientHeight??(window.innerHeight||-1)}function xt(e,t,s){s==null||typeof s=="string"&&s==""?_a(e,t):kt(e,t,s)}function kt(e,t,s){e.setAttribute(em(t),s.toString())}function _a(e,t){e.removeAttribute(em(t))}function em(e){return`aria-${e}`}function Ie(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function sF(e){const t=e?.direction;return t==="asc"?"ascending":t==="desc"?"descending":t==="mixed"?"other":"none"}function tm(e){return Number.parseInt(e.getAttribute("aria-posinset"),10)}function iF(e){return e.getAttribute("aria-label")}function de(e,t){xt(e,"label",t)}function Cs(e,t){xt(e,"labelledby",t)}function rn(e,t){xt(e,"describedby",t)}function sm(e,t){xt(e,"live",t)}function rF(e,t){xt(e,"atomic",t)}function oF(e,t){xt(e,"relevant",t)}function Wa(e,t){xt(e,"invalid",t)}function on(e,t){xt(e,"level",t)}function nn(e,t){xt(e,"disabled",t)}function Ua(e,t){xt(e,"hidden",t)}function Vd(e,t){xt(e,"activedescendant",t)}function ot(e,t){kt(e,"expanded",t)}function Bd(e){_a(e,"expanded")}function an(e,t){kt(e,"setsize",t)}function ln(e,t){kt(e,"posinset",t)}function nF(e,t){kt(e,"multiselectable",t)}function im(e,t){kt(e,"rowcount",t)}function dr(e,t){kt(e,"rowindex",t)}function aF(e,t){kt(e,"rowspan",t)}function rm(e,t){kt(e,"colcount",t)}function $a(e,t){kt(e,"colindex",t)}function Nd(e,t){kt(e,"colspan",t)}function om(e,t){kt(e,"sort",t)}function nm(e){_a(e,"sort")}function cn(e,t){xt(e,"selected",t)}function Hd(e,t){kt(e,"checked",t===void 0?"mixed":t)}function Ka(e,t){xt(e,"controls",t)}function ja(e,t){Ka(e,t.id),Cs(t,e.id)}function am(e,t){xt(e,"owns",t)}function lm(e,t){xt(e,"haspopup",t===!1?null:t)}function qa(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}function lF(e,t){t?kt(e,"orientation",t):_a(e,"orientation")}function dn(e,t,s){const i=e.parentElement;let r=i&&i.firstChild;for(;r;)t&&r.classList.toggle(t,r===e),s&&r.classList.toggle(s,r!==e),r=r.nextSibling}var cF="[tabindex], input, select, button, textarea, [href]",cm="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Zr(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(cm)?!1:Ne(e)}function V(e,t,s={}){const{skipAriaHidden:i}=s;e.classList.toggle("ag-hidden",!t),i||Ua(e,!t)}function zd(e,t,s={}){const{skipAriaHidden:i}=s;e.classList.toggle("ag-invisible",!t),i||Ua(e,!t)}function wi(e,t){const s="disabled",i=t?o=>o.setAttribute(s,""):o=>o.removeAttribute(s);i(e);const r=e.querySelectorAll("input")??[];for(const o of r)i(o)}function ur(e,t,s){let i=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof s=="number"){if(++i>s)break}else if(e===s)break}return!1}function hr(e){const{height:t,width:s,borderTopWidth:i,borderRightWidth:r,borderBottomWidth:o,borderLeftWidth:n,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:d,marginTop:u,marginRight:h,marginBottom:g,marginLeft:p,boxSizing:f}=window.getComputedStyle(e),m=Number.parseFloat;return{height:m(t||"0"),width:m(s||"0"),borderTopWidth:m(i||"0"),borderRightWidth:m(r||"0"),borderBottomWidth:m(o||"0"),borderLeftWidth:m(n||"0"),paddingTop:m(a||"0"),paddingRight:m(l||"0"),paddingBottom:m(c||"0"),paddingLeft:m(d||"0"),marginTop:m(u||"0"),marginRight:m(h||"0"),marginBottom:m(g||"0"),marginLeft:m(p||"0"),boxSizing:f}}function un(e){const t=hr(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function gr(e){const t=hr(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function hn(e){const{height:t,marginBottom:s,marginTop:i}=hr(e);return Math.floor(t+s+i)}function bi(e){const{width:t,marginLeft:s,marginRight:i}=hr(e);return Math.floor(t+s+i)}function dm(e){const t=e.getBoundingClientRect(),{borderTopWidth:s,borderLeftWidth:i,borderRightWidth:r,borderBottomWidth:o}=hr(e);return{top:t.top+(s||0),left:t.left+(i||0),right:t.right+(r||0),bottom:t.bottom+(o||0)}}function Ya(e,t){let s=e.scrollLeft;return t&&(s=Math.abs(s)),s}function pr(e,t,s){s&&(t*=-1),e.scrollLeft=t}function ee(e){for(;e?.firstChild;)e.firstChild.remove()}function ue(e){e?.parentNode&&e.remove()}function um(e){return!!e.offsetParent}function Ne(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!um(e)||window.getComputedStyle(e).visibility!=="visible")}function Xa(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function hm(e,t,s){s&&s.nextSibling===t||(e.firstChild?s?s.nextSibling?e.insertBefore(t,s.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.prepend(t):e.appendChild(t))}function gm(e,t){for(let s=0;s`-${t.toLocaleLowerCase()}`)}function gn(e,t){if(t)for(const s of Object.keys(t)){const i=t[s];if(!s?.length||i==null)continue;const r=dF(s),o=i.toString(),n=o.replace(/\s*!important/g,""),a=n.length!=o.length?"important":void 0;e.style.setProperty(r,n,a)}}function ti(e){return()=>{const t=e();return t?pm(t)||uF(t):!0}}function pm(e){return e.clientWidtho?.disconnect()}function Rt(e,t){const s=Xr(e);s.requestAnimationFrame?s.requestAnimationFrame(t):s.webkitRequestAnimationFrame?s.webkitRequestAnimationFrame(t):s.setTimeout(t,0)}var fm="data-ref",Wd;function mm(){return Wd??(Wd=document.createTextNode(" ")),Wd.cloneNode()}function $e(e){const{attrs:t,children:s,cls:i,ref:r,role:o,tag:n}=e,a=document.createElement(n);if(i&&(a.className=i),r&&a.setAttribute(fm,r),o&&a.setAttribute("role",o),t)for(const l of Object.keys(t))a.setAttribute(l,t[l]);if(s)if(typeof s=="string")a.textContent=s;else{let l=!0;for(const c of s)c&&(typeof c=="string"?(a.appendChild(document.createTextNode(c)),l=!1):typeof c=="function"?a.appendChild(c()):(l&&(a.appendChild(mm()),l=!1),a.append($e(c)),a.appendChild(mm())))}return a}var hF=["touchstart","touchend","touchmove","touchcancel","scroll"],gF=["wheel"],Ud={},Ja=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return s=>{if(typeof Ud[s]=="boolean")return Ud[s];const i=document.createElement(e[s]||"div");return s="on"+s,Ud[s]=s in i}})();function el(e,t){return!t||!e?!1:fF(t).indexOf(e)>=0}function pF(e){const t=[];let s=e.target;for(;s;)t.push(s),s=s.parentElement;return t}function fF(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():pF(t)}function mF(e,t,s){const i=CF(t);let r;i!=null&&(r={passive:i}),e.addEventListener(t,s,r)}var CF=e=>{const t=hF.includes(e),s=gF.includes(e);if(t)return!0;if(s)return!1};function Cm(e,t,s){if(s===0)return!1;const i=Math.abs(e.clientX-t.clientX),r=Math.abs(e.clientY-t.clientY);return Math.max(i,r)<=s}var Qr=(e,t)=>{const s=e.identifier;for(let i=0,r=t.length;i0&&h+e.clientWidth>o+m&&(h=o+m-e.clientWidth),h<0&&(h=0),n>0&&u+e.clientHeight>n+f&&(u=n+f-e.clientHeight),u<0&&(u=0),e.style.left=`${h}px`,e.style.top=`${u}px`}var sl=(e,...t)=>{for(const s of t){const[i,r,o,n]=s;i.addEventListener(r,o,n),e.push(s)}},$d=e=>{if(e){for(const[t,s,i,r]of e)t.removeEventListener(s,i,r);e.length=0}},Si=e=>{e.cancelable&&e.preventDefault()};function vF(e,t){return t}function Kd(e){return e?.getLocaleTextFunc()??vF}function il(e,t,s,i){const r=t[s];return e.getLocaleTextFunc()(s,typeof r=="function"?r(i):r,i)}function vm(e){return(t,s,i)=>e({key:t,defaultValue:s,variableValues:i})}function wm(e){return(t,s,i)=>{let r=e?.[t];if(r&&i?.length){let o=0;for(;!(o>=i.length||r.indexOf("${variable}")===-1);)r=r.replace("${variable}",i[o++])}return r??s}}var Ke=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;tnull;let i;if(wF(e))e.__addEventListener(t,s),i=()=>(e.__removeEventListener(t,s),null);else{const r=bF(e);e instanceof HTMLElement?mF(e,t,s):r?e.addListener(t,s):e.addEventListener(t,s),i=r?()=>(e.removeListener(t,s),null):()=>(e.removeEventListener(t,s),null)}return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(r=>r!==i),null)}setupPropertyListener(e,t){const{gos:s}=this;s.addPropertyEventListener(e,t);const i=()=>(s.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(r=>r!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const s=e.join("-")+this.propertyListenerId++,i=r=>{if(r.changeSet){if(r.changeSet&&r.changeSet.id===this.lastChangeSetIdLookup[s])return;this.lastChangeSetIdLookup[s]=r.changeSet.id}const o={type:"propertyChanged",changeSet:r.changeSet,source:r.source};t(o)};for(const r of e)this.setupPropertyListener(r,i)}getLocaleTextFunc(){return Kd(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const s=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),s}createBean(e,t,s){return(t||this.stubContext).createBean(e,s)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function wF(e){return e.__addEventListener!==void 0}function bF(e){return e.eventServiceType==="global"}var E=class extends Ke{},jd=new Set,Jr=(e,t)=>{jd.has(t)||(jd.add(t),e())};Jr._set=jd;var SF={pending:!1,funcs:[]},yF={pending:!1,funcs:[]};function Cn(e,t="setTimeout",s){const i=t==="raf"?yF:SF;if(i.funcs.push(e),i.pending)return;i.pending=!0;const r=()=>{const o=i.funcs.slice();i.funcs.length=0,i.pending=!1;for(const n of o)n()};t==="raf"?Rt(s,r):window.setTimeout(r,0)}function Ce(e,t,s){let i;return function(...r){const o=this;return window.clearTimeout(i),i=window.setTimeout(function(){e.isAlive()&&t.apply(o,r)},s),i}}function bm(e,t){let s=0;return function(...i){const r=this,o=Date.now();o-s{o!=null&&(window.clearInterval(o),o=null)};e.addDestroyFunc(a);const l=()=>{const c=Date.now()-r>i;(t()||c)&&(s(),n=!0,a())};l(),n||(o=window.setInterval(l,10))}var Sm=new Set(["__proto__","constructor","prototype"]);function xF(e,t){if(e!=null){if(Array.isArray(e)){for(let s=0;s!Sm.has(i)))t(s,e[s])}}function Oe(e,t,s=!0,i=!1){D(t)&&xF(t,(r,o)=>{let n=e[r];n!==o&&(i&&n==null&&o!=null&&typeof o=="object"&&o.constructor===Object&&(n={},e[r]=n),ym(o)&&ym(n)&&!Array.isArray(n)?Oe(n,o,s,i):(s||o!==void 0)&&(e[r]=o))})}function ym(e){return typeof e=="object"&&e!==null}var Yd=class vi{static applyGlobalGridOptions(t){if(!vi.gridOptions)return{...t};let s={};return Oe(s,vi.gridOptions,!0,!0),vi.mergeStrategy==="deep"?Oe(s,t,!0,!0):s={...s,...t},vi.gridOptions.context&&(s.context=vi.gridOptions.context),t.context&&(vi.mergeStrategy==="deep"&&s.context&&Oe(t.context,s.context,!0,!0),s.context=t.context),s}static applyGlobalGridOption(t,s){if(vi.mergeStrategy==="deep"){const i=Xd(t);if(i&&typeof i=="object"&&typeof s=="object")return vi.applyGlobalGridOptions({[t]:s})[t]}return s}};Yd.gridOptions=void 0,Yd.mergeStrategy="shallow";var vn=Yd;function RF(e,t="shallow"){vn.gridOptions=e,vn.mergeStrategy=t}function Xd(e){return vn.gridOptions?.[e]}var xm={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,refreshAfterGroupEdit:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupHideColumnsUntilExpanded:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,enableFilterHandlers:!1},Rm="https://www.ag-grid.com";function yi(e,t,...s){e.get("debug")&&console.log("AG Grid: "+t,...s)}function ss(e,...t){Jr(()=>Fm(e,...t),e+t?.join(""))}function eo(e,...t){Jr(()=>to(e,...t),e+t?.join(""))}function to(e,...t){console.error("AG Grid: "+e,...t)}function Fm(e,...t){console.warn("AG Grid: "+e,...t)}var Em=new Set,rl={},fr={},ol,Pm=!1,Mm=!1,Tm=!1;function FF(e){const[t,s]=e.version.split(".")||[],[i,r]=ol.split(".")||[];return t===i&&s===r}function EF(e){ol||(ol=e.version);const t=i=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${i} Please update all modules to the same version.`;e.version?FF(e)||eo(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${ol}.`)):eo(t(`'${e.moduleName}' is incompatible.`));const s=e.validate?.();s&&!s.isValid&&eo(`${s.message}`)}function so(e,t,s=!1){s||(Pm=!0),EF(e);const i=e.rowModels??["all"];Em.add(e);let r;t!==void 0?(Mm=!0,fr[t]===void 0&&(fr[t]={}),r=fr[t]):r=rl;for(const o of i)r[o]===void 0&&(r[o]={}),r[o][e.moduleName]=e;if(e.dependsOn)for(const o of e.dependsOn)so(o,t,s)}function PF(e){delete fr[e]}function Zd(e,t,s){const i=r=>!!rl[r]?.[e]||!!fr[t]?.[r]?.[e];return i(s)||i("all")}function Qd(){return Mm}function MF(e,t){const s=fr[e]??{};return[...Object.values(rl.all??{}),...Object.values(s.all??{}),...Object.values(rl[t]??{}),...Object.values(s[t]??{})]}function TF(){return new Set(Em)}function Dm(e,t){const s=fr[e]??{};return[...Object.values(s.all??{}),...Object.values(s[t]??{})]}function DF(){return Pm}function Jd(){return Tm}function Am(){Tm=!0}var nl=class{static register(e){so(e,void 0)}static registerModules(e){for(const t of e)so(t,void 0)}};function Im(e){for(const t of e){if("setLicenseKey"in t)return t;if(t.dependsOn){const s=Im(t.dependsOn);if(s)return s}}}var H="35.2.1",km=2e3,Lm=100,Gm="_version_",Om=null,io=`${Rm}/javascript-data-grid`;function AF(e){Om=e}function IF(e){io=e}function Vm(e,t,s){return Om?.(e,t)??[OF(e,t,s)]}function al(e,t,s,i,r){e(`${i?"warning":"error"} #${t}`,...Vm(t,s,r))}function kF(e){if(!e)return String(e);const t={};for(const s of Object.keys(e))typeof e[s]!="object"&&typeof e[s]!="function"&&(t[s]=e[s]);return JSON.stringify(t)}function LF(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=kF(e)),t}function ll(e){return e===void 0?"undefined":e===null?"null":e}function eu(e,t){return`${e}?${t.toString()}`}function GF(e,t,s){const i=Array.from(t.entries()).sort((o,n)=>n[1].length-o[1].length);let r=eu(e,t);for(const[o,n]of i){if(o===Gm)continue;const a=r.length-s;if(a<=0)break;const l="...",c=a+l.length,d=n.length-c>Lm?n.slice(0,n.length-c)+l:n.slice(0,Lm)+l;t.set(o,d),r=eu(e,t)}return r}function Bm(e,t){const s=new URLSearchParams;if(s.append(Gm,H),t)for(const o of Object.keys(t))s.append(o,LF(t[o]));const i=`${io}/errors/${e}`,r=eu(i,s);return r.length<=km?r:GF(i,s,km)}var OF=(e,t,s)=>{const i=Bm(e,t),r=`${s?s+` `:""}Visit ${i}`;return Jd()?r:`${r}${s?"":` Alternatively register the ValidationModule to see the full message in the console.`}`};function F(...e){al(ss,e[0],e[1],!0)}function Q(...e){al(eo,e[0],e[1],!1)}function wn(e,t,s){al(eo,e,t,!1,s)}function Nm(e,t,s){al(ss,e,t,!0,s)}function Hm(e,t){const s=t[0];return`error #${s} `+Vm(s,t[1],e).join(" ")}function Ft(...e){return Hm(void 0,e)}function cl(...e){return Hm(` `,e)}function zm(e,t){return e.get("rowModelType")===t}function ae(e,t){return zm(e,"clientSide")}function ft(e,t){return zm(e,"serverSide")}function je(e,t){return e.get("domLayout")===t}function Lt(e){return wr(e)!==void 0}function dl(e){return typeof e.get("getRowHeight")=="function"}function VF(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function si({gos:e,formula:t}){const s=e.get("rowNumbers");return s||!!t?.active&&s!==!1}function Ze(e,t,s=!1,i){const{gos:r,environment:o}=e;if(i==null&&(i=o.getDefaultRowHeight()),dl(r)){if(s)return{height:i,estimated:!0};const l={node:t,data:t.data},c=r.getCallback("getRowHeight")(l);if(tu(c))return c===0&&F(23),{height:Math.max(1,c),estimated:!1}}if(t.detail&&r.get("masterDetail"))return BF(r);const n=r.get("rowHeight");return{height:n&&tu(n)?n:i,estimated:!1}}function BF(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return tu(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function Et(e){const{environment:t,gos:s}=e,i=s.get("rowHeight");if(!i||ne(i))return t.getDefaultRowHeight();const r=t.refreshRowHeightVariable();return r!==-1?r:(F(24),t.getDefaultRowHeight())}function tu(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function _m(e,t,s){const i=t[e.getDomDataKey()];return i?i[s]:void 0}function mr(e,t,s,i){const r=e.getDomDataKey();let o=t[r];ne(o)&&(o={},t[r]=o),o[s]=i}function Cr(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function bn(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||je(e,"print"))}function ws(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function xi(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function Ri(e){return e.get("grandTotalRow")}function vr(e){const t=e.get("groupTotalRow");return typeof t=="function"?e.getCallback("groupTotalRow"):()=>t??void 0}function Sn(e){return e.get("groupHideOpenParents")?!0:e.get("groupDisplayType")==="multipleColumns"}function su(e){return Sn(e)&&e.get("groupHideColumnsUntilExpanded")&&ae(e)}function ul(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function hl(e,t,s){return!!t.group&&!t.footer&&ul(e,s)}function Is(e){const t=e.getCallback("getRowId");return t===void 0?t:s=>{let i=t(s);return typeof i!="string"&&(Jr(()=>F(25,{id:i}),"getRowIdString"),i=String(i)),i}}function Wm(e,t){const s=e.get("groupHideParentOfSingleChild");return!!(s===!0||s==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function iu(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function ru(e,t){const s=e.get("suppressGroupChangesColumnVisibility");if(s===!0||t&&s==="suppressHideOnGroup"||!t&&s==="suppressShowOnUngroup")return!1;const i=e.get("suppressRowGroupHidesColumns");if(t&&i===!0)return!1;const r=e.get("suppressMakeColumnVisibleAfterUnGroup");return!(!t&&r===!0)}function Fi(e){return e?.checkboxes??!0}function yn(e){return e?.mode==="multiRow"&&(e.headerCheckbox??!0)}function ro(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function ou(e){return e?.hideDisabledCheckboxes??!1}function gl(e){return typeof e.get("rowSelection")!="string"}function Um(e){return e.get("cellSelection")!==void 0}function $m(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t?.suppressMultiRanges??!1:!1:e.get("suppressMultiRangeSelection")}function mt(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function pl(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"&&t.handle?.mode==="fill"?t.handle:void 0:{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}}function Ei(e){const t=e.get("cellSelection")??!1;return(typeof t=="object"&&t.enableColumnSelection)??!1}function Km(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const s=e.get("suppressRowClickSelection"),i=e.get("suppressRowDeselection");return s&&i?!1:s?"enableDeselection":i?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function NF(e){const t=Km(e);return t===!0||t==="enableSelection"}function HF(e){const t=Km(e);return t===!0||t==="enableDeselection"}function fl(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t?.isRowSelectable}function wr(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t?.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function ks(e){return wr(e)==="multiRow"}function zF(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):t?.enableSelectionWithoutKeys??!1}function xn(e){const t=e.get("rowSelection");if(typeof t=="string"){const s=e.get("groupSelectsChildren"),i=e.get("groupSelectsFiltered");return s&&i?"filteredDescendants":s?"descendants":"self"}return t?.mode==="multiRow"?t.groupSelects:void 0}function jm(e,t=!0){const s=e.get("rowSelection");return typeof s!="object"?t?"all":void 0:s.mode==="multiRow"?s.selectAll:"all"}function _F(e){const t=e.get("rowSelection");return typeof t=="string"?!1:t?.mode==="multiRow"?t.ctrlASelectsRows??!1:!1}function Pi(e){const t=xn(e);return t==="descendants"||t==="filteredDescendants"}function qm(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function nu(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function He(e){return e.get("columnMenu")==="legacy"}function au(e){return!He(e)}function Ym(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function WF(e,t,s){typeof e!="object"&&(e={});const i={...e};for(const r of s){const o=t[r];typeof o<"u"&&(i[r]=o)}return i}function UF(e,t){if(!e)return;const s={};let i=!1;for(const n of Object.keys(e))s[n]=e[n],i=!0;if(!i)return;const r={type:"gridOptionsChanged",options:s};t.dispatchEvent(r);const o={type:"componentStateChanged",...s};t.dispatchEvent(o)}function N(e,t){return e.addCommon(t)}function $F(e,t){return e[t]??e.gridOptions?.[t]??Xd(t)??xm[t]}function ml({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var KF={resizable:!0,sortable:!0},jF=0;function Xm(){return jF++}function bs(e){return e instanceof is}var qF=["asc","desc",null],YF=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],is=class extends E{constructor(e,t,s,i){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=s,this.primary=i,this.isColumn=!0,this.instanceId=Xm(),this.autoHeaderHeight=null,this.sortDef=Ut(),this._wasSortExplicitlyRemoved=!1,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.formulaRef=null,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new As,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=pt(s)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:s,colFlex:i}}=this;t?.initCol(this);const r=e.hide;r!==void 0?this.visible=!r:this.visible=!e.initialHide,s?.initCol(this),i?.initCol(this)}setColDef(e,t,s){const i=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),i&&(this.beans.rowSpanSvc?.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",s)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.initState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){const{gos:e,colDef:{field:t,tooltipField:s}}=this,i=e.get("suppressFieldDotNotation");this.fieldContainsDots=D(t)&&t.includes(".")&&!i,this.tooltipFieldContainsDots=D(s)&&s.includes(".")&&!i}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}initRowSpan(){this.colDef.spanRows&&this.beans.rowSpanSvc?.register(this)}addPivotListener(){const e=this.beans.pivotColDefSvc,t=this.colDef.pivotValueColumn;!e||!t||this.addManagedListeners(t,{colDefChanged:s=>{const i=e.recreateColDef(this.colDef);this.setColDef(i,i,s.source)}})}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){const t=e.width??e.initialWidth??200;return Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,e)??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}__addEventListener(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.colEventSvc);const s=this.frameworkEventListenerService?.wrap(e,t)??t;this.colEventSvc.addEventListener(e,s)}removeEventListener(e,t){const s=this.frameworkEventListenerService?.unwrap(e,t)??t;this.colEventSvc.removeEventListener(e,s)}createColumnFunctionCallbackParams(e){return N(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){return this.beans.cellNavigation?.isSuppressNavigable(this,e)??!1}isCellEditable(e){return this.beans.editSvc?.isCellEditable({rowNode:e,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.beans.selectionSvc?.isCellCheckboxSelection(this,e)??!1}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?.suppressPaste??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??KF[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const s=this.createColumnFunctionCallbackParams(e);return t(s)}return!1}createColumnEvent(e,t){return N(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sortDef.direction}getSortDef(){return this.sortDef.direction?this.sortDef:null}getColDefAllowedSortTypes(){const e=[],{sort:t,initialSort:s}=this.colDef,i=t===null?t:rs(t?.type),r=s===null?s:rs(s?.type);return i&&e.push(i),r&&e.push(r),e}getSortingOrder(){const e=this.getColDefAllowedSortTypes().includes("absolute")?YF:qF;return(this.colDef.sortingOrder??this.gos.get("sortingOrder")??e).map(t=>Ut(t))}getAvailableSortTypes(){const e=this.getSortingOrder().reduce((t,s)=>(s.direction&&t.push(s.type),t),this.getColDefAllowedSortTypes());return new Set(e)}get wasSortExplicitlyRemoved(){return this._wasSortExplicitlyRemoved}setSortDef(e,t=!1){t||(this._wasSortExplicitlyRemoved=!e.direction),this.sortDef=e}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.getSort()==="asc"}isSortDescending(){return this.getSort()==="desc"}isSortNone(){return ne(this.getSort())}isSorting(){return D(this.getSort())}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){return F(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const s=e===!0;this.visible!==s&&(this.visible=s,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getFirstRealParent(){let e=this.getOriginalParent();for(;e?.isPadding();)e=e.getOriginalParent();return e}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e?.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let s=!0;for(;e;){if(!e.isPadding()){s=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:s}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return N(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(ne(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),s=this.colDef.colSpan(t);return Math.max(s,1)}getRowSpan(e){if(ne(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),s=this.colDef.rowSpan(t);return Math.max(s,1)}setActualWidth(e,t,s=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),s||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}isAllowFormula(){return this.colDef.allowFormula===!0}dispatchColEvent(e,t,s){const i=this.createColumnEvent(e,t);s&&Oe(i,s),this.colEventSvc.dispatchEvent(i)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function Ut(e){return oo(e)?{direction:e.direction,type:e.type}:{direction:Fn(e),type:rs(e)}}function ii(e){return e==="asc"||e==="desc"||e===null}function Cl(e){return e==="default"||e==="absolute"}function oo(e){if(!e||typeof e!="object")return!1;const t=e;return Cl(t.type)&&ii(t.direction)}function Rn(e,t){return e?t?e.type===t.type&&e.direction===t.direction:e?e.direction===null:!0:t?t.direction===null:!0}function Fn(e){return ii(e)?e:null}function rs(e){return Cl(e)?e:"default"}function lu(e,t,s){const r=s?.()??t.sortSvc.getDisplaySortForColumn(e),o=rs(r?.type),n=Fn(r?.direction),a=e.getAvailableSortTypes(),l=a.has("default"),c=a.has("absolute");return{isDefaultSortAllowed:l,isAbsoluteSortAllowed:c,isAbsoluteSort:o==="absolute",isDefaultSort:o==="default",isAscending:n==="asc",isDescending:n==="desc",direction:n}}function Re(e){return e instanceof br}var br=class extends E{constructor(e,t,s,i){super(),this.colGroupDef=e,this.groupId=t,this.padding=s,this.level=i,this.isColumn=!1,this.expandable=!1,this.instanceId=Xm(),this.expandableListenerRemoveCallback=null,this.expanded=!!e?.openByDefault}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}forEachLeafColumn(e){if(this.children)for(const t of this.children)bs(t)?e(t):Re(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)bs(t)?e.push(t):Re(t)&&t.addLeafColumns(e)}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);for(const t of this.getLeafColumns())t.__addEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=()=>{for(const t of this.getLeafColumns())t.__removeEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,s=!1;const i=this.findChildrenRemovingPadding();for(let o=0,n=i.length;o{for(const i of s)Re(i)&&i.isPadding()?t(i.children):e.push(i)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},XF={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function cu(e,t,s){const i={},r=e.gos;return Object.assign(i,r.get("defaultColGroupDef")),Object.assign(i,t),r.validateColDef(i,s),i}var Zm=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t0&&F(273,{providedId:e,usedId:r}),this.existingKeys[r]=!0,r}s++}}},Qm=(e,t)=>{Re(e)&&e.setupExpandable(),e.originalParent=t};function Jm(e,t=null,s,i,r){const{existingCols:o,existingGroups:n}=eC(i),a=new Map(o.map(f=>[f.getId(),f])),l=new Map(n.map(f=>[f.getId(),f]));let c=0;const d=(f,m)=>{if(c=Math.max(c,m),iC(f)){if(!e.colGroupSvc)return null;const S=f.groupId,y=l.get(S),R=cu(e,f,S),P=new br(R,S,!1,m);return e.context.createBean(P),y&&P.setExpanded(y.isExpanded()),P.setChildren(f.children.map(M=>d(M,m+1))),P}const C=f.colId;let v=a.get(C);const w=Mi(e,f,v?.getColId()??C);return v?(v.setColDef(w,f,r),uu(e,v,w,r)):(v=new is(w,f,C,s),e.context.createBean(v)),e.dataTypeSvc?.addColumnListeners(v),v},u=t?.map(f=>d(f,0))??[];let h=0;const g={getUniqueKey:(f,m)=>String(++h)},p=e.colGroupSvc?e.colGroupSvc.balanceColumnTree(u,0,c,g):u;return Ls(null,p,Qm),{columnTree:p,treeDepth:c}}function du(e,t=null,s,i,r){const o=new Zm,{existingCols:n,existingGroups:a,existingColKeys:l}=eC(i);o.addExistingKeys(l);const c=tC(e,t,0,s,n,o,a,r),{colGroupSvc:d}=e,u=d?.findMaxDepth(c,0)??0,h=d?d.balanceColumnTree(c,0,u,o):c;return Ls(null,h,Qm),{columnTree:h,treeDepth:u}}function eC(e){const t=[],s=[],i=[];return e&&Ls(null,e,r=>{if(Re(r)){const o=r;s.push(o)}else{const o=r;i.push(o.getId()),t.push(o)}}),{existingCols:t,existingGroups:s,existingColKeys:i}}function tC(e,t,s,i,r,o,n,a){if(!t)return[];const{colGroupSvc:l}=e,c=new Array(t.length);for(let d=0;d0))if(s.width!=null)t.setActualWidth(s.width,i);else{const o=t.getActualWidth();t.setActualWidth(o,i)}}function QF(e,t){if(t)for(let s=0;s{for(let r=0;rt+s.getActualWidth(),0)}function os(e,t,s){const i={};if(!t)return;Ls(null,t,o=>{i[o.getInstanceId()]=o}),s&&Ls(null,s,o=>{i[o.getInstanceId()]=null});const r=Object.values(i).filter(o=>o!=null);e.context.destroyBeans(r)}function Sr(e){return e.getId().startsWith($t)}function Gs(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(vl)??!1}function Fe(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(En)??!1}function yr(e){return Gs(e)||Fe(e)}function bl(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function Pn(e,t){return be(e,t,(s,i)=>s.getColId()===i.getColId())}function Mn(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function Os(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function oi(e,t){return e===t||e.colId==t||e.getColDef()===t}var tE=(e,t)=>(s,i)=>{const r={value1:void 0,value2:void 0};let o=!1;return e&&(e[s]!==void 0&&(r.value1=e[s],o=!0),D(i)&&e[i]!==void 0&&(r.value2=e[i],o=!0)),!o&&t&&(t[s]!==void 0&&(r.value1=t[s]),D(i)&&t[i]!==void 0&&(r.value2=t[i])),r};function Sl(e,t){const s={...e,sort:void 0,colId:t},i=hu(e);return i&&(s.sort=i.direction,s.sortType=i.type),s}function hu(e){const{sort:t,initialSort:s}=e,i=oo(t)||ii(t),r=oo(s)||ii(s);return i?Ut(t):r?Ut(s):null}function oC(e,t){return e+"_"+t}function Le(e){return e instanceof no}var no=class extends E{constructor(e,t,s,i){super(),this.providedColumnGroup=e,this.groupId=t,this.partId=s,this.pinned=i,this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.colIdSanitised=pt(this.getUniqueId())}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}getUniqueId(){return oC(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){for(const e of this.displayedChildren)Le(e)&&e.checkLeft();if(this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=W(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;for(const t of this.displayedChildren??[])e+=t.getActualWidth();return e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;for(const t of this.displayedChildren)t.isResizable()&&(e=!0);return e}getMinWidth(){let e=0;for(const t of this.displayedChildren)e+=t.getMinWidth();return e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}isAutoHeaderHeight(){return!!this.getColGroupDef()?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}addDisplayedLeafColumns(e){for(const t of this.displayedChildren??[])bs(t)?e.push(t):Le(t)&&t.addDisplayedLeafColumns(e)}addLeafColumns(e){for(const t of this.children??[])bs(t)?e.push(t):Le(t)&&t.addLeafColumns(e)}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return!this.isPadding()||!e?.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e?.isPadding();)e=e.getParent();if(!(e?e.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}for(const s of this.children??[]){if(Le(s)&&!s.displayedChildren?.length)continue;switch(s.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(s);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(s);break;default:this.displayedChildren.push(s);break}}this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},b={BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:" ",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",DELETE:"Delete",F2:"F2",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",PAGE_HOME:"Home",PAGE_END:"End",A:"KeyA",C:"KeyC",D:"KeyD",V:"KeyV",X:"KeyX",Y:"KeyY",Z:"KeyZ"},sE=65,iE=67,rE=86,oE=68,nE=90,aE=89;function nC(e){const{keyCode:t}=e;let s;switch(t){case sE:s=b.A;break;case iE:s=b.C;break;case rE:s=b.V;break;case oE:s=b.D;break;case nE:s=b.Z;break;case aE:s=b.Y;break;default:s=e.code}return s}function aC(e){return typeof e.then=="function"}function lE(e,t){return new $(s=>{s(window.setInterval(e,t))})}var $=class Ha{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(s=>this.onDone(s),s=>this.onReject(s))}static all(t){return t.length?new Ha(s=>{let i=t.length;const r=new Array(i);t.forEach((o,n)=>{o.then(a=>{r[n]=a,i--,i===0&&s(r)})})}):Ha.resolve()}static resolve(t=null){return new Ha(s=>s(t))}then(t){return new Ha(s=>{this.status===1?s(t(this.resolution)):this.waiters.push(i=>s(t(i)))})}onDone(t){this.status=1,this.resolution=t;for(const s of this.waiters)s(t)}onReject(t){}},lC=class extends Ke{constructor(){super(...arguments),this.beanName="dragAndDrop",this.dragSourceAndParamsList=[],this.dragItem=null,this.dragInitialSourcePointerOffsetX=0,this.dragInitialSourcePointerOffsetY=0,this.lastMouseEvent=null,this.lastDraggingEvent=null,this.dragSource=null,this.dragImageCompPromise=null,this.dragImageComp=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0,this.dropTargets=[],this.externalDropZoneCount=0,this.lastDropTarget=null}addDragSource(e,t=!1){const s={capturePointer:!0,dragSource:e,eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:i=>this.onDragStart(e,i),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push(s),this.beans.dragSvc.addDragSource(s)}setDragImageCompIcon(e,t=!1){const s=this.dragImageComp;s&&(t||this.dragImageLastIcon!==e)&&(this.dragImageLastIcon=e,s.setIcon(e,t))}removeDragSource(e){const{dragSourceAndParamsList:t,beans:s}=this;for(let i=0,r=t.length;i{for(const c of l){const{width:d,height:u,left:h,right:g,top:p,bottom:f}=c.getBoundingClientRect();if(d===0||u===0)return!1;const m=a.clientX>=h&&a.clientX=p&&a.clientY0}findExternalZone(e){const t=this.dropTargets;for(let s=0,i=t.length;s0?"down":p<0?"up":null,hDirection:g<0?"left":g>0?"right":null,initialSourcePointerOffsetX:a,initialSourcePointerOffsetY:l,dragSource:i,fromNudge:s,dragItem:r,dropZoneTarget:c,dropTarget:o?.dropTarget??null,changed:!!o?.changed});return this.lastDraggingEvent=f,f}positionDragImageComp(e){const t=this.dragImageComp?.getGui();t&&tl(t,e,this.beans)}removeDragImageComp(e){this.dragImageComp===e&&(this.dragImageComp=null),e&&(e.getGui()?.remove(),this.destroyBean(e))}createAndUpdateDragImageComp(e){const t=this.createDragImageComp(e)??null;this.dragImageCompPromise=t,t?.then(s=>{const i=this.lastMouseEvent;if(t!==this.dragImageCompPromise||!i||!this.isAlive()){this.destroyBean(s);return}this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0;const r=this.dragImageComp;r!==s&&(this.dragImageComp=s,this.removeDragImageComp(r)),s&&(this.appendDragImageComp(s),this.updateDragImageComp(),this.positionDragImageComp(i))})}appendDragImageComp(e){const t=e.getGui(),s=t.style;s.position="absolute",s.zIndex="9999",this.beans.dragSvc?.hasPointerCapture()&&(s.pointerEvents="none"),this.gos.setInstanceDomData(t),this.beans.environment.applyThemeClasses(t),s.top="20px",s.left="20px";const i=cr(this.beans);i?i.appendChild(t):this.warnNoBody()}updateDragImageComp(){const{dragImageComp:e,dragSource:t,lastDropTarget:s,lastDraggingEvent:i,dragImageLastLabel:r}=this;if(!e)return;this.setDragImageCompIcon(s?.getIconName?.(i)??null);let o=t?.dragItemName;typeof o=="function"&&(o=o(i)),o||(o=""),r!==o&&(this.dragImageLastLabel=o,e.setLabel(o))}};function cC(e){return typeof e=="object"&&!!e.component}function cE(e){return e?e.prototype&&"getGui"in e.prototype:!1}function dC(e,t,s,i){const{name:r}=s;let o,n,a,l,c,d;if(t){const u=t,h=u[r+"Selector"],g=h?h(i):null,p=f=>{typeof f=="string"?o=f:f!=null&&f!==!0&&(e.isFrameworkComponent(f)?a=f:n=f)};g?(p(g.component),l=g.params,c=g.popup,d=g.popupPosition):p(u[r])}return{compName:o,jsComp:n,fwComp:a,paramsFromSelector:l,popupFromSelector:c,popupPositionFromSelector:d}}var dE=class extends E{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,s,i=!1){return this.getCompDetails(this.gridOptions,e,t,s,i)}getCompDetails(e,t,s,i,r=!1){const{name:o,cellRenderer:n}=t;let{compName:a,jsComp:l,fwComp:c,paramsFromSelector:d,popupFromSelector:u,popupPositionFromSelector:h}=dC(this.beans.frameworkOverrides,e,t,i),g,p;const f=w=>{const S=this.registry.getUserComponent(o,w);S&&(l=S.componentFromFramework?void 0:S.component,c=S.componentFromFramework?S.component:void 0,g=S.params,p=S.processParams)};if(a!=null&&f(a),l==null&&c==null&&s!=null&&f(s),l&&n&&!cE(l)&&(l=this.agCompUtils?.adaptFunction(t,l)),!l&&!c){const{validation:w}=this.beans;r&&(a!==s||!s)?a?w?.isProvidedUserComp(a)||Q(50,{compName:a}):s?w||Q(260,{...this.gos.getModuleErrorParams(),propName:o,compName:s}):Q(216,{name:o}):s&&!w&&Q(146,{comp:s});return}const m=this.mergeParams(e,t,i,d,g,p),C=l==null,v=l??c;return{componentFromFramework:C,componentClass:v,params:m,type:t,popupFromSelector:u,popupPositionFromSelector:h,newAgStackInstance:()=>this.newAgStackInstance(v,C,m,t)}}newAgStackInstance(e,t,s,i){const r=!t;let o;r?o=new e:o=this.frameworkCompWrapper.wrap(e,i.mandatoryMethods,i.optionalMethods,i),this.createBean(o);const n=o.init?.(s);return n==null?$.resolve(o):n.then(()=>o)}mergeParams(e,t,s,i=null,r,o){const n={...s,...r},l=e?.[t.name+"Params"];if(typeof l=="function"){const c=l(s);Oe(n,c)}else typeof l=="object"&&Oe(n,l);return Oe(n,i),o?o(n):n}},uE={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},hE={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},gE={name:"headerComponent",optionalMethods:["refresh"]},pE={name:"innerHeaderComponent"},fE={name:"innerHeaderGroupComponent"},mE={name:"headerGroupComponent"},CE={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},vE={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},wE={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"]},bE={name:"loadingCellRenderer",cellRenderer:!0},SE={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},yE={name:"tooltipComponent"},gu={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},xE={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},RE={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},FE={name:"loadingCellRenderer",cellRenderer:!0},EE={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},PE={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function ME(e,t){return e.getCompDetailsFromGridOptions(hE,"agDragAndDropImage",t,!0)}function Tn(e,t,s){return e.getCompDetails(t,CE,void 0,s)}function TE(e,t,s){return e.getCompDetails(t,gE,"agColumnHeader",s)}function DE(e,t,s){return e.getCompDetails(t,pE,void 0,s)}function AE(e,t){const s=t.columnGroup.getColGroupDef();return e.getCompDetails(s,mE,"agColumnGroupHeader",t)}function IE(e,t,s){return e.getCompDetails(t,fE,void 0,s)}function kE(e,t){return e.getCompDetailsFromGridOptions(RE,void 0,t,!0)}function LE(e,t){return e.getCompDetailsFromGridOptions(FE,"agLoadingCellRenderer",t,!0)}function GE(e,t){return e.getCompDetailsFromGridOptions(EE,"agGroupRowRenderer",t,!0)}function OE(e,t){return e.getCompDetailsFromGridOptions(PE,"agDetailCellRenderer",t,!0)}function xr(e,t,s){return e.getCompDetails(t,vE,void 0,s)}function pu(e,t,s){return e.getCompDetails(t,wE,void 0,s)}function uC(e,t,s){return e.getCompDetails(t,bE,"agSkeletonCellRenderer",s,!0)}function hC(e,t,s){return e.getCompDetails(t,SE,"agCellEditor",s,!0)}function fu(e,t,s,i){const r=t.filter;return cC(r)&&(t={filter:r.component,filterParams:t.filterParams}),e.getCompDetails(t,gu,i,s,!0)}function VE(e,t,s){return e.getCompDetails(t,uE,"agDateInput",s,!0)}function BE(e,t){return e.getCompDetails(t.colDef,yE,"agTooltipComponent",t,!0)}function mu(e,t,s,i){return e.getCompDetails(t,xE,i,s)}function gC(e,t){return dC(e,t,gu)}function Cu(e,t,s){return e.mergeParams(t,gu,s)}var ns=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(ns||{}),NE=class extends lC{createEvent(e){return N(this.gos,e)}createDragImageComp(e){const{gos:t,beans:s}=this;return ME(s.userCompFactory,N(t,{dragSource:e}))?.newAgStackInstance()}handleEnter(e,t){e?.onGridEnter?.(t)}handleExit(e,t){e?.onGridExit?.(t)}warnNoBody(){F(54)}isDropZoneWithinThisGrid(e){return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(e.dropZoneTarget)}registerGridDropTarget(e,t){const s={getContainer:e,isInterestedIn:i=>i===1||i===0,getIconName:()=>"notAllowed"};this.addDropTarget(s),t.addDestroyFunc(()=>this.removeDropTarget(s))}};function vu(e){return!!e.operator}var pC="ag-resizer-wrapper",Ti=(e,t)=>({tag:"div",ref:`${e}Resizer`,cls:`ag-resizer ag-resizer-${t}`}),HE={tag:"div",cls:pC,children:[Ti("eTopLeft","topLeft"),Ti("eTop","top"),Ti("eTopRight","topRight"),Ti("eRight","right"),Ti("eBottomRight","bottomRight"),Ti("eBottom","bottom"),Ti("eBottomLeft","bottomLeft"),Ti("eLeft","left")]},wu=class extends Ke{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config={popup:!1,...t}}wireBeans(e){this.popupSvc=e.popupSvc,this.dragSvc=e.dragSvc}center(e){const{clientHeight:t,clientWidth:s}=this.offsetParent,i=s/2-this.getWidth()/2,r=t/2-this.getHeight()/2;this.offsetElement(i,r,e)}initialisePosition(e){if(this.positioned)return;const{centered:t,forcePopupParentAsOffsetParent:s,minWidth:i,width:r,minHeight:o,height:n,x:a,y:l}=this.config;this.offsetParent||this.setOffsetParent();let c=0,d=0;const u=Ne(this.element);if(u){const h=this.findBoundaryElement(),g=window.getComputedStyle(h);if(g.minWidth!=null){const p=h.offsetWidth-this.element.offsetWidth;d=Number.parseInt(g.minWidth,10)-p}if(g.minHeight!=null){const p=h.offsetHeight-this.element.offsetHeight;c=Number.parseInt(g.minHeight,10)-p}}if(this.minHeight=o||c,this.minWidth=i||d,r&&this.setWidth(r),n&&this.setHeight(n),(!r||!n)&&this.refreshSize(),t)this.center(e);else if(a||l)this.offsetElement(a,l,e);else if(u&&s){let h=this.boundaryEl,g=!0;if(h||(h=this.findBoundaryElement(),g=!1),h){const p=Number.parseFloat(h.style.top),f=Number.parseFloat(h.style.left);g?this.offsetElement(Number.isNaN(f)?0:f,Number.isNaN(p)?0:p,e):this.setPosition(f,p)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const s=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragSvc?.addDragSource(s),this.moveElementDragListener=s):(this.dragSvc?.removeDragSource(s),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),typeof e=="boolean"){if(e===!1)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}for(const t of Object.keys(e)){const s=!!e[t],i=this.getResizerElement(t),r={dragStartPixels:0,eElement:i,onDragStart:o=>this.onResizeStart(o,t),onDragging:this.onResize.bind(this),onDragStop:o=>this.onResizeEnd(o,t)};(s||!this.isAlive()&&!s)&&(s?(this.dragSvc?.addDragSource(r),this.resizeListeners.push(r),i.style.pointerEvents="all"):i.style.pointerEvents="none",this.resizable[t]=s)}}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;t!==-1&&(this.element.style.width=`${t}px`),e!==-1&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,s=this.element;let i=!1;if(typeof e=="string"&&e.includes("%"))pn(s,e),e=hn(s),i=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const r=this.getAvailableHeight();r&&e>r&&(e=r)}this.getHeight()!==e&&(i?(s.style.maxHeight="unset",s.style.minHeight="unset"):t?pn(s,e):(s.style.height=`${e}px`,s.style.flex="0 0 auto",this.lastSize.height=typeof e=="number"?e:Number.parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:s}=this.offsetParent;if(!s)return null;const i=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),o=e?this.position.y:i.top,n=e?0:r.top;let a=0;if(t){const c=this.element.parentElement;if(c){const{bottom:d}=c.getBoundingClientRect();a=d-i.bottom}}return s+n-o-a}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:s}=this.config;let i=!1;if(typeof e=="string"&&e.includes("%"))ts(t,e),e=bi(t),i=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:r}=this.offsetParent,o=s?this.position.x:this.element.getBoundingClientRect().left;r&&e+o>r&&(e=r-o)}this.getWidth()!==e&&(i?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?ts(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width=typeof e=="number"?e:Number.parseFloat(e)))}offsetElement(e=0,t=0,s){const{forcePopupParentAsOffsetParent:i}=this.config,r=i?this.boundaryEl:this.element;r&&(this.popupSvc?.positionPopup({ePopup:r,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t}),postProcessCallback:s}),this.setPosition(Number.parseFloat(r.style.left),Number.parseFloat(r.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const s=this.getAvailableHeight();this.element.style.setProperty("max-height",`${s}px`)};e&&this.popupSvc?(this.resizeObserverSubscriber?.(),this.resizeObserverSubscriber=vs(this.beans,this.popupSvc?.getPopupParent(),t)):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:s,isTop:i,anywhereWithin:r,topBuffer:o}=e,n=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y,l=this.shouldSkipX(t,!!s,!!r,n)?0:n,c=this.shouldSkipY(t,!!i,o,a)?0:a;return{movementX:l,movementY:c}}shouldSkipX(e,t,s,i){const r=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:r.left;let l=a<=0&&o.left>=e.clientX||o.right<=e.clientX&&o.right<=n.right;return l?!0:(t?l=i<0&&e.clientX>a+o.left||i>0&&e.clientXn.right||i>0&&e.clientXn.right||i>0&&e.clientX=e.clientY||o.bottom<=e.clientY&&o.bottom<=n.bottom;return l?!0:(t?l=i<0&&e.clientY>a+o.top+s||i>0&&e.clientYn.bottom||i>0&&e.clientY({element:this.element.querySelector(`[data-ref=${t}Resizer]`)});this.resizerMap={topLeft:e("eTopLeft"),top:e("eTop"),topRight:e("eTopRight"),right:e("eRight"),bottomRight:e("eBottomRight"),bottom:e("eBottom"),bottomLeft:e("eBottomLeft"),left:e("eLeft")}}addResizers(){if(this.resizersAdded)return;const e=this.element;e&&(e.appendChild($e(HE)),this.createResizeMap(),this.resizersAdded=!0)}removeResizers(){this.resizerMap=void 0,this.element.querySelector(`.${pC}`)?.remove(),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:s,forcePopupParentAsOffsetParent:i}=this.config;!s&&!i&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const t=this.element.parentElement;return t?Array.prototype.slice.call(t.children).filter(s=>!s.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,s=0;for(const i of e){const r=!!i.style.flex&&i.style.flex!=="0 0 auto";if(i===this.element)continue;let o=this.minHeight||0,n=this.minWidth||0;if(r){const a=window.getComputedStyle(i);a.minHeight&&(o=Number.parseInt(a.minHeight,10)),a.minWidth&&(n=Number.parseInt(a.minWidth,10))}else o=i.offsetHeight,n=i.offsetWidth;t+=o,s+=n}return{height:t,width:s}}applySizeToSiblings(e){let t=null;const s=this.getSiblings();if(s){for(let i=0;ie)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:s}=this.config,{isTop:i,isRight:r,isBottom:o,isLeft:n}=this.currentResizer,a=r||n,l=o||i,{movementX:c,movementY:d}=this.calculateMouseMovement({e,isLeft:n,isTop:i}),u=this.position.x,h=this.position.y;let g=0,p=0;if(a&&c){const f=n?-1:1,m=this.getWidth(),C=m+c*f;let v=!1;n&&(g=m-C,(u+g<=0||C<=this.minWidth)&&(v=!0,g=0)),v||this.setWidth(C)}if(l&&d){const f=i?-1:1,m=this.getHeight(),C=m+d*f;let v=!1;i?(p=m-C,(h+p<=0||C<=this.minHeight)&&(v=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&mthis.element.parentElement.offsetHeight&&(v=!0),v||this.setHeight(C)}this.updateDragStartPosition(e.clientX,e.clientY),((t||s)&&g||p)&&this.offsetElement(u+g,h+p)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:s}=this.position;let i;this.config.calculateTopBuffer&&(i=this.config.calculateTopBuffer());const{movementX:r,movementY:o}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:i});this.offsetElement(t+r,s+o),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent&&this.popupSvc?this.offsetParent=this.popupSvc.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragSvc?.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragSvc?.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},yl=class extends wu{},x=null;function ao(e){return typeof e?.getGui=="function"}var bu=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){if(!e)return;if(e.includes(" ")){const i=(e||"").split(" ");if(i.length>1){for(const r of i)this.toggleCss(r,t);return}}this.cssClassStates[e]!==t&&e.length&&(this.getGui()?.classList.toggle(e,t),this.cssClassStates[e]=t)}},zE=0,Pt=class extends Ke{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=zE++,this.cssManager=new bu(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(s=>[s.selector,s])),e&&this.setTemplate(e)}preConstruct(){this.wireTemplate(this.getGui()),this.addGlobalCss()}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute(fm):null}applyElementsToComponent(e,t,s,i=null){if(t===void 0&&(t=this.getDataRefAttribute(e)),t){const r=this[t];if(r===x)this[t]=i??e;else{const o=s?.[t];if(!this.suppressDataRefValidation&&!o)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${r}`)}}}createChildComponentsFromTags(e,t){const s=[];for(const i of e.childNodes??[])s.push(i);for(const i of s){if(!(i instanceof HTMLElement))continue;const r=this.createComponentFromElement(i,o=>{const n=o.getGui();if(n)for(const a of i.attributes??[])n.setAttribute(a.name,a.value)},t);if(r){if(r.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);const o=Array.prototype.slice.call(i.children);r.addItems(o)}this.swapComponentForNode(r,e,i)}else i.childNodes&&this.createChildComponentsFromTags(i,t)}}createComponentFromElement(e,t,s){const i=e.nodeName,r=this.getDataRefAttribute(e),o=i.indexOf("AG-")===0,n=o?this.componentSelectors.get(i):null;let a=null;if(n){const l=s&&r?s[r]:void 0;a=new n.component(l),a.setParentComponent(this),this.createBean(a,null,t)}else if(o)throw new Error(`selector: ${i}`);return this.applyElementsToComponent(e,r,s,a),a}swapComponentForNode(e,t,s){const i=e.getGui();t.replaceChild(i,s),t.insertBefore(document.createComment(s.nodeName),i),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e,t){const s=t??this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const i of e)i.setAttribute("tabindex",s.toString())}setTemplate(e,t,s){let i;typeof e=="string"||e==null?i=Xa(e):i=$e(e),this.setTemplateFromElement(i,t,s)}setTemplateFromElement(e,t,s,i=!1){if(this.eGui=e,this.suppressDataRefValidation=i,t)for(let r=0;rthis.eGui.removeEventListener(e,t))}addCss(e){this.cssManager.toggleCss(e,!0)}removeCss(e){this.cssManager.toggleCss(e,!1)}toggleCss(e,t){this.cssManager.toggleCss(e,t)}registerCSS(e){this.css===fC?(this.css=[e],this.addGlobalCss()):(this.css||(this.css=[]),this.css.push(e))}addGlobalCss(){if(Array.isArray(this.css)){const e="component-"+Object.getPrototypeOf(this)?.constructor?.name;for(const t of this.css??[])this.beans.environment.addGlobalCSS(t,e)}this.css=fC}},fC=Symbol(),A=class extends Pt{},Su,yu,xu,Ru,Fu,Eu,Pu;function Ss(){return Su===void 0&&(Su=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),Su}function Di(){return yu===void 0&&(yu=/(firefox)/i.test(navigator.userAgent)),yu}function mC(){return xu===void 0&&(xu=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),xu}function ni(){return Ru===void 0&&(Ru=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),Ru}function Mu(e){if(!e)return null;const t=e.tabIndex,s=e.getAttribute("tabIndex");return t===-1&&(s===null||s===""&&!Di())?null:t.toString()}function _E(){if(Pu!==void 0)return Pu;if(!document.body)return-1;let e=1e6;const t=Di()?6e6:1e9,s=document.createElement("div");for(document.body.appendChild(s);;){const i=e*2;if(s.style.height=i+"px",i>t||s.clientHeight!==i)break;e=i}return s.remove(),Pu=e,e}function Tu(){return Eu==null&&CC(),Eu}function CC(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let s=t.offsetWidth-t.clientWidth;s===0&&t.clientWidth===0&&(s=null),t.parentNode&&t.remove(),s!=null&&(Eu=s,Fu=s===0)}function vC(){return Fu==null&&CC(),Fu}var Du=!1,xl=0;function WE(e){xl>0||(e.addEventListener("keydown",Rl),e.addEventListener("mousedown",Rl))}function UE(e){xl>0||(e.removeEventListener("keydown",Rl),e.removeEventListener("mousedown",Rl))}function Rl(e){const t=Du,s=e.type==="keydown";s&&(e.ctrlKey||e.metaKey||e.altKey)||t!==s&&(Du=s)}function $E(e){const t=me(e);return WE(t),xl++,()=>{xl--,UE(t)}}function Dn(){return Du}function Kt(e,t,s=!1){const i=cF;let r=cm;t&&(r+=", "+t),s&&(r+=', [tabindex="-1"]');const o=Array.prototype.slice.apply(e.querySelectorAll(i)).filter(l=>Ne(l)),n=Array.prototype.slice.apply(e.querySelectorAll(r));return n.length?((l,c)=>l.filter(d=>c.indexOf(d)===-1))(o,n):o}function Ge(e,t=!1,s=!1,i=!1){const r=Kt(e,i?".ag-tab-guard":null,s),o=t?W(r):r[0];return o?(o.focus({preventScroll:!0}),!0):!1}function Qe(e,t,s,i){const r=Kt(t,s?':not([tabindex="-1"])':null),o=ie(e);let n;s?n=r.findIndex(l=>l.contains(o)):n=r.indexOf(o);const a=n+(i?-1:1);return a<0||a>=r.length?null:r[a]}function Fl(e,t=5){let s=0;for(;e&&Mu(e)===null&&++s<=t;)e=e.parentElement;return Mu(e)===null?null:e}var Au="ag-focus-managed",wC=class extends Ke{constructor(e,t={isStopPropagation:()=>!1,stopPropagation:()=>{}},s={}){super(),this.eFocusable=e,this.stopPropagationCallbacks=t,this.callbacks=s,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:i=>{if(i.defaultPrevented)return;const r=Qe(this.beans,this.eFocusable,!1,i.shiftKey);r&&(r.focus(),i.preventDefault())},...s}}postConstruct(){const{eFocusable:e,callbacks:{onFocusIn:t,onFocusOut:s}}=this;e.classList.add(Au),this.addKeyDownListeners(e),t&&this.addManagedElementListeners(e,{focusin:t}),s&&this.addManagedElementListeners(e,{focusout:s})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:t=>{if(t.defaultPrevented||this.stopPropagationCallbacks.isStopPropagation(t))return;const{callbacks:s}=this;if(s.shouldStopEventPropagation(t)){this.stopPropagationCallbacks.stopPropagation(t);return}t.key===b.TAB?s.onTabKeyDown(t):s.handleKeyDown&&s.handleKeyDown(t)}})}},bC="__ag_Grid_Stop_Propagation";function Ee(e){e[bC]=!0}function Gt(e){return e[bC]===!0}var Ai={isStopPropagation:Gt,stopPropagation:Ee},Ii=class extends wC{constructor(e,t){super(e,Ai,t)}},KE={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",bigintFilter:"BigInt Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd",filterSummaryInactive:"is (All)",filterSummaryContains:"contains",filterSummaryNotContains:"does not contain",filterSummaryTextEquals:"equals",filterSummaryTextNotEqual:"does not equal",filterSummaryStartsWith:"begins with",filterSummaryEndsWith:"ends with",filterSummaryBlank:"is blank",filterSummaryNotBlank:"is not blank",filterSummaryEquals:"=",filterSummaryNotEqual:"!=",filterSummaryGreaterThan:">",filterSummaryGreaterThanOrEqual:">=",filterSummaryLessThan:"<",filterSummaryLessThanOrEqual:"<=",filterSummaryInRange:"between",yesterday:"Yesterday",today:"Today",tomorrow:"Tomorrow",last7Days:"Last 7 Days",lastWeek:"Last Week",thisWeek:"This Week",nextWeek:"Next Week",last30Days:"Last 30 Days",lastMonth:"Last Month",thisMonth:"This Month",nextMonth:"Next Month",last90Days:"Last 90 Days",lastQuarter:"Last Quarter",thisQuarter:"This Quarter",nextQuarter:"Next Quarter",lastYear:"Last Year",thisYear:"This Year",yearToDate:"Year To Date",nextYear:"Next Year",last6Months:"Last 6 Months",last12Months:"Last 12 Months",last24Months:"Last 24 Months",filterSummaryInRangeValues:e=>`(${e[0]}, ${e[1]})`,filterSummaryTextQuote:e=>`"${e[0]}"`,minDateValidation:e=>`Date must be after ${e[0]}`,maxDateValidation:e=>`Date must be before ${e[0]}`,strictMinValueValidation:e=>`Must be greater than ${e[0]}`,strictMaxValueValidation:e=>`Must be less than ${e[0]}`};function jt(e,t,s){return il(e,KE,t,s)}function Iu(e,t){const{debounceMs:s}=e;return lo(e)?(s!=null&&F(71),0):s??t}function lo(e){return(e.buttons?.indexOf("apply")??-1)>=0}function SC(e,t,s,i){let r=jt(e,s);if(typeof t=="function"){const o=jt(e,i);r=t({filterOptionKey:i,filterOption:o,placeholder:r})}else typeof t=="string"&&(r=t);return r}var An=class extends A{constructor(e,t){super(),this.filterNameKey=e,this.cssIdentifier=t,this.applyActive=!1,this.debouncePending=!1,this.defaultDebounceMs=0}postConstruct(){const e={tag:"div",cls:`ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,children:[this.createBodyTemplate()]};this.setTemplate(e,this.getAgComponents()),this.createManagedBean(new Ii(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=this.createBean(new yl(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}))}handleKeyDown(e){}init(e){const t=e;this.setParams(t),this.setModelIntoUi(t.state.model,!0).then(()=>this.updateUiVisibility())}areStatesEqual(e,t){return e===t}refresh(e){const t=e,s=this.params;this.params=t;const{source:i,state:r,additionalEventAttributes:o}=t;i==="colDef"&&this.updateParams(t,s);const n=this.state;this.state=r;const a=o?.fromAction;return(a&&a!=="apply"||r.model!==n.model||!this.areStatesEqual(r.state,n.state))&&this.setModelIntoUi(r.model),!0}setParams(e){this.params=e,this.state=e.state,this.commonUpdateParams(e)}updateParams(e,t){this.commonUpdateParams(e,t)}commonUpdateParams(e,t){this.applyActive=lo(e),this.setupApplyDebounced()}doesFilterPass(e){F(283);const{getHandler:t,model:s,column:i}=this.params;return t().doesFilterPass({...e,model:s,handlerParams:this.beans.colFilter.getHandlerParams(i)})}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return F(284),this.params.model!=null}setupApplyDebounced(){const e=Iu(this.params,this.defaultDebounceMs),t=Ce(this,this.checkApplyDebounce.bind(this),e);this.applyDebounced=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.doApplyModel())}getModel(){return F(285),this.params.model}setModel(e){F(286);const{beans:t,params:s}=this;return t.colFilter.setModelForColumnLegacy(s.column,e)}applyModel(e="api"){return this.doApplyModel()}canApply(e){return!0}doApplyModel(e){const{params:t,state:{valid:s=!0,model:i}}=this;if(!s)return!1;const r=!this.areModelsEqual(t.model,i);return r&&t.onAction("apply",e),r}onNewRowsLoaded(){}onUiChanged(e,t=!1){this.updateUiVisibility();const s=this.getModelFromUi(),i={model:s,state:this.getState(),valid:this.canApply(s)};this.state=i;const{params:r,gos:o,eventSvc:n,applyActive:a}=this;r.onStateChange(i),r.onUiChange(this.getUiChangeEventParams()),o.get("enableFilterHandlers")||n.dispatchEvent({type:"filterModified",column:r.column,filterInstance:this}),i.valid&&(e??(e=a?void 0:"debounce"),e==="immediately"?this.doApplyModel({afterFloatingFilter:t,afterDataChange:!1}):e==="debounce"&&this.applyDebounced())}getState(){}getUiChangeEventParams(){}afterGuiAttached(e){this.lastContainerType=e?.container,this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){const{positionableFeature:t,gos:s}=this;if(!t)return;const i=e==="floatingFilter"||e==="columnFilter";i?(t.restoreLastSize(),t.setResizable(s.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(t.removeSizeFromEl(),t.setResizable(!1)),t.constrainSizeToAvailableHeight(i)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}destroy(){this.positionableFeature=this.destroyBean(this.positionableFeature),super.destroy()}translate(e,t){return jt(this,e,t)}getPositionableElement(){return this.getGui()}areModelsEqual(e,t){return e===t||e==null&&t==null?!0:e==null||t==null?!1:this.areNonNullModelsEqual(e,t)}},yC=["aggregation","filter","sort","pivot","columnVisibility","columnSizing","rowGroup"],In=class extends Pt{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e?.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},Rr=class extends In{constructor(){super(...arguments),this.errorMessages=null}init(e){this.params=e,this.initialiseEditor(e),this.eEditor.onValueChange(()=>e.validate())}destroy(){this.eEditor.destroy(),this.errorMessages=null,super.destroy()}};function at(e){const t=e.rowModel;return t.getType()==="clientSide"?t:void 0}function El(e){const t=e.rowModel;return t.getType()==="infinite"?t:void 0}function co(e){const t=e.rowModel;return t.getType()==="serverSide"?t:void 0}function jE(e){const t=e.rowModel;return t.getType()==="viewport"?t:void 0}var ku="row-group-",Pl="t-",Ml="b-",qE=0,lt=class{constructor(e){this.id=void 0,this.destroyed=!1,this._groupData=void 0,this.master=!1,this.detail=void 0,this.rowIndex=null,this.field=null,this.rowGroupColumn=null,this.key=null,this.sourceRowIndex=-1,this._leafs=void 0,this.childrenAfterGroup=null,this.childrenAfterFilter=null,this.childrenAfterAggFilter=null,this.childrenAfterSort=null,this.allChildrenCount=null,this.childrenMapped=null,this.treeParent=null,this.treeNodeFlags=0,this._expanded=void 0,this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=qE++,this.alreadyRendered=!1,this.formulaRowIndex=null,this.hovered=!1,this.__selected=!1,this.beans=e}get groupData(){const e=this._groupData;return e!==void 0?e:this.footer?this.sibling?.groupData:this.beans.groupStage?.loadGroupData(this)??null}set groupData(e){this._groupData=e}get primaryRow(){let e=this.footer&&this.sibling?this.sibling:this;const{pinnedSibling:t}=e;return t&&e.rowPinned&&(e=t,e.footer&&e.sibling&&(e=e.sibling)),e}get allLeafChildren(){const e=this._leafs;return e===void 0?this.beans.groupStage?.loadLeafs?.(this)??null:e}set allLeafChildren(e){this._leafs=e}get expanded(){const e=this.beans.expansionSvc;return e?e.isExpanded(this):this.level===-1?!0:!!this._expanded}set expanded(e){this._expanded=e}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const{valueCache:s,eventSvc:i}=this.beans,r=this.data;this.data=e,s?.onDataChanged(),this.updateDataOnDetailNode(),this.resetQuickFilterAggregateText();const o=this.createDataChangedEvent(e,r,t);if(this.__localEventService?.dispatchEvent(o),this.sibling){this.sibling.data=e;const a=this.sibling.createDataChangedEvent(e,r,t);this.sibling.__localEventService?.dispatchEvent(a)}i.dispatchEvent({type:"rowNodeDataChanged",node:this});const n=this.pinnedSibling;n&&(n.data=e,n.__localEventService?.dispatchEvent(n.createDataChangedEvent(e,r,t)),i.dispatchEvent({type:"rowNodeDataChanged",node:n}))}updateDataOnDetailNode(){const e=this.detailNode;e&&(e.data=this.data)}createDataChangedEvent(e,t,s){return{type:"dataChanged",node:this,oldData:t,newData:e,update:s}}getRowIndexString(){return this.rowIndex==null?(Q(13),null):this.rowPinned==="top"?Pl+this.rowIndex:this.rowPinned==="bottom"?Ml+this.rowIndex:this.rowIndex.toString()}setDataAndId(e,t){const{selectionSvc:s}=this.beans,i=s?.createDaemonNode?.(this),r=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),s&&(s.updateRowSelectable(this),s.syncInRowNode(this,i));const o=this.createDataChangedEvent(e,r,!1);this.__localEventService?.dispatchEvent(o)}setId(e){const t=Is(this.beans.gos);if(t)if(this.data){const s=this.parent?.getRoute()??[];this.id=t({data:this.data,parentKeys:s.length>0?s:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(ku)&&Q(14,{groupPrefix:ku})}else this.id=void 0;else this.id=e}setRowTop(e){if(this.oldRowTop=this.rowTop,this.rowTop===e)return;this.rowTop=e,this.dispatchRowEvent("topChanged");const t=e!==null;this.displayed!==t&&(this.displayed=t,this.dispatchRowEvent("displayedChanged"))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(e){this.hovered=e}isHovered(){return this.hovered}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.dispatchRowEvent("heightChanged")}setExpanded(e,t,s){this.beans.expansionSvc?.setExpanded(this,e,t,s)}setDataValue(e,t,s){const{colModel:i,valueSvc:r,gos:o,editSvc:n}=this.beans;if(e==null)return!1;let a=i.getCol(e)??i.getColDefCol(e);if(!a)return!1;if(!this.group){const d=a.getColDef();d.pivotValueColumn&&(a=d.pivotValueColumn)}const l=r.getValueForDisplay({column:a,node:this,from:"data"}).value;if(o.get("readOnlyEdit")){const{beans:{eventSvc:d},data:u,rowIndex:h,rowPinned:g}=this;return d.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:h,rowPinned:g,column:a,colDef:a.colDef,data:u,node:this,oldValue:l,newValue:t,value:t,source:s}),!1}if(s!=="data"&&n&&!n.committing){const d=n.setDataValue({rowNode:this,column:a},t,s);if(d!=null)return d}const c=r.setValue(this,a,t,s);return this.dispatchCellChangedEvent(a,t,l),c&&this.pinnedSibling?.dispatchCellChangedEvent(a,t,l),c}getDataValue(e,t="data"){const{colModel:s,valueSvc:i,formula:r}=this.beans;if(e==null)return;const o=s.getCol(e)??s.getColDefCol(e);if(!o)return;const n=t==="data-raw",a=n||t==="value"?"data":t;let l=i.getValue(o,this,a,n);if(!n&&(r&&o.isAllowFormula()&&r.isFormula(l)&&(l=r.resolveValue(o,this)),t!=="data"&&o.getAggFunc()&&typeof l=="object"&&l!=null)){if(typeof l.toNumber=="function")return l.toNumber();if("value"in l)return l.value}return l}updateHasChildren(){let e=this.group&&!this.footer||!!this.childrenAfterGroup?.length;const{rowChildrenSvc:t}=this.beans;t&&(e=t.getHasChildrenValue(this)),e!==this.__hasChildren&&(this.__hasChildren=!!e,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}dispatchCellChangedEvent(e,t,s){const i={type:"cellChanged",node:this,column:e,newValue:t,oldValue:s};this.__localEventService?.dispatchEvent(i)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.beans.expansionSvc?.isExpandable(this)??!1}isSelected(){if(this.footer)return this.sibling.isSelected();const e=this.rowPinned&&this.pinnedSibling;return e?e.isSelected():this.__selected}depthFirstSearch(e){const t=this.childrenAfterGroup;if(t)for(let s=0,i=t.length;s{const s=new lt(t);for(const i of Object.keys(e))YE.has(i)||(s[i]=e[i]);return s.oldRowTop=null,s},kn=(e,t,s)=>{if(!s)return;let i=s.rowIndex;if(i==null)return;i+=t;const r=e.getRowCount();for(;i>=0&&it?.compareRowNodes(i,a,l)||(a.pinnedSibling?.rowIndex??0)-(l.pinnedSibling?.rowIndex??0)),!o)return;const n=Ri(s);n==="bottom"||n==="pinnedBottom"?this.order.push(o):this.order.unshift(o)}hide(e){const{all:t,visible:s}=this,i=s.size;return t.forEach(r=>e(r)?s.delete(r):s.add(r)),this.order=Array.from(s),this.sort(),i!=s.size}queue(e){this.queued.add(e)}unqueue(e){this.queued.delete(e)}forEachQueued(e){this.queued.forEach(e)}};function RC(e){if(e.level===-1)return!0;const t=e.parent;return t?.childrenAfterSort?.some(s=>s==e)?RC(t):!1}function Ou(e,t){const{gos:s,rowModel:i,filterManager:r}=e;return ft(s,i)?!i.getRowNode(t.id):r?.isAnyFilterPresent()?!RC(t):s.get("pivotMode")?!t.group:!1}function XE(e){return!!e.footer&&e.level===-1}function ZE(e){return!!e.pinnedSibling&&XE(e.pinnedSibling)}function QE(e){const t=e.findIndex(ZE);if(t>-1)return e.splice(t,1)?.[0]}var FC=class extends E{constructor(){super(...arguments),this.csrm=null}postConstruct(){const{gos:e,beans:t}=this;this.top=new xC(t,"top"),this.bottom=new xC(t,"bottom"),this.csrm=at(t)??null;const s=r=>Ou(t,r.pinnedSibling),i=()=>{const r=e.get("isRowPinned");r&&e.get("enableRowPinning")&&t.rowModel.forEachNode(o=>this.pinRow(o,r(o)),!0),this.refreshRowPositions(),this.dispatchRowPinnedEvents()};this.addManagedEventListeners({stylesChanged:this.onGridStylesChanges.bind(this),modelUpdated:({keepRenderedRows:r})=>{this.tryToEmptyQueues(),this.pinGrandTotalRow();let o=!1;this.forContainers(a=>{o||(o=a.hide(s))});const n=this.refreshRowPositions();(!r||n||o)&&this.dispatchRowPinnedEvents()},columnRowGroupChanged:()=>{this.forContainers(eP),this.refreshRowPositions()},rowNodeDataChanged:({node:r})=>{(e.get("isRowPinnable")?.(r)??!0)||this.pinRow(r,null)},firstDataRendered:i}),this.addManagedPropertyListener("pivotMode",()=>{this.forContainers(r=>r.hide(s)),this.dispatchRowPinnedEvents()}),this.addManagedPropertyListener("grandTotalRow",({currentValue:r})=>{this._grandTotalPinned=r==="pinnedBottom"?"bottom":r==="pinnedTop"?"top":null}),this.addManagedPropertyListener("isRowPinned",i)}destroy(){this.reset(!1),super.destroy()}reset(e=!0){this.forContainers(t=>{const s=[];t.forEach(i=>s.push(i)),s.forEach(i=>this.pinRow(i,null)),t.clear()}),e&&this.dispatchRowPinnedEvents()}pinRow(e,t,s){if(t!=null&&e.destroyed)return;if(e.footer){const n=e.level;if(n>-1)return;if(n===-1){this._grandTotalPinned=t,this.csrm?.reMapRows();return}}const i=e.rowPinned??e.pinnedSibling?.rowPinned;if(i!=null&&t!=null&&t!=i){const n=e.rowPinned?e:e.pinnedSibling,a=e.rowPinned?e.pinnedSibling:e;this.pinRow(n,null,s),this.pinRow(a,t,s);return}const o=s&&tP(this.beans,e,s);if(o){o.forEach(n=>this.pinRow(n,t));return}if(t==null){const n=e.rowPinned?e:e.pinnedSibling,a=this.findPinnedRowNode(n);if(!a)return;a.delete(n);const l=n.pinnedSibling;Vu(n),this.refreshRowPositions(t),this.dispatchRowPinnedEvents(l)}else{const n=EC(this.beans,e,t),a=this.getContainer(t);a.add(n),Ou(this.beans,e)&&a.hide(l=>Ou(this.beans,l.pinnedSibling)),this.refreshRowPositions(t),this.dispatchRowPinnedEvents(e)}}isManual(){return!0}isEmpty(e){return this.getContainer(e).size()===0}isRowsToRender(e){return!this.isEmpty(e)}ensureRowHeightsValid(){let e=!1,t=0;const s=i=>{if(i.rowHeightEstimated){const r=Ze(this.beans,i);i.setRowTop(t),i.setRowHeight(r.height),t+=r.height,e=!0}};return this.bottom.forEach(s),t=0,this.top.forEach(s),this.eventSvc.dispatchEvent({type:"pinnedHeightChanged"}),e}getPinnedTopTotalHeight(){return PC(this.top)}getPinnedBottomTotalHeight(){return PC(this.bottom)}getPinnedTopRowCount(){return this.top.size()}getPinnedBottomRowCount(){return this.bottom.size()}getPinnedTopRow(e){return this.top.getByIndex(e)}getPinnedBottomRow(e){return this.bottom.getByIndex(e)}getPinnedRowById(e,t){return this.getContainer(t).getById(e)}forEachPinnedRow(e,t){this.getContainer(e).forEach(t)}getPinnedState(){const e=t=>{const s=[];return this.forEachPinnedRow(t,i=>{const r=i.pinnedSibling?.id;r!=null&&s.push(r)}),s};return{top:e("top"),bottom:e("bottom")}}setPinnedState(e){this.forContainers((t,s)=>{for(const i of e[s]){const r=this.beans.rowModel.getRowNode(i);r?this.pinRow(r,s):t.queue(i)}})}getGrandTotalPinned(){return this._grandTotalPinned}setGrandTotalPinned(e){this._grandTotalPinned=e}tryToEmptyQueues(){this.forContainers((e,t)=>{const s=new Set;e.forEachQueued(i=>{const r=this.beans.rowModel.getRowNode(i);r&&s.add(r)});for(const i of s)e.unqueue(i.id),this.pinRow(i,t)})}pinGrandTotalRow(){const{csrm:e,beans:t,_grandTotalPinned:s}=this;if(!e)return;const i=e.rootNode?.sibling;if(!i)return;const r=i.pinnedSibling,o=r&&this.findPinnedRowNode(r);if(s){if(o&&o.floating!==s&&(Vu(r),o.delete(r)),!o||o.floating!==s){const n=EC(t,i,s);this.getContainer(s).add(n)}}else{if(!o)return;Vu(r),o.delete(r)}}onGridStylesChanges(e){e.rowHeightChanged&&this.forContainers(t=>t.forEach(s=>s.setRowHeight(s.rowHeight,!0)))}getContainer(e){return e==="top"?this.top:this.bottom}findPinnedRowNode(e){if(this.top.has(e))return this.top;if(this.bottom.has(e))return this.bottom}refreshRowPositions(e){const t=i=>JE(this.beans,i);if(e)return t(this.getContainer(e));let s=!1;return this.forContainers(i=>{const r=t(i);s||(s=r)}),s}forContainers(e){e(this.top,"top"),e(this.bottom,"bottom")}dispatchRowPinnedEvents(e){this.eventSvc.dispatchEvent({type:"pinnedRowsChanged"}),e?.dispatchRowEvent("rowPinned")}};function JE(e,t){let s=0,i=!1;return t.forEach((r,o)=>{if(i||(i=r.rowTop!==s),r.setRowTop(s),r.rowHeightEstimated||r.rowHeight==null){const n=Ze(e,r).height;i||(i=r.rowHeight!==n),r.setRowHeight(n)}r.setRowIndex(o),s+=r.rowHeight}),i}function EC(e,t,s){if(t.pinnedSibling)return t.pinnedSibling;const i=Gu(t,e);i.setRowTop(null),i.setRowIndex(null),i.rowPinned=s;const r=s==="top"?Pl:Ml;return i.id=`${r}${s}-${t.id}`,i.pinnedSibling=t,t.pinnedSibling=i,i}function Vu(e){if(!e.pinnedSibling)return;e.rowPinned=null,e._destroy(!1);const t=e.pinnedSibling;e.pinnedSibling=void 0,t&&(t.pinnedSibling=void 0,t.rowPinned=null)}function eP(e){const t=new Set;e.forEach(s=>{s.group&&t.add(s)}),t.forEach(s=>e.delete(s))}function tP(e,t,s){const{rowSpanSvc:i}=e,r=(s&&i?.isCellSpanning(s,t))??!1;if(s&&r)return i?.getCellSpan(s,t)?.spannedNodes}function PC(e){const t=e.size();if(t===0)return 0;const s=e.getByIndex(t-1);return s===void 0?0:s.rowTop+s.rowHeight}var MC=class extends E{constructor(){super(...arguments),this.nextId=0,this.pinnedTopRows={cache:{},order:[]},this.pinnedBottomRows={cache:{},order:[]}}postConstruct(){const e=this.gos;this.setPinnedRowData(e.get("pinnedTopRowData"),"top"),this.setPinnedRowData(e.get("pinnedBottomRowData"),"bottom"),this.addManagedPropertyListener("pinnedTopRowData",t=>this.setPinnedRowData(t.currentValue,"top")),this.addManagedPropertyListener("pinnedBottomRowData",t=>this.setPinnedRowData(t.currentValue,"bottom")),this.addManagedEventListeners({stylesChanged:this.onGridStylesChanges.bind(this)})}reset(){}isEmpty(e){return this.getCache(e).order.length===0}isRowsToRender(e){return!this.isEmpty(e)}isManual(){return!1}pinRow(e,t){}onGridStylesChanges(e){if(e.rowHeightChanged){const t=s=>{s.setRowHeight(s.rowHeight,!0)};Gn(this.pinnedBottomRows,t),Gn(this.pinnedTopRows,t)}}ensureRowHeightsValid(){let e=!1,t=0;const s=i=>{if(i.rowHeightEstimated){const r=Ze(this.beans,i);i.setRowTop(t),i.setRowHeight(r.height),t+=r.height,e=!0}};return Gn(this.pinnedBottomRows,s),t=0,Gn(this.pinnedTopRows,s),this.eventSvc.dispatchEvent({type:"pinnedHeightChanged"}),e}setPinnedRowData(e,t){this.updateNodesFromRowData(e,t),this.eventSvc.dispatchEvent({type:"pinnedRowDataChanged"})}updateNodesFromRowData(e,t){const s=this.getCache(t);if(e===void 0){s.order.length=0,s.cache={};return}const i=Is(this.gos),r=t==="top"?Pl:Ml,o=new Set(s.order),n=[],a=new Set;let l=0,c=-1;for(const d of e){const u=i?.({data:d,level:0,rowPinned:t})??r+this.nextId++;if(a.has(u)){F(96,{id:u,data:d});continue}c++,a.add(u),n.push(u);const h=Ln(s,u);if(h!==void 0)h.data!==d&&h.updateData(d),l+=this.setRowTopAndRowIndex(h,l,c),o.delete(u);else{const g=new lt(this.beans);g.id=u,g.data=d,g.rowPinned=t,l+=this.setRowTopAndRowIndex(g,l,c),s.cache[u]=g,s.order.push(u)}}for(const d of o)Ln(s,d)?.clearRowTopAndRowIndex(),delete s.cache[d];s.order=n}setRowTopAndRowIndex(e,t,s){return e.setRowTop(t),e.setRowHeight(Ze(this.beans,e).height),e.setRowIndex(s),e.rowHeight}getPinnedTopTotalHeight(){return TC(this.pinnedTopRows)}getPinnedBottomTotalHeight(){return TC(this.pinnedBottomRows)}getPinnedTopRowCount(){return Nu(this.pinnedTopRows)}getPinnedBottomRowCount(){return Nu(this.pinnedBottomRows)}getPinnedTopRow(e){return Bu(this.pinnedTopRows,e)}getPinnedBottomRow(e){return Bu(this.pinnedBottomRows,e)}getPinnedRowById(e,t){return Ln(this.getCache(t),e)}forEachPinnedRow(e,t){return Gn(this.getCache(e),t)}getCache(e){return e==="top"?this.pinnedTopRows:this.pinnedBottomRows}getPinnedState(){return{top:[],bottom:[]}}setPinnedState(){}getGrandTotalPinned(){}setGrandTotalPinned(){}};function TC(e){const t=Nu(e);if(t===0)return 0;const s=Bu(e,t-1);return s===void 0?0:s.rowTop+s.rowHeight}function Ln(e,t){return e.cache[t]}function Bu(e,t){return Ln(e,e.order[t])}function Gn(e,t){e.order.forEach((s,i)=>{const r=Ln(e,s);r&&t(r,i)})}function Nu(e){return e.order.length}var DC=class extends E{constructor(){super(...arguments),this.beanName="pinnedRowModel"}postConstruct(){const{gos:e}=this,t=()=>{const s=e.get("enableRowPinning"),i=Ri(e),o=!!s||(i==="pinnedBottom"||i==="pinnedTop"),n=o?this.inner instanceof MC:this.inner instanceof FC;this.inner&&n&&this.destroyBean(this.inner),(n||!this.inner)&&(this.inner=this.createManagedBean(o?new FC:new MC))};this.addManagedPropertyListeners(["enableRowPinning","grandTotalRow"],t),t()}reset(){return this.inner.reset()}isEmpty(e){return this.inner.isEmpty(e)}isManual(){return this.inner.isManual()}isRowsToRender(e){return this.inner.isRowsToRender(e)}pinRow(e,t,s){return this.inner.pinRow(e,t,s)}ensureRowHeightsValid(){return this.inner.ensureRowHeightsValid()}getPinnedRowById(e,t){return this.inner.getPinnedRowById(e,t)}getPinnedTopTotalHeight(){return this.inner.getPinnedTopTotalHeight()}getPinnedBottomTotalHeight(){return this.inner.getPinnedBottomTotalHeight()}getPinnedTopRowCount(){return this.inner.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.inner.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.inner.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.inner.getPinnedBottomRow(e)}forEachPinnedRow(e,t){return this.inner.forEachPinnedRow(e,t)}getPinnedState(){return this.inner.getPinnedState()}setPinnedState(e){return this.inner.setPinnedState(e)}setGrandTotalPinned(e){return this.inner.setGrandTotalPinned(e)}getGrandTotalPinned(){return this.inner.getGrandTotalPinned()}},ys=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(ys||{}),sP=500,iP=550,Tl,rP=e=>{if(!Tl)Tl=new WeakSet;else if(Tl.has(e))return!1;return Tl.add(e),!0},as=class{constructor(e,t=!1){this.eElement=e,this.preventClick=t,this.startListener=null,this.handlers=[],this.eventSvc=void 0,this.touchStart=null,this.lastTapTime=null,this.longPressTimer=0,this.moved=!1}addEventListener(e,t){let s=this.eventSvc;if(!s){if(s===null)return;this.eventSvc=s=new As;const i=this.onTouchStart.bind(this);this.startListener=i,this.eElement.addEventListener("touchstart",i,{passive:!0})}s.addEventListener(e,t)}removeEventListener(e,t){this.eventSvc?.removeEventListener(e,t)}onTouchStart(e){if(this.touchStart||!rP(e))return;const t=e.touches[0];this.touchStart=t;const s=this.handlers;if(!s.length){const i=this.eElement,r=i.ownerDocument,o=this.onTouchMove.bind(this),n=this.onTouchEnd.bind(this),a=this.onTouchCancel.bind(this),l={passive:!0},c={passive:!1};sl(s,[i,"touchmove",o,l],[r,"touchcancel",a,l],[r,"touchend",n,c],[r,"contextmenu",Si,c])}this.clearLongPress(),this.longPressTimer=window.setTimeout(()=>{this.longPressTimer=0,this.touchStart===t&&!this.moved&&(this.moved=!0,this.eventSvc?.dispatchEvent({type:"longTap",touchStart:t,touchEvent:e}))},iP)}onTouchMove(e){const{moved:t,touchStart:s}=this;if(!t&&s){const i=Qr(s,e.touches);i&&!Cm(i,s,4)&&(this.clearLongPress(),this.moved=!0)}}onTouchEnd(e){const t=this.touchStart;!t||!Qr(t,e.changedTouches)||(this.moved||(this.eventSvc?.dispatchEvent({type:"tap",touchStart:t}),this.checkDoubleTap(t)),this.preventClick&&Si(e),this.cancel())}onTouchCancel(e){const t=this.touchStart;!t||!Qr(t,e.changedTouches)||(this.lastTapTime=null,this.cancel())}checkDoubleTap(e){let t=Date.now();const s=this.lastTapTime;s&&t-s>sP&&(this.eventSvc?.dispatchEvent({type:"doubleTap",touchStart:e}),t=null),this.lastTapTime=t}cancel(){this.clearLongPress(),$d(this.handlers),this.touchStart=null}clearLongPress(){window.clearTimeout(this.longPressTimer),this.longPressTimer=0,this.moved=!1}destroy(){const e=this.startListener;e&&(this.startListener=null,this.eElement.removeEventListener("touchstart",e)),this.cancel(),this.eElement=null,this.eventSvc=null}},qt=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(qt||{}),oP=1,AC=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,this.instanceId=oP++,e?.beanClasses&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){this.id=e.id,this.beans.context=this,this.destroyCallback=e.destroyCallback;for(const t of Object.keys(e.providedBeanInstances))this.beans[t]=e.providedBeanInstances[t];for(const t of e.beanClasses){const s=new t;s.beanName?this.beans[s.beanName]=s:console.error(`Bean ${t.name} is missing beanName`),this.createdBeans.push(s)}for(const t of e.derivedBeans??[]){const{beanName:s,bean:i}=t(this);this.beans[s]=i,this.createdBeans.push(i)}e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){return this.initBeans([e],t),e}initBeans(e,t){const s=this.beans;for(const i of e)i.preWireBeans?.(s),i.wireBeans?.(s);for(const i of e)i.preConstruct?.();t&&e.forEach(t);for(const i of e)i.postConstruct?.()}getBeans(){return this.beans}getBean(e){return this.beans[e]}getId(){return this.id}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[],this.destroyCallback?.()}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t[e,t]));function lP(e,t){const s=(e.beanName?IC[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER,i=(t.beanName?IC[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return s-i}function cP(e,t){return e?.beanName==="gridDestroySvc"?-1:t?.beanName==="gridDestroySvc"?1:0}function ai(e){const{rowIndex:t,rowPinned:s,column:i}=e;return`${t}.${s??"null"}.${i.getId()}`}function uo(e,t){const s=e.column===t.column,i=e.rowPinned===t.rowPinned,r=e.rowIndex===t.rowIndex;return s&&i&&r}function ze(e,t){switch(e.rowPinned){case"top":if(t.rowPinned!=="top")return!0;break;case"bottom":if(t.rowPinned!=="bottom")return!1;break;default:if(D(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndexu.rowNode.rowIndex===t.rowIndex),l=a?o:n,c=(s?-1:1)*(a?-1:1);let d;for(let u=0;u{if(!i.defaultPrevented&&!gP(i)&&i.key===b.TAB){const r=i.shiftKey;Qe(e,s,!1,r)||Vs(e,r)&&i.preventDefault()}}})}function zu(e,t){return e.ctrlsSvc.get("gridCtrl").focusInnerElement(t)}function xs(e){return e.gos.get("suppressHeaderFocus")||!!e.overlays?.exclusive}function On(e){return e.gos.get("suppressCellFocus")||!!e.overlays?.exclusive}function Vs(e,t,s=!1){const i=e.ctrlsSvc.get("gridCtrl"),r=i.focusNextInnerContainer(t);return r===!0?!0:r===!1?r:((s||!t&&!i.isDetailGrid()&&i.isFocusInsideGridBody())&&i.forceFocusOutOfContainer(t),!1)}function _u(e,t){const s=e.focusSvc,i=s.getFocusedCell();if(i&&t&&uo(i,t)){const{rowIndex:r,rowPinned:o,column:n}=t;ms(e)&&s.setFocusedCell({rowIndex:r,column:n,rowPinned:o,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!Dn()})}}function hP(e,t){const s=e.getFocusableContainerName();return s==="gridBody"?t():LC(e,()=>Kt(e.getGui(),".ag-tab-guard").length>0)?s:null}function LC(e,t){e.setAllowFocus?.(!0);try{return t()}finally{e.setAllowFocus?.(!1)}}var GC="__ag_Grid_Skip_Focusable_Container";function OC(e){e[GC]=!0}function gP(e){return e[GC]===!0}function VC(e){return e.cols?e.cols.treeDepth+1:-1}function cs(e){return e.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0}function Wu(e){const t=[],s=e.ctrlsSvc.getHeaderRowContainerCtrls();for(const i of s){if(!i)continue;const r=i.getGroupRowCount()||0;for(let o=0;oa)&&(t[o]=l)}}}return t}function pP(e,t){let i=e.colModel.isPivotMode()?mP(e):BC(e);const r=t.getHeaderCellCtrls();for(const o of r){const{column:n}=o,a=n.getAutoHeaderHeight();a!=null&&a>i&&n.isAutoHeaderHeight()&&(i=a)}return i}function Uu(e){let s=e.colModel.isPivotMode()?fP(e):Vn(e);return e.colModel.forAllCols(i=>{const r=i.getAutoHeaderHeight();r!=null&&r>s&&i.isAutoHeaderHeight()&&(s=r)}),s}function Vn(e){return e.gos.get("headerHeight")??e.environment.getDefaultHeaderHeight()}function Dl(e){return e.gos.get("floatingFiltersHeight")??Vn(e)}function BC(e){return e.gos.get("groupHeaderHeight")??Vn(e)}function fP(e){return e.gos.get("pivotHeaderHeight")??Vn(e)}function mP(e){return e.gos.get("pivotGroupHeaderHeight")??BC(e)}function CP(e,t){return e.headerRowIndex===t.headerRowIndex&&e.column===t.column}function vP(e){return e?.headerRowIndex!=null}var NC=class extends E{setComp(e,t,s){this.comp=e,this.eGui=t;const{beans:i}=this,{headerNavigation:r,touchSvc:o,ctrlsSvc:n}=i;r&&this.createManagedBean(new Ii(s,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,i),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,i)}),this.onPivotModeChanged(i),this.setupHeaderHeight();const a=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:a}),o?.mockHeaderContextMenu(this,a),n.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e),this.addManagedEventListeners({headerRowsChanged:e,columnHeaderHeightChanged:e,columnGroupHeaderHeightChanged:()=>Rt(this.beans,()=>e()),stylesChanged:e,advancedFilterEnabledChanged:e})}setHeaderHeight(){const{beans:e}=this;let t=0;const s=Wu(e).reduce((n,a)=>n+a,0),i=Uu(e);e.filterManager?.hasFloatingFilters()&&(t+=Dl(e)),t+=s,t+=i;const r=e.environment.getHeaderRowBorderWidth(),o=t+r;if(this.headerHeightWithBorder!==o){this.headerHeightWithBorder=o;const n=`${o}px`;this.comp.setHeightAndMinHeight(n)}this.headerHeight!==t&&(this.headerHeight=t,this.eventSvc.dispatchEvent({type:"headerHeightChanged"}))}onPivotModeChanged(e){const t=e.colModel.isPivotMode();this.comp.toggleCss("ag-pivot-on",t),this.comp.toggleCss("ag-pivot-off",!t)}onDisplayedColumnsChanged(e){const s=e.visibleCols.allCols.some(i=>i.isSpanHeaderHeight());this.comp.toggleCss("ag-header-allow-overflow",s)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),s=e.shiftKey,i=s!==t?"LEFT":"RIGHT",{beans:r}=this,{headerNavigation:o,focusSvc:n}=r;(o.navigateHorizontally(i,!0,e)||!s&&n.focusOverlay(!1)||Vs(r,s,!0))&&e.preventDefault()}handleKeyDown(e){let t=null;const{headerNavigation:s}=this.beans;switch(e.key){case b.LEFT:t="LEFT";case b.RIGHT:{D(t)||(t="RIGHT"),s.navigateHorizontally(t,!1,e)&&e.preventDefault();break}case b.UP:t="UP";case b.DOWN:{D(t)||(t="DOWN"),s.navigateVertically(t,e)&&e.preventDefault();break}default:return}}onFocusOut(e){const{relatedTarget:t}=e,{eGui:s,beans:i}=this;!t&&s.contains(ie(i))||s.contains(t)||(i.focusSvc.focusedHeader=null)}onHeaderContextMenu(e,t,s){const{menuSvc:i,ctrlsSvc:r}=this.beans;if(!e&&!s||!i?.isHeaderContextMenuEnabled())return;const{target:o}=e??t;(o===this.eGui||o===r.getHeaderRowContainerCtrl()?.eViewport)&&i.showHeaderContextMenu(void 0,e,s)}},$u=class extends A{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},wP={tag:"div",cls:"ag-header-cell",role:"columnheader",children:[{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"},{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"}]},bP=class extends $u{constructor(e){super(wP,e),this.eResize=x,this.eHeaderCompWrapper=x,this.headerCompVersion=0}postConstruct(){const e=this.getGui(),t=()=>{const i=this.ctrl.getSelectAllGui();i&&(this.eResize.insertAdjacentElement("afterend",i),this.addDestroyFunc(()=>i.remove()))},s={setWidth:i=>e.style.width=i,toggleCss:(i,r)=>this.toggleCss(i,r),setUserStyles:i=>gn(e,i),setAriaSort:i=>i?om(e,i):nm(e),setUserCompDetails:i=>this.setUserCompDetails(i),getUserCompInstance:()=>this.headerComp,refreshSelectAllGui:t,removeSelectAllGui:()=>this.ctrl.getSelectAllGui()?.remove()};this.ctrl.setComp(s,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0),t()}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){this.headerComp&&(this.headerCompGui?.remove(),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(s=>this.afterCompCreated(t,s))}afterCompCreated(e,t){if(e!=this.headerCompVersion||!this.isAlive()){this.destroyBean(t);return}this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}},SP={tag:"div",cls:"ag-header-group-cell",role:"columnheader",children:[{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"},{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"}]},yP=class extends $u{constructor(e){super(SP,e),this.eResize=x,this.eHeaderCompWrapper=x}postConstruct(){const e=this.getGui(),t=(i,r)=>r!=null?e.setAttribute(i,r):e.removeAttribute(i),s={toggleCss:(i,r)=>this.toggleCss(i,r),setUserStyles:i=>gn(e,i),setHeaderWrapperHidden:i=>{i?this.eHeaderCompWrapper.style.setProperty("display","none"):this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:i=>{i!=null?this.eHeaderCompWrapper.style.setProperty("max-height",`${i}px`):this.eHeaderCompWrapper.style.removeProperty("max-height"),this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",i!=null)},setResizableDisplayed:i=>V(this.eResize,i),setWidth:i=>e.style.width=i,setAriaExpanded:i=>t("aria-expanded",i),setUserCompDetails:i=>this.setUserCompDetails(i),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(s,e,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(e){e.newAgStackInstance().then(t=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}const s=this.getGui(),i=e.getGui();this.eHeaderCompWrapper.appendChild(i),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(s)}},xP={tag:"div",cls:"ag-header-cell ag-floating-filter",role:"gridcell",children:[{tag:"div",ref:"eFloatingFilterBody",role:"presentation"},{tag:"div",ref:"eButtonWrapper",cls:"ag-floating-filter-button ag-hidden",role:"presentation",children:[{tag:"button",ref:"eButtonShowMainFilter",cls:"ag-button ag-floating-filter-button-button",attrs:{type:"button",tabindex:"-1"}}]}]},RP=class extends $u{constructor(e){super(xP,e),this.eFloatingFilterBody=x,this.eButtonWrapper=x,this.eButtonShowMainFilter=x}postConstruct(){const e=this.getGui(),t={toggleCss:(s,i)=>this.toggleCss(s,i),setUserStyles:s=>gn(e,s),addOrRemoveBodyCssClass:(s,i)=>this.eFloatingFilterBody.classList.toggle(s,i),setButtonWrapperDisplayed:s=>V(this.eButtonWrapper,s),setCompDetails:s=>this.setCompDetails(s),getFloatingFilterComp:()=>this.compPromise,setWidth:s=>e.style.width=s,setMenuIcon:s=>this.eButtonShowMainFilter.appendChild(s)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(e){if(!e){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=e.newAgStackInstance(),this.compPromise.then(t=>this.afterCompCreated(t))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp?.getGui().remove(),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp)}afterCompCreated(e){if(e){if(!this.isAlive()){this.destroyBean(e);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached?.()}}},FP=class extends A{constructor(e){super({tag:"div",cls:e.headerRowClass,role:"row"}),this.ctrl=e,this.headerComps={}}postConstruct(){this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),dr(this.getGui(),this.ctrl.getAriaRowIndex());const t={setHeight:s=>this.getGui().style.height=s,setTop:s=>this.getGui().style.top=s,setHeaderCtrls:(s,i)=>this.setHeaderCtrls(s,i),setWidth:s=>this.getGui().style.width=s,setRowIndex:s=>dr(this.getGui(),s)};this.ctrl.setComp(t,void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const s=this.headerComps;this.headerComps={};for(const i of e){const r=i.instanceId;let o=s[r];delete s[r],o==null&&(o=this.createHeaderComp(i),this.getGui().appendChild(o.getGui())),this.headerComps[r]=o}if(Object.values(s).forEach(i=>{i.getGui().remove(),this.destroyBean(i)}),t){const i=Object.values(this.headerComps);i.sort((o,n)=>{const a=o.getCtrl().column.getLeft(),l=n.getCtrl().column.getLeft();return a-l});const r=i.map(o=>o.getGui());gm(this.getGui(),r)}}createHeaderComp(e){let t;switch(this.ctrl.type){case"group":t=new yP(e);break;case"filter":t=new RP(e);break;default:t=new bP(e);break}return this.createBean(t),t.setParentComponent(this),t}},Ku=class extends E{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=je(this.gos,"print"),{visibleCols:t,scrollVisibleSvc:s}=this.beans,i=t.bodyWidth,r=t.getColsLeftWidth(),o=t.getDisplayedColumnsRightWidth();let n;e?n=i+r+o:(n=i,this.addSpacer&&(this.gos.get("enableRtl")?r:o)===0&&s.verticalScrollShowing&&(n+=s.getScrollbarWidth())),this.callback(n)}},EP=class extends E{};function Bn(e,t,s){return s&&e.addDestroyFunc(()=>t.destroyBean(s)),s??e}var ju=class extends E{constructor(e,t,s,i){super(),this.columnOrGroup=e,this.eCell=t,this.colsSpanning=i,this.columnOrGroup=e,this.ariaEl=t.querySelector("[role=columnheader]")||t,this.beans=s}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){const{beans:e,colsSpanning:t}=this;return e.gos.get("enableRtl")&&t?W(t):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const{gos:e,colAnimation:t}=this.beans,s=e.get("suppressColumnMoveAnimation"),i=D(this.columnOrGroup.getOldLeft());t?.isActive()&&i&&!s?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=this.modifyLeftForPrintLayout(e,e.getOldLeft()),s=this.modifyLeftForPrintLayout(e,e.getLeft());this.setLeft(t),this.actualLeft=s,this.beans.colAnimation.executeNextVMTurn(()=>{this.actualLeft===s&&this.setLeft(s)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){const{gos:s,visibleCols:i}=this.beans;if(!je(s,"print")||e.getPinned()==="left")return t;const o=i.getColsLeftWidth();if(e.getPinned()==="right"){const n=i.bodyWidth;return o+n+t}return o+t}setLeft(e){if(D(e)&&(this.eCell.style.left=`${e}px`),Le(this.columnOrGroup)){const t=this.columnOrGroup.getLeafColumns();if(!t.length)return;t.length>1&&Nd(this.ariaEl,t.length)}}},PP="ag-column-first",MP="ag-column-last";function Al(e,t,s,i){return ne(e)?[]:zC(e.headerClass,e,t,s,i)}function qu(e,t,s,i){return ne(e)?[]:zC(e.toolPanelClass,e,t,s,i)}function HC(e,t,s){e.toggleCss(PP,s.isColAtEdge(t,"first")),e.toggleCss(MP,s.isColAtEdge(t,"last"))}function TP(e,t,s,i){return N(t,{colDef:e,column:s,columnGroup:i})}function zC(e,t,s,i,r){if(ne(e))return[];let o;if(typeof e=="function"){const n=TP(t,s,i,r);o=e(n)}else o=e;return typeof o=="string"?[o]:Array.isArray(o)?[...o]:[]}var DP=0,_C="headerCtrl",Yu=class extends E{constructor(e,t){super(),this.column=e,this.rowCtrl=t,this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.reAttemptToFocus=!1,this.instanceId=e.getUniqueId()+"-"+DP++}postConstruct(){const e=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],e),this.addManagedEventListeners({overlayExclusiveChanged:e})}setComp(e,t,s,i,r){t.setAttribute("col-id",this.column.colIdSanitised),this.wireComp(e,t,s,i,r),this.reAttemptToFocus&&(this.reAttemptToFocus=!1,this.focus(this.lastFocusEvent??void 0))}shouldStopEventPropagation(e){const{headerRowIndex:t,column:s}=this.beans.focusSvc.focusedHeader,i=s.getDefinition(),r=i?.suppressHeaderKeyboardEvent;if(!D(r))return!1;const o=N(this.gos,{colDef:i,column:s,headerRowIndex:t,event:e});return!!r(o)}getWrapperHasFocus(){return ie(this.beans)===this.eGui}setGui(e,t){this.eGui=e,this.addDomData(t),t.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),t.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}refreshHeaderStyles(){const e=this.column.getDefinition();if(!e)return;const{headerStyle:t}=e;let s;if(typeof t=="function"){const i=this.getHeaderClassParams();s=t(i)}else s=t;s&&this.comp.setUserStyles(s)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(e){const{wrapperElement:t,checkMeasuringCallback:s,compBean:i}=e,{beans:r}=this,o=u=>{if(!this.isAlive()||!i.isAlive())return;const{paddingTop:h,paddingBottom:g,borderBottomWidth:p,borderTopWidth:f}=hr(this.eGui),m=h+g+p+f,v=t.offsetHeight+m;if(u<5){const S=!me(r)?.contains(t),y=v==0;if(S||y){Cn(()=>o(u+1),"raf",r);return}}this.setColHeaderHeight(this.column,v)};let n=!1,a;const l=()=>{const u=this.column.isAutoHeaderHeight();u&&!n&&c(),!u&&n&&d()},c=()=>{n=!0,this.comp.toggleCss("ag-header-cell-auto-height",!0),o(0),a=vs(this.beans,t,()=>o(0))},d=()=>{n=!1,a&&a(),this.comp.toggleCss("ag-header-cell-auto-height",!1),a=void 0};l(),i.addDestroyFunc(()=>d()),i.addManagedListeners(this.column,{widthChanged:()=>n&&o(0)}),i.addManagedEventListeners({sortChanged:()=>{n&&window.setTimeout(()=>o(0))}}),s&&s(l)}onDisplayedColumnsChanged(){const{comp:e,column:t,beans:s,eGui:i}=this;!e||!t||!i||(HC(e,t,s.visibleCols),$a(i,s.visibleCols.getAriaColIndex(t)))}addResizeAndMoveKeyboardListeners(e){e.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){const e=xs(this.beans);this.eGui&&nt(this.eGui,"tabindex",e?null:"-1")}onGuiKeyDown(e){const t=ie(this.beans),s=e.key===b.LEFT||e.key===b.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),t!==this.eGui||!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey)return;if((this.isResizing||s)&&(e.preventDefault(),e.stopImmediatePropagation()),(e.ctrlKey||e.metaKey)&&nC(e)===b.C)return this.beans.clipboardSvc?.copyToClipboard();if(!s)return;const o=e.key===b.LEFT!==this.gos.get("enableRtl")?"left":"right";if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const n=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(n,e.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(o)}moveHeader(e){this.beans.colMoves?.moveHeader(e,this.eGui,this.column,this.rowCtrl.pinned,this)}getViewportAdjustedResizeDiff(e){const t=this.getResizeDiff(e),{pinnedCols:s}=this.beans;return s?s.getHeaderResizeDiff(t,this.column):t}getResizeDiff(e){const{gos:t,column:s}=this;let i=e.key===b.LEFT!==t.get("enableRtl");const r=s.getPinned(),o=t.get("enableRtl");return r&&o!==(r==="right")&&(i=!i),(i?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case b.PAGE_DOWN:case b.PAGE_UP:case b.PAGE_HOME:case b.PAGE_END:t&&e.preventDefault()}}addDomData(e){const t=_C,{eGui:s,gos:i}=this;mr(i,s,t,this),e.addDestroyFunc(()=>mr(i,s,t,null))}focus(e){if(!this.isAlive())return!1;const{eGui:t}=this;return t?(this.lastFocusEvent=e||null,t.focus()):this.reAttemptToFocus=!0,!0}focusThis(){this.beans.focusSvc.focusedHeader={headerRowIndex:this.rowCtrl.rowIndex,column:this.column}}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop?.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,s){const i=e??t,{menuSvc:r,gos:o}=this.beans;o.get("preventDefaultOnContextMenu")&&i.preventDefault(),r?.isHeaderContextMenuEnabled(s)&&r.showHeaderContextMenu(s,e,t),this.dispatchColumnMouseEvent("columnHeaderContextMenu",s)}dispatchColumnMouseEvent(e,t){this.eventSvc.dispatchEvent({type:e,column:t})}setColHeaderHeight(e,t){if(!e.setAutoHeaderHeight(t))return;const{eventSvc:s}=this;e.isColumn?s.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"}):s.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:e,source:"autosizeColumnGroupHeaderHeight"})}clearComponent(){this.removeDragSource(),this.resizeFeature=null,this.comp=null,this.eGui=null}destroy(){super.destroy(),this.column=null,this.lastFocusEvent=null,this.rowCtrl=null}},AP=class extends Yu{constructor(){super(...arguments),this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map}wireComp(e,t,s,i,r){this.comp=e;const{rowCtrl:o,column:n,beans:a}=this,{colResize:l,context:c,colHover:d,rangeSvc:u}=a,h=Bn(this,c,r);this.setGui(t,h),this.updateState(),this.setupWidth(h),this.setupMovingCss(h),this.setupMenuClass(h),this.setupSortableClass(h),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:i,checkMeasuringCallback:p=>this.setRefreshFunction("measuring",p),compBean:h}),this.addColumnHoverListener(h),this.setupFilterClass(h),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(h),this.setupSelectAll(h),this.setupUserComp(),this.refreshAria(),l?this.resizeFeature=h.createManagedBean(l.createResizeFeature(o.pinned,n,s,e,this)):V(s,!1),d?.createHoverFeature(h,[n],t),u?.createRangeHighlightFeature(h,n,e),h.createManagedBean(new ju(n,t,a)),h.createManagedBean(new Ii(t,{shouldStopEventPropagation:p=>this.shouldStopEventPropagation(p),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(h),h.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader","enableAdvancedFilter"],()=>this.refresh()),h.addManagedListeners(n,{colDefChanged:()=>this.refresh(),formulaRefChanged:()=>this.refresh(),headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});const g=()=>this.checkDisplayName();h.addManagedEventListeners({columnValueChanged:g,columnRowGroupChanged:g,columnPivotChanged:g,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),h.addDestroyFunc(()=>{this.refreshFunctions={},this.selectAllFeature=null,this.dragSourceElement=void 0,this.userCompDetails=null,this.userHeaderClasses.clear(),this.ariaDescriptionProperties.clear(),this.clearComponent()})}resizeHeader(e,t){this.beans.colResize?.resizeHeader(this.column,e,t)}getHeaderClassParams(){const{column:e,beans:t}=this,s=e.colDef;return N(t.gos,{colDef:s,column:e,floatingFilter:!1})}setupUserComp(){const e=this.lookupUserCompDetails();e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return TE(this.beans.userCompFactory,t,e)}createParams(){const{menuSvc:e,sortSvc:t,colFilter:s,gos:i}=this.beans;return N(i,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!e?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!s&&(!this.openFilterEnabled||He(this.gos)),showColumnMenu:(o,n)=>{e?.showColumnMenu({column:this.column,buttonElement:o,positionBy:"button",onClosedCallback:n})},showColumnMenuAfterMouseClick:(o,n)=>{e?.showColumnMenu({column:this.column,mouseEvent:o,positionBy:"mouse",onClosedCallback:n})},showFilter:o=>{e?.showFilterMenu({column:this.column,buttonElement:o,containerType:"columnFilter",positionBy:"button"})},progressSort:o=>{t?.progressSort(this.column,!!o,"uiColumnSorted")},setSort:(o,n)=>{t?.setSortForColumn(this.column,Ut(o),!!n,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(o,n)=>{i.assertModuleRegistered("Tooltip",3),this.setupTooltip(o,n)}})}setupSelectAll(e){const{selectionSvc:t}=this.beans;t&&(this.selectAllFeature=e.createOptionalManagedBean(t.createSelectAllFeature(this.column)),this.selectAllFeature?.setComp(this),e.addManagedPropertyListener("rowSelection",()=>{const s=t.createSelectAllFeature(this.column);s&&!this.selectAllFeature?(this.selectAllFeature=e.createManagedBean(s),this.selectAllFeature?.setComp(this),this.comp.refreshSelectAllGui()):this.selectAllFeature&&!s&&(this.comp.removeSelectAllGui(),this.selectAllFeature=this.destroyBean(this.selectAllFeature))}))}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===b.SPACE?this.selectAllFeature?.onSpaceKeyDown(e):e.key===b.ENTER?this.onEnterKeyDown(e):e.key===b.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){const{column:t,gos:s,sortable:i,beans:r}=this;let o=!1;(e.ctrlKey||e.metaKey)&&(o=this.showMenuOnKeyPress(e,!0)),o||(!e.altKey&&Ei(s)?r.rangeSvc?.handleColumnSelection(t,e):i&&r.sortSvc?.progressSort(t,e.shiftKey,"uiColumnSorted"))}showMenuOnKeyPress(e,t){const s=this.comp.getUserCompInstance();return WC(s)&&s.onMenuKeyboardShortcut(t)?(e.preventDefault(),!0):!1}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription()),Dn()&&this.setActiveHeader(!0)}onFocusOut(e){this.eGui.contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderTooltip(this.tooltipFeature,this,e,t)}setupStylesFromColDef(){this.setRefreshFunction("headerStyles",this.refreshHeaderStyles.bind(this)),this.refreshHeaderStyles()}setupClassesFromColDef(){const e=()=>{const t=this.column.getColDef(),s=Al(t,this.gos,this.column,null),i=this.userHeaderClasses;this.userHeaderClasses=new Set(s);for(const r of s)i.has(r)?i.delete(r):this.comp.toggleCss(r,!0);for(const r of i)this.comp.toggleCss(r,!1)};this.setRefreshFunction("headerClasses",e),e()}setDragSource(e){this.dragSourceElement=e,this.removeDragSource(),!(!e||!this.draggable)&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null)}updateState(){const{menuSvc:e}=this.beans;this.menuEnabled=!!e?.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=!!e?.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(e,t){this.refreshFunctions[e]=t}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria();for(const e of Object.values(this.refreshFunctions))e()}refreshHeaderComp(){const e=this.lookupUserCompDetails();if(!e)return;(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==e.componentClass?this.attemptHeaderCompRefresh(e.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}setupWidth(e){const t=()=>{const s=this.column.getActualWidth();this.comp.setWidth(`${s}px`)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupMovingCss(e){const t=()=>{this.comp.toggleCss("ag-header-cell-moving",this.column.isMoving())};e.addManagedListeners(this.column,{movingChanged:t}),t()}setupMenuClass(e){const t=()=>{this.comp?.toggleCss("ag-column-menu-visible",this.column.isMenuVisible())};e.addManagedListeners(this.column,{menuVisibleChanged:t}),t()}setupSortableClass(e){const t=()=>{this.comp.toggleCss("ag-header-cell-sortable",!!this.sortable)};t(),this.setRefreshFunction("updateSortable",t),e.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(e){const t=()=>{const s=this.column.isFilterActive();this.comp.toggleCss("ag-header-cell-filtered",s),this.refreshAria()};e.addManagedListeners(this.column,{filterActiveChanged:t}),t()}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.toggleCss("ag-header-cell-wrap-text",t)};e(),this.setRefreshFunction("wrapText",e)}onHeaderHighlightChanged(){const e=this.column.getHighlighted(),t=e===0,s=e===1;this.comp.toggleCss("ag-header-highlight-before",t),this.comp.toggleCss("ag-header-highlight-after",s)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:s,beans:i}=this,r=Wu(this.beans),o=r.reduce((h,g)=>h+g,0)===0;if(s.toggleCss("ag-header-parent-hidden",o),!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),s.toggleCss("ag-header-span-height",!1),s.toggleCss("ag-header-span-total",!1);return}const{numberOfParents:n,isSpanningTotal:a}=this.column.getColumnGroupPaddingInfo();s.toggleCss("ag-header-span-height",n>0);const l=Uu(i);if(n===0){s.toggleCss("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${l}px`);return}s.toggleCss("ag-header-span-total",a);const c=(this.column.getFirstRealParent()?.getLevel()??-1)+1,d=r.length-c;let u=0;for(let h=0;hr==="filter"?-1:o.charCodeAt(0)-r.charCodeAt(0)).map(r=>s.get(r)).join(". ");e.ariaAnnounce?.announceValue(i,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered(),this.refreshAriaCellSelection()}addColumnHoverListener(e){this.beans.colHover?.addHeaderColumnHoverListener(e,this.comp,this.column)}addActiveHeaderMouseListeners(e){const t=r=>this.handleMouseOverChange(r.type==="mouseenter"),s=()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},i=r=>this.handleContextMenuMouseEvent(r,void 0,this.column);e.addManagedListeners(this.eGui,{mouseenter:t,mouseleave:t,click:s,contextmenu:i})}handleMouseOverChange(e){this.setActiveHeader(e),this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(e){this.comp.toggleCss("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return WC(t)?t.getAnchorElementForMenu(e):this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function WC(e){return typeof e?.getAnchorElementForMenu=="function"&&typeof e.onMenuKeyboardShortcut=="function"}var IP=0,Xu=class extends E{constructor(e,t,s){super(),this.rowIndex=e,this.pinned=t,this.type=s,this.instanceId=IP++,this.comp=null,this.allCtrls=[];let i="ag-header-row-column";s==="group"?i="ag-header-row-group":s==="filter"&&(i="ag-header-row-filter"),this.headerRowClass=`ag-header-row ${i}`}setRowIndex(e){this.rowIndex=e,this.comp?.setRowIndex(this.getAriaRowIndex()),this.onRowHeightChanged()}postConstruct(){this.isPrintLayout=je(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){return this.comp?this.allCtrls.every(e=>e.eGui!=null):!1}setComp(e,t,s=!0){this.comp=e,t=Bn(this,this.beans.context,t),s&&(this.setRowIndex(this.rowIndex),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners(t)}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){const t=this.onRowHeightChanged.bind(this),s=this.onDisplayedColumnsChanged.bind(this);e.addManagedEventListeners({columnResized:this.setWidth.bind(this),displayedColumnsChanged:s,virtualColumnsChanged:i=>this.onVirtualColumnsChanged(i.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,stylesChanged:t,advancedFilterEnabledChanged:t}),e.addManagedPropertyListener("domLayout",s),e.addManagedPropertyListener("ensureDomOrder",i=>this.isEnsureDomOrder=i.currentValue),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}onDisplayedColumnsChanged(){this.isPrintLayout=je(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}setWidth(){if(!this.comp)return;const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleCols:e}=this.beans;return this.isPrintLayout?this.pinned!=null?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){if(!this.comp)return;const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){let e=0;const t=Wu(this.beans);for(let r=0;r{const{focusSvc:r,visibleCols:o}=this.beans;return r.isHeaderWrapperFocused(i)?o.isVisible(i.column):!1};if(e)for(const[i,r]of e)s(r)?this.ctrlsById.set(i,r):this.destroyBean(r);return this.allCtrls=Array.from(this.ctrlsById.values()),this.allCtrls}getHeaderCellCtrls(){return this.allCtrls}recycleAndCreateHeaderCtrls(e,t,s){if(e.isEmptyGroup())return;const i=e.getUniqueId();let r;if(s&&(r=s.get(i),s.delete(i)),r&&r.column!=e&&(this.destroyBean(r),r=void 0),r==null)switch(this.type){case"filter":{r=this.createBean(this.beans.registry.createDynamicBean("headerFilterCellCtrl",!0,e,this));break}case"group":r=this.createBean(this.beans.registry.createDynamicBean("headerGroupCellCtrl",!0,e,this));break;default:r=this.createBean(new AP(e,this));break}t.set(i,r)}getColumnsInViewport(){if(!this.isPrintLayout)return this.getComponentsToRender();if(this.pinned)return[];const e=[];for(const t of["left",null,"right"])e.push(...this.getComponentsToRender(t));return e}getComponentsToRender(e=this.pinned){return this.type==="group"?this.beans.colViewport.getHeadersToRender(e,this.rowIndex):this.beans.colViewport.getColumnHeadersToRender(e)}focusHeader(e,t){const s=this.allCtrls.find(r=>r.column==e);return s?s.focus(t):!1}destroy(){this.allCtrls=this.destroyBeans(this.allCtrls),this.ctrlsById=void 0,this.comp=null,super.destroy()}},UC=class extends E{constructor(e){super(),this.pinned=e,this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[]}setComp(e,t){this.comp=e,this.eViewport=t;const{pinnedCols:s,ctrlsSvc:i,colModel:r,colMoves:o}=this.beans;this.setupCenterWidth(),s?.setupHeaderPinnedWidth(this),this.setupDragAndDrop(o,this.eViewport);const n=this.refresh.bind(this,!0);this.addManagedEventListeners({displayedColumnsChanged:n,advancedFilterEnabledChanged:n});const a=`${typeof this.pinned=="string"?this.pinned:"center"}Header`;i.register(a,this),r.ready&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const{focusSvc:t,filterManager:s,visibleCols:i}=this.beans;let r=0;const o=t.getFocusHeaderToUseAfterRefresh(),n=()=>{const u=i.headerGroupRowCount;r=u,e||(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls));const h=this.groupsRowCtrls.length;if(h!==u){if(h>u){for(let g=u;g{const u=r++;if(this.hidden){this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl);return}this.columnsRowCtrl==null||!e?(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.columnsRowCtrl=this.createBean(new Xu(u,this.pinned,"column"))):this.columnsRowCtrl.rowIndex!==u&&this.columnsRowCtrl.setRowIndex(u)},l=()=>{this.includeFloatingFilter=!!s?.hasFloatingFilters()&&!this.hidden;const u=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){u();return}e||u();const h=r++;this.filtersRowCtrl?this.filtersRowCtrl.rowIndex!==h&&this.filtersRowCtrl.setRowIndex(h):this.filtersRowCtrl=this.createBean(new Xu(h,this.pinned,"filter"))},c=this.getAllCtrls();n(),a(),l();const d=this.getAllCtrls();this.comp.setCtrls(d),this.restoreFocusOnHeader(t,o),c.length!==d.length&&this.beans.eventSvc.dispatchEvent({type:"headerRowsChanged"})}getHeaderCtrlForColumn(e){const t=s=>s?.getHeaderCellCtrls().find(i=>i.column===e);if(bs(e))return t(this.columnsRowCtrl);if(this.groupsRowCtrls.length!==0)for(let s=0;sthis.comp.setCenterWidth(`${e}px`),!0))}},kP={tag:"div",cls:"ag-pinned-left-header",role:"rowgroup"},LP={tag:"div",cls:"ag-pinned-right-header",role:"rowgroup"},GP={tag:"div",cls:"ag-header-viewport",role:"rowgroup",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eCenterContainer",cls:"ag-header-container",role:"presentation"}]},Zu=class extends A{constructor(e){super(),this.eCenterContainer=x,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:s=>this.setDisplayed(s),setCtrls:s=>this.setCtrls(s),setCenterWidth:s=>this.eCenterContainer.style.width=s,setViewportScrollLeft:s=>this.getGui().scrollLeft=s,setPinnedContainerWidth:s=>{const i=this.getGui();i.style.width=s,i.style.maxWidth=s,i.style.minWidth=s}};this.createManagedBean(new UC(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",s=e?kP:t?LP:GP;this.setTemplate(s),this.eRowContainer=this.eCenterContainer!==x?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),e.getGui().remove()}setCtrls(e){const t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let s;const i=r=>{const o=r.getGui();o.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(o),s&&hm(this.eRowContainer,o,s),s=o};for(const r of e){const o=r.instanceId,n=t[o];delete t[o];const a=n||this.createBean(new FP(r));this.headerRowComps[o]=a,this.rowCompsList.push(a),i(a)}for(const r of Object.values(t))this.destroyRowComp(r)}},OP={tag:"div",cls:"ag-header",role:"presentation"},VP=class extends A{constructor(){super(OP)}postConstruct(){const e={toggleCss:(i,r)=>this.toggleCss(i,r),setHeightAndMinHeight:i=>{this.getGui().style.height=i,this.getGui().style.minHeight=i}};this.createManagedBean(new NC).setComp(e,this.getGui(),this.getFocusableElement());const s=i=>{this.createManagedBean(i),this.appendChild(i)};s(new Zu("left")),s(new Zu(null)),s(new Zu("right"))}},BP={selector:"AG-HEADER-ROOT",component:VP},Rs={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},Qu=class extends E{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.gos.get("domLayout"),t={autoHeight:e==="autoHeight",normal:e==="normal",print:e==="print"},s=t.autoHeight?Rs.AUTO_HEIGHT:t.print?Rs.PRINT:Rs.NORMAL;this.view.updateLayoutClasses(s,t)}},$C=class extends A{constructor(e,t){super(),this.direction=t,this.eViewport=x,this.eContainer=x,this.hideTimeout=0,this.setTemplate(e)}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.toggleCss("ag-apple-scrollbar",mC()||ni())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=vC(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.toggleCss("ag-scrollbar-active",!0),s=()=>this.toggleCss("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:s,touchend:s})}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),Rt(this.beans,()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=0),this.toggleCss("ag-scrollbar-scrolling",!0))},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout(()=>{this.toggleCss("ag-scrollbar-scrolling",!1),this.hideTimeout=0},400)}})}attemptSettingScrollPosition(e){const t=this.eViewport;qd(this,()=>Ne(t),()=>this.setScrollPosition(e),100)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}},NP={tag:"div",cls:"ag-body-horizontal-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eLeftSpacer",cls:"ag-horizontal-left-spacer"},{tag:"div",ref:"eViewport",cls:"ag-body-horizontal-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-horizontal-scroll-container"}]},{tag:"div",ref:"eRightSpacer",cls:"ag-horizontal-right-spacer"}]},KC=class extends $C{constructor(){super(NP,"horizontal"),this.eLeftSpacer=x,this.eRightSpacer=x,this.setScrollVisibleDebounce=0}wireBeans(e){this.visibleCols=e.visibleCols,this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.refreshCompBottom.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.beans.ctrlsSvc.register("fakeHScrollComp",this),this.createManagedBean(new Ku(t=>this.eContainer.style.width=`${t}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.beans.pinnedRowModel?.getPinnedBottomTotalHeight()??0;this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleSvc.verticalScrollShowing;let t=this.visibleCols.getDisplayedColumnsRightWidth();const s=!this.enableRtl&&e,i=this.scrollVisibleSvc.getScrollbarWidth();s&&(t+=i),ts(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=i);let r=this.visibleCols.getColsLeftWidth();this.enableRtl&&e&&(r+=i),ts(this.eLeftSpacer,r),this.eLeftSpacer.classList.toggle("ag-scroller-corner",r<=i)}setScrollVisible(){const e=this.scrollVisibleSvc.horizontalScrollShowing,t=this.invisibleScrollbar,s=this.gos.get("suppressHorizontalScroll"),i=e&&this.scrollVisibleSvc.getScrollbarWidth()||0,o=s?0:i===0&&t?16:i,n=()=>{this.setScrollVisibleDebounce=0,this.toggleCss("ag-scrollbar-invisible",t),pn(this.getGui(),o),pn(this.eViewport,o),pn(this.eContainer,o),o||this.eContainer.style.setProperty("min-height","1px"),this.setVisible(e,{skipAriaHidden:!0})};window.clearTimeout(this.setScrollVisibleDebounce),e?this.setScrollVisibleDebounce=window.setTimeout(n,100):n()}getScrollPosition(){return Ya(this.eViewport,this.enableRtl)}setScrollPosition(e){Ne(this.eViewport)||this.attemptSettingScrollPosition(e),pr(this.eViewport,e,this.enableRtl)}},HP={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:KC},jC=class extends E{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this,this.beans.rowContainerHeight)})}onHeightChanged(e){const t=e.uiContainerHeight,s=t!=null?`${t}px`:"";this.eContainer.style.height=s,this.eViewport&&(this.eViewport.style.height=s)}},zP={tag:"div",cls:"ag-body-vertical-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eViewport",cls:"ag-body-vertical-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-vertical-scroll-container"}]}]},qC=class extends $C{constructor(){super(zP,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new jC(this.eContainer));const{ctrlsSvc:e}=this.beans;e.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this,e)})}setScrollVisible(){const{scrollVisibleSvc:e}=this.beans,t=e.verticalScrollShowing,s=this.invisibleScrollbar,i=t&&e.getScrollbarWidth()||0,r=i===0&&s?16:i;this.toggleCss("ag-scrollbar-invisible",s),ts(this.getGui(),r),ts(this.eViewport,r),ts(this.eContainer,r),this.setDisplayed(t,{skipAriaHidden:!0})}onRowContainerHeightChanged(e){const s=e.getGridBodyCtrl().eBodyViewport,i=this.getScrollPosition(),r=s.scrollTop;i!=r&&this.setScrollPosition(r,!0)}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(e,t){!t&&!Ne(this.eViewport)&&this.attemptSettingScrollPosition(e),this.eViewport.scrollTop=e}},_P={selector:"AG-FAKE-VERTICAL-SCROLL",component:qC},Ju=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(Ju||{}),ki="Viewport",YC="fakeVScrollComp",eh=["fakeHScrollComp","centerHeader","topCenter","bottomCenter","stickyTopCenter","stickyBottomCenter"],XC=100,th=150,WP=class extends E{constructor(e){super(),this.clearRetryListenerFncs=[],this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.lastIsHorizontalScrollShowing=!1,this.scrollTimer=0,this.isScrollActive=!1,this.isVerticalPositionInvalidated=!0,this.isHorizontalPositionInvalidated=!0,this.eBodyViewport=e,this.resetLastHScrollDebounced=Ce(this,()=>this.lastScrollSource[1]=null,th),this.resetLastVScrollDebounced=Ce(this,()=>this.lastScrollSource[0]=null,th)}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.animationFrameSvc=e.animationFrameSvc,this.visibleCols=e.visibleCols}destroy(){super.destroy(),this.clearRetryListenerFncs=[],window.clearTimeout(this.scrollTimer)}postConstruct(){this.enableRtl=this.gos.get("enableRtl");const e=this.invalidateVerticalScroll.bind(this),t=this.invalidateHorizontalScroll.bind(this);this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),bodyHeightChanged:e,scrollGapChanged:t}),this.addManagedElementListeners(this.eBodyViewport,{scroll:e}),this.ctrlsSvc.whenReady(this,s=>{this.centerRowsCtrl=s.center,this.fakeVScrollComp=s.fakeVScrollComp,this.fakeHScrollComp=s.fakeHScrollComp,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}invalidateHorizontalScroll(){this.isHorizontalPositionInvalidated=!0}invalidateVerticalScroll(){this.isVerticalPositionInvalidated=!0}addScrollListener(){this.addHorizontalScrollListeners(),this.addVerticalScrollListeners()}addHorizontalScrollListeners(){this.addManagedElementListeners(this.centerRowsCtrl.eViewport,{scroll:this.onHScroll.bind(this,ki)});for(const e of eh){const t=this.ctrlsSvc.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){const e=this.gos.get("debounceVerticalScrollbar"),t=e?Ce(this,this.onVScroll.bind(this,ki),XC):this.onVScroll.bind(this,ki),s=e?Ce(this,this.onVScroll.bind(this,YC),XC):this.onVScroll.bind(this,YC);this.addManagedElementListeners(this.eBodyViewport,{scroll:t}),this.registerScrollPartner(this.fakeVScrollComp,s)}registerScrollPartner(e,t){e.onScrollCallback(t)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){this.centerRowsCtrl!=null&&(e===void 0&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft()),this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e)))}setScrollLeftForAllContainersExceptCurrent(e){for(const t of[...eh,ki]){if(this.lastScrollSource[1]===t)continue;const s=this.getViewportForSource(t);pr(s,e,this.enableRtl)}}getViewportForSource(e){return e===ki?this.centerRowsCtrl.eViewport:this.ctrlsSvc.get(e).eViewport}isControllingScroll(e,t){return this.lastScrollSource[t]==null?(t===0?this.lastScrollSource[0]=e:this.lastScrollSource[1]=e,!0):this.lastScrollSource[t]===e}onHScroll(e){if(!this.isControllingScroll(e,1))return;const t=this.centerRowsCtrl.eViewport,{scrollLeft:s}=t;if(this.shouldBlockScrollUpdate(1,s,!0))return;const i=Ya(this.getViewportForSource(e),this.enableRtl);this.doHorizontalScroll(i),this.resetLastHScrollDebounced()}onVScroll(e){if(!this.isControllingScroll(e,0))return;const t=e===ki?this.eBodyViewport.scrollTop:this.fakeVScrollComp.getScrollPosition();let s=t;if(this.shouldBlockScrollUpdate(0,s,!0))return;e===ki?this.fakeVScrollComp.setScrollPosition(s):(this.eBodyViewport.scrollTop=t,s=this.eBodyViewport.scrollTop,this.invalidateVerticalScroll(),s!==t&&this.fakeVScrollComp.setScrollPosition(s,!0));const{animationFrameSvc:i}=this;i?.setScrollTop(s),this.nextScrollTop=s,i?.active?i.schedule():this.scrollGridIfNeeded(!0),this.resetLastVScrollDebounced()}doHorizontalScroll(e){const t=this.fakeHScrollComp.getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}isScrolling(){return this.isScrollActive}fireScrollEvent(e){const t={type:"bodyScroll",direction:e===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.isScrollActive=!0,this.eventSvc.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=window.setTimeout(()=>{this.scrollTimer=0,this.isScrollActive=!1,this.eventSvc.dispatchEvent({...t,type:"bodyScrollEnd"})},th)}shouldBlockScrollUpdate(e,t,s=!1){return s&&!ni()?!1:e===0?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=un(this.eBodyViewport),{scrollHeight:s}=this.eBodyViewport;return e<0||e+t>s}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:s}=this.centerRowsCtrl.eViewport;if(this.enableRtl){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>s}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){const e=this.scrollLeft;let t=!1;for(const s of eh)if(this.getViewportForSource(s).scrollLeft!==e){t=!0;break}t&&this.onHScroll(ki)}scrollGridIfNeeded(e=!1){const t=this.scrollTop!=this.nextScrollTop;return t&&(this.scrollTop=this.nextScrollTop,e&&this.invalidateVerticalScroll(),this.redrawRowsAfterScroll()),t}setHorizontalScrollPosition(e,t=!1){const i=this.centerRowsCtrl.eViewport.scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(this.enableRtl?e=e>0?0:i:e=Math.min(Math.max(e,0),i)),pr(this.centerRowsCtrl.eViewport,Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.invalidateVerticalScroll(),this.eBodyViewport.scrollTop=e}getVScrollPosition(){if(!this.isVerticalPositionInvalidated){const{lastOffsetHeight:s,lastScrollTop:i}=this;return{top:i,bottom:i+s}}this.isVerticalPositionInvalidated=!1;const{scrollTop:e,offsetHeight:t}=this.eBodyViewport;return this.lastScrollTop=e,this.lastOffsetHeight=t,{top:e,bottom:e+t}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.isHorizontalPositionInvalidated&&(this.lastIsHorizontalScrollShowing=this.centerRowsCtrl.isHorizontalScrollShowing(),this.isHorizontalPositionInvalidated=!1),this.lastIsHorizontalScrollShowing}scrollHorizontally(e){const t=this.centerRowsCtrl.eViewport.scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.eViewport.scrollLeft-t}scrollToTop(){this.setVerticalScrollPosition(0)}ensureNodeVisible(e,t=null){const{rowModel:s}=this.beans,i=s.getRowCount();let r=-1;for(let o=0;o=0&&this.ensureIndexVisible(r,t)}ensureIndexVisible(e,t,s=0){if(je(this.gos,"print"))return;const{rowModel:i}=this.beans,r=i.getRowCount();if(typeof e!="number"||e<0||e>=r){F(88,{index:e});return}this.clearRetryListeners();const{frameworkOverrides:o,pageBounds:n,rowContainerHeight:a,rowRenderer:l}=this.beans;o.wrapIncoming(()=>{const c=this.ctrlsSvc.getGridBodyCtrl(),d=i.getRow(e);let u,h,g=0;this.invalidateVerticalScroll();do{const{stickyTopHeight:p,stickyBottomHeight:f}=c,m=d.rowTop,C=d.rowHeight,v=n.getPixelOffset(),w=d.rowTop-v,S=w+d.rowHeight,y=this.getVScrollPosition(),R=a.divStretchOffset,P=y.top+R,M=y.bottom+R,T=M-P,I=a.getScrollPositionForPixel(w),k=a.getScrollPositionForPixel(S-T),L=Math.min((I+k)/2,w),j=P+p>w,U=M-fT?O=I-p:O=k+f),O!==null&&(this.setVerticalScrollPosition(O),l.redraw({afterScroll:!0})),u=m!==d.rowTop||C!==d.rowHeight,h=p!==c.stickyTopHeight||f!==c.stickyBottomHeight,g++}while((u||h)&&g<10);if(this.animationFrameSvc?.flushAllFrames(),s<10&&(d?.stub||!this.beans.rowAutoHeight?.areRowsMeasured())){const p=this.getVScrollPosition().top;this.clearRetryListenerFncs=this.addManagedEventListeners({bodyScroll:()=>{const f=this.getVScrollPosition().top;p!==f&&this.clearRetryListeners()},modelUpdated:()=>{this.clearRetryListeners(),!(e>=i.getRowCount())&&this.ensureIndexVisible(e,t,s+1)}})}})}clearRetryListeners(){for(const e of this.clearRetryListenerFncs)e();this.clearRetryListenerFncs=[]}ensureColumnVisible(e,t="auto"){const{colModel:s,frameworkOverrides:i}=this.beans,r=s.getCol(e);if(!r||r.isPinned()||!this.visibleCols.isColDisplayed(r))return;const o=this.getPositionedHorizontalScroll(r,t);i.wrapIncoming(()=>{o!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(o),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameSvc?.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:s,columnAfterEnd:i}=this.isColumnOutsideViewport(e),r=this.centerRowsCtrl.getCenterWidth()r:si;return{columnBeforeStart:n,columnAfterEnd:a}}getColumnBounds(e){const t=this.enableRtl,s=this.visibleCols.bodyWidth,i=e.getActualWidth(),r=e.getLeft(),o=t?-1:1,n=t?s-r:r,a=n+i*o,l=n+i/2*o;return{colLeft:n,colMiddle:l,colRight:a}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft(),s=t,i=e+t;return{start:s,end:i,width:e}}},ZC={horizontal:{overflow:e=>e.scrollWidth-e.clientWidth,scrollSize:e=>e.scrollWidth,clientSize:e=>e.clientWidth,opposite:"vertical"},vertical:{overflow:e=>e.scrollHeight-e.clientHeight,scrollSize:e=>e.scrollHeight,clientSize:e=>e.clientHeight,opposite:"horizontal"}};function UP(e,t,s=Tu()||0,i,r){return QC(e,t,"horizontal",s,i,r)}function $P(e,t,s=Tu()||0,i,r){return QC(e,t,"vertical",s,i,r)}function QC(e,t,s,i,r,o){const n=ZC[s],a=ZC[n.opposite],l=r?Ne(r):!0,c=o?Ne(o):!0,d=n.overflow(e);if(d<=0)return!1;if(!t||i===0)return!0;const u=a.overflow(t);if(u<=0)return!0;if(d<=i){if(l&&c&&KP({candidateOverflow:u,candidateScrollSize:a.scrollSize(t),candidateClientSize:a.clientSize(t),scrollbarWidth:i}))return!1;const h=n.clientSize(e)+i;return n.scrollSize(e)<=h}return!0}function KP({candidateOverflow:e,candidateScrollSize:t,candidateClientSize:s,scrollbarWidth:i}){if(e<=0||e>i)return!1;const r=s+i;return t>s&&t<=r}var jP=class extends E{constructor(e){super(),this.centerContainerCtrl=e}wireBeans(e){this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const{beans:e,centerContainerCtrl:t,gridBodyCtrl:s}=this,i=()=>{Rt(e,()=>{this.onCenterViewportResized()})};t.registerViewportResizeListener(i),s.registerBodyViewportResizeListener(i)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleSvc.updateScrollGap(),this.centerContainerCtrl.isViewportInTheDOMTree()){const{pinnedCols:e,colFlex:t}=this.beans;e?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const s=this.centerContainerCtrl.getCenterWidth();s!==this.centerWidth&&(this.centerWidth=s,t?.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.scrollFeature.checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=this.gridBodyCtrl.eBodyViewport,t=un(e);this.bodyHeight!==t&&(this.bodyHeight=t,this.eventSvc.dispatchEvent({type:"bodyHeightChanged"}))}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){if(!this.isAlive())return;const e={horizontalScrollShowing:this.centerContainerCtrl.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleSvc.setScrollsVisible(e)}onHorizontalViewportChanged(){const{centerContainerCtrl:e,beans:t}=this,s=e.getCenterWidth(),i=e.getViewportScrollLeft();t.colViewport.setScrollPosition(s,i)}};function Il(e){return e.altKey||e.ctrlKey||e.metaKey?!1:e.key?.length===1}function Nn(e,t,s,i){const r=t.getColDef().cellRendererParams?.suppressMouseEventHandling;return JC(e,t,s,i,r)}function qP(e,t,s,i){const r=t?.suppressMouseEventHandling;return JC(e,void 0,s,i,r)}function JC(e,t,s,i,r){return r?r(N(e,{column:t,node:s,event:i})):!1}function ev(e,t,s){let i=t;for(;i;){const r=_m(e,i,s);if(r)return r;i=i.parentElement}return null}var kl="cellCtrl";function Hn(e,t){return ev(e,t,kl)}var Ll="renderedRow";function sh(e,t){return ev(e,t,Ll)}function ih(e,t,s,i,r){const o=i?i.getColDef().suppressKeyboardEvent:void 0;if(!o)return!1;const n=N(e,{event:t,editing:r,column:i,node:s,data:s.data,colDef:i.getColDef()});return!!(o&&o(n))}function rh(e){const{pinnedRowModel:t,rowModel:s,rangeSvc:i,visibleCols:r}=e;if(!i||r.allCols.length===0)return;const o=t?.isEmpty("top")??!0,n=t?.isEmpty("bottom")??!0,a=o?null:"top";let l,c;n?(l=null,c=s.getRowCount()-1):(l="bottom",c=t?.getPinnedBottomRowCount()??-1),i.setCellRange({rowStartIndex:0,rowStartPinned:a,rowEndIndex:c,rowEndPinned:l})}var YP=class extends E{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.beans.touchSvc?.mockRowContextMenu(this),this.editSvc=this.beans.editSvc}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){let e="mousedown";Ja("pointerdown")?e="pointerdown":Ja("touchstart")&&(e="touchstart");const t=["dblclick","contextmenu","mouseover","mouseout","click",e];for(const s of t){const i=this.processMouseEvent.bind(this,s);this.addManagedElementListeners(this.element,{[s]:i})}}processMouseEvent(e,t){if(!mn(this.beans,t)||Gt(t))return;const{cellCtrl:s,rowCtrl:i}=this.getControlsForEventTarget(t.target);e==="contextmenu"?(s?.column&&s.dispatchCellContextMenuEvent(t),this.beans.contextMenuSvc?.handleContextMenuMouseEvent(t,void 0,i,s)):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}getControlsForEventTarget(e){const{gos:t}=this;return{cellCtrl:Hn(t,e),rowCtrl:sh(t,e)}}processKeyboardEvent(e,t){const{cellCtrl:s,rowCtrl:i}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(s?this.processCellKeyboardEvent(s,e,t):i?.isFullWidth()&&this.processFullWidthRowKeyboardEvent(i,e,t))}processCellKeyboardEvent(e,t,s){const i=this.editSvc?.isEditing(e,{withOpenEditor:!0})??!1;!ih(this.gos,s,e.rowNode,e.column,i)&&t==="keydown"&&(!i&&this.beans.navigation?.handlePageScrollingKey(s)||e.onKeyDown(s),this.doGridOperations(s,i),Il(s)&&e.processCharacter(s)),t==="keydown"&&this.eventSvc.dispatchEvent(e.createEvent(s,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,s){const{rowNode:i}=e,{focusSvc:r,navigation:o}=this.beans,a=r.getFocusedCell()?.column;if(!ih(this.gos,s,i,a,!1)){const c=s.key;if(t==="keydown")switch(c){case b.PAGE_HOME:case b.PAGE_END:case b.PAGE_UP:case b.PAGE_DOWN:o?.handlePageScrollingKey(s,!0);break;case b.LEFT:case b.RIGHT:if(!this.gos.get("embedFullWidthRows"))break;case b.UP:case b.DOWN:e.onKeyboardNavigate(s);break;case b.TAB:e.onTabKeyDown(s);break;default:}}t==="keydown"&&this.eventSvc.dispatchEvent(e.createRowEvent("cellKeyDown",s))}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!mn(this.beans,e))return;const s=nC(e),{clipboardSvc:i,undoRedo:r}=this.beans;if(s===b.A)return this.onCtrlAndA(e);if(s===b.C)return this.onCtrlAndC(i,e);if(s===b.D)return this.onCtrlAndD(i,e);if(s===b.V)return this.onCtrlAndV(i,e);if(s===b.X)return this.onCtrlAndX(i,e);if(s===b.Y)return this.onCtrlAndY(r);if(s===b.Z)return this.onCtrlAndZ(r,e)}onCtrlAndA(e){const{beans:{rowModel:t,rangeSvc:s,selectionSvc:i},gos:r}=this;s&&mt(r)&&!_F(r)&&t.isRowsToRender()?rh(this.beans):i&&i.selectAllRowNodes({source:"keyboardSelectAll",selectAll:jm(r)}),e.preventDefault()}onCtrlAndC(e,t){if(!e||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:s}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(s,{withOpenEditor:!0})||(t.preventDefault(),e.copyToClipboard())}onCtrlAndX(e,t){if(!e||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:s}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(s,{withOpenEditor:!0})||(t.preventDefault(),e.cutToClipboard(void 0,"ui"))}onCtrlAndV(e,t){const{cellCtrl:s}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(s,{withOpenEditor:!0})||e&&!this.gos.get("suppressClipboardPaste")&&e.pasteFromClipboard()}onCtrlAndD(e,t){e&&!this.gos.get("suppressClipboardPaste")&&e.copyRangeDown(),t.preventDefault()}onCtrlAndZ(e,t){!this.gos.get("undoRedoCellEditing")||!e||(t.preventDefault(),t.shiftKey?e.redo("ui"):e.undo("ui"))}onCtrlAndY(e){e?.redo("ui")}},Gl=e=>e.topRowCtrls,Ol=e=>e.getStickyTopRowCtrls(),Vl=e=>e.getStickyBottomRowCtrls(),Bl=e=>e.bottomRowCtrls,Nl=e=>e.allRowCtrls,oh=e=>e.getCtrls("top"),nh=e=>e.getCtrls("center"),ah=e=>e.getCtrls("bottom"),XP={center:{type:"center",name:"center-cols",getRowCtrls:Nl,getSpannedRowCtrls:nh},left:{type:"left",name:"pinned-left-cols",pinnedType:"left",getRowCtrls:Nl,getSpannedRowCtrls:nh},right:{type:"right",name:"pinned-right-cols",pinnedType:"right",getRowCtrls:Nl,getSpannedRowCtrls:nh},fullWidth:{type:"fullWidth",name:"full-width",fullWidth:!0,getRowCtrls:Nl},topCenter:{type:"center",name:"floating-top",getRowCtrls:Gl,getSpannedRowCtrls:oh},topLeft:{type:"left",name:"pinned-left-floating",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:Gl,getSpannedRowCtrls:oh},topRight:{type:"right",name:"pinned-right-floating",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:Gl,getSpannedRowCtrls:oh},topFullWidth:{type:"fullWidth",name:"floating-top-full-width",fullWidth:!0,getRowCtrls:Gl},stickyTopCenter:{type:"center",name:"sticky-top",getRowCtrls:Ol},stickyTopLeft:{type:"left",name:"pinned-left-sticky-top",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:Ol},stickyTopRight:{type:"right",name:"pinned-right-sticky-top",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:Ol},stickyTopFullWidth:{type:"fullWidth",name:"sticky-top-full-width",fullWidth:!0,getRowCtrls:Ol},stickyBottomCenter:{type:"center",name:"sticky-bottom",getRowCtrls:Vl},stickyBottomLeft:{type:"left",name:"pinned-left-sticky-bottom",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:Vl},stickyBottomRight:{type:"right",name:"pinned-right-sticky-bottom",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:Vl},stickyBottomFullWidth:{type:"fullWidth",name:"sticky-bottom-full-width",fullWidth:!0,getRowCtrls:Vl},bottomCenter:{type:"center",name:"floating-bottom",getRowCtrls:Bl,getSpannedRowCtrls:ah},bottomLeft:{type:"left",name:"pinned-left-floating-bottom",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:Bl,getSpannedRowCtrls:ah},bottomRight:{type:"right",name:"pinned-right-floating-bottom",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:Bl,getSpannedRowCtrls:ah},bottomFullWidth:{type:"fullWidth",name:"floating-bottom-full-width",fullWidth:!0,getRowCtrls:Bl}};function lh(e){return`ag-${go(e).name}-viewport`}function ch(e){const t=go(e);return t.container??`ag-${t.name}-container`}function tv(e){return`ag-${go(e).name}-spanned-cells-container`}function go(e){return XP[e]}var ZP=["topCenter","topLeft","topRight"],QP=["bottomCenter","bottomLeft","bottomRight"],JP=["center","left","right"],eM=["center","left","right","fullWidth"],tM=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],sM=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],iM=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],sv=["stickyTopCenter","stickyTopLeft","stickyTopRight"],iv=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],rM=[...sv,"stickyTopFullWidth",...iv,"stickyBottomFullWidth"],oM=[...ZP,...QP,...JP,...sv,...iv],rv=class extends E{constructor(e){super(),this.name=e,this.visible=!0,this.EMPTY_CTRLS=[],this.options=go(e)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new jP(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.beans.ctrlsSvc.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}setComp(e,t,s,i){this.comp=e,this.eContainer=t,this.eSpannedContainer=s,this.eViewport=i,this.createManagedBean(new YP(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();const{pinnedCols:r,rangeSvc:o}=this.beans,n=()=>this.onPinnedWidthChanged();this.forContainers(sM,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(r?.createPinnedWidthFeature(!0,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:n})}),this.forContainers(iM,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(r?.createPinnedWidthFeature(!1,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:n})}),this.forContainers(eM,()=>this.createManagedBean(new jC(this.eContainer,this.name==="center"?i:void 0))),o&&this.forContainers(oM,()=>this.createManagedBean(o.createDragListenerFeature(this.eContainer))),this.forContainers(tM,()=>this.createManagedBean(new Ku(a=>this.comp.setContainerWidth(`${a}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}addListeners(){const{spannedRowRenderer:e,gos:t}=this.beans,s=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({displayedColumnsChanged:s,displayedColumnsWidthChanged:s,displayedRowsChanged:i=>this.onDisplayedRowsChanged(i.afterScroll)}),s(),this.onDisplayedRowsChanged(),e&&this.options.getSpannedRowCtrls&&t.get("enableCellSpan")&&this.addManagedListeners(e,{spannedRowsUpdated:()=>{const i=this.options.getSpannedRowCtrls(e);i&&this.comp.setSpannedRowCtrls(i,!1)}})}listenOnDomOrder(){if(rM.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const t=()=>{const s=this.gos.get("ensureDomOrder"),i=je(this.gos,"print");this.comp.setDomOrder(s||i)};this.addManagedPropertyListener("domLayout",t),t()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const{dragSvc:e}=this.beans;if(!e)return;const t=s=>{e.dragging&&s.cancelable&&s.preventDefault()};this.eContainer.addEventListener("touchmove",t,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",t))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),s=this.getCenterViewportScrollLeft();this.beans.colViewport.setScrollPosition(t,s,e)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return gr(this.eViewport)}getCenterViewportScrollLeft(){return Ya(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=vs(this.beans,this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return um(this.eViewport)}getViewportScrollLeft(){return Ya(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){const{beans:e,gos:t,eViewport:s}=this,i=t.get("alwaysShowHorizontalScroll"),{ctrlsSvc:r}=e,o=r.getGridBodyCtrl()?.eBodyViewport,n=r.get("fakeHScrollComp")?.getGui(),a=r.get("fakeVScrollComp")?.getGui();return i||UP(s,o,void 0,n,a)}setHorizontalScroll(e){this.comp.setHorizontalScroll(e)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){pr(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(this.options.pinnedType!=null)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.beans.rowRenderer);if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const s=je(this.gos,"print"),r=this.gos.get("embedFullWidthRows")||s,o=t.filter(n=>{const a=n.isFullWidth();return this.options.fullWidth?!r&&a:r||!a});this.comp.setRowCtrls({rowCtrls:o,useFlushSync:e})}},ov="ag-force-vertical-scroll",nM="ag-selectable",aM="ag-column-moving",nv=class extends E{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.colModel=e.colModel,this.scrollVisibleSvc=e.scrollVisibleSvc,this.pinnedRowModel=e.pinnedRowModel,this.filterManager=e.filterManager,this.rowGroupColsSvc=e.rowGroupColsSvc}setComp(e,t,s,i,r,o,n){this.comp=e,this.eGridBody=t,this.eBodyViewport=s,this.eTop=i,this.eBottom=r,this.eStickyTop=o,this.eStickyBottom=n,this.eCenterColsViewport=s.querySelector(`.${lh("center")}`),this.eFullWidthContainer=s.querySelector(`.${ch("fullWidth")}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",a=>this.setCellTextSelection(a.currentValue)),this.createManagedBean(new Qu(this.comp)),this.scrollFeature=this.createManagedBean(new WP(s)),this.beans.rowDragSvc?.setupRowDrag(s,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([i,s,r,o,n]),this.setGridRootRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),this.filterManager?.setupAdvFilterHeaderComp(i),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){const e=this.setFloatingHeights.bind(this),t=this.setGridRootRole.bind(this),s=this.toggleRowResizeStyles.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.updateScrollingClasses.bind(this),pinnedRowDataChanged:e,pinnedHeightChanged:e,pinnedRowsChanged:e,headerHeightChanged:this.setStickyTopOffsetTop.bind(this),columnRowGroupChanged:t,columnPivotChanged:t,rowResizeStarted:s,rowResizeEnded:s}),this.addManagedPropertyListener("treeData",t)}toggleRowResizeStyles(e){const t=e.type==="rowResizeStarted";this.eBodyViewport.classList.toggle("ag-prevent-animation",t)}onGridColumnsChanged(){const e=this.beans.colModel.getCols();this.comp.setColumnCount(e.length)}onScrollVisibilityChanged(){const{scrollVisibleSvc:e}=this,t=e.verticalScrollShowing;this.setVerticalScrollPaddingVisible(t),this.setStickyWidth(t),this.setStickyBottomOffsetBottom();const s=t&&e.getScrollbarWidth()||0,i=vC()?16:0,r=`calc(100% + ${s+i}px)`;Rt(this.beans,()=>this.comp.setBodyViewportWidth(r)),this.updateScrollingClasses()}setGridRootRole(){const{rowGroupColsSvc:e,colModel:t,gos:s}=this;let i=s.get("treeData");if(!i){const r=t.isPivotMode();i=(e?e.columns.length:0)>=(r?2:1)}this.comp.setGridRootRole(i?"treegrid":"grid")}addFocusListeners(e){for(const t of e)this.addManagedElementListeners(t,{focusin:s=>{const{target:i}=s,r=ur(i,"ag-root",t);t.classList.toggle("ag-has-focus",!r)},focusout:s=>{const{target:i,relatedTarget:r}=s,o=t.contains(r),n=ur(r,"ag-root",t);ur(i,"ag-root",t)||(!o||n)&&t.classList.remove("ag-has-focus")}})}setColumnMovingCss(e){this.comp.setColumnMovingCss(aM,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(nM,e)}updateScrollingClasses(){const{eGridBody:{classList:e},scrollVisibleSvc:t}=this;e.toggle("ag-body-vertical-content-no-gap",!t.verticalScrollGap),e.toggle("ag-body-horizontal-content-no-gap",!t.horizontalScrollGap)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){this.beans.editSvc?.addStopEditingWhenGridLosesFocus([this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom])}updateRowCount(){const e=(this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.filterManager?.getHeaderRowCount()??0),{rowModel:t}=this.beans,s=t.isLastRowIndexKnown()?t.getRowCount():-1,i=s===-1?-1:e+s;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const{gos:e,comp:t,ctrlsSvc:s}=this,i=e.get("alwaysShowVerticalScroll"),r=i?ov:null,o=je(e,"normal");t.setAlwaysVerticalScrollClass(r,i);const n=s.get("center")?.eViewport,a=s.get("fakeHScrollComp")?.getGui(),l=s.get("fakeVScrollComp")?.getGui();return i||o&&$P(this.eBodyViewport,n,void 0,l,a)}setupRowAnimationCssClass(){const{rowContainerHeight:e,environment:t}=this.beans;let s=t.sizesMeasured;const i=()=>{const r=s&&Cr(this.gos)&&!e.stretching,o=r?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(o,r)};i(),this.addManagedEventListeners({heightScaleChanged:i}),this.addManagedPropertyListener("animateRows",i),this.addManagedEventListeners({stylesChanged:()=>{!s&&t.sizesMeasured&&(s=!0,i())}})}addBodyViewportListener(){const{eBodyViewport:e,eStickyTop:t,eStickyBottom:s,eTop:i,eBottom:r,beans:{popupSvc:o,touchSvc:n}}=this,a=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(e,{contextmenu:a}),n?.mockBodyContextMenu(this,a),this.addManagedElementListeners(e,{wheel:this.onBodyViewportWheel.bind(this,o)});const l=this.onStickyWheel.bind(this);for(const d of[t,s,i,r])this.addManagedElementListeners(d,{wheel:l});const c=this.onHorizontalWheel.bind(this);for(const d of["left","right","topLeft","topRight","bottomLeft","bottomRight"])this.addManagedElementListeners(this.ctrlsSvc.get(d).eContainer,{wheel:c});this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:e=>this.onFullWidthContainerWheel(e)})}onFullWidthContainerWheel(e){const{deltaX:t,deltaY:s,shiftKey:i}=e;(i||Math.abs(t)>Math.abs(s))&&mn(this.beans,e)&&this.scrollGridBodyToMatchEvent(e)}onStickyWheel(e){const{deltaY:t}=e;this.scrollVertically(t)>0&&e.preventDefault()}onHorizontalWheel(e){const{deltaX:t,deltaY:s,shiftKey:i}=e;(i||Math.abs(t)>Math.abs(s))&&this.scrollGridBodyToMatchEvent(e)}scrollGridBodyToMatchEvent(e){const{deltaX:t,deltaY:s}=e;e.preventDefault(),this.eCenterColsViewport.scrollBy({left:t||s})}onBodyViewportContextMenu(e,t,s){if(!e&&!s)return;this.gos.get("preventDefaultOnContextMenu")&&(e||s).preventDefault();const{target:i}=e||t;(i===this.eBodyViewport||i===this.ctrlsSvc.get("center").eViewport)&&this.beans.contextMenuSvc?.showContextMenu({mouseEvent:e,touchEvent:s,value:null,anchorToElement:this.eGridBody,source:"ui"})}onBodyViewportWheel(e,t){this.gos.get("suppressScrollWhenPopupsAreOpen")&&e?.hasAnchoredPopup()&&t.preventDefault()}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.scrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}setFloatingHeights(){const{pinnedRowModel:e,beans:{environment:t}}=this,s=e?.getPinnedTopTotalHeight(),i=e?.getPinnedBottomTotalHeight(),r=t.getPinnedRowBorderWidth(),o=t.getRowBorderWidth(),n=r-o,a=s?n+s:0,l=i?n+i:0;this.comp.setTopHeight(a),this.comp.setBottomHeight(l),this.comp.setTopInvisible(a<=0),this.comp.setBottomInvisible(l<=0),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}setStickyWidth(e){if(!e)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const t=this.scrollVisibleSvc.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`)}}setStickyTopOffsetTop(){const t=this.ctrlsSvc.get("gridHeaderCtrl").headerHeight+(this.filterManager?.getHeaderHeight()??0),s=this.pinnedRowModel?.getPinnedTopTotalHeight()??0;let i=0;t>0&&(i+=t),s>0&&(i+=s),i>0&&(i+=1),this.comp.setStickyTopTop(`${i}px`)}setStickyBottomOffsetBottom(){const{pinnedRowModel:e,scrollVisibleSvc:t,comp:s}=this,i=e?.getPinnedBottomTotalHeight()??0,o=t.horizontalScrollShowing&&t.getScrollbarWidth()||0,n=i+o;s.setStickyBottomBottom(`${n}px`)}};function re(e){return $e(e)}var lM=class extends A{constructor(e,t,s,i,r){super(),this.cellCtrl=t,this.rowResizerElement=null,this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.gos=e.gos,this.column=t.column,this.rowNode=t.rowNode,this.eRow=i;const o=re({tag:"div",role:t.getCellAriaRole(),attrs:{"comp-id":`${this.getCompId()}`,"col-id":t.column.colIdSanitised}});this.eCell=o;let n;t.isCellSpanning()?(n=re({tag:"div",cls:"ag-spanned-cell-wrapper",role:"presentation"}),n.appendChild(o),this.setTemplateFromElement(n)):this.setTemplateFromElement(o),this.cellCssManager=new bu(()=>o),this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const a={toggleCss:(l,c)=>this.cellCssManager.toggleCss(l,c),setUserStyles:l=>gn(o,l),getFocusableElement:()=>o,setIncludeSelection:l=>this.includeSelection=l,setIncludeRowDrag:l=>this.includeRowDrag=l,setIncludeDndSource:l=>this.includeDndSource=l,setRowResizerElement:l=>this.setRowResizerElement(l),setRenderDetails:(l,c,d)=>this.setRenderDetails(l,c,d),setEditDetails:(l,c,d)=>this.setEditDetails(l,c,d),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue(),refreshEditStyles:(l,c)=>this.refreshEditStyles(l,c)};t.setComp(a,o,n,this.eCellWrapper,s,r,void 0)}getParentOfValue(){return this.eCellValue??this.eCellWrapper??this.eCell}setRowResizerElement(e){this.rowResizerElement&&ue(this.rowResizerElement),this.rowResizerElement=e,e&&this.eCell.appendChild(e)}setRenderDetails(e,t,s){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const r=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(s||r)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t)),this.rowDraggingComp?.refreshVisibility(),this.rowResizerElement&&!this.rowResizerElement.parentElement&&this.eCell.appendChild(this.rowResizerElement)}setEditDetails(e,t,s){e?this.createCellEditorInstance(e,t,s):this.destroyEditor()}removeControls(){const e=this.beans.context;this.checkboxSelectionComp=e.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=e.destroyBean(this.dndSourceComp),this.rowDraggingComp=e.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,s=t||this.forceWrapper,i=s&&this.eCellWrapper==null;i&&(this.eCellWrapper=re({tag:"div",cls:"ag-cell-wrapper",role:"presentation"}),this.eCell.appendChild(this.eCellWrapper));const r=!s&&this.eCellWrapper!=null;r&&(ue(this.eCellWrapper),this.eCellWrapper=void 0),this.cellCssManager.toggleCss("ag-cell-value",!s);const o=!e&&s,n=o&&this.eCellValue==null;if(n){const c=this.cellCtrl.getCellValueClass();this.eCellValue=re({tag:"span",cls:c,role:"presentation"}),this.eCellWrapper.appendChild(this.eCellValue)}const a=!o&&this.eCellValue!=null;a&&(ue(this.eCellValue),this.eCellValue=void 0);const l=i||r||n||a;return l&&this.removeControls(),!e&&t&&this.addControls(),l}addControls(){const{cellCtrl:e,eCellWrapper:t,eCellValue:s,includeRowDrag:i,includeDndSource:r,includeSelection:o}=this,n=a=>{a&&t.insertBefore(a.getGui(),s)};i&&this.rowDraggingComp==null&&(this.rowDraggingComp=e.createRowDragComp(),n(this.rowDraggingComp)),r&&this.dndSourceComp==null&&(this.dndSourceComp=e.createDndSource(),n(this.dndSourceComp)),o&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=e.createSelectionCheckbox(),n(this.checkboxSelectionComp))}createCellEditorInstance(e,t,s){const i=this.editorVersion,r=e.newAgStackInstance(),{params:o}=e;r.then(a=>this.afterCellEditorCreated(i,a,o,t,s)),ne(this.cellEditor)&&o.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();ee(t);const s=es(e);s!=null&&(t.textContent=s)}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),ue(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;(this.cellEditorPopupWrapper?.getGui().contains(ie(this.beans))||this.cellCtrl.hasBrowserFocus())&&this.eCell.focus({preventScroll:!0}),this.hideEditorPopup?.(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),ue(this.cellEditorGui),this.cellCtrl.disableEditorTooltipFeature(),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer?.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){const t=this.rendererVersion,s=o=>n=>{if(this.rendererVersion!==t||!this.isAlive())return;const l=o.newAgStackInstance(),c=this.afterCellRendererCreated.bind(this,t,o.componentClass);l?.then(c)},{animationFrameSvc:i}=this.beans;let r;if(i?.active&&this.firstRender?r=(o,n=!1)=>{i.createTask(s(o),this.rowNode.rowIndex,"p2",o.componentFromFramework,n)}:r=o=>s(o)(),e.params?.deferRender&&!this.cellCtrl.rowNode.group){const{loadingComp:o,onReady:n}=this.cellCtrl.getDeferLoadingCellRenderer();o&&(r(o),n.then(()=>r(e,!0)))}else r(e)}afterCellRendererCreated(e,t,s){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(s);return}this.cellRenderer=s,this.cellRendererClass=t;const r=s.getGui();if(this.cellRendererGui=r,r!=null){const o=this.getParentOfValue();ee(o),o.appendChild(r)}}afterCellEditorCreated(e,t,s,i,r){const o=e!==this.editorVersion,{context:n}=this.beans;if(o){n.destroyBean(t);return}if(t.isCancelBeforeStart?.()){n.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){F(97,{colId:this.column.getId()}),n.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const l=i||t.isPopup?.();l?this.addPopupCellEditor(s,r):this.addInCellEditor(),this.refreshEditStyles(!0,l),t.afterGuiAttached?.(),this.cellCtrl.enableEditorTooltipFeature(t),this.cellCtrl.cellEditorAttached()}refreshEditStyles(e,t){const{cellCssManager:s}=this;s.toggleCss("ag-cell-inline-editing",e&&!t),s.toggleCss("ag-cell-popup-editing",e&&!!t),s.toggleCss("ag-cell-not-inline-editing",!e||!!t)}addInCellEditor(){const{eCell:e}=this;e.contains(ie(this.beans))&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),ee(this.getParentOfValue()),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){const{gos:s,context:i,popupSvc:r,editSvc:o}=this.beans;s.get("editType")==="fullRow"&&F(98);const n=this.cellEditorPopupWrapper=i.createBean(o.createPopupEditorWrapper(e)),{cellEditor:a,cellEditorGui:l,eCell:c,rowNode:d,column:u,cellCtrl:h}=this,g=n.getGui();l&&g.appendChild(l);const p=s.get("stopEditingWhenCellsLoseFocus"),f=t??a.getPopupPosition?.()??"over",m=s.get("enableRtl"),C={ePopup:g,additionalParams:{column:u,rowNode:d},type:"popupCellEditor",eventSource:c,position:f,alignSide:m?"right":"left",keepWithinBounds:!0},v=r.positionPopupByComponent.bind(r,C),w=r.addPopup({modal:p,eChild:g,closeOnEsc:!0,closedCallback:S=>{h.onPopupEditorClosed(S)},anchorToElement:c,positionCallback:v,ariaOwns:c});w&&(this.hideEditorPopup=w.hideFunc)}detach(){this.getGui().remove()}destroy(){this.destroyRenderer(),this.destroyEditor(),this.removeControls(),super.destroy()}},cM=class extends A{constructor(e,t,s){super(),this.cellComps=new Map,this.beans=t,this.rowCtrl=e;const i=re({tag:"div",role:"row",attrs:{"comp-id":`${this.getCompId()}`}});this.setInitialStyle(i,s),this.setTemplateFromElement(i);const r=i.style;this.domOrder=this.rowCtrl.getDomOrder();const o={setDomOrder:n=>this.domOrder=n,setCellCtrls:n=>this.setCellCtrls(n),showFullWidth:n=>this.showFullWidth(n),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,getFullWidthCellRendererParams:()=>this.fullWidthCellRendererParams,toggleCss:(n,a)=>this.toggleCss(n,a),setUserStyles:n=>gn(i,n),setTop:n=>r.top=n,setTransform:n=>r.transform=n,setRowIndex:n=>i.setAttribute("row-index",n),setRowId:n=>i.setAttribute("row-id",n),setRowBusinessKey:n=>i.setAttribute("row-business-key",n),refreshFullWidth:n=>{const a=n();return this.fullWidthCellRendererParams=a,this.fullWidthCellRenderer?.refresh?.(a)??!1}};e.setComp(o,this.getGui(),s,void 0),this.addDestroyFunc(()=>{e.unsetComp(s)})}setInitialStyle(e,t){const s=this.rowCtrl.getInitialTransform(t);if(s)e.style.setProperty("transform",s);else{const i=this.rowCtrl.getInitialRowTop(t);i&&e.style.setProperty("top",i)}}showFullWidth(e){const t=i=>{if(this.isAlive()){const r=i.getGui();this.getGui().appendChild(r),this.rowCtrl.setupDetailRowAutoHeight(r),this.setFullWidthRowComp(i,e.params)}else this.beans.context.destroyBean(i)};e.newAgStackInstance().then(t)}setCellCtrls(e){const t=new Map(this.cellComps);for(const s of e){const i=s.instanceId;this.cellComps.has(i)?t.delete(i):this.newCellComp(s)}this.destroyCells(t),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];for(const s of e){const i=this.cellComps.get(s.instanceId);i&&t.push(i.getGui())}gm(this.getGui(),t)}newCellComp(e){const t=this.beans.editSvc?.isEditing(e,{withOpenEditor:!0})??!1,s=new lM(this.beans,e,this.rowCtrl.printLayout,this.getGui(),t);this.cellComps.set(e.instanceId,s),this.getGui().appendChild(s.getGui())}destroy(){super.destroy(),this.destroyCells(this.cellComps)}setFullWidthRowComp(e,t){this.fullWidthCellRenderer=e,this.fullWidthCellRendererParams=t,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer),this.fullWidthCellRendererParams=void 0})}destroyCells(e){for(const t of e.values()){if(!t)continue;const s=t.cellCtrl.instanceId;this.cellComps.get(s)===t&&(t.detach(),t.destroy(),this.cellComps.delete(s))}}};function dM(e,t,s){const i=!!s.gos.get("enableCellSpan")&&!!t.getSpannedRowCtrls,r={tag:"div",ref:"eContainer",cls:ch(e),role:"rowgroup"};if(t.type==="center"||i){const o={tag:"div",ref:"eSpannedContainer",cls:`ag-spanning-container ${tv(e)}`,role:"presentation"};return r.role="presentation",{tag:"div",ref:"eViewport",cls:`ag-viewport ${lh(e)}`,role:"rowgroup",children:[r,i?o:null]}}return r}var uM=class extends A{constructor(e){super(),this.eViewport=x,this.eContainer=x,this.eSpannedContainer=x,this.rowCompsNoSpan={},this.rowCompsWithSpan={},this.name=e?.name,this.options=go(this.name)}postConstruct(){this.setTemplate(dM(this.name,this.options,this.beans));const e={setHorizontalScroll:s=>this.eViewport.scrollLeft=s,setViewportHeight:s=>this.eViewport.style.height=s,setRowCtrls:({rowCtrls:s})=>this.setRowCtrls(s),setSpannedRowCtrls:s=>this.setRowCtrls(s,!0),setDomOrder:s=>{this.domOrder=s},setContainerWidth:s=>{this.eContainer.style.width=s,this.eSpannedContainer&&(this.eSpannedContainer.style.width=s)},setOffsetTop:s=>{const i=`translateY(${s})`;this.eContainer.style.transform=i,this.eSpannedContainer&&(this.eSpannedContainer.style.transform=i)}};this.createManagedBean(new rv(this.name)).setComp(e,this.eContainer,this.eSpannedContainer,this.eViewport)}destroy(){this.setRowCtrls([]),this.setRowCtrls([],!0),super.destroy(),this.lastPlacedElement=null}setRowCtrls(e,t){const{beans:s,options:i}=this,r=t?this.eSpannedContainer:this.eContainer,o=t?{...this.rowCompsWithSpan}:{...this.rowCompsNoSpan},n={};t?this.rowCompsWithSpan=n:this.rowCompsNoSpan=n,this.lastPlacedElement=null;const a=[];for(const l of e){const c=l.instanceId,d=o[c];let u;if(d)u=d,delete o[c];else{if(!l.rowNode.displayed)continue;u=new cM(l,s,i.type)}n[c]=u,a.push([u,!d])}this.removeOldRows(Object.values(o)),this.addRowNodes(a,r)}addRowNodes(e,t){const{domOrder:s}=this;for(const[i,r]of e){const o=i.getGui();s?this.ensureDomOrder(o,t):r&&t.appendChild(o)}}removeOldRows(e){for(const t of e)t.getGui().remove(),t.destroy()}ensureDomOrder(e,t){hm(t,e,this.lastPlacedElement),this.lastPlacedElement=e}},hM={selector:"AG-ROW-CONTAINER",component:uM};function zn(e,t){return t.map(s=>{const i=`e${s[0].toUpperCase()+s.substring(1)}RowContainer`;return e[i]={name:s},{tag:"ag-row-container",ref:i,attrs:{name:s}}})}function gM(e){const t={},s={tag:"div",ref:"eGridRoot",cls:"ag-root ag-unselectable",children:[{tag:"ag-header-root"},{tag:"div",ref:"eTop",cls:"ag-floating-top",role:"presentation",children:zn(t,["topLeft","topCenter","topRight","topFullWidth"])},{tag:"div",ref:"eBody",cls:"ag-body",role:"presentation",children:[{tag:"div",ref:"eBodyViewport",cls:"ag-body-viewport",role:"presentation",children:zn(t,["left","center","right","fullWidth"])},{tag:"ag-fake-vertical-scroll"}]},{tag:"div",ref:"eStickyTop",cls:"ag-sticky-top",role:"presentation",children:zn(t,["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])},{tag:"div",ref:"eStickyBottom",cls:"ag-sticky-bottom",role:"presentation",children:zn(t,["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])},{tag:"div",ref:"eBottom",cls:"ag-floating-bottom",role:"presentation",children:zn(t,["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])},{tag:"ag-fake-horizontal-scroll"},e?{tag:"ag-overlay-wrapper"}:null]};return{paramsMap:t,elementParams:s}}var pM=class extends A{constructor(){super(...arguments),this.eGridRoot=x,this.eBodyViewport=x,this.eStickyTop=x,this.eStickyBottom=x,this.eTop=x,this.eBottom=x,this.eBody=x}postConstruct(){const{overlays:e,rangeSvc:t}=this.beans,s=e?.getOverlayWrapperSelector(),{paramsMap:i,elementParams:r}=gM(!!s);this.setTemplate(r,[...s?[s]:[],HP,_P,BP,hM],i);const o=(a,l)=>{const c=`${a}px`;l.style.minHeight=c,l.style.height=c},n={setRowAnimationCssOnBodyViewport:(a,l)=>this.setRowAnimationCssOnBodyViewport(a,l),setColumnCount:a=>rm(this.getGui(),a),setRowCount:a=>im(this.getGui(),a),setTopHeight:a=>o(a,this.eTop),setBottomHeight:a=>o(a,this.eBottom),setTopInvisible:a=>this.eTop.classList.toggle("ag-invisible",a),setBottomInvisible:a=>this.eBottom.classList.toggle("ag-invisible",a),setStickyTopHeight:a=>this.eStickyTop.style.height=a,setStickyTopTop:a=>this.eStickyTop.style.top=a,setStickyTopWidth:a=>this.eStickyTop.style.width=a,setStickyBottomHeight:a=>{this.eStickyBottom.style.height=a,this.eStickyBottom.classList.toggle("ag-invisible",a==="0px")},setStickyBottomBottom:a=>this.eStickyBottom.style.bottom=a,setStickyBottomWidth:a=>this.eStickyBottom.style.width=a,setColumnMovingCss:(a,l)=>this.toggleCss(a,l),updateLayoutClasses:(a,l)=>{const c=[this.eBodyViewport.classList,this.eBody.classList];for(const d of c)d.toggle(Rs.AUTO_HEIGHT,l.autoHeight),d.toggle(Rs.NORMAL,l.normal),d.toggle(Rs.PRINT,l.print);this.toggleCss(Rs.AUTO_HEIGHT,l.autoHeight),this.toggleCss(Rs.NORMAL,l.normal),this.toggleCss(Rs.PRINT,l.print)},setAlwaysVerticalScrollClass:(a,l)=>this.eBodyViewport.classList.toggle(ov,l),registerBodyViewportResizeListener:a=>{const l=vs(this.beans,this.eBodyViewport,a);this.addDestroyFunc(()=>l())},setPinnedTopBottomOverflowY:a=>this.eTop.style.overflowY=this.eBottom.style.overflowY=a,setCellSelectableCss:(a,l)=>{for(const c of[this.eTop,this.eBodyViewport,this.eBottom])c.classList.toggle(a,l)},setBodyViewportWidth:a=>this.eBodyViewport.style.width=a,setGridRootRole:a=>Ie(this.eGridRoot,a)};this.ctrl=this.createManagedBean(new nv),this.ctrl.setComp(n,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(t&&mt(this.gos)||ks(this.gos))&&nF(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const s=this.eBodyViewport.classList;s.toggle("ag-row-animation",t),s.toggle("ag-row-no-animation",!t)}getFocusableContainerName(){return"gridBody"}},fM={selector:"AG-GRID-BODY",component:pM},_n={TAB_GUARD:"ag-tab-guard",TAB_GUARD_TOP:"ag-tab-guard-top",TAB_GUARD_BOTTOM:"ag-tab-guard-bottom"},av=class extends Ke{constructor(e,t){super(),this.stopPropagationCallbacks=t,this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:s,eTopGuard:i,eBottomGuard:r,focusTrapActive:o,forceFocusOutWhenTabGuardsAreEmpty:n,isFocusableContainer:a,focusInnerElement:l,onFocusIn:c,onFocusOut:d,shouldStopEventPropagation:u,onTabKeyDown:h,handleKeyDown:g,isEmpty:p,eFocusableElement:f}=e;this.comp=s,this.eTopGuard=i,this.eBottomGuard=r,this.providedFocusInnerElement=l,this.eFocusableElement=f,this.focusTrapActive=!!o,this.forceFocusOutWhenTabGuardsAreEmpty=!!n,this.isFocusableContainer=!!a,this.providedFocusIn=c,this.providedFocusOut=d,this.providedShouldStopEventPropagation=u,this.providedOnTabKeyDown=h,this.providedHandleKeyDown=g,this.providedIsEmpty=p}postConstruct(){this.createManagedBean(new wC(this.eFocusableElement,this.stopPropagationCallbacks,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards();for(const e of[this.eTopGuard,this.eBottomGuard])this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)})}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&(this.providedIsEmpty?this.providedIsEmpty():Kt(this.eFocusableElement,".ag-tab-guard").length===0)){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;!(this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t))&&this.forceFocusOutWhenTabGuardsAreEmpty&&this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard)}findNextElementOutsideAndFocus(e){const t=me(this.beans),s=Kt(t.body,null,!0),i=s.indexOf(e?this.eTopGuard:this.eBottomGuard);if(i===-1)return;let r,o;e?(r=0,o=i):(r=i+1,o=s.length);const n=s.slice(r,o),a=this.gos.get("tabIndex");n.sort((l,c)=>{const d=Number.parseInt(l.getAttribute("tabindex")||"0"),u=Number.parseInt(c.getAttribute("tabindex")||"0");return u===a?1:d===a?-1:d===0?1:u===0?-1:d-u}),n[e?n.length-1:0]?.focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(this.focusTrapActive||e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const s=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),s&&(s.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=Kt(this.eFocusableElement);return this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(-1,1)),t.length?(t[e?t.length-1:0].focus({preventScroll:!0}),!0):!1}getNextFocusableElement(e){return Qe(this.beans,this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},Hl=class extends Ke{constructor(e,t){super(),this.comp=e,this.stopPropagationCallbacks=t}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:s,eFocusableElement:i,stopPropagationCallbacks:r}=this,o=[t,s],n={setTabIndex:C=>{for(const v of o)C==null?v.removeAttribute("tabindex"):v.setAttribute("tabindex",C)}};this.addTabGuards(t,s);const{focusTrapActive:a=!1,onFocusIn:l,onFocusOut:c,focusInnerElement:d,handleKeyDown:u,onTabKeyDown:h,shouldStopEventPropagation:g,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:f,isFocusableContainer:m}=e;this.tabGuardCtrl=this.createManagedBean(new av({comp:n,focusTrapActive:a,eTopGuard:t,eBottomGuard:s,eFocusableElement:i,onFocusIn:l,onFocusOut:c,focusInnerElement:d,handleKeyDown:u,onTabKeyDown:h,shouldStopEventPropagation:g,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:f,isFocusableContainer:m},r))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=me(this.beans).createElement("div"),s=e==="top"?_n.TAB_GUARD_TOP:_n.TAB_GUARD_BOTTOM;return t.classList.add(_n.TAB_GUARD,s),Ie(t,"presentation"),t}addTabGuards(e,t){const s=this.eFocusableElement;s.prepend(e),s.append(t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];ee(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,s){fn(t)||(t=t.getGui());const{eBottomGuard:i}=this;i?i.before(t):e(t,s)}destroy(){const{eTopGuard:e,eBottomGuard:t}=this;ue(e),ue(t),super.destroy()}},po=class extends Pt{initialiseTabGuard(e,t){this.tabGuardFeature=this.createManagedBean(new Hl(this,t)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},Pr=class extends po{initialiseTabGuard(e){super.initialiseTabGuard(e,Ai)}},lv=(e,t)=>LC(e,()=>Ge(e.getGui(),t,!1,!0)),cv=e=>e?.getFocusableContainerName()??"external",mM=e=>e==null?"external":typeof e=="string"?e:"gridBody",dv=class extends E{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}setComp(e,t,s){this.view=e,this.eGridHostDiv=t,this.eGui=s,this.eGui.setAttribute("grid-id",this.beans.context.getId());const{dragAndDrop:i,ctrlsSvc:r}=this.beans;i?.registerGridDropTarget(()=>this.eGui,this),this.createManagedBean(new Qu(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");const o=vs(this.beans,this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>o()),r.register("gridCtrl",this)}isDetailGrid(){return Fl(this.getGui())?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){const e=this.beans;return{paginationSelector:e.pagination?.getPaginationSelector(),gridHeaderDropZonesSelector:e.registry?.getSelector("AG-GRID-HEADER-DROP-ZONES"),sideBarSelector:e.sideBar?.getSelector(),statusBarSelector:e.registry?.getSelector("AG-STATUS-BAR"),watermarkSelector:e.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){this.eventSvc.dispatchEvent({type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight})}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){const{view:t}=this;e===!1?t.setCursor(null):t.setCursor(e===1?"ew-resize":"ns-resize")}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),{indexWithFocus:s,nextIndex:i}=this.getNextFocusableIndex(t,e),r=s===-1?e?t.length-1:0:i,{gos:o,beans:{focusSvc:n,navigation:a}}=this,l=o.getCallback("tabToNextGridContainer");if(l){const c=n.getDefaultTabToNextGridContainerTarget({backwards:e,focusableContainers:t,nextIndex:r}),d=cv(t[r]),u=c==null&&d==="gridBody"?"gridBody":mM(c),h=l({backwards:e,previousContainer:cv(t[s]),nextContainer:u,defaultTarget:c});if(h!==void 0){if(typeof h=="boolean")return h;if(typeof h=="string"){if(h==="gridBody")return this.focusGridBodyDefault(e)||void 0;const g=t.find(p=>p.getFocusableContainerName()===h);if(!g){Fm(`tabToNextGridContainer - ${h} container not found`);return}return lv(g,e)?!0:void 0}return vP(h)?n.focusHeaderPosition({headerPosition:h})||void 0:(a?.ensureCellVisible(h),n.setFocusedCell({...h,forceBrowserFocus:!0}),n.isCellFocused(h)||void 0)}}return this.focusNextInnerContainerDefault({backwards:e,focusableContainers:t,indexWithFocus:s,nextIndex:r})||void 0}focusInnerElement(e){const{gos:t,beans:s,beans:{focusSvc:i,visibleCols:r}}=this;if(t.getCallback("focusGridInnerElement")?.({fromBottom:!!e}))return!0;const n=this.getFocusableContainers();if(e)return this.focusNextInnerContainerDefault({backwards:!0,focusableContainers:n,indexWithFocus:n.length,nextIndex:n.length-1})?!0:i.focusGridView({column:W(r.allCols),backwards:!0});const a=r.allCols;if(t.get("headerHeight")===0||xs(s)){if(i.focusGridView({column:a[0],backwards:e}))return!0;for(let l=1;lr.getGui().contains(s));return{indexWithFocus:i,nextIndex:i+(t?-1:1)}}focusGridBodyDefault(e){const{gos:t,beans:s,beans:{focusSvc:i,visibleCols:{allCols:r}}}=this;return e?i.focusGridView({column:W(r),backwards:!0}):t.get("headerHeight")===0||xs(s)?i.focusGridView({column:r[0]}):i.focusFirstHeader()}focusNextInnerContainerDefault(e){const{backwards:t,focusableContainers:s,indexWithFocus:i}=e,r=t?-1:1;for(let o=e.nextIndex;o>=0&&oo:ithis.destroyBean(this),setRtlClass:o=>this.addCss(o),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:o=>{this.getGui().style.userSelect=o??"",this.getGui().style.webkitUserSelect=o??""},setCursor:o=>{this.getGui().style.cursor=o??""}},t=this.createManagedBean(new dv),s=t.getOptionalSelectors(),i=this.createTemplate(s),r=[fM,...Object.values(s).filter(o=>!!o)];this.setTemplate(i,r),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:o=>t.focusInnerElement(o),forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:()=>!t.isFocusable()})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{e.remove(),yi(this.gos,"Grid removed from DOM")})}updateLayoutClasses(e,t){const s=this.rootWrapperBody.classList,{AUTO_HEIGHT:i,NORMAL:r,PRINT:o}=Rs,{autoHeight:n,normal:a,print:l}=t;s.toggle(i,n),s.toggle(r,a),s.toggle(o,l),this.toggleCss(i,n),this.toggleCss(r,a),this.toggleCss(o,l)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?{tag:"ag-grid-header-drop-zones",ref:"gridHeaderDropZones"}:null,s=e.sideBarSelector?{tag:"ag-side-bar",ref:"sideBar"}:null,i=e.statusBarSelector?{tag:"ag-status-bar",ref:"statusBar"}:null,r=e.watermarkSelector?{tag:"ag-watermark"}:null,o=e.paginationSelector?{tag:"ag-pagination",ref:"pagination"}:null;return{tag:"div",cls:"ag-root-wrapper",role:"presentation",children:[t,{tag:"div",ref:"rootWrapperBody",cls:"ag-root-wrapper-body",role:"presentation",children:[{tag:"ag-grid-body",ref:"gridBody"},s]},i,o,r]}}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){if(!e&&this.pagination?.isDisplayed()){this.pagination.forceFocusOutOfContainer(e);return}super.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[...this.gridHeaderDropZones?.getFocusableContainers?.()??[],this.gridBody];for(const t of[this.sideBar,this.statusBar,this.pagination])t&&e.push(t);return e.filter(t=>Ne(t.getGui()))}},te=(e,t)=>{for(const s of Object.keys(t))t[s]=e;return t},uv={dispatchEvent:"CommunityCore",...te("CommunityCore",{destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,isModuleRegistered:0}),...te("GridState",{getState:0,setState:0}),...te("SharedRowSelection",{setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0}),...te("RowApi",{redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRowIndex:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0}),...te("ScrollApi",{getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0}),...te("KeyboardNavigation",{getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0}),...te("EventApi",{addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0}),...te("ValueCache",{expireValueCache:0}),...te("CellApi",{getCellValue:0}),...te("SharedMenu",{showColumnMenu:0,hidePopupMenu:0}),...te("Sort",{onSortChanged:0}),...te("PinnedRow",{getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,forEachPinnedRow:0}),...te("Overlay",{showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0}),...te("RenderApi",{setGridAriaProperty:0,refreshCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0}),...te("HighlightChanges",{flashCells:0}),...te("RowDrag",{addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getRowDropPositionIndicator:0,setRowDropPositionIndicator:0}),...te("ColumnApi",{getColumnDefs:0,getColumnDef:0,getDisplayNameForColumn:0,getColumn:0,getColumns:0,applyColumnState:0,getColumnState:0,resetColumnState:0,isPinning:0,isPinningLeft:0,isPinningRight:0,getDisplayedColAfter:0,getDisplayedColBefore:0,setColumnsVisible:0,setColumnsPinned:0,getAllGridColumns:0,getDisplayedLeftColumns:0,getDisplayedCenterColumns:0,getDisplayedRightColumns:0,getAllDisplayedColumns:0,getAllDisplayedVirtualColumns:0}),...te("ColumnAutoSize",{sizeColumnsToFit:0,autoSizeColumns:0,autoSizeAllColumns:0}),...te("ColumnGroup",{setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumnGroup:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0}),...te("ColumnMove",{moveColumnByIndex:0,moveColumns:0}),...te("ColumnResize",{setColumnWidths:0}),...te("ColumnHover",{isColumnHovered:0}),...te("EditCore",{getCellEditorInstances:0,getEditingCells:0,getEditRowValues:0,stopEditing:0,startEditingCell:0,isEditing:0,validateEdit:0}),...te("BatchEdit",{startBatchEdit:0,cancelBatchEdit:0,commitBatchEdit:0,isBatchEditing:0}),...te("UndoRedoEdit",{undoCellEditing:0,redoCellEditing:0,getCurrentUndoSize:0,getCurrentRedoSize:0}),...te("FilterCore",{isAnyFilterPresent:0,onFilterChanged:0}),...te("ColumnFilter",{isColumnFilterPresent:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,hideColumnFilter:0,getColumnFilterHandler:0,doFilterAction:0}),...te("QuickFilter",{isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0}),...te("Find",{findGetActiveMatch:0,findGetTotalMatches:0,findGoTo:0,findNext:0,findPrevious:0,findGetNumMatches:0,findGetParts:0,findClearActive:0,findRefresh:0}),...te("Pagination",{paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0}),...te("CsrmSsrmSharedApi",{expandAll:0,collapseAll:0,resetRowGroupExpansion:0}),...te("SsrmInfiniteSharedApi",{setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...te("ClientSideRowModelApi",{onGroupExpandedOrCollapsed:0,refreshClientSideRowModel:0,isRowDataEmpty:0,forEachLeafNode:0,forEachNodeAfterFilter:0,forEachNodeAfterFilterAndSort:0,applyTransaction:0,applyTransactionAsync:0,flushAsyncTransactions:0,getBestCostNodeSelection:0,onRowHeightChanged:0,resetRowHeights:0}),...te("CsvExport",{getDataAsCsv:0,exportDataAsCsv:0}),...te("InfiniteRowModel",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...te("AdvancedFilter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...te("IntegratedCharts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...te("Clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...te("ExcelExport",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...te("SharedMasterDetail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...te("ContextMenu",{showContextMenu:0}),...te("ColumnMenu",{showColumnChooser:0,hideColumnChooser:0}),...te("CellSelection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...te("SharedRowGrouping",{setRowGroupColumns:0,removeRowGroupColumns:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0}),...te("SharedAggregation",{addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0}),...te("SharedPivot",{isPivotMode:0,getPivotResultColumn:0,setValueColumns:0,getValueColumns:0,removeValueColumns:0,addValueColumns:0,setPivotColumns:0,removePivotColumns:0,addPivotColumns:0,getPivotColumns:0,setPivotResultColumns:0,getPivotResultColumns:0}),...te("ServerSideRowModelApi",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0,onRowHeightChanged:0,resetRowHeights:0}),...te("SideBar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...te("StatusBar",{getStatusPanel:0}),...te("AiToolkit",{getStructuredSchema:0})},dh={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},vM=(e,t)=>e.eventSvc.dispatchEvent(t),hv=class{};Reflect.defineProperty(hv,"name",{value:"GridApi"});var wM=class extends E{constructor(){super(),this.beanName="apiFunctionSvc",this.api=new hv,this.fns={...dh,dispatchEvent:vM},this.preDestroyLink="";const{api:e}=this;for(const t of Object.keys(uv))e[t]=this.makeApi(t)[t]}postConstruct(){this.preDestroyLink=this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(e,t){const{fns:s,beans:i}=this;s!==dh&&(s[e]=i?.validation?.validateApiFunction(e,t)??t)}makeApi(e){return{[e]:(...t)=>{const{beans:s,fns:{[e]:i}}=this;return i?i(s,...t):this.apiNotFound(e)}}}apiNotFound(e){const{beans:t,gos:s,preDestroyLink:i}=this;if(!t)F(26,{fnName:e,preDestroyLink:i});else{const r=uv[e];s.assertModuleRegistered(r,`api.${e}`)&&F(27,{fnName:e,module:r})}}destroy(){super.destroy(),this.fns=dh,this.beans=null}};function gv(e){return e.context.getId()}function bM(e){e.gridDestroySvc.destroy()}function SM(e){return e.gridDestroySvc.destroyCalled}function yM(e,t){return e.gos.get(t)}function xM(e,t,s){pv(e,{[t]:s})}function pv(e,t){e.gos.updateGridOptions({options:t})}function RM(e,t){const s=t.replace(/Module$/,"");return e.gos.isModuleRegistered(s)}function Bs(e,t,s){const i=_(e,t,s);if(i){const{className:o}=i;if(typeof o=="string"&&o.includes("ag-icon")||typeof o=="object"&&o["ag-icon"])return i}const r=re({tag:"span"});return r.appendChild(i),r}function _(e,t,s){let i=null;e==="smallDown"?F(262):e==="smallLeft"?F(263):e==="smallRight"&&F(264);const r=s?.getColDef().icons;if(r&&(i=r[e]),t.gos&&!i){const o=t.gos.get("icons");o&&(i=o[e])}if(i){let o;if(typeof i=="function")o=i();else if(typeof i=="string")o=i;else{F(38,{iconName:e});return}if(typeof o=="string")return Xa(o);if(fn(o))return o;F(133,{iconName:e});return}else{const o=t.registry.getIcon(e);return o||t.validation?.validateIcon(e),re({tag:"span",cls:`ag-icon ag-icon-${o??e}`,role:"presentation",attrs:{unselectable:"on"}})}}var FM={tag:"div",cls:"ag-drag-handle ag-row-drag",attrs:{draggable:"true"}},EM=class extends A{constructor(e,t,s){super(FM),this.rowNode=e,this.column=t,this.eCell=s}postConstruct(){this.getGui().appendChild(_("rowDrag",this.beans,null)),this.addGuiEventListener("mousedown",t=>{t.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const{rowNode:t,column:s,eCell:i,gos:r}=this,o=s.getColDef().dndSourceOnRowDrag,n=e.dataTransfer;if(n.setDragImage(i,0,0),o){const a=N(r,{rowNode:t,dragEvent:e});o(a)}else try{const a=JSON.stringify(t.data);n.setData("application/json",a),n.setData("text/plain",a)}catch{}}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},PM=".ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}.ag-dnd-ghost-not-allowed{border:var(--ag-drag-and-drop-image-not-allowed-border)}",MM={tag:"div",children:[{tag:"div",ref:"eGhost",cls:"ag-dnd-ghost ag-unselectable",children:[{tag:"span",ref:"eIcon",cls:"ag-dnd-ghost-icon ag-shake-left-to-right"},{tag:"div",ref:"eLabel",cls:"ag-dnd-ghost-label"}]}]},TM=class extends A{constructor(){super(),this.dragSource=null,this.eIcon=x,this.eLabel=x,this.eGhost=x,this.registerCSS(PM)}postConstruct(){const e=t=>Bs(t,this.beans,null);this.dropIconMap={pinned:e("columnMovePin"),hide:e("columnMoveHide"),move:e("columnMoveMove"),left:e("columnMoveLeft"),right:e("columnMoveRight"),group:e("columnMoveGroup"),aggregate:e("columnMoveValue"),pivot:e("columnMovePivot"),notAllowed:e("dropNotAllowed")}}init(e){this.dragSource=e.dragSource,this.setTemplate(MM),this.beans.environment.applyThemeClasses(this.eGhost)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t){const{eGhost:s,eIcon:i,dragSource:r,dropIconMap:o,gos:n}=this;ee(i);let a=null;e||(e=r?.getDefaultIconName?r.getDefaultIconName():"notAllowed"),a=o[e],s.classList.toggle("ag-dnd-ghost-not-allowed",e==="notAllowed"),i.classList.toggle("ag-shake-left-to-right",t),!(a===o.hide&&n.get("suppressDragLeaveHidesColumns"))&&a&&i.appendChild(a)}setLabel(e){this.eLabel.textContent=e}};function DM(e,t){e.rowDragSvc?.rowDragFeature?.addRowDropZone(t)}function AM(e,t){const s=e.dragAndDrop?.findExternalZone(t.getContainer());s&&e.dragAndDrop?.removeDropTarget(s)}function IM(e,t){return e.rowDragSvc?.rowDragFeature?.getRowDropZone(t)}function kM(e){const t=e.rowDropHighlightSvc;return t?{row:t.row,dropIndicatorPosition:t.position}:{row:null,dropIndicatorPosition:"none"}}function LM(e,t){const s=e.rowDropHighlightSvc;if(!s)return;const i=t?.row;let r=t?.dropIndicatorPosition;r!=="above"&&r!=="below"&&r!=="inside"&&(r="none");const o=i?.rowIndex;o==null||r==="none"?s.clear():s.set(i,r)}var fv=(e,t)=>{if(t!=null&&e?.setPointerCapture)try{return e.setPointerCapture(t),e.hasPointerCapture(t)}catch{}return!1},GM=(e,t)=>{if(typeof PointerEvent>"u"||!(t instanceof PointerEvent))return null;const s=t.pointerId;if(!fv(e,s))return null;const i={eElement:e,pointerId:s,onLost(r){VM(i,r)}};return e.addEventListener("lostpointercapture",i.onLost),i},OM=e=>{if(!e)return;mv(e);const{eElement:t,pointerId:s}=e;if(t){try{t.releasePointerCapture(s)}catch{}e.eElement=null}},mv=e=>{const{eElement:t,onLost:s}=e;t&&s&&(t.removeEventListener("lostpointercapture",s),e.onLost=null)},VM=(e,t)=>{mv(e);const{eElement:s,pointerId:i}=e;s&&t.pointerId===i&&fv(s,i)},fo,mo,uh={passive:!0},Li={passive:!1},Ns=e=>{if(!mo)mo=new WeakSet;else if(mo.has(e))return!1;return mo.add(e),!0},Cv=class extends Ke{constructor(){super(...arguments),this.beanName="dragSvc",this.dragging=!1,this.drag=null,this.dragSources=[]}get startTarget(){return this.drag?.start.target??null}isPointer(){return!!fo?.has(It(this.beans))}hasPointerCapture(){const e=this.drag?.pointerCapture;return!!(e&&this.beans.eRootDiv.hasPointerCapture?.(e.pointerId))}destroy(){this.drag&&this.cancelDrag();const e=this.dragSources;for(const t of e)vv(t);e.length=0,super.destroy()}removeDragSource(e){const t=this.dragSources;for(let s=0,i=t.length;sthis.onPointerDown(e,c),Li],[t,"mousedown",c=>this.onMouseDown(e,c)]);const l=this.gos.get("suppressTouch");s&&!l&&sl(i,[t,"touchstart",d=>this.onTouchStart(e,d),Li])}cancelDrag(e){const t=this.drag;e??(e=t?.eElement),e&&this.eventSvc.dispatchEvent({type:"dragCancelled",target:e}),t?.params.onDragCancel?.(),this.destroyDrag()}shouldPreventMouseEvent(e){const t=e.type;return(t==="mousemove"||t==="pointermove")&&e.cancelable&&mn(this.beans,e)&&!Zr(gh(e))}initDrag(e,...t){this.drag=e;const s=this.beans,i=a=>this.onScroll(a),r=a=>this.onKeyDown(a),o=It(s),n=me(s);sl(e.handlers,[o,"contextmenu",Si],[o,"keydown",r],[n,"scroll",i,{capture:!0}],[n.defaultView||window,"scroll",i],...t)}destroyDrag(){this.dragging=!1;const e=this.drag;if(e){const t=e.rootEl;fo?.get(t)===e&&fo.delete(t),this.drag=null,OM(e.pointerCapture),$d(e.handlers)}}onPointerDown(e,t){if(this.isPointer())return;const s=this.beans;if(mo?.has(t))return;const i=t.pointerType;if(i==="touch"&&(s.gos.get("suppressTouch")||!e.includeTouch||(e.stopPropagationForTouch&&t.stopPropagation(),Zr(gh(t))))||!t.isPrimary||i==="mouse"&&t.button!==0)return;this.destroyDrag();const r=It(s),o=e.eElement,n=t.pointerId,a=new hh(r,e,t,n);fo??(fo=new WeakMap),fo.set(r,a);const l=h=>{h.pointerId===n&&this.onMouseOrPointerMove(h)},c=h=>{h.pointerId===n&&this.onMouseOrPointerUp(h)},d=h=>{h.pointerId===n&&Ns(h)&&this.cancelDrag()},u=h=>this.draggingPreventDefault(h);this.initDrag(a,[r,"pointerup",c],[r,"pointercancel",d],[r,"pointermove",l,Li],[r,"touchmove",u,Li],[o,"mousemove",u,Li]),e.dragStartPixels===0?this.onMouseOrPointerMove(t):Ns(t)}onTouchStart(e,t){if(this.gos.get("suppressTouch")||!e.includeTouch||!Ns(t)||Zr(gh(t)))return;if(e.stopPropagationForTouch&&t.stopPropagation(),this.isPointer()){this.dragging&&Si(t);return}this.destroyDrag();const i=this.beans,r=It(i),o=new hh(r,e,t.touches[0]),n=h=>this.onTouchMove(h),a=h=>this.onTouchUp(h),l=h=>this.onTouchCancel(h),c=h=>this.draggingPreventDefault(h),d=It(i),u=t.target??e.eElement;this.initDrag(o,[u,"touchmove",n,uh],[u,"touchend",a,uh],[u,"touchcancel",l,uh],[d,"touchmove",c,Li],[d,"touchend",a,Li],[d,"touchcancel",l,Li]),e.dragStartPixels===0&&this.onMove(o.start)}draggingPreventDefault(e){this.dragging&&Si(e)}onMouseDown(e,t){if(t.button!==0||mo?.has(t)||this.isPointer())return;const s=this.beans;this.destroyDrag();const i=new hh(It(s),e,t),r=a=>this.onMouseOrPointerMove(a),o=a=>this.onMouseOrPointerUp(a),n=It(s);this.initDrag(i,[n,"mousemove",r],[n,"mouseup",o]),e.dragStartPixels===0?this.onMouseOrPointerMove(t):Ns(t)}onScroll(e){if(!Ns(e))return;const t=this.drag,s=t?.lastDrag;s&&this.dragging&&t.params?.onDragging?.(s)}onMouseOrPointerMove(e){Ns(e)&&(Ss()&&me(this.beans).getSelection()?.removeAllRanges(),this.shouldPreventMouseEvent(e)&&Si(e),this.onMove(e))}onTouchCancel(e){const t=this.drag;!t||!Ns(e)||Qr(t.start,e.changedTouches)&&this.cancelDrag()}onTouchMove(e){const t=this.drag;if(!t||!Ns(e))return;const s=Qr(t.start,e.touches);s&&(this.onMove(s),this.draggingPreventDefault(e))}onMove(e){const t=this.drag;if(!t)return;t.lastDrag=e;const s=t.params;if(!this.dragging){const i=t.start,o=s.dragStartPixels??4;if(Cm(e,i,o)||(this.dragging=!0,s.capturePointer&&(t.pointerCapture=GM(this.beans.eRootDiv,e)),this.eventSvc.dispatchEvent({type:"dragStarted",target:s.eElement}),s.onDragStart?.(i),this.drag!==t)||(s.onDragging?.(i),this.drag!==t))return}s.onDragging?.(e)}onTouchUp(e){const t=this.drag;t&&Ns(e)&&this.onUp(Qr(t.start,e.changedTouches))}onMouseOrPointerUp(e){Ns(e)&&this.onUp(e)}onUp(e){const t=this.drag;t&&(e||(e=t.lastDrag),e&&this.dragging&&(this.dragging=!1,t.params.onDragStop?.(e),this.eventSvc.dispatchEvent({type:"dragStopped",target:t.params.eElement})),this.destroyDrag())}onKeyDown(e){e.key===b.ESCAPE&&this.cancelDrag()}},vv=e=>{$d(e.handlers);const t=e.oldTouchAction;if(t!=null){const s=e.params.eElement.style;s&&(s.touchAction=t)}},hh=class{constructor(e,t,s,i=null){this.rootEl=e,this.params=t,this.start=s,this.pointerId=i,this.handlers=[],this.lastDrag=null,this.pointerCapture=null,this.eElement=t.eElement}},gh=e=>{const t=e.target;return t instanceof Element?t:null},BM=class extends Cv{shouldPreventMouseEvent(e){return this.gos.get("enableCellTextSelection")&&super.shouldPreventMouseEvent(e)}},NM=class extends E{constructor(){super(...arguments),this.beanName="horizontalResizeSvc"}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),onDragCancel:this.onDragStop.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0},{dragSvc:s}=this.beans;return s.addDragSource(t),()=>s.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const s=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(s)}setResizeIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(1),e.disableUserSelect(!0)}onDragStop(e){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},HM={tag:"div",cls:"ag-drag-handle ag-row-drag",attrs:{"aria-hidden":"true"}},zl={skipAriaHidden:!0},zM=class extends A{constructor(e,t,s,i,r,o=!1){super(),this.cellValueFn=e,this.rowNode=t,this.column=s,this.customGui=i,this.dragStartPixels=r,this.alwaysVisible=o,this.dragSource=null,this.disabled=!1}isCustomGui(){return this.customGui!=null}postConstruct(){const{beans:e,customGui:t}=this;t?this.setDragElement(t,this.dragStartPixels):(this.setTemplate(HM),this.getGui().appendChild(_("rowDrag",e,null)),this.addDragSource()),this.alwaysVisible||this.initCellDrag()}initCellDrag(){const{beans:e,rowNode:t}=this,s=this.refreshVisibility.bind(this);this.addManagedListeners(e.eventSvc,{rowDragVisibilityChanged:s}),this.addManagedListeners(t,{dataChanged:s,cellChanged:s}),this.refreshVisibility()}setDragElement(e,t){this.setTemplateFromElement(e,void 0,void 0,!0),this.addDragSource(t)}refreshVisibility(){if(this.alwaysVisible)return;const{beans:e,column:t,rowNode:s}=this,{gos:i,dragAndDrop:r,rowDragSvc:o}=e,n=o?.visibility;let l=!(n==="suppress"||n==="hidden"&&!r?.hasExternalDropZones()),c=l;if(l&&!this.isCustomGui()&&t){const d=t.getColDef().rowDrag;if(d===!1)l=!1;else{const u=typeof d=="function";c=t.isRowDrag(s),l=u||c}}l&&c&&s.footer&&i.get("rowDragManaged")&&(c=!1,l=!0),c&&(c=l),l||this.setDisplayed(l,zl),c||this.setVisible(c,zl),this.setDisabled(!c||n==="disabled"&&!r?.hasExternalDropZones()),l&&this.setDisplayed(l,zl),c&&this.setVisible(c,zl)}setDisabled(e){e!==this.disabled&&(this.disabled=e,this.getGui()?.classList?.toggle("ag-drag-handle-disabled",e))}getSelectedNodes(){const e=this.rowNode;if(!this.gos.get("rowDragMultiRow"))return[e];const s=this.beans.selectionSvc?.getSelectedNodes()??[];return s.indexOf(e)!==-1?s:[e]}getDragItem(){const{column:e,rowNode:t}=this;return{rowNode:t,rowNodes:this.getSelectedNodes(),columns:e?[e]:void 0,defaultTextValue:this.cellValueFn()}}addDragSource(e=4){if(this.dragSource&&this.removeDragSource(),this.gos.get("rowDragManaged")&&this.rowNode.footer)return;const t=this.getGui();if(this.gos.get("enableCellTextSelection")){this.removeMouseDownListener();const i=Ja("pointerdown")?{pointerdown:Si}:{mousedown:Si};this.mouseDownListener=this.addManagedElementListeners(t,i)[0]}const s=this.getLocaleTextFunc();this.dragSource={type:2,eElement:t,dragItemName:i=>this.getDragItemName(i,s),getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDrop.addDragSource(this.dragSource,!0)}getDragItemName(e,t){const s=e?.dragItem||this.getDragItem(),i=(e?.dropTarget?.rows.length??s.rowNodes?.length)||1,r=this.column?.getColDef()?.rowDragText??this.gos.get("rowDragText");if(r)return r(s,i);if(i!==1)return`${i} ${t("rowDragRows","rows")}`;const o=this.cellValueFn();return o||`1 ${t("rowDragRow","rows")}`}destroy(){this.removeDragSource(),this.removeMouseDownListener(),super.destroy()}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop.removeDragSource(this.dragSource),this.dragSource=null)}removeMouseDownListener(){this.mouseDownListener&&(this.mouseDownListener(),this.mouseDownListener=void 0)}},_l=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.includes("x"),this.scrollVertically=e.scrollAxis.includes("y"),this.scrollByTick=e.scrollByTick??20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}get scrolling(){return this.tickingInterval!==null}check(e,t=!1){const s=!this.scrollVertically||t||this.shouldSkipVerticalScroll(),i=!this.scrollHorizontally||this.shouldSkipHorizontalScroll();if(s&&i)return;const r=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=!i&&e.clientXr.right-o,this.tickUp=!s&&e.clientYr.bottom-o,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Mr=class{constructor(){this.reordered=!1,this.removals=[],this.updates=new Set,this.adds=new Set}},Gi=e=>{let t=e.childrenAfterGroup;for(;t?.length;){const s=t[0];if(s.sourceRowIndex>=0)return s;t=s.childrenAfterGroup}},ph=(e,t,s,i)=>{if(!t.size||!e)return!1;let r=!1;const o=e.length??0;let n=-1;s&&(n=s.sourceRowIndex,s=n<0?Gi(s):null,s&&(n=s.sourceRowIndex)),n<0||n>=o?n=o:i||++n;let a=n,l=Math.min(n,o-1);for(const u of t){const h=u.sourceRowIndex;hl&&(l=h)}let c=a;for(let u=a;u=n;--u){const h=e[u];t.has(h)||(h.sourceRowIndex!==d&&(h.sourceRowIndex=d,e[d]=h,r=!0),--d)}for(const u of t)u.sourceRowIndex!==c&&(u.sourceRowIndex=c,e[c]=u,r=!0),++c;return r};function fh(e,t){return Hn(e,t.target)?.getFocusedCellPosition()??null}function Wn(e,t){const s=je(e.gos,"normal"),i=t;let r,o;i.clientX!=null||i.clientY!=null?(r=i.clientX,o=i.clientY):(r=i.x,o=i.y);const{pageFirstPixel:n}=e.pageBounds.getCurrentPagePixelRange();if(o+=n,s){const a=e.ctrlsSvc.getScrollFeature(),l=a.getVScrollPosition(),c=a.getHScrollPosition();r+=c.left,o+=l.top}return{x:r,y:o}}var _M=.25,WM=class extends E{constructor(e){super(),this.eContainer=e,this.lastDraggingEvent=null,this.autoScroll=null,this.autoScrollChanged=!1,this.autoScrollChanging=!1,this.autoScrollOldV=null}postConstruct(){const e=this.beans;e.ctrlsSvc.whenReady(this,t=>{const s=()=>t.gridBodyCtrl.scrollFeature.getVScrollPosition().top,i=new _l({scrollContainer:t.gridBodyCtrl.eBodyViewport,scrollAxis:"y",getVerticalPosition:s,setVerticalPosition:r=>t.gridBodyCtrl.scrollFeature.setVerticalScrollPosition(r),onScrollCallback:()=>{const r=s();if(this.autoScrollOldV!==r){this.autoScrollOldV=r,this.autoScrollChanging=!0;return}const o=this.autoScrollChanging;this.autoScrollChanged=o,this.autoScrollChanging=!1,o&&(e.dragAndDrop?.nudge(),this.autoScrollChanged=!1)}});this.autoScroll=i,this.clearAutoScroll()})}destroy(){super.destroy(),this.clearAutoScroll(),this.autoScroll=null,this.lastDraggingEvent=null,this.eContainer=null}getContainer(){return this.eContainer}isInterestedIn(e){return e===2}getIconName(e){return e?.dropTarget?.allowed===!1||this.beans.rowDragSvc.visibility!=="visible"?"notAllowed":"move"}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const s=this.beans.selectionSvc?.getSelectedNodes();if(s&&s.indexOf(t)>=0)return s.slice().sort(UM)}return[t]}onDragEnter(e){this.dragging(e,!0)}onDragging(e){this.dragging(e,!1)}dragging(e,t){const{lastDraggingEvent:s,beans:i}=this;if(t){const a=this.getRowNodes(e);e.dragItem.rowNodes=a,bv(a,!0)}this.lastDraggingEvent=e;const r=e.fromNudge,o=this.makeRowsDrop(s,e,r,!1);i.rowDropHighlightSvc?.fromDrag(e),t&&this.dispatchGridEvent("rowDragEnter",e),this.dispatchGridEvent("rowDragMove",e);const n=this.autoScroll;o?.rowDragManaged&&o.moved&&o.allowed&&o.sameGrid&&!o.suppressMoveWhenRowDragging&&(!r&&!n?.scrolling||this.autoScrollChanged)&&this.dropRows(o),n?.check(e.event)}isFromThisGrid(e){return e.dragSource.dragSourceDomDataKey===this.gos.getDomDataKey()}makeRowsDrop(e,t,s,i){const{beans:r,gos:o}=this,n=this.newRowsDrop(t,i),a=r.rowModel;if(t.dropTarget=n,t.changed=!1,!n)return null;let{sameGrid:l,rootNode:c,source:d,target:u}=n;u??(u=a.getRow(a.getRowCount()-1)??null);const h=this.beans.groupEditSvc,g=!!h?.canSetParent(n);let p=null;if(u?.footer){const m=kn(a,-1,u)??kn(a,1,u);g&&(p=u.sibling??c),u=m??null}u?.detail&&(u=u.parent),n.moved&&(n.moved=d!==u);let f=.5;if(u&&(l&&n.moved&&(p||!g)?f=d.rowIndex>u.rowIndex?-.5:.5:f=(n.y-u.rowTop-u.rowHeight/2)/u.rowHeight||0),!g&&l&&u&&n.moved&&ae(o)){const m=$M(a,n);m&&(f=d.rowIndex>m.rowIndex?-.5:.5,u=m,n.moved&&(n.moved=d!==u))}return n.target=u,n.newParent=p,n.pointerPos=KM(u,n.y),n.yDelta=f,h?.fixRowsDrop(n,g,s,f),this.validateRowsDrop(n,g,i),t.changed||(t.changed=wv(e?.dropTarget,n)),n}newRowsDrop(e,t){const{beans:s,gos:i}=this,r=s.rowModel.rootNode,o=ae(i)?i.get("rowDragManaged"):!1,n=i.get("suppressMoveWhenRowDragging"),a=this.isFromThisGrid(e);let{rowNode:l,rowNodes:c}=e.dragItem;if(c||(c=l?[l]:[]),l||(l=c[0]),!l||!r)return null;const d=this.beans.dragAndDrop.isDropZoneWithinThisGrid(e);let u=!0;o&&(!c.length||s.rowDragSvc.visibility!=="visible"||(n||!a)&&!d)&&(u=!1);const h=Wn(s,e).y,g=this.getOverNode(h);return{api:s.gridApi,context:s.gridOptions.context,draggingEvent:e,rowDragManaged:o,suppressMoveWhenRowDragging:n,sameGrid:a,withinGrid:d,treeData:!1,rootNode:r,moved:l!==g,y:h,overNode:g,overIndex:g?.rowIndex??-1,pointerPos:"none",position:"none",source:l,target:g??null,newParent:null,rows:c,allowed:u,highlight:!t&&o&&n&&(d||!a),yDelta:0,inside:!1,droppedManaged:!1}}validateRowsDrop(e,t,s){const{source:i,target:r,yDelta:o,inside:n,moved:a,rowDragManaged:l,suppressMoveWhenRowDragging:c}=e;e.moved&&(e.moved=i!==r);const{position:d,fallbackPosition:u}=this.computeDropPosition(a,n,o);e.position=d,t||(e.newParent=null),this.enforceSuppressMoveWhenRowDragging(e,c,"initial");const h=(!l||e.allowed)&&this.gos.get("isRowValidDropPosition");h&&this.applyDropValidator(e,t,s,l,h),l&&(e.rows=this.filterRows(e)),this.beans.groupEditSvc?.clearNewSameParent(e,t),this.enforceSuppressMoveWhenRowDragging(e,c,"final"),e.position==="inside"&&(!e.allowed||!e.newParent)&&(e.position=u)}computeDropPosition(e,t,s){const i=s<0?"above":"below";return e?{position:t?"inside":i,fallbackPosition:i}:{position:"none",fallbackPosition:i}}enforceSuppressMoveWhenRowDragging(e,t,s){if(t){if(s==="initial"){e.moved||(e.allowed=!1);return}(!e.rows.length||e.position==="none")&&(e.allowed=!1)}}applyDropValidator(e,t,s,i,r){this.beans.groupEditSvc?.clearNewSameParent(e,t);const o=r(e);if(!o){e.allowed=!1;return}if(typeof o!="object")return;o.rows!==void 0&&(e.rows=o.rows??[]),t&&o.newParent!==void 0&&(e.newParent=o.newParent),o.target!==void 0&&(e.target=o.target),o.position&&(e.position=o.position),o.allowed!==void 0?e.allowed=o.allowed:i||(e.allowed=!0);const n=e.draggingEvent;o.changed&&n&&(n.changed=!0),!s&&o.highlight!==void 0&&(e.highlight=o.highlight)}addRowDropZone(e){if(!e.getContainer()){F(55);return}const t=this.beans.dragAndDrop;if(t.findExternalZone(e.getContainer())){F(56);return}const s=e.fromGrid?e:{getContainer:e.getContainer,onDragEnter:e.onDragEnter&&(r=>e.onDragEnter(this.rowDragEvent("rowDragEnter",r))),onDragLeave:e.onDragLeave&&(r=>e.onDragLeave(this.rowDragEvent("rowDragLeave",r))),onDragging:e.onDragging&&(r=>e.onDragging(this.rowDragEvent("rowDragMove",r))),onDragStop:e.onDragStop&&(r=>e.onDragStop(this.rowDragEvent("rowDragEnd",r))),onDragCancel:e.onDragCancel&&(r=>e.onDragCancel(this.rowDragEvent("rowDragCancel",r)))},i={isInterestedIn:r=>r===2,getIconName:()=>"move",external:!0,...s};t.addDropTarget(i),this.addDestroyFunc(()=>t.removeDropTarget(i))}getRowDropZone(e){return{getContainer:this.getContainer.bind(this),onDragEnter:s=>{this.onDragEnter(s),e?.onDragEnter?.(this.rowDragEvent("rowDragEnter",s))},onDragLeave:s=>{this.onDragLeave(s),e?.onDragLeave?.(this.rowDragEvent("rowDragLeave",s))},onDragging:s=>{this.onDragging(s),e?.onDragging?.(this.rowDragEvent("rowDragMove",s))},onDragStop:s=>{this.onDragStop(s),e?.onDragStop?.(this.rowDragEvent("rowDragEnd",s))},onDragCancel:s=>{this.onDragCancel(s),e?.onDragCancel?.(this.rowDragEvent("rowDragCancel",s))},fromGrid:!0}}getOverNode(e){const{pageBounds:t,rowModel:s}=this.beans,r=e>t.getCurrentPagePixelRange().pageLastPixel?-1:s.getRowIndexAtPixel(e);return r>=0?s.getRow(r):void 0}rowDragEvent(e,t){const s=this.beans,{dragItem:i,dropTarget:r,event:o,vDirection:n}=t,a=r?.rootNode===s.rowModel.rootNode,l=a?r.y:Wn(s,t).y,c=a?r.overNode:this.getOverNode(l),d=a?r.overIndex:c?.rowIndex??-1;return{api:s.gridApi,context:s.gridOptions.context,type:e,event:o,node:i.rowNode,nodes:i.rowNodes,overIndex:d,overNode:c,y:l,vDirection:n,rowsDrop:r}}dispatchGridEvent(e,t){const s=this.rowDragEvent(e,t);this.eventSvc.dispatchEvent(s)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e,!1)}onDragStop(e){const t=this.lastDraggingEvent?.dropTarget??null,s=this.makeRowsDrop(this.lastDraggingEvent,e,!1,!0);this.dispatchGridEvent("rowDragEnd",e),s?.allowed&&s.rowDragManaged&&(!t?.droppedManaged||wv(t,s))&&this.dropRows(s),this.stopDragging(e,!0)}onDragCancel(e){this.dispatchGridEvent("rowDragCancel",e),this.stopDragging(e,!0)}stopDragging(e,t){this.clearAutoScroll(),this.beans.groupEditSvc?.stopDragging(t),this.beans.rowDropHighlightSvc?.fromDrag(null),bv(e.dragItem.rowNodes,!1),this.lastDraggingEvent=null}clearAutoScroll(){this.autoScroll?.ensureCleared(),this.autoScrollChanged=!1,this.autoScrollChanging=!1,this.autoScrollOldV=null}dropRows(e){return e.droppedManaged=!0,e.sameGrid?this.csrmMoveRows(e):this.csrmAddRows(e)}csrmAddRows({position:e,target:t,rows:s}){const i=Is(this.gos),r=this.beans.rowModel,o=s.filter(({data:a,rowPinned:l})=>!r.getRowNode(i?.({data:a,level:0,rowPinned:l})??a.id)).map(({data:a})=>a);if(o.length===0)return!1;let n;if(t){const a=t.sourceRowIndex>=0?t:Gi(t);a&&(n=a.sourceRowIndex+(e==="above"?0:1))}return r.updateRowData({add:o,addIndex:n}),!0}filterRows(e){const{groupEditSvc:t}=this.beans,{rows:s,sameGrid:i}=e;let r;for(let o=0,n=s.length;o=0)return e.destroyed?void 0:e;const t=this.beans.groupEditSvc;return t?t.csrmFirstLeaf(e):Gi(e)}},wv=(e,t)=>e!==t&&(!e||e.sameGrid!==t.sameGrid||e.allowed!==t.allowed||e.position!==t.position||e.target!==t.target||e.source!==t.source||e.newParent!==t.newParent||!be(e.rows,t.rows)),UM=({rowIndex:e},{rowIndex:t})=>e!==null&&t!==null?e-t:0,bv=(e,t)=>{for(let s=0,i=e?.length||0;s{let s=null,i=t.target;if(i&&t.rows.indexOf(i)<0)return null;const r=t.source;if(!i||!r)return null;let o=i.rowIndex-r.rowIndex;const n=o<0?-1:1;o=t.suppressMoveWhenRowDragging?Math.abs(o):1;const a=new Set(t.rows);do{const l=kn(e,n,i);if(!l)break;a.has(l)||(s=l,--o),i=l}while(o>0);return s},KM=(e,t)=>{const s=e?.rowTop,i=e?.rowHeight??0;if(s==null||!i||i<=0)return"none";const r=t-s,o=i*_M;return r<=o?"above":r>=i-o?"below":"inside"},jM=class extends E{constructor(){super(...arguments),this.beanName="rowDragSvc",this.rowDragFeature=null,this.visibility="suppress"}setupRowDrag(e,t){const s=t.createManagedBean(new WM(e)),i=this.beans.dragAndDrop;i.addDropTarget(s),t.addDestroyFunc(()=>i.removeDropTarget(s)),this.rowDragFeature=s;const r=()=>this.refreshVisibility();this.addManagedPropertyListeners(["rowDragManaged","suppressRowDrag","refreshAfterGroupEdit"],r),this.addManagedEventListeners({newColumnsLoaded:r,columnRowGroupChanged:r,columnPivotModeChanged:r,sortChanged:r,filterChanged:r}),this.visibility=this.computeVisibility()}createRowDragComp(e,t,s,i,r,o){return new zM(e,t,s,i,r,o)}createRowDragCompForRow(e,t){if(mt(this.gos))return;const s=this.getLocaleTextFunc();return this.createRowDragComp(()=>`1 ${s("rowDragRow","row")}`,e,void 0,t,void 0,!0)}createRowDragCompForCell(e,t,s,i,r,o){const n=this.gos;return n.get("rowDragManaged")&&(!ae(n)||n.get("pagination"))?void 0:this.createRowDragComp(s,e,t,i,r,o)}cancelRowDrag(){this.rowDragFeature?.lastDraggingEvent&&this.beans.dragSvc?.cancelDrag()}computeVisibility(){const e=this.beans,t=e.gos;if(t.get("suppressRowDrag"))return"suppress";if(!t.get("rowDragManaged"))return"visible";const i=e.colModel.isPivotMode();return(i||e.rowGroupColsSvc?.columns?.length)&&!t.get("refreshAfterGroupEdit")?"hidden":i||e.filterManager?.isAnyFilterPresent()||e.sortSvc?.isSortActive()?"disabled":"visible"}refreshVisibility(){const e=this.visibility,t=this.computeVisibility();e!==t&&(this.visibility=t,this.eventSvc?.dispatchEvent({type:"rowDragVisibilityChanged"}))}},qM=class extends E{constructor(){super(...arguments),this.beanName="rowDropHighlightSvc",this.uiLevel=0,this.dragging=!1,this.row=null,this.position="none"}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this)})}onModelUpdated(){const e=this.row,t=this.dragging;!e||e?.rowIndex===null||this.position==="none"?this.clear():this.set(e,this.position),this.dragging=t}destroy(){this.clear(),super.destroy()}clear(){const e=this.row;this.dragging=!1,e&&(this.uiLevel=0,this.position="none",this.row=null,e.dispatchRowEvent("rowHighlightChanged"))}set(e,t){const s=e!==this.row,i=e.uiLevel,r=t!==this.position,o=i!==this.uiLevel;this.dragging=!1,(s||r||o)&&(s&&this.clear(),this.uiLevel=i,this.position=t,this.row=e,e.dispatchRowEvent("rowHighlightChanged"))}fromDrag(e){const t=e?.dropTarget;if(t){const{highlight:s,target:i,position:r}=t;if(s&&i&&r!=="none"){this.set(i,r),this.dragging=!0;return}}this.dragging&&this.clear()}},Wl={moduleName:"Drag",version:H,beans:[BM]},Sv={moduleName:"DragAndDrop",version:H,dynamicBeans:{dndSourceComp:EM},icons:{rowDrag:"grip"}},Oi={moduleName:"SharedDragAndDrop",version:H,beans:[NE],dependsOn:[Wl],userComponents:{agDragAndDropImage:TM},icons:{columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",rowDrag:"grip"}},yv={moduleName:"RowDrag",version:H,beans:[qM,jM],apiFunctions:{addRowDropZone:DM,removeRowDropZone:AM,getRowDropZoneParams:IM,getRowDropPositionIndicator:kM,setRowDropPositionIndicator:LM},dependsOn:[Oi]},mh={moduleName:"HorizontalResize",version:H,beans:[NM],dependsOn:[Wl]},YM=":where(.ag-ltr) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:left .2s}.ag-header-group-cell{transition:left .2s,width .2s}}:where(.ag-rtl) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:right .2s}.ag-header-group-cell{transition:right .2s,width .2s}}",XM=class extends E{constructor(){super(...arguments),this.beanName="colAnimation",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.activeNext=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){if(this.active)return;const{gos:e}=this;e.get("suppressColumnMoveAnimation")||e.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0,this.activeNext=!0)}finish(){this.active&&this.flush(()=>this.activeNext=!1,()=>this.active=!1)}executeNextVMTurn(e){this.activeNext?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount,{gridBodyCtrl:t}=this;t.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&t.setColumnMovingCss(!1)})}flush(e,t){const{executeNextFuncs:s,executeLaterFuncs:i}=this;if(s.length===0&&i.length===0){e(),t();return}const r=o=>{for(;o.length;){const n=o.pop();n&&n()}};this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e(),r(s)},0),window.setTimeout(()=>{t(),r(i)},200)})}};function ZM(e,t,s){e.colMoves?.moveColumnByIndex(t,s,"api")}function QM(e,t,s){e.colMoves?.moveColumns(t,s,"api")}var JM=class extends E{constructor(e){super(),this.pinned=e,this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[]}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;if(t)for(const s of t)s.isPrimary()&&(s.isAnyFunctionActive()||(s.isAllowValue()?this.columnsToAggregate.push(s):s.isAllowRowGroup()?this.columnsToGroup.push(s):s.isAllowPivot()&&this.columnsToPivot.push(s)))}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){const{valueColsSvc:t,rowGroupColsSvc:s,pivotColsSvc:i}=this.beans;this.columnsToAggregate.length>0&&t?.addColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&s?.addColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&i?.addColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function eT(e,t){!t||t.length<=1||t.filter(i=>e.indexOf(i)<0).length>0||t.sort((i,r)=>{const o=e.indexOf(i),n=e.indexOf(r);return o-n})}function tT(e){const t=[...e];for(const s of e){let i=null,r=s.getParent();for(;r!=null&&r.getDisplayedLeafColumns().length===1;)i=r,r=r.getParent();if(i!=null){const n=!!i.getColGroupDef()?.marryChildren?i.getProvidedColumnGroup().getLeafColumns():i.getLeafColumns();for(const a of n)t.includes(a)||t.push(a)}}return t}function sT(e,t,s,i){const r=i.allCols;let o=null,n=null;for(let a=0;ar.includes(h));if(n===null)n=d;else if(!be(d,n))break;const u=rT(c);(o===null||u=p||s&&f<=p))return;const C=sT(g,h,c,d);if(!C)return;const v=C.move;if(!(v>l.getCols().length-h.length))return{columns:h,toIndex:v}}function Rv(e){const{columns:t,toIndex:s}=xv(e)||{},{finished:i,colMoves:r}=e;return!t||s==null?null:(r.moveColumns(t,s,"uiColumnMoved",i),i?null:{columns:t,toIndex:s})}function iT(e,t){const s=t.getCols(),i=e.map(l=>s.indexOf(l)).sort((l,c)=>l-c),r=i[0];return W(i)-r!==i.length-1?null:r}function rT(e){function t(i){const r=[];let o=i.getOriginalParent();for(;o!=null;)r.push(o),o=o.getOriginalParent();return r}let s=0;for(let i=0;io.length?[r,o]:[o,r];for(const n of r)o.indexOf(n)===-1&&s++}return s}function oT(e,t){switch(t){case"left":return e.leftCols;case"right":return e.rightCols;default:return e.centerCols}}function nT(e){const{movingCols:t,draggingRight:s,xPosition:i,pinned:r,gos:o,colModel:n,visibleCols:a}=e;if(o.get("suppressMovableColumns")||t.some(w=>w.getColDef().suppressMovable))return[];const c=oT(a,r),d=n.getCols(),u=c.filter(w=>t.includes(w)),h=c.filter(w=>!t.includes(w)),g=d.filter(w=>!t.includes(w));let p=0,f=i;if(s){let w=0;for(const S of u)w+=S.getActualWidth();f-=w}if(f>0){for(let w=0;w0){const w=h[p-1];m=g.indexOf(w)+1}else m=g.indexOf(h[0]),m===-1&&(m=0);const C=[m],v=(w,S)=>w-S;if(s){let w=m+1;const S=d.length-1;for(;w<=S;)C.push(w),w++;C.sort(v)}else{let w=m;const S=d.length-1;let y=d[w];for(;w<=S&&c.indexOf(y)<0;)w++,C.push(w),y=d[w];w=m-1;const R=0;for(;w>=R;)C.push(w),w--;C.sort(v).reverse()}return C}function Ch(e){const{pinned:t,fromKeyboard:s,gos:i,ctrlsSvc:r,useHeaderRow:o,skipScrollPadding:n}=e;let a=r.getHeaderRowContainerCtrl(t)?.eViewport,{x:l}=e;return a?(s&&(l-=a.getBoundingClientRect().left),i.get("enableRtl")&&(o&&(a=a.querySelector(".ag-header-row")),l=a.clientWidth-l),t==null&&!n&&(l+=r.get("center").getCenterViewportScrollLeft()),l):0}function vh(e,t){for(const s of e)s.moving=t,s.dispatchColEvent("movingChanged","uiColumnMoved")}var Fv=7,wh=100,Ul=wh/2,aT=5,lT=100,cT=class extends E{constructor(e){super(),this.pinned=e,this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.isCenterContainer=!D(e)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){const{pinned:e,lastDraggingEvent:t}=this,{dragItem:s}=t||{},i=s?.columns??[];for(const r of i){const o=r.getPinned();if(r.getColDef().lockPinned){if(o==e)return"move";continue}const n=s?.containerType;if(n===e||!e)return"move";if(e&&(!o||n!==e))return"pinned"}return"notAllowed"}onDragEnter(e){const t=e.dragItem,s=t.columns;if(e.dragSource.type===0)this.setColumnsVisible(s,!0,"uiColumnDragged");else{const r=t.visibleState,o=(s||[]).filter(n=>r[n.getId()]&&!n.isVisible());this.setColumnsVisible(o,!0,"uiColumnDragged")}this.gos.get("suppressMoveWhenColumnDragging")||this.attemptToPinColumns(s,this.pinned),this.onDragging(e,!0,!0)}onDragging(e=this.lastDraggingEvent,t=!1,s=!1,i=!1){const{gos:r,ctrlsSvc:o}=this.beans,n=r.get("suppressMoveWhenColumnDragging");if(i&&!n){this.finishColumnMoving();return}if(this.lastDraggingEvent=e,!e||!i&&ne(e.hDirection))return;const a=Ch({x:e.x,pinned:this.pinned,gos:r,ctrlsSvc:o});t||this.checkCenterForScrolling(a),n?this.handleColumnDragWhileSuppressingMovement(e,t,s,a,i):this.handleColumnDragWhileAllowingMovement(e,t,s,a,i)}onDragLeave(){this.ensureIntervalCleared(),this.clearHighlighted(),this.updateDragItemContainerType(),this.lastMovedInfo=null}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}onDragCancel(){this.clearHighlighted(),this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,s){if(!e?.length)return;const i=e.filter(r=>!r.getColDef().lockVisible);i.length&&this.beans.colModel.setColsVisible(i,t,s)}finishColumnMoving(){this.clearHighlighted();const e=this.lastMovedInfo;if(!e)return;const{columns:t,toIndex:s}=e;this.beans.colMoves.moveColumns(t,s,"uiColumnMoved",!0)}updateDragItemContainerType(){const{lastDraggingEvent:e}=this;if(this.gos.get("suppressMoveWhenColumnDragging")||!e)return;const t=e.dragItem;t&&(t.containerType=this.pinned)}handleColumnDragWhileSuppressingMovement(e,t,s,i,r){const o=this.getAllMovingColumns(e,!0);if(r){const n=this.isAttemptingToPin(o);n&&this.attemptToPinColumns(o,void 0,!0);const{fromLeft:a,xPosition:l}=this.getNormalisedXPositionInfo(o,n)||{};if(a==null||l==null){this.finishColumnMoving();return}this.moveColumnsAfterHighlight({allMovingColumns:o,xPosition:l,fromEnter:t,fakeEvent:s,fromLeft:a})}else{if(!this.beans.dragAndDrop.isDropZoneWithinThisGrid(e))return;this.highlightHoveredColumn(o,i)}}handleColumnDragWhileAllowingMovement(e,t,s,i,r){const o=this.getAllMovingColumns(e),n=this.normaliseDirection(e.hDirection)==="right",a=e.dragSource.type===1,l=this.getMoveColumnParams({allMovingColumns:o,isFromHeader:a,xPosition:i,fromLeft:n,fromEnter:t,fakeEvent:s}),c=Rv({...l,finished:r});c&&(this.lastMovedInfo=c)}getAllMovingColumns(e,t=!1){const s=e.dragSource.getDragItem();let i=null;t?(i=s.columnsInSplit,i||(i=s.columns)):i=s.columns;const r=o=>o.getColDef().lockPinned?o.getPinned()==this.pinned:!0;return i?i.filter(r):[]}getMoveColumnParams(e){const{allMovingColumns:t,isFromHeader:s,xPosition:i,fromLeft:r,fromEnter:o,fakeEvent:n}=e,{gos:a,colModel:l,colMoves:c,visibleCols:d}=this.beans;return{allMovingColumns:t,isFromHeader:s,fromLeft:r,xPosition:i,pinned:this.pinned,fromEnter:o,fakeEvent:n,gos:a,colModel:l,colMoves:c,visibleCols:d}}highlightHoveredColumn(e,t){const{gos:s,colModel:i}=this.beans,r=s.get("enableRtl"),o=i.getCols().filter(d=>d.isVisible()&&d.getPinned()===this.pinned);let n=null,a=null,l=null;for(const d of o){if(a=d.getActualWidth(),n=this.getNormalisedColumnLeft(d,0,r),n!=null){const u=n+a;if(n<=t&&u>=t){l=d;break}}n=null,a=null}if(l)e.indexOf(l)!==-1&&(l=null);else{for(let d=o.length-1;d>=0;d--){const u=o[d],h=o[d].getParent();if(!h){l=u;break}const g=h?.getDisplayedLeafColumns();if(g.length){l=W(g);break}}if(!l)return;n=this.getNormalisedColumnLeft(l,0,r),a=l.getActualWidth()}if(l==null||n==null||a==null){this.lastHighlightedColumn?.column!==l&&this.clearHighlighted();return}let c;if(t-nFv;return t&&s||e.some(i=>i.getPinned()!==this.pinned)}moveColumnsAfterHighlight(e){const{allMovingColumns:t,xPosition:s,fromEnter:i,fakeEvent:r,fromLeft:o}=e,n=this.getMoveColumnParams({allMovingColumns:t,isFromHeader:!0,xPosition:s,fromLeft:o,fromEnter:i,fakeEvent:r}),{columns:a,toIndex:l}=xv(n)||{};a&&l!=null&&(this.lastMovedInfo={columns:a,toIndex:l}),this.finishColumnMoving()}clearHighlighted(){const{lastHighlightedColumn:e}=this;e&&(Ev(e.column,null),this.lastHighlightedColumn=null)}checkCenterForScrolling(e){if(!this.isCenterContainer)return;const t=this.beans.ctrlsSvc.get("center"),s=t.getCenterViewportScrollLeft(),i=s+t.getCenterWidth();let r,o;this.gos.get("enableRtl")?(r=ei-Ul):(o=ei-Ul),this.needToMoveRight=r,this.needToMoveLeft=o,o||r?this.ensureIntervalStarted():this.ensureIntervalCleared()}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),lT),this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName()))}moveInterval(){let e;this.intervalCount++,e=10+this.intervalCount*aT,e>wh&&(e=wh);let t=null;const s=this.gridBodyCon.scrollFeature;if(this.needToMoveLeft?t=s.scrollHorizontally(-e):this.needToMoveRight&&(t=s.scrollHorizontally(e)),t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const{pinnedCols:i,dragAndDrop:r,gos:o}=this.beans;if(this.failedMoveAttempts<=Fv+1||!i)return;if(r.setDragImageCompIcon("pinned"),!o.get("suppressMoveWhenColumnDragging")){const n=this.lastDraggingEvent?.dragItem.columns;this.attemptToPinColumns(n,void 0,!0)}}}getPinDirection(){if(this.needToMoveLeft||this.pinned==="left")return"left";if(this.needToMoveRight||this.pinned==="right")return"right"}attemptToPinColumns(e,t,s=!1){const i=(e||[]).filter(n=>!n.getColDef().lockPinned);if(!i.length)return 0;s&&(t=this.getPinDirection());const{pinnedCols:r,dragAndDrop:o}=this.beans;return r?.setColsPinned(i,t,"uiColumnDragged"),s&&o.nudge(),i.length}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}};function Ev(e,t){e.highlighted!==t&&(e.highlighted=t,e.dispatchColEvent("headerHighlightChanged","uiColumnMoved"))}function dT(e){const t=e.length;let s,i;for(let r=0;r{let r;const o=i.gridBodyCtrl.eBodyViewport;switch(s){case"left":r=[[o,i.left.eContainer],[i.bottomLeft.eContainer],[i.topLeft.eContainer]];break;case"right":r=[[o,i.right.eContainer],[i.bottomRight.eContainer],[i.topRight.eContainer]];break;default:r=[[o,i.center.eViewport],[i.bottomCenter.eViewport],[i.topCenter.eViewport]];break}this.eSecondaryContainers=r}),this.moveColumnFeature=this.createManagedBean(new cT(s)),this.bodyDropPivotTarget=this.createManagedBean(new JM(s)),t.addDropTarget(this),this.addDestroyFunc(()=>t.removeDropTarget(this))}isInterestedIn(e){return e===1||e===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.beans.colModel.isPivotMode()&&e.dragSource.type===0}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}onDragCancel(){this.currentDropListener.onDragCancel()}};function Pv(e,t){const s=[],i=[],r=[];return e.forEach(n=>{const a=n.getColDef().lockPosition;a==="right"?r.push(n):a==="left"||a===!0?s.push(n):i.push(n)}),t.get("enableRtl")?[...r,...i,...s]:[...s,...i,...r]}function Mv(e,t){let s=!0;return Ls(null,t,i=>{if(!Re(i))return;const r=i;if(!r.getColGroupDef()?.marryChildren)return;const a=[];for(const h of r.getLeafColumns()){const g=e.indexOf(h);a.push(g)}const l=Math.max.apply(Math,a),c=Math.min.apply(Math,a),d=l-c,u=r.getLeafColumns().length-1;d>u&&(s=!1)}),s}var hT=class extends E{constructor(){super(...arguments),this.beanName="colMoves"}moveColumnByIndex(e,t,s){const i=this.beans.colModel.getCols();if(!i)return;const r=i[e];this.moveColumns([r],t,s)}moveColumns(e,t,s,i=!0){const{colModel:r,colAnimation:o,visibleCols:n,eventSvc:a}=this.beans,l=r.getCols();if(!l)return;if(t>l.length-e.length){F(30,{toIndex:t});return}o?.start();const c=r.getColsForKeys(e);this.doesMovePassRules(c,t)&&(Qf(r.getCols(),c,t),n.refresh(s),a.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,toIndex:t,finished:i,source:s})),o?.finish()}doesMovePassRules(e,t){const s=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(s)}doesOrderPassRules(e){const{colModel:t,gos:s}=this.beans;return!(!Mv(e,t.getColTree())||!(r=>{const o=c=>c?c==="left"||c===!0?-1:1:0,n=s.get("enableRtl");let a=n?1:-1,l=!0;for(const c of r){const d=o(c.getColDef().lockPosition);n?d>a&&(l=!1):da?"hide":"notAllowed",getDragItem:l?()=>fT(t,n.allCols):()=>pT(t),dragItemName:s,onDragStarted:()=>{a=!i.get("suppressDragLeaveHidesColumns"),vh(c,!0)},onDragStopped:()=>vh(c,!1),onDragCancelled:()=>vh(c,!1),onGridEnter:h=>{if(a){const{columns:g=[],visibleState:p}=h??{},f=l?C=>!p||p[C.getColId()]:()=>!0,m=g.filter(C=>!C.getColDef().lockVisible&&f(C));r.setColsVisible(m,!0,"uiColumnMoved")}},onGridExit:h=>{if(a){const g=h?.columns?.filter(p=>!p.getColDef().lockVisible)||[];r.setColsVisible(g,!1,"uiColumnMoved")}}};return o.addDragSource(u,!0),u}};function gT(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}}function pT(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t,containerType:e.pinned}}function fT(e,t){const s=e.getProvidedColumnGroup().getLeafColumns(),i={};for(const a of s)i[a.getId()]=a.isVisible();const r=[];for(const a of t)s.indexOf(a)>=0&&(r.push(a),De(s,a));for(const a of s)r.push(a);const o=[],n=e.getLeafColumns();for(const a of r)n.indexOf(a)!==-1&&o.push(a);return{columns:r,columnsInSplit:o,visibleState:i,containerType:o[0]?.pinned}}var $l={moduleName:"ColumnMove",version:H,beans:[hT,XM],apiFunctions:{moveColumnByIndex:ZM,moveColumns:QM},dependsOn:[Oi],css:[YM]},mT=class extends E{constructor(){super(...arguments),this.beanName="autoWidthCalc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const s=this.getHeaderCellForColumn(e);if(!s)return-1;const i=this.beans.rowRenderer.getAllCellsNotSpanningForColumn(e);return t||i.push(s),this.getPreferredWidthForElements(i)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.getPreferredWidthForElements([t]):-1}getPreferredWidthForElements(e,t){const s=document.createElement("form");s.style.position="fixed";const i=this.centerRowContainerCtrl.eContainer;for(const o of e)this.cloneItemIntoDummy(o,s);i.appendChild(s);const r=Math.ceil(s.getBoundingClientRect().width);return s.remove(),t=t??this.gos.get("autoSizePadding"),r+t}getHeaderCellForColumn(e){let t=null;for(const s of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()){const i=s.getHtmlElementForColumnHeader(e);i!=null&&(t=i)}return t}cloneItemIntoDummy(e,t){const s=e.cloneNode(!0);s.style.width="",s.style.position="static",s.style.left="";const i=document.createElement("div"),r=i.classList;["ag-header-cell","ag-header-group-cell"].some(a=>s.classList.contains(a))?(r.add("ag-header","ag-header-row"),i.style.position="static"):r.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(l=>n.classList.contains(l))){for(let l=0;lo.getPinned());e.dispatchEvent({type:"columnPinned",pinned:r??null,columns:t,column:i,source:s})}function vT(e,t,s){if(!t.length)return;const i=t.length===1?t[0]:null,r=Dv(t,o=>o.isVisible());e.dispatchEvent({type:"columnVisible",visible:r,columns:t,column:i,source:s})}function Iv(e,t,s,i){e.dispatchEvent({type:t,columns:s,column:s&&s.length==1?s[0]:null,source:i})}function Co(e,t,s,i,r=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:r,finished:s,source:i})}var wT=class extends E{constructor(e,t,s,i){super(),this.comp=e,this.eResize=t,this.pinned=s,this.columnGroup=i}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const{horizontalResizeSvc:e,gos:t,colAutosize:s}=this.beans,i=e.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});this.addDestroyFunc(i),!t.get("suppressAutoSize")&&s&&this.addDestroyFunc(s.addColumnGroupResize(this.eResize,this.columnGroup,()=>this.resizeLeafColumnsToFit("uiColumnResized")))}onResizeStart(e){const{columnsToResize:t,resizeStartWidth:s,resizeRatios:i,groupAfterColumns:r,groupAfterStartWidth:o,groupAfterRatios:n}=this.getInitialValues(e);this.resizeCols=t,this.resizeStartWidth=s,this.resizeRatios=i,this.resizeTakeFromCols=r,this.resizeTakeFromStartWidth=o,this.resizeTakeFromRatios=n,this.toggleColumnResizing(!0)}onResizing(e,t,s="uiColumnResized"){const i=this.normaliseDragChange(t),r=this.resizeStartWidth+i;this.resizeColumnsFromLocalValues(r,s,e)}getInitialValues(e){const t=l=>l.reduce((c,d)=>c+d.getActualWidth(),0),s=(l,c)=>l.map(d=>d.getActualWidth()/c),i=this.getColumnsToResize(),r=t(i),o=s(i,r),n={columnsToResize:i,resizeStartWidth:r,resizeRatios:o};let a=null;if(e&&(a=this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup,"After")??null),a){const l=a.getDisplayedLeafColumns(),c=n.groupAfterColumns=l.filter(u=>u.isResizable()),d=n.groupAfterStartWidth=t(c);n.groupAfterRatios=s(c,d)}else n.groupAfterColumns=void 0,n.groupAfterStartWidth=void 0,n.groupAfterRatios=void 0;return n}resizeLeafColumnsToFit(e){const t=this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup),s=this.getInitialValues();t>s.resizeStartWidth&&this.resizeColumns(s,t,e,!0)}resizeColumnsFromLocalValues(e,t,s=!0){if(!this.resizeCols||!this.resizeRatios)return;const i={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols,groupAfterStartWidth:this.resizeTakeFromStartWidth,groupAfterRatios:this.resizeTakeFromRatios};this.resizeColumns(i,e,t,s)}resizeColumns(e,t,s,i=!0){const{columnsToResize:r,resizeStartWidth:o,resizeRatios:n,groupAfterColumns:a,groupAfterStartWidth:l,groupAfterRatios:c}=e,d=[];if(d.push({columns:r,ratios:n,width:t}),a){const u=t-o;d.push({columns:a,ratios:c,width:l-u})}this.beans.colResize?.resizeColumnSets({resizeSets:d,finished:i,source:s}),i&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.toggleCss("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(t=>t.isResizable())}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?this.pinned!=="left"&&(t*=-1):this.pinned==="right"&&(t*=-1),t}destroy(){super.destroy(),this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}},bT=class extends E{constructor(e,t,s,i,r){super(),this.pinned=e,this.column=t,this.eResize=s,this.comp=i,this.ctrl=r}postConstruct(){const e=[];let t,s;const i=()=>{if(V(this.eResize,t),!t)return;const{horizontalResizeSvc:n,colAutosize:a}=this.beans,l=n.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});e.push(l),s&&a&&e.push(a.addColumnAutosizeListeners(this.eResize,this.column))},r=()=>{for(const n of e)n();e.length=0},o=()=>{const n=this.column.isResizable(),a=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(n!==t||a!==s)&&(t=n,s=a,r(),i())};o(),this.addDestroyFunc(r),this.ctrl.setRefreshFunction("resize",o)}onResizing(e,t){const{column:s,lastResizeAmount:i,resizeStartWidth:r,beans:o}=this,n=this.normaliseResizeAmount(t),a=r+n,l=[{key:s,newWidth:a}],{pinnedCols:c,ctrlsSvc:d,colResize:u}=o;if(this.column.getPinned()){const h=c?.leftWidth??0,g=c?.rightWidth??0,p=gr(d.getGridBodyCtrl().eBodyViewport)-50;if(h+g+(n-i)>p)return}this.lastResizeAmount=n,u?.setColumnWidths(l,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.column.resizing=e,this.comp.toggleCss("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const s=this.pinned!=="left",i=this.pinned==="right";return this.gos.get("enableRtl")?s&&(t*=-1):i&&(t*=-1),t}},ST=class extends E{constructor(){super(...arguments),this.beanName="colResize"}setColumnWidths(e,t,s,i){const r=[],{colModel:o,gos:n,visibleCols:a}=this.beans;for(const l of e){const c=o.getColDefCol(l.key)||o.getCol(l.key);if(!c)continue;if(r.push({width:l.newWidth,ratios:[1],columns:[c]}),n.get("colResizeDefault")==="shift"&&(t=!t),t){const u=a.getColAfter(c);if(!u)continue;const h=c.getActualWidth()-l.newWidth,g=u.getActualWidth()+h;r.push({width:g,ratios:[1],columns:[u]})}}r.length!==0&&this.resizeColumnSets({resizeSets:r,finished:s,source:i})}resizeColumnSets(e){const{resizeSets:t,finished:s,source:i}=e;if(!(!t||t.every(d=>yT(d)))){if(s){const d=t&&t.length>0?t[0].columns:null;Co(this.eventSvc,d,s,i)}return}const o=[],n=[];for(const d of t){const{width:u,columns:h,ratios:g}=d,p={},f={};for(const v of h)n.push(v);let m=!0,C=0;for(;m;){if(C++,C>1e3){Q(31);break}m=!1;const v=[];let w=0,S=u;h.forEach((R,P)=>{if(f[R.getId()])S-=p[R.getId()];else{v.push(R);const T=g[P];w+=T}});const y=1/w;v.forEach((R,P)=>{const M=P===v.length-1;let T;M?T=S:(T=Math.round(g[P]*u*y),S-=T);const I=R.getMinWidth(),k=R.getMaxWidth();T0&&T>k&&(T=k,f[R.getId()]=!0,m=!0),p[R.getId()]=T})}for(const v of h){const w=p[v.getId()];v.getActualWidth()!==w&&(v.setActualWidth(w,i),o.push(v))}}const a=o.length>0;let l=[];if(a){const{colFlex:d,visibleCols:u,colViewport:h}=this.beans;l=d?.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0})??[],u.setLeftValues(i),u.updateBodyWidths(),h.checkViewportColumns()}const c=n.concat(l);(a||s)&&Co(this.eventSvc,c,s,i,l)}resizeHeader(e,t,s){if(!e.isResizable())return;const i=e.getActualWidth(),r=e.getMinWidth(),o=e.getMaxWidth(),n=Math.min(Math.max(i+t,r),o);this.setColumnWidths([{key:e,newWidth:n}],s,!0,"uiColumnResized")}createResizeFeature(e,t,s,i,r){return new bT(e,t,s,i,r)}createGroupResizeFeature(e,t,s,i){return new wT(e,t,s,i)}};function yT(e){const{columns:t,width:s}=e;let i=0,r=0,o=!0;for(const l of t){const c=l.getMinWidth();i+=c||0;const d=l.getMaxWidth();d>0?r+=d:o=!1}const n=s>=i,a=!o||s<=r;return n&&a}var xT={moduleName:"ColumnResize",version:H,beans:[ST],apiFunctions:{setColumnWidths:CT},dependsOn:[mh,Tv]},RT=class extends E{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);for(const t of this.columnGroup.getLeafColumns())t.__addEventListener("widthChanged",e),t.__addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.__removeEventListener("widthChanged",e),t.__removeEventListener("visibleChanged",e)})}removeListenersOnChildrenColumns(){for(const e of this.removeChildListenersFuncs)e();this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.toggleCss("ag-hidden",e===0)}},FT=class extends Yu{constructor(){super(...arguments),this.onSuppressColMoveChange=()=>{!this.isAlive()||this.isSuppressMoving()?this.removeDragSource():this.dragSource||this.setDragSource(this.eGui)}}wireComp(e,t,s,i,r){const{column:o,beans:n}=this,{context:a,colNames:l,colHover:c,rangeSvc:d,colResize:u}=n;this.comp=e,r=Bn(this,a,r),this.setGui(t,r),this.displayName=l.getDisplayNameForColumnGroup(o,"header"),this.refreshHeaderStyles(),this.addClasses(),this.setupMovingCss(r),this.setupExpandable(r),this.setupTooltip(),this.refreshAnnouncement(),this.setupAutoHeight({wrapperElement:i,compBean:r}),this.setupUserComp(),this.addHeaderMouseListeners(r,i),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();const h=this.rowCtrl.pinned,g=o.getProvidedColumnGroup().getLeafColumns();c?.createHoverFeature(r,g,t),d?.createRangeHighlightFeature(r,o,e),r.createManagedBean(new ju(o,t,n)),r.createManagedBean(new RT(e,o)),u?this.resizeFeature=r.createManagedBean(u.createGroupResizeFeature(e,s,h,o)):e.setResizableDisplayed(!1),r.createManagedBean(new Ii(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(r,g),this.addManagedEventListeners({cellSelectionChanged:()=>this.refreshAnnouncement()}),r.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(r),r.addDestroyFunc(()=>this.clearComponent())}getHeaderClassParams(){const{column:e,beans:t}=this,s=e.getDefinition();return N(t.gos,{colDef:s,columnGroup:e,floatingFilter:!1})}refreshMaxHeaderHeight(){const{gos:e,comp:t}=this,s=e.get("groupHeaderHeight");s!=null?s===0?t.setHeaderWrapperHidden(!0):t.setHeaderWrapperMaxHeight(s):(t.setHeaderWrapperHidden(!1),t.setHeaderWrapperMaxHeight(null))}addHighlightListeners(e,t){if(this.beans.gos.get("suppressMoveWhenColumnDragging"))for(const s of t)e.addManagedListeners(s,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,s)})}onLeafColumnHighlightChanged(e){const t=this.column.getDisplayedLeafColumns(),s=t[0]===e,i=W(t)===e;if(!s&&!i)return;const r=e.getHighlighted(),o=!!this.rowCtrl.getHeaderCellCtrls().find(l=>l.column.isMoving());let n=!1,a=!1;if(o){const l=this.beans.gos.get("enableRtl"),c=r===1,d=r===0;s&&(l?a=c:n=d),i&&(l?n=d:a=c)}this.comp.toggleCss("ag-header-highlight-before",n),this.comp.toggleCss("ag-header-highlight-after",a)}resizeHeader(e,t){const{resizeFeature:s}=this;if(!s)return;const i=s.getInitialValues(t);s.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}resizeLeafColumnsToFit(e){this.resizeFeature?.resizeLeafColumnsToFit(e)}setupUserComp(){const{colGroupSvc:e,userCompFactory:t,gos:s,enterpriseMenuFactory:i}=this.beans,r=this.column,o=r.getProvidedColumnGroup(),n=N(s,{displayName:this.displayName,columnGroup:r,setExpanded:l=>{e.setColumnGroupOpened(o,l,"gridInitializing")},setTooltip:(l,c)=>{s.assertModuleRegistered("Tooltip",3),this.setupTooltip(l,c)},showColumnMenu:(l,c)=>i?.showMenuAfterButtonClick(o,l,"columnMenu",c),showColumnMenuAfterMouseClick:(l,c)=>i?.showMenuAfterMouseEvent(o,l,"columnMenu",c),eGridHeader:this.eGui}),a=AE(t,n);a&&this.comp.setUserCompDetails(a)}addHeaderMouseListeners(e,t){const{column:s,comp:i,beans:{rangeSvc:r},gos:o}=this,n=d=>this.handleMouseOverChange(d.type==="mouseenter"),a=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",s.getProvidedColumnGroup()),l=d=>this.handleContextMenuMouseEvent(d,void 0,s.getProvidedColumnGroup());e.addManagedListeners(this.eGui,{mouseenter:n,mouseleave:n,click:a,contextmenu:l}),i.toggleCss("ag-header-group-cell-selectable",Ei(o));const c=r?.createHeaderGroupCellMouseListenerFeature(this.column,t);c&&this.createManagedBean(c)}handleMouseOverChange(e){this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderGroupTooltip(this.tooltipFeature,this,e,t)}setupExpandable(e){const t=this.column.getProvidedColumnGroup();this.refreshExpanded();const s=this.refreshExpanded.bind(this);e.addManagedListeners(t,{expandedChanged:s,expandableChanged:s})}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0),this.refreshHeaderStyles()}addClasses(){const{column:e}=this,t=e.getColGroupDef(),s=Al(t,this.gos,null,e);e.isPadding()?(s.push("ag-header-group-cell-no-group"),e.getLeafColumns().every(r=>r.isSpanHeaderHeight())&&s.push("ag-header-span-height")):(s.push("ag-header-group-cell-with-group"),t?.wrapHeaderText&&s.push("ag-header-cell-wrap-text"));for(const i of s)this.comp.toggleCss(i,!0)}setupMovingCss(e){const{column:t}=this,i=t.getProvidedColumnGroup().getLeafColumns(),r=()=>this.comp.toggleCss("ag-header-cell-moving",t.isMoving());for(const o of i)e.addManagedListeners(o,{movingChanged:r});r()}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription())}handleKeyDown(e){if(super.handleKeyDown(e),!this.getWrapperHasFocus())return;const{column:s,expandable:i,gos:r,beans:o}=this,n=Ei(r);if(e.key==b.ENTER){if(n&&!e.altKey)o.rangeSvc?.handleColumnSelection(s,e);else if(i){const a=!s.isExpanded();o.colGroupSvc.setColumnGroupOpened(s.getProvidedColumnGroup(),a,"uiColumnExpanded")}}}refreshAnnouncement(){let e;const{gos:t}=this;Ei(t)&&(e=this.getLocaleTextFunc()("ariaColumnGroupCellSelection","Press Enter to toggle selection for all visible cells in this column group")),this.ariaAnnouncement=e}announceAriaDescription(){const{beans:e,eGui:t,ariaAnnouncement:s}=this;!s||!t.contains(ie(e))||e.ariaAnnounce?.announceValue(s,"columnHeader")}setDragSource(e){!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),e&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null))}isSuppressMoving(){return this.gos.get("suppressMovableColumns")||this.column.getLeafColumns().some(e=>e.getColDef().suppressMovable||e.getColDef().lockPosition)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function ET(e,t,s){e.colGroupSvc?.setColumnGroupOpened(t,s,"api")}function PT(e,t,s){return e.colGroupSvc?.getColumnGroup(t,s)??null}function MT(e,t){return e.colGroupSvc?.getProvidedColGroup(t)??null}function TT(e,t,s){return e.colNames.getDisplayNameForColumnGroup(t,s)||""}function DT(e){return e.colGroupSvc?.getColumnGroupState()??[]}function AT(e,t){e.colGroupSvc?.setColumnGroupState(t,"api")}function IT(e){e.colGroupSvc?.resetColumnGroupState("api")}function kT(e){return e.visibleCols.treeLeft}function LT(e){return e.visibleCols.treeCenter}function GT(e){return e.visibleCols.treeRight}function OT(e){return e.visibleCols.getAllTrees()}var bh=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let s;return typeof t!="number"?s=0:s=t+1,this.existingIds[e]=s,s}};function VT(e,t){for(let s=0;s=0&&(e[i]=e[e.length-1],e.pop())}}var BT=class extends E{constructor(){super(...arguments),this.beanName="visibleCols",this.colsAndGroupsMap={},this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.headerGroupRowCount=0,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.isBodyWidthDirty=!0}refresh(e,t=!1){const{colFlex:s,colModel:i,colGroupSvc:r,colViewport:o,selectionColSvc:n}=this.beans;t||this.buildTrees(i,r),r?.updateOpenClosedVisibility(),this.leftCols=Sh(this.treeLeft),this.centerCols=Sh(this.treeCenter),this.rightCols=Sh(this.treeRight),n?.refreshVisibility(this.leftCols,this.centerCols,this.rightCols),this.joinColsAriaOrder(i),this.joinCols(),this.headerGroupRowCount=this.getHeaderRowCount(),this.setLeftValues(e),this.autoHeightCols=this.allCols.filter(a=>a.isAutoHeight()),s?.refreshFlexedColumns(),this.updateBodyWidths(),this.setFirstRightAndLastLeftPinned(i,this.leftCols,this.rightCols,e),o.checkViewportColumns(!1),this.eventSvc.dispatchEvent({type:"displayedColumnsChanged",source:e})}getHeaderRowCount(){if(!this.gos.get("hidePaddedHeaderRows"))return this.beans.colModel.cols.treeDepth;let e=0;for(const t of this.allCols){let s=t.getParent();for(;s;){if(!s.isPadding()){const i=s.getProvidedColumnGroup().getLevel()+1;i>e&&(e=i);break}s=s.getParent()}}return e}updateBodyWidths(){const e=ri(this.centerCols),t=ri(this.leftCols),s=ri(this.rightCols);this.isBodyWidthDirty=this.bodyWidth!==e,(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==s)&&(this.bodyWidth=e,this.leftWidth=t,this.rightWidth=s,this.eventSvc.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventSvc.dispatchEvent({type:"displayedColumnsWidthChanged"}))}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e,t,s,i){let r,o;this.gos.get("enableRtl")?(r=t?t[0]:null,o=s?W(s):null):(r=t?W(t):null,o=s?s[0]:null);for(const n of e.getCols())n.setLastLeftPinned(n===r,i),n.setFirstRightPinned(n===o,i)}buildTrees(e,t){const s=e.getColsToShow(),i=s.filter(l=>l.getPinned()=="left"),r=s.filter(l=>l.getPinned()=="right"),o=s.filter(l=>l.getPinned()!="left"&&l.getPinned()!="right"),n=new bh,a=l=>t?t.createColumnGroups(l):l.columns;this.treeLeft=a({columns:i,idCreator:n,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=a({columns:r,idCreator:n,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=a({columns:o,idCreator:n,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.ariaOrderColumns=[]}joinColsAriaOrder(e){const t=e.getCols(),s=[],i=[],r=[];for(const o of t){const n=o.getPinned();n?n===!0||n==="left"?s.push(o):r.push(o):i.push(o)}this.ariaOrderColumns=s.concat(i).concat(r)}getAriaColIndex(e){let t;return Le(e)?t=e.getLeafColumns()[0]:t=e,this.ariaOrderColumns.indexOf(t)+1}setLeftValuesOfGroups(){for(const e of[this.treeLeft,this.treeRight,this.treeCenter])for(const t of e)Le(t)&&t.checkLeft()}setLeftValuesOfCols(e){const{colModel:t}=this.beans;if(!t.getColDefCols())return;const i=t.getCols().slice(0),r=this.gos.get("enableRtl");for(const o of[this.leftCols,this.rightCols,this.centerCols]){if(r){let n=ri(o);for(const a of o)n-=a.getActualWidth(),a.setLeft(n,e)}else{let n=0;for(const a of o)a.setLeft(n,e),n+=a.getActualWidth()}VT(i,o)}for(const o of i)o.setLeft(null,e)}joinCols(){this.gos.get("enableRtl")?this.allCols=this.rightCols.concat(this.centerCols).concat(this.leftCols):this.allCols=this.leftCols.concat(this.centerCols).concat(this.rightCols)}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}isColDisplayed(e){return this.allCols.indexOf(e)>=0}getLeftColsForRow(e){const{leftCols:t,beans:{colModel:s}}=this;return s.colSpanActive?this.getColsForRow(e,t):t}getRightColsForRow(e){const{rightCols:t,beans:{colModel:s}}=this;return s.colSpanActive?this.getColsForRow(e,t):t}getColsForRow(e,t,s,i){const r=[];let o=null;for(let n=0;n1){const h=c-1;for(let g=1;g<=h;g++)d.push(t[n+g]);n+=h}let u;if(s){u=!1;for(const h of d)s(h)&&(u=!0)}else u=!0;u&&(r.length===0&&o&&(i&&i(a))&&r.push(o),r.push(a)),o=a}return r}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getColBefore(e){const t=this.allCols,s=t.indexOf(e);return s>0?t[s-1]:null}isPinningLeft(){return this.leftCols.length>0}isPinningRight(){return this.rightCols.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=t=>{this.colsAndGroupsMap[t.getUniqueId()]=t};Tr(this.treeCenter,!1,e),Tr(this.treeLeft,!1,e),Tr(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["leftCols","centerCols","rightCols"];e&&t.reverse();for(let s=0;s{bs(s)&&t.push(s)}),t}var NT=class extends E{constructor(){super(...arguments),this.beanName="colGroupSvc"}getColumnGroupState(){const e=[],t=this.beans.colModel.getColTree();return Ls(null,t,s=>{Re(s)&&e.push({groupId:s.getGroupId(),open:s.isExpanded()})}),e}resetColumnGroupState(e){const t=this.beans.colModel.getColDefColTree();if(!t)return;const s=[];Ls(null,t,i=>{if(Re(i)){const r=i.getColGroupDef(),o={groupId:i.getGroupId(),open:r?r.openByDefault:void 0};s.push(o)}}),this.setColumnGroupState(s,e)}setColumnGroupState(e,t){const{colModel:s,colAnimation:i,visibleCols:r,eventSvc:o}=this.beans;if(!s.getColTree().length)return;i?.start();const a=[];for(const l of e){const c=l.groupId,d=l.open,u=this.getProvidedColGroup(c);u&&u.isExpanded()!==d&&(u.setExpanded(d),a.push(u))}r.refresh(t,!0),a.length&&o.dispatchEvent({type:"columnGroupOpened",columnGroup:a.length===1?a[0]:void 0,columnGroups:a}),i?.finish()}setColumnGroupOpened(e,t,s){let i;Re(e)?i=e.getId():i=e||"",this.setColumnGroupState([{groupId:i,open:t}],s)}getProvidedColGroup(e){let t=null;return Ls(null,this.beans.colModel.getColTree(),s=>{Re(s)&&s.getId()===e&&(t=s)}),t}getGroupAtDirection(e,t){const s=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),i=e.getDisplayedLeafColumns(),r=t==="After"?W(i):i[0],o=`getCol${t}`;for(;;){const n=this.beans.visibleCols[o](r);if(!n)return null;const a=this.getColGroupAtLevel(n,s);if(a!==e)return a}}getColGroupAtLevel(e,t){let s=e.getParent(),i,r;for(;i=s.getProvidedColumnGroup().getLevel(),r=s.getPaddingLevel(),!(i+r<=t);)s=s.getParent();return s}updateOpenClosedVisibility(){const e=this.beans.visibleCols.getAllTrees();Tr(e,!1,t=>{Le(t)&&t.calculateDisplayedColumns()})}getColumnGroup(e,t){if(!e)return null;if(Le(e))return e;const s=this.beans.visibleCols.getAllTrees(),i=typeof t=="number";let r=null;return Tr(s,!1,o=>{if(Le(o)){const n=o;let a;i?a=e===n.getGroupId()&&t===n.getPartId():a=e===n.getGroupId(),a&&(r=n)}}),r}createColumnGroups(e){const{columns:t,idCreator:s,pinned:i,oldDisplayedGroups:r,isStandaloneStructure:o}=e,n=this.mapOldGroupsById(r),a=[];let l=t;for(;l.length;){const c=l;l=[];let d=0;const u=h=>{const g=d;d=h;const p=c[g],m=(Le(p)?p.getProvidedColumnGroup():p).getOriginalParent();if(m==null){for(let v=g;vRe(d))){l.setChildren([n]);continue}else{l.setChildren(e);break}r.push(n)}}return r}findDepth(e){let t=0,s=e;for(;s?.[0]&&Re(s[0]);)t++,s=s[0].getChildren();return t}findMaxDepth(e,t){let s=t;for(let i=0;i=0;o--){const n=new br(null,`FAKE_PATH_${i.getId()}_${o}`,!0,o);this.createBean(n),n.setChildren([r]),r.originalParent=n,r=n}t===0&&(i.originalParent=null),s.push(r)}return s}findExistingGroup(e,t){if(e.groupId!=null)for(let i=0;i{for(const r of i)if(Le(r)){const o=r;t[r.getUniqueId()]=o,s(o.getChildren())}};return e&&s(e),t}setupParentsIntoCols(e,t){for(const s of e??[])if(s.parent!==t&&(this.beans.colViewport.colsWithinViewportHash=""),s.parent=t,Le(s)){const i=s;this.setupParentsIntoCols(i.getChildren(),i)}}},yh={moduleName:"ColumnGroup",version:H,dynamicBeans:{headerGroupCellCtrl:FT},beans:[NT],apiFunctions:{getAllDisplayedColumnGroups:OT,getCenterDisplayedColumnGroups:LT,getColumnGroup:PT,getColumnGroupState:DT,getDisplayNameForColumnGroup:TT,getLeftDisplayedColumnGroups:kT,getProvidedColumnGroup:MT,getRightDisplayedColumnGroups:GT,resetColumnGroupState:IT,setColumnGroupOpened:ET,setColumnGroupState:AT}};function qe(e,t,s){const{colModel:i,rowGroupColsSvc:r,pivotColsSvc:o,autoColSvc:n,selectionColSvc:a,colAnimation:l,visibleCols:c,pivotResultCols:d,environment:u,valueColsSvc:h,eventSvc:g,gos:p}=e,f=i.getColDefCols()??[],m=a?.getColumns();if(!f.length&&!m?.length)return!1;if(t?.state&&!t.state.forEach)return F(32),!1;const C=(y,R,P,M,T)=>{if(!y)return;const I=tE(R,t.defaultState),k=I("flex").value1,L=I("sort").value1,j=I("sortType").value1,U=ii(L)||Cl(j),O=rs(j),X=Fn(L),se=U?{type:O,direction:X}:void 0;if(sC(e,y,I("hide").value1,se,I("sortIndex").value1,I("pinned").value1,k,s),k==null){const we=I("width").value1;if(we!=null){const pe=y.getColDef().minWidth??u.getDefaultColumnMinWidth();pe!=null&&we>=pe&&y.setActualWidth(we,s)}}T||!y.isPrimary()||(h?.syncColumnWithState(y,s,I),r?.syncColumnWithState(y,s,I,P),o?.syncColumnWithState(y,s,I,M))},v=(y,R,P)=>{const M=kv(e,s),T=R.slice(),I={},k={},L=[],j=[],U=[];let O=0;const X=r?.columns.slice()??[],se=o?.columns.slice()??[];for(const ge of y){const it=ge.colId;if(it.startsWith($t)){L.push(ge),U.push(ge);continue}if(Gs(it)){j.push(ge),U.push(ge);continue}const _t=P(it);_t?(C(_t,ge,I,k,!1),De(T,_t)):(U.push(ge),O+=1)}const we=ge=>C(ge,null,I,k,!1);T.forEach(we),r?.sortColumns(Gv.bind(r,I,X)),o?.sortColumns(Gv.bind(o,k,se)),i.refreshCols(!1,s);const pe=(ge,it,Z=[])=>{for(const _t of it){const Ms=ge(_t.colId);De(Z,Ms),C(Ms,_t,null,null,!0)}Z.forEach(we)};return pe(ge=>n?.getColumn(ge)??null,L,n?.getColumns()?.slice()),pe(ge=>a?.getColumn(ge)??null,j,a?.getColumns()?.slice()),HT(t,i,p),c.refresh(s),g.dispatchEvent({type:"columnEverythingChanged",source:s}),M(),{unmatchedAndAutoStates:U,unmatchedCount:O}};l?.start();let{unmatchedAndAutoStates:w,unmatchedCount:S}=v(t.state||[],f,y=>i.getColDefCol(y));if(w.length>0||D(t.defaultState)){const y=d?.getPivotResultCols()?.list??[];S=v(w,y,R=>d?.getPivotResultCol(R)??null).unmatchedCount}return l?.finish(),S===0}function xh(e,t){const{colModel:s,autoColSvc:i,selectionColSvc:r,eventSvc:o,gos:n}=e,a=s.getColDefCols();if(!a?.length)return;const l=s.getColDefColTree(),c=wl(l),d=[];let u=1e3,h=1e3;const g=v=>{const w=Lv(v);ne(w.rowGroupIndex)&&w.rowGroup&&(w.rowGroupIndex=u++),ne(w.pivotIndex)&&w.pivot&&(w.pivotIndex=h++),d.push(w)};i?.getColumns()?.forEach(g),r?.getColumns()?.forEach(g),c?.forEach(g),qe(e,{state:d},t);const p=i?.getColumns()??[],C=[...r?.getColumns()??[],...p,...a].map(v=>({colId:v.colId}));qe(e,{state:C,applyOrder:!0},t),o.dispatchEvent(N(n,{type:"columnsReset",source:t}))}function kv(e,t){const{rowGroupColsSvc:s,pivotColsSvc:i,valueColsSvc:r,colModel:o,sortSvc:n,eventSvc:a}=e,l={rowGroupColumns:s?.columns.slice()??[],pivotColumns:i?.columns.slice()??[],valueColumns:r?.columns.slice()??[]},c=Un(e),d={};for(const u of c)d[u.colId]=u;return()=>{const u=(R,P,M,T)=>{const I=P.map(T),k=M.map(T);if(be(I,k))return;const j=new Set(P);for(const O of M)j.delete(O)||j.add(O);const U=[...j];a.dispatchEvent({type:R,columns:U,column:U.length===1?U[0]:null,source:t})},h=R=>{const P=[];return o.forAllCols(M=>{const T=d[M.getColId()];T&&R(T,M)&&P.push(M)}),P},g=R=>R.getColId();u("columnRowGroupChanged",l.rowGroupColumns,s?.columns??[],g),u("columnPivotChanged",l.pivotColumns,i?.columns??[],g);const f=h((R,P)=>{const M=R.aggFunc!=null,T=M!=P.isValueActive(),I=M&&R.aggFunc!=P.getAggFunc();return T||I});f.length>0&&Iv(a,"columnValueChanged",f,t),Co(a,h((R,P)=>R.width!=P.getActualWidth()),!0,t),Av(a,h((R,P)=>R.pinned!=P.getPinned()),t),vT(a,h((R,P)=>R.hide==P.isVisible()),t);const S=h((R,P)=>!Rn(P.getSortDef(),{type:rs(R.sortType),direction:Fn(R.sort)})||R.sortIndex!=P.getSortIndex());S.length>0&&n?.dispatchSortChangedEvents(t,S);const y=Un(e);_T(c,y,t,o,a)}}function Un(e){const{colModel:t,rowGroupColsSvc:s,pivotColsSvc:i}=e,r=t.getColDefCols();if(ne(r)||!t.isAlive())return[];const o=s?.columns,n=i?.columns,a=[],l=d=>{const u=d.isRowGroupActive()&&o?o.indexOf(d):null,h=d.isPivotActive()&&n?n.indexOf(d):null,g=d.isValueActive()?d.getAggFunc():null,p=d.getSortIndex()!=null?d.getSortIndex():null;a.push({colId:d.getColId(),width:d.getActualWidth(),hide:!d.isVisible(),pinned:d.getPinned(),sort:d.getSort(),sortType:d.getSortDef()?.type,sortIndex:p,aggFunc:g,rowGroup:d.isRowGroupActive(),rowGroupIndex:u,pivot:d.isPivotActive(),pivotIndex:h,flex:d.getFlex()??null})};t.forAllCols(d=>l(d));const c=new Map(t.getCols().map((d,u)=>[d.getColId(),u]));return a.sort((d,u)=>{const h=c.has(d.colId)?c.get(d.colId):-1,g=c.has(u.colId)?c.get(u.colId):-1;return h-g}),a}function Lv(e){const t=(m,C)=>m??C??null,s=e.getColDef(),i=Ut(t(s.sort,s.initialSort)),r=i.direction,o=i.type,n=t(s.sortIndex,s.initialSortIndex),a=t(s.hide,s.initialHide),l=t(s.pinned,s.initialPinned),c=t(s.width,s.initialWidth),d=t(s.flex,s.initialFlex);let u=t(s.rowGroupIndex,s.initialRowGroupIndex),h=t(s.rowGroup,s.initialRowGroup);u==null&&!h&&(u=null,h=null);let g=t(s.pivotIndex,s.initialPivotIndex),p=t(s.pivot,s.initialPivot);g==null&&!p&&(g=null,p=null);const f=t(s.aggFunc,s.initialAggFunc);return{colId:e.getColId(),sort:r,sortType:o,sortIndex:n,hide:a,pinned:l,width:c,flex:d,rowGroup:h,rowGroupIndex:u,pivot:p,pivotIndex:g,aggFunc:f}}function HT(e,t,s){if(!e.applyOrder||!e.state)return;const i=[];for(const r of e.state)r.colId!=null&&i.push(r.colId);zT(t.cols,i,t,s)}function zT(e,t,s,i){if(e==null)return;let r=[];const o={};for(const a of t){if(o[a])continue;const l=e.map[a];l&&(r.push(l),o[a]=!0)}let n=0;for(const a of e.list){const l=a.getColId();if(o[l]!=null)continue;l.startsWith($t)?r.splice(n++,0,a):r.push(a)}if(r=Pv(r,i),!Mv(r,s.getColTree())){F(39);return}e.list=r}function _T(e,t,s,i,r){const o={};for(const d of t)o[d.colId]=d;const n={};for(const d of e)o[d.colId]&&(n[d.colId]=!0);const a=e.filter(d=>n[d.colId]),l=t.filter(d=>n[d.colId]),c=[];l.forEach((d,u)=>{const h=a?.[u];if(h&&h.colId!==d.colId){const g=i.getCol(h.colId);g&&c.push(g)}}),c.length&&r.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,finished:!0,source:s})}var Gv=(e,t,s,i)=>{const r=e[s.getId()],o=e[i.getId()],n=r!=null,a=o!=null;if(n&&a)return r-o;if(n)return-1;if(a)return 1;const l=t.indexOf(s),c=t.indexOf(i),d=l>=0,u=c>=0;return d&&u?l-c:d?-1:1},WT=class extends E{constructor(){super(...arguments),this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","groupHideColumnsUntilExpanded","rowNumbers","hidePaddedHeaderRows"],e=>this.refreshAll(Os(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),Os(e.source)))}createColsFromColDefs(e){const{beans:t}=this,{valueCache:s,colAutosize:i,rowGroupColsSvc:r,pivotColsSvc:o,valueColsSvc:n,visibleCols:a,eventSvc:l,groupHierarchyColSvc:c}=t,d=this.colDefs?kv(t,e):void 0;s?.expire();const u=this.colDefCols?.list,h=this.colDefCols?.tree,g=du(t,this.colDefs,!0,h,e);os(t,this.colDefCols?.tree,g.columnTree);const p=g.columnTree,f=g.treeDepth,m=wl(p),C={};for(const v of m)C[v.getId()]=v;this.colDefCols={tree:p,treeDepth:f,list:m,map:C},this.createColumnsForService([c],this.colDefCols,e),r?.extractCols(e,u),o?.extractCols(e,u),n?.extractCols(e,u),this.ready=!0,this.changeEventsDispatching=!0,this.refreshCols(!0,e),this.changeEventsDispatching=!1,a.refresh(e),l.dispatchEvent({type:"columnEverythingChanged",source:e}),d&&(this.changeEventsDispatching=!0,d(),this.changeEventsDispatching=!1),l.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing"&&i?.applyAutosizeStrategy()}refreshCols(e,t){if(!this.colDefCols)return;const s=this.cols?.tree;this.saveColOrder();const{autoColSvc:i,selectionColSvc:r,rowNumbersSvc:o,quickFilter:n,pivotResultCols:a,showRowGroupCols:l,rowAutoHeight:c,visibleCols:d,colViewport:u,eventSvc:h,formula:g}=this.beans,p=this.selectCols(a,this.colDefCols);g?.setFormulasActive(p),this.createColumnsForService([i,r,o],p,t);const f=VF(this.gos,this.showingPivotResult);(!e||f)&&this.restoreColOrder(p),this.positionLockedCols(p),l?.refresh(),n?.refreshCols(),this.setColSpanActive(),c?.setAutoHeightActive(p),d.clear(),u.clear(),be(s,this.cols.tree)||h.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,s){for(const i of e)i&&(i.createColumns(t,r=>{this.lastOrder=r(this.lastOrder),this.lastPivotOrder=r(this.lastPivotOrder)},s),i.addColumns(t))}selectCols(e,t){const s=e?.getPivotResultCols()??null;this.showingPivotResult=s!=null;const{map:i,list:r,tree:o,treeDepth:n}=s??t;return this.cols={list:r.slice(),map:{...i},tree:o.slice(),treeDepth:n},s&&(s.list.some(l=>this.cols?.map[l.getColId()]!==void 0)||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const{beans:e,showingPivotResult:t,cols:s}=this,{valueColsSvc:i,selectionColSvc:r,gos:o}=e,n=this.isPivotMode()&&!t,a=r?.isSelectionColumnEnabled(),l=si(e),c=i?.columns,d=su(o);return s.list.filter(h=>{const g=Sr(h);return n?c?.includes(h)||g&&(!d||h.isVisible())||a&&Gs(h)||l&&Fe(h):g&&!d||h.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,s){qe(this.beans,{state:e.map(i=>({colId:typeof i=="string"?i:i.getColId(),hide:!t}))},s)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const s=t.filter(u=>e.map[u.getId()]!=null);if(s.length===0)return;if(s.length===e.list.length){e.list=s;return}const i=u=>{const h=u.getOriginalParent();return h?h.getChildren().length>1?!0:i(h):!1};if(!s.some(u=>i(u))){const u=new Set(s);for(const h of e.list)u.has(h)||s.push(h);e.list=s;return}const r=new Map;for(let u=0;u!r.has(u));if(o.length===0){e.list=s;return}const n=(u,h)=>{const g=h?h.getOriginalParent():u.getOriginalParent();if(!g)return null;let p=null,f=null;for(const m of g.getChildren())if(!(m===h||m===u)){if(m instanceof is){const C=r.get(m);if(C==null)continue;(p==null||p{const v=r.get(C);v!=null&&(p==null||p=0;u--)c[d--]=a[u];for(let u=s.length-1;u>=0;u--){const h=s[u],g=l.get(h);if(g)if(Array.isArray(g))for(let p=g.length-1;p>=0;p--){const f=g[p];c[d--]=f}else c[d--]=g;c[d--]=h}e.list=c}positionLockedCols(e){e.list=Pv(e.list,this.gos)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list??null:this.lastOrder=this.cols?.list??null}getColumnDefs(e){return this.colDefCols&&this.beans.colDefFactory?.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,this.cols?.list??[],e)}setColSpanActive(){this.colSpanActive=!!this.cols?.list.some(e=>e.getColDef().colSpan!=null)}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode||(this.pivotMode=e,!this.ready))return;this.refreshCols(!1,t);const{visibleCols:s,eventSvc:i}=this.beans;s.refresh(t),i.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){const e=this.beans.pivotColsSvc?.columns;return this.pivotMode&&!!e?.length}recreateColumnDefs(e){if(!this.cols)return;this.beans.autoColSvc?.updateColumns(e);const t=Os(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){os(this.beans,this.colDefCols?.tree),super.destroy()}getColTree(){return this.cols?.tree??[]}getColDefColTree(){return this.colDefCols?.tree??[]}getColDefCols(){return this.colDefCols?.list??null}getCols(){return this.cols?.list??[]}forAllCols(e){const{pivotResultCols:t,autoColSvc:s,selectionColSvc:i,groupHierarchyColSvc:r}=this.beans;tn(this.colDefCols?.list,e)||tn(s?.columns?.list,e)||tn(i?.columns?.list,e)||tn(r?.columns?.list,e)||tn(t?.getPivotResultCols()?.list,e)}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColById(e){return this.cols?.map[e]??null}getColFromCollection(e,t){if(t==null)return null;const{map:s,list:i}=t;if(typeof e=="string"&&s[e])return s[e];for(let a=0;ae(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return ts(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}};function $T(e){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:e,ref:"eInput",cls:"ag-input-field-input"}]}]}}var li=class extends Rh{constructor(e,t,s="text",i="input"){super(e,e?.template??$T(i),[],t),this.inputType=s,this.displayFieldTag=i,this.eLabel=x,this.eWrapper=x,this.eInput=x}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:s,className:i}=this;e.classList.add(`${i}-label`),t.classList.add(`${i}-input-wrapper`),s.classList.add(`${i}-input`),this.addCss("ag-input-field"),s.id=s.id||`ag-${this.getCompId()}-input`;const{inputName:r,inputWidth:o,inputPlaceholder:n,autoComplete:a,tabIndex:l}=this.config;r!=null&&this.setInputName(r),o!=null&&this.setInputWidth(o),n!=null&&this.setInputPlaceholder(n),a!=null&&this.setAutoComplete(a),this.addInputListeners(),this.activateTabIndex([s],l)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){this.displayFieldTag==="input"&&(this.inputType=e,nt(this.eInput,"type",e))}getInputElement(){return this.eInput}getWrapperElement(){return this.eWrapper}setInputWidth(e){return Za(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return nt(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return de(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return wi(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)nt(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";nt(this.eInput,"autocomplete",t)}return this}},Vi=class extends li{constructor(e,t="ag-checkbox",s="checkbox"){super(e,t,s),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t,name:s}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t),s!=null&&this.setName(s)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0;const s=this.eInput;s.checked=e,s.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,s){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:s});const i=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:i.id,name:i.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),s=this.selected=e.target.checked;this.refreshSelectedClass(s),this.dispatchChange(s,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",e===!0),t.toggle("ag-indeterminate",e==null)}},ds={selector:"AG-CHECKBOX",component:Vi},KT=".ag-checkbox-cell{height:100%}",jT={tag:"div",cls:"ag-cell-wrapper ag-checkbox-cell",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},qT=class extends A{constructor(){super(jT,[ds]),this.eCheckbox=x,this.registerCSS(KT)}init(e){this.refresh(e);const{eCheckbox:t,beans:s}=this,i=t.getInputElement();i.setAttribute("tabindex","-1"),sm(i,"polite"),this.addManagedListeners(i,{click:r=>{if(Ee(r),t.isDisabled())return;const o=t.getValue();this.onCheckboxChanged(o)},dblclick:r=>{Ee(r)}}),this.addManagedElementListeners(e.eGridCell,{keydown:r=>{if(r.key===b.SPACE&&!t.isDisabled()){e.eGridCell===ie(s)&&t.toggle();const o=t.getValue();this.onCheckboxChanged(o),r.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,s=!0;const{value:i,column:r,node:o}=e;if(o.group&&r)if(typeof i=="boolean")t=i;else{const u=r.getColId();u.startsWith($t)?t=i==null||i===""?void 0:i==="true":o.aggData&&o.aggData[u]!==void 0||o.sourceRowIndex>=0?t=i??void 0:s=!1}else t=i??void 0;const{eCheckbox:n}=this;if(!s){n.setDisplayed(!1);return}n.setValue(t);const a=e.disabled??!r?.isCellEditable(o);n.setDisabled(a);const l=this.getLocaleTextFunc(),c=qa(l,t),d=a?c:`${l("ariaToggleCellValue","Press SPACE to toggle cell value")} (${c})`;n.setInputAriaLabel(d)}onCheckboxChanged(e){const{params:t}=this,{column:s,node:i,value:r}=t,{editSvc:o}=this.beans;if(!s)return;const n={rowNode:i,column:s};o?.dispatchCellEvent(n,null,"cellEditingStarted",{value:r});const a=i.setDataValue(s,e,"ui");o?.dispatchCellEvent(n,null,"cellEditingStopped",{oldValue:r,newValue:e,valueChanged:a}),a||this.updateCheckbox(t)}},YT={tag:"div",cls:"ag-skeleton-container"},XT=class extends A{constructor(){super(YT)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>Cs(e.eParentOfValue)),Cs(e.eParentOfValue,t),e.deferRender?this.setupLoading(e):e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.getLocaleTextFunc();this.getGui().textContent=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");de(this.getGui(),t)}setupLoading(e){const t=re({tag:"div",cls:"ag-skeleton-effect"}),s=e.node.rowIndex;if(s!=null){const o=75+25*(s%2===0?Math.sin(s):Math.cos(s));t.style.width=`${o}%`}this.getGui().appendChild(t);const i=this.getLocaleTextFunc(),r=e.deferRender?i("ariaDeferSkeletonCellLoading","Cell is loading"):i("ariaSkeletonCellLoading","Row data is loading");de(this.getGui(),r)}refresh(e){return!1}},ZT={moduleName:"CheckboxCellRenderer",version:H,userComponents:{agCheckboxCellRenderer:qT}},QT={moduleName:"SkeletonCellRenderer",version:H,userComponents:{agSkeletonCellRenderer:XT}};function JT(e,t){const s=e.colModel.getColDefCol(t);return s?s.getColDef():null}function eD(e){return e.colModel.getColumnDefs(!0)}function tD(e,t,s){return e.colNames.getDisplayNameForColumn(t,s)||""}function sD(e,t){return e.colModel.getColDefCol(t)}function iD(e){return e.colModel.getColDefCols()}function rD(e,t){return qe(e,t,"api")}function oD(e){return Un(e)}function nD(e){xh(e,"api")}function aD(e){return e.visibleCols.isPinningLeft()||e.visibleCols.isPinningRight()}function lD(e){return e.visibleCols.isPinningLeft()}function cD(e){return e.visibleCols.isPinningRight()}function dD(e,t){return e.visibleCols.getColAfter(t)}function uD(e,t){return e.visibleCols.getColBefore(t)}function hD(e,t,s){e.colModel.setColsVisible(t,s,"api")}function gD(e,t,s){e.pinnedCols?.setColsPinned(t,s,"api")}function pD(e){return e.colModel.getCols()}function fD(e){return e.visibleCols.leftCols}function mD(e){return e.visibleCols.centerCols}function CD(e){return e.visibleCols.rightCols}function vD(e){return e.visibleCols.allCols}function wD(e){return e.colViewport.getViewportColumns()}function Fh(e,t){if(!e)return;const s=e,i={};for(const r of Object.keys(s)){if(t&&t.indexOf(r)>=0||Sm.has(r))continue;const o=s[r];typeof o=="object"&&o!==null&&o.constructor===Object?i[r]=Fh(o):i[r]=o}return i}var bD=class extends E{constructor(){super(...arguments),this.beanName="colDefFactory"}wireBeans(e){this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc}getColumnDefs(e,t,s,i,r=!1){const o=e.slice();t?o.sort((l,c)=>s.indexOf(l)-s.indexOf(c)):(s||r)&&o.sort((l,c)=>i.indexOf(l)-i.indexOf(c));const n=this.rowGroupColsSvc?.columns,a=this.pivotColsSvc?.columns;return this.buildColumnDefs(o,n,a)}buildColumnDefs(e,t=[],s=[]){const i=[],r={};for(const o of e){const n=this.createDefFromColumn(o,t,s);let a=!0,l=n,c=o.getOriginalParent(),d=null;for(;c;){let u=null;if(c.isPadding()){c=c.getOriginalParent();continue}const h=r[c.getGroupId()];if(h){h.children.push(l),a=!1;break}if(u=this.createDefFromGroup(c),u&&(u.children=[l],r[u.groupId]=u,l=u,c=c.getOriginalParent()),c!=null&&d===c){a=!1;break}d=c}a&&i.push(l)}return i}createDefFromGroup(e){const t=Fh(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,s){const i=Fh(e.getColDef());return i.colId=e.getColId(),i.width=e.getActualWidth(),i.rowGroup=e.isRowGroupActive(),i.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,i.pivot=e.isPivotActive(),i.pivotIndex=e.isPivotActive()?s.indexOf(e):null,i.aggFunc=e.isValueActive()?e.getAggFunc():null,i.hide=e.isVisible()?void 0:!0,i.pinned=e.isPinned()?e.getPinned():null,i.sort=e.getSortDef(),i.sortIndex=e.getSortIndex()!=null?e.getSortIndex():null,i}},SD=class extends E{constructor(){super(...arguments),this.beanName="colFlex",this.columnsHidden=!1}refreshFlexedColumns(e={}){const t=e.source??"flex";e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth);const s=this.flexViewportWidth,{visibleCols:i,colDelayRenderSvc:r}=this.beans,o=i.centerCols;let n=-1;if(e.resizingCols){const f=new Set(e.resizingCols);for(let m=o.length-1;m>=0;m--)if(f.has(o[m])){n=m;break}}let a=!1;const l=o.map((f,m)=>{const C=f.getFlex(),v=C!=null&&C>0&&m>n;return a||(a=v),{col:f,isFlex:v,flex:Math.max(0,C??0),initialSize:f.getActualWidth(),min:f.getMinWidth(),max:f.getMaxWidth(),targetSize:0}});if(a?(r?.hideColumns("colFlex"),this.columnsHidden=!0):this.columnsHidden&&this.revealColumns(r),!s||!a)return[];let c=l.length,d=l.reduce((f,m)=>f+m.flex,0),u=s;const h=(f,m)=>{f.frozenSize=m,f.col.setActualWidth(m,t),u-=m,d-=f.flex,c-=1},g=f=>f.frozenSize!=null;for(const f of l)f.isFlex||h(f,f.initialSize);for(;c>0;){const f=Math.round(d<1?u*d:u);let m,C=0,v=0;for(const y of l){if(g(y))continue;m=y,v+=f*(y.flex/d);const R=v-C,P=Math.round(R);y.targetSize=P,C+=P}m&&(m.targetSize+=f-C);let w=0;for(const y of l){if(g(y))continue;const R=y.targetSize,P=Math.min(Math.max(R,y.min),y.max);w+=P-R,y.violationType=P===R?void 0:P0?"min":"max";for(const y of l)g(y)||(S==="all"||y.violationType===S)&&h(y,y.targetSize)}e.skipSetLeft||i.setLeftValues(t),e.updateBodyWidths&&i.updateBodyWidths();const p=l.filter(f=>f.isFlex&&!f.violationType).map(f=>f.col);if(e.fireResizedEvent){const f=l.filter(C=>C.initialSize!==C.frozenSize).map(C=>C.col),m=l.filter(C=>C.flex).map(C=>C.col);Co(this.eventSvc,f,!0,t,m)}return this.revealColumns(r),p}revealColumns(e){this.columnsHidden&&(e?.revealColumns("colFlex"),this.columnsHidden=!1)}initCol(e){const{flex:t,initialFlex:s}=e.colDef;t!==void 0?e.flex=t:s!==void 0&&(e.flex=s)}setColFlex(e,t){e.flex=t??null,e.dispatchStateUpdatedEvent("flex")}},et=e=>{if(typeof e=="bigint")return e;let t;if(typeof e=="number")t=e;else if(typeof e=="string"&&(t=e.trim(),t===""||(t.endsWith("n")&&(t=t.slice(0,-1)),!/^[+-]?\d+$/.test(t))))return null;if(t==null)return null;try{return BigInt(t)}catch{return null}},Eh="T",yD=new RegExp(`[${Eh} ]`),xD=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${Eh}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function Hs(e,t){return e.toString().padStart(t,"0")}function tt(e,t=!0,s=Eh){if(!e)return null;let i=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(r=>Hs(r,2)).join("-");return t&&(i+=s+[e.getHours(),e.getMinutes(),e.getSeconds()].map(r=>Hs(r,2)).join(":")),i}function Dr(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),Hs(e.getDate(),2),Hs(e.getHours(),2),`:${Hs(e.getMinutes(),2)}`,`:${Hs(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,Hs(e.getDate(),2)].map(String):null}var Ph=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"},$n=["January","February","March","April","May","June","July","August","September","October","November","December"],Mh=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function RD(e,t){if(t==null)return tt(e,!1);const s=Hs(e.getFullYear(),4),i={YYYY:()=>s.slice(s.length-4,s.length),YY:()=>s.slice(s.length-2,s.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>$n[e.getMonth()],MMM:()=>$n[e.getMonth()].slice(0,3),MM:()=>Hs(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Ph(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${Ph(e.getDate())}`,DD:()=>Hs(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>Mh[e.getDay()],ddd:()=>Mh[e.getDay()].slice(0,3),dd:()=>Mh[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${Ph(e.getDay())}`,d:()=>`${e.getDay()}`},r=new RegExp(Object.keys(i).join("|"),"g");return t.replace(r,o=>o in i?i[o]():o)}function jl(e,t=!1){return!!_e(e,t)}function FD(e){return jl(e,!0)}function _e(e,t=!1,s){if(!e||!s&&!xD.test(e))return null;const[i,r]=e.split(yD);if(!i)return null;const o=i.split("-").map(g=>Number.parseInt(g,10));if(o.filter(g=>!isNaN(g)).length!==3)return null;const[n,a,l]=o,c=new Date(n,a-1,l);if(c.getFullYear()!==n||c.getMonth()!==a-1||c.getDate()!==l||!r&&t)return null;if(!r||r==="00:00:00")return c;const[d,u,h]=r.split(":").map(g=>Number.parseInt(g,10));if(d>=0&&d<24)c.setHours(d);else if(t)return null;if(u>=0&&u<60)c.setMinutes(u);else if(t)return null;if(h>=0&&h<60)c.setSeconds(h);else if(t)return null;return c}function Kn(e,t,s){if(!t||!e)return;if(!s)return e[t];const i=t.split(".");let r=e;for(let o=0;onull,suppressKeyboardEvent:({node:e,event:t,column:s})=>t.key===b.SPACE&&s.isCellEditable(e)}},date({formatValue:e}){return{cellEditor:"agDateCellEditor",keyCreator:e}},dateString({formatValue:e}){return{cellEditor:"agDateStringCellEditor",keyCreator:e}},dateTime(e){return this.date(e)},dateTimeString(e){return this.dateString(e)},object({formatValue:e,colModel:t,colId:s}){return{cellEditorParams:{useFormatter:!0},comparator:(i,r)=>{const o=t.getColDefCol(s),n=o?.getColDef();if(!o||!n)return 0;const a=i==null?"":e({column:o,node:null,value:i}),l=r==null?"":e({column:o,node:null,value:r});return a===l?0:a>l?1:-1},keyCreator:e}},text(){return{}}}}wireBeans(e){this.colModel=e.colModel}postConstruct(){this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.colModel.recreateColumnDefs(e)})}processDataTypeDefinitions(){const e=this.getDefaultDataTypes(),t={},s={},i=d=>u=>{const{column:h,node:g,value:p}=u;let f=h.getColDef().valueFormatter;return f===d.groupSafeValueFormatter&&(f=d.valueFormatter),this.beans.valueSvc.formatValue(h,g,p,f)};for(const d of Object.keys(e)){const u=e[d],h={...u,groupSafeValueFormatter:Bv(u,this.gos)};t[d]=h,s[d]=i(h)}const r=this.gos.get("dataTypeDefinitions")??{},o={};for(const d of Object.keys(r)){const u=r[d],h=this.processDataTypeDefinition(u,r,[d],e);h&&(t[d]=h,u.dataTypeMatcher&&(o[d]=u.dataTypeMatcher),s[d]=i(h))}const{valueParser:n,valueFormatter:a}=e.object,{valueParser:l,valueFormatter:c}=t.object;this.hasObjectValueParser=l!==n,this.hasObjectValueFormatter=c!==a,this.formatValueFuncs=s,this.dataTypeDefinitions=t,this.dataTypeMatchers=this.sortKeysInMatchers(o,e)}sortKeysInMatchers(e,t){const s={...e};for(const i of ED)delete s[i],s[i]=e[i]??t[i].dataTypeMatcher;return s}processDataTypeDefinition(e,t,s,i){let r;const o=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let n=i[o];const a=t[o];if(n&&a&&(n=a),!Vv(e,n,o))return;r=Ov(n,e)}else{if(s.includes(o)){F(44);return}const n=t[o];if(!Vv(e,n,o))return;const a=this.processDataTypeDefinition(n,t,[...s,o],i);if(!a)return;r=Ov(a,e)}return{...r,groupSafeValueFormatter:Bv(r,this.gos)}}updateColDefAndGetColumnType(e,t,s){let{cellDataType:i}=t;i===void 0&&(i=e.cellDataType);const{field:r}=t;if((i==null||i===!0)&&(i=this.canInferCellDataType(e,t)?this.inferCellDataType(r,s):!1),this.addFormulaCellEditorToColDef(e,t),!i){e.cellDataType=!1;return}const o=this.dataTypeDefinitions[i];if(!o){F(47,{cellDataType:i});return}return e.cellDataType=i,o.groupSafeValueFormatter&&(e.valueFormatter=o.groupSafeValueFormatter),o.valueParser&&(e.valueParser=o.valueParser),o.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,i,o,s),o.columnTypes}addFormulaCellEditorToColDef(e,t){!(t.allowFormula??e.allowFormula)||t.cellEditor||(e.cellEditor="agFormulaCellEditor")}addColumnListeners(e){if(!this.isPendingInference)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const s=i=>{t.add(i.key)};e.__addEventListener("columnStateUpdated",s),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.__removeEventListener("columnStateUpdated",s))}canInferCellDataType(e,t){const{gos:s}=this;if(!ae(s))return!1;const i={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(Th(t,i))return!1;const r=t.type===null?e.type:t.type;if(r){const o=s.get("columnTypes")??{};if(bl(r).some(a=>{const l=o[a.trim()];return l&&Th(l,i)}))return!1}return!Th(e,i)}inferCellDataType(e,t){if(!e)return;let s;const i=this.getInitialData();if(i){const o=e.includes(".")&&!this.gos.get("suppressFieldDotNotation");s=Kn(i,e,o)}else this.initWaitForRowData(t);return s==null?void 0:Object.keys(this.dataTypeMatchers).find(o=>this.dataTypeMatchers[o](s))??"object"}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const t=this.beans.rowModel.rootNode?._leafs;if(t?.length)return t[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isPendingInference)return;this.isPendingInference=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions,{colAutosize:s,eventSvc:i}=this.beans;t&&s&&(s.shouldQueueResizeOperations=!0);const[r]=this.addManagedEventListeners({rowDataUpdateStarted:o=>{const{firstRowData:n}=o;n&&(r?.(),this.isPendingInference=!1,this.processColumnsPendingInference(n,t),this.columnStateUpdatesPendingInference={},t&&s?.processResizeOperations(),i.dispatchEvent({type:"dataTypesInferred"}))}})}processColumnsPendingInference(e,t){this.initialData=e;const s=[];this.destroyColumnStateUpdateListeners();const i={},r={};for(const o of Object.keys(this.columnStateUpdatesPendingInference)){const n=this.columnStateUpdatesPendingInference[o],a=this.colModel.getCol(o);if(!a)continue;const l=a.getColDef();if(!this.resetColDefIntoCol(a,"cellDataTypeInferred"))continue;const c=a.getColDef();if(t&&c.type&&c.type!==l.type){const d=kD(a,n);d.rowGroup&&d.rowGroupIndex==null&&(i[o]=d),d.pivot&&d.pivotIndex==null&&(r[o]=d),s.push(d)}}t&&s.push(...this.generateColumnStateForRowGroupAndPivotIndexes(i,r)),s.length&&qe(this.beans,{state:s},"cellDataTypeInferred"),this.initialData=null}generateColumnStateForRowGroupAndPivotIndexes(e,t){const s={},{rowGroupColsSvc:i,pivotColsSvc:r}=this.beans;return i?.restoreColumnOrder(s,e),r?.restoreColumnOrder(s,t),Object.values(s)}resetColDefIntoCol(e,t){const s=e.getUserProvidedColDef();if(!s)return!1;const i=Mi(this.beans,s,e.getColId());return e.setColDef(i,s,t),!0}getDateStringTypeDefinition(e){const{dateString:t}=this.dataTypeDefinitions;return e?this.getDataTypeDefinition(e)??t:t}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDateIncludesTimeFlag(e){return e==="dateTime"||e==="dateTimeString"}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,t){if(t==null)return!0;const s=this.getDataTypeDefinition(e)?.dataTypeMatcher;return!s||e.getColDef().allowFormula&&this.beans.formula?.isFormula(t)?!0:s(t)}validateColDef(e,t,s,i){if(e.cellDataType==="object"){const r=l=>l?.cellDataType==null||l?.cellDataType===!0,o=r(t)&&r(s),n=l=>F(48,{property:l,inferred:o,colId:i}),{object:a}=this.dataTypeDefinitions;e.valueFormatter===a.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&n("Formatter"),e.editable&&e.valueParser===a.valueParser&&!this.hasObjectValueParser&&n("Parser")}}postProcess(e){const t=e.cellDataType;if(!t||typeof t!="string")return;const{dataTypeDefinitions:s,beans:i,formatValueFuncs:r}=this,o=s[t];o&&i.colFilter?.setColDefPropsForDataType(e,o,r[t])}getFormatValue(e){return this.formatValueFuncs[e]}isColPendingInference(e){return this.isPendingInference&&!!this.columnStateUpdatesPendingInference[e]}setColDefPropertiesForBaseDataType(e,t,s,i){const r=this.formatValueFuncs[t],o=this.columnDefinitionPropsPerDataType[s.baseDataType]({colDef:e,cellDataType:t,colModel:this.colModel,dataTypeDefinition:s,colId:i,formatValue:r,filterModuleBean:this.beans.filterManager});e.cellEditor==="agFormulaCellEditor"&&o.cellEditor!==e.cellEditor&&(o.cellEditor=e.cellEditor),Object.assign(e,o)}getDateObjectTypeDef(e){const t=this.getLocaleTextFunc(),s=this.getDateIncludesTimeFlag(e);return{baseDataType:e,valueParser:i=>_e(i.newValue&&String(i.newValue)),valueFormatter:i=>i.value==null?"":!(i.value instanceof Date)||isNaN(i.value.getTime())?t("invalidDate","Invalid Date"):tt(i.value,s)??"",dataTypeMatcher:i=>i instanceof Date}}getDateStringTypeDef(e){const t=this.getDateIncludesTimeFlag(e);return{baseDataType:e,dateParser:s=>_e(s)??void 0,dateFormatter:s=>tt(s??null,t)??void 0,valueParser:s=>jl(String(s.newValue))?s.newValue:null,valueFormatter:s=>jl(String(s.value))?String(s.value):"",dataTypeMatcher:s=>typeof s=="string"&&jl(s)}}getDefaultDataTypes(){const e=this.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:t=>t.newValue?.trim?.()===""?null:Number(t.newValue),valueFormatter:t=>t.value==null?"":typeof t.value!="number"||isNaN(t.value)?e("invalidNumber","Invalid Number"):String(t.value),dataTypeMatcher:t=>typeof t=="number"},bigint:{baseDataType:"bigint",valueParser:t=>{const{newValue:s}=t;return s==null||typeof s=="string"&&s.trim()===""?null:et(s)},valueFormatter:t=>t.value==null?"":typeof t.value!="bigint"?e("invalidBigInt","Invalid BigInt"):String(t.value),dataTypeMatcher:t=>typeof t=="bigint"},text:{baseDataType:"text",valueParser:t=>t.newValue===""?null:Xe(t.newValue),dataTypeMatcher:t=>typeof t=="string"},boolean:{baseDataType:"boolean",valueParser:t=>t.newValue==null?t.newValue:t.newValue?.trim?.()===""?null:String(t.newValue).toLowerCase()==="true",valueFormatter:t=>t.value==null?"":String(t.value),dataTypeMatcher:t=>typeof t=="boolean"},date:this.getDateObjectTypeDef("date"),dateString:this.getDateStringTypeDef("dateString"),dateTime:this.getDateObjectTypeDef("dateTime"),dateTimeString:{...this.getDateStringTypeDef("dateTimeString"),dataTypeMatcher:t=>typeof t=="string"&&FD(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:t=>Xe(t.value)??""}}}destroyColumnStateUpdateListeners(){for(const e of this.columnStateUpdateListenerDestroyFuncs)e();this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}};function Ov(e,t){const s={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(s.columnTypes=[...bl(e.columnTypes),...bl(t.columnTypes)]),s}function Vv(e,t,s){return t?t.baseDataType!==e.baseDataType?(F(46),!1):!0:(F(45,{parentCellDataType:s}),!1)}var MD=e=>typeof e=="bigint"||typeof e=="number",TD=e=>e==="number"||e==="bigint";function Bv(e,t){if(e.valueFormatter)return s=>{const{node:i,colDef:r,column:o,value:n}=s;if(i?.group){const a=(r.pivotValueColumn??o).getAggFunc();if(a){if(a==="first"||a==="last")return e.valueFormatter(s);const{baseDataType:l}=e;if(TD(l)&&a!=="count"){if(MD(n))return e.valueFormatter(s);if(n==null)return;if(typeof n=="object"){if(typeof n.toNumber=="function")return e.valueFormatter({...s,value:n.toNumber()});if("value"in n)return e.valueFormatter({...s,value:n.value})}}return}}else if(t.get("groupHideOpenParents")&&s.column.isRowGroupActive()&&typeof s.value=="string"&&!e.dataTypeMatcher?.(s.value))return;return e.valueFormatter(s)}}function DD(e,t,s,i){if(!t[s])return!1;const r=e[s];return r===null?(t[s]=!1,!1):i===void 0?!!r:r===i}function AD(e,t){if(e==null)return t==null?0:-1;if(t==null)return 1;const s=et(e),i=et(t);return s!=null&&i!=null?s===i?0:s>i?1:-1:0}function ID(e,t){if(e==null)return t==null?0:-1;if(t==null)return 1;const s=Nv(e),i=Nv(t);return s!=null&&i!=null?s===i?0:s>i?1:-1:0}function Nv(e){const t=et(e);return t==null?null:t<0n?-t:t}function Th(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([s,i])=>DD(e,t,s,i))}function kD(e,t){const s=Lv(e);for(const i of t)delete s[i],i==="rowGroup"?delete s.rowGroupIndex:i==="pivot"&&delete s.pivotIndex;return s}var LD={moduleName:"DataType",version:H,beans:[PD],dependsOn:[ZT]},GD={moduleName:"ColumnFlex",version:H,beans:[SD]},ql={moduleName:"ColumnApi",version:H,beans:[bD],apiFunctions:{getColumnDef:JT,getDisplayNameForColumn:tD,getColumn:sD,getColumns:iD,applyColumnState:rD,getColumnState:oD,resetColumnState:nD,isPinning:aD,isPinningLeft:lD,isPinningRight:cD,getDisplayedColAfter:dD,getDisplayedColBefore:uD,setColumnsVisible:hD,setColumnsPinned:gD,getAllGridColumns:pD,getDisplayedLeftColumns:fD,getDisplayedCenterColumns:mD,getDisplayedRightColumns:CD,getAllDisplayedColumns:vD,getAllDisplayedVirtualColumns:wD,getColumnDefs:eD}},OD=class extends E{constructor(){super(...arguments),this.beanName="colNames"}getDisplayNameForColumn(e,t,s=!1){if(!e)return null;const i=this.getHeaderName(e.getColDef(),e,null,null,t),{aggColNameSvc:r}=this.beans;return s&&r?r.getHeaderName(e,i):i}getDisplayNameForProvidedColumnGroup(e,t,s){const i=t?.getColGroupDef();return i?this.getHeaderName(i,null,e,t,s):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,s,i,r){const o=e.headerValueGetter;if(o){const n=N(this.gos,{colDef:e,column:t,columnGroup:s,providedColumnGroup:i,location:r});return typeof o=="function"?o(n):typeof o=="string"?this.beans.expressionSvc?.evaluate(o,n)??null:""}else{if(e.headerName!=null)return e.headerName;if(e.field)return Jf(e.field)}return""}},VD=class extends E{constructor(){super(...arguments),this.beanName="colViewport",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.columnsToRenderLeft=[],this.columnsToRenderRight=[],this.columnsToRenderCenter=[]}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}getScrollPosition(){return this.scrollPosition}setScrollPosition(e,t,s=!1){const{visibleCols:i}=this,r=i.isBodyWidthDirty;if(!(e===this.scrollWidth&&t===this.scrollPosition&&!r)){if(this.scrollWidth=e,this.scrollPosition=t,i.isBodyWidthDirty=!0,this.gos.get("enableRtl")){const n=i.bodyWidth;this.viewportLeft=n-t-e,this.viewportRight=n-t}else this.viewportLeft=t,this.viewportRight=e+t;this.colModel.ready&&this.checkViewportColumns(s)}}getColumnHeadersToRender(e){switch(e){case"left":return this.columnsToRenderLeft;case"right":return this.columnsToRenderRight;default:return this.columnsToRenderCenter}}getHeadersToRender(e,t){let s;switch(e){case"left":s=this.rowsOfHeadersToRenderLeft[t];break;case"right":s=this.rowsOfHeadersToRenderRight[t];break;default:s=this.rowsOfHeadersToRenderCenter[t];break}return s??[]}extractViewportColumns(){const e=this.visibleCols.centerCols;this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return e.isAutoHeaderHeight()||BD(e)?!0:this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,s=t+e.getActualWidth(),i=this.viewportLeft-200,r=this.viewportRight+200,o=tr&&s>r;return!o&&!n}getViewportColumns(){const{leftCols:e,rightCols:t}=this.visibleCols;return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.colModel.colSpanActive)return this.colsWithinViewport;const t=o=>{const n=o.getLeft();return D(n)&&n>this.viewportLeft},s=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),{visibleCols:i}=this,r=i.centerCols;return i.getColsForRow(e,r,s,t)}checkViewportColumns(e=!1){this.extractViewport()&&this.eventSvc.dispatchEvent({type:"virtualColumnsChanged",afterScroll:e})}calculateHeaderRows(){const{leftCols:e,rightCols:t}=this.visibleCols;this.columnsToRenderLeft=e,this.columnsToRenderRight=t,this.columnsToRenderCenter=this.colsWithinViewport;const s=i=>{const r=new Set,o={};for(const n of i){let a=n.getParent();const l=n.isSpanHeaderHeight();for(;a&&!r.has(a);){if(l&&a.isPadding()){a=a.getParent();continue}const d=a.getProvidedColumnGroup().getLevel();o[d]??(o[d]=[]),o[d].push(a),r.add(a),a=a.getParent()}}return o};this.rowsOfHeadersToRenderLeft=s(e),this.rowsOfHeadersToRenderRight=s(t),this.rowsOfHeadersToRenderCenter=s(this.headerColsWithinViewport)}extractViewport(){const e=i=>`${i.getId()}-${i.getPinned()||"normal"}`;this.extractViewportColumns();const t=this.getViewportColumns().map(e).join("#"),s=this.colsWithinViewportHash!==t;return s&&(this.colsWithinViewportHash=t,this.calculateHeaderRows()),s}};function BD(e){for(;e;){if(e.isAutoHeaderHeight())return!0;e=e.getParent()}return!1}var ND=class extends E{constructor(){super(...arguments),this.beanName="agCompUtils"}adaptFunction(e,t){if(!e.cellRenderer)return null;class s{refresh(){return!1}getGui(){return this.eGui}init(r){const o=t(r),n=typeof o;if(n==="string"||n==="number"||n==="boolean"){this.eGui=Xa(""+o+"");return}if(o==null){this.eGui=re({tag:"span"});return}this.eGui=o}}return s}},HD={moduleName:"CellRendererFunction",version:H,beans:[ND]},Hv=class extends Ke{constructor(){super(...arguments),this.beanName="registry"}registerDynamicBeans(e){if(e){this.dynamicBeans??(this.dynamicBeans={});for(const t of Object.keys(e))this.dynamicBeans[t]=e[t]}}createDynamicBean(e,t,...s){if(!this.dynamicBeans)throw new Error(this.getDynamicError(e,!0));const i=this.dynamicBeans[e];if(i==null){if(t)throw new Error(this.getDynamicError(e,!1));return}return new i(...s)}};function zD(e){return typeof e=="object"&&!!e.getComp}var _D=class extends Hv{constructor(){super(...arguments),this.agGridDefaults={},this.agGridDefaultOverrides={},this.jsComps={},this.selectors={},this.icons={}}postConstruct(){const e=this.gos.get("components");if(e!=null)for(const t of Object.keys(e))this.jsComps[t]=e[t]}registerModule(e){const{icons:t,userComponents:s,dynamicBeans:i,selectors:r}=e;if(s){const o=(n,a,l,c)=>{this.agGridDefaults[n]=a,(l||c)&&(this.agGridDefaultOverrides[n]={params:l,processParams:c})};for(const n of Object.keys(s)){let a=s[n];if(zD(a)&&(a=a.getComp(this.beans)),typeof a=="object"){const{classImp:l,params:c,processParams:d}=a;o(n,l,c,d)}else o(n,a)}}this.registerDynamicBeans(i);for(const o of r??[])this.selectors[o.selector]=o;if(t)for(const o of Object.keys(t))this.icons[o]=t[o]}getUserComponent(e,t){const s=(a,l,c,d)=>({componentFromFramework:l,component:a,params:c,processParams:d}),{frameworkOverrides:i}=this.beans,r=i.frameworkComponent(t,this.gos.get("components"));if(r!=null)return s(r,!0);const o=this.jsComps[t];if(o){const a=i.isFrameworkComponent(o);return s(o,a)}const n=this.agGridDefaults[t];if(n){const a=this.agGridDefaultOverrides[t];return s(n,!1,a?.params,a?.processParams)}return this.beans.validation?.missingUserComponent(e,t,this.agGridDefaults,this.jsComps),null}getSelector(e){return this.selectors[e]}getIcon(e){return this.icons[e]}getDynamicError(e,t){return t?Ft(279,{name:e}):this.beans.validation?.missingDynamicBean(e)??Ft(256)}},WD=23,UD=class extends E{constructor(){super(...arguments),this.beanName="ctrlsSvc",this.params={},this.ready=!1,this.readyCallbacks=[]}postConstruct(){this.addEventListener("ready",()=>{if(this.updateReady(),this.ready){for(const e of this.readyCallbacks)e(this.params);this.readyCallbacks.length=0}},this.beans.frameworkOverrides.runWhenReadyAsync?.()??!1)}updateReady(){const e=Object.values(this.params);this.ready=e.length===WD&&e.every(t=>t?.isAlive()??!1)}whenReady(e,t){this.ready?t(this.params):this.readyCallbacks.push(t),e.addDestroyFunc(()=>{const s=this.readyCallbacks.indexOf(t);s>=0&&this.readyCallbacks.splice(s,1)})}register(e,t){this.params[e]=t,this.updateReady(),this.ready&&this.dispatchLocalEvent({type:"ready"}),t.addDestroyFunc(()=>{this.updateReady()})}get(e){return this.params[e]}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:s}=this.params;return[e,s,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}getScrollFeature(){return this.getGridBodyCtrl().scrollFeature}},$D=':where([class^=ag-]),:where([class^=ag-]):after,:where([class^=ag-]):before{box-sizing:border-box}:where([class^=ag-]):where(button){color:inherit}:where([class^=ag-]):where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}:where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-tab-guard{display:block;height:0;position:absolute;width:0}.ag-tab-guard-top{top:1px}.ag-tab-guard-bottom{bottom:1px}.ag-measurement-container{height:0;overflow:hidden;visibility:hidden;width:0}.ag-measurement-element-border{display:inline-block}.ag-measurement-element-border:before{border-left:var(--ag-internal-measurement-border);content:"";display:block}.ag-popup-child{top:0;z-index:5}.ag-popup-child:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);font-weight:var(--ag-font-weight);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled .ag-icon,[disabled] .ag-icon{opacity:.5}.ag-icon-grip.ag-disabled,.ag-icon-grip[disabled]{opacity:.35}.ag-icon-loading{animation-duration:1s;animation-iteration-count:infinite;animation-name:spin;animation-timing-function:linear}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}.ag-menu{background-color:var(--ag-menu-background-color);border:var(--ag-menu-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-menu-shadow);color:var(--ag-menu-text-color);max-height:100%;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}',Dh=typeof window!="object"||!window?.document?.fonts?.forEach,Yl=!1,Ar=(e,t,s,i,r,o,n=!1)=>{if(Dh||Yl)return;let a=e;i&&(a=`@layer ${CSS.escape(i).replaceAll("\\.",".")} { ${e} }`);let l=zs.map.get(t);if(l||(l=[],zs.map.set(t,l)),l.some(h=>h.injectedCss===a))return;const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.dataset.agCss=s,c.dataset.agCssVersion=H,c.textContent=a;const d={rawCss:e,injectedCss:a,el:c,priority:r,isParams:n};let u;for(const h of l){if(h.priority>r)break;u=h}if(u){u.el.after(c);const h=l.indexOf(u);l.splice(h+1,0,d)}else t.nodeName==="STYLE"?t.after(c):t.insertBefore(c,t.querySelector(":not(title, meta)")),l.push(d)},zv=(e,t,s,i)=>{Ar($D,e,"shared",t,0,s),i?.forEach((r,o)=>r.forEach(n=>Ar(n,e,o,t,0,s)))},KD=(e,t,s,i,r,o)=>{if(Dh||Yl)return;const n=zs.grids.get(e);n?n.paramsCss=t:zs.grids.set(e,{styleContainer:i,paramsCss:t}),Ah(i),t&&s&&Ar(t,i,s,r,2,o,!0)},jD=e=>{const t=zs.grids.get(e)?.styleContainer;if(!t)return;zs.grids.delete(e),Array.from(zs.grids.values()).some(i=>i.styleContainer===t)?Ah(t):(Ah(t,!0),zs.map.delete(t))},Ah=(e,t=!1)=>{const s=new Set;for(const r of zs.grids.values())r.styleContainer===e&&s.add(r.paramsCss);const i=zs.map.get(e)??[];for(let r=i.length-1;r>=0;r--)(t||i[r].isParams&&!s.has(i[r].rawCss))&&(i[r].el.remove(),i.splice(r,1))},_v=()=>{const e=globalThis.agStyleInjectionVersions??(globalThis.agStyleInjectionVersions=new Map);let t=e.get(H);return t||(t={map:new WeakMap,grids:new Map,paramsId:0},e.set(H,t)),t},zs=_v(),he=e=>new Wv(e),Bi="$default",qD=0,Wv=class{constructor({feature:e,params:t,modeParams:s={},css:i,cssImports:r}){this.feature=e,this.css=i,this.cssImports=r,this.modeParams={[Bi]:{...s[Bi]??{},...t??{}},...s}}use(e,t,s){let i=this._inject;if(i==null){let{css:r}=this;if(r){const o=`ag-theme-${this.feature??"part"}-${++qD}`;typeof r=="function"&&(r=r()),r=`:where(.${o}) { ${r} } `;for(const n of this.cssImports??[])r=`@import url(${JSON.stringify(n)}); ${r}`;i={css:r,class:o}}else i=!1;this._inject=i}return i&&e&&Ar(i.css,e,i.class,t,1,s),i?i.class:!1}},YD=e=>e.replace(/[A-Z]|\d+/g,t=>`-${t}`).toLowerCase(),Xl=e=>`--ag-${YD(e)}`,_s=e=>`var(${Xl(e)})`,XD=(e,t,s)=>Math.max(t,Math.min(s,e)),ZD=e=>{const t=new Map;return s=>{const i=s;return t.has(i)||t.set(i,e(s)),t.get(i)}},Xt=e=>({ref:"accentColor",mix:e}),Be=e=>({ref:"foregroundColor",mix:e}),Pe=e=>({ref:"foregroundColor",mix:e,onto:"backgroundColor"}),QD=e=>({ref:"foregroundColor",mix:e,onto:"headerBackgroundColor"}),Me={ref:"backgroundColor"},Ot={ref:"foregroundColor"},ke={ref:"accentColor"},Ir={backgroundColor:"#fff",foregroundColor:"#181d1f",borderColor:Be(.15),chromeBackgroundColor:Pe(.02),browserColorScheme:"light"},Uv={...Ir,textColor:Ot,accentColor:"#2196f3",invalidColor:"#e02525",fontFamily:["-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue","sans-serif"],subtleTextColor:{ref:"textColor",mix:.5},borderWidth:1,borderRadius:4,spacing:8,fontSize:14,fontWeight:"inherit",focusShadow:{spread:3,color:Xt(.5)},focusErrorShadow:{spread:3,color:{ref:"invalidColor",onto:"backgroundColor",mix:.5}},popupShadow:"0 0 16px #00000026",cardShadow:"0 1px 4px 1px #00000018",dropdownShadow:{ref:"cardShadow"},listItemHeight:{calc:"max(iconSize, dataFontSize) + widgetVerticalSpacing"},dragAndDropImageBackgroundColor:Me,dragAndDropImageBorder:!0,dragAndDropImageNotAllowedBorder:{color:{ref:"invalidColor",onto:"dragAndDropImageBackgroundColor",mix:.5}},dragAndDropImageShadow:{ref:"popupShadow"},iconSize:16,iconColor:"inherit",toggleButtonWidth:28,toggleButtonHeight:18,toggleButtonOnBackgroundColor:ke,toggleButtonOffBackgroundColor:Pe(.3),toggleButtonSwitchBackgroundColor:Me,toggleButtonSwitchInset:2,tooltipBackgroundColor:{ref:"chromeBackgroundColor"},tooltipErrorBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:.1},tooltipTextColor:{ref:"textColor"},tooltipErrorTextColor:{ref:"invalidColor"},tooltipBorder:!0,tooltipErrorBorder:{color:{ref:"invalidColor",onto:"backgroundColor",mix:.25}},panelBackgroundColor:Me,panelTitleBarHeight:{ref:"headerHeight"},panelTitleBarBackgroundColor:{ref:"headerBackgroundColor"},panelTitleBarIconColor:{ref:"headerTextColor"},panelTitleBarTextColor:{ref:"headerTextColor"},panelTitleBarFontFamily:{ref:"headerFontFamily"},panelTitleBarFontSize:{ref:"headerFontSize"},panelTitleBarFontWeight:{ref:"headerFontWeight"},panelTitleBarBorder:!0,dialogShadow:{ref:"popupShadow"},dialogBorder:{color:Be(.2)},widgetContainerHorizontalPadding:{calc:"spacing * 1.5"},widgetContainerVerticalPadding:{calc:"spacing * 1.5"},widgetHorizontalSpacing:{calc:"spacing * 1.5"},widgetVerticalSpacing:{ref:"spacing"},dataFontSize:{ref:"fontSize"},headerBackgroundColor:{ref:"chromeBackgroundColor"},headerFontFamily:{ref:"fontFamily"},headerFontSize:{ref:"fontSize"},headerFontWeight:500,headerTextColor:{ref:"textColor"},headerHeight:{calc:"max(iconSize, dataFontSize) + spacing * 4 * headerVerticalPaddingScale"},headerVerticalPaddingScale:1,menuBorder:{color:Be(.2)},menuBackgroundColor:Pe(.03),menuTextColor:Pe(.95),menuShadow:{ref:"popupShadow"},menuSeparatorColor:{ref:"borderColor"}},JD=["colorScheme","color","length","scale","borderStyle","border","shadow","image","fontFamily","fontWeight","duration"],$v=ZD(e=>(e=e.toLowerCase(),JD.find(t=>e.endsWith(t.toLowerCase()))??"length")),Zl=e=>typeof e=="object"&&e?.ref?_s(e.ref):typeof e=="string"?e:typeof e=="number"?String(e):!1,Ql=e=>{if(typeof e=="string")return e;if(typeof e=="object"&&e&&"ref"in e){const t=_s(e.ref);return e.mix==null?t:`color-mix(in srgb, ${e.onto?_s(e.onto):"transparent"}, ${t} ${XD(e.mix*100,0,100)}%)`}return!1},eA=Zl,vo=e=>typeof e=="string"?e:typeof e=="number"?`${e}px`:typeof e=="object"&&e&&"calc"in e?`calc(${e.calc.replace(/ ?[*/+] ?/g," $& ").replace(/-?\b[a-z][a-z0-9]*\b(?![-(])/gi,s=>s[0]==="-"?s:" "+_s(s)+" ")})`:typeof e=="object"&&e&&"ref"in e?_s(e.ref):!1,tA=Zl,Ih=(e,t)=>typeof e=="string"?e:e===!0?Ih({},t):e===!1?t==="columnBorder"?Ih({color:"transparent"},t):"none":typeof e=="object"&&e&&"ref"in e?_s(e.ref):jv(e.style??"solid")+" "+vo(e.width??{ref:"borderWidth"})+" "+Ql(e.color??{ref:"borderColor"}),Kv=e=>[vo(e.offsetX??0),vo(e.offsetY??0),vo(e.radius??0),vo(e.spread??0),Ql(e.color??{ref:"foregroundColor"}),...e.inset?["inset"]:[]].join(" "),sA=e=>typeof e=="string"?e:e===!1?"none":typeof e=="object"&&e&&"ref"in e?_s(e.ref):Array.isArray(e)?e.map(Kv).join(", "):Kv(e),jv=Zl,kh=e=>typeof e=="string"?e.includes(",")?e:qv(e):typeof e=="object"&&e&&"googleFont"in e?kh(e.googleFont):typeof e=="object"&&e&&"ref"in e?_s(e.ref):Array.isArray(e)?e.map(t=>(typeof t=="object"&&"googleFont"in t&&(t=t.googleFont),qv(t))).join(", "):!1,qv=e=>/^[\w-]+$|\w\(/.test(e)?e:JSON.stringify(e),Yv=Zl,Lh=e=>typeof e=="string"?e:typeof e=="object"&&e&&"url"in e?`url(${JSON.stringify(e.url)})`:typeof e=="object"&&e&&"svg"in e?Lh({url:`data:image/svg+xml,${encodeURIComponent(e.svg)}`}):typeof e=="object"&&e&&"ref"in e?_s(e.ref):!1,iA=(e,t,s)=>typeof e=="string"?e:typeof e=="number"?(e>=10&&s?.warn(104,{value:e,param:t}),`${e}s`):typeof e=="object"&&e&&"ref"in e?_s(e.ref):!1,rA={color:Ql,colorScheme:eA,length:vo,scale:tA,border:Ih,borderStyle:jv,shadow:sA,image:Lh,fontFamily:kh,fontWeight:Yv,duration:iA},Xv=(e,t,s)=>{const i=$v(e);return rA[i](t,e,s)},oA=e=>{if(!(e instanceof Gh))throw new Error("theme is not an object created by createTheme");return e},Zv=(e,t)=>new Gh({themeLogger:e,overridePrefix:t}),Gh=class UR{constructor(t,s=[]){this.params=t,this.parts=s}withPart(t){return typeof t=="function"&&(t=t()),t instanceof Wv?new UR(this.params,[...this.parts,t]):(this.params.themeLogger.preInitErr(259,"Invalid part",{part:t}),this)}withoutPart(t){return this.withPart(he({feature:t}))}withParams(t,s=Bi){return this.withPart(he({modeParams:{[s]:t}}))}_startUse({styleContainer:t,cssLayer:s,nonce:i,loadThemeGoogleFonts:r,moduleCss:o}){if(Dh||Yl)return;aA(),zv(t,s,i,o);const n=nA(this);if(n.length>0)for(const a of n)r&&lA(a,i);for(const a of this.parts)a.use(t,s,i)}_getCssClass(){return Yl?"ag-theme-quartz":this._cssClassCache??(this._cssClassCache=Qv(this.parts).map(t=>t.use(void 0,void 0,void 0)).filter(Boolean).concat(this._getParamsClassName()).join(" "))}_getParamsClassName(){return this._paramsClassName??(this._paramsClassName=`ag-theme-params-${++_v().paramsId}`)}_getModeParams(){let t=this._paramsCache;if(!t){const s={[Bi]:{...Uv}};for(const i of Qv(this.parts))for(const r of Object.keys(i.modeParams)){const o=i.modeParams[r];if(o){const n=s[r]??(s[r]={}),a=new Set;for(const l of Object.keys(o)){const c=o[l];c!==void 0&&(n[l]=c,a.add(l))}if(r===Bi)for(const l of Object.keys(s)){const c=s[l];if(l!==Bi)for(const d of a)delete c[d]}}}this._paramsCache=t=s}return t}_getParamsCss(){if(!this._paramsCssCache){let t="",s="";const i=this._getModeParams(),{overridePrefix:r,themeLogger:o}=this.params,n=r?`--ag-${r}-`:void 0;for(const c of Object.keys(i)){const d=i[c];if(c!==Bi){const h=`:where([data-ag-theme-mode="${typeof CSS=="object"?CSS.escape(c):c}"]) & { `;t+=h,s+=h}for(const u of Object.keys(d).sort()){const h=d[u],g=Xv(u,h,o);if(g===!1)o.error(107,{key:u,value:h});else{const p=Xl(u),f=n?p.replace("--ag-",n):p,m=p.replace("--ag-","--ag-inherited-");t+=` ${p}: var(${m}, ${g}); `,s+=` ${m}: var(${f}); `}}c!==Bi&&(t+=`} `,s+=`} `)}const a=`:where(.${this._getParamsClassName()})`;let l=`${a} { ${t}} `;l+=`:has(> ${a}):not(${a}) { ${s}} `,this._paramsCssCache=l}return this._paramsCssCache}},Qv=e=>{const t=new Map;for(const i of e)t.set(i.feature,i);const s=[];for(const i of e)(!i.feature||t.get(i.feature)===i)&&s.push(i);return s},nA=e=>{const t=new Set,s=o=>{if(Array.isArray(o))o.forEach(s);else{const n=o?.googleFont;typeof n=="string"&&t.add(n)}};return Object.values(e._getModeParams()).flatMap(o=>Object.values(o)).forEach(s),Array.from(t).sort()},Jv=!1,aA=()=>{if(!Jv){Jv=!0;for(const e of Array.from(document.head.querySelectorAll('style[data-ag-scope="legacy"]')))e.remove()}},lA=async(e,t)=>{const s=`@import url('https://${cA}/css2?family=${encodeURIComponent(e)}:wght@100;200;300;400;500;600;700;800;900&display=swap'); `;Ar(s,document.head,`googleFont:${e}`,void 0,0,t)},cA="fonts.googleapis.com",ew={changeKey:"listItemHeight",type:"length",defaultValue:24},tw=class extends Ke{constructor(){super(...arguments),this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.sizesMeasured=!1,this.globalCSS=[]}wireBeans(e){this.eRootDiv=e.eRootDiv}postConstruct(){const{gos:e,eRootDiv:t}=this;e.setInstanceDomData(t);const s=e.get("themeStyleContainer"),i=typeof ShadowRoot<"u",r=i&&t.getRootNode()instanceof ShadowRoot;this.eStyleContainer=(typeof s=="function"?s():s)??(r?t:document.head),!s&&!r&&i&&dA(t,this.shadowRootError.bind(this),this.addDestroyFunc.bind(this)),this.cssLayer=e.get("themeCssLayer"),this.styleNonce=e.get("styleNonce"),this.addManagedPropertyListener("theme",()=>this.handleThemeChange()),this.handleThemeChange(),this.getSizeEl(ew),this.initVariables(),this.addDestroyFunc(()=>jD(this)),this.mutationObserver=new MutationObserver(()=>{this.fireStylesChangedEvent("theme")}),this.addDestroyFunc(()=>this.mutationObserver.disconnect())}applyThemeClasses(e,t=[]){const{theme:s}=this,i=s?s._getCssClass():this.applyLegacyThemeClasses();for(const r of Array.from(e.classList))r.startsWith("ag-theme-")&&e.classList.remove(r);if(i){const r=e.className;e.className=`${r}${r?" ":""}${i}${t?.length?" "+t.join(" "):""}`}}applyLegacyThemeClasses(){let e="";this.mutationObserver.disconnect();let t=this.eRootDiv;for(;t;){let s=!1;for(const i of Array.from(t.classList))i.startsWith("ag-theme-")&&(s=!0,e=e?`${e} ${i}`:i);s&&this.mutationObserver.observe(t,{attributes:!0,attributeFilter:["class"]}),t=t.parentElement}return e}addGlobalCSS(e,t){this.theme?Ar(e,this.eStyleContainer,t,this.cssLayer,0,this.styleNonce):this.globalCSS.push([e,t])}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(ew)}getCSSVariablePixelValue(e){const t=this.lastKnownValues.get(e);if(t!=null)return t;const s=this.measureSizeEl(e);return s==="detached"||s==="no-styles"?(e.cacheDefault&&this.lastKnownValues.set(e,e.defaultValue),e.defaultValue):(this.lastKnownValues.set(e,s),s)}measureSizeEl(e){const t=this.getSizeEl(e);if(t.offsetParent==null)return"detached";const s=t.offsetWidth;return s===Oh?"no-styles":(this.sizesMeasured=!0,s)}getMeasurementContainer(){let e=this.eMeasurementContainer;return e||(e=this.eMeasurementContainer=$e({tag:"div",cls:"ag-measurement-container"}),this.eRootDiv.appendChild(e)),e}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;const s=this.getMeasurementContainer();t=$e({tag:"div"});const i=this.setSizeElStyles(t,e);s.appendChild(t),this.sizeEls.set(e,t);const{type:r,noWarn:o}=e;if(r!=="length"&&r!=="border")return t;let n=this.measureSizeEl(e);n==="no-styles"&&!o&&this.varError(i,e.defaultValue);const a=vs(this.beans,t,()=>{const l=this.measureSizeEl(e);l==="detached"||l==="no-styles"||(this.lastKnownValues.set(e,l),l!==n&&(n=l,this.fireStylesChangedEvent(e.changeKey)))});return this.addDestroyFunc(()=>a()),t}setSizeElStyles(e,t){const{changeKey:s,type:i}=t;let r=Xl(s);return i==="border"?(r.endsWith("-width")&&(r=r.slice(0,-6)),e.className="ag-measurement-element-border",e.style.setProperty("--ag-internal-measurement-border",`var(${r}, solid ${Oh}px)`)):e.style.width=`var(${r}, ${Oh}px)`,r}handleThemeChange(){const{gos:e,theme:t}=this,s=e.get("theme");let i;if(s==="legacy")i=void 0;else{const r=s??this.getDefaultTheme();r instanceof Gh?i=r:this.themeError(r)}i!==t&&this.handleNewTheme(i),this.postProcessThemeChange(i,s)}handleNewTheme(e){const{gos:t,eRootDiv:s,globalCSS:i}=this,r=this.getAdditionalCss();if(e){zv(this.eStyleContainer,this.cssLayer,this.styleNonce,r);for(const[o,n]of i)Ar(o,this.eStyleContainer,n,this.cssLayer,0,this.styleNonce);i.length=0}this.theme=e,e?._startUse({loadThemeGoogleFonts:t.get("loadThemeGoogleFonts"),styleContainer:this.eStyleContainer,cssLayer:this.cssLayer,nonce:this.styleNonce,moduleCss:r}),KD(this,e?._getParamsCss()??null,e?._getParamsClassName()??null,this.eStyleContainer,this.cssLayer,this.styleNonce),this.applyThemeClasses(s),this.fireStylesChangedEvent("theme")}fireStylesChangedEvent(e){this.eventSvc.dispatchEvent({type:"stylesChanged",[`${e}Changed`]:!0})}},Oh=15538,dA=(e,t,s)=>{let i=60;const r=setInterval(()=>{typeof ShadowRoot<"u"&&e.getRootNode()instanceof ShadowRoot&&(t(),clearInterval(r)),(e.isConnected||--i<0)&&clearInterval(r)},1e3);s(()=>clearInterval(r))},uA='.ag-aria-description-container{border:0;z-index:9999;clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.ag-unselectable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-selectable{-webkit-user-select:text;-moz-user-select:text;user-select:text}.ag-shake-left-to-right{animation-direction:alternate;animation-duration:.2s;animation-iteration-count:infinite;animation-name:ag-shake-left-to-right}@keyframes ag-shake-left-to-right{0%{padding-left:6px;padding-right:2px}to{padding-left:2px;padding-right:6px}}.ag-body-horizontal-scroll-viewport,.ag-body-vertical-scroll-viewport,.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:hidden;position:relative}.ag-viewport{position:relative}.ag-spanning-container{position:absolute;top:0;z-index:1}.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{overflow-x:auto;-ms-overflow-style:none!important;scrollbar-width:none!important}.ag-body-viewport::-webkit-scrollbar,.ag-center-cols-viewport::-webkit-scrollbar,.ag-floating-bottom-viewport::-webkit-scrollbar,.ag-floating-top-viewport::-webkit-scrollbar,.ag-header-viewport::-webkit-scrollbar,.ag-sticky-bottom-viewport::-webkit-scrollbar,.ag-sticky-top-viewport::-webkit-scrollbar{display:none!important}.ag-body-viewport{display:flex;overflow-x:hidden;&:where(.ag-layout-normal){overflow-y:auto;-webkit-overflow-scrolling:touch}}.ag-floating-bottom-container,.ag-floating-top-container,.ag-sticky-bottom-container,.ag-sticky-top-container{min-height:1px}.ag-center-cols-viewport{min-height:100%;width:100%}.ag-body-horizontal-scroll-viewport{overflow-x:scroll}.ag-body-vertical-scroll-viewport{overflow-y:scroll}.ag-body-container,.ag-body-horizontal-scroll-container,.ag-body-vertical-scroll-container,.ag-center-cols-container,.ag-floating-bottom-container,.ag-floating-bottom-full-width-container,.ag-floating-top-container,.ag-full-width-container,.ag-header-container,.ag-pinned-left-cols-container,.ag-pinned-left-sticky-bottom,.ag-pinned-right-cols-container,.ag-pinned-right-sticky-bottom,.ag-sticky-bottom-container,.ag-sticky-top-container{position:relative}.ag-floating-bottom-container,.ag-floating-top-container,.ag-header-container,.ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top,.ag-sticky-bottom-container,.ag-sticky-top-container{height:100%;white-space:nowrap}.ag-center-cols-container,.ag-pinned-right-cols-container{display:block}.ag-body-horizontal-scroll-container{height:100%}.ag-body-vertical-scroll-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container,.ag-full-width-container,.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{pointer-events:none;position:absolute;top:0}:where(.ag-ltr) .ag-floating-bottom-full-width-container,:where(.ag-ltr) .ag-floating-top-full-width-container,:where(.ag-ltr) .ag-full-width-container,:where(.ag-ltr) .ag-sticky-bottom-full-width-container,:where(.ag-ltr) .ag-sticky-top-full-width-container{left:0}:where(.ag-rtl) .ag-floating-bottom-full-width-container,:where(.ag-rtl) .ag-floating-top-full-width-container,:where(.ag-rtl) .ag-full-width-container,:where(.ag-rtl) .ag-sticky-bottom-full-width-container,:where(.ag-rtl) .ag-sticky-top-full-width-container{right:0}.ag-full-width-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container{display:inline-block;height:100%;overflow:hidden;width:100%}.ag-body{display:flex;flex:1 1 auto;flex-direction:row!important;min-height:0;position:relative}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:flex;min-height:0;min-width:0;position:relative;&:where(.ag-scrollbar-invisible){bottom:0;position:absolute;&:where(.ag-apple-scrollbar){opacity:0;transition:opacity .4s;visibility:hidden;&:where(.ag-scrollbar-active),&:where(.ag-scrollbar-scrolling){opacity:1;visibility:visible}}}}.ag-body-horizontal-scroll{width:100%;&:where(.ag-scrollbar-invisible){left:0;right:0}}.ag-body-vertical-scroll{height:100%;&:where(.ag-scrollbar-invisible){top:0;z-index:10}}:where(.ag-ltr) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){right:0}}:where(.ag-rtl) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){left:0}}.ag-force-vertical-scroll{overflow-y:scroll!important}.ag-horizontal-left-spacer,.ag-horizontal-right-spacer{height:100%;min-width:0;overflow-x:scroll;&:where(.ag-scroller-corner){overflow-x:hidden}}:where(.ag-row-animation) .ag-row{transition:transform .4s,top .4s,opacity .2s;&:where(.ag-after-created){transition:transform .4s,top .4s,height .4s,opacity .2s}}:where(.ag-row-animation.ag-prevent-animation) .ag-row{transition:none!important;&:where(.ag-row.ag-after-created){transition:none!important}}:where(.ag-row-no-animation) .ag-row{transition:none}.ag-row-loading{align-items:center;display:flex}.ag-row-position-absolute{position:absolute}.ag-row-position-relative{position:relative}.ag-full-width-row{overflow:hidden;pointer-events:all}.ag-row-inline-editing{z-index:1}.ag-row-dragging{z-index:2}.ag-stub-cell{align-items:center;display:flex}.ag-cell{display:inline-block;height:100%;position:absolute;white-space:nowrap;&:focus-visible{box-shadow:none}}.ag-cell-value{flex:1 1 auto}.ag-cell-value:not(.ag-allow-overflow),.ag-group-value{overflow:hidden;text-overflow:ellipsis}.ag-cell-wrap-text{white-space:normal;word-break:break-word}:where(.ag-cell) .ag-icon{display:inline-block;vertical-align:middle}.ag-floating-top{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-top:not(.ag-invisible)){border-bottom:var(--ag-pinned-row-border)}.ag-floating-bottom{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-bottom:not(.ag-invisible)){border-top:var(--ag-pinned-row-border)}.ag-sticky-bottom,.ag-sticky-top{background-color:var(--ag-data-background-color);display:flex;height:0;overflow:hidden;position:absolute;width:100%;z-index:1}.ag-sticky-bottom{box-sizing:content-box!important;:where(.ag-pinned-left-sticky-bottom),:where(.ag-pinned-right-sticky-bottom),:where(.ag-sticky-bottom-container){border-top:var(--ag-row-border);box-sizing:border-box}}.ag-opacity-zero{opacity:0!important}.ag-cell-label-container{align-items:center;display:flex;flex-direction:row-reverse;height:100%;justify-content:space-between;width:100%}:where(.ag-right-aligned-header){.ag-cell-label-container{flex-direction:row}.ag-header-cell-text{text-align:end}}.ag-column-group-icons{display:block;:where(.ag-column-group-closed-icon),:where(.ag-column-group-opened-icon){cursor:pointer}}:where(.ag-ltr){direction:ltr;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row}}:where(.ag-rtl){direction:rtl;text-align:right;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row-reverse}.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{display:block}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(180deg)}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(-180deg)}}:where(.ag-ltr) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-left:var(--ag-row-group-indent-size)}:where(.ag-rtl) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-right:var(--ag-row-group-indent-size)}:where(.ag-ltr) .ag-row-group-leaf-indent{margin-left:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}:where(.ag-rtl) .ag-row-group-leaf-indent{margin-right:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}.ag-value-change-delta{padding:0 2px}.ag-value-change-delta-up{color:var(--ag-value-change-delta-up-color)}.ag-value-change-delta-down{color:var(--ag-value-change-delta-down-color)}.ag-value-change-value{background-color:transparent;border-radius:1px;padding-left:1px;padding-right:1px;transition:background-color 1s}.ag-value-change-value-highlight{background-color:var(--ag-value-change-value-highlight-background-color);transition:background-color .1s}.ag-cell-data-changed{background-color:var(--ag-value-change-value-highlight-background-color)!important}.ag-cell-data-changed-animation{background-color:transparent}.ag-cell-highlight{background-color:var(--ag-range-selection-highlight-color)!important}.ag-row,.ag-spanned-row{color:var(--ag-cell-text-color);font-family:var(--ag-cell-font-family);font-size:var(--ag-cell-font-size);font-weight:var(--ag-cell-font-weight);white-space:nowrap;--ag-internal-content-line-height:calc(min(var(--ag-row-height), var(--ag-line-height, 1000px)) - var(--ag-internal-row-border-width, 1px) - 2px)}.ag-row{background-color:var(--ag-data-background-color);border-bottom:var(--ag-row-border);height:var(--ag-row-height);width:100%;&.ag-row-editing-invalid{background-color:var(--ag-full-row-edit-invalid-background-color)}}:where(.ag-body-vertical-content-no-gap>div>div>div,.ag-body-vertical-content-no-gap>div>div>div>div)>.ag-row-last{border-bottom-color:transparent}.ag-group-contracted,.ag-group-expanded{cursor:pointer}.ag-cell,.ag-full-width-row .ag-cell-wrapper.ag-row-group{border:1px solid transparent;line-height:var(--ag-internal-content-line-height);-webkit-font-smoothing:subpixel-antialiased}:where(.ag-ltr) .ag-cell{border-right:var(--ag-column-border)}:where(.ag-rtl) .ag-cell{border-left:var(--ag-column-border)}.ag-spanned-cell-wrapper{background-color:var(--ag-data-background-color);position:absolute}.ag-spanned-cell-wrapper>.ag-spanned-cell{display:block;position:relative}:where(.ag-ltr) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-right-color:transparent}:where(.ag-rtl) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-left-color:transparent}.ag-cell-wrapper{align-items:center;display:flex;>:where(:not(.ag-cell-value,.ag-group-value)){align-items:center;display:flex;height:var(--ag-internal-content-line-height)}&:where(.ag-row-group){align-items:flex-start}:where(.ag-full-width-row) &:where(.ag-row-group){align-items:center;height:100%}}:where(.ag-ltr) .ag-cell-wrapper{padding-left:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-rtl) .ag-cell-wrapper{padding-right:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-cell-wrap-text:not(.ag-cell-auto-height)) .ag-cell-wrapper{align-items:normal;height:100%;:where(.ag-cell-value){height:100%}}:where(.ag-ltr) .ag-row>.ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-row>.ag-cell-wrapper.ag-row-group{padding-right:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-cell-focus:not(.ag-cell-range-selected):focus-within,.ag-cell-range-single-cell,.ag-cell-range-single-cell.ag-cell-range-handle,.ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),.ag-context-menu-open .ag-full-width-row.ag-row-focus .ag-cell-wrapper.ag-row-group,.ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group{border:1px solid;border-color:var(--ag-range-selection-border-color);border-style:var(--ag-range-selection-border-style);outline:initial}.ag-full-width-row.ag-row-focus:focus{box-shadow:none}:where(.ag-ltr) .ag-group-contracted,:where(.ag-ltr) .ag-group-expanded,:where(.ag-ltr) .ag-row-drag,:where(.ag-ltr) .ag-selection-checkbox{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-contracted,:where(.ag-rtl) .ag-group-expanded,:where(.ag-rtl) .ag-row-drag,:where(.ag-rtl) .ag-selection-checkbox{margin-left:var(--ag-cell-widget-spacing)}.ag-drag-handle-disabled{opacity:.35;pointer-events:none}:where(.ag-ltr) .ag-group-child-count{margin-left:3px}:where(.ag-rtl) .ag-group-child-count{margin-right:3px}.ag-row-highlight-above:after,.ag-row-highlight-below:after,.ag-row-highlight-inside:after{background-color:var(--ag-row-drag-indicator-color);border-radius:calc(var(--ag-row-drag-indicator-width)/2);content:"";height:var(--ag-row-drag-indicator-width);pointer-events:none;position:absolute;width:calc(100% - 1px)}:where(.ag-ltr) .ag-row-highlight-above:after,:where(.ag-ltr) .ag-row-highlight-below:after,:where(.ag-ltr) .ag-row-highlight-inside:after{left:1px}:where(.ag-rtl) .ag-row-highlight-above:after,:where(.ag-rtl) .ag-row-highlight-below:after,:where(.ag-rtl) .ag-row-highlight-inside:after{right:1px}.ag-row-highlight-above:after{top:0}.ag-row-highlight-below:after{bottom:0}.ag-row-highlight-indent:after{display:block;width:auto}:where(.ag-ltr) .ag-row-highlight-indent:after{left:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size));right:1px}:where(.ag-rtl) .ag-row-highlight-indent:after{left:1px;right:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size))}.ag-row-highlight-inside:after{background-color:var(--ag-selected-row-background-color);border:1px solid var(--ag-range-selection-border-color);display:block;height:auto;inset:0;width:auto}.ag-body,.ag-floating-bottom,.ag-floating-top{background-color:var(--ag-data-background-color)}.ag-row-odd{background-color:var(--ag-odd-row-background-color)}.ag-row-selected:before{background-color:var(--ag-selected-row-background-color);content:"";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-full-width-row.ag-row-group:before,.ag-row-hover:not(.ag-full-width-row):before{background-color:var(--ag-row-hover-color);content:"";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-row-selected:before{background-color:var(--ag-row-hover-color);background-image:linear-gradient(var(--ag-selected-row-background-color),var(--ag-selected-row-background-color))}.ag-row.ag-full-width-row.ag-row-group>*{position:relative}.ag-column-hover{background-color:var(--ag-column-hover-color)}.ag-header-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-right-aligned-cell{font-variant-numeric:tabular-nums}:where(.ag-ltr) .ag-right-aligned-cell{text-align:right}:where(.ag-rtl) .ag-right-aligned-cell{text-align:left}.ag-right-aligned-cell .ag-cell-value,.ag-right-aligned-cell .ag-group-value{margin-left:auto}:where(.ag-ltr) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-ltr) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level));padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}:where(.ag-rtl) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-rtl) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-row>.ag-cell-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}.ag-row-dragging{cursor:move;opacity:.5}.ag-details-row{background-color:var(--ag-data-background-color);padding:calc(var(--ag-spacing)*3.75)}.ag-layout-auto-height,.ag-layout-print{.ag-center-cols-container,.ag-center-cols-viewport{min-height:150px}}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{background-color:var(--ag-modal-overlay-background-color)}.ag-skeleton-container{align-content:center;height:100%;width:100%}.ag-skeleton-effect{animation:ag-skeleton-loading 1.5s ease-in-out .5s infinite;background-color:var(--ag-row-loading-skeleton-effect-color);border-radius:.25rem;height:1em;width:100%}:where(.ag-ltr) .ag-right-aligned-cell .ag-skeleton-effect{margin-left:auto}:where(.ag-rtl) .ag-right-aligned-cell .ag-skeleton-effect{margin-right:auto}@keyframes ag-skeleton-loading{0%{background-color:var(--ag-row-loading-skeleton-effect-color)}50%{background-color:color-mix(in srgb,transparent,var(--ag-row-loading-skeleton-effect-color) 40%)}to{background-color:var(--ag-row-loading-skeleton-effect-color)}}.ag-loading{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-loading{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-loading{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-ltr) .ag-loading-icon{padding-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-loading-icon{padding-left:var(--ag-cell-widget-spacing)}.ag-header{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);color:var(--ag-header-text-color);display:flex;font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;white-space:nowrap;width:100%}.ag-header-row{height:var(--ag-header-height);position:absolute}.ag-floating-filter-button-button,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,:where(.ag-header-cell-sortable) .ag-header-cell-label,:where(.ag-header-group-cell-selectable) .ag-header-cell-comp-wrapper{cursor:pointer}:where(.ag-ltr) .ag-header-expand-icon{margin-left:4px}:where(.ag-rtl) .ag-header-expand-icon{margin-right:4px}.ag-header-row:where(:not(:first-child)){:where(.ag-header-cell:not(.ag-header-span-height.ag-header-span-total,.ag-header-parent-hidden)),:where(.ag-header-group-cell.ag-header-group-cell-with-group){border-top:var(--ag-header-row-border)}}.ag-header-row:where(:not(.ag-header-row-column-group)){overflow:hidden}:where(.ag-header.ag-header-allow-overflow) .ag-header-row{overflow:visible}.ag-header-cell{display:inline-flex;overflow:hidden}.ag-header-group-cell{contain:paint;display:flex}.ag-header-cell,.ag-header-group-cell{align-items:center;gap:var(--ag-cell-widget-spacing);height:100%;padding:0 var(--ag-cell-horizontal-padding);position:absolute}@property --ag-internal-moving-color{syntax:"";inherits:false;initial-value:transparent}@property --ag-internal-hover-color{syntax:"";inherits:false;initial-value:transparent}.ag-header-cell:where(:not(.ag-floating-filter)):before,.ag-header-group-cell:before{background-image:linear-gradient(var(--ag-internal-hover-color),var(--ag-internal-hover-color)),linear-gradient(var(--ag-internal-moving-color),var(--ag-internal-moving-color));content:"";inset:0;position:absolute;--ag-internal-moving-color:transparent;--ag-internal-hover-color:transparent;transition:--ag-internal-moving-color var(--ag-header-cell-background-transition-duration),--ag-internal-hover-color var(--ag-header-cell-background-transition-duration)}.ag-header-cell:where(:not(.ag-floating-filter)):where(:hover):before,.ag-header-group-cell:where(:hover):before{--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}.ag-header-cell:where(:not(.ag-floating-filter)):where(.ag-header-cell-moving):before,.ag-header-group-cell:where(.ag-header-cell-moving):before{--ag-internal-moving-color:var(--ag-header-cell-moving-background-color);--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}:where(.ag-header-cell:not(.ag-floating-filter)>*,.ag-header-group-cell>*){position:relative;z-index:1}.ag-header-cell-menu-button:where(:not(.ag-header-menu-always-show)){opacity:0;transition:opacity .2s}.ag-header-cell-filter-button,:where(.ag-header-cell.ag-header-active) .ag-header-cell-menu-button{opacity:1}.ag-header-cell-label,.ag-header-group-cell-label{align-items:center;align-self:stretch;display:flex;flex:1 1 auto;overflow:hidden;padding:5px 0}:where(.ag-ltr) .ag-sort-indicator-icon{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-sort-indicator-icon{padding-right:var(--ag-spacing)}.ag-header-cell-label{text-overflow:ellipsis}.ag-header-group-cell-label.ag-sticky-label{flex:none;max-width:100%;overflow:visible;position:sticky}:where(.ag-ltr) .ag-header-group-cell-label.ag-sticky-label{left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-header-group-cell-label.ag-sticky-label{right:var(--ag-cell-horizontal-padding)}.ag-header-cell-text,.ag-header-group-text{overflow:hidden;text-overflow:ellipsis}.ag-header-cell-text{word-break:break-word}.ag-header-cell-comp-wrapper{width:100%}:where(.ag-header-group-cell) .ag-header-cell-comp-wrapper{display:flex}:where(.ag-header-cell:not(.ag-header-cell-auto-height)) .ag-header-cell-comp-wrapper{align-items:center;display:flex;height:100%}.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper{white-space:normal}.ag-header-cell-comp-wrapper-limited-height>*{overflow:hidden}:where(.ag-right-aligned-header) .ag-header-cell-label{flex-direction:row-reverse}:where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}.ag-header-cell:after,.ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{content:"";height:var(--ag-header-column-border-height);position:absolute;top:calc(50% - var(--ag-header-column-border-height)*.5);z-index:1}:where(.ag-ltr) .ag-header-cell:after,:where(.ag-ltr) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-right:var(--ag-header-column-border);right:0}:where(.ag-rtl) .ag-header-cell:after,:where(.ag-rtl) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-left:var(--ag-header-column-border);left:0}.ag-header-highlight-after:after,.ag-header-highlight-before:after{background-color:var(--ag-column-drag-indicator-color);border-radius:calc(var(--ag-column-drag-indicator-width)/2);content:"";height:100%;position:absolute;top:0;width:var(--ag-column-drag-indicator-width)}:where(.ag-ltr) .ag-header-highlight-before:after{left:0}:where(.ag-rtl) .ag-header-highlight-before:after{right:0}:where(.ag-ltr) .ag-header-highlight-after:after{right:0;:where(.ag-pinned-left-header) &{right:1px}}:where(.ag-rtl) .ag-header-highlight-after:after{left:0;:where(.ag-pinned-left-header) &{left:1px}}.ag-header-cell-resize{align-items:center;cursor:ew-resize;display:flex;height:100%;position:absolute;top:0;width:8px;z-index:2}:where(.ag-ltr) .ag-header-cell-resize{right:-3px}:where(.ag-rtl) .ag-header-cell-resize{left:-3px}.ag-header-cell-resize:after{background-color:var(--ag-header-column-resize-handle-color);content:"";height:var(--ag-header-column-resize-handle-height);position:absolute;top:calc(50% - var(--ag-header-column-resize-handle-height)*.5);width:var(--ag-header-column-resize-handle-width);z-index:1}:where(.ag-ltr) .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-rtl) .ag-header-cell-resize:after{right:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-header-cell.ag-header-span-height) .ag-header-cell-resize:after{height:calc(100% - var(--ag-spacing)*4);top:calc(var(--ag-spacing)*2)}.ag-header-group-cell-no-group:where(.ag-header-span-height){display:none}.ag-sort-indicator-container{display:flex;gap:var(--ag-spacing)}.ag-layout-print{&.ag-body{display:block;height:unset}&.ag-root-wrapper{container-type:normal;display:inline-block}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:none}&.ag-force-vertical-scroll{overflow-y:visible!important}}@media print{.ag-root-wrapper.ag-layout-print{container-type:normal;display:table;.ag-body-horizontal-scroll-viewport,.ag-body-viewport,.ag-center-cols-container,.ag-center-cols-viewport,.ag-root,.ag-root-wrapper-body,.ag-virtual-list-viewport{display:block!important;height:auto!important;overflow:hidden!important}.ag-cell,.ag-row{-moz-column-break-inside:avoid;break-inside:avoid}}}ag-grid,ag-grid-angular{display:block}.ag-root-wrapper{border:var(--ag-wrapper-border);border-radius:var(--ag-wrapper-border-radius);container-type:inline-size;display:flex;flex-direction:column;overflow:hidden;position:relative;&.ag-layout-normal{height:100%}}.ag-root-wrapper-body{display:flex;flex-direction:row;&.ag-layout-normal{flex:1 1 auto;height:0;min-height:0}}.ag-root{display:flex;flex-direction:column;position:relative;&.ag-layout-auto-height,&.ag-layout-normal{flex:1 1 auto;overflow:hidden;width:0}&.ag-layout-normal{height:100%}}.ag-drag-handle{color:var(--ag-drag-handle-color);cursor:grab;:where(.ag-icon){color:var(--ag-drag-handle-color)}}.ag-chart-menu-icon,.ag-chart-settings-next,.ag-chart-settings-prev,.ag-column-group-icons,.ag-column-select-header-icon,.ag-filter-toolpanel-expand,.ag-floating-filter-button-button,.ag-group-title-bar-icon,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,.ag-panel-title-bar-button-icon,.ag-set-filter-group-icons,:where(.ag-group-contracted) .ag-icon,:where(.ag-group-expanded) .ag-icon{background-color:var(--ag-icon-button-background-color);border-radius:var(--ag-icon-button-border-radius);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-background-color);color:var(--ag-icon-button-color)}.ag-chart-menu-icon:hover,.ag-chart-settings-next:hover,.ag-chart-settings-prev:hover,.ag-column-group-icons:hover,.ag-column-select-header-icon:hover,.ag-filter-toolpanel-expand:hover,.ag-floating-filter-button-button:hover,.ag-group-title-bar-icon:hover,.ag-header-cell-filter-button:hover,.ag-header-cell-menu-button:hover,.ag-header-expand-icon:hover,.ag-panel-title-bar-button-icon:hover,.ag-panel-title-bar-button:hover,.ag-set-filter-group-icons:hover,:where(.ag-group-contracted) .ag-icon:hover,:where(.ag-group-expanded) .ag-icon:hover{background-color:var(--ag-icon-button-hover-background-color);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-hover-background-color);color:var(--ag-icon-button-hover-color)}:where(.ag-filter-active),:where(.ag-filter-toolpanel-group-instance-header-icon),:where(.ag-filter-toolpanel-instance-header-icon){position:relative}:where(.ag-filter-active):after,:where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-filter-toolpanel-instance-header-icon):after{background-color:var(--ag-icon-button-active-indicator-color);border-radius:50%;content:"";height:6px;position:absolute;top:-1px;width:6px}:where(.ag-ltr) :where(.ag-filter-active):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-instance-header-icon):after{right:-1px}:where(.ag-rtl) :where(.ag-filter-active):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-instance-header-icon):after{left:-1px}.ag-filter-active{background-image:linear-gradient(var(--ag-icon-button-active-background-color),var(--ag-icon-button-active-background-color));border-radius:1px;outline:solid var(--ag-icon-button-background-spread) var(--ag-icon-button-active-background-color);:where(.ag-icon-filter){clip-path:path("M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z");color:var(--ag-icon-button-active-color)}}',sw={wrapperBorder:!0,rowBorder:!0,headerRowBorder:!0,footerRowBorder:{ref:"rowBorder"},columnBorder:{style:"solid",width:1,color:"transparent"},headerColumnBorder:!1,headerColumnBorderHeight:"100%",pinnedColumnBorder:!0,pinnedRowBorder:!0,sidePanelBorder:!0,sideBarPanelWidth:250,sideBarPanelAnimationDuration:0,sideBarBackgroundColor:{ref:"chromeBackgroundColor"},sideButtonBarBackgroundColor:{ref:"sideBarBackgroundColor"},sideButtonBarTopPadding:0,sideButtonSelectedUnderlineWidth:2,sideButtonSelectedUnderlineColor:"transparent",sideButtonSelectedUnderlineTransitionDuration:0,sideButtonBackgroundColor:"transparent",sideButtonTextColor:{ref:"textColor"},sideButtonHoverBackgroundColor:{ref:"sideButtonBackgroundColor"},sideButtonHoverTextColor:{ref:"sideButtonTextColor"},sideButtonSelectedBackgroundColor:Me,sideButtonSelectedTextColor:{ref:"sideButtonTextColor"},sideButtonBorder:"solid 1px transparent",sideButtonSelectedBorder:!0,sideButtonLeftPadding:{ref:"spacing"},sideButtonRightPadding:{ref:"spacing"},sideButtonVerticalPadding:{calc:"spacing * 3"},cellFontFamily:{ref:"fontFamily"},cellFontSize:{ref:"dataFontSize"},cellFontWeight:{ref:"fontWeight"},headerCellHoverBackgroundColor:"transparent",headerCellMovingBackgroundColor:{ref:"headerCellHoverBackgroundColor"},headerCellBackgroundTransitionDuration:"0.2s",cellTextColor:{ref:"textColor"},rangeSelectionBorderStyle:"solid",rangeSelectionBorderColor:ke,rangeSelectionBackgroundColor:Xt(.2),rangeSelectionChartBackgroundColor:"#0058FF1A",rangeSelectionChartCategoryBackgroundColor:"#00FF841A",rangeSelectionHighlightColor:Xt(.5),rangeHeaderHighlightColor:QD(.08),rowNumbersSelectedColor:Xt(.5),rowHoverColor:Xt(.08),columnHoverColor:Xt(.05),selectedRowBackgroundColor:Xt(.12),modalOverlayBackgroundColor:{ref:"backgroundColor",mix:.66},dataBackgroundColor:Me,oddRowBackgroundColor:{ref:"dataBackgroundColor"},wrapperBorderRadius:8,cellHorizontalPadding:{calc:"spacing * 2 * cellHorizontalPaddingScale"},cellWidgetSpacing:{calc:"spacing * 1.5"},cellHorizontalPaddingScale:1,rowGroupIndentSize:{calc:"cellWidgetSpacing + iconSize"},valueChangeDeltaUpColor:"#43a047",valueChangeDeltaDownColor:"#e53935",valueChangeValueHighlightBackgroundColor:"#16a08580",rowHeight:{calc:"max(iconSize, cellFontSize) + spacing * 3.25 * rowVerticalPaddingScale"},rowVerticalPaddingScale:1,paginationPanelHeight:{ref:"rowHeight",calc:"max(rowHeight, 22px)"},dragHandleColor:Be(.7),headerColumnResizeHandleHeight:"30%",headerColumnResizeHandleWidth:2,headerColumnResizeHandleColor:{ref:"borderColor"},iconButtonColor:{ref:"iconColor"},iconButtonBackgroundColor:"transparent",iconButtonBackgroundSpread:4,iconButtonBorderRadius:1,iconButtonHoverColor:{ref:"iconButtonColor"},iconButtonHoverBackgroundColor:Be(.1),iconButtonActiveColor:ke,iconButtonActiveBackgroundColor:Xt(.28),iconButtonActiveIndicatorColor:ke,setFilterIndentSize:{ref:"iconSize"},chartMenuPanelWidth:260,chartMenuLabelColor:Be(.8),cellEditingBorder:{color:ke},cellEditingShadow:{ref:"cardShadow"},fullRowEditInvalidBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:.25},columnSelectIndentSize:{ref:"iconSize"},toolPanelSeparatorBorder:!0,columnDropCellBackgroundColor:Be(.07),columnDropCellTextColor:{ref:"textColor"},columnDropCellDragHandleColor:{ref:"textColor"},columnDropCellBorder:{color:Be(.13)},selectCellBackgroundColor:Be(.07),selectCellBorder:{color:Be(.13)},advancedFilterBuilderButtonBarBorder:!0,advancedFilterBuilderIndentSize:{calc:"spacing * 2 + iconSize"},advancedFilterBuilderJoinPillColor:"#f08e8d",advancedFilterBuilderColumnPillColor:"#a6e194",advancedFilterBuilderOptionPillColor:"#f3c08b",advancedFilterBuilderValuePillColor:"#85c0e4",filterPanelApplyButtonColor:Me,filterPanelApplyButtonBackgroundColor:ke,columnPanelApplyButtonColor:Me,columnPanelApplyButtonBackgroundColor:ke,filterPanelCardSubtleColor:{ref:"textColor",mix:.7},filterPanelCardSubtleHoverColor:{ref:"textColor"},findMatchColor:Ot,findMatchBackgroundColor:"#ffff00",findActiveMatchColor:Ot,findActiveMatchBackgroundColor:"#ffa500",filterToolPanelGroupIndent:{ref:"spacing"},rowLoadingSkeletonEffectColor:Be(.15),statusBarLabelColor:Ot,statusBarLabelFontWeight:500,statusBarValueColor:Ot,statusBarValueFontWeight:500,pinnedSourceRowTextColor:{ref:"textColor"},pinnedSourceRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedSourceRowFontWeight:600,pinnedRowFontWeight:600,pinnedRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedRowTextColor:{ref:"textColor"},rowDragIndicatorColor:{ref:"rangeSelectionBorderColor"},rowDragIndicatorWidth:2,columnDragIndicatorColor:{ref:"accentColor"},columnDragIndicatorWidth:2},hA=".ag-cell-batch-edit{background-color:var(--ag-cell-batch-edit-background-color);color:var(--ag-cell-batch-edit-text-color);display:inherit}.ag-row-batch-edit{background-color:var(--ag-row-batch-edit-background-color);color:var(--ag-row-batch-edit-text-color)}",iw={cellBatchEditBackgroundColor:"rgba(220 181 139 / 16%)",cellBatchEditTextColor:"#422f00",rowBatchEditBackgroundColor:{ref:"cellBatchEditBackgroundColor"},rowBatchEditTextColor:{ref:"cellBatchEditTextColor"}},gA={...iw,cellBatchEditTextColor:"#f3d0b3"},pA=()=>he({feature:"batchEditStyle",params:iw,css:hA}),fA=pA(),Jl=":where(.ag-button){background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-indent:inherit;text-shadow:inherit;text-transform:inherit;word-spacing:inherit;&:disabled{cursor:default}&:focus-visible{box-shadow:var(--ag-focus-shadow);outline:none}}.ag-standard-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--ag-button-background-color);border:var(--ag-button-border);border-radius:var(--ag-button-border-radius);color:var(--ag-button-text-color);cursor:pointer;font-weight:var(--ag-button-font-weight);padding:var(--ag-button-vertical-padding) var(--ag-button-horizontal-padding);&:active{background-color:var(--ag-button-active-background-color);border:var(--ag-button-active-border);color:var(--ag-button-active-text-color)}&:disabled{background-color:var(--ag-button-disabled-background-color);border:var(--ag-button-disabled-border);color:var(--ag-button-disabled-text-color)}}.ag-standard-button:hover{background-color:var(--ag-button-hover-background-color);border:var(--ag-button-hover-border);color:var(--ag-button-hover-text-color)}",ec={buttonTextColor:"inherit",buttonFontWeight:"normal",buttonBackgroundColor:"transparent",buttonBorder:!1,buttonBorderRadius:{ref:"borderRadius"},buttonHorizontalPadding:{calc:"spacing * 2"},buttonVerticalPadding:{ref:"spacing"},buttonHoverTextColor:{ref:"buttonTextColor"},buttonHoverBackgroundColor:{ref:"buttonBackgroundColor"},buttonHoverBorder:{ref:"buttonBorder"},buttonActiveTextColor:{ref:"buttonHoverTextColor"},buttonActiveBackgroundColor:{ref:"buttonHoverBackgroundColor"},buttonActiveBorder:{ref:"buttonHoverBorder"},buttonDisabledTextColor:{ref:"inputDisabledTextColor"},buttonDisabledBackgroundColor:{ref:"inputDisabledBackgroundColor"},buttonDisabledBorder:{ref:"inputDisabledBorder"}},mA=()=>he({feature:"buttonStyle",params:ec,css:Jl}),rw=mA(),CA=()=>he({feature:"buttonStyle",params:{...ec,buttonBackgroundColor:Me,buttonBorder:!0,buttonHoverBackgroundColor:{ref:"rowHoverColor"},buttonActiveBorder:{color:ke}},css:Jl}),ow=CA(),vA=()=>he({feature:"buttonStyle",params:{...ec,buttonBackgroundColor:Me,buttonBorder:{color:ke},buttonFontWeight:600,buttonTextColor:ke,buttonHoverBackgroundColor:{ref:"rowHoverColor"},buttonActiveBackgroundColor:ke,buttonActiveTextColor:Me},css:Jl}),nw=vA(),wA=()=>he({feature:"buttonStyle",params:{...ec,buttonBorder:{color:Ot,width:2,style:"outset"},buttonActiveBorder:{color:Ot,width:2,style:"inset"},buttonBackgroundColor:Pe(.07),buttonHoverBackgroundColor:Me,buttonVerticalPadding:{calc:"spacing * 0.5"}},css:Jl}),aw=wA(),bA=".ag-column-drop-vertical-empty-message{align-items:center;border:dashed var(--ag-border-width);border-color:var(--ag-border-color);display:flex;inset:0;justify-content:center;margin:calc(var(--ag-spacing)*1.5) calc(var(--ag-spacing)*2);overflow:hidden;padding:calc(var(--ag-spacing)*2);position:absolute}",SA=".ag-column-drop-vertical-empty-message{color:var(--ag-subtle-text-color);font-size:calc(var(--ag-font-size) - 1px);font-weight:600;padding-top:var(--ag-spacing)}:where(.ag-ltr) .ag-column-drop-vertical-empty-message{padding-left:calc(var(--ag-icon-size) + var(--ag-spacing) + var(--ag-widget-horizontal-spacing));padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-column-drop-vertical-empty-message{padding-left:var(--ag-spacing);padding-right:calc(var(--ag-icon-size) + var(--ag-spacing) + var(--ag-widget-horizontal-spacing))}",yA=()=>he({feature:"columnDropStyle",css:bA}),tc=yA(),xA=()=>he({feature:"columnDropStyle",css:SA}),Vh=xA(),RA={formulaToken1Color:"#3269c6",formulaToken1BackgroundColor:{ref:"formulaToken1Color",mix:.08},formulaToken1Border:{color:{ref:"formulaToken1Color"}},formulaToken2Color:"#c0343f",formulaToken2BackgroundColor:{ref:"formulaToken2Color",mix:.06},formulaToken2Border:{color:{ref:"formulaToken2Color"}},formulaToken3Color:"#8156b8",formulaToken3BackgroundColor:{ref:"formulaToken3Color",mix:.08},formulaToken3Border:{color:{ref:"formulaToken3Color"}},formulaToken4Color:"#007c1f",formulaToken4BackgroundColor:{ref:"formulaToken4Color",mix:.06},formulaToken4Border:{color:{ref:"formulaToken4Color"}},formulaToken5Color:"#b03e85",formulaToken5BackgroundColor:{ref:"formulaToken5Color",mix:.08},formulaToken5Border:{color:{ref:"formulaToken5Color"}},formulaToken6Color:"#b74900",formulaToken6BackgroundColor:{ref:"formulaToken6Color",mix:.06},formulaToken6Border:{color:{ref:"formulaToken6Color"}},formulaToken7Color:"#247492",formulaToken7BackgroundColor:{ref:"formulaToken7Color",mix:.08},formulaToken7Border:{color:{ref:"formulaToken7Color"}}},FA=()=>he({feature:"formulaStyle",params:RA}),EA=FA(),PA={warn:(...e)=>{F(e[0],e[1])},error:(...e)=>{Q(e[0],e[1])},preInitErr:(...e)=>{wn(e[0],e[2],e[1])}},jn=()=>Zv(PA).withParams(sw).withPart(ow).withPart(tc).withPart(fA).withPart(EA),MA='.ag-checkbox-input-wrapper,.ag-radio-button-input-wrapper{background-color:var(--ag-checkbox-unchecked-background-color);border:solid var(--ag-checkbox-border-width) var(--ag-checkbox-unchecked-border-color);flex:none;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:where(.ag-checked){background-color:var(--ag-checkbox-checked-background-color);border-color:var(--ag-checkbox-checked-border-color)}&:where(.ag-checked):after{background-color:var(--ag-checkbox-checked-shape-color)}&:where(.ag-disabled){filter:grayscale();opacity:.5}}.ag-checkbox-input,.ag-radio-button-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-icon-size);margin:0;opacity:0;width:var(--ag-icon-size)}.ag-checkbox-input-wrapper:after,.ag-radio-button-input-wrapper:after{content:"";display:block;inset:0;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute}.ag-checkbox-input-wrapper:where(:focus-within,:active),.ag-radio-button-input-wrapper:where(:focus-within,:active){box-shadow:var(--ag-focus-shadow)}.ag-checkbox-input-wrapper{border-radius:var(--ag-checkbox-border-radius);&:where(.ag-checked):after{-webkit-mask-image:var(--ag-checkbox-checked-shape-image);mask-image:var(--ag-checkbox-checked-shape-image)}&:where(.ag-indeterminate){background-color:var(--ag-checkbox-indeterminate-background-color);border-color:var(--ag-checkbox-indeterminate-border-color)}&:where(.ag-indeterminate):after{background-color:var(--ag-checkbox-indeterminate-shape-color);-webkit-mask-image:var(--ag-checkbox-indeterminate-shape-image);mask-image:var(--ag-checkbox-indeterminate-shape-image)}}.ag-cell-editing-error .ag-checkbox-input-wrapper:focus-within{box-shadow:var(--ag-focus-error-shadow)}.ag-radio-button-input-wrapper{border-radius:100%;&:where(.ag-checked):after{-webkit-mask-image:var(--ag-radio-checked-shape-image);mask-image:var(--ag-radio-checked-shape-image)}}',TA=()=>he({feature:"checkboxStyle",params:{checkboxBorderWidth:1,checkboxBorderRadius:{ref:"borderRadius"},checkboxUncheckedBackgroundColor:Me,checkboxUncheckedBorderColor:Pe(.3),checkboxCheckedBackgroundColor:ke,checkboxCheckedBorderColor:{ref:"checkboxCheckedBackgroundColor"},checkboxCheckedShapeImage:{svg:''},checkboxCheckedShapeColor:Me,checkboxIndeterminateBackgroundColor:Pe(.3),checkboxIndeterminateBorderColor:{ref:"checkboxIndeterminateBackgroundColor"},checkboxIndeterminateShapeImage:{svg:''},checkboxIndeterminateShapeColor:Me,radioCheckedShapeImage:{svg:''}},css:MA}),qn=TA(),DA=()=>he({feature:"colorScheme",params:Ir}),AA=DA(),IA=()=>he({feature:"colorScheme",params:{...Ir,foregroundColor:"#000000de",borderColor:"#60300026",chromeBackgroundColor:"#60300005"}}),kA=IA(),LA=()=>he({feature:"colorScheme",params:{...Ir,foregroundColor:"#000",chromeBackgroundColor:"#f3f8f8"}}),GA=LA(),Bh=()=>({...Ir,...gA,backgroundColor:"hsl(217, 0%, 17%)",foregroundColor:"#FFF",chromeBackgroundColor:Pe(.05),rowHoverColor:Xt(.15),selectedRowBackgroundColor:Xt(.2),menuBackgroundColor:Pe(.1),browserColorScheme:"dark",popupShadow:"0 0px 20px #000A",cardShadow:"0 1px 4px 1px #000A",advancedFilterBuilderJoinPillColor:"#7a3a37",advancedFilterBuilderColumnPillColor:"#355f2d",advancedFilterBuilderOptionPillColor:"#5a3168",advancedFilterBuilderValuePillColor:"#374c86",filterPanelApplyButtonColor:Ot,columnPanelApplyButtonColor:Ot,findMatchColor:Me,findActiveMatchColor:Me,checkboxUncheckedBorderColor:Pe(.4),toggleButtonOffBackgroundColor:Pe(.4),rowBatchEditBackgroundColor:Pe(.1),formulaToken1Color:"#4da3e5",formulaToken2Color:"#f55864",formulaToken3Color:"#b688f2",formulaToken4Color:"#24bb4a",formulaToken5Color:"#e772ba",formulaToken6Color:"#f69b5f",formulaToken7Color:"#a3e6ff"}),OA=()=>he({feature:"colorScheme",params:Bh()}),VA=OA(),BA=()=>he({feature:"colorScheme",params:{backgroundColor:"hsl(29, 10%, 17%)",foregroundColor:"#FFF",browserColorScheme:"dark"}}),lw=()=>({...Bh(),backgroundColor:"#1f2836"}),NA=BA(),HA=()=>he({feature:"colorScheme",params:lw()}),zA=HA(),_A=()=>he({feature:"colorScheme",params:Ir,modeParams:{light:Ir,dark:Bh(),"dark-blue":lw()}}),Yn=_A(),WA=`.ag-icon-aggregation:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eaggregation%3C/title%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0M7.006 4c-1.57.02-2.946 1.348-3.004 2.922-.078 6.078-.23 12.16.002 18.234.094 1.484 1.354 2.746 2.84 2.84 6.1.232 12.212.232 18.312 0 1.48-.094 2.746-1.35 2.84-2.84.232-6.1.232-12.212 0-18.312-.094-1.48-1.35-2.746-2.84-2.84C19.11 3.774 13.056 4 7.006 4M22 12h-2v-2h-8v.092c.056 1.352 3.426 2.598 4.472 4.404.682 1.174.438 2.754-.572 3.72C14.29 19.618 12 20.924 12 22h8v-2h2v4H10c0-1.586-.098-3.304 1.016-4.314 1.904-1.632 4.89-3.108 3.54-4.42-1.918-1.68-4.464-2.936-4.554-5.12L10 8h12z'/%3E%3C/svg%3E")}.ag-icon-arrows:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Earrows%3C/title%3E%3Cpath d='m6.414 17 2.294 2.292-1.416 1.416L2.586 16l4.706-4.708 1.416 1.416L6.414 15H15V6.414l-2.292 2.294-1.416-1.416L16 2.586l4.708 4.706-1.416 1.416L17 6.414V15h8.586l-2.294-2.292 1.416-1.416L29.414 16l-4.706 4.708-1.416-1.416L25.586 17H17v8.586l2.292-2.294 1.416 1.416L16 29.414l-4.708-4.706 1.416-1.416L15 25.586V17z'/%3E%3C/svg%3E")}.ag-icon-asc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m15 10.621-4.292 4.294-1.416-1.416L16 6.793l6.708 6.706-1.416 1.416L17 10.621v14.586h-2z'/%3E%3C/svg%3E")}.ag-icon-aasc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M13.201 8.08q.65 0 1.135.222.487.222.759.618.27.396.279.919H14.19a.72.72 0 0 0-.293-.536q-.26-.191-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125q.382.086.701.229.32.143.554.35.234.21.362.49.131.284.134.648a1.6 1.6 0 0 1-.273.93q-.27.391-.777.608-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.642q-.29-.428-.305-1.058h1.194q.02.294.17.49.15.195.402.294.253.097.573.097.313 0 .544-.09a.84.84 0 0 0 .362-.255.6.6 0 0 0 .129-.374q0-.195-.117-.33a.9.9 0 0 0-.337-.228 3.4 3.4 0 0 0-.54-.171l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.927q.287-.396.79-.618a2.8 2.8 0 0 1 1.14-.223'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 14H4.489l-.432-1.332H1.948L1.515 14H.19l2.017-5.84h1.592zm-3.551-2.296h1.481l-.718-2.21H2.98zM8.452 8.16q.645 0 1.075.19.43.191.648.531a1.4 1.4 0 0 1 .217.775q0 .343-.137.602-.137.256-.376.422a1.6 1.6 0 0 1-.542.231v.057q.333.015.624.188.294.175.476.489.183.31.183.74 0 .466-.231.831a1.56 1.56 0 0 1-.676.573Q9.265 14 8.609 14H6.114V8.16zM7.35 12.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.29 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.396.64.64 0 0 0-.226-.511q-.223-.195-.633-.194H7.35z' clip-rule='evenodd'/%3E%3Cpath fill='%23000' d='M7.166.377a.75.75 0 0 1 .919.066l3.333 3a.75.75 0 0 1-1.003 1.115L7.609 2.033 5.113 4.53a.75.75 0 0 1-1.06-1.06l3-3z'/%3E%3C/svg%3E")}.ag-icon-cancel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecancel%3C/title%3E%3Cpath d='M16 4C9.378 4 4 9.378 4 16s5.378 12 12 12 12-5.378 12-12S22.622 4 16 4m0 2c5.52 0 10 4.48 10 10s-4.48 10-10 10S6 21.52 6 16 10.48 6 16 6m0 8.586 5.292-5.294 1.416 1.416L17.414 16l5.294 5.292-1.416 1.416L16 17.414l-5.292 5.294-1.416-1.416L14.586 16l-5.294-5.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-chart:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Echart%3C/title%3E%3Cpath d='M6.667 12.267h4v13.067h-4zm7.466-5.6h3.733v18.667h-3.733zM21.6 17.333h3.733v8H21.6z'/%3E%3C/svg%3E")}.ag-icon-color-picker:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolor-picker%3C/title%3E%3Cpath d='M23.907 17.587 10.574 4.254l-1.88 1.88 3.173 3.173-8.28 8.28 10.16 10.16zm-16.547 0 6.387-6.387 6.387 6.387H7.361zm18.387 2s-2.667 2.893-2.667 4.667c0 1.467 1.2 2.667 2.667 2.667s2.667-1.2 2.667-2.667c0-1.773-2.667-4.667-2.667-4.667'/%3E%3C/svg%3E")}.ag-icon-columns:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolumns%3C/title%3E%3Cpath d='M14 25h-2V7h2zm6 0h-2V7h2zm6 0h-2V7h2zM8 25H6V7h2z'/%3E%3C/svg%3E")}.ag-icon-contracted:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Econtracted%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-copy:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecopy%3C/title%3E%3Cpath d='M21.929 27.999h-7.828a5.09 5.09 0 0 1-5.086-5.086v-9.812a5.087 5.087 0 0 1 5.086-5.086h7.828a5.09 5.09 0 0 1 5.086 5.086v9.812a5.087 5.087 0 0 1-5.086 5.086m.16-17.984h-8.088a2.94 2.94 0 0 0-2.938 2.938v10.132a2.94 2.94 0 0 0 2.938 2.938h8.088a2.94 2.94 0 0 0 2.936-2.938V12.953a2.94 2.94 0 0 0-2.936-2.938M7.041 26.013h-2.05a4 4 0 0 1-.006-.228V9.065a5.07 5.07 0 0 1 5.064-5.064h12.812q.069 0 .134.002v2.012H9.915a2.876 2.876 0 0 0-2.874 2.874z'/%3E%3C/svg%3E")}.ag-icon-cross:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='4 4 24 24'%3E%3Ctitle%3Ecross%3C/title%3E%3Cpath d='m16 14.586 5.292-5.294 1.416 1.416L17.414 16l5.294 5.292-1.416 1.416L16 17.414l-5.292 5.294-1.416-1.416L14.586 16l-5.294-5.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-csv:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='M.688-.226a.2.2 0 0 1-.017.074.28.28 0 0 1-.145.14.412.412 0 0 1-.234.013.28.28 0 0 1-.202-.168.468.468 0 0 1-.04-.19q0-.086.025-.155a.319.319 0 0 1 .182-.191.4.4 0 0 1 .134-.025q.087 0 .155.035a.3.3 0 0 1 .104.085.17.17 0 0 1 .036.097.06.06 0 0 1-.018.044.06.06 0 0 1-.042.019.06.06 0 0 1-.042-.013.2.2 0 0 1-.031-.046.2.2 0 0 0-.066-.079.16.16 0 0 0-.095-.027.17.17 0 0 0-.142.068.3.3 0 0 0-.053.193.4.4 0 0 0 .023.139.2.2 0 0 0 .067.083.2.2 0 0 0 .1.027q.063 0 .106-.031a.2.2 0 0 0 .065-.091.2.2 0 0 1 .023-.046q.014-.018.044-.018a.06.06 0 0 1 .044.018.06.06 0 0 1 .019.045' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 7.122 25.977)'/%3E%3Cpath d='M.622-.215a.2.2 0 0 1-.033.117.23.23 0 0 1-.098.081.4.4 0 0 1-.153.029.34.34 0 0 1-.175-.04.23.23 0 0 1-.079-.077.17.17 0 0 1-.031-.093q0-.027.019-.045a.06.06 0 0 1 .046-.019.06.06 0 0 1 .039.014.1.1 0 0 1 .027.044.3.3 0 0 0 .03.057q.015.023.044.038.03.015.076.015.065 0 .105-.03a.09.09 0 0 0 .04-.075.08.08 0 0 0-.022-.058.14.14 0 0 0-.056-.034 1 1 0 0 0-.092-.025.7.7 0 0 1-.129-.042.2.2 0 0 1-.083-.066.17.17 0 0 1-.03-.104q0-.058.032-.105a.2.2 0 0 1 .093-.07.4.4 0 0 1 .144-.025q.066 0 .114.016a.3.3 0 0 1 .08.044.2.2 0 0 1 .046.057q.015.03.015.058a.07.07 0 0 1-.018.046.06.06 0 0 1-.046.021q-.025 0-.038-.012a.2.2 0 0 1-.028-.041.2.2 0 0 0-.047-.063Q.387-.625.326-.625a.15.15 0 0 0-.09.025q-.035.024-.035.059 0 .021.012.037a.1.1 0 0 0 .032.027.4.4 0 0 0 .111.036q.06.015.11.031.048.018.083.042a.2.2 0 0 1 .054.062.2.2 0 0 1 .019.091' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 13.339 25.977)'/%3E%3Cpath d='m.184-.633.162.48.163-.483q.013-.038.019-.053a.062.062 0 0 1 .061-.039q.018 0 .034.009a.1.1 0 0 1 .025.025q.009.015.009.031L.654-.64l-.007.025-.009.024-.173.468-.019.051a.2.2 0 0 1-.021.042.1.1 0 0 1-.033.03.1.1 0 0 1-.049.012.1.1 0 0 1-.05-.011A.1.1 0 0 1 .26-.03a.2.2 0 0 1-.021-.042L.22-.123.05-.587.041-.612.033-.638.03-.662q0-.025.02-.046a.07.07 0 0 1 .05-.02q.037 0 .053.023.015.023.031.072' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 18.94 25.977)'/%3E%3C/svg%3E")}.ag-icon-cut:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M14.703 15.096 6.215 4.719a1 1 0 1 1 1.548-1.267l13.058 15.965A5.001 5.001 0 0 1 28 23.916a5 5 0 0 1-4.999 4.999 5 5 0 0 1-4.999-4.999 4.98 4.98 0 0 1 1.23-3.283l-3.238-3.958-3.272 4.001a4.98 4.98 0 0 1 1.265 3.323 5 5 0 0 1-4.999 4.999 5 5 0 0 1-4.999-4.999 5 5 0 0 1 7.13-4.522zM8.991 20.8a3.1 3.1 0 0 0-3.1 3.1c0 1.711 1.389 3.1 3.1 3.1s3.1-1.389 3.1-3.1-1.389-3.1-3.1-3.1M23 20.8a3.1 3.1 0 0 0-3.1 3.1c0 1.711 1.389 3.1 3.1 3.1s3.1-1.389 3.1-3.1-1.389-3.1-3.1-3.1m-5.723-8.852 1.292 1.579 7.205-8.808a1 1 0 0 0-1.548-1.267z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-desc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m17 21.379 4.292-4.294 1.416 1.416L16 25.207l-6.708-6.706 1.416-1.416L15 21.379V6.793h2z'/%3E%3C/svg%3E")}.ag-icon-adesc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M10.387 11.47a.75.75 0 0 1 1.06 1.06l-3 3-.113.093a.75.75 0 0 1-.919-.065l-3.333-3a.75.75 0 0 1 1.003-1.116l2.806 2.525zM13.201 3.08q.65 0 1.135.222.487.223.759.619.27.396.279.918H14.19a.72.72 0 0 0-.293-.536q-.26-.192-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125a3.7 3.7 0 0 1 .701.229q.32.143.554.35.234.21.362.492.131.282.134.647a1.6 1.6 0 0 1-.273.93 1.74 1.74 0 0 1-.777.607q-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.641q-.29-.429-.305-1.059h1.194q.02.294.17.49.15.195.402.294.253.098.573.098.313 0 .544-.092a.84.84 0 0 0 .362-.254.6.6 0 0 0 .129-.373.5.5 0 0 0-.117-.33.9.9 0 0 0-.337-.23 3.4 3.4 0 0 0-.54-.17l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.926q.287-.396.79-.62a2.8 2.8 0 0 1 1.14-.222'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 9H4.489l-.432-1.332H1.948L1.515 9H.19l2.017-5.84h1.592zM2.262 6.704h1.481l-.718-2.21H2.98zM8.452 3.16q.645 0 1.075.19.43.192.648.53a1.4 1.4 0 0 1 .217.776q0 .342-.137.602a1.2 1.2 0 0 1-.376.423 1.6 1.6 0 0 1-.542.23v.058q.333.014.624.187.294.175.476.489.183.31.183.74 0 .465-.231.83a1.56 1.56 0 0 1-.676.574Q9.265 9 8.609 9H6.114V3.16zM7.35 7.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.291 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.397.64.64 0 0 0-.226-.51q-.223-.194-.633-.194H7.35z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m17 21.379 4.292-4.294 1.416 1.416L16 25.207l-6.708-6.706 1.416-1.416L15 21.379V6.793h2z'/%3E%3C/svg%3E")}.ag-icon-excel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='m.052-.139.16-.234-.135-.208a.4.4 0 0 1-.028-.052.1.1 0 0 1-.01-.042.05.05 0 0 1 .018-.037.07.07 0 0 1 .045-.016q.03 0 .047.018a1 1 0 0 1 .047.066l.107.174.115-.174.024-.038.019-.026.021-.015a.1.1 0 0 1 .027-.005.06.06 0 0 1 .044.016.05.05 0 0 1 .018.039q0 .033-.038.089l-.141.211.152.234a.3.3 0 0 1 .03.051.1.1 0 0 1 .009.038.1.1 0 0 1-.008.031.1.1 0 0 1-.024.023.1.1 0 0 1-.034.008.1.1 0 0 1-.035-.008.1.1 0 0 1-.023-.022L.427-.067.301-.265l-.134.204-.022.034-.016.019a.1.1 0 0 1-.022.015.1.1 0 0 1-.03.005.06.06 0 0 1-.044-.016.06.06 0 0 1-.017-.047q0-.036.036-.088' style='fill-rule:nonzero' transform='matrix(17.82892 0 0 16.50777 10.371 25.928)'/%3E%3C/svg%3E")}.ag-icon-expanded:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eexpanded%3C/title%3E%3Cpath d='M21.061 8.708 13.767 16l7.294 7.292-1.416 1.416L10.939 16l8.706-8.708z'/%3E%3C/svg%3E")}.ag-icon-eye-slash:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye-slash%3C/title%3E%3Cpath d='M9.304 7.89a15.2 15.2 0 0 1 6.404-1.638c.294-.002.292-.002.584 0 5.956.174 11.328 4.088 13.62 9.748 0 0-1.318 3.178-3.224 5.174a13.6 13.6 0 0 1-2.226 1.874L26.414 25 25 26.414l-2.336-2.336C17.866 26.396 11.776 26.15 7.36 22.96a14.9 14.9 0 0 1-4.168-4.612c-.41-.71-.694-1.336-1.104-2.348 0 0 .898-2.218 2.002-3.718a14.6 14.6 0 0 1 3.442-3.334L5.586 7 7 5.586zm-.3 2.528c-2.038 1.344-3.708 3.246-4.724 5.508L4.248 16c2.46 5.762 9.622 9.064 15.63 7.15q.688-.219 1.342-.516l-.912-.912a6.96 6.96 0 0 1-4.19 1.394c-3.862 0-7-3.136-7-7 0-1.57.52-3.022 1.394-4.19zm14.032 11.204a13.25 13.25 0 0 0 4.684-5.548l.032-.074c-1.984-4.646-6.834-7.798-12.006-7.748-1.712.05-3.386.458-4.922 1.158l1.102 1.102a6.97 6.97 0 0 1 4.192-1.396 7.003 7.003 0 0 1 5.606 11.192zm-11.09-8.262a5.003 5.003 0 0 0 6.928 6.928zm8.342 5.514a5.002 5.002 0 0 0-6.928-6.928z'/%3E%3C/svg%3E")}.ag-icon-eye:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye%3C/title%3E%3Cpath d='M16.292 6.32c5.956.174 11.328 4.086 13.62 9.746 0 0-1.318 3.18-3.224 5.176-4.862 5.088-13.534 5.97-19.328 1.784a14.9 14.9 0 0 1-4.168-4.612c-.41-.71-.694-1.336-1.104-2.348 0 0 .898-2.216 2.002-3.716 2.678-3.64 7.03-5.896 11.618-6.03.294-.004.292-.004.584 0m-.546 2c-4.896.142-9.458 3.202-11.466 7.672l-.032.074c2.46 5.762 9.622 9.066 15.63 7.152 3.458-1.102 6.342-3.738 7.842-7.076l.032-.076C25.768 11.42 20.918 8.27 15.746 8.32m.254.946c3.754 0 6.8 3.048 6.8 6.8 0 3.754-3.046 6.8-6.8 6.8s-6.8-3.046-6.8-6.8c0-3.752 3.046-6.8 6.8-6.8m5 6.768V16c0-2.76-2.24-5-5-5s-5 2.24-5 5v.066c0 2.76 2.24 5 5 5s5-2.24 5-5z'/%3E%3C/svg%3E")}.ag-icon-filter:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efilter%3C/title%3E%3Cpath d='M26 8.184c-.066 2.658-4.058 5.154-6.742 7.974a1.05 1.05 0 0 0-.258.682v3.66L13 25c0-2.74.066-5.482-.002-8.222a1.05 1.05 0 0 0-.256-.62C10.026 13.304 6.06 10.61 6 8.184V6h20zM8 8c0 .304.06.612.258.842 2.716 2.854 6.682 5.548 6.742 7.974V21l2-1.5v-2.684c.066-2.658 4.058-5.154 6.742-7.974.198-.23.258-.538.258-.842z'/%3E%3C/svg%3E")}.ag-icon-first:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efirst%3C/title%3E%3Cpath d='M24.354 8.708 17.06 16l7.294 7.292-1.416 1.416L14.232 16l8.706-8.708zM9.646 8v16h-2V8z'/%3E%3C/svg%3E")}.ag-icon-group:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egroup%3C/title%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0M7.006 4c-1.57.02-2.946 1.348-3.004 2.922-.078 6.078-.23 12.16.002 18.234.094 1.484 1.354 2.746 2.84 2.84 6.1.232 12.212.232 18.312 0 1.48-.094 2.746-1.35 2.84-2.84.232-6.1.232-12.212 0-18.312-.094-1.48-1.35-2.746-2.84-2.84C19.11 3.774 13.056 4 7.006 4M14 21h-4v-2h4zm12 0H16v-2h10zm-12-4h-4v-2h4zm12 0H16v-2h10zm-16-4H6v-2h4zm16 0H12v-2h14z'/%3E%3C/svg%3E")}.ag-icon-last:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elast%3C/title%3E%3Cpath d='m17.768 16-8.706 8.708-1.416-1.416L14.94 16 7.646 8.708l1.416-1.416zm6.586 8h-2V8h2z'/%3E%3C/svg%3E")}.ag-icon-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eleft%3C/title%3E%3Cpath d='m17.621 11-2 2h12.586v6H15.621l2 2-4.414 4.414L3.793 16l9.414-9.414zm-11 5 6.586 6.586L14.793 21l-4-4h15.414v-2H10.793l4-4-1.586-1.586z'/%3E%3C/svg%3E")}.ag-icon-linked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elinked%3C/title%3E%3Cpath d='M17.138 13.418a1.03 1.03 0 0 0-.298.658s.125.096.226.178c1.372 1.114 2.033 3.039 1.582 4.796a4.7 4.7 0 0 1-1.205 2.123c-1.145 1.151-2.296 2.294-3.445 3.441-1.241 1.232-3.185 1.691-4.864 1.105-1.546-.54-2.756-1.938-3.048-3.572-.267-1.496.246-3.108 1.319-4.186l.578-.578-.03-.092a10.5 10.5 0 0 1-.452-2.3v-.005c-.776.775-1.621 1.489-2.275 2.396-1.817 2.522-1.643 6.323.706 8.669 1.813 1.811 4.708 2.462 7.171 1.517a6.75 6.75 0 0 0 2.336-1.518l3.427-3.424c1.939-1.954 2.533-5.126 1.294-7.674a6.8 6.8 0 0 0-2.071-2.481l-.003-.002zM21.265 4a6.8 6.8 0 0 0-4.734 1.964l-3.427 3.424c-1.961 1.977-2.52 5.092-1.32 7.619a6.8 6.8 0 0 0 2.098 2.537l.003.002c.32-.32.643-.637.96-.96.167-.172.27-.401.286-.64l-.204-.167c-1.603-1.287-2.215-3.68-1.316-5.616a4.7 4.7 0 0 1 .918-1.32c1.145-1.151 2.296-2.294 3.445-3.441 1.239-1.23 3.178-1.694 4.864-1.105 1.83.639 3.16 2.498 3.12 4.493a4.8 4.8 0 0 1-1.391 3.265l-.578.578.03.092c.235.743.387 1.519.452 2.3v.005c.732-.731 1.521-1.406 2.162-2.244 1.192-1.559 1.643-3.651 1.204-5.575a6.8 6.8 0 0 0-3.98-4.703 6.8 6.8 0 0 0-2.529-.506h-.061z'/%3E%3C/svg%3E")}.ag-icon-loading:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eloading%3C/title%3E%3Cpath d='M17 29h-2v-8h2zm-3.586-9L7 26.414 5.586 25 12 18.586zm13 5L25 26.414 18.586 20 20 18.586zM29 17h-8v-2h8zm-18 0H3v-2h8zm2.414-5L12 13.414 5.586 7 7 5.586zm13-5L20 13.414 18.586 12 25 5.586zM17 11h-2V3h2z'/%3E%3C/svg%3E")}.ag-icon-maximize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3 3 26 26'%3E%3Ctitle%3Emaximize%3C/title%3E%3Cpath d='m7.54 17.4.1 6.98 6.96.1-2.24-2.24L16 18.6 13.4 16l-3.64 3.64zm16.92-2.8-.1-6.98-6.96-.1 2.24 2.24L16 13.4l2.6 2.6 3.64-3.64z'/%3E%3C/svg%3E")}.ag-icon-menu:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Emenu%3C/title%3E%3Cpath d='M26 23H6v-2h20zm0-6H6v-2h20zm0-6H6V9h20z'/%3E%3C/svg%3E")}.ag-icon-menu-alt:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none'%3E%3Cpath fill='%23000' d='M16 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4m0-7a2 2 0 1 0 0-4 2 2 0 0 0 0 4m0 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4'/%3E%3C/svg%3E")}.ag-icon-minimize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3 3 26 26'%3E%3Ctitle%3Eminimize%3C/title%3E%3Cpath d='m14.8 24.26-.1-6.96-6.96-.1 2.24 2.24-3.64 3.64 2.6 2.6 3.64-3.64zm2.4-16.52.1 6.96 6.96.1-2.24-2.24 3.64-3.64-2.6-2.6-3.64 3.64z'/%3E%3C/svg%3E")}.ag-icon-minus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.515 7.515c-4.683 4.682-4.683 12.288 0 16.97 4.682 4.683 12.288 4.683 16.97 0 4.683-4.682 4.683-12.288 0-16.97-4.682-4.683-12.288-4.683-16.97 0m1.414 1.414c3.903-3.903 10.239-3.903 14.142 0s3.903 10.239 0 14.142-10.239 3.903-14.142 0-3.903-10.239 0-14.142m-1.414 6.07h16.97v2.002H7.515z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-next:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enext%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-none:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enone%3C/title%3E%3Cpath d='m10.044 21.258 4.478-4.198L16 18.444 9 25l-7-6.556 1.478-1.384 4.478 4.198V7h2.088zm14 3.742h-2.088V10.742l-4.478 4.198L16 13.556 23 7q3.5 3.28 7 6.556l-1.478 1.384-4.478-4.198z'/%3E%3C/svg%3E")}.ag-icon-not-allowed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enot-allowed%3C/title%3E%3Cpath d='M16.186 3.646c8.188.154 14.898 9.796 11.17 17.78-3.298 7.066-13.932 9.374-19.848 3.87-3.9-3.632-5.076-9.896-2.684-14.708 2.082-4.19 6.588-6.974 11.362-6.942m-.298 1.998c-6.922.132-12.578 8.308-9.33 15.052 3.342 6.934 15.246 7.646 18.932 0 3.076-6.386-1.988-15.1-9.602-15.052m7.596 6.422c2.864 5.33-1.744 13.186-8.306 12.536a8.6 8.6 0 0 1-3.232-.998l-1.266-.706L22.778 10.8q.351.633.706 1.266m-9.422 10.276c3.296 1.028 7.246-1.006 8.216-4.418a6.6 6.6 0 0 0-.056-3.742zm2.104-14.696a8.8 8.8 0 0 1 3.936 1.038l1.266.706L9.27 21.488c-3.018-5.41-.99-13.37 6.318-13.834q.289-.01.578-.008m-.31 2c-4.06.154-7.23 4.614-6.03 8.46l8.16-8.16a6.8 6.8 0 0 0-2.13-.3'/%3E%3C/svg%3E")}.ag-icon-paste:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epaste%3C/title%3E%3Cpath d='M20 6.5c0-1-1-3-4-3s-4 2-4 3H8c-2.21 0-4 1.79-4 4v14c0 2.21 1.79 4 4 4h16c2.21 0 4-1.79 4-4v-14c0-2.21-1.79-4-4-4zm-4 .546c.734 0 1.334.572 1.334 1.272S16.734 9.59 16 9.59s-1.334-.572-1.334-1.272.6-1.272 1.334-1.272M24 26.5H8a2 2 0 0 1-2-2v-14a2 2 0 0 1 2-2h2v4h12v-4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2'/%3E%3C/svg%3E")}.ag-icon-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epin%3C/title%3E%3Cpath d='m10.78 19.777-4.668-4.666s.032-1 .67-1.87c1.366-1.86 4.052-1.96 6.056-1.572l3.158-3.108c-.7-2.342 3.352-5.046 3.352-5.046l9.166 9.168q-.334.447-.67.894c-1.074 1.426-2.538 2.63-4.272 2.338l-3.32 3.218c.046.344.042.03.118 1.152.144 2.13-.64 4.324-2.632 5.34l-.746.364-4.798-4.798-7.292 7.294-1.416-1.416zm8.24-13.672c-.688.568-1.416 1.45-1.024 2.072l.49.722-4.986 4.988c-1.988-.506-4.346-.636-5.156.614l9.02 9.032q.14-.099.272-.21c1.226-1.08.764-3.04.498-4.9l4.79-4.79s1.47.938 2.936-.776l-6.79-6.79q-.026.019-.05.038'/%3E%3C/svg%3E")}.ag-icon-pivot:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epivot%3C/title%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0m2.966 7.954H9.892v18.136c5.086.13 10.18.098 15.264-.096 1.48-.094 2.746-1.35 2.84-2.84.192-5.064.226-10.134.098-15.2M3.968 24.1q.015.528.036 1.056c.094 1.484 1.354 2.746 2.84 2.84l1.012.036V24.1zM22 15.414l-.292.294-1.416-1.416L23 11.586l2.708 2.706-1.416 1.416-.292-.294v3.592c-.032 2.604-2.246 4.892-4.872 4.992L15.414 24l.294.292-1.416 1.416L11.586 23l2.706-2.708 1.416 1.416-.322.32c3.372.03 6.578-.164 6.614-3.034zM3.88 18.038c.002 1.346.012 2.694.038 4.04h3.938v-4.04zm.05-6.062a681 681 0 0 0-.044 4.042h3.97v-4.042zm5.962-7.99Q8.449 3.999 7.006 4c-1.57.02-2.946 1.348-3.004 2.922q-.02 1.517-.042 3.034h3.896v-2.02h2.036zm14.244-.016v3.966h3.898q-.017-.546-.038-1.092c-.094-1.48-1.35-2.746-2.84-2.84q-.51-.019-1.02-.034m-8.14-.054q-2.035.022-4.07.048v3.972h4.07zm6.106.008c-1.358-.022-2.714-.026-4.07-.022v4.034h4.07z'/%3E%3C/svg%3E")}.ag-icon-plus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.515 7.515c-4.683 4.682-4.683 12.288 0 16.97 4.682 4.683 12.288 4.683 16.97 0 4.683-4.682 4.683-12.288 0-16.97-4.682-4.683-12.288-4.683-16.97 0m1.414 1.414c3.903-3.903 10.239-3.903 14.142 0s3.903 10.239 0 14.142-10.239 3.903-14.142 0-3.903-10.239 0-14.142M15 15l-.001-7.485h2.002L17 15l7.485-.001v2.002L17 17l.001 7.485h-2.002L15 17l-7.485.001v-2.002z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-previous:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eprevious%3C/title%3E%3Cpath d='M21.061 8.708 13.767 16l7.294 7.292-1.416 1.416L10.939 16l8.706-8.708z'/%3E%3C/svg%3E")}.ag-icon-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eright%3C/title%3E%3Cpath d='m28.207 16-9.414 9.414L14.379 21l2-2H3.793v-6h12.586l-2-2 4.414-4.414zm-11-5 4 4H5.793v2h15.414l-4 4 1.586 1.586L25.379 16l-6.586-6.586z'/%3E%3C/svg%3E")}.ag-icon-save:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esave%3C/title%3E%3Cpath d='M25.333 16v9.333H6.666V16H3.999v9.333C3.999 26.8 5.199 28 6.666 28h18.667C26.8 28 28 26.8 28 25.333V16zm-8 .893 3.453-3.44 1.88 1.88L15.999 22l-6.667-6.667 1.88-1.88 3.453 3.44V4h2.667v12.893z'/%3E%3C/svg%3E")}.ag-icon-small-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-down%3C/title%3E%3Cpath d='M24.708 12.355 16 21.061l-8.708-8.706 1.416-1.416L16 18.233l7.292-7.294z'/%3E%3C/svg%3E")}.ag-icon-small-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-left%3C/title%3E%3Cpath d='M21.061 8.708 13.767 16l7.294 7.292-1.416 1.416L10.939 16l8.706-8.708z'/%3E%3C/svg%3E")}.ag-icon-small-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-right%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-small-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-up%3C/title%3E%3Cpath d='m24.708 19.645-1.416 1.416L16 13.767l-7.292 7.294-1.416-1.416L16 10.939z'/%3E%3C/svg%3E")}.ag-icon-tick:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etick%3C/title%3E%3Cpath d='M24.708 10.855 13 22.561l-5.708-5.706 1.416-1.416L13 19.733 23.292 9.439z'/%3E%3C/svg%3E")}.ag-icon-tree-closed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-closed%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-tree-indeterminate:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-indeterminate%3C/title%3E%3Cpath d='M6 15h20v2H6z'/%3E%3C/svg%3E")}.ag-icon-tree-open:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-open%3C/title%3E%3Cpath d='M24.708 12.355 16 21.061l-8.708-8.706 1.416-1.416L16 18.233l7.292-7.294z'/%3E%3C/svg%3E")}.ag-icon-unlinked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eunlinked%3C/title%3E%3Cpath d='M5.35 3.999a.2.2 0 0 0-.14.058c-.388.38-.768.768-1.152 1.152a.21.21 0 0 0-.002.288c7.459 7.506 14.965 14.965 22.447 22.447a.21.21 0 0 0 .288.002q.576-.574 1.151-1.151a.21.21 0 0 0 .002-.288C20.484 19.002 12.979 11.542 5.497 4.06a.2.2 0 0 0-.146-.061zm.611 12.548c-1.933 1.939-2.538 5.119-1.289 7.688a6.79 6.79 0 0 0 4.891 3.672 6.82 6.82 0 0 0 5.893-1.866l1.984-1.984-1.438-1.438-1.986 1.986c-1.486 1.476-3.993 1.81-5.834.629a4.73 4.73 0 0 1-2.024-2.853 4.76 4.76 0 0 1 1.241-4.393l1.986-1.986-1.438-1.438-1.984 1.984zM21.273 3.999a6.78 6.78 0 0 0-4.727 1.963l-1.984 1.984L16 9.384l1.985-1.985a4.74 4.74 0 0 1 2.776-1.338c1.974-.224 4.045.926 4.845 2.834.712 1.699.329 3.778-1.004 5.12L22.616 16l1.439 1.438q1-1 2-2c2.012-2.031 2.557-5.368 1.112-7.982-1.144-2.07-3.432-3.441-5.834-3.459h-.061z'/%3E%3C/svg%3E")}.ag-icon-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m15 10.621-4.292 4.294-1.416-1.416L16 6.793l6.708 6.706-1.416 1.416L17 10.621v14.586h-2z'/%3E%3C/svg%3E")}.ag-icon-grip:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egrip%3C/title%3E%3Cpath d='M8 24H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 18H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 12H6V8h2zm6 0h-2V8h2zm6 0h-2V8h2zm6 0h-2V8h2z'/%3E%3C/svg%3E")}.ag-icon-settings:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3M2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3 1.3-3 3-3'/%3E%3C/svg%3E")}.ag-icon-column-arrow:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11 4a1 1 0 0 1 1 1v22a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 13a1 1 0 0 1 1-1h23.5a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 4h18v24H2zm2 2v20h14V6zM26.793 13 23 9.207l1.414-1.414L29.621 13l-5.207 5.207L23 16.793z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-un-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m6.112 15.111 3.272 3.271 1.436-1.402-2.476-2.479c.81-1.25 3.168-1.12 5.156-.614l4.986-4.988-.49-.722c-.392-.622.336-1.504 1.024-2.072l.008-.007.01-.006.032-.025 1.447 1.447 1.432-1.397-2.601-2.602s-4.052 2.704-3.352 5.046l-3.158 3.108c-2.004-.388-4.69-.288-6.056 1.572-.638.87-.67 1.87-.67 1.87m.581 11.582.014.014 5.502-5.501 4.783 4.783.746-.364c1.992-1.016 2.776-3.21 2.632-5.34-.055-.805-.068-.87-.088-.97-.008-.04-.017-.085-.03-.182l3.32-3.218c1.734.292 3.198-.912 4.272-2.338q.337-.447.67-.894l-.001-.001-.007-.007-.007-.007-.007-.007-3.87-3.87 1.585-1.584-1.414-1.414-14.381 14.38-1.237 1.209-5.69 5.687 1.417 1.416zM23.21 10.206l2.65 2.651c-1.465 1.714-2.935.776-2.935.776l-4.79 4.79q.041.291.087.583c.257 1.676.513 3.35-.585 4.317a4 4 0 0 1-.272.21l-3.739-3.744z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-pinned-top:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='m16.708 10.878 8.708 8.706L24 21l-6.292-6.294V27h-2V14.706L9.416 21 8 19.584q4.348-4.344 8.691-8.69zM25 6H8v2h17z'/%3E%3C/svg%3E")}.ag-icon-pinned-bottom:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M16.708 22.122 8 13.416 9.416 12l6.292 6.294V6h2v12.294L24 12l1.416 1.416-8.691 8.69zM7.416 28h17v-2h-17z'/%3E%3C/svg%3E")}.ag-icon-chevron-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3.479 10.521a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1-1.06 1.06l-3.47-3.47-3.47 3.47a.75.75 0 0 1-1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.521 5.461a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 1.06-1.06l3.47 3.47 3.47-3.47a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.53 12.512a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 1.06l-3.47 3.47 3.47 3.47a.75.75 0 0 1 0 1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M5.47 3.47a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06-1.06L8.94 8 5.47 4.53a.75.75 0 0 1 0-1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-filter-add:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M19.834 8H8c0 .304.06.612.258.842 2.716 2.854 6.682 5.548 6.742 7.974V21l2-1.5v-2.684c.056-2.267 2.968-4.417 5.49-6.75v3.087c-1.081.974-2.245 1.968-3.232 3.005a1.05 1.05 0 0 0-.258.682v3.66L13 25c0-2.74.066-5.482-.002-8.222a1.05 1.05 0 0 0-.256-.62C10.026 13.304 6.06 10.61 6 8.184V6h13.834z'/%3E%3Cpath fill='currentColor' d='M26 6h2.946v2.002H26v3.313h-2.002V8.002h-2.946V6h2.946V3.04H26z'/%3E%3C/svg%3E")}.ag-icon-edit:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M23.182 5a3.82 3.82 0 0 1 2.83 6.383l-.131.137-2.09 2.088a1 1 0 0 1-.084.099 1 1 0 0 1-.098.084L12.533 24.869a3 3 0 0 1-1.245.746l-4.353 1.32-.003.002a1.5 1.5 0 0 1-1.87-1.867l.003-.004 1.32-4.352v-.003l.06-.174c.13-.344.321-.661.565-.936l.126-.135L18.209 8.39a1 1 0 0 1 .18-.181l2.092-2.09.137-.132A3.82 3.82 0 0 1 23.182 5M8.548 20.883a1 1 0 0 0-.25.415l-1.049 3.451 3.457-1.048.114-.042q.17-.076.301-.206l10.458-10.46-2.572-2.572zM23.182 7c-.482 0-.946.19-1.287.531v.001l-1.474 1.475 2.572 2.572 1.474-1.474.121-.133A1.82 1.82 0 0 0 23.182 7'/%3E%3C/svg%3E")}`,cw=he({feature:"iconSet",css:WA}),UA=`.ag-icon-aggregation:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M24 6H8v2l8 8-8 8v2h16v-2H11l8-8-8-8h13z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-arrows:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.515 11.171 2.687 16l4.828 4.829-1.414 1.414L-.142 16l6.243-6.243zm16.97 0 1.414-1.414L32.142 16l-6.243 6.243-1.414-1.414L29.313 16zM16.028 13.2l2.829 2.828-2.829 2.829-2.828-2.829zm-4.857 11.285L16 29.313l4.829-4.828 1.414 1.414L16 32.142l-6.243-6.243zm0-16.97L9.757 6.101 16-.142l6.243 6.243-1.414 1.414L16 2.687z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-asc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333 5.332 16z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-aasc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M13.201 8.08q.65 0 1.135.222.487.222.759.618.27.396.279.919H14.19a.72.72 0 0 0-.293-.536q-.26-.191-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125q.382.086.701.229.32.143.554.35.234.21.362.49.131.284.134.648a1.6 1.6 0 0 1-.273.93q-.27.391-.777.608-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.642q-.29-.428-.305-1.058h1.194q.02.294.17.49.15.195.402.294.253.097.573.097.313 0 .544-.09a.84.84 0 0 0 .362-.255.6.6 0 0 0 .129-.374q0-.195-.117-.33a.9.9 0 0 0-.337-.228 3.4 3.4 0 0 0-.54-.171l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.927q.287-.396.79-.618a2.8 2.8 0 0 1 1.14-.223'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 14H4.489l-.432-1.332H1.948L1.515 14H.19l2.017-5.84h1.592zm-3.551-2.296h1.481l-.718-2.21H2.98zM8.452 8.16q.645 0 1.075.19.43.191.648.531a1.4 1.4 0 0 1 .217.775q0 .343-.137.602-.137.256-.376.422a1.6 1.6 0 0 1-.542.231v.057q.333.015.624.188.294.175.476.489.183.31.183.74 0 .466-.231.831a1.56 1.56 0 0 1-.676.573Q9.265 14 8.609 14H6.114V8.16zM7.35 12.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.29 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.396.64.64 0 0 0-.226-.511q-.223-.195-.633-.194H7.35z' clip-rule='evenodd'/%3E%3Cpath fill='%23000' d='M7.166.377a.75.75 0 0 1 .919.066l3.333 3a.75.75 0 0 1-1.003 1.115L7.609 2.033 5.113 4.53a.75.75 0 0 1-1.06-1.06l3-3z'/%3E%3C/svg%3E")}.ag-icon-cancel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M16 2.667A13.32 13.32 0 0 0 2.667 16c0 7.373 5.96 13.333 13.333 13.333S29.333 23.373 29.333 16 23.373 2.667 16 2.667m6.667 18.12-1.88 1.88L16 17.88l-4.787 4.787-1.88-1.88L14.12 16l-4.787-4.787 1.88-1.88L16 14.12l4.787-4.787 1.88 1.88L17.88 16z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-chart:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Echart%3C/title%3E%3Cg fill='%23000' fill-rule='nonzero'%3E%3Cpath d='M14 7h4v18h-4zM8 17h4v8H8zM20 13h4v12h-4z'/%3E%3C/g%3E%3C/svg%3E")}.ag-icon-color-picker:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M23.907 17.587 10.574 4.254l-1.88 1.88 3.173 3.173-8.28 8.28 10.16 10.16zm-16.547 0 6.387-6.387 6.387 6.387zm18.387 2s-2.667 2.893-2.667 4.667c0 1.467 1.2 2.667 2.667 2.667s2.667-1.2 2.667-2.667c0-1.773-2.667-4.667-2.667-4.667' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-columns:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M26 25H6V7h20zM12 11H8v12h4zm6 0h-4v12h4zm6 12V11h-4v12z' style='fill-rule:nonzero' transform='translate(0 -1)'/%3E%3C/svg%3E")}.ag-icon-contracted:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m12 6 10 10-10 10-2-2 8-8-8-8z'/%3E%3C/svg%3E")}.ag-icon-copy:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M22 1.333H6A2.675 2.675 0 0 0 3.333 4v18.667H6V4h16zm4 5.334H11.333a2.675 2.675 0 0 0-2.667 2.667v18.667c0 1.467 1.2 2.667 2.667 2.667H26c1.467 0 2.667-1.2 2.667-2.667V9.334c0-1.467-1.2-2.667-2.667-2.667M26 28H11.333V9.333H26z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-cross:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M15.984 13.894 27.05 2.828l2.122 2.122-11.066 11.066 11.066 11.066-2.122 2.12-11.066-11.066L4.918 29.202l-2.12-2.12 11.066-11.066L2.798 4.95l2.12-2.122z'/%3E%3C/svg%3E")}.ag-icon-csv:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='M.688-.226a.2.2 0 0 1-.017.074.28.28 0 0 1-.145.14.412.412 0 0 1-.234.013.28.28 0 0 1-.202-.168.468.468 0 0 1-.04-.19q0-.086.025-.155a.319.319 0 0 1 .182-.191.4.4 0 0 1 .134-.025q.087 0 .155.035a.3.3 0 0 1 .104.085.17.17 0 0 1 .036.097.06.06 0 0 1-.018.044.06.06 0 0 1-.042.019.06.06 0 0 1-.042-.013.2.2 0 0 1-.031-.046.2.2 0 0 0-.066-.079.16.16 0 0 0-.095-.027.17.17 0 0 0-.142.068.3.3 0 0 0-.053.193.4.4 0 0 0 .023.139.2.2 0 0 0 .067.083.2.2 0 0 0 .1.027q.063 0 .106-.031a.2.2 0 0 0 .065-.091.2.2 0 0 1 .023-.046q.014-.018.044-.018a.06.06 0 0 1 .044.018.06.06 0 0 1 .019.045' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 7.122 25.977)'/%3E%3Cpath d='M.622-.215a.2.2 0 0 1-.033.117.23.23 0 0 1-.098.081.4.4 0 0 1-.153.029.34.34 0 0 1-.175-.04.23.23 0 0 1-.079-.077.17.17 0 0 1-.031-.093q0-.027.019-.045a.06.06 0 0 1 .046-.019.06.06 0 0 1 .039.014.1.1 0 0 1 .027.044.3.3 0 0 0 .03.057q.015.023.044.038.03.015.076.015.065 0 .105-.03a.09.09 0 0 0 .04-.075.08.08 0 0 0-.022-.058.14.14 0 0 0-.056-.034 1 1 0 0 0-.092-.025.7.7 0 0 1-.129-.042.2.2 0 0 1-.083-.066.17.17 0 0 1-.03-.104q0-.058.032-.105a.2.2 0 0 1 .093-.07.4.4 0 0 1 .144-.025q.066 0 .114.016a.3.3 0 0 1 .08.044.2.2 0 0 1 .046.057q.015.03.015.058a.07.07 0 0 1-.018.046.06.06 0 0 1-.046.021q-.025 0-.038-.012a.2.2 0 0 1-.028-.041.2.2 0 0 0-.047-.063Q.387-.625.326-.625a.15.15 0 0 0-.09.025q-.035.024-.035.059 0 .021.012.037a.1.1 0 0 0 .032.027.4.4 0 0 0 .111.036q.06.015.11.031.048.018.083.042a.2.2 0 0 1 .054.062.2.2 0 0 1 .019.091' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 13.339 25.977)'/%3E%3Cpath d='m.184-.633.162.48.163-.483q.013-.038.019-.053a.062.062 0 0 1 .061-.039q.018 0 .034.009a.1.1 0 0 1 .025.025q.009.015.009.031L.654-.64l-.007.025-.009.024-.173.468-.019.051a.2.2 0 0 1-.021.042.1.1 0 0 1-.033.03.1.1 0 0 1-.049.012.1.1 0 0 1-.05-.011A.1.1 0 0 1 .26-.03a.2.2 0 0 1-.021-.042L.22-.123.05-.587.041-.612.033-.638.03-.662q0-.025.02-.046a.07.07 0 0 1 .05-.02q.037 0 .053.023.015.023.031.072' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 18.94 25.977)'/%3E%3C/svg%3E")}.ag-icon-cut:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M13.775 15.198 3.835 2.945a1.501 1.501 0 0 1 2.33-1.89l14.997 18.488A6.003 6.003 0 0 1 29.657 25c0 3.311-2.688 6-6 6s-6-2.689-6-6c0-1.335.437-2.569 1.176-3.566l-3.127-3.855-3.001 3.7A5.97 5.97 0 0 1 14 25c0 3.311-2.689 6-6 6s-6-2.689-6-6a6.003 6.003 0 0 1 8.315-5.536zm9.882 6.702a3.1 3.1 0 0 0-3.1 3.1c0 1.711 1.389 3.1 3.1 3.1s3.1-1.389 3.1-3.1-1.389-3.1-3.1-3.1M8 21.95a3.05 3.05 0 1 0 .001 6.101A3.05 3.05 0 0 0 8 21.95m9.63-11.505 1.932 2.381 8.015-9.881a1.5 1.5 0 0 0-2.329-1.89z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-desc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-adesc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M10.387 11.47a.75.75 0 0 1 1.06 1.06l-3 3-.113.093a.75.75 0 0 1-.919-.065l-3.333-3a.75.75 0 0 1 1.003-1.116l2.806 2.525zM13.201 3.08q.65 0 1.135.222.487.223.759.619.27.396.279.918H14.19a.72.72 0 0 0-.293-.536q-.26-.192-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125a3.7 3.7 0 0 1 .701.229q.32.143.554.35.234.21.362.492.131.282.134.647a1.6 1.6 0 0 1-.273.93 1.74 1.74 0 0 1-.777.607q-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.641q-.29-.429-.305-1.059h1.194q.02.294.17.49.15.195.402.294.253.098.573.098.313 0 .544-.092a.84.84 0 0 0 .362-.254.6.6 0 0 0 .129-.373.5.5 0 0 0-.117-.33.9.9 0 0 0-.337-.23 3.4 3.4 0 0 0-.54-.17l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.926q.287-.396.79-.62a2.8 2.8 0 0 1 1.14-.222'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 9H4.489l-.432-1.332H1.948L1.515 9H.19l2.017-5.84h1.592zM2.262 6.704h1.481l-.718-2.21H2.98zM8.452 3.16q.645 0 1.075.19.43.192.648.53a1.4 1.4 0 0 1 .217.776q0 .342-.137.602a1.2 1.2 0 0 1-.376.423 1.6 1.6 0 0 1-.542.23v.058q.333.014.624.187.294.175.476.489.183.31.183.74 0 .465-.231.83a1.56 1.56 0 0 1-.676.574Q9.265 9 8.609 9H6.114V3.16zM7.35 7.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.291 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.397.64.64 0 0 0-.226-.51q-.223-.194-.633-.194H7.35z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-excel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='m.052-.139.16-.234-.135-.208a.4.4 0 0 1-.028-.052.1.1 0 0 1-.01-.042.05.05 0 0 1 .018-.037.07.07 0 0 1 .045-.016q.03 0 .047.018a1 1 0 0 1 .047.066l.107.174.115-.174.024-.038.019-.026.021-.015a.1.1 0 0 1 .027-.005.06.06 0 0 1 .044.016.05.05 0 0 1 .018.039q0 .033-.038.089l-.141.211.152.234a.3.3 0 0 1 .03.051.1.1 0 0 1 .009.038.1.1 0 0 1-.008.031.1.1 0 0 1-.024.023.1.1 0 0 1-.034.008.1.1 0 0 1-.035-.008.1.1 0 0 1-.023-.022L.427-.067.301-.265l-.134.204-.022.034-.016.019a.1.1 0 0 1-.022.015.1.1 0 0 1-.03.005.06.06 0 0 1-.044-.016.06.06 0 0 1-.017-.047q0-.036.036-.088' style='fill-rule:nonzero' transform='matrix(17.82892 0 0 16.50777 10.371 25.928)'/%3E%3C/svg%3E")}.ag-icon-expanded:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M20 26 10 16 20 6l2 2-8 8 8 8z'/%3E%3C/svg%3E")}.ag-icon-eye-slash:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye-slash%3C/title%3E%3Cpath fill='%23000' fill-rule='nonzero' d='M8.95 10.364 7 8.414 8.414 7l2.32 2.32A13.2 13.2 0 0 1 16.5 8c5.608 0 10.542 3.515 12.381 8.667L29 17l-.119.333a13 13 0 0 1-4.255 5.879l1.466 1.466-1.414 1.414-1.754-1.753A13.2 13.2 0 0 1 16.5 26c-5.608 0-10.542-3.515-12.381-8.667L4 17l.119-.333a13 13 0 0 1 4.83-6.303m1.445 1.445A11.02 11.02 0 0 0 6.148 17c1.646 4.177 5.728 7 10.352 7 1.76 0 3.441-.409 4.94-1.146l-1.878-1.878A5.06 5.06 0 0 1 16.5 22c-2.789 0-5.05-2.239-5.05-5 0-1.158.398-2.223 1.065-3.07zm1.855-.974 1.794 1.795A5.07 5.07 0 0 1 16.5 12c2.789 0 5.05 2.239 5.05 5 0 .9-.24 1.745-.661 2.474l2.305 2.306A11 11 0 0 0 26.852 17c-1.646-4.177-5.728-7-10.352-7-1.495 0-2.933.295-4.25.835'/%3E%3C/svg%3E")}.ag-icon-eye:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M16.5 23c4.624 0 8.706-2.823 10.352-7-1.646-4.177-5.728-7-10.352-7s-8.706 2.823-10.352 7c1.646 4.177 5.728 7 10.352 7M4.119 15.667C5.958 10.515 10.892 7 16.5 7s10.542 3.515 12.381 8.667L29 16l-.119.333C27.042 21.485 22.108 25 16.5 25S5.958 21.485 4.119 16.333L4 16zM16.5 21c2.789 0 5.049-2.239 5.049-5s-2.26-5-5.049-5-5.049 2.239-5.049 5 2.26 5 5.049 5' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-filter:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m28 8-8 8v5l-6 6V16L6 8V6h22zM9 8l7 7v7l2-2v-5l7-7z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-first:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M24.273 22.12 18.153 16l6.12-6.12L22.393 8l-8 8 8 8zM7.727 8h2.667v16H7.727z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-group:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M14 7v1H9V7zm0-3v1H5.001V4zm-7 7H5v-1h2zm0-3H5V7h2zM3 5H1V4h2zm11 5v1H9v-1zm-7 4H5v-1h2zm7-1v1H9v-1z' style='fill-rule:nonzero' transform='matrix(2 0 0 2 0 -2)'/%3E%3C/svg%3E")}.ag-icon-last:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m7.727 9.88 6.12 6.12-6.12 6.12L9.607 24l8-8-8-8zM21.607 8h2.667v16h-2.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M26.667 14.667H10.44l7.453-7.453L16 5.334 5.333 16.001 16 26.668l1.88-1.88-7.44-7.453h16.227z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-linked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M5.2 16a4.136 4.136 0 0 1 4.133-4.133h5.333V9.334H9.333a6.67 6.67 0 0 0-6.667 6.667 6.67 6.67 0 0 0 6.667 6.667h5.333v-2.533H9.333A4.136 4.136 0 0 1 5.2 16.002zm5.467 1.333h10.667v-2.667H10.667zm12-8h-5.333v2.533h5.333a4.136 4.136 0 0 1 4.133 4.133 4.136 4.136 0 0 1-4.133 4.133h-5.333v2.533h5.333a6.67 6.67 0 0 0 6.667-6.667 6.67 6.67 0 0 0-6.667-6.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-loading:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M17 29h-2v-8h2zm-3.586-9L7 26.414 5.586 25 12 18.586zm13 5L25 26.414 18.586 20 20 18.586zM29 17h-8v-2h8zm-18 0H3v-2h8zm2.414-5L12 13.414 5.586 7 7 5.586zm13-5L20 13.414 18.586 12 25 5.586zM17 11h-2V3h2z' style='fill-rule:nonzero' transform='translate(-3.692 -3.692)scale(1.23077)'/%3E%3C/svg%3E")}.ag-icon-maximize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M14 30H2V18h2.828v7.05l8.254-8.252 2.12 2.12-8.252 8.254H14zm4-28h12v12h-2.828V6.95l-8.254 8.252-2.12-2.12 8.252-8.254H18z'/%3E%3C/svg%3E")}.ag-icon-menu:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M20 13H0v-2h20zm0-6H0V5h20zm0-6H0v-2h20z' style='fill-rule:nonzero' transform='translate(6 9)'/%3E%3C/svg%3E")}.ag-icon-menu-alt:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M16 19a3 3 0 1 0 0-6 3 3 0 0 0 0 6M16 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6M16 27a3 3 0 1 0 0-6 3 3 0 0 0 0 6'/%3E%3C/svg%3E")}.ag-icon-minimize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M2 18h12v12h-2.828v-7.05l-8.254 8.252-2.12-2.12 8.252-8.254H2zm28-4H18V2h2.828v7.05L29.082.798l2.12 2.12-8.252 8.254H30z'/%3E%3C/svg%3E")}.ag-icon-minus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658H7.901v-2.658z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-next:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M10.94 6 9.06 7.88 17.167 16 9.06 24.12 10.94 26l10-10z' style='fill-rule:nonzero' transform='translate(1)'/%3E%3C/svg%3E")}.ag-icon-none:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enone%3C/title%3E%3Cg fill='%23000' fill-rule='nonzero'%3E%3Cpath d='M23.708 14.645 16 6.939l-7.708 7.706 1.416 1.416L16 9.767l6.292 6.294zM23.708 20.355 16 28.061l-7.708-7.706 1.416-1.416L16 25.233l6.292-6.294z'/%3E%3C/g%3E%3C/svg%3E")}.ag-icon-not-allowed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M16 2.667C8.64 2.667 2.667 8.64 2.667 16S8.64 29.333 16 29.333 29.333 23.36 29.333 16 23.36 2.667 16 2.667M5.333 16c0-5.893 4.773-10.667 10.667-10.667 2.467 0 4.733.84 6.533 2.253L7.586 22.533A10.54 10.54 0 0 1 5.333 16M16 26.667c-2.467 0-4.733-.84-6.533-2.253L24.414 9.467A10.54 10.54 0 0 1 26.667 16c0 5.893-4.773 10.667-10.667 10.667' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-paste:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M25.334 4H19.76C19.2 2.453 17.733 1.333 16 1.333S12.8 2.453 12.24 4H6.667A2.675 2.675 0 0 0 4 6.667V28c0 1.467 1.2 2.667 2.667 2.667h18.667c1.467 0 2.667-1.2 2.667-2.667V6.667C28.001 5.2 26.801 4 25.334 4M16 4c.733 0 1.333.6 1.333 1.333s-.6 1.333-1.333 1.333-1.333-.6-1.333-1.333S15.267 4 16 4m9.333 24H6.666V6.667h2.667v4h13.333v-4h2.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m10.78 19.777-4.668-4.666s.032-1 .67-1.87c1.366-1.86 4.052-1.96 6.056-1.572l3.158-3.108c-.7-2.342 3.352-5.046 3.352-5.046l9.166 9.168q-.334.447-.67.894c-1.074 1.426-2.538 2.63-4.272 2.338l-3.32 3.218c.046.344.042.03.118 1.152.144 2.13-.64 4.324-2.632 5.34l-.746.364-4.798-4.798-7.292 7.294-1.416-1.416zm8.24-13.672c-.688.568-1.416 1.45-1.024 2.072l.49.722-4.986 4.988c-1.988-.506-4.346-.636-5.156.614l9.02 9.032q.14-.099.272-.21c1.226-1.08.764-3.04.498-4.9l4.79-4.79s1.47.938 2.936-.776l-6.79-6.79q-.026.019-.05.038' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-pivot:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0m2.966 7.954H9.892v18.136c5.086.13 10.18.098 15.264-.096 1.48-.094 2.746-1.35 2.84-2.84.192-5.064.226-10.134.098-15.2M3.968 24.1q.015.528.036 1.056c.094 1.484 1.354 2.746 2.84 2.84l1.012.036V24.1zM22 15.414l-.292.294-1.416-1.416L23 11.586l2.708 2.706-1.416 1.416-.292-.294v3.592c-.032 2.604-2.246 4.892-4.872 4.992L15.414 24l.294.292-1.416 1.416L11.586 23l2.706-2.708 1.416 1.416-.322.32c3.372.03 6.578-.164 6.614-3.034zM3.88 18.038c.002 1.346.012 2.694.038 4.04h3.938v-4.04zm.05-6.062a681 681 0 0 0-.044 4.042h3.97v-4.042zm5.962-7.99Q8.449 3.999 7.006 4c-1.57.02-2.946 1.348-3.004 2.922q-.02 1.517-.042 3.034h3.896v-2.02h2.036zm14.244-.016v3.966h3.898q-.017-.546-.038-1.092c-.094-1.48-1.35-2.746-2.84-2.84q-.51-.019-1.02-.034m-8.14-.054q-2.035.022-4.07.048v3.972h4.07zm6.106.008a213 213 0 0 0-4.07-.022v4.034h4.07z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-plus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658h-6.77v6.77h-2.658v-6.77h-6.77v-2.658h6.77v-6.77h2.658v6.77z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-previous:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M21.94 7.88 20.06 6l-10 10 10 10 1.88-1.88L13.833 16z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m16 5.333-1.88 1.88 7.44 7.453H5.333v2.667H21.56l-7.44 7.453 1.88 1.88 10.667-10.667L16 5.332z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-save:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M15.708 2.355 8 10.061.292 2.355 1.708.939 8 7.233 14.292.939z' style='fill-rule:nonzero' transform='translate(8 14)'/%3E%3Cpath d='M5 26h22v2H5zM15 4h2v18h-2z'/%3E%3C/svg%3E")}.ag-icon-small-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.334 10.667 16 21.334l8.667-10.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-small-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M21.333 7.334 10.666 16l10.667 8.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-small-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M10.667 24.666 21.334 16 10.667 7.333z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-small-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.334 21.333 16 10.666l8.667 10.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-tick:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M11.586 22.96 27.718 6.828 29.84 8.95 11.586 27.202 2.4 18.016l2.12-2.122z'/%3E%3C/svg%3E")}.ag-icon-tree-closed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m11.94 6-1.88 1.88L18.167 16l-8.107 8.12L11.94 26l10-10z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-tree-indeterminate:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6 13.5h20v3H6z'/%3E%3C/svg%3E")}.ag-icon-tree-open:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M24.12 9.06 16 17.167 7.88 9.06 6 10.94l10 10 10-10z' style='fill-rule:nonzero' transform='translate(0 1)'/%3E%3C/svg%3E")}.ag-icon-unlinked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M22.667 9.333h-5.333v2.533h5.333a4.136 4.136 0 0 1 4.133 4.133c0 1.907-1.307 3.507-3.08 3.973l1.947 1.947c2.173-1.107 3.667-3.32 3.667-5.92a6.67 6.67 0 0 0-6.667-6.667zm-1.334 5.334h-2.92l2.667 2.667h.253zM2.667 5.693 6.814 9.84A6.65 6.65 0 0 0 2.667 16a6.67 6.67 0 0 0 6.667 6.667h5.333v-2.533H9.334a4.136 4.136 0 0 1-4.133-4.133c0-2.12 1.613-3.867 3.68-4.093l2.76 2.76h-.973v2.667h3.64l3.027 3.027v2.307h2.307l5.347 5.333 1.68-1.68L4.362 4.002 2.669 5.695z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333 5.332 16z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-grip:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M8 24H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 18H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 12H6V8h2zm6 0h-2V8h2zm6 0h-2V8h2zm6 0h-2V8h2z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-settings:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3M2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3 1.3-3 3-3'/%3E%3C/svg%3E")}.ag-icon-column-arrow:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11 4a1 1 0 0 1 1 1v22a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 13a1 1 0 0 1 1-1h23.5a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 4h18v24H2zm2 2v20h14V6zM26.793 13 23 9.207l1.414-1.414L29.621 13l-5.207 5.207L23 16.793z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-un-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m6.112 15.111 3.272 3.271 1.436-1.402-2.476-2.479c.81-1.25 3.168-1.12 5.156-.614l4.986-4.988-.49-.722c-.392-.622.336-1.504 1.024-2.072l.008-.007.01-.006.032-.025 1.447 1.447 1.432-1.397-2.601-2.602s-4.052 2.704-3.352 5.046l-3.158 3.108c-2.004-.388-4.69-.288-6.056 1.572-.638.87-.67 1.87-.67 1.87m.581 11.582.014.014 5.502-5.501 4.783 4.783.746-.364c1.992-1.016 2.776-3.21 2.632-5.34-.055-.805-.068-.87-.088-.97-.008-.04-.017-.085-.03-.182l3.32-3.218c1.734.292 3.198-.912 4.272-2.338q.337-.447.67-.894l-.001-.001-.007-.007-.007-.007-.007-.007-3.87-3.87 1.585-1.584-1.414-1.414-14.381 14.38-1.237 1.209-5.69 5.687 1.417 1.416zM23.21 10.206l2.65 2.651c-1.465 1.714-2.935.776-2.935.776l-4.79 4.79q.041.291.087.583c.257 1.676.513 3.35-.585 4.317a4 4 0 0 1-.272.21l-3.739-3.744z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-pinned-top:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='m16.708 10.878 8.708 8.706L24 21l-6.292-6.294V27h-2V14.706L9.416 21 8 19.584q4.348-4.344 8.691-8.69zM25 6H8v2h17z'/%3E%3C/svg%3E")}.ag-icon-pinned-bottom:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M16.708 22.122 8 13.416 9.416 12l6.292 6.294V6h2v12.294L24 12l1.416 1.416-8.691 8.69zM7.416 28h17v-2h-17z'/%3E%3C/svg%3E")}.ag-icon-chevron-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3.479 10.521a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1-1.06 1.06l-3.47-3.47-3.47 3.47a.75.75 0 0 1-1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.521 5.461a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 1.06-1.06l3.47 3.47 3.47-3.47a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.53 12.512a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 1.06l-3.47 3.47 3.47 3.47a.75.75 0 0 1 0 1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M5.47 3.47a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06-1.06L8.94 8 5.47 4.53a.75.75 0 0 1 0-1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-filter-add:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M19.834 8H8c0 .304.06.612.258.842 2.716 2.854 6.682 5.548 6.742 7.974V21l2-1.5v-2.684c.056-2.267 2.968-4.417 5.49-6.75v3.087c-1.081.974-2.245 1.968-3.232 3.005a1.05 1.05 0 0 0-.258.682v3.66L13 25c0-2.74.066-5.482-.002-8.222a1.05 1.05 0 0 0-.256-.62C10.026 13.304 6.06 10.61 6 8.184V6h13.834z'/%3E%3Cpath fill='currentColor' d='M26 6h2.946v2.002H26v3.313h-2.002V8.002h-2.946V6h2.946V3.04H26z'/%3E%3C/svg%3E")}.ag-icon-edit:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M6.222 25.778h1.611l14.834-14.811-1.611-1.611-14.834 14.81zM4 28v-4.733L22.644 4.656a2.26 2.26 0 0 1 1.567-.634q.423 0 .833.167.412.166.734.478l1.589 1.6q.333.322.483.733t.15.822q0 .423-.161.839-.162.416-.472.728L8.733 28zm17.856-17.833-.8-.811 1.61 1.61z'/%3E%3C/svg%3E")}`,dw=he({feature:"iconSet",css:UA}),$A=`.ag-icon-aggregation:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eaggregation%3C/title%3E%3Cpath d='M24 5.333H8V8l8.667 8L8 24v2.667h16v-4h-9.333L21.334 16l-6.667-6.667H24z'/%3E%3C/svg%3E")}.ag-icon-arrows:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Earrows%3C/title%3E%3Cpath d='M13.333 11.556h5.333V8h3.556L16 1.778 9.778 8h3.556zm-1.777 1.777H8V9.777l-6.222 6.222L8 22.221v-3.556h3.556zM30.222 16 24 9.778v3.556h-3.556v5.333H24v3.556l6.222-6.222zm-11.555 4.444h-5.333V24H9.778L16 30.222 22.222 24h-3.556z'/%3E%3C/svg%3E")}.ag-icon-asc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333z'/%3E%3C/svg%3E")}.ag-icon-aasc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M13.201 8.08q.65 0 1.135.222.487.222.759.618.27.396.279.919H14.19a.72.72 0 0 0-.293-.536q-.26-.191-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125q.382.086.701.229.32.143.554.35.234.21.362.49.131.284.134.648a1.6 1.6 0 0 1-.273.93q-.27.391-.777.608-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.642q-.29-.428-.305-1.058h1.194q.02.294.17.49.15.195.402.294.253.097.573.097.313 0 .544-.09a.84.84 0 0 0 .362-.255.6.6 0 0 0 .129-.374q0-.195-.117-.33a.9.9 0 0 0-.337-.228 3.4 3.4 0 0 0-.54-.171l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.927q.287-.396.79-.618a2.8 2.8 0 0 1 1.14-.223'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 14H4.489l-.432-1.332H1.948L1.515 14H.19l2.017-5.84h1.592zm-3.551-2.296h1.481l-.718-2.21H2.98zM8.452 8.16q.645 0 1.075.19.43.191.648.531a1.4 1.4 0 0 1 .217.775q0 .343-.137.602-.137.256-.376.422a1.6 1.6 0 0 1-.542.231v.057q.333.015.624.188.294.175.476.489.183.31.183.74 0 .466-.231.831a1.56 1.56 0 0 1-.676.573Q9.265 14 8.609 14H6.114V8.16zM7.35 12.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.29 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.396.64.64 0 0 0-.226-.511q-.223-.195-.633-.194H7.35z' clip-rule='evenodd'/%3E%3Cpath fill='%23000' d='M7.166.377a.75.75 0 0 1 .919.066l3.333 3a.75.75 0 0 1-1.003 1.115L7.609 2.033 5.113 4.53a.75.75 0 0 1-1.06-1.06l3-3z'/%3E%3C/svg%3E")}.ag-icon-cancel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecancel%3C/title%3E%3Cpath d='M16 2.667C8.627 2.667 2.667 8.627 2.667 16S8.627 29.333 16 29.333 29.333 23.373 29.333 16 23.373 2.667 16 2.667m6.667 18.12-1.88 1.88L16 17.88l-4.787 4.787-1.88-1.88L14.12 16l-4.787-4.787 1.88-1.88L16 14.12l4.787-4.787 1.88 1.88L17.88 16z'/%3E%3C/svg%3E")}.ag-icon-chart:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Echart%3C/title%3E%3Cpath d='M6.667 12.267h4v13.067h-4zm7.466-5.6h3.733v18.667h-3.733zM21.6 17.333h3.733v8H21.6z'/%3E%3C/svg%3E")}.ag-icon-color-picker:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolor-picker%3C/title%3E%3Cpath d='M23.907 17.587 10.574 4.254l-1.88 1.88 3.173 3.173-8.28 8.28 10.16 10.16zm-16.547 0 6.387-6.387 6.387 6.387H7.361zm18.387 2s-2.667 2.893-2.667 4.667c0 1.467 1.2 2.667 2.667 2.667s2.667-1.2 2.667-2.667c0-1.773-2.667-4.667-2.667-4.667'/%3E%3C/svg%3E")}.ag-icon-columns:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolumns%3C/title%3E%3Cpath d='M5.333 10.667h5.333V5.334H5.333zm8 16h5.333v-5.333h-5.333zm-8 0h5.333v-5.333H5.333zm0-8h5.333v-5.333H5.333zm8 0h5.333v-5.333h-5.333zm8-13.334v5.333h5.333V5.333zm-8 5.334h5.333V5.334h-5.333zm8 8h5.333v-5.333h-5.333zm0 8h5.333v-5.333h-5.333z'/%3E%3C/svg%3E")}.ag-icon-contracted:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Econtracted%3C/title%3E%3Cpath d='m12.94 8-1.88 1.88L17.167 16l-6.107 6.12L12.94 24l8-8z'/%3E%3C/svg%3E")}.ag-icon-copy:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecopy%3C/title%3E%3Cpath d='M22 1.333H6A2.675 2.675 0 0 0 3.333 4v18.667H6V4h16zm4 5.334H11.333a2.675 2.675 0 0 0-2.667 2.667v18.667c0 1.467 1.2 2.667 2.667 2.667H26c1.467 0 2.667-1.2 2.667-2.667V9.334c0-1.467-1.2-2.667-2.667-2.667M26 28H11.333V9.333H26z'/%3E%3C/svg%3E")}.ag-icon-cross:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecross%3C/title%3E%3Cpath d='m25.333 8.547-1.88-1.88L16 14.12 8.547 6.667l-1.88 1.88L14.12 16l-7.453 7.453 1.88 1.88L16 17.88l7.453 7.453 1.88-1.88L17.88 16z'/%3E%3C/svg%3E")}.ag-icon-csv:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='M.688-.226a.2.2 0 0 1-.017.074.28.28 0 0 1-.145.14.412.412 0 0 1-.234.013.28.28 0 0 1-.202-.168.468.468 0 0 1-.04-.19q0-.086.025-.155a.319.319 0 0 1 .182-.191.4.4 0 0 1 .134-.025q.087 0 .155.035a.3.3 0 0 1 .104.085.17.17 0 0 1 .036.097.06.06 0 0 1-.018.044.06.06 0 0 1-.042.019.06.06 0 0 1-.042-.013.2.2 0 0 1-.031-.046.2.2 0 0 0-.066-.079.16.16 0 0 0-.095-.027.17.17 0 0 0-.142.068.3.3 0 0 0-.053.193.4.4 0 0 0 .023.139.2.2 0 0 0 .067.083.2.2 0 0 0 .1.027q.063 0 .106-.031a.2.2 0 0 0 .065-.091.2.2 0 0 1 .023-.046q.014-.018.044-.018a.06.06 0 0 1 .044.018.06.06 0 0 1 .019.045' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 7.122 25.977)'/%3E%3Cpath d='M.622-.215a.2.2 0 0 1-.033.117.23.23 0 0 1-.098.081.4.4 0 0 1-.153.029.34.34 0 0 1-.175-.04.23.23 0 0 1-.079-.077.17.17 0 0 1-.031-.093q0-.027.019-.045a.06.06 0 0 1 .046-.019.06.06 0 0 1 .039.014.1.1 0 0 1 .027.044.3.3 0 0 0 .03.057q.015.023.044.038.03.015.076.015.065 0 .105-.03a.09.09 0 0 0 .04-.075.08.08 0 0 0-.022-.058.14.14 0 0 0-.056-.034 1 1 0 0 0-.092-.025.7.7 0 0 1-.129-.042.2.2 0 0 1-.083-.066.17.17 0 0 1-.03-.104q0-.058.032-.105a.2.2 0 0 1 .093-.07.4.4 0 0 1 .144-.025q.066 0 .114.016a.3.3 0 0 1 .08.044.2.2 0 0 1 .046.057q.015.03.015.058a.07.07 0 0 1-.018.046.06.06 0 0 1-.046.021q-.025 0-.038-.012a.2.2 0 0 1-.028-.041.2.2 0 0 0-.047-.063Q.387-.625.326-.625a.15.15 0 0 0-.09.025q-.035.024-.035.059 0 .021.012.037a.1.1 0 0 0 .032.027.4.4 0 0 0 .111.036q.06.015.11.031.048.018.083.042a.2.2 0 0 1 .054.062.2.2 0 0 1 .019.091' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 13.339 25.977)'/%3E%3Cpath d='m.184-.633.162.48.163-.483q.013-.038.019-.053a.062.062 0 0 1 .061-.039q.018 0 .034.009a.1.1 0 0 1 .025.025q.009.015.009.031L.654-.64l-.007.025-.009.024-.173.468-.019.051a.2.2 0 0 1-.021.042.1.1 0 0 1-.033.03.1.1 0 0 1-.049.012.1.1 0 0 1-.05-.011A.1.1 0 0 1 .26-.03a.2.2 0 0 1-.021-.042L.22-.123.05-.587.041-.612.033-.638.03-.662q0-.025.02-.046a.07.07 0 0 1 .05-.02q.037 0 .053.023.015.023.031.072' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 18.94 25.977)'/%3E%3C/svg%3E")}.ag-icon-cut:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m19 3-6 6 2 2 7-7V3m-10 9.5a.503.503 0 0 1-.5-.5c0-.274.226-.5.5-.5s.5.226.5.5-.226.5-.5.5M6 20c-1.097 0-2-.903-2-2a2 2 0 0 1 2-2c1.097 0 2 .903 2 2a2 2 0 0 1-2 2M6 8c-1.097 0-2-.903-2-2a2 2 0 0 1 2-2c1.097 0 2 .903 2 2a2 2 0 0 1-2 2m3.64-.36c.23-.5.36-1.05.36-1.64 0-2.194-1.806-4-4-4S2 3.806 2 6s1.806 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.194 0-4 1.806-4 4s1.806 4 4 4 4-1.806 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1z' style='fill-rule:nonzero' transform='translate(4 4)'/%3E%3C/svg%3E")}.ag-icon-desc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667L26.668 16z'/%3E%3C/svg%3E")}.ag-icon-adesc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M10.387 11.47a.75.75 0 0 1 1.06 1.06l-3 3-.113.093a.75.75 0 0 1-.919-.065l-3.333-3a.75.75 0 0 1 1.003-1.116l2.806 2.525zM13.201 3.08q.65 0 1.135.222.487.223.759.619.27.396.279.918H14.19a.72.72 0 0 0-.293-.536q-.26-.192-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125a3.7 3.7 0 0 1 .701.229q.32.143.554.35.234.21.362.492.131.282.134.647a1.6 1.6 0 0 1-.273.93 1.74 1.74 0 0 1-.777.607q-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.641q-.29-.429-.305-1.059h1.194q.02.294.17.49.15.195.402.294.253.098.573.098.313 0 .544-.092a.84.84 0 0 0 .362-.254.6.6 0 0 0 .129-.373.5.5 0 0 0-.117-.33.9.9 0 0 0-.337-.23 3.4 3.4 0 0 0-.54-.17l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.926q.287-.396.79-.62a2.8 2.8 0 0 1 1.14-.222'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 9H4.489l-.432-1.332H1.948L1.515 9H.19l2.017-5.84h1.592zM2.262 6.704h1.481l-.718-2.21H2.98zM8.452 3.16q.645 0 1.075.19.43.192.648.53a1.4 1.4 0 0 1 .217.776q0 .342-.137.602a1.2 1.2 0 0 1-.376.423 1.6 1.6 0 0 1-.542.23v.058q.333.014.624.187.294.175.476.489.183.31.183.74 0 .465-.231.83a1.56 1.56 0 0 1-.676.574Q9.265 9 8.609 9H6.114V3.16zM7.35 7.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.291 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.397.64.64 0 0 0-.226-.51q-.223-.194-.633-.194H7.35z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667L26.668 16z'/%3E%3C/svg%3E")}.ag-icon-excel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='m.052-.139.16-.234-.135-.208a.4.4 0 0 1-.028-.052.1.1 0 0 1-.01-.042.05.05 0 0 1 .018-.037.07.07 0 0 1 .045-.016q.03 0 .047.018a1 1 0 0 1 .047.066l.107.174.115-.174.024-.038.019-.026.021-.015a.1.1 0 0 1 .027-.005.06.06 0 0 1 .044.016.05.05 0 0 1 .018.039q0 .033-.038.089l-.141.211.152.234a.3.3 0 0 1 .03.051.1.1 0 0 1 .009.038.1.1 0 0 1-.008.031.1.1 0 0 1-.024.023.1.1 0 0 1-.034.008.1.1 0 0 1-.035-.008.1.1 0 0 1-.023-.022L.427-.067.301-.265l-.134.204-.022.034-.016.019a.1.1 0 0 1-.022.015.1.1 0 0 1-.03.005.06.06 0 0 1-.044-.016.06.06 0 0 1-.017-.047q0-.036.036-.088' style='fill-rule:nonzero' transform='matrix(17.82892 0 0 16.50777 10.371 25.928)'/%3E%3C/svg%3E")}.ag-icon-expanded:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eexpanded%3C/title%3E%3Cpath d='M20.94 9.88 19.06 8l-8 8 8 8 1.88-1.88L14.833 16z'/%3E%3C/svg%3E")}.ag-icon-eye-slash:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye-slash%3C/title%3E%3Cpath d='M21.106 15.088A5.19 5.19 0 0 0 16 10.814a5.17 5.17 0 0 0-3.668 1.522L9.866 9.868a12.2 12.2 0 0 1 6.133-1.646c5.186 0 9.614 3.225 11.408 7.778a12.34 12.34 0 0 1-5.276 6.133l-2.468-2.466a5.17 5.17 0 0 0 1.449-2.802h-2.123c-.148.508-.42.964-.782 1.33l-1.33-1.33h-2.514l2.196 2.196q-.272.049-.56.05a3.11 3.11 0 0 1-2.99-2.245h-2.123a5.19 5.19 0 0 0 7.3 3.836l2.247 2.247a12.2 12.2 0 0 1-4.434.828c-5.186 0-9.614-3.225-11.408-7.778a12.3 12.3 0 0 1 3.781-5.111l2.924 2.924a5.1 5.1 0 0 0-.404 1.275h4.206l-1.296-1.296a3.1 3.1 0 0 1 2.196-.903c1.404 0 2.587.924 2.976 2.199h2.13z'/%3E%3C/svg%3E")}.ag-icon-eye:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye%3C/title%3E%3Cpath d='M16 8.222c-5.186 0-9.614 3.225-11.408 7.778 1.794 4.553 6.222 7.778 11.408 7.778S25.614 20.553 27.408 16C25.614 11.447 21.186 8.222 16 8.222m0 12.964c-2.862 0-5.186-2.324-5.186-5.186s2.324-5.186 5.186-5.186 5.186 2.324 5.186 5.186-2.324 5.186-5.186 5.186m0-8.297c-1.721 0-3.111 1.39-3.111 3.111s1.39 3.111 3.111 3.111 3.111-1.39 3.111-3.111-1.39-3.111-3.111-3.111'/%3E%3C/svg%3E")}.ag-icon-filter:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efilter%3C/title%3E%3Cpath d='M13.333 24h5.333v-2.667h-5.333zM4 8v2.667h24V8zm4 9.333h16v-2.667H8z'/%3E%3C/svg%3E")}.ag-icon-first:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efirst%3C/title%3E%3Cpath d='M24.273 22.12 18.153 16l6.12-6.12L22.393 8l-8 8 8 8zM7.727 8h2.667v16H7.727z'/%3E%3C/svg%3E")}.ag-icon-group:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egroup%3C/title%3E%3Cpath d='M18.667 21.333h8.889A3.555 3.555 0 0 1 24 24.889h-5.333zm8.888-7.111v3.556h-8.889v-3.556zM24 7.111a3.555 3.555 0 0 1 3.556 3.556h-16V7.111zm-8.889 17.778h-3.556v-3.556h3.556zm0-7.111h-3.556v-3.556h3.556zM8 10.667H4.444A3.555 3.555 0 0 1 8 7.111z'/%3E%3C/svg%3E")}.ag-icon-last:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elast%3C/title%3E%3Cpath d='m7.727 9.88 6.12 6.12-6.12 6.12L9.607 24l8-8-8-8zM21.607 8h2.667v16h-2.667z'/%3E%3C/svg%3E")}.ag-icon-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eleft%3C/title%3E%3Cpath d='M26.667 14.667H10.44l7.453-7.453L16 5.334 5.333 16.001 16 26.668l1.88-1.88-7.44-7.453h16.227v-2.667z'/%3E%3C/svg%3E")}.ag-icon-linked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elinked%3C/title%3E%3Cpath d='M5.2 16a4.136 4.136 0 0 1 4.133-4.133h5.333V9.334H9.333c-3.68 0-6.667 2.987-6.667 6.667s2.987 6.667 6.667 6.667h5.333v-2.533H9.333A4.136 4.136 0 0 1 5.2 16.002zm5.467 1.333h10.667v-2.667H10.667zm12-8h-5.333v2.533h5.333c2.28 0 4.133 1.853 4.133 4.133s-1.853 4.133-4.133 4.133h-5.333v2.533h5.333c3.68 0 6.667-2.987 6.667-6.667s-2.987-6.667-6.667-6.667z'/%3E%3C/svg%3E")}.ag-icon-loading:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eloading%3C/title%3E%3Cpath d='m17.778 11.708 3.25-3.251 2.516 2.516-3.251 3.25h4.597v3.556h-4.597l3.251 3.25-2.516 2.516-3.25-3.251v4.597h-3.556v-4.597l-3.25 3.251-2.516-2.516 3.251-3.25H7.11v-3.556h4.597l-3.251-3.25 2.516-2.516 3.25 3.251V7.111h3.556zm-3.251 7.847h2.944l2.084-2.084v-2.944l-2.084-2.084h-2.944l-2.084 2.084v2.944z'/%3E%3C/svg%3E")}.ag-icon-maximize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Emaximize%3C/title%3E%3Cpath d='M4 4h24v2.667H4z'/%3E%3C/svg%3E")}.ag-icon-menu:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Emenu%3C/title%3E%3Cpath d='M4 24h24v-2.667H4zm0-6.667h24v-2.667H4zM4 8v2.667h24V8z'/%3E%3C/svg%3E")}.ag-icon-menu-alt:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M16 26.667a2.57 2.57 0 0 1-1.883-.784A2.57 2.57 0 0 1 13.333 24q0-1.1.784-1.883A2.57 2.57 0 0 1 16 21.333q1.1 0 1.883.784.784.783.784 1.883t-.784 1.883a2.57 2.57 0 0 1-1.883.784m0-8a2.57 2.57 0 0 1-1.883-.784A2.57 2.57 0 0 1 13.333 16q0-1.1.784-1.883A2.57 2.57 0 0 1 16 13.333q1.1 0 1.883.784.784.783.784 1.883t-.784 1.883a2.57 2.57 0 0 1-1.883.784m0-8a2.57 2.57 0 0 1-1.883-.784A2.57 2.57 0 0 1 13.333 8q0-1.1.784-1.883A2.57 2.57 0 0 1 16 5.333q1.1 0 1.883.784.784.783.784 1.883t-.784 1.883a2.57 2.57 0 0 1-1.883.784'/%3E%3C/svg%3E")}.ag-icon-minimize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eminimize%3C/title%3E%3Cpath d='M8 25.333h16V28H8z'/%3E%3C/svg%3E")}.ag-icon-minus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658H7.901v-2.658z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-next:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enext%3C/title%3E%3Cpath d='m12.94 8-1.88 1.88L17.167 16l-6.107 6.12L12.94 24l8-8z'/%3E%3C/svg%3E")}.ag-icon-none:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enone%3C/title%3E%3Cpath d='M4 24h16v-2.667H4zM4 8v2.667h24V8zm0 9.333h24v-2.667H4z'/%3E%3C/svg%3E")}.ag-icon-not-allowed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enot-allowed%3C/title%3E%3Cpath d='M16 2.667C8.64 2.667 2.667 8.64 2.667 16S8.64 29.333 16 29.333 29.333 23.36 29.333 16 23.36 2.667 16 2.667M5.333 16c0-5.893 4.773-10.667 10.667-10.667 2.467 0 4.733.84 6.533 2.253L7.586 22.533A10.54 10.54 0 0 1 5.333 16M16 26.667c-2.467 0-4.733-.84-6.533-2.253L24.414 9.467A10.54 10.54 0 0 1 26.667 16c0 5.893-4.773 10.667-10.667 10.667'/%3E%3C/svg%3E")}.ag-icon-paste:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epaste%3C/title%3E%3Cpath d='M25.333 4H19.76C19.2 2.453 17.733 1.333 16 1.333S12.8 2.453 12.24 4H6.667A2.675 2.675 0 0 0 4 6.667V28c0 1.467 1.2 2.667 2.667 2.667h18.667c1.467 0 2.667-1.2 2.667-2.667V6.667C28.001 5.2 26.801 4 25.334 4zM16 4c.733 0 1.333.6 1.333 1.333s-.6 1.333-1.333 1.333-1.333-.6-1.333-1.333S15.267 4 16 4m9.333 24H6.666V6.667h2.667v4h13.333v-4h2.667z'/%3E%3C/svg%3E")}.ag-icon-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epin%3C/title%3E%3Cpath d='m11.106 22.093-4.444 4.444-1.259-1.259 4.444-4.444zm5.872-16.63 9.618 9.62-.962.962-.962-.962-7.694 3.847 1.924 1.924-2.74 2.74-7.696-7.696 2.741-2.74 1.924 1.925 3.847-7.696-.962-.962z'/%3E%3C/svg%3E")}.ag-icon-pivot:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epivot%3C/title%3E%3Cpath d='M26.667 30.223H5.334a3.556 3.556 0 0 1-3.556-3.556V5.334a3.556 3.556 0 0 1 3.556-3.556h21.333a3.556 3.556 0 0 1 3.556 3.556v21.333a3.556 3.556 0 0 1-3.556 3.556m-16-8.89H5.334v5.333h5.333zm16-7.11H12.444v12.444h14.223zm-9.15 6.85-2.039 2.037 2.039 2.039-1.257 1.257-3.295-3.296 3.295-3.295q.63.628 1.257 1.257zm-6.85-6.85H5.334v5.333h5.333zm15.74 3.816-1.257 1.256-2.039-2.037-2.037 2.037-1.257-1.256 3.295-3.296zM10.667 5.333H5.334v5.333h5.333zm8.889 0h-7.112v5.333h7.112zm7.111 0h-5.333v5.333h5.333z'/%3E%3C/svg%3E")}.ag-icon-plus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658h-6.77v6.77h-2.658v-6.77h-6.77v-2.658h6.77v-6.77h2.658v6.77z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-previous:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eprevious%3C/title%3E%3Cpath d='M20.94 9.88 19.06 8l-8 8 8 8 1.88-1.88L14.833 16z'/%3E%3C/svg%3E")}.ag-icon-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eright%3C/title%3E%3Cpath d='m16 5.333-1.88 1.88 7.44 7.453H5.333v2.667H21.56l-7.44 7.453 1.88 1.88 10.667-10.667L16 5.332z'/%3E%3C/svg%3E")}.ag-icon-save:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esave%3C/title%3E%3Cpath d='M25.333 16v9.333H6.666V16H3.999v9.333C3.999 26.8 5.199 28 6.666 28h18.667C26.8 28 28 26.8 28 25.333V16zm-8 .893 3.453-3.44 1.88 1.88L15.999 22l-6.667-6.667 1.88-1.88 3.453 3.44V4h2.667v12.893z'/%3E%3C/svg%3E")}.ag-icon-small-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-down%3C/title%3E%3Cpath d='M9.333 12.667 16 19.334l6.667-6.667H9.334z'/%3E%3C/svg%3E")}.ag-icon-small-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-left%3C/title%3E%3Cpath d='M19.333 9.333 12.666 16l6.667 6.667V9.334z'/%3E%3C/svg%3E")}.ag-icon-small-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-right%3C/title%3E%3Cpath d='M12.667 22.667 19.334 16l-6.667-6.667v13.333z'/%3E%3C/svg%3E")}.ag-icon-small-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-up%3C/title%3E%3Cpath d='M9.333 19.333 16 12.666l6.667 6.667H9.334z'/%3E%3C/svg%3E")}.ag-icon-tick:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etick%3C/title%3E%3Cpath d='m11.727 21.167-5.56-5.56-1.893 1.88 7.453 7.453 16-16-1.88-1.88z'/%3E%3C/svg%3E")}.ag-icon-tree-closed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-closed%3C/title%3E%3Cpath d='m12.94 8-1.88 1.88L17.167 16l-6.107 6.12L12.94 24l8-8z'/%3E%3C/svg%3E")}.ag-icon-tree-indeterminate:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-indeterminate%3C/title%3E%3Cpath d='M6.667 14.667h18.667v2.667H6.667z'/%3E%3C/svg%3E")}.ag-icon-tree-open:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-open%3C/title%3E%3Cpath d='M22.12 11.06 16 17.167 9.88 11.06 8 12.94l8 8 8-8z'/%3E%3C/svg%3E")}.ag-icon-unlinked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eunlinked%3C/title%3E%3Cpath d='M22.667 9.333h-5.333v2.533h5.333a4.136 4.136 0 0 1 4.133 4.133c0 1.907-1.307 3.507-3.08 3.973l1.947 1.947c2.173-1.107 3.667-3.32 3.667-5.92a6.67 6.67 0 0 0-6.667-6.667zm-1.334 5.334h-2.92l2.667 2.667h.253zM2.667 5.693 6.814 9.84A6.65 6.65 0 0 0 2.667 16a6.67 6.67 0 0 0 6.667 6.667h5.333v-2.533H9.334a4.136 4.136 0 0 1-4.133-4.133c0-2.12 1.613-3.867 3.68-4.093l2.76 2.76h-.973v2.667h3.64l3.027 3.027v2.307h2.307l5.347 5.333 1.68-1.68L4.362 4.002 2.669 5.695z'/%3E%3C/svg%3E")}.ag-icon-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333z'/%3E%3C/svg%3E")}.ag-icon-grip:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egrip%3C/title%3E%3Cpath d='M26.667 12H5.334v2.667h21.333zM5.333 20h21.333v-2.667H5.333z'/%3E%3C/svg%3E")}.ag-icon-settings:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3M2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3 1.3-3 3-3'/%3E%3C/svg%3E")}.ag-icon-column-arrow:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11 4a1 1 0 0 1 1 1v22a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 13a1 1 0 0 1 1-1h23.5a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 4h18v24H2zm2 2v20h14V6zM26.793 13 23 9.207l1.414-1.414L29.621 13l-5.207 5.207L23 16.793z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-un-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M8 11a.75.75 0 0 0-.75.75v3.333a.75.75 0 1 0 1.5 0V11.75A.75.75 0 0 0 8 11'/%3E%3Cpath fill='currentColor' d='M13.11 1.436a.75.75 0 0 0-1.22-.872l-10 14a.75.75 0 1 0 1.22.872L5.207 12.5h7.376a.75.75 0 0 0 .75-.75v-1.174a2.08 2.08 0 0 0-1.153-1.863l-1.185-.599-.005-.002a.58.58 0 0 1-.323-.522V5.165a2.083 2.083 0 0 0 1.854-2.904zm-3.943 5.52v.634a2.08 2.08 0 0 0 1.153 1.863l1.185.6.005.002a.58.58 0 0 1 .323.522V11H6.28zM9.277 1H5.25a2.084 2.084 0 0 0-.083 4.165v1.676l1.5-2.132v-.292a.75.75 0 0 0-.75-.75H5.25a.584.584 0 0 1 0-1.167h2.972z'/%3E%3C/svg%3E")}.ag-icon-pinned-top:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M12.53 3.72A.75.75 0 0 1 12 5H4a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 .53.22M3.269 10.744a.75.75 0 0 1 .2-.524l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 1 1-1.06 1.06L8.75 8.56V14a.75.75 0 0 1-1.5 0V8.56l-2.72 2.72a.75.75 0 0 1-1.26-.536'/%3E%3C/svg%3E")}.ag-icon-pinned-bottom:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M3.47 12.28A.75.75 0 0 1 4 11h8a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1-.53-.22M12.731 5.256a.75.75 0 0 1-.2.524l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06l2.72 2.72V2a.75.75 0 0 1 1.5 0v5.44l2.72-2.72a.75.75 0 0 1 1.26.536'/%3E%3C/svg%3E")}.ag-icon-chevron-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3.479 10.521a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1-1.06 1.06l-3.47-3.47-3.47 3.47a.75.75 0 0 1-1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.521 5.461a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 1.06-1.06l3.47 3.47 3.47-3.47a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.53 12.512a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 1.06l-3.47 3.47 3.47 3.47a.75.75 0 0 1 0 1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M5.47 3.47a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06-1.06L8.94 8 5.47 4.53a.75.75 0 0 1 0-1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-filter-add:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M18.666 24h-5.333v-2.667h5.333zM24 17.333H8v-2.667h16zm3.59-9.344h3.221v2.657h-3.22v3.22h-2.656v-3.22h-3.221V7.989h3.22V4.77h2.657zm-8.582 2.678H4V8h15.008z'/%3E%3C/svg%3E")}.ag-icon-edit:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M6.222 25.778h1.611l14.834-14.811-1.611-1.611-14.834 14.81zM4 28v-4.733L22.644 4.656a2.26 2.26 0 0 1 1.567-.634q.423 0 .833.167.412.166.734.478l1.589 1.6q.333.322.483.733t.15.822q0 .423-.161.839-.162.416-.472.728L8.733 28zm17.856-17.833-.8-.811 1.61 1.61z'/%3E%3C/svg%3E")}`,uw=he({feature:"iconSet",css:$A}),KA=e=>{const t=[];if(e.type==="image"){const{icons:s,mask:i}=e;for(const r of Object.keys(s)){const o=Lh(s[r]);i?t.push(`.ag-icon-${r}::before { mask-image: ${o}; }`):t.push(`.ag-icon-${r}::before { background-image: ${o}; ${hw} }`)}}if(e.type==="font"){const{family:s,weight:i,color:r,icons:o}=e;let n=hw;s&&(n+=` font-family: ${kh(s)};`),i&&(n+=` font-weight: ${Yv(i)};`),r&&(n+=` color: ${Ql(r)};`);for(const a of Object.keys(o))t.push(`.ag-icon-${a}::before { content: ${JSON.stringify(o[a])}; ${n} }`)}return he({css:t.join(`; `),cssImports:e.cssImports})},hw="background-color: unset; mask-image: unset; -webkit-mask-image: unset;",gw={aggregation:'',arrows:'',asc:'',cancel:'',chart:'',"color-picker":'',columns:'',contracted:'',copy:'',cross:'',csv:'',cut:'',desc:'',down:'',excel:'',expanded:'',eye:'',"eye-slash":'',filter:'',first:'',grip:'',group:'',last:'',left:'',linked:'',loading:'',maximize:'',menu:'',"menu-alt":'',minimize:'',minus:'',next:'',none:'',"not-allowed":'',paste:'',pin:'',pivot:'',plus:'',previous:'',right:'',save:'',settings:'',"small-left":'',"small-right":'',tick:'',"tree-closed":'',"tree-indeterminate":'',"tree-open":'',unlinked:'',up:''},pw={aasc:'',adesc:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"column-arrow":'',edit:'',"filter-add":'',"pinned-bottom":'',"pinned-top":'',"small-down":'',"small-up":'',"un-pin":''},jA=(e={})=>{let t="";for(const s of[...Object.keys(gw),...Object.keys(pw)]){const i=qA(s,e.strokeWidth);t+=`.ag-icon-${s}::before { mask-image: url('data:image/svg+xml,${encodeURIComponent(i)}'); } `}return t},qA=(e,t=1.5)=>{const s=pw[e];if(s)return s;const i=gw[e];if(!i)throw new Error(`Missing icon data for ${e}`);return``+i+""},sc=(e={})=>he({feature:"iconSet",css:()=>jA(e)}),YA=sc({strokeWidth:1}),fw=sc(),XA=sc({strokeWidth:2}),Nh=':where(.ag-input-field-input[type=number]:not(.ag-number-field-input-stepper)){-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);font-family:inherit;font-size:inherit;line-height:inherit;margin:0;min-height:var(--ag-input-height);padding:0;&:where(:disabled){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}&:where(:focus){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color);outline:none}&:where(:invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&::-moz-placeholder{color:var(--ag-input-placeholder-text-color)}&::placeholder{color:var(--ag-input-placeholder-text-color)}}:where(.ag-ltr) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-left:var(--ag-input-padding-start)}:where(.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-right:var(--ag-input-padding-start)}&:where(.ag-ltr,.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding:0 var(--ag-input-padding-start)}:where(.ag-column-select-header-filter-wrapper),:where(.ag-filter-add-select),:where(.ag-filter-filter),:where(.ag-filter-toolpanel-search),:where(.ag-floating-filter-search-icon),:where(.ag-mini-filter){.ag-input-wrapper:before{background-color:currentcolor;color:var(--ag-input-icon-color);content:"";display:block;height:12px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==");mask-image:url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;opacity:.5;position:absolute;width:12px}}:where(.ag-ltr) :where(.ag-column-select-header-filter-wrapper),:where(.ag-ltr) :where(.ag-filter-add-select),:where(.ag-ltr) :where(.ag-filter-filter),:where(.ag-ltr) :where(.ag-filter-toolpanel-search),:where(.ag-ltr) :where(.ag-floating-filter-search-icon),:where(.ag-ltr) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-left:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)}}:where(.ag-rtl) :where(.ag-column-select-header-filter-wrapper),:where(.ag-rtl) :where(.ag-filter-add-select),:where(.ag-rtl) :where(.ag-filter-filter),:where(.ag-rtl) :where(.ag-filter-toolpanel-search),:where(.ag-rtl) :where(.ag-floating-filter-search-icon),:where(.ag-rtl) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-right:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)}}',ZA=".ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){&:focus{box-shadow:var(--ag-focus-shadow);&:where(.invalid),&:where(:invalid){box-shadow:var(--ag-focus-error-shadow)}}}",QA=".ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){border-left:none;border-right:none;border-top:none}",Hh={inputBackgroundColor:"transparent",inputBorder:!1,inputBorderRadius:0,inputTextColor:{ref:"textColor"},inputPlaceholderTextColor:{ref:"inputTextColor",mix:.5},inputPaddingStart:0,inputHeight:{calc:"max(iconSize, fontSize) + spacing * 2"},inputFocusBackgroundColor:{ref:"inputBackgroundColor"},inputFocusBorder:{ref:"inputBorder"},inputFocusShadow:"none",inputFocusTextColor:{ref:"inputTextColor"},inputDisabledBackgroundColor:{ref:"inputBackgroundColor"},inputDisabledBorder:{ref:"inputBorder"},inputDisabledTextColor:{ref:"inputTextColor"},inputInvalidBackgroundColor:{ref:"inputBackgroundColor"},inputInvalidBorder:{ref:"inputBorder"},inputInvalidTextColor:{ref:"inputTextColor"},inputIconColor:{ref:"inputTextColor"},pickerButtonBorder:!1,pickerButtonFocusBorder:{ref:"inputFocusBorder"},pickerButtonBackgroundColor:{ref:"backgroundColor"},pickerButtonFocusBackgroundColor:{ref:"backgroundColor"},pickerListBorder:!1,pickerListBackgroundColor:{ref:"backgroundColor"},colorPickerThumbSize:18,colorPickerTrackSize:12,colorPickerThumbBorderWidth:3,colorPickerTrackBorderRadius:12,colorPickerColorBorderRadius:4},JA=()=>he({feature:"inputStyle",params:Hh,css:Nh}),eI=JA(),tI=()=>he({feature:"inputStyle",params:{...Hh,inputBackgroundColor:Me,inputBorder:!0,inputBorderRadius:{ref:"borderRadius"},inputPaddingStart:{ref:"spacing"},inputFocusBorder:{color:ke},inputFocusShadow:{ref:"focusShadow"},inputDisabledBackgroundColor:Pe(.06),inputDisabledTextColor:{ref:"textColor",mix:.5},inputInvalidBorder:{color:{ref:"invalidColor"}},pickerButtonBorder:!0,pickerListBorder:!0},css:()=>Nh+ZA}),ic=tI(),sI=()=>he({feature:"inputStyle",params:{...Hh,inputBackgroundColor:"transparent",inputBorder:{width:2,color:Be(.3)},inputPaddingStart:{ref:"spacing"},inputFocusBorder:"solid 2px var(--ag-accent-color)",inputDisabledTextColor:{ref:"textColor",mix:.5},inputDisabledBorder:"solid 1px var(--ag-border-color)",inputInvalidBorder:{width:2,color:{ref:"invalidColor",mix:.3}}},css:()=>Nh+QA}),mw=sI(),Xn='.ag-tabs-header{background-color:var(--ag-tab-bar-background-color);border-bottom:var(--ag-tab-bar-border);display:flex;flex:1;gap:var(--ag-tab-spacing);padding:var(--ag-tab-bar-top-padding) var(--ag-tab-bar-horizontal-padding) 0}.ag-tabs-header-wrapper{display:flex}.ag-tabs-close-button-wrapper{align-items:center;border:0;display:flex;padding:var(--ag-spacing)}:where(.ag-ltr) .ag-tabs-close-button-wrapper{border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-tabs-close-button-wrapper{border-left:solid var(--ag-border-width) var(--ag-border-color)}.ag-tabs-close-button{background-color:unset;border:0;cursor:pointer;padding:0}.ag-tab{align-items:center;background-color:var(--ag-tab-background-color);border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;color:var(--ag-tab-text-color);cursor:pointer;display:flex;flex:1;justify-content:center;padding:var(--ag-tab-top-padding) var(--ag-tab-horizontal-padding) var(--ag-tab-bottom-padding);position:relative}.ag-tab:hover{background-color:var(--ag-tab-hover-background-color);color:var(--ag-tab-hover-text-color)}.ag-tab.ag-tab-selected{background-color:var(--ag-tab-selected-background-color);color:var(--ag-tab-selected-text-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-left-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-left-color:var(--ag-tab-selected-border-color)}.ag-tab:after{background-color:var(--ag-tab-selected-underline-color);bottom:0;content:"";display:block;height:var(--ag-tab-selected-underline-width);left:0;opacity:0;position:absolute;right:0;transition:opacity var(--ag-tab-selected-underline-transition-duration)}.ag-tab.ag-tab-selected:after{opacity:1}',iI=".ag-tab{border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;border-top:var(--ag-tab-selected-border-width) solid transparent;flex:none;&.ag-tab-selected{border-left-color:var(--ag-tab-selected-border-color);border-right-color:var(--ag-tab-selected-border-color);border-top-color:var(--ag-tab-selected-border-color);margin-bottom:-1px;padding-bottom:calc(var(--ag-tab-bottom-padding) + 1px)}}",Zn={tabBarBackgroundColor:"transparent",tabBarHorizontalPadding:0,tabBarTopPadding:0,tabBackgroundColor:"transparent",tabTextColor:{ref:"textColor"},tabHorizontalPadding:{ref:"spacing"},tabTopPadding:{ref:"spacing"},tabBottomPadding:{ref:"spacing"},tabSpacing:"0",tabHoverBackgroundColor:{ref:"tabBackgroundColor"},tabHoverTextColor:{ref:"tabTextColor"},tabSelectedBackgroundColor:{ref:"tabBackgroundColor"},tabSelectedTextColor:{ref:"tabTextColor"},tabSelectedBorderWidth:{ref:"borderWidth"},tabSelectedBorderColor:"transparent",tabSelectedUnderlineColor:"transparent",tabSelectedUnderlineWidth:0,tabSelectedUnderlineTransitionDuration:0,tabBarBorder:!1},rI=()=>he({feature:"tabStyle",params:Zn,css:Xn}),oI=rI(),nI=()=>he({feature:"tabStyle",params:{...Zn,tabBarBorder:!0,tabBarBackgroundColor:Be(.05),tabTextColor:{ref:"textColor",mix:.7},tabSelectedTextColor:{ref:"textColor"},tabHoverTextColor:{ref:"textColor"},tabSelectedBorderColor:{ref:"borderColor"},tabSelectedBackgroundColor:Me},css:Xn}),Cw=nI(),aI=()=>he({feature:"tabStyle",params:{...Zn,tabBarBackgroundColor:{ref:"chromeBackgroundColor"},tabSelectedUnderlineColor:{ref:"primaryColor"},tabSelectedUnderlineWidth:2,tabSelectedUnderlineTransitionDuration:0},css:Xn}),vw=aI(),lI=()=>he({feature:"tabStyle",params:{...Zn,tabBarBorder:!0,tabBarBackgroundColor:{ref:"chromeBackgroundColor"},tabHoverTextColor:ke,tabSelectedTextColor:ke,tabSelectedUnderlineColor:ke,tabSelectedUnderlineWidth:2,tabSelectedUnderlineTransitionDuration:"0.3s"},css:Xn}),ww=lI(),cI=()=>he({feature:"tabStyle",params:{...Zn,tabBarBackgroundColor:{ref:"chromeBackgroundColor"},tabBarHorizontalPadding:{ref:"spacing"},tabBarTopPadding:{ref:"spacing"},tabBarBorder:!0,tabHorizontalPadding:{calc:"spacing * 2"},tabTopPadding:{ref:"spacing"},tabBottomPadding:{ref:"spacing"},tabSpacing:{ref:"spacing"},tabSelectedBorderColor:{ref:"borderColor"},tabSelectedBackgroundColor:Me},css:()=>Xn+iI}),bw=cI(),dI=".ag-dnd-ghost,.ag-filter-toolpanel-header,.ag-filter-toolpanel-search,.ag-multi-filter-group-title-bar,.ag-panel-title-bar-title,.ag-status-bar{color:var(--ag-header-text-color);font-size:calc(var(--ag-font-size) - 1px);font-weight:600}.ag-column-drop-horizontal{background-color:color-mix(in srgb,var(--ag-background-color),var(--ag-foreground-color) 8%)}.ag-cell.ag-cell-inline-editing{background-color:var(--ag-background-color);background-image:linear-gradient(0deg,var(--ag-input-background-color),var(--ag-input-background-color));border:var(--ag-input-border)!important;border-width:1px!important;height:calc(var(--ag-row-height) + var(--ag-spacing)*3);padding:var(--ag-spacing);:where(.ag-row-last:not(.ag-row-first)) &{bottom:0}:where(.ag-has-focus) &{border:var(--ag-input-focus-border)!important;border-width:1px!important}}.ag-advanced-filter-builder-button,.ag-standard-button{text-transform:uppercase}.ag-status-bar{border:solid var(--ag-border-width) var(--ag-border-color)}.ag-list-item-hovered:after{background-color:var(--ag-primary-color)}.ag-pill-button:hover{color:var(--ag-primary-color)}.ag-filter-add-button,.ag-filter-add-button:hover{border-bottom:2px solid var(--ag-primary-color)}",Sw=()=>({fontFamily:[{googleFont:"IBM Plex Sans"},"-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu"]}),uI=()=>jn().withPart(qn).withPart(Yn).withPart(fw).withPart(Cw).withPart(ic).withPart(tc).withParams(Sw()),yw=uI(),xw=()=>({accentColor:"#2196f3",selectedRowBackgroundColor:Xt(.3),inputFocusBorder:{color:Xt(.4)},focusShadow:{radius:2,spread:1.6,color:Xt(.4)},iconButtonHoverBackgroundColor:"transparent",iconButtonActiveBackgroundColor:"transparent",checkboxUncheckedBorderColor:Pe(.45),checkboxIndeterminateBackgroundColor:Pe(.45),checkboxIndeterminateBorderColor:Pe(.45),checkboxBorderWidth:2,checkboxBorderRadius:2,fontSize:13,dataFontSize:14,headerFontWeight:700,borderRadius:3,wrapperBorderRadius:3,tabSelectedUnderlineColor:ke,tabSelectedBorderWidth:0,tabSelectedUnderlineTransitionDuration:.3,sideButtonSelectedUnderlineColor:ke,sideButtonSelectedUnderlineWidth:2,sideButtonSelectedUnderlineTransitionDuration:.3,sideButtonBorder:!1,sideButtonSelectedBorder:!1,sideButtonBarTopPadding:{calc:"spacing * 3"},sideButtonSelectedBackgroundColor:"transparent",sideButtonHoverTextColor:ke,iconButtonHoverColor:ke,toggleButtonWidth:28,toggleButtonHeight:18,toggleButtonSwitchInset:1,toggleButtonOffBackgroundColor:Pe(.45),colorPickerThumbSize:13,colorPickerTrackSize:11,colorPickerThumbBorderWidth:2,colorPickerTrackBorderRadius:2,colorPickerColorBorderRadius:2}),hI=()=>jn().withPart(nw).withPart(qn).withPart(Yn).withPart(dw).withPart(ww).withPart(ic).withPart(tc).withParams(xw()),gI=hI(),Rw=()=>({accentColor:"#0091ea",borderColor:Be(.2),spacing:4,widgetVerticalSpacing:{calc:"max(8px, spacing)"},borderRadius:2,wrapperBorderRadius:2,headerColumnResizeHandleColor:"transparent",headerColumnBorder:!0,headerColumnBorderHeight:"50%",oddRowBackgroundColor:{ref:"chromeBackgroundColor",mix:.5},checkboxBorderRadius:2,checkboxBorderWidth:1,checkboxUncheckedBackgroundColor:Me,checkboxUncheckedBorderColor:Pe(.5),checkboxCheckedBackgroundColor:Me,checkboxCheckedBorderColor:ke,checkboxCheckedShapeColor:ke,checkboxIndeterminateBackgroundColor:Me,checkboxIndeterminateBorderColor:Pe(.5),checkboxIndeterminateShapeColor:Pe(.5),focusShadow:{radius:2,spread:1,color:ke},headerTextColor:Be(.6),iconButtonHoverBackgroundColor:"transparent",iconButtonActiveBackgroundColor:"transparent",fontSize:12,tabSelectedBackgroundColor:Me,headerFontWeight:"bold",toggleButtonWidth:32,toggleButtonHeight:16,toggleButtonSwitchInset:1,toggleButtonOffBackgroundColor:Pe(.5),sideButtonBorder:!0,sideButtonBarTopPadding:{calc:"spacing * 4"},popupShadow:"5px 5px 10px rgba(0, 0, 0, 0.3)",statusBarLabelColor:Be(.54),statusBarLabelFontWeight:600,statusBarValueFontWeight:600,panelTitleBarIconColor:Ot,colorPickerThumbSize:13,colorPickerTrackSize:11,colorPickerThumbBorderWidth:2,colorPickerTrackBorderRadius:2,colorPickerColorBorderRadius:2}),pI=()=>jn().withPart(aw).withPart(qn).withPart(Yn).withPart(cw).withPart(bw).withPart(ic).withPart(Vh).withParams(Rw()),fI=pI(),mI=()=>{const e={tabSelectedUnderlineColor:{ref:"primaryColor"},sideButtonSelectedUnderlineColor:{ref:"primaryColor"},buttonTextColor:{ref:"primaryColor"},rangeSelectionBackgroundColor:{ref:"primaryColor",mix:.2},rangeSelectionBorderColor:{ref:"primaryColor"},rangeSelectionHighlightColor:{ref:"primaryColor",mix:.5},rangeHeaderHighlightColor:{ref:"foregroundColor",mix:.08},rowNumbersSelectedColor:{ref:"primaryColor",mix:.5},inputFocusBorder:{width:2,color:{ref:"primaryColor"}},pickerButtonFocusBorder:{width:1,color:{ref:"primaryColor"}},cellEditingBorder:{color:{ref:"primaryColor"}},menuBackgroundColor:{ref:"backgroundColor"},sideButtonBarBackgroundColor:Me,sideButtonSelectedBackgroundColor:"transparent",sideButtonBarTopPadding:{calc:"spacing * 4"},headerColumnResizeHandleColor:"none",headerBackgroundColor:{ref:"backgroundColor"},rowHoverColor:Be(.08),columnHoverColor:Be(.08),headerCellHoverBackgroundColor:Be(.05),statusBarLabelColor:Be(.63),statusBarLabelFontWeight:600,statusBarValueFontWeight:600,valueChangeValueHighlightBackgroundColor:"#00acc1",panelTitleBarIconColor:Ot,advancedFilterBuilderButtonBarBorder:!1,filterPanelApplyButtonColor:{ref:"buttonTextColor"},filterPanelApplyButtonBackgroundColor:{ref:"buttonBackgroundColor"},columnPanelApplyButtonColor:{ref:"buttonTextColor"},columnPanelApplyButtonBackgroundColor:{ref:"buttonBackgroundColor"},colorPickerThumbSize:13,colorPickerTrackSize:11,colorPickerThumbBorderWidth:2,colorPickerTrackBorderRadius:2,colorPickerColorBorderRadius:2,rowDragIndicatorColor:{ref:"primaryColor"},columnDragIndicatorColor:{ref:"primaryColor"}},t={...e,primaryColor:"#3f51b5",foregroundColor:"#000D",headerTextColor:"#0008",accentColor:"#ff4081",checkboxUncheckedBorderColor:Ot,checkboxIndeterminateBackgroundColor:Ot,toggleButtonOffBackgroundColor:Ot,selectedRowBackgroundColor:"rgba(33, 150, 243, 0.3)"},s={...e,primaryColor:"#3f51b5",foregroundColor:"#fffD",headerTextColor:"#fff8",accentColor:"#bb86fc",checkboxUncheckedBorderColor:Pe(.5),checkboxIndeterminateBackgroundColor:Pe(.5),toggleButtonOffBackgroundColor:Pe(.5),selectedRowBackgroundColor:"#bb86fc33"};return he({feature:"styleMaterial",css:dI,params:t,modeParams:{light:t,dark:s,"dark-blue":s}})},Fw=mI(),Ew=()=>({rowHeight:{calc:"max(iconSize, cellFontSize) + spacing * 3.75 * rowVerticalPaddingScale"},headerHeight:{calc:"max(iconSize, dataFontSize) + spacing * 4.75 * headerVerticalPaddingScale"},widgetVerticalSpacing:{calc:"spacing * 1.75"},cellHorizontalPadding:{calc:"spacing * 3"},buttonHorizontalPadding:{ref:"spacing"},widgetContainerHorizontalPadding:{calc:"spacing * 1.5"},widgetContainerVerticalPadding:{calc:"spacing * 2"},fontSize:13,iconSize:18,borderRadius:0,wrapperBorderRadius:0,wrapperBorder:!1,menuBorder:!1,dialogBorder:!1,panelTitleBarBorder:!1,tabSelectedBorderWidth:0,tabSelectedUnderlineTransitionDuration:.3,sidePanelBorder:!1,sideButtonSelectedBorder:!1,sideButtonSelectedUnderlineWidth:2,sideButtonSelectedUnderlineTransitionDuration:.3,sideButtonBorder:!1,buttonBorder:!1,buttonDisabledBorder:!1,focusShadow:{spread:4,color:Be(.16)},fontFamily:[{googleFont:"Roboto"},"-apple-system","BlinkMacSystemFont","Segoe UI","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue","sans-serif"],inputHeight:{calc:"max(iconSize, fontSize) + spacing * 3"},pickerButtonBorder:{width:1,color:"transparent"},headerFontWeight:600,headerFontSize:{calc:"fontSize - 1px"},checkboxBorderWidth:2,checkboxBorderRadius:2,toggleButtonWidth:34,toggleButtonSwitchInset:1,cardShadow:"0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)",popupShadow:"5px 5px 10px rgba(0, 0, 0, 0.3)"}),CI=()=>jn().withPart(rw).withPart(qn).withPart(Yn).withPart(uw).withPart(vw).withPart(mw).withPart(Vh).withPart(Fw).withParams(Ew()),vI=CI(),Ni=(e,t,s,i,r)=>({changeKey:e,type:t,defaultValue:s,noWarn:i,cacheDefault:r}),wI=Ni("cellHorizontalPadding","length",16),bI=Ni("indentationLevel","length",0,!0,!0),SI=Ni("rowGroupIndentSize","length",0),Pw=Ni("rowHeight","length",42),Mw=Ni("headerHeight","length",48),zh=Ni("rowBorderWidth","border",1),Tw=Ni("pinnedRowBorderWidth","border",1),yI=Ni("headerRowBorderWidth","border",1);function Dw(e,t){for(const s of t.sort((i,r)=>i.moduleName.localeCompare(r.moduleName))){const i=s.css;i&&e.set(`module-${s.moduleName}`,i)}}var xI=class extends tw{initVariables(){this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.getSizeEl(Pw),this.getSizeEl(Mw),this.getSizeEl(zh),this.getSizeEl(Tw),this.refreshRowBorderWidthVariable()}getPinnedRowBorderWidth(){return this.getCSSVariablePixelValue(Tw)}getRowBorderWidth(){return this.getCSSVariablePixelValue(zh)}getHeaderRowBorderWidth(){return this.getCSSVariablePixelValue(yI)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(Pw)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(Mw)}getDefaultCellHorizontalPadding(){return this.getCSSVariablePixelValue(wI)}getCellPaddingLeft(){const e=this.getDefaultCellHorizontalPadding(),t=this.getCSSVariablePixelValue(bI),s=this.getCSSVariablePixelValue(SI);return e-1+s*t}getCellPadding(){const e=this.getDefaultCellHorizontalPadding()-1;return this.getCellPaddingLeft()+e}getDefaultColumnMinWidth(){return Math.min(36,this.getDefaultRowHeight())}refreshRowHeightVariable(){const{eRootDiv:e}=this,t=e.style.getPropertyValue("--ag-line-height").trim(),s=this.gos.get("rowHeight");if(s==null||isNaN(s)||!isFinite(s))return t!==null&&e.style.setProperty("--ag-line-height",null),-1;const i=`${s}px`;return t!=i?(e.style.setProperty("--ag-line-height",i),s):t!=""?Number.parseFloat(t):-1}fireStylesChangedEvent(e){e==="rowBorderWidth"&&this.refreshRowBorderWidthVariable(),super.fireStylesChangedEvent(e)}refreshRowBorderWidthVariable(){const e=this.getCSSVariablePixelValue(zh);this.eRootDiv.style.setProperty("--ag-internal-row-border-width",`${e}px`)}postProcessThemeChange(e,t){e&&getComputedStyle(this.getMeasurementContainer()).getPropertyValue("--ag-legacy-styles-loaded")&&Q(t?106:239)}getAdditionalCss(){const e=new Map;return e.set("core",[uA]),Dw(e,Array.from(TF())),e}getDefaultTheme(){return yw}varError(e,t){F(9,{variable:{cssName:e,defaultValue:t}})}themeError(e){Q(240,{theme:e})}shadowRootError(){Q(293)}},Aw=class extends Ke{constructor(){super(...arguments),this.beanName="eventSvc",this.eventServiceType="global",this.globalSvc=new As}addListener(e,t,s){this.globalSvc.addEventListener(e,t,s)}removeListener(e,t,s){this.globalSvc.removeEventListener(e,t,s)}addGlobalListener(e,t=!1){this.globalSvc.addGlobalListener(e,t)}removeGlobalListener(e,t=!1){this.globalSvc.removeGlobalListener(e,t)}dispatchEvent(e){this.globalSvc.dispatchEvent(this.gos.addCommon(e))}dispatchEventOnce(e){this.globalSvc.dispatchEventOnce(this.gos.addCommon(e))}},RI=class extends Aw{postConstruct(){const{globalListener:e,globalSyncListener:t}=this.beans;e&&this.addGlobalListener(e,!0),t&&this.addGlobalListener(t,!1)}};function _h(e,t,s){const i=e.visibleCols.headerGroupRowCount;if(s>=i)return{column:t,headerRowIndex:s};let r=t.getParent();for(;r&&r.getProvidedColumnGroup().getLevel()>s;)r=r.getParent();const o=t.isSpanHeaderHeight();return!r||o&&r.isPadding()?{column:t,headerRowIndex:i}:{column:r,headerRowIndex:r.getProvidedColumnGroup().getLevel()}}var FI=class extends E{constructor(){super(...arguments),this.beanName="headerNavigation",this.currentHeaderRowWithoutSpan=-1}postConstruct(){const e=this.beans;e.ctrlsSvc.whenReady(this,s=>{this.gridBodyCon=s.gridBodyCtrl});const t=me(e);this.addManagedElementListeners(t,{mousedown:()=>{this.currentHeaderRowWithoutSpan=-1}})}getHeaderPositionForColumn(e,t){let s;const{colModel:i,colGroupSvc:r,ctrlsSvc:o}=this.beans;if(typeof e=="string"?(s=i.getCol(e),s||(s=r?.getColumnGroup(e)??null)):s=e,!s)return null;const a=o.getHeaderRowContainerCtrl()?.getAllCtrls(),l=W(a||[]).type==="filter",c=cs(this.beans)-1;let d=-1,u=s;for(;u;)d++,u=u.getParent();let h=d;return t&&l&&h===c-1&&h++,h===-1?null:{headerRowIndex:h,column:s}}navigateVertically(e,t){const{focusSvc:s,visibleCols:i}=this.beans,{focusedHeader:r}=s;if(!r)return!1;const{headerRowIndex:o}=r,n=r.column,a=cs(this.beans),l=this.getHeaderRowType(o),c=i.headerGroupRowCount;let{headerRowIndex:d,column:u,headerRowIndexWithoutSpan:h}=e==="UP"?EI(l,n,o):PI(n,o,c),g=!1;return d<0&&(d=0,u=n,g=!0),d>=a?(d=-1,this.currentHeaderRowWithoutSpan=-1):h!==void 0&&(this.currentHeaderRowWithoutSpan=h),!g&&!u?!1:s.focusHeaderPosition({headerPosition:{headerRowIndex:d,column:u},allowUserOverride:!0,event:t})}navigateHorizontally(e,t=!1,s){const{focusSvc:i,gos:r}=this.beans,o={...i.focusedHeader};let n,a;this.currentHeaderRowWithoutSpan!==-1?o.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=o.headerRowIndex,e==="LEFT"!==r.get("enableRtl")?(a="Before",n=this.findHeader(o,a)):(a="After",n=this.findHeader(o,a));const l=r.getCallback("tabToNextHeader");if(t&&l){const c=i.focusHeaderPositionFromUserFunc({userFunc:l,headerPosition:n,direction:a});if(c){const{headerRowIndex:d}=i.focusedHeader||{};d!=null&&d!=o.headerRowIndex&&(this.currentHeaderRowWithoutSpan=d)}return c}return n||!t?i.focusHeaderPosition({headerPosition:n,direction:a,fromTab:t,allowUserOverride:!0,event:s}):this.focusNextHeaderRow(o,a,s)}focusNextHeaderRow(e,t,s){const i=this.beans,r=e.headerRowIndex;let o=null,n;const a=cs(i),l=this.beans.visibleCols.allCols;if(t==="Before"){if(r<=0)return!1;o=W(l),n=r-1,this.currentHeaderRowWithoutSpan-=1}else o=l[0],n=r+1,this.currentHeaderRowWithoutSpan=a&&(d=-1),i.focusSvc.focusHeaderPosition({headerPosition:{column:c,headerRowIndex:d},direction:t,fromTab:!0,allowUserOverride:!0,event:s})}scrollToColumn(e,t="After"){if(e.getPinned())return;let s;if(Le(e)){const i=e.getDisplayedLeafColumns();s=t==="Before"?W(i):i[0]}else s=e;this.gridBodyCon.scrollFeature.ensureColumnVisible(s)}findHeader(e,t){const{colGroupSvc:s,visibleCols:i}=this.beans;let r=e.column;if(r instanceof no){const l=r.getDisplayedLeafColumns();r=t==="Before"?l[0]:l[l.length-1]}const o=t==="Before"?i.getColBefore(r):i.getColAfter(r);if(!o)return;const n=i.headerGroupRowCount;if(e.headerRowIndex>=n)return{headerRowIndex:e.headerRowIndex,column:o};const a=s?.getColGroupAtLevel(o,e.headerRowIndex);return a?a.isPadding()&&o.isSpanHeaderHeight()?{headerRowIndex:i.headerGroupRowCount,column:o}:{headerRowIndex:e.headerRowIndex,column:a??o}:{headerRowIndex:o instanceof is&&o.isSpanHeaderHeight()?i.headerGroupRowCount:e.headerRowIndex,column:o}}getHeaderRowType(e){const t=this.beans.ctrlsSvc.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}};function EI(e,t,s){const i=s-1;if(e!=="filter"){const r=t instanceof is&&t.isSpanHeaderHeight();let o=t.getParent();for(;o&&(o.getProvidedColumnGroup().getLevel()>i||r&&o.isPadding());)o=o.getParent();if(o)return r?{column:o,headerRowIndex:o.getProvidedColumnGroup().getLevel(),headerRowIndexWithoutSpan:i}:{column:o,headerRowIndex:i,headerRowIndexWithoutSpan:i}}return{column:t,headerRowIndex:i,headerRowIndexWithoutSpan:i}}function PI(e,t,s){const i=t+1,r={column:e,headerRowIndex:i,headerRowIndexWithoutSpan:i};if(e instanceof no){if(i>=s)return{column:e.getDisplayedLeafColumns()[0],headerRowIndex:s,headerRowIndexWithoutSpan:i};let n=e.getDisplayedChildren()[0];if(n instanceof no&&n.isPadding()){const l=n.getDisplayedLeafColumns()[0];l.isSpanHeaderHeight()&&(n=l)}r.column=n,n instanceof is&&n.isSpanHeaderHeight()&&(r.headerRowIndex=s,r.headerRowIndexWithoutSpan=i)}return r}var MI=class extends E{constructor(){super(...arguments),this.beanName="focusSvc",this.focusFallbackTimeout=null,this.needsFocusRestored=!1}wireBeans(e){this.colModel=e.colModel,this.visibleCols=e.visibleCols,this.rowRenderer=e.rowRenderer,this.navigation=e.navigation,this.filterManager=e.filterManager,this.overlays=e.overlays}postConstruct(){const e=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:e,columnRowGroupChanged:e}),this.addDestroyFunc($E(this.beans))}attemptToRecoverFocus(){this.needsFocusRestored=!0,this.focusFallbackTimeout!=null&&clearTimeout(this.focusFallbackTimeout),this.focusFallbackTimeout=window.setTimeout(this.setFocusRecovered.bind(this),100)}setFocusRecovered(){this.needsFocusRestored=!1,this.focusFallbackTimeout!=null&&(clearTimeout(this.focusFallbackTimeout),this.focusFallbackTimeout=null)}shouldTakeFocus(){return this.gos.get("suppressFocusAfterRefresh")?(this.setFocusRecovered(),!1):this.needsFocusRestored?(this.setFocusRecovered(),!0):this.doesRowOrCellHaveBrowserFocus()}onColumnEverythingChanged(){if(!this.focusedCell)return;const e=this.focusedCell.column,t=this.colModel.getCol(e.getId());e!==t&&this.clearFocusedCell()}getFocusCellToUseAfterRefresh(){const{gos:e,focusedCell:t}=this;return e.get("suppressFocusAfterRefresh")||e.get("suppressCellFocus")||!t||!this.doesRowOrCellHaveBrowserFocus()?null:t}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeader||!this.isDomDataPresentInHierarchy(ie(this.beans),_C)?null:this.focusedHeader}doesRowOrCellHaveBrowserFocus(){const e=ie(this.beans);return this.isDomDataPresentInHierarchy(e,kl,!0)?!0:this.isDomDataPresentInHierarchy(e,Ll,!0)}isDomDataPresentInHierarchy(e,t,s){let i=e;for(;i;){const r=_m(this.gos,i,t);if(r)return r.destroyed&&s?(this.attemptToRecoverFocus(),!1):!0;i=i.parentNode}return!1}getFocusedCell(){return this.focusedCell}getFocusEventParams(e){const{rowIndex:t,rowPinned:s,column:i}=e,r={rowIndex:t,rowPinned:s,column:i,isFullWidthCell:!1},o=this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:s});return o&&(r.isFullWidthCell=o.isFullWidth()),r}clearFocusedCell(){if(this.focusedCell==null)return;const e=this.getFocusEventParams(this.focusedCell);this.focusedCell=null,this.eventSvc.dispatchEvent({type:"cellFocusCleared",...e})}setFocusedCell(e){this.setFocusRecovered();const{column:t,rowIndex:s,rowPinned:i,forceBrowserFocus:r=!1,preventScrollOnBrowserFocus:o=!1,sourceEvent:n}=e,a=this.colModel.getCol(t);if(!a){this.focusedCell=null;return}this.focusedCell={rowIndex:s,rowPinned:Ae(i),column:a};const l=this.getFocusEventParams(this.focusedCell);this.eventSvc.dispatchEvent({type:"cellFocused",...l,...this.previousCellFocusParams&&{previousParams:this.previousCellFocusParams},forceBrowserFocus:r,preventScrollOnBrowserFocus:o,sourceEvent:n}),this.previousCellFocusParams=l}isCellFocused(e){return this.focusedCell==null?!1:uo(e,this.focusedCell)}isHeaderWrapperFocused(e){if(this.focusedHeader==null)return!1;const{column:t,rowCtrl:{rowIndex:s,pinned:i}}=e,{column:r,headerRowIndex:o}=this.focusedHeader;return t===r&&s===o&&i==r.getPinned()}focusHeaderPosition(e){if(this.setFocusRecovered(),xs(this.beans))return!1;const{direction:t,fromTab:s,allowUserOverride:i,event:r,fromCell:o,rowWithoutSpanValue:n,scroll:a=!0}=e;let{headerPosition:l}=e;if(o&&this.filterManager?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(l);if(i){const c=this.focusedHeader,d=cs(this.beans);if(s){const u=this.gos.getCallback("tabToNextHeader");u&&(l=this.getHeaderPositionFromUserFunc({userFunc:u,direction:t,currentPosition:c,headerPosition:l,headerRowCount:d}))}else{const u=this.gos.getCallback("navigateToNextHeader");if(u&&r){const h={key:r.key,previousHeaderPosition:c,nextHeaderPosition:l,headerRowCount:d,event:r},g=u(h);l=g===null?c:g}}}return l?this.focusProvidedHeaderPosition({headerPosition:l,direction:t,event:r,fromCell:o,rowWithoutSpanValue:n,scroll:a}):!1}focusHeaderPositionFromUserFunc(e){if(xs(this.beans))return!1;const{userFunc:t,headerPosition:s,direction:i,event:r}=e,o=this.focusedHeader,n=cs(this.beans),a=this.getHeaderPositionFromUserFunc({userFunc:t,direction:i,currentPosition:o,headerPosition:s,headerRowCount:n});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:i,event:r})}getHeaderPositionFromUserFunc(e){const{userFunc:t,direction:s,currentPosition:i,headerPosition:r,headerRowCount:o}=e,a=t({backwards:s==="Before",previousHeaderPosition:i,nextHeaderPosition:r,headerRowCount:o});return a===!0?i:a===!1?null:a}focusProvidedHeaderPosition(e){const{headerPosition:t,direction:s,fromCell:i,rowWithoutSpanValue:r,event:o,scroll:n=!0}=e,{column:a,headerRowIndex:l}=t,{filterManager:c,ctrlsSvc:d,headerNavigation:u}=this.beans;if(this.focusedHeader&&CP(e.headerPosition,this.focusedHeader))return!1;if(l===-1)return c?.isAdvFilterHeaderActive()?this.focusAdvancedFilter(t):this.focusGridView({column:a,event:o});n&&u?.scrollToColumn(a,s);const g=d.getHeaderRowContainerCtrl(a.getPinned())?.focusHeader(t.headerRowIndex,a,o)||!1;return u&&g&&(r!=null||i)&&(u.currentHeaderRowWithoutSpan=r??-1),g}focusFirstHeader(){if(this.overlays?.exclusive&&this.focusOverlay())return!0;const e=this.visibleCols.allCols[0];if(!e)return!1;const t=_h(this.beans,e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){if(this.overlays?.exclusive&&this.focusOverlay(!0))return!0;const t=cs(this.beans)-1,s=W(this.visibleCols.allCols);return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:s},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){return this.filterManager?.isAdvFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCell}isRowFocused(e,t){return this.focusedCell==null?!1:this.focusedCell.rowIndex===e&&this.focusedCell.rowPinned===Ae(t)}focusOverlay(e){const t=this.overlays?.isVisible()&&this.overlays.eWrapper?.getGui();return!!t&&Ge(t,e)}getDefaultTabToNextGridContainerTarget(e){const{backwards:t,focusableContainers:s}=e,i=t?-1:1;let r;const o=()=>(r===void 0&&(r=this.getGridBodyTabTarget(t)),r);for(let n=e.nextIndex;n>=0&&n{e.executeLaterVMTurn(()=>this.updateScrollVisibleImpl())}):this.updateScrollVisibleImpl()}updateScrollVisibleImpl(){const e=this.ctrlsSvc.get("center");if(!e||this.colAnimation?.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.verticalScrollShowing};this.setScrollsVisible(t),this.updateScrollGap()}updateScrollGap(){const e=this.ctrlsSvc.get("center"),t=e.hasHorizontalScrollGap(),s=e.hasVerticalScrollGap();(this.horizontalScrollGap!==t||this.verticalScrollGap!==s)&&(this.horizontalScrollGap=t,this.verticalScrollGap=s,this.eventSvc.dispatchEvent({type:"scrollGapChanged"}))}setScrollsVisible(e){(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing)&&(this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing,this.eventSvc.dispatchEvent({type:"scrollVisibilityChanged"}))}getScrollbarWidth(){if(this.scrollbarWidth==null){const e=this.gos.get("scrollbarWidth"),s=typeof e=="number"&&e>=0?e:Tu();s!=null&&(this.scrollbarWidth=s,this.eventSvc.dispatchEvent({type:"scrollbarWidthChanged"}))}return this.scrollbarWidth}},DI=class extends E{constructor(){super(...arguments),this.beanName="gridDestroySvc",this.destroyCalled=!1}destroy(){if(this.destroyCalled)return;const{stateSvc:e,ctrlsSvc:t,context:s}=this.beans;this.eventSvc.dispatchEvent({type:"gridPreDestroyed",state:e?.getState()??{}}),this.destroyCalled=!0,t.get("gridCtrl")?.destroyGridUi(),s.destroy(),super.destroy()}},Wh=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","pinnedRowsChanged","rangeSelectionChanged","cellSelectionChanged","chartCreated","chartRangeSelectionChanged","chartOptionsChanged","chartDestroyed","toolPanelVisibleChanged","toolPanelSizeChanged","modelUpdated","cutStart","cutEnd","pasteStart","pasteEnd","fillStart","fillEnd","cellSelectionDeleteStart","cellSelectionDeleteEnd","rangeDeleteStart","rangeDeleteEnd","undoStarted","undoEnded","redoStarted","redoEnded","cellClicked","cellDoubleClicked","cellMouseDown","cellContextMenu","cellValueChanged","cellEditRequest","rowValueChanged","headerFocused","cellFocused","rowSelected","selectionChanged","tooltipShow","tooltipHide","cellKeyDown","cellMouseOver","cellMouseOut","filterChanged","filterModified","filterUiChanged","filterOpened","floatingFilterUiChanged","advancedFilterBuilderVisibleChanged","sortChanged","virtualRowRemoved","rowClicked","rowDoubleClicked","gridReady","gridPreDestroyed","gridSizeChanged","viewportChanged","firstDataRendered","dragStarted","dragStopped","dragCancelled","rowEditingStarted","rowEditingStopped","cellEditingStarted","cellEditingStopped","bodyScroll","bodyScrollEnd","paginationChanged","componentStateChanged","storeRefreshed","stateUpdated","columnMenuVisibleChanged","contextMenuVisibleChanged","rowDragEnter","rowDragMove","rowDragLeave","rowDragEnd","rowDragCancel","findChanged","rowResizeStarted","rowResizeEnded","columnsReset","bulkEditingStarted","bulkEditingStopped","batchEditingStarted","batchEditingStopped"],AI=["scrollbarWidthChanged","keyShortcutChangedCellStart","keyShortcutChangedCellEnd","pinnedHeightChanged","cellFocusCleared","fullWidthRowFocused","checkboxChanged","heightScaleChanged","suppressMovableColumns","suppressMenuHide","suppressFieldDotNotation","columnPanelItemDragStart","columnPanelItemDragEnd","bodyHeightChanged","columnContainerWidthChanged","displayedColumnsWidthChanged","scrollVisibilityChanged","scrollGapChanged","columnHoverChanged","flashCells","rowDragVisibilityChanged","paginationPixelOffsetChanged","displayedRowsChanged","leftPinnedWidthChanged","rightPinnedWidthChanged","rowContainerHeightChanged","headerHeightChanged","columnGroupHeaderHeightChanged","columnHeaderHeightChanged","stylesChanged","storeUpdated","filterDestroyed","filterHandlerDestroyed","rowDataUpdateStarted","rowCountReady","advancedFilterEnabledChanged","dataTypesInferred","fieldValueChanged","fieldPickerValueSelected","richSelectListRowSelected","sideBarUpdated","alignedGridScroll","alignedGridColumn","gridOptionsChanged","chartTitleEdit","recalculateRowBounds","stickyTopOffsetChanged","overlayExclusiveChanged","rowNodeDataChanged","cellEditValuesChanged","filterSwitched","filterClosed","headerRowsChanged","rowExpansionStateChanged","showRowGroupColsSetChanged"],II=()=>[...Wh,...AI],Qn=new Set(["gridPreDestroyed","fillStart","pasteStart"]),rc=Wh.reduce((e,t)=>(e[t]=Ym(t),e),{}),wo={agSetColumnFilter:"SetFilter",agSetColumnFloatingFilter:"SetFilter",agMultiColumnFilter:"MultiFilter",agMultiColumnFloatingFilter:"MultiFilter",agGroupColumnFilter:"GroupFilter",agGroupColumnFloatingFilter:"GroupFilter",agGroupCellRenderer:"GroupCellRenderer",agGroupRowRenderer:"GroupCellRenderer",agRichSelect:"RichSelect",agRichSelectCellEditor:"RichSelect",agDetailCellRenderer:"SharedMasterDetail",agSparklineCellRenderer:"Sparklines",agDragAndDropImage:"SharedDragAndDrop",agColumnHeader:"ColumnHeaderComp",agColumnGroupHeader:"ColumnGroupHeaderComp",agSortIndicator:"Sort",agAnimateShowChangeCellRenderer:"HighlightChanges",agAnimateSlideCellRenderer:"HighlightChanges",agLoadingCellRenderer:"LoadingCellRenderer",agSkeletonCellRenderer:"SkeletonCellRenderer",agCheckboxCellRenderer:"CheckboxCellRenderer",agLoadingOverlay:"Overlay",agExportingOverlay:"Overlay",agNoRowsOverlay:"Overlay",agNoMatchingRowsOverlay:"Overlay",agTooltipComponent:"Tooltip",agReadOnlyFloatingFilter:"CustomFilter",agTextColumnFilter:"TextFilter",agNumberColumnFilter:"NumberFilter",agBigIntColumnFilter:"BigIntFilter",agDateColumnFilter:"DateFilter",agDateInput:"DateFilter",agTextColumnFloatingFilter:"TextFilter",agNumberColumnFloatingFilter:"NumberFilter",agBigIntColumnFloatingFilter:"BigIntFilter",agDateColumnFloatingFilter:"DateFilter",agFormulaCellEditor:"Formula",agCellEditor:"TextEditor",agSelectCellEditor:"SelectEditor",agTextCellEditor:"TextEditor",agNumberCellEditor:"NumberEditor",agDateCellEditor:"DateEditor",agDateStringCellEditor:"DateEditor",agCheckboxCellEditor:"CheckboxEditor",agLargeTextCellEditor:"LargeTextEditor",agMenuItem:"MenuItem",agColumnsToolPanel:"ColumnsToolPanel",agFiltersToolPanel:"FiltersToolPanel",agNewFiltersToolPanel:"NewFiltersToolPanel",agAggregationComponent:"StatusBar",agSelectedRowCountComponent:"StatusBar",agTotalRowCountComponent:"StatusBar",agFilteredRowCountComponent:"StatusBar",agTotalAndFilteredRowCountComponent:"StatusBar",agFindCellRenderer:"Find"};function Iw(e){return`"${e}"`}var kI=()=>({checkboxSelection:{version:"32.2",message:"Use `rowSelection.checkboxes` in `GridOptions` instead."},headerCheckboxSelection:{version:"32.2",message:"Use `rowSelection.headerCheckbox = true` in `GridOptions` instead."},headerCheckboxSelectionFilteredOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "filtered"` in `GridOptions` instead.'},headerCheckboxSelectionCurrentPageOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "currentPage"` in `GridOptions` instead.'},showDisabledCheckboxes:{version:"32.2",message:"Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead."},rowGroupingHierarchy:{version:"34.3",message:"Use `colDef.groupHierarchy` instead."}}),LI={allowFormula:"Formula",aggFunc:"SharedAggregation",autoHeight:"RowAutoHeight",cellClass:"CellStyle",cellClassRules:"CellStyle",cellEditor:({cellEditor:e,editable:t,groupRowEditable:s})=>!!t||!!s?typeof e=="string"?wo[e]??"CustomEditor":"CustomEditor":null,cellRenderer:({cellRenderer:e})=>typeof e!="string"?null:wo[e],cellStyle:"CellStyle",columnChooserParams:"ColumnMenu",contextMenuItems:"ContextMenu",dndSource:"DragAndDrop",dndSourceOnRowDrag:"DragAndDrop",editable:({editable:e,cellEditor:t})=>e&&!t?"TextEditor":null,groupRowEditable:({groupRowEditable:e,cellEditor:t})=>e?t?"RowGroupingEdit":["RowGroupingEdit","TextEditor"]:null,groupRowValueSetter:({groupRowValueSetter:e})=>e?"RowGroupingEdit":null,enableCellChangeFlash:"HighlightChanges",enablePivot:"SharedPivot",enableRowGroup:"SharedRowGrouping",enableValue:"SharedAggregation",filter:({filter:e})=>e&&typeof e!="string"&&typeof e!="boolean"?"CustomFilter":typeof e=="string"?wo[e]??"ColumnFilter":"ColumnFilter",floatingFilter:"ColumnFilter",getQuickFilterText:"QuickFilter",headerTooltip:"Tooltip",headerTooltipValueGetter:"Tooltip",mainMenuItems:"ColumnMenu",menuTabs:e=>{const t=["columnsMenuTab","generalMenuTab"];return e.menuTabs?.some(s=>t.includes(s))?"ColumnMenu":null},pivot:"SharedPivot",pivotIndex:"SharedPivot",rowDrag:"RowDrag",rowGroup:"SharedRowGrouping",rowGroupIndex:"SharedRowGrouping",tooltipField:"Tooltip",tooltipValueGetter:"Tooltip",tooltipComponentSelector:"Tooltip",spanRows:"CellSpan",groupHierarchy:"SharedRowGrouping"},GI=()=>({autoHeight:{supportedRowModels:["clientSide","serverSide"],validate:(t,{paginationAutoPageSize:s})=>s?"colDef.autoHeight is not supported with paginationAutoPageSize.":null},allowFormula:{supportedRowModels:["clientSide"]},cellRendererParams:{validate:t=>(t.rowGroup!=null||t.rowGroupIndex!=null||t.cellRenderer==="agGroupCellRenderer")&&"checkbox"in t.cellRendererParams?'Since v33.0, `cellRendererParams.checkbox` has been deprecated. Use `rowSelection.checkboxLocation = "autoGroupColumn"` instead.':null},flex:{validate:(t,s)=>s.autoSizeStrategy?"colDef.flex is not supported with gridOptions.autoSizeStrategy":null},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],validate:(t,{rowSelection:s})=>s==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],validate:(t,{rowSelection:s})=>s==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],validate:(t,{rowSelection:s})=>s==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerValueGetter:{validate:t=>{const s=t.headerValueGetter;return typeof s=="function"||typeof s=="string"?null:"headerValueGetter must be a function or a valid string expression"}},icons:{validate:({icons:t})=>{if(t){if(t.smallDown)return Ft(262);if(t.smallLeft)return Ft(263);if(t.smallRight)return Ft(264)}return null}},sort:{validate:t=>oo(t.sort)||ii(t.sort)?null:`sort must be of type (SortDirection | SortDef), currently it is ${typeof t.sort=="object"?JSON.stringify(t.sort):ll(t.sort)}`},initialSort:{validate:t=>oo(t.initialSort)||ii(t.initialSort)?null:`initialSort must be of non-null type (SortDirection | SortDef), currently it is ${typeof t.initialSort=="object"?JSON.stringify(t.initialSort):ll(t.initialSort)}`},sortingOrder:{validate:t=>{const s=t.sortingOrder;if(Array.isArray(s)&&s.length>0){const i=s.filter(r=>!(oo(r)||ii(r)));if(i.length>0)return`sortingOrder must be an array of type non-null (SortDirection | SortDef)[], incorrect items are: [${i.map(r=>typeof r=="string"||r==null?ll(r):JSON.stringify(r)).join(", ")}]`}else if(!Array.isArray(s)||!s.length)return`sortingOrder must be an array with at least one element, currently it is [${s}]`;return null}},type:{validate:t=>{const s=t.type;return s instanceof Array?s.some(r=>typeof r!="string")?"if colDef.type is supplied an array it should be of type 'string[]'":null:typeof s=="string"?null:"colDef.type should be of type 'string' | 'string[]'"}},rowSpan:{validate:(t,{suppressRowTransform:s})=>s?null:"colDef.rowSpan requires suppressRowTransform to be enabled."},spanRows:{dependencies:{editable:{required:[!1,void 0]},groupRowEditable:{required:[!1,void 0]},rowDrag:{required:[!1,void 0]},colSpan:{required:[void 0]},rowSpan:{required:[void 0]}},validate:(t,{rowSelection:s,cellSelection:i,suppressRowTransform:r,enableCellSpan:o,rowDragEntireRow:n,enableCellTextSelection:a})=>typeof s=="object"&&s?.mode==="singleRow"&&s?.enableClickSelection?"colDef.spanRows is not supported with rowSelection.clickSelection":i?"colDef.spanRows is not supported with cellSelection.":r?"colDef.spanRows is not supported with suppressRowTransform.":o?n?"colDef.spanRows is not supported with rowDragEntireRow.":a?"colDef.spanRows is not supported with enableCellTextSelection.":null:"colDef.spanRows requires enableCellSpan to be enabled."},groupHierarchy:{validate(t,{groupHierarchyConfig:s={}},i){const r=new Set(["year","quarter","month","formattedMonth","day","hour","minute","second"]),o=[];for(const n of t.groupHierarchy??[]){if(typeof n=="object"){i.validation?.validateColDef(n);continue}!r.has(n)&&!(n in s)&&o.push(Iw(n))}if(o.length>0){const n=`The following parts of colDef.groupHierarchy are not recognised: ${o.join(", ")}.`,a=`Choose one of ${[...r].map(Iw).join(", ")}, or define your own parts in gridOptions.groupHierarchyConfig.`;return`${n} ${a}`}return null}}}),OI={headerName:void 0,columnGroupShow:void 0,headerStyle:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,headerTooltipValueGetter:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,groupRowEditable:void 0,groupRowValueSetter:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,spanRows:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,tooltipComponentSelector:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0,dateComponent:void 0,dateComponentParams:void 0,getFindText:void 0,rowGroupingHierarchy:void 0,groupHierarchy:void 0,allowFormula:void 0},VI=()=>Object.keys(OI),BI=()=>({objectName:"colDef",allProperties:VI(),docsUrl:"column-properties/",deprecations:kI(),validations:GI()}),kw=["overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","treeDataChildrenField","treeDataParentIdField","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","invalidEditValueMode","grandTotalRow","themeCssLayer","findSearchValue","styleNonce","renderingMode"],NI=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","dragAndDropImageComponentParams","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","activeOverlayParams","popupParent","themeStyleContainer","statusBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterParent","advancedFilterBuilderParams","advancedFilterParams","formulaDataSource","formulaFuncs","initialState","autoSizeStrategy","selectionColumnDef","findOptions","filterHandlers","groupHierarchyConfig"],HI=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector","suppressOverlays"],Uh=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipSwitchShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns","rowDragInsertDelay"],zI=["theme","rowSelection"],$h=["cellSelection","sideBar","rowNumbers","suppressGroupChangesColumnVisibility","groupAggFiltering","suppressStickyTotalRow","groupHideParentOfSingleChild","enableRowPinning"],Kh=["loadThemeGoogleFonts","suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMoveWhenColumnDragging","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","allowContextMenuWithControlKey","suppressContextMenu","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","enableCellSpan","suppressClickEdit","rowDragEntireRow","rowDragManaged","refreshAfterGroupEdit","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupHideColumnsUntilExpanded","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading","maintainColumnOrder","enableStrictPivotColumnOrder","suppressSetFilterByDefault","enableFilterHandlers","suppressStartEditOnTab","hidePaddedHeaderRows","ssrmExpandAllAffectsAllRows","animateColumnResizing"],Lw=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","dragAndDropImageComponent","fullWidthCellRenderer","loadingCellRenderer","overlayComponent","loadingOverlayComponent","noRowsOverlayComponent","overlayComponentSelector","activeOverlay","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getFullRowEditValidationErrors","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","tabToNextGridContainer","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","loadingCellRendererSelector","getRowId","chartMenuItems","groupTotalRow","alwaysPassFilter","isRowPinnable","isRowPinned","isRowValidDropPosition"],Gw=()=>[...HI,...NI,...kw,...Uh,...Lw,...Kh,...$h,...zI],_I=()=>[...kw,...Uh,...Lw,...Kh,...$h],WI=()=>({suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."},enableFillHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeSelection:{version:"32.2",message:"Use `cellSelection = true` instead."},suppressMultiRangeSelection:{version:"32.2",message:"Use `cellSelection.suppressMultiRanges` instead."},suppressClearOnFillReduction:{version:"32.2",message:"Use `cellSelection.handle.suppressClearOnFillReduction` instead."},fillHandleDirection:{version:"32.2",message:"Use `cellSelection.handle.direction` instead."},fillOperation:{version:"32.2",message:"Use `cellSelection.handle.setFillValue` instead."},suppressRowClickSelection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},suppressRowDeselection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},rowMultiSelectWithClick:{version:"32.2",message:"Use `rowSelection.enableSelectionWithoutKeys` instead."},groupSelectsChildren:{version:"32.2",message:'Use `rowSelection.groupSelects = "descendants"` instead.'},groupSelectsFiltered:{version:"32.2",message:'Use `rowSelection.groupSelects = "filteredDescendants"` instead.'},isRowSelectable:{version:"32.2",message:"Use `selectionOptions.isRowSelectable` instead."},suppressCopySingleCellRanges:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},suppressCopyRowsToClipboard:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},onRangeSelectionChanged:{version:"32.2",message:"Use `onCellSelectionChanged` instead."},onRangeDeleteStart:{version:"32.2",message:"Use `onCellSelectionDeleteStart` instead."},onRangeDeleteEnd:{version:"32.2",message:"Use `onCellSelectionDeleteEnd` instead."},suppressBrowserResizeObserver:{version:"32.2",message:"The grid always uses the browser's ResizeObserver, this grid option has no effect."},onColumnEverythingChanged:{version:"32.2",message:"Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events."},groupRemoveSingleChildren:{version:"33",message:"Use `groupHideParentOfSingleChild` instead."},groupRemoveLowestSingleChildren:{version:"33",message:'Use `groupHideParentOfSingleChild: "leafGroupsOnly"` instead.'},suppressRowGroupHidesColumns:{version:"33",message:'Use `suppressGroupChangesColumnVisibility: "suppressHideOnGroup"` instead.'},suppressMakeColumnVisibleAfterUnGroup:{version:"33",message:'Use `suppressGroupChangesColumnVisibility: "suppressShowOnUngroup"` instead.'},unSortIcon:{version:"33",message:"Use `defaultColDef.unSortIcon` instead."},sortingOrder:{version:"33",message:"Use `defaultColDef.sortingOrder` instead."},suppressPropertyNamesCheck:{version:"33",message:"`gridOptions` and `columnDefs` both have a `context` property that should be used for arbitrary user data. This means that column definitions and gridOptions should only contain valid properties making this property redundant."},suppressAdvancedFilterEval:{version:"34",message:"Advanced filter no longer uses function evaluation, so this option has no effect."}});function Ws(e,t,s){return typeof t=="number"||t==null?t==null||t>=s?null:`${e}: value should be greater than or equal to ${s}`:`${e}: value should be a number`}var UI={alignedGrids:"AlignedGrids",allowContextMenuWithControlKey:"ContextMenu",autoSizeStrategy:"ColumnAutoSize",cellSelection:"CellSelection",columnHoverHighlight:"ColumnHover",datasource:"InfiniteRowModel",doesExternalFilterPass:"ExternalFilter",editType:"EditCore",invalidEditValueMode:"EditCore",enableAdvancedFilter:"AdvancedFilter",enableCellSpan:"CellSpan",enableCharts:"IntegratedCharts",enableRangeSelection:"CellSelection",enableRowPinning:"PinnedRow",findSearchValue:"Find",getFullRowEditValidationErrors:"EditCore",getContextMenuItems:"ContextMenu",getLocaleText:"Locale",getMainMenuItems:"ColumnMenu",getRowClass:"RowStyle",getRowStyle:"RowStyle",groupTotalRow:"SharedRowGrouping",grandTotalRow:"ClientSideRowModelHierarchy",initialState:"GridState",isExternalFilterPresent:"ExternalFilter",isRowPinnable:"PinnedRow",isRowPinned:"PinnedRow",localeText:"Locale",masterDetail:"SharedMasterDetail",pagination:"Pagination",pinnedBottomRowData:"PinnedRow",pinnedTopRowData:"PinnedRow",pivotMode:"SharedPivot",pivotPanelShow:"RowGroupingPanel",quickFilterText:"QuickFilter",rowClass:"RowStyle",rowClassRules:"RowStyle",rowData:"ClientSideRowModel",rowDragManaged:"RowDrag",refreshAfterGroupEdit:["RowGrouping","TreeData"],rowGroupPanelShow:"RowGroupingPanel",rowNumbers:"RowNumbers",rowSelection:"SharedRowSelection",rowStyle:"RowStyle",serverSideDatasource:"ServerSideRowModel",sideBar:"SideBar",statusBar:"StatusBar",treeData:"SharedTreeData",undoRedoCellEditing:"UndoRedoEdit",valueCache:"ValueCache",viewportDatasource:"ViewportRowModel"},$I=()=>{const e={autoSizePadding:{validate({autoSizePadding:s}){return Ws("autoSizePadding",s,0)}},cacheBlockSize:{supportedRowModels:["serverSide","infinite"],validate({cacheBlockSize:s}){return Ws("cacheBlockSize",s,1)}},cacheOverflowSize:{validate({cacheOverflowSize:s}){return Ws("cacheOverflowSize",s,1)}},datasource:{supportedRowModels:["infinite"]},domLayout:{validate:s=>{const i=s.domLayout,r=["autoHeight","normal","print"];return i&&!r.includes(i)?`domLayout must be one of [${r.join()}], currently it's ${i}`:null}},enableFillHandle:{dependencies:{enableRangeSelection:{required:[!0]}}},enableRangeHandle:{dependencies:{enableRangeSelection:{required:[!0]}}},enableCellSpan:{supportedRowModels:["clientSide","serverSide"]},enableRangeSelection:{dependencies:{rowDragEntireRow:{required:[!1,void 0]}}},enableRowPinning:{supportedRowModels:["clientSide"],validate({enableRowPinning:s,pinnedTopRowData:i,pinnedBottomRowData:r}){return s&&(i||r)?"Manual row pinning cannot be used together with pinned row data. Either set `enableRowPinning` to `false`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.":null}},isRowPinnable:{supportedRowModels:["clientSide"],validate({enableRowPinning:s,isRowPinnable:i,pinnedTopRowData:r,pinnedBottomRowData:o}){return i&&(r||o)?"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinnable`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.":!s&&i?"`isRowPinnable` requires `enableRowPinning` to be set.":null}},isRowPinned:{supportedRowModels:["clientSide"],validate({enableRowPinning:s,isRowPinned:i,pinnedTopRowData:r,pinnedBottomRowData:o}){return i&&(r||o)?"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinned`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.":!s&&i?"`isRowPinned` requires `enableRowPinning` to be set.":null}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupHideColumnsUntilExpanded:{supportedRowModels:["clientSide"],validate({groupHideColumnsUntilExpanded:s,groupHideOpenParents:i,groupDisplayType:r}){return s&&!i&&r!=="multipleColumns"?"`groupHideColumnsUntilExpanded = true` requires either `groupDisplayType = 'multipleColumns'` or `groupHideOpenParents = true`":null}},groupHideOpenParents:{supportedRowModels:["clientSide","serverSide"],dependencies:{groupTotalRow:{required:[void 0,"bottom"]},treeData:{required:[void 0,!1],reason:"Tree Data has values at the group level so it doesn't make sense to hide them."}}},groupHideParentOfSingleChild:{dependencies:{groupHideOpenParents:{required:[void 0,!1]}}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:{required:[void 0,!1]},groupRemoveSingleChildren:{required:[void 0,!1]}}},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:{required:[void 0,!1]},groupRemoveLowestSingleChildren:{required:[void 0,!1]}}},groupSelectsChildren:{dependencies:{rowSelection:{required:["multiple"]}}},groupHierarchyConfig:{validate({groupHierarchyConfig:s={}},i,r){for(const o of Object.keys(s))r.validation?.validateColDef(s[o]);return null}},icons:{validate:({icons:s})=>{if(s){if(s.smallDown)return Ft(262);if(s.smallLeft)return Ft(263);if(s.smallRight)return Ft(264)}return null}},infiniteInitialRowCount:{validate({infiniteInitialRowCount:s}){return Ws("infiniteInitialRowCount",s,1)}},initialGroupOrderComparator:{supportedRowModels:["clientSide"]},ssrmExpandAllAffectsAllRows:{validate:s=>{if(typeof s.ssrmExpandAllAffectsAllRows=="boolean"){if(s.rowModelType!=="serverSide")return"'ssrmExpandAllAffectsAllRows' is only supported with the Server Side Row Model.";if(s.ssrmExpandAllAffectsAllRows&&typeof s.getRowId!="function")return"'getRowId' callback must be provided for Server Side Row Model grouping to work correctly."}return null}},keepDetailRowsCount:{validate({keepDetailRowsCount:s}){return Ws("keepDetailRowsCount",s,1)}},paginationPageSize:{validate({paginationPageSize:s}){return Ws("paginationPageSize",s,1)}},paginationPageSizeSelector:{validate:s=>{const i=s.paginationPageSizeSelector;return typeof i=="boolean"||i==null||i.length?null:`'paginationPageSizeSelector' cannot be an empty array. If you want to hide the page size selector, set paginationPageSizeSelector to false.`}},pivotMode:{dependencies:{treeData:{required:[!1,void 0],reason:"Pivot Mode is not supported with Tree Data."}}},quickFilterText:{supportedRowModels:["clientSide"]},rowBuffer:{validate({rowBuffer:s}){return Ws("rowBuffer",s,0)}},rowClass:{validate:s=>typeof s.rowClass=="function"?"rowClass should not be a function, please use getRowClass instead":null},rowData:{supportedRowModels:["clientSide"]},rowDragManaged:{supportedRowModels:["clientSide"],dependencies:{pagination:{required:[!1,void 0]}}},rowSelection:{validate({rowSelection:s}){return s&&typeof s=="string"?'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.':s&&typeof s!="object"?"Expected `RowSelectionOptions` object for the `rowSelection` property.":s&&s.mode!=="multiRow"&&s.mode!=="singleRow"?`Selection mode "${s.mode}" is invalid. Use one of 'singleRow' or 'multiRow'.`:null}},rowStyle:{validate:s=>{const i=s.rowStyle;return i&&typeof i=="function"?"rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead":null}},serverSideDatasource:{supportedRowModels:["serverSide"]},serverSideInitialRowCount:{supportedRowModels:["serverSide"],validate({serverSideInitialRowCount:s}){return Ws("serverSideInitialRowCount",s,1)}},serverSideOnlyRefreshFilteredGroups:{supportedRowModels:["serverSide"]},serverSideSortAllLevels:{supportedRowModels:["serverSide"]},sortingOrder:{validate:s=>{const i=s.sortingOrder;if(Array.isArray(i)&&i.length>0){const r=i.filter(o=>!Ut(o));if(r.length>0)return`sortingOrder must be an array of type (SortDirection | SortDef)[], incorrect items are: ${r.map(o=>typeof o=="string"||o==null?ll(o):JSON.stringify(o))}]`}else if(!Array.isArray(i)||!i.length)return`sortingOrder must be an array with at least one element, currently it's ${i}`;return null}},tooltipHideDelay:{validate:s=>s.tooltipHideDelay&&s.tooltipHideDelay<0?"tooltipHideDelay should not be lower than 0":null},tooltipShowDelay:{validate:s=>s.tooltipShowDelay&&s.tooltipShowDelay<0?"tooltipShowDelay should not be lower than 0":null},tooltipSwitchShowDelay:{validate:s=>s.tooltipSwitchShowDelay&&s.tooltipSwitchShowDelay<0?"tooltipSwitchShowDelay should not be lower than 0":null},treeData:{supportedRowModels:["clientSide","serverSide"],validate:s=>{const i=s.rowModelType??"clientSide";switch(i){case"clientSide":{const{treeDataChildrenField:r,treeDataParentIdField:o,getDataPath:n,getRowId:a}=s;if(!r&&!o&&!n)return"treeData requires either 'treeDataChildrenField' or 'treeDataParentIdField' or 'getDataPath' in the clientSide row model.";if(r){if(n)return"Cannot use both 'treeDataChildrenField' and 'getDataPath' at the same time.";if(o)return"Cannot use both 'treeDataChildrenField' and 'treeDataParentIdField' at the same time."}if(o){if(!a)return"getRowId callback not provided, tree data with parent id cannot be built.";if(n)return"Cannot use both 'treeDataParentIdField' and 'getDataPath' at the same time."}return null}case"serverSide":{const r=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${i} row model.`;return s.isServerSideGroup&&s.getServerSideGroupKey?null:r}}return null}},viewportDatasource:{supportedRowModels:["viewport"]},viewportRowModelBufferSize:{validate({viewportRowModelBufferSize:s}){return Ws("viewportRowModelBufferSize",s,0)}},viewportRowModelPageSize:{validate({viewportRowModelPageSize:s}){return Ws("viewportRowModelPageSize",s,1)}},rowDragEntireRow:{dependencies:{cellSelection:{required:[void 0]}}},autoGroupColumnDef:{validate({autoGroupColumnDef:s,showOpenedGroup:i}){return s?.field&&i?"autoGroupColumnDef.field and showOpenedGroup are not supported when used together.":s?.valueGetter&&i?"autoGroupColumnDef.valueGetter and showOpenedGroup are not supported when used together.":null}},renderingMode:{validate:s=>{const i=s.renderingMode,r=["default","legacy"];return i&&!r.includes(i)?`renderingMode must be one of [${r.join()}], currently it's ${i}`:null}},autoSizeStrategy:{validate:({autoSizeStrategy:s})=>{if(!s)return null;const i=["fitCellContents","fitGridWidth","fitProvidedWidth"],r=s.type;return r!=="fitCellContents"&&r!=="fitGridWidth"&&r!=="fitProvidedWidth"?`Invalid Auto-size strategy. \`autoSizeStrategy\` must be one of ${i.map(o=>'"'+o+'"').join(", ")}, currently it's ${r}`:r==="fitProvidedWidth"&&typeof s.width!="number"?`When using the 'fitProvidedWidth' auto-size strategy, must provide a numeric \`width\`. You provided ${s.width}`:null}}},t={};for(const s of Kh)t[s]={expectedType:"boolean"};for(const s of Uh)t[s]={expectedType:"number"};return Oe(t,e),t},KI=()=>({objectName:"gridOptions",allProperties:[...Gw(),...Object.values(rc)],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:WI(),validations:$I()}),jI=0,qI=0,Ow="__ag_grid_instance",YI=class extends E{constructor(){super(...arguments),this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.instanceId=qI++,this.gridReadyFired=!1,this.queueEvents=[],this.propEventSvc=new As,this.globalEventHandlerFactory=e=>(t,s)=>{if(!this.isAlive())return;const i=Qn.has(t);if(i&&!e||!i&&e||!XI(t))return;const r=(o,n)=>{const a=rc[o],l=this.gridOptions[a];typeof l=="function"&&this.beans.frameworkOverrides.wrapOutgoing(()=>l(n))};if(this.gridReadyFired)r(t,s);else if(t==="gridReady"){r(t,s),this.gridReadyFired=!0;for(const o of this.queueEvents)r(o.eventName,o.event);this.queueEvents=[]}else this.queueEvents.push({eventName:t,event:s})}}wireBeans(e){this.gridOptions=e.gridOptions,this.validation=e.validation,this.api=e.gridApi,this.gridId=e.context.getId()}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){this.validateGridOptions(this.gridOptions),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory().bind(this),!0),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propEventSvc.setFrameworkOverrides(this.beans.frameworkOverrides),this.addManagedEventListeners({gridOptionsChanged:({options:e})=>{this.updateGridOptions({options:e,force:!0,source:"optionsUpdated"})}})}destroy(){super.destroy(),this.queueEvents=[]}get(e){return this.gridOptions[e]??xm[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return D(this.gridOptions[e])}mergeGridCommonParams(e){return e&&(s=>e(this.addCommon(s)))}updateGridOptions({options:e,force:t,source:s="api"}){const i={id:jI++,properties:[]},r=[],{gridOptions:o,validation:n}=this;for(const a of Object.keys(e)){const l=vn.applyGlobalGridOption(a,e[a]);n?.warnOnInitialPropertyUpdate(s,a);const c=t||typeof l=="object"&&s==="api",d=o[a];if(c||d!==l){o[a]=l;const u={type:a,currentValue:l,previousValue:d,changeSet:i,source:s};r.push(u)}}this.validateGridOptions(this.gridOptions),i.properties=r.map(a=>a.type);for(const a of r)yi(this,`Updated property ${a.type} from`,a.previousValue," to ",a.currentValue),this.propEventSvc.dispatchEvent(a)}addPropertyEventListener(e,t){this.propEventSvc.addEventListener(e,t)}removePropertyEventListener(e,t){this.propEventSvc.removeEventListener(e,t)}getDomDataKey(){return this.domDataKey}addCommon(e){return e.api=this.api,e.context=this.gridOptionsContext,e}validateOptions(e,t){for(const s of Object.keys(e)){const i=e[s];if(i==null||i===!1)continue;let r=t[s];typeof r=="function"&&(r=r(e,this.gridOptions,this.beans)),r&&this.assertModuleRegistered(r,s)}}validateGridOptions(e){this.validateOptions(e,UI),this.validation?.processGridOptions(e)}validateColDef(e,t,s){(s||!this.beans.dataTypeSvc?.isColPendingInference(t))&&(this.validateOptions(e,LI),this.validation?.validateColDef(e))}assertModuleRegistered(e,t){const s=Array.isArray(e)?e.some(i=>this.isModuleRegistered(i)):this.isModuleRegistered(e);return s||Q(200,{...this.getModuleErrorParams(),moduleName:e,reasonOrId:t}),s}getModuleErrorParams(){return{gridId:this.gridId,gridScoped:Qd(),rowModelType:this.get("rowModelType"),isUmd:Jd()}}isModuleRegistered(e){return Zd(e,this.gridId,this.get("rowModelType"))}setInstanceDomData(e){e[Ow]=this.instanceId}isElementInThisInstance(e){let t=e;for(;t;){const s=t[Ow];if(D(s))return s===this.instanceId;t=t.parentElement}return!1}};function XI(e){return!!rc[e]}var ZI=class extends E{constructor(e,t){super(),this.column=e,this.eGui=t,this.lastMovingChanged=0}postConstruct(){this.addManagedElementListeners(this.eGui,{click:e=>e&&this.onClick(e)}),this.addManagedListeners(this.column,{movingChanged:()=>{this.lastMovingChanged=Date.now()}})}onClick(e){const{sortSvc:t,rangeSvc:s,gos:i}=this.beans;if(!(Ei(i)?e.altKey:!0))s?.handleColumnSelection(this.column,e);else if(this.column.isSortable()){const o=this.column.isMoving(),a=Date.now()-this.lastMovingChanged<50;o||a||t?.progressSortFromEvent(this.column,e)}}};function QI(e,t){const s={"aria-hidden":"true"};return{tag:"div",cls:"ag-cell-label-container",role:"presentation",children:[{tag:"span",ref:"eMenu",cls:"ag-header-icon ag-header-cell-menu-button",attrs:s},{tag:"span",ref:"eFilterButton",cls:"ag-header-icon ag-header-cell-filter-button",attrs:s},{tag:"div",ref:"eLabel",cls:"ag-header-cell-label",role:"presentation",children:[e?{tag:"span",ref:"eColRef",cls:"ag-header-col-ref"}:null,{tag:"span",ref:"eText",cls:"ag-header-cell-text"},{tag:"span",ref:"eFilter",cls:"ag-header-icon ag-header-label-icon ag-filter-icon",attrs:s},t?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:null]}]}}var Vw=class extends A{constructor(){super(...arguments),this.eFilter=x,this.eFilterButton=x,this.eSortIndicator=x,this.eMenu=x,this.eLabel=x,this.eText=x,this.eColRef=x,this.eSortOrder=x,this.eSortAsc=x,this.eSortDesc=x,this.eSortMixed=x,this.eSortNone=x,this.eSortAbsoluteAsc=x,this.eSortAbsoluteDesc=x,this.isLoadingInnerComponent=!1}refresh(e){const t=this.params;if(this.params=e,this.workOutTemplate(e,!!this.beans?.sortSvc)!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||e.enableSorting!=this.currentSort||e.column.formulaRef!=this.currentRef||this.currentSuppressMenuHide!=null&&this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||t.enableFilterButton!=e.enableFilterButton||t.enableFilterIcon!=e.enableFilterIcon)return!1;if(this.innerHeaderComponent){const s={...e};Oe(s,e.innerHeaderComponentParams),this.innerHeaderComponent.refresh?.(s)}else this.setDisplayName(e);return!0}workOutTemplate(e,t){const{formula:s}=this.beans,i=e.template;return i?i?.trim?i.trim():i:QI(!!s?.active,t)}init(e){this.params=e;const{sortSvc:t,touchSvc:s,rowNumbersSvc:i,userCompFactory:r}=this.beans,o=t?.getSortIndicatorSelector();this.currentTemplate=this.workOutTemplate(e,!!o),this.setTemplate(this.currentTemplate,o?[o]:void 0),this.eLabel&&(this.mouseListener??(this.mouseListener=this.createManagedBean(new ZI(e.column,this.eLabel)))),s?.setupForHeader(this),this.setMenu(),this.setupSort(),this.setupColumnRefIndicator(),i?.setupForHeader(this),this.setupFilterIcon(),this.setupFilterButton(),this.workOutInnerHeaderComponent(r,e),this.setDisplayName(e)}workOutInnerHeaderComponent(e,t){const s=DE(e,t,t);s&&(this.isLoadingInnerComponent=!0,s.newAgStackInstance().then(i=>{this.isLoadingInnerComponent=!1,i&&(this.isAlive()?(this.innerHeaderComponent=i,this.eText&&this.eText.appendChild(i.getGui())):this.destroyBean(i))}))}setDisplayName(e){const{displayName:t}=e,s=this.currentDisplayName;this.currentDisplayName=t,!(!this.eText||s===t||this.innerHeaderComponent||this.isLoadingInnerComponent)&&(this.eText.textContent=es(t))}addInIcon(e,t,s){const i=_(e,this.beans,s);i&&t.appendChild(i)}workOutShowMenu(){return this.params.enableMenu&&!!this.beans.menuSvc?.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return!!this.beans.menuSvc?.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){ue(this.eMenu),this.eMenu=void 0;return}const{gos:e,eMenu:t,params:s}=this,i=He(e);this.addInIcon(i?"menu":"menuAlt",t,s.column),t.classList.toggle("ag-header-menu-icon",!i);const r=this.shouldSuppressMenuHide();this.currentSuppressMenuHide=r,this.addManagedElementListeners(t,{click:()=>this.showColumnMenu(this.eMenu)}),this.toggleMenuAlwaysShow(r)}toggleMenuAlwaysShow(e){this.eMenu?.classList.toggle("ag-header-menu-always-show",e)}showColumnMenu(e){const{currentSuppressMenuHide:t,params:s}=this;t||this.toggleMenuAlwaysShow(!0),s.showColumnMenu(e,()=>{t||this.toggleMenuAlwaysShow(!1)})}onMenuKeyboardShortcut(e){const{params:t,gos:s,beans:i,eMenu:r,eFilterButton:o}=this,n=t.column,a=He(s);if(e&&!a){if(i.menuSvc?.isFilterMenuInHeaderEnabled(n))return t.showFilter(o??r??this.getGui()),!0}else if(t.enableMenu)return this.showColumnMenu(r??o??this.getGui()),!0;return!1}setupSort(){const{sortSvc:e}=this.beans;if(!e)return;const{enableSorting:t,column:s}=this.params;if(this.currentSort=t,!this.eSortIndicator){this.eSortIndicator=this.createBean(e.createSortIndicator(!0));const{eSortIndicator:i,eSortOrder:r,eSortAsc:o,eSortDesc:n,eSortMixed:a,eSortNone:l,eSortAbsoluteAsc:c,eSortAbsoluteDesc:d}=this;i.attachCustomElements(r,o,n,a,l,c,d)}this.eSortIndicator.setupSort(s),this.currentSort&&e.setupHeader(this,s)}setupColumnRefIndicator(){const{eColRef:e,beans:{editModelSvc:t},params:s}=this;e&&(this.currentRef=s.column.formulaRef,e.textContent=this.currentRef,V(e,!1),this.addManagedEventListeners({cellEditingStarted:()=>{const i=t?.getEditPositions(),r=!!this.currentRef&&!!i?.some(o=>o.column.isAllowFormula());V(e,r)},cellEditingStopped:()=>{V(e,!1)}}))}setupFilterIcon(){const{eFilter:e,params:t}=this;if(!e)return;const s=()=>{const i=t.column.isFilterActive();V(e,i,{skipAriaHidden:!0})};this.configureFilter(t.enableFilterIcon,e,s,"filterActive")}setupFilterButton(){const{eFilterButton:e,params:t}=this;if(!e)return;this.configureFilter(t.enableFilterButton,e,this.onFilterChangedButton.bind(this),"filter")?this.addManagedElementListeners(e,{click:()=>t.showFilter(e)}):this.eFilterButton=void 0}configureFilter(e,t,s,i){if(!e)return ue(t),!1;const r=this.params.column;return this.addInIcon(i,t,r),this.addManagedListeners(r,{filterChanged:s}),s(),!0}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){const{eFilterButton:t,eMenu:s}=this;return e?t??s??this.getGui():s??t??this.getGui()}destroy(){super.destroy(),this.innerHeaderComponent=this.destroyBean(this.innerHeaderComponent),this.mouseListener=this.destroyBean(this.mouseListener)}},JI=class extends E{constructor(e,t){super(),this.eLabel=e,this.columnGroup=t,this.isSticky=!1,this.left=null,this.right=null}postConstruct(){const{columnGroup:e,beans:t}=this,{ctrlsSvc:s}=t;s.whenReady(this,()=>{const i=this.refreshPosition.bind(this);e.getPinned()==null&&this.addManagedEventListeners({bodyScroll:r=>{r.direction==="horizontal"&&this.updateSticky(r.left)}}),this.addManagedListeners(e,{leftChanged:i,displayedChildrenChanged:i}),this.addManagedEventListeners({columnResized:i}),this.refreshPosition()})}refreshPosition(){const{columnGroup:e,beans:t}=this,s=e.getLeft(),i=e.getActualWidth();if(s==null||i===0){this.left=null,this.right=null,this.setSticky(!1);return}this.left=s,this.right=s+i;const r=t.colViewport.getScrollPosition();r!=null&&this.updateSticky(r)}updateSticky(e){const{beans:t,left:s,right:i}=this;if(s==null||i==null){this.setSticky(!1);return}const{gos:r,visibleCols:o}=t,a=r.get("enableRtl")?o.bodyWidth-e:e;this.setSticky(sa)}setSticky(e){const{isSticky:t,eLabel:s}=this;t!==e&&(this.isSticky=e,s.classList.toggle("ag-sticky-label",e))}},e2={tag:"div",cls:"ag-header-group-cell-label",role:"presentation",children:[{tag:"span",ref:"agLabel",cls:"ag-header-group-text",role:"presentation"},{tag:"span",ref:"agOpened",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"},{tag:"span",ref:"agClosed",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"}]},t2=class extends A{constructor(){super(e2),this.agOpened=x,this.agClosed=x,this.agLabel=x,this.isLoadingInnerComponent=!1}init(e){const{userCompFactory:t,touchSvc:s}=this.beans;this.params=e,this.checkWarnings(),this.workOutInnerHeaderGroupComponent(t,e),this.setupLabel(e),this.addGroupExpandIcon(e),this.setupExpandIcons(),s?.setupForHeaderGroup(this)}checkWarnings(){this.params.template&&F(89)}workOutInnerHeaderGroupComponent(e,t){const s=IE(e,t,t);s&&(this.isLoadingInnerComponent=!0,s.newAgStackInstance().then(i=>{this.isLoadingInnerComponent=!1,i&&(this.isAlive()?(this.innerHeaderGroupComponent=i,this.agLabel.appendChild(i.getGui())):this.destroyBean(i))}))}setupExpandIcons(){const{agOpened:e,agClosed:t,params:{columnGroup:s},beans:{colGroupSvc:i}}=this;this.addInIcon("columnGroupOpened",e),this.addInIcon("columnGroupClosed",t);const r=l=>{if(Gt(l))return;const c=!s.isExpanded();i.setColumnGroupOpened(s.getProvidedColumnGroup(),c,"uiColumnExpanded")};this.addTouchAndClickListeners(t,r),this.addTouchAndClickListeners(e,r);const o=l=>{Ee(l)};this.addManagedElementListeners(t,{dblclick:o}),this.addManagedElementListeners(e,{dblclick:o}),this.addManagedElementListeners(this.getGui(),{dblclick:r}),this.updateIconVisibility();const n=s.getProvidedColumnGroup(),a=this.updateIconVisibility.bind(this);this.addManagedListeners(n,{expandedChanged:a,expandableChanged:a})}addTouchAndClickListeners(e,t){this.beans.touchSvc?.setupForHeaderGroupElement(this,e,t),this.addManagedElementListeners(e,{click:t})}updateIconVisibility(){const{agOpened:e,agClosed:t,params:{columnGroup:s}}=this;if(s.isExpandable()){const i=s.isExpanded();V(e,i),V(t,!i)}else V(e,!1),V(t,!1)}addInIcon(e,t){const s=_(e,this.beans,null);s&&t.appendChild(s)}addGroupExpandIcon(e){if(!e.columnGroup.isExpandable()){const{agOpened:t,agClosed:s}=this;V(t,!1),V(s,!1)}}setupLabel(e){const{displayName:t,columnGroup:s}=e,{innerHeaderGroupComponent:i,isLoadingInnerComponent:r}=this,o=i||r;D(t)&&!o&&(this.agLabel.textContent=es(t)),s.getColGroupDef()?.suppressStickyLabel||this.createManagedBean(new JI(this.getGui(),s))}destroy(){super.destroy(),this.innerHeaderGroupComponent&&(this.destroyBean(this.innerHeaderGroupComponent),this.innerHeaderGroupComponent=void 0)}},s2={moduleName:"ColumnHeaderComp",version:H,userComponents:{agColumnHeader:Vw},icons:{menu:"menu",menuAlt:"menu-alt"}},i2={moduleName:"ColumnGroupHeaderComp",version:H,userComponents:{agColumnGroupHeader:t2},icons:{columnGroupOpened:"expanded",columnGroupClosed:"contracted"}},r2=class extends E{constructor(){super(...arguments),this.beanName="animationFrameSvc",this.p1={list:[],sorted:!1},this.p2={list:[],sorted:!1},this.f1={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastScrollTop=0,this.taskCount=0}setScrollTop(e){this.scrollGoingDown=e>=this.lastScrollTop,e===0&&(this.scrollGoingDown=!0),this.lastScrollTop=e}postConstruct(){this.active=!this.gos.get("suppressAnimationFrame"),this.batchFrameworkComps=this.beans.frameworkOverrides.batchFrameworkComps}verify(){this.active===!1&&F(92)}createTask(e,t,s,i,r=!1){this.verify();let o=s;i&&this.batchFrameworkComps&&(o="f1");const n={task:e,index:t,createOrder:++this.taskCount,deferred:r};this.addTaskToList(this[o],n),this.schedule()}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((s,i)=>s.deferred!==i.deferred?s.deferred?-1:1:s.index!==i.index?t*(i.index-s.index):i.createOrder-s.createOrder),e.sorted=!0}addDestroyTask(e){this.verify(),this.destroyTasks.push(e),this.schedule()}executeFrame(e){const{p1:t,p2:s,f1:i,destroyTasks:r,beans:o}=this,{ctrlsSvc:n,frameworkOverrides:a}=o,l=t.list,c=s.list,d=i.list,u=Date.now();let h=0;const g=e<=0,p=n.getScrollFeature();for(;g||h{for(;(g||h{};else if(r.length)m=r.pop();else break;m()}h=Date.now()-u}l.length||c.length||d.length||r.length?this.requestFrame():this.ticking=!1}flushAllFrames(){this.active&&this.executeFrame(-1)}schedule(){this.active&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);Rt(this.beans,e)}isQueueEmpty(){return!this.ticking}},o2={moduleName:"AnimationFrame",version:H,beans:[r2]},n2=class extends E{constructor(){super(...arguments),this.beanName="iconSvc"}createIconNoSpan(e,t){return _(e,this.beans,t?.column)}},a2=(e,t,s)=>t||e&&s,l2=class extends E{constructor(){super(...arguments),this.beanName="touchSvc"}mockBodyContextMenu(e,t){this.mockContextMenu(e,e.eBodyViewport,t)}mockHeaderContextMenu(e,t){this.mockContextMenu(e,e.eGui,t)}mockRowContextMenu(e){if(!ni())return;const t=(s,i,r)=>{const{rowCtrl:o,cellCtrl:n}=e.getControlsForEventTarget(r?.target??null);n?.column&&n.dispatchCellContextMenuEvent(r??null),this.beans.contextMenuSvc?.handleContextMenuMouseEvent(void 0,r,o,n)};this.mockContextMenu(e,e.element,t)}handleCellDoubleClick(e,t){return(()=>{if(!ni()||Ja("dblclick"))return!1;const i=Date.now(),r=i-e.lastIPadMouseClickEvent<200;return e.lastIPadMouseClickEvent=i,r})()?(e.onCellDoubleClicked(t),t.preventDefault(),!0):!1}setupForHeader(e){const{gos:t,sortSvc:s,menuSvc:i}=this.beans;if(t.get("suppressTouch"))return;const{params:r,eMenu:o,eFilterButton:n}=e,a=new as(e.getGui(),!0);e.addDestroyFunc(()=>a.destroy());const l=e.shouldSuppressMenuHide(),c=l&&D(o)&&r.enableMenu,d=!!i?.isHeaderContextMenuEnabled(r.column),u=a2(r.enableMenu,d,He(t));let h=a;c&&(h=new as(o,!0),e.addDestroyFunc(()=>h.destroy()));const g=p=>r.showColumnMenuAfterMouseClick(p.touchStart);if(c&&r.enableMenu&&e.addManagedListeners(h,{tap:g}),u&&e.addManagedListeners(a,{longTap:g}),r.enableSorting){const p=f=>{const m=f.touchStart.target;l&&(o?.contains(m)||n?.contains(m))||s?.progressSort(r.column,!1,"uiColumnSorted")};e.addManagedListeners(a,{tap:p})}if(r.enableFilterButton&&n){const p=new as(n,!0);e.addManagedListeners(p,{tap:()=>r.showFilter(n)}),e.addDestroyFunc(()=>p.destroy())}}setupForHeaderGroup(e){const t=e.params;if(this.beans.menuSvc?.isHeaderContextMenuEnabled(t.columnGroup.getProvidedColumnGroup())){const s=new as(t.eGridHeader,!0),i=r=>t.showColumnMenuAfterMouseClick(r.touchStart);e.addManagedListeners(s,{longTap:i}),e.addDestroyFunc(()=>s.destroy())}}setupForHeaderGroupElement(e,t,s){const i=new as(t,!0);e.addManagedListeners(i,{tap:s}),e.addDestroyFunc(()=>i.destroy())}mockContextMenu(e,t,s){if(!ni())return;const i=new as(t),r=o=>{mn(this.beans,o.touchEvent)&&s(void 0,o.touchStart,o.touchEvent)};e.addManagedListeners(i,{longTap:r}),e.addDestroyFunc(()=>i.destroy())}},c2={moduleName:"Touch",version:H,beans:[l2]},d2=class extends E{constructor(){super(...arguments),this.beanName="cellNavigation"}wireBeans(e){this.rowSpanSvc=e.rowSpanSvc}getNextCellToFocus(e,t,s=!1){return s?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const s=e===b.UP,i=e===b.DOWN,r=e===b.LEFT;let o,n;const{pageBounds:a,gos:l,visibleCols:c,pinnedRowModel:d}=this.beans,{rowPinned:u}=t;if(s||i)u&&d?s?n=0:n=u==="top"?d.getPinnedTopRowCount()-1:d.getPinnedBottomRowCount()-1:n=s?a.getFirstRow():a.getLastRow(),o=t.column;else{const h=l.get("enableRtl");n=t.rowIndex,o=(r!==h?c.allCols:[...c.allCols].reverse()).find(p=>!Fe(p)&&this.isCellGoodToFocusOn({rowIndex:n,rowPinned:null,column:p}))}return o?{rowIndex:n,rowPinned:u,column:o}:null}getNextCellToFocusWithoutCtrlPressed(e,t){let s=t,i=!1;for(;!i;){switch(e){case b.UP:s=this.getCellAbove(s);break;case b.DOWN:s=this.getCellBelow(s);break;case b.RIGHT:s=this.gos.get("enableRtl")?this.getCellToLeft(s):this.getCellToRight(s);break;case b.LEFT:s=this.gos.get("enableRtl")?this.getCellToRight(s):this.getCellToLeft(s);break;default:s=null,F(8,{key:e});break}s?i=this.isCellGoodToFocusOn(s):i=!0}return s}isCellGoodToFocusOn(e){const t=e.column;let s;const{pinnedRowModel:i,rowModel:r}=this.beans;switch(e.rowPinned){case"top":s=i?.getPinnedTopRow(e.rowIndex);break;case"bottom":s=i?.getPinnedBottomRow(e.rowIndex);break;default:s=r.getRow(e.rowIndex);break}return s?!this.isSuppressNavigable(t,s):!1}getCellToLeft(e){if(!e)return null;const t=this.beans.visibleCols.getColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.beans.visibleCols.getColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellBelow(e){if(!e)return null;const t=this.rowSpanSvc?.getCellEnd(e)??e,s=Je(this.beans,t,!0);return s?{rowIndex:s.rowIndex,column:e.column,rowPinned:s.rowPinned}:null}getCellAbove(e){if(!e)return null;const t=this.rowSpanSvc?.getCellStart(e)??e,s=Yt(this.beans,{rowIndex:t.rowIndex,rowPinned:t.rowPinned},!0);return s?{rowIndex:s.rowIndex,column:e.column,rowPinned:s.rowPinned}:null}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const{visibleCols:t,pagination:s}=this.beans,i=t.allCols;let r=e.rowIndex,o=e.rowPinned,n=t.getColAfter(e.column);if(!n){n=i[0];const a=Je(this.beans,e,!0);if(ne(a)||!a.rowPinned&&!(s?.isRowInPage(a.rowIndex)??!0))return null;r=a?a.rowIndex:null,o=a?a.rowPinned:null}return{rowIndex:r,column:n,rowPinned:o}}getNextTabbedCellBackwards(e){const{beans:t}=this,{visibleCols:s,pagination:i}=t,r=s.allCols;let o=e.rowIndex,n=e.rowPinned,a=s.getColBefore(e.column);if(!a){a=W(r);const l=Yt(t,{rowIndex:e.rowIndex,rowPinned:e.rowPinned},!0);if(ne(l)||!l.rowPinned&&!(i?.isRowInPage(l.rowIndex)??!0))return null;o=l?l.rowIndex:null,n=l?l.rowPinned:null}return{rowIndex:o,column:a,rowPinned:n}}isSuppressNavigable(e,t){const{suppressNavigable:s}=e.colDef;if(typeof s=="boolean")return s;if(typeof s=="function"){const i=e.createColumnFunctionCallbackParams(t);return s(i)}return!1}};function u2(e){return e.focusSvc.getFocusedCell()}function h2(e){return e.focusSvc.clearFocusedCell()}function g2(e,t,s,i){e.focusSvc.setFocusedCell({rowIndex:t,column:s,rowPinned:i,forceBrowserFocus:!0})}function p2(e,t){return e.navigation?.tabToNextCell(!1,t)??!1}function f2(e,t){return e.navigation?.tabToNextCell(!0,t)??!1}function m2(e,t,s=!1){const i=e.headerNavigation?.getHeaderPositionForColumn(t,s);i&&e.focusSvc.focusHeaderPosition({headerPosition:i})}function Us(e){const t=e;return t?.getFrameworkComponentInstance!=null?t.getFrameworkComponentInstance():e}var C2=class extends E{constructor(){super(...arguments),this.beanName="editModelSvc",this.edits=new Map,this.cellValidations=new Bw,this.rowValidations=new Nw,this.suspendEdits=!1}suspend(e){this.suspendEdits=e}removeEdits({rowNode:e,column:t}){if(!this.hasEdits({rowNode:e})||!e)return;const s=this.getEditRow(e);t?s.delete(t):s.clear(),s.size===0&&this.edits.delete(e)}getEditRow(e,t={}){if(this.suspendEdits||this.edits.size===0)return;const s=e&&this.edits.get(e);if(s)return s;if(t.checkSiblings){const i=e.pinnedSibling;if(i)return this.getEditRow(i)}}getEditRowDataValue(e,{checkSiblings:t}={}){if(!e||this.edits.size===0)return;const s=this.getEditRow(e),i=e.pinnedSibling,r=t&&i&&this.getEditRow(i);if(!s&&!r)return;const o={...e.data},n=(a,l)=>a.forEach(({editorValue:c,pendingValue:d},u)=>{const h=c===void 0?d:c;h!==st&&(l[u.getColId()]=h)});return s&&n(s,o),r&&n(r,o),o}getEdit(e={},t){const{rowNode:s,column:i}=e,r=this.edits;if(this.suspendEdits||r.size===0||!s||!i)return;const o=r.get(s)?.get(i);if(o)return o;if(t?.checkSiblings){const n=s.pinnedSibling;if(n)return r.get(n)?.get(i)}}getEditMap(e=!0){if(this.suspendEdits||this.edits.size===0)return new Map;if(!e)return this.edits;const t=new Map;return this.edits.forEach((s,i)=>{const r=new Map;s.forEach(({editorState:o,...n},a)=>r.set(a,{...n})),t.set(i,r)}),t}setEditMap(e){this.edits.clear(),e.forEach((t,s)=>{const i=new Map;t.forEach((r,o)=>i.set(o,{...r})),this.edits.set(s,i)})}setEdit(e,t){const s=this.edits;(s.size===0||!s.has(e.rowNode))&&s.set(e.rowNode,new Map);const i=this.getEdit(e),r={editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0},...i,...t};return this.getEditRow(e.rowNode).set(e.column,r),r}clearEditValue(e){const{rowNode:t,column:s}=e;if(!t)return;const i=o=>{o.editorValue=void 0,o.pendingValue=o.sourceValue,o.state="changed"};if(!s){this.getEditRow(t)?.forEach(i);return}const r=this.getEdit(e);r&&i(r)}getState(e){if(!this.suspendEdits)return this.getEdit(e)?.state}getEditPositions(e){if(this.suspendEdits||(e??this.edits).size===0)return[];const t=[];return(e??this.edits).forEach((s,i)=>{for(const r of s.keys()){const{editorState:o,...n}=s.get(r);t.push({rowNode:i,column:r,...n})}}),t}hasRowEdits(e,t){return this.suspendEdits||this.edits.size===0?!1:!!this.getEditRow(e,t)}hasEdits(e={},t={}){if(this.suspendEdits||this.edits.size===0)return!1;const{rowNode:s,column:i}=e,{withOpenEditor:r}=t;if(s){const o=this.getEditRow(s,t);return o?i?r?this.getEdit(e)?.state==="editing":o.has(i):o.size!==0?r?Array.from(o.values()).some(({state:n})=>n==="editing"):!0:!1:!1}return r?this.getEditPositions().some(({state:o})=>o==="editing"):this.edits.size>0}start(e){const t=this.getEditRow(e.rowNode)??new Map,{rowNode:s,column:i}=e;i&&!t.has(i)&&t.set(i,{editorValue:void 0,pendingValue:st,sourceValue:this.beans.valueSvc.getValue(i,s,"data"),state:"editing",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}}),this.edits.set(s,t)}stop(e,t,s){if(this.hasEdits(e))if(t){const i=this.getEditRow(e.rowNode)?.get(e.column);i&&(i.pendingValue===st||i.pendingValue===i.sourceValue)?this.removeEdits(e):i&&s&&(i.editorValue=void 0)}else this.removeEdits(e)}clear(){for(const e of this.edits.values())e.clear();this.edits.clear()}getCellValidationModel(){return this.cellValidations}getRowValidationModel(){return this.rowValidations}setCellValidationModel(e){this.cellValidations=e}setRowValidationModel(e){this.rowValidations=e}destroy(){super.destroy(),this.clear()}},Bw=class{constructor(){this.cellValidations=new Map}getCellValidation(e){const{rowNode:t,column:s}=e||{};return this.cellValidations?.get(t)?.get(s)}hasCellValidation(e){return!e?.rowNode||!e.column?this.cellValidations.size>0:!!this.getCellValidation(e)}setCellValidation(e,t){const{rowNode:s,column:i}=e;this.cellValidations.has(s)||this.cellValidations.set(s,new Map),this.cellValidations.get(s).set(i,t)}clearCellValidation(e){const{rowNode:t,column:s}=e;this.cellValidations.get(t)?.delete(s)}setCellValidationMap(e){this.cellValidations=e}getCellValidationMap(){return this.cellValidations}clearCellValidationMap(){this.cellValidations.clear()}},Nw=class{constructor(){this.rowValidations=new Map}getRowValidation(e){const{rowNode:t}=e||{};return this.rowValidations.get(t)}hasRowValidation(e){return e?.rowNode?!!this.getRowValidation(e):this.rowValidations.size>0}setRowValidation({rowNode:e},t){this.rowValidations.set(e,t)}clearRowValidation({rowNode:e}){this.rowValidations.delete(e)}setRowValidationMap(e){this.rowValidations=e}getRowValidationMap(){return this.rowValidations}clearRowValidationMap(){this.rowValidations.clear()}};function oc(e,t={}){const{rowIndex:s,rowId:i,rowCtrl:r,rowPinned:o}=t;if(r)return r;const{rowModel:n,rowRenderer:a}=e;let{rowNode:l}=t;return l||(i?l=dP(e,i,o):s!=null&&(l=n.getRow(s))),l?a.getRowCtrlByNode(l):void 0}function ce(e,t={}){const{cellCtrl:s,colId:i,columnId:r,column:o}=t;if(s)return s;const n=e.colModel.getCol(i??r??jh(o)),a=t.rowCtrl??oc(e,t),l=a?.getCellCtrl(n)??void 0;if(l)return l;const c=t.rowNode??a?.rowNode;if(c)return e.rowRenderer.getCellCtrls([c],[n])?.[0]}function Hw(e){const{editSvc:t}=e;t?.isBatchEditing()?(Hi(e,{persist:!0}),zi(e)):t?.stopEditing(void 0,{source:"api"})}function v2(e,t,s){const{gos:i,popupSvc:r}=t;if(!i.get("stopEditingWhenCellsLoseFocus"))return;const o=n=>{const a=n.relatedTarget;if(Mu(a)===null){Hw(t);return}let l=s.some(c=>c.contains(a))&&i.isElementInThisInstance(a);l||(l=!!r&&(r.getActivePopups().some(c=>c.contains(a))||r.isElementWithinCustomPopup(a))),l||Hw(t)};for(const n of s)e.addManagedElementListeners(n,{focusout:o})}function jh(e){if(e)return typeof e=="string"?e:e.getColId()}var st=Symbol("unedited"),w2=(e,t={})=>{const s=e.rowRenderer.getCellCtrls(t.rowNodes,t.columns),i=new Array(s.length);let r=0;for(let o=0,n=s.length;o0&&t.set(s,r)}return t}function kr(e,t,s){const{key:i,event:r,cellStartedEdit:o,silent:n}=s??{},{editModelSvc:a,gos:l,userCompFactory:c}=e,d=ce(e,t),u=d?.comp?.getCellEditor(),h=_w(e,t,i,o&&!n),g=a?.getEdit(t),p=h.value??g?.sourceValue;if(u){a?.setEdit(t,{editorValue:So(e,p,!0,t.column),state:"editing"}),u.refresh?.(h);return}const f=t.column.getColDef(),m=hC(c,f,h);if(!m)return;const{popupFromSelector:C,popupPositionFromSelector:v}=m,w=C??!!f.cellEditorPopup,S=v??f.cellEditorPopupPosition;if(Ww(m.params,r),!d)return;const{rangeFeature:y,rowCtrl:R,comp:P,onEditorAttachedFuncs:M}=d;a?.setEdit(t,{editorValue:So(e,p,!0,t.column),state:"editing",editorState:{cellStartedEditing:void 0,cellStoppedEditing:void 0}}),d.editCompDetails=m,M.push(()=>y?.unsetComp()),P?.setEditDetails(m,w,S,l.get("reactiveCustomComponents")),R?.refreshRow({suppressFlash:!0}),y2(e,t,r,p,n)}function y2(e,t,s,i,r){const{editSvc:o,editModelSvc:n}=e,a=n?.getEdit(t);!r&&a?.state==="editing"&&!a?.editorState?.cellStartedEditing&&(o?.dispatchCellEvent(t,s,"cellEditingStarted",{value:i}),n?.setEdit(t,{editorState:{cellStartedEditing:!0}}))}function zw(e,t,s){const i={editorValueExists:!1};if(qh(e)&&(t.getValidationErrors?.()?.length??0)>0||s?.isCancelling)return i;if(s?.isStopping){const o=t?.isCancelAfterEnd?.();if(o)return{...i,isCancelAfterEnd:o}}return{editorValue:t.getValue(),editorValueExists:!0}}function _w(e,t,s,i){const{valueSvc:r,gos:o,editSvc:n}=e,a=e.gos.get("enableGroupEdit"),l=ce(e,t),c=t.rowNode?.rowIndex??void 0,d=n?.isBatchEditing(),u=e.colModel.getCol(t.column.getId()),{rowNode:h,column:g}=t,p=l.comp?.getCellEditor(),f=n?.getCellDataValue(t),m=f===void 0?p?zw(e,p)?.editorValue:void 0:f,C=m===st?r.getValueForDisplay({column:u,node:h,from:"edit"})?.value:m;let v=a?m:C;return g.isAllowFormula()&&e.formula?.isFormula(v)&&(v=e.formula?.normaliseFormula(v,!0)??v),N(o,{value:v,eventKey:s??null,column:g,colDef:g.getColDef(),rowIndex:c,node:h,data:h.data,cellStartedEdit:!!i,onKeyDown:l?.onKeyDown.bind(l),stopEditing:w=>{n.stopEditing(t,{source:d?"ui":"api",suppressNavigateAfterEdit:w}),ea(e,t,{})},eGridCell:l?.eGui,parseValue:w=>r.parseValue(u,h,w,l?.value),formatValue:l?.formatValue.bind(l),validate:()=>{n?.validateEdit()}})}function Jn(e,t){const{editModelSvc:s}=e;s?.getEditMap().forEach((i,r)=>{i.forEach((o,n)=>{!t&&(o.state==="editing"||o.pendingValue===st)||!Fs(o)&&(o.state!=="editing"||t)&&s?.removeEdits({rowNode:r,column:n})})})}function x2(e,t){const s=t.comp?.getCellEditor();if(!s?.refresh)return;const{eventKey:i,cellStartedEdit:r}=t.editCompDetails.params,{column:o}=t,n=_w(e,t,i,r),a=o.getColDef(),l=hC(e.userCompFactory,a,n);s.refresh(Ww(l.params,i))}function Ww(e,t){return t instanceof KeyboardEvent&&e.column.getColDef().cellEditor==="agNumberCellEditor"?e.suppressPreventDefault=["-","+",".","e"].includes(t?.key??"")||e.suppressPreventDefault:t?.preventDefault?.(),e}function Hi(e,t){for(const s of e.editModelSvc?.getEditPositions()??[]){const i=ce(e,s);if(!i)continue;const r=i.comp?.getCellEditor();if(!r)continue;const{editorValue:o,editorValueExists:n,isCancelAfterEnd:a}=zw(e,r,t);if(a){const{cellStartedEditing:l,cellStoppedEditing:c}=e.editModelSvc?.getEdit(s)?.editorState||{};e.editModelSvc?.setEdit(s,{editorState:{isCancelAfterEnd:a,cellStartedEditing:l,cellStoppedEditing:c}})}bo(e,s,o,void 0,!n,t)}}function bo(e,t,s,i,r,o){const{editModelSvc:n,valueSvc:a}=e;if(!n)return;const{rowNode:l,column:c}=t;if(!(l&&c))return;let d=n.getEdit(t);if(d?.sourceValue===void 0){const u=d?So(e,d.editorValue,!1,c):st,h={sourceValue:a.getValue(c,l,"data"),pendingValue:u};o?.persist&&(h.state="changed"),d=n.setEdit(t,h)}n.setEdit(t,{editorValue:r?So(e,d.sourceValue,!0,c):s}),o?.persist&&R2(e,t)}function So(e,t,s,i){const{formula:r}=e;return i.isAllowFormula()&&r?.isFormula(t)?r?.normaliseFormula(t,s)??t:t}function R2(e,t){const{editModelSvc:s}=e,i=s?.getEdit(t),o={pendingValue:So(e,i?.editorValue,!1,t.column)};!i?.editorState?.cellStoppedEditing&&i?.state!=="editing"&&(o.state="changed"),s?.setEdit(t,o)}function zi(e,t,s={}){if(t||(t=e.editModelSvc?.getEditPositions()),t)for(const i of t)ea(e,i,s)}function ea(e,t,s,i=ce(e,t)){const r=e.editModelSvc,o=r?.getEdit(t);let n;if(o&&o.state!=="editing"&&o.editorState?.cellStoppedEditing?n=o.state:n="changed",!i){o&&r?.setEdit(t,{state:n});return}const a=i.comp,l=a?.getCellEditor();if(a&&!l){if(i?.refreshCell(),o){r?.setEdit(t,{state:n});const d=e.gos.get("enableGroupEdit")?Uw(o,s?.cancel):{valueChanged:!1,newValue:void 0,oldValue:o.sourceValue};$w(e,t,d,s)}return}if(qh(e)){const d=o&&l?.getValidationErrors?.(),u=r?.getCellValidationModel();d?.length?u?.setCellValidation(t,{errorMessages:d}):u?.clearCellValidation(t)}o&&r?.setEdit(t,{state:n}),a?.setEditDetails(),a?.refreshEditStyles(!1,!1),i?.refreshCell({force:!0,suppressFlash:!0});const c=r?.getEdit(t);if(c&&c.state!=="editing"){const d=s?.cancel,u=e.gos.get("enableGroupEdit")?Uw(c,d):F2(c,o,d);$w(e,t,u,s)}}function Uw(e,t){const{sourceValue:s,pendingValue:i}=e;let r;return!t&&i!==st&&(r=i),{valueChanged:!t&&Fs(e),newValue:r,oldValue:s,value:s}}function F2(e,t,s){if(s||e.editorState.isCancelAfterEnd)return{valueChanged:!1,newValue:void 0,oldValue:e.sourceValue};let i=e.editorValue;return(i==null||i===st)&&(i=t?.pendingValue),i===st&&(i=void 0),{valueChanged:Fs(e),newValue:i,oldValue:e.sourceValue}}function $w(e,t,s,{silent:i,event:r}={}){const{editSvc:o,editModelSvc:n}=e,a=n?.getEdit(t),{editorState:l}=a||{},{isCancelBeforeStart:c,cellStartedEditing:d,cellStoppedEditing:u}=l||{};!i&&!c&&d&&!u&&(o?.dispatchCellEvent(t,r,"cellEditingStopped",s),n?.setEdit(t,{editorState:{cellStoppedEditing:!0}}))}function E2(e){if(!e)return!1;for(let t=0,s=e.length;t0,w=v?m.join(". "):"";Wa(C,v),v&&i.announceValue(`${c} ${m}`,"editorValidation"),C instanceof HTMLInputElement?C.setCustomValidity(w):C.classList.toggle("invalid",v)}m?.length>0&&s.setCellValidation({rowNode:p,column:f},{errorMessages:m}),d.add(u.rowCtrl)}if(Hi(e,{persist:!1}),o?.setCellValidationModel(s),a){const u=M2(e);o?.setRowValidationModel(u)}for(const u of d.values()){u.rowEditStyleFeature?.applyRowStyles();for(const h of u.getAllCellCtrls())h.tooltipFeature?.refreshTooltip(!0),h.editorTooltipFeature?.refreshTooltip(!0),h.editStyleFeature?.applyCellStyles?.()}}var M2=e=>{const t=new Nw,s=e.gos.get("getFullRowEditValidationErrors"),i=e.editModelSvc?.getEditMap();if(!i)return t;for(const r of i.keys()){const o=i.get(r);if(!o)continue;const n=[],{rowIndex:a,rowPinned:l}=r;for(const d of o.keys()){const u=o.get(d);if(!u)continue;const{editorValue:h,pendingValue:g,sourceValue:p}=u,f=h??(g===st?void 0:g)??p;n.push({column:d,colId:d.getColId(),rowIndex:a,rowPinned:l,oldValue:p,newValue:f})}const c=s?.({editorsState:n})??[];c.length>0&&t.setRowValidation({rowNode:r},{errorMessages:c})}return t};function T2(e){_i(e,!0);const t=e.editModelSvc?.getCellValidationModel().getCellValidationMap();if(!t)return null;const s=[];return t.forEach((i,r)=>{i.forEach(({errorMessages:o},n)=>{s.push({column:n,rowIndex:r.rowIndex,rowPinned:r.rowPinned,messages:o??null})})}),s}function nc(e){return!!(e.rowPinned&&e.pinnedSibling)}function us(e,t,s,i){const r=t==="top";if(!s)return us(e,t,r?e.getPinnedTopRow(0):e.getPinnedBottomRow(0),i);if(!i){const l=r?e.getPinnedTopRowCount():e.getPinnedBottomRowCount();return us(e,t,s,r?e.getPinnedTopRow(l-1):e.getPinnedBottomRow(l-1))}let o=!1,n=!1;const a=[];return e.forEachPinnedRow(t,l=>{if(l===s&&!o){o=!0,a.push(l);return}if(o&&l===i){n=!0,a.push(l);return}o&&!n&&a.push(l)}),a}function D2(e,t,s,{rowNode:i,column:r},o){return N(e.gos,{type:s,node:i,data:i.data,value:o,column:r,colDef:r.getColDef(),rowPinned:i.rowPinned,event:t,rowIndex:i.rowIndex})}function A2(e,t=!1){return e===b.DELETE?!0:!t&&e===b.BACKSPACE?mC():!1}var I2=class extends E{constructor(e,t,s,i){super(),this.cellCtrl=e,this.rowNode=s,this.rowCtrl=i,this.beans=t}init(){this.eGui=this.cellCtrl.eGui}onKeyDown(e){const t=e.key;if(!(t===b.ENTER&&Fe(this.cellCtrl.column)&&this.beans.rowNumbersSvc?.handleKeyDownOnCell(this.cellCtrl.cellPosition,e)))switch(t){case b.ENTER:this.onEnterKeyDown(e);break;case b.F2:this.onF2KeyDown(e);break;case b.ESCAPE:this.onEscapeKeyDown(e);break;case b.TAB:this.onTabKeyDown(e);break;case b.BACKSPACE:case b.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case b.DOWN:case b.UP:case b.RIGHT:case b.LEFT:this.onNavigationKeyDown(e,t);break}}onNavigationKeyDown(e,t){const{cellCtrl:s,beans:i}=this;if(!i.editSvc?.isEditing(s,{withOpenEditor:!0})){if(e.shiftKey&&s.isRangeSelectionEnabled())this.onShiftRangeSelect(e);else{const r=s.getFocusedCellPosition();i.navigation?.navigateToNextCell(e,t,r,!0)}e.preventDefault()}}onShiftRangeSelect(e){const{rangeSvc:t,navigation:s}=this.beans;if(!t)return;const i=t.extendLatestRangeInDirection(e);i&&(e.key===b.LEFT||e.key===b.RIGHT?s?.ensureColumnVisible(i.column):s?.ensureRowVisible(i.rowIndex))}onTabKeyDown(e){this.beans.navigation?.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:s,beans:i,rowNode:r}=this,{gos:o,rangeSvc:n,eventSvc:a,editSvc:l}=i;if(a.dispatchEvent({type:"keyShortcutChangedCellStart"}),A2(e,o.get("enableCellEditingOnBackspace"))&&!l?.isEditing(s,{withOpenEditor:!0})){if(n&&mt(o))n.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(s.isCellEditable()){const c=i.valueSvc.getDeleteValue(s.column,r);r.setDataValue(s.column,c,"cellClear")}}else l?.isEditing(s,{withOpenEditor:!0})||i.editSvc?.startEditing(s,{startedEdit:!0,event:t});a.dispatchEvent({type:"keyShortcutChangedCellEnd"})}onEnterKeyDown(e){const{cellCtrl:t,beans:s}=this,{editSvc:i,navigation:r}=s,o=i?.isEditing(t,{withOpenEditor:!0}),n=t.rowNode,a=i?.isRowEditing(n,{withOpenEditor:!0}),l=c=>{i?.startEditing(c,{startedEdit:!0,event:e,source:"edit"})&&e.preventDefault()};if(o||a){if(this.isCtrlEnter(e)){i?.applyBulkEdit(t,s?.rangeSvc?.getCellRanges()||[]);return}if(_i(s),i?.checkNavWithValidation(void 0,e)==="block-stop")return;i?.isEditing(t,{withOpenEditor:!0})?i?.stopEditing(t,{event:e,source:"edit"}):a&&!t.isCellEditable()?i?.stopEditing({rowNode:n},{event:e,source:"edit"}):l(t)}else if(s.gos.get("enterNavigatesVertically")){const c=e.shiftKey?b.UP:b.DOWN;r?.navigateToNextCell(null,c,t.cellPosition,!1)}else{if(i?.hasValidationErrors())return;i?.hasValidationErrors(t)&&i.revertSingleCellEdit(t,!0),l(t)}}isCtrlEnter(e){return(e.ctrlKey||e.metaKey)&&e.key===b.ENTER}onF2KeyDown(e){const{cellCtrl:t,beans:{editSvc:s}}=this;s?.isEditing()&&(_i(this.beans),s?.checkNavWithValidation(void 0,e)==="block-stop")||s?.startEditing(t,{startedEdit:!0,event:e})}onEscapeKeyDown(e){const{cellCtrl:t,beans:{editSvc:s}}=this;s?.checkNavWithValidation(t,e)==="block-stop"&&s.revertSingleCellEdit(t),setTimeout(()=>{s?.stopEditing(t,{event:e,cancel:!0})})}processCharacter(e){const s=e.target!==this.eGui,{beans:{editSvc:i},cellCtrl:r}=this;if(s||i?.isEditing(r,{withOpenEditor:!0}))return;if(e.key===b.SPACE)this.onSpaceKeyDown(e);else if(i?.isCellEditable(r,"ui")){if(i?.hasValidationErrors()&&!i?.hasValidationErrors(r))return;i?.startEditing(r,{startedEdit:!0,event:e,source:"api",editable:!0}),!r.editCompDetails?.params?.suppressPreventDefault&&e.preventDefault()}}onSpaceKeyDown(e){const{gos:t,editSvc:s}=this.beans,{rowNode:i}=this.cellCtrl;!s?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&Lt(t)&&this.beans.selectionSvc?.handleSelectionEvent(e,i,"spaceKey"),e.preventDefault()}},k2=class extends E{constructor(e,t,s){super(),this.cellCtrl=e,this.column=s,this.beans=t}onMouseEvent(e,t){if(!Gt(t))switch(e){case"click":this.onCellClicked(t);break;case"pointerdown":case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t);break}}onCellClicked(e){if(this.beans.touchSvc?.handleCellDoubleClick(this,e))return;const{eventSvc:t,rangeSvc:s,editSvc:i,editModelSvc:r,frameworkOverrides:o,gos:n}=this.beans,a=e.ctrlKey||e.metaKey,{cellCtrl:l}=this,{column:c,cellPosition:d,rowNode:u}=l,h=Nn(n,c,u,e);s&&a&&!h&&s.getCellRangeCount(d)>1&&s.intersectLastRange(!0);const g=l.createEvent(e,"cellClicked");g.isEventHandlingSuppressed=h,t.dispatchEvent(g);const p=c.getColDef();if(p.onCellClicked&&window.setTimeout(()=>{o.wrapOutgoing(()=>{p.onCellClicked(g)})},0),!h&&r?.getState(l)!=="editing"){const f=i?.isEditing(),m=i?.isRangeSelectionEnabledWhileEditing(),C=r?.getCellValidationModel().getCellValidationMap().size??0,v=r?.getRowValidationModel().getRowValidationMap().size??0;if(f&&(m||C>0||v>0))return;i?.shouldStartEditing(l,e)?i?.startEditing(l,{event:e}):i?.shouldStopEditing(l,e)&&(this.beans.gos.get("editType")==="fullRow"?i?.stopEditing(l,{event:e,source:"edit"}):i?.stopEditing(void 0,{event:e,source:"edit"}))}}onCellDoubleClicked(e){const{column:t,beans:s,cellCtrl:i}=this,{eventSvc:r,frameworkOverrides:o,editSvc:n,editModelSvc:a,gos:l}=s,c=Nn(l,i.column,i.rowNode,e),d=t.getColDef(),u=i.createEvent(e,"cellDoubleClicked");if(u.isEventHandlingSuppressed=c,r.dispatchEvent(u),typeof d.onCellDoubleClicked=="function"&&window.setTimeout(()=>{o.wrapOutgoing(()=>{d.onCellDoubleClicked(u)})},0),!c&&n?.shouldStartEditing(i,e)&&a?.getState(i)!=="editing"){const h=n?.isEditing(),g=n?.isRangeSelectionEnabledWhileEditing(),p=a?.getCellValidationModel().getCellValidationMap().size??0,f=a?.getRowValidationModel().getRowValidationMap().size??0;if(h&&(g||p>0||f>0))return;n?.startEditing(i,{event:e})}}onMouseDown(e){const{shiftKey:t}=e,s=e.target,{cellCtrl:i,beans:r}=this,{eventSvc:o,rangeSvc:n,rowNumbersSvc:a,focusSvc:l,gos:c,editSvc:d}=r,{column:u,rowNode:h,cellPosition:g}=i,p=Nn(c,u,h,e),f=()=>{const w=i.createEvent(e,"cellMouseDown");w.isEventHandlingSuppressed=p,o.dispatchEvent(w)};if(p){f();return}if(this.isRightClickInExistingRange(e))return;const m=n&&!n.isEmpty(),C=this.containsWidget(s),v=Fe(u);if(!(a&&v&&!a.handleMouseDownOnCell(g,e))){if(!t||!m){const w=d?.isEditing(i),y=c.get("enableCellTextSelection")&&e.defaultPrevented,R=(Ss()||y)&&!w&&!Zr(s)&&!C;i.focusCell(R,e)}if(t&&m&&!l.isCellFocused(g)){e.preventDefault();const w=l.getFocusedCell();if(w){const{column:S,rowIndex:y,rowPinned:R}=w,P=!!d?.isRangeSelectionEnabledWhileEditing?.();d?.isEditing(w)&&!P&&d?.stopEditing(w),P||l.setFocusedCell({column:S,rowIndex:y,rowPinned:R,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,sourceEvent:e})}}C||(n?.handleCellMouseDown(e,g),f())}}isRightClickInExistingRange(e){const{rangeSvc:t}=this.beans;if(t){const s=t.isCellInAnyRange(this.cellCtrl.cellPosition),i=ml(this.beans,e);if(s&&i)return!0}return!1}containsWidget(e){return ur(e,"ag-selection-checkbox",3)||ur(e,"ag-drag-handle",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const{eventSvc:t,colHover:s}=this.beans;t.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOut")),s?.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const{eventSvc:t,colHover:s}=this.beans;t.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOver")),s?.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.eGui,s=t.contains(e.target),i=t.contains(e.relatedTarget);return s&&i}},L2=class extends E{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.column,this.rowNode=e.rowNode}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventSvc,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}init(){this.eSetLeft=this.cellCtrl.getRootElement(),this.eContent=this.cellCtrl.eGui;const e=this.cellCtrl.getCellSpan();if(e||(this.setupColSpan(),this.setupRowSpan()),this.onLeftChanged(),this.onWidthChanged(),e||this._legacyApplyRowSpan(),e){const t=this.refreshSpanHeight.bind(this,e);t(),this.addManagedListeners(this.beans.eventSvc,{paginationChanged:t,recalculateRowBounds:t,pinnedHeightChanged:t})}}refreshSpanHeight(e){const t=e.getCellHeight();t!=null&&(this.eContent.style.height=`${t}px`)}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this._legacyApplyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();be(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){this.column.getColDef().colSpan!=null&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)}))}onWidthChanged(){if(!this.eContent)return;const e=this.getCellWidth();this.eContent.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const{column:e,rowNode:t}=this,s=e.getColSpan(t),i=[];if(s===1)i.push(e);else{let r=e;const o=e.getPinned();for(let n=0;r&&nthis.removeFeatures()),this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.setupFocus(),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(i,n),this.refreshFirstAndLastStyles(),this.checkFormulaError(),this.refreshAriaRowIndex(),this.refreshAriaColIndex(),this.positionFeature?.init(),this.customStyleFeature?.setComp(e),this.editStyleFeature?.setComp(e),this.tooltipFeature?.refreshTooltip(),this.keyboardListener?.init(),this.rangeFeature?.setComp(e),this.rowResizeFeature?.refreshRowResizer();const a=o?this.isCellEditable():void 0,l=!a&&this.hasEdit&&this.editSvc?.isEditing(this,{withOpenEditor:!0});if(a||l?this.editSvc?.startEditing(this,{startedEdit:!1,source:"api",silent:!0,continueEditing:!0,editable:a}):this.showValue(!1,!0),this.onCompAttachedFuncs.length){for(const c of this.onCompAttachedFuncs)c();this.onCompAttachedFuncs=[]}}checkFormulaError(){const e=!!this.beans.formula?.getFormulaError(this.column,this.rowNode);this.eGui.classList.toggle("formula-error",e)}setupAutoHeight(e,t){this.isAutoHeight=this.beans.rowAutoHeight?.setupCellAutoHeight(this,e,t)??!1}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}isCellRenderer(){const e=this.column.getColDef();return e.cellRenderer!=null||e.cellRendererSelector!=null}getValueToDisplay(){return this.valueFormatted??this.value}getDeferLoadingCellRenderer(){const{beans:e,column:t}=this,{userCompFactory:s,ctrlsSvc:i,eventSvc:r}=e,o=t.getColDef(),n=this.createCellRendererParams();n.deferRender=!0;const a=uC(s,o,n);if(i.getGridBodyCtrl()?.scrollFeature?.isScrolling()){let l;const c=new $(u=>{l=u}),[d]=this.addManagedListeners(r,{bodyScrollEnd:()=>{l(),d()}});return{loadingComp:a,onReady:c}}return{loadingComp:a,onReady:$.resolve()}}showValue(e,t){const{beans:s,column:i,rowNode:r,rangeFeature:o}=this,{userCompFactory:n}=s;let a=this.getValueToDisplay(),l;const c=r.stub&&r.groupData?.[i.getId()]==null,d=i.getColDef();if(c||this.isCellRenderer()){const u=this.createCellRendererParams();!c||Fe(i)?l=xr(n,d,u):l=uC(n,d,u)}if(!l&&!c&&s.findSvc?.isMatch(r,i)){const u=this.createCellRendererParams();l=xr(n,{...i.getColDef(),cellRenderer:"agFindCellRenderer"},u)}if(this.hasEdit&&this.editSvc.isBatchEditing()&&this.editSvc.isRowEditing(r,{checkSiblings:!0})){const u=this.editSvc.prepDetailsDuringBatch(this,{compDetails:l,valueToDisplay:a});u&&(u.compDetails?l=u.compDetails:u.valueToDisplay&&(a=u.valueToDisplay))}this.comp.setRenderDetails(l,a,e),this.customRowDragComp?.refreshVisibility(),!t&&o&&Rt(s,()=>o?.refreshRangeStyleAndHandle()),this.rowResizeFeature?.refreshRowResizer()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(this.isCheckboxSelection(e),!0),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.comp.setIncludeSelection(this.includeSelection),this.comp.setIncludeDndSource(this.includeDndSource),this.comp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}getCellValueClass(){const e="ag-cell-value",t=this.column.getColDef().cellRenderer==="agCheckboxCellRenderer";let s="";return t&&(s=" ag-allow-overflow"),`${e}${s}`}isIncludeControl(e,t=!1){return(this.rowNode.rowPinned==null||t&&nc(this.rowNode))&&!!e}isCheckboxSelection(e){const{rowSelection:t,groupDisplayType:s}=this.beans.gridOptions,i=ro(t),r=Gs(this.column);return s==="custom"&&i!=="selectionColumn"&&r?!1:e.checkboxSelection||r&&typeof t=="object"&&Fi(t)}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(this.isCheckboxSelection(e),!0),s=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),i=this.includeDndSource!=this.isIncludeControl(e.dndSource),r=this.isAutoHeight!=this.column.isAutoHeight();return t||s||i||r}onPopupEditorClosed(e){const{editSvc:t}=this.beans;if(!t?.isEditing(this,{withOpenEditor:!0}))return;const s=e instanceof KeyboardEvent,i=e instanceof MouseEvent,r=s&&e.key===b.ESCAPE;t.stopEditing(this,{source:t.isBatchEditing()?"ui":"api",cancel:r,event:s||i?e:void 0}),r&&this.focusCell(!0,e)}stopEditing(e=!1){const{editSvc:t}=this.beans;return t?.stopEditing(this,{cancel:e,source:t?.isBatchEditing()?"ui":"api"})??!1}createCellRendererParams(){const{value:e,valueFormatted:t,column:s,rowNode:i,comp:r,eGui:o,beans:{valueSvc:n,gos:a,editSvc:l}}=this;return N(a,{value:e,valueFormatted:t,getValue:()=>n.getValueForDisplay({column:s,node:i,from:"edit"}).value,setValue:d=>l?.setDataValue({rowNode:i,column:s},d)||i.setDataValue(s,d),formatValue:this.formatValue.bind(this),data:i.data,node:i,pinned:s.getPinned(),colDef:s.getColDef(),column:s,refreshCell:this.refreshCell.bind(this),eGridCell:o,eParentOfValue:r.getParentOfValue(),registerRowDragger:(d,u,h,g)=>this.registerRowDragger(d,u,g),setTooltip:(d,u)=>{a.assertModuleRegistered("Tooltip",3),this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(d,u),this.tooltipFeature?.refreshTooltip()}})}onCellChanged(e){e.column===this.column&&this.refreshCell()}refreshOrDestroyCell(e){if(this.refreshShouldDestroy()?this.rowCtrl?.recreateCell(this):this.refreshCell(e),this.hasEdit&&this.editCompDetails){const{editSvc:t,comp:s}=this;!s?.getCellEditor()&&t.isEditing(this,{withOpenEditor:!0})&&t.startEditing(this,{startedEdit:!1,source:"api",silent:!0})}}refreshCell(e){const{editStyleFeature:t,customStyleFeature:s,rowCtrl:{rowEditStyleFeature:i},beans:{cellFlashSvc:r,filterManager:o},column:n,comp:a,suppressRefreshCell:l,tooltipFeature:c}=this;if(l)return;const{field:d,valueGetter:u,showRowGroup:h,enableCellChangeFlash:g}=n.getColDef(),p=d==null&&u==null&&h==null,f=e?.newData??!1,m=p||e&&(e.force||f),C=!!a,v=this.updateAndFormatValue(C),w=m||v;if(C){if(w){this.showValue(!!f,!1);const S=o?.isSuppressFlashingCellsBecauseFiltering();!e?.suppressFlash&&!S&&g&&r?.flashCell(this),t?.applyCellStyles?.(),s?.applyUserStyles(),s?.applyClassesFromColDef(),i?.applyRowStyles(),this.checkFormulaError()}c?.refreshTooltip(),s?.applyCellClassRules()}}isCellEditable(){return this.column.isCellEditable(this.rowNode)}formatValue(e){return this.callValueFormatter(e)??e}callValueFormatter(e){return this.beans.valueSvc.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,s=this.valueFormatted,{value:i,valueFormatted:r}=this.beans.valueSvc.getValueForDisplay({column:this.column,node:this.rowNode,includeValueFormatted:!0,from:"edit"});return this.value=i,this.valueFormatted=r,e?!this.valuesAreEqual(t,this.value)||this.valueFormatted!=s:!0}valuesAreEqual(e,t){const s=this.column.getColDef();return s.equals?s.equals(e,t):e===t}addDomData(e){const t=this.eGui;mr(this.beans.gos,t,kl,this),e.addDestroyFunc(()=>mr(this.beans.gos,t,kl,null))}createEvent(e,t){const{rowNode:s,column:i,value:r,beans:o}=this;return D2(o,e,t,{rowNode:s,column:i},r)}processCharacter(e){this.keyboardListener?.processCharacter(e)}onKeyDown(e){this.keyboardListener?.onKeyDown(e)}onMouseEvent(e,t){this.mouseListener?.onMouseEvent(e,t)}getColSpanningList(){return this.positionFeature?.getColSpanningList()??[]}onLeftChanged(){this.comp&&this.positionFeature?.onLeftChanged()}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{comp:e,column:t,beans:s}=this;HC(e,t,s.visibleCols)}refreshAriaColIndex(){const e=this.beans.visibleCols.getAriaColIndex(this.column);$a(this.eGui,e)}onWidthChanged(){return this.positionFeature?.onWidthChanged()}getRowPosition(){const{rowIndex:e,rowPinned:t}=this.cellPosition;return{rowIndex:e,rowPinned:t}}updateRangeBordersIfRangeCount(){this.comp&&this.rangeFeature?.updateRangeBordersIfRangeCount()}onCellSelectionChanged(){this.comp&&this.rangeFeature?.onCellSelectionChanged()}isRangeSelectionEnabled(){return this.rangeFeature!=null}focusCell(e=!1,t){const s=this.editSvc?.allowedFocusTargetOnValidation(this);s&&s!==this||this.beans.focusSvc.setFocusedCell({...this.getFocusedCellPosition(),forceBrowserFocus:e,sourceEvent:t})}restoreFocus(e=!1){const{beans:{editSvc:t,focusSvc:s},comp:i}=this;if(!i||t?.isEditing(this)||!this.isCellFocused()||!s.shouldTakeFocus())return;const r=()=>{if(!this.isAlive())return;const o=i.getFocusableElement();this.isCellFocused()&&o.focus({preventScroll:!0})};if(e){setTimeout(r,0);return}r()}onRowIndexChanged(){this.createCellPosition(),this.refreshAriaRowIndex(),this.onCellFocused(),this.restoreFocus(),this.rangeFeature?.onCellSelectionChanged(),this.rowResizeFeature?.refreshRowResizer()}onSuppressCellFocusChanged(e){const t=this.eGui;t&&nt(t,"tabindex",e?void 0:-1)}onFirstRightPinnedChanged(){if(!this.comp)return;const e=this.column.isFirstRightPinned();this.comp.toggleCss(N2,e)}onLastLeftPinnedChanged(){if(!this.comp)return;const e=this.column.isLastLeftPinned();this.comp.toggleCss(H2,e)}checkCellFocused(){return this.beans.focusSvc.isCellFocused(this.cellPosition)}isCellFocused(){const e=this.checkCellFocused();return this.hasBeenFocused||(this.hasBeenFocused=e),e}setupFocus(){this.restoreFocus(!0),this.onCellFocused(this.focusEventWhileNotReady??void 0)}onCellFocused(e){const{beans:t}=this;if(On(t))return;if(!this.comp){e&&(this.focusEventWhileNotReady=e);return}const s=this.isCellFocused(),i=t.editSvc?.isEditing(this)??!1;if(this.comp.toggleCss(B2,s),s&&(e?.forceBrowserFocus||!this.hasBrowserFocus()&&this.beans.focusSvc.shouldTakeFocus())){let r=this.comp.getFocusableElement();if(i){const n=Kt(r,null,!0);n.length&&(r=n[0])}const o=e?e.preventScrollOnBrowserFocus:!0;r.focus({preventScroll:o}),Qa(t,r)}s&&this.focusEventWhileNotReady&&(this.focusEventWhileNotReady=null),s&&e&&this.rowCtrl.announceDescription()}createCellPosition(){const{rowIndex:e,rowPinned:t}=this.rowNode;this.cellPosition={rowIndex:e,rowPinned:Ae(t),column:this.column}}applyStaticCssClasses(){const{comp:e}=this;e.toggleCss(G2,!0),e.toggleCss(z2,!0);const t=this.column.isAutoHeight()==!0;e.toggleCss(O2,t),e.toggleCss(V2,!t)}onColumnHover(){this.beans.colHover?.onCellColumnHover(this.column,this.comp)}onColDefChanged(){this.comp&&(this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editSvc?.isEditing(this)?this.editSvc?.handleColDefChanged(this):this.refreshOrDestroyCell({force:!0,suppressFlash:!0}))}setWrapText(){const e=this.column.getColDef().wrapText==!0;this.comp.toggleCss(_2,e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),s=this.createEvent(e,"cellContextMenu"),{beans:i}=this;i.eventSvc.dispatchEvent(s),t.onCellContextMenu&&window.setTimeout(()=>{i.frameworkOverrides.wrapOutgoing(()=>{t.onCellContextMenu(s)})},0)}getCellRenderer(){return this.comp?.getCellRenderer()??null}destroy(){this.onCompAttachedFuncs=[],this.onEditorAttachedFuncs=[],this.isCellFocused()&&this.hasBrowserFocus()&&this.beans.focusSvc.attemptToRecoverFocus(),super.destroy()}hasBrowserFocus(){return this.eGui?.contains(ie(this.beans))??!1}createSelectionCheckbox(){const e=this.beans.selectionSvc?.createCheckboxSelectionComponent();if(e)return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=this.beans.registry.createDynamicBean("dndSourceComp",!1,this.rowNode,this.column,this.eGui);return e&&this.beans.context.createBean(e),e}registerRowDragger(e,t,s){if(this.customRowDragComp){this.customRowDragComp.setDragElement(e,t);return}const i=this.createRowDragComp(e,t,s);i&&(this.customRowDragComp=i,this.addDestroyFunc(()=>{this.beans.context.destroyBean(i),this.customRowDragComp=null}),i.refreshVisibility())}createRowDragComp(e,t,s){const i=this.beans.rowDragSvc?.createRowDragCompForCell(this.rowNode,this.column,()=>this.value,e,t,s);if(i)return this.beans.context.createBean(i),i}cellEditorAttached(){for(const e of this.onEditorAttachedFuncs)e();this.onEditorAttachedFuncs=[]}setFocusedCellPosition(e){}getFocusedCellPosition(){return this.cellPosition}refreshAriaRowIndex(){if(!Fe(this.column)||!this.eGui)return;const{ariaRowIndex:e}=this.rowCtrl;e!=null&&dr(this.eGui,e)}getRootElement(){return this.eGui}};function Yh(e,t,s,i,r,o){if(s==null&&t==null)return;const n={},a={},l=(c,d)=>{for(const u of c.split(" "))u.trim()!=""&&d(u)};if(s){const c=Object.keys(s);for(let d=0;d{g?n[p]=!0:a[p]=!0})}}if(t&&o)for(const c of Object.keys(t))l(c,d=>{n[d]||(a[d]=!0)});o&&Object.keys(a).forEach(o),Object.keys(n).forEach(r)}function Kw(e){if(e.group)return e.level;const t=e.parent;return t?t.level+1:0}var U2=class extends E{constructor(){super(...arguments),this.beanName="rowStyleSvc"}processClassesFromGridOptions(e,t){const s=this.gos,i=n=>{if(typeof n=="string")e.push(n);else if(Array.isArray(n))for(const a of n)e.push(a)},r=s.get("rowClass");r&&i(r);const o=s.getCallback("getRowClass");if(o){const n={data:t.data,node:t,rowIndex:t.rowIndex},a=o(n);i(a)}}preProcessRowClassRules(e,t){this.processRowClassRules(t,s=>{e.push(s)},()=>{})}processRowClassRules(e,t,s){const{gos:i,expressionSvc:r}=this.beans,o=N(i,{data:e.data,node:e,rowIndex:e.rowIndex});Yh(r,void 0,i.get("rowClassRules"),o,t,s)}processStylesFromGridOptions(e){const t=this.gos,s=t.get("rowStyle"),i=t.getCallback("getRowStyle");let r;if(i){const o={data:e.data,node:e,rowIndex:e.rowIndex};r=i(o)}if(r||s)return Object.assign({},s,r)}},$2=0,ac=class extends E{constructor(e,t,s,i,r){super(),this.rowNode=e,this.useAnimationFrameForCreate=i,this.printLayout=r,this.focusEventWhileNotReady=null,this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.ariaRowIndex=null,this.businessKey=null,this.beans=t,this.gos=t.gos,this.paginationPage=t.pagination?.getCurrentPage()??0,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+$2++,this.rowId=pt(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusSvc.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=Kw(this.rowNode),this.setRowType(),this.setAnimateFlags(s),this.rowStyles=this.processStylesFromGridOptions(),this.rowEditStyleFeature=t.editSvc?.createRowStyleFeature(this),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!="function")return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKey=pt(e)}updateGui(e,t){e==="left"?this.leftGui=t:e==="right"?this.rightGui=t:e==="fullWidth"?this.fullWidthGui=t:this.centerGui=t}setComp(e,t,s,i){const{context:r,rowRenderer:o}=this.beans;i=Bn(this,r,i);const n={rowComp:e,element:t,containerType:s,compBean:i};this.allRowGuis.push(n),this.updateGui(s,n),this.initialiseRowComp(n);const a=this.rowNode,l=this.rowType==="FullWidthLoading"||a.stub,c=!a.data&&this.beans.rowModel.getType()==="infinite";!l&&!c&&!a.rowPinned&&o.dispatchFirstDataRenderedEvent(),this.setupFocus()}unsetComp(e){this.allRowGuis=this.allRowGuis.filter(t=>t.containerType!==e),this.updateGui(e,void 0)}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";for(const s of this.allRowGuis)s.element.style.display=t}initialiseRowComp(e){const t=this.gos;this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.listenOnDomOrder(e),this.onRowHeightChanged(e),this.updateRowIndexes(e),this.setFocusedClasses(e),this.setStylesFromGridOptions(!1,e),Lt(t)&&this.rowNode.selectable&&this.onRowSelected(e),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=e.rowComp,i=this.getInitialRowClasses(e.containerType);for(const r of i)s.toggleCss(r,!0);this.executeSlideAndFadeAnimations(e),this.rowNode.group&&ot(e.element,!!this.rowNode.expanded),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),mr(t,e.element,Ll,this),e.compBean.addDestroyFunc(()=>mr(t,e.element,Ll,null)),this.useAnimationFrameForCreate?this.beans.animationFrameSvc.createTask(this.addHoverFunctionality.bind(this,e),this.rowNode.rowIndex,"p2",!1):this.addHoverFunctionality(e),this.isFullWidth()&&this.setupFullWidth(e),t.get("rowDragEntireRow")&&this.addRowDraggerToRow(e),this.useAnimationFrameForCreate&&this.beans.animationFrameSvc.addDestroyTask(()=>{this.isAlive()&&e.rowComp.toggleCss("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){this.businessKey!=null&&e.setRowBusinessKey(this.businessKey)}setRowCompRowId(e){const t=pt(this.rowNode.id);this.rowId=t,t!=null&&e.setRowId(t)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(Cn(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1),this.fadeInAnimation[t]&&(Cn(()=>{e.rowComp.toggleCss("ag-opacity-zero",!1)}),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){const t=this.beans.rowDragSvc?.createRowDragCompForRow(this.rowNode,e.element);if(!t)return;const s=this.createBean(t,this.beans.context);this.rowDragComps.push(s),e.compBean.addDestroyFunc(()=>{this.rowDragComps=this.rowDragComps.filter(i=>i!==s),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,this.beans.context),this.destroyBean(s,this.beans.context)})}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType),s=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(s)}getFullWidthCellRenderers(){return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(e=>e?.rowComp?.getFullWidthCellRenderer()):[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");if(!e||!this.areAllContainersReady())return;const t={eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)};e(t)}areAllContainersReady(){const{leftGui:e,centerGui:t,rightGui:s,beans:{visibleCols:i}}=this,r=!!e||!i.isPinningLeft(),o=!!t,n=!!s||!i.isPinningRight();return r&&o&&n}isNodeFullWidthCell(){if(this.rowNode.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return e?e({rowNode:this.rowNode}):!1}setRowType(){const{rowNode:e,gos:t,beans:{colModel:s}}=this,i=e.stub&&!t.get("suppressServerSideFullWidthLoadingRow")&&!t.get("groupHideOpenParents"),r=this.isNodeFullWidthCell(),o=t.get("masterDetail")&&e.detail,n=s.isPivotMode(),a=hl(t,e,n);i?this.rowType="FullWidthLoading":o?this.rowType="FullWidthDetail":r?this.rowType="FullWidth":a?this.rowType="FullWidthGroup":this.rowType="Normal"}updateColumnLists(e=!1,t=!1){if(this.isFullWidth())return;const{animationFrameSvc:s}=this.beans;if(!s?.active||e||this.printLayout){this.updateColumnListsImpl(t);return}this.updateColumnListsPending||(s.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"p1",!1),this.updateColumnListsPending=!0)}getNewCellCtrl(e){if(!this.beans.rowSpanSvc?.isCellSpanning(e,this.rowNode))return new yo(e,this.rowNode,this.beans,this)}isCorrectCtrlForSpan(e){return!this.beans.rowSpanSvc?.isCellSpanning(e.column,this.rowNode)}createCellCtrls(e,t,s=null){const i={list:[],map:{}},r=(c,d,u)=>{u!=null?i.list.splice(u,0,d):i.list.push(d),i.map[c]=d},o=[];for(const c of t){const d=c.getInstanceId();let u=e.map[d];u&&!this.isCorrectCtrlForSpan(u)&&(u.destroy(),u=void 0),u||(u=this.getNewCellCtrl(c)),u&&r(d,u)}for(const c of e.list){const d=c.column.getInstanceId();if(i.map[d]!=null)continue;!this.isCellEligibleToBeRemoved(c,s)?o.push([d,c]):c.destroy()}if(o.length)for(const[c,d]of o){const u=i.list.findIndex(g=>g.column.getLeft()>d.column.getLeft()),h=u===-1?void 0:Math.max(u-1,0);r(c,d,h)}const{focusSvc:n,visibleCols:a}=this.beans,l=n.getFocusedCell();if(l&&l.column.getPinned()==s){const c=l.column.getInstanceId();if(!i.map[c]&&a.allCols.includes(l.column)){const u=this.createFocusedCellCtrl();if(u){const h=i.list.findIndex(p=>p.column.getLeft()>u.column.getLeft()),g=h===-1?void 0:Math.max(h-1,0);r(c,u,g)}}}return i}createFocusedCellCtrl(){const{focusSvc:e,rowSpanSvc:t}=this.beans,s=e.getFocusedCell();if(!s)return;const i=t?.getCellSpan(s.column,this.rowNode);if(i){if(i.firstNode!==this.rowNode||!i.doesSpanContain(s))return}else if(!e.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))return;return this.getNewCellCtrl(s.column)}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){for(const t of this.allRowGuis){const s=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(s,e)}}getCellCtrlsForContainer(e){switch(e){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){const e=this.beans.colViewport,t=this.beans.visibleCols;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t.allCols),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const s=e.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,s);const i=t.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,i,"left");const r=t.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,r,"right")}}isCellEligibleToBeRemoved(e,t){const{column:r}=e;if(r.getPinned()!=t||!this.isCorrectCtrlForSpan(e))return!0;const{visibleCols:o,editSvc:n}=this.beans,a=n?.isEditing(e),l=e.isCellFocused();return a||l?!(o.allCols.indexOf(r)>=0):!0}getDomOrder(){return this.gos.get("ensureDomOrder")||je(this.gos,"print")}listenOnDomOrder(e){const t=()=>{e.rowComp.setDomOrder(this.getDomOrder())};e.compBean.addManagedPropertyListeners(["domLayout","ensureDomOrder"],t)}setAnimateFlags(e){if(this.rowNode.sticky||!e)return;const t=D(this.rowNode.oldRowTop),{visibleCols:s}=this.beans,i=s.isPinningLeft(),r=s.isPinningRight();if(t){const{slideInAnimation:o}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){o.fullWidth=!0;return}o.center=!0,o.left=i,o.right=r}else{const{fadeInAnimation:o}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){o.fullWidth=!0;return}o.center=!0,o.left=i,o.right=r}}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){const e=(n,a)=>n?n.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(n.element,a).params):!0,t=e(this.fullWidthGui,null),s=e(this.centerGui,null),i=e(this.leftGui,"left"),r=e(this.rightGui,"right");return t&&s&&i&&r}addListeners(){const{beans:e,gos:t,rowNode:s}=this,{expansionSvc:i,eventSvc:r,context:o,rowSpanSvc:n}=e;this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),...i?.getRowExpandedListeners(this)??{}}),s.detail&&this.addManagedListeners(s.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)}),this.addManagedListeners(s,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this),rowPinned:this.onRowPinned.bind(this)}),this.addManagedListeners(r,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),n&&this.addManagedListeners(n,{spannedCellsUpdated:({pinned:a})=>{a&&!s.rowPinned||this.updateColumnLists()}}),this.addDestroyFunc(()=>{this.rowDragComps=this.destroyBeans(this.rowDragComps,o),this.tooltipFeature=this.destroyBean(this.tooltipFeature,o),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,o)}),this.addManagedPropertyListeners(["rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules"],this.postProcessCss.bind(this)),this.addManagedPropertyListener("rowDragEntireRow",()=>{if(t.get("rowDragEntireRow")){for(const l of this.allRowGuis)this.addRowDraggerToRow(l);return}this.rowDragComps=this.destroyBeans(this.rowDragComps,o)}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{for(const e of this.getAllCellCtrls())e.onRowIndexChanged()},cellChanged:e=>{for(const t of this.getAllCellCtrls())t.onCellChanged(e)}})}onRowPinned(){for(const e of this.allRowGuis)e.rowComp.toggleCss("ag-row-pinned-source",!!this.rowNode.pinnedSibling)}onRowNodeDataChanged(e){this.refreshRow({suppressFlash:!e.update,newData:!e.update})}refreshRow(e){if(this.isFullWidth()!==!!this.isNodeFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode);return}for(const s of this.getAllCellCtrls())s.refreshCell(e);for(const s of this.allRowGuis)this.setRowCompRowId(s.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(s.rowComp);this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.rowEditStyleFeature?.applyRowStyles(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.beans.rowDropHighlightSvc,t=e?.row===this.rowNode?e.position:"none",s=t==="above",i=t==="inside",r=t==="below",o=t!=="none",n=s||r,a=this.rowNode.uiLevel,l=n&&a>0,c=l?a.toString():"0";for(const d of this.allRowGuis){const u=d.rowComp;u.toggleCss("ag-row-highlight-above",s),u.toggleCss("ag-row-highlight-inside",i),u.toggleCss("ag-row-highlight-below",r),u.toggleCss("ag-row-highlight-indent",l),o?d.element.style.setProperty("--ag-row-highlight-level",c):d.element.style.removeProperty("--ag-row-highlight-level")}}postProcessRowDragging(){const e=this.rowNode.dragging;for(const t of this.allRowGuis)t.rowComp.toggleCss("ag-row-dragging",e)}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.rowAutoHeight?.requestCheckAutoHeight()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:Ae(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.findFullWidthInfoForEvent(e);if(!t)return;const{rowGui:s,column:i}=t;if(!(s.element===e.target))return;const n=this.rowNode,{focusSvc:a,navigation:l}=this.beans,c=a.getFocusedCell(),d={rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:c?.column??i};l?.navigateToNextCell(e,e.key,d,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||Gt(e))return;const t=this.allRowGuis.find(a=>a.element.contains(e.target)),s=t?t.element:null,i=s===e.target,r=ie(this.beans);let o=!1;s&&r&&(o=s.contains(r)&&r.classList.contains("ag-cell"));let n=null;!i&&!o&&(n=Qe(this.beans,s,!1,e.shiftKey)),(this.isFullWidth()&&i||!n)&&this.beans.navigation?.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){const e=this.allRowGuis.find(t=>Ne(t.element))?.element;return e?e.getBoundingClientRect().top:0}onSuppressCellFocusChanged(e){const t=this.isFullWidth()&&e?void 0:this.gos.get("tabIndex");for(const s of this.allRowGuis)nt(s.element,"tabindex",t)}setupFocus(){this.isFullWidth()&&(this.restoreFullWidthFocus(!0),this.onFullWidthRowFocused(this.focusEventWhileNotReady??void 0))}restoreFullWidthFocus(e=!1){const{focusSvc:t,editSvc:s}=this.beans;if(s?.isEditing(this)||!t.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned)||!t.shouldTakeFocus())return;const i=this.getFullWidthRowGuiForFocus();if(!i)return;const r=()=>{this.isAlive()&&t.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned)&&i.element.focus({preventScroll:!0})};if(e){setTimeout(r,0);return}r()}getFullWidthRowGuiForFocus(e){if(this.fullWidthGui)return this.fullWidthGui;const t=this.beans.focusSvc.getFocusedCell(),s=this.beans.colModel.getCol(e?.column??t?.column);if(!s)return;const i=s?.pinned;return i==="right"?this.rightGui:i==="left"?this.leftGui:this.centerGui}setFullWidthRowFocusedClass(e,t){this.forEachGui(void 0,s=>{s.element.classList.toggle("ag-full-width-focus",t&&s===e)})}onFullWidthRowFocused(e){const{focusSvc:t}=this.beans;if(!(this.isFullWidth()&&t.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))){this.setFullWidthRowFocusedClass(void 0,!1);return}const i=this.getFullWidthRowGuiForFocus(e);if(!i){e&&(this.focusEventWhileNotReady=e),this.setFullWidthRowFocusedClass(void 0,!1);return}this.setFullWidthRowFocusedClass(i,!0),this.focusEventWhileNotReady=null,e?.forceBrowserFocus&&i.element.focus({preventScroll:!0})}recreateCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),e.destroy(),this.updateColumnLists()}removeCellCtrl(e,t){const s={list:[],map:{}};for(const i of e.list)i!==t&&(s.list.push(i),s.map[i.column.getInstanceId()]=i);return s}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"pointerdown":case"touchstart":case"mousedown":this.onRowMouseDown(t);break}}createRowEvent(e,t){const{rowNode:s}=this;return N(this.gos,{type:e,node:s,data:s.data,rowIndex:s.rowIndex,rowPinned:s.rowPinned,event:t})}createRowEventWithSource(e,t){const s=this.createRowEvent(e,t);return s.source=this,s}onRowDblClick(e){if(Gt(e))return;const t=this.createRowEventWithSource("rowDoubleClicked",e);t.isEventHandlingSuppressed=this.isSuppressMouseEvent(e),this.beans.eventSvc.dispatchEvent(t)}findFullWidthInfoForEvent(e){if(!e)return;const t=this.findFullWidthRowGui(e.target),s=this.getColumnForFullWidth(t);if(!(!t||!s))return{rowGui:t,column:s}}findFullWidthRowGui(e){return this.allRowGuis.find(t=>t.element.contains(e))}getColumnForFullWidth(e){const{visibleCols:t}=this.beans;switch(e?.containerType){case"center":return t.centerCols[0];case"left":return t.leftCols[0];case"right":return t.rightCols[0];default:return t.allCols[0]}}onRowMouseDown(e){if(this.lastMouseDownOnDragger=ur(e.target,"ag-row-drag",3),!this.isFullWidth()||this.isSuppressMouseEvent(e))return;const{rangeSvc:t,focusSvc:s}=this.beans;t?.removeAllCellRanges();const i=this.findFullWidthInfoForEvent(e);if(!i)return;const{rowGui:r,column:o}=i,n=r.element,a=e.target,l=this.rowNode;let c=e.defaultPrevented||Ss();n&&n.contains(a)&&Zr(a)&&(c=!1),s.setFocusedCell({rowIndex:l.rowIndex,column:o,rowPinned:l.rowPinned,forceBrowserFocus:c})}isSuppressMouseEvent(e){const{gos:t,rowNode:s}=this;if(this.isFullWidth()){const r=this.findFullWidthRowGui(e.target);return qP(t,r?.rowComp.getFullWidthCellRendererParams(),s,e)}const i=Hn(t,e.target);return i!=null&&Nn(t,i.column,s,e)}onRowClick(e){if(Gt(e)||this.lastMouseDownOnDragger)return;const s=this.isSuppressMouseEvent(e),{eventSvc:i,selectionSvc:r}=this.beans,o=this.createRowEventWithSource("rowClicked",e);o.isEventHandlingSuppressed=s,i.dispatchEvent(o),!s&&r?.handleSelectionEvent(e,this.rowNode,"rowClicked")}setupDetailRowAutoHeight(e){this.rowType==="FullWidthDetail"&&this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this,e)}createFullWidthCompDetails(e,t){const{gos:s,rowNode:i}=this,r=N(s,{fullWidth:!0,data:i.data,node:i,value:i.key,valueFormatted:i.key,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(n,a,l,c)=>this.addFullWidthRowDragging(n,a,l,c),setTooltip:(n,a)=>{s.assertModuleRegistered("Tooltip",3),this.setupFullWidthRowTooltip(n,a)}}),o=this.beans.userCompFactory;switch(this.rowType){case"FullWidthDetail":return OE(o,r);case"FullWidthGroup":{const{value:n,valueFormatted:a}=this.beans.valueSvc.getValueForDisplay({node:this.rowNode,includeValueFormatted:!0,from:"edit"});return r.value=n,r.valueFormatted=a,GE(o,r)}case"FullWidthLoading":return LE(o,r);default:return kE(o,r)}}setupFullWidthRowTooltip(e,t){this.fullWidthGui&&(this.tooltipFeature=this.beans.tooltipSvc?.setupFullWidthRowTooltip(this.tooltipFeature,this,e,t))}addFullWidthRowDragging(e,t,s="",i){const{rowDragSvc:r,context:o}=this.beans;if(!r||!this.isFullWidth())return;const n=r.createRowDragComp(()=>s,this.rowNode,void 0,e,t,i);this.createBean(n,o),this.addDestroyFunc(()=>{this.destroyBean(n,o)})}onUiLevelChanged(){const e=Kw(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,s="ag-row-level-"+this.rowLevel;for(const i of this.allRowGuis)i.rowComp.toggleCss(t,!0),i.rowComp.toggleCss(s,!1)}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();if(this.firstRowOnPage!==e){this.firstRowOnPage=e;for(const s of this.allRowGuis)s.rowComp.toggleCss("ag-row-first",e)}if(this.lastRowOnPage!==t){this.lastRowOnPage=t;for(const s of this.allRowGuis)s.rowComp.toggleCss("ag-row-last",t)}}getAllCellCtrls(){return this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=[];if(this.beans.rowStyleSvc?.processClassesFromGridOptions(e,this.rowNode),!!e.length)for(const t of e)for(const s of this.allRowGuis)s.rowComp.toggleCss(t,!0)}postProcessRowClassRules(){this.beans.rowStyleSvc?.processRowClassRules(this.rowNode,e=>{for(const t of this.allRowGuis)t.rowComp.toggleCss(e,!0)},e=>{for(const t of this.allRowGuis)t.rowComp.toggleCss(e,!1)})}setStylesFromGridOptions(e,t){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(t,s=>s.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){return e==="left"||e==="right"?e:null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),s=this.isFullWidth(),{rowNode:i,beans:r}=this,o=[];o.push("ag-row"),o.push(this.rowFocused?"ag-row-focus":"ag-row-no-focus"),this.fadeInAnimation[e]&&o.push("ag-opacity-zero"),o.push(i.rowIndex%2===0?"ag-row-even":"ag-row-odd"),i.isRowPinned()&&(o.push("ag-row-pinned"),r.pinnedRowModel?.isManual()&&o.push("ag-row-pinned-manual")),!i.isRowPinned()&&i.pinnedSibling&&o.push("ag-row-pinned-source"),i.isSelected()&&o.push("ag-row-selected"),i.footer&&o.push("ag-row-footer"),o.push("ag-row-level-"+this.rowLevel),i.stub&&o.push("ag-row-loading"),s&&o.push("ag-full-width-row"),r.expansionSvc?.addExpandedCss(o,i),i.dragging&&o.push("ag-row-dragging");const{rowStyleSvc:n}=r;return n&&(n.processClassesFromGridOptions(o,i),n.preProcessRowClassRules(o,i)),o.push(this.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),this.isFirstRowOnPage()&&o.push("ag-row-first"),this.isLastRowOnPage()&&o.push("ag-row-last"),s&&(t==="left"&&o.push("ag-cell-last-left-pinned"),t==="right"&&o.push("ag-cell-first-right-pinned")),o}processStylesFromGridOptions(){return this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode)??this.emptyStyle}onRowSelected(e){this.beans.selectionSvc?.onRowCtrlSelected(this,t=>{(t===this.centerGui||t===this.fullWidthGui)&&this.announceDescription()},e)}announceDescription(){this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode)}addHoverFunctionality(e){if(!this.active)return;const{element:t,compBean:s}=e,{rowNode:i,beans:r,gos:o}=this;s.addManagedListeners(t,{pointerenter:n=>{n.pointerType==="mouse"&&i.dispatchRowEvent("mouseEnter")},pointerleave:n=>{n.pointerType==="mouse"&&i.dispatchRowEvent("mouseLeave")}}),s.addManagedListeners(i,{mouseEnter:()=>{!r.dragSvc?.dragging&&!o.get("suppressRowHoverHighlight")&&(t.classList.add("ag-row-hover"),i.setHovered(!0))},mouseLeave:()=>{this.resetHoveredStatus(t)}})}resetHoveredStatus(e){const t=e?[e]:this.allRowGuis.map(s=>s.element);for(const s of t)s.classList.remove("ag-row-hover");this.rowNode.setHovered(!1)}roundRowTopToBounds(e){const t=this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition(),s=this.applyPaginationOffset(t.top,!0)-100,i=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(s,e),i)}forEachGui(e,t){if(e)t(e);else for(const s of this.allRowGuis)t(s)}isRowRendered(){return this.allRowGuis.length>0}onRowHeightChanged(e){if(this.rowNode.rowHeight==null)return;const t=this.rowNode.rowHeight,s=this.beans.environment.getDefaultRowHeight(),r=dl(this.gos)?Ze(this.beans,this.rowNode).height:void 0,o=r?`${Math.min(s,r)-2}px`:void 0;this.forEachGui(e,n=>{n.element.style.height=`${t}px`,o&&n.element.style.setProperty("--ag-line-height",o)})}destroyFirstPass(e=!1){this.active=!1;const{rowNode:t}=this;if(!e&&Cr(this.gos)&&!t.sticky)if(t.rowTop!=null){const r=this.roundRowTopToBounds(t.rowTop);this.setRowTop(r)}else for(const r of this.allRowGuis)r.rowComp.toggleCss("ag-opacity-zero",!0);this.fullWidthGui?.element.contains(ie(this.beans))&&this.beans.focusSvc.attemptToRecoverFocus(),t.setHovered(!1);const s=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(s),this.beans.eventSvc.dispatchEvent(s),super.destroy()}destroySecondPass(){this.allRowGuis.length=0;const e=t=>{for(const s of t.list)s.destroy();return{list:[],map:{}}};this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,t=>{t.rowComp.toggleCss("ag-row-focus",this.rowFocused),t.rowComp.toggleCss("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const{focusSvc:e}=this.beans,t=e.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);t!==this.rowFocused&&(this.rowFocused=t,this.setFocusedClasses())}onPaginationChanged(){const e=this.beans.pagination?.getCurrentPage()??0;this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return e;const s=this.beans.pageBounds.getPixelOffset();return e+s*(t?1:-1)}setRowTop(e){if(!this.printLayout&&D(e)){const t=this.applyPaginationOffset(e),r=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeight.getRealPixelPosition(t)}px`;this.setRowTopStyle(r)}}getInitialRowTop(e){return this.suppressRowTransform?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";const t=this.rowNode;let s;if(t.sticky)s=t.stickyRowTop;else{const i=this.slideInAnimation[e]?this.roundRowTopToBounds(t.oldRowTop):t.rowTop,r=this.applyPaginationOffset(i);s=t.isRowPinned()?r:this.beans.rowContainerHeight.getRealPixelPosition(r)}return s+"px"}setRowTopStyle(e){for(const t of this.allRowGuis)this.suppressRowTransform?t.rowComp.setTop(e):t.rowComp.setTransform(`translateY(${e})`)}getCellCtrl(e,t=!1){let s=null;for(const i of this.getAllCellCtrls())i.column==e&&(s=i);if(s!=null||t)return s;for(const i of this.getAllCellCtrls())i?.getColSpanningList().indexOf(e)>=0&&(s=i);return s}onRowIndexChanged(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}updateRowIndexes(e){const t=this.rowNode.getRowIndexString();if(t===null)return;const s=(this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.beans.filterManager?.getHeaderRowCount()??0),i=this.rowNode.rowIndex%2===0,r=this.ariaRowIndex=s+this.rowNode.rowIndex+1;this.forEachGui(e,o=>{o.rowComp.setRowIndex(t),o.rowComp.toggleCss("ag-row-even",i),o.rowComp.toggleCss("ag-row-odd",!i),dr(o.element,r)})}},K2=class extends E{constructor(){super(),this.beanName="navigation",this.onPageDown=bm(this.onPageDown,100),this.onPageUp=bm(this.onPageUp,100)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const s=e.key,i=e.altKey,r=e.ctrlKey||e.metaKey,o=!!this.beans.rangeSvc&&e.shiftKey,n=fh(this.gos,e);let a=!1;switch(s){case b.PAGE_HOME:case b.PAGE_END:!r&&!i&&(this.onHomeOrEndKey(s),a=!0);break;case b.LEFT:case b.RIGHT:case b.UP:case b.DOWN:if(!n)return!1;r&&!i&&!o&&(this.onCtrlUpDownLeftRight(s,n),a=!0);break;case b.PAGE_DOWN:case b.PAGE_UP:!r&&!i&&(a=this.handlePageUpDown(s,n,t));break}return a&&e.preventDefault(),a}handlePageUpDown(e,t,s){return s&&(t=this.beans.focusSvc.getFocusedCell()),t?(e===b.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0):!1}navigateTo({scrollIndex:e,scrollType:t,scrollColumn:s,focusIndex:i,focusColumn:r,isAsync:o,rowPinned:n}){const{scrollFeature:a}=this.gridBodyCon;D(s)&&!s.isPinned()&&a.ensureColumnVisible(s),D(e)&&a.ensureIndexVisible(e,t),o||a.ensureIndexVisible(i);const{focusSvc:l}=this.beans;l.setFocusedCell({rowIndex:i,column:r,rowPinned:n,forceBrowserFocus:!0}),this.setRangeToCellIfSupported({rowIndex:i,rowPinned:n,column:r})}onPageDown(e){const t=this.beans,s=Xh(t),i=this.getViewportHeight(),{pageBounds:r,rowModel:o,rowAutoHeight:n}=t,a=r.getPixelOffset(),l=s.top+i,c=o.getRowIndexAtPixel(l+a);n?.active?this.navigateToNextPageWithAutoHeight(e,c):this.navigateToNextPage(e,c)}onPageUp(e){const t=this.beans,s=Xh(t),{pageBounds:i,rowModel:r,rowAutoHeight:o}=t,n=i.getPixelOffset(),a=s.top,l=r.getRowIndexAtPixel(a+n);o?.active?this.navigateToNextPageWithAutoHeight(e,l,!0):this.navigateToNextPage(e,l,!0)}navigateToNextPage(e,t,s=!1){const{pageBounds:i,rowModel:r}=this.beans,o=this.getViewportHeight(),n=i.getFirstRow(),a=i.getLastRow(),l=i.getPixelOffset(),c=r.getRow(e.rowIndex),d=s?c?.rowHeight-o-l:o-l,u=c?.rowTop+d;let h=r.getRowIndexAtPixel(u+l);if(h===e.rowIndex){const p=s?-1:1;t=h=e.rowIndex+p}let g;s?(g="bottom",ha&&(h=a),t>a&&(t=a)),this.isRowTallerThanView(r.getRow(h))&&(t=h,g="top"),this.navigateTo({scrollIndex:t,scrollType:g,scrollColumn:null,focusIndex:h,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,s=!1){this.navigateTo({scrollIndex:t,scrollType:s?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const i=this.getNextFocusIndexForAutoHeight(e,s);this.navigateTo({scrollIndex:t,scrollType:s?"bottom":"top",scrollColumn:null,focusIndex:i,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){const s=t?-1:1,i=this.getViewportHeight(),{pageBounds:r,rowModel:o}=this.beans,n=r.getLastRow();let a=0,l=e.rowIndex;for(;l>=0&&l<=n;){const c=o.getRow(l);if(c){const d=c.rowHeight??0;if(a+d>i)break;a+=d}l+=s}return Math.max(0,Math.min(l,n))}getViewportHeight(){const e=this.beans,t=Xh(e),s=this.beans.scrollVisibleSvc.getScrollbarWidth();let i=t.bottom-t.top;return e.ctrlsSvc.get("center").isHorizontalScrollShowing()&&(i-=s),i}isRowTallerThanView(e){if(!e)return!1;const t=e.rowHeight;return typeof t!="number"?!1:t>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const s=this.beans.cellNavigation.getNextCellToFocus(e,t,!0);if(!s)return;const i=this.getNormalisedPosition(s),{rowIndex:r,rowPinned:o,column:n}=i??s,a=n;this.navigateTo({scrollIndex:r,scrollType:null,scrollColumn:a,focusIndex:r,focusColumn:a,rowPinned:o})}onHomeOrEndKey(e){const t=e===b.PAGE_HOME,{visibleCols:s,pageBounds:i,rowModel:r}=this.beans,o=s.allCols,n=t?i.getFirstRow():i.getLastRow(),a=r.getRow(n);if(!a)return;const l=(t?o:[...o].reverse()).find(c=>!c.isSuppressNavigable(a)&&!Fe(c));l&&this.navigateTo({scrollIndex:n,scrollType:null,scrollColumn:l,focusIndex:n,focusColumn:l})}onTabKeyDown(e,t){const s=t.shiftKey,i=this.tabToNextCellCommon(e,s,t),r=this.beans,{ctrlsSvc:o,pageBounds:n,focusSvc:a,gos:l}=r;if(i!==!1){i?t.preventDefault():i===null&&o.get("gridCtrl").allowFocusForNextCoreContainer(s);return}if(s){const{rowIndex:c,rowPinned:d}=e.getRowPosition();(d?c===0:c===n.getFirstRow())&&(l.get("headerHeight")===0||xs(r)?Vs(r,!0,!0):(t.preventDefault(),a.focusPreviousFromFirstCell(t)))}else e instanceof yo&&e.focusCell(!0),(a.focusOverlay(!1)||Vs(r,s))&&t.preventDefault()}tabToNextCell(e,t){const s=this.beans,{focusSvc:i,rowRenderer:r}=s,o=i.getFocusedCell();if(!o)return!1;let n=ls(s,o);return!n&&(n=r.getRowByPosition(o),!n?.isFullWidth())?!1:!!this.tabToNextCellCommon(n,e,t,"api")}tabToNextCellCommon(e,t,s,i="ui"){const{editSvc:r,focusSvc:o}=this.beans;let n;const a=e instanceof yo?e:e.getAllCellCtrls()?.[0];return r?.isEditing()?n=r?.moveToNextCell(a,t,s,i):n=this.moveToNextCellNotEditing(e,t,s),n===null?n:n||!!o.focusedHeader}moveToNextCellNotEditing(e,t,s){const i=this.beans.visibleCols.allCols;let r;if(e instanceof ac){if(r={...e.getRowPosition(),column:t?i[0]:W(i)},this.gos.get("embedFullWidthRows")&&s){const n=e.findFullWidthInfoForEvent(s);n&&(r.column=n.column)}}else r=e.getFocusedCellPosition();const o=this.findNextCellToFocusOn(r,{backwards:t,startEditing:!1});if(o===!1)return null;if(o instanceof yo)o.focusCell(!0);else if(o)return this.tryToFocusFullWidthRow(o,t);return D(o)}findNextCellToFocusOn(e,{backwards:t,startEditing:s,skipToNextEditableCell:i}){let r=e;const o=this.beans,{cellNavigation:n,gos:a,focusSvc:l,rowRenderer:c}=o;for(;;){e!==r&&(e=r),t||(r=this.getLastCellOfColSpan(r)),r=n.getNextTabbedCell(r,t);const d=a.getCallback("tabToNextCell");if(D(d)){const p=d({backwards:t,editing:s,previousCellPosition:e,nextCellPosition:r||null});if(p===!0)r=e;else{if(p===!1)return!1;r={rowIndex:p.rowIndex,column:p.column,rowPinned:p.rowPinned}}}if(!r)return null;if(r.rowIndex<0){const g=cs(o);return l.focusHeaderPosition({headerPosition:{headerRowIndex:g+r.rowIndex,column:r.column},fromCell:!0}),null}const u=a.get("editType")==="fullRow";if(s&&(!u||i)&&!this.isCellEditable(r))continue;this.ensureCellVisible(r);const h=ls(o,r);if(!h){const g=c.getRowByPosition(r);if(!g||!g.isFullWidth()||s)continue;return{...g.getRowPosition(),column:r?.column}}if(!n.isSuppressNavigable(h.column,h.rowNode))return h.setFocusedCellPosition(r),this.setRangeToCellIfSupported(r),h}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return t?e.column.isCellEditable(t):!1}lookupRowNodeForCell({rowIndex:e,rowPinned:t}){const{pinnedRowModel:s,rowModel:i}=this.beans;return t==="top"?s?.getPinnedTopRow(e):t==="bottom"?s?.getPinnedBottomRow(e):i.getRow(e)}navigateToNextCell(e,t,s,i){let r=s,o=!1;const n=this.beans,{cellNavigation:a,focusSvc:l,gos:c}=n;for(;r&&(r===s||!this.isValidNavigateCell(r));)c.get("enableRtl")?t===b.LEFT&&(r=this.getLastCellOfColSpan(r)):t===b.RIGHT&&(r=this.getLastCellOfColSpan(r)),r=a.getNextCellToFocus(t,r),o=ne(r);if(o&&e&&e.key===b.UP&&(r={rowIndex:-1,rowPinned:null,column:s.column}),i){const u=c.getCallback("navigateToNextCell");if(D(u)){const g=u({key:t,previousCellPosition:s,nextCellPosition:r||null,event:e});D(g)?r={rowPinned:g.rowPinned,rowIndex:g.rowIndex,column:g.column}:r=null}}if(!r)return;if(r.rowIndex<0){const u=cs(n);l.focusHeaderPosition({headerPosition:{headerRowIndex:u+r.rowIndex,column:r.column??s.column},event:e||void 0,fromCell:!0});return}const d=this.getNormalisedPosition(r);d?this.focusPosition(d):this.tryToFocusFullWidthRow(r)}getNormalisedPosition(e){if(!!this.beans.spannedRowRenderer?.getCellByPosition(e))return e;this.ensureCellVisible(e);const s=ls(this.beans,e);return s?(e=s.getFocusedCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t){const{visibleCols:s,rowRenderer:i,focusSvc:r,eventSvc:o}=this.beans,n=s.allCols;if(!i.getRowByPosition(e)?.isFullWidth())return!1;const l=r.getFocusedCell(),c={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?W(n):n[0])};this.focusPosition(c);const d=t??(l!=null&&ze(c,l));return o.dispatchEvent({type:"fullWidthRowFocused",rowIndex:c.rowIndex,rowPinned:c.rowPinned,column:c.column,isFullWidthCell:!0,fromBelow:d}),!0}focusPosition(e){const{focusSvc:t}=this.beans;t.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),this.setRangeToCellIfSupported(e)}setRangeToCellIfSupported(e){Fe(e.column)||this.beans.rangeSvc?.setRangeToCell(e)}isValidNavigateCell(e){return!!Ve(this.beans,e)}getLastCellOfColSpan(e){const t=ls(this.beans,e);if(!t)return e;const s=t.getColSpanningList();return s.length===1?e:{rowIndex:e.rowIndex,column:W(s),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=bn(this.gos),s=this.beans.rowModel.getRow(e.rowIndex),i=t&&s?.sticky,{scrollFeature:r}=this.gridBodyCon;!i&&ne(e.rowPinned)&&r.ensureIndexVisible(e.rowIndex),e.column.isPinned()||r.ensureColumnVisible(e.column)}ensureColumnVisible(e){const t=this.gridBodyCon.scrollFeature;e.isPinned()||t.ensureColumnVisible(e)}ensureRowVisible(e){this.gridBodyCon.scrollFeature.ensureIndexVisible(e)}};function Xh(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}var ta={moduleName:"KeyboardNavigation",version:H,beans:[K2,d2,FI],apiFunctions:{getFocusedCell:u2,clearFocusedCell:h2,setFocusedCell:g2,setFocusedHeader:m2,tabToNextCell:p2,tabToPreviousCell:f2}},j2=class extends E{constructor(){super(...arguments),this.beanName="pageBoundsListener"}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(e){this.calculatePages(),this.eventSvc.dispatchEvent({type:"paginationChanged",animate:e?.animate??!1,newData:e?.newData??!1,newPage:e?.newPage??!1,newPageSize:e?.newPageSize??!1,keepRenderedRows:e?.keepRenderedRows??!1})}calculatePages(){const{pageBounds:e,pagination:t,rowModel:s}=this.beans;t?t.calculatePages():e.calculateBounds(0,s.getRowCount()-1)}},q2=class extends E{constructor(){super(...arguments),this.beanName="pageBounds",this.pixelOffset=0}getFirstRow(){return this.topRowBounds?.rowIndex??-1}getLastRow(){return this.bottomRowBounds?.rowIndex??-1}getCurrentPageHeight(){const{topRowBounds:e,bottomRowBounds:t}=this;return!e||!t?0:Math.max(t.rowTop+t.rowHeight-e.rowTop,0)}getCurrentPagePixelRange(){const{topRowBounds:e,bottomRowBounds:t}=this,s=e?.rowTop??0,i=t?t.rowTop+t.rowHeight:0;return{pageFirstPixel:s,pageLastPixel:i}}calculateBounds(e,t){const{rowModel:s}=this.beans,i=s.getRowBounds(e);i&&(i.rowIndex=e),this.topRowBounds=i;const r=s.getRowBounds(t);r&&(r.rowIndex=t),this.bottomRowBounds=r,this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){const e=this.topRowBounds?.rowTop??0;this.pixelOffset!==e&&(this.pixelOffset=e,this.eventSvc.dispatchEvent({type:"paginationPixelOffsetChanged"}))}},Y2=".ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top{min-width:0;overflow:hidden;position:relative}.ag-pinned-left-sticky-top,.ag-pinned-right-sticky-top{height:100%;overflow:hidden;position:relative}.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{height:100%;overflow:hidden;width:100%}.ag-pinned-left-header,.ag-pinned-right-header{display:inline-block;height:100%;overflow:hidden;position:relative}.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible){.ag-horizontal-left-spacer:not(.ag-scroller-corner){border-right:var(--ag-pinned-column-border)}.ag-horizontal-right-spacer:not(.ag-scroller-corner){border-left:var(--ag-pinned-column-border)}}.ag-pinned-right-header{border-left:var(--ag-pinned-column-border)}.ag-pinned-left-header{border-right:var(--ag-pinned-column-border)}.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-left:var(--ag-pinned-column-border)}.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-right:var(--ag-pinned-column-border)}.ag-pinned-left-header .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}.ag-pinned-right-header .ag-header-cell-resize:after{left:50%}.ag-pinned-left-header .ag-header-cell-resize{right:-3px}.ag-pinned-right-header .ag-header-cell-resize{left:-3px}",X2=class extends E{constructor(e,t){super(),this.isLeft=e,this.elements=t,this.getWidth=e?()=>this.beans.pinnedCols.leftWidth:()=>this.beans.pinnedCols.rightWidth}postConstruct(){this.addManagedEventListeners({[`${this.isLeft?"left":"right"}PinnedWidthChanged`]:this.onPinnedWidthChanged.bind(this)})}onPinnedWidthChanged(){const e=this.getWidth(),t=e>0;for(const s of this.elements)s&&(V(s,t),ts(s,e))}},Z2=class extends E{constructor(){super(...arguments),this.beanName="pinnedCols"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,t=>{this.gridBodyCtrl=t.gridBodyCtrl});const e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const{gos:e,visibleCols:t,eventSvc:s}=this.beans,i=je(e,"print"),r=i?0:t.getColsLeftWidth(),o=i?0:t.getDisplayedColumnsRightWidth();r!=this.leftWidth&&(this.leftWidth=r,s.dispatchEvent({type:"leftPinnedWidthChanged"})),o!=this.rightWidth&&(this.rightWidth=o,s.dispatchEvent({type:"rightPinnedWidthChanged"}))}keepPinnedColumnsNarrowerThanViewport(){const e=this.gridBodyCtrl.eBodyViewport,t=gr(e);if(t<=50)return;const s=this.getPinnedColumnsOverflowingViewport(t-50),i=this.gos.getCallback("processUnpinnedColumns"),{columns:r,hasLockedPinned:o}=s;let n=r;!n.length&&!o||(i&&(n=i({columns:n,viewportWidth:t})),n?.length&&(n=n.filter(a=>!Fe(a)),this.setColsPinned(n,null,"viewportSizeFeature")))}createPinnedWidthFeature(e,...t){return new X2(e,t)}setColsPinned(e,t,s){const{colModel:i,colAnimation:r,visibleCols:o,gos:n}=this.beans;if(!i.cols||!e?.length)return;if(je(n,"print")){F(37);return}r?.start();let a;t===!0||t==="left"?a="left":t==="right"?a="right":a=null;const l=[];for(const c of e){if(!c)continue;const d=i.getCol(c);d&&d.getPinned()!==a&&(this.setColPinned(d,a),l.push(d))}l.length&&(o.refresh(s),Av(this.eventSvc,l,s)),r?.finish()}initCol(e){const{pinned:t,initialPinned:s}=e.colDef;t!==void 0?this.setColPinned(e,t):this.setColPinned(e,s)}setColPinned(e,t){t===!0||t==="left"?e.pinned="left":t==="right"?e.pinned="right":e.pinned=null,e.dispatchStateUpdatedEvent("pinned")}setupHeaderPinnedWidth(e){const{scrollVisibleSvc:t}=this.beans;if(e.pinned==null)return;const s=e.pinned==="left",i=e.pinned==="right";e.hidden=!0;const r=()=>{const o=s?this.leftWidth:this.rightWidth;if(o==null)return;const n=o==0,a=e.hidden!==n,l=this.gos.get("enableRtl"),c=t.getScrollbarWidth(),u=t.verticalScrollShowing&&(l&&s||!l&&i)?o+c:o;e.comp.setPinnedContainerWidth(`${u}px`),e.comp.setDisplayed(!n),a&&(e.hidden=n,e.refresh())};e.addManagedEventListeners({leftPinnedWidthChanged:r,rightPinnedWidthChanged:r,scrollVisibilityChanged:r,scrollbarWidthChanged:r})}getHeaderResizeDiff(e,t){if(t.getPinned()){const{leftWidth:i,rightWidth:r}=this,o=gr(this.beans.ctrlsSvc.getGridBodyCtrl().eBodyViewport)-50;if(i+r+e>o)if(o>i+r)e=o-i-r;else return 0}return e}getPinnedColumnsOverflowingViewport(e){const t=this.rightWidth??0,s=this.leftWidth??0,i=t+s;let r=!1;if(i0;){if(l0){const g=n[c++];if(g.colDef.lockPinned){r=!0;continue}h-=g.getActualWidth(),u.push(g)}}return{columns:u,hasLockedPinned:r}}},Q2={moduleName:"PinnedColumn",version:H,beans:[Z2],css:[Y2]},J2=class extends Ke{constructor(){super(),this.beanName="ariaAnnounce",this.descriptionContainer=null,this.pendingAnnouncements=new Map,this.lastAnnouncement="",this.updateAnnouncement=Ce(this,this.updateAnnouncement.bind(this),200)}postConstruct(){const e=this.beans,t=me(e),s=this.descriptionContainer=t.createElement("div");s.classList.add("ag-aria-description-container"),sm(s,"polite"),oF(s,"additions text"),rF(s,!0),e.eRootDiv.appendChild(s)}announceValue(e,t){this.pendingAnnouncements.set(t,e),this.updateAnnouncement()}updateAnnouncement(){if(!this.descriptionContainer)return;const e=Array.from(this.pendingAnnouncements.values()).join(". ");this.pendingAnnouncements.clear(),this.descriptionContainer.textContent="",setTimeout(()=>{this.handleAnnouncementUpdate(e)},50)}handleAnnouncementUpdate(e){if(!this.isAlive()||!this.descriptionContainer)return;let t=e;if(t==null||t.replace(/[ .]/g,"")==""){this.lastAnnouncement="";return}this.lastAnnouncement===t&&(t=`${t}\u200B`),this.lastAnnouncement=t,this.descriptionContainer.textContent=t}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(ee(e),e.remove()),this.descriptionContainer=null,this.pendingAnnouncements.clear()}},e3=class extends J2{},t3={moduleName:"Aria",version:H,beans:[e3]},s3=":where(.ag-delay-render){.ag-cell,.ag-header-cell,.ag-header-group-cell,.ag-row,.ag-spanned-cell-wrapper{visibility:hidden}}",jw="ag-delay-render",i3=class extends E{constructor(){super(...arguments),this.beanName="colDelayRenderSvc",this.hideRequested=!1,this.alreadyRevealed=!1,this.timesRetried=0,this.requesters=new Set}hideColumns(e){this.alreadyRevealed||this.requesters.has(e)||(this.requesters.add(e),this.hideRequested||(this.beans.ctrlsSvc.whenReady(this,t=>{t.gridBodyCtrl.eGridBody.classList.add(jw)}),this.hideRequested=!0))}revealColumns(e){if(this.alreadyRevealed||!this.isAlive()||(this.requesters.delete(e),this.requesters.size>0))return;const{renderStatus:t,ctrlsSvc:s}=this.beans;if(t){if(!t.areHeaderCellsRendered()&&this.timesRetried<5){this.timesRetried++,setTimeout(()=>this.revealColumns(e));return}this.timesRetried=0}s.getGridBodyCtrl().eGridBody.classList.remove(jw),this.alreadyRevealed=!0}},r3={moduleName:"ColumnDelayRender",version:H,beans:[i3],css:[s3]},lc=class extends A{constructor(){super()}},o3={tag:"div",cls:"ag-overlay-exporting-center",children:[{tag:"span",ref:"eExportingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eExportingText",cls:"ag-exporting-text"}]},n3=class extends lc{constructor(){super(...arguments),this.eExportingIcon=x,this.eExportingText=x}init(e){const{beans:t}=this;this.setTemplate(o3);const s=_("overlayExporting",t,null);s&&this.eExportingIcon.appendChild(s);const i=e.exporting?.overlayText??this.getLocaleTextFunc()("exportingOoo","Exporting...");this.eExportingText.textContent=i,t.ariaAnnounce.announceValue(i,"overlay")}},a3={tag:"div",cls:"ag-overlay-loading-center",children:[{tag:"span",ref:"eLoadingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eLoadingText",cls:"ag-loading-text"}]},l3=class extends lc{constructor(){super(...arguments),this.eLoadingIcon=x,this.eLoadingText=x}init(e){const{beans:t,gos:s}=this,i=Ae(s.get("overlayLoadingTemplate")?.trim());if(this.setTemplate(i??a3),!i){const r=_("overlayLoading",t,null);r&&this.eLoadingIcon.appendChild(r);const o=e.loading?.overlayText??this.getLocaleTextFunc()("loadingOoo","Loading...");this.eLoadingText.textContent=o,t.ariaAnnounce.announceValue(o,"overlay")}}},c3={tag:"span",cls:"ag-overlay-no-matching-rows-center"},d3=class extends lc{init(e){const{beans:t}=this;this.setTemplate(c3);const s=e.noMatchingRows?.overlayText??this.getLocaleTextFunc()("noMatchingRows","No Matching Rows");this.getGui().textContent=s,t.ariaAnnounce.announceValue(s,"overlay")}},u3={tag:"span",cls:"ag-overlay-no-rows-center"},h3=class extends lc{init(e){const{beans:t,gos:s}=this,i=Ae(s.get("overlayNoRowsTemplate")?.trim());if(this.setTemplate(i??u3),!i){const r=e.noRows?.overlayText??this.getLocaleTextFunc()("noRowsToShow","No Rows To Show");this.getGui().textContent=r,t.ariaAnnounce.announceValue(r,"overlay")}}};function g3(e){e.overlays?.showLoadingOverlay()}function p3(e){e.overlays?.showNoRowsOverlay()}function f3(e){e.overlays?.hideOverlay()}var m3=".ag-overlay{inset:0;pointer-events:none;position:absolute;z-index:2}.ag-overlay-panel,.ag-overlay-wrapper{display:flex;height:100%;width:100%}.ag-overlay-wrapper{align-items:center;flex:none;justify-content:center;text-align:center}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{pointer-events:all}.ag-overlay-exporting-center,.ag-overlay-loading-center{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-popup-shadow);display:flex;padding:var(--ag-spacing)}",C3={tag:"div",cls:"ag-overlay",role:"presentation",children:[{tag:"div",cls:"ag-overlay-panel",role:"presentation",children:[{tag:"div",ref:"eOverlayWrapper",cls:"ag-overlay-wrapper",role:"presentation"}]}]},qw=class extends A{constructor(){super(C3),this.eOverlayWrapper=x,this.activeOverlay=null,this.activePromise=null,this.activeCssClass=null,this.elToFocusAfter=null,this.overlayExclusive=!1,this.oldWrapperPadding=null,this.registerCSS(m3)}handleKeyDown(e){if(e.key!==b.TAB||e.defaultPrevented||Gt(e))return;const{beans:t,eOverlayWrapper:s}=this;if(s&&Qe(t,s,!1,e.shiftKey))return;let r=!1;e.shiftKey?r=t.focusSvc.focusGridView({column:W(t.visibleCols.allCols),backwards:!0,canFocusOverlay:!1}):r=Vs(t,!1),r&&e.preventDefault()}updateLayoutClasses(e,t){const s=this.eOverlayWrapper;if(!s)return;const i=s.classList,{AUTO_HEIGHT:r,NORMAL:o,PRINT:n}=Rs;i.toggle(r,t.autoHeight),i.toggle(o,t.normal),i.toggle(n,t.print)}postConstruct(){this.createManagedBean(new Qu(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.beans.overlays.setWrapperComp(this,!1),this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)}),this.addManagedEventListeners({gridSizeChanged:this.refreshWrapperPadding.bind(this)})}setWrapperTypeClass(e){const t=this.eOverlayWrapper?.classList;if(!t){this.activeCssClass=null;return}this.activeCssClass&&t.toggle(this.activeCssClass,!1),this.activeCssClass=e,t.toggle(e,!0)}showOverlay(e,t,s){if(this.destroyActiveOverlay(),this.elToFocusAfter=null,this.activePromise=e,this.overlayExclusive=s,!e)return this.refreshWrapperPadding(),$.resolve();if(this.setWrapperTypeClass(t),this.setDisplayed(!0,{skipAriaHidden:!0}),this.refreshWrapperPadding(),s&&this.isGridFocused()){const i=ie(this.beans);i&&!ms(this.beans)&&(this.elToFocusAfter=i)}return e.then(i=>{const r=this.eOverlayWrapper;if(!r){this.destroyBean(i);return}if(this.activePromise!==e){this.activeOverlay!==i&&(this.destroyBean(i),i=null);return}this.activePromise=null,i&&(this.activeOverlay!==i&&(r.appendChild(i.getGui()),this.activeOverlay=i),s&&this.isGridFocused()&&Ge(r))}),e}refreshWrapperPadding(){if(!this.eOverlayWrapper){this.oldWrapperPadding=null;return}const e=!!this.activeOverlay||!!this.activePromise;let t=0;e&&!this.overlayExclusive&&(t=this.beans.ctrlsSvc.get("gridHeaderCtrl")?.headerHeight||0),t!==this.oldWrapperPadding&&(this.oldWrapperPadding=t,this.eOverlayWrapper.style.setProperty("padding-top",`${t}px`))}destroyActiveOverlay(){this.activePromise=null;const e=this.activeOverlay;if(!e){this.overlayExclusive=!1,this.elToFocusAfter=null,this.refreshWrapperPadding();return}let t=this.elToFocusAfter;this.elToFocusAfter=null,this.activeOverlay=null,this.overlayExclusive=!1,t&&!this.isGridFocused()&&(t=null),this.destroyBean(e);const s=this.eOverlayWrapper;s&&ee(s),t?.focus?.({preventScroll:!0}),this.refreshWrapperPadding()}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}isGridFocused(){const e=ie(this.beans);return!!e&&this.beans.eGridDiv.contains(e)}destroy(){this.elToFocusAfter=null,this.destroyActiveOverlay(),this.beans.overlays.setWrapperComp(this,!0),super.destroy(),this.eOverlayWrapper=null}},v3={selector:"AG-OVERLAY-WRAPPER",component:qw},w3=["refresh"],sa=e=>({name:e,optionalMethods:w3}),Lr={id:"agLoadingOverlay",overlayType:"loading",comp:sa("loadingOverlayComponent"),wrapperCls:"ag-overlay-loading-wrapper",exclusive:!0,compKey:"loadingOverlayComponent",paramsKey:"loadingOverlayComponentParams",isSuppressed:e=>{const t=e.get("loading");return t===!1||e.get("suppressLoadingOverlay")===!0&&t!==!0}},xo={id:"agNoRowsOverlay",overlayType:"noRows",comp:sa("noRowsOverlayComponent"),wrapperCls:"ag-overlay-no-rows-wrapper",compKey:"noRowsOverlayComponent",paramsKey:"noRowsOverlayComponentParams",isSuppressed:e=>e.get("suppressNoRowsOverlay")},Zh={id:"agNoMatchingRowsOverlay",overlayType:"noMatchingRows",comp:sa("noMatchingRowsOverlayComponent"),wrapperCls:"ag-overlay-no-matching-rows-wrapper"},cc={id:"agExportingOverlay",overlayType:"exporting",comp:sa("exportingOverlayComponent"),wrapperCls:"ag-overlay-exporting-wrapper",exclusive:!0},dc={id:"activeOverlay",comp:sa("activeOverlay"),wrapperCls:"ag-overlay-modal-wrapper",exclusive:!0},b3=e=>e?{agLoadingOverlay:Lr,agNoRowsOverlay:xo,agNoMatchingRowsOverlay:Zh,agExportingOverlay:cc}[e]??dc:null,S3=e=>e?{loading:Lr,noRows:xo,noMatchingRows:Zh,exporting:cc}[e]:null,y3=class extends E{constructor(){super(...arguments),this.beanName="overlays",this.eWrapper=void 0,this.exclusive=!1,this.oldExclusive=!1,this.currentDef=null,this.showInitialOverlay=!0,this.userForcedNoRows=!1,this.exportsInProgress=0,this.newColumnsLoadedCleanup=null}postConstruct(){const e=this.gos;this.showInitialOverlay=ae(e);const t=()=>{this.userForcedNoRows||this.updateOverlay(!1)},[s,i,r,o]=this.addManagedEventListeners({newColumnsLoaded:t,rowCountReady:()=>{this.disableInitialOverlay(),t(),i()},rowDataUpdated:t,modelUpdated:t});this.newColumnsLoadedCleanup=s,this.addManagedPropertyListeners(["loading","activeOverlay","activeOverlayParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams"],n=>this.onPropChange(new Set(n.changeSet?.properties)))}destroy(){this.doHideOverlay(),super.destroy(),this.eWrapper=void 0}setWrapperComp(e,t){this.isAlive()&&(t?this.eWrapper===e&&(this.eWrapper=void 0):this.eWrapper=e,this.updateOverlay(!1))}isVisible(){return!!this.currentDef}showLoadingOverlay(){this.showInitialOverlay=!1;const e=this.gos;if(!this.eWrapper||e.get("activeOverlay")||this.isDisabled(Lr))return;const t=e.get("loading");!t&&t!==void 0||this.doShowOverlay(Lr)}showNoRowsOverlay(){this.showInitialOverlay=!1;const e=this.gos;!this.eWrapper||e.get("activeOverlay")||e.get("loading")||this.isDisabled(xo)||(this.userForcedNoRows=!0,this.doShowOverlay(xo))}async showExportOverlay(e){const{gos:t,beans:s}=this;if(!this.eWrapper||t.get("activeOverlay")||t.get("loading")||this.isDisabled(cc)||this.userForcedNoRows&&this.currentDef===xo){e();return}const i=this.getDesiredDefWithOverride(cc);if(!i){e();return}this.exportsInProgress++,this.focusedCell=s.focusSvc.getFocusedCell(),await this.doShowOverlay(i),await new Promise(o=>setTimeout(()=>o()));const r=Date.now();try{e()}finally{const o=Date.now()-r,n=Math.max(0,300-o),a=()=>{this.exportsInProgress--,this.exportsInProgress===0&&(this.updateOverlay(!1),_u(s,this.focusedCell),this.focusedCell=null)};n>0?setTimeout(()=>a(),n):a()}}hideOverlay(){const e=this.gos;this.showInitialOverlay=!1;const t=this.userForcedNoRows;if(this.userForcedNoRows=!1,e.get("loading")){F(99);return}if(e.get("activeOverlay")){F(296);return}if(this.currentDef===Zh){F(297);return}this.doHideOverlay(),t&&this.getOverlayDef()!==xo&&this.updateOverlay(!1)}getOverlayWrapperSelector(){return v3}getOverlayWrapperCompClass(){return qw}onPropChange(e){const t=e.has("activeOverlay");if((t||e.has("loading"))&&this.updateOverlay(t))return;const s=this.currentDef,i=this.eWrapper?.activeOverlay;if(i&&s){const r=e.has("activeOverlayParams");if(s===dc)r&&i.refresh?.(this.makeCompParams(!0));else{const o=s.paramsKey;(e.has("overlayComponentParams")||o&&e.has(o))&&i.refresh?.(this.makeCompParams(!1,o,s.overlayType))}}}updateOverlay(e){const t=this.eWrapper;if(!t)return this.currentDef=null,!1;const s=this.getDesiredDefWithOverride(),i=this.currentDef,r=s===dc&&e;return s!==i?s?(this.doShowOverlay(s),!0):(this.disableInitialOverlay(),this.doHideOverlay()):r&&s?(t.hideOverlay(),this.doShowOverlay(s),!0):(s||this.disableInitialOverlay(),!1)}getDesiredDefWithOverride(e){const{gos:t}=this;let s=b3(t.get("activeOverlay"));return s||(s=e??this.getOverlayDef(),s&&this.isDisabled(s)&&(s=null)),s}getOverlayDef(){const{gos:e,beans:t}=this,{rowModel:s}=t,i=e.get("loading");if(i!==void 0){if(this.disableInitialOverlay(),i)return Lr}else if(this.showInitialOverlay){if(!this.isDisabled(Lr)&&(!e.get("columnDefs")||!e.get("rowData")))return Lr;this.disableInitialOverlay()}else this.disableInitialOverlay();const o=s.getOverlayType();return S3(o)}disableInitialOverlay(){this.showInitialOverlay=!1,this.newColumnsLoadedCleanup?.(),this.newColumnsLoadedCleanup=null}doShowOverlay(e){const{gos:t,beans:s}=this,{userCompFactory:i}=s;this.currentDef=e;const r=e!==dc,o=!!e.exclusive;this.exclusive=o;let n;(e.paramsKey&&t.get(e.paramsKey)||e.compKey&&t.get(e.compKey))&&(n=e.paramsKey);let a;r&&(t.get("overlayComponent")||t.get("overlayComponentSelector"))&&(a=i.getCompDetailsFromGridOptions({name:"overlayComponent",optionalMethods:["refresh"]},void 0,this.makeCompParams(!1,e.paramsKey,e.overlayType))),a??(a=i.getCompDetailsFromGridOptions(e.comp,r?e.id:void 0,this.makeCompParams(!r,n,e.overlayType),!1));const l=a?.newAgStackInstance()??null,c=this.eWrapper?this.eWrapper.showOverlay(l,e.wrapperCls,o):$.resolve();return this.eWrapper?.refreshWrapperPadding(),this.setExclusive(o),c}makeCompParams(e,t,s){const{gos:i}=this,r=e?i.get("activeOverlayParams"):{...i.get("overlayComponentParams"),...t&&i.get(t)||null,overlayType:s};return N(i,r??{})}doHideOverlay(){let e=!1;this.currentDef&&(this.currentDef=null,e=!0),this.exclusive=!1;const t=this.eWrapper;return t&&(t.hideOverlay(),t.refreshWrapperPadding(),this.setExclusive(!1)),e}setExclusive(e){this.oldExclusive!==e&&(this.oldExclusive=e,this.eventSvc.dispatchEvent({type:"overlayExclusiveChanged"}))}isDisabled(e){const{gos:t}=this;return e.overlayType&&t.get("suppressOverlays")?.includes(e.overlayType)||e.isSuppressed?.(t)===!0}},x3={moduleName:"Overlay",version:H,userComponents:{agLoadingOverlay:l3,agNoRowsOverlay:h3,agNoMatchingRowsOverlay:d3,agExportingOverlay:n3},apiFunctions:{showLoadingOverlay:g3,showNoRowsOverlay:p3,hideOverlay:f3},icons:{overlayLoading:"loading",overlayExporting:"loading"},beans:[y3]},R3=class extends E{constructor(){super(...arguments),this.beanName="rowContainerHeight",this.scrollY=0,this.uiBodyHeight=0}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=_E(),yi(this.gos,"RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}updateOffset(){if(!this.stretching)return;const e=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition().top,t=this.getUiBodyHeight();(e!==this.scrollY||t!==this.uiBodyHeight)&&(this.scrollY=e,this.uiBodyHeight=t,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;yi(this.gos,`RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventSvc.dispatchEvent({type:"rowContainerHeightChanged"}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t=typeof e=="number"?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventSvc.dispatchEvent({type:"heightScaleChanged"}))}setModelHeight(e){this.modelHeight=e,this.stretching=e!=null&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const e=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=this.modelHeight-this.getUiBodyHeight(),s=e/t;return this.maxScrollY*s}},F3=400,E3=class extends E{constructor(){super(...arguments),this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{for(const o of this.getAllCellCtrls())o.onCellSelectionChanged()},t=()=>{for(const o of this.getAllCellCtrls())o.updateRangeBordersIfRangeCount()},s=()=>{this.eventSvc.addListener("cellSelectionChanged",e),this.eventSvc.addListener("columnMoved",t),this.eventSvc.addListener("columnPinned",t),this.eventSvc.addListener("columnVisible",t)},i=()=>{this.eventSvc.removeListener("cellSelectionChanged",e),this.eventSvc.removeListener("columnMoved",t),this.eventSvc.removeListener("columnPinned",t),this.eventSvc.removeListener("columnVisible",t)};this.addDestroyFunc(()=>i()),this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{mt(this.gos)?s():i()}),mt(this.gos)&&s()}}wireBeans(e){this.pageBounds=e.pageBounds,this.colModel=e.colModel,this.pinnedRowModel=e.pinnedRowModel,this.rowModel=e.rowModel,this.focusSvc=e.focusSvc,this.rowContainerHeight=e.rowContainerHeight,this.ctrlsSvc=e.ctrlsSvc,this.editSvc=e.editSvc}postConstruct(){this.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()})}initialise(){this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),pinnedRowsChanged:this.onPinnedRowsChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this,{})}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListener("suppressCellFocus",i=>this.onSuppressCellFocusChanged(i.currentValue)),this.addManagedPropertyListeners(["groupSuppressBlankHeader","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.addManagedPropertyListener("cellSelection",({currentValue:i,previousValue:r})=>{(!r&&i||r&&!i)&&this.redrawRows()});const{stickyRowSvc:e,gos:t,showRowGroupCols:s}=this.beans;if(s&&this.addManagedPropertyListener("showOpenedGroup",()=>{const i=s.columns;i.length&&this.refreshCells({columns:i,force:!0})}),e)this.stickyRowFeature=e.createStickyRowFeature(this,this.createRowCon.bind(this),this.destroyRowCtrls.bind(this));else{const i=this.gridBodyCtrl;i.setStickyTopHeight(0),i.setStickyBottomHeight(0)}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=je(t,"print"),this.embedFullWidthRows=this.printLayout||t.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=e??3;this.cachedRowCtrls=new P3(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?.stickyTopRowCtrls??[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?.stickyBottomRowCtrls??[]}updateAllRowCtrls(){const e=Object.values(this.rowCtrlsByRowIndex),t=Object.values(this.zombieRowCtrls),s=this.cachedRowCtrls?.getEntries()??[];t.length>0||s.length>0?this.allRowCtrls=[...e,...t,...s]:this.allRowCtrls=e}isCellBeingRendered(e,t){const s=this.rowCtrlsByRowIndex[e];return!t||!s?!!s:s.isFullWidth()?!0:!!this.beans.spannedRowRenderer?.getCellByPosition({rowIndex:e,column:t,rowPinned:null})||!!s.getCellCtrl(t)||!s.isRowRendered()}updateCellFocus(e){for(const t of this.getAllCellCtrls())t.onCellFocused(e);for(const t of this.getFullWidthRowCtrls())t.onFullWidthRowFocused(e)}onCellFocusChanged(e){if(e?.rowIndex!=null&&!e.rowPinned){const t=this.beans.colModel.getCol(e.column)??void 0;this.isCellBeingRendered(e.rowIndex,t)||this.redraw()}this.updateCellFocus(e)}onSuppressCellFocusChanged(e){for(const t of this.getAllCellCtrls())t.onSuppressCellFocusChanged(e);for(const t of this.getFullWidthRowCtrls())t.onSuppressCellFocusChanged(e)}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:e=>this.onCellFocusChanged(e),cellFocusCleared:()=>this.updateCellFocus(),flashCells:e=>{const{cellFlashSvc:t}=this.beans;if(t)for(const s of this.getAllCellCtrls())t.onFlashCells(s,e)},columnHoverChanged:()=>{for(const e of this.getAllCellCtrls())e.onColumnHover()},displayedColumnsChanged:()=>{for(const e of this.getAllCellCtrls())e.onDisplayedColumnsChanged()},displayedColumnsWidthChanged:()=>{if(this.printLayout)for(const e of this.getAllCellCtrls())e.onLeftChanged()}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){for(const e of this.destroyFuncsForColumnListeners)e();this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners();const e=this.colModel.getCols();for(const t of e){const s=l=>{for(const c of this.getAllCellCtrls())c.column===t&&l(c)},i=()=>{s(l=>l.onLeftChanged())},r=()=>{s(l=>l.onWidthChanged())},o=()=>{s(l=>l.onFirstRightPinnedChanged())},n=()=>{s(l=>l.onLastLeftPinnedChanged())},a=()=>{s(l=>l.onColDefChanged())};t.__addEventListener("leftChanged",i),t.__addEventListener("widthChanged",r),t.__addEventListener("firstRightPinnedChanged",o),t.__addEventListener("lastLeftPinnedChanged",n),t.__addEventListener("colDefChanged",a),this.destroyFuncsForColumnListeners.push(()=>{t.__removeEventListener("leftChanged",i),t.__removeEventListener("widthChanged",r),t.__removeEventListener("firstRightPinnedChanged",o),t.__removeEventListener("lastLeftPinnedChanged",n),t.__removeEventListener("colDefChanged",a)})}}onDomLayoutChanged(){const e=je(this.gos,"print"),t=e||this.gos.get("embedFullWidthRows"),s=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,s&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsNotSpanningForColumn(e){const t=[];for(const s of this.getAllRowCtrls()){const i=s.getCellCtrl(e,!0)?.eGui;i&&t.push(i)}return t}refreshFloatingRowComps(e=!0){this.refreshFloatingRows(this.topRowCtrls,"top",e),this.refreshFloatingRows(this.bottomRowCtrls,"bottom",e)}refreshFloatingRows(e,t,s){const{pinnedRowModel:i,beans:r,printLayout:o}=this,n=Object.fromEntries(e.map(l=>[l.rowNode.id,l]));i?.forEachPinnedRow(t,(l,c)=>{const d=e[c];d&&i.getPinnedRowById(d.rowNode.id,t)===void 0&&(d.destroyFirstPass(),d.destroySecondPass()),l.id in n&&s?(e[c]=n[l.id],delete n[l.id]):e[c]=new ac(l,r,!1,!1,o)});const a=(t==="top"?i?.getPinnedTopRowCount():i?.getPinnedBottomRowCount())??0;e.length=a}onPinnedRowDataChanged(){const e={recycleRows:!0};this.redrawAfterModelUpdate(e)}onPinnedRowsChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){if(e.sticky)this.stickyRowFeature?.refreshStickyNode(e);else if(this.cachedRowCtrls?.has(e)){this.cachedRowCtrls.removeRow(e);return}else{const s=i=>{const r=i[e.rowIndex];r&&r.rowNode===e&&(r.destroyFirstPass(),r.destroySecondPass(),i[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":s(this.topRowCtrls);break;case"bottom":s(this.bottomRowCtrls);break;default:s(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){const{editSvc:t}=this.beans;if(t?.isEditing()&&(t.isBatchEditing()?t.cleanupEditors():t.stopEditing(void 0,{source:"api"})),e!=null){for(const i of e??[])this.redrawRow(i,!0);this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.beans.focusSvc?.getFocusCellToUseAfterRefresh();this.updateContainerHeights(),this.scrollToTopIfNewData(e);const s=!e.domLayoutChanged&&!!e.recycleRows,i=e.animate&&Cr(this.gos),r=s?this.getRowsToRecycle():null;s||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender();const{stickyRowFeature:o,gos:n}=this;if(o){o.checkStickyRows();const a=o.extraTopHeight+o.extraBottomHeight;a&&this.updateContainerHeights(a)}this.recycleRows(r,i),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(n.get("enableRowPinning")?s:void 0),this.dispatchDisplayedRowsChanged(),t!=null&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,s=this.gos.get("suppressScrollOnNewData");t&&!s&&(this.gridBodyCtrl.scrollFeature.scrollToTop(),this.stickyRowFeature?.resetOffsets())}updateContainerHeights(e=0){const{rowContainerHeight:t}=this;if(this.printLayout){t.setModelHeight(null);return}let s=this.pageBounds.getCurrentPageHeight();s===0&&(s=1),t.setModelHeight(s+e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error(Ft(252));this.refreshInProgress=!0,this.beans.frameworkOverrides.getLockOnRefresh?.()}releaseLockOnRefresh(){this.refreshInProgress=!1,this.beans.frameworkOverrides.releaseLockOnRefresh?.()}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){if(!e)return;const t=this.beans.focusSvc,s=this.findPositionToFocus(e);if(!s){t.focusHeaderPosition({headerPosition:{headerRowIndex:cs(this.beans)-1,column:e.column}});return}if(e.rowIndex!==s.rowIndex||e.rowPinned!=s.rowPinned){t.setFocusedCell({...s,preventScrollOnBrowserFocus:!0,forceBrowserFocus:!0});return}t.doesRowOrCellHaveBrowserFocus()||this.updateCellFocus(N(this.gos,{...s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))}findPositionToFocus(e){const{pagination:t,pageBounds:s}=this.beans;let i=e;for(i.rowPinned==null&&t&&s&&!t.isRowInPage(i.rowIndex)&&(i={rowPinned:null,rowIndex:s.getFirstRow()});i;){if(i.rowPinned==null&&s)if(i.rowIndexs.getLastRow()&&(i={rowPinned:null,rowIndex:s.getLastRow()});const r=this.getRowByPosition(i);if(r?.isAlive())return{...r.getRowPosition(),column:e.column};i=Yt(this.beans,i)}return null}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),s=t.length;for(let i=0;i{const r=i.rowNode;return Jh(r,t)})}getCellCtrls(e,t){let s;D(t)&&(s={},t.forEach(r=>{const o=this.colModel.getCol(r);D(o)&&(s[o.getId()]=!0)}));const i=[];for(const r of this.getRowCtrls(e))for(const o of r.getAllCellCtrls()){const n=o.column.getId();s&&!s[n]||i.push(o)}return i}destroy(){this.removeAllRowComps(!0),super.destroy()}removeAllRowComps(e=!1){const t=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(t,e),this.stickyRowFeature?.destroyStickyCtrls()}getRowsToRecycle(){const e=[];for(const s of Object.keys(this.rowCtrlsByRowIndex))this.rowCtrlsByRowIndex[s].rowNode.id==null&&e.push(s);this.removeRowCtrls(e);const t={};for(const s of Object.values(this.rowCtrlsByRowIndex)){const i=s.rowNode;t[i.id]=s}return this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){for(const s of e){const i=this.rowCtrlsByRowIndex[s];i&&(i.destroyFirstPass(t),i.destroySecondPass()),delete this.rowCtrlsByRowIndex[s]}}onBodyScroll(e){e.direction==="vertical"&&this.redraw({afterScroll:!0})}redraw(e={}){const{focusSvc:t,animationFrameSvc:s}=this.beans,{afterScroll:i}=e;let r;const o=this.stickyRowFeature;o&&(r=t?.getFocusCellToUseAfterRefresh()||void 0);const n=this.firstRenderedRow,a=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let l=!1;if(o){l=o.checkStickyRows();const d=o.extraTopHeight+o.extraBottomHeight;d&&this.updateContainerHeights(d)}const c=this.firstRenderedRow!==n||this.lastRenderedRow!==a;if(!(i&&!l&&!c)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,i),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(i&&!l),r!=null)){const d=t?.getFocusCellToUseAfterRefresh();r!=null&&d==null&&(s?.flushAllFrames(),this.restoreFocusedCell(r))}}removeRowCompsNotToDraw(e,t){const s={};for(const o of e)s[o]=!0;const r=Object.keys(this.rowCtrlsByRowIndex).filter(o=>!s[o]);this.removeRowCtrls(r,t)}calculateIndexesToDraw(e){const t=[];for(let n=this.firstRenderedRow;n<=this.lastRenderedRow;n++)t.push(n);const s=this.beans.pagination,i=this.beans.focusSvc?.getFocusedCell()?.rowIndex;i!=null&&(ithis.lastRenderedRow)&&(!s||s.isRowInPage(i))&&i{const a=n.rowNode.rowIndex;a==null||a===i||(athis.lastRenderedRow)&&this.doNotUnVirtualiseRow(n)&&t.push(a)};for(const n of Object.values(this.rowCtrlsByRowIndex))r(n);if(e)for(const n of Object.values(e))r(n);t.sort((n,a)=>n-a);const o=[];for(let n=0;n{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}):this.destroyRowCtrls(e,t)}this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){this.eventSvc.dispatchEvent({type:"displayedRowsChanged",afterScroll:e})}onDisplayedColumnsChanged(){const{visibleCols:e}=this.beans,t=e.isPinningLeft(),s=e.isPinningRight();(this.pinningLeft!==t||s!==this.pinningRight)&&(this.pinningLeft=t,this.pinningRight=s,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];for(const t of this.getFullWidthRowCtrls()){const s=t.rowNode.rowIndex;e.push(s.toString())}this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=Qh(e);return this.getAllRowCtrls().filter(s=>{if(!s.isFullWidth())return!1;const i=s.rowNode;return!(t!=null&&!Jh(i,t))})}createOrUpdateRowCtrl(e,t,s,i){let r,o=this.rowCtrlsByRowIndex[e];if(o||(r=this.rowModel.getRow(e),D(r)&&D(t)&&t[r.id]&&r.alreadyRendered&&(o=t[r.id],t[r.id]=null)),!o)if(r||(r=this.rowModel.getRow(e)),D(r))o=this.createRowCon(r,s,i);else return;r&&(r.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=o}destroyRowCtrls(e,t){const s=[];if(e){for(const i of Object.values(e))if(i){if(this.cachedRowCtrls&&i.isCacheable()){this.cachedRowCtrls.addRow(i);continue}if(i.destroyFirstPass(!t),t){const r=i.instanceId;this.zombieRowCtrls[r]=i,s.push(()=>{i.destroySecondPass(),delete this.zombieRowCtrls[r]})}else i.destroySecondPass()}}t&&(s.push(()=>{this.isAlive()&&(this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged())}),window.setTimeout(()=>{for(const i of s)i()},F3))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){const e=this.getRowBuffer(),t=Et(this.beans);return e*t}workOutFirstAndLastRowsToRender(){const{rowContainerHeight:e,pageBounds:t,rowModel:s}=this;e.updateOffset();let i,r;if(!s.isRowsToRender())i=0,r=-1;else if(this.printLayout)this.beans.environment.refreshRowHeightVariable(),i=t.getFirstRow(),r=t.getLastRow();else{const d=this.getRowBufferInPixels(),u=this.ctrlsSvc.getScrollFeature(),h=this.gos.get("suppressRowVirtualisation");let g=!1,p,f;do{const S=t.getPixelOffset(),{pageFirstPixel:y,pageLastPixel:R}=t.getCurrentPagePixelRange(),P=e.divStretchOffset,M=u.getVScrollPosition(),T=M.top,I=M.bottom;h?(p=y+P,f=R+P):(p=Math.max(T+S-d,y)+P,f=Math.min(I+S+d,R)+P),this.firstVisibleVPixel=Math.max(T+S,y)+P,this.lastVisibleVPixel=Math.min(I+S,R)+P,g=this.ensureAllRowsInRangeHaveHeightsCalculated(p,f)}while(g);let m=s.getRowIndexAtPixel(p),C=s.getRowIndexAtPixel(f);const v=t.getFirstRow(),w=t.getLastRow();mw&&(C=w),i=m,r=C}const o=je(this.gos,"normal"),n=this.gos.get("suppressMaxRenderedRowRestriction"),a=Math.max(this.getRowBuffer(),500);o&&!n&&r-i>a&&(r=i+a);const l=i!==this.firstRenderedRow,c=r!==this.lastRenderedRow;(l||c)&&(this.firstRenderedRow=i,this.lastRenderedRow=r,this.eventSvc.dispatchEvent({type:"viewportChanged",firstRow:i,lastRow:r}))}dispatchFirstDataRenderedEvent(){this.dataFirstRenderedFired||(this.dataFirstRenderedFired=!0,Rt(this.beans,()=>{this.beans.eventSvc.dispatchEvent({type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow})}))}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const s=this.pinnedRowModel?.ensureRowHeightsValid(),i=this.stickyRowFeature?.ensureRowHeightsValid(),{pageBounds:r,rowModel:o}=this,n=o.ensureRowHeightsValid(e,t,r.getFirstRow(),r.getLastRow());return(n||i)&&this.eventSvc.dispatchEvent({type:"recalculateRowBounds"}),i||n||s?(this.updateContainerHeights(),!0):!1}doNotUnVirtualiseRow(e){const i=e.rowNode,r=this.focusSvc.isRowFocused(i.rowIndex,i.rowPinned),o=this.editSvc?.isEditing(e),n=i.detail;return r||o||n?!!this.isRowPresent(i):!1}isRowPresent(e){return this.rowModel.isRowPresent(e)?this.beans.pagination?.isRowInPage(e.rowIndex)??!0:!1}createRowCon(e,t,s){const i=this.cachedRowCtrls?.getRow(e)??null;if(i)return i;const r=s&&!this.printLayout&&!!this.beans.animationFrameSvc?.active;return new ac(e,this.beans,t,r,this.printLayout)}getRenderedNodes(){const e=Object.values(this.rowCtrlsByRowIndex).map(i=>i.rowNode),t=this.getStickyTopRowCtrls().map(i=>i.rowNode),s=this.getStickyBottomRowCtrls().map(i=>i.rowNode);return[...t,...e,...s]}getRowByPosition(e){let t;const{rowIndex:s}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[s];break;case"bottom":t=this.bottomRowCtrls[s];break;default:t=this.rowCtrlsByRowIndex[s],t||(t=this.getStickyTopRowCtrls().find(i=>i.rowNode.rowIndex===s)||null,t||(t=this.getStickyBottomRowCtrls().find(i=>i.rowNode.rowIndex===s)||null));break}return t}isRangeInRenderedViewport(e,t){if(e==null||t==null)return!1;const i=e>this.lastRenderedRow;return!(tthis.maxCount){const t=this.entriesList[0];t.destroyFirstPass(),t.destroySecondPass(),this.removeFromCache(t)}}getRow(e){if(e?.id==null)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.rowNode!=e?null:t):null}has(e){return this.entriesMap[e.id]!=null}removeRow(e){const t=e.id,s=this.entriesMap[t];delete this.entriesMap[t],De(this.entriesList,s)}removeFromCache(e){const t=e.rowNode.id;delete this.entriesMap[t],De(this.entriesList,e)}getEntries(){return this.entriesList}};function Qh(e){if(!e)return;const t={top:{},bottom:{},normal:{}};for(const s of e){const i=s.id;switch(s.rowPinned){case"top":t.top[i]=s;break;case"bottom":t.bottom[i]=s;break;default:t.normal[i]=s;break}}return t}function Jh(e,t){const s=e.id;switch(e.rowPinned){case"top":return t.top[s]!=null;case"bottom":return t.bottom[s]!=null;default:return t.normal[s]!=null}}var M3=class extends E{constructor(){super(...arguments),this.beanName="rowNodeSorter",this.accentedSort=!1,this.primaryColumnsSortGroups=!1,this.pivotActive=!1}postConstruct(){this.firstLeaf=ae(this.gos)?Gi:T3,this.addManagedPropertyListeners(["accentedSort","autoGroupColumnDef","treeData"],this.updateOptions.bind(this));const e=this.updatePivotModeState.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,columnPivotChanged:e}),this.updateOptions(),e()}updateOptions(){this.accentedSort=!!this.gos.get("accentedSort"),this.primaryColumnsSortGroups=ws(this.gos)}updatePivotModeState(){this.pivotActive=this.beans.colModel.isPivotActive()}doFullSortInPlace(e,t){return e.sort((s,i)=>this.compareRowNodes(t,s,i))}compareRowNodes(e,t,s){if(t===s)return 0;const i=this.accentedSort;for(let r=0,o=e.length;r{if(e.data)return e;let t=e.childrenAfterGroup;for(;t?.length;){const s=t[0];if(s.data)return s;t=s.childrenAfterGroup}},Yw=e=>{if(!e)return e;if(typeof e=="bigint")return e<0n?-e:e;const t=Number(e);return isNaN(t)?e:Math.abs(t)};function D3(e){e.sortSvc?.onSortChanged("api")}var Gr=(e,t)=>({tag:"span",ref:`eSort${e}`,cls:`ag-sort-indicator-icon ag-sort-${t} ag-hidden`,attrs:{"aria-hidden":"true"}}),A3={tag:"span",cls:"ag-sort-indicator-container",children:[Gr("Order","order"),Gr("Asc","ascending-icon"),Gr("Desc","descending-icon"),Gr("Mixed","mixed-icon"),Gr("AbsoluteAsc","absolute-ascending-icon"),Gr("AbsoluteDesc","absolute-descending-icon"),Gr("None","none-icon")]},eg=class extends A{constructor(e){super(),this.eSortOrder=x,this.eSortAsc=x,this.eSortDesc=x,this.eSortMixed=x,this.eSortNone=x,this.eSortAbsoluteAsc=x,this.eSortAbsoluteDesc=x,e||this.setTemplate(A3)}attachCustomElements(e,t,s,i,r,o,n){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=s,this.eSortMixed=i,this.eSortNone=r,this.eSortAbsoluteAsc=o,this.eSortAbsoluteDesc=n}setupSort(e,t=!1,s){if(this.column=e,this.suppressOrder=t,this.getSortDefOverride=s,this.setupMultiSortIndicator(),!e.isSortable()&&!e.getColDef().showRowGroup)return;this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addInIcon("sortAbsoluteAscending",this.eSortAbsoluteAsc,e),this.addInIcon("sortAbsoluteDescending",this.eSortAbsoluteDesc,e);const i=this.updateIcons.bind(this),r=this.onSortChanged.bind(this);this.addManagedPropertyListener("unSortIcon",i),this.addManagedEventListeners({newColumnsLoaded:i,sortChanged:r,columnRowGroupChanged:r}),this.onSortChanged()}addInIcon(e,t,s){if(t==null)return;const i=_(e,this.beans,s);i&&t.appendChild(i)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const{eSortAsc:e,eSortDesc:t,eSortAbsoluteAsc:s,eSortAbsoluteDesc:i,eSortNone:r,column:o,gos:n,beans:a}=this,l=lu(o,a,this.getSortDefOverride),c=l.isDefaultSortAllowed,d=l.isAbsoluteSortAllowed,{isAbsoluteSort:u,isDefaultSort:h,isAscending:g,isDescending:p,direction:f}=l;if(e&&V(e,g&&h&&c,{skipAriaHidden:!0}),t&&V(t,p&&h&&c,{skipAriaHidden:!0}),r){const m=!o.getColDef().unSortIcon&&!n.get("unSortIcon");V(r,!m&&!f,{skipAriaHidden:!0})}s&&V(s,g&&u&&d,{skipAriaHidden:!0}),i&&V(i,p&&u&&d,{skipAriaHidden:!0})}setupMultiSortIndicator(){const{eSortMixed:e,column:t,gos:s}=this;this.addInIcon("sortUnSort",e,t);const i=t.getColDef().showRowGroup;ws(s)&&i&&(this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator())}updateMultiSortIndicator(){const{eSortMixed:e,beans:t,column:s}=this;if(e){const i=t.sortSvc.getDisplaySortForColumn(s)?.direction==="mixed";V(e,i,{skipAriaHidden:!0})}}updateSortOrder(){const{eSortOrder:e,column:t,beans:{sortSvc:s}}=this;if(!e)return;const i=s.getColumnsWithSortingOrdered(),r=s.getDisplaySortIndexForColumn(t)??-1,o=i.some(a=>s.getDisplaySortIndexForColumn(a)??-1>=1),n=r>=0&&o;V(e,n,{skipAriaHidden:!0}),r>=0?e.textContent=(r+1).toString():ee(e)}refresh(){this.onSortChanged()}},I3={selector:"AG-SORT-INDICATOR",component:eg},k3=class extends E{constructor(){super(...arguments),this.beanName="sortSvc"}progressSort(e,t,s){const i=this.getNextSortDirection(e);this.setSortForColumn(e,i,t,s)}progressSortFromEvent(e,t){const i=this.gos.get("multiSortKey")==="ctrl"?t.ctrlKey||t.metaKey:t.shiftKey;this.progressSort(e,i,"uiColumnSorted")}setSortForColumn(e,t,s,i){const{gos:r,showRowGroupCols:o}=this.beans,n=ws(r);let a=[e];if(n&&e.getColDef().showRowGroup){const u=o?.getSourceColumnsForGroupColumn?.(e)?.filter(h=>h.isSortable());u&&(a=[e,...u])}for(const d of a)this.setColSort(d,t,i);const l=(s||r.get("alwaysMultiSort"))&&!r.get("suppressMultiSort"),c=[];if(!l){const d=this.clearSortBarTheseColumns(a,i);c.push(...d)}this.updateSortIndex(e),c.push(...a),this.dispatchSortChangedEvents(i,c)}updateSortIndex(e){const{gos:t,colModel:s,showRowGroupCols:i}=this.beans,r=ws(t),o=i?.getShowRowGroupCol(e.getId()),n=r&&o||e,a=this.getColumnsWithSortingOrdered();s.forAllCols(d=>this.setColSortIndex(d,null));const l=a.filter(d=>r&&d.getColDef().showRowGroup?!1:d!==n);(n.getSortDef()?[...l,n]:l).forEach((d,u)=>this.setColSortIndex(d,u))}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){let e=!1;return this.beans.colModel.forAllCols(t=>{if(t.getSortDef())return e=!0,!0}),e}dispatchSortChangedEvents(e,t){const s={type:"sortChanged",source:e};t&&(s.columns=t),this.eventSvc.dispatchEvent(s)}clearSortBarTheseColumns(e,t){const s=[];return this.beans.colModel.forAllCols(i=>{e.includes(i)||(i.getSortDef()&&s.push(i),this.setColSort(i,void 0,t))}),s}getNextSortDirection(e,t){const s=e.getSortingOrder(),i=t===void 0?e.getSortDef():Ut(t);let o=s.findIndex(n=>Rn(n,i))+1;return o>=s.length&&(o=0),Ut(s[o])}getIndexedSortMap(){const{gos:e,colModel:t,showRowGroupCols:s,rowGroupColsSvc:i}=this.beans;let r=[];if(t.forAllCols(c=>{c.getSortDef()&&r.push(c)}),t.isPivotMode()){const c=ws(e);r=r.filter(d=>{const u=!!d.getAggFunc(),h=!d.isPrimary(),g=c?s?.getShowRowGroupCol(d.getId()):d.getColDef().showRowGroup;return u||h||g})}const o=i?.columns.filter(c=>!!c.getSortDef())??[],n={};r.forEach((c,d)=>n[c.getId()]=d),r.sort((c,d)=>{const u=c.getSortIndex(),h=d.getSortIndex();if(u!=null&&h!=null)return u-h;if(u==null&&h==null){const g=n[c.getId()],p=n[d.getId()];return g>p?1:-1}else return h==null?-1:1});const a=ws(e)&&!!o.length;a&&(r=[...new Set(r.map(c=>s?.getShowRowGroupCol(c.getId())??c))]);const l=new Map;if(r.forEach((c,d)=>l.set(c,d)),a)for(const c of o){const d=s.getShowRowGroupCol(c.getId());l.set(c,l.get(d))}return l}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([,e],[,t])=>e-t).map(([e])=>e)}collectSortItems(e=!1){const t=[],s=this.getColumnsWithSortingOrdered();for(const i of s){const r=i.getSortDef()?.direction;if(!r)continue;const o=rs(i.getSortDef()?.type),n={sort:r,type:o};e?n.colId=i.getId():n.column=i,t.push(n)}return t}getSortModel(){return this.collectSortItems(!0)}getSortOptions(){return this.collectSortItems()}canColumnDisplayMixedSort(e){const t=ws(this.gos),s=!!e.getColDef().showRowGroup;return t&&s}getDisplaySortForColumn(e){const t=this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!t?.length)return e.getSortDef();const i=e.getColDef().field!=null||!!e.getColDef().valueGetter?[e,...t]:t,r=i[0].getSortDef();return i.every(n=>Rn(n.getSortDef(),r))?r:{type:rs(e.getSortDef()?.type),direction:"mixed"}}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}setupHeader(e,t){const s=()=>{const{type:i,direction:r}=Ut(t.getSortDef());if(e.toggleCss("ag-header-cell-sorted-asc",r==="asc"),e.toggleCss("ag-header-cell-sorted-desc",r==="desc"),e.toggleCss("ag-header-cell-sorted-abs-asc",i==="absolute"&&r==="asc"),e.toggleCss("ag-header-cell-sorted-abs-desc",i==="absolute"&&r==="desc"),e.toggleCss("ag-header-cell-sorted-none",!r),t.getColDef().showRowGroup){const a=!this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(t)?.every(l=>r==l.getSortDef()?.direction);e.toggleCss("ag-header-cell-sorted-mixed",a)}};e.addManagedEventListeners({sortChanged:s,columnPinned:s,columnRowGroupChanged:s,displayedColumnsChanged:s})}initCol(e){const{sortIndex:t,initialSortIndex:s}=e.colDef,i=hu(e.colDef);i&&e.setSortDef(i,!0),t!==void 0?t!==null&&(e.sortIndex=t):s!==null&&(e.sortIndex=s)}updateColSort(e,t,s){t!==void 0&&this.setColSort(e,Ut(t),s)}setColSort(e,t,s){Rn(e.getSortDef(),t)||(e.setSortDef(Ut(t),t===void 0),e.dispatchColEvent("sortChanged",s)),e.dispatchStateUpdatedEvent("sort")}setColSortIndex(e,t){e.sortIndex=t,e.dispatchStateUpdatedEvent("sortIndex")}createSortIndicator(e){return new eg(e)}getSortIndicatorSelector(){return I3}},uc={moduleName:"Sort",version:H,beans:[k3,M3],apiFunctions:{onSortChanged:D3},userComponents:{agSortIndicator:eg},icons:{sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc"}},L3=class extends E{constructor(){super(...arguments),this.beanName="syncSvc",this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.beans.ctrlsSvc.whenReady(this,()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){const{colModel:t,rowModel:s}=this.beans;t.setColumnDefs(e??[],"gridInitializing"),s.start()}gridReady(){const{eventSvc:e,gos:t}=this;e.dispatchEvent({type:"gridReady"}),yi(t,`initialised successfully, enterprise = ${t.isModuleRegistered("EnterpriseCore")}`)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t){if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(t);return}this.beans.colModel.setColumnDefs(t,Os(e.source))}}};function G3(e){e.valueCache?.expire()}function O3(e,t){const{colKey:s,rowNode:i,useFormatter:r,from:o="edit"}=t,n=e.colModel.getColDefCol(s)??e.colModel.getCol(s);if(!n)return null;const a=e.valueSvc.getValueForDisplay({column:n,node:i,includeValueFormatted:r,from:o});return r?a.valueFormatted??es(a.value):a.value}var V3="paste",B3=class extends E{constructor(){super(...arguments),this.beanName="changeDetectionSvc",this.deferredDepth=0,this.batchedPath=null,this.batchedNodes=null}destroy(){super.destroy(),this.batchedPath=null,this.batchedNodes=null}postConstruct(){this.csrm=at(this.beans),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}beginDeferred(){this.deferredDepth++}endDeferred(){if(this.deferredDepth===0||--this.deferredDepth>0)return;const e=this.batchedPath,t=this.batchedNodes;this.batchedPath=null,this.batchedNodes=null,e&&this.csrm?.doAggregate(e);const{rowRenderer:s}=this.beans;if(t)for(const i of t)Xw(s,i);if(e){const i=e.getSortedRows();for(let r=0,o=i.length;r{const{sibling:s,pinnedSibling:i}=t;e.refreshRowByNode(t),e.refreshRowByNode(s),e.refreshRowByNode(i),e.refreshRowByNode(s?.pinnedSibling),e.refreshRowByNode(i?.sibling)},N3=class extends E{constructor(){super(...arguments),this.beanName="expressionSvc",this.cache={}}evaluate(e,t){if(typeof e=="string")return this.evaluateExpression(e,t);Q(15,{expression:e})}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.getValue,t.column,t.columnGroup)}catch(s){return Q(16,{expression:e,params:t,e:s}),null}}createExpressionFunction(e){const t=this.cache;if(t[e])return t[e];const s=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",s);return t[e]=i,i}createFunctionBody(e){return e.includes("return")?e:"return "+e+";"}},H3=class extends E{constructor(){super(...arguments),this.beanName="valueCache",this.cacheVersion=0}postConstruct(){const e=this.gos;this.active=e.get("valueCache"),this.neverExpires=e.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,s){if(this.active){const i=this.cacheVersion;e.__cacheVersion!==i&&(e.__cacheVersion=i,e.__cacheData={}),e.__cacheData[t]=s}}getValue(e,t){if(!(!this.active||e.__cacheVersion!==this.cacheVersion))return e.__cacheData[t]}},Zw={moduleName:"ValueCache",version:H,beans:[H3],apiFunctions:{expireValueCache:G3}},z3={moduleName:"Expression",version:H,beans:[N3]},_3={moduleName:"ChangeDetection",version:H,beans:[B3]},Qw={moduleName:"CellApi",version:H,apiFunctions:{getCellValue:O3}},W3=class extends E{constructor(){super(...arguments),this.beanName="valueSvc",this.initialised=!1,this.isSsrm=!1}wireBeans(e){this.expressionSvc=e.expressionSvc,this.colModel=e.colModel,this.valueCache=e.valueCache,this.dataTypeSvc=e.dataTypeSvc,this.editSvc=e.editSvc,this.formulaDataSvc=e.formulaDataSvc,this.rowGroupColsSvc=e.rowGroupColsSvc}postConstruct(){this.initialised||this.init()}init(){const{gos:e,valueCache:t}=this;this.executeValueGetter=t?this.executeValueGetterWithValueCache.bind(this):this.executeValueGetterWithoutValueCache.bind(this),this.isSsrm=ft(e),this.cellExpressions=e.get("enableCellExpressions"),this.isTreeData=e.get("treeData"),this.initialised=!0;const s=i=>this.callColumnCellValueChangedHandler(i);this.eventSvc.addListener("cellValueChanged",s,!0),this.addDestroyFunc(()=>this.eventSvc.removeListener("cellValueChanged",s,!0)),this.addManagedPropertyListener("treeData",i=>this.isTreeData=i.currentValue)}getValueForDisplay(e){const t=this.beans,s=e.column,i=e.node,r=t.showRowGroupColValueSvc,o=!s&&i.group,n=s?.colDef.showRowGroup,a=!this.isTreeData||i.footer;if(r&&a&&(o||n)){const h=r.getGroupValue(i,s,this.displayIgnoresAggData(i));return h==null?{value:null,valueFormatted:null}:{value:h.value,valueFormatted:e.includeValueFormatted?r.formatAndPrefixGroupColValue(h,s,e.exporting):null}}if(!s)return{value:i.key,valueFormatted:null};let l=this.getValue(s,i,e.from,this.displayIgnoresAggData(i)),c=l;const d=t.formula;s.isAllowFormula()&&d?.isFormula(l)&&(e.useRawFormula?(l=d.normaliseFormula(l,!0),c=d.resolveValue(s,i)):(l=d.resolveValue(s,i),c=l));const u=e.includeValueFormatted&&!(e.exporting&&s.colDef.useValueFormatterForExport===!1);return{value:l,valueFormatted:u?this.formatValue(s,i,c):null}}getValue(e,t,s,i=!1){if(this.initialised||this.init(),!t)return;const r=e.colDef,o=t.group;if(!o){const l=r.pivotValueColumn;l&&(e=l)}const n=this.editSvc?.getPendingEditValue(t,e,s);if(n!==void 0)return n;let a=this.resolveValue(e,t,i,o);if(a===void 0){if(o){const l=r.showRowGroup;if(typeof l=="string"){const c=this.rowGroupColsSvc?.getColumnIndex(l);if(c!=null&&c>t.level)return null}}return}if(this.cellExpressions&&lr(a)){const l=a.substring(1);a=this.executeValueGetter(l,t.data,e,t)}return a}displayIgnoresAggData(e){return!e.group||e.footer||e.level===-1||!e.sibling||this.gos.get("groupSuppressBlankHeader")||e.leafGroup&&this.colModel.isPivotMode()?!1:!!e.expanded}resolveValue(e,t,s,i){const r=e.colDef,o=e.colId,n=!i&&this.formulaDataSvc;if(n&&n.hasDataSource()&&r.allowFormula===!0){const v=n.getFormula({column:e,rowNode:t});if(lr(v))return v}const a=i&&!s?t.aggData:void 0,l=this.isTreeData;if(l&&a?.[o]!==void 0)return a[o];const c=t.data,d=r.field,u=r.valueGetter;if(l){if(u)return this.executeValueGetter(u,c,e,t);if(d&&c)return Kn(c,d,e.isFieldContainsDots())}const h=t.groupData;if(h&&o in h)return h[o];if(a?.[o]!==void 0)return a[o];const g=r.showRowGroup,p=typeof g!="string"||!i,f=this.isSsrm,m=f&&s&&!!r.aggFunc;if(u&&!m)return p?this.executeValueGetter(u,c,e,t):void 0;if(f&&t.footer&&t.field&&(g===!0||g===t.field))return Kn(c,t.field,e.isFieldContainsDots());if(d&&c&&!m)return p?Kn(c,d,e.isFieldContainsDots()):void 0}parseValue(e,t,s,i){const r=e.getColDef();if(r.allowFormula&&this.beans.formula?.isFormula(s))return s;const o=r.valueParser;if(D(o)){const n=N(this.gos,{node:t,data:t?.data,oldValue:i,newValue:s,colDef:r,column:e});return typeof o=="function"?o(n):this.expressionSvc?.evaluate(o,n)}return s}getDeleteValue(e,t){return D(e.getColDef().valueParser)?this.parseValue(e,t,"",this.getValueForDisplay({column:e,node:t,from:"edit"}).value)??null:null}formatValue(e,t,s,i,r=!0){const{expressionSvc:o}=this.beans;let n=null,a;const l=e.getColDef();if(i?a=i:r&&(a=l.valueFormatter),a){const c=t?t.data:null,d=N(this.gos,{value:s,node:t,data:c,colDef:l,column:e});typeof a=="function"?n=a(d):n=o?o.evaluate(a,d):null}else if(l.refData)return l.refData[s]||"";return n==null&&Array.isArray(s)&&(n=s.join(", ")),n}setValue(e,t,s,i){const r=t.getColDef();if(!e.data&&this.canCreateRowNodeData(e,r)&&(e.data={}),!this.isSetValueSupported(t,e,s,r))return!1;const o=this.getValue(t,e,"data"),n=N(this.gos,{node:e,data:e.data,oldValue:o,newValue:s,colDef:r,column:t});let a=!1;if(e.data){const c=this.handleExternalFormulaChange({column:t,eventSource:i,newValue:s,setterParams:n,rowNode:e});if(c!==null)return c;a=this.computeValueChange({column:t,rowNode:e,newValue:s,params:n,rowData:e.data,valueSetter:r.valueSetter,field:r.field})??!0}const l=this.beans.changeDetectionSvc;l?.beginDeferred();try{if(e.group){const c=this.beans.rowGroupingEditValueSvc?.setGroupDataValue(e,t,s,o,i,a||s!==o);if(c!==void 0)return!a&&!c?!1:this.finishValueChange(e,t,n,i,s)}return a?this.finishValueChange(e,t,n,i):!1}finally{l?.endDeferred()}}canCreateRowNodeData(e,t){return e.group?!(t.groupRowValueSetter!=null||t.groupRowEditable!=null||t.pivotValueColumn):!0}finishValueChange(e,t,s,i,r){e.resetQuickFilterAggregateText(),this.valueCache?.onDataChanged();const o=r===void 0?this.getValue(t,e,"data"):r;return this.dispatchCellValueChangedEvent(e,s,o,i),e.pinnedSibling&&this.dispatchCellValueChangedEvent(e.pinnedSibling,s,o,i),!0}isSetValueSupported(e,t,s,i){const{field:r,valueSetter:o}=i,n=this.beans.formula,a=e.isAllowFormula()&&n?.isFormula(s),l=!!this.formulaDataSvc?.hasDataSource();return ne(r)&&ne(o)&&!(l&&a)?t.group&&(i.groupRowValueSetter||i.groupRowEditable)?!0:(F(17),!1):this.dataTypeSvc&&!this.dataTypeSvc.checkType(e,s)?(F(135),!1):!0}handleExternalFormulaChange(e){const{column:t,rowNode:s,newValue:i,eventSource:r,setterParams:o}=e,n=this.beans.formula,a=this.formulaDataSvc;if(!a?.hasDataSource()||!t.isAllowFormula())return null;const l=n?.isFormula(i),c=a.getFormula({column:t,rowNode:s});if(l){if(!(c!==i))return!1;a.setFormula({column:t,rowNode:s,formula:i});const u=n?.resolveValue(t,s),h=t.getColDef();if(D(h.valueSetter)||!ne(h.field)){const g={...o,newValue:u};this.computeValueChange({column:t,rowNode:s,newValue:u,params:g,rowData:s.data,valueSetter:h.valueSetter,field:h.field})}return this.finishValueChange(s,t,o,r)}return c!==void 0&&a.setFormula({column:t,rowNode:s,formula:void 0}),null}computeValueChange(e){const{valueSetter:t,params:s,rowData:i,field:r,column:o,newValue:n}=e;return D(t)?typeof t=="function"?t(s):this.expressionSvc?.evaluate(t,s):!!i&&this.setValueUsingField(i,r,n,o.isFieldContainsDots())}dispatchCellValueChangedEvent(e,t,s,i){this.eventSvc.dispatchEvent({type:"cellValueChanged",event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:t.column,colDef:t.colDef,data:e.data,node:e,oldValue:t.oldValue,newValue:s,newRawValue:t.newValue,value:s,source:i})}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;typeof t=="function"&&this.beans.frameworkOverrides.wrapOutgoing(()=>{t(e)})}setValueUsingField(e,t,s,i){if(!t)return!1;let r=!1;if(!i)r=e[t]===s,r||(e[t]=s);else{const o=t.split(".");let n=e;for(;o.length>0&&n;){const a=o.shift();o.length===0?(r=n[a]===s,r||(n[a]=s)):n=n[a]}}return!r}executeValueGetterWithValueCache(e,t,s,i){const r=s.getColId(),o=this.valueCache.getValue(i,r);if(o!==void 0)return o;const n=this.executeValueGetterWithoutValueCache(e,t,s,i);return this.valueCache.setValue(i,r,n),n}executeValueGetterWithoutValueCache(e,t,s,i){const r=N(this.gos,{data:t,node:i,column:s,colDef:s.getColDef(),getValue:n=>this.getValueCallback(i,n)});let o;return typeof e=="function"?o=e(r):o=this.expressionSvc?.evaluate(e,r),o}getValueCallback(e,t){const s=this.colModel.getColDefCol(t);return s?this.getValue(s,e,"data"):null}getKeyForNode(e,t){const s=this.getValue(e,t,"data"),i=e.getColDef().keyCreator;let r=s;if(i){const o=N(this.gos,{value:s,colDef:e.getColDef(),column:e,node:t,data:t.data});r=i(o)}return typeof r=="string"||r==null||(r=String(r),r==="[object Object]"&&F(121)),r}},U3={moduleName:"CommunityCore",version:H,beans:[DI,wM,_D,dE,R3,BT,RI,YI,WT,q2,j2,E3,W3,MI,xI,TI,UD,L3,OD,VD,n2],icons:{selectOpen:"small-down",smallDown:"small-down",colorPicker:"color-picker",smallUp:"small-up",checkboxChecked:"small-up",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off",smallLeft:"small-left",smallRight:"small-right"},apiFunctions:{getGridId:gv,destroy:bM,isDestroyed:SM,getGridOption:yM,setGridOption:xM,updateGridOptions:pv,isModuleRegistered:RM},dependsOn:[LD,$l,xT,uc,s2,yh,i2,x3,_3,o2,ta,Q2,t3,c2,HD,GD,z3,QT,r3]};function Ro(e){const{inputValue:t,allSuggestions:s,hideIrrelevant:i,filterByPercentageOfBestMatch:r}=e;let o=(s??[]).map((l,c)=>({value:l,relevance:$3(t,l),idx:c}));if(o.sort((l,c)=>l.relevance-c.relevance),i&&(o=o.filter(l=>l.relevance0&&r&&r>0){const c=o[0].relevance*r;o=o.filter(d=>c-d.relevance<0)}const n=[],a=[];for(const l of o)n.push(l.value),a.push(l.idx);return{values:n,indices:a}}function $3(e,t){const s=e.length,i=t.length;if(i===0)return s||0;let r=e.toLocaleLowerCase(),o=t.toLocaleLowerCase(),n;e.length1&&p>1){const C=e[u-2],v=r[u-2],w=t[p-2],S=o[p-2];v===S&&(c++,C===w&&c++)}u`No AG Grid modules are registered! It is recommended to start with all Community features via the AllCommunityModule: import { ModuleRegistry, AllCommunityModule } from 'ag-grid-community'; ModuleRegistry.registerModules([ AllCommunityModule ]); `,Y3=e=>{const t=e.map(i=>`import { ${ia(i)} } from '${Jw[i]?"ag-grid-enterprise":"ag-grid-community"}';`);return e.some(i=>i==="IntegratedCharts"||i==="Sparklines")&&t.push("import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';"),`import { ModuleRegistry } from 'ag-grid-community'; ${t.join(` `)} ModuleRegistry.registerModules([ ${e.map(i=>ia(i,!0)).join(", ")} ]); For more info see: ${io}/modules/`};function ia(e,t=!1){return t&&(e==="IntegratedCharts"||e==="Sparklines")?`${e}Module.with(AgChartsEnterpriseModule)`:`${e}Module`}function X3(e,t){const s=t.filter(o=>o==="IntegratedCharts"||o==="Sparklines");let i="";return!globalThis?.agCharts&&s.length>0?i=`Unable to use ${e} as either the ag-charts-community or ag-charts-enterprise script needs to be included alongside ag-grid-enterprise. `:t.some(o=>Jw[o])&&(i=i+`Unable to use ${e} as that requires the ag-grid-enterprise script to be included. `),i}function tb({moduleName:e,rowModelType:t}){return`To use the ${e}Module you must set the gridOption "rowModelType='${t}'"`}var sb=({reasonOrId:e,moduleName:t,gridScoped:s,gridId:i,rowModelType:r,additionalText:o,isUmd:n})=>{const a=q3(t,r),l=typeof e=="string"?e:ek[e];if(n)return X3(l,a);const c=a.filter(h=>h==="IntegratedCharts"||h==="Sparklines"),d=c.length>0?`${c.map(h=>ia(h)).join()} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.`:"";return`${`Unable to use ${l} as ${a.length>1?"one of "+a.map(h=>ia(h)).join(", "):ia(a[0])} is not registered${s?" for gridId: "+i:""}. ${d} Check if you have registered the module: `} ${Y3(a)}`+(o?` ${o}`:"")},ib=e=>`${e} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'. import { AgChartsEnterpriseModule } from 'ag-charts-enterprise'; import { ModuleRegistry } from 'ag-grid-community'; import { ${e} } from 'ag-grid-enterprise'; ModuleRegistry.registerModules([${e}.with(AgChartsEnterpriseModule)]); `,Z3=e=>`AG Grid: Unable to use the Clipboard API (navigator.clipboard.${e}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`,Q3={1:()=>"`rowData` must be an array",2:({nodeId:e})=>`Duplicate node id '${e}' detected from getRowId callback, this could cause issues in your grid.`,3:()=>"Calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.",4:({id:e})=>`Could not find row id=${e}, data item was not found for this id`,5:({data:e})=>["Could not find data item as object was not found.",e," Consider using getRowId to help the Grid find matching row data"],6:()=>"'groupHideOpenParents' only works when specifying specific columns for 'colDef.showRowGroup'",7:()=>"Pivoting is not supported with aligned grids as it may produce different columns in each grid.",8:({key:e})=>`Unknown key for navigation ${e}`,9:({variable:e})=>`No value for ${e?.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${e?.defaultValue} will be used and updated when styles load.`,10:({eventType:e})=>`As of v33, the '${e}' event is deprecated. Use the global 'modelUpdated' event to determine when row children have changed.`,11:()=>"No gridOptions provided to createGrid",12:({colKey:e})=>["column ",e," not found"],13:()=>"Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid.",14:({groupPrefix:e})=>`Row IDs cannot start with ${e}, this is a reserved prefix for AG Grid's row grouping feature.`,15:({expression:e})=>["value should be either a string or a function",e],16:({expression:e,params:t,e:s})=>["Processing of the expression failed","Expression = ",e,"Params = ",t,"Exception = ",s],17:()=>"you need either field or valueSetter set on colDef for editing to work",18:()=>"alignedGrids contains an undefined option.",19:()=>"alignedGrids - No api found on the linked grid.",20:()=>`You may want to configure via a callback to avoid setup race conditions: "alignedGrids: () => [linkedGrid]"`,21:()=>"pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.",22:({key:e})=>`${e} is an initial property and cannot be updated.`,23:()=>"The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.",24:()=>"row height must be a number if not using standard row model",25:({id:e})=>["The getRowId callback must return a string. The ID ",e," is being cast to a string."],26:({fnName:e,preDestroyLink:t})=>`Grid API function ${e}() cannot be called as the grid has been destroyed. Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid. To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${t}`,27:({fnName:e,module:t})=>`API function '${e}' not registered to module '${t}'`,28:()=>"setRowCount cannot be used while using row grouping.",29:()=>"tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?",30:({toIndex:e})=>["tried to insert columns in invalid location, toIndex = ",e,"remember that you should not count the moving columns when calculating the new index"],31:()=>"infinite loop in resizeColumnSets",32:()=>"applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.",33:()=>"stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON.",34:({key:e})=>`the column type '${e}' is a default column type and cannot be overridden.`,35:()=>"Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type.",36:({t:e})=>"colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes",37:()=>"Changing the column pinning status is not allowed with domLayout='print'",38:({iconName:e})=>`provided icon '${e}' needs to be a string or a function`,39:()=>"Applying column order broke a group where columns should be married together. Applying new order has been discarded.",40:({e,method:t})=>`${e} ${Z3(t)}`,41:()=>"Browser did not allow document.execCommand('copy'). Ensure 'api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons.",42:()=>"Browser does not support document.execCommand('copy') for clipboard operations",43:({iconName:e})=>`As of v33, icon '${e}' is deprecated. Use the icon CSS name instead.`,44:()=>'Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.',45:({parentCellDataType:e})=>`The data type definition ${e} does not exist.`,46:()=>'The "baseDataType" property of a data type definition must match that of its parent.',47:({cellDataType:e})=>`Missing data type definition - "${e}"`,48:({property:e,inferred:t,colId:s})=>{const i=t?" (inferred)":"",r=s?` for column "${s}"`:"";return`Cell data type is "object"${i} but no Value ${e} has been provided${r}. Please either provide an object data type definition with a Value ${e}, or set: - "colDef.value${e}"${t&&e==="Parser"?` - "colDef.cellDataType = 'object'"`:""}`},49:({methodName:e})=>`Framework component is missing the method ${e}()`,50:({compName:e})=>`Could not find component ${e}, did you forget to configure this component?`,51:()=>"Export cancelled. Export is not allowed as per your configuration.",52:()=>"There is no `window` associated with the current `document`",53:()=>"unknown value type during csv conversion",54:()=>"Could not find document body, it is needed for drag and drop and context menu.",55:()=>"addRowDropZone - A container target needs to be provided",56:()=>"addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.",57:()=>"unable to show popup filter, filter instantiation failed",58:()=>"no values found for select cellEditor",59:()=>"cannot select pinned rows",60:()=>"cannot select node until it has finished loading",61:()=>"since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option.",62:({colId:e})=>`setFilterModel() - no column found for colId: ${e}`,63:({colId:e})=>`setFilterModel() - unable to fully apply model, filtering disabled for colId: ${e}`,64:({colId:e})=>`setFilterModel() - unable to fully apply model, unable to create filter for colId: ${e}`,65:()=>"filter missing setModel method, which is needed for setFilterModel",66:()=>"filter API missing getModel method, which is needed for getFilterModel",67:()=>"Filter is missing isFilterActive() method",68:()=>"Column Filter API methods have been disabled as Advanced Filters are enabled.",69:({guiFromFilter:e})=>`getGui method from filter returned ${e}; it should be a DOM element.`,70:({newFilter:e})=>`Grid option quickFilterText only supports string inputs, received: ${typeof e}`,71:()=>"debounceMs is ignored when apply button is present",72:({keys:e})=>["ignoring FilterOptionDef as it doesn't contain one of ",e],73:()=>"invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'",74:()=>"no filter options for filter",75:()=>"Unknown button type specified",76:({filterModelType:e})=>['Unexpected type of filter "',e,'", it looks like the filter was configured with incorrect Filter Options'],77:()=>"Filter model is missing 'conditions'",78:()=>'Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.',79:()=>'"filterParams.maxNumConditions" must be greater than or equal to zero.',80:()=>'"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.',81:()=>'"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".',82:({param:e})=>`DateFilter ${e} is not a number`,83:()=>"DateFilter minValidYear should be <= maxValidYear",84:()=>"DateFilter minValidDate should be <= maxValidDate",85:()=>"DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored.",86:()=>"DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored.",87:()=>"DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.",88:({index:e})=>`Invalid row index for ensureIndexVisible: ${e}`,89:()=>"A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)",90:()=>"datasource is missing getRows method",91:()=>"Filter is missing method doesFilterPass",92:()=>"AnimationFrameService called but animation frames are off",93:()=>"cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`",94:({paginationPageSizeOption:e,pageSizeSet:t,pageSizesSet:s,pageSizeOptions:i})=>`'paginationPageSize=${e}'${t?"":" (default value)"}, but ${e} is not included in${s?"":" the default"} paginationPageSizeSelector=[${i?.join(", ")}].`,95:({paginationPageSizeOption:e,paginationPageSizeSelector:t})=>`Either set '${t}' to an array that includes ${e} or to 'false' to disable the page size selector.`,96:({id:e,data:t})=>["Duplicate ID",e,"found for pinned row with data",t,"When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter."],97:({colId:e})=>`cellEditor for column ${e} is missing getGui() method`,98:()=>"popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.",99:()=>"Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.",101:({propertyName:e,componentName:t,agGridDefaults:s,jsComps:i})=>{const r=[],o=[...Object.keys(s??[]).filter(a=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(a)),...Object.keys(i??[]).filter(a=>!!i[a])],n=Ro({inputValue:t,allSuggestions:o,hideIrrelevant:!0,filterByPercentageOfBestMatch:.8}).values;return r.push(`Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components. `),n.length>0&&r.push(` Did you mean: [${n.slice(0,3)}]? `),r.push("If using a custom component check it has been registered correctly."),r},102:()=>"selectAll: 'filtered' only works when gridOptions.rowModelType='clientSide'",103:()=>"Invalid selection state. When using client-side row model, the state must conform to `string[]`.",104:({value:e,param:t})=>`Numeric value ${e} passed to ${t} param will be interpreted as ${e} seconds. If this is intentional use "${e}s" to silence this warning.`,105:({e})=>["chart rendering failed",e],106:()=>`Theming API and Legacy Themes are both used in the same page. A Theming API theme has been provided to the 'theme' grid option, but the file (ag-grid.css) is also included and will cause styling issues. Remove ag-grid.css from the page. See the migration guide: ${io}/theming-migration/`,107:({key:e,value:t})=>`Invalid value for theme param ${e} - ${t}`,108:({e})=>["chart update failed",e],109:({inputValue:e,allSuggestions:t})=>{const s=Ro({inputValue:e,allSuggestions:t,hideIrrelevant:!0,filterByPercentageOfBestMatch:.8}).values;return[`Could not find '${e}' aggregate function. It was configured as "aggFunc: '${e}'" but it wasn't found in the list of registered aggregations.`,s.length>0?` Did you mean: [${s.slice(0,3)}]?`:"","If using a custom aggregation function check it has been registered correctly."].join(` `)},110:()=>"groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup",111:()=>"Invalid selection state. When `groupSelects` is enabled, the state must conform to `IServerSideGroupSelectionState`.",113:()=>"Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values",114:({component:e})=>`Could not find component with name of ${e}. Is it in Vue.components?`,116:()=>"Invalid selection state. The state must conform to `IServerSideSelectionState`.",117:()=>"selectAll must be of boolean type.",118:()=>"Infinite scrolling must be enabled in order to set the row count.",119:()=>"Unable to instantiate filter",120:()=>"MultiFloatingFilterComp expects MultiFilter as its parent",121:()=>"a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (see AG Grid docs) or b) to toString() on the object to return a key",122:()=>"could not find the document, document is empty",123:()=>"Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model.",124:()=>"No active charts to update.",125:({chartId:e})=>`Unable to update chart. No active chart found with ID: ${e}.`,126:()=>"unable to restore chart as no chart model is provided",127:({allRange:e})=>`unable to create chart as ${e?"there are no columns in the grid":"no range is selected"}.`,128:({feature:e})=>`${e} is only available if using 'multiRow' selection mode.`,129:({feature:e,rowModel:t})=>`${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`,130:()=>'cannot multi select unless selection mode is "multiRow"',132:()=>"Row selection features are not available unless `rowSelection` is enabled.",133:({iconName:e})=>`icon '${e}' function should return back a string or a dom object`,134:({iconName:e})=>`Did not find icon '${e}'`,135:()=>"Data type of the new value does not match the cell data type of the column",136:()=>"Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.",137:({type:e,currentChartType:t})=>`Unable to update chart as a '${e}' update type is not permitted on a ${t}.`,138:({chartType:e})=>`invalid chart type supplied: ${e}`,139:({customThemeName:e})=>`a custom chart theme with the name ${e} has been supplied but not added to the 'chartThemes' list`,140:({name:e})=>`no stock theme exists with the name '${e}' and no custom chart theme with that name was supplied to 'customChartThemes'`,141:()=>"cross filtering with row grouping is not supported.",142:()=>"cross filtering is only supported in the client side row model.",143:({panel:e})=>`'${e}' is not a valid Chart Tool Panel name`,144:({type:e})=>`Invalid charts data panel group name supplied: '${e}'`,145:({group:e})=>`As of v32, only one charts customize panel group can be expanded at a time. '${e}' will not be expanded.`,146:({comp:e})=>`Unable to instantiate component '${e}' as its module hasn't been loaded. Add 'ValidationModule' to see which module is required.`,147:({group:e})=>`Invalid charts customize panel group name supplied: '${e}'`,148:({group:e})=>`invalid chartGroupsDef config '${e}'`,149:({group:e,chartType:t})=>`invalid chartGroupsDef config '${e}.${t}'`,150:()=>"'seriesChartTypes' are required when the 'customCombo' chart type is specified.",151:({chartType:e})=>`invalid chartType '${e}' supplied in 'seriesChartTypes', converting to 'line' instead.`,152:({colId:e})=>`no 'seriesChartType' found for colId = '${e}', defaulting to 'line'.`,153:({chartDataType:e})=>`unexpected chartDataType value '${e}' supplied, instead use 'category', 'series' or 'excluded'`,154:({colId:e})=>`cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: ${e}`,155:({option:e})=>`'${e}' is not a valid Chart Toolbar Option`,156:({panel:e})=>`Invalid panel in chartToolPanelsDef.panels: '${e}'`,157:({unrecognisedGroupIds:e})=>["unable to find group(s) for supplied groupIds:",e],158:()=>"can not expand a column item that does not represent a column group header",159:()=>"Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty.",160:()=>"Export cancelled. Export is not allowed as per your configuration.",161:()=>"The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'",162:({id:e,dataType:t})=>`Unrecognized data type for excel export [${e}.dataType=${t}]`,163:({featureName:e})=>`Excel table export does not work with ${e}. The exported Excel file will not contain any Excel tables. Please turn off ${e} to enable Excel table exports.`,164:()=>"Unable to add data table to Excel sheet: A table already exists.",165:()=>"Unable to add data table to Excel sheet: Missing required parameters.",166:({unrecognisedGroupIds:e})=>["unable to find groups for these supplied groupIds:",e],167:({unrecognisedColIds:e})=>["unable to find columns for these supplied colIds:",e],168:()=>"detailCellRendererParams.template should be function or string",169:()=>'Reference to eDetailGrid was missing from the details template. Please add data-ref="eDetailGrid" to the template.',170:({providedStrategy:e})=>`invalid cellRendererParams.refreshStrategy = ${e} supplied, defaulting to refreshStrategy = 'rows'.`,171:()=>"could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions",172:()=>"could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData",173:({group:e})=>`invalid chartGroupsDef config '${e}'`,174:({group:e,chartType:t})=>`invalid chartGroupsDef config '${e}.${t}'`,175:({menuTabName:e,itemsToConsider:t})=>[`Trying to render an invalid menu item '${e}'. Check that your 'menuTabs' contains one of `,t],176:({key:e})=>`unknown menu item type ${e}`,177:()=>"valid values for cellSelection.handle.direction are 'x', 'y' and 'xy'. Default to 'xy'.",178:({colId:e})=>`column ${e} is not visible`,179:()=>"totalValueGetter should be either a function or a string (expression)",180:()=>"agRichSelectCellEditor requires cellEditorParams.values to be set",181:()=>"agRichSelectCellEditor cannot have `multiSelect` and `allowTyping` set to `true`. AllowTyping has been turned off.",182:()=>'you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data',183:()=>"Group Column Filter only works on group columns. Please use a different filter.",184:({parentGroupData:e,childNodeData:t})=>["duplicate group keys for row data, keys should be unique",[e,t]],185:({data:e})=>["getDataPath() should not return an empty path",[e]],186:({rowId:e,rowData:t,duplicateRowsData:s})=>["duplicate group keys for row data, keys should be unique",e,t,...s??[]],187:({rowId:e,firstData:t,secondData:s})=>[`Duplicate node id ${e}. Row IDs are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`,"first instance",t,"second instance",s],188:e=>`getRowId callback must be provided for Server Side Row Model ${e?.feature||"selection"} to work correctly.`,189:({startRow:e})=>`invalid value ${e} for startRow, the value should be >= 0`,190:({rowGroupId:e,data:t})=>["null and undefined values are not allowed for server side row model keys",e?`column = ${e}`:"","data is ",t],194:({method:e})=>`calling gridApi.${e}() is only possible when using rowModelType=\`clientSide\`.`,195:({justCurrentPage:e})=>`selecting just ${e?"current page":"filtered"} only works when gridOptions.rowModelType='clientSide'`,196:({key:e})=>`Provided ids must be of string type. Invalid id provided: ${e}`,197:()=>"`toggledNodes` must be an array of string ids.",199:()=>"getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model. Use `api.getServerSideSelectionState()` instead.",200:sb,201:({rowModelType:e})=>`Could not find row model for rowModelType = ${e}`,202:()=>"`getSelectedNodes` and `getSelectedRows` functions cannot be used with `groupSelectsChildren` and the server-side row model. Use `api.getServerSideSelectionState()` instead.",203:()=>"Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.",204:()=>"Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.",205:({duplicateIdText:e})=>`Unable to display rows as duplicate row ids (${e}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`,206:()=>"getRowId callback must be implemented for transactions to work. Transaction was ignored.",207:()=>'The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.',208:()=>"Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects.",209:()=>`Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects. See ${io}/filter-set-filter-list/#filter-value-types`,210:()=>"Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects?",211:()=>"property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date.",212:()=>"please review all your toolPanel components, it seems like at least one of them doesn't have an id",213:()=>"Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled.",214:({key:e})=>`unable to lookup Tool Panel as invalid key supplied: ${e}`,215:({key:e,defaultByKey:t})=>`the key ${e} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(t??{}).join(",")}`,216:({name:e})=>`Missing component for '${e}'`,217:({invalidColIds:e})=>["unable to find grid columns for the supplied colDef(s):",e],218:({property:e,defaultOffset:t})=>`${e} must be a number, the value you provided is not a valid number. Using the default of ${t}px.`,219:({property:e})=>`Property ${e} does not exist on the target object.`,220:({lineDash:e})=>`'${e}' is not a valid 'lineDash' option.`,221:()=>"agAggregationComponent should only be used with the client and server side row model.",222:()=>"agFilteredRowCountComponent should only be used with the client side row model.",223:()=>"agSelectedRowCountComponent should only be used with the client and server side row model.",224:()=>"agTotalAndFilteredRowCountComponent should only be used with the client side row model.",225:()=>"agTotalRowCountComponent should only be used with the client side row model.",226:()=>"viewport is missing init method.",227:()=>"menu item icon must be DOM node or string",228:({menuItemOrString:e})=>`unrecognised menu item ${e}`,230:()=>"detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://www.ag-grid.com/react-data-grid/master-detail-custom-detail/",231:()=>"As of v32, using custom components with `reactiveCustomComponents = false` is deprecated.",232:()=>"Using both rowData and v-model. rowData will be ignored.",233:({methodName:e})=>`Framework component is missing the method ${e}()`,234:()=>'Group Column Filter does not work with the colDef property "field". This property will be ignored.',235:()=>'Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.',236:()=>'Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.',237:()=>"Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter.",238:()=>"setRowCount can only accept a positive row count.",239:()=>'Theming API and CSS File Themes are both used in the same page. In v33 we released the Theming API as the new default method of styling the grid. See the migration docs https://www.ag-grid.com/react-data-grid/theming-migration/. Because no value was provided to the `theme` grid option it defaulted to themeQuartz. But the file (ag-grid.css) is also included and will cause styling issues. Either pass the string "legacy" to the theme grid option to use v32 style themes, or remove ag-grid.css from the page to use Theming API.',240:({theme:e})=>`theme grid option must be a Theming API theme object or the string "legacy", received: ${e}`,243:()=>"Failed to deserialize state - each provided state object must be an object.",244:()=>"Failed to deserialize state - `selectAllChildren` must be a boolean value or undefined.",245:()=>"Failed to deserialize state - `toggledNodes` must be an array.",246:()=>"Failed to deserialize state - Every `toggledNode` requires an associated string id.",247:()=>`Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule. Please rebuild the selection state and reapply it.`,248:()=>"SetFloatingFilter expects SetFilter as its parent",249:()=>"Must supply a Value Formatter in Set Filter params when using a Key Creator",250:()=>"Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.",251:({chartType:e})=>`AG Grid: Unable to create chart as an invalid chartType = '${e}' was supplied.`,252:()=>`cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.`,253:({version:e})=>["Illegal version string: ",e],254:()=>"Cannot create chart: no chart themes available.",255:({point:e})=>`Lone surrogate U+${e?.toString(16).toUpperCase()} is not a scalar value`,256:()=>"Unable to initialise. See validation error, or load ValidationModule if missing.",257:()=>ib("IntegratedChartsModule"),258:()=>ib("SparklinesModule"),259:({part:e})=>`the argument to theme.withPart must be a Theming API part object, received: ${e}`,260:({propName:e,compName:t,gridScoped:s,gridId:i,rowModelType:r})=>sb({reasonOrId:`AG Grid '${e}' component: ${t}`,moduleName:wo[t],gridId:i,gridScoped:s,rowModelType:r}),261:()=>"As of v33, `column.isHovered()` is deprecated. Use `api.isColumnHovered(column)` instead.",262:()=>'As of v33, icon key "smallDown" is deprecated. Use "advancedFilterBuilderSelect" for Advanced Filter Builder dropdown, "selectOpen" for Select cell editor and dropdowns (e.g. Integrated Charts menu), "richSelectOpen" for Rich Select cell editor.',263:()=>'As of v33, icon key "smallLeft" is deprecated. Use "panelDelimiterRtl" for Row Group Panel / Pivot Panel, "subMenuOpenRtl" for sub-menus.',264:()=>'As of v33, icon key "smallRight" is deprecated. Use "panelDelimiter" for Row Group Panel / Pivot Panel, "subMenuOpen" for sub-menus.',265:({colId:e})=>`Unable to infer chart data type for column '${e}' if first data entry is null. Please specify "chartDataType", or a "cellDataType" in the column definition. For more information, see ${io}/integrated-charts-range-chart#coldefchartdatatype .`,266:()=>'As of v33.1, using "keyCreator" with the Rich Select Editor has been deprecated. It now requires the "formatValue" callback to convert complex data to strings.',267:()=>"Detail grids can not use a different theme to the master grid, the `theme` detail grid option will be ignored.",268:()=>"Transactions aren't supported with tree data when using treeDataChildrenField",269:()=>"When `masterSelects: 'detail'`, detail grids must be configured with multi-row selection",270:({id:e,parentId:t})=>`Cycle detected for row with id='${e}' and parent id='${t}'. Resetting the parent for row with id='${e}' and showing it as a root-level node.`,271:({id:e,parentId:t})=>`Parent row not found for row with id='${e}' and parent id='${t}'. Showing row with id='${e}' as a root-level node.`,272:()=>eb(),273:({providedId:e,usedId:t})=>`Provided column id '${e}' was already in use, ensure all column and group ids are unique. Using '${t}' instead.`,274:({prop:e})=>{let t=`Since v33, ${e} has been deprecated.`;switch(e){case"maxComponentCreationTimeMs":t+=" This property is no longer required and so will be removed in a future version.";break;case"setGridApi":t+=" This method is not called by AG Grid. To access the GridApi see: https://ag-grid.com/react-data-grid/grid-interface/#grid-api ";break;case"children":t+=" For multiple versions AgGridReact does not support children.";break}return t},275:tb,276:()=>"Row Numbers Row Resizer cannot be used when Grid Columns have `autoHeight` enabled.",277:({colId:e})=>`'enableFilterHandlers' is set to true, but column '${e}' does not have 'filter.doesFilterPass' or 'filter.handler' set.`,278:({colId:e})=>`Unable to create filter handler for column '${e}'`,279:e=>{},280:({colId:e})=>`'name' must be provided for custom filter components for column '${e}`,281:({colId:e})=>`Filter for column '${e}' does not have 'filterParams.buttons', but the new Filters Tool Panel has buttons configured. Either configure buttons for the filter, or disable buttons on the Filters Tool Panel.`,282:()=>"New filter tool panel requires `enableFilterHandlers: true`.",283:()=>"As of v34, use the same method on the filter handler (`api.getColumnFilterHandler(colKey)`) instead.",284:()=>"As of v34, filters are active when they have a model. Use `api.getColumnFilterModel()` instead.",285:()=>"As of v34, use (`api.getColumnFilterModel()`) instead.",286:()=>"As of v34, use (`api.setColumnFilterModel()`) instead.",287:()=>"`api.doFilterAction()` requires `enableFilterHandlers = true",288:()=>"`api.getColumnFilterModel(key, true)` requires `enableFilterHandlers = true",289:({rowModelType:e})=>`Row Model '${e}' is not supported with Batch Editing`,290:({rowIndex:e,rowPinned:t})=>`Row with index '${e}' and pinned state '${t}' not found`,291:()=>"License Key being set multiple times with different values. This can result in an incorrect license key being used,",292:({colId:e})=>`The Multi Filter for column '${e}' has buttons configured against the child filters. When 'enableFilterHandlers=true', buttons must instead be provided against the parent Multi Filter params. The child filter buttons will be ignored.`,293:()=>"The grid was initialised detached from the DOM and was then inserted into a Shadow Root. Theme styles are probably broken. Pass the themeStyleContainer grid option to let the grid know where in the document to insert theme CSS.",294:()=>"When using the `agRichSelectCellEditor` setting `filterListAsync = true` requires `allowTyping = true` and the `values()` callback must return a Promise of filtered values.",295:({blockedService:e})=>`colDef.allowFormula is not supported with ${e}. Formulas has been turned off.`,296:()=>"Since v35, `api.hideOverlay()` does not hide the overlay when `activeOverlay` is set. Set `activeOverlay=null` instead.",297:()=>'`api.hideOverlay()` does not hide the no matching rows overlay as it is only controlled by grid state. Set `suppressOverlays=["noMatchingRows"] to not show it.',298:()=>"Columns Tool Panel 'buttons' requires 'apply' to enable Deferred Updates."};function J3(e,t){const s=Q3[e];if(!s)return[`Missing error text for error id ${e}!`];const i=s(t),o=` See ${Bm(e,t)}`;return Array.isArray(i)?i.concat(o):[i,o]}var ek={1:"Charting Aggregation",2:"pivotResultFields",3:"setTooltip"},rb=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.batchFrameworkComps=!1,this.wrapIncoming=t=>t(),this.wrapOutgoing=t=>t(),this.baseDocLink=`${Rm}/${this.frameworkName}-data-grid`,IF(this.baseDocLink)}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return this.baseDocLink+(e?"/"+e:"")}},sg=new WeakMap,ig=new WeakMap;function ob(e,t,s){if(!t)return Q(11),{};const i=s;let r;if(!i?.setThemeOnGridDiv){const n=re({tag:"div"});n.style.height="100%",e.appendChild(n),e=n,r=()=>e.remove()}return new nb().create(e,t,n=>{const a=new CM(e);n.createBean(a)},void 0,s,r)}var tk=1,nb=class{create(e,t,s,i,r,o){const n=vn.applyGlobalGridOptions(t),a=n.gridId??String(tk++),l=this.getRegisteredModules(r,a,n.rowModelType),c=this.createBeansList(n.rowModelType,l,a),d=this.createProvidedBeans(e,n,r);if(!c)return;const h={providedBeanInstances:d,beanClasses:c,id:a,beanInitComparator:lP,beanDestroyComparator:cP,derivedBeans:[nP],destroyCallback:()=>{ig.delete(p),sg.delete(e),PF(a),o?.()}},g=new AC(h);this.registerModuleFeatures(g,l),s(g),g.getBean("syncSvc").start(),i?.(g);const p=g.getBean("gridApi");return sg.set(e,p),ig.set(p,e),p}getRegisteredModules(e,t,s){return so(U3,void 0,!0),e?.modules?.forEach(i=>so(i,t)),MF(t,ab(s))}registerModuleFeatures(e,t){const s=e.getBean("registry"),i=e.getBean("apiFunctionSvc");for(const r of t){s.registerModule(r);const o=r.apiFunctions;if(o){const n=Object.keys(o);for(const a of n)i?.addFunction(a,o[a])}}}createProvidedBeans(e,t,s){let i=s?s.frameworkOverrides:null;ne(i)&&(i=new rb);const r={gridOptions:t,eGridDiv:e,eRootDiv:e,globalListener:s?s.globalListener:null,globalSyncListener:s?s.globalSyncListener:null,frameworkOverrides:i,withinStudio:s?.withinStudio};return s?.providedBeanInstances&&Object.assign(r,s.providedBeanInstances),r}createBeansList(e,t,s){const i={clientSide:"ClientSideRowModel",infinite:"InfiniteRowModel",serverSide:"ServerSideRowModel",viewport:"ViewportRowModel"},r=ab(e),o=i[r];if(!o){wn(201,{rowModelType:r},`Unknown rowModelType ${r}.`);return}if(!DF()){wn(272,void 0,eb());return}if(!e){const a=Object.entries(i).filter(([l,c])=>Zd(c,s,l));if(a.length==1){const[l,c]=a[0];if(l!==r){const d={moduleName:c,rowModelType:l};wn(275,d,tb(d));return}}}if(!Zd(o,s,r)){const a=Jd(),l=`rowModelType = '${r}'`,c=a?`Unable to use ${l} as that requires the ag-grid-enterprise script to be included. `:`Missing module ${o}Module for rowModelType ${r}.`;wn(200,{reasonOrId:l,moduleName:o,gridScoped:Qd(),gridId:s,rowModelType:r,isUmd:a},c);return}const n=new Set;for(const a of t)for(const l of a.beans??[])n.add(l);return Array.from(n)}};function ab(e){return e??"clientSide"}function sk(e){if(typeof e=="string")try{e=document.querySelector(`[grid-id="${e}"]`)?.parentElement??document.querySelector(e)?.firstElementChild??document.getElementById(e)?.firstElementChild}catch{e=null}return e?sg.get(e):void 0}function ik(e){return ig.get(e)}function lb(e,t=!1){const s=[],i=[],r=[],o=[],n=[],a=[],l=[],c=[],d=[];let u=0;for(let h=0;ht!=null)}function cb(e){const t=[];for(const{groupId:s,open:i}of e)i&&t.push(s);return t.length?{openColumnGroupIds:t}:void 0}function rk(e){return{columnGroup:cb(e)}}var ok=class extends E{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(i=>{if(!i){Q(18),t||Q(20);return}if(this.isGridApi(i))return i;const r=i;return"current"in r?r.current?.api:(r.api||Q(19),r.api)}).filter(i=>!!i&&!i.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 s=[];return e.columns?e.columns.forEach(i=>{s.push(t(i))}):e.column&&s.push(t(e.column)),s}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":F(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const s of e.columnGroups){let i=null;s&&(i=t.getProvidedColGroup(s.getGroupId())),!(s&&!i)&&t.setColumnGroupOpened(i,s.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let s=null;const i=this.beans,{colResize:r,ctrlsSvc:o,colModel:n}=i;if(t&&(s=n.getColDefCol(t.getColId())),t&&!s)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const u=e.api.getColumnState().map(h=>({colId:h.colId}));qe(i,{state:u,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const u=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));qe(i,{state:u},"alignedGridChanged")}break;case"columnPinned":{const u=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));qe(i,{state:u},"alignedGridChanged")}break;case"columnResized":{const d=e,u={};for(const h of a)u[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of d.flexColumns??[])u[h.getId()]&&delete u[h.getId()];r?.setColumnWidths(Object.values(u),!1,d.finished,"alignedGridChanged");break}}const c=o.getGridBodyCtrl().isVerticalScrollShowing();for(const d of this.getAlignedGridApis())d.setGridOption("alwaysShowVerticalScroll",c)}},db={moduleName:"AlignedGrids",version:H,beans:[ok],dependsOn:[ql]};function nk(e,t={}){const s=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(s))}function ub(e,t,s,i,r){t&&(i&&t.parent&&t.parent.level!==-1&&ub(e,t.parent,s,i,r),t.setExpanded(s,void 0,r))}function ak(e,t){return e.rowModel.getRowNode(t)}function lk(e,t,s,i){e.rowRenderer.addRenderedRowListener(t,s,i)}function ck(e){return e.rowRenderer.getRenderedNodes()}function dk(e,t,s){e.rowModel.forEachNode(t,s)}function uk(e){return e.rowRenderer.firstRenderedRow}function hk(e){return e.rowRenderer.lastRenderedRow}function gk(e,t){return e.rowModel.getRow(t)}function pk(e){return e.rowModel.getRowCount()}function fk(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function mk(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function hb(e,t,s="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,s),"ensureVisible")}function gb(e,t,s){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,s),"ensureVisible")}function Ck(e,t,s=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,s),"ensureVisible")}var pb={moduleName:"RowApi",version:H,apiFunctions:{redrawRows:nk,setRowNodeExpanded:ub,getRowNode:ak,addRenderedRowListener:lk,getRenderedNodes:ck,forEachNode:dk,getFirstDisplayedRowIndex:uk,getLastDisplayedRowIndex:hk,getDisplayedRowAtIndex:gk,getDisplayedRowCount:pk}},fb={moduleName:"ScrollApi",version:H,apiFunctions:{getVerticalPixelRange:fk,getHorizontalPixelRange:mk,ensureColumnVisible:hb,ensureIndexVisible:gb,ensureNodeVisible:Ck}};function vk(e){e.expansionSvc?.expandAll(!0)}function wk(e){e.expansionSvc?.expandAll(!1)}function hc(e){e.rowModel?.onRowHeightChanged()}function gc(e){if(e.rowAutoHeight?.active){F(3);return}e.rowModel?.resetRowHeights()}function bk(e){e.expansionSvc?.resetExpansion()}function Sk(e,t,s){const i=co(e);if(i){if(e.rowGroupColsSvc?.columns.length===0){if(t<0){Q(238);return}i.setRowCount(t,s);return}Q(28);return}El(e)?.setRowCount(t,s)}function yk(e){return ft(e.gos)?e.rowModel.getBlockStates():e.rowNodeBlockLoader?.getBlockState()??{}}function xk(e){return e.rowModel.isLastRowIndexKnown()}var og={moduleName:"CsrmSsrmSharedApi",version:H,apiFunctions:{expandAll:vk,collapseAll:wk,resetRowGroupExpansion:bk}},ng={moduleName:"RowModelSharedApi",version:H,apiFunctions:{onRowHeightChanged:hc,resetRowHeights:gc}},ag={moduleName:"SsrmInfiniteSharedApi",version:H,apiFunctions:{setRowCount:Sk,getCacheBlockState:yk,isLastRowIndexKnown:xk}},mb=(e,t)=>{for(let s=0,i=e.length;s{if(s!=null){const o=s.getSortedRows();for(let n=0,a=o.length;n{const c=a.level+1;for(let d=0,u=l.length;d{if(!u&&u!==void 0){const w=C.sourceRowIndex;u=w<=h,h=w}C.data!==v&&(C.updateData(v),n.has(C)||a.add(C),!C.selectable&&C.isSelected()&&c.push(C))},f=(C,v,w)=>{for(let S=0,y=v.length;S0;if(m){const C=s._leafs??(s._leafs=[]);u===void 0?Tk(C,l,o):Mk(C,l)&&(o.reordered=!0)}(m||g||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},s,i){const r=this.rootNode._leafs;for(let o=0,n=r.length;o0}updateRowData(e,t,s){if(this.dispatchRowDataUpdateStarted(e.add),this.beans.groupStage?.getNestedDataGetter())return F(268),{remove:[],update:[],add:[]};const i=[],r=Is(this.gos),o=this.executeRemove(r,e,t,i,s),n=this.executeUpdate(r,e,t,i),a=this.executeAdd(e,t);return this.deselect(i),{remove:o,update:n,add:a}}executeRemove(e,{remove:t},{adds:s,updates:i,removals:r},o,n){const a=this.rootNode._leafs,l=a?.length,c=t?.length;if(!c||!l)return[];let d=0,u=l,h=0;const g=new Array(c);for(let p=0;ph&&(h=m),g[d++]=f,this.destroyNode(f,n)&&(f.isSelected()&&o.push(f),s.delete(f)||(i.delete(f),r.push(f)))}return g.length=d,d&&Pk(a,u,h),g}executeUpdate(e,{update:t},{adds:s,updates:i},r){const o=t?.length;if(!o)return[];const n=new Array(o);let a=0;for(let l=0;l=l;--u){const g=i[u];g.sourceRowIndex=h,i[h--]=g}t.reordered=!0}i.length=a;const c=new Array(n),d=t.adds;for(let u=0;u=s||Number.isNaN(t))return s;t=Math.ceil(t);const i=this.gos;return t>0&&i.get("treeData")&&i.get("getDataPath")&&(t=Fk(e,t)),t}},Fk=(e,t)=>{for(let s=0,i=e.length;s{e.group=!0,e.level=-1,e._expanded=!0,e.id="ROOT_NODE_ID",e._leafs?.length!==0&&(e._leafs=[]);const t=[],s=[],i=[],r=[];e.childrenAfterGroup=t,e.childrenAfterSort=s,e.childrenAfterAggFilter=i,e.childrenAfterFilter=r;const o=e.sibling;return o&&(o.childrenAfterGroup=t,o.childrenAfterSort=s,o.childrenAfterAggFilter=i,o.childrenAfterFilter=r,o.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},Ek=(e,t)=>{if(e)for(let s=0,i=e.length;s{t=Math.max(0,t);for(let i=t,r=e.length;i{const s=t.size;e.length=s;let i=0,r=!1,o=!1;for(const n of t){const a=n.sourceRowIndex;a===i?o||(o=r):(a>=0?o=!0:r=!0,n.sourceRowIndex=i,e[i]=n),++i}return o},Tk=(e,t,{adds:s})=>{const i=e.length,r=t.size;r>i&&(e.length=r);let o=0;for(let n=0;n{i.hasChildren()&&e&&!r?i.childrenAfterFilter=i.childrenAfterGroup.filter(o=>{const n=o.childrenAfterFilter&&o.childrenAfterFilter.length>0,a=o.data&&this.filterManager.doesRowPassFilter({rowNode:o});return n||a}):i.childrenAfterFilter=i.childrenAfterGroup,lg(i)};if(this.doingTreeDataFiltering()){const i=(r,o)=>{if(r.childrenAfterGroup)for(let n=0;ns(r,!1);Mt(this.beans.rowModel.rootNode,this.beans.rowModel.hierarchical,t,i)}}softFilter(e,t){const s=r=>{if(r.childrenAfterFilter=r.childrenAfterGroup,r.hasChildren())for(const o of r.childrenAfterGroup)o.softFiltered=e&&!(o.data&&this.filterManager.doesRowPassFilter({rowNode:o}));lg(r)},i=this.beans.rowModel;Mt(i.rootNode,i.hierarchical,t,s)}doingTreeDataFiltering(){const{gos:e}=this;return!!this.beans.groupStage?.treeData&&!e.get("excludeChildrenWhenTreeDataFiltering")}},Ak=4,Ik=(e,t,s,i,r)=>{const o=t.childrenAfterSort,n=t.childrenAfterAggFilter;if(!n)return o&&o.length>0?o:[];const a=n.length;if(a<=1)return o?.length===a&&(a===0||o[0]===n[0])?o:n.slice();if(!o||a<=Ak)return e.doFullSortInPlace(n.slice(),r);const l=new Map,{updates:c,adds:d}=s,u=[];for(let g=0;ge.compareRowNodes(r,g,p)||~l.get(g)-~l.get(p)),h===a?u:kk(e,r,u,o,l,a))},kk=(e,t,s,i,r,o)=>{const n=new Array(o);let a=0,l=s[a],c,d=-1,u=0,h=0;const g=s.length,p=i.length;for(;;){if(d<0){if(u>=p)break;if(c=i[u++],d=r.get(c)??-1,d<0)continue}if((e.compareRowNodes(t,l,c)||~r.get(l)-d)<0){if(n[h++]=l,++a>=g)break;l=s[a]}else n[h++]=c,d=-1}for(;a=0&&(n[h++]=f)}return n},Lk=(e,t,s)=>{let i=0;s.length=t.size;for(let r=0,o=e.length;r{const t=e.childrenAfterSort,s=e.sibling;if(s&&(s.childrenAfterSort=t),!!t)for(let i=0,r=t.length-1;i<=r;i++){const o=t[i],n=i===0,a=i===r;o.firstChild!==n&&(o.firstChild=n,o.dispatchRowEvent("firstChildChanged")),o.lastChild!==a&&(o.lastChild=a,o.dispatchRowEvent("lastChildChanged")),o.childIndex!==i&&(o.childIndex=i,o.dispatchRowEvent("childIndexChanged"))}},Gk=class extends E{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e,t){const s=this.beans.sortSvc.getSortOptions(),i=s.length>0&&!!t&&this.gos.get("deltaSort"),{gos:r,colModel:o,rowGroupColsSvc:n,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,d=r.get("groupMaintainOrder"),u=o.getCols().some(v=>v.isRowGroupActive()),h=n?.columns,g=o.isPivotMode(),p=r.getCallback("postSortRows");let f=!1,m;const C=v=>{const w=g&&v.leafGroup;let S=d&&u&&!v.leafGroup;S&&(m??(m=this.shouldSortContainsGroupCols(s)),S&&(S=!m));let y=null;if(S){let R=!1;if(h){const P=v.level+1;P{const t=e.childrenAfterSort,s=e.childrenAfterAggFilter,i=t?.length,r=s?.length;if(!i||!r)return null;const o=new Array(r),n=new Set;for(let l=0;l{this.beans.groupStage?.invalidateGroupCols(),this.refreshModel({step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")})};this.addManagedEventListeners({newColumnsLoaded:s,columnRowGroupChanged:s,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:()=>this.refreshModel({step:"pivot"}),columnPivotModeChanged:()=>this.refreshModel({step:"group"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),stylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,s=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(i=>!!i);this.stages=s;for(let i=s.length-1;i>=0;--i){const r=s[i];for(const o of r.refreshProps)t.set(o,i)}this.addManagedPropertyListeners([...t.keys(),"rowData"],i=>{const r=i.changeSet?.properties;r&&this.onPropChange(r)}),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,s,i){let r,o=!1;do{r=!1;const n=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(n,s),c=Math.min(a,i);for(let d=l;d<=c;d++){const u=this.getRow(d);if(u.rowHeightEstimated){const h=Ze(this.beans,u);u.setRowHeight(h.height),r=!0,o=!0}}r&&this.setRowTopAndRowIndex()}while(r);return o}onPropChange(e){const{nodeManager:t,gos:s,beans:i}=this,r=i.groupStage;if(!t)return;const o=new Set(e),n=r?.onPropChange(o);let a;o.has("rowData")?a=s.get("rowData"):n&&(a=r?.extractData()),a&&!Array.isArray(a)&&(a=null,F(1));const l={step:"nothing",changedProps:o};if(a){const d=!n&&!this.isEmpty()&&a.length>0&&s.exists("getRowId")&&!s.get("resetRowDataOnUpdate");this.refreshingData=!0,d?(l.keepRenderedRows=!0,l.animate=!s.get("suppressAnimationFrame"),l.changedRowNodes=new Mr,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:s}=this;if(!t)return null;const i=t.length;let r=i;for(let o=0,n=e.length;o{o?.id!=null&&!t.has(o.id)&&o.clearRowTopAndRowIndex()},i=o=>{s(o),s(o.detailNode),s(o.sibling);const n=o.childrenAfterGroup;if(!(!o.hasChildren()||!n)&&!(e&&o.level!==-1&&!o.expanded))for(let a=0,l=n.length;a{let c=o[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?.getTopDisplayIndex(i,e,o,n):n(e)}getTopLevelIndexFromDisplayedIndex(e){const{rootNode:t,rowsToDisplay:s}=this;if(!t||!s.length||s[0]===t)return e;let r=this.getRow(e);r.footer&&(r=r.sibling);let o=r.parent;for(;o&&o!==t;)r=o,o=r.parent;const n=t.childrenAfterSort?.indexOf(r)??-1;return n>=0?n: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:Cr(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const i=t.length===0||t.some(r=>r.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:i,keepRenderedRows:!0,animate:Cr(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:Cr(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:s,rowDataUpdated:i}=e;return!(!t||s||!i||t.removals.length||t.adds.size)}reMapRows(){if(this.refreshingModel||this.refreshingData){this.noKeepRenderedRows=!0,this.noKeepUndoRedoStack=!0,this.noAnimate=!0;return}this.refreshModel({step:"map",keepRenderedRows:!1,keepUndoRedoStack:!1,animate:!1})}refreshModel(e){const{nodeManager:t,eventSvc:s,started:i}=this;if(!t)return;const r=!!e.rowDataUpdated;if(i&&r&&s.dispatchEvent({type:"rowDataUpdated"}),this.deferRefresh(e)){this.setPendingRefreshFlags(e),this.rowDataUpdatedPending||(this.rowDataUpdatedPending=r);return}this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.updateRefreshParams(e);let o=!1;this.refreshingModel=!0;try{this.executeRefresh(e,r),o=!0}finally{this.refreshingData=!1,this.refreshingModel=!1,o||this.setPendingRefreshFlags(e)}this.clearPendingRefreshFlags(),s.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}executeRefresh(e,t){const{beans:s,rootNode:i}=this;s.masterDetailSvc?.refreshModel(e),t&&e.step!=="group"&&s.colFilter?.refreshModel();let r=e.changedPath;switch(r?.addRow(i),e.step==="group"&&(this.doGrouping(i,e),r??(r=e.changedPath)),r??(r=s.changedPathFactory?.ensureRowsPath(e,i)),e.step){case"group":case"filter":this.doFilter(r);case"pivot":this.doPivot(r)&&(r=void 0,e.changedPath=void 0);case"aggregate":this.doAggregate(r);case"filter_aggregates":this.doFilterAggregates(r);case"sort":this.doSort(r,e.changedRowNodes);case"map":this.doRowsToDisplay()}const o=new Set;this.setRowTopAndRowIndex(o),this.clearRowTopAndRowIndex(r,o),this.updateRefreshParams(e)}deferRefresh(e){return this.refreshingModel||this.beans.colModel.changeEventsDispatching?!0:this.isSuppressModelUpdateAfterUpdateTransaction(e)?(this.started&&(this.refreshingData=!1),!0):!this.started}setPendingRefreshFlags(e){this.pendingNewData||(this.pendingNewData=!!e.newData),this.noKeepRenderedRows||(this.noKeepRenderedRows=!e.keepRenderedRows),this.noKeepUndoRedoStack||(this.noKeepUndoRedoStack=!e.keepUndoRedoStack),this.noAnimate||(this.noAnimate=!e.animate)}clearPendingRefreshFlags(){this.pendingNewData=!1,this.noKeepRenderedRows=!1,this.noKeepUndoRedoStack=!1,this.noAnimate=!1}updateRefreshParams(e){e.newData=this.pendingNewData||!!e.newData,e.keepRenderedRows=!this.noKeepRenderedRows&&!!e.keepRenderedRows,e.keepUndoRedoStack=!this.noKeepUndoRedoStack&&!!e.keepUndoRedoStack,e.animate=!this.noAnimate&&!!e.animate}isEmpty(){return!this.rootNode?._leafs?.length||!this.beans.colModel?.ready}isRowsToRender(){return this.rowsToDisplay.length>0}getOverlayType(){const{beans:e,gos:t}=this;if(this.rootNode?._leafs?.length){if(e.filterManager?.isAnyFilterPresent()&&this.getRowCount()===0)return"noMatchingRows"}else if(this.rowCountReady||(t.get("rowData")?.length??0)==0)return"noRows";return null}getNodesInRangeForSelection(e,t){let s=!1,i=!1;const r=[],o=Pi(this.gos);return this.forEachNodeAfterFilterAndSort(n=>{if(i)return;if(s&&(n===t||n===e)&&(i=!0,o&&n.group)){wb(r,n);return}if(!s){if(n!==t&&n!==e)return;s=!0,t===e&&(i=!0)}(!n.group||!o)&&r.push(n)}),r}getTopLevelNodes(){return this.rootNode?.childrenAfterGroup??null}getRow(e){return this.rowsToDisplay[e]}getFormulaRow(e){return this.formulaRows[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,s=t.length;if(this.isEmpty()||s===0)return-1;let i=0,r=s-1;if(e<=0)return 0;if(t[r].rowTop<=e)return r;let n=-1,a=-1;for(;;){const l=Math.floor((i+r)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTope&&(r=l-1),n===i&&a===r))return l;n=i,a=r}}isRowInPixel(e,t){const s=e.rowTop,i=s+e.rowHeight;return s<=t&&i>t}forEachLeafNode(e){const t=this.rootNode?._leafs;if(t)for(let s=0,i=t.length;ss.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,s=>s.childrenAfterSort)}forEachPivotNode(e,t,s){const{colModel:i,rowGroupColsSvc:r}=this.beans;if(!i.isPivotMode())return;if(!r?.columns.length){e(this.rootNode,0);return}const o=s?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,n=>n.leafGroup?null:n[o])}depthFirstSearchRowNodes(e,t=!1,s=o=>o.childrenAfterGroup,i=this.rootNode,r=0){let o=r;if(!i)return o;const n=i===this.rootNode;if(n||e(i,o++),i.hasChildren()&&!i.footer){const a=n||this.hierarchical?s(i):null;if(a){const l=this.beans.footerSvc;o=l?.addTotalRows(o,i,e,t,n,"top")??o;for(const c of a)o=this.depthFirstSearchRowNodes(e,t,s,c,o);return l?.addTotalRows(o,i,e,t,n,"bottom")??o}}return o}doAggregate(e){this.rootNode&&this.beans.aggStage?.execute(e)}doFilterAggregates(e){const t=this.rootNode,s=this.beans.filterAggStage;if(s&&this.hierarchical){s.execute(e);return}t.childrenAfterAggFilter=t.childrenAfterFilter;const i=t.sibling;i&&(i.childrenAfterAggFilter=t.childrenAfterFilter)}doSort(e,t){const s=this.beans.sortStage;if(s){s.execute(e,t);return}Mt(this.rootNode,this.hierarchical,e,i=>{i.childrenAfterSort=i.childrenAfterAggFilter.slice(0),vb(i)})}doGrouping(e,t){const i=this.beans.groupStage?.execute(t);if(i===void 0){const r=e._leafs;e.childrenAfterGroup=r,e.updateHasChildren();const o=e.sibling;o&&(o.childrenAfterGroup=r)}(i||t.rowDataUpdated)&&this.beans.colFilter?.refreshModel(),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute(e);return}Mt(this.rootNode,this.hierarchical,e,s=>{s.childrenAfterFilter=s.childrenAfterGroup,lg(s)})}doPivot(e){return this.beans.pivotStage?.execute(e)??!1}getRowNode(e){const t=this.nodeManager?.getRowNode(e);return typeof t=="object"?t:this.beans.groupStage?.getNonLeaf(e)}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const s=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),s)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){const{nodeManager:e,beans:t,eventSvc:s,asyncTransactions:i}=this;if(!e)return;t.valueCache?.onDataChanged();const r=[],o=[],n=new Mr,a=!this.gos.get("suppressAnimationFrame");for(const{rowDataTransaction:l,callback:c}of i??[]){this.rowNodesCountReady=!0,this.refreshingData=!0;const d=e.updateRowData(l,n,a);r.push(d),c&&o.push(c.bind(null,d))}this.commitTransactions(n,a),o.length>0&&setTimeout(()=>{for(let l=0,c=o.length;l0&&s.dispatchEvent({type:"asyncTransactionsFlushed",results:r}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){const t=this.nodeManager;if(!t)return null;this.beans.valueCache?.onDataChanged(),this.rowNodesCountReady=!0;const s=new Mr,i=!this.gos.get("suppressAnimationFrame");this.refreshingData=!0;const r=t.updateRowData(e,s,i);return this.commitTransactions(s,i),r}commitTransactions(e,t){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:t,changedRowNodes:e})}doRowsToDisplay(){const{rootNode:e,beans:t}=this;if(t.formula?.active){const r=e?.childrenAfterSort??[];this.formulaRows=r,this.rowsToDisplay=r.filter(o=>!o.softFiltered);for(const o of this.rowsToDisplay)o.setUiLevel(0);return}const s=t.flattenStage;if(s){this.rowsToDisplay=s.execute();return}const i=this.rootNode.childrenAfterSort??[];for(const r of i)r.setUiLevel(0);this.rowsToDisplay=i}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 s=e.sibling;s?.setRowHeight(s.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const s=t.detailNode;s?.setRowHeight(s.rowHeight,!0);const i=t.sibling;i?.setRowHeight(i.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){e.rowHeightChanged&&!this.beans.rowAutoHeight?.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,this.stages=null,this.stagesRefreshProps.clear(),clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},wb=(e,t)=>{const s=t.childrenAfterGroup;if(s)for(let i=0,r=s.length;iat(e)?.updateRowData(t))}function $k(e,t,s){e.frameworkOverrides.wrapIncoming(()=>at(e)?.batchUpdateRowData(t,s))}function Kk(e){e.frameworkOverrides.wrapIncoming(()=>at(e)?.flushAsyncTransactions())}function jk(e){return e.selectionSvc?.getBestCostNodeSelection()}var bb={moduleName:"ClientSideRowModel",version:H,rowModels:["clientSide"],beans:[Vk,Gk],dependsOn:[uc]},Sb={moduleName:"ClientSideRowModelApi",version:H,apiFunctions:{onGroupExpandedOrCollapsed:Bk,refreshClientSideRowModel:Nk,isRowDataEmpty:Hk,forEachLeafNode:zk,forEachNodeAfterFilter:_k,forEachNodeAfterFilterAndSort:Wk,applyTransaction:Uk,applyTransactionAsync:$k,flushAsyncTransactions:Kk,getBestCostNodeSelection:jk,resetRowHeights:gc,onRowHeightChanged:hc},dependsOn:[og,ng]},qk=":where(.ag-ltr) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,left .2s ease-in-out}}:where(.ag-rtl) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,right .2s ease-in-out}}";function Yk(e,t){typeof t=="number"?e.colAutosize?.sizeColumnsToFit(t,"api"):e.colAutosize?.sizeColumnsToFitGridBody(t)}function yb({colAutosize:e,visibleCols:t},s,i){Array.isArray(s)?e?.autoSizeCols({colKeys:s,skipHeader:i,source:"api"}):e?.autoSizeCols({...s,colKeys:s.colIds??t.allCols,source:"api"})}function Xk(e,t){t&&typeof t=="object"?yb(e,t):e.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:t})}var Zk=class extends E{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const i=t.type;if(i==="fitGridWidth"||i==="fitProvidedWidth")s=!0;else if(i==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");s=r!=null&&r.length>0&&ae(e)}s&&this.beans.colDelayRenderSvc?.hideColumns(i)}}autoSizeCols(e){const{eventSvc:t,visibleCols:s,colModel:i}=this.beans;ra(this.beans,!0),this.innerAutoSizeCols(e).then(r=>{const o=d=>Co(t,Array.from(d),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return ra(this.beans,!1),o(r);const n=xb(this.beans),a=d=>s.leftCols.some(u=>oi(u,d)),l=d=>s.rightCols.some(u=>oi(u,d)),c=e.colKeys.filter(d=>!i.getCol(d)?.getColDef().suppressAutoSize&&!Fe(d)&&!a(d)&&!l(d));this.sizeColumnsToFit(n,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:e.columnLimits?.map(d=>({...d,key:d.colId})),colKeys:c,onlyScaleUp:!0,animate:!1}),ra(this.beans,!1),o(r)})}innerAutoSizeCols(e){return new Promise((t,s)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,s));const{colKeys:i,skipHeader:r,skipHeaderGroups:o,stopAtGroup:n,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:d="api"}=e,{animationFrameSvc:u,renderStatus:h,colModel:g,autoWidthCalc:p,visibleCols:f}=this.beans;if(u?.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,s)});return}this.timesDelayed=0;const m=new Set;let C=-1;const v=Object.fromEntries(c.map(({colId:y,...R})=>[y,R])),w=r??this.gos.get("skipHeaderOnAutoSize"),S=o??w;for(;C!==0;){C=0;const y=[];for(const R of i){if(!R||yr(R))continue;const P=g.getCol(R);if(!P||m.has(P)||P.getColDef().suppressAutoSize)continue;const M=p.getPreferredWidthForColumn(P,w);if(M>0){const T=v[P.colId]??{};T.minWidth??(T.minWidth=l),T.maxWidth??(T.maxWidth=a);const I=Qk(P,M,T);P.setActualWidth(I,d),m.add(P),C++}y.push(P)}y.length&&f.refresh(d)}S||this.autoSizeColumnGroupsByColumns(i,d,n),t(m)})}autoSizeColumn(e,t,s){this.autoSizeCols({colKeys:[e],skipHeader:s,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,s){const{colModel:i,ctrlsSvc:r}=this.beans,o=new Set,n=i.getColsForKeys(e);for(const l of n){let c=l.getParent();for(;c&&c!=s;)c.isPadding()||o.add(c),c=c.getParent()}let a;for(const l of o){for(const c of r.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;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 s=this.gos.get("skipHeaderOnAutoSize"),i=()=>{this.autoSizeColumn(t,"uiColumnResized",s)};e.addEventListener("dblclick",i);const r=new as(e);return r.addEventListener("doubleTap",i),()=>{e.removeEventListener("dblclick",i),r.destroy()}}addColumnGroupResize(e,t,s){const i=this.gos.get("skipHeaderOnAutoSize"),r=()=>{const o=[],n=t.getDisplayedLeafColumns();for(const a of n)a.getColDef().suppressAutoSize||o.push(a.getColId());o.length>0&&this.autoSizeCols({colKeys:o,skipHeader:i,stopAtGroup:t,source:"uiColumnResized"}),s()};return e.addEventListener("dblclick",r),()=>e.removeEventListener("dblclick",r)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const s=xb(this.beans);if(s>0){this.sizeColumnsToFit(s,"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):F(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",s,i){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,s,i));return}const{beans:r}=this,o=i?.animate??!0;o&&ra(r,!0);const n={};for(const{key:C,...v}of i?.columnLimits??[])n[typeof C=="string"?C:C.getColId()]=v;const a=r.visibleCols.allCols;if(e<=0||!a.length)return;const l=ri(a);if(i?.onlyScaleUp&&l>e||e===l&&a.every(v=>{if(v.colDef.suppressSizeToFit)return!0;const w=n?.[v.getId()],S=w?.minWidth??i?.defaultMinWidth,y=w?.maxWidth??i?.defaultMaxWidth,R=v.getActualWidth();return(S==null||R>=S)&&(y==null||R<=y)}))return;const d=[],u=[];for(const C of a){const v=i?.colKeys?.some(w=>oi(C,w))??!0;C.getColDef().suppressSizeToFit||!v?u.push(C):d.push(C)}const h=d.slice(0);let g=!1;const p=C=>{De(d,C),u.push(C)},f={};for(const C of d){i?.onlyScaleUp&&(f[C.getColId()]=C.getActualWidth()),C.resetActualWidth(t);const v=n?.[C.getId()],w=v?.minWidth??i?.defaultMinWidth??-1/0,S=v?.maxWidth??i?.defaultMaxWidth??1/0,y=C.getActualWidth(),R=Math.max(Math.min(y,S),w);R!=y&&C.setActualWidth(R,t,!0)}for(;!g;){g=!0;const C=e-ri(u);if(C<=0)for(const v of d){const w=n?.[v.getId()]?.minWidth??i?.defaultMinWidth??v.minWidth;v.setActualWidth(w,t,!0)}else{const v=C/ri(d);let w=C;for(let S=d.length-1;S>=0;S--){const y=d[S],R=y.getColId(),P=f[R],M=n?.[R],T=M?.minWidth??i?.defaultMinWidth??P,I=M?.maxWidth??i?.defaultMaxWidth,k=Math.max(T??-1/0,y.getMinWidth()),L=Math.min(I??1/0,y.getMaxWidth());let j=Math.round(y.getActualWidth()*v);jL?(j=L,p(y),g=!1):S===0&&(j=w),y.setActualWidth(j,t,!0),w-=j}}}for(const C of h)C.fireColumnWidthChangedEvent(t);const m=r.visibleCols;m.setLeftValues(t),m.updateBodyWidths(),!s&&(Co(this.eventSvc,h,!0,t),o&&ra(r,!1))}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,s=e.get("autoSizeStrategy");s?.type!=="fitGridWidth"&&s?.type!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const i=s.type;if(i==="fitGridWidth"){const{columnLimits:r,defaultMinWidth:o,defaultMaxWidth:n}=s,a=r?.map(({colId:l,minWidth:c,maxWidth:d})=>({key:l,minWidth:c,maxWidth:d}));this.sizeColumnsToFitGridBody({defaultMinWidth:o,defaultMaxWidth:n,columnLimits:a})}else i==="fitProvidedWidth"&&this.sizeColumnsToFit(s.width,"sizeColumnsToFit");t?.revealColumns(i)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{if(!this.isAlive())return;const s="autosizeColumns";e?this.autoSizeCols({...t,source:s,colKeys:e}):this.autoSizeAllColumns({...t,source:s}),this.beans.colDelayRenderSvc?.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 Qk(e,t,s={}){const i=s.minWidth??e.getMinWidth();tr&&(t=r),t}function xb({ctrlsSvc:e,scrollVisibleSvc:t}){const s=e.getGridBodyCtrl(),r=s.isVerticalScrollShowing()?t.getScrollbarWidth():0;return gr(s.eGridBody)-r}var Rb="ag-animate-autosize";function ra({ctrlsSvc:e,gos:t},s){if(!t.get("animateColumnResizing")||t.get("enableRtl")||!e.isAlive())return;const i=e.getGridBodyCtrl().eGridBody.classList;s?i.add(Rb):i.remove(Rb)}var Fb={moduleName:"ColumnAutoSize",version:H,beans:[Zk],apiFunctions:{sizeColumnsToFit:Yk,autoSizeColumns:yb,autoSizeAllColumns:Xk},dependsOn:[Tv],css:[qk]};function Jk(e,t){return!!e.colHover?.isHovered(t)}var eL=class extends E{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=s=>{const{beans:i,gos:r,element:o,columns:n}=this,a=i.colHover;if(s??!!r.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(o,{mouseover:a.setMouseOver.bind(a,n),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}},tL="ag-column-hover",sL=class extends E{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,s){const i=()=>{const r=this.isHovered(s);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:i}),i()}onCellColumnHover(e,t){if(!t)return;const s=this.isHovered(e);t.toggleCss(tL,s)}addHeaderFilterColumnHoverListener(e,t,s,i){this.createHoverFeature(e,[s],i);const r=()=>{const o=this.isHovered(s);t.toggleCss("ag-column-hover",o)};e.addManagedEventListeners({columnHoverChanged:r}),r()}createHoverFeature(e,t,s){e.createManagedBean(new eL(t,s))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},Eb={moduleName:"ColumnHover",version:H,beans:[sL],apiFunctions:{isColumnHovered:Jk}},iL=class extends E{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:s,columnKeys:i,skipRowGroups:r,exportRowNumbers:o}=t,n=this.getColumnsToExport({allColumns:s,skipRowGroups:r,columnKeys:i,exportRowNumbers:o});return[this.prepareSession(n),this.prependContent(t),this.exportColumnGroups(t,n),this.exportHeaders(t,n),this.processPinnedTopRows(t,n),this.processRows(t,n),this.processPinnedBottomRows(t,n),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,s,i){const r=t.shouldRowBeSkipped||(()=>!1),n=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!n,l=this.colModel.isPivotMode()?i.leafGroup:!i.group,c=!!i.footer,d=i.allChildrenCount===1&&i.childrenAfterGroup?.length===1&&Wm(this.gos,i);if(!l&&!c&&(t.skipRowGroups||d||a)||t.onlySelected&&!i.isSelected()||t.skipPinnedTop&&i.rowPinned==="top"||t.skipPinnedBottom&&i.rowPinned==="bottom"||i.stub||i.level===-1&&!l&&!c||r(N(this.gos,{node:i})))return;const g=e.onNewBodyRow(i);if(s.forEach((p,f)=>{g.onColumn(p,f,i)}),t.getCustomContentBelowRow){const p=t.getCustomContentBelowRow(N(this.gos,{node:i}));p&&e.addCustomContent(p)}}appendContent(e){return t=>{const s=e.appendContent;return s&&t.addCustomContent(s),t}}prependContent(e){return t=>{const s=e.prependContent;return s&&t.addCustomContent(s),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return s=>{if(!e.skipColumnGroupHeaders){const i=new bh,{colGroupSvc:r}=this.beans,o=r?r.createColumnGroups({columns:t,idCreator:i,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(o,s,e.processGroupHeaderCallback)}return s}}exportHeaders(e,t){return s=>{if(!e.skipColumnHeaders){const i=s.onNewHeaderRow();t.forEach((r,o)=>{i.onColumn(r,o,void 0)})}return s}}processPinnedTopRows(e,t){return s=>{const i=this.processRow.bind(this,s,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="top").sort((r,o)=>r.rowIndex-o.rowIndex).map(r=>this.pinnedRowModel?.getPinnedTopRow(r.rowIndex)).forEach(i):this.pinnedRowModel?.isManual()||this.pinnedRowModel?.forEachPinnedRow("top",i),s}}processRows(e,t){return s=>{const i=this.rowModel,r=ae(this.gos,i),o=ft(this.gos,i),n=!r&&e.onlySelected,a=this.processRow.bind(this,s,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(c=>c.rowPinned==null).sort((c,d)=>c.rowIndex-d.rowIndex).map(c=>i.getRow(c.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())r?i.forEachPivotNode(a,!0,l==="filteredAndSorted"):o?i.forEachNodeAfterFilterAndSort(a,!0):i.forEachNode(a);else if(e.onlySelectedAllPages||n){const c=this.beans.selectionSvc?.getSelectedNodes()??[];this.replicateSortedOrder(c),c.forEach(a)}else l==="all"?i.forEachNode(a):r||o?i.forEachNodeAfterFilterAndSort(a,!0):i.forEachNode(a);return s}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:s}=this.beans;if(!t||!s)return;const i=t.getSortOptions(),r=(o,n)=>o.rowIndex!=null&&n.rowIndex!=null?o.rowIndex-n.rowIndex:o.level===n.level?o.parent?.id===n.parent?.id?s.compareRowNodes(i,o,n)||(o.rowIndex??-1)-(n.rowIndex??-1):r(o.parent,n.parent):o.level>n.level?r(o.parent,n):r(o,n.parent);e.sort(r)}processPinnedBottomRows(e,t){return s=>{const i=this.processRow.bind(this,s,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="bottom").sort((r,o)=>r.rowIndex-o.rowIndex).map(r=>this.pinnedRowModel?.getPinnedBottomRow(r.rowIndex)).forEach(i):this.pinnedRowModel?.isManual()||this.pinnedRowModel?.forEachPinnedRow("bottom",i),s}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:s=!1,exportRowNumbers:i=!1,columnKeys:r}=e,{colModel:o,gos:n,visibleCols:a}=this,l=o.isPivotMode(),c=h=>Gs(h)?!1:!Fe(h)||i;if(r?.length)return o.getColsForKeys(r).filter(c);const d=n.get("treeData");let u=[];return t&&!l?u=o.getCols():u=a.allCols,u=u.filter(h=>c(h)&&(s&&!d?!Sr(h):!0)),u}recursivelyAddHeaderGroups(e,t,s){const i=[];for(const r of e){const o=r;if(o.getChildren)for(const n of o.getChildren()??[])i.push(n)}e.length>0&&Le(e[0])&&this.doAddHeaderHeader(t,e,s),i&&i.length>0&&this.recursivelyAddHeaderGroups(i,t,s)}doAddHeaderHeader(e,t,s){const i=e.onNewHeaderGroupingRow();let r=0;for(const o of t){const n=o;let a;s?a=s(N(this.gos,{columnGroup:n})):a=this.beans.colNames.getDisplayNameForColumnGroup(n,"header");const c=(n.isExpandable()?n.getLeafColumns():[]).reduce((d,u,h,g)=>{let p=W(d);return u.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],d.push(p)):p&&p[1]==null&&(p[1]=h-1),h===g.length-1&&p&&p[1]==null&&(p[1]=h),d},[]);i.onColumn(n,a||"",r++,n.getLeafColumns().length-1,c)}}},cg={moduleName:"SharedExport",version:H,beans:[iL]},dg=class extends E{getFileName(e){const t=this.getDefaultFileExtension();return e?.length||(e=this.getDefaultFileName()),e.includes(".")?e:`${e}.${t}`}getData(e){return this.beans.gridSerializer.serialize(this.createSerializingSession(e),e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}};function oa(e,t){const s=document.defaultView||window;if(!s){F(52);return}const i=document.createElement("a"),r=s.URL.createObjectURL(t);i.setAttribute("href",r),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:s})),i.remove(),s.setTimeout(()=>{s.URL.revokeObjectURL(r)},0)}var ug=class{constructor(e){this.valueFrom="data";const{colModel:t,rowGroupColsSvc:s,colNames:i,valueSvc:r,gos:o,processCellCallback:n,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,valueFrom:d}=e;this.colModel=t,this.rowGroupColsSvc=s,this.colNames=i,this.valueSvc=r,this.gos=o,this.processCellCallback=n,this.processHeaderCallback=a,this.processGroupHeaderCallback=l,this.processRowGroupCallback=c,d&&(this.valueFrom=d)}prepare(e){}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e){const{column:t,node:s,currentColumnIndex:i,accumulatedRowIndex:r,type:o,useRawFormula:n}=e,a=i===0&&hl(this.gos,s,this.colModel.isPivotMode());if(this.processRowGroupCallback&&(this.gos.get("treeData")||s.group)&&(t.isRowGroupDisplayed(s.rowGroupColumn?.getColId()??"")||a))return{value:this.processRowGroupCallback(N(this.gos,{column:t,node:s}))??""};if(this.processCellCallback)return{value:this.processCellCallback(N(this.gos,{accumulatedRowIndex:r,column:t,node:s,value:this.valueSvc.getValueForDisplay({column:t,node:s,from:this.valueFrom}).value,type:o,parseValue:p=>this.valueSvc.parseValue(t,s,p,this.valueSvc.getValue(t,s,this.valueFrom)),formatValue:p=>this.valueSvc.formatValue(t,s,p)??p}))??""};const l=this.gos.get("treeData"),c=this.valueSvc,d=s.level===-1&&s.footer,u=t.colDef.showRowGroup===!0&&(s.group||l);if(!d&&(a||u)){let p="",f=s;for(;f&&f.level!==-1;){const{value:m,valueFormatted:C}=c.getValueForDisplay({column:a?void 0:t,node:f,includeValueFormatted:!0,exporting:!0,from:this.valueFrom});p=` -> ${C??m??""}${p}`,f=f.parent}return{value:p,valueFormatted:p}}const{value:h,valueFormatted:g}=c.getValueForDisplay({column:t,node:s,includeValueFormatted:!0,exporting:!0,useRawFormula:n,from:this.valueFrom});return{value:h??"",valueFormatted:g}}getHeaderName(e,t){return e?e(N(this.gos,{column:t})):this.colNames.getDisplayNameForColumn(t,"csv",!0)}},Pb=`\r `,rL=class extends ug{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:s}=e;this.suppressQuotes=t,this.columnSeparator=s}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,Pb),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((s,i)=>{i!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(s.data.value||""),s.mergeAcross&&this.appendEmptyCells(s.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,s,i){s!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(i)}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,s){t!=0&&(this.result+=this.columnSeparator);const i=this.extractRowCellValue({column:e,node:s,currentColumnIndex:t,accumulatedRowIndex:t,type:"csv",useRawFormula:!1});this.result+=this.putInQuotes(i.valueFormatted??i.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():(F(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=Pb),this.isFirstLine=!1}},oL=class extends dg{constructor(){super(...arguments),this.beanName="csvCreator"}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){F(51);return}const t=()=>{const i=this.getMergedParams(e),r=this.getData(i),o=new Blob(["\uFEFF",r],{type:"text/plain"}),n=i.fileName,a=typeof n=="function"?n(N(this.gos,{})):n;oa(this.getFileName(a),o)},{overlays:s}=this.beans;s?s.showExportOverlay(t):t()}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const s=t?Object.assign({},e):this.getMergedParams(e);return this.getData(s)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:s,rowGroupColsSvc:i,valueSvc:r,gos:o}=this.beans,{processCellCallback:n,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:d,columnSeparator:u,valueFrom:h}=e;return new rL({colModel:t,colNames:s,valueSvc:r,gos:o,processCellCallback:n||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:d||!1,columnSeparator:u||",",rowGroupColsSvc:i,valueFrom:h})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function nL(e,t){return e.csvCreator?.getDataAsCsv(t)}function aL(e,t){e.csvCreator?.exportDataAsCsv(t)}var hg={moduleName:"CsvExport",version:H,beans:[oL],apiFunctions:{getDataAsCsv:nL,exportDataAsCsv:aL},dependsOn:[cg]},gg=class extends Ke{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}postConstruct(){this.refreshTooltip()}setBrowserTooltip(e,t){const s="title",i=this.ctrl.getGui();i&&(e!=null&&(e!=""||t)?i.setAttribute(s,e):i.removeAttribute(s))}updateTooltipText(){const{getTooltipValue:e}=this.ctrl;e&&(this.tooltip=e())}createTooltipFeatureIfNeeded(){if(this.tooltipManager==null){const e=this.beans.registry.createDynamicBean("tooltipStateManager",!0,this.ctrl,()=>this.tooltip);e&&(this.tooltipManager=this.createBean(e,this.beans.context))}}attemptToShowTooltip(){this.tooltipManager?.prepareToShowTooltip()}attemptToHideTooltip(){this.tooltipManager?.hideTooltip()}setTooltipAndRefresh(e){this.tooltip=e,this.refreshTooltip()}refreshTooltip(e){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)):(this.setBrowserTooltip(e?"":null,e),this.createTooltipFeatureIfNeeded())}destroy(){this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context),super.destroy()}},lL=1e3,cL=1e3,Mb=100,Tb,pc=!1,Db=class extends Ke{constructor(e,t){super(),this.tooltipCtrl=e,this.getTooltipValue=t,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(e){this.popupSvc=e.popupSvc}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const e=this.tooltipCtrl.getGui();this.tooltipTrigger===0&&this.addManagedListeners(e,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),this.tooltipTrigger===1&&this.addManagedListeners(e,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.addManagedListeners(e,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(e,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(e){const t=this.gos.get(e);return Math.max(200,t)}getTooltipDelay(e){return this.tooltipCtrl[`getTooltip${e}DelayOverride`]?.()??this.getGridOptionsTooltipDelay(`tooltip${e}Delay`)}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return!e||e==="hover"?0:1}onMouseEnter(e){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),!ni()&&(pc?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(e)},Mb):this.prepareToShowTooltip(e))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&this.state===2&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){const t=e.relatedTarget,s=this.tooltipCtrl.getGui(),i=this.tooltipComp?.getGui();this.isInteractingWithTooltip||s.contains(t)||this.interactionEnabled&&i?.contains(t)||this.setToDoNothing()}onKeyDown(){this.isInteractingWithTooltip&&(this.isInteractingWithTooltip=!1),this.setToDoNothing()}prepareToShowTooltip(e){if(this.state!=0||pc)return;let t=0;e&&(t=this.isLastTooltipHiddenRecently()?this.getTooltipDelay("SwitchShow"):this.getTooltipDelay("Show")),this.lastMouseEvent=e||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),t),this.state=1}isLastTooltipHiddenRecently(){return Date.now()-Tbthis.hideTooltip(!0),...t.getAdditionalParams?.()});this.state=2,this.tooltipInstanceCount++;const i=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.createTooltipComp(s,i)}hideTooltip(e){!e&&this.isInteractingWithTooltip||(this.tooltipComp&&(this.destroyTooltipComp(),Tb=Date.now()),this.eventSvc.dispatchEvent({type:"tooltipHide",parentGui:this.tooltipCtrl.getGui()}),e&&(this.isInteractingWithTooltip=!1),this.setToDoNothing(!0))}newTooltipComponentCallback(e,t){if(this.state!==2||this.tooltipInstanceCount!==e){this.destroyBean(t);return}const i=t.getGui();this.tooltipComp=t,i.classList.contains("ag-tooltip")||i.classList.add("ag-tooltip-custom"),this.tooltipTrigger===0&&i.classList.add("ag-tooltip-animate"),this.interactionEnabled&&i.classList.add("ag-tooltip-interactive");const r=this.getLocaleTextFunc(),o=this.popupSvc?.addPopup({eChild:i,ariaLabel:r("ariaLabelTooltip","Tooltip")});if(o&&(this.tooltipPopupDestroyFunc=o.hideFunc),this.positionTooltip(),this.tooltipTrigger===1){const n=()=>this.setToDoNothing();[this.onBodyScrollEventCallback]=this.addManagedEventListeners({bodyScroll:n}),this.setEventHandlers(n)}this.interactionEnabled&&([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(i,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),[this.onDocumentKeyDownCallback]=this.addManagedElementListeners(me(this.beans),{keydown:n=>{i.contains(n?.target)||this.onKeyDown()}}),this.tooltipTrigger===1&&([this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(i,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}))),this.eventSvc.dispatchEvent({type:"tooltipShow",tooltipGui:i,parentGui:this.tooltipCtrl.getGui()}),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,this.lockService())}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){const e=this.tooltipComp?.getGui(),t=ie(this.beans);return!!e&&e.contains(t)}onTooltipFocusOut(e){const t=this.tooltipCtrl.getGui();this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,t.contains(e.relatedTarget)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupSvc?.positionPopupUnderMouseEvent({...e,mouseEvent:this.lastMouseEvent}):this.popupSvc?.positionPopupByComponent({...e,eventSource:this.tooltipCtrl.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,s=this.tooltipTrigger===0?cL:0;window.setTimeout(()=>{e(),this.destroyBean(t)},s),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){for(const e of[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener])e&&e();this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){pc=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},Mb)}unlockService(){pc=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("Hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}},dL=class extends gg{constructor(e,t,s){super(e,s),this.highlightTracker=t,this.onHighlight=this.onHighlight.bind(this)}postConstruct(){super.postConstruct(),this.wireHighlightListeners()}wireHighlightListeners(){this.addManagedPropertyListener("tooltipTrigger",({currentValue:e})=>{this.setTooltipMode(e)}),this.setTooltipMode(this.gos.get("tooltipTrigger")),this.highlightTracker.addEventListener("itemHighlighted",this.onHighlight)}onHighlight(e){this.tooltipMode===1&&(e.highlighted?this.attemptToShowTooltip():this.attemptToHideTooltip())}setTooltipMode(e="focus"){this.tooltipMode=e==="focus"?1:0}destroy(){this.highlightTracker.removeEventListener("itemHighlighted",this.onHighlight),super.destroy()}},Ab=class extends In{constructor(){super({tag:"div",cls:"ag-tooltip"})}init(e){const{value:t}=e,s=this.getGui();s.textContent=es(t);const i=e.location.replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase();s.classList.add(`ag-${i}-tooltip`)}},uL=".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),&:where(.ag-cell-formula-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}}",fc=0,hL=200,Ib=class extends Ke{constructor(){super(...arguments),this.beanName="popupSvc",this.popupList=[]}postConstruct(){this.addManagedEventListeners({stylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){const e=this.gos.get("popupParent");return e||this.getDefaultPopupParent()}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:s,nudgeY:i,skipObserver:r}=e;this.positionPopup({ePopup:t,nudgeX:s,nudgeY:i,keepWithinBounds:!0,skipObserver:r,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,e.type,e.ePopup,null,e.mouseEvent)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:s,nudgeY:i,keepWithinBounds:r,eventSource:o,alignSide:n="left",position:a="over",type:l}=e,c=o.getBoundingClientRect(),d=this.getParentRect();this.setAlignedTo(o,t);const u=()=>{let h=c.left-d.left;n==="right"&&(h-=t.offsetWidth-c.width);let g;return a==="over"?(g=c.top-d.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),this.shouldRenderUnderOrAbove(t,c,d,e.nudgeY||0)==="under"?g=c.top-d.top+c.height:g=c.top-t.offsetHeight-(i||0)*2-d.top),{x:h,y:g}};this.positionPopup({ePopup:t,nudgeX:s,nudgeY:i,keepWithinBounds:r,updatePosition:u,postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,l,t,o,null)})}positionPopupForMenu(e){const{eventSource:t,ePopup:s,event:i}=e,r=t.getBoundingClientRect(),o=this.getParentRect();this.setAlignedTo(t,s);let n=!1;const a=()=>{const l=this.keepXYWithinBounds(s,r.top-o.top,0),c=s.clientWidth>0?s.clientWidth:200;n||(s.style.minWidth=`${c}px`,n=!0);const u=o.right-o.left-c;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=g(),this.setAlignedStyles(s,"left")),h>u&&(h=0,this.setAlignedStyles(s,"right"))):(h=g(),h>u&&(h=p(),this.setAlignedStyles(s,"right")),h<0&&(h=0,this.setAlignedStyles(s,"left"))),{x:h,y:l};function g(){return r.right-o.left-2}function p(){return r.left-o.left-c}};this.positionPopup({ePopup:s,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,"subMenu",s,t,i instanceof MouseEvent?i:void 0)})}shouldRenderUnderOrAbove(e,t,s,i){const r=s.bottom-t.bottom,o=t.top-s.top,n=e.offsetHeight+i;return r>n?"under":o>n||o>r?"above":"under"}setAlignedStyles(e,t){const s=this.getPopupIndex(e);if(s===-1)return;const i=this.popupList[s],{alignedToElement:r}=i;if(!r)return;const o=["right","left","over","above","under"];for(const n of o)r.classList.remove(`ag-has-popup-positioned-${n}`),e.classList.remove(`ag-popup-positioned-${n}`);t&&(r.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}setAlignedTo(e,t){const s=this.getPopupIndex(t);if(s!==-1){const i=this.popupList[s];i.alignedToElement=e}}positionPopup(e){const{ePopup:t,keepWithinBounds:s,nudgeX:i,nudgeY:r,skipObserver:o,updatePosition:n}=e,a={width:0,height:0},l=(c=!1)=>{let{x:d,y:u}=n();c&&t.clientWidth===a.width&&t.clientHeight===a.height||(a.width=t.clientWidth,a.height=t.clientHeight,i&&(d+=i),r&&(u+=r),s&&(d=this.keepXYWithinBounds(t,d,1),u=this.keepXYWithinBounds(t,u,0)),t.style.left=`${d}px`,t.style.top=`${u}px`,e.postProcessCallback&&e.postProcessCallback())};if(l(),!o){const c=vs(this.beans,t,()=>l(!0));setTimeout(()=>c(),hL)}}getParentRect(){const e=me(this.beans);let t=this.getPopupParent();return t===e.body?t=e.documentElement:getComputedStyle(t).position==="static"&&(t=t.offsetParent),dm(t)}keepXYWithinBounds(e,t,s){const i=s===0,r=i?"clientHeight":"clientWidth",o=i?"top":"left",n=i?"height":"width",a=i?"scrollTop":"scrollLeft",l=me(this.beans),c=l.documentElement,d=this.getPopupParent(),u=e.getBoundingClientRect(),h=d.getBoundingClientRect(),g=l.documentElement.getBoundingClientRect(),p=d===l.body,f=Math.ceil(u[n]);let C=p?(i?hn:bi)(c)+c[a]:d[r];p&&(C-=Math.abs(g[o]-h[o]));const v=C-f;return Math.min(Math.max(t,0),Math.max(v,0))}addPopup(e){const{eChild:t,ariaLabel:s,ariaOwns:i,alwaysOnTop:r,positionCallback:o,anchorToElement:n}=e,a=this.getPopupIndex(t);if(a!==-1)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(t);const l=this.createPopupWrapper(t,!!r,s,i),c=this.addEventListenersToPopup({...e,wrapperEl:l});return o&&o(),this.addPopupToPopupList(t,l,c,n),{hideFunc:c}}initialisePopupPosition(e){const s=this.getPopupParent().getBoundingClientRect();D(e.style.top)||(e.style.top=`${s.top*-1}px`),D(e.style.left)||(e.style.left=`${s.left*-1}px`)}createPopupWrapper(e,t,s,i){const r=this.getPopupParent(),{environment:o,gos:n}=this.beans,a=$e({tag:"div"});return o.applyThemeClasses(a),a.classList.add("ag-popup"),e.classList.add(n.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||Ie(e,"dialog"),s?de(e,s):i&&(e.id||(e.id=`popup-component-${fc}`),am(i,e.id)),a.appendChild(e),r.appendChild(a),t?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),a}addEventListenersToPopup(e){const t=this.beans,s=me(t),{wrapperEl:i,eChild:r,closedCallback:o,afterGuiAttached:n,closeOnEsc:a,modal:l,ariaOwns:c}=e;let d=!1;const u=f=>{if(!i.contains(ie(t)))return;f.key===b.ESCAPE&&!this.isStopPropagation(f)&&p({keyboardEvent:f})},h=f=>p({mouseEvent:f}),g=f=>p({touchEvent:f}),p=(f={})=>{const{mouseEvent:m,touchEvent:C,keyboardEvent:v,forceHide:w}=f;!w&&(this.isEventFromCurrentPopup({mouseEvent:m,touchEvent:C},r)||d)||(d=!0,i.remove(),s.removeEventListener("keydown",u),s.removeEventListener("mousedown",h),s.removeEventListener("touchstart",g),s.removeEventListener("contextmenu",h),this.eventSvc.removeListener("dragStarted",h),o&&o(m||C||v),this.removePopupFromPopupList(r,c))};return n&&n({hidePopup:p}),window.setTimeout(()=>{a&&s.addEventListener("keydown",u),l&&(s.addEventListener("mousedown",h),this.eventSvc.addListener("dragStarted",h),s.addEventListener("touchstart",g),s.addEventListener("contextmenu",h))},0),p}addPopupToPopupList(e,t,s,i){this.popupList.push({element:e,wrapper:t,hideFunc:s,instanceId:fc,isAnchored:!!i}),i&&this.setPopupPositionRelatedToElement(e,i),fc=fc+1}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const s=this.getPopupIndex(e);if(s===-1)return;const i=this.popupList[s];if(i.stopAnchoringPromise&&i.stopAnchoringPromise.then(o=>o&&o()),i.stopAnchoringPromise=void 0,i.isAnchored=!1,!t)return;const r=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:i.hideFunc});return i.stopAnchoringPromise=r,i.isAnchored=!0,r}removePopupFromPopupList(e,t){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),t&&am(t,null),this.popupList=this.popupList.filter(s=>s.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),s=t.getBoundingClientRect(),{element:i,ePopup:r}=e,o=i.getBoundingClientRect(),n=u=>Number.parseInt(u.substring(0,u.length-1),10),a=(u,h)=>{const g=s[u]-o[u],p=n(r.style[u]);return{initialDiff:g,lastDiff:g,initial:p,last:p,direction:h}},l=a("top",0),c=a("left",1),d=this.beans.frameworkOverrides;return new $(u=>{d.wrapIncoming(()=>{lE(()=>{const h=t.getBoundingClientRect(),g=i.getBoundingClientRect();if(g.top==0&&g.left==0&&g.height==0&&g.width==0){e.hidePopup();return}const f=(m,C)=>{const v=n(r.style[C]);m.last!==v&&(m.initial=v,m.last=v);const w=h[C]-g[C];if(w!=m.lastDiff){const S=this.keepXYWithinBounds(r,m.initial+m.initialDiff-w,m.direction);r.style[C]=`${S}px`,m.last=S}m.lastDiff=w};f(l,"top"),f(c,"left")},200).then(h=>{u(()=>{h!=null&&window.clearInterval(h)})})},"popupPositioning")})}isEventFromCurrentPopup(e,t){const{mouseEvent:s,touchEvent:i}=e,r=s||i;if(!r)return!1;const o=this.getPopupIndex(t);if(o===-1)return!1;for(let n=o;ne.element)}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return Gt(e)}},$s={moduleName:"Popup",version:H,beans:[gL]};function Fo(e){return e.get("tooltipShowMode")==="whenTruncated"}function na(e,t){return Fo(e)?ti(t):void 0}var pL=(e,t)=>{const s=e;return typeof s.getTranslatedMessage=="function"?s.getTranslatedMessage(t):e.message},pg=(e,t,s)=>{const{editModelSvc:i}=e,r=i?.getCellValidationModel()?.getCellValidation(t)?.errorMessages,o=i?.getRowValidationModel().getRowValidation(t)?.errorMessages,n=r||o;return n?.length?n.join(s("tooltipValidationErrorSeparator",". ")):void 0},fL=(e,t)=>{if(Fo(e.gos)){if(t.isCellRenderer()){const i=t.column.getColDef();return!!i.showRowGroup||i.cellRenderer==="agGroupCellRenderer"?ti(()=>{const o=t.eGui;return o.querySelector(".ag-group-value")||o.querySelector(".ag-cell-value")||o}):void 0}return ti(()=>{const i=t.eGui;return i.children.length===0?i:i.querySelector(".ag-cell-value")})}},mL=(e,t,s)=>{const{editSvc:i}=e,{column:r}=t,o=fL(e,t),n=()=>i?.isEditing(t)?!1:o?r.isTooltipEnabled()?o():!1:!0;return{shouldDisplayDefault:n,shouldDisplayColumnTooltip:n,shouldDisplayCustomTooltip:s??n}},CL=({beans:e,ctrl:t,value:s,displayFunctions:i,translate:r})=>{const{editSvc:o,formula:n,gos:a}=e,{column:l,rowNode:c}=t;if(n?.active&&l.isAllowFormula()){const m=n.getFormulaError(l,c);if(m)return{value:pL(m,r),location:"cellFormula",shouldDisplay:()=>!!n?.getFormulaError(l,c)}}if(!!!o?.isEditing(t)){const m=pg(e,t,r);if(m)return{value:m,location:"cellEditor",shouldDisplay:()=>!o?.isEditing(t)&&!!pg(e,t,r)}}const{shouldDisplayCustomTooltip:u,shouldDisplayColumnTooltip:h}=i;if(s!=null)return{value:s,location:"cell",shouldDisplay:u};const g=l.getColDef(),p=c.data;if(g.tooltipField&&D(p))return{value:Kn(p,g.tooltipField,l.isTooltipFieldContainsDots()),location:"cell",shouldDisplay:h};const f=g.tooltipValueGetter;return f?{value:f(N(a,{location:"cell",colDef:l.getColDef(),column:l,rowIndex:t.cellPosition.rowIndex,node:c,data:c.data,value:t.value,valueFormatted:t.valueFormatted})),location:"cell",shouldDisplay:h}:null},vL=class extends E{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,s,i){e&&t.destroyBean(e);const r=this.gos,o=Fo(r),{column:n,eGui:a}=t,l=n.getColDef();!i&&o&&!l.headerComponent&&(i=ti(()=>a.querySelector(".ag-header-cell-text")));const c="header",u=this.beans.colNames.getDisplayNameForColumn(n,"header",!0),h=s??u,g={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>s??l?.headerTooltipValueGetter?.(N(r,{location:c,colDef:l,column:n,value:h,valueFormatted:u}))??l?.headerTooltip,shouldDisplayTooltip:i,getAdditionalParams:()=>({column:n,colDef:n.getColDef()})};let p=this.createTooltipFeature(g);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,s,i){e&&t.destroyBean(e);const r=this.gos,o=Fo(r),{column:n,eGui:a}=t,l=n.getColGroupDef();!i&&o&&!l?.headerGroupComponent&&(i=ti(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",u=this.beans.colNames.getDisplayNameForColumnGroup(n,"header"),h=s??u,g={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>s??l?.headerTooltipValueGetter?.(N(r,{location:c,colDef:l,column:n,value:h,valueFormatted:u}))??l?.headerTooltip,shouldDisplayTooltip:i,getAdditionalParams:()=>{const f={column:n};return l&&(f.colDef=l),f}},p=this.createTooltipFeature(g);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,s){const{beans:i}=this,{column:r,rowNode:o}=e,n=mL(i,e,s),a=this.getLocaleTextFunc();let l=null;const c=()=>(l=CL({beans:i,ctrl:e,value:t,displayFunctions:n,translate:a}),l),u={getGui:()=>e.eGui,getLocation:()=>l?.location??"cell",getTooltipValue:()=>c()?.value,shouldDisplayTooltip:()=>{const h=l??c();return h?h.shouldDisplay?h.shouldDisplay():!0:!1},getAdditionalParams:()=>({column:r,colDef:r.getColDef(),rowIndex:e.cellPosition.rowIndex,node:o,data:o.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(u,i)}setupFullWidthRowTooltip(e,t,s,i){const r={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>s,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:i},o=this.beans,n=o.context;e&&t.destroyBean(e,n);const a=this.createTooltipFeature(r,o);if(a)return t.createBean(a,n)}setupCellEditorTooltip(e,t){const{beans:s}=this,{context:i}=s,r=t.getValidationElement?.(!0)||!t.isPopup?.()&&e.eGui;if(!r)return;const o={getGui:()=>r,getTooltipValue:()=>pg(s,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{const{editModelSvc:a}=s,l=a?.getRowValidationModel()?.getRowValidationMap(),c=a?.getCellValidationModel()?.getCellValidationMap(),d=!!l&&l.size>0,u=!!c&&c.size>0;return d||u}},n=this.createTooltipFeature(o,s);if(n)return e.createBean(n,i)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=D(t.tooltipField)||D(t.tooltipValueGetter)||D(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},wL=class extends Db{createTooltipComp(e,t){BE(this.beans.userCompFactory,e)?.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){this.onColumnMovedEventCallback?.(),this.onColumnMovedEventCallback=void 0}},mc={moduleName:"Tooltip",version:H,beans:[vL],dynamicBeans:{tooltipFeature:gg,highlightTooltipFeature:dL,tooltipStateManager:wL},userComponents:{agTooltipComponent:Ab},dependsOn:[$s],css:[uL]},Eo=class{constructor(e){this.cellValueChanges=e}},fg=class extends Eo{constructor(e,t,s,i){super(e),this.initialRange=t,this.finalRange=s,this.ranges=i}},bL=10,kb=class{constructor(e){this.actionStack=[],this.maxStackSize=e||bL,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}},SL=class extends E{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},s=this.activeCellEdit!==null&&uo(this.activeCellEdit,t),i=this.activeRowEdit!==null&&ve(this.activeRowEdit,t);if(!(s||i||this.isPasting||this.isRangeInAction))return;const{rowPinned:o,rowIndex:n,column:a,oldValue:l,value:c}=e,d={rowPinned:o,rowIndex:n,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(d)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const s=e.get("undoRedoCellEditingLimit");if(s<=0)return;this.undoStack=new kb(s),this.redoStack=new kb(s),this.addListeners();const i=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:r=>{r.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:i,newColumnsLoaded:i,columnGroupOpened:i,columnRowGroupChanged:i,columnMoved:i,columnPinned:i,columnVisible:i,rowDragEnd:i}),t.whenReady(this,r=>{this.gridBodyCtrl=r.gridBodyCtrl})}getCurrentUndoStackSize(){return this.undoStack?.getCurrentStackSize()??0}getCurrentRedoStackSize(){return this.redoStack?.getCurrentStackSize()??0}undo(e){const{eventSvc:t,undoStack:s,redoStack:i}=this;t.dispatchEvent({type:"undoStarted",source:e});const r=this.undoRedo(s,i,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:r})}redo(e){const{eventSvc:t,undoStack:s,redoStack:i}=this;t.dispatchEvent({type:"redoStarted",source:e});const r=this.undoRedo(i,s,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:r})}undoRedo(e,t,s,i,r){if(!e)return!1;const o=e.pop();return o?.cellValueChanges?(this.processAction(o,n=>n[i],r),o instanceof fg?this.processRange(o.ranges||[o[s]]):this.processCell(o.cellValueChanges),t.push(o),!0):!1}processAction(e,t,s){const{changeDetectionSvc:i}=this.beans;i?.beginDeferred();try{for(const r of e.cellValueChanges){const{rowIndex:o,rowPinned:n,columnId:a}=r,l={rowIndex:o,rowPinned:n},c=Ve(this.beans,l);c?.displayed&&c.setDataValue(a,t(r),s)}}finally{i?.endDeferred()}}processRange(e){let t;const s=this.beans.rangeSvc;s.removeAllCellRanges(!0),e.forEach((i,r)=>{if(!i)return;const o=i.startRow,n=i.endRow;r===e.length-1&&(t={rowPinned:o.rowPinned,rowIndex:o.rowIndex,columnId:i.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,rowEndIndex:n.rowIndex,rowEndPinned:n.rowPinned,columnStart:i.startColumn,columns:i.columns};s.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:s,rowPinned:i}=t,r={rowIndex:s,rowPinned:i},o=Ve(this.beans,r),n={rowPinned:t.rowPinned,rowIndex:o.rowIndex,columnId:t.columnId};this.setLastFocusedCell(n)}setLastFocusedCell(e){const{rowIndex:t,columnId:s,rowPinned:i}=e,{colModel:r,focusSvc:o,rangeSvc:n}=this.beans,a=r.getCol(s);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:i};o.setFocusedCell({...c,forceBrowserFocus:!0}),n?.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Eo(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 s=new Eo(this.cellValueChanges);this.pushActionsToUndoStack(s)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Eo(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new fg(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:s}=this.beans;t&&mt(s)?e=new fg(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Eo(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?.length===0))return;const s=new Eo(t??[]);this.pushActionsToUndoStack(s),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},yL=".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) .ag-text-area-input{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}",xL={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},RL=class extends Rr{constructor(){super(xL,[ds]),this.eEditor=x}initialiseEditor(e){this.agSetEditValue(e.value),this.eEditor.getInputElement().setAttribute("tabindex","-1"),this.addManagedListeners(this.eEditor,{fieldValueChanged:s=>this.setAriaLabel(s.selected)})}agSetEditValue(e){this.params.value=e;const t=e??void 0;this.eEditor.setValue(t,!0),this.setAriaLabel(t)}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(),s=qa(t,e),i=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${i} (${s})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,s=this.getValue();return t?t({value:s,internalErrors:null,cellEditorParams:e}):null}},ct=class extends li{constructor(e,t="ag-text-field",s="text"){super(e,t,s)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){const s=this.eInput;return s.value!==e&&(s.value=D(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}setCustomValidity(e){const t=this.eInput,s=e.length>0;t.setCustomValidity(e),s&&t.reportValidity(),Wa(t,s)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=s=>{Il(s)&&s.key&&!e.test(s.key)&&s.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:s=>{s.clipboardData?.getData("text")?.split("").some(r=>!e.test(r))&&s.preventDefault()}})}},Vt={selector:"AG-INPUT-TEXT-FIELD",component:ct},Po=class extends ct{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=Ss();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){ie(this.beans)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?tt(e??null,!!this.includeTime)??void 0:e;return this.min===t?this:(this.min=t,nt(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?tt(e??null,!!this.includeTime)??void 0:e;return this.max===t?this:(this.max=t,nt(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,nt(this.eInput,"step",e),this)}setIncludeTime(e){return this.includeTime===e?this:(this.includeTime=e,super.setInputType(e?"datetime-local":"date"),e&&this.setStep(1),this)}getDate(){if(this.eInput.validity.valid)return _e(this.getValue())??void 0}setDate(e,t){this.setValue(tt(e??null,this.includeTime),t)}},Lb={selector:"AG-INPUT-DATE-FIELD",component:Po},Cc=class extends Rr{constructor(e){super(),this.cellEditorInput=e,this.eEditor=x}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:s}=this,{cellStartedEdit:i,eventKey:r,suppressPreventDefault:o}=e;s.getInputElement().setAttribute("title",""),t.init(s,e);let n,a=!0;i?(this.focusAfterAttached=!0,r===b.BACKSPACE||r===b.DELETE?n="":r&&r.length===1?o?a=!1:n=r:(n=t.getStartValue(),r!==b.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,n=t.getStartValue()),a&&n!=null&&s.setStartValue(n),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===b.PAGE_UP||c===b.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;Ss()||t.getFocusableElement().focus();const s=t.getInputElement();this.highlightAllOnFocus?s.select():this.cellEditorInput.setCaret?.()}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),s=e.getInputElement();t.focus(),s.select()}getValue(){return this.cellEditorInput.getValue()}agSetEditValue(e){this.params.value=e;const t=this.cellEditorInput.getStartValue();this.eEditor.setStartValue(t??null)}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},FL={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},EL=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return FL}getAgComponents(){return[Lb]}init(e,t){this.eEditor=e,this.params=t;const{min:s,max:i,step:r,colDef:o}=t;s!=null&&e.setMin(s),i!=null&&e.setMax(i),r!=null&&e.setStep(r),this.includeTime=t.includeTime??this.getDataTypeService()?.getDateIncludesTimeFlag?.(o.cellDataType),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:s}=this,{min:i,max:r,getValidationErrors:o}=s;let n=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(i){const l=i instanceof Date?i:new Date(i);if(tl){const c=l.toLocaleDateString();n.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return n.length||(n=null),o?o({value:t,cellEditorParams:s,internalErrors:n}):n}getValue(){const{eEditor:e,params:t}=this,s=e.getDate();return!D(s)&&!D(t.value)?t.value:s??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return tt(e,this.includeTime??!1)}},PL=class extends Cc{constructor(){super(new EL(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},ML={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},TL=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return ML}getAgComponents(){return[Lb]}init(e,t){this.eEditor=e,this.params=t;const{min:s,max:i,step:r,colDef:o}=t;s!=null&&e.setMin(s),i!=null&&e.setMax(i),r!=null&&e.setStep(r),this.includeTime=t.includeTime??this.getDataTypeService()?.getDateIncludesTimeFlag?.(o.cellDataType),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,s=e.getInputElement().value,i=this.formatDate(this.parseDate(s??void 0)),{min:r,max:o,getValidationErrors:n}=t;let a=[];if(i){const l=new Date(i),c=this.getLocaleTextFunc();if(r){const d=new Date(r);if(ld){const u=d.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${u}`,[u]))}}}return a.length||(a=null),n?n({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,s=this.formatDate(t.getDate());return!D(s)&&!D(e.value)?e.value:e.parseValue(s??"")}getStartValue(){return tt(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):_e(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):tt(e??null,this.includeTime??!1)??void 0}},DL=class extends Cc{constructor(){super(new TL(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Gb=class extends li{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const s=super.setValue(e,t);return this.eInput.value=e,s}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},AL={selector:"AG-INPUT-TEXT-AREA",component:Gb},IL={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},kL=class extends Rr{constructor(){super(IL,[AL]),this.eEditor=x}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:s,eventKey:i,maxLength:r,cols:o,rows:n}=e;this.focusAfterAttached=s,t.getInputElement().setAttribute("title",""),t.setMaxLength(r||200).setCols(o||60).setRows(n||10);let a;s?(this.focusAfterAttached=!0,i===b.BACKSPACE||i===b.DELETE?a="":i&&i.length===1?a=i:(a=this.getStartValue(e),i!==b.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?.toString()??t}agSetEditValue(e){this.params.value=e;const t=this.getStartValue(this.params);this.eEditor.setValue(t??"",!0)}onKeyDown(e){const t=e.key;(t===b.LEFT||t===b.UP||t===b.RIGHT||t===b.DOWN||e.shiftKey&&t===b.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:s}=this,i=this.getLocaleTextFunc();e.setInputAriaLabel(i("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),s&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:s}=t,i=e.getValue();return!D(i)&&!D(s)?s:t.parseValue(i)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:s}=e,i=this.getLocaleTextFunc(),r=this.getValue();let o=[];return typeof r=="string"&&t!=null&&r.length>t&&o.push(i("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),o.length||(o=null),s?s({value:r,internalErrors:o,cellEditorParams:e}):o}},aa=class extends ct{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct();const e=this.eInput;this.addManagedListeners(e,{blur:()=>{const o=Number.parseFloat(e.value),n=isNaN(o)?"":this.normalizeValue(o.toString());this.value!==n&&this.setValue(n)},wheel:this.onWheel.bind(this)}),e.step="any";const{precision:t,min:s,max:i,step:r}=this.config;typeof t=="number"&&this.setPrecision(t),typeof s=="number"&&this.setMin(s),typeof i=="number"&&this.setMax(i),typeof r=="number"&&this.setStep(r)}onWheel(e){ie(this.beans)===this.eInput&&e.preventDefault()}normalizeValue(e){return e===""?"":(this.precision!=null&&(e=this.adjustPrecision(e)),e)}adjustPrecision(e,t){const s=this.precision;if(s==null)return e;if(t){const r=Number.parseFloat(e).toFixed(s);return Number.parseFloat(r).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=s)return e;if(s>0)return`${i[0]}.${i[1].slice(0,s)}`}return i[0]}setMin(e){return this.min===e?this:(this.min=e,nt(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,nt(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,nt(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(s=>super.setValue(s,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,s){if(D(s)){let i=this.isScientificNotation(s);if(i&&this.eInput.validity.valid)return e(s);if(!i){s=this.adjustPrecision(s);const r=this.normalizeValue(s);i=s!=r}if(i)return t(s)}return e(s)}getValue(e=!1){const t=this.eInput;if(!t.validity.valid&&!e)return;const s=t.value;return this.isScientificNotation(s)?this.adjustPrecision(s,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},la={selector:"AG-INPUT-NUMBER-FIELD",component:aa},LL={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},GL=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return LL}getAgComponents(){return[la]}init(e,t){this.eEditor=e,this.params=t;const{max:s,min:i,precision:r,step:o}=t;s!=null&&e.setMax(s),i!=null&&e.setMin(i),r!=null&&e.setPrecision(r),o!=null&&e.setStep(o);const n=e.getInputElement();t.preventStepping?e.addManagedElementListeners(n,{keydown:this.preventStepping}):t.showStepperButtons&&n.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:s,getValidationErrors:i}=e,o=this.eEditor.getInputElement().valueAsNumber,n=this.getLocaleTextFunc();let a=[];return typeof o=="number"&&(t!=null&&os&&a.push(n("maxValueValidation",`Must be less than or equal to ${s}.`,[String(s)]))),a.length||(a=null),i?i({value:o,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===b.UP||e.key===b.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,s=e.getValue();if(!D(s)&&!D(t.value))return t.value;let i=t.parseValue(s);if(i==null)return i;if(typeof i=="string"){if(i==="")return null;i=Number(i)}return isNaN(i)?null:i}getStartValue(){return this.params.value}setCaret(){Ss()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},OL=class extends Cc{constructor(){super(new GL(()=>this.getLocaleTextFunc()))}},VL=".ag-list-item{align-items:center;display:flex;height:var(--ag-list-item-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}",BL="ag-active-item",NL=(e,t)=>({tag:"div",cls:`ag-list-item ag-${e}-list-item`,attrs:{role:"option"},children:[{tag:"span",cls:`ag-list-item-text ag-${e}-list-item-text`,ref:"eText",children:t}]}),HL=class extends Pt{constructor(e,t,s){super(NL(e,t)),this.label=t,this.value=s,this.eText=x}postConstruct(){this.createTooltip(),this.addEventListeners()}setHighlighted(e){const t=this.getGui();t.classList.toggle(BL,e),cn(t,e),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:e})}getHeight(){return this.getGui().clientHeight}setIndex(e,t){const s=this.getGui();ln(s,e),an(s,t)}createTooltip(){const e={getTooltipValue:()=>this.label,getGui:()=>this.getGui(),getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>pm(this.eText)},t=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("highlightTooltipFeature",!1,e,this));t&&(this.tooltipFeature=t)}addEventListeners(){const e=this.getParentComponent();e&&(this.addGuiEventListener("mouseover",()=>{e.highlightItem(this)}),this.addGuiEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),e.setValue(this.value)}))}},zL=class extends Pt{constructor(e="default"){super({tag:"div",cls:`ag-list ag-${e}-list`}),this.cssIdentifier=e,this.options=[],this.listItems=[],this.highlightedItem=null,this.registerCSS(VL)}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()})}handleKeyDown(e){const t=e.key;switch(t){case b.ENTER:if(!this.highlightedItem)this.setValue(this.getValue());else{const s=this.listItems.indexOf(this.highlightedItem);this.setValueByIndex(s)}break;case b.DOWN:case b.UP:e.preventDefault(),this.navigate(t);break;case b.PAGE_DOWN:case b.PAGE_UP:case b.PAGE_HOME:case b.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){const{value:t,text:s}=e,i=s??t;return this.options.push({value:t,text:i}),this.renderOption(t,i),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0);for(const e of this.listItems)e.destroy();ee(this.getGui()),this.listItems=[],this.refreshAriaRole()}updateOptions(e){const t=this.options!==e;return t&&(this.clearOptions(),this.addOptions(e)),t}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;const s=this.options.findIndex(i=>i.value===e);if(s!==-1){const i=this.options[s];this.value=i.value,this.displayValue=i.text,this.highlightItem(this.listItems[s]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(t=>t.value===this.value);e!==-1&&this.highlightItem(this.listItems[e])}highlightItem(e){const t=e.getGui();if(!Ne(t))return;this.clearHighlighted(),e.setHighlighted(!0),this.highlightedItem=e;const s=this.getGui(),{scrollTop:i,clientHeight:r}=s,{offsetTop:o,offsetHeight:n}=t;(o+n>i+r||o{s.setIndex(i+1,t)})}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},_L=".ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-picker-button-background-color);border:var(--ag-picker-button-border);border-radius:5px;min-height:max(var(--ag-list-item-height),calc(var(--ag-spacing)*4));overflow:hidden;&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}}.ag-picker-field-wrapper:where(.ag-picker-has-focus),.ag-picker-field-wrapper:where(:focus-within){background-color:var(--ag-picker-button-focus-background-color);border:var(--ag-picker-button-focus-border);box-shadow:var(--ag-focus-shadow);&:where(.invalid){box-shadow:var(--ag-focus-error-shadow)}}.ag-picker-field-wrapper:disabled{opacity:.5}",WL={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-field-wrapper ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},vc=class extends Rh{constructor(e){if(super(e,e?.template||WL,e?.agComponents||[],e?.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=x,this.eWrapper=x,this.eDisplayField=x,this.eIcon=x,this.registerCSS(_L),this.ariaRole=e?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:s,variableWidth:i,minPickerWidth:r,maxPickerWidth:o}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!i,s!=null&&this.setPickerMaxHeight(s),r!=null&&this.setPickerMinWidth(r),o!=null&&this.setPickerMaxWidth(o)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:s,inputWidth:i}=this.config;if(s){const r=this.beans.iconSvc.createIconNoSpan(s);r&&this.eIcon.appendChild(r)}i!=null&&this.setInputWidth(i)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),ot(e,!1),this.ariaRole&&Ie(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&e?.target===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case b.UP:case b.DOWN:case b.ENTER:case b.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case b.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const t=this.getLocaleTextFunc(),{config:{pickerAriaLabelKey:s,pickerAriaLabelValue:i,modalPicker:r=!0},maxPickerHeight:o,minPickerWidth:n,maxPickerWidth:a,variableWidth:l,beans:c,eWrapper:d}=this,u={modal:r,eChild:e,closeOnEsc:!0,closedCallback:()=>{const f=ms(c);this.beforeHidePicker(),f&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(s,i),anchorToElement:d};e.style.position="absolute";const h=c.popupSvc,g=h.addPopup(u);l?(n&&(e.style.minWidth=n),e.style.width=_d(bi(d)),a&&(e.style.maxWidth=a)):Za(e,a??bi(d));const p=o??`${un(h.getPopupParent())}px`;return e.style.setProperty("max-height",p),this.alignPickerToComponent(),g.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerGap:e,config:{pickerType:t},beans:{popupSvc:s,gos:i},eWrapper:r,pickerComponent:o}=this,n=i.get("enableRtl")?"right":"left";s.positionPopupByComponent({type:t,eventSource:r,ePopup:o.getGui(),position:"under",alignSide:n,keepWithinBounds:!0,nudgeY:e})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();ot(t,e);const s=this.eWrapper.classList;s.toggle("ag-picker-expanded",e),s.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){this.pickerComponent?.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&(this.hideCurrentPicker(),this.dispatchLocalEvent({type:"pickerHidden"}))}setInputWidth(e){return Za(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}},UL=".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}.ag-select:where(:not(.ag-cell-editor,.ag-label-align-top)){min-height:var(--ag-list-item-height)}:where(.ag-select){.ag-picker-field-wrapper{cursor:default;padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}.ag-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}:where(.ag-ltr) .ag-select-list-item{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-select-list-item{padding-right:var(--ag-spacing)}.ag-select-list-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",Ct=class extends vc{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"selectOpen",ariaRole:"combobox",...e}),this.registerCSS(UL)}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{shouldDisplayTooltip:ti(()=>this.eDisplayField),getGui:()=>this.getGui()})),super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:s}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),s&&t==null&&(this.eDisplayField.textContent=s),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){const e=this.createBean(new zL("select"));this.listComponent=e,e.setParentComponent(this);const t=e.getAriaElement(),s=`ag-select-list-${e.getCompId()}`;t.setAttribute("id",s),ja(this.getAriaElement(),t),e.addManagedElementListeners(e.getGui(),{mousedown:i=>{i?.preventDefault()}}),e.addManagedListeners(e,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})},fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}beforeHidePicker(){this.listComponent?.hideItemTooltip(),super.beforeHidePicker()}onKeyDown(e){const{key:t}=e;switch(t===b.TAB&&this.hidePicker(),t){case b.ENTER:case b.UP:case b.DOWN:case b.PAGE_UP:case b.PAGE_DOWN:case b.PAGE_HOME:case b.PAGE_END:e.preventDefault(),this.isPickerDisplayed?this.listComponent?.handleKeyDown(e):super.onKeyDown(e);break;case b.ESCAPE:super.onKeyDown(e);break;case b.SPACE:this.isPickerDisplayed?e.preventDefault():super.onKeyDown(e);break}}showPicker(){const e=this.listComponent;e&&(super.showPicker(),e.refreshHighlighted())}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){return this.listComponent?.clearOptions(),this.setValue(void 0,!0),this}updateOptions(e){return this.listComponent?.updateOptions(e)&&this.setValue(void 0,!0),this}setValue(e,t,s){const{listComponent:i,config:{placeholder:r},eDisplayField:o,tooltipFeature:n}=this;if(this.value===e||!i)return this;if(s||i.setValue(e,!0),i.getValue()===this.getValue())return this;let l=i.getDisplayValue();return l==null&&r&&(l=r),o.textContent=l,n?.setTooltipAndRefresh(l??null),super.setValue(e,t)}destroy(){this.listComponent=this.destroyBean(this.listComponent),super.destroy()}},Wi={selector:"AG-SELECT",component:Ct},$L={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},KL=class extends Rr{constructor(){super($L,[Wi]),this.eEditor=x,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:s,gos:i}=this,{values:r,value:o,eventKey:n}=e;if(ne(r)){F(58);return}this.startedByEnter=n!=null?n===b.ENTER:!1;let a=!1;r.forEach(u=>{const h={value:u},g=s.formatValue(e.column,null,u),p=g!=null;h.text=p?g:u,t.addOption(h),a=a||o===u}),a?t.setValue(e.value??void 0,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:d}=e;l!=null&&t.setPickerGap(l),d!=null&&t.setPickerMaxHeight(d),c!=null&&t.setPickerMaxWidth(c),i.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()}agSetEditValue(e){this.params.value=e,this.eEditor.setValue(e??void 0,!0)}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:s}=e,i=this.getValue();let r=[];if(t&&i!=null&&!t.includes(i)){const o=this.getLocaleTextFunc();r.push(o("invalidSelectionValidation","Invalid selection."))}else r=null;return s?s({value:i,internalErrors:r,cellEditorParams:e}):r}},jL={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},qL=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return jL}getAgComponents(){return[Vt]}init(e,t){this.eEditor=e,this.params=t;const s=t.maxLength;s!=null&&e.setMaxLength(s)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:s}=e,i=this.getValue(),r=this.getLocaleTextFunc();let o=[];return t!=null&&typeof i=="string"&&i.length>t&&o.push(r("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),o.length||(o=null),s?s({value:i,cellEditorParams:e,internalErrors:o}):o}getValue(){const{eEditor:e,params:t}=this,s=e.getValue();return!D(s)&&!D(t.value)?t.value:t.parseValue(s)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){Ss()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),s=D(t)&&t.length||0;s&&e.getInputElement().setSelectionRange(s,s)}},Ob=class extends Cc{constructor(){super(new qL(()=>this.getLocaleTextFunc()))}};function YL(e){e.undoRedo?.undo("api")}function XL(e){e.undoRedo?.redo("api")}function ZL(e,t){return e.editModelSvc?.getEditRowDataValue(t,{checkSiblings:!0})}function QL(e){const t=e.editModelSvc?.getEditMap(),s=[];return t?.forEach((i,r)=>{const{rowIndex:o,rowPinned:n}=r;i.forEach((a,l)=>{const{editorValue:c,pendingValue:d,sourceValue:u,state:h}=a,g=Fs(a);let p=c??d;p===st&&(p=void 0);const f={newValue:p,oldValue:u,state:h,column:l,colId:l.getColId(),colKey:l.getColId(),rowIndex:o,rowPinned:n},m=h==="editing";(m||!m&&g)&&s.push(f)})}),s}function JL(e,t=!1){const{editSvc:s}=e;if(s?.isBatchEditing()){if(t)for(const i of e.editModelSvc?.getEditPositions()??[])i.state==="editing"&&s.revertSingleCellEdit(i);else Hi(e,{persist:!0});zi(e,void 0,{cancel:t})}else s?.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function e6(e,t){const s=ce(e,t);return!!e.editSvc?.isEditing(s)}function t6(e,t){const{key:s,colKey:i,rowIndex:r,rowPinned:o}=t,{editSvc:n,colModel:a}=e,l=a.getCol(i);if(!l){F(12,{colKey:i});return}const d=Ve(e,{rowIndex:r,rowPinned:o||null,column:l});if(!d){F(290,{rowIndex:r,rowPinned:o});return}if(!n?.isCellEditable({rowNode:d,column:l},"api"))return;o==null&&gb(e,r),hb(e,i),n?.startEditing({rowNode:d,column:l},{event:s?new KeyboardEvent("keydown",{key:s}):void 0,source:"api",editable:!0})}function s6(e){return e.editSvc?.validateEdit()||null}function i6(e){return e.undoRedo?.getCurrentUndoStackSize()??0}function r6(e){return e.undoRedo?.getCurrentRedoStackSize()??0}var o6={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},n6=class extends In{constructor(e){super(o6),this.params=e}postConstruct(){mr(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,s=i=>{ih(this.gos,i,t.node,t.column,!0)||t.onKeyDown(i)};this.addManagedElementListeners(e,{keydown:s})}};function a6(e,{column:t},s,i,r="ui"){if(s instanceof KeyboardEvent&&(s.key===b.TAB||s.key===b.ENTER||s.key===b.F2||s.key===b.BACKSPACE&&i))return!0;if(s?.shiftKey&&e.rangeSvc?.getCellRanges().length!=0)return!1;const n=t?.getColDef(),a=l6(e.gos,n),l=s?.type;return l==="click"&&s?.detail===1&&a===1||l==="dblclick"&&s?.detail===2&&a===2?!0:r==="api"?!!i:!1}function l6(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t?.singleClickEdit?1:2}function mg(e,t){return e.editModelSvc?.hasEdits(t,{withOpenEditor:!0})??!1}function Cg(e,t){const s=t.column,i=t.rowNode,r=s.getColDef();if(!i)return mg(e,t);const o=r.editable;return i.group&&r.groupRowEditable!=null?e.rowGroupingEditValueSvc?.isGroupCellEditable(i,s)?!0:mg(e,t):s.isColumnFunc(i,o)?!0:mg(e,t)}function c6(e,t,s="ui"){const i=Cg(e,t);if(i||s==="ui")return i;const{rowNode:r,column:o}=t;for(const n of e.colModel.getCols())if(n!==o&&Cg(e,{rowNode:r,column:n}))return!0;return!1}var wc=(e,t=!1)=>{if(e!==void 0)return Fs(e)||t&&e.state==="editing"};function Vb(e,t,s=!1){return wc(e.editModelSvc?.getEdit(t),s)}var Bb=(e,t,s)=>{if(e)for(let i=0,r=e.length;i{const l={rowNode:i,column:a};return Vb(s,l,!0)||Nb(s,l)||Hb(s,l)});this.applyStyle(o,n);return}this.applyStyle(o)}applyStyle(e=!1,t=!1){const s=!!this.editSvc?.isBatchEditing(),i=this.gos.get("editType")==="fullRow";this.rowCtrl?.forEachGui(void 0,({rowComp:r})=>{r.toggleCss("ag-row-editing",i&&t),r.toggleCss("ag-row-batch-edit",i&&t&&s),r.toggleCss("ag-row-inline-editing",t),r.toggleCss("ag-row-not-inline-editing",!t),r.toggleCss("ag-row-editing-invalid",i&&t&&e)})}},h6=({rowModel:e,pinnedRowModel:t,editModelSvc:s},i)=>{const r=new Set;e.forEachNode(o=>i.has(o)&&r.add(o)),t?.forEachPinnedRow("top",o=>i.has(o)&&r.add(o)),t?.forEachPinnedRow("bottom",o=>i.has(o)&&r.add(o));for(const o of i)r.has(o)||s.removeEdits({rowNode:o});return r},g6=({editModelSvc:e},t,s)=>{for(const i of t)e?.getEditRow(i)?.forEach((r,o)=>!s.has(o)&&e.removeEdits({rowNode:i,column:o}))},p6=e=>()=>{const t=new Set(e.colModel.getCols()),s=e.editModelSvc.getEditMap(!0),i=new Set(s.keys());g6(e,h6(e,i),t)},f6=new Set(["undo","redo","paste","bulk","rangeSvc"]),m6=new Set(["ui","api"]),zb={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},C6=new Set(Object.keys(zb)),v6=new Set(["paste","rangeSvc","cellClear","redo","undo"]),vg={cancel:!0,source:"api"},w6={cancel:!1,source:"api"},Or={checkSiblings:!0},Ui={force:!0,suppressFlash:!0},b6={force:!0},S6=class extends E{constructor(){super(...arguments),this.beanName="editSvc",this.committing=!1,this.batch=!1,this.batchStartDispatched=!1,this.stopping=!1,this.rangeSelectionWhileEditing=0}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:i})=>{this.stopEditing(void 0,vg),this.createStrategy(i)});const t=p6(e),s=()=>{const i=this.model.getCellValidationModel().getCellValidationMap().size>0,r=this.model.getRowValidationModel().getRowValidationMap().size>0;return i||r?this.stopEditing(void 0,vg):this.isEditing()&&(this.batch?zi(e,this.model.getEditPositions()):this.stopEditing(void 0,w6)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:s,filterChanged:s,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}startBatchEditing(){this.batch||(this.batch=!0,this.batchStartDispatched=!1,this.stopEditing(void 0,vg))}stopBatchEditing(e){this.batch&&(e&&this.stopEditing(void 0,e),this.batchStartDispatched&&this.dispatchBatchStopped(new Map,!1),this.batch=!1,this.batchStartDispatched=!1)}ensureBatchStarted(){!this.batch||this.batchStartDispatched||(this.batchStartDispatched=!0,this.dispatchBatchEvent("batchEditingStarted",new Map))}createStrategy(e){const{beans:t,gos:s,strategy:i}=this,r=_b(s,e);if(i){if(i.beanName===r)return i;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(r,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,s,i="ui"){const r=a6(this.beans,e,t,s,i);return r&&(this.strategy??(this.strategy=this.createStrategy())),r}shouldStopEditing(e,t,s="ui"){return this.strategy?.shouldStop(e,t,s)??null}shouldCancelEditing(e,t,s="ui"){return this.strategy?.shouldCancel(e,t,s)??null}validateEdit(){return T2(this.beans)}isEditing(e,t){return this.model.hasEdits(e??void 0,t??Or)}isRowEditing(e,t){return!!e&&this.model.hasRowEdits(e,t)}enableRangeSelectionWhileEditing(){this.beans.rangeSvc&&this.gos.get("cellSelection")&&this.rangeSelectionWhileEditing++}disableRangeSelectionWhileEditing(){this.rangeSelectionWhileEditing=Math.max(0,this.rangeSelectionWhileEditing-1)}isRangeSelectionEnabledWhileEditing(){return this.rangeSelectionWhileEditing>0}startEditing(e,t){const{startedEdit:s=!0,event:i=null,source:r="ui",ignoreEventKey:o=!1,silent:n}=t;if(this.strategy??(this.strategy=this.createStrategy()),!(t.editable??this.isCellEditable(e,"api")))return;const l=ce(this.beans,e);if(l&&!l.comp){t.editable=void 0,l.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const c=this.shouldStartEditing(e,i,s,r);if(c===!1&&r!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,r)&&!t.continueEditing&&this.stopEditing(void 0,{source:r}),c&&this.ensureBatchStarted(),this.strategy.start({position:e,event:i,source:r,ignoreEventKey:o,startedEdit:s,silent:n})}stopEditing(e,t){const s=this.prepareStopContext(e,t);if(!s)return!1;this.stopping=!0;let i=!1,{edits:r}=s;try{const o=this.processStopRequest(s);return i||(i=o.res),r=o.edits,this.finishStopEditing({...s,edits:r,params:t,position:e,res:i}),i}finally{this.rangeSelectionWhileEditing=0,this.stopping=!1}}prepareStopContext(e,t){const{event:s=null,cancel:i=!1,source:r="ui",forceCancel:o=!1,forceStop:n=!1,commit:a=!1}=t||{};if(C6.has(r)&&this.batch)return e?.rowNode&&e?.column&&this.bulkRefreshCell(e),null;const l=this.committing?zb[r]:r;if(!(this.committing||this.isEditing(e)||this.batch&&this.model.hasEdits(e,Or))||!this.strategy||this.stopping)return null;const d=ce(this.beans,e);d&&(d.onEditorAttachedFuncs=[]);const u=!i&&(!!this.shouldStopEditing(e,s,l)||(this.committing||r==="paste")&&!this.batch)||n,h=i&&!!this.shouldCancelEditing(e,s,l)||o;return{cancel:i,cellCtrl:d,edits:this.model.getEditMap(!0),event:s??null,forceCancel:o,forceStop:n,commit:a,position:e,source:r,treatAsSource:l,willCancel:h,willStop:u}}processStopRequest(e){const{event:t,position:s,willCancel:i,willStop:r}=e;return r||i?this.handleStopOrCancel(e):this.shouldHandleMidBatchKey(t,s)?{res:!1,edits:this.handleMidBatchKey(t,s,e)}:(Hi(this.beans,{persist:!0}),this.batch&&this.strategy?.cleanupEditors(s),{res:!1,edits:this.model.getEditMap()})}handleStopOrCancel(e){const{beans:t,model:s}=this,{cancel:i,commit:r,edits:o,event:n,source:a,willCancel:l,willStop:c}=e,d=!this.batch||!l;Hi(t,{persist:d,isCancelling:l||i,isStopping:c});const u=s.getEditMap(),g=!l&&(!this.batch||r)?this.processEdits(u,a):[];i?this.strategy?.stopCancelled(e.forceCancel):this.strategy?.stopCommitted(n,r),this.clearValidationIfNoOpenEditors();for(const p of g)s.clearEditValue(p);this.bulkRefreshMap(o);for(const p of s.getEditPositions(u)){const f=ce(t,p),m=Fs(p);f?.refreshCell({force:!0,suppressFlash:!m})}return{res:c,edits:u}}shouldHandleMidBatchKey(e,t){return e instanceof KeyboardEvent&&this.batch&&!!this.strategy?.midBatchInputsAllowed(t)&&this.isEditing(t,{withOpenEditor:!0})}handleMidBatchKey(e,t,s){const{beans:i,model:r}=this,{cellCtrl:o,edits:n}=s,{key:a}=e,l=a===b.ENTER,c=a===b.ESCAPE,d=a===b.TAB;if(l||d||c){if(l||d)Hi(i,{persist:!0});else if(c&&o){const{rowNode:u,column:h}=o;if(this.batch&&u&&h){const g={rowNode:u,column:h};zi(i,[g],{silent:!0}),this.model.stop(g,!0,!0),ce(i,g)?.refreshCell(Ui)}else this.revertSingleCellEdit(o)}return this.batch?this.strategy?.cleanupEditors():zi(i,r.getEditPositions(),{event:e,cancel:c}),e.preventDefault(),this.bulkRefreshMap(n,{suppressFlash:!0}),r.getEditMap()}return n}finishStopEditing({cellCtrl:e,edits:t,params:s,position:i,res:r,commit:o,forceCancel:n,willCancel:a,willStop:l}){const c=this.beans;r&&i&&(!this.batch||o)&&this.model.removeEdits(i),this.navigateAfterEdit(s,e?.cellPosition),Jn(c),this.clearValidationIfNoOpenEditors();const{rowRenderer:d,formula:u}=c;if(a&&d.refreshRows({rowNodes:Array.from(t.keys())}),this.batch){u?u.refreshFormulas(!0):d.refreshRows({suppressFlash:!0,force:!0});const h=l&&o;(h||a&&n)&&this.dispatchBatchStopped(t,h)}}dispatchBatchStopped(e,t){let s;t&&(s=S2(e),s.size>0&&this.ensureBatchStarted()),this.batchStartDispatched&&(this.batchStartDispatched=!1,this.dispatchBatchEvent("batchEditingStopped",s??new Map))}clearValidationIfNoOpenEditors(){this.model.hasEdits(void 0,{withOpenEditor:!0})||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap())}navigateAfterEdit(e,t){if(!e||!t)return;const{event:s,suppressNavigateAfterEdit:i}=e;if(!(s instanceof KeyboardEvent)||i)return;const{key:o,shiftKey:n}=s,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(o!==b.ENTER||!a)return;const l=n?b.UP:b.DOWN;this.beans.navigation?.navigateToNextCell(null,l,t,!1)}processEdits(e,t){const s=Array.from(e.keys()),i=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,r=[],{changeDetectionSvc:o}=this.beans;o?.beginDeferred();try{for(const n of s){const a=e.get(n);for(const l of a.keys()){const c=a.get(l),d={rowNode:n,column:l};if(Fs(c)&&!i){const u=ce(this.beans,d);this.setNodeDataValue(n,l,c.pendingValue,u,t)||r.push(d)}}}}finally{o?.endDeferred()}return r}setNodeDataValue(e,t,s,i,r="edit"){const o=m6.has(r)?"edit":r;i&&(i.suppressRefreshCell=!0),this.committing=!0;try{return e.setDataValue(t,s,o)}finally{this.committing=!1,i&&(i.suppressRefreshCell=!1)}}syncEditAfterCommit(e,t){const s=this.model.getEdit(e);s&&s.state!=="editing"&&(t?this.beans.editModelSvc?.setEdit(e,{sourceValue:s.pendingValue}):this.model.clearEditValue(e))}setEditMap(e,t){this.strategy??(this.strategy=this.createStrategy()),this.strategy?.setEditMap(e,t),this.bulkRefreshMap(e);let s=Ui;t?.forceRefreshOfEditCellsOnly&&(s={...y6(e),...Ui}),this.beans.rowRenderer.refreshCells(s)}dispatchEditValuesChanged({rowNode:e,column:t},s={}){if(!e||!t||!s)return;const{pendingValue:i,sourceValue:r}=s,{rowIndex:o,rowPinned:n,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:o,rowPinned:n,column:t,source:"api",data:a,newValue:i,oldValue:r,value:i,colDef:t.getColDef()})}bulkRefreshCell(e,t){ae(this.gos,this.beans.rowModel)&&this.refCell(e,this.model.getEdit(e),t)}bulkRefreshMap(e,t){ae(this.gos,this.beans.rowModel)&&e.forEach((s,i)=>{for(const r of s.keys())this.refCell({rowNode:i,column:r},s.get(r),t)})}refCell({rowNode:e,column:t},s,i={}){const{beans:r,gos:o}=this,n=new Set([e]),a=new Set,l=e.pinnedSibling;l&&n.add(l);const c=e.sibling;c&&a.add(c);let d=e.parent;for(;d;)d.sibling?.footer&&o.get("groupTotalRow")||!d.parent&&d.sibling&&o.get("grandTotalRow")?a.add(d.sibling):a.add(d),d=d.parent;for(const u of n)this.dispatchEditValuesChanged({rowNode:u,column:t},s);for(const u of n)ce(r,{rowNode:u,column:t})?.refreshCell(i);for(const u of a){const h=ce(r,{rowNode:u,column:t});h&&(h.refreshCell(i),!i.force&&this.batch&&h.editStyleFeature?.applyCellStyles?.())}}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{gos:s,beans:i}=this,r=e.rowNode;if(r.group&&e.column.getColDef().groupRowEditable==null){if(s.get("treeData")){if(!r.data&&!s.get("enableGroupEdit"))return!1}else if(!s.get("enableGroupEdit"))return!1}const o=_b(s)==="fullRow"?c6(i,e,t):Cg(i,e);return o&&(this.strategy??(this.strategy=this.createStrategy())),o}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,s=!0){if(this.hasValidationErrors(e)){const i=ce(this.beans,e);return this.cellEditingInvalidCommitBlocks()?(t?.preventDefault?.(),s&&(i&&!i.hasBrowserFocus()&&i.focusCell(),i?.comp?.getCellEditor()?.focusIn?.()),"block-stop"):(i&&this.revertSingleCellEdit(i),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){const s=ce(this.beans,e);s?.comp?.getCellEditor()&&(zi(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),kr(this.beans,e,{silent:!0}),_i(this.beans),s?.refreshCell(Ui),t&&(s?.focusCell(),s?.comp?.getCellEditor()?.focusIn?.()))}hasValidationErrors(e){_i(this.beans);const t=ce(this.beans,e);t&&(t.refreshCell(Ui),t.rowCtrl.rowEditStyleFeature?.applyRowStyles());let s=!1;return e?.rowNode?(s||(s=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(s||(s=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(s||(s=this.model.getCellValidationModel().getCellValidationMap().size>0),s||(s=this.model.getRowValidationModel().getRowValidationMap().size>0)),s}moveToNextCell(e,t,s,i="ui"){let r;const o=this.isEditing(),n=o&&this.checkNavWithValidation(void 0,s)==="block-stop";return e instanceof yo&&o&&(r=this.strategy?.moveToNextEditingCell(e,t,s,i,n)),r===null||(r=r||!!this.beans.focusSvc.focusedHeader,r===!1&&!n&&this.stopEditing()),r}getPendingEditValue(e,t,s){if(s==="data"||s==="batch"&&!this.batch)return;const i=this.model.getEdit({rowNode:e,column:t},Or);if(!i||this.stopping&&!this.batch&&!i.editorState?.cellStartedEditing)return;if(s==="edit"){const o=i.editorValue;if(o!=null&&o!==st)return o}const r=i.pendingValue;if(r!==st)return r}getCellDataValue(e){const t=this.model.getEdit(e,Or);if(t){const s=t.pendingValue;if(s!==st)return s;const i=t.sourceValue;if(i!=null)return i}return this.valueSvc.getValue(e.column,e.rowNode,"data")}addStopEditingWhenGridLosesFocus(e){v2(this,this.beans,e)}createPopupEditorWrapper(e){return new n6(e)}batchResetToSourceValue(e){if(!this.batch)return!1;const t=this.model.getEdit(e);if(!t)return!1;const{pendingValue:s,sourceValue:i,state:r}=t;return s===i||r==="editing"?!1:(this.dispatchEditValuesChanged(e,{...t,pendingValue:i}),this.beans.editModelSvc?.removeEdits(e),ce(this.beans,e)?.refreshCell(Ui),!0)}setDataValue(e,t,s){try{const i=this.batch,r=this.isEditing(i?void 0:e);if((!r||this.committing)&&!i&&!v6.has(s)||!r&&!i&&s==="paste"||s==="batch"&&!i)return;if(s==="edit"){if(r&&this.applyEditorValue(e,t))return!0;if(!i)return}if(this.strategy??(this.strategy=this.createStrategy()),s==="batch"||s==="edit")return this.applyDirectValue(e,t,s);const o=this.beans;let n;if(i?n="ui":this.committing?n=s??"api":n="api",!s||f6.has(s))return this.applyDirectValue(e,t,s);const a=this.applyExistingEdit(e,t,s,n);return a!==void 0?a:(bo(o,e,t,s,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(e,{source:n,suppressNavigateAfterEdit:!0}),!0)}finally{this.committing=!1}}applyExistingEdit(e,t,s,i){const r=this.model.getEdit(e);if(r)return r.pendingValue===t?!1:r.sourceValue!==t?(bo(this.beans,e,t,s,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0):(this.beans.editModelSvc?.removeEdits(e),this.ensureBatchStarted(),this.dispatchEditValuesChanged(e,{...r,pendingValue:t}),!0)}applyEditorValue(e,t){const s=this.beans,i=ce(s,e),r=i?.comp?.getCellEditor();return!i||!r?!1:(bo(s,e,t,"edit",void 0,{persist:!0}),i.editStyleFeature?.applyCellStyles?.(),"agSetEditValue"in r?(r.agSetEditValue(t),!0):r.refresh&&i.editCompDetails?(r.refresh({...i.editCompDetails.params,value:t}),!0):(i.hasBrowserFocus()&&i.onEditorAttachedFuncs.push(()=>{const n=ce(this.beans,e);n?.focusCell(!0),n?.comp?.getCellEditor()?.focusIn?.()}),zi(s,[e],{silent:!0,cancel:!0}),kr(s,e,{silent:!0}),_i(s),ce(s,e)?.refreshCell(Ui),!0))}applyDirectValue(e,t,s){const i=this.beans;if(this.batch){if(s==="batch"&&ce(i,e)?.comp?.getCellEditor()){const{editModelSvc:n,valueSvc:a}=i,{rowNode:l,column:c}=e;n?.getEdit(e)?.sourceValue===void 0&&n?.setEdit(e,{sourceValue:a.getValue(c,l,"data")}),n?.setEdit(e,{pendingValue:t})}else bo(i,e,t,s,void 0,{persist:!0}),s!=="batch"&&this.cleanupEditors();return Jn(i),this.ensureBatchStarted(),this.bulkRefreshCell(e),!0}bo(i,e,t,s,void 0,{persist:!0});const r=ce(i,e),o=this.setNodeDataValue(e.rowNode,e.column,t,r,s);return this.syncEditAfterCommit(e,o),Jn(i),ce(i,e)?.refreshCell(o?b6:Ui),o}handleColDefChanged(e){x2(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){const{model:s}=this;if(!this.batch||!s.hasRowEdits(e.rowNode,Or))return;const{rowNode:r}=e,{compDetails:o,valueToDisplay:n}=t;if(o){const{params:a}=o;return a.data=s.getEditRowDataValue(r,Or),{compDetails:o}}return{valueToDisplay:n}}cleanupEditors(){this.strategy?.cleanupEditors()}dispatchCellEvent(e,t,s,i){this.strategy?.dispatchCellEvent(e,t,s,i)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return N(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},s){if(!s||s.length===0)return;const{beans:i,rangeSvc:r,valueSvc:o}=this,{formula:n}=i;Hi(i,{persist:!0});const a=this.model.getEditMap(!0);let l=a.get(e)?.get(t)?.pendingValue,c=!1;this.batch||(this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),c=!0);const d=n?.isFormula(l)??!1;s.forEach(h=>{const g=h.columns.some(p=>p?.isAllowFormula());if(r?.forEachRowInRange(h,p=>{const f=Ve(i,p);if(f===void 0)return;const m=a.get(f)??new Map;let C=l;for(const v of h.columns){if(!v)continue;const w=!!d&&v.isAllowFormula();if(this.isCellEditable({rowNode:f,column:v},"api")){const S=o.getValue(v,f,"data",!0);let y=o.parseValue(v,f??null,C,S);Number.isNaN(y)&&(y=null),m.set(v,{editorValue:void 0,pendingValue:y,sourceValue:S,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}w&&(C=n?.updateFormulaByOffset({value:C,columnDelta:1}))}m.size>0&&a.set(f,m),d&&g&&(l=n?.updateFormulaByOffset({value:l,rowDelta:1}))}),this.setEditMap(a),this.batch){this.cleanupEditors(),Jn(i),this.ensureBatchStarted();return}this.committing=!0;try{this.stopEditing(void 0,{source:"bulk"})}finally{this.committing=!1,c&&this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(a)})}});const u=ce(i,{rowNode:e,column:t});u&&u.focusCell(!0)}createCellStyleFeature(e){return new d6(e,this.beans)}createRowStyleFeature(e){return new u6(e,this.beans)}setEditingCells(e,t){const{beans:s}=this,{colModel:i,valueSvc:r}=s,o=new Map;for(let{colId:n,column:a,colKey:l,rowIndex:c,rowPinned:d,newValue:u,state:h}of e){const g=n?i.getCol(n):l?i.getCol(l):a;if(!g)continue;const p=Ve(s,{rowIndex:c,rowPinned:d});if(!p)continue;const f=r.getValue(g,p,"data",!0);if(!t?.forceRefreshOfEditCellsOnly&&!Fs({pendingValue:u,sourceValue:f})&&h!=="editing")continue;let m=o.get(p);m||(m=new Map,o.set(p,m)),u===void 0&&(u=st),m.set(g,{editorValue:void 0,pendingValue:u,sourceValue:f,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(o,t)}onCellFocused(e){const t=ce(this.beans,e);if(!t||!this.isEditing(t,Or))return;const s=this.model.getEdit(t);if(!s||!Fs(s))return;const r=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");this.beans.ariaAnnounce?.announceValue(r,"pendingChange")}allowedFocusTargetOnValidation(e){return ce(this.beans,e)}};function y6(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 _b(e,t){return t??e.get("editType")??"singleCell"}var Wb=class extends E{postConstruct(){this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:this.onCellFocusChanged?.bind(this),cellFocusCleared:this.onCellFocusChanged?.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const s=e.previousParams,{editSvc:i,beans:r}=this,o=e.type==="cellFocused"?e.sourceEvent:null;s&&(t=ce(r,s));const{gos:n,editModelSvc:a}=r,l=e.type==="cellFocusCleared";if(i.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:d,rowPinned:u}=e,h={column:c,rowNode:Ve(r,{rowIndex:d,rowPinned:u})},g=n.get("invalidEditValueMode")==="block";if(g)return;const p=!g,f=!!a?.getCellValidationModel().hasCellValidation(h),m=p&&f;(s||l?i.stopEditing(void 0,{cancel:m,source:l&&p?"api":void 0,event:o}):!0)||(i.isBatchEditing()?i.cleanupEditors():i.stopEditing(void 0,{source:"api"}))}t?.refreshCell({suppressFlash:!0,force:!0})}stopCancelled(e){const t=this.editSvc.isBatchEditing()&&!e;for(const s of this.model.getEditPositions())ea(this.beans,s,{cancel:!0},ce(this.beans,s)),this.model.stop(s,t,!0);return!0}stopCommitted(e,t){const s=this.model.getEditPositions(),i={all:[],pass:[],fail:[]};for(const n of s)i.all.push(n),(this.model.getCellValidationModel().getCellValidation(n)?.errorMessages?.length??0)>0?i.fail.push(n):i.pass.push(n);const r=this.processValidationResults(i),o=this.editSvc.isBatchEditing()&&!t;for(const n of r.destroy)ea(this.beans,n,{event:e},ce(this.beans,n)),this.model.stop(n,o,!1);for(const n of r.keep){const a=ce(this.beans,n);!this.editSvc.cellEditingInvalidCommitBlocks()&&a&&this.editSvc.revertSingleCellEdit(a)}return!0}cleanupEditors({rowNode:e}={},t){Hi(this.beans,{persist:!1});const s=this.model.getEditPositions(),i=[];if(e)for(const r of s)r.rowNode!==e&&i.push(r);else for(const r of s)i.push(r);zi(this.beans,i),Jn(this.beans,t)}setFocusOutOnEditor(e){e.comp?.getCellEditor()?.focusOut?.()}setFocusInOnEditor(e){const t=e.comp,s=t?.getCellEditor();if(s?.focusIn)s.focusIn();else{const i=this.beans.gos.get("editType")==="fullRow";e.focusCell(i),e.onEditorAttachedFuncs.push(()=>t?.getCellEditor()?.focusIn?.())}}setupEditors(e){const{event:t,ignoreEventKey:s=!1,startedEdit:i,position:r,cells:o=this.model.getEditPositions()}=e,n=t instanceof KeyboardEvent&&!s&&t.key||void 0;b2(this.beans,o,r,n,t,i)}dispatchCellEvent(e,t,s,i){const r=ce(this.beans,e);r&&this.eventSvc.dispatchEvent({...r.createEvent(t??null,s),...i})}dispatchRowEvent(e,t,s){if(s)return;const i=oc(this.beans,e);i&&this.eventSvc.dispatchEvent(i.createRowEvent(t))}shouldStop(e,t,s="ui"){const i=this.editSvc.isBatchEditing();return i&&s==="api"?!0:i&&(s==="ui"||s==="edit")?!1:s==="api"?!0:t instanceof KeyboardEvent&&!i?t.key===b.ENTER:null}shouldCancel(e,t,s="ui"){const i=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!i&&t.key===b.ESCAPE||i&&s==="api"||s==="api")}setEditMap(e,t){t?.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const s=[];if(e.forEach((i,r)=>{i.forEach((o,n)=>{o.state==="editing"&&s.push({...o,rowNode:r,column:n})})}),t?.update&&(e=new Map([...this.model.getEditMap(),...e])),this.model?.setEditMap(e),s.length>0){const i=s.at(-1),r=i.pendingValue===st?void 0:i.pendingValue;this.start({position:i,event:new KeyboardEvent("keydown",{key:r}),source:"api"});const o=ce(this.beans,i);o&&this.setFocusInOnEditor(o)}}destroy(){this.cleanupEditors(),super.destroy()}},x6=class extends Wb{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=new Set}shouldStop(e,t,s="ui"){const{rowNode:i,beans:r}=this,{rowNode:o}=e||{};if(!oc(r,{rowNode:i}))return!0;const a=super.shouldStop({rowNode:i},t,s);return a!==null?a:i?o!==i:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:s,startedEdit:i,event:r,ignoreEventKey:o}=e,{rowNode:n}=t,{beans:a,model:l,startedRows:c}=this;this.rowNode!==n&&super.cleanupEditors(t);const d=a.visibleCols.allCols,u=[],h=[];for(const g of d)g.isCellEditable(n)&&h.push(g);if(h.length!=0){c.has(n)||(this.dispatchRowEvent({rowNode:n},"rowEditingStarted",s),c.add(n));for(const g of h){const p={rowNode:n,column:g};u.push(p),l.start(p)}this.rowNode=n,this.setupEditors({cells:u,position:t,startedEdit:i,event:r,ignoreEventKey:o})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stopCancelled(e){const{rowNode:t,model:s}=this;return t&&!s.hasRowEdits(t)?!1:(super.stopCancelled(e),this.cleanupEditors({rowNode:t},!0),this.rowNode=void 0,!0)}stopCommitted(e,t){const{rowNode:s,beans:i,model:r,editSvc:o}=this;if(s&&!r.hasRowEdits(s))return!1;const n=[];if(r.getEditMap().forEach((a,l)=>{if(!(!a||a.size===0)){for(const c of a.values())if(Fs(c)){n.push(l);break}}}),_i(i),o.checkNavWithValidation({rowNode:s})==="block-stop")return!1;if(super.stopCommitted(e,t),t||!o.isBatchEditing())for(const a of n)this.dispatchRowEvent({rowNode:a},"rowValueChanged");return this.cleanupEditors({rowNode:s},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,s=e.previousParams;if(s?.rowIndex===t||e.sourceEvent instanceof KeyboardEvent)return;const{beans:i,gos:r,model:o}=this;if(i.editSvc?.isRangeSelectionEnabledWhileEditing())return;const n=ce(i,s);r.get("invalidEditValueMode")==="block"&&n&&(o.getCellValidationModel().getCellValidation(n)||o.getRowValidationModel().getRowValidation(n))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);const{startedRows:s}=this;for(const i of s)this.dispatchRowEvent({rowNode:i},"rowEditingStopped"),this.destroyEditorsForRow(i);s.clear()}destroyEditorsForRow(e){const t=oc(this.beans,{rowNode:e});if(!t)return;const s={};for(const i of t.getAllCellCtrls())i.comp?.getCellEditor()&&ea(this.beans,i,s,i)}moveToNextEditingCell(e,t,s,i="ui",r=!1){const{beans:o,model:n,gos:a,editSvc:l}=this,c=e.cellPosition;let d;n.suspend(!0);try{d=o.navigation?.findNextCellToFocusOn(c,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{n.suspend(!1)}if(d===!1)return null;if(d==null)return!1;const u=d.cellPosition,h=e.isCellEditable(),g=d.isCellEditable(),p=u&&c.rowIndex===u.rowIndex&&c.rowPinned===u.rowPinned;h&&this.setFocusOutOnEditor(e),this.restoreEditors();const f=a.get("suppressStartEditOnTab");return g&&!r?f?d.focusCell(!0,s):(d.comp?.getCellEditor()||kr(o,d,{event:s,cellStartedEdit:!0}),this.setFocusInOnEditor(d),d.focusCell(!1,s)):(g&&r&&this.setFocusInOnEditor(d),d.focusCell(!0,s)),!p&&!r&&(l?.stopEditing({rowNode:e.rowNode},{event:s,forceStop:!0}),l?.isRowEditing(e.rowNode,{withOpenEditor:!0})&&this.cleanupEditors(d,!0),f?d.focusCell(!0,s):l.startEditing(d,{startedEdit:!0,event:s,source:i,ignoreEventKey:!0,editable:g||void 0})),e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){const{beans:e,model:t}=this;t.getEditMap().forEach((s,i)=>s.forEach(({state:r},o)=>{if(r!=="editing")return;const n=ce(e,{rowNode:i,column:o});n&&!n.comp?.getCellEditor()&&kr(e,n,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.clear()}},R6=class extends Wb{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,s="ui"){const i=super.shouldStop(e,t,s);if(i!==null)return i;const r=e?.rowNode,o=e?.column,n=this.rowNode,a=this.column;return(!n||!a)&&r&&o?null:n!==r||a!==o?!0:!n&&!a?this.model.hasEdits(void 0,{withOpenEditor:!0}):!1}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:s,event:i,ignoreEventKey:r}=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:s,event:i,ignoreEventKey:r})}dispatchRowEvent(e,t,s){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stopCancelled(e){return super.stopCancelled(e),this.clearPosition()}stopCommitted(e,t){return super.stopCommitted(e,t),this.clearPosition()}clearPosition(){return this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:s}=this.beans,{rowIndex:i,column:r,rowPinned:o}=e,n=Ve(this.beans,{rowIndex:i,rowPinned:o}),a=jh(r),l=t.getCol(a),c=e.previousParams;if(c){const d=jh(c.column);if(c?.rowIndex===i&&d===a&&c?.rowPinned===o)return}e.type=="cellFocused"&&(s?.isRangeSelectionEnabledWhileEditing()||s?.isEditing({rowNode:n,column:l},{withOpenEditor:!0}))||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,s,i="ui",r=!1){const o=this.beans.focusSvc.getFocusedCell();o&&(e=ls(this.beans,o)??e);const n=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),r||(e.eGui.focus(),this.editSvc?.stopEditing(e,{source:this.editSvc?.isBatchEditing()?"ui":"api",event:s}));try{a=this.beans.navigation?.findNextCellToFocusOn(n,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,d=e.isCellEditable(),u=a.isCellEditable(),h=c&&n.rowIndex===c.rowIndex&&n.rowPinned===c.rowPinned;d&&!r&&this.setFocusOutOnEditor(e);const g=this.gos.get("suppressStartEditOnTab");let p=!1;if(!h&&!r&&(super.cleanupEditors(a,!0),g?a.focusCell(!0,s):(p=!0,this.editSvc.startEditing(a,{startedEdit:!0,event:s,source:i,ignoreEventKey:!0,editable:u}))),u&&!r){if(a.focusCell(!1,s),g)a.focusCell(!0,s);else if(!a.comp?.getCellEditor()){if(!p){const f=this.editSvc?.isEditing(a,{withOpenEditor:!0});kr(this.beans,a,{event:s,cellStartedEdit:!0,silent:f})}this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else u&&r&&this.setFocusInOnEditor(a),a.focusCell(!0,s);return e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},Es={moduleName:"EditCore",version:H,beans:[C2,S6],apiFunctions:{getEditingCells:QL,getEditRowValues:ZL,getCellEditorInstances:w2,startEditingCell:t6,stopEditing:JL,isEditing:e6,validateEdit:s6},dynamicBeans:{singleCell:R6,fullRow:x6},dependsOn:[$s,mc],css:[yL]},Ub={moduleName:"UndoRedoEdit",version:H,beans:[SL],apiFunctions:{undoCellEditing:YL,redoCellEditing:XL,getCurrentUndoSize:i6,getCurrentRedoSize:r6},dependsOn:[Es]},$b={moduleName:"TextEditor",version:H,userComponents:{agCellEditor:Ob,agTextCellEditor:Ob},dependsOn:[Es]},Kb={moduleName:"NumberEditor",version:H,userComponents:{agNumberCellEditor:{classImp:OL}},dependsOn:[Es]},jb={moduleName:"DateEditor",version:H,userComponents:{agDateCellEditor:PL,agDateStringCellEditor:DL},dependsOn:[Es]},qb={moduleName:"CheckboxEditor",version:H,userComponents:{agCheckboxCellEditor:RL},dependsOn:[Es]},Yb={moduleName:"SelectEditor",version:H,userComponents:{agSelectCellEditor:KL},dependsOn:[Es]},Xb={moduleName:"LargeTextEditor",version:H,userComponents:{agLargeTextCellEditor:kL},dependsOn:[Es]},Zb={moduleName:"CustomEditor",version:H,dependsOn:[Es]},Qb={agSetColumnFilter:"agSetColumnFilterHandler",agMultiColumnFilter:"agMultiColumnFilterHandler",agGroupColumnFilter:"agGroupColumnFilterHandler",agNumberColumnFilter:"agNumberColumnFilterHandler",agBigIntColumnFilter:"agBigIntColumnFilterHandler",agDateColumnFilter:"agDateColumnFilterHandler",agTextColumnFilter:"agTextColumnFilterHandler"},F6=new Set(Object.values(Qb));function $i(e,t){const s=e.filterUi;if(!s)return null;if(s.created)return s.promise;if(t)return null;const i=s.create(s.refreshed),r=s;return r.created=!0,r.promise=i,i}function bc(e,t,s,i,r,o,n){return t.refresh?.({...s,model:i,source:o,additionalEventAttributes:n}),e().then(a=>{if(a){const{filter:l,filterParams:c}=a;ca(l,c,i,r,o,n)}})}function ca(e,t,s,i,r,o){e?.refresh?.({...t,model:s,state:i,source:r,additionalEventAttributes:o})}function Jb(e,t,s,i){const r=e();r?.created&&r.promise.then(o=>{const n=t();ca(o,r.filterParams,n,s()??{model:n},"ui",i)})}function Sc(e){let t,s=!1,i;const{action:r,filterParams:o,getFilterUi:n,getModel:a,getState:l,updateState:c,updateModel:d,processModelToApply:u}=e;switch(r){case"apply":{const h=l();i=h?.model??null,u&&(i=u(i)),t={state:h?.state,model:i},s=!0;break}case"clear":{t={model:null},o?.buttons?.includes("apply")||(s=!0,i=null);break}case"reset":{t={model:null},s=!0,i=null;break}case"cancel":{t={model:a()};break}}c(t),s?d(i):Jb(n,a,l,{fromAction:r})}function We(e,t){return e[t]??null}var E6=class extends Yu{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,s,i,r){this.comp=e;const o=Bn(this,this.beans.context,r);this.eButtonShowMainFilter=s,this.eFloatingFilterBody=i,this.setGui(t,o),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(o),this.setupLeft(o),this.setupHover(o),this.setupFocus(o),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(o),this.setupUi(),o.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(o);const n=()=>this.onColDefChanged(o);o.addManagedListeners(this.column,{colDefChanged:n}),o.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&n()}}),o.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,s=e.colDef;return N(t.gos,{colDef:s,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,s=!!e.floatingFilter;this.active=t&&s}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=_("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new Ii(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();de(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){const{beans:t}=this;if(ie(t)===this.eGui)return;const r=Qe(t,this.eGui,null,e.shiftKey);if(r){t.headerNavigation?.scrollToColumn(this.column),e.preventDefault(),r.focus();return}const o=this.findNextColumnWithFloatingFilter(e.shiftKey);o&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:o},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let s=this.column;do if(s=e?t.getColBefore(s):t.getColAfter(s),!s)break;while(!s.getColDef().filter||!s.getColDef().floatingFilter);return s}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case b.UP:case b.DOWN:case b.LEFT:case b.RIGHT:if(t)return;Ee(e);case b.ENTER:t&&Ge(this.eGui)&&e.preventDefault();break;case b.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const s=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),i=!!e.relatedTarget&&ur(e.relatedTarget,"ag-floating-filter");if(s&&i&&e.target===this.eGui){const r=this.lastFocusEvent,o=!!(r&&r.key===b.TAB);if(r&&o){const n=r.shiftKey;Ge(this.eGui,n)}}this.focusThis()}setupHover(e){this.beans.colHover?.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new ju(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!He(this.gos)}setupUserComp(){if(!this.active)return;const e=this.beans.colFilter?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.beans.menuSvc?.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:s,gos:i}=this,r=o=>{if(o?.source==="filterDestroyed"&&(!this.isAlive()||!t?.isAlive()))return;const n=this.comp.getFloatingFilterComp();n&&n.then(a=>{if(a){if(i.get("enableFilterHandlers")){const d=o;let u="filter";d?.afterFloatingFilter?u="ui":d?.afterDataChange?u="dataChanged":o?.source==="api"&&(u="api"),this.updateFloatingFilterParams(this.userCompDetails,u);return}const l=t?.getCurrentFloatingFilterParentModel(s),c=o?{...o,columns:o.columns??[],source:o.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(s,{filterChanged:r}),t?.isFilterActive(s)&&r(null)}setupWidth(e){const t=()=>{const s=`${this.column.getActualWidth()}px`;this.comp.setWidth(s)};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(){if(!this.suppressFilterButton&&this.comp){const e=!!this.beans.filterManager?.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const s=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const i=this.beans.colFilter,r=this.active?i?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,o=this.comp.getFloatingFilterComp();!o||!r?this.updateCompDetails(e,r,s):o.then(n=>{!n||i?.areFilterCompsDifferent(this.userCompDetails??null,r)?this.updateCompDetails(e,r,s):this.updateFloatingFilterParams(r,"colDef")})}updateCompDetails(e,t,s){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),s&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){if(!e)return;let s=e.params;this.comp.getFloatingFilterComp()?.then(i=>{typeof i?.refresh=="function"&&(this.gos.get("enableFilterHandlers")&&(s={...s,model:We(this.beans.colFilter?.model??{},this.column.getColId()),source:t}),i.refresh(s))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function P6(e,t){const s=e.colModel.getCol(t);if(!s){Q(12,{colKey:t});return}e.menuSvc?.showColumnMenu({column:s,positionBy:"auto"})}function M6(e){e.menuSvc?.hidePopupMenu()}var T6=class extends E{constructor(){super(...arguments),this.beanName="menuSvc"}postConstruct(){const{enterpriseMenuFactory:e,filterMenuFactory:t}=this.beans;this.activeMenuFactory=e??t}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){this.showColumnMenuCommon(eS(this.beans),e,e.containerType,!0)}showHeaderContextMenu(e,t,s){this.activeMenuFactory?.showMenuAfterContextMenuEvent(e,t,s)}hidePopupMenu(){this.beans.contextMenuSvc?.hideActiveMenu(),this.activeMenuFactory?.hideActiveMenu()}hideFilterMenu(){eS(this.beans)?.hideActiveMenu()}isColumnMenuInHeaderEnabled(e){const{suppressHeaderMenuButton:t}=e.getColDef();return!t&&!!this.activeMenuFactory?.isMenuEnabled(e)&&(He(this.gos)||!!this.beans.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&!!this.beans.filterManager?.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!(e&&bs(e)?e.getColDef():e?.getColGroupDef())?.suppressHeaderContextMenu&&this.gos.get("columnMenu")==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(ni()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!He(this.gos)&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return!!this.beans.filterManager?.isFilterAllowed(e)&&!He(this.gos)&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isFloatingFilterButtonEnabled(e){return!e.getColDef().suppressFloatingFilterButton}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos,t=e.get("suppressMenuHide");return He(e)?e.exists("suppressMenuHide")?t:!1:t}showColumnMenuCommon(e,t,s,i){const{positionBy:r,onClosedCallback:o}=t,n=t.column;if(r==="button"){const{buttonElement:a}=t;e?.showMenuAfterButtonClick(n,a,s,o,i)}else if(r==="mouse"){const{mouseEvent:a}=t;e?.showMenuAfterMouseEvent(n,a,s,o,i)}else if(n){const a=this.beans,l=a.ctrlsSvc;l.getScrollFeature().ensureColumnVisible(n,"auto"),Rt(a,()=>{const c=l.getHeaderRowContainerCtrl(n.getPinned())?.getHeaderCtrlForColumn(n);c&&e?.showMenuAfterButtonClick(n,c.getAnchorElementForMenu(i),s,o,i)})}}};function da(e,t,s){e.menuVisible!==t&&(e.menuVisible=t,e.dispatchColEvent("menuVisibleChanged",s))}function eS(e){const{enterpriseMenuFactory:t,filterMenuFactory:s,gos:i}=e;return t&&He(i)?t:s}var wg={moduleName:"SharedMenu",version:H,beans:[T6],apiFunctions:{showColumnMenu:P6,hidePopupMenu:M6}},D6=".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;:where(.ag-set-filter-group-closed-icon),:where(.ag-set-filter-group-indeterminate-icon),:where(.ag-set-filter-group-opened-icon){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{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%}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>:where(.ag-date-floating-filter-wrapper),>:where(.ag-floating-filter-input),>:where(.ag-input-field){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(.ag-input-field-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;gap:var(--ag-widget-vertical-spacing);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:var(--ag-widget-container-vertical-padding);: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 A6(e){const t=e.filterManager;return!!t?.isColumnFilterPresent()||!!t?.isAggregateFilterPresent()}function I6(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)}function k6(e,t){const s=e.colModel.getColDefCol(t);if(s)return e.colFilter?.destroyFilter(s,"api")}function L6(e,t){e.frameworkOverrides.wrapIncoming(()=>e.filterManager?.setFilterModel(t))}function G6(e){return e.filterManager?.getFilterModel()??{}}function O6(e,t,s){const{gos:i,colModel:r,colFilter:o}=e;s&&!i.get("enableFilterHandlers")&&(F(288),s=!1);const n=r.getColDefCol(t);return n?o?.getModelForColumn(n,s)??null:null}function V6(e,t,s){return e.filterManager?.setColumnFilterModel(t,s)??Promise.resolve()}function B6(e,t){const s=e.colModel.getCol(t);if(!s){Q(12,{colKey:t});return}e.menuSvc?.showFilterMenu({column:s,containerType:"columnFilter",positionBy:"auto"})}function N6(e){e.menuSvc?.hideFilterMenu()}function H6(e,t){const s=e.colModel.getCol(t);if(!s){Q(12,{colKey:t});return}return e.colFilter?.getHandler(s,!0)}function z6(e,t){const{colModel:s,colFilter:i,gos:r}=e;if(!r.get("enableFilterHandlers")){F(287);return}const{colId:o,action:n}=t;if(o){const a=s.getColById(o);a&&i?.updateModel(a,n)}else i?.updateAllModels(n)}var tS={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},sS=["january","february","march","april","may","june","july","august","september","october","november","december"];function _6(e,t){return e==null?-1:t==null?1:Number.parseFloat(e)-Number.parseFloat(t)}function W6(e,t){if(e==null)return-1;if(t==null)return 1;const s=et(e),i=et(t);return s!=null&&i!=null?s===i?0:s>i?1:-1:String(e).localeCompare(String(t))}function iS(e){return e instanceof Date&&!isNaN(e.getTime())}var bg={number:()=>{},bigint:()=>{},boolean:()=>({maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>t===!1,numberOfInputs:0}]}),date:()=>({isValidDate:iS}),dateString:({dataTypeDefinition:e})=>({comparator:(t,s)=>{const i=e.dateParser(s);return s==null||it?1:0},isValidDate:t=>typeof t=="string"&&iS(e.dateParser(t))}),dateTime:e=>bg.date(e),dateTimeString:e=>bg.dateString(e),object:()=>{},text:()=>{}},Sg={number:()=>({comparator:_6}),bigint:()=>({comparator:W6}),boolean:({t:e})=>({valueFormatter:t=>D(t.value)?e(String(t.value),t.value?"True":"False"):e("blanks","(Blanks)")}),date:({formatValue:e,t})=>({valueFormatter:s=>{const i=e(s);return D(i)?i:t("blanks","(Blanks)")},treeList:!0,treeListFormatter:(s,i)=>{if(s==="NaN")return t("invalidDate","Invalid Date");if(i===1&&s!=null){const r=sS[Number(s)-1];return t(r,tS[r])}return s??t("blanks","(Blanks)")},treeListPathGetter:s=>Dr(s,!1)}),dateString:({formatValue:e,dataTypeDefinition:t,t:s})=>({valueFormatter:i=>{const r=e(i);return D(r)?r:s("blanks","(Blanks)")},treeList:!0,treeListPathGetter:i=>Dr(t.dateParser(i??void 0),!1),treeListFormatter:(i,r)=>{if(r===1&&i!=null){const o=sS[Number(i)-1];return s(o,tS[o])}return i??s("blanks","(Blanks)")}}),dateTime:e=>{const t=Sg.date(e);return t.treeListPathGetter=Dr,t},dateTimeString(e){const t=e.dataTypeDefinition.dateParser,s=Sg.dateString(e);return s.treeListPathGetter=i=>Dr(t(i??void 0)),s},object:({formatValue:e,t})=>({valueFormatter:s=>{const i=e(s);return D(i)?i:t("blanks","(Blanks)")}}),text:()=>{}};function yc(e,t,s,i,r,o,n){let a=t,l=s;const c=e==="agSetColumnFilter";!l&&i.baseDataType==="object"&&!c&&(l=({column:g,node:p})=>r({column:g,node:p,value:o.valueSvc.getValue(g,p,"data")}));const u=(c?Sg:bg)[i.baseDataType],h=u({dataTypeDefinition:i,formatValue:r,t:n});return a=typeof t=="object"?{...h,...t}:h,{filterParams:a,filterValueGetter:l}}var U6={boolean:"agTextColumnFilter",date:"agDateColumnFilter",dateString:"agDateColumnFilter",dateTime:"agDateColumnFilter",dateTimeString:"agDateColumnFilter",bigint:"agBigIntColumnFilter",number:"agNumberColumnFilter",object:"agTextColumnFilter",text:"agTextColumnFilter"},$6={boolean:"agTextColumnFloatingFilter",date:"agDateColumnFloatingFilter",dateString:"agDateColumnFloatingFilter",dateTime:"agDateColumnFloatingFilter",dateTimeString:"agDateColumnFloatingFilter",bigint:"agBigIntColumnFloatingFilter",number:"agNumberColumnFloatingFilter",object:"agTextColumnFloatingFilter",text:"agTextColumnFloatingFilter"};function xc(e,t=!1){return(t?$6:U6)[e??"text"]}function yg(e,t,s){if(t==null)return null;let i=null;const{compName:r,jsComp:o,fwComp:n}=gC(e,t);return r?i={agSetColumnFilter:"agSetColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",agBigIntColumnFilter:"agBigIntColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[r]:o==null&&n==null&&t.filter===!0&&(i=s()),i}var K6={filterHandler:()=>({doesFilterPass:()=>!0})};function rS(e,t,s,i){if(!e.isPrimary())return!0;const o=!s;return!e.isValueActive()||!o?!1:t?!0:i}var j6=class extends E{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={...Qb},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.addManagedPropertyListener("pivotMode",this.onPivotModeChanged.bind(this));const e=this.gos,t={...e.get("initialState")?.filter?.filterModel??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",s){const{colModel:i,dataTypeSvc:r,filterManager:o}=this.beans;if(r?.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const n=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,d)=>{const u=e[d];n.push(this.setModelOnFilterWrapper(c,u)),l.delete(d)}),l.forEach(c=>{const d=i.getColDefCol(c)||i.getCol(c);if(!d){F(62,{colId:c});return}if(!d.isFilterAllowed()){F(63,{colId:c});return}const u=this.getOrCreateFilterWrapper(d,!0);if(!u){F(64,{colId:c});return}n.push(this.setModelOnFilterWrapper(u,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{n.push(this.setModelOnFilterWrapper(l,null))});$.all(n).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((d,u)=>{const h=a?a[u]:null,g=l?l[u]:null;Ds(h,g)||c.push(d.column)}),c.length>0?o?.onFilterChanged({columns:c,source:t}):s&&this.updateActive("filterChanged")})}getModel(e){const t={},{allColumnFilters:s,initialModel:i,beans:{colModel:r}}=this;if(s.forEach((o,n)=>{const a=this.getModelFromFilterWrapper(o);D(a)&&(t[n]=a)}),!e)for(const o of Object.keys(i)){const n=i[o];D(n)&&!s.has(o)&&r.getCol(o)?.isFilterAllowed()&&(t[o]=n)}return t}setState(e,t,s="api"){if(this.state.clear(),t)for(const i of Object.keys(t)){const r=t[i];this.state.set(i,{model:We(this.model,i),state:r})}this.setModel(e,s,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let s=!1;return e.forEach((i,r)=>{const o=i.state;o!=null&&(s=!0,t[r]=o)}),s?t:void 0}getModelFromFilterWrapper(e){const s=e.column.getColId();if(e.isHandler)return We(this.model,s);const i=e.filter;return i?typeof i.getModel!="function"?(F(66),null):i.getModel():We(this.initialModel,s)}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=l=>l?l.isFilterActive?l.isFilterActive():(F(67),!1):!1,{colModel:t,gos:s}=this.beans,i=!!xi(s),r=[],o=[],n=(l,c,d)=>{c&&(rS(l,t.isPivotMode(),t.isPivotActive(),i)?r.push(d):o.push(d))},a=[];return this.allColumnFilters.forEach(l=>{const c=l.column,d=c.getColId();if(l.isHandler)a.push($.resolve().then(()=>{n(c,this.isHandlerActive(c),{colId:d,isHandler:!0,handler:l.handler,handlerParams:l.handlerParams})}));else{const u=$i(l);u&&a.push(u.then(h=>{n(c,e(h),{colId:d,isHandler:!1,comp:h})}))}}),$.all(a).then(()=>{this.activeAggregateFilters=r,this.activeColumnFilters=o})}updateFilterFlagInColumns(e,t){const s=[];return this.allColumnFilters.forEach(i=>{const r=i.column;if(i.isHandler)s.push($.resolve().then(()=>{this.setColFilterActive(r,this.isHandlerActive(r),e,t)}));else{const o=$i(i);o&&s.push(o.then(n=>{this.setColFilterActive(r,n.isFilterActive(),e,t)}))}}),this.beans.groupFilter?.updateFilterFlags(e,t),$.all(s)}doFiltersPass(e,t,s){const{data:i,aggData:r}=e,o=s?this.activeAggregateFilters:this.activeColumnFilters,n=s?r:i,a=this.model;for(let l=0;l{this.isAlive()&&s?.onFilterChanged(e)};t.isRefreshInProgress()?setTimeout(i,0):i()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:s}=e,i=t?.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",s).then(()=>{this.allColumnFilters.forEach(r=>{const{column:o,isHandler:n}=r;i!==o.getColId()&&(n&&r.handler.onAnyFilterChanged?.(),$i(r,n)?.then(a=>{typeof a?.onAnyFilterChanged=="function"&&a.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(s=>{const i=s.isHandler;i&&s.handler.onNewRowsLoaded?.();const r=$i(s,i);r&&t.push(r.then(o=>{o.onNewRowsLoaded?.()}))}),$.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:s,colModel:i}=this.beans;return(r,o)=>{const n=o?i.getCol(o):e;return n?s.getValue(n,r,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t?.isHandler)return this.isHandlerActive(e);const s=t?.filter;return s?s.isFilterActive():We(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=D(We(this.model,e.getColId()));if(t)return t;const s=this.beans.groupFilter;return s?.isGroupFilter(e)?s.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?$i(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const s=$i(t);return s?s.then(i=>({comp:i,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const s=this.getOrCreateFilterWrapper(e,t);return s?.isHandler?s.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let s=this.cachedFilter(e);return!s&&t&&(s=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,s)),s}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>this.beans.dataTypeSvc?.getBaseDataType(e),t)}getDefaultFilterFromDataType(e,t=!1){return nu(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":xc(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,s,i,r,o){const n=()=>{const c=this.createFilterCompParams(e,r,o),d=i(c,r);return fu(this.beans.userCompFactory,t,d,s)},a=n();return a?{compDetails:a,createFilterUi:c=>(c?n():a).newAgStackInstance()}:null}createFilterInstance(e,t,s,i){const r=this.beans.selectableFilter;r?.isSelectable(t)&&(t=r.getFilterDef(e,t));const{handler:o,handlerParams:n,handlerGenerator:a}=this.createHandler(e,t,s)??{},l=this.createFilterComp(e,t,s,i,!!o,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:o,handlerGenerator:a,handlerParams:n};const{compDetails:c,createFilterUi:d}=l;return this.isGlobalButtons&&(c.params?.buttons?.length||F(281,{colId:e.getColId()})),{compDetails:c,handler:o,handlerGenerator:a,handlerParams:n,createFilterUi:d}}createBaseFilterParams(e,t){const{filterManager:s,rowModel:i}=this.beans;return N(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:r=>s?.doesRowPassOtherFilters(e.getColId(),r)??!0,rowModel:i})}createFilterCompParams(e,t,s,i){const r=this.filterChangedCallbackFactory(e),o=this.createBaseFilterParams(e,i);if(o.filterChangedCallback=r,o.filterModifiedCallback=i?()=>{}:n=>this.filterModified(e,n),t){const n=o,a=e.getColId(),l=We(this.model,a);n.model=l,n.state=this.state.get(a)??{model:l},n.onModelChange=(c,d)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,d).then(()=>{r({...d,source:"columnFilter"})})},n.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},n.onAction=(c,d,u)=>{this.updateModel(e,c,d),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:u})},n.getHandler=()=>this.getHandler(e,!0),n.onUiChange=c=>this.filterUiChanged(e,c),n.source=s}return o}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,s){const i=t(),r={created:!0,create:t,filterParams:e.params,compDetails:e,promise:i};return i.then(s),r}createFilterWrapper(e){const{compDetails:t,handler:s,handlerGenerator:i,handlerParams:r,createFilterUi:o}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),a=>a),n=e.getColId();if(s)return delete this.initialModel[n],s.init?.({...r,source:"init",model:We(this.model,n)}),{column:e,isHandler:!0,handler:s,handlerGenerator:i,handlerParams:r,filterUi:this.createFilterUiForHandler(t,o)};if(o){const a={column:e,filterUi:null,isHandler:!1};return a.filterUi=this.createFilterUiLegacy(t,o,l=>{a.filter=l??void 0}),a}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,s){const{gos:i,frameworkOverrides:r,registry:o}=this.beans;let n;const a=g=>{const p=g.filter;if(cC(p)){const f=p.handler;return f||(n=p.doesFilterPass,n?()=>({doesFilterPass:n}):void 0)}return typeof p=="string"?p:void 0},l=i.get("enableFilterHandlers"),c=l?a(t):void 0,d=g=>()=>this.createBean(o.createDynamicBean(g,!0));let u,h;if(typeof c=="string"){const g=i.get("filterHandlers")?.[c];g!=null?u=g:F6.has(c)&&(u=d(c),h=c)}else u=c;if(!u){let g;const{compName:p,jsComp:f,fwComp:m}=gC(r,t);p?g=p:f==null&&m==null&&t.filter===!0&&(g=s),h=this.handlerMap[g],h&&(u=d(h))}return u?{filterHandler:u,handlerNameOrCallback:n??h}:l?(ae(i)&&F(277,{colId:e.getColId()}),K6):void 0}createHandler(e,t,s){const i=this.createHandlerFunc(e,t,s);if(!i)return;const r=Cu(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:o,filterHandler:n}=i,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,n,r);return{handler:a,handlerParams:l,handlerGenerator:o??n}}createHandlerFromFunc(e,t,s){const i=e.getColDef(),r=t(N(this.gos,{column:e,colDef:i})),o=this.createHandlerParams(e,s);return{handler:r,handlerParams:o}}createHandlerParams(e,t){const s=e.getColDef(),i=e.getColId(),r=this.filterChangedCallbackFactory(e);return N(this.gos,{colDef:s,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:o=>this.beans.filterManager?.doesRowPassOtherFilters(i,o)??!0,onModelChange:(o,n)=>{this.updateStoredModel(i,o),this.refreshHandlerAndUi(e,o,"handler",!1,n).then(()=>{r({...n,source:"columnFilter"})})},onModelAsStringChange:()=>{e.dispatchColEvent("filterChanged","filterChanged"),this.dispatchLocalEvent({type:"filterModelAsStringChanged",column:e})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:s,groupFilter:i}=this.beans;this.allColumnFilters.forEach((o,n)=>{let a;o.column.isPrimary()?a=t.getColDefCol(n):a=t.getCol(n),!(a&&a===o.column)&&(e.push(o.column),this.disposeFilterWrapper(o,"columnChanged"),this.disposeColumnListener(n))});const r=i&&e.every(o=>i.isGroupFilter(o));e.length>0&&!r&&s?.onFilterChanged({columns:e,source:"api"})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const s=this.beans.groupFilter;return s?.isGroupFilter(e)?s.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:s,frameworkOverrides:i,selectableFilter:r,gos:o}=this.beans,n=g=>{this.getOrCreateFilterUi(e)?.then(f=>{g(Us(f))})},a=e.getColDef(),l=r?.isSelectable(a)?r.getFilterDef(e,a):a,c=yg(i,l,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",d=o.get("enableFilterHandlers"),u=Cu(s,l,this.createFilterCompParams(e,d,"init",!0)),h=N(o,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:n,showParentFilter:t});if(d){const g=h,p=e.getColId(),f=this.filterChangedCallbackFactory(e);g.onUiChange=m=>this.floatingFilterUiChanged(e,m),g.model=We(this.model,p),g.onModelChange=(m,C)=>{this.updateStoredModel(p,m),this.refreshHandlerAndUi(e,m,"floating",!0,C).then(()=>{f({...C,source:"columnFilter"})})},g.getHandler=()=>this.getHandler(e,!0),g.source="init"}return mu(s,a,h,c)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,s,i){const r="paramsUpdated";if(e.isHandler){const o=t.getColId();delete this.initialModel[o],this.state.delete(o);const n=e.filterUi,a=this.createFilterUiForHandler(s,i);e.filterUi=a;const l=this.eventSvc;n?.created?n.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:r,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:r,column:t})}else this.destroyFilter(t,r)}destroyFilter(e,t="api"){const s=e.getColId(),i=this.allColumnFilters.get(s);this.disposeColumnListener(s),delete this.initialModel[s],i&&this.disposeFilterWrapper(i,t).then(r=>{r&&this.isAlive()&&this.beans.filterManager?.onFilterChanged({columns:[e],source:"api"})})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let s=!1;const{column:i,isHandler:r,filterUi:o}=e,n=i.getColId();r&&(s=this.isHandlerActive(i),this.destroyBean(e.handler),delete this.model[n],this.state.delete(n));const a=()=>{this.setColFilterActive(i,!1,"filterDestroyed"),this.allColumnFilters.delete(n),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:i})};if(o){if(o.created)return o.promise.then(l=>(s=r?s:!!l?.isFilterActive(),this.destroyBean(l),a(),s));a()}return $.resolve(s)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:t?.source??"columnFilter"})}}filterParamsChanged(e,t="api"){const s=this.allColumnFilters.get(e);if(!s)return;const i=this.beans,r=s.column,o=r.getColDef(),n=r.isFilterAllowed(),a=this.getDefaultFilter(r),l=i.selectableFilter,c=l?.isSelectable(o)?l.getFilterDef(r,o):o,d=n?this.createHandlerFunc(r,c,this.getDefaultFilter(r)):void 0,u=!!d,h=s.isHandler;if(h!=u){this.destroyFilter(r,"paramsUpdated");return}const{compDetails:g,createFilterUi:p}=(n?this.createFilterComp(r,c,a,m=>m,u,"colDef"):null)??{compDetails:null,createFilterUi:null},f=g?.params??Cu(i.userCompFactory,c,this.createFilterCompParams(r,u,"colDef"));if(h){const m=d?.handlerNameOrCallback??d?.filterHandler,C=We(this.model,e);if(s.handlerGenerator!=m){const v=s.handler,{handler:w,handlerParams:S}=this.createHandlerFromFunc(r,d.filterHandler,f);s.handler=w,s.handlerParams=S,s.handlerGenerator=m,delete this.model[e],w.init?.({...S,source:"init",model:null}),this.destroyBean(v),C!=null&&this.beans.filterManager?.onFilterChanged({columns:[r],source:t})}else{const v=this.createHandlerParams(r,g?.params);s.handlerParams=v,s.handler.refresh?.({...v,source:"colDef",model:C})}}if(this.areFilterCompsDifferent(s.filterUi?.compDetails??null,g)||!s.filterUi||!g){this.destroyFilterUi(s,r,g,p);return}s.filterUi.filterParams=f,$i(s,h)?.then(m=>{(m?.refresh?m.refresh(f):!0)===!1?this.destroyFilterUi(s,r,g,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:r,params:f})})}refreshHandlerAndUi(e,t,s,i,r){const o=this.cachedFilter(e);if(!o)return i&&this.getOrCreateFilterWrapper(e,!0),$.resolve();if(!o.isHandler)return $.resolve();const{filterUi:n,handler:a,handlerParams:l}=o;return bc(()=>{if(n){const{created:c,filterParams:d}=n;if(c)return n.promise.then(u=>u?{filter:u,filterParams:d}:void 0);n.refreshed=!0}return $.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},s,r)}setColumnFilterWrapper(e,t){const s=e.getColId();this.allColumnFilters.set(s,t),this.allColumnListeners.set(s,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(s)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:s}=e,{componentClass:i}=t;return!(s===i||s?.render&&i?.render&&s.render===i.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 s=this.getOrCreateFilterUi(t);return s?new Promise(i=>{s.then(r=>{i(Us(r))})}):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:s})=>{this.setModelForColumn(e,t).then(()=>s())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:i,model:r}=this,o=e.getColId(),n=i.get(o);return n?n.model??null:We(r,o)}const s=this.cachedFilter(e);return s?this.getModelFromFilterWrapper(s):null}setModelForColumn(e,t){if(this.beans.dataTypeSvc?.isPendingInference){let s=()=>{};const i=new Promise(r=>{s=r});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),i}return new Promise(s=>{this.setModelForColumnLegacy(e,t).then(i=>s(i))})}getStateForColumn(e){return this.state.get(e)??{model:We(this.model,e)}}setModelForColumnLegacy(e,t){const s=this.beans.colModel.getColDefCol(e),i=s?this.getOrCreateFilterWrapper(s,!0):null;return i?this.setModelOnFilterWrapper(i,t):$.resolve()}setColDefPropsForDataType(e,t,s){const i=e.filter,r=i===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):i;if(typeof r!="string")return;let o,n;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;r==="agMultiColumnFilter"?{filterParams:o,filterValueGetter:n}=a.multiFilter?.getParamsForDataType(l,c,t,s)??{}:{filterParams:o,filterValueGetter:n}=yc(r,l,c,t,s,a,this.getLocaleTextFunc()),e.filterParams=o,n&&(e.filterValueGetter=n)}setColFilterActive(e,t,s,i){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",s)),e.dispatchColEvent("filterChanged",s,i)}setModelOnFilterWrapper(e,t,s){return new $(i=>{if(e.isHandler){const o=e.column,n=o.getColId(),a=this.model[n];if(this.updateStoredModel(n,t),s&&t===a){i();return}this.refreshHandlerAndUi(o,t,"api").then(()=>i());return}const r=$i(e);if(r){r.then(o=>{if(typeof o?.setModel!="function"){F(65),i();return}(o.setModel(t)||$.resolve()).then(()=>i())});return}i()})}updateStoredModel(e,t){D(t)?this.model[e]=t:delete this.model[e];const s=this.state.get(e),i={model:t,state:s?.state};this.state.set(e,i)}filterModified(e,t){this.getOrCreateFilterUi(e)?.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,s){const i=e.getColId(),r=this.cachedFilter(e),o=()=>r?.filterUi;Sc({action:t,filterParams:r?.filterUi?.filterParams,getFilterUi:o,getModel:()=>We(this.model,i),getState:()=>this.state.get(i),updateState:n=>this.updateState(e,n),updateModel:n=>o()?.filterParams?.onModelChange(n,{...s,fromAction:t}),processModelToApply:r?.isHandler?r.handler.processModelToApply?.bind(r.handler):void 0})}updateAllModels(e,t){const s=[];this.allColumnFilters.forEach((i,r)=>{const o=this.beans.colModel.getColDefCol(r);o&&Sc({action:e,filterParams:i.filterUi?.filterParams,getFilterUi:()=>i.filterUi,getModel:()=>We(this.model,r),getState:()=>this.state.get(r),updateState:n=>this.updateState(o,n),updateModel:n=>{this.updateStoredModel(r,n),this.dispatchLocalEvent({type:"filterAction",column:o,action:e}),s.push(this.refreshHandlerAndUi(o,n,"ui"))},processModelToApply:i?.isHandler?i.handler.processModelToApply?.bind(i.handler):void 0})}),s.length&&$.all(s).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();Jb(()=>this.cachedFilter(e)?.filterUi,()=>We(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:s}=this;for(const r of s)if(r.source==="COLUMN_MENU")return!1;let i=!1;for(const r of e.keys()){const o=e.get(r);if(o.valid===!1)return!1;(o.model??null)!==We(t,r)&&(i=!0)}return i}hasUnappliedModel(e){const{model:t,state:s}=this;return(s.get(e)?.model??null)!==We(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const s=this.beans.filterPanelSvc;return s?.isActive?!!s.getState(e.getColId()):!1}onPivotModeChanged(e){const{colModel:t,pivotColsSvc:s}=this.beans,i=!!xi(this.gos),r=e.currentValue,o=r?this.activeColumnFilters:this.activeAggregateFilters,n=r?this.activeAggregateFilters:this.activeColumnFilters,a=[];for(const l of o){const c=t.getColById(l.colId),d=r&&!!s?.columns.length;c&&r===rS(c,r,d,i)&&(n.push(l),a.push(l))}za(o,a)}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function q6(e){return!!e.filterManager?.isAnyFilterPresent()}function Y6(e,t="api"){e.filterManager?.onFilterChanged({source:t})}var X6=class extends E{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:i})=>this.onAdvFilterEnabledChanged(i),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:s}=this;this.alwaysPassFilter=s.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=s.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,s="api"){this.isAdvFilterEnabled()||this.colFilter?.setState(e,t,s)}setFilterModel(e,t="api",s){if(this.isAdvFilterEnabled()){s||this.warnAdvFilters();return}this.colFilter?.setModel(e,t)}getFilterModel(){return this.colFilter?.getModel()??{}}getFilterState(){return this.colFilter?.getState()}isColumnFilterPresent(){return!!this.colFilter?.isFilterPresent()}isAggregateFilterPresent(){return!!this.colFilter?.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){e?this.colFilter?.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):this.advancedFilter?.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){return!!this.advancedFilter?.isEnabled()}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){xi(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:s,columns:i=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):$.resolve()).then(()=>{const r={source:t,type:"filterChanged",columns:i};s&&Oe(r,s),this.eventSvc.dispatchEvent(r),this.colFilter?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.colFilter?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilter?.isFilterPresent()}updateAggFiltering(){this.aggFiltering=!!xi(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){const{rowNode:t}=e;return this.alwaysPassFilter?.(t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){const{rowNode:t}=e;return this.alwaysPassFilter?.(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){return this.isAdvFilterEnabled()?!1:!!this.colFilter?.isFilterAllowed(e)}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){if(this.isAdvFilterEnabled()){if(this.beans.dataTypeSvc?.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(){return this.isAdvFilterEnabled()?!1:!!this.colFilter?.hasFloatingFilters()}getColumnFilterInstance(e){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):this.colFilter?.getFilterInstance(e)??Promise.resolve(void 0)}warnAdvFilters(){F(68)}setupAdvFilterHeaderComp(e){this.advancedFilter?.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){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):this.colFilter?.setModelForColumn(e,t)??Promise.resolve()}};function Z6(e){return{tag:"div",cls:e}}var Mo=class extends A{constructor(e){const{className:t="ag-filter-apply-panel"}=e??{};super(Z6(t)),this.listeners=[],this.validationMessage=null,this.className=t}updateButtons(e,t){const s=this.buttons;if(this.buttons=e,s===e)return;const i=this.getGui();ee(i);let r;this.destroyListeners();const o=document.createDocumentFragment(),n=this.className,a=({type:c,label:d})=>{const u=C=>{this.dispatchLocalEvent({type:c,event:C})};["apply","clear","reset","cancel"].includes(c)||F(75);const h=c==="apply",p=re({tag:"button",attrs:{type:h&&t?"submit":"button"},ref:`${c}FilterButton`,cls:`ag-button ag-standard-button ${n}-button${h?" "+n+"-apply-button":""}`,children:d});this.activateTabIndex([p]),h&&(r=p);const f=C=>{C.key===b.ENTER&&(C.preventDefault(),u(C))},m=this.listeners;p.addEventListener("click",u),m.push(()=>p.removeEventListener("click",u)),p.addEventListener("keydown",f),m.push(()=>p.removeEventListener("keydown",f)),o.append(p)};for(const c of e)a(c);this.eApply=r;const l=this.validationTooltipFeature;r&&!l?this.validationTooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eApply,getLocation:()=>"advancedFilter",getTooltipShowDelayOverride:()=>1e3})):!r&&l&&(this.validationTooltipFeature=this.destroyBean(l)),i.append(o)}getApplyButton(){return this.eApply}updateValidity(e,t=null){const s=this.eApply;s&&(wi(s,!e),this.validationMessage=t,this.validationTooltipFeature?.setTooltipAndRefresh(this.validationMessage))}destroyListeners(){for(const e of this.listeners)e();this.listeners=[]}destroy(){this.destroyListeners(),super.destroy()}},oS={selector:"AG-FILTER-BUTTON",component:Mo},xg=class extends A{constructor(e,t,s,i,r,o){super(),this.column=e,this.wrapper=t,this.eventParent=s,this.updateModel=i,this.isGlobalButtons=r,this.enableGlobalButtonCheck=o,this.hidePopup=null,this.applyActive=!1}postConstruct(){const{comp:e,params:t}=this.wrapper,s=t,i=s.useForm,r=i?"form":"div";this.setTemplate({tag:r,cls:"ag-filter-wrapper"}),i&&this.addManagedElementListeners(this.getGui(),{submit:o=>{o?.preventDefault()},keydown:this.handleKeyDown.bind(this)}),this.appendChild(e.getGui()),this.params=s,this.resetButtonsPanel(s),this.addManagedListeners(this.eventParent,{filterParamsChanged:({column:o,params:n})=>{o===this.column&&this.resetButtonsPanel(n,this.params)},filterStateChanged:({column:o,state:n})=>{o===this.column&&this.eButtons?.updateValidity(n.valid!==!1)},filterAction:({column:o,action:n,event:a})=>{o===this.column&&this.afterAction(n,a)},...this.enableGlobalButtonCheck?{filterGlobalButtons:({isGlobal:o})=>{if(o!==this.isGlobalButtons){this.isGlobalButtons=o;const n=this.params;this.resetButtonsPanel(n,n,!0)}}}:void 0})}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup)}resetButtonsPanel(e,t,s){const{buttons:i,readOnly:r}=t??{},{buttons:o,readOnly:n,useForm:a}=e;if(!s&&r===n&&Ds(i,o))return;const l=o&&o.length>0&&!e.readOnly&&!this.isGlobalButtons;let c=this.eButtons;if(l){const d=o.map(u=>{const h=`${u}Filter`;return{type:u,label:jt(this,h)}});if(this.applyActive=lo(this.params),!c){c=this.createBean(new Mo),this.appendChild(c.getGui());const u=this.column,h=g=>({event:p})=>{this.updateModel(u,g,{fromButtons:!0}),this.afterAction(g,p)};c?.addManagedListeners(c,{apply:h("apply"),clear:h("clear"),reset:h("reset"),cancel:h("cancel")}),this.eButtons=c}c.updateButtons(d,a)}else this.applyActive=!1,c&&(ue(c.getGui()),this.eButtons=this.destroyBean(c))}close(e){const t=this.hidePopup;if(!t)return;const s=e,i=s?.key;let r;(i===b.ENTER||i===b.SPACE)&&(r={keyboardEvent:s}),t(r),this.hidePopup=null}afterAction(e,t){const{params:s,applyActive:i}=this,r=s?.closeOnApply;switch(e){case"apply":{t?.preventDefault(),r&&i&&this.close(t);break}case"reset":{r&&i&&this.close();break}case"cancel":{r&&this.close(t);break}}}handleKeyDown(e){!e.defaultPrevented&&e.key===b.ENTER&&this.applyActive&&(this.updateModel(this.column,"apply",{fromButtons:!0}),this.afterAction("apply",e))}destroy(){this.hidePopup=null,this.eButtons=this.destroyBean(this.eButtons)}},Q6=":where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}",J6={tag:"div",cls:"ag-filter"},To=class extends A{constructor(e,t,s){super(J6),this.column=e,this.source=t,this.enableGlobalButtonCheck=s,this.wrapper=null}postConstruct(){this.beans.colFilter?.activeFilterComps.add(this),this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return this.wrapper!=null}getFilter(){return this.wrapper?.then(e=>e.comp)??null}afterInit(){return this.wrapper?.then(()=>{})??$.resolve()}afterGuiAttached(e){this.afterGuiAttachedParams=e,this.wrapper?.then(t=>{this.comp?.afterGuiAttached(e),t?.comp?.afterGuiAttached?.(e)})}afterGuiDetached(){this.wrapper?.then(e=>{e?.comp?.afterGuiDetached?.()})}createFilter(e){const{column:t,source:s,beans:{colFilter:i}}=this,r=i.getFilterUiForDisplay(t)??null;this.wrapper=r,r?.then(o=>{if(!o)return;const{isHandler:n,comp:a}=o;let l;if(n){const c=!!this.enableGlobalButtonCheck,d=this.createBean(new xg(t,o,i,i.updateModel.bind(i),c&&i.isGlobalButtons,c));this.comp=d,l=d.getGui()}else this.registerCSS(Q6),l=a.getGui(),D(l)||F(69,{guiFromFilter:l});this.appendChild(l),e?this.eventSvc.dispatchEvent({type:"filterOpened",column:t,source:s,eGui:this.getGui()}):a.afterGuiAttached?.(this.afterGuiAttachedParams)})}onFilterDestroyed(e){const{source:t,column:s}=e;(t==="api"||t==="paramsUpdated")&&s.getId()===this.column.getId()&&this.beans.colModel.getColDefCol(this.column)&&(ee(this.getGui()),this.comp=this.destroyBean(this.comp),this.createFilter())}destroy(){this.beans.colFilter?.activeFilterComps.delete(this),this.eventSvc.dispatchEvent({type:"filterClosed",column:this.column}),this.wrapper=null,this.comp=this.destroyBean(this.comp),this.afterGuiAttachedParams=void 0,super.destroy()}},eG=class extends E{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){this.hidePopup?.()}showMenuAfterMouseEvent(e,t,s,i){e&&!e.isColumn||this.showPopup(e,r=>{this.popupSvc?.positionPopupUnderMouseEvent({additionalParams:{column:e},type:s,mouseEvent:t,ePopup:r})},s,t.target,He(this.gos),i)}showMenuAfterButtonClick(e,t,s,i){if(e&&!e.isColumn)return;let r=-1,o="left";const n=He(this.gos);!n&&this.gos.get("enableRtl")&&(r=1,o="right");const a=n?void 0:4*r,l=n?void 0:4;this.showPopup(e,c=>{this.popupSvc?.positionPopupByComponent({type:s,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:o,keepWithinBounds:!0,position:"under",additionalParams:{column:e}})},s,t,n,i)}showPopup(e,t,s,i,r,o){const n=e?this.createBean(new To(e,"COLUMN_MENU")):void 0;if(this.activeMenu=n,!n?.hasFilter()||!e){Q(57);return}const a=re({tag:"div",cls:`ag-menu${r?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:f=>this.trapFocusWithin(f,a)}),a.appendChild(n?.getGui());let l;const c=()=>n?.afterGuiDetached(),d=au(this.gos)?i??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,u=f=>{da(e,!1,"contextMenu");const m=f instanceof KeyboardEvent;this.tabListener&&(this.tabListener=this.tabListener()),m&&i&&Ne(i)&&Fl(i)?.focus({preventScroll:!0}),c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,s,e),o?.()},h=this.getLocaleTextFunc(),g=r&&s!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=this.popupSvc?.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:u,positionCallback:()=>t(a),anchorToElement:d,ariaLabel:g});p&&(this.hidePopup=l=p.hideFunc),n.afterInit().then(()=>{t(a),n.afterGuiAttached({container:s,hidePopup:l})}),da(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,s,e)}trapFocusWithin(e,t){e.key!==b.TAB||e.defaultPrevented||Qe(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),Ge(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,s){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:s??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},tG=class extends E{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,s){if(!t)return;const i=e.getColDef(),{selectableFilter:r,valueSvc:o,formula:n}=this.beans,a=s??r?.getFilterValueGetter(e.getColId())??i.filterValueGetter;if(a)return this.executeFilterValueGetter(a,t.data,e,t,i);const l=o.getValue(e,t,"data");return e.isAllowFormula()&&n?.isFormula(l)?n.resolveValue(e,t):l}executeFilterValueGetter(e,t,s,i,r){const{expressionSvc:o,valueSvc:n}=this.beans,a=N(this.gos,{data:t,node:i,column:s,colDef:r,getValue:n.getValueCallback.bind(n,i)});return typeof e=="function"?e(a):o?.evaluate(e,a)}},sG={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},iG=class extends A{constructor(){super(sG,[Vt]),this.eFloatingFilterText=x}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 s=e,i=s.getHandler();if(i.getModelAsString){const r=i.getModelAsString(s.model);this.eFloatingFilterText.setValue(r)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const s=t.getModelAsString(e);this.eFloatingFilterText.setValue(s)}})}refresh(e){this.init(e)}},Rg=class extends Vi{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){const t=this.eInput;e.selected&&e.name&&t.name&&t.name===e.name&&e.id&&t.id!==e.id&&this.setValue(!1,!0)}},rG={selector:"AG-RADIO-BUTTON",component:Rg},Fg=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const s=e.filterOptions??t;this.filterOptions!==s&&(this.filterOptions=s,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 s=[["displayKey"],["displayName"],["predicate","test"]],i=r=>r.some(o=>t[o]!=null)?!0:(F(72,{keys:r}),!1);if(!s.every(i)){this.filterOptions=e.filter(r=>r===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const s=t[0];if(typeof s=="string")return s;if(s.displayKey)return s.displayKey;F(73)}else F(74)}getCustomOption(e){return this.customFilterOptions[e]}};function ua(e,t,s){return s==null?e.splice(t):e.splice(t,s)}function Rc(e){return e==null||typeof e=="string"&&e.trim().length===0}function oG(e){return e==="AND"||e==="OR"?e:"AND"}function nG(e,t,s){if(e==null)return;const{predicate:i}=e;if(i!=null&&!t.some(r=>r==null))return i(t,s)}function aG(e,t){let s=e.length;return s>t&&(e.splice(t),F(78),s=t),s}var lG=new Set(["empty","notBlank","blank","today","yesterday","tomorrow","thisWeek","lastWeek","nextWeek","thisMonth","lastMonth","nextMonth","thisQuarter","lastQuarter","nextQuarter","thisYear","lastYear","nextYear","yearToDate","last7Days","last30Days","last90Days","last6Months","last12Months","last24Months"]);function Ki(e,t){const s=t.getCustomOption(e);if(s){const{numberOfInputs:i}=s;return i??1}return e&&lG.has(e)?0:e==="inRange"?2:1}var Fc=class extends An{constructor(e,t,s){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=s,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 Fg;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=oG(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions(),nt(this.getGui(),"tabindex",this.isReadOnly()?"-1":null)}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,s)=>{const i=s===0?e:this.optionsFactory.defaultOption;t.setValue(i,!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 s=!e.operator,i=!t.operator;if(!s&&i||s&&!i)return!1;let o;if(s){const n=e,a=t;o=this.areSimpleModelsEqual(n,a)}else{const n=e,a=t;o=n.operator===a.operator&&be(n.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return o}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),$.resolve();if(e.operator){const i=e;let r=i.conditions;r==null&&(r=[],F(77));const o=aG(r,this.maxNumConditions),n=this.getNumConditions();if(on)for(let l=n;ll.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),r.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const i=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(i.type,!0),this.setConditionIntoUi(i,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),$.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(F(79),t=1),this.maxNumConditions=t;let s=e.numAlwaysVisibleConditions??1;s<1&&(F(80),s=1),s>t&&(F(81),s=t),this.numAlwaysVisibleConditions=s}createOption(){const e=this.getGui(),t=this.createManagedBean(new Ct);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const s=this.createEValue();this.eConditionBodies.push(s),e.appendChild(s),this.putOptionsIntoDropdown(t),this.resetType(t);const i=this.getNumConditions()-1;this.forEachPositionInput(i,r=>this.resetInput(r)),this.addChangedListeners(t,i)}createJoinOperatorPanel(){const e=re({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),s=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const i=this.eJoinPanels.length-1,r=this.joinOperatorId++;this.resetJoinOperatorAnd(t,i,r),this.resetJoinOperatorOr(s,i,r),this.isReadOnly()||(t.onValueChange(this.listener),s.onValueChange(this.listener))}createJoinOperator(e,t,s){const i=this.createManagedBean(new Rg);e.push(i);const r="ag-filter-condition-operator";return i.addCss(r),i.addCss(`${r}-${s}`),t.appendChild(i.getGui()),i}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 s of t)e.addOption(s);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,s=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:s?this.getLocaleTextFunc()(s.displayKey,s.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 s=0;s0&&this.removeConditionsAndOperators(i,r),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((i,r)=>{const o=this.isConditionDisabled(r,e);i.setDisabled(o||this.filterListOptions.length<=1),r===1&&(wi(this.eJoinPanels[0],o),this.eJoinAnds[0].setDisabled(o),this.eJoinOrs[0].setDisabled(o))}),this.eConditionBodies.forEach((i,r)=>{V(i,this.isConditionBodyVisible(r))});const s=(t??this.getJoinOperator())==="OR";for(const i of this.eJoinAnds)i.setValue(!s,!0);for(const i of this.eJoinOrs)i.setValue(s,!0);this.forEachInput((i,r,o,n)=>{this.setElementDisplayed(i,r=this.getNumConditions())return;const{eTypes:s,eConditionBodies:i,eJoinPanels:r,eJoinAnds:o,eJoinOrs:n}=this;this.removeComponents(s,e,t),this.removeElements(i,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(r,a,t),this.removeComponents(o,a,t),this.removeComponents(n,a,t)}removeElements(e,t,s){const i=ua(e,t,s);for(const r of i)ue(r)}removeComponents(e,t,s){const i=ua(e,t,s);for(const r of i)ue(r.getGui()),this.destroyBean(r)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus){let t;if(!this.isReadOnly()){const s=this.getInputs(0)[0];s instanceof li&&this.isConditionBodyVisible(0)?t=s.getInputElement():t=this.eTypes[0]?.getFocusableElement()}(t??this.getGui()).focus({preventScroll:!0})}}shouldKeepInvalidInputState(){return!1}afterGuiDetached(){super.afterGuiDetached();const e=this.params;if(this.beans.colFilter?.shouldKeepStateOnDetach(e.column)||this.shouldKeepInvalidInputState())return;e.onStateChange({model:e.model});let t=-1,s=-1,i=!1;const r=this.getJoinOperator();for(let n=this.getNumConditions()-1;n>=0;n--)if(this.isConditionUiComplete(n))t===-1&&(t=n,s=n);else{const a=n>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(n-1),l=n{if(!(i instanceof li))return;const a=r===0&&n>1?"inRangeStart":r===0?"filterOoo":"inRangeEnd",l=r===0&&n>1?e("ariaFilterFromValue","Filter from value"):r===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value"),c=s[o].getValue(),d=SC(this,t,a,c);i.setInputPlaceholder(d),i.setInputAriaLabel(l)})}setElementValue(e,t,s){e instanceof li&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){ao(e)&&V(e.getGui(),t)}setElementDisabled(e,t){ao(e)&&wi(e.getGui(),t)}attachElementOnChange(e,t){e instanceof li&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,s)=>{this.forEachPositionTypeInput(s,t,e)})}forEachPositionInput(e,t){const s=this.getConditionType(e);this.forEachPositionTypeInput(e,s,t)}forEachPositionTypeInput(e,t,s){const i=Ki(t,this.optionsFactory),r=this.getInputs(e);for(let o=0;ot+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return Ki(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(s=>s==null)||this.positionHasInvalidInputs(e))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;tthis.resetType(t)),this.eJoinAnds.forEach((t,s)=>this.resetJoinOperatorAnd(t,s,this.joinOperatorId+s)),this.eJoinOrs.forEach((t,s)=>this.resetJoinOperatorOr(t,s,this.joinOperatorId+s)),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 s=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(s).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,s){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),s)}resetJoinOperatorOr(e,t,s){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),s)}resetJoinOperator(e,t,s,i,r){this.updateJoinOperatorDisabled(e.setValue(s,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${r}`).setLabel(i),t)}updateJoinOperatorsDisabled(){const e=(t,s)=>this.updateJoinOperatorDisabled(t,s);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 s=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((i,r,o)=>{o===t&&this.setElementValue(i,s[r]!=null?s[r]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,s,i)=>{this.setElementValue(t,s===0&&i===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,s=>{this.attachElementOnChange(s,this.listener)}))}hasInvalidInputs(){return!1}positionHasInvalidInputs(e){return!1}isReadOnly(){return!!this.params.readOnly}},Eg=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function Pg(e){return e?.allowedCharPattern??null}function nS(e,t){const{filter:s,filterTo:i,type:r}=e||{};return[et(s),et(i)].slice(0,Ki(r,t))}var cG=class extends Fc{constructor(){super("bigintFilter",nS,Eg),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="bigint",this.defaultDebounceMs=500}afterGuiAttached(e){super.afterGuiAttached(e),this.refreshInputValidation()}shouldKeepInvalidInputState(){return!Di()&&this.hasInvalidInputs()&&this.getConditionTypes().includes("inRange")}refreshInputValidation(){for(let e=0;e0&&this.beans.ariaAnnounce.announceValue(h,"dateFilter")}getState(){return{isInvalid:this.hasInvalidInputs()}}areStatesEqual(e,t){return(e?.isInvalid??!1)===(t?.isInvalid??!1)}refresh(e){const t=super.refresh(e),{state:s,additionalEventAttributes:i}=e,r=this.state,o=i?.fromAction;return(o&&o!="apply"||s.model!==r.model||!this.areStatesEqual(s.state,r.state))&&this.refreshInputValidation(),t}setElementValue(e,t,s){super.setElementValue(e,t,s),t===null&&e.setCustomValidity("")}createEValue(){const{params:e,eValuesFrom:t,eValuesTo:s}=this,i=Pg(e),r=re({tag:"div",cls:"ag-filter-body",role:"presentation"}),o=this.createFromToElement(r,t,"from",i),n=this.createFromToElement(r,s,"to",i),a=(d,u,h)=>()=>this.refreshInputPairValidation(d,u,h),l=a(o,n,!0);o.onValueChange(l),o.addGuiEventListener("focusin",l);const c=a(o,n,!1);return n.onValueChange(c),n.addGuiEventListener("focusin",c),r}createFromToElement(e,t,s,i){const r=this.createManagedBean(i?new ct({allowedCharPattern:i}):new ct);return r.addCss(`ag-filter-${s}`),r.addCss("ag-filter-filter"),t.push(r),e.appendChild(r.getGui()),r}removeEValues(e,t){const s=i=>this.removeComponents(i,e,t);s(this.eValuesFrom),s(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(s,i,r,o)=>{i0&&(s.filter=String(i[0])),i.length>1&&(s.filterTo=String(i[1])),s}removeConditionsAndOperators(e,t){if(!this.hasInvalidInputs())return super.removeConditionsAndOperators(e,t)}getInputs(e){const{eValuesFrom:t,eValuesTo:s}=this;return e>=t.length?[null,null]:[t[e],s[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>e||(e=!t.getInputElement().validity.valid)),e}positionHasInvalidInputs(e){let t=!1;return this.forEachPositionInput(e,s=>t||(t=!s.getInputElement().validity.valid)),t}canApply(e){return!this.hasInvalidInputs()}getParsedValue(e,t){const s=e.getValue();return s==null||typeof s=="string"&&s.trim()===""?null:t?t(s):et(s)}isInvalidValue(e,t){const s=e.getValue();return s!=null&&String(s).trim()!==""&&t===null}};function dG(e,t,s){return e!=null&&t!=null&&e>=t?`strict${s?"Max":"Min"}ValueValidation`:null}var aS=class extends E{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,s=new Fg;this.optionsFactory=s,s.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(s,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,s=this.optionsFactory;s.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:s,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:s}=t,i=[];if(s){const n=t;i.push(...n.conditions??[])}else i.push(t);const r=s&&s==="OR"?"some":"every",o=this.params.getValue(e.node);return i[r](n=>this.individualConditionPasses(e,n,o))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:s,maxNumConditions:i}}=e;if(t==null)return;let o=vu(t)?t.conditions:[t];const n=s?.map(d=>typeof d=="string"?d:d.displayKey)??this.defaultOptions;if(!(!o||o.every(d=>n.find(u=>u===d.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((o&&!o.every(d=>d.filterType===c)||t.filterType!==c)&&(o=o.map(d=>({...d,filterType:c})),l=!0),typeof i=="number"&&o&&o.length>i&&(o=o.slice(0,i),l=!0),l){const d=o.length>1?{...t,filterType:c,conditions:o}:{...o[0],filterType:c};this.params={...e,model:d},e.onModelChange(d)}}individualConditionPasses(e,t,s){const i=this.optionsFactory,r=this.mapValuesFromModel(t,i),o=i.getCustomOption(t.type),n=nG(o,r,s);return n??(s==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(r,s,t,e))}},Mg=class extends aS{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:s,includeBlanksInGreaterThan:i,includeBlanksInLessThan:r,includeBlanksInRange:o}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(s)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(i)return!0;break;case"lessThan":case"lessThanOrEqual":if(r)return!0;break;case"inRange":if(o)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,s){const i=s.type;if(!this.isValid(t))return i==="notEqual"||i==="notBlank";const r=this.comparator(),o=e[0]!=null?r(e[0],t):0;switch(i){case"equals":return o===0;case"notEqual":return o!==0;case"greaterThan":return o>0;case"greaterThanOrEqual":return o>=0;case"lessThan":return o<0;case"lessThanOrEqual":return o<=0;case"inRange":{const n=r(e[1],t);return this.params.filterParams.inRangeInclusive?o>=0&&n<=0:o>0&&n<0}case"blank":return Rc(t);case"notBlank":return!Rc(t);default:return F(76,{filterModelType:i}),!0}}},Tg={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},uG={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},Ec=class extends E{constructor(e,t,s){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=s}getModelAsString(e,t){const s=this.getLocaleTextFunc(),i=t==="filterToolPanel";if(!e)return i?jt(this,"filterSummaryInactive"):null;if(e.operator!=null){const o=e,a=(o.conditions??[]).map(c=>this.getModelAsString(c,t)),l=o.operator==="AND"?"andCondition":"orCondition";return a.join(` ${jt(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return i?jt(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):s(e.type,e.type);{const o=e,n=this.optionsFactory.getCustomOption(o.type),{displayKey:a,displayName:l,numberOfInputs:c}=n||{};return a&&l&&c===0?s(a,l):this.conditionToString(o,i,o.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:s}=e;this.optionsFactory=t,this.filterParams=s}conditionForToolPanel(e,t,s,i,r,o){let n;const a=this.getTypeKey(e);return a&&(n=jt(this,a)),r&&o&&(n=this.getLocaleTextFunc()(r,o)),n!=null?t?`${n} ${jt(this,"filterSummaryInRangeValues",[s(),i()])}`:`${n} ${s()}`: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)}},lS=class extends Ec{constructor(e,t){super(e,t,t.bigintFormatter),this.filterTypeKeys=Tg}conditionToString(e,t,s,i,r){const{filter:o,filterTo:n,type:a}=e,l=this.formatValue.bind(this),c=et(o),d=et(n);if(t){const u=this.conditionForToolPanel(a,s,()=>l(c),()=>l(d),i,r);if(u!=null)return u}return s?`${l(c)}-${l(d)}`:o!=null?l(c):`${a}`}},hG=class extends Mg{constructor(){super(nS,Eg),this.filterType="bigint",this.FilterModelFormatterClass=lS}comparator(){return(e,t)=>e===t?0:e{}}setupGui(e){this.eInput=this.createManagedBean(new ct(this.params?.config));const t=this.eInput.getGui();e.appendChild(t);const s=i=>this.onValueChanged(i);this.addManagedListeners(t,{input:s,keydown:s})}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,placeholder:s}){const{eInput:i}=this;i.setInputAriaLabel(e),t!==void 0&&i.setAutoComplete(t),i.toggleCss("ag-floating-filter-search-icon",!!s),i.setInputPlaceholder(s)}};function Ag(e){const t=e?.trim();return t===""?e:t}function cS(e,t){const{filter:s,filterTo:i,type:r}=e||{};return[s||null,i||null].slice(0,Ki(r,t))}var dS=class extends A{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let s;t?s=e.conditions[0]:s=e,this.lastType=s.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const s=e;return this.isTypeEditable(s.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const s=e;this.onModelUpdated(s.model)}}setParams(e){const t=new Fg;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 s=this.optionsFactory.defaultOption;t||(this.lastType=s),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(s);this.setEditable(i)}refresh(e){this.params=e;const t=e,s=this.reactive;if((!s||t.source==="colDef")&&this.updateParams(e),s){const{source:i,model:r}=t;if(i==="dataChanged"||i==="ui")return;this.onModelUpdated(r)}}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?.afterFloatingFilter||t?.afterDataChange||this.onModelUpdated(e)}isTypeEditable(e){return!!e&&!this.readOnly&&Ki(e,this.optionsFactory)===1}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},gG={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},Ig=class extends dS{constructor(){super(...arguments),this.eFloatingFilterInputContainer=x,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(gG)}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{inputSvc:t,defaultDebounceMs:s,readOnly:i}=this,{filterPlaceholder:r,column:o,browserAutoComplete:n,filterParams:a}=e,l=this.lastType??this.optionsFactory.defaultOption,c=e.filterParams.filterPlaceholder,d=r===!0?SC(this,c,"filterOoo",l):r||void 0;if(t.setParams({ariaLabel:this.getAriaLabel(o),autoComplete:n??!1,placeholder:d}),this.applyActive=lo(a),!i){const u=Iu(a,s);t.setValueChangedListener(Ce(this,this.syncUpWithParentFilter.bind(this),u))}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,s=t.getValue();ee(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(s,!0)}syncUpWithParentFilter(e){const t=e.key===b.ENTER,s=this.reactive;if(s&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:i,params:r,lastType:o}=this;let n=i.getValue();if(r.filterParams.trimInput&&(n=Ag(n),i.setValue(n,!0)),s){const a=r,l=a.model,c=this.convertValue(n),d=c==null?null:{...l??{filterType:this.filterType,type:o??this.optionsFactory.defaultOption},filter:c};a.onModelChange(d,{afterFloatingFilter:!0})}else r.parentFilterInstance(a=>{a?.onFloatingFilterChanged(o||null,n||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},pG=class extends Ig{constructor(){super(...arguments),this.FilterModelFormatterClass=lS,this.filterType="bigint",this.defaultOptions=Eg}updateParams(e){const t=e.filterParams;Pg(t)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),this.bigintParser=t?.bigintParser,super.updateParams(e)}createFloatingFilterInputService(e){const t=e.filterParams;this.allowedCharPattern=Pg(t),this.bigintParser=t?.bigintParser;const s=this.allowedCharPattern?{allowedCharPattern:this.allowedCharPattern}:void 0;return this.createManagedBean(new Dg({config:s}))}convertValue(e){return e==null||e===""?null:this.bigintParser?this.bigintParser(e):et(e)}},uS=".ag-input-field-input",hS=class{constructor(e,t,s,i,r,o){this.context=e,this.eParent=r,this.alive=!0,this.debouncedReport=Ce({isAlive:()=>this.alive},gS,500),this.timeoutHandle=null,VE(t,s,i)?.newAgStackInstance().then(a=>{if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;r.appendChild(a.getGui()),a?.afterGuiAttached?.();const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&a.setDisabled?.(c),o?.(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){const t=this.dateComp;t?t.setDisabled?.(e):this.disabled=e}setDisplayed(e){V(this.eParent,e)}setInputPlaceholder(e){this.dateComp?.setInputPlaceholder?.(e)}setInputAriaLabel(e){this.dateComp?.setInputAriaLabel?.(e)}afterGuiAttached(e){this.dateComp?.afterGuiAttached?.(e)}updateParams(e){this.dateComp?.refresh?.(e)}setCustomValidity(e,t=!1){const s=this.dateComp?.getGui().querySelector(uS);if(s&&"setCustomValidity"in s){const i=e.length>0;s.setCustomValidity(e),i?t?this.timeoutHandle=this.debouncedReport(s):gS(s):this.timeoutHandle&&window.clearTimeout(this.timeoutHandle),Wa(s,i)}}getValidity(){return this.dateComp?.getGui().querySelector(uS)?.validity}};function gS(e){e.reportValidity()}var kg=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function pS(e,t){const{dateFrom:s,dateTo:i,type:r}=e||{};return[s&&_e(s,void 0,!0)||null,i&&_e(i,void 0,!0)||null].slice(0,Ki(r,t))}var fS=1e3,mS=1/0,fG=class extends Fc{constructor(){super("dateFilter",pS,kg),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=fS,this.maxValidYear=mS,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e),this.refreshInputValidation()}shouldKeepInvalidInputState(){return!Di()&&this.hasInvalidInputs()&&this.getConditionTypes().includes("inRange")}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,c)=>{const d=e[l];if(d!=null)if(isNaN(d))F(82,{param:l});else return d==null?c:Number(d);return c},s=t("minValidYear",fS),i=t("maxValidYear",mS);this.minValidYear=s,this.maxValidYear=i,s>i&&F(83);const{minValidDate:r,maxValidDate:o}=e,n=r instanceof Date?r:_e(r);this.minValidDate=n;const a=o instanceof Date?o:_e(o);this.maxValidDate=a,n&&a&&n>a&&F(84)}refreshInputValidation(){for(let e=0;e=2?mG(c,d,t):null,h=u?this.translate(u,[String(t?d:c)]):"",g=!Di()&&!s;(t?n:a).setCustomValidity(h,g),(t?a:n).setCustomValidity("",g),h.length>0&&o.ariaAnnounce.announceValue(h,"dateFilter")}createDateCompWrapper(e,t,s){const{beans:{userCompFactory:i,context:r,gos:o},params:n}=this,a=s==="from",l=new hS(r,i,n.colDef,N(o,{onDateChanged:()=>{this.refreshInputPairValidation(t,a),this.onUiChanged()},onFocusIn:()=>this.refreshInputPairValidation(t,a),filterParams:n,location:"filter"}),e);return this.addDestroyFunc(()=>l.destroy()),l}getState(){return{isInvalid:this.hasInvalidInputs()}}areStatesEqual(e,t){return(e?.isInvalid??!1)===(t?.isInvalid??!1)}setElementValue(e,t){e.setDate(t),t||e.setCustomValidity("")}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=re({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,s,i){const r=re({tag:"div",cls:`ag-filter-${i} ag-filter-date-${i}`});t.push(r),e.appendChild(r),s.push(this.createDateCompWrapper(r,t.length-1,i))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),ua(this.eConditionPanelsFrom,e,t),ua(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,s){const i=ua(e,t,s);for(const r of i)r.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:s,minValidYear:i,maxValidYear:r}=this;if(t){if(es)return!1}else if(e.getUTCFullYear()>r)return!1;return!0}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>e||(e=t.getDate()!=null&&!(t.getValidity()?.valid??!0))),e}positionHasInvalidInputs(e){let t=!1;return this.forEachPositionInput(e,s=>t||(t=!(s.getValidity()?.valid??!0))),t}canApply(e){return!this.hasInvalidInputs()}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachPositionInput(e,(s,i,r,o)=>{!t||i>=o||t&&(t=this.isValidDateValue(s.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),s={},{params:i,filterType:r}=this,o=this.getValues(e),n=i.useIsoSeparator?"T":" ";return o.length>0&&(s.dateFrom=tt(o[0],!0,n)),o.length>1&&(s.dateTo=tt(o[1],!0,n)),{dateFrom:null,dateTo:null,filterType:r,type:t,...s}}removeConditionsAndOperators(e,t){if(!this.hasInvalidInputs())return super.removeConditionsAndOperators(e,t)}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),s=e("ariaFilterValue","Filter Value");this.forEachInput(i=>{i.setInputPlaceholder(t),i.setInputAriaLabel(s)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:s}=this;return e>=t.length?[null,null]:[t[e],s[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(s,i,r,o)=>{i=t?`${s?"max":"min"}DateValidation`:null}var CS=class extends Ec{constructor(e,t){super(e,t,s=>{const{dataTypeSvc:i,valueSvc:r}=this.beans,o=t.column,n=i?.getDateFormatterFunction(o),a=n?n(s??void 0):s;return r.formatValue(o,null,a)}),this.filterTypeKeys=Tg}conditionToString(e,t,s,i,r){const{type:o}=e,n=_e(e.dateFrom),a=_e(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>RD(h,l),d=()=>n!==null?c(n):"null",u=()=>a!==null?c(a):"null";if(n==null&&a==null)return jt(this,o);if(t){const h=this.conditionForToolPanel(o,s,d,u,i,r);if(h!=null)return h}return s?`${d()}-${u()}`:n!=null?c(n):`${o}`}};function CG(e,t){const s=t;return se?1:0}var vG=class extends Mg{constructor(){super(pS,kg),this.filterType="date",this.FilterModelFormatterClass=CS,this.filterTypeToRangeCache=new Map}getOrRefreshRangeCacheItem(e,t){const{filterTypeToRangeCache:s}=this,i=Date.now();let r=s.get(e);if(r&&r.expires=0&&r(l,t)<0}return super.evaluateNonNullValue(e,t,s)}},wG=1,Pc=null,bG=()=>{if(Pc!=null)return Pc;let e;const t=typeof navigator>"u"?void 0:navigator.languages?.[0]??navigator.language;if(t&&typeof Intl<"u"&&typeof Intl.Locale=="function")try{e=new Intl.Locale(t).getWeekInfo?.()?.firstDay}catch{e=void 0}return Pc=e==null?wG:e%7,Pc},Zt=e=>(e.setHours(0,0,0,0),e),Mc=e=>{const t=e.getDay(),s=bG(),i=(t-s+7)%7;return e.setDate(e.getDate()-i),Zt(e)},Tc=(e,t=1)=>(e.setDate(e.getDate()-t),e),hs=e=>(e.setDate(e.getDate()+1),Zt(e)),vS=e=>(Mc(e),e.setDate(e.getDate()+6),hs(e)),Dc=e=>(e.setDate(1),Zt(e)),Lg=e=>(e.setDate(1),e.setMonth(e.getMonth()+1),Zt(e)),Gg=e=>{const t=Math.floor(e.getMonth()/3);return e.setMonth(t*3),Dc(e)},wS=e=>{const t=Math.floor(e.getMonth()/3);return e.setMonth(t*3+2),Lg(e)},Og=e=>(e.setMonth(0,1),Zt(e)),bS=e=>(e.setMonth(12,0),hs(e)),Do=e=>Tc(e),Vg=e=>Do(Mc(e)),Bg=e=>Do(Dc(e)),Ng=e=>Do(Gg(e)),Hg=(e,t)=>[Zt(e),hs(t)],SG=(e,t)=>Hg(Do(e),Do(t)),zg=(e,t)=>[Mc(e),vS(t)],yG=(e,t)=>zg(Vg(e),Vg(t)),_g=(e,t)=>[Dc(e),Lg(t)],xG=(e,t)=>_g(Bg(e),Bg(t)),Wg=(e,t)=>[Gg(e),wS(t)],RG=(e,t)=>Wg(Ng(e),Ng(t)),Ug=(e,t)=>[Og(e),bS(t)],FG=(e,t)=>[Og(e),hs(t)],EG=(e,t)=>[Zt(Tc(e,7)),hs(t)],PG=(e,t)=>[Zt(Tc(e,30)),hs(t)],MG=(e,t)=>[Zt(Tc(e,90)),hs(t)],TG=(e,t)=>(e.setFullYear(e.getFullYear()-1),e.setMonth(e.getMonth()+6),[Zt(e),hs(t)]),DG=(e,t)=>(e.setFullYear(e.getFullYear()-1),[Zt(e),hs(t)]),AG=(e,t)=>(e.setFullYear(e.getFullYear()-2),[Zt(e),hs(t)]),IG=(e,t)=>(e.setFullYear(e.getFullYear()-1),t.setFullYear(t.getFullYear()-1),Ug(e,t)),kG=(e,t)=>(e.setFullYear(e.getFullYear()+1),t.setFullYear(t.getFullYear()+1),Ug(e,t)),LG=(e,t)=>(e.setMonth(e.getMonth()+3),t.setMonth(t.getMonth()+3),Wg(e,t)),GG=(e,t)=>(e.setMonth(e.getMonth()+1),t.setMonth(t.getMonth()+1),_g(e,t)),OG=(e,t)=>(e.setDate(e.getDate()+7),t.setDate(t.getDate()+7),zg(e,t)),VG=(e,t)=>(e.setDate(e.getDate()+1),t.setDate(t.getDate()+1),Hg(e,t)),BG={today:Hg,yesterday:SG,tomorrow:VG,thisWeek:zg,lastWeek:yG,nextWeek:OG,thisMonth:_g,lastMonth:xG,nextMonth:GG,thisQuarter:Wg,lastQuarter:RG,nextQuarter:LG,thisYear:Ug,lastYear:IG,nextYear:kG,yearToDate:FG,last7Days:EG,last30Days:PG,last90Days:MG,last6Months:TG,last12Months:DG,last24Months:AG,setStartOfDay:Zt,setStartOfWeek:Mc,setStartOfNextDay:hs,setStartOfNextWeek:vS,setStartOfMonth:Dc,setStartOfNextMonth:Lg,setStartOfQuarter:Gg,setStartOfNextQuarter:wS,setStartOfYear:Og,setStartOfNextYear:bS,setPreviousDay:Do,setPreviousWeek:Vg,setPreviousMonth:Bg,setPreviousQuarter:Ng},NG={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"}]},HG=class extends dS{constructor(){super(NG,[Vt]),this.eReadOnlyText=x,this.eDateWrapper=x,this.FilterModelFormatterClass=CS,this.filterType="date",this.defaultOptions=kg}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 s=e?_e(e.dateFrom):null;this.dateComp.setDate(s),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){V(this.eDateWrapper,e),V(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 s=t.model,i=tt(e),r=i==null?null:{...s??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:i};t.onModelChange(r,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t?.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=Iu(e,this.defaultDebounceMs);return N(this.gos,{onDateChanged:Ce(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:s,params:{column:i}}=this;this.dateComp=new hS(e,t,i.getColDef(),this.getDateComponentParams(),s,r=>{r.setInputAriaLabel(this.getAriaLabel(i))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},zG={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},_G=class extends A{constructor(){super(zG,[Vt]),this.eDateInput=x,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),focusin:this.handleFocusIn.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())}handleFocusIn(){this.params.onFocusIn?.()}setParams(e){const t=this.eDateInput.getInputElement(),s=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=s&&Ss();const{minValidYear:i,maxValidYear:r,minValidDate:o,maxValidDate:n,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},d=this.beans.dataTypeSvc,u=l??d?.getDateIncludesTimeFlag?.(c.cellDataType)??!1;s?u?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text";const h=SS(o,i,!0),g=SS(n,r,!1);h&&g&&h.getTime()>g.getTime()&&F(87),h&&(t.min=tt(h,u)),g&&(t.max=tt(g,u)),this.isApply=e.location==="floatingFilter"&&!!a?.includes("apply")}refresh(e){this.params=e,this.setParams(e)}getDate(){return _e(this.eDateInput.getValue())}setDate(e){const t=this.params.filterParams.colDef.cellDataType,s=this.beans.dataTypeSvc?.getDateIncludesTimeFlag(t)??!1;this.eDateInput.setValue(tt(e,s))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e?.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){return e?.filterParams?.browserDatePicker??!0}};function SS(e,t,s){return e&&t&&F(s?85:86),e instanceof Date?e:e?_e(e):t?_e(`${t}-${s?"01-01":"12-31"}`):null}var $g=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function Kg(e){return e?.allowedCharPattern??null}function Ac(e){return e==null||isNaN(e)?null:e}function yS(e,t){const{filter:s,filterTo:i,type:r}=e||{};return[Ac(s),Ac(i)].slice(0,Ki(r,t))}var WG=class extends Fc{constructor(){super("numberFilter",yS,$g),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}afterGuiAttached(e){super.afterGuiAttached(e),this.refreshInputValidation()}shouldKeepInvalidInputState(){return!Di()&&this.hasInvalidInputs()&&this.getConditionTypes().includes("inRange")}refreshInputValidation(){for(let e=0;e0&&this.beans.ariaAnnounce.announceValue(a,"dateFilter")}getState(){return{isInvalid:this.hasInvalidInputs()}}areStatesEqual(e,t){return(e?.isInvalid??!1)===(t?.isInvalid??!1)}refresh(e){const t=super.refresh(e),{state:s,additionalEventAttributes:i}=e,r=this.state,o=i?.fromAction;return(o&&o!="apply"||s.model!==r.model||!this.areStatesEqual(s.state,r.state))&&this.refreshInputValidation(),t}setElementValue(e,t,s){const{numberFormatter:i}=this.params,r=!s&&i?i(t??null):t;super.setElementValue(e,r),r===null&&e.setCustomValidity("")}createEValue(){const{params:e,eValuesFrom:t,eValuesTo:s}=this,i=Kg(e),r=re({tag:"div",cls:"ag-filter-body",role:"presentation"}),o=this.createFromToElement(r,t,"from",i),n=this.createFromToElement(r,s,"to",i),a=(d,u,h)=>()=>this.refreshInputPairValidation(d,u,h),l=a(o,n,!0);o.onValueChange(l),o.addGuiEventListener("focusin",l);const c=a(o,n,!1);return n.onValueChange(c),n.addGuiEventListener("focusin",c),r}createFromToElement(e,t,s,i){const r=this.createManagedBean(i?new ct({allowedCharPattern:i}):new aa);return r.addCss(`ag-filter-${s}`),r.addCss("ag-filter-filter"),t.push(r),e.appendChild(r.getGui()),r}removeEValues(e,t){const s=i=>this.removeComponents(i,e,t);s(this.eValuesFrom),s(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(s,i,r,o)=>{i0&&(s.filter=i[0]),i.length>1&&(s.filterTo=i[1]),s}removeConditionsAndOperators(e,t){if(!this.hasInvalidInputs())return super.removeConditionsAndOperators(e,t)}getInputs(e){const{eValuesFrom:t,eValuesTo:s}=this;return e>=t.length?[null,null]:[t[e],s[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>e||(e=!t.getInputElement().validity.valid)),e}positionHasInvalidInputs(e){let t=!1;return this.forEachPositionInput(e,s=>t||(t=!s.getInputElement().validity.valid)),t}canApply(e){return!this.hasInvalidInputs()}};function xS(e,t){if(typeof t=="number")return t;let s=Ae(t);return s!=null&&s.trim()===""&&(s=null),e?e(s):s==null||s.trim()==="-"?null:Number.parseFloat(s)}function RS(e,t){return Ac(xS(e,t.getValue(!0)))}function UG(e,t,s){return e!=null&&t!=null&&e>=t?`strict${s?"Max":"Min"}ValueValidation`:null}var FS=class extends Ec{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=Tg}conditionToString(e,t,s,i,r){const{filter:o,filterTo:n,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,s,()=>l(o),()=>l(n),i,r);if(c!=null)return c}return s?`${l(o)}-${l(n)}`:o!=null?l(o):`${a}`}},$G=class extends Mg{constructor(){super(yS,$g),this.filterType="number",this.FilterModelFormatterClass=FS}comparator(){return(e,t)=>e===t?0:e{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new aa),this.eTextInput=this.createManagedBean(new ct),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),s=this.eTextInput.getGui();e.appendChild(t),e.appendChild(s),this.setupListeners(t,i=>this.onValueChanged(i)),this.setupListeners(s,i=>this.onValueChanged(i))}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({ariaLabel:e,autoComplete:t,placeholder:s}){this.setAriaLabel(e),t!==void 0&&this.setAutoComplete(t),this.setPlaceholder(this.eNumberInput,s),this.setPlaceholder(this.eTextInput,s)}setPlaceholder(e,t){e.toggleCss("ag-floating-filter-search-icon",!!t),e.setInputPlaceholder(t)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},jG=class extends Ig{constructor(){super(...arguments),this.FilterModelFormatterClass=FS,this.filterType="number",this.defaultOptions=$g}updateParams(e){Kg(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=Kg(e.filterParams),this.allowedCharPattern?this.createManagedBean(new Dg({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new KG)}convertValue(e){return e?Number(e):null}},jg=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],qG=class extends Fc{constructor(){super("textFilter",cS,jg),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),s={filterType:this.filterType,type:t},i=this.getValues(e);return i.length>0&&(s.filter=i[0]),i.length>1&&(s.filterTo=i[1]),s}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:s}=this;return e>=t.length?[null,null]:[t[e],s[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(s,i,r,o)=>{ithis.removeComponents(o,e,t),{eValuesFrom:i,eValuesTo:r}=this;s(i),s(r)}},ES=class extends Ec{constructor(){super(...arguments),this.filterTypeKeys=uG}conditionToString(e,t,s,i,r){const{filter:o,filterTo:n,type:a}=e;if(t){const l=d=>()=>jt(this,"filterSummaryTextQuote",[d]),c=this.conditionForToolPanel(a,s,l(o),l(n),i,r);if(c!=null)return c}return s?`${o}-${n}`:o!=null?`${o}`:`${a}`}},YG=({filterOption:e,value:t,filterText:s})=>{if(s==null)return!1;switch(e){case"contains":return t.includes(s);case"notContains":return!t.includes(s);case"equals":return t===s;case"notEqual":return t!=s;case"startsWith":return t.indexOf(s)===0;case"endsWith":{const i=t.lastIndexOf(s);return i>=0&&i===t.length-s.length}default:return!1}},XG=e=>e,ZG=e=>e==null?null:e.toString().toLowerCase(),QG=class extends aS{constructor(){super(cS,jg),this.filterType="text",this.FilterModelFormatterClass=ES}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??YG,this.formatter=t.textFormatter??(t.caseSensitive?XG:ZG)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,s,i){const r=e.map(h=>this.formatter(h))||[],o=this.formatter(t),{api:n,colDef:a,column:l,context:c,filterParams:{textFormatter:d}}=this.params;if(s.type==="blank")return Rc(t);if(s.type==="notBlank")return!Rc(t);const u={api:n,colDef:a,column:l,context:c,node:i.node,data:i.data,filterOption:s.type,value:o,textFormatter:d};return r.some(h=>this.matcher({...u,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=s=>{const i={...s},{filter:r,filterTo:o}=s;return r&&(i.filter=Ag(r)??null),o&&(i.filterTo=Ag(o)??null),i};return vu(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},JG=class extends Ig{constructor(){super(...arguments),this.FilterModelFormatterClass=ES,this.filterType="text",this.defaultOptions=jg}createFloatingFilterInputService(){return this.createManagedBean(new Dg)}};function eO(e){return!!e.quickFilter?.isFilterPresent()}function tO(e){return e.quickFilter?.getText()}function sO(e){e.quickFilter?.resetCache()}var iO=class extends E{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",s=>this.setFilter(s.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(){const{autoColSvc:e,colModel:t,gos:s,pivotResultCols:i}=this.beans,r=t.isPivotMode(),o=e?.getColumns(),n=t.getColDefCols();let a=(r&&!s.get("applyQuickFilterBeforePivotOrAgg")?i?.getPivotResultCols()?.list:n)??[];o&&(a=a.concat(o)),this.colsToUse=s.get("includeHiddenColumnsInQuickFilter")?a:a.filter(l=>l.isVisible()||l.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(s=>t?this.doesRowPassCache(e,s):this.doesRowPassNoCache(e,s))}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 D(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){F(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"),s=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,s&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(s=>{const i=this.getTextForColumn(s,e);return D(i)&&i.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let s;e?(this.checkGenerateAggText(t),s=t.quickFilterAggregateText):s=this.getAggText(t);const{quickFilterParts:i,matcher:r}=this;return r(i,s)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let s=this.beans.filterValueSvc.getValue(e,t);const i=e.getColDef();if(i.getQuickFilterText){const r=N(this.gos,{value:s,node:t,data:t.data,column:e,colDef:i});s=i.getQuickFilterText(r)}return D(s)?s.toString().toUpperCase():null}getAggText(e){const t=[];for(const s of this.colsToUse){const i=this.getTextForColumn(s,e);D(i)&&t.push(i)}return t.join(` `)}},rO={moduleName:"ClientSideRowModelFilter",version:H,rowModels:["clientSide"],beans:[Dk]},ha={moduleName:"FilterCore",version:H,beans:[X6],apiFunctions:{isAnyFilterPresent:q6,onFilterChanged:Y6},css:[D6],dependsOn:[rO]},Ic={moduleName:"FilterValue",version:H,beans:[tG]},Ps={moduleName:"ColumnFilter",version:H,beans:[j6,eG],dynamicBeans:{headerFilterCellCtrl:E6},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:A6,getColumnFilterInstance:I6,destroyFilter:k6,setFilterModel:L6,getFilterModel:G6,getColumnFilterModel:O6,setColumnFilterModel:V6,showColumnFilter:B6,hideColumnFilter:N6,getColumnFilterHandler:H6,doFilterAction:z6},dependsOn:[ha,$s,Ic,wg]},PS={moduleName:"CustomFilter",version:H,userComponents:{agReadOnlyFloatingFilter:iG},dependsOn:[Ps]},MS={moduleName:"TextFilter",version:H,dependsOn:[Ps],userComponents:{agTextColumnFilter:{classImp:qG,params:{useForm:!0}},agTextColumnFloatingFilter:JG},dynamicBeans:{agTextColumnFilterHandler:QG}},TS={moduleName:"NumberFilter",version:H,dependsOn:[Ps],userComponents:{agNumberColumnFilter:{classImp:WG,params:{useForm:!0}},agNumberColumnFloatingFilter:jG},dynamicBeans:{agNumberColumnFilterHandler:$G}},DS={moduleName:"BigIntFilter",version:H,dependsOn:[Ps],userComponents:{agBigIntColumnFilter:{classImp:cG,params:{useForm:!0}},agBigIntColumnFloatingFilter:pG},dynamicBeans:{agBigIntColumnFilterHandler:hG}},AS={moduleName:"DateFilter",version:H,dependsOn:[Ps],userComponents:{agDateColumnFilter:{classImp:fG,params:{useForm:!0}},agDateInput:_G,agDateColumnFloatingFilter:HG},dynamicBeans:{agDateColumnFilterHandler:vG}},oO={moduleName:"QuickFilterCore",version:H,rowModels:["clientSide"],beans:[iO],dependsOn:[ha,Ic]},IS={moduleName:"QuickFilter",version:H,apiFunctions:{isQuickFilterPresent:eO,getQuickFilter:tO,resetQuickFilter:sO},dependsOn:[oO]},kS={moduleName:"ExternalFilter",version:H,dependsOn:[ha]},nO=class extends E{constructor(e,t,s){super(),this.id=e,this.parentCache=t,this.params=s,this.state="needsLoading",this.version=0,this.startRow=e*s.blockSize,this.endRow=this.startRow+s.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,s){this.successCommon(e,{rowData:t,rowCount:s})}isRequestMostRecentAndLive(e){const t=e===this.version,s=this.isAlive();return t&&s}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:s,beans:i,rowNodes:r}=this;for(let o=0;o{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:s,params:{sortModel:i,filterModel:r},gos:o}=this;return N(o,{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,s),failCallback:this.pageLoadFailed.bind(this,s),sortModel:i,filterModel:r})}forEachNode(e,t,s){this.rowNodes.forEach((i,r)=>{this.startRow+r{const n=e.rowData?e.rowData[o]:void 0;!r.id&&r.alreadyRendered&&n&&(t[o]=new lt(s),t[o].setRowIndex(r.rowIndex),t[o].setRowTop(r.rowTop),t[o].setRowHeight(r.rowHeight),r._destroy(!0)),this.setDataAndId(t[o],n,this.startRow+o)});const i=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,i)}destroy(){const e=this.rowNodes;for(let t=0,s=e.length;tn!=e),s=(n,a)=>a.lastAccessed-n.lastAccessed;t.sort(s);const i=this.params.maxBlocksInCache>0,r=i?this.params.maxBlocksInCache-1:null,o=aO-1;t.forEach((n,a)=>{const l=n.state==="needsLoading"&&a>=o,c=i?a>=r:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(n)||this.isBlockFocused(n))return;this.removeBlockFromCache(n)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:s,endRow:i}=e;return t.rowIndex>=s&&t.rowIndex=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:s,overflowSize:i}=this.params,o=(e.id+1)*s+i;this.rowCounts.id-i.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 s=[];let i=-1,r=!1;const o={value:0};let n=!1;for(const l of this.getBlocksInOrder())if(!n){if(r&&i+1!==l.id){n=!0;continue}i=l.id,l.forEachNode(c=>{const d=c===e||c===t;(r||d)&&s.push(c),d&&(r=!r)},o,this.rowCount)}return n||r?[]:s}},cO=class extends E{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.hierarchical=!1}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 lt(e);this.rootNode=t,t.level=-1,this.rowHeight=Et(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=Et(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){let e;this.cacheParams?e=!Ds(this.cacheParams.sortModel,this.beans.sortSvc?.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}getOverlayType(){return this.infiniteCache?.getRowCount()===0?this.beans.filterManager?.isAnyFilterPresent()?"noMatchingRows":"noRows":null}getNodesInRangeForSelection(e,t){return this.infiniteCache?.getRowNodesInRange(e,t)??[]}reset(){if(!this.datasource)return;Is(this.gos)!=null||this.beans.selectionSvc?.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:s,rowNodeBlockLoader:i,eventSvc:r,gos:o}=e;this.cacheParams={datasource:this.datasource,filterModel:t?.getFilterModel()??{},sortModel:s?.getSortModel()??[],rowNodeBlockLoader:i,initialRowCount:o.get("infiniteInitialRowCount"),maxBlocksInCache:o.get("maxBlocksInCache"),rowHeight:Et(e),overflowSize:o.get("cacheOverflowSize"),blockSize:o.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new lO(this.cacheParams)),r.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(s=>{s.id===e&&(t=s)}),t}forEachNode(e){this.infiniteCache?.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),s=this.getRowCount()-1;return t>s?s:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache?.refreshCache()}purgeCache(){this.infiniteCache?.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?.isLastRowIndexKnown()??!1}setRowCount(e,t){this.infiniteCache?.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function dO(e){El(e)?.refreshCache()}function uO(e){El(e)?.purgeCache()}function hO(e){return El(e)?.getRowCount()}var gO=class extends E{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=iu(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Ce(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){De(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){yi(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(s=>s.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const s of t)s.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:s,state:i}=t.getBlockStateJson();e[s]=i}),e}printCacheStatus(){yi(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},pO={moduleName:"InfiniteRowModelCore",version:H,rowModels:["infinite"],beans:[cO,gO]},LS={moduleName:"InfiniteRowModel",version:H,apiFunctions:{refreshInfiniteCache:dO,purgeInfiniteCache:uO,getInfiniteRowCount:hO},dependsOn:[pO,ag]},fO=class extends E{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(e,t){const s=this.wrapSvc?.wrap(e,t)??t,i=!Qn.has(e),r=i?this.asyncListeners:this.syncListeners;r.has(e)||r.set(e,new Set),r.get(e).add(s),this.eventSvc.addListener(e,s,i)}removeListener(e,t){const s=this.wrapSvc?.unwrap(e,t)??t,r=!!this.asyncListeners.get(e)?.delete(s);r||this.syncListeners.get(e)?.delete(s),this.eventSvc.removeListener(e,s,r)}addGlobalListener(e){const t=this.wrapSvc?.wrapGlobal(e)??e,s=(o,n)=>{Qn.has(o)&&t(o,n)},i=(o,n)=>{Qn.has(o)||t(o,n)};this.globalListenerPairs.set(e,{syncListener:s,asyncListener:i});const r=this.eventSvc;r.addGlobalListener(s,!1),r.addGlobalListener(i,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:s,globalListenerPairs:i}=this,r=s?.unwrapGlobal(e)??e;if(i.has(r)){const{syncListener:n,asyncListener:a}=i.get(r);t.removeGlobalListener(n,!1),t.removeGlobalListener(a,!0),i.delete(e)}else this.syncGlobalListeners.delete(r),t.removeGlobalListener(r,!1)}destroyEventListeners(e,t){e.forEach((s,i)=>{s.forEach(r=>this.eventSvc.removeListener(i,r,t)),s.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const s of e)this.eventSvc.removeGlobalListener(s,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:s,asyncListener:i})=>{t.removeGlobalListener(s,!1),t.removeGlobalListener(i,!0)}),e.clear()}};function mO(e,t,s){e.apiEventSvc?.addListener(t,s)}function CO(e,t,s){e.apiEventSvc?.removeListener(t,s)}function vO(e,t){e.apiEventSvc?.addGlobalListener(t)}function wO(e,t){e.apiEventSvc?.removeGlobalListener(t)}var qg={moduleName:"EventApi",version:H,apiFunctions:{addEventListener:mO,addGlobalListener:vO,removeEventListener:CO,removeGlobalListener:wO},beans:[fO]},GS=class extends E{constructor(){super(...arguments),this.beanName="localeSvc"}getLocaleTextFunc(){const e=this.gos,t=e.getCallback("getLocaleText");return t?vm(t):wm(e.get("localeText"))}},OS={moduleName:"Locale",version:H,beans:[GS]};function bO(e){return e.stateSvc?.getState()??{}}function SO(e,t,s){return e.stateSvc?.setState(t,s)}function VS(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=yO(e)),e.version=H,e}function yO(e){return e.cellSelection=xO(e,"rangeSelection"),e}function xO(e,t){if(e&&typeof e=="object")return e[t]}var RO=class extends E{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Ce(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Ce(this,()=>this.updateGroupExpansionState(),0),this.onRowSelectedDebounced=Ce(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:s}=this.beans;this.isClientSideRowModel=ae(e);const i=VS(e.get("initialState")??{}),r=i.partialColumnState;delete i.partialColumnState,this.cachedState=i;const o=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>o(()=>this.setupStateOnGridReady(i))),(i.columnOrder||i.columnVisibility||i.columnSizing||i.columnPinning||i.columnGroup)&&s?.hideColumns("columnState");const[n,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(n(),o(()=>{this.setupStateOnColumnsInitialised(i,!!r),s?.revealColumns("columnState")}))},rowCountReady:()=>{a?.(),o(()=>this.setupStateOnRowCountReady(i))},firstDataRendered:()=>{l?.(),o(()=>this.setupStateOnFirstDataRendered(i))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const s=VS(e);delete s.partialColumnState,this.cachedState=s,this.startSuppressEvents();const i="api",r=t?new Set(t):void 0;this.setGridReadyState(s,i,r),this.setColumnsInitialisedState(s,i,!!r,r),this.setRowCountState(s,i,r),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(s,i,r),this.stopSuppressEvents(i)})}setGridReadyState(e,t,s){t==="api"&&!s?.has("sideBar")&&this.beans.sideBar?.comp?.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,s,i){this.setColumnState(e,t,s,i),this.setColumnGroupState(e,t,i),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const s=i=>()=>this.updateColumnState([i]);this.addManagedEventListeners({columnValueChanged:s("aggregation"),columnMoved:s("columnOrder"),columnPinned:s("columnPinning"),columnResized:s("columnSizing"),columnVisible:s("columnVisibility"),columnPivotChanged:s("pivot"),columnPivotModeChanged:s("pivot"),columnRowGroupChanged:s("rowGroup"),sortChanged:s("sort"),newColumnsLoaded:({source:i})=>{this.updateColumnAndGroupState(),i!=="gridInitializing"&&this.isClientSideRowModel&&this.onRowGroupOpenedDebounced()},columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,s){const{filter:i,rowGroupExpansion:r,ssrmRowGroupExpansion:o,rowSelection:n,pagination:a,rowPinning:l}=e,c=(u,h)=>!s?.has(u)&&(h||t==="api");c("filter",i)&&this.setFilterState(i),(c("rowGroupExpansion",r)||c("ssrmRowGroupExpansion",o))&&this.setRowGroupExpansionState(o,r,t),c("rowSelection",n)&&this.setRowSelectionState(n,t),c("pagination",a)&&this.setPaginationState(a,t),c("rowPinning",l)&&this.setRowPinningState(l);const d=this.updateCachedState.bind(this);d("filter",this.getFilterState()),this.updateGroupExpansionState(),d("rowSelection",this.getRowSelectionState()),d("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),s=()=>{this.updateRowGroupExpansionStateTimer=0,this.updateGroupExpansionState()},i=()=>t("filter",this.getFilterState()),{gos:r,colFilter:o,selectableFilter:n}=this.beans;this.addManagedEventListeners({filterChanged:i,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:s,columnRowGroupChanged:s,rowDataUpdated:()=>{(r.get("groupDefaultExpanded")!==0||r.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(s)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:a=>{(a.newPage||a.newPageSize)&&t("pagination",this.getPaginationState())},pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())}),o&&this.addManagedListeners(o,{filterStateChanged:i}),n&&this.addManagedListeners(n,{selectedFilterChanged:i})}setFirstDataRenderedState(e,t,s){const{scroll:i,cellSelection:r,focusedCell:o,columnOrder:n}=e,a=(d,u)=>!s?.has(d)&&(u||t==="api");a("focusedCell",o)&&this.setFocusedCellState(o),a("cellSelection",r)&&this.setCellSelectionState(r),a("scroll",i)&&this.setScrollState(i),this.setColumnPivotState(!!n?.orderedColIds,t);const l=this.updateCachedState.bind(this);l("sideBar",this.getSideBarState()),l("focusedCell",this.getFocusedCellState());const c=this.getRangeSelectionState();l("rangeSelection",c),l("cellSelection",c),l("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),s=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:s,cellFocusCleared:s,cellSelectionChanged:i=>{if(i.finished){const r=this.getRangeSelectionState();t("rangeSelection",r),t("cellSelection",r)}},bodyScrollEnd:()=>t("scroll",this.getScrollState())})}getColumnState(){const e=this.beans;return lb(Un(e),e.colModel.isPivotMode())}setColumnState(e,t,s,i){const{sort:r,rowGroup:o,aggregation:n,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:d,columnOrder:u}=e;let h=!1;const g=(k,L)=>{const j=!i?.has(k)&&!!(L||t==="api");return h||(h=j),j},p={},f=k=>{let L=p[k];return L||(L={colId:k},p[k]=L,L)},m={},C=g("sort",r);C&&r?.sortModel.forEach(({colId:k,sort:L,type:j},U)=>{const O=f(k);O.sort=L,O.sortIndex=U,O.sortType=j}),(C||!s)&&(m.sort=null,m.sortIndex=null);const v=g("rowGroup",o);v&&o?.groupColIds.forEach((k,L)=>{const j=f(k);j.rowGroup=!0,j.rowGroupIndex=L}),(v||!s)&&(m.rowGroup=null,m.rowGroupIndex=null);const w=g("aggregation",n);w&&n?.aggregationModel.forEach(({colId:k,aggFunc:L})=>{f(k).aggFunc=L}),(w||!s)&&(m.aggFunc=null);const S=g("pivot",a);S&&(a?.pivotColIds.forEach((k,L)=>{const j=f(k);j.pivot=!0,j.pivotIndex=L}),this.gos.updateGridOptions({options:{pivotMode:!!a?.pivotMode},source:t})),(S||!s)&&(m.pivot=null,m.pivotIndex=null);const y=g("columnPinning",l);if(y){for(const k of l?.leftColIds??[])f(k).pinned="left";for(const k of l?.rightColIds??[])f(k).pinned="right"}(y||!s)&&(m.pinned=null);const R=g("columnVisibility",c);if(R)for(const k of c?.hiddenColIds??[])f(k).hide=!0;(R||!s)&&(m.hide=null);const P=g("columnSizing",d);if(P)for(const{colId:k,flex:L,width:j}of d?.columnSizingModel??[]){const U=f(k);U.flex=L??null,U.width=j}(P||!s)&&(m.flex=null);const M=u?.orderedColIds,T=!!M?.length&&!i?.has("columnOrder"),I=T?M.map(k=>f(k)):Object.values(p);(I.length||h)&&(this.columnStates=I,qe(this.beans,{state:I,applyOrder:T,defaultState:m},t))}setColumnPivotState(e,t){const s=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;this.columnGroupStates=void 0;const r=this.beans,{pivotResultCols:o,colGroupSvc:n}=r;if(o?.isPivotResultColsPresent()){if(s){const a=[];for(const l of s)o.getPivotResultCol(l.colId)&&a.push(l);qe(r,{state:a,applyOrder:e},t)}i&&n?.setColumnGroupState(i,t)}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return cb(t)}setColumnGroupState(e,t,s){const i=this.beans.colGroupSvc;if(!i||s?.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const r=new Set(e.columnGroup?.openColumnGroupIds),n=i.getColumnGroupState().map(({groupId:a})=>{const l=r.has(a);return l&&r.delete(a),{groupId:a,open:l}});for(const a of r)n.push({groupId:a,open:!0});n.length&&(this.columnGroupStates=n),i.setColumnGroupState(n,t)}getFilterState(){const{filterManager:e,selectableFilter:t}=this.beans;let s=e?.getFilterModel();s&&Object.keys(s).length===0&&(s=void 0);const i=e?.getFilterState(),r=e?.getAdvFilterModel()??void 0,o=t?.getState();return s||r||i||o?{filterModel:s,columnFilterState:i,advancedFilterModel:r,selectableFilters:o}:void 0}setFilterState(e){const{filterManager:t,selectableFilter:s}=this.beans,{filterModel:i,columnFilterState:r,advancedFilterModel:o,selectableFilters:n}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};n!==void 0&&s?.setState(n??{}),(i!==void 0||r!==void 0)&&t?.setFilterState(i??null,r??null,"columnFilter"),o!==void 0&&t?.setAdvFilterModel(o??null,"advancedFilter")}getRangeSelectionState(){const e=this.beans.rangeSvc?.getCellRanges().map(t=>{const{id:s,type:i,startRow:r,endRow:o,columns:n,startColumn:a}=t;return{id:s,type:i,startRow:r,endRow:o,colIds:n.map(l=>l.getColId()),startColId:a.getColId()}});return e?.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:s,colModel:i,visibleCols:r}=this.beans;if(!mt(t)||!s)return;const o=[];for(const n of e?.cellRanges??[]){const a=[];for(const c of n.colIds){const d=i.getCol(c);d&&a.push(d)}if(!a.length)continue;let l=i.getCol(n.startColId);if(!l){const c=r.allCols,d=new Set(a);l=c.find(u=>d.has(u))}o.push({...n,columns:a,startColumn:l})}s.setCellRanges(o)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:s}=e?.getVScrollPosition()??{top:0};return s||t?{top:s,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:s}=e??{top:0,left:0},{frameworkOverrides:i,rowRenderer:r,animationFrameSvc:o,ctrlsSvc:n}=this.beans;i.wrapIncoming(()=>{n.get("center").setCenterViewportScrollLeft(s),n.getScrollFeature()?.setVerticalScrollPosition(t),r.redraw({afterScroll:!0}),o?.flushAllFrames()})}getSideBarState(){return this.beans.sideBar?.comp?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:s,rowPinned:i}=e;return{colId:t.getColId(),rowIndex:s,rowPinned:i}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:s}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:i,rowIndex:r,rowPinned:o}=e;t.setFocusedCell({column:s.getCol(i),rowIndex:r,rowPinned:o,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const s=e.getCurrentPage(),i=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!s&&!i))return{page:s,pageSize:i}}setPaginationState(e,t){const{pagination:s,gos:i}=this.beans;if(!s)return;const{pageSize:r,page:o}=e??{page:0,pageSize:i.get("paginationPageSize")},n=t==="gridInitializing";r&&!i.get("paginationAutoPageSize")&&s.setPageSize(r,n?"initialState":"pageSizeSelector"),typeof o=="number"&&(n?s.setPage(o):s.goToPage(o))}getRowSelectionState(){const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!t?.toggledNodes?.length?void 0:t}setRowSelectionState(e,t){this.beans.selectionSvc?.setSelectionState(e,t,t==="api")}updateGroupExpansionState(){const{expansionSvc:e,gos:t}=this.beans,s=e?.getExpansionState(),i=t.get("ssrmExpandAllAffectsAllRows");this.updateCachedState("ssrmRowGroupExpansion",i?s:void 0),this.updateCachedState("rowGroupExpansion",i?void 0:s)}getRowPinningState(){return this.beans.pinnedRowModel?.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t?.setPinnedState(e):t?.reset()}setRowGroupExpansionState(e,t,s){const i=e??t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};this.beans.expansionSvc?.setExpansionState(i,s)}updateColumnState(e){const t=this.getColumnState();let s=!1;const i=this.cachedState;for(const r of Object.keys(t)){const o=t[r];Ds(o,i[r])||(s=!0)}this.cachedState={...i,...t},s&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const s=this.cachedState[e];this.setCachedStateValue(e,t),Ds(t,s)||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(){this.suppressEvents=!0,this.beans.colAnimation?.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.beans.colAnimation?.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},BS={moduleName:"GridState",version:H,beans:[RO],apiFunctions:{getState:bO,setState:SO}};function FO(e){return e.rowModel.isLastRowIndexKnown()}function EO(e){return e.pagination?.getPageSize()??100}function PO(e){return e.pagination?.getCurrentPage()??0}function MO(e){return e.pagination?.getTotalPages()??1}function TO(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function DO(e){e.pagination?.goToNextPage()}function AO(e){e.pagination?.goToPreviousPage()}function IO(e){e.pagination?.goToFirstPage()}function kO(e){e.pagination?.goToLastPage()}function LO(e,t){e.pagination?.goToPage(t)}var GO=class extends E{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,s=()=>{const i=Math.max(Et(t),1),r=Math.floor(e/i);t.pagination.setPageSize(r,"autoCalculated")};this.isBodyRendered?Ce(this,s,50)():(s(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};function ci(e,t){if(typeof e!="number")return"";const s=t(),i=s("thousandSeparator",","),r=s("decimalSeparator",".");return e.toString().replace(".",r).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${i}`)}var ga="paginationPageSizeSelector",OO={tag:"span",cls:"ag-paging-page-size"},VO=class extends A{constructor(){super(OO),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(ga,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!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(){ee(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(ga)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),s=!t||!e.includes(t);if(s){const r=this.gos.exists("paginationPageSize"),o=this.gos.get(ga)!==!0;F(94,{pageSizeSet:r,pageSizesSet:o,pageSizeOptions:e,paginationPageSizeOption:t}),o||F(95,{paginationPageSizeOption:t,paginationPageSizeSelector:ga}),e.unshift("")}const i=String(s?"":t);this.selectPageSizeComp?(be(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(i,!0)):this.createPageSizeSelectorComp(e,i),this.hasEmptyOption=s}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const s=this.getLocaleTextFunc(),i=s("pageSizeSelectorLabel","Page Size:"),r=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Ct).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(r).setLabel(i).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(ga);return!Array.isArray(t)||!t?.length?e:[...t].sort((s,i)=>s-i)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},BO={selector:"AG-PAGE-SIZE-SELECTOR",component:VO},NO=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;flex-wrap:wrap-reverse;gap:calc(var(--ag-spacing)*4);justify-content:flex-end;min-height:var(--ag-pagination-panel-height);padding:calc(var(--ag-spacing)*.5) var(--ag-cell-horizontal-padding);row-gap:calc(var(--ag-spacing)*.5);@container (width < 600px){justify-content:center}}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel,.ag-paging-row-summary-panel{margin:calc(var(--ag-spacing)*.5)}.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}.ag-paging-description{line-height:0}",HO=class extends Pr{constructor(){super(),this.btFirst=x,this.btPrevious=x,this.btNext=x,this.btLast=x,this.lbRecordCount=x,this.lbFirstRowOnPage=x,this.lbLastRowOnPage=x,this.lbCurrent=x,this.lbTotal=x,this.pageSizeComp=x,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(NO)}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(),[BO]);const{btFirst:t,btPrevious:s,btNext:i,btLast:r}=this;this.activateTabIndex([t,s,i,r]),t.insertAdjacentElement("afterbegin",_(e?"last":"first",this.beans)),s.insertAdjacentElement("afterbegin",_(e?"next":"previous",this.beans)),i.insertAdjacentElement("afterbegin",_(e?"previous":"next",this.beans)),r.insertAdjacentElement("afterbegin",_(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:o=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(o):zu(this.beans,o),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}getFocusableContainerName(){return"pagination"}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:s}=e;this.addManagedListeners(t,{click:s,keydown:i=>{(i.key===b.ENTER||i.key===b.SPACE)&&(i.preventDefault(),s())}})}ho(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}):ci(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(),s=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const i=this.isZeroPagesToDisplay(),r=e===s-1;this.nextButtonDisabled=r||i,this.lastButtonDisabled=!t||i||e===s-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){nn(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(),s=this.pagination.getMasterRowCount(),i=e?s:null,r=this.pagination.getCurrentPage(),o=this.pagination.getPageSize();let n,a;this.isZeroPagesToDisplay()?n=a=0:(n=o*r+1,a=n+o-1,e&&a>i&&(a=i));const l=n+o-1,c=!e&&s0?r+1:0,f=this.formatNumber(p);this.lbCurrent.textContent=f;let m,C;if(e)m=this.formatNumber(t),C=this.formatNumber(i);else{const v=h("more","more");m=v,C=v}this.lbTotal.textContent=m,this.lbRecordCount.textContent=C,this.announceAriaStatus(d,u,C,f,m)}announceAriaStatus(e,t,s,i,r){const o=this.getLocaleTextFunc(),n=o("page","Page"),a=o("to","to"),l=o("of","of"),c=`${e} ${a} ${t} ${l} ${s}`,d=`${n} ${i} ${l} ${r}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,this.ariaAnnounce?.announceValue(c,"paginationRow")),d!==this.ariaPageStatus&&(this.ariaPageStatus=d,this.ariaAnnounce?.announceValue(d,"paginationPage"))}},zO={selector:"AG-PAGINATION",component:HO},_O=100,WO=class extends E{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 zO}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:s}=this.beans;s?.isEditing()&&(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){if(!this.active)return;let t=e;this.paginateChildRows||(t=this.beans.rowModel.getTopLevelIndexFromDisplayedIndex?.(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 D(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:D(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:D(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:D(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:_O}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 s=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}s!==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 s=this.pageSize,i=t-1;this.totalPages=Math.floor(i/s)+1,this.adjustCurrentPageIfInvalid();const r=this.currentPage,o=s*r;let n=s*(r+1)-1;if(n>i&&(n=i),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(o),n===i)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(n+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:s}=this,i=e-1;this.totalPages=Math.floor(i/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*s,this.bottomDisplayedRowIndex=t*(s+1)-1,this.bottomDisplayedRowIndex>i&&(this.bottomDisplayedRowIndex=i)}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:s=!1,newPageSize:i=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:s,newPageSize:i,keepRenderedRows:t})}},NS={moduleName:"Pagination",version:H,beans:[WO,GO],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:FO,paginationGetPageSize:EO,paginationGetCurrentPage:PO,paginationGetTotalPages:MO,paginationGetRowCount:TO,paginationGoToNextPage:DO,paginationGoToPreviousPage:AO,paginationGoToFirstPage:IO,paginationGoToLastPage:kO,paginationGoToPage:LO},dependsOn:[$s]},UO=".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 $O(e){return e.pinnedRowModel?.getPinnedTopRowCount()??0}function KO(e){return e.pinnedRowModel?.getPinnedBottomRowCount()??0}function jO(e,t){return e.pinnedRowModel?.getPinnedTopRow(t)}function qO(e,t){return e.pinnedRowModel?.getPinnedBottomRow(t)}function YO(e,t,s){return e.pinnedRowModel?.forEachPinnedRow(t,s)}var HS={moduleName:"PinnedRow",version:H,beans:[DC],css:[UO],apiFunctions:{getPinnedTopRowCount:$O,getPinnedBottomRowCount:KO,getPinnedTopRow:jO,getPinnedBottomRow:qO,forEachPinnedRow:YO},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},XO="\u2191",ZO="\u2193",QO={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},JO=class extends A{constructor(){super(QO),this.eValue=x,this.eDelta=x,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const s=Math.abs(t),i=e.formatValue(s),r=D(i)?i:s,o=t>=0,n=this.eDelta;o?n.textContent=XO+r:n.textContent=ZO+r,n.classList.toggle("ag-value-change-delta-up",o),n.classList.toggle("ag-value-change-delta-down",!o)}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"),ee(this.eDelta)}refresh(e,t=!1){const{value:s,valueFormatted:i}=e,{eValue:r,lastValue:o,beans:n}=this;if(s===o||(D(i)?r.textContent=i:D(s)?r.textContent=s:ee(r),n.filterManager?.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=s&&typeof s=="object"&&"toNumber"in s?s.toNumber():s,l=o&&typeof o=="object"&&"toNumber"in o?o.toNumber():o;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const c=a-l;this.showDelta(e,c)}return o&&r.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=s,!0}},e4=".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}",t4={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},s4=class extends A{constructor(){super(t4),this.eCurrent=x,this.refreshCount=0,this.registerCSS(e4)}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious?.remove();const{beans:t,eCurrent:s}=this,i=re({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=i,i.textContent=s.textContent,this.getGui().insertBefore(i,s),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.ePrevious?.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let s=e.value;if(ne(s)&&(s=""),s===this.lastValue||this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=s;const i=this.eCurrent;return D(e.valueFormatted)?i.textContent=e.valueFormatted:D(e.value)?i.textContent=s:ee(i),!0}},i4=class extends E{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,s=this.beans.gos.get("cellFlashDuration"),i=this.beans.gos.get("cellFadeDuration")){const r=this.animations[t];r.delete(e);const o=Date.now(),n=o+s,a=o+s+i,l={phase:"flash",flashEndTime:n,fadeEndTime:a};r.set(e,l);const c=`ag-cell-${t}`,d=`${c}-animation`,{comp:u,eGui:{style:h}}=e;u.toggleCss(c,!0),u.toggleCss(d,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&n+15{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),s)}),this.nextAnimationTime=n)}advanceAnimations(){const e=Date.now();let t=null;for(const s of Object.keys(this.animations)){const i=this.animations[s],r=`ag-cell-${s}`,o=`${r}-animation`;for(const[n,a]of i){if(!n.isAlive()||!n.comp){i.delete(n);continue}const{phase:l,flashEndTime:c,fadeEndTime:d}=a,u=l==="flash"?c:d;if(!(e+15>=u)){t=Math.min(u,t??1/0);continue}const{comp:g,eGui:{style:p}}=n;switch(l){case"flash":g.toggleCss(r,!1),g.toggleCss(o,!0),p.transition=`background-color ${d-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(d,t??1/0),a.phase="fade";break;case"fade":g.toggleCss(r,!1),g.toggleCss(o,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),i.delete(n);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 s=ai(e.cellPosition);t.cells[s]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t?.flashDuration,t?.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function r4(e,t={}){const{cellFlashSvc:s}=e;s&&e.frameworkOverrides.wrapIncoming(()=>{for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))s.flashCell(i,t)})}var Yg={moduleName:"HighlightChanges",version:H,beans:[i4],userComponents:{agAnimateShowChangeCellRenderer:JO,agAnimateSlideCellRenderer:s4},apiFunctions:{flashCells:r4}};function o4(e,t,s){if(!t)return;const i=e.ctrlsSvc.getGridBodyCtrl().eGridBody,r=`aria-${t}`;s===null?i.removeAttribute(r):i.setAttribute(r,s)}function n4(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function a4(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function l4(e){return e.animationFrameSvc?.isQueueEmpty()??!0}function c4(e){e.animationFrameSvc?.flushAllFrames()}function d4(e){return{rowHeight:Et(e),headerHeight:Vn(e)}}function u4(e,t={}){const s=[];for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const n=o.getCellRenderer();n!=null&&s.push(Us(n))}if(t.columns?.length)return s;const i=[],r=Qh(t.rowNodes);for(const o of e.rowRenderer.getAllRowCtrls()){if(r&&!Jh(o.rowNode,r)||!o.isFullWidth())continue;const n=o.getFullWidthCellRenderers();for(let a=0;a{const l=a.__autoHeights;let c=Ze(this.beans,a).height;for(const d of r){let u=l?.[d.getColId()];const h=s?.getCellSpan(d,a);if(h){if(h.getLastNode()!==a)continue;if(u=s?.getCellSpan(d,a)?.getLastNodeAutoHeight(),!u)return}if(u==null){if(this.colSpanSkipCell(d,a))continue;return}c=Math.max(u,c)}c!==a.rowHeight&&(a.setRowHeight(c),o=!0)};i?.forEachPinnedRow?.("top",n),i?.forEachPinnedRow?.("bottom",n),t.forEachDisplayedNode?.(n),o&&t.onRowHeightChanged?.()}setRowAutoHeight(e,t,s){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[s.getId()];return}const i=e.__autoHeights[s.getId()];e.__autoHeights[s.getId()]=t,i!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:s,colViewport:i,visibleCols:r}=this.beans;if(!s.colSpanActive)return!1;let o=[];switch(e.getPinned()){case"left":o=r.getLeftColsForRow(t);break;case"right":o=r.getRightColsForRow(t);break;case null:o=i.getColsWithinViewport(t);break}return!o.includes(e)}setupCellAutoHeight(e,t,s){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const i=t.parentElement,{rowNode:r,column:o}=e,n=this.beans,a=d=>{if(this.beans.editSvc?.isEditing(e)||!e.isAlive()||!s.isAlive())return;const{paddingTop:u,paddingBottom:h,borderBottomWidth:g,borderTopWidth:p}=hr(i),f=u+h+g+p,C=t.offsetHeight+f;if(d<5){const w=!me(n)?.contains(t),S=C==0;if(w||S){window.setTimeout(()=>a(d+1),0);return}}this.setRowAutoHeight(r,C,o)},l=()=>a(0);l();const c=vs(n,t,l);return s.addDestroyFunc(()=>{c(),this.setRowAutoHeight(r,void 0,o)}),!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:s}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(s).filter(r=>r.isAutoHeight())),t.length!==0){if(!s.__autoHeights)return!1;for(const i of t){const r=s.__autoHeights[i.getColId()];if(!r||s.rowHeight{p=w,f=null,m=S},v=w=>{const S=!w.isExpandable()&&!w.group&&!w.detail&&(d?!d({rowNode:w}):!0);if(w.rowIndex==null||!S){C(null,null);return}if(p==null||w.level!==p.level||w.footer||f&&w.rowIndex-1!==f?.getLastNode().rowIndex){C(w,o.getValue(t,w,"data"));return}const y=o.getValue(t,w,"data");if(g){const R=N(s,{valueA:m,nodeA:p,valueB:y,nodeB:w,column:t,colDef:a});if(!h(R)){C(w,y);return}}else if(u?!u(m,y):m!==y){C(w,y);return}if(!f){const R=l?.get(p);R?.firstNode===p?(R.reset(),f=R):f=new g4(t,p),c.set(p,f)}f.addSpannedNode(w),c.set(w,f)};switch(e){case"center":r.forEachDisplayedNode?.(w=>{(!n||n.isRowInPage(w.rowIndex))&&v(w)}),this.centerValueNodeMap=c;break;case"top":i?.forEachPinnedRow("top",v),this.topValueNodeMap=c;break;case"bottom":i?.forEachPinnedRow("bottom",v),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}}},f4=class extends E{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Ce(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Ce(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 s=this.createManagedBean(new p4(e));this.spanningColumns.set(e,s),s.buildCache("top"),s.buildCache("bottom"),s.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?.createCtrls("top"),t?.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),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 s=this.spanningColumns.get(e);return s?s.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:s}=this.beans,i=e.column,r=e.rowIndex,o=this.spanningColumns.get(i);if(!o)return;let n;switch(e.rowPinned){case"top":n=t?.getPinnedTopRow(r);break;case"bottom":n=t?.getPinnedBottomRow(r);break;default:n=s.getRow(r)}if(n)return o.getCellSpan(n)}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 s=this.spanningColumns.get(e);if(s)return s.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[s,i]of this.spanningColumns)if(i.isCellSpanning(e)){const r=i.getCellSpan(e);t(s,r)}}destroy(){super.destroy(),this.spanningColumns.clear()}},m4=class extends yo{constructor(e,t,s){super(e.col,e.firstNode,s,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,s,i,r,o,n){this.eWrapper=s,super.setComp(e,t,s,i,r,o,n),this.setAriaRowSpan()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||dr(e,t.rowIndex)}setAriaRowSpan(){aF(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(On(t)){this.focusedCellPosition=void 0;return}const s=this.isCellFocused();s||(this.focusedCellPosition=void 0),e&&s&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},C4=class extends ac{getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){const t=this.beans.rowSpanSvc?.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new m4(t,this,this.beans)}isCorrectCtrlForSpan(e){const t=this.beans.rowSpanSvc?.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},v4=class extends E{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,s=this.getCtrlsMap(e),i=s.size,r=this.getAllRelevantRowControls(e),o=new Map;let n=!1;for(const l of r)l.isAlive()&&t?.forEachSpannedColumn(l.rowNode,(c,d)=>{if(o.has(d.firstNode))return;const u=s.get(d.firstNode);if(u){o.set(d.firstNode,u),s.delete(d.firstNode);return}n=!0;const h=new C4(d.firstNode,this.beans,!1,!1,!1);o.set(d.firstNode,h)});this.setCtrlsMap(e,o);const a=o.size===i;if(!(!n&&a)){for(const l of s.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,s=t?.getCellSpanByPosition(e);if(!s)return;const i=this.getCtrlsMap(e.rowPinned).get(s.firstNode);if(i)return i.getAllCellCtrls().find(r=>r.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")}},WS={moduleName:"CellSpan",version:H,beans:[f4,v4]},w4=class extends E{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,Os(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),Mn(e))}createColumns(e,t){const s=()=>{os(this.beans,this.columns?.tree),this.columns=null},i=e.treeDepth,o=(this.columns?.treeDepth??-1)==i,n=this.generateSelectionCols();if(Pn(n,this.columns?.list??[])&&o)return;s();const{colGroupSvc:l}=this.beans,c=l?.findDepth(e.tree)??0,d=l?.balanceTreeForAutoCols(n,c)??[];this.columns={list:n,tree:d,treeDepth:c,map:{}},t(h=>{if(!h)return null;const g=h.filter(p=>!Gs(p));return[...n,...g]})}updateColumns(e){const t=Os(e.source),{beans:s}=this;for(const i of this.columns?.list??[]){const r=this.createSelectionColDef(e.currentValue);i.setColDef(r,null,t),qe(s,{state:[Sl(r,i.colId)]},t)}}getColumn(e){return this.columns?.list.find(t=>oi(t,e))??null}getColumns(){return this.columns?.list??null}isSelectionColumnEnabled(){const{gos:e,beans:t}=this,s=e.get("rowSelection");if(typeof s!="object"||!Lt(e))return!1;const i=(t.autoColSvc?.getColumns()?.length??0)>0;if(s.checkboxLocation==="autoGroupColumn"&&i)return!1;const r=!!Fi(s),o=yn(s);return r||o}createSelectionColDef(e){const{gos:t}=this,s=e??t.get("selectionColumnDef"),i=t.get("enableRtl"),{rowSpan:r,spanRows:o,...n}=s??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:i?"right":"left",comparator(a,l,c,d){const u=c.isSelected(),h=d.isSelected();return u===h?0:u?1:-1},editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,pinned:null,...n,colId:vl,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const s=new is(e,null,t,!1);return this.createBean(s),[s]}onSelectionOptionsChanged(e,t,s){const i=t&&typeof t!="string"?Fi(t):void 0,r=e&&typeof e!="string"?Fi(e):void 0,o=i!==r,n=t&&typeof t!="string"?yn(t):void 0,a=e&&typeof e!="string"?yn(e):void 0,l=n!==a,c=ro(e),d=ro(t);(o||l||c!==d)&&this.beans.colModel.refreshAll(s)}destroy(){os(this.beans,this.columns?.tree),super.destroy()}refreshVisibility(e,t,s){if(!this.columns?.list.length)return;const i=e.length+t.length+s.length;if(i===0)return;const r=this.columns.list[0];if(!r.isVisible())return;const o=()=>{let l;switch(r.pinned){case"left":case!0:l=e;break;case"right":l=s;break;default:l=t}l&&De(l,r)};(this.beans.rowNumbersSvc?.getColumn(En)?2:1)===i&&o()}},b4=':where(.ag-selection-checkbox) .ag-checkbox-input-wrapper:before{content:"";cursor:pointer;inset:-8px;position:absolute}';function S4(e,t){if(!t.nodes.every(n=>n.rowPinned&&!nc(n)?(F(59),!1):n.id===void 0?(F(60),!1):!0))return;const{nodes:i,source:r,newValue:o}=t;e.selectionSvc?.setNodesSelected({nodes:i,source:r??"api",newValue:o})}function y4(e,t,s="apiSelectAll"){e.selectionSvc?.selectAllRowNodes({source:s,selectAll:t})}function x4(e,t,s="apiSelectAll"){e.selectionSvc?.deselectAllRowNodes({source:s,selectAll:t})}function R4(e,t="apiSelectAllFiltered"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"filtered"})}function F4(e,t="apiSelectAllFiltered"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"filtered"})}function E4(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"currentPage"})}function P4(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function M4(e){return e.selectionSvc?.getSelectedNodes()??[]}function T4(e){return e.selectionSvc?.getSelectedRows()??[]}var D4={tag:"div",cls:"ag-selection-checkbox",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},A4=class extends A{constructor(){super(D4,[ds]),this.eCheckbox=x}postConstruct(){this.eCheckbox.setPassive(!0)}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.getLocaleTextFunc(),{rowNode:t,eCheckbox:s}=this,i=t.isSelected(),r=qa(e,i),[o,n]=t.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],a=e(o,n);s.setValue(i,!0),s.setInputAriaLabel(`${a} (${r})`)}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getWrapperElement(),{dblclick:Ee,click:i=>{Ee(i),!this.eCheckbox.isDisabled()&&this.beans.selectionSvc?.handleSelectionEvent(i,this.rowNode,"checkboxSelected")}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),this.addManagedPropertyListener("rowSelection",({currentValue:i,previousValue:r})=>{const o=typeof i=="object"?ou(i):void 0,n=typeof r=="object"?ou(r):void 0;o!==n&&this.onSelectableChanged()}),fl(this.gos)||typeof this.getIsVisible()=="function"){const i=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:i}),this.addManagedListeners(this.rowNode,{dataChanged:i,cellChanged:i}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}showOrHideSelect(){const{column:e,rowNode:t,overrides:s,gos:i}=this,r=t.selectable,o=this.getIsVisible();let n;if(typeof o=="function"){const u=s?.callbackParams;if(!e)n=o({...u,node:t,data:t.data});else{const h=e.createColumnFunctionCallbackParams(t);n=o({...u,...h})}}else n=o??!1;const a=r&&!n||!r&&n,l=r||n,c=i.get("rowSelection"),d=c&&typeof c!="string"?!ou(c):!!e?.getColDef().showDisabledCheckboxes;this.setVisible(l&&(a?d:!0)),this.setDisplayed(l&&(a?d:!0)),l&&this.eCheckbox.setDisabled(a),s?.removeHidden&&this.setDisplayed(l)}getIsVisible(){const e=this.overrides;if(e)return e.isVisible;const t=this.gos.get("rowSelection");return t&&typeof t!="string"?Fi(t):this.column?.getColDef()?.checkboxSelection}},I4=class{constructor(e,t){this.rowModel=e,this.pinnedRowModel=t,this.selectAll=!1,this.rootId=null,this.endId=null,this.cachedRange=[]}reset(){this.rootId=null,this.endId=null,this.cachedRange.length=0}setRoot(e){this.rootId=e.id,this.endId=null,this.cachedRange.length=0}setEndRange(e){this.endId=e.id,this.cachedRange.length=0}getRange(){if(this.cachedRange.length===0){const e=this.getRoot(),t=this.getEnd();if(e==null||t==null)return this.cachedRange;this.cachedRange=this.getNodesInRange(e,t)??[]}return this.cachedRange}isInRange(e){return this.rootId===null?!1:this.getRange().some(t=>t.id===e.id)}getRoot(e){if(this.rootId)return this.getRowNode(this.rootId);if(e)return this.setRoot(e),e}getEnd(){if(this.endId)return this.getRowNode(this.endId)}getRowNode(e){let t;const{rowModel:s,pinnedRowModel:i}=this;return t??(t=s.getRowNode(e)),i?.isManual()&&(t??(t=i.getPinnedRowById(e,"top")),t??(t=i.getPinnedRowById(e,"bottom"))),t}truncate(e){const t=this.getRange();if(t.length===0)return{keep:[],discard:[]};const s=t[0].id===this.rootId,i=t.findIndex(r=>r.id===e.id);if(i>-1){const r=t.slice(0,i),o=t.slice(i+1);return this.setEndRange(e),s?{keep:r,discard:o}:{keep:o,discard:r}}else return{keep:t,discard:[]}}extend(e,t=!1){const s=this.getRoot();if(s==null){const r=this.getRange().slice();return t&&e.depthFirstSearch(o=>!o.group&&r.push(o)),r.push(e),this.setRoot(e),{keep:r,discard:[]}}const i=this.getNodesInRange(s,e);if(!i)return this.setRoot(e),{keep:[e],discard:[]};if(i.find(r=>r.id===this.endId))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const r=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:r}}}getNodesInRange(e,t){const{pinnedRowModel:s,rowModel:i}=this;if(!s?.isManual())return i.getNodesInRangeForSelection(e,t);if(e.rowPinned==="top"&&!t.rowPinned)return us(s,"top",e,void 0).concat(i.getNodesInRangeForSelection(i.getRow(0),t)??[]);if(e.rowPinned==="bottom"&&!t.rowPinned){const r=us(s,"bottom",void 0,e),o=i.getRowCount(),n=i.getRow(o-1);return(i.getNodesInRangeForSelection(t,n)??[]).concat(r)}if(!e.rowPinned&&!t.rowPinned)return i.getNodesInRangeForSelection(e,t);if(e.rowPinned==="top"&&t.rowPinned==="top")return us(s,"top",e,t);if(e.rowPinned==="bottom"&&t.rowPinned==="top"){const r=us(s,"top",t,void 0),o=us(s,"bottom",void 0,e),n=i.getRow(0),a=i.getRow(i.getRowCount()-1);return r.concat(i.getNodesInRangeForSelection(n,a)??[]).concat(o)}if(!e.rowPinned&&t.rowPinned==="top")return us(s,"top",t,void 0).concat(i.getNodesInRangeForSelection(i.getRow(0),e)??[]);if(e.rowPinned==="top"&&t.rowPinned==="bottom"){const r=us(s,"top",e,void 0),o=us(s,"bottom",void 0,t),n=i.getRow(0),a=i.getRow(i.getRowCount()-1);return r.concat(i.getNodesInRangeForSelection(n,a)??[]).concat(o)}if(e.rowPinned==="bottom"&&t.rowPinned==="bottom")return us(s,"bottom",e,t);if(!e.rowPinned&&t.rowPinned==="bottom"){const r=us(s,"bottom",void 0,t),o=i.getRow(i.getRowCount());return(i.getNodesInRangeForSelection(e,o)??[]).concat(r)}return null}},k4=class extends E{constructor(e){super(),this.column=e,this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(ie(this.beans))&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e;const t=this.createManagedBean(new Vi);this.cbSelectAll=t,t.addCss("ag-header-select-all"),Ie(t.getGui(),"presentation"),this.showOrHideSelectAll();const s=this.updateStateOfCheckbox.bind(this);this.addManagedEventListeners({newColumnsLoaded:()=>this.showOrHideSelectAll(),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:s,paginationChanged:s,modelUpdated:s}),this.addManagedPropertyListener("rowSelection",({currentValue:i,previousValue:r})=>{const o=n=>typeof n=="string"||!n||n.mode==="singleRow"?void 0:n.selectAll;o(i)!==o(r)&&this.showOrHideSelectAll(),this.updateStateOfCheckbox()}),this.addManagedListeners(t,{fieldValueChanged:this.onCbSelectAll.bind(this)}),t.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onDisplayedColumnsChanged(e){this.isAlive()&&this.showOrHideSelectAll(e.source==="uiColumnMoved")}showOrHideSelectAll(e=!1){const t=this.isCheckboxSelection();this.cbSelectAllVisible=t,this.cbSelectAll.setDisplayed(t),t&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel(e)}updateStateOfCheckbox(){if(!this.cbSelectAllVisible||this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.getSelectAllMode(),t=this.beans.selectionSvc,s=this.cbSelectAll,i=t.getSelectAllState(e);s.setValue(i);const r=t.hasNodesToSelect(e);s.setDisabled(!r),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(e=!1){const t=this.getLocaleTextFunc(),{headerCellCtrl:s,cbSelectAll:i,cbSelectAllVisible:r}=this,o=i.getValue(),n=qa(t,o),a=t("ariaRowSelectAll","Press Space to toggle all rows selection");s.setAriaDescriptionProperty("selectAll",r?`${a} (${n})`:null),i.setInputAriaLabel(t("ariaHeaderSelection","Column with Header Selection")),e||s.announceAriaDescription()}checkSelectionType(e){return ks(this.gos)?!0:(F(128,{feature:e}),!1)}checkRightRowModelType(e){const{gos:t,rowModel:s}=this.beans;return ae(t)||ft(t)?!0:(F(129,{feature:e,rowModel:s.getType()}),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.getSelectAllMode();let s="uiSelectAll";t==="currentPage"?s="uiSelectAllCurrentPage":t==="filtered"&&(s="uiSelectAllFiltered");const i={source:s,selectAll:t},r=this.beans.selectionSvc;e?r.selectAllRowNodes(i):r.deselectAllRowNodes(i)}isCheckboxSelection(){const{column:e,gos:t,beans:s}=this,o=typeof t.get("rowSelection")=="object"?"headerCheckbox":"headerCheckboxSelection";return US(s,e)&&this.checkRightRowModelType(o)&&this.checkSelectionType(o)}getSelectAllMode(){const e=jm(this.gos,!1);if(e)return e;const{headerCheckboxSelectionCurrentPageOnly:t,headerCheckboxSelectionFilteredOnly:s}=this.column.getColDef();return t?"currentPage":s?"filtered":"all"}destroy(){super.destroy(),this.cbSelectAll=void 0,this.headerCellCtrl=void 0}};function US({gos:e,selectionColSvc:t},s){const i=e.get("rowSelection"),r=s.getColDef(),{headerCheckboxSelection:o}=r;let n=!1;if(typeof i=="object"){const l=Gs(s),c=Sr(s);(ro(i)==="autoGroupColumn"&&c||l&&t?.isSelectionColumnEnabled())&&(n=yn(i))}else typeof o=="function"?n=o(N(e,{column:s,colDef:r})):n=!!o;return n}var Xg=class extends E{postConstruct(){const{gos:e,beans:t}=this;this.selectionCtx=new I4(t.rowModel,t.pinnedRowModel),this.addManagedPropertyListeners(["isRowSelectable","rowSelection"],()=>{const s=fl(e);s!==this.isRowSelectable&&(this.isRowSelectable=s,this.updateSelectable())}),this.isRowSelectable=fl(e),this.addManagedEventListeners({cellValueChanged:s=>this.updateRowSelectable(s.node),rowNodeDataChanged:s=>this.updateRowSelectable(s.node)})}destroy(){super.destroy(),this.selectionCtx.reset()}createCheckboxSelectionComponent(){return new A4}createSelectAllFeature(e){if(US(this.beans,e))return new k4(e)}isMultiSelect(){return ks(this.gos)}onRowCtrlSelected(e,t,s){const i=!!e.rowNode.isSelected();e.forEachGui(s,r=>{r.rowComp.toggleCss("ag-row-selected",i);const o=r.element;cn(o,i),o.contains(ie(this.beans))&&t(r)})}announceAriaRowSelection(e){if(this.isRowSelectionBlocked(e))return;const t=e.isSelected(),s=this.beans.editSvc?.isEditing({rowNode:e});if(!e.selectable||s)return;const r=this.getLocaleTextFunc()(t?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${t?"deselect":"select"} this row`);this.beans.ariaAnnounce?.announceValue(r,"rowSelection")}isRowSelectionBlocked(e){return!e.selectable||e.rowPinned&&!nc(e)||!Lt(this.gos)}updateRowSelectable(e,t){const s=e.rowPinned&&e.pinnedSibling?e.pinnedSibling.selectable:this.isRowSelectable?.(e)??!0;return this.setRowSelectable(e,s,t),s}setRowSelectable(e,t,s){if(e.selectable!==t){if(e.selectable=t,e.dispatchRowEvent("selectableChanged"),s)return;if(Pi(this.gos)){const r=this.calculateSelectedFromChildren(e);this.setNodesSelected({nodes:[e],newValue:r??!1,source:"selectableChanged"});return}e.isSelected()&&!e.selectable&&this.setNodesSelected({nodes:[e],newValue:!1,source:"selectableChanged"})}}calculateSelectedFromChildren(e){let t=!1,s=!1;if(!e.childrenAfterGroup?.length)return e.selectable?e.__selected:null;for(let i=0;i{const t=Pi(e),s=wr(e),i=xn(e)==="filteredDescendants";this.masterSelectsDetail=qm(e)==="detail",(t!==this.groupSelectsDescendants||i!==this.groupSelectsFiltered||s!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=i,this.mode=s)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,s){if(this.isRowSelectionBlocked(t))return 0;const i=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,s);if(i==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in i)return i.reset?this.resetNodes():this.selectRange(i.deselect,!1,s),this.selectRange(i.select,!0,s);{const r=i.checkFilteredNodes?KS(i.node):i.newValue;return this.setNodesSelected({nodes:[i.node],newValue:r,clearSelection:i.clearSelection,keepDescendants:i.keepDescendants,event:e,source:s})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:s,nodes:i,event:r,source:o,keepDescendants:n=!1}){if(i.length===0)return 0;const{gos:a}=this;if(!Lt(a)&&e)return F(132),0;if(i.length>1&&!this.isMultiSelect())return F(130),0;let l=0;for(let c=0;c0&&(this.updateGroupsFromChildrenSelections(o),this.dispatchSelectionChanged(o))),l}selectRange(e,t,s){let i=0;return e.forEach(r=>{const o=r.primaryRow;if(o.group&&this.groupSelectsDescendants)return;this.selectRowNode(o,t,void 0,s)&&i++}),i>0&&(this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s)),i}selectChildren(e,t,s){const i=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return i?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:s,nodes:i}):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((s,i)=>{e(s)&&t.set(i,s)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:s,rowModel:i}=this.beans;if(!ae(s,i))return!1;const r=i.rootNode;if(!r)return!1;let o=!1;const n=a=>{if(a!==r){const l=this.calculateSelectedFromChildren(a);o=this.selectRowNode(a,l===null?!1:l,void 0,e)||o}};return Mt(r,this.beans.rowModel.hierarchical,t,n),o}clearOtherNodes(e,t,s){const i=new Map;let r=0;return this.selectedNodes.forEach(o=>{const n=o.id==e.id;if((t?!O4(e,o):!0)&&!n){const l=this.selectedNodes.get(o.id);r+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:s}),this.groupSelectsDescendants&&o.parent&&i.set(o.parent.id,o.parent)}}),i.forEach(o=>{const n=this.calculateSelectedFromChildren(o);this.selectRowNode(o,n===null?!1:n,void 0,s)}),r}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 lt(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(!ae(e,t))return;const s=t.getTopLevelNodes();if(s===null)return;const i=[];function r(o){for(let n=0,a=o.length;n{const n=this.selectRowNode(o.primaryRow,!1,void 0,e);i||(i=n)};if(t==="currentPage"||t==="filtered"){if(!s){Q(102);return}this.getNodesToSelect(t).forEach(r)}else this.selectedNodes.forEach(r),this.reset(e);if(this.selectionCtx.selectAll=!1,s&&this.groupSelectsDescendants){const o=this.updateGroupsFromChildrenSelections(e);i||(i=o)}i&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,s=0;return this.getNodesToSelect(e).forEach(i=>{this.groupSelectsDescendants&&i.group||(i.isSelected()?t++:i.selectable&&s++)}),{selectedCount:t,notSelectedCount:s}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:s}=this.getSelectedCounts(e);return $S(t,s)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],s=r=>t.push(r);if(e==="currentPage")return this.forEachNodeOnPage(r=>{if(!r.group){s(r);return}if(!r.footer&&!r.expanded){const o=n=>{s(n);const a=n.childrenAfterFilter;if(a)for(let l=0,c=a.length;l{const a=this.selectRowNode(n.primaryRow,!0,void 0,i);o||(o=a)}),s.selectAll=!0,ae(t)&&this.groupSelectsDescendants){const n=this.updateGroupsFromChildrenSelections(i);o||(o=n)}o&&this.dispatchSelectionChanged(i)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,s){if(e||(e=[]),!Array.isArray(e)){Q(103);return}const i=new Set(e),r=[];this.beans.rowModel.forEachNode(o=>{i.has(o.id)&&r.push(o)}),s&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:r,source:t})}canSelectAll(){return ae(this.beans.gos)}updateSelectable(e){const{gos:t,rowModel:s}=this.beans;if(!Lt(t))return;const i="selectableChanged",r=ae(t)&&this.groupSelectsDescendants,o=[];if(r){const n=s.rootNode;n&&Mt(n,s.hierarchical,e,a=>{let l=!1;for(const c of a.childrenAfterGroup)l||(l=c.selectable),!c.group&&!this.updateRowSelectable(c,!0)&&c.isSelected()&&o.push(c);this.setRowSelectable(a,l,!0)})}else s.forEachNode(n=>{!this.updateRowSelectable(n,!0)&&n.isSelected()&&o.push(n)});o.length&&this.setNodesSelected({nodes:o,newValue:!1,source:i}),!e&&r&&this.updateGroupsFromChildrenSelections?.(i)}updateSelectableAfterGrouping(e){this.updateSelectable(e),this.groupSelectsDescendants&&this.updateGroupsFromChildrenSelections?.("rowGroupChanged",e)&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){if(!this.masterSelectsDetail)return;const s=e.detailNode?.detailGridInfo?.api;if(!s)return;const i=G4(s);e.isSelected()!==i&&this.selectRowNode(e,i,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),i||this.detailSelection.set(e.id,new Set(s.getSelectedNodes().map(o=>o.id)))}setDetailSelectionState(e,t,s){if(this.masterSelectsDetail){if(!ks(t)){F(269);return}switch(e.isSelected()){case!0:{s.selectAll();break}case!1:{s.deselectAll();break}case void 0:{const i=this.detailSelection.get(e.id);if(i){const r=[];for(const o of i){const n=s.getRowNode(o);n&&r.push(n)}s.setNodesSelected({nodes:r,newValue:!0,source:"masterDetail"})}break}default:break}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function G4(e){let t=0,s=0;return e.forEachNode(i=>{i.isSelected()?t++:i.selectable&&s++}),$S(t,s)}function $S(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function O4(e,t){let s=t.parent;for(;s;){if(s===e)return!0;s=s.parent}return!1}function KS(e){const t=e.isSelected()===!1,s=e.childrenAfterFilter?.some(KS)??!1;return t||s}var Zg={moduleName:"SharedRowSelection",version:H,beans:[w4],css:[b4],apiFunctions:{setNodesSelected:S4,selectAll:y4,deselectAll:x4,selectAllFiltered:R4,deselectAllFiltered:F4,selectAllOnCurrentPage:E4,deselectAllOnCurrentPage:P4,getSelectedNodes:M4,getSelectedRows:T4}},jS={moduleName:"RowSelection",version:H,rowModels:["clientSide","infinite","viewport"],beans:[L4],dependsOn:[Zg]},V4=class extends E{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,s=e.colDef,i=s.cellClassRules,r=this.getCellClassParams(e,s);Yh(this.beans.expressionSvc,i===this.cellClassRules?void 0:this.cellClassRules,i,r,o=>t.toggleCss(o,!0),o=>t.toggleCss(o,!1)),this.cellClassRules=i}applyUserStyles(){const e=this.column,t=e.colDef,s=t.cellStyle;if(!s)return;let i;if(typeof s=="function"){const r=this.getCellClassParams(e,t);i=s(r)}else i=s;i&&this.cellComp.setUserStyles(i)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,s=e.colDef,i=this.getCellClassParams(e,s);for(const o of this.staticClasses)t.toggleCss(o,!1);const r=this.beans.cellStyles.getStaticCellClasses(s,i);this.staticClasses=r;for(const o of r)t.toggleCss(o,!0)}getCellClassParams(e,t){const{value:s,rowNode:i}=this.cellCtrl;return N(this.beans.gos,{value:s,data:i.data,node:i,colDef:t,column:e,rowIndex:i.rowIndex})}},B4=class extends E{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,s,i){Yh(this.beans.expressionSvc,void 0,e.cellClassRules,t,s,i),this.processStaticCellClasses(e,t,s)}getStaticCellClasses(e,t){const{cellClass:s}=e;if(!s)return[];let i;return typeof s=="function"?i=s(t):i=s,typeof i=="string"&&(i=[i]),i||[]}createCellCustomStyleFeature(e){return new V4(e,this.beans)}processStaticCellClasses(e,t,s){this.getStaticCellClasses(e,t).forEach(r=>{s(r)})}},Qg={moduleName:"CellStyle",version:H,beans:[B4]},qS={moduleName:"RowStyle",version:H,beans:[U2]},N4={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,customChartThemes:!0,chartThemeOverrides:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressTouch:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,dragAndDropImageComponent:!0,overlayComponent:!0,suppressOverlays:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,groupLockGroupColumns:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,renderingMode:!0,columnMenu:!0,suppressSetFilterByDefault:!0,getDataPath:!0,enableCellSpan:!0,enableFilterHandlers:!0,filterHandlers:!0},Bt="clientSide",vt="serverSide",Ao="infinite",H4={onGroupExpandedOrCollapsed:[Bt],refreshClientSideRowModel:[Bt],isRowDataEmpty:[Bt],forEachLeafNode:[Bt],forEachNodeAfterFilter:[Bt],forEachNodeAfterFilterAndSort:[Bt],resetRowHeights:[Bt,vt],applyTransaction:[Bt],applyTransactionAsync:[Bt],flushAsyncTransactions:[Bt],getBestCostNodeSelection:[Bt],getServerSideSelectionState:[vt],setServerSideSelectionState:[vt],applyServerSideTransaction:[vt],applyServerSideTransactionAsync:[vt],applyServerSideRowData:[vt],retryServerSideLoads:[vt],flushServerSideAsyncTransactions:[vt],refreshServerSide:[vt],getServerSideGroupLevelState:[vt],refreshInfiniteCache:[Ao],purgeInfiniteCache:[Ao],getInfiniteRowCount:[Ao],isLastRowIndexKnown:[Ao,vt],expandAll:[Bt,vt],collapseAll:[Bt,vt],onRowHeightChanged:[Bt,vt],setRowCount:[Ao,vt],getCacheBlockState:[Ao,vt]},z4={showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'},clearRangeSelection:{version:"v32.2",message:"Use `clearCellSelection` instead."},getInfiniteRowCount:{version:"v32.2",old:"getInfiniteRowCount()",new:"getDisplayedRowCount()"},selectAllFiltered:{version:"v33",old:"selectAllFiltered()",new:'selectAll("filtered")'},deselectAllFiltered:{version:"v33",old:"deselectAllFiltered()",new:'deselectAll("filtered")'},selectAllOnCurrentPage:{version:"v33",old:"selectAllOnCurrentPage()",new:'selectAll("currentPage")'},deselectAllOnCurrentPage:{version:"v33",old:"deselectAllOnCurrentPage()",new:'deselectAll("currentPage")'}};function _4(e,t,s){const i=z4[e];if(i){const{version:o,new:n,old:a,message:l}=i,c=a??e;return(...d)=>{const u=n?`Please use ${n} instead. `:"";return ss(`Since ${o} api.${c} is deprecated. ${u}${l??""}`),t.apply(t,d)}}const r=H4[e];return r?(...o)=>{const n=s.rowModel.getType();if(!r.includes(n)){eo(`api.${e} can only be called when gridOptions.rowModelType is ${r.join(" or ")}`);return}return t.apply(t,o)}:t}var W4={detailCellRendererCtrl:"SharedMasterDetail",dndSourceComp:"DragAndDrop",fillHandle:"CellSelection",groupCellRendererCtrl:"GroupCellRenderer",headerFilterCellCtrl:"ColumnFilter",headerGroupCellCtrl:"ColumnGroup",rangeHandle:"CellSelection",tooltipFeature:"Tooltip",highlightTooltipFeature:"Tooltip",tooltipStateManager:"Tooltip",groupStrategy:"RowGrouping",treeGroupStrategy:"TreeData",rowNumberRowResizer:"RowNumbers",singleCell:"EditCore",fullRow:"EditCore",agSetColumnFilterHandler:"SetFilter",agMultiColumnFilterHandler:"MultiFilter",agGroupColumnFilterHandler:"GroupFilter",agNumberColumnFilterHandler:"NumberFilter",agBigIntColumnFilterHandler:"BigIntFilter",agDateColumnFilterHandler:"DateFilter",agTextColumnFilterHandler:"TextFilter"},U4={expanded:1,contracted:1,"tree-closed":1,"tree-open":1,"tree-indeterminate":1,pin:1,"eye-slash":1,arrows:1,left:1,right:1,group:1,aggregation:1,pivot:1,"not-allowed":1,chart:1,cross:1,cancel:1,tick:1,first:1,previous:1,next:1,last:1,linked:1,unlinked:1,"color-picker":1,loading:1,menu:1,"menu-alt":1,filter:1,"filter-add":1,columns:1,maximize:1,minimize:1,copy:1,cut:1,paste:1,grip:1,save:1,csv:1,excel:1,"small-down":1,"small-left":1,"small-right":1,"small-up":1,asc:1,desc:1,aasc:1,adesc:1,none:1,up:1,down:1,plus:1,minus:1,settings:1,"checkbox-checked":1,"checkbox-indeterminate":1,"checkbox-unchecked":1,"radio-button-on":1,"radio-button-off":1,eye:1,"column-arrow":1,"un-pin":1,"pinned-top":1,"pinned-bottom":1,"chevron-up":1,"chevron-down":1,"chevron-left":1,"chevron-right":1,edit:1},$4={chart:"MenuCore",cancel:"EnterpriseCore",first:"Pagination",previous:"Pagination",next:"Pagination",last:"Pagination",linked:"IntegratedCharts",loadingMenuItems:"MenuCore",unlinked:"IntegratedCharts",menu:"ColumnHeaderComp",legacyMenu:"ColumnMenu",filter:"ColumnFilter",filterActive:"ColumnFilter",filterAdd:"NewFiltersToolPanel",filterCardCollapse:"NewFiltersToolPanel",filterCardExpand:"NewFiltersToolPanel",filterCardEditing:"NewFiltersToolPanel",filterTab:"ColumnMenu",filtersToolPanel:"FiltersToolPanel",columns:["MenuCore"],columnsToolPanel:["ColumnsToolPanel"],maximize:"EnterpriseCore",minimize:"EnterpriseCore",save:"MenuCore",columnGroupOpened:"ColumnGroupHeaderComp",columnGroupClosed:"ColumnGroupHeaderComp",accordionOpen:"EnterpriseCore",accordionClosed:"EnterpriseCore",accordionIndeterminate:"EnterpriseCore",columnSelectClosed:["ColumnsToolPanel","ColumnMenu"],columnSelectOpen:["ColumnsToolPanel","ColumnMenu"],columnSelectIndeterminate:["ColumnsToolPanel","ColumnMenu"],columnMovePin:"SharedDragAndDrop",columnMoveHide:"SharedDragAndDrop",columnMoveMove:"SharedDragAndDrop",columnMoveLeft:"SharedDragAndDrop",columnMoveRight:"SharedDragAndDrop",columnMoveGroup:"SharedDragAndDrop",columnMoveValue:"SharedDragAndDrop",columnMovePivot:"SharedDragAndDrop",dropNotAllowed:"SharedDragAndDrop",ensureColumnVisible:["ColumnsToolPanel","ColumnMenu"],groupContracted:"GroupCellRenderer",groupExpanded:"GroupCellRenderer",setFilterGroupClosed:"SetFilter",setFilterGroupOpen:"SetFilter",setFilterGroupIndeterminate:"SetFilter",setFilterLoading:"SetFilter",close:"EnterpriseCore",check:"MenuItem",colorPicker:"CommunityCore",groupLoading:"LoadingCellRenderer",overlayLoading:"Overlay",overlayExporting:"Overlay",menuAlt:"ColumnHeaderComp",menuPin:"MenuCore",menuValue:"MenuCore",menuAddRowGroup:["MenuCore","ColumnsToolPanel"],menuRemoveRowGroup:["MenuCore","ColumnsToolPanel"],clipboardCopy:"MenuCore",clipboardCut:"MenuCore",clipboardPaste:"MenuCore",pivotPanel:["ColumnsToolPanel","RowGroupingPanel"],rowGroupPanel:["ColumnsToolPanel","RowGroupingPanel"],valuePanel:"ColumnsToolPanel",columnDrag:"EnterpriseCore",rowDrag:["RowDrag","DragAndDrop"],csvExport:"MenuCore",excelExport:"MenuCore",smallDown:"CommunityCore",selectOpen:"CommunityCore",richSelectOpen:"RichSelect",richSelectRemove:"RichSelect",richSelectLoading:"RichSelect",smallLeft:"CommunityCore",smallRight:"CommunityCore",subMenuOpen:"MenuItem",subMenuOpenRtl:"MenuItem",panelDelimiter:"RowGroupingPanel",panelDelimiterRtl:"RowGroupingPanel",smallUp:"CommunityCore",sortAscending:["MenuCore","Sort"],sortDescending:["MenuCore","Sort"],sortAbsoluteAscending:["MenuCore","Sort"],sortAbsoluteDescending:["MenuCore","Sort"],sortUnSort:["MenuCore","Sort"],advancedFilterBuilder:"AdvancedFilter",advancedFilterBuilderDrag:"AdvancedFilter",advancedFilterBuilderInvalid:"AdvancedFilter",advancedFilterBuilderMoveUp:"AdvancedFilter",advancedFilterBuilderMoveDown:"AdvancedFilter",advancedFilterBuilderAdd:"AdvancedFilter",advancedFilterBuilderRemove:"AdvancedFilter",advancedFilterBuilderSelectOpen:"AdvancedFilter",chartsMenu:"IntegratedCharts",chartsMenuEdit:"IntegratedCharts",chartsMenuAdvancedSettings:"IntegratedCharts",chartsMenuAdd:"IntegratedCharts",chartsColorPicker:"IntegratedCharts",chartsThemePrevious:"IntegratedCharts",chartsThemeNext:"IntegratedCharts",chartsDownload:"IntegratedCharts",checkboxChecked:"CommunityCore",checkboxIndeterminate:"CommunityCore",checkboxUnchecked:"CommunityCore",radioButtonOn:"CommunityCore",radioButtonOff:"CommunityCore",rowPin:"PinnedRow",rowUnpin:"PinnedRow",rowPinBottom:"PinnedRow",rowPinTop:"PinnedRow"},K4=new Set(["colorPicker","smallUp","checkboxChecked","checkboxIndeterminate","checkboxUnchecked","radioButtonOn","radioButtonOff","smallDown","smallLeft","smallRight"]),j4=class extends E{constructor(){super(...arguments),this.beanName="validation"}wireBeans(e){this.gridOptions=e.gridOptions,AF(J3)}warnOnInitialPropertyUpdate(e,t){e==="api"&&N4[t]&&F(22,{key:t})}processGridOptions(e){this.processOptions(e,KI())}validateApiFunction(e,t){return _4(e,t,this.beans)}missingUserComponent(e,t,s,i){const r=wo[t];r?this.gos.assertModuleRegistered(r,`AG Grid '${e}' component: ${t}`):F(101,{propertyName:e,componentName:t,agGridDefaults:s,jsComps:i})}missingDynamicBean(e){const t=W4[e];return t?Ft(200,{...this.gos.getModuleErrorParams(),moduleName:t,reasonOrId:e}):void 0}checkRowEvents(e){Y4.has(e)&&F(10,{eventType:e})}validateIcon(e){if(K4.has(e)&&F(43,{iconName:e}),U4[e])return;const t=$4[e];if(t){Q(200,{reasonOrId:`icon '${e}'`,moduleName:t,gridScoped:Qd(),gridId:this.beans.context.getId(),rowModelType:this.gos.get("rowModelType"),additionalText:"Alternatively, use the CSS icon name directly."});return}F(134,{iconName:e})}isProvidedUserComp(e){return!!wo[e]}validateColDef(e){this.processOptions(e,BI())}processOptions(e,t){const{validations:s,deprecations:i,allProperties:r,propertyExceptions:o,objectName:n,docsUrl:a}=t;r&&this.gridOptions.suppressPropertyNamesCheck!==!0&&this.checkProperties(e,[...o??[],...Object.keys(i)],r,n,a);const l=new Set;if(Object.keys(e).forEach(d=>{const u=i[d];if(u){const{message:v,version:w}=u;l.add(`As of v${w}, ${String(d)} is deprecated. ${v??""}`)}const h=e[d];if(h==null||h===!1)return;const g=s[d];if(!g)return;const{dependencies:p,validate:f,supportedRowModels:m,expectedType:C}=g;if(C){const v=typeof h;if(v!==C){l.add(`${String(d)} should be of type '${C}' but received '${v}' (${h}).`);return}}if(m){const v=this.gridOptions.rowModelType??"clientSide";if(!m.includes(v)){l.add(`${String(d)} is not supported with the '${v}' row model. It is only valid with: ${m.join(", ")}.`);return}}if(p){const v=this.checkForRequiredDependencies(d,p,e);if(v){l.add(v);return}}if(f){const v=f(e,this.gridOptions,this.beans);if(v){l.add(v);return}}}),l.size>0)for(const d of l)ss(d)}checkForRequiredDependencies(e,t,s){const r=Object.entries(t).filter(([o,n])=>{const a=s[o];return!n.required.includes(a)});return r.length===0?null:r.map(([o,n])=>`'${String(e)}' requires '${o}' to be one of [${n.required.map(a=>a===null?"null":a===void 0?"undefined":a).join(", ")}]. ${n.reason??""}`).join(` `)}checkProperties(e,t,s,i,r){const o=["__ob__","__v_skip","__metadata__"],n=q4(Object.getOwnPropertyNames(e),[...o,...t,...s],s),a=Object.keys(n);for(const l of a){const c=n[l];let d=`invalid ${i} property '${l}' did you mean any of these: ${c.slice(0,8).join(", ")}.`;s.includes("context")&&(d+=` If you are trying to annotate ${i} with application data, use the '${i}.context' property instead.`),ss(d)}if(a.length>0&&r){const l=this.beans.frameworkOverrides.getDocLink(r);ss(`to see all the valid ${i} properties please check: ${l}`)}}};function q4(e,t,s){const i={},r=e.filter(o=>!t.some(n=>n===o));if(r.length>0)for(const o of r)i[o]=Ro({inputValue:o,allSuggestions:s}).values;return i}var Y4=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),YS={moduleName:"Validation",version:H,beans:[j4]},XS={moduleName:"AllCommunity",version:H,dependsOn:[bb,hg,LS,YS,$b,Kb,jb,qb,Yb,Xb,Zb,Ub,MS,TS,DS,AS,PS,IS,kS,BS,db,NS,ql,pb,fb,zS,Fb,yv,HS,jS,Zw,Qg,Eb,qS,qg,Qw,Yg,mc,OS,_S,Sv,Sb,WS]};function K(e,t={}){const s=Object.keys(t).map(i=>{const r=t[i];return r!=null?`${i}=${r}`:null}).filter(Boolean).join(";");return[e,s].filter(i=>i.length>0).join(":")}var z={grid(e){return K("ag-grid-root",{gridId:e})},headerGroupCell(e){return K("ag-header-group-cell",{colId:e})},headerCell(e){return K("ag-header-cell",{colId:e})},headerCheckbox(e){return K("ag-header-selection-checkbox",{colId:e})},headerFilterButton(e){return K("ag-header-cell-filter-button",{colId:e})},floatingFilter(e){return K("ag-floating-filter",{colId:e})},floatingFilterButton(e){return K("ag-floating-filter-button",{colId:e})},headerCellMenuButton(e){return K("ag-header-cell-menu-button",{colId:e})},headerResizeHandle(e){return K("ag-header-cell-resize",{colId:e})},filterInstancePickerDisplay(e){return K(`ag-${e.source}-picker-display`,kc(e))},numberFilterInstanceInput(e){return K(`ag-${e.source}-number-input`,kc(e))},textFilterInstanceInput(e){return K(`ag-${e.source}-text-input`,kc(e))},dateFilterInstanceInput(e){return K(`ag-${e.source}-date-input`,kc(e))},setFilterInstanceMiniFilterInput(e){return K(`ag-${e.source}-set-filter-mini-filter-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},setFilterInstanceItem(e,t){return K(`ag-${e.source}-set-filter-item`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,itemLabel:t}:{colId:e.colId,itemLabel:t})},setFilterApplyPanelButton(e,t){return K(`ag-${e.source}-set-filter-apply-panel-button`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,buttonLabel:t}:{colId:e.colId,buttonLabel:t})},filterConditionRadioButton(e,t){return K(`ag-${e.source}-filter-condition-radio-button`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,buttonLabel:t}:{colId:e.colId,buttonLabel:t})},advancedFilterInput(){return K("ag-advanced-filter-input")},advancedFilterButton(e){return K("ag-advanced-filter-button",{label:e})},advancedFilterBuilderButton(){return K("ag-advanced-filter-builder-button")},advancedFilterPanelMaximiseButton(){return K("ag-advanced-filter-builder-panel-maximise")},advancedFilterPanelCloseButton(){return K("ag-advanced-filter-builder-panel-close")},advancedFilterPill(e){return K("ag-advanced-filter-builder-pill",{label:e})},advancedFilterBuilderAddItemButton(){return K("ag-advanced-filter-builder-add-item-button")},rowNode(e){return K("ag-row",{"row-id":e})},cell(e,t){return K("ag-cell",{"row-id":e,colId:t})},autoGroupCell(e){return z.cell(e,$t)},checkbox(e,t){return K("ag-selection-checkbox",{"row-id":e,colId:t})},selectionColumnCheckbox(e){return z.checkbox(e,vl)},autoGroupColumnCheckbox(e){return z.checkbox(e,$t)},dragHandle(e,t){return K("ag-drag-handle",{"row-id":e,colId:t})},groupContracted(e,t){return K("ag-group-contracted",{"row-id":e,colId:t})},groupExpanded(e,t){return K("ag-group-expanded",{"row-id":e,colId:t})},autoGroupContracted(e){return z.groupContracted(e,$t)},autoGroupExpanded(e){return z.groupExpanded(e,$t)},rowNumber(e){return z.cell(e,En)},menu(){return K("ag-menu")},menuOption(e){return K("ag-menu-option",{option:e})},sideBar(){return K("ag-side-bar")},sideBarButton(e){return K("ag-side-button",{label:e})},columnToolPanel(){return K("ag-column-panel")},pivotModeSelect(){return K("ag-pivot-mode-select")},columnPanelSelectHeaderCheckbox(){return K("ag-column-panel-select-header-checkbox")},columnPanelSelectHeaderFilter(){return K("ag-column-panel-select-header-filter")},columnSelectListItemGroupClosedIcon(e){return K("ag-column-select-list-item-group-closed-icon",{label:e})},columnSelectListItemCheckbox(e){return K("ag-column-select-list-item-checkbox",{label:e})},columnSelectListItemDragHandle(e){return K("ag-column-select-list-item-drag-handle",{label:e})},columnDropCellDragHandle(e,t,s){return K("ag-column-drop-cell-drag-handle",{source:e,area:t,label:s})},columnDropCellCancelButton(e,t,s){return K("ag-column-drop-cell-cancel",{source:e,area:t,label:s})},columnDropArea(e,t){return K("ag-column-drop-area",{source:e,name:t})},filterToolPanel(){return K("ag-filter-panel")},filterToolPanelAddFilterButton(){return K("ag-filter-panel-add-filter-button")},filterToolPanelFilterTypeSelector(e){return K("ag-filter-panel-filter-type-selector",{colLabel:e})},filterToolPanelSearchInput(){return K("ag-filter-toolpanel-search-input")},filterToolPanelGroup(e){return K("ag-filter-toolpanel-group",{title:e})},filterToolPanelGroupCollapsedIcon(e){return K("ag-filter-toolpanel-group-collapsed-icon",{title:e})},statusBarTotalAndFilteredRowCount(){return K("ag-status-bar-total-and-filtered-row-count")},statusBarTotalRowCount(){return K("ag-status-bar-total-row-count")},statusBarFilteredRowCount(){return K("ag-status-bar-filtered-row-count")},statusBarSelectedRowCount(){return K("ag-status-bar-selected-row-count")},statusBarAggregations(){return K("ag-status-bar-aggregations")},paginationPanelSizePickerDisplay(e){return K("ag-pagination-page-size-picker-field-display",{value:e})},paginationPanelFirstRowOnPage(e){return K("ag-paging-row-summary-panel-first-row-on-page",{value:e})},paginationPanelLastRowOnPage(e){return K("ag-paging-row-summary-panel-last-row-on-page",{value:e})},paginationPanelRecordCount(e){return K("ag-paging-row-summary-panel-record-count",{value:e})},paginationSummaryPanelButton(e){return K("ag-paging-page-summary-panel-btn",{label:e})},paginationSummaryPanelCurrentPage(e){return K("ag-paging-page-summary-panel-current-page",{value:e})},paginationSummaryPanelTotalPage(e){return K("ag-paging-page-summary-panel-total-page",{value:e})},fillHandle(){return K("ag-fill-handle")},columnChooserCloseButton(){return K("ag-column-chooser-close-button")},columnChooserSearchBarCheckbox(){return K("ag-column-chooser-header-checkbox")},columnChooserSearchBarFilter(){return K("ag-column-chooser-searchbar-filter")},columnChooserListItemGroupClosedIcon(e){return K("ag-column-chooser-list-item-group-closed-icon",{label:e})},columnChooserListItemCheckbox(e){return K("ag-column-chooser-list-item-checkbox",{label:e})},columnChooserListItemDragHandle(e){return K("ag-column-chooser-list-item-drag-handle",{label:e})},overlay(){return K("ag-overlay")}},X4=e=>{const t={},s=Object.keys(z);for(const i of s)t[i]=(...r)=>e(z[i](...r));return t};function Z4(e,t){const s={};for(const i of Object.keys(e))t[i]!==null&&(s[t[i]??i]=e[i]);return s}function Q4(e){return e.source!=="floating-filter"?{index:0,...e}:e}function kc(e){return Z4(Q4(e),{colLabel:"label"})}var ZS="data-testid";function q(e,t){e?.setAttribute(ZS,t)}function J4(e){ZS=e}var eV=class extends E{constructor(){super(...arguments),this.beanName="testIdSvc"}postConstruct(){const e=Ce(this,()=>this.setupAllTestIds(),500),t=Ce(this,()=>{this.setupAllTestIds(),e()},0);this.addManagedEventListeners({firstDataRendered:t,displayedRowsChanged:t,displayedColumnsChanged:t,displayedColumnsWidthChanged:t,virtualColumnsChanged:t,columnMenuVisibleChanged:t,contextMenuVisibleChanged:t,advancedFilterBuilderVisibleChanged:t,fieldPickerValueSelected:t,modelUpdated:t,sideBarUpdated:t,pinnedHeightChanged:t,gridReady:t,overlayExclusiveChanged:t,rowGroupOpened:t,scrollVisibilityChanged:t,gridSizeChanged:t,filterOpened:t,filterChanged:t,cellSelectionChanged:t})}setupAllTestIds(){const e=It(this.beans),t=gv(this.beans),s=e.querySelector(`[grid-id="${t}"]`);q(s,z.grid(t)),e.querySelectorAll(".ag-header-group-cell").forEach(o=>{q(o,z.headerGroupCell(o.getAttribute("col-id")))}),e.querySelectorAll(".ag-header-cell").forEach(o=>{const n=o.getAttribute("col-id"),l=o.classList.contains("ag-floating-filter")?z.floatingFilter(n):z.headerCell(n);q(o,l),q(o.querySelector(".ag-header-cell-filter-button"),z.headerFilterButton(n)),q(o.querySelector(".ag-header-cell-menu-button"),z.headerCellMenuButton(n)),q(o.querySelector(".ag-header-cell-resize"),z.headerResizeHandle(n)),q(o.querySelector(".ag-checkbox input[type=checkbox]"),z.headerCheckbox(n)),q(o.querySelector(".ag-floating-filter-button button"),z.floatingFilterButton(n)),this.setupFilterInstance(o.querySelector(".ag-floating-filter-body"),{source:"floating-filter",colId:n})});const i=e.querySelector(".ag-filter-menu");this.setupFilterInstance(i,{source:"column-filter"}),q(e.querySelector(".ag-advanced-filter input[type=text]"),z.advancedFilterInput()),e.querySelectorAll(".ag-advanced-filter-buttons button").forEach(o=>{q(o,z.advancedFilterButton(o.textContent))}),q(e.querySelector("button.ag-advanced-filter-builder-button"),z.advancedFilterBuilderButton()),e.querySelectorAll('.ag-panel[aria-label="Advanced Filter"] .ag-panel-title-bar-button').forEach((o,n)=>{q(o,n===0?z.advancedFilterPanelMaximiseButton():z.advancedFilterPanelCloseButton())}),e.querySelectorAll('.ag-panel[aria-lable="Advanced Filter"] .ag-advanced-filter-builder-pill').forEach(o=>{q(o,z.advancedFilterPill(o.querySelector(".ag-picker-field-display")?.textContent))}),q(e.querySelector('.ag-panel[aria-label="Advanced Filter"] .ag-advanced-filter-builder-item-button'),z.advancedFilterBuilderAddItemButton()),e.querySelectorAll(".ag-row").forEach(o=>{const n=o.getAttribute("row-id");q(o,z.rowNode(n)),o.querySelectorAll(".ag-cell").forEach(a=>{const l=a.getAttribute("col-id");q(a,z.cell(n,l)),q(a.querySelector(".ag-selection-checkbox input[type=checkbox]"),z.checkbox(n,l)),q(a.querySelector(".ag-drag-handle"),z.dragHandle(n,l)),q(a.querySelector(".ag-group-contracted"),z.groupContracted(n,l)),q(a.querySelector(".ag-group-expanded"),z.groupExpanded(n,l))})}),e.querySelectorAll(".ag-menu-list").forEach(o=>{q(o,z.menu()),o.querySelectorAll(".ag-menu-option").forEach(n=>{q(n,z.menuOption(n.querySelector(".ag-menu-option-text")?.textContent))})}),e.querySelectorAll(".ag-side-bar").forEach(o=>{q(o,z.sideBar()),o.querySelectorAll(".ag-side-button button").forEach(n=>{q(n,z.sideBarButton(n.querySelector(".ag-side-button-label")?.textContent))}),o.querySelectorAll(".ag-column-panel").forEach(n=>{q(n,z.columnToolPanel()),q(n.querySelector(".ag-pivot-mode-select input[type=checkbox]"),z.pivotModeSelect()),q(n.querySelector(".ag-column-select-header-checkbox input[type=checkbox]"),z.columnPanelSelectHeaderCheckbox()),q(n.querySelector(".ag-column-select-header-filter-wrapper input[type=text]"),z.columnPanelSelectHeaderFilter()),n.querySelectorAll(".ag-column-select-list").forEach(a=>{a.querySelectorAll(".ag-column-select-virtual-list-item").forEach(l=>{const c=l.getAttribute("aria-label");q(l.querySelector(".ag-column-group-closed-icon"),z.columnSelectListItemGroupClosedIcon(c)),q(l.querySelector(".ag-column-select-checkbox input[type=checkbox]"),z.columnSelectListItemCheckbox(c)),q(l.querySelector(".ag-drag-handle"),z.columnSelectListItemDragHandle(c))})}),this.setupColumnDropArea(n,"toolbar")}),o.querySelectorAll(".ag-filter-panel").forEach(n=>{q(n,z.filterToolPanel()),q(n.querySelector("button.ag-filter-add-button"),z.filterToolPanelAddFilterButton()),n.querySelectorAll(".ag-filter-card").forEach(a=>{const l=a.querySelector(".ag-filter-card-title")?.textContent,c=a.querySelector(".ag-filter-type-select");q(c,z.filterToolPanelFilterTypeSelector(l)),a.querySelectorAll(".ag-filter").forEach(d=>this.setupFilterInstance(d,{source:"filter-toolpanel",colLabel:l}))})}),o.querySelectorAll(".ag-filter-toolpanel").forEach(n=>{q(n.querySelector(".ag-filter-toolpanel-search-input input[type=text]"),z.filterToolPanelSearchInput()),n.querySelectorAll(".ag-filter-toolpanel-group").forEach(a=>{const l=a.querySelector(".ag-filter-toolpanel-group-title")?.textContent;q(a,z.filterToolPanelGroup(l)),q(a.querySelector(".ag-filter-toolpanel-group-title-bar-icon .ag-icon-tree-closed"),z.filterToolPanelGroupCollapsedIcon(l));const c=a.querySelector(".ag-filter-toolpanel-instance-filter");c&&this.setupFilterInstance(c,{source:"filter-toolpanel",colLabel:l})})})}),q(e.querySelector(".ag-status-bar .ag-status-panel-total-and-filtered-row-count"),z.statusBarTotalAndFilteredRowCount()),q(e.querySelector(".ag-status-bar .ag-status-panel-total-row-count"),z.statusBarTotalRowCount()),q(e.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"),z.statusBarFilteredRowCount()),q(e.querySelector(".ag-status-bar .ag-status-panel-selected-row-count"),z.statusBarSelectedRowCount()),q(e.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"),z.statusBarAggregations()),e.querySelectorAll(".ag-paging-panel").forEach(o=>{q(o.querySelector(".ag-paging-page-size .ag-picker-field-display"),z.paginationPanelSizePickerDisplay(o.querySelector(".ag-paging-page-size .ag-picker-field-display")?.textContent)),o.querySelectorAll(".ag-paging-row-summary-panel-number").forEach(n=>{switch(n.getAttribute("data-ref")){case"lbFirstRowOnPage":q(n,z.paginationPanelFirstRowOnPage(n.textContent));break;case"lbLastRowOnPage":q(n,z.paginationPanelLastRowOnPage(n.textContent));break;case"lbRecordCount":q(n,z.paginationPanelRecordCount(n.textContent));break}}),o.querySelectorAll(".ag-paging-page-summary-panel .ag-button").forEach(n=>{q(n,z.paginationSummaryPanelButton(n.getAttribute("aria-label")?.toLowerCase()))}),o.querySelectorAll(".ag-paging-page-summary-panel .ag-paging-number").forEach(n=>{switch(n.getAttribute("data-ref")){case"lbCurrent":q(n,z.paginationSummaryPanelCurrentPage(n.textContent));break;case"lbTotal":q(n,z.paginationSummaryPanelTotalPage(n.textContent));break}})}),q(e.querySelector(".ag-fill-handle"),z.fillHandle()),e.querySelectorAll('.ag-panel[aria-label="Choose Columns"]').forEach(o=>{q(o.querySelector(".ag-panel-title-bar-button-icon"),z.columnChooserCloseButton()),q(o.querySelector('.ag-column-select-header-checkbox input[type="checkbox"]'),z.columnChooserSearchBarCheckbox()),q(o.querySelector('.ag-column-select-header-filter-wrapper input[type="text"]'),z.columnChooserSearchBarFilter()),o.querySelectorAll(".ag-column-select-list").forEach(n=>{n.querySelectorAll(".ag-column-select-virtual-list-item").forEach(a=>{const l=a.getAttribute("aria-label");q(a.querySelector(".ag-column-group-closed-icon"),z.columnChooserListItemGroupClosedIcon(l)),q(a.querySelector(".ag-column-select-checkbox input[type=checkbox]"),z.columnChooserListItemCheckbox(l)),q(a.querySelector(".ag-drag-handle"),z.columnChooserListItemDragHandle(l))})})}),q(e.querySelector(".ag-overlay-wrapper"),z.overlay());const r=e.querySelector(".ag-column-drop-wrapper");r&&this.setupColumnDropArea(r,"panel")}setupFilterInstance(e,t){if(!e)return;e.querySelectorAll(".ag-filter-select .ag-picker-field-display").forEach(r=>{q(r,z.filterInstancePickerDisplay(t))});const s=t.source==="floating-filter"?".ag-floating-filter-body":".ag-filter-body";e.querySelectorAll(`${s} .ag-input-field:not(.ag-hidden) input[type="number"]`).forEach((r,o,n)=>{const l=n.length>1?{...t,index:o}:t;q(r,z.numberFilterInstanceInput(l))}),e.querySelectorAll(`${s} .ag-input-field:not(.ag-hidden) input[type="text"]`).forEach((r,o,n)=>{const l=n.length>1?{...t,index:o}:t;q(r,z.textFilterInstanceInput(l))}),e.querySelectorAll(`${s} .ag-input-field:not(.ag-hidden) input[type="date"]`).forEach((r,o,n)=>{const l=n.length>1?{...t,index:o}:t;q(r,z.dateFilterInstanceInput(l))});const i=e.querySelector('.ag-mini-filter input[type="text"]');q(i,z.setFilterInstanceMiniFilterInput(t)),e.querySelectorAll(".ag-set-filter-list .ag-set-filter-item").forEach(r=>{const o=r.querySelector(".ag-checkbox-label")?.textContent,n=r.querySelector('input[type="checkbox"]');q(n,z.setFilterInstanceItem(t,o))}),e.querySelectorAll(".ag-filter-apply-panel button").forEach(r=>{q(r,z.setFilterApplyPanelButton(t,r.textContent))}),e.querySelectorAll(".ag-filter-condition .ag-radio-button").forEach(r=>{const o=r.querySelector(".ag-radio-button-label")?.textContent;q(r.querySelector("input[type=radio]"),z.filterConditionRadioButton(t,o))})}setupColumnDropArea(e,t){e.querySelectorAll(".ag-column-drop").forEach(s=>{const i=s.querySelector(".ag-column-drop-list")?.getAttribute("aria-label");q(s,z.columnDropArea(t,i)),s.querySelectorAll(".ag-column-drop-cell").forEach(r=>{const o=r.querySelector(".ag-column-drop-cell-text")?.textContent;q(r.querySelector(".ag-drag-handle"),z.columnDropCellDragHandle(t,i,o)),q(r.querySelector(".ag-column-drop-cell-button .ag-icon-cancel"),z.columnDropCellCancelButton(t,i,o))})})}},tV={moduleName:"Testing",version:H,beans:[eV]};function sV({testIdAttribute:e}={}){e&&J4(e),nl.registerModules([tV])}var Lc=class extends E{constructor(){super(...arguments),this.dispatchColumnChangedEvent=Iv,this.columns=[],this.columnIndexMap={},this.updateIndexMap=()=>{this.columnIndexMap={},this.columns.forEach((e,t)=>this.columnIndexMap[e.getId()]=t)}}wireBeans(e){this.colModel=e.colModel,this.aggFuncSvc=e.aggFuncSvc,this.visibleCols=e.visibleCols,this.groupHierarchCols=e.groupHierarchyColSvc}sortColumns(e){const{groupHierarchCols:t}=this;this.columns.sort((s,i)=>t?.compareVirtualColumns(s,i)??e(s,i)),this.updateIndexMap()}setColumns(e,t){this.setColList(e,this.columns,this.eventName,!0,!0,this.columnProcessors.set,t)}addColumns(e,t){this.updateColList(e,this.columns,!0,!0,this.columnProcessors.add,this.eventName,t)}removeColumns(e,t){this.updateColList(e,this.columns,!1,!0,this.columnProcessors.remove,this.eventName,t)}getColumnIndex(e){return this.columnIndexMap[e]}setColList(e=[],t,s,i,r,o,n){const a=this.colModel.getCols();if(!a||a.length===0)return;const l=new Map;t.forEach((d,u)=>l.set(d,u)),t.length=0;for(const d of e){const u=this.colModel.getColDefCol(d);u&&t.push(u)}t.forEach((d,u)=>{const h=l.get(d);if(h===void 0){l.set(d,0);return}i&&h!==u||l.delete(d)}),this.updateIndexMap();const c=this.colModel.getColDefCols();for(const d of c??[]){const u=t.indexOf(d)>=0;o(d,u,n)}r&&this.colModel.refreshCols(!1,n),this.visibleCols.refresh(n),this.dispatchColumnChangedEvent(this.eventSvc,s,[...l.keys()],n)}updateColList(e=[],t,s,i,r,o,n){if(!e||e.length===0)return;let a=!1;const l=new Set;for(const d of e){if(!d)continue;const u=this.colModel.getColDefCol(d);if(u){if(l.add(u),s){if(t.indexOf(u)>=0)continue;t.push(u)}else{const h=t.indexOf(u);if(h<0)continue;for(let g=h+1;g=0:m?w!==void 0?R=w:y!==void 0?R=y!=null&&y>=0:R=!1:R=s.indexOf(f)>=0,R&&((m?S!=null||y!=null:S!=null)?i.push(f):r.push(f))}const u=f=>{const m=f.getColDef();return n(m)??a(m)};i.sort((f,m)=>u(f)-u(m));const h=[],g=this.groupHierarchCols,p=f=>{g?g.expandColumnInto(h,f):h.push(f)};i.forEach(p);for(const f of s)r.indexOf(f)>=0&&p(f);for(const f of r)h.indexOf(f)<0&&p(f);for(const f of s)h.indexOf(f)<0&&o(f,!1,e);for(const f of h)s.indexOf(f)<0&&o(f,!0,e);return this.columns=h,this.updateIndexMap(),this.columns}restoreColumnOrder(e,t){const s=this.columns,i=this.colModel.getColDefCols();if(!s.length||!i)return e;const r=Object.keys(t),o=new Set(r),n=new Set(r),a=new Set(s.map(w=>{const S=w.getColId();return n.delete(S),S}).concat(r)),l=[],c={};let d=0;for(let w=0;w{const S=c[w];for(let y=g;ythis.syncValueFromDom(),blur:()=>this.syncValueFromDom(!0)}),this.renderValueToElement&&this.value!=null&&this.refreshDisplayedValue(this.value)}setupAria(){const e=this.getAriaElement();Ie(e,this.config.ariaRole??"textbox"),e.setAttribute("tabindex",this.gos.get("tabIndex").toString())}setupEditable(){const e=this.config.contentEditable??"plaintext-only";e===!1?this.eWrapper.removeAttribute("contenteditable"):e===!0?this.eWrapper.setAttribute("contenteditable","true"):this.eWrapper.setAttribute("contenteditable",e)}setValue(e,t){const s=super.setValue(e,t);return this.renderValueToElement&&!t&&this.refreshDisplayedValue(e),s}setRenderValueToElement(e){this.renderValueToElement=e}setDisplayedValue(e){this.refreshDisplayedValue(e??"")}getContentElement(){return this.eWrapper}refreshDisplayedValue(e){this.eWrapper.textContent=e??""}syncValueFromDom(e){super.setValue(this.eWrapper.textContent??"",e)}getFocusableElement(){return this.eWrapper}},lV={selector:"AG-CONTENT-EDITABLE-FIELD",component:Jg},cV='.ag-toggle-button{flex:none;min-width:unset;width:unset}.ag-toggle-button-input-wrapper{background-color:var(--ag-toggle-button-off-background-color);border-radius:calc(var(--ag-toggle-button-height)*.5);flex:none;height:var(--ag-toggle-button-height);max-width:var(--ag-toggle-button-width);min-width:var(--ag-toggle-button-width);position:relative;transition:background-color .1s;:where(.ag-toggle-button-input){-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-toggle-button-height);margin:0;max-width:var(--ag-toggle-button-width);min-width:var(--ag-toggle-button-width);opacity:0}&.ag-checked{background-color:var(--ag-toggle-button-on-background-color)}&.ag-disabled{opacity:.5}}.ag-toggle-button-input-wrapper:before{background-color:var(--ag-toggle-button-switch-background-color);border-radius:100%;content:"";display:block;height:calc(var(--ag-toggle-button-height) - var(--ag-toggle-button-switch-inset)*2);left:var(--ag-toggle-button-switch-inset);pointer-events:none;position:absolute;top:var(--ag-toggle-button-switch-inset);transition:left .1s;width:calc(var(--ag-toggle-button-height) - var(--ag-toggle-button-switch-inset)*2)}.ag-toggle-button-input-wrapper.ag-checked:before{left:calc(100% - var(--ag-toggle-button-height) + var(--ag-toggle-button-switch-inset))}.ag-toggle-button-input-wrapper:focus-within{box-shadow:var(--ag-focus-shadow)}',Vr=class extends Vi{constructor(e){super(e,"ag-toggle-button"),this.registerCSS(cV)}setValue(e,t){return super.setValue(e,t),this.toggleCss("ag-selected",this.getValue()),this}},QS={selector:"AG-TOGGLE-BUTTON",component:Vr},dV=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let s=e[0],i=e[1],r=e[2],o=e[3];s=this.ff(s,i,r,o,t[0],7,-680876936),o=this.ff(o,s,i,r,t[1],12,-389564586),r=this.ff(r,o,s,i,t[2],17,606105819),i=this.ff(i,r,o,s,t[3],22,-1044525330),s=this.ff(s,i,r,o,t[4],7,-176418897),o=this.ff(o,s,i,r,t[5],12,1200080426),r=this.ff(r,o,s,i,t[6],17,-1473231341),i=this.ff(i,r,o,s,t[7],22,-45705983),s=this.ff(s,i,r,o,t[8],7,1770035416),o=this.ff(o,s,i,r,t[9],12,-1958414417),r=this.ff(r,o,s,i,t[10],17,-42063),i=this.ff(i,r,o,s,t[11],22,-1990404162),s=this.ff(s,i,r,o,t[12],7,1804603682),o=this.ff(o,s,i,r,t[13],12,-40341101),r=this.ff(r,o,s,i,t[14],17,-1502002290),i=this.ff(i,r,o,s,t[15],22,1236535329),s=this.gg(s,i,r,o,t[1],5,-165796510),o=this.gg(o,s,i,r,t[6],9,-1069501632),r=this.gg(r,o,s,i,t[11],14,643717713),i=this.gg(i,r,o,s,t[0],20,-373897302),s=this.gg(s,i,r,o,t[5],5,-701558691),o=this.gg(o,s,i,r,t[10],9,38016083),r=this.gg(r,o,s,i,t[15],14,-660478335),i=this.gg(i,r,o,s,t[4],20,-405537848),s=this.gg(s,i,r,o,t[9],5,568446438),o=this.gg(o,s,i,r,t[14],9,-1019803690),r=this.gg(r,o,s,i,t[3],14,-187363961),i=this.gg(i,r,o,s,t[8],20,1163531501),s=this.gg(s,i,r,o,t[13],5,-1444681467),o=this.gg(o,s,i,r,t[2],9,-51403784),r=this.gg(r,o,s,i,t[7],14,1735328473),i=this.gg(i,r,o,s,t[12],20,-1926607734),s=this.hh(s,i,r,o,t[5],4,-378558),o=this.hh(o,s,i,r,t[8],11,-2022574463),r=this.hh(r,o,s,i,t[11],16,1839030562),i=this.hh(i,r,o,s,t[14],23,-35309556),s=this.hh(s,i,r,o,t[1],4,-1530992060),o=this.hh(o,s,i,r,t[4],11,1272893353),r=this.hh(r,o,s,i,t[7],16,-155497632),i=this.hh(i,r,o,s,t[10],23,-1094730640),s=this.hh(s,i,r,o,t[13],4,681279174),o=this.hh(o,s,i,r,t[0],11,-358537222),r=this.hh(r,o,s,i,t[3],16,-722521979),i=this.hh(i,r,o,s,t[6],23,76029189),s=this.hh(s,i,r,o,t[9],4,-640364487),o=this.hh(o,s,i,r,t[12],11,-421815835),r=this.hh(r,o,s,i,t[15],16,530742520),i=this.hh(i,r,o,s,t[2],23,-995338651),s=this.ii(s,i,r,o,t[0],6,-198630844),o=this.ii(o,s,i,r,t[7],10,1126891415),r=this.ii(r,o,s,i,t[14],15,-1416354905),i=this.ii(i,r,o,s,t[5],21,-57434055),s=this.ii(s,i,r,o,t[12],6,1700485571),o=this.ii(o,s,i,r,t[3],10,-1894986606),r=this.ii(r,o,s,i,t[10],15,-1051523),i=this.ii(i,r,o,s,t[1],21,-2054922799),s=this.ii(s,i,r,o,t[8],6,1873313359),o=this.ii(o,s,i,r,t[15],10,-30611744),r=this.ii(r,o,s,i,t[6],15,-1560198380),i=this.ii(i,r,o,s,t[13],21,1309151649),s=this.ii(s,i,r,o,t[4],6,-145523070),o=this.ii(o,s,i,r,t[11],10,-1120210379),r=this.ii(r,o,s,i,t[2],15,718787259),i=this.ii(i,r,o,s,t[9],21,-343485551),e[0]=this.add32(s,e[0]),e[1]=this.add32(i,e[1]),e[2]=this.add32(r,e[2]),e[3]=this.add32(o,e[3])}cmn(e,t,s,i,r,o){return t=this.add32(this.add32(t,e),this.add32(i,o)),this.add32(t<>>32-r,s)}ff(e,t,s,i,r,o,n){return this.cmn(t&s|~t&i,e,t,r,o,n)}gg(e,t,s,i,r,o,n){return this.cmn(t&i|s&~i,e,t,r,o,n)}hh(e,t,s,i,r,o,n){return this.cmn(t^s^i,e,t,r,o,n)}ii(e,t,s,i,r,o,n){return this.cmn(s^(t|~i),e,t,r,o,n)}md51(e){const t=e.length,s=[1732584193,-271733879,-1732584194,271733878];let i;for(i=64;i<=e.length;i+=64)this.md5cycle(s,this.md5blk(e.substring(i-64,i)));e=e.substring(i-64);const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i>2]|=e.charCodeAt(i)<<(i%4<<3);if(r[i>>2]|=128<<(i%4<<3),i>55)for(this.md5cycle(s,r),i=0;i<16;i++)r[i]=0;return r[14]=t*8,this.md5cycle(s,r),s}md5blk(e){const t=[];for(let s=0;s<64;s+=4)t[s>>2]=e.charCodeAt(s)+(e.charCodeAt(s+1)<<8)+(e.charCodeAt(s+2)<<16)+(e.charCodeAt(s+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let s="",i=0;for(;i<4;i++)s+=t[e>>i*8+4&15]+t[e>>i*8&15];return s}hex(e){for(let t=0;t>16)+(t>>16)+(s>>16)<<16|s&65535}},Gc={"01":"GRID","02":"CHARTS","0102":"BOTH"},JS="https://www.ag-grid.com/licensing/",ey=class Wt{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new dV,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(Wt.licenseKey),s=`AG Grid ${t.currentLicenseType==="BOTH"?"and AG Charts ":""}Enterprise`,i=t.suppliedLicenseType===void 0?"":`AG ${t.suppliedLicenseType==="BOTH"?"Grid and AG Charts":t.suppliedLicenseType==="GRID"?"Grid":"Charts"} Enterprise`;if(t.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(s);else if(t.expired){const r=Wt.getGridReleaseDate(),o=Wt.formatDate(r);this.outputExpiredKey(t.expiry,o,s,i)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,s,i):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,s,i)}static extractExpiry(t){const s=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(Wt.decode(s),10))}static extractLicenseComponents(t){let s=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(s=s.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const i=s.length-32,r=s.substring(i),o=s.substring(0,i),[n,a,l]=Wt.extractBracketedInformation(s);return{md5:r,license:o,version:n,isTrial:a,type:l}}getLicenseDetails(t){const s=Wt.chartsLicenseManager?"BOTH":"GRID";if(!t?.length)return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};const i=Wt.getGridReleaseDate(),{md5:r,license:o,version:n,isTrial:a,type:l}=Wt.extractLicenseComponents(t);let c=r===this.md5.md5(o)&&!t.includes("For_Trialing_ag-Grid_Only"),d,u,h=null,g=!1,p;function f(){d=hh,n){case"legacy":case"2":{a&&f();break}case"3":l?.length?(p=l,l!==Gc["01"]&&l!==Gc["0102"]||s==="BOTH"&&p!=="BOTH"?(c=!1,g=!0):a&&f()):c=!1}return c?{licenseKey:t,valid:c,expiry:Wt.formatDate(h),expired:u,version:n,isTrial:a,trialExpired:d,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:p}:{licenseKey:t,valid:c,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:p}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!!this.watermarkMessage?.length}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){const s=(this.document.defaultView||window).location,{hostname:i=""}=s;return i}isForceWatermark(){const s=(this.document.defaultView||window).location,{pathname:i}=s;return i?i.includes("forceWatermark"):!1}isWebsiteUrl(){return this.getHostname().match(/^(?:[\w-]+\.)?(ag-grid|bryntum)\.com$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(t){const s=["January","February","March","April","May","June","July","August","September","October","November","December"],i=t.getDate(),r=t.getMonth(),o=t.getFullYear();return i+" "+s[r]+" "+o}static getGridReleaseDate(){return new Date(parseInt(Wt.decode(Wt.RELEASE_INFORMATION),10))}static decode(t){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i="",r,o,n,a,l,c,d,u=0;const h=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;u>4,o=(l&15)<<4|c>>2,n=(c&3)<<6|d,i=i+String.fromCharCode(r),c!=64&&(i=i+String.fromCharCode(o)),d!=64&&(i=i+String.fromCharCode(n));return i=Wt.utf8_decode(i),i}static utf8_decode(t){t=t.replace(/rn/g,"n");let s="";for(let i=0;i127&&r<2048?(s+=String.fromCharCode(r>>6|192),s+=String.fromCharCode(r&63|128)):(s+=String.fromCharCode(r>>12|224),s+=String.fromCharCode(r>>6&63|128),s+=String.fromCharCode(r&63|128))}return s}static setChartsLicenseManager(t){this.chartsLicenseManager=t,this.chartsLicenseManager?.setLicenseKey(this.licenseKey,!0)}static setLicenseKey(t){D(this.licenseKey)&&this.licenseKey!==t&&Nm(291,void 0,"AG Grid: License Key being set multiple times with different values. This can result in an incorrect license key being used."),this.licenseKey=t,this.chartsLicenseManager?.setLicenseKey(t,!0)}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const s=t.match(/\[(.*?)\]/g).map(a=>a.replace("[","").replace("]",""));if(!s||s.length===0)return["legacy",!1,void 0];const i=s.filter(a=>a==="TRIAL").length===1,r=s.filter(a=>a.indexOf("v")===0)[0],o=r?r.replace("v",""):"legacy",n=Gc[s.filter(a=>Gc[a])[0]];return[o,i,n]}centerPadAndOutput(t){const s=this.totalMessageLength-t.length;console.error(t.padStart(s/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,s="*",i=""){console.error(t.padEnd(this.totalMessageLength-i.length,s)+i)}outputInvalidLicenseKey(t,s,i){t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${i} only and does not cover you for ${s}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${JS}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${JS}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,s,i){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${i} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,s,i,r){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions${r==""?"":` of ${r}`} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${s}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="License Expired"}};ey.RELEASE_INFORMATION="MTc3NTU1MDg5NDgwOQ==";var pa=ey,uV='.ag-watermark{bottom:20px;color:#9b9b9b;opacity:.7;position:absolute;transition:opacity 1s ease-out 3s}:where(.ag-ltr) .ag-watermark{right:25px}:where(.ag-rtl) .ag-watermark{left:25px}.ag-watermark:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDkiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMDkgMzYiPjxwYXRoIGZpbGw9IiM5YjliOWIiIGQ9Ik0xOTIuOTkzIDIzLjY1OHYtNy45NDZoLTEzLjU0MWwtNy45NDcgNy45NDZ6TTIwOC4yNSAzLjk1aC0xNi45NzRsLTguMDEgNy45NDdoMjQuOTg0ek0xNjMuNjIyIDMxLjYwNWw0LjA2OS00LjA2OWgxMy43MzJ2Ny45NDdoLTE3LjgwMXoiLz48cGF0aCBmaWxsPSIjOWI5YjliIiBkPSJNMTY2LjYxIDE5Ljc4aDguNzczbDguMDEtNy45NDZIMTY2LjYxek0xNTcuMDExIDMxLjYwNWg2LjYxMWw3Ljg4My03Ljk0N2gtMTQuNDk0ek0xOTEuMjc2IDMuOTVsLTQuMDY4IDQuMDdIMTYxLjI3Vi4wNzJoMzAuMDA2ek0yMC44NCAzMC4yMDZIOC4zNzhsLTIuMTYyIDUuMzRILjc1TDEyLjI1NyA4LjU5Mmg0Ljc2OEwyOC41MyAzNS41NDZoLTUuNTN6bS0xLjcxNy00LjI2TDE0LjYwOSAxNC45NWwtNC41MTQgMTAuOTk4ek0xMDQuNDM3IDE4LjUwOWMxLjU4OS0yLjM1MiA1LjU5NC0yLjYwNyA3LjI0Ny0yLjYwN3Y0LjU3OGMtMi4wMzQgMC00LjA2OS4wNjMtNS4yNzcuOTUzLTEuMjA3Ljg5LTEuODQzIDIuMDk4LTEuODQzIDMuNTZ2MTAuNTUzaC00Ljk1OVYxNS45MDJoNC43Njh6TTExOS4zNzYgMTUuOTAyaC00Ljk1OHYxOS42NDRoNC45NTh6TTExOS4zNzYgNy4xM2gtNC45NTh2NS44NDhoNC45NTh6TTE0My45NzkgNy4xM3YyOC40MTZoLTQuNzY4bC0uMTI3LTIuOTg4YTguMyA4LjMgMCAwIDEtMi42NyAyLjQ4Yy0xLjA4MS41NzItMi40MTYuODktMy45NDIuODktMS4zMzUgMC0yLjYwNi0uMjU1LTMuNjg3LS43LTEuMTQ0LS41MDgtMi4xNjItMS4xNDQtMi45ODgtMi4wMzRhOS42IDkuNiAwIDAgMS0xLjk3MS0zLjE3OWMtLjUwOC0xLjIwNy0uNjk5LTIuNjA2LS42OTktNC4xMzJzLjI1NC0yLjkyNC42OTktNC4xOTZjLjUwOS0xLjI3MSAxLjE0NS0yLjM1MiAxLjk3MS0zLjI0MnMxLjg0NC0xLjU4OSAyLjk4OC0yLjA5OCAyLjM1Mi0uNzYzIDMuNjg3LS43NjNjMS41MjYgMCAyLjc5Ny4yNTUgMy44NzguODI3czEuOTcxIDEuMzM1IDIuNjcgMi40MTZWNy4xOTNoNC45NTl6bS0xMC40MjYgMjQuNTM4YzEuNjUzIDAgMi45MjQtLjU3MiAzLjk0MS0xLjY1M3MxLjUyNi0yLjU0MyAxLjUyNi00LjMyMy0uNTA5LTMuMTc4LTEuNTI2LTQuMzIyYy0xLjAxNy0xLjA4MS0yLjI4OC0xLjY1My0zLjk0MS0xLjY1My0xLjU5IDAtMi45MjUuNTcyLTMuODc4IDEuNjUzLTEuMDE3IDEuMDgtMS41MjYgMi41NDMtMS41MjYgNC4zMjIgMCAxLjc4LjUwOSAzLjE4IDEuNTI2IDQuMjYgMS4wMTcgMS4xNDQgMi4yODggMS43MTYgMy44NzggMS43MTZNNTcuMjAyIDIwLjM1M0g0NC45MzN2NC4yNTloNi45OTNjLS4xOSAyLjE2MS0xLjAxNyAzLjgxNC0yLjQxNiA1LjE1LTEuMzk4IDEuMjctMy4xNzggMS45MDYtNS40NjcgMS45MDYtMS4yNzEgMC0yLjQ4LS4yNTQtMy40OTYtLjY5OWE3IDcgMCAwIDEtMi43MzQtMS45N2MtLjc2My0uODI3LTEuMzM1LTEuODQ0LTEuNzgtMy4wNTJzLS42MzYtMi40OC0uNjM2LTMuOTQyLjE5LTIuNzMzLjYzNi0zLjk0MWMuMzgxLTEuMjA4IDEuMDE3LTIuMTYyIDEuNzgtMy4wNTIuNzYzLS44MjYgMS42NTMtMS40NjIgMi43MzMtMS45N2E5LjEgOS4xIDAgMCAxIDMuNTYtLjdxNC4wMDUgMCA2LjEwMyAxLjkwN2wzLjMwNi0zLjMwNWMtMi40OC0xLjkwNy01LjY1OC0yLjkyNS05LjQwOS0yLjkyNS0yLjA5NyAwLTQuMDA0LjMxOC01LjcyMSAxLjAxOC0xLjcxNi42OTktMy4xNzkgMS41ODktNC4zODYgMi43OTdBMTIuMSAxMi4xIDAgMCAwIDMxLjIgMTYuMjJjLS42MzUgMS43MTctLjk1MyAzLjYyNC0uOTUzIDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1NyAxLjAxNyAyLjAzNSAwIDMuODc4LS4zMTggNS41MzEtMS4wMTcgMS42NTMtLjcgMy4wNTItMS41OSA0LjE5Ni0yLjc5N3ExLjcxNi0xLjgxMiAyLjY3LTQuMzg3Yy42MzYtMS43MTYuOTU0LTMuNjIzLjk1NC01LjY1OHYtLjgyNmMtLjE5MS0uMTI3LS4yNTUtLjQ0NS0uMjU1LS43TTk1Ljk4MiAyMC4zNTNoLTEyLjI3djQuMjU5aDYuOTkzYy0uMTkgMi4xNjEtMS4wMTcgMy44MTQtMi40MTYgNS4xNS0xLjM5OCAxLjI3LTMuMTc4IDEuOTA2LTUuNDY3IDEuOTA2LTEuMjcxIDAtMi40OC0uMjU0LTMuNDk2LS42OTlhNyA3IDAgMCAxLTIuNzM0LTEuOTdjLS43NjMtLjgyNy0xLjMzNS0xLjg0NC0xLjc4LTMuMDUycy0uNjM2LTIuNDgtLjYzNi0zLjk0Mi4xOS0yLjczMy42MzYtMy45NDFjLjM4MS0xLjIwOCAxLjAxNy0yLjE2MiAxLjc4LTMuMDUyLjc2My0uODI2IDEuNjUzLTEuNDYyIDIuNzM0LTEuOTdhOS4xIDkuMSAwIDAgMSAzLjU2LS43cTQuMDA1IDAgNi4xMDMgMS45MDdsMy4zMDUtMy4zMDVjLTIuNDc5LTEuOTA3LTUuNjU4LTIuOTI1LTkuNDA4LTIuOTI1LTIuMDk4IDAtNC4wMDUuMzE4LTUuNzIyIDEuMDE4LTEuNzE2LjY5OS0zLjE3OCAxLjU4OS00LjM4NiAyLjc5N2ExMi4xIDEyLjEgMCAwIDAtMi43OTcgNC4zODZjLS42MzYgMS43MTctLjk1NCAzLjYyNC0uOTU0IDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1OCAxLjAxNyAyLjAzNCAwIDMuODc4LS4zMTggNS41My0xLjAxNyAxLjY1My0uNyAzLjA1Mi0xLjU5IDQuMTk2LTIuNzk3cTEuNzE4LTEuODEyIDIuNjctNC4zODdjLjYzNi0xLjcxNi45NTQtMy42MjMuOTU0LTUuNjU4di0uODI2Yy0uMTktLjEyNy0uMjU1LS40NDUtLjI1NS0uNyIvPjwvc3ZnPg==");background-repeat:no-repeat;background-size:170px 40px;content:"";display:block;height:40px;width:170px}.ag-watermark-text{font-family:Impact,sans-serif;font-size:19px;font-weight:700;opacity:.5}:where(.ag-ltr) .ag-watermark-text{padding-left:.7rem}:where(.ag-rtl) .ag-watermark-text{padding-right:.7rem}',hV={tag:"div",cls:"ag-watermark",children:[{tag:"div",ref:"eLicenseTextRef",cls:"ag-watermark-text"}]},gV=class extends A{constructor(){super(hV),this.eLicenseTextRef=x,this.registerCSS(uV)}wireBeans(e){this.licenseManager=e.licenseManager}postConstruct(){const e=this.shouldDisplayWatermark();this.setDisplayed(e),e&&(this.eLicenseTextRef.textContent=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCss("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5e3))}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},pV={selector:"AG-WATERMARK",component:gV},ep=class extends E{constructor(){super(...arguments),this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){const e=this.beans;if(e.withinStudio)this.licenseManager={isDisplayWatermark:()=>!1,getWatermarkMessage:()=>""};else{const t=new pa(me(e));this.licenseManager=t,t.validateLicense()}}static getLicenseDetails(e){return new pa(null).getLicenseDetails(e)}getWatermarkSelector(){return pV}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){pa.setLicenseKey(e)}static setChartsLicenseManager(e){pa.setChartsLicenseManager(e)}},fV=9525,ty={0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49},Oc=`\r `;function sy(e,t,s){if(!t&&t!==""&&t!==0)return"";let i=t;return typeof t=="boolean"&&s&&(i=s(t)),` ${e}="${i}"`}function mV(e={}){const t="",i=["version"];e.version||(e.version="1.0"),e.encoding&&i.push("encoding"),e.standalone&&i.push("standalone");const r=i.map(o=>`${o}="${e[o]}"`).join(" ");return`${t}xml ${r} ${s}`}function iy(e,t){let s="";if(e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(r=>{for(const o of Object.keys(r.map))s+=sy(r.prefix+o,r.map[o],t)}),e.properties.rawMap))for(const r of Object.keys(e.properties.rawMap))s+=sy(r,e.properties.rawMap[r],t);let i="<"+e.name+s;if(!e.children&&e.textNode==null)return i+"/>"+Oc;if(e.textNode!=null)return i+">"+e.textNode+""+Oc;if(i+=">"+Oc,e.children)for(const r of e.children)i+=iy(r,t);return i+""+Oc}var CV=e=>Math.round(e*96/72),Io=e=>Math.ceil(e*fV),vV=e=>{if(e===void 0)return;const s=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(e||"Automatic");return Math.max(s,0)},Vc=(e,t)=>{if(!t)return;let s;return typeof t=="number"?s=t:s=t({rowIndex:e}),s},wV=(e,t)=>{const{colSpan:s,column:i}=e.position;if(e.width)if(s){const r=t.slice(i-1,i+s-1);let o=0;for(let n=0;n{const{rowSpan:s,row:i}=e.position;if(e.height)if(s){let r=0,o=0;for(let n=i;n{const s=mV({encoding:"UTF-8",standalone:"yes"}),i=iy(e);return t?i:`${s}${i}`},Br=e=>{const i=String.fromCharCode,r=Math.floor(e/26),o=e%26;return!r||e===26?i(65+e-1):o?r<26?i(65+r-1)+i(65+o-1):Br(r)+i(65+o-1):Br(r-1)+"Z"},SV=e=>e.replaceAll(` `,"_x000a_"),Bc=e=>{if(e==null)return null;let t="";for(let s=0;s=0&&i<=31&&i!==10){const n=`_x${i.toString(16).toUpperCase().padStart(4,"0")}_`;t+=n}else t+=e[s]}return t},yV=e=>{const t=[];for(const s of e.keys()){const i=s.toString(),r={name:"t",textNode:pt(Bc(i))};i.trim().length!==i.length&&(r.properties={rawMap:{"xml:space":"preserve"}}),t.push({name:"si",children:[r]})}return t},xV=class extends ug{constructor(e){super(e),this.mixedStyles={},this.mixedStyleCounter=0,this.rows=[],this.frozenRowCount=0,this.skipFrozenRows=!1,this.frozenColumnCount=0,this.skipFrozenColumns=!1,this.formulaSvc=e.formulaSvc,this.config=Object.assign({},e),this.workbook=e.workbook,this.stylesByIds={};for(const s of this.config.baseExcelStyles)this.stylesByIds[s.id]=s;const t={id:"_quotePrefix",quotePrefix:1};this.stylesByIds[t.id]=t,this.excelStyles=[...this.config.baseExcelStyles,t]}addCustomContent(e){for(const t of e){const s=this.rows.length+1;let i;!this.config.suppressRowOutline&&t.outlineLevel!=null&&(i=t.outlineLevel);const r={height:Vc(s,t.height||this.config.rowHeight),cells:(t.cells||[]).map((o,n)=>{const a=this.addImage(s,this.columnsToExport[n],o.data?.value);let l=null;o.styleId&&(l=typeof o.styleId=="string"?[o.styleId]:o.styleId);const c=this.getStyleId(l);if(a)return this.createCell(c,this.getDataTypeForValue(a.value),a.value==null?"":a.value);const d=o.data?.value??"",u=this.getDataTypeForValue(d);return o.mergeAcross?this.createMergedCell(c,u,d,o.mergeAcross):this.createCell(c,u,d)}),outlineLevel:i};t.collapsed!=null&&(r.collapsed=t.collapsed),t.hidden!=null&&(r.hidden=t.hidden),this.rows.push(r)}}onNewHeaderGroupingRow(){const e=[],{freezeRows:t,headerRowHeight:s}=this.config;return this.rows.push({cells:e,height:Vc(this.rows.length+1,s)}),t&&this.frozenRowCount++,{onColumn:(i,r,o,n,a)=>{const l=this.config.styleLinker({rowType:"HEADER_GROUPING",rowIndex:1,value:`grouping-${r}`,columnGroup:i});e.push({...this.createMergedCell(this.getStyleId(l),this.getDataTypeForValue("string"),r,n),collapsibleRanges:a})}}}onNewHeaderRow(){const{freezeRows:e,headerRowHeight:t}=this.config;return e&&this.frozenRowCount++,this.onNewRow(this.onNewHeaderColumn,t)}onNewBodyRow(e){const{freezeRows:t,rowHeight:s}=this.config;this.skipFrozenRows||(t==="headersAndPinnedRows"&&e?.rowPinned==="top"?this.frozenRowCount++:typeof t=="function"?t(N(this.gos,{node:e}))?this.frozenRowCount++:this.skipFrozenRows=!0:this.skipFrozenRows=!0);const i=this.onNewRow(this.onNewBodyColumn,s);return e&&this.addRowOutlineIfNecessary(e),i}prepare(e){super.prepare(e),this.columnsToExport=[...e],this.cols=e.map((t,s)=>this.convertColumnToExcel(t,s))}parse(){const e=this.rows.reduce((s,i)=>Math.max(s,i.cells.length),0);for(;this.cols.length{const i=this.extractHeaderValue(s),r=this.config.styleLinker({rowType:"HEADER",rowIndex:e,value:i,column:s});t.push(this.createCell(this.getStyleId(r),this.getDataTypeForValue("string"),i))}}onNewBodyColumn(e,t){let s=0;const{freezeColumns:i,rightToLeft:r}=this.config;return(o,n,a)=>{if(s>0){s-=1;return}if(!this.skipFrozenColumns){const m=o.getPinned();i==="pinned"&&m&&(m===!0||m==="left")!==r?this.frozenColumnCount++:typeof i=="function"&&i(N(this.gos,{column:o}))?this.frozenColumnCount++:this.skipFrozenColumns=!0}const{value:l,valueFormatted:c}=this.extractRowCellValue({column:o,node:a,currentColumnIndex:n,accumulatedRowIndex:e,type:"excel",useRawFormula:!0}),d=l,u=typeof d=="bigint"?d.toString():d,h=this.config.styleLinker({rowType:"BODY",rowIndex:e,value:d,column:o,node:a}),g=this.getStyleId(h),p=o.getColSpan(a),f=this.addImage(e,o,u);if(f)t.push(this.createCell(g,this.getDataTypeForValue(f.value),f.value==null?"":f.value));else if(p>1)s=p-1,t.push(this.createMergedCell(g,this.getDataTypeForValue(d),u,p-1));else{const m=o.isAllowFormula()&&this.formulaSvc?.isFormula(u),C=this.createCell(g,m?"f":this.getDataTypeForValue(d),m?this.formulaSvc?.updateFormulaByOffset({value:u,rowDelta:e-(a.formulaRowIndex+1),useRefFormat:!1}):u,c);t.push(C)}}}onNewRow(e,t){const s=[];return this.rows.push({cells:s,height:Vc(this.rows.length+1,t)}),{onColumn:e.bind(this,this.rows.length,s)()}}addWorksheetToWorkbook(e){const{excelStyles:t,config:s}=this;return this.mapSharedStrings(e),this.frozenColumnCount&&(s.frozenColumnCount=this.frozenColumnCount),this.frozenRowCount&&(s.frozenRowCount=this.frozenRowCount),this.workbook.addWorksheet(t,e,s)}mapSharedStrings(e){let t;for(const s of e.table.rows)for(const i of s.cells){const r=i.data;if(!r||r.type!=="s")continue;const o=r.value;if(o!=null){if(o===""){t??(t=this.workbook.getStringPosition("").toString()),r.value=t;continue}r.value=this.workbook.getStringPosition(String(o)).toString()}}}getDataTypeForValue(e){if(e===void 0)return"empty";let t="s";try{this.isNumerical(e)&&(t="n")}catch{}return t}getTypeFromStyle(e,t){if(this.isFormula(t))return"f";if(e?.dataType)switch(e.dataType.toLocaleLowerCase()){case"formula":return"f";case"string":return"s";case"number":return"n";case"datetime":return"d";case"error":return"e";case"boolean":return"b";default:F(162,{id:e.id,dataType:e.dataType})}return null}addImage(e,t,s){if(!this.config.addImageToCell)return;const i=this.config.addImageToCell(e,t,s);if(i)return this.workbook.addBodyImageToMap(i.image,e,t,this.columnsToExport,this.config.rowHeight),i}createCell(e,t,s,i){const r=this.getStyleById(e);!r?.dataType&&t==="s"&&i!=null&&(s=i);const o=this.getTypeFromStyle(r,s)||t,{value:n,escaped:a}=this.getCellValue(o,s),l=[];return r&&l.push(e),a&&l.push("_quotePrefix"),e=this.getStyleId(l)||void 0,{styleId:e,data:{type:o,value:n}}}createMergedCell(e,t,s,i){const r=s??"";return{styleId:this.getStyleById(e)?e:void 0,data:{type:t,value:t==="s"?String(r):s},mergeAcross:i}}getCellValue(e,t){let s=!1;if(t==null||e==="s"&&t==="")return{value:"",escaped:!1};if(e==="s")t=String(t),t[0]==="'"&&(s=!0,t=t.slice(1));else if(e==="f")t=this.addXlfnPrefix(t).slice(1);else if(e==="n"){const i=Number(t);isNaN(i)?t="":t!==""&&(t=i.toString())}return{value:t,escaped:s}}addXlfnPrefix(e){if(!e)return e;const t=/(^|[^A-Z0-9._])(CONCAT)(\s*\()/gi;return e.replace(t,(s,i,r,o)=>`${i}_xlfn.${r}${o}`)}getStyleId(e){if(!e?.length)return null;const t=e.filter(i=>this.stylesByIds[i]!=null);if(!t.length)return null;if(t.length===1)return t[0];const s=t.join("-");return this.mixedStyles[s]||this.addNewMixedStyle(t),this.mixedStyles[s].excelID}addNewMixedStyle(e){this.mixedStyleCounter+=1;const t=`mixedStyle${this.mixedStyleCounter}`,s={};for(const r of e){const o=this.stylesByIds[r];o&&Oe(s,o,!0,!0)}s.id=t;const i=e.join("-");this.mixedStyles[i]={excelID:t,key:i,result:s},this.excelStyles.push(s),this.stylesByIds[t]=s}isFormula(e){if(e==null)return!1;const t=String(e);return this.config.autoConvertFormulas&&lr(t)}isNumerical(e){return typeof e=="bigint"?!1:isFinite(e)&&e!==""&&!isNaN(parseFloat(e))}getStyleById(e){return e==null?null:this.stylesByIds[e]||null}},RV={getTemplate(e){const{name:t,ContentType:s,Extension:i,PartName:r}=e;return{name:t,properties:{rawMap:{Extension:i,PartName:r,ContentType:s}}}}},FV=RV,Nc=e=>e==="jpg"?"jpeg":e,EV={getTemplate({sheetLen:e,hasCustomProperties:t}){const s=new Array(e).fill(void 0).map((u,h)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${h+1}.xml`})),i=Yi.size,r=di.size,o={};Lo.forEach(u=>{o[Nc(u.type)]=!0});const n=new Array(i).fill(void 0).map((u,h)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${h+1}.xml`})),a=[];js.forEach(({name:u})=>{a.push({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${u}.xml`})});const l=t?[{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml",PartName:"/docProps/custom.xml"}]:[],c=Object.keys(o).map(u=>({name:"Default",ContentType:`image/${u}`,Extension:u}));r&&c.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"});const d=[...c,{name:"Default",Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"},{name:"Default",ContentType:"application/xml",Extension:"xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",PartName:"/xl/workbook.xml"},...s,{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml",PartName:"/xl/theme/theme1.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",PartName:"/xl/styles.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",PartName:"/xl/sharedStrings.xml"},...n,...a,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"},...l].map(u=>FV.getTemplate(u));return{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:d}}},PV=EV,MV={getTemplate(e){const s=new Date().toJSON();return{name:"cp:coreProperties",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"}}]},children:[{name:"dc:creator",textNode:e},{name:"dc:title",textNode:"Workbook"},{name:"dcterms:created",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:s},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:s}]}}},TV=MV,DV="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",AV=e=>Object.keys(e).filter(s=>s&&e[s]!=null).map((s,i)=>({name:"property",properties:{rawMap:{fmtid:DV,pid:(i+2).toString(),name:pt(s)??""}},children:[{name:"vt:lpwstr",textNode:pt(Bc(String(e[s])))??""}]})),IV={getTemplate(e){return{name:"Properties",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}},children:AV(e)}}},kV=IV,ry=(e,t)=>({name:`xdr:${e}`,children:[{name:"xdr:col",textNode:t.col.toString()},{name:"xdr:colOff",textNode:t.offsetX.toString()},{name:"xdr:row",textNode:t.row.toString()},{name:"xdr:rowOff",textNode:t.offsetY.toString()}]}),LV=e=>{const t=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(e.recolor?.toLowerCase()){case"grayscale":case"sepia":case"washout":t.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:t}},GV=(e,t)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:t,name:e.id,descr:e.altText!=null?e.altText:void 0}},children:[LV(e)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),oy=e=>{if(!e.saturation&&!e.tint)return;const t=[];return e.saturation&&t.push({name:"a:satMod",properties:{rawMap:{val:e.saturation*1e3}}}),e.tint&&t.push({name:"a:tint",properties:{rawMap:{val:e.tint*1e3}}}),t},OV=(e,t)=>({name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:e.color}},children:oy(e)},{name:"a:srgbClr",properties:{rawMap:{val:t.color}},children:oy(t)}]}),VV=(e,t)=>{let s;if(e.transparency){const i=Math.min(Math.max(e.transparency,0),100);s=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(i*1e3)}}}]}if(e.recolor)switch(s||(s=[]),e.recolor.toLocaleLowerCase()){case"grayscale":s.push({name:"a:grayscl"});break;case"sepia":s.push(OV({color:"black"},{color:"D9C3A5",tint:50,saturation:180}));break;case"washout":s.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}});break;default:}return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${t}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:s},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},BV=(e,t)=>{const s={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:t.width,cy:t.height}}}]};if(e.rotation){const o=e.rotation;s.properties={rawMap:{rot:Math.min(Math.max(o,0),360)*6e4}}}return{name:"xdr:spPr",children:[s,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},NV=e=>{e.fitCell=!!e.fitCell||!e.width||!e.height;const{position:t={},fitCell:s,width:i=0,height:r=0,totalHeight:o,totalWidth:n}=e,{offsetX:a=0,offsetY:l=0,row:c=1,rowSpan:d=1,column:u=1,colSpan:h=1}=t;return{from:{row:c-1,col:u-1,offsetX:Io(a),offsetY:Io(l)},to:{row:c-1+(s?1:d-1),col:u-1+(s?1:h-1),offsetX:Io(i+a),offsetY:Io(r+l)},height:Io(o||r),width:Io(n||i)}},HV=(e,t,s,i)=>({name:"xdr:pic",children:[GV(e,t+1),VV(e,s+1),BV(e,i)]}),zV={getTemplate(e){const{sheetIndex:t}=e,s=Yi.get(t),i=Go.get(t),r=s.map((o,n)=>{const a=NV(o);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[ry("from",a.from),ry("to",a.to),HV(o,n,i.get(o.id).index,a),{name:"xdr:clientData"}]}});return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}},children:r}}},_V=zV,WV={getTemplate(e){const{Id:t,Type:s,Target:i}=e;return{name:"Relationship",properties:{rawMap:{Id:t,Type:s,Target:i}}}}},UV=WV,$V={getTemplate(e){const t=e.map(s=>UV.getTemplate(s));return{name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:t}}},fa=$V,KV={getTemplate(e){return{name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:e.size,uniqueCount:e.size}},children:yV(e)}}},jV=KV,qV=e=>{switch(e){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}},YV={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot",Continuous:"Continuous"},XV=["Dashed","DashDot","DashDotDot"],ZV={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinDiagStripe:"lightUp",ThinHorzCross:"lightGrid",ThinDiagCross:"lightTrellis",Gray125:"gray125",Gray0625:"gray0625"},QV={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},JV={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},eB=e=>e?ZV[e]||e:"none",ji=e=>e==null?e:(e.charAt(0)==="#"&&(e=e.substring(1)),e.length===6?"FF"+e:e),Hc=(e,t)=>{if(!e)return"thin";const s=qV(t);if(e==="Continuous")return s;const i=YV[e];return s==="medium"&&XV.some(r=>r===i)?`medium${i}`:`${i.charAt(0).toLowerCase()}${i.substring(1)}`},tB=e=>QV[e]||"general",sB=e=>JV[e]||void 0,ma=e=>({name:"color",properties:{rawMap:{rgb:ji(e||"#000000")}}}),iB={getTemplate(e){const{left:t,right:s,top:i,bottom:r,diagonal:o}=e,n=t?[ma(t.color)]:void 0,a=s?[ma(s.color)]:void 0,l=i?[ma(i.color)]:void 0,c=r?[ma(r.color)]:void 0,d=o?[ma(o.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:t?.style}},children:n},{name:"right",properties:{rawMap:{style:s?.style}},children:a},{name:"top",properties:{rawMap:{style:i?.style}},children:l},{name:"bottom",properties:{rawMap:{style:r?.style}},children:c},{name:"diagonal",properties:{rawMap:{style:o?.style}},children:d}]}}},rB=iB,oB={getTemplate(e){return{name:"borders",properties:{rawMap:{count:e.length}},children:e.map(t=>rB.getTemplate(t))}}},nB=oB,aB=e=>{const s=["Context","LeftToRight","RightToLeft"].indexOf(e);return Math.max(s,0)},lB={getTemplate(e){const{horizontal:t,indent:s,readingOrder:i,rotate:r,shrinkToFit:o,vertical:n,wrapText:a}=e;return{name:"alignment",properties:{rawMap:{horizontal:t&&tB(t),indent:s,readingOrder:i&&aB(i),textRotation:r,shrinkToFit:o,vertical:n&&sB(n),wrapText:a}}}}},cB=lB,dB={getTemplate(e){const t=e.protected===!1?0:1;return{name:"protection",properties:{rawMap:{hidden:e.hideFormula===!0?1:0,locked:t}}}}},uB=dB,hB={getTemplate(e){const{alignment:t,borderId:s,fillId:i,fontId:r,numFmtId:o,protection:n,quotePrefix:a,xfId:l}=e,c=[];return t&&c.push(cB.getTemplate(t)),n&&c.push(uB.getTemplate(n)),{name:"xf",properties:{rawMap:{applyAlignment:t?1:void 0,applyProtection:n?1:void 0,applyBorder:s?1:void 0,applyFill:i?1:void 0,borderId:s,fillId:i,applyFont:r?1:void 0,fontId:r,applyNumberFormat:o?1:void 0,numFmtId:o,quotePrefix:a?1:void 0,xfId:l}},children:c.length?c:void 0}}},ny=hB,gB={getTemplate(e){return{name:"cellStyleXfs",properties:{rawMap:{count:e.length}},children:e.map(t=>ny.getTemplate(t))}}},pB=gB,fB={getTemplate(e){const{builtinId:t,name:s,xfId:i}=e;return{name:"cellStyle",properties:{rawMap:{builtinId:t,name:s,xfId:i}}}}},mB=fB,CB={getTemplate(e){return{name:"cellStyles",properties:{rawMap:{count:e.length}},children:e.map(t=>mB.getTemplate(t))}}},vB=CB,wB={getTemplate(e){return{name:"cellXfs",properties:{rawMap:{count:e.length}},children:e.map(t=>ny.getTemplate(t))}}},bB=wB,SB={getTemplate(e){const{patternType:t,fgTheme:s,fgTint:i,fgRgb:r,bgRgb:o,bgIndexed:n}=e,a={name:"patternFill",properties:{rawMap:{patternType:t}}};return(s||i||r)&&(a.children=[{name:"fgColor",properties:{rawMap:{theme:s,tint:i,rgb:r}}}]),(n||o)&&(a.children||(a.children=[]),a.children.push({name:"bgColor",properties:{rawMap:{indexed:n,rgb:o}}})),{name:"fill",children:[a]}}},yB=SB,xB={getTemplate(e){return{name:"fills",properties:{rawMap:{count:e.length}},children:e.map(t=>yB.getTemplate(t))}}},RB=xB,FB={getTemplate(e){const{size:t,colorTheme:s,color:i="FF000000",fontName:r="Calibri",family:o,scheme:n,italic:a,bold:l,strikeThrough:c,outline:d,shadow:u,underline:h,verticalAlign:g}=e,p=[{name:"sz",properties:{rawMap:{val:t}}},{name:"color",properties:{rawMap:{theme:s,rgb:i}}},{name:"name",properties:{rawMap:{val:r}}}];return o&&p.push({name:"family",properties:{rawMap:{val:o}}}),n&&p.push({name:"scheme",properties:{rawMap:{val:n}}}),a&&p.push({name:"i"}),l&&p.push({name:"b"}),c&&p.push({name:"strike"}),d&&p.push({name:"outline"}),u&&p.push({name:"shadow"}),h&&p.push({name:"u",properties:{rawMap:{val:h}}}),g&&p.push({name:"vertAlign",properties:{rawMap:{val:g}}}),{name:"font",children:p}}},EB=FB,PB={getTemplate(e){return{name:"fonts",properties:{rawMap:{count:e.length}},children:e.map(t=>EB.getTemplate(t))}}},MB=PB;function TB(e){const t=e.split(/(\[[^\]]*\])/);for(let s=0;sAB.getTemplate(t))}}},kB=IB,zc,ko,Ca,va,wa,ay,_c,ly,tp,cy=(e,t)=>(e.includes("mixedStyle")&&t>1&&(e+=`_${t}`),e),dy=()=>{zc={base:0},ko=[],Ca=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],va=[{patternType:"none"},{patternType:"gray125"}],wa=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],ay=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],_c=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],ly=[{builtinId:0,name:"Normal",xfId:0}]},LB=e=>{const t=eB(e.pattern),s=ji(e.color),i=ji(e.patternColor);let r=va.findIndex(o=>{const{patternType:n,fgRgb:a,bgRgb:l}=o;return!(n!=t||a!=s||l!=i)});return r===-1&&(r=va.length,va.push({patternType:t,fgRgb:s,bgRgb:i})),r},GB=e=>{if(ty[e])return ty[e];let t=ko.findIndex(s=>s.formatCode===e);return t===-1?(t=ko.length+164,ko.push({formatCode:e,numFmtId:t})):t=ko[t].numFmtId,t},OB=e=>{const{borderBottom:t,borderTop:s,borderLeft:i,borderRight:r}=e;let o,n,a,l,c,d,u,h;i&&(a=Hc(i.lineStyle,i.weight),u=ji(i.color)),r&&(l=Hc(r.lineStyle,r.weight),h=ji(r.color)),t&&(o=Hc(t.lineStyle,t.weight),c=ji(t.color)),s&&(n=Hc(s.lineStyle,s.weight),d=ji(s.color));let g=wa.findIndex(p=>{const{left:f,right:m,top:C,bottom:v}=p;if(!f&&(a||u)||!m&&(l||h)||!C&&(n||d)||!v&&(o||c))return!1;const{style:w,color:S}=f||{},{style:y,color:R}=m||{},{style:P,color:M}=C||{},{style:T,color:I}=v||{};return!(w!=a||S!=u||y!=l||R!=h||P!=n||M!=d||T!=o||I!=c)});return g===-1&&(g=wa.length,wa.push({left:{style:a,color:u},right:{style:l,color:h},top:{style:n,color:d},bottom:{style:o,color:c},diagonal:{style:void 0,color:void 0}})),g},VB=e=>{const{fontName:t="Calibri",color:s,size:i,bold:r,italic:o,outline:n,shadow:a,strikeThrough:l,underline:c,family:d,verticalAlign:u}=e,h=ji(s),g=vV(d),p=c?c.toLocaleLowerCase():void 0,f=u?u.toLocaleLowerCase():void 0;let m=Ca.findIndex(C=>!(C.fontName!=t||C.color!=h||C.size!=i||C.bold!=r||C.italic!=o||C.outline!=n||C.shadow!=a||C.strikeThrough!=l||C.underline!=p||C.verticalAlign!=f||C.family!=g));return m===-1&&(m=Ca.length,Ca.push({fontName:t,color:h,size:i,bold:r,italic:o,outline:n,shadow:a,strikeThrough:l,underline:p,verticalAlign:f,family:g?.toString()})),m},BB=e=>{const{alignment:t,borders:s,font:i,interior:r,numberFormat:o,protection:n,quotePrefix:a}=e;let{id:l}=e,c=0,d=0,u=0,h=0;l&&(l=cy(l,tp),zc[l]==null&&(r&&(c=LB(r)),s&&(d=OB(s)),i&&(u=VB(i)),o&&(h=GB(o.format)),zc[l]=_c.length,_c.push({alignment:t,borderId:d||0,fillId:c||0,fontId:u||0,numFmtId:h||0,protection:n,quotePrefix:a,xfId:0})))},NB={getTemplate(e){const t=kB.getTemplate(ko),s=MB.getTemplate(Ca.map(l=>({...l,size:l.size!=null?l.size:e}))),i=RB.getTemplate(va),r=nB.getTemplate(wa),o=pB.getTemplate(ay),n=bB.getTemplate(_c),a=vB.getTemplate(ly);return dy(),{name:"styleSheet",properties:{rawMap:{"mc:Ignorable":"x14ac x16r2 xr",xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"}},children:[t,s,i,r,o,n,a,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},HB=(e,t)=>zc[cy(e,t)]||0,zB=(e,t)=>{tp=t,tp===1&&dy(),e.forEach(BB)},_B=NB,WB={getTemplate(e,t){const{name:s,columns:i,rowRange:r,displayName:o,showRowStripes:n,showColumnStripes:a,showFilterButtons:l,highlightFirstColumn:c,highlightLastColumn:d}=e||{},u=!r||r[0]-r[1]===0;if(!e||!s||!Array.isArray(i)||!i.length||u)return{name:"table"};const h=i.map((v,w)=>({name:"filterColumn",properties:{rawMap:{colId:w.toString(),hiddenButton:l[w]?0:1}}})),g=`A${r[0]}`,p=`${Br(i.length)}${r[1]}`,f=`${g}:${p}`,m=`${t+1}`,C=t?`${o}_${m}`:o;return{name:"table",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3",name:C,displayName:C,ref:f,totalsRowShown:0,id:m}},children:[{name:"autoFilter",properties:{rawMap:{ref:f}},children:h},{name:"tableColumns",properties:{rawMap:{count:i.length}},children:i.map((v,w)=>({name:"tableColumn",properties:{rawMap:{id:(w+1).toString(),name:pt(SV(v)),dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:c?1:0,showLastColumn:d?1:0,showRowStripes:n?1:0,showColumnStripes:a?1:0}}}]}}},UB=WB,gs=e=>{const[t,s,i,r]=e;return{name:`a:${t}`,children:[{name:`a:${s}`,properties:{rawMap:{val:i,lastClr:r}}}]}},$B={getTemplate(){return{name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[gs(["dk1","sysClr","windowText","000000"]),gs(["lt1","sysClr","window","FFFFFF"]),gs(["dk2","srgbClr","44546A"]),gs(["lt2","srgbClr","E7E6E6"]),gs(["accent1","srgbClr","4472C4"]),gs(["accent2","srgbClr","ED7D31"]),gs(["accent3","srgbClr","A5A5A5"]),gs(["accent4","srgbClr","FFC000"]),gs(["accent5","srgbClr","5B9BD5"]),gs(["accent6","srgbClr","70AD47"]),gs(["hlink","srgbClr","0563C1"]),gs(["folHlink","srgbClr","954F72"])]}}},KB=$B,B=e=>{const[t,s,i,r]=e;return{name:`a:${t}`,properties:{rawMap:{script:i,typeface:s,panose:r}}}},jB={getTemplate(){return{name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[B(["latin","Calibri Light",void 0,"020F0302020204030204"]),B(["ea",""]),B(["cs",""]),B(["font","\u6E38\u30B4\u30B7\u30C3\u30AF Light","Jpan"]),B(["font","\uB9D1\uC740 \uACE0\uB515","Hang"]),B(["font","\u7B49\u7EBF Light","Hans"]),B(["font","\u65B0\u7D30\u660E\u9AD4","Hant"]),B(["font","Times New Roman","Arab"]),B(["font","Times New Roman","Hebr"]),B(["font","Tahoma","Thai"]),B(["font","Nyala","Ethi"]),B(["font","Vrinda","Beng"]),B(["font","Shruti","Gujr"]),B(["font","MoolBoran","Khmr"]),B(["font","Tunga","Knda"]),B(["font","Raavi","Guru"]),B(["font","Euphemia","Cans"]),B(["font","Plantagenet Cherokee","Cher"]),B(["font","Microsoft Yi Baiti","Yiii"]),B(["font","Microsoft Himalaya","Tibt"]),B(["font","MV Boli","Thaa"]),B(["font","Mangal","Deva"]),B(["font","Gautami","Telu"]),B(["font","Latha","Taml"]),B(["font","Estrangelo Edessa","Syrc"]),B(["font","Kalinga","Orya"]),B(["font","Kartika","Mlym"]),B(["font","DokChampa","Laoo"]),B(["font","Iskoola Pota","Sinh"]),B(["font","Mongolian Baiti","Mong"]),B(["font","Times New Roman","Viet"]),B(["font","Microsoft Uighur","Uigh"]),B(["font","Sylfaen","Geor"]),B(["font","Arial","Armn"]),B(["font","Leelawadee UI","Bugi"]),B(["font","Microsoft JhengHei","Bopo"]),B(["font","Javanese Text","Java"]),B(["font","Segoe UI","Lisu"]),B(["font","Myanmar Text","Mymr"]),B(["font","Ebrima","Nkoo"]),B(["font","Nirmala UI","Olck"]),B(["font","Ebrima","Osma"]),B(["font","Phagspa","Phag"]),B(["font","Estrangelo Edessa","Syrn"]),B(["font","Estrangelo Edessa","Syrj"]),B(["font","Estrangelo Edessa","Syre"]),B(["font","Nirmala UI","Sora"]),B(["font","Microsoft Tai Le","Tale"]),B(["font","Microsoft New Tai Lue","Talu"]),B(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[B(["latin","Calibri",void 0,"020F0502020204030204"]),B(["ea",""]),B(["cs",""]),B(["font","\u6E38\u30B4\u30B7\u30C3\u30AF","Jpan"]),B(["font","\uB9D1\uC740 \uACE0\uB515","Hang"]),B(["font","\u7B49\u7EBF","Hans"]),B(["font","\u65B0\u7D30\u660E\u9AD4","Hant"]),B(["font","Arial","Arab"]),B(["font","Arial","Hebr"]),B(["font","Tahoma","Thai"]),B(["font","Nyala","Ethi"]),B(["font","Vrinda","Beng"]),B(["font","Shruti","Gujr"]),B(["font","DaunPenh","Khmr"]),B(["font","Tunga","Knda"]),B(["font","Raavi","Guru"]),B(["font","Euphemia","Cans"]),B(["font","Plantagenet Cherokee","Cher"]),B(["font","Microsoft Yi Baiti","Yiii"]),B(["font","Microsoft Himalaya","Tibt"]),B(["font","MV Boli","Thaa"]),B(["font","Mangal","Deva"]),B(["font","Gautami","Telu"]),B(["font","Latha","Taml"]),B(["font","Estrangelo Edessa","Syrc"]),B(["font","Kalinga","Orya"]),B(["font","Kartika","Mlym"]),B(["font","DokChampa","Laoo"]),B(["font","Iskoola Pota","Sinh"]),B(["font","Mongolian Baiti","Mong"]),B(["font","Arial","Viet"]),B(["font","Microsoft Uighur","Uigh"]),B(["font","Sylfaen","Geor"]),B(["font","Arial","Armn"]),B(["font","Leelawadee UI","Bugi"]),B(["font","Microsoft JhengHei","Bopo"]),B(["font","Javanese Text","Java"]),B(["font","Segoe UI","Lisu"]),B(["font","Myanmar Text","Mymr"]),B(["font","Ebrima","Nkoo"]),B(["font","Nirmala UI","Olck"]),B(["font","Ebrima","Osma"]),B(["font","Phagspa","Phag"]),B(["font","Estrangelo Edessa","Syrn"]),B(["font","Estrangelo Edessa","Syrj"]),B(["font","Estrangelo Edessa","Syre"]),B(["font","Nirmala UI","Sora"]),B(["font","Microsoft Tai Le","Tale"]),B(["font","Microsoft New Tai Lue","Talu"]),B(["font","Ebrima","Tfng"])]}]}}},qB=jB,Ks=(e,t,s)=>({name:`a:${e}`,properties:{rawMap:{val:t}},children:s}),sp=e=>{const[t,s,i,r,o,n]=e,a=[];return a.push(Ks("satMod",i)),r&&a.push(Ks("lumMod",r)),o&&a.push(Ks("tint",o)),n&&a.push(Ks("shade",n)),{name:"a:gs",properties:{rawMap:{pos:t}},children:[{name:"a:schemeClr",properties:{rawMap:{val:s}},children:a}]}},Wc=(e,t)=>({name:"a:solidFill",children:[Ks("schemeClr",e,t)]}),ip=e=>{const[t,s,i,r,o]=e,[n,a]=o;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:t}},children:[{name:"a:gsLst",children:[sp(s),sp(i),sp(r)]},{name:"a:lin",properties:{rawMap:{ang:n,scaled:a}}}]}},rp=e=>{const[t,s,i,r]=e;return{name:"a:ln",properties:{rawMap:{w:t,cap:s,cmpd:i,algn:r}},children:[Wc("phClr"),Ks("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},op=e=>{const t=[];if(e){const[s,i,r,o,n]=e;t.push({name:"a:outerShdw",properties:{rawMap:{blurRad:s,dist:i,dir:r,algn:o,rotWithShape:n}},children:[Ks("srgbClr","000000",[Ks("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},t.length?{children:t}:{})]}},YB=()=>({name:"a:fillStyleLst",children:[Wc("phClr"),ip(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),ip(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]}),XB=()=>({name:"a:lnStyleLst",children:[rp(["6350","flat","sng","ctr"]),rp(["12700","flat","sng","ctr"]),rp(["19050","flat","sng","ctr"])]}),ZB=()=>({name:"a:effectStyleLst",children:[op(),op(),op(["57150","19050","5400000","ctr","0"])]}),QB=()=>({name:"a:bgFillStyleLst",children:[Wc("phClr"),Wc("phClr",[Ks("tint","95000"),Ks("satMod","170000")]),ip(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}),JB={getTemplate(){return{name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[YB(),XB(),ZB(),QB()]}}},e5=JB,t5={getTemplate(){return{name:"a:themeElements",children:[KB.getTemplate(),qB.getTemplate(),e5.getTemplate()]}}},s5=t5,i5={getTemplate(){return{name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[s5.getTemplate(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]}}},r5=i5,o5=()=>({name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]}),n5=()=>({name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}}),a5=e=>({name:"v:formulas",children:e.map(t=>({name:"v:f",properties:{rawMap:{eqn:t}}}))}),l5=()=>({name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}}),uy=e=>{const{aspectratio:t,rotation:s}=e||{},i={};return t&&(i.aspectratio="t"),s&&(i.rotation="t"),{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:i}}};function c5(e,t,s,i,r){return(e-t)/(s-t)*(r-i)+i}var d5=(e,t)=>{let s;const{recolor:i,brightness:r,contrast:o,id:n}=e;if(i&&(s={},(i==="Washout"||i==="Grayscale")&&(s.gain="19661f",s.blacklevel="22938f"),(i==="Black & White"||i==="Grayscale")&&(s.grayscale="t",i==="Black & White"&&(s.bilevel="t"))),!i||i==="Grayscale"){if(s||(s={}),o!=null&&o!==50){let a="1";o>=0&&(o<50?a=String(o/50):o<100?a=String(50/(100-o)):o===100&&(a="2147483647f")),s.gain=a}r!=null&&r!==50&&(s.blacklevel=c5(r,0,100,-.5,.5).toString())}return{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${t}`,title:n}}],rawMap:s}}},u5=()=>{const e=["if lineDrawn pixelLineWidth 0","sum @0 1 0","sum 0 0 @1","prod @2 1 2","prod @3 21600 pixelWidth","prod @3 21600 pixelHeight","sum @0 0 1","prod @6 1 2","prod @7 21600 pixelWidth","sum @8 21600 0","prod @7 21600 pixelHeight","sum @10 21600 0"];return{name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"75",preferrelative:"t"}}],rawMap:{coordsize:"21600,21600",filled:"f",id:"_x0000_t75",path:"m@4@5l@4@11@9@11@9@5xe",stroked:"f"}},children:[n5(),a5(e),l5(),uy({aspectratio:!0})]}},hy=e=>Math.floor((e??0)*.74999943307122),h5=(e,t)=>{const{width:s=0,height:i=0,altText:r}=e,o=hy(s),n=hy(i);return{name:"v:shape",properties:{rawMap:{id:e.headerFooterPosition,"o:spid":"_x0000_s1025",style:`position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${o}pt; height: ${n}pt; z-index: ${t+1}`,type:"#_x0000_t75",alt:r}},children:[d5(e,t+1),uy({rotation:!0})]}},g5={getTemplate(e){const t=di.get(e.sheetIndex)||[],s=[o5(),u5(),...t.map((i,r)=>h5(i,r))];return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:s}}},p5=g5,f5={getTemplate(e,t){const s=(t+1).toString();return{name:"sheet",properties:{rawMap:{name:e,sheetId:s,"r:id":`rId${s}`}}}}},m5=f5,C5={getTemplate(e){return{name:"sheets",children:e.map((t,s)=>m5.getTemplate(t,s))}}},v5=C5,w5={getTemplate(e,t){return{name:"workbook",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[{name:"bookViews",children:[{name:"workbookView",properties:{rawMap:{activeTab:t}}}]},v5.getTemplate(e)]}}},b5=w5,S5=e=>Math.ceil((e-12)/7+1),y5={getTemplate(e){const{min:t,max:s,outlineLevel:i,s:r,width:o,hidden:n,bestFit:a}=e;let l=1,c="0";return o>1&&(l=S5(o),c="1"),{name:"col",properties:{rawMap:{min:t,max:s,outlineLevel:i??void 0,width:l,style:r,hidden:n?"1":"0",bestFit:a?"1":"0",customWidth:c}}}}},x5=y5,R5={getTemplate(e){return{name:"mergeCell",properties:{rawMap:{ref:e}}}}},F5=R5,E5=e=>{const t=e.charAt(0).toLowerCase();return t==="s"?"inlineStr":t},P5={getTemplate(e,t,s){const{ref:i,data:r,styleId:o}=e,{type:n,value:a}=r||{type:"empty",value:null};let l=n;n==="f"?l="str":n.charAt(0)===n.charAt(0).toUpperCase()&&(l=E5(n));const c={name:"c",properties:{rawMap:{r:i,t:l==="empty"?void 0:l,s:o?HB(o,s):void 0}}};if(l==="empty")return c;let d;return l==="str"&&n==="f"?d=[{name:"f",textNode:pt(Bc(a))}]:l==="inlineStr"?d=[{name:"is",children:[{name:"t",textNode:pt(Bc(a))}]}]:d=[{name:"v",textNode:a}],Object.assign({},c,{children:d})}},M5=P5,T5=(e,t)=>{const s=[];let i=0;for(let r=0;r=0;r--){const o=[],n=e[s[r].pos];for(let a=1;a<=n.mergeAcross;a++)o.push({ref:`${Br(s[r].excelPos+1+a)}${t+1}`,styleId:n.styleId,data:{type:"empty",value:null}});o.length&&e.splice(s[r].pos+1,0,...o)}},D5=e=>e.data?.value!==""||e.styleId!==void 0,A5={getTemplate(e,t,s){const{collapsed:i,hidden:r,height:o,outlineLevel:n,cells:a=[]}=e;T5(a,t);const l=a.filter(D5).map((c,d)=>M5.getTemplate(c,d,s));return{name:"row",properties:{rawMap:{r:t+1,collapsed:i?"1":"0",hidden:r?"1":"0",ht:o,customHeight:o!=null?"1":"0",spans:"1:1",outlineLevel:n||void 0}},children:l}}},I5=A5,k5=(e,t,s)=>{const i=[],r=[];e.forEach((a,l)=>{const c=a.cells;let d=0,u;c.forEach((h,g)=>{const p=g+d+1,f=Br(p),m=l+1;if(h.mergeAcross){d+=h.mergeAcross;const v=Br(g+d+1);i.push(`${f}${m}:${v}${m}`)}t[p-1]||(t[p-1]={});const{collapsibleRanges:C}=h;C&&C.forEach(v=>{r.push([p+v[0],p+v[1]])}),u=t[p-1],u.min=p,u.max=p,h.ref=`${f}${m}`})}),r.sort((a,l)=>a[0]!==l[0]?a[0]-l[0]:l[1]-a[1]);const o=new Map,n=new Map;return r.filter(a=>{const l=a.toString();return o.get(l)?!1:(o.set(l,!0),!0)}).forEach(a=>{const l=t.find(d=>d.min==a[0]&&d.max==a[1]),c=n.get(a[0]);t.push({min:a[0],max:a[1],outlineLevel:s?void 0:c||1,width:(l||{width:100}).width}),n.set(a[0],(c||0)+1)}),i},L5=e=>!e||e!=="Portrait"&&e!=="Landscape"?"portrait":e.toLocaleLowerCase(),G5=e=>{if(e==null)return 1;const s=["Letter","Letter Small","Tabloid","Ledger","Legal","Statement","Executive","A3","A4","A4 Small","A5","A6","B4","B5","Folio","Envelope","Envelope DL","Envelope C5","Envelope B5","Envelope C3","Envelope C4","Envelope C6","Envelope Monarch","Japanese Postcard","Japanese Double Postcard"].indexOf(e);return s===-1?1:s+1},O5=e=>{const t={"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"};for(const s of Object.keys(t))e=e.replace(s,t[s]);return e},V5=e=>e==="Center"?"C":e==="Right"?"R":"L",B5=(e,t)=>(t&&(e+="&"",e+=t.fontName||"Calibri",t.bold!==t.italic?e+=t.bold?",Bold":",Italic":t.bold?e+=",Bold Italic":e+=",Regular",e+=""",t.size&&(e+=`&${t.size}`),t.strikeThrough&&(e+="&S"),t.underline&&(e+=`&${t.underline==="Double"?"E":"U"}`),t.color&&(e+=`&K${t.color.replace("#","").toUpperCase()}`)),e),N5=(e,t,s)=>e.reduce((i,r,o)=>{const n=V5(r.position),a=B5(`${i}&${n}`,r.font),l=["Left","Center","Right"];r.position||(r.position=l[o]);const{image:c}=r;if(r.value==="&[Picture]"&&c){const d=`${n}${t}${s}`;gy(c,d)}return`${a}${pt(O5(r.value))}`},""),H5=e=>{const t=["all","first","even"],s=[];return t.forEach(i=>{const r=e[i],o=i==="all"?"odd":i;if(r)for(const n of Object.keys(r)){const a=r[n],l=`${n.charAt(0).toUpperCase()}${n.slice(1)}`,c=n[0].toUpperCase();if(a){const d=i==="all"?"":i.toUpperCase();s.push({name:`${o}${l}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:N5(a,c,d)})}}}),s},z5=e=>t=>(e.length&&t.children.push({name:"cols",children:e.map(s=>x5.getTemplate(s))}),t),_5=(e,t)=>s=>(e.length&&s.children.push({name:"sheetData",children:e.map((i,r)=>I5.getTemplate(i,r,t))}),s),W5=e=>{const t=e.length;if(!t)return"";const s=new Array(t+1);s[0]=t;for(let r=1;r<=t;r++)s[r]=e.charCodeAt(r-1)&255;let i=0;for(let r=s.length-1;r>=0;r--){const o=s[r],n=i&16384?1:0,a=i<<1&32767;i=(n|a)^o}return(i^52811).toString(16).toUpperCase().padStart(4,"0")},U5=e=>t=>{if(!e)return t;const s=typeof e=="boolean"?{}:e,i={sheet:1},r=s.password?W5(s.password):"";r&&(i.password=r);const o={autoFilter:!1,deleteColumns:!1,deleteRows:!1,formatCells:!1,formatColumns:!1,formatRows:!1,insertColumns:!1,insertHyperlinks:!1,insertRows:!1,pivotTables:!1,selectLockedCells:!0,selectUnlockedCells:!0};return Object.keys(o).forEach(n=>{const a=s[n];a==null||a===o[n]||(i[n]=a?0:1)}),t.children.push({name:"sheetProtection",properties:{rawMap:i}}),t},$5=e=>t=>(e.length&&t.children.push({name:"mergeCells",properties:{rawMap:{count:e.length}},children:e.map(s=>F5.getTemplate(s))}),t),K5=e=>t=>{const{top:s=.75,right:i=.7,bottom:r=.75,left:o=.7,header:n=.3,footer:a=.3}=e;return t.children.push({name:"pageMargins",properties:{rawMap:{bottom:r,footer:a,header:n,left:o,right:i,top:s}}}),t},j5=e=>t=>(e&&t.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:L5(e.orientation),paperSize:G5(e.pageSize)}}}),t),q5=e=>t=>{if(!e)return t;const s=e.first!=null?1:0,i=e.even!=null?1:0;return t.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:s,differentOddEven:i}},children:H5(e)}),t},Y5=e=>t=>(e&&t.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}]}),t),X5=e=>t=>(Yi.get(e)?.length&&t.children.push({name:"drawing",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}),t),Z5=e=>t=>(di.get(e)&&t.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}),t),Q5=(e=0,t=0)=>{const s=e>0||t>0;return s?[{name:"pane",properties:{rawMap:{state:s?"frozen":void 0,topLeftCell:s?`${Br(e+1)}${t+1}`:void 0,xSplit:e===0?void 0:e,ySplit:t===0?void 0:t}}}]:void 0},J5=(e=!1,t,s)=>i=>(i.children.push({name:"sheetViews",children:[{name:"sheetView",properties:{rawMap:{rightToLeft:e===!0?"1":"0",workbookViewId:"0"}},children:Q5(t,s)}]}),i),eN=()=>e=>(e.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),e),tN=e=>t=>{const s=e.reduce((i,r)=>r.outlineLevel&&r.outlineLevel>i?r.outlineLevel:i,0);return t.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:s||void 0}}}),t},sN={getTemplate(e){const{worksheet:t,currentSheet:s,config:i}=e,{margins:r={},pageSetup:o,headerFooterConfig:n,suppressColumnOutline:a,rightToLeft:l,frozenRowCount:c,frozenColumnCount:d,protectSheet:u}=i,{table:h}=t,{rows:g,columns:p}=h,f=p?.length?k5(g,p,!!a):[],m=js.get(s),{children:C}=[eN(),J5(l,d,c),tN(g),z5(p),_5(g,s+1),U5(u),$5(f),K5(r),j5(o),q5(n),X5(s),Z5(s),Y5(m)].reduce((v,w)=>w(v),{children:[],rIdCounter:0});return{name:"worksheet",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:C}}},iN=sN,Nr=new Map,Qt=[],Hr=[],zr=new Map,qi=new Map,Yi=new Map,di=new Map,Lo=new Map,Go=new Map,js=new Map,rN="AG-GRID-TABLE",np="SINGLE_SHEET";function oN(){return np}function nN(e){np=e}function aN(e,t,s){hN(t),zB(e,Qt.length);const i=Object.assign({},s);s.exportAsExcelTable&&s.pivotModeActive&&(F(163,{featureName:"pivot mode"}),i.exportAsExcelTable=!1),dN(t,i);const r=DN(t,i);return AN(r),r}function lN(e){return e.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}function cN(e,t){if(js.has(e)){F(164);return}js.set(e,t)}function dN(e,t){const{exportAsExcelTable:s,prependContent:i,appendContent:r,headerRowCount:o=0}=t;if(!s)return;const n=typeof s=="boolean"?{}:s,{name:a,showColumnStripes:l,showRowStripes:c,showFilterButton:d,highlightFirstColumn:u,highlightLastColumn:h}=n,g=lN(a||rN),p=Qt.length-1,{table:f}=e,{rows:m,columns:C}=f,v=i?i.length:0,w=r?r.length:0,S=m.length,y=C.length,R=[],P=[];for(let M=0;Mo.id===e.id)||r.push(e)}function uN(e,t,s,i,r){const o=Qt.length,{row:n,column:a}=e.position||{},l=e;i&&(t!=null&&s!=null&&(!n||!a)&&(e.position||(e.position={}),e.position=Object.assign({},e.position,{row:t,column:i.indexOf(s)+1})),wV(l,i),bV(l,r)),py({imageToAdd:l,idx:o});let c=Go.get(o);c||(c=new Map,Go.set(o,c));const d=Yi.get(o);d?d.push(l):Yi.set(o,[l]),c.get(e.id)||c.set(e.id,{index:c.size,type:e.imageType})}function py(e){const{imageToAdd:t,idx:s}=e,i=qi.get(t.id);if(i){const r=i.find(o=>o.sheetId===s);r?r.image.push(t):i.push({sheetId:s,image:[t]})}else qi.set(t.id,[{sheetId:s,image:[t]}]),Lo.set(t.id,{type:t.imageType,index:Lo.size})}function hN(e){const t=pt(e.name)||"";let s="";for(;Qt.indexOf(`${t}${s}`)!==-1;)s===""?s="_1":s=`_${parseInt(s.slice(1),10)+1}`;e.name=`${t}${s}`,Qt.push(e.name)}function gN(e){return Nr.has(e)?Nr.get(e):(Nr.set(e,Nr.size),Nr.size-1)}function pN(){Nr.clear(),qi.clear(),Yi.clear(),di.clear(),Lo.clear(),Go.clear(),js.clear(),Qt=[],Hr=[],zr=new Map,np="SINGLE_SHEET"}function fN(e){return wt(b5.getTemplate(Qt,e))}function mN(e){return wt(_B.getTemplate(e))}function CN(){return wt(jV.getTemplate(Nr))}function vN(e){return wt(TV.getTemplate(e))}function wN(e){return wt(kV.getTemplate(e))}function bN(e,t){return wt(PV.getTemplate({sheetLen:e,hasCustomProperties:t}))}function SN(e){const t=[{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"},{Id:"rId2",Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"}];e&&t.push({Id:"rId3",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",Target:"docProps/custom.xml"});const s=fa.getTemplate(t);return wt(s)}function yN(){return wt(r5.getTemplate())}function xN(e,t){return wt(UB.getTemplate(e,t))}function RN(e){const t=new Array(e).fill(void 0).map((i,r)=>({Id:`rId${r+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${r+1}.xml`})),s=fa.getTemplate([...t,{Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"},{Id:`rId${e+2}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"},{Id:`rId${e+3}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"}]);return wt(s)}function FN(e){return wt(_V.getTemplate({sheetIndex:e}))}function EN(e){const t=Go.get(e)||[],s=[];for(const[i,r]of t){const{index:o,type:n}=r;s.push({Id:`rId${o+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${Lo.get(i).index+1}.${Nc(n)}`})}return wt(fa.getTemplate(s))}function PN(e){return wt(p5.getTemplate({sheetIndex:e}),!0)}function MN(e){const t=di.get(e)||[],s=[];for(let i=0;i{if(!e.size)return;const s=new Map;t.forEach((i,r)=>{e.has(i)&&s.set(r,e.get(i))}),e.clear(),s.forEach((i,r)=>e.set(r,i))},AN=e=>{const t=zr.get(e)??[];t.push(Qt.length-1),zr.set(e,t),Hr.push(e)},IN=e=>{const t=new Map(zr),s=[];for(const i of e){const r=t.get(i);if(!r?.length)return null;const o=r.shift();s.push(o),t.set(i,r)}return s},kN=e=>{if(!e.length||Hr.length===0)return null;const t=new Set,s=[];for(const i of e){const r=Hr.findIndex((o,n)=>!t.has(n)&&o===i);if(r===-1)return null;t.add(r),s.push(r)}return s},LN=e=>{const t=new Map;e.forEach((s,i)=>t.set(s,i)),Qt=e.map(s=>Qt[s]),Hr=e.map(s=>Hr[s]),Uc(Yi,e),Uc(di,e),Uc(js,e),Uc(Go,e),qi.forEach(s=>{s.forEach(i=>{const r=t.get(i.sheetId);r!=null&&(i.sheetId=r)})}),zr=new Map,Hr.forEach((s,i)=>{const r=zr.get(s)??[];r.push(i),zr.set(s,r)})},GN=e=>{if(e.length<=1)return;const t=IN(e)??kN(e);t&&LN(t)},$c=class{getStringPosition(e){return gN(e)}addBodyImageToMap(e,t,s,i,r){uN(e,t,s,i,r)}addHeaderFooterImageToMap(e,t){gy(e,t)}addWorksheet(e,t,s){return aN(e,t,s)}syncOrderWithSheetData(e){GN(e)}reset(){pN()}setFactoryMode(e){nN(e)}getFactoryMode(){return oN()}getSheetNames(){return[...Qt]}},ON=async e=>{let t=0;const s=[],i=new WritableStream({write:n=>{s.push(n),t+=n.length}}),r=new ReadableStream({start:n=>{const a=new FileReader;a.onload=l=>{l.target?.result&&n.enqueue(l.target.result),n.close()},a.readAsArrayBuffer(e)}}),o=new window.CompressionStream("deflate-raw");return await r.pipeThrough(o).pipeTo(i),{size:t,content:new Blob(s)}},VN=async e=>{const t=new Blob([e]),{size:s,content:i}=await ON(t),r=new Uint8Array(await i.arrayBuffer());return{size:s,content:r}},BN=e=>{let t=e.getHours();return t<<=6,t=t|e.getMinutes(),t<<=5,t=t|e.getSeconds()/2,t},NN=e=>{let t=e.getFullYear()-1980;return t<<=4,t=t|e.getMonth()+1,t<<=5,t=t|e.getDate(),t};function bt(e,t){let s="";for(let i=0;i>>=8;return s}var fy=e=>{if(!e.length)return 0;let t=-1,s=0,i=0,r=0;for(let o=0;o>>8^r;return t^-1},my=e=>e.length?fy(typeof e=="string"?new TextEncoder().encode(e):e):0,HN=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function zN(e){const t=String.fromCharCode;function s(u){const h=[];if(!u)return[];const g=u.length;let p=0,f,m;for(;p=55296&&f<=56319&&p=55296&&u<=57343)throw new Error(Ft(255,{point:u}))}function r(u,h){return t(u>>h&63|128)}function o(u){if(!(u&4294967168))return t(u);let h="";return u&4294965248?u&4294901760?u&4292870144||(h=t(u>>18&7|240),h+=r(u,12),h+=r(u,6)):(i(u),h=t(u>>12&15|224),h+=r(u,6)):h=t(u>>6&31|192),h+=t(u&63|128),h}const n=s(e),a=n.length;let l=-1,c,d="";for(;++l{const{content:n,path:a,created:l}=e,c=BN(l),d=NN(l),u=my(r),h=o!==void 0?o:i,g=zN(a),p=g!==a;let f="";if(p){const w=bt(1,1)+bt(my(g),4)+g;f="up"+bt(w.length,2)+w}const m="\0"+(p?"\0\b":"\0\0")+bt(t?8:0,2)+bt(c,2)+bt(d,2)+bt(h?u:0,4)+bt(o??i,4)+bt(i,4)+bt(g.length,2)+bt(f.length,2),C="PK"+m+g+f,v="PK\0"+m+"\0\0\0\0\0\0"+(n?"\0\0\0\0":"\0\0\0")+bt(s,4)+g+f;return{localFileHeader:Uint8Array.from(C,w=>w.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(v,w=>w.charCodeAt(0))}},vy=e=>{let t;if(typeof e=="string"){const s=atob(e.split(";base64,")[1]);t=Uint8Array.from(s,i=>i.charCodeAt(0))}else t=e;return{size:t.length,content:t}},_N=async e=>{const{content:t}=e,{size:s,content:i}=t?vy(t):{size:0,content:Uint8Array.from([])};let r,o,n=!1;if(e.type==="file"&&i&&s>0){const l=await VN(i);r=l.content,o=l.size,n=!0}return{rawContent:i,rawSize:s,deflatedContent:r,deflatedSize:o,isCompressed:n}},WN=(e,t)=>{const{content:s}=e,{content:i}=s?vy(s):{content:Uint8Array.from([])};return{...Cy(e,!1,t,i.length,i,void 0),content:i,isCompressed:!1}},UN=(e,t,s)=>{const i="PK\0\0\0\0"+bt(e,2)+bt(e,2)+bt(t,4)+bt(s,4)+"\0\0";return Uint8Array.from(i,r=>r.charCodeAt(0))},wy=class{constructor(){this.folders=[],this.files=[]}addFolders(e){e.forEach(this.addFolder.bind(this))}addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}addFile(e,t,s=!1){this.files.push({path:e,created:new Date,content:s?t:new TextEncoder().encode(t),isBase64:s,type:"file"})}async getZipFile(e="application/zip"){const t=await this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})}getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}clearStream(){this.folders=[],this.files=[]}packageFiles(e){let t=0,s=0;for(const c of e){const{localFileHeader:d,centralDirectoryHeader:u,content:h}=c;t+=d.length+h.length,s+=u.length}const i=new Uint8Array(t),r=new Uint8Array(s);let o=0,n=0;for(const c of e){const{localFileHeader:d,centralDirectoryHeader:u,content:h}=c;i.set(d,o),o+=d.length,i.set(h,o),o+=h.length,r.set(u,n),n+=u.length}const a=UN(e.length,s,t),l=new Uint8Array(i.length+r.length+a.length);return l.set(i),l.set(r,i.length),l.set(a,i.length+r.length),l}async buildCompressedFileStream(){const e=[...this.folders,...this.files],t=await Promise.all(e.map(_N)),s=[];let i=0;for(let r=0;r{if(e.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]),!qi.size)return;e.addFolders(["xl/worksheets/_rels","xl/drawings/","xl/drawings/_rels","xl/media/"]);let t=0;qi.forEach(s=>{const i=s[0].image[0],{base64:r,imageType:o}=i;e.addFile(`xl/media/image${++t}.${Nc(o)}`,r,!0)})},KN=(e,t)=>{let s=0,i=0;for(let r=0;r0&&Yi.has(r),a=js.size>0&&js.get(r),l=qi.size&&di.has(r);if(!n&&!a&&!l)continue;let c,d,u;n&&(jN(e,r,s),d=s,s++),l&&(qN(e,r,i),u=i,i++),a&&(c=a.name);const h=`xl/worksheets/_rels/sheet${r+1}.xml.rels`;e.addFile(h,TN({tableName:c,drawingIndex:d,vmlDrawingIndex:u}))}},jN=(e,t,s)=>{const i="xl/drawings",r=`${i}/drawing${s+1}.xml`,o=`${i}/_rels/drawing${s+1}.xml.rels`;e.addFile(o,EN(t)),e.addFile(r,FN(t))},qN=(e,t,s)=>{const i="xl/drawings",r=`${i}/vmlDrawing${s+1}.vml`,o=`${i}/_rels/vmlDrawing${s+1}.vml.rels`;e.addFile(r,PN(t)),e.addFile(o,MN(t))},YN=e=>{const t=js,s=Array.from(t.keys());for(let i=0;i{const n=!!o&&Object.keys(o).some(a=>o[a]!=null);e.addFile("xl/workbook.xml",fN(r)),e.addFile("xl/styles.xml",mN(t)),e.addFile("xl/sharedStrings.xml",CN()),e.addFile("xl/theme/theme1.xml",yN()),e.addFile("xl/_rels/workbook.xml.rels",RN(i)),e.addFile("docProps/core.xml",vN(s)),n&&e.addFile("docProps/custom.xml",wN(o)),e.addFile("[Content_Types].xml",bN(i,n)),e.addFile("_rels/.rels",SN(n))},by=(e,t,s={},i)=>{if(!t||t.length===0)return F(159),i.reset(),!1;i.syncOrderWithSheetData(t);const{fontSize:r=11,author:o="AG Grid",activeTab:n=0,customMetadata:a}=s,l=t.length,c=Math.max(Math.min(n,l-1),0);return $N(e),YN(e),KN(e,t),XN(e,r,o,l,c,a),i.reset(),!0},ap=(e,t=new $c)=>{const{data:s,fontSize:i,author:r,activeSheetIndex:o,customMetadata:n}=e,a=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",l=new wy;return by(l,s,{author:r,fontSize:i,activeTab:o,customMetadata:n},t)?l.getZipFile(a):Promise.resolve(void 0)},lp=(e,t=new $c)=>{const{data:s,fontSize:i,author:r,activeSheetIndex:o,customMetadata:n}=e,a=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",l=new wy;if(by(l,s,{author:r,fontSize:i,activeTab:o,customMetadata:n},t))return l.getUncompressedZipFile(a)},ZN=e=>{const{fileName:t="export.xlsx"}=e,s=new $c;ap(e,s).then(i=>{if(i){const r=typeof t=="function"?t():t;oa(r,i)}})},QN=class extends dg{constructor(){super(...arguments),this.beanName="excelCreator",this.workbook=new $c}getMergedParams(e){const t=this.gos.get("defaultExcelExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){F(160);return}const t=()=>{const i=this.getMergedParams(e),r=this.getData(i),{fontSize:o,author:n,mimeType:a,customMetadata:l}=i,c={data:[r],fontSize:o,author:n,mimeType:a,customMetadata:l};this.packageCompressedFile(c).then(d=>{if(d){const{fileName:u}=i,h=typeof u=="function"?u(N(this.gos,{})):u;oa(this.getFileName(h),d)}})},{overlays:s}=this.beans;s?s.showExportOverlay(t):t()}exportDataAsExcel(e){this.export(e)}getDataAsExcel(e){const t=this.getMergedParams(e),s=this.getData(t),{fontSize:i,author:r,mimeType:o,customMetadata:n}=t,a={data:[s],fontSize:i,author:r,mimeType:o,customMetadata:n};return this.packageFile(a)}setFactoryMode(e){this.workbook.setFactoryMode(e)}getFactoryMode(){return this.workbook.getFactoryMode()}getSheetDataForExcel(e){const t=this.getMergedParams(e);return this.getData(t)}getMultipleSheetsAsExcel(e){return lp(e,this.workbook)}exportMultipleSheetsAsExcel(e){ap(e,this.workbook).then(t=>{const{fileName:s="export.xlsx"}=e;if(t){const i=typeof s=="function"?s():s;oa(i,t)}})}getDefaultFileExtension(){return"xlsx"}createSerializingSession(e){const{colModel:t,colNames:s,rowGroupColsSvc:i,valueSvc:r,formula:o,gos:n}=this.beans,a=n.get("excelStyles")||[],l=this.createStyleLinker(a),c={...e,colModel:t,colNames:s,rowGroupColsSvc:i,valueSvc:r,formulaSvc:o,gos:n,suppressRowOutline:e.suppressRowOutline||e.skipRowGroups,headerRowHeight:e.headerRowHeight||e.rowHeight,baseExcelStyles:a,rightToLeft:e.rightToLeft??n.get("enableRtl"),styleLinker:l,headerRowCount:VC(t),pivotModeActive:t.isPivotActive(),workbook:this.workbook};return new xV(c)}createStyleLinker(e){const t=[],s=new Set,i=new Map;e.forEach((n,a)=>{t.push(n.id),s.add(n.id),i.set(n.id,a)});const{gos:r,cellStyles:o}=this.beans;return n=>{const{rowType:a,rowIndex:l,value:c,column:d,columnGroup:u,node:h}=n,g=a==="HEADER",p=a==="HEADER_GROUPING",f=g?d:u;let m=[];if(g||p)return m.push("header"),p&&m.push("headerGroup"),f&&(m=m.concat(Al(f.getDefinition(),r,d||null,u||null))),m;const C=["cell"];if(!t.length)return C;const v=d.getDefinition();return o?.processAllCellClasses(v,N(r,{value:c,data:h.data,node:h,colDef:v,column:d,rowIndex:l}),w=>{s.has(w)&&C.push(w)}),C.sort((w,S)=>{const y=i.get(w)??-1,R=i.get(S)??-1;return y===R?0:ythis.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)},this.stopPropagationCallbacks),this.refreshAriaProperties(),this.addManagedEventListeners({stylesChanged:this.onStylesChanged.bind(this)})}onStylesChanged(e){e.listItemHeightChanged&&(this.rowHeight=this.getItemHeight(),this.refresh())}refreshAriaProperties(){const t=this.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),s=this.eContainer;Ie(s,this.model?.getRowCount()>0?this.ariaRole:"presentation"),de(s,t)}addResizeObserver(){const e=()=>Rt(this.beans,()=>this.drawVirtualRows()),t=vs(this.beans,this.getGui(),e);this.addDestroyFunc(t)}focusInnerElement(e){return this.focusRow(e?this.model.getRowCount()-1:0),!0}onFocusIn(e){const t=e.target;t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=tm(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){const{key:t,shiftKey:s}=e;switch(t){case b.UP:case b.DOWN:{const i=t===b.UP;e.preventDefault(),s?this.moveItem(i):this.navigate(i)}break;case b.PAGE_HOME:case b.PAGE_END:case b.PAGE_UP:case b.PAGE_DOWN:this.navigateToPage(t)!==null&&e.preventDefault();break}}onTabKeyDown(e){this.stopPropagationCallbacks?.stopPropagation(e),this.forceFocusOutOfContainer(e.shiftKey)}getNextRow(e){if(this.lastFocusedRowIndex==null)return;const t=this.lastFocusedRowIndex+(e?-1:1);if(!(t<0||t>=this.model.getRowCount()))return t}moveItem(e){if(!this.moveItemCallback)return;const t=this.getComponentAt(this.lastFocusedRowIndex);t&&this.moveItemCallback(t,e)}navigate(e){const t=this.getNextRow(e);t!==void 0&&this.focusRow(t)}navigateToPage(e,t="focused"){let s=!1;t==="focused"&&(t=this.getLastFocusedRow(),s=!0);const i=this.model.getRowCount()-1;let r=-1;return e===b.PAGE_HOME?r=0:e===b.PAGE_END?r=i:e===b.PAGE_DOWN?r=Math.min(t+this.pageSize,i):e===b.PAGE_UP&&(r=Math.max(t-this.pageSize,0)),r===-1?null:(s?this.focusRow(r):this.ensureIndexVisible(r),r)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),Rt(this.beans,()=>{if(this.isScrolling=!1,!this.isAlive())return;const t=this.renderedRows.get(e);t&&t.eDiv.focus()}))}getComponentAt(e){const t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,s)=>e(t.rowComponent,s))}getItemHeight(){return this.isHeightFromTheme?this.beans.environment.getDefaultListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const s=this.model.getRowCount();if(typeof e!="number"||e<0||e>=s)return!1;const i=e*this.rowHeight,r=i+this.rowHeight,o=this.getGui(),n=o.scrollTop,a=o.offsetHeight,l=n+a,c=t?0:this.rowHeight,d=n>i+c,u=l{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}awaitStable(e){if(this.awaitStableCallbacks.push(e),this.awaitStableCallbacks.length>1)return;const t=this.model.getRowCount();qd(this,()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{if(!this.isAlive())return;const s=this.awaitStableCallbacks;this.awaitStableCallbacks=[];for(const i of s)i()})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&typeof this.model.areRowsEqual=="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),s=t.scrollTop,i=s+t.offsetHeight;if(s===i)this.clearVirtualRows();else{const r=Math.floor(s/this.rowHeight),o=Math.floor(i/this.rowHeight);this.pageSize=Math.floor((i-s)/this.rowHeight),this.ensureRowsRendered(r,o,e)}}ensureRowsRendered(e,t,s){this.renderedRows.forEach((i,r)=>{(rt)&&r!==this.lastFocusedRowIndex&&this.removeRow(r)}),s&&this.refreshRows();for(let i=e;i<=t;i++)this.renderedRows.has(i)||i=t.getRowCount())return;const{cssIdentifier:s,ariaRole:i,renderedRows:r,eContainer:o}=this,n=t.getRow(e),a=i==="tree"?"treeitem":"option",l=$e({tag:"div",cls:`ag-virtual-list-item ag-${s}-virtual-list-item`,role:a,attrs:{tabindex:"-1"}});an(l,t.getRowCount()),ln(l,e+1);const c=this.rowHeight;l.style.height=`${c}px`,l.style.top=`${c*e}px`;const d=this.componentCreator(n,l);d.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),l.appendChild(d.getGui()),r.has(e-1)?r.get(e-1).eDiv.insertAdjacentElement("afterend",l):r.has(e+1)?r.get(e+1).eDiv.insertAdjacentElement("beforebegin",l):o.appendChild(l),r.set(e,{rowComponent:d,eDiv:l,value:n})}removeRow(e){const t=this.renderedRows.get(e);t.eDiv.remove(),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach((t,s)=>{if(s>=e)this.removeRow(s);else{const i=this.model.getRow(s);this.model.areRowsEqual?.(t.value,i)?this.componentUpdater(i,t.rowComponent):this.removeRow(s)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),this.awaitStableCallbacks.length=0,super.destroy())}},t7='.ag-list-item-hovered:after{background-color:var(--ag-accent-color);content:"";height:1px;left:0;position:absolute;right:0}.ag-item-highlight-top:after{top:0}.ag-item-highlight-bottom:after{bottom:0}',cp="ag-list-item-hovered",yy=class extends Ke{constructor(e,t,s){super(),this.comp=e,this.virtualList=t,this.params=s,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.beans.environment.addGlobalCSS(t7,"component-AgVirtualListDragFeature"),this.params.addListeners(this,this.listItemDragStart.bind(this),this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){const e={isInterestedIn:t=>t===this.params.dragSourceType,getIconName:()=>this.moveBlocked?"pinned":"move",getContainer:()=>this.comp.getGui(),onDragging:t=>this.onDragging(t),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave(),onDragCancel:()=>this.onDragCancel()};this.beans.dragAndDrop?.addDropTarget(e)}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new _l({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;const t=this.getListDragItem(e),s=this.virtualList.getComponentAt(t.rowIndex);if(!s)return;const i=s.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,dn(i,cp),dn(i,`ag-item-highlight-${t.position}`))}getListDragItem(e){const t=this.virtualList.getGui(),s=Number.parseFloat(window.getComputedStyle(t).paddingTop),i=this.virtualList.getRowHeight(),r=this.virtualList.getScrollTop(),o=Math.max(0,(e.y-s+r)/i),n=this.params.getNumRows(this.comp)-1,a=Math.min(n,o)|0;return{rowIndex:a,position:Math.round(o)>o||o>n?"bottom":"top",component:this.virtualList.getComponentAt(a)}}onDragStop(){this.moveBlocked||(this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearDragProperties())}onDragCancel(){this.clearDragProperties()}onDragLeave(){this.clearDragProperties()}clearDragProperties(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){const e=this.virtualList.getGui();for(const t of e.querySelectorAll(`.${cp}`))for(const s of[cp,"ag-item-highlight-top","ag-item-highlight-bottom"])t.classList.remove(s);this.lastHoveredListItem=null}},xy=class extends li{constructor(e){super(e,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:e,max:t,step:s}=this.config;e!=null&&this.setMinValue(e),t!=null&&this.setMaxValue(t),this.setStep(s||1)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>{const t=e.target.value;this.setValue(t)}})}setMinValue(e){return this.min=e,this.eInput.setAttribute("min",e.toString()),this}setMaxValue(e){return this.max=e,this.eInput.setAttribute("max",e.toString()),this}setStep(e){return this.eInput.setAttribute("step",e.toString()),this}setValue(e,t){this.min!=null&&(e=Math.max(parseFloat(e),this.min).toString()),this.max!=null&&(e=Math.min(parseFloat(e),this.max).toString());const s=super.setValue(e,t);return this.eInput.value=e,s}},Ry={selector:"AG-INPUT-RANGE",component:xy},Nt=class extends Kl{constructor(e){super(e,`
`,[Ry,la]),this.eLabel=x,this.eSlider=x,this.eText=x,this.labelAlignment="top"}postConstruct(){super.postConstruct(),this.eSlider.addCss("ag-slider-field");const{minValue:e,maxValue:t,textFieldWidth:s,step:i,value:r,onValueChange:o}=this.config;e!=null&&this.setMinValue(e),t!=null&&this.setMaxValue(t),s!=null&&this.setTextFieldWidth(s),i!=null&&this.setStep(i),r!=null&&this.setValue(r),o!=null&&this.onValueChange(o)}onValueChange(e){return this.addManagedListeners(this.eText,{fieldValueChanged:()=>{const t=parseFloat(this.eText.getValue());this.eSlider.setValue(t.toString(),!0),e(t||0)}}),this.addManagedListeners(this.eSlider,{fieldValueChanged:()=>{const t=this.eSlider.getValue();this.eText.setValue(t,!0),e(parseFloat(t))}}),this}setSliderWidth(e){return this.eSlider.setWidth(e),this}setTextFieldWidth(e){return this.eText.setWidth(e),this}setMinValue(e){return this.eSlider.setMinValue(e),this.eText.setMin(e),this}setMaxValue(e){return this.eSlider.setMaxValue(e),this.eText.setMax(e),this}getValue(){return this.eText.getValue()}setValue(e,t){return this.getValue()===e?this:(this.eText.setValue(e,!0),this.eSlider.setValue(e,!0),t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}},Tt={selector:"AG-SLIDER",component:Nt},s7=class extends ct{constructor(){super({template:{tag:"div",cls:"ag-color-input",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:"input",ref:"eInput",cls:"ag-input-field-input"},{tag:"div",ref:"eColor",cls:"ag-color-input-color"}]}]}}),this.eColor=x}wireBeans(e){this.color=e.agChartsExports._Util.Color}setColor(e){const t=e.toRgbaString();this.setValue(this.color.fromString(t).toHexString().toUpperCase(),!0),this.eColor.style.backgroundColor=t}setValue(e,t){const s=this.color.validColorString(e??"");return this.eInput.setCustomValidity(s?"":this.getLocaleTextFunc()("invalidColor","Color value is invalid")),super.setValue(e,t),s&&!t&&this.dispatchLocalEvent({type:"colorChanged"}),this}onColorChanged(e){this.addManagedListeners(this,{colorChanged:()=>e(this.color.fromString(this.value))})}},i7={selector:"AG-COLOR-INPUT",component:s7},Fy=8,Kc=[],r7=class extends Pt{constructor(e){super(`
`,[i7]),this.H=1,this.S=1,this.B=1,this.A=1,this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1,this.colorChanged=!1,this.spectrumColor=x,this.spectrumVal=x,this.spectrumDragger=x,this.spectrumHue=x,this.spectrumHueSlider=x,this.spectrumAlpha=x,this.spectrumAlphaSlider=x,this.colorInput=x,this.recentColors=x,this.picker=e.picker}wireBeans(e){this._Color=e.agChartsExports._Util.Color}postConstruct(){this.initTabIndex(),this.initRecentColors(),this.addGuiEventListener("focus",()=>this.spectrumColor.focus()),this.addGuiEventListener("keydown",e=>{e.key===b.ENTER&&!e.defaultPrevented&&this.destroy()}),this.addManagedListeners(this.spectrumColor,{keydown:e=>this.moveDragger(e)}),this.addManagedListeners(this.spectrumAlphaSlider,{keydown:e=>this.moveAlphaSlider(e)}),this.addManagedListeners(this.spectrumHueSlider,{keydown:e=>this.moveHueSlider(e)}),this.addManagedListeners(this.spectrumVal,{mousedown:this.onSpectrumDraggerDown.bind(this)}),this.addManagedListeners(this.spectrumHue,{mousedown:this.onSpectrumHueDown.bind(this)}),this.addManagedListeners(this.spectrumAlpha,{mousedown:this.onSpectrumAlphaDown.bind(this)}),this.addGuiEventListener("mousemove",e=>{this.onSpectrumDraggerMove(e),this.onSpectrumHueMove(e),this.onSpectrumAlphaMove(e)}),this.addManagedListeners(document,{mouseup:this.onMouseUp.bind(this)}),this.colorInput.onColorChanged(this.setColor.bind(this)),this.addManagedListeners(this.recentColors,{click:this.onRecentColorClick.bind(this),keydown:e=>{(e.key===b.ENTER||e.key===b.SPACE)&&(e.preventDefault(),this.onRecentColorClick(e))}})}initTabIndex(){const e=this.tabIndex=this.gos.get("tabIndex").toString();this.spectrumColor.setAttribute("tabindex",e),this.spectrumHueSlider.setAttribute("tabindex",e),this.spectrumAlphaSlider.setAttribute("tabindex",e)}refreshSpectrumRect(){return this.spectrumValRect=this.spectrumVal.getBoundingClientRect()}refreshHueRect(){return this.spectrumHueRect=this.spectrumHue.getBoundingClientRect()}refreshAlphaRect(){return this.spectrumAlphaRect=this.spectrumAlpha.getBoundingClientRect()}onSpectrumDraggerDown(e){e.preventDefault(),this.refreshSpectrumRect(),this.isSpectrumDragging=!0,this.moveDragger(e)}onSpectrumDraggerMove(e){this.isSpectrumDragging&&this.moveDragger(e)}onSpectrumHueDown(e){this.refreshHueRect(),this.isSpectrumHueDragging=!0,this.moveHueSlider(e)}onSpectrumHueMove(e){this.isSpectrumHueDragging&&this.moveHueSlider(e)}onSpectrumAlphaDown(e){this.refreshAlphaRect(),this.isSpectrumAlphaDragging=!0,this.moveAlphaSlider(e)}onSpectrumAlphaMove(e){this.isSpectrumAlphaDragging&&this.moveAlphaSlider(e)}onMouseUp(){this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1}moveDragger(e){const t=this.spectrumValRect;if(!t)return;let s,i;if(e instanceof MouseEvent)s=e.clientX-t.left,i=e.clientY-t.top;else{const r=e.key===b.LEFT,o=e.key===b.RIGHT,n=e.key===b.UP,a=e.key===b.DOWN,l=n||a,c=r||o;if(!l&&!c)return;e.preventDefault();const{x:d,y:u}=this.getSpectrumValue();s=d+(c?r?-5:5:0),i=u+(l?n?-5:5:0)}s=Math.max(s,0),s=Math.min(s,t.width),i=Math.max(i,0),i=Math.min(i,t.height),this.setSpectrumValue(s/t.width,1-i/t.height)}moveHueSlider(e){const t=this.spectrumHueRect;if(!t)return;const s=this.moveSlider(this.spectrumHueSlider,e);s!=null&&(this.H=1-s/t.width,this.update())}moveAlphaSlider(e){const t=this.spectrumAlphaRect;if(!t)return;const s=this.moveSlider(this.spectrumAlphaSlider,e);s!=null&&(this.A=s/t.width,this.update())}moveSlider(e,t){const s=e.getBoundingClientRect(),i=e.parentElement?.getBoundingClientRect();if(!e||!i)return null;const r=s.width/2;let o;if(t instanceof MouseEvent)o=Math.floor(t.clientX-i.left);else{const n=t.key===b.LEFT,a=t.key===b.RIGHT;if(!n&&!a)return null;t.preventDefault();const l=n?-5:5;o=parseFloat(e.style.left)+r+l}return o=Math.max(o,0),o=Math.min(o,i.width),e.style.left=o-r+"px",o}update(e){const{A:t,S:s,B:i,H:r,_Color:o}=this,n=r*360,a=o.fromHSB(n,s,i,t),l=a.toRgbaString(),d=o.fromHSB(n,s,i).toRgbaString(),h=o.fromHSB(n,1,1).toRgbaString(),g=this.picker;o.fromString(g.getValue()).toRgbaString()!==l&&(this.colorChanged=!0),g.setValue(l),this.spectrumColor.style.backgroundColor=h,this.spectrumDragger.style.backgroundColor=d,this.spectrumHueSlider.style.backgroundColor=h,this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color-from",o.fromHSB(n,s,i,0).toRgbaString()),this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color-to",d),this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color",l),e||this.colorInput.setColor(a)}setSpectrumValue(e,t,s){const i=this.spectrumValRect||this.refreshSpectrumRect();if(i==null)return;const r=this.spectrumDragger,o=r.getBoundingClientRect();e=Math.max(0,e),e=Math.min(1,e),t=Math.max(0,t),t=Math.min(1,t),this.S=e,this.B=t,r.style.left=e*i.width-o.width/2+"px",r.style.top=(1-t)*i.height-o.height/2+"px",this.update(s)}getSpectrumValue(){const e=this.spectrumDragger,t=e.getBoundingClientRect(),s=parseFloat(e.style.left)+t.width/2,i=parseFloat(e.style.top)+t.height/2;return{x:s,y:i}}initRecentColors(){const e=Kc,t=e.map((s,i)=>`
`);this.recentColors.innerHTML=t.join(""),V(this.recentColors,!!e.length)}setValue(e){const t=this._Color.fromString(e);this.setColor(t,!0)}setColor(e,t){const[s,i,r]=e.toHSB();this.H=(isNaN(s)?0:s)/360,this.A=e.a;const o=this.spectrumHueRect||this.refreshHueRect(),n=this.spectrumAlphaRect||this.refreshAlphaRect();this.spectrumHueSlider.style.left=`${(this.H-1)*-o.width-this.spectrumHueSlider.getBoundingClientRect().width/2}px`,this.spectrumAlphaSlider.style.left=`${this.A*n.width-this.spectrumAlphaSlider.getBoundingClientRect().width/2}px`,this.setSpectrumValue(i,r,!t)}onRecentColorClick(e){const t=e.target;if(!D(t.id))return;const s=parseInt(t.id,10);this.setValue(Kc[s]),this.destroy()}addRecentColor(){const t=this._Color.fromHSB(this.H*360,this.S,this.B,this.A).toRgbaString();let s=Kc;!this.colorChanged||s[0]===t||(s=s.filter(i=>i!=t),s=[t].concat(s),s.length>Fy&&(s=s.slice(0,Fy)),Kc=s)}destroy(){this.addRecentColor(),super.destroy()}},o7=".ag-panel{background-color:var(--ag-panel-background-color);display:flex;flex-direction:column;overflow:hidden;position:relative}.ag-dialog{border:var(--ag-dialog-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dialog-shadow);position:absolute}.ag-panel-title-bar{align-items:center;background-color:var(--ag-panel-title-bar-background-color);border-bottom:var(--ag-panel-title-bar-border);color:var(--ag-panel-title-bar-text-color);cursor:default;display:flex;flex:none;font-family:var(--ag-panel-title-bar-font-family);font-size:var(--ag-panel-title-bar-font-size);font-weight:var(--ag-panel-title-bar-font-weight);height:var(--ag-panel-title-bar-height);padding:var(--ag-spacing) var(--ag-cell-horizontal-padding)}.ag-panel-title-bar-button{cursor:pointer;:where(.ag-icon){color:var(--ag-panel-title-bar-icon-color)}}:where(.ag-ltr) .ag-panel-title-bar-button{margin-left:calc(var(--ag-spacing)*2);margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-panel-title-bar-button{margin-left:var(--ag-spacing);margin-right:calc(var(--ag-spacing)*2)}.ag-panel-title-bar-title{flex:1 1 auto}.ag-panel-title-bar-buttons{display:flex}.ag-panel-content-wrapper{display:flex;flex:1 1 auto;overflow:hidden;position:relative}:where(.ag-dragging-fill-handle) .ag-dialog,:where(.ag-dragging-range-handle) .ag-dialog{opacity:.7;pointer-events:none}";function n7(e){return e??(e=e||"default"),{tag:"div",cls:`ag-panel ag-${e}-panel`,attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eTitleBar",cls:`ag-panel-title-bar ag-${e}-panel-title-bar ag-unselectable`,children:[{tag:"span",ref:"eTitle",cls:`ag-panel-title-bar-title ag-${e}-panel-title-bar-title`},{tag:"div",ref:"eTitleBarButtons",cls:`ag-panel-title-bar-buttons ag-${e}-panel-title-bar-buttons`}]},{tag:"div",ref:"eContentWrapper",cls:`ag-panel-content-wrapper ag-${e}-panel-content-wrapper`}]}}var dp=class extends Pt{constructor(e){super(n7(e.cssIdentifier)),this.config=e,this.closable=!0,this.eContentWrapper=x,this.eTitleBar=x,this.eTitleBarButtons=x,this.eTitle=x,this.registerCSS(o7)}postConstruct(){const{component:e,closable:t,hideTitleBar:s,title:i,minWidth:r=250,width:o,minHeight:n=250,height:a,centered:l,popup:c,x:d,y:u,postProcessPopupParams:h}=this.config,g=this.beans,p=this.createManagedBean(new wu(this.getGui(),{minWidth:r,width:o,minHeight:n,height:a,centered:l,x:d,y:u,popup:c,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}));this.positionableFeature=p;const f=this.getGui();if(e&&this.setBodyComponent(e),s?V(this.eTitleBar,!1):(i&&this.setTitle(i),this.setClosable(t??this.closable)),this.addManagedElementListeners(this.eTitleBar,{mousedown:C=>{if(f.contains(C.relatedTarget)||f.contains(ie(g))||this.eTitleBarButtons.contains(C.target)){C.preventDefault();return}const v=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");v&&v.focus()}}),c&&p.isPositioned())return;this.renderComponent&&this.renderComponent();let m;if(h){const{type:C,eventSource:v,mouseEvent:w}=h;m=()=>g.popupSvc?.callPostProcessPopup(h,C,f,v,w)}p.initialisePosition(m),this.eContentWrapper.style.height="0"}renderComponent(){const e=this.getGui();e.focus(),this.close=()=>{e.remove(),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(e){if(e!==this.closable&&(this.closable=e),e){const t=this.closeButtonComp=new Pt({tag:"div",cls:"ag-button"});this.createBean(t);const s=t.getGui(),i=this.beans.iconSvc.createIconNoSpan("close",this.beans);i.classList.add("ag-panel-title-bar-button-icon"),s.appendChild(i),this.addTitleBarButton(t),t.addManagedElementListeners(s,{click:this.onBtClose.bind(this)})}else this.closeButtonComp&&(this.closeButtonComp.getGui().remove(),this.closeButtonComp=this.destroyBean(this.closeButtonComp))}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const s=this.eTitleBarButtons,i=s.children,r=i.length;t==null&&(t=r),t=Math.max(0,Math.min(t,r)),e.addCss("ag-panel-title-bar-button");const o=e.getGui();t===0?s.prepend(o):t===r?s.append(o):i[t-1].after(o),e.setParentComponent(this)}getBodyHeight(){return un(this.eContentWrapper)}getBodyWidth(){return gr(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const e=this.getGui();e&&Ne(e)&&this.close(),super.destroy()}},up=class extends dp{constructor(e,t){super({...e,popup:!0}),this.callbacks=t,this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}wireBeans(e){this.popupSvc=e.popupSvc}postConstruct(){const e=this.getGui(),{movable:t,resizable:s,maximizable:i,modal:r}=this.config;this.addCss("ag-dialog"),super.postConstruct(),this.tabGuardFeature=this.createManagedBean(new Hl(this,this.callbacks?.stopPropagationCallbacks)),this.tabGuardFeature.initialiseTabGuard({isFocusableContainer:!0,onFocusIn:()=>{this.popupSvc?.bringPopupToFront(e)},onTabKeyDown:o=>{if(r)return;const n=o.shiftKey,a=Qe(this.beans,e,!1,n);(!a||this.tabGuardFeature.getTabGuardCtrl().isTabGuard(a))&&this.callbacks?.focusNextContainer(this.beans,n)&&o.preventDefault()}}),t&&this.setMovable(t),i&&this.setMaximizable(i),s&&this.setResizable(s),this.config.modal||this.callbacks?.configureFocusableContainer(this.beans,this)}setAllowFocus(e){this.tabGuardFeature.getTabGuardCtrl().setAllowFocus(e)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:s,title:i,afterGuiAttached:r}=this.config,o=this.getLocaleTextFunc(),n=this.popupSvc?.addPopup({modal:s,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:i||o("ariaLabelDialog","Dialog"),afterGuiAttached:r});n&&(this.close=n.hideFunc)}onClosed(e){this.destroy(),this.config.closedCallback?.(e)}setMaximized(e){this.isMaximizable&&e!==this.isMaximized&&this.toggleMaximize()}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:t,y:s,width:i,height:r}=this.lastPosition;this.setWidth(i),this.setHeight(r),this.positionableFeature.offsetElement(t,s)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){V(this.maximizeIcon,!this.isMaximized),V(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){if(this.maximizeListeners.length){for(const e of this.maximizeListeners)e();this.maximizeListeners.length=0}this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e){this.clearMaximizebleListeners(),this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0);return}const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;this.isMaximizable=e;const s=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),s.addManagedElementListeners(s.getGui(),{click:this.toggleMaximize.bind(this)}),this.addTitleBarButton(s,0),this.maximizeListeners.push(...this.addManagedElementListeners(t,{dblclick:this.toggleMaximize.bind(this)})),[this.resizeListenerDestroy]=this.addManagedListeners(this.positionableFeature,{resize:()=>{this.isMaximized=!1,this.refreshMaximizeIcon()}})}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new Pt({tag:"div",cls:"ag-dialog-button"})),t=e.getGui(),s=this.beans.iconSvc;return this.maximizeIcon=s.createIconNoSpan("maximize"),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=s.createIconNoSpan("minimize"),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}},hp=class extends vc{constructor(e){super({pickerAriaLabelKey:"ariaLabelColorPicker",pickerAriaLabelValue:"Color Picker",pickerType:"ag-list",className:"ag-color-picker",pickerIcon:"chartsColorPicker",...e})}postConstruct(){this.eDisplayFieldColor=re({tag:"span",cls:"ag-color-picker-color"}),this.eDisplayFieldText=re({tag:"span",cls:"ag-color-picker-value"}),this.eDisplayField.append(this.eDisplayFieldColor,this.eDisplayFieldText),super.postConstruct(),this.value&&this.setValue(this.value)}createPickerComponent(){const e=this.eWrapper.getBoundingClientRect(),t=this.beans.popupSvc.getParentRect();return this.createBean(new up({closable:!1,modal:!0,hideTitleBar:!0,minWidth:190,width:190,height:250,x:e.right-t.left-190,y:e.top-t.top-250-(this.config.pickerGap??0),postProcessPopupParams:{type:"colorPicker",eventSource:this.eWrapper}},this.config.dialogCallbacks))}renderAndPositionPicker(){const e=this.pickerComponent,t=this.createBean(new r7({picker:this}));return e.addCss("ag-color-dialog"),t.addDestroyFunc(()=>{e.isAlive()&&this.destroyBean(e)}),e.setParentComponent(this),e.setBodyComponent(t),t.setValue(this.getValue()),t.getGui().focus(),e.addDestroyFunc(()=>{this.isDestroyingPicker?this.isDestroyingPicker=!1:(this.beforeHidePicker(),this.isDestroyingPicker=!0,t.isAlive()&&this.destroyBean(t),this.isAlive()&&this.getFocusableElement().focus())}),()=>this.pickerComponent?.close()}setValue(e){return this.value===e?this:(this.eDisplayFieldColor.style.backgroundColor=e,this.eDisplayFieldText.textContent=this.beans.agChartsExports._Util.Color.fromString(e).toHexString().toUpperCase(),super.setValue(e))}getValue(){return this.value}},a7={selector:"AG-COLOR-PICKER",component:hp},l7=class extends po{constructor(e){super(),this.setTemplateFromElement(e.getGui(),void 0,void 0,!0)}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===b.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}},jc=class extends Ke{constructor(e){super(),this.callbacks=e,this.ACTIVATION_DELAY=80,this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(e){const{menuItemDef:t,isAnotherSubMenuOpen:s,level:i,childComponent:r,contextParams:o}=e;return this.params=e.menuItemDef,this.level=i,this.isAnotherSubMenuOpen=s,this.childComponent=r,this.contextParams=o,this.cssClassPrefix=this.params.menuItemParams?.cssClassPrefix??"ag-menu-option",this.callbacks.getMenuItemComp(this.beans,this.params,{...t,level:i,isAnotherSubMenuOpen:s,openSubMenu:n=>this.openSubMenu(n),closeSubMenu:()=>this.closeSubMenu(),closeMenu:n=>this.closeMenu(n),updateTooltip:(n,a)=>this.refreshTooltip(n,a),onItemActivated:()=>this.onItemActivated()}).then(n=>{if(!n)return;this.menuItemComp=n;const a=n.configureDefaults?.();a&&this.configureDefaults(a===!0?void 0:a)})}addListeners(e,t){t?.suppressClick||this.addManagedElementListeners(e,{click:s=>this.onItemSelected(s)}),t?.suppressKeyboardSelect||this.addManagedElementListeners(e,{keydown:s=>{(s.key===b.ENTER||s.key===b.SPACE)&&(s.preventDefault(),this.onItemSelected(s))}}),t?.suppressMouseDown||this.addManagedElementListeners(e,{mousedown:s=>{s.stopPropagation(),s.preventDefault()}}),t?.suppressMouseOver||this.addManagedElementListeners(e,{mouseenter:()=>this.onMouseEnter(),mouseleave:()=>this.onMouseLeave()})}isDisabled(){return!!this.params.disabled}openSubMenu(e=!1,t){if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const s=re({tag:"div",cls:"ag-menu",role:"presentation"});this.eSubMenuGui=s;let i,r=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const c=this.createBean(new l7(this.childComponent));c.setParentComponent(this);const d=c.getGui(),u="mouseenter",h=()=>this.cancelDeactivate();d.addEventListener(u,h),i=()=>{d.removeEventListener(u,h),this.destroyBean(c)},s.appendChild(d),this.childComponent.afterGuiAttached&&(r=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const c=this.createBean(new qc(this.level+1,this.contextParams,this.callbacks));c.setParentComponent(this),c.addMenuItems(this.params.subMenu),s.appendChild(c.getGui()),this.addManagedListeners(c,{closeMenu:d=>this.dispatchLocalEvent(d)}),c.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),i=()=>this.destroyBean(c),e&&(r=()=>{c.activateFirstItem(),this.subMenuIsOpening=!1})}const o=this.beans.popupSvc,n=()=>{const c=this.eGui;o?.positionPopupForMenu({eventSource:c,ePopup:s,event:t instanceof MouseEvent?t:void 0,additionalParams:this.callbacks.getPostProcessPopupParams(this.contextParams)})},a=this.getLocaleTextFunc(),l=o?.addPopup({modal:!0,eChild:s,positionCallback:n,anchorToElement:this.eGui,ariaLabel:a("ariaLabelSubMenu","SubMenu"),afterGuiAttached:r});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{l&&l.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),i(),this.menuItemComp.setExpanded?.(!1),this.eSubMenuGui=void 0},this.menuItemComp.setExpanded?.(!0)}setAriaExpanded(e){this.suppressAria||ot(this.eGui,e)}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1))}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(e,t){this.cancelActivate(),!(this.params.disabled&&!t)&&(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),this.menuItemComp.setActive?.(!0),this.suppressFocus||this.callbacks.preserveRangesWhile(this.beans,()=>this.eGui.focus({preventScroll:!t})),e&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){this.cancelDeactivate(),this.suppressRootStyles||this.eGui.classList.remove(`${this.cssClassPrefix}-active`),this.menuItemComp.setActive?.(!1),this.isActive=!1,this.subMenuIsOpen&&this.closeSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(e){this.parentComponent=e}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(e){this.menuItemComp.select?.(),this.params.action?this.beans.frameworkOverrides.wrapOutgoing(()=>this.params.action(this.gos.addCommon({...this.contextParams}))):this.openSubMenu(e&&e.type==="keydown",e),!(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)&&this.closeMenu(e)}closeMenu(e){const t={type:"closeMenu"};e&&(e instanceof MouseEvent?t.mouseEvent=e:t.keyboardEvent=e),this.dispatchLocalEvent(t)}onItemActivated(){const e={type:"menuItemActivated",menuItem:this};this.dispatchLocalEvent(e)}cancelActivate(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)}cancelDeactivate(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)}onMouseEnter(){this.cancelDeactivate(),this.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),this.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),this.ACTIVATION_DELAY):this.deactivate()}refreshRootElementGui(e){let t=this.menuItemComp.getGui();const{cssClassPrefix:s,params:{cssClasses:i,disabled:r}}=this,o=this.menuItemComp.getRootElement?.();if(o&&(e||t.classList.add("ag-menu-option-custom"),t=o),this.suppressRootStyles=!!e,!this.suppressRootStyles){t.classList.add(s);for(const n of i??[])t.classList.add(n);r&&t.classList.add(`${s}-disabled`)}return t}applyAriaProperties(e){const{params:{checked:t,subMenu:s,subMenuRole:i,disabled:r}}=this,o=t!=null;Ie(e,o?"menuitemcheckbox":"menuitem"),s&&lm(e,i??"menu"),r&&nn(e,!0)}configureDefaults(e){if(!this.menuItemComp){setTimeout(()=>this.configureDefaults(e));return}const{suppressRootStyles:t,suppressTooltip:s,suppressAria:i,suppressTabIndex:r,suppressFocus:o}=e||{},{params:{tooltip:n,disabled:a}}=this,l=this.eGui=this.refreshRootElementGui(!!t);this.suppressAria=!!i,i||this.applyAriaProperties(l),r||l.setAttribute("tabindex","-1"),s||this.refreshTooltip(n),a||this.addListeners(l,e),this.suppressFocus=!!o}refreshTooltip(e,t){if(this.tooltip=e,this.tooltipFeature=this.destroyBean(this.tooltipFeature),!e||!this.menuItemComp)return;const s=this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:t});s&&(this.tooltipFeature=this.createBean(s))}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),this.menuItemComp?.destroy?.(),super.destroy()}},qc=class extends po{constructor(e=0,t,s){super({tag:"div",cls:"ag-menu-list",role:"menu"}),this.level=e,this.menuActionParams=t,this.callbacks=s,this.menuItems=[]}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.callbacks.preserveRangesWhile(this.beans,()=>this.handleKeyDown(e)),onFocusIn:e=>this.handleFocusIn(e),onFocusOut:e=>this.handleFocusOut(e)})}onTabKeyDown(e){this.getParentComponent()?.getGui()?.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case b.UP:case b.RIGHT:case b.DOWN:case b.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case b.ESCAPE:this.closeIfIsChild()&&this.callbacks.stopPropagationCallbacks.stopPropagation(e);break}}handleFocusIn(e){const t=e.relatedTarget;!this.tabGuardFeature.getTabGuardCtrl().isTabGuard(t)&&(this.getGui().contains(t)||this.activeMenuItem?.getSubMenuGui()?.contains(t))||(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(e){const t=e.relatedTarget;!this.activeMenuItem||this.getGui().contains(t)||this.activeMenuItem.getSubMenuGui()?.contains(t)||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){e!=null&&$.all(e.map(t=>t==="separator"?$.resolve({eGui:this.createSeparator()}):typeof t=="string"?(this.callbacks.warnNoItem?.(t),$.resolve({eGui:null})):this.addItem(t))).then(t=>{for(const s of t??[])s?.eGui&&(this.appendChild(s.eGui),s.comp&&this.menuItems.push(s.comp))})}addItem(e){const t=this.createManagedBean(new jc(this.callbacks));return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some(s=>s.isSubMenuOpen()),level:this.level,contextParams:this.menuActionParams}).then(()=>(t.setParentComponent(this),this.addManagedListeners(t,{closeMenu:s=>{this.dispatchLocalEvent(s)},menuItemActivated:s=>{this.activeMenuItem&&this.activeMenuItem!==s.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=s.menuItem}}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){const e=this.menuItems.filter(t=>!t.isDisabled())[0];e&&e.activate()}createSeparator(){const e={tag:"div",cls:"ag-menu-separator-part"};return $e({tag:"div",cls:"ag-menu-separator",attrs:{"aria-hidden":"true"},children:[e,e,e,e]})}handleNavKey(e){switch(e){case b.UP:case b.DOWN:{const s=this.findNextItem(e===b.UP);s&&s!==this.activeMenuItem&&s.activate(!1,!0);return}}const t=this.gos.get("enableRtl")?b.RIGHT:b.LEFT;e===t?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();return t&&t instanceof jc?(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0):!1}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){const t=[...this.menuItems];if(!t.length)return;if(!this.activeMenuItem)return e?W(t):t[0];e&&t.reverse();let s,i=!1;for(const r of t){if(!i){r===this.activeMenuItem&&(i=!0);continue}s=r;break}return i&&!s?t[0]:s||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}},c7="ag-menu",d7="ag-context-menu-loading-icon",Ey=class extends Ke{constructor(e){super(),this.params=e,this.destroyLoadingSpinner=null,this.lastPromise=0}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenu(e,t,s){const{getMenuItems:i,shouldBlockMenuOpen:r}=this.params,o=i(e,t);if(aC(o)){const n=this.lastPromise+1;return this.lastPromise=n,this.destroyLoadingSpinner||this.createLoadingIcon(t),o.then(a=>{if(this.lastPromise!==n)return;const{target:l}=t,c=!l;a?.length&&(c||Ne(l))&&!r?.()&&this.createContextMenu({menuItems:a,menuActionParams:e,mouseEvent:t,anchorToElement:s}),this.destroyLoadingSpinner?.()}),!0}return o?.length?(this.createContextMenu({menuItems:o,menuActionParams:e,mouseEvent:t,anchorToElement:s}),!0):!1}createLoadingIcon(e){const{beans:t}=this,s=this.getLocaleTextFunc(),i=t.iconSvc.createIconNoSpan("loadingMenuItems"),r=$e({tag:"div",cls:d7});r.appendChild(i);const o=It(t),n=cr(t);if(!n)return;n.appendChild(r),t.ariaAnnounce?.announceValue(s("ariaLabelLoadingContextMenu","Loading Context Menu"),"contextmenu"),t.environment.applyThemeClasses(r),tl(r,e,t);const a=l=>{tl(r,l,t)};o.addEventListener("mousemove",a),this.destroyLoadingSpinner=()=>{o.removeEventListener("mousemove",a),r.remove(),this.destroyLoadingSpinner=null}}createContextMenu(e){const{mapMenuItems:t,menuItemCallbacks:s,beforeMenuOpen:i,onMenuClose:r,afterMenuDestroyed:o,onVisibleChanged:n,onMenuOpen:a}=this.params,{menuItems:l,menuActionParams:c,mouseEvent:d,anchorToElement:u}=e,h=this.beans.popupSvc,g=t?S=>t(l,c,S):()=>l,p=new u7(g,c,s);this.createBean(p);const f=p.getGui();i?.(c);const m={additionalParams:s.getPostProcessPopupParams(c),type:"contextMenu",mouseEvent:d,ePopup:f,nudgeY:1},C=this.getLocaleTextFunc(),v=h?.addPopup({modal:!0,eChild:f,closeOnEsc:!0,closedCallback:S=>{s.preserveRangesWhile(this.beans,()=>{r?.(),this.destroyBean(p),o?.(),n?.(!1,S===void 0?"api":"ui")})},click:d,positionCallback:()=>{const S=this.gos.get("enableRtl");h?.positionPopupUnderMouseEvent({...m,nudgeX:S?(f.offsetWidth+1)*-1:1})},anchorToElement:u,ariaLabel:C("ariaLabelContextMenu","Context Menu")});v&&(a?.(),p.afterGuiAttached({container:"contextMenu",hidePopup:v.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=p,p.addEventListener("destroyed",()=>{this.activeMenu===p&&(this.activeMenu=null)}),v&&p.addEventListener("closeMenu",S=>v.hideFunc({mouseEvent:S.mouseEvent??void 0,keyboardEvent:S.keyboardEvent??void 0,forceHide:!0}));const w=d&&d instanceof MouseEvent&&d.type==="mousedown";n?.(!0,w?"api":"ui")}destroy(){this.destroyLoadingSpinner?.(),super.destroy()}},u7=class extends Pt{constructor(e,t,s){super({tag:"div",cls:c7,role:"presentation"}),this.getMenuItems=e,this.menuActionParams=t,this.callbacks=s,this.menuList=null}postConstruct(){const e=this.createManagedBean(new qc(0,this.menuActionParams,this.callbacks)),t=this.getMenuItems(()=>this.getGui());e.addMenuItems(t),this.appendChild(e),this.menuList=e,e.addEventListener("closeMenu",s=>this.dispatchLocalEvent(s))}afterGuiAttached({hidePopup:e}){e&&this.addDestroyFunc(e);const t=this.menuList;t&&this.callbacks.preserveRangesWhile(this.beans,()=>Ge(t.getGui()))}},Py=class extends Pt{constructor(e){super({tag:"div"}),this.callbacks=e}init(e){this.params=e,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addAriaAttributes(),this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addAriaAttributes(){const{checked:e,subMenu:t}=this.params,s=this.getGui();e&&Hd(s,e),t&&ot(s,!1)}addIcon(){if(this.params.isCompact)return;const e=$e({tag:"span",ref:"eIcon",cls:`${this.getClassName("part")} ${this.getClassName("icon")}`,role:"presentation"}),{checked:t,icon:s}=this.params;t?e.appendChild(this.beans.iconSvc.createIconNoSpan("check")):s&&(fn(s)?e.appendChild(s):typeof s=="string"?e.innerHTML=s:this.callbacks?.warnNoIcon?.()),this.getGui().appendChild(e)}addName(){const e=$e({tag:"span",ref:"eName",cls:`${this.getClassName("part")} ${this.getClassName("text")}`,children:this.params.name||""});this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=$e({tag:"span",ref:"eShortcut",cls:`${this.getClassName("part")} ${this.getClassName("shortcut")}`,children:this.params.shortcut||""});this.getGui().appendChild(e)}addSubMenu(){const e=$e({tag:"span",ref:"ePopupPointer",cls:`${this.getClassName("part")} ${this.getClassName("popup-pointer")}`}),t=this.getGui();if(this.params.subMenu){const s=this.gos.get("enableRtl")?"subMenuOpenRtl":"subMenuOpen";e.appendChild(this.beans.iconSvc.createIconNoSpan(s))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}};function gp(e,t){if(!t)return null;const s=Kt(e),i=s.indexOf(t);if(i===-1)return null;let r=-1;for(let o=i-1;o>=0;o--)if(s[o].classList.contains(_n.TAB_GUARD_TOP)){r=o;break}return r<=0?null:s[r-1]}function My(e,t){if(!t)return!1;const s=e.querySelectorAll(`.${Au}`);if(!s.length)return!1;for(let i=0;ithis.activeItem?.tabbedItem?.afterDetachedCallback?.())}setupHeader(){const{enableCloseButton:e,cssClass:t}=this.params,s=(i,r)=>{i.classList.add(`ag-tabs-${r}`),t&&i.classList.add(`${t}-${r}`)};e?(this.setupCloseButton(s),this.eTabHeader=$e({tag:"div",role:"presentation"}),s(this.eHeader,"header-wrapper"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,Ie(this.eTabHeader,"tablist"),s(this.eTabHeader,"header")}setupCloseButton(e){const t=$e({tag:"button"});e(t,"close-button");const s=this.beans.iconSvc.createIconNoSpan("close");de(t,this.params.closeButtonAriaLabel),t.appendChild(s),this.addManagedElementListeners(t,{click:()=>this.params.onCloseClicked?.()});const i=$e({tag:"div",role:"presentation"});e(i,"close-button-wrapper"),i.appendChild(t),this.eHeader.appendChild(i),this.eCloseButton=t}handleKeyDown(e){switch(e.key){case b.RIGHT:case b.LEFT:{if(!this.eTabHeader.contains(ie(this.beans)))return;const t=e.key===b.RIGHT,s=this.gos.get("enableRtl"),i=this.items.indexOf(this.activeItem),r=t!==s?Math.min(i+1,this.items.length-1):Math.max(i-1,0);if(i===r)return;e.preventDefault();const o=this.items[r];this.showItemWrapper(o),o.eHeaderButton.focus();break}case b.UP:case b.DOWN:e.stopPropagation();break}}onTabKeyDown(e){if(e.defaultPrevented)return;const{beans:t,eHeader:s,eBody:i,activeItem:r,params:o}=this,{suppressTrapFocus:n,enableCloseButton:a}=o,l=ie(t),c=e.target,d=e.shiftKey;if(s.contains(l)){e.preventDefault(),a&&d&&!this.eCloseButton?.contains(l)?this.eCloseButton?.focus():n&&d?gp(me(t).body,c)?.focus():this.focusBody(e.shiftKey);return}let u=null;if(My(i,c)&&(d&&(u=gp(i,c)),!u&&!n&&(u=r.eHeaderButton)),!u&&i.contains(l)&&(u=Qe(t,i,!1,d),!u)){n&&!d?this.forceFocusOutOfContainer(d):a&&!d?(e.preventDefault(),this.eCloseButton?.focus()):(e.preventDefault(),this.focusHeader());return}u&&(e.preventDefault(),u.focus())}focusInnerElement(e){return e?this.focusBody(!0):(this.focusHeader(),!0)}focusHeader(e){this.activeItem.eHeaderButton.focus({preventScroll:e})}focusBody(e){return Ge(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const t=$e({tag:"span",cls:"ag-tab",role:"tab",attrs:{tabindex:"-1"}});t.appendChild(e.title),this.eTabHeader.appendChild(t),de(t,e.titleLabel);const s={tabbedItem:e,eHeaderButton:t};this.items.push(s),t.addEventListener("click",this.showItemWrapper.bind(this,s))}showItem(e){const t=this.items.find(s=>s.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){const{tabbedItem:t,eHeaderButton:s}=e;if(this.params.onItemClicked?.({item:t}),this.activeItem===e){this.params.onActiveItemClicked?.();return}this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),ee(this.eBody),t.bodyPromise.then(i=>{this.eBody.appendChild(i);const r=!Dn();if(this.params.suppressFocusBodyOnOpen||Ge(this.eBody,!1,r),t.afterAttachedCallback&&t.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const o=t.getScrollableContainer?.()||i;[this.lastScrollListener]=this.addManagedElementListeners(o,{scroll:()=>{this.tabbedItemScrollMap.set(t.name,o.scrollTop)}});const n=this.tabbedItemScrollMap.get(t.name);n!==void 0&&setTimeout(()=>{o.scrollTop=n},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),this.activeItem.tabbedItem.afterDetachedCallback?.()),s.classList.add("ag-tab-selected"),this.activeItem=e}},g7=".ag-group{position:relative;width:100%}.ag-group-title-bar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-title{display:inline;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-group-title-bar) .ag-group-title{cursor:default}.ag-group-toolbar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-container{display:flex}.ag-disabled .ag-group-container{pointer-events:none}.ag-disabled-group-container,.ag-disabled-group-title-bar{opacity:.5}.ag-group-container-horizontal{flex-flow:row wrap}.ag-group-container-vertical{flex-direction:column}.ag-group-title-bar-icon{cursor:pointer;flex:none}:where(.ag-ltr) .ag-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-group-title-bar-icon{margin-left:var(--ag-spacing)}:where(.ag-group-item-alignment-stretch) .ag-group-item{align-items:stretch}:where(.ag-group-item-alignment-start) .ag-group-item{align-items:flex-start}:where(.ag-group-item-alignment-end) .ag-group-item{align-items:flex-end}";function p7(e){const t=e.cssIdentifier||"default",s=e.direction||"vertical";return{tag:"div",cls:`ag-group ag-${t}-group`,role:"presentation",children:[{tag:"div",ref:"eToolbar",cls:`ag-group-toolbar ag-${t}-group-toolbar`,children:[{tag:"ag-checkbox",ref:"cbGroupEnabled"}]},{tag:"div",ref:"eContainer",cls:`ag-group-container ag-group-container-${s} ag-${t}-group-container`}]}}var qs=class extends Pt{constructor(e={}){super(p7(e),[ds]),this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=x,this.cbGroupEnabled=x,this.eContainer=x,this.registerCSS(g7);const{enabled:t,items:s,suppressEnabledCheckbox:i,expanded:r,suppressToggleExpandOnEnableChange:o,useToggle:n}=e;this.cssIdentifier=e.cssIdentifier||"default",this.enabled=t??!0,this.items=s||[],this.useToggle=n??!1,this.alignItems=e.alignItems||"center",this.expanded=r??!0,i!=null&&(this.suppressEnabledCheckbox=i),o!=null&&(this.suppressToggleExpandOnEnableChange=o)}postConstruct(){if(this.setupTitleBar(),this.items.length){const r=this.items;this.items=[],this.addItems(r)}const e=this.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.enabled&&this.setEnabled(this.enabled,void 0,!0),this.setAlignItems(this.alignItems);const{onEnableChange:t,onExpandedChange:s,suppressOpenCloseIcons:i}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(i??!1),this.refreshChildDisplay(),V(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(r=>{this.setEnabled(r,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(r)}),t!=null&&this.onEnableChange(t),s!=null&&this.onExpandedChange(s)}refreshChildDisplay(){V(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),this.eTitleBar?.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCss(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const t=`ag-group-item-alignment-${this.alignItems}`;return this.addCss(t),this}toggleGroupExpand(e,t){if(this.eTitleBar?.isSuppressCollapse()&&!this.useToggle)e=!0,t=!0;else if(e=e??!this.expanded,this.expanded===e)return this;return this.expanded=e,this.refreshChildDisplay(),V(this.eContainer,e),t||this.dispatchLocalEvent({type:e?"expanded":"collapsed"}),this}addItems(e){for(const t of e)this.addItem(t)}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}updateItems(e){const t=this.items;let s=0;for(let i=0;ie(t.enabled)}),this}onExpandedChange(e){return this.addManagedListeners(this,{expanded:()=>e(!0),collapsed:()=>e(!1)}),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){return this.eTitleBar?.hideOpenCloseIcons(e),this}refreshDisabledStyles(){const e=!this.enabled;this.eContainer.classList.toggle("ag-disabled",e),this.eTitleBar?.refreshDisabledStyles(this.suppressEnabledCheckbox&&e),this.eContainer.classList.toggle("ag-disabled-group-container",e)}setupTitleBar(){const e=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",e.getGui())}createDefaultTitleBar(){const e=this.createManagedBean(new m7(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListeners(e,{expandedChanged:t=>this.toggleGroupExpand(t.expanded)}),e}createToggleTitleBar(){const e=this.createManagedBean(new Vr({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:t=>{this.setEnabled(t,!0),this.dispatchEnableChangeEvent(t)}}));return e.addCss("ag-group-title-bar"),e.addCss(`ag-${this.params.cssIdentifier??"default"}-group-title-bar ag-unselectable`),this.eToggle=e,this.toggleGroupExpand(this.enabled),e}},fp="ag-disabled-group-title-bar";function f7(e){const t=e.cssIdentifier??"default";return{tag:"div",cls:`ag-group-title-bar ag-${t}-group-title-bar ag-unselectable`,role:e.suppressKeyboardNavigation?"presentation":"group",children:[{tag:"span",ref:"eGroupOpenedIcon",cls:`ag-group-title-bar-icon ag-${t}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eGroupClosedIcon",cls:`ag-group-title-bar-icon ag-${t}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eTitle",cls:`ag-group-title ag-${t}-group-title`}]}}var m7=class extends Pt{constructor(e={}){super(f7(e)),this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=x,this.eGroupClosedIcon=x,this.eTitle=x;const{title:t,suppressOpenCloseIcons:s,suppressKeyboardNavigation:i}=e;t&&t.length>0&&(this.title=t),s!=null&&(this.suppressOpenCloseIcons=s),this.suppressKeyboardNavigation=i??!1}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){const e=this.beans.iconSvc;this.eGroupClosedIcon.appendChild(e.createIconNoSpan("accordionClosed")),this.eGroupOpenedIcon.appendChild(e.createIconNoSpan("accordionOpen")),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:t=>{switch(t.key){case b.ENTER:case b.SPACE:t.preventDefault(),this.dispatchExpandChanged();break;case b.RIGHT:case b.LEFT:t.preventDefault(),this.dispatchExpandChanged(t.key===b.RIGHT);break}}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||ot(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;V(this.eGroupOpenedIcon,t&&e),V(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(e){const t={type:"expandedChanged",expanded:e};this.dispatchLocalEvent(t)}setTitle(e){const t=this.getGui(),s=!!e&&e.length>0;e=s?e:void 0,this.eTitle.textContent=e??"",V(t,s),e!==this.title&&(this.title=e);const i=t.classList.contains(fp);return this.refreshDisabledStyles(i),this}addWidget(e){return this.getGui().appendChild(e),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.dispatchExpandChanged(!0),this}refreshDisabledStyles(e){const t=this.getGui();e?(t.classList.add(fp),t.removeAttribute("tabindex"),Ie(t,"presentation")):(t.classList.remove(fp),typeof this.title=="string"&&!this.suppressKeyboardNavigation?(this.activateTabIndex([t]),Ie(t,"group")):(t.removeAttribute("tabindex"),Ie(t,"presentation")))}},Se={selector:"AG-GROUP-COMPONENT",component:qs},Y="35.2.1",le={moduleName:"EnterpriseCore",version:Y,beans:[ep],icons:{accordionOpen:"tree-open",accordionClosed:"tree-closed",accordionIndeterminate:"tree-indeterminate",close:"cross",cancel:"cancel",maximize:"maximize",minimize:"minimize",columnDrag:"grip"},dependsOn:[],setLicenseKey:ep.setLicenseKey},C7='.ag-advanced-filter-header{align-items:center;background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);display:flex;position:relative}.ag-advanced-filter{align-items:center;display:flex;width:100%}.ag-advanced-filter-buttons{display:contents}.ag-advanced-filter-header-cell{height:100%;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding)}.ag-advanced-filter-apply-button,.ag-advanced-filter-builder-button{align-items:center;background-color:unset;border:0;display:flex;font-size:var(--ag-font-size);font-weight:600;line-height:normal;padding:var(--ag-spacing);white-space:nowrap;&:where(.ag-standard-button):where(:not(:disabled)){cursor:pointer;&:where(.ag-standard-button):hover{background-color:var(--ag-row-hover-color)}}}:where(.ag-ltr) .ag-advanced-filter-apply-button,:where(.ag-ltr) .ag-advanced-filter-builder-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-advanced-filter-apply-button,:where(.ag-rtl) .ag-advanced-filter-builder-button{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-advanced-filter-builder-button-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-advanced-filter-builder-button-label{margin-right:var(--ag-spacing)}.ag-advanced-filter-builder{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-advanced-filter-builder-list{flex:1;overflow:auto}.ag-advanced-filter-builder-button-panel{border-top:var(--ag-advanced-filter-builder-button-bar-border);display:flex;justify-content:flex-end;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-advanced-filter-builder-apply-button,:where(.ag-ltr) .ag-advanced-filter-builder-cancel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-advanced-filter-builder-apply-button,:where(.ag-rtl) .ag-advanced-filter-builder-cancel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-advanced-filter-builder-item-wrapper{align-items:center;display:flex;flex:1 1 auto;justify-content:space-between;overflow:hidden}:where(.ag-ltr) .ag-advanced-filter-builder-item-wrapper{padding-left:calc(var(--ag-icon-size)/2);padding-right:var(--ag-icon-size)}:where(.ag-rtl) .ag-advanced-filter-builder-item-wrapper{padding-left:var(--ag-icon-size);padding-right:calc(var(--ag-icon-size)/2)}:where(.ag-virtual-list-viewport) .ag-advanced-filter-builder-item-wrapper .ag-tab-guard{position:absolute}.ag-advanced-filter-builder-item-tree-line{width:var(--ag-advanced-filter-builder-indent-size)}.ag-advanced-filter-builder-item-tree-line-root{width:var(--ag-icon-size)}.ag-advanced-filter-builder-item-tree-line-root:before{height:50%;top:50%}.ag-advanced-filter-builder-item-tree-line-horizontal,.ag-advanced-filter-builder-item-tree-line-vertical,.ag-advanced-filter-builder-item-tree-line-vertical-bottom,.ag-advanced-filter-builder-item-tree-line-vertical-top{align-items:center;display:flex;height:100%;position:relative}.ag-advanced-filter-builder-item-tree-line-horizontal:after,.ag-advanced-filter-builder-item-tree-line-horizontal:before,.ag-advanced-filter-builder-item-tree-line-vertical-bottom:after,.ag-advanced-filter-builder-item-tree-line-vertical-bottom:before,.ag-advanced-filter-builder-item-tree-line-vertical-top:after,.ag-advanced-filter-builder-item-tree-line-vertical-top:before,.ag-advanced-filter-builder-item-tree-line-vertical:after,.ag-advanced-filter-builder-item-tree-line-vertical:before{content:"";height:100%;position:absolute}.ag-advanced-filter-builder-item-tree-line-horizontal:after{border-bottom:var(--ag-border-width) solid var(--ag-border-color);height:50%;top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size))}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-horizontal:after{left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-horizontal:after{right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical:before{top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical-top:before{height:50%;top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical-top:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical-top:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{height:calc(50% - var(--ag-icon-size)*1.5/2);top:calc(50% + var(--ag-icon-size)*1.5/2);width:calc(var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-condition{padding-bottom:var(--ag-spacing);padding-top:var(--ag-spacing)}.ag-advanced-filter-builder-item,.ag-advanced-filter-builder-item-buttons,.ag-advanced-filter-builder-item-condition,.ag-advanced-filter-builder-item-tree-lines,.ag-advanced-filter-builder-pill,.ag-advanced-filter-builder-pill-wrapper{align-items:center;display:flex;height:100%}.ag-advanced-filter-builder-pill-wrapper{margin:0 var(--ag-spacing)}.ag-advanced-filter-builder-pill{border-radius:var(--ag-border-radius);min-height:calc(100% - var(--ag-spacing)*3);min-width:calc(var(--ag-spacing)*2);padding:var(--ag-spacing) calc(var(--ag-spacing)*2);position:relative}:where(.ag-advanced-filter-builder-pill){.ag-advanced-filter-builder-value-number{font-family:monospace;font-weight:700}.ag-advanced-filter-builder-value-empty{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-advanced-filter-builder-pill){.ag-picker-field-display{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-advanced-filter-builder-pill){.ag-picker-field-display{margin-left:var(--ag-spacing)}}.ag-advanced-filter-builder-pill-display{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-advanced-filter-builder-join-pill{background-color:var(--ag-advanced-filter-builder-join-pill-color);cursor:pointer}.ag-advanced-filter-builder-column-pill{background-color:var(--ag-advanced-filter-builder-column-pill-color);cursor:pointer}.ag-advanced-filter-builder-option-pill{background-color:var(--ag-advanced-filter-builder-option-pill-color);cursor:pointer}.ag-advanced-filter-builder-value-pill{background-color:var(--ag-advanced-filter-builder-value-pill-color);cursor:text;max-width:140px;:where(.ag-advanced-filter-builder-pill-display){display:block}}.ag-advanced-filter-builder-item-buttons{display:flex;gap:var(--ag-spacing);padding:0 calc(var(--ag-spacing)*.5)}.ag-advanced-filter-builder-item-button{color:var(--ag-subtle-text-color);cursor:pointer;position:relative}.ag-advanced-filter-builder-item-button,.ag-advanced-filter-builder-pill{&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-advanced-filter-builder-item-button-disabled{cursor:default;opacity:.5}.ag-advanced-filter-builder-virtual-list-container{top:var(--ag-spacing)}.ag-advanced-filter-builder-virtual-list-item{cursor:default;display:flex;height:var(--ag-list-item-height)}.ag-advanced-filter-builder-virtual-list-item:hover{background-color:var(--ag-row-hover-color);:where(.ag-advanced-filter-builder-item-button){opacity:1}}.ag-advanced-filter-builder-invalid{color:var(--ag-subtle-text-color);cursor:default;margin:0 var(--ag-spacing)}:where(.ag-advanced-filter-builder-validation) .ag-advanced-filter-builder-invalid{color:var(--ag-invalid-color)}:where(.ag-advanced-filter-builder-virtual-list-item-highlight) .ag-advanced-filter-builder-item-button:focus-visible{opacity:1}';function v7(e){return e.filterManager?.getAdvFilterModel()??null}function w7(e,t){e.filterManager?.setAdvFilterModel(t)}function b7(e){e.filterManager?.toggleAdvFilterBuilder(!0,"api")}function S7(e){e.filterManager?.toggleAdvFilterBuilder(!1,"api")}var y7={ariaAdvancedFilterBuilderItem:e=>`${e[0]}. Level ${e[1]}. Press ENTER to edit`,ariaAdvancedFilterBuilderItemValidation:e=>`${e[0]}. Level ${e[1]}. ${e[2]} Press ENTER to edit`,ariaAdvancedFilterBuilderList:"Advanced Filter Builder List",ariaAdvancedFilterBuilderFilterItem:"Filter Condition",ariaAdvancedFilterBuilderGroupItem:"Filter Group",ariaAdvancedFilterBuilderColumn:"Column",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValue:"Value",ariaAdvancedFilterBuilderJoinOperator:"Join Operator",ariaAdvancedFilterInput:"Advanced Filter Input",ariaLabelAdvancedFilterAutocomplete:"Advanced Filter Autocomplete",advancedFilterContains:"contains",advancedFilterNotContains:"does not contain",advancedFilterTextEquals:"equals",advancedFilterTextNotEqual:"does not equal",advancedFilterStartsWith:"begins with",advancedFilterEndsWith:"ends with",advancedFilterBlank:"is blank",advancedFilterNotBlank:"is not blank",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"is true",advancedFilterFalse:"is false",advancedFilterAnd:"AND",advancedFilterOr:"OR",advancedFilterApply:"Apply",advancedFilterReset:"Reset",advancedFilterCancel:"Cancel",advancedFilterClear:"Clear",advancedFilterBuilder:"Builder",advancedFilterValidationMissingColumn:"Column is missing",advancedFilterValidationMissingOption:"Option is missing",advancedFilterValidationMissingValue:"Value is missing",advancedFilterValidationInvalidColumn:"Column not found",advancedFilterValidationInvalidOption:"Option not found",advancedFilterValidationMissingQuote:"Value is missing an end quote",advancedFilterValidationNotANumber:"Value is not a number",advancedFilterValidationNotABigInt:"Value is not a big integer",advancedFilterValidationInvalidDate:"Value is not a valid date",advancedFilterValidationMissingCondition:"Condition is missing",advancedFilterValidationJoinOperatorMismatch:"Join operators within a condition must be the same",advancedFilterValidationInvalidJoinOperator:"Join operator not found",advancedFilterValidationMissingEndBracket:"Missing end bracket",advancedFilterValidationExtraEndBracket:"Too many end brackets",advancedFilterValidationMessage:e=>`Expression has an error. ${e[0]} - ${e[1]}.`,advancedFilterValidationMessageAtEnd:e=>`Expression has an error. ${e[0]} at end of expression.`,advancedFilterBuilderTitle:"Advanced Filter",advancedFilterBuilderApply:"Apply",advancedFilterBuilderCancel:"Cancel",advancedFilterBuilderClear:"Clear",advancedFilterBuilderReset:"Reset",advancedFilterBuilderAddButtonTooltip:"Add Filter or Group",advancedFilterBuilderRemoveButtonTooltip:"Remove",advancedFilterBuilderMoveUpButtonTooltip:"Move Up",advancedFilterBuilderMoveDownButtonTooltip:"Move Down",advancedFilterBuilderAddJoin:"Add Group",advancedFilterBuilderAddCondition:"Add Filter",advancedFilterBuilderSelectColumn:"Select a column",advancedFilterBuilderSelectOption:"Select an option",advancedFilterBuilderEnterValue:"Enter a value...",advancedFilterBuilderValidationAlreadyApplied:"Current filter already applied.",advancedFilterBuilderValidationIncomplete:"Not all conditions are complete.",advancedFilterBuilderValidationSelectColumn:"Must select a column.",advancedFilterBuilderValidationSelectOption:"Must select an option.",advancedFilterBuilderValidationEnterValue:"Must enter a value."};function mp(e,t,s){if(!e)return"";const i=s-t;return i?e.slice(0,e.length-i):e}function Xi(e,t,s,i,r,o,n){const a=s+(!e.length||n?0:1);let l=0;return r&&(e[a]===" "?l=1:(i+=" ",o&&(i+='"'))),{updatedValue:e.slice(0,t)+i+e.slice(a),updatedPosition:t+i.length+l}}function x7(e,t,s){let i=t;for(;i{(this.quotes||isNaN(this.modelValue))&&(this.valid=!1,this.validationMessage=this.params.advFilterExpSvc.translate("advancedFilterValidationNotANumber"))},bigint:()=>{(this.quotes||et(this.modelValue)===null)&&(this.valid=!1,this.validationMessage=this.params.advFilterExpSvc.translate("advancedFilterValidationNotABigInt"))},date:r=>{r==null&&(this.valid=!1,this.validationMessage=this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidDate"))},dateString:(...r)=>this.filterValidationSetters.date(...r),dateTime:(...r)=>this.filterValidationSetters.date(...r),dateTimeString:(...r)=>this.filterValidationSetters.date(...r),boolean(){},object(){},text(){}}}parse(e,t){if(e===" ")if(this.quotes)this.operand+=e;else return this.parseOperand(!1,t),!0;else if(e===")"){if(this.baseCellDataType==="number"||!this.quotes)return this.parseOperand(!1,t-1),!0;this.operand+=e}else if(!this.operand&&!this.quotes&&(e==="'"||e==='"'))this.quotes=e;else{if(this.quotes&&e===this.quotes)return this.parseOperand(!1,t),!1;this.operand+=e}}complete(e){this.parseOperand(!0,e)}getValidationError(){return this.validationMessage?{message:this.validationMessage,startPosition:this.startPosition,endPosition:this.endPosition??this.params.expression.length-1}:null}getRawValue(){return this.operand}getModelValue(){return this.modelValue}parseOperand(e,t){const{advFilterExpSvc:s}=this.params;if(this.endPosition=t,this.modelValue=this.operand,e&&this.quotes)this.valid=!1,this.validationMessage=s.translate("advancedFilterValidationMissingQuote");else if(this.modelValue==="")this.valid=!1,this.validationMessage=s.translate("advancedFilterValidationMissingValue");else{const i=s.getOperandModelValue(this.operand,this.baseCellDataType,this.column);i!=null&&(this.modelValue=i),this.filterValidationSetters[this.baseCellDataType](i)}}},wp="[",bp="]",P7=class{constructor(e,t){this.params=e,this.startPosition=t,this.isAwaiting=!0,this.operandValueGetters={number:Number,bigint:s=>et(s),date:s=>this.params.valueSvc.parseValue(this.columnParser.column,null,s,void 0),dateString:s=>this.operandValueGetters.date(s),dateTime:s=>this.operandValueGetters.date(s),dateTimeString:s=>this.operandValueGetters.date(s),boolean:s=>s,object:s=>s,text:s=>s}}parseExpression(){let e=this.startPosition;const{expression:t}=this.params;for(;e(o,n,a)=>a.operators[s].evaluator(o.getValue(i,n),n,a.evaluatorParams[r],t==null?void 0:a.operands[t]))}getAutocompleteListParams(e){if(this.isColumnPosition(e))return this.getColumnAutocompleteListParams(e);if(this.isOperatorPosition(e))return this.getOperatorAutocompleteListParams(e);if(!this.isBeyondEndPosition(e))return{enabled:!1}}updateExpression(e,t,s){const{expression:i}=this.params;if(this.isColumnPosition(e))return Xi(this.params.expression,this.startPosition,this.columnParser?.getColId()?this.columnParser.endPosition:Cp(i,e).endPosition,this.params.advFilterExpSvc.getColumnValue(t),!0);if(this.isOperatorPosition(e)){const r=this.getBaseCellDataTypeFromOperatorAutocompleteType(s),o=this.hasOperand(r,t.key),n=o&&this.doesOperandNeedQuotes(r);let a;if(this.operatorParser?.startPosition!=null&&ethis.endPosition+1&&this.endPosition+10,r=this.columnParser?.hasEndChar&&s.length===t.length+2;return i?s.slice(1,r?-1:void 0):s}getOperatorAutocompleteListParams(e){const t=this.columnParser?.column;if(!t)return{enabled:!1};const s=this.columnParser.baseCellDataType,i=this.operatorParser?.startPosition!=null&&e0}doesOperandNeedQuotes(e){return e!=="number"&&e!=="bigint"}addToListAndGetIndex(e,t){const s=e.length;return e.push(t),s}};function Yc(e,t,s){let i=!1;const r=e.toLocaleLowerCase(),o=r+" ",n=Object.keys(t).find(a=>{const l=t[a],c=s(l).toLocaleLowerCase();return c.startsWith(o)&&(i=!0),c===r});return n||(i?null:void 0)}function Sp(e,t){return(t??Object.keys(e)).map(i=>({key:i,displayValue:e[i].displayValue}))}var Ty=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return Sp(this.operators,e)}findOperator(e){return Yc(e,this.operators,({displayValue:t})=>t)}initOperators(){const{translate:e}=this.params;this.operators={contains:{displayValue:e("advancedFilterContains"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!1,(o,n)=>o.includes(n)),numOperands:1},notContains:{displayValue:e("advancedFilterNotContains"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!0,(o,n)=>!o.includes(n)),numOperands:1},equals:{displayValue:e("advancedFilterTextEquals"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!1,(o,n)=>o===n),numOperands:1},notEqual:{displayValue:e("advancedFilterTextNotEqual"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!0,(o,n)=>o!=n),numOperands:1},startsWith:{displayValue:e("advancedFilterStartsWith"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!1,(o,n)=>o.startsWith(n)),numOperands:1},endsWith:{displayValue:e("advancedFilterEndsWith"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!1,(o,n)=>o.endsWith(n)),numOperands:1},blank:{displayValue:e("advancedFilterBlank"),evaluator:t=>t==null||typeof t=="string"&&t.trim().length===0,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:t=>t!=null&&(typeof t!="string"||t.trim().length>0),numOperands:0}}}evaluateExpression(e,t,s,i,r,o){return e==null?r:s.caseSensitive?o(s.valueConverter(e,t),i):o(s.valueConverter(e,t).toLocaleLowerCase(),i.toLocaleLowerCase())}},Oo=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return Sp(this.operators,e)}findOperator(e){return Yc(e,this.operators,({displayValue:t})=>t)}initOperators(){const{translate:e,equals:t}=this.params;this.operators={equals:{displayValue:e("advancedFilterEquals"),evaluator:(s,i,r,o)=>this.evaluateSingleOperandExpression(s,i,r,o,!!r.includeBlanksInEquals,t),numOperands:1},notEqual:{displayValue:e("advancedFilterNotEqual"),evaluator:(s,i,r,o)=>this.evaluateSingleOperandExpression(s,i,r,o,!!r.includeBlanksInEquals,(n,a)=>!t(n,a)),numOperands:1},greaterThan:{displayValue:e("advancedFilterGreaterThan"),evaluator:(s,i,r,o)=>this.evaluateSingleOperandExpression(s,i,r,o,!!r.includeBlanksInGreaterThan,(n,a)=>n>a),numOperands:1},greaterThanOrEqual:{displayValue:e("advancedFilterGreaterThanOrEqual"),evaluator:(s,i,r,o)=>this.evaluateSingleOperandExpression(s,i,r,o,!!r.includeBlanksInGreaterThan,(n,a)=>n>=a),numOperands:1},lessThan:{displayValue:e("advancedFilterLessThan"),evaluator:(s,i,r,o)=>this.evaluateSingleOperandExpression(s,i,r,o,!!r.includeBlanksInLessThan,(n,a)=>nthis.evaluateSingleOperandExpression(s,i,r,o,!!r.includeBlanksInLessThan,(n,a)=>n<=a),numOperands:1},blank:{displayValue:e("advancedFilterBlank"),evaluator:s=>s==null,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:s=>s!=null,numOperands:0}}}evaluateSingleOperandExpression(e,t,s,i,r,o){return e==null?r:o(s.valueConverter(e,t),i)}},M7=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return Sp(this.operators,e)}findOperator(e){return Yc(e,this.operators,({displayValue:t})=>t)}initOperators(){const{translate:e}=this.params;this.operators={true:{displayValue:e("advancedFilterTrue"),evaluator:t=>!!t,numOperands:0},false:{displayValue:e("advancedFilterFalse"),evaluator:t=>t===!1,numOperands:0},blank:{displayValue:e("advancedFilterBlank"),evaluator:t=>t==null,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:t=>t!=null,numOperands:0}}}},T7=class extends E{constructor(){super(...arguments),this.beanName="advFilterExpSvc",this.filterOperandGetters={number:e=>Xe(e.filter)??"",bigint:e=>Xe(e.filter)??"",date:e=>{const t=this.colModel.getColDefCol(e.colId);return t?this.valueSvc.formatValue(t,null,_e(Xe(e.filter)??"")):null},dateTime:e=>this.filterOperandGetters.date(e),dateString:e=>{const t=this.colModel.getColDefCol(e.colId);if(!t)return null;const{filter:s}=e,r=this.dataTypeSvc?.getDateFormatterFunction(t)?.(_e(Xe(e.filter)??"")??void 0)??s;return this.valueSvc.formatValue(t,null,r)},dateTimeString:e=>this.filterOperandGetters.dateString(e),boolean:()=>null,object:()=>null,text:()=>null},this.operandModelValueGetters={number:e=>D(e)?Number(e):null,bigint:e=>e,date:(e,t,s)=>tt(this.valueSvc.parseValue(t,null,e,void 0),!!this.dataTypeSvc?.getDateIncludesTimeFlag(s)),dateTime:(...e)=>this.operandModelValueGetters.date(...e),dateString:(e,t,s)=>{const i=this.valueSvc.parseValue(t,null,e,void 0);return this.dataTypeSvc?tt(this.dataTypeSvc.getDateParserFunction(t)(i)??null,this.dataTypeSvc.getDateIncludesTimeFlag(s)):i},dateTimeString:(...e)=>this.operandModelValueGetters.dateString(...e),boolean:e=>e,object:e=>e,text:e=>e},this.columnNameToIdMap={},this.columnAutocompleteEntries=null,this.expressionEvaluatorParams={}}wireBeans(e){this.valueSvc=e.valueSvc,this.colModel=e.colModel,this.colNames=e.colNames,this.dataTypeSvc=e.dataTypeSvc}postConstruct(){this.expressionJoinOperators=this.generateExpressionJoinOperators(),this.expressionOperators=this.generateExpressionOperators()}parseJoinOperator(e){const{type:t}=e;return this.expressionJoinOperators[t]??t}getColumnDisplayValue(e){const{colId:t}=e,i=this.getColumnAutocompleteEntries().find(({key:o})=>o===t);let r;return i?(r=i.displayValue,this.columnNameToIdMap[r.toLocaleUpperCase()]={colId:t,columnName:r}):r=t,r}getOperatorDisplayValue(e){return this.getExpressionOperator(e.filterType,e.type)?.displayValue??e.type}getOperandModelValue(e,t,s){return this.operandModelValueGetters[t](e,s,t)}getOperandDisplayValue(e,t){const{filter:s,filterType:i}=e;if(s==null)return"";let r=this.filterOperandGetters[i](e);return i!=="number"&&i!=="bigint"&&(r??(r=Xe(s)??""),t||(r=`"${r}"`)),t?r:` ${r}`}parseColumnFilterModel(e){const t=this.getColumnDisplayValue(e)??"",s=this.getOperatorDisplayValue(e)??"",i=this.getOperandDisplayValue(e);return`[${t}] ${s}${i}`}updateAutocompleteCache(e,t){if(t==="column"){const{key:s,displayValue:i}=e;this.columnNameToIdMap[e.displayValue.toLocaleUpperCase()]={colId:s,columnName:i}}}translate(e,t){let s=y7[e];return typeof s=="function"&&(s=s(t)),this.getLocaleTextFunc()(e,s,t)}generateAutocompleteListParams(e,t,s){return{enabled:!0,type:t,searchString:s,entries:e}}getColumnAutocompleteEntries(){if(this.columnAutocompleteEntries)return this.columnAutocompleteEntries;const e=this.colModel.getColDefCols()??[],t=[],s=this.gos.get("includeHiddenColumnsInAdvancedFilter");for(const i of e)i.getColDef().filter&&(s||i.isVisible()||i.isRowGroupActive())&&t.push({key:i.getColId(),displayValue:this.colNames.getDisplayNameForColumn(i,"advancedFilter")});return t.sort((i,r)=>{const o=i.displayValue??"",n=r.displayValue??"";return oo?1:0}),t}getOperatorAutocompleteEntries(e,t){const s=this.getActiveOperators(e);return this.getDataTypeExpressionOperator(t).getEntries(s)}getJoinOperatorAutocompleteEntries(){return Object.entries(this.expressionJoinOperators).map(([e,t])=>({key:e,displayValue:t}))}getDefaultAutocompleteListParams(e){return this.generateAutocompleteListParams(this.getColumnAutocompleteEntries(),"column",e)}getDataTypeExpressionOperator(e){return this.expressionOperators[e]}getExpressionOperator(e,t){return this.getDataTypeExpressionOperator(e)?.operators?.[t]}getExpressionJoinOperators(){return this.expressionJoinOperators}getColId(e){const t=e.toLocaleUpperCase(),s=this.columnNameToIdMap[t];if(s)return s;const r=this.getColumnAutocompleteEntries().find(({displayValue:o})=>o.toLocaleUpperCase()===t);if(r){const{key:o,displayValue:n}=r,a={colId:o,columnName:n};return this.columnNameToIdMap[t]=a,a}return null}getExpressionEvaluatorParams(e){let t=this.expressionEvaluatorParams[e];if(t)return t;const s=this.colModel.getColDefCol(e);if(!s)return{valueConverter:o=>o};switch(this.dataTypeSvc?.getBaseDataType(s)){case"dateTimeString":case"dateString":t={valueConverter:this.dataTypeSvc?.getDateParserFunction(s)??(o=>o)};break;case"object":s.getColDef().filterValueGetter?t={valueConverter:o=>o}:t={valueConverter:(o,n)=>this.valueSvc.formatValue(s,n,o)??(typeof o.toString=="function"?o.toString():"")};break;case"text":case void 0:t={valueConverter:o=>Xe(o)};break;default:t={valueConverter:o=>o};break}const{filterParams:r}=s.getColDef();return r&&["caseSensitive","includeBlanksInEquals","includeBlanksInLessThan","includeBlanksInGreaterThan"].forEach(o=>{const n=r[o];n&&(t[o]=n)}),this.expressionEvaluatorParams[e]=t,t}getColumnDetails(e){const t=this.colModel.getColDefCol(e)??void 0,s=(t?this.dataTypeSvc?.getBaseDataType(t):void 0)??"text";return{column:t,baseCellDataType:s}}generateExpressionOperators(){const e=(s,i)=>this.translate(s,i),t={translate:e,equals:(s,i)=>s.getTime()===i.getTime()};return{text:new Ty({translate:e}),boolean:new M7({translate:e}),object:new Ty({translate:e}),number:new Oo({translate:e,equals:(s,i)=>s===i}),bigint:new Oo({translate:e,equals:(s,i)=>s===i}),date:new Oo(t),dateString:new Oo(t),dateTime:new Oo(t),dateTimeString:new Oo(t)}}getColumnValue({displayValue:e}){return`${wp}${e}${bp}`}generateExpressionJoinOperators(){return{AND:this.translate("advancedFilterAnd"),OR:this.translate("advancedFilterOr")}}getActiveOperators(e){const t=e.getColDef().filterParams?.filterOptions;return t&&t.every(i=>typeof i=="string")?t:void 0}resetColumnCaches(){this.columnAutocompleteEntries=null,this.columnNameToIdMap={},this.expressionEvaluatorParams={}}},Dy={stopPropagationCallbacks:Ai,focusNextContainer:(e,t)=>Vs(e,t),configureFocusableContainer:(e,t)=>{const s=e.ctrlsSvc.get("gridCtrl");s.addFocusableContainer(t),t.addDestroyFunc(()=>s.removeFocusableContainer(t))}},Xc=class extends up{constructor(e){super(e,Dy)}getFocusableContainerName(){return"dialog"}},Ay=".ag-autocomplete{align-items:center;display:flex;width:100%;>:where(.ag-text-field){flex:1 1 auto}}.ag-autocomplete-list-popup{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-autocomplete-list{height:calc(var(--ag-row-height)*6.5);min-width:200px;position:relative;width:100%}.ag-autocomplete-virtual-list-item{cursor:default;display:flex;height:var(--ag-list-item-height);&:focus-visible:after{content:none}}.ag-autocomplete-virtual-list-item:hover{background-color:var(--ag-row-hover-color)}.ag-autocomplete-row{align-items:center;display:flex;flex:1 1 auto;overflow:hidden}.ag-autocomplete-row-label{margin:0 var(--ag-widget-container-horizontal-padding);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-autocomplete-row-selected{background-color:var(--ag-selected-row-background-color)}",Vo=class extends Sy{constructor(e){super(Ai,e)}},D7={tag:"div",cls:"ag-autocomplete-row",role:"presentation",children:[{tag:"div",cls:"ag-autocomplete-row-label"}]},A7=class extends A{constructor(){super(D7),this.hasHighlighting=!1}setState(e,t){this.value=e,this.render(),this.updateSelected(t)}updateSelected(e){this.toggleCss("ag-autocomplete-row-selected",e)}setSearchString(e){let t=!1;const{value:s}=this;if(s&&D(e)){const i=s.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(i>=0){t=!0,this.hasHighlighting=!0;const r=i+e.length,o=this.getGui().lastElementChild;ee(o),o.append(s.slice(0,i),re({tag:"b",children:s.slice(i,r)}),s.slice(r))}}!t&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){this.getGui().lastElementChild.textContent=this.value??"\xA0"}},I7={tag:"div",cls:"ag-autocomplete-list-popup",children:[{tag:"div",ref:"eList",cls:"ag-autocomplete-list"}]},Iy=class extends In{constructor(e){super(I7),this.params=e,this.eList=x,this.searchString="",this.lastAutoListHeight=null}postConstruct(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new Vo({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:t=>this.autocompleteEntries[t]});const e=this.virtualList.getGui();this.addManagedListeners(e,{click:()=>this.params.onConfirmed(),mousemove:this.onMouseMove.bind(this),mousedown:t=>t.preventDefault()}),this.setSelectedValue(0),this.updateListHeight()}onNavigationKeyDown(e,t){e.preventDefault();const s=this.autocompleteEntries.indexOf(this.selectedValue),i=t===b.UP?s-1:s+1;this.checkSetSelectedValue(i)}setSearch(e){this.searchString=e,D(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0),this.updateListHeight()),this.updateSearchInList()}runContainsSearch(e,t){let s,i=!1;const r=e.toLocaleLowerCase(),o=t.filter(n=>{const l=n.toLocaleLowerCase().indexOf(r),c=l===0,d=l>=0;return d&&(!s||!i&&c||i===c&&n.lengtho.toLocaleLowerCase().startsWith(s));return{topMatch:i[0],allMatches:i}}runSearch(){const{autocompleteEntries:e,useFuzzySearch:t,useStartsWithSearch:s,forceLastSelection:i}=this.params,r=e.map(c=>c.displayValue??c.key);let o,n;if(t)o=Ro({inputValue:this.searchString,allSuggestions:r,hideIrrelevant:!0}).values,n=o.length?o[0]:void 0;else{const c=s?this.runStartsWithSearch(this.searchString,r):this.runContainsSearch(this.searchString,r);o=c.allMatches,n=c.topMatch}let a=e.filter(({key:c,displayValue:d})=>o.includes(d??c));if(!a.length&&this.selectedValue&&i?.(this.selectedValue,this.searchString)&&(a=[this.selectedValue]),this.autocompleteEntries=a,this.virtualList.refresh(),this.updateListHeight(),!n)return;const l=o.indexOf(n);this.checkSetSelectedValue(l)}updateSearchInList(){this.virtualList.forEachRenderedRow(e=>e.setSearchString(this.searchString))}updateListHeight(){if(!this.params.autoSizeList)return;const e=this.autocompleteEntries.length,t=this.virtualList.getRowHeight(),s=this.params.maxVisibleItems??e;let r=Math.min(e,s)*t;e===0&&(r=t),this.lastAutoListHeight!==r&&(this.lastAutoListHeight=r,this.eList.style.height=`${r}px`,Ne(this.eList)&&this.params.onListHeightChanged?.())}checkSetSelectedValue(e){e>=0&&e{s.updateSelected(e===i)}))}createRowComponent(e){const t=new A7;return this.createBean(t),t.setState(e.displayValue??e.key,e===this.selectedValue),t}onMouseMove(e){const t=this.virtualList,s=t.getGui().getBoundingClientRect(),i=t.getScrollTop(),r=e.clientY-s.top+i,o=Math.floor(r/t.getRowHeight());this.checkSetSelectedValue(o)}afterGuiAttached(){this.virtualList.refresh(),this.updateListHeight()}getSelectedValue(){return this.autocompleteEntries.length?this.selectedValue??null:null}},k7={tag:"div",cls:"ag-autocomplete",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eAutocompleteInput"}]},L7=class extends A{constructor(){super(k7,[Vt]),this.eAutocompleteInput=x,this.isListOpen=!1,this.lastPosition=0,this.valid=!0,this.registerCSS(Ay)}wireBeans(e){this.popupSvc=e.popupSvc}postConstruct(){this.eAutocompleteInput.onValueChange(e=>this.onValueChanged(e)),this.eAutocompleteInput.getInputElement().setAttribute("autocomplete","off"),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.addGuiEventListener("click",this.updatePositionAndList.bind(this)),this.addDestroyFunc(()=>{this.destroyBean(this.autocompleteList)}),this.addGuiEventListener("focusout",()=>this.onFocusOut())}onValueChanged(e){const t=Ae(e);this.updateValue(t),this.updateAutocompleteList(t)}updateValue(e){this.updateLastPosition(),this.dispatchLocalEvent({type:"eventValueChanged",value:e}),this.validate(e)}updateAutocompleteList(e){const t=this.listGenerator?.(e,this.lastPosition)??{enabled:!1};(!t.type||t.type!==this.autocompleteListParams?.type)&&this.isListOpen&&this.closeList();const s=this.isListOpen;if(this.autocompleteListParams=t,t?.enabled){s||this.openList();const{searchString:i}=t;this.autocompleteList.setSearch(i??"")}else s&&this.closeList()}onKeyDown(e){const t=e.key;switch(this.updateLastPosition(),t){case b.ENTER:this.onEnterKeyDown(e);break;case b.TAB:this.onTabKeyDown(e);break;case b.DOWN:case b.UP:this.onUpDownKeyDown(e,t);break;case b.LEFT:case b.RIGHT:case b.PAGE_HOME:case b.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case b.ESCAPE:this.onEscapeKeyDown(e);break;case b.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList());break}}confirmSelection(){const e=this.autocompleteList?.getSelectedValue();e&&(this.closeList(),this.dispatchLocalEvent({type:"eventOptionSelected",value:this.getValue(),position:this.lastPosition,updateEntry:e,autocompleteType:this.autocompleteListParams.type}))}onTabKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.confirmSelection())}onEnterKeyDown(e){e.preventDefault(),this.isListOpen?this.confirmSelection():this.onCompleted()}onUpDownKeyDown(e,t){e.preventDefault(),this.isListOpen?this.autocompleteList?.onNavigationKeyDown(e,t):this.forceOpenList()}onEscapeKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.closeList(),this.setCaret(this.lastPosition,!0))}onFocusOut(){this.isListOpen&&this.closeList()}updatePositionAndList(){this.updateLastPosition(),this.updateAutocompleteList(this.eAutocompleteInput.getValue()??null)}setCaret(e,t){(t||ms(this.beans))&&this.eAutocompleteInput.getFocusableElement().focus();const s=this.eAutocompleteInput.getInputElement();s.setSelectionRange(e,e),e===s.value.length&&(s.scrollLeft=s.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){this.lastPosition=this.eAutocompleteInput.getInputElement().selectionStart??0}validate(e){if(!this.validator)return;const t=this.validationMessage=this.validator(e);this.eAutocompleteInput.getInputElement().setCustomValidity(t??""),this.valid=!t,this.dispatchLocalEvent({type:"eventValidChanged",isValid:this.valid,validationMessage:t})}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new Iy({autocompleteEntries:this.autocompleteListParams.entries,onConfirmed:()=>this.confirmSelection(),forceLastSelection:this.forceLastSelection}));const e=this.autocompleteList.getGui(),t={ePopup:e,type:"autocomplete",eventSource:this.getGui(),position:"under",alignSide:this.gos.get("enableRtl")?"right":"left",keepWithinBounds:!0},s=this.popupSvc.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupSvc.positionPopupByComponent(t),ariaLabel:this.listAriaLabel});this.hidePopup=s.hideFunc,this.autocompleteList.afterGuiAttached()}closeList(){this.isListOpen=!1,this.hidePopup(),this.destroyBean(this.autocompleteList),this.autocompleteList=null}onCompleted(){this.isListOpen&&this.closeList(),this.dispatchLocalEvent({type:"eventValueConfirmed",value:this.getValue(),isValid:this.isValid()})}getValue(){return Ae(this.eAutocompleteInput.getValue())}setInputPlaceholder(e){return this.eAutocompleteInput.setInputPlaceholder(e),this}setInputAriaLabel(e){return this.eAutocompleteInput.setInputAriaLabel(e),this}setListAriaLabel(e){return this.listAriaLabel=e,this}setListGenerator(e){return this.listGenerator=e,this}setValidator(e){return this.validator=e,this}isValid(){return this.valid}setValue(e){const{value:t,position:s,silent:i,updateListOnlyIfOpen:r,restoreFocus:o}=e;this.eAutocompleteInput.setValue(t,!0),this.setCaret(s??this.lastPosition,o),i||this.updateValue(t),(!r||this.isListOpen)&&this.updateAutocompleteList(t)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}},G7={selector:"AG-AUTOCOMPLETE",component:L7},yp={buttons:["apply"],suppressBuilderButton:!1},ky={apply:"advancedFilterApply",clear:"advancedFilterClear",cancel:"advancedFilterCancel",reset:"advancedFilterReset"},O7={tag:"div",cls:"ag-advanced-filter",role:"presentation",attrs:{tabindex:"-1"},children:[{tag:"ag-autocomplete",ref:"eAutocomplete"},{tag:"ag-filter-button",ref:"eButtons",cls:"ag-advanced-filter-buttons"},{tag:"button",ref:"eBuilderFilterButton",cls:"ag-button ag-advanced-filter-builder-button",children:[{tag:"span",ref:"eBuilderFilterButtonIcon",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eBuilderFilterButtonLabel",cls:"ag-advanced-filter-builder-button-label"}]}]},Ly=class extends A{constructor(){super(O7,[G7,oS]),this.eAutocomplete=x,this.eButtons=x,this.eBuilderFilterButton=x,this.eBuilderFilterButtonIcon=x,this.eBuilderFilterButtonLabel=x,this.expressionParser=null,this.isApplyDisabled=!0,this.builderOpen=!1}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc,this.advancedFilter=e.advancedFilter,this.filterManager=e.filterManager,this.registry=e.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipShowDelayOverride:()=>1e3,getLocation:()=>"advancedFilter"})),this.eAutocomplete.setListGenerator((s,i)=>this.generateAutocompleteListParams(i)).setValidator(()=>this.validateValue()).setForceLastSelection((s,i)=>this.forceLastSelection(s,i)).setInputAriaLabel(this.advFilterExpSvc.translate("ariaAdvancedFilterInput")).setListAriaLabel(this.advFilterExpSvc.translate("ariaLabelAdvancedFilterAutocomplete")),this.refresh(),this.addManagedListeners(this.eAutocomplete,{eventValueChanged:({value:s})=>this.onValueChanged(s),eventValueConfirmed:({isValid:s})=>this.onValueConfirmed(s),eventOptionSelected:({position:s,updateEntry:i,autocompleteType:r})=>this.onOptionSelected(s,i,r),eventValidChanged:({isValid:s,validationMessage:i})=>this.onValidChanged(s,i)});const{buttons:e,suppressBuilderButton:t}={...yp,...this.gos.get("advancedFilterParams")};this.setupButtons(e),this.setupBuilderButton(t),this.beans.gos.addManagedPropertyListener("advancedFilterParams",s=>{const i={...yp,...s.currentValue},r={...yp,...s.previousValue};if(i.buttons!==r.buttons){const o=i.buttons.map(n=>({type:n,label:this.advFilterExpSvc.translate(ky[n])}));this.eButtons.updateButtons(o)}i.suppressBuilderButton!==r.suppressBuilderButton&&V(this.eBuilderFilterButton,!i.suppressBuilderButton)})}refresh(){const e=this.advancedFilter.getExpressionDisplayValue();this.eAutocomplete.setValue({value:e??"",position:e?.length,updateListOnlyIfOpen:!0})}setInputDisabled(e){this.eAutocomplete.setInputDisabled(e),this.eButtons.updateValidity(!e&&!this.isApplyDisabled&&!this.advancedFilter.isCurrentExpressionApplied())}setupButtons(e){const t=e.map(i=>({type:i,label:this.advFilterExpSvc.translate(ky[i])})),s=i=>()=>{this.updateModel(i)};this.eButtons.addManagedListeners(this.eButtons,{apply:s("apply"),clear:s("clear"),reset:s("reset"),cancel:s("cancel")}),this.eButtons.updateButtons(t)}updateModel(e){switch(e){case"apply":this.onValueConfirmed(this.eAutocomplete.isValid());break;case"reset":this.advancedFilter.setModel(null),this.filterManager?.onFilterChanged({source:"advancedFilter"});break;case"cancel":this.advancedFilter.setModel(this.advancedFilter.getModel()),this.filterManager?.onFilterChanged({source:"advancedFilter"});break;case"clear":this.eAutocomplete.setValue({value:"",restoreFocus:!0});break}}setupBuilderButton(e){this.eBuilderFilterButtonIcon.appendChild(_("advancedFilterBuilder",this.beans)),this.eBuilderFilterButtonLabel.textContent=this.advFilterExpSvc.translate("advancedFilterBuilder"),this.activateTabIndex([this.eBuilderFilterButton]),this.addManagedElementListeners(this.eBuilderFilterButton,{click:()=>this.openBuilder()}),this.addManagedListeners(this.advancedFilter.getCtrl(),{advancedFilterBuilderClosed:()=>this.closeBuilder()}),V(this.eBuilderFilterButton,!e)}onValueChanged(e){e=Ae(e),this.advancedFilter.setExpressionDisplayValue(e),this.expressionParser=this.advancedFilter.createExpressionParser(e);const t=this.expressionParser?.parseExpression();t&&t!==e&&this.eAutocomplete.setValue({value:t,silent:!0,restoreFocus:!0})}onValueConfirmed(e){!e||this.isApplyDisabled||(this.eButtons?.updateValidity(!1),this.advancedFilter.applyExpression(),this.filterManager?.onFilterChanged({source:"advancedFilter"}))}onOptionSelected(e,t,s){const{updatedValue:i,updatedPosition:r,hideAutocomplete:o}=this.updateExpression(e,t,s);this.eAutocomplete.setValue({value:i,position:r,updateListOnlyIfOpen:o,restoreFocus:!0})}validateValue(){return this.expressionParser?.isValid()?null:this.expressionParser?.getValidationMessage()??null}onValidChanged(e,t){this.isApplyDisabled=!e||this.advancedFilter.isCurrentExpressionApplied(),this.eButtons.updateValidity(!this.isApplyDisabled),this.tooltipFeature?.setTooltipAndRefresh(t)}generateAutocompleteListParams(e){return this.expressionParser?this.expressionParser.getAutocompleteListParams(e):this.advFilterExpSvc.getDefaultAutocompleteListParams("")}updateExpression(e,t,s){return this.advFilterExpSvc.updateAutocompleteCache(t,s),this.expressionParser?.updateExpression(e,t,s)??this.advancedFilter.getDefaultExpression(t)}forceLastSelection({key:e,displayValue:t},s){return!!s.toLocaleLowerCase().match(`^${(t??e).toLocaleLowerCase()}\\s*$`)}openBuilder(){this.builderOpen||(this.builderOpen=!0,wi(this.eBuilderFilterButton,!0),this.advancedFilter.getCtrl().toggleFilterBuilder({source:"ui",eventSource:this.eBuilderFilterButton}))}closeBuilder(){this.builderOpen&&(this.builderOpen=!1,wi(this.eBuilderFilterButton,!1),this.eBuilderFilterButton.focus())}},V7={tag:"div",cls:"ag-advanced-filter-header",role:"row"},B7=class extends A{constructor(e){super(V7),this.enabled=e}wireBeans(e){this.colModel=e.colModel,this.focusSvc=e.focusSvc,this.ctrlsSvc=e.ctrlsSvc}postConstruct(){this.setupAdvancedFilter(this.enabled),this.addDestroyFunc(()=>this.destroyBean(this.eAdvancedFilter));const e=()=>{this.enabled&&this.setEnabledHeight()};this.addManagedEventListeners({gridColumnsChanged:()=>this.onGridColumnsChanged(),columnHeaderHeightChanged:e,stylesChanged:e}),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addGuiEventListener("keydown",t=>this.onKeyDown(t)),this.addGuiEventListener("focusout",t=>{this.getFocusableElement().contains(t.relatedTarget)||this.focusSvc.clearAdvancedFilterColumn()})}getFocusableElement(){return this.eAdvancedFilter?.getGui()??this.getGui()}setEnabled(e){e!==this.enabled&&this.setupAdvancedFilter(e)}refresh(){this.eAdvancedFilter?.refresh()}getHeight(){return this.height}setInputDisabled(e){this.eAdvancedFilter?.setInputDisabled(e)}setupAdvancedFilter(e){const t=this.getGui();if(e){this.eAdvancedFilter=this.createBean(new Ly);const s=this.eAdvancedFilter.getGui();this.eAdvancedFilter.addCss("ag-advanced-filter-header-cell"),this.setEnabledHeight(),this.setAriaRowIndex(),Ie(s,"gridcell"),$a(s,1),this.setAriaColumnCount(s),t.appendChild(s)}else ee(t),this.destroyBean(this.eAdvancedFilter),this.height=0;V(t,e),this.enabled=e}setEnabledHeight(){const e=this.getGui();this.height=Dl(this.beans);const t=`${this.height}px`;e.style.height=t,e.style.minHeight=t}setAriaColumnCount(e){Nd(e,this.colModel.getCols().length)}setAriaRowIndex(){dr(this.getGui(),this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)}onGridColumnsChanged(){this.eAdvancedFilter&&(this.setAriaColumnCount(this.eAdvancedFilter.getGui()),this.setAriaRowIndex())}onKeyDown(e){switch(e.key){case b.ENTER:{this.hasFocus()&&Ge(this.getFocusableElement())&&e.preventDefault();break}case b.ESCAPE:this.hasFocus()||this.getFocusableElement().focus();break;case b.UP:this.navigateUpDown(!0,e);break;case b.DOWN:this.navigateUpDown(!1,e);break;case b.TAB:if(this.hasFocus())this.navigateLeftRight(e);else{const t=Qe(this.beans,this.getFocusableElement(),null,e.shiftKey);t?(e.preventDefault(),t.focus()):this.navigateLeftRight(e)}break}}navigateUpDown(e,t){this.hasFocus()&&this.focusSvc.focusNextFromAdvancedFilter(e)&&t.preventDefault()}navigateLeftRight(e){(e.shiftKey?this.focusSvc.focusLastHeader():this.focusSvc.focusNextFromAdvancedFilter(!1,!0))&&e.preventDefault()}hasFocus(){return ie(this.beans)===this.getFocusableElement()}},Gy=class extends yy{},N7=class extends E{constructor(e,t){super(),this.comp=e,this.virtualList=t}postConstruct(){this.createManagedBean(new Gy(this.comp,this.virtualList,{dragSourceType:ns.AdvancedFilterBuilder,addListeners:(e,t,s)=>{e.addManagedListeners(this,{advancedFilterBuilderDragStarted:t,advancedFilterBuilderDragEnded:s})},getCurrentDragValue:e=>this.getCurrentDragValue(e),isMoveBlocked:()=>!1,getNumRows:e=>e.getNumItems(),moveItem:(e,t)=>this.moveItem(e,t)}))}getCurrentDragValue(e){return e.item}moveItem(e,t){this.comp.moveItem(e,t)}},H7=100;function z7(e){const{host:t,source:s,useAsyncSearch:i,onMisconfiguredSearchSource:r,onFirstValuesPageLoaded:o}=e,n=new _7({host:t,source:s,onMisconfiguredSearchSource:r,onFirstValuesPageLoaded:o??(()=>{})}),a=typeof s.loadValuesPage=="function";return{controller:n,hasPagedSource:a,onSearch:i?l=>n.onSearch(l):void 0,onLoadMoreRows:a?l=>n.loadValuesPage(l??"down"):void 0}}var _7=class{constructor(e){this.ctrlParams=e,this.currentSearchRequest=0,this.currentValuesPageRequest=0,this.valuesPageLoading=!1,this.valuesPageHasMoreNext=!1,this.valuesPageHasMorePrev=!1,this.valuesPageLoadedValues=[],this.valuesPageSearch="",this.valuesPageWindowStartRow=0,this.destroyed=!1}destroy(){this.destroyed=!0,this.currentSearchRequest++,this.currentValuesPageRequest++}onSearch(e){if(this.destroyed)return;if(this.isValuesPaged()){this.resetValuesPage(e);return}const t=++this.currentSearchRequest,{host:s,source:i,onMisconfiguredSearchSource:r}=this.ctrlParams;if(s.setValueList({refresh:!0,valueList:void 0}),!e)return;if(typeof i.searchValues!="function"){r?.();return}let o;try{o=i.searchValues(e)}catch(n){to("Rich Select",n),t===this.currentSearchRequest&&s.setValueList({refresh:!0,valueList:[]});return}if(Array.isArray(o)){r?.(),s.setValueList({refresh:!0,valueList:o});return}s.setValueList({valueList:o.then(n=>{if(t===this.currentSearchRequest)return n}).catch(n=>{if(to("Rich Select",n),t===this.currentSearchRequest)return[]}),refresh:!0})}resetValuesPage(e){this.destroyed||(this.valuesPageSearch=e,this.valuesPageLoadedValues=[],this.valuesPageWindowStartRow=this.resolveValuesPageStartRow(e),this.valuesPageNextCursor=void 0,this.valuesPageHasMoreNext=!0,this.valuesPageHasMorePrev=this.valuesPageWindowStartRow>0,this.valuesPageLoading=!1,this.currentValuesPageRequest++,this.ctrlParams.host.setValueList({valueList:void 0,refresh:!0,isInitial:!0}),this.loadValuesPage("down"))}loadValuesPage(e){if(this.destroyed)return;const t=this.ctrlParams.source.loadValuesPage;if(typeof t!="function"||this.valuesPageLoading||e==="up"&&!this.valuesPageHasMorePrev||e==="down"&&!this.valuesPageHasMoreNext)return;const s=Math.max(this.ctrlParams.source.valuesPageSize??H7,1),i=e==="up"?Math.max(this.valuesPageWindowStartRow-s,0):this.valuesPageWindowStartRow+this.valuesPageLoadedValues.length,r=e==="up"?this.valuesPageWindowStartRow:i+s;if(i>=r){e==="up"?this.valuesPageHasMorePrev=!1:this.valuesPageHasMoreNext=!1;return}const o=this.currentValuesPageRequest,n={search:this.valuesPageSearch,startRow:i,endRow:r,cursor:e==="down"?this.valuesPageNextCursor:void 0};this.valuesPageLoading=!0,this.valuesPageLoadedValues.length===0&&this.ctrlParams.host.setIsLoading();let a;try{a=t(n)}catch(l){this.handleValuesPageError(l,o);return}Promise.resolve(a).then(l=>this.applyValuesPageResult(l,s,o,e,i,r)).catch(l=>this.handleValuesPageError(l,o))}applyValuesPageResult(e,t,s,i,r,o){if(this.destroyed||s!==this.currentValuesPageRequest)return;this.valuesPageLoading=!1;const n=this.valuesPageLoadedValues.length===0,a=e?.values??[];if(i==="up"){a.length&&(this.valuesPageLoadedValues=[...a,...this.valuesPageLoadedValues],this.valuesPageWindowStartRow=r);const l=o-r;this.valuesPageHasMorePrev=r>0&&a.length>=l}else{a.length&&(this.valuesPageLoadedValues=[...this.valuesPageLoadedValues,...a]),this.valuesPageNextCursor=e?.cursor;const l=this.valuesPageLoadedValues.length;typeof e?.lastRow=="number"?this.valuesPageHasMoreNext=this.valuesPageWindowStartRow+l=t}this.ctrlParams.host.setValueList({valueList:this.valuesPageLoadedValues,refresh:!0,isInitial:!0,scrollToCurrentValue:n,prependedRowCount:i==="up"?a.length:void 0}),n&&this.ctrlParams.onFirstValuesPageLoaded()}handleValuesPageError(e,t){to("Rich Select",e),!(this.destroyed||t!==this.currentValuesPageRequest)&&(this.valuesPageLoading=!1,this.valuesPageHasMoreNext=!1,this.valuesPageHasMorePrev=!1,this.ctrlParams.host.setValueList({valueList:this.valuesPageLoadedValues,refresh:!0,isInitial:!0}))}resolveValuesPageStartRow(e){if(e)return 0;const t=this.ctrlParams.source.valuesPageInitialStartRow?.(e);return Math.max(Math.floor(t??0),0)}isValuesPaged(){return typeof this.ctrlParams.source.loadValuesPage=="function"}},W7={tag:"div",cls:"ag-pill",role:"option",children:[{tag:"span",ref:"eText",cls:"ag-pill-text"},{tag:"span",ref:"eButton",cls:"ag-button ag-pill-button",role:"presentation"}]},U7=class extends A{constructor(e){super(W7),this.config=e,this.eText=x,this.eButton=x}postConstruct(){const{config:e,eButton:t}=this,{onKeyDown:s,onButtonClick:i}=e;this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),this.addGuiEventListener("focus",()=>{this.eButton.focus()}),s&&this.addGuiEventListener("keydown",s),i&&this.addManagedElementListeners(t,{click:i})}toggleCloseButtonClass(e,t){this.eButton.classList.toggle(e,t)}setText(e){this.eText.textContent=e}getText(){return this.eText.textContent}},$7={tag:"div",cls:"ag-pill-container"},K7=class extends A{constructor(){super($7),this.pills=[]}init(e){this.params=e,this.getKey=e.valueFormatter??(t=>String(t)),this.refresh()}refresh(){this.clearPills();const{params:e,onPillKeyDown:t,getKey:s}=this;let i=e.getValue();if(!Array.isArray(i)){if(i==null)return;i=[i]}const r=e.valueFormatter??(n=>String(n)),o=i.length;Ie(this.getGui(),o===0?"presentation":"listbox");for(let n=0;nthis.onPillButtonClick(l),onKeyDown:t.bind(this)})),c=l.getGui();ln(c,n+1),an(c,o),e.onPillMouseDown&&l.addGuiEventListener("mousedown",e.onPillMouseDown),e.announceItemFocus&&l.addGuiEventListener("focus",e.announceItemFocus),l.setText(r(a)??""),l.toggleCloseButtonClass("ag-icon-cancel",!0),this.appendChild(c),this.pills.push({key:s(a)??n.toString(),pill:l})}}onNavigationKeyDown(e){const{key:t}=e,s=this.gos.get("enableRtl"),i=!s&&t===b.LEFT||s&&t===b.RIGHT,r=!s&&t===b.RIGHT||s&&t===b.LEFT;if(!this.pills.length||!i&&!r)return;e.preventDefault();const{beans:o,params:n}=this,a=ie(o),l=this.getGui(),c=Kt(l);if(l.contains(a)){const d=c.find(h=>h.contains(a));d&&d!==a&&d.focus();const u=Qe(o,l,!1,i);u?u.focus():r&&n.focusAfterForwardBoundary?.()}else c.length>0&&c[r?0:c.length-1].focus()}clearPills(){const e=this.getGui();e.contains(ie(this.beans))&&this.params.eWrapper&&this.params.eWrapper.focus(),ee(e),this.destroyBeans(this.pills.map(({pill:t})=>t)),this.pills=[]}onPillButtonClick(e){this.deletePill(e)}onPillKeyDown(e){const t=e.key;if(t===b.LEFT||t===b.RIGHT){e.stopPropagation(),this.params.onHorizontalArrowKeyDown?this.params.onHorizontalArrowKeyDown(e):this.onNavigationKeyDown(e);return}if(t!==b.DELETE&&t!==b.BACKSPACE)return;e.preventDefault();const s=me(this.beans),i=this.pills.findIndex(({pill:o})=>o.getGui().contains(s.activeElement));if(i===-1)return;const r=this.pills[i];r?.pill&&this.deletePill(r.pill,i)}deletePill(e,t){const{getKey:s,pills:i,params:r}=this,o=(i[t??-1]??i.find(({pill:a})=>a===e))?.key,n=(r.getValue()||[]).filter(a=>s(a)!==o);if(r.setValue(n),!n.length)r.focusAfterDelete?r.focusAfterDelete():r.eWrapper?.focus();else if(t!=null){const{pill:a}=i[Math.min(t,i.length-1)];a&&a.getFocusableElement().focus()}}destroy(){this.clearPills(),super.destroy()}},j7=".ag-rich-select{cursor:default;height:100%}.ag-rich-select-value{align-items:center;background-color:var(--ag-picker-button-background-color);display:flex;height:100%;padding:var(--ag-spacing);:where(.ag-picker-field-display){overflow:hidden;text-overflow:ellipsis;&:where(.ag-display-as-placeholder){opacity:.5}}}.ag-virtual-list-viewport.ag-rich-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-input-border-radius);box-shadow:var(--ag-dropdown-shadow);height:auto;position:relative;width:100%;:where(.ag-rich-select-loading){display:flex;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);:where(.ag-loading-text){overflow:hidden;text-overflow:ellipsis}}}.ag-rich-select-row{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;padding:0 var(--ag-spacing);white-space:nowrap}.ag-rich-select-row-selected{background-color:var(--ag-selected-row-background-color)}.ag-rich-select-row-highlighted,.ag-rich-select-row:hover{background-image:linear-gradient(var(--ag-row-hover-color),var(--ag-row-hover-color))}.ag-rich-select-row-text-highlight{font-weight:700}.ag-rich-select-field-input{flex:1 1 auto;:where(.ag-input-field-input){border:none!important;box-shadow:none!important;padding:0!important;text-overflow:ellipsis;&::-moz-placeholder{opacity:.8}&::placeholder{opacity:.8}}}:where(.ag-ltr) .ag-rich-select-field-input{left:var(--ag-spacing)}:where(.ag-rtl) .ag-rich-select-field-input{right:var(--ag-spacing)}.ag-rich-select-typing-multi{:where(.ag-picker-field-display){flex:0 1 auto;max-width:100%;min-width:0}:where(.ag-rich-select-pill-display){align-items:center;display:flex;flex:0 1 auto;max-width:100%;min-width:0;overflow:hidden;:where(.ag-pill-container){flex:0 1 auto;max-width:100%;min-width:0;overflow:hidden}}:where(.ag-rich-select-field-input){flex:0 0 auto;max-width:100%;min-width:0;:where(.ag-input-wrapper){flex:0 0 auto;max-width:100%}:where(.ag-input-field-input){max-width:100%;min-width:1ch;width:auto}}}:where(.ag-ltr) .ag-rich-select-typing-multi{:where(.ag-rich-select-field-input){margin-left:.25rem}:where(.ag-rich-select-deselect-button){margin-left:auto}:where(.ag-rich-select-deselect-button.ag-hidden+.ag-picker-field-icon){margin-left:auto}}:where(.ag-rtl) .ag-rich-select-typing-multi{:where(.ag-rich-select-field-input){margin-right:.25rem}:where(.ag-rich-select-deselect-button){margin-right:auto}:where(.ag-rich-select-deselect-button.ag-hidden+.ag-picker-field-icon){margin-right:auto}}:where(.ag-popup-editor) .ag-rich-select-value{height:var(--ag-row-height);min-width:200px}.ag-rich-select-virtual-list-item{cursor:default;height:var(--ag-list-item-height)}.ag-pill-container{display:flex;flex-wrap:nowrap;gap:.25rem;min-width:0}.ag-pill{align-items:center;background:var(--ag-select-cell-background-color);border:var(--ag-select-cell-border);border-radius:var(--ag-border-radius);display:flex;padding:0 .25rem;white-space:nowrap}.ag-pill-button{border:none;padding:0}:where(.ag-ltr) .ag-pill-button{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-pill-button{margin-right:var(--ag-spacing)}.ag-pill-button:hover{color:var(--ag-accent-color);cursor:pointer}",q7={tag:"div",cls:"ag-rich-select-row",role:"presentation"},Y7=class extends A{constructor(e){super(q7),this.params=e,this.valueFormatter=Rp(e.valueFormatter)}wireBeans(e){this.userCompFactory=e.userCompFactory,this.registry=e.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("highlightTooltipFeature",!1,{getGui:()=>this.getGui(),shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0},this))}setState(e){const t=this.valueFormatter(e);this.populateWithRenderer(e,t)||this.populateWithoutRenderer(e,t),this.value=e}highlightString(e){const{parsedValue:t,params:s}=this;if(s.cellRenderer||!D(t))return;let i=D(e);if(i){const r=t?.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(r>=0){const o=r+e.length,n=this.getGui().querySelector("span");n&&(ee(n),n.append(t.slice(0,r),re({tag:"span",cls:"ag-rich-select-row-text-highlight",children:t.slice(r,o)}),t.slice(o)))}else i=!1}i||this.renderValueWithoutRenderer(t)}updateSelected(e){const t=this.getGui();cn(t.parentElement,e),this.toggleCss("ag-rich-select-row-selected",e)}getValue(){return this.value}toggleHighlighted(e){this.toggleCss("ag-rich-select-row-highlighted",e),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:e})}populateWithoutRenderer(e,t){const s=this.getGui(),i=re({tag:"span"});i.style.overflow="hidden",i.style.textOverflow="ellipsis";const r=es(D(t)?t:e);this.parsedValue=D(r)?r:null,s.appendChild(i),this.renderValueWithoutRenderer(r),this.shouldDisplayTooltip=ti(()=>i),this.tooltipFeature?.setTooltipAndRefresh(this.parsedValue)}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.textContent=D(e)?e:"\xA0")}populateWithRenderer(e,t){let s,i;const{cellRenderer:r,cellRendererParams:o}=this.params;if(r){const n=this.getParentComponent()?.getParentComponent();i=pu(this.userCompFactory,this.params,N(this.gos,{value:e,valueFormatted:t,cellRendererParams:o,getValue:()=>n?.getValue(),setValue:a=>{n?.setValue(a,!0)},setTooltip:(a,l)=>{this.gos.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=l,this.tooltipFeature?.setTooltipAndRefresh(a)}}))}return i&&(s=i.newAgStackInstance()),s&&Ny(s,this.getGui()),s?(s.then(n=>{this.addDestroyFunc(()=>{this.destroyBean(n)})}),!0):!1}},Oy="ag-rich-select-list",Vy="ag-rich-select-row",Zc=0,X7=1,Qc=2,xp=3,Z7=class extends Vo{constructor(e,t,s){super({cssIdentifier:"rich-select"}),this.params=e,this.richSelectWrapper=t,this.getSearchString=s,this.lastRowHovered=-1,this.selectedItems=new Set,this.loadingState=xp,this.loadMoreRowsThreshold=10,this.valueFormatter=Rp(e.valueFormatter),this.setComponentCreator(this.createRowComponent.bind(this)),this.setComponentUpdater(()=>{})}postConstruct(){super.postConstruct();const e=this.getLocaleTextFunc();this.loadingLabel=e("loadingOoo","Loading..."),this.noMatchesLabel=e("noMatches","No matches to show"),this.eLoadingIcon=_("richSelectLoading",this.beans,null),this.eStateCompLabel=re({tag:"span",cls:"ag-loading-text",children:this.loadingLabel}),this.eStateComp=re({tag:"div",cls:"ag-rich-select-loading",children:[{tag:"span",cls:"ag-loading-icon",children:[this.eLoadingIcon?()=>this.eLoadingIcon:void 0]},{tag:"span",cls:"ag-loading-text",children:[()=>this.eStateCompLabel]}]}),this.appendChild(this.eStateComp);const{cellRowHeight:t,pickerAriaLabelKey:s,pickerAriaLabelValue:i}=this.params;t&&this.setRowHeight(t);const r=this.getGui(),o=this.getAriaElement();this.addManagedListeners(r,{mousemove:this.onMouseMove.bind(this),mouseout:this.onMouseOut.bind(this),mousedown:this.onMouseDown.bind(this),click:this.onClick.bind(this),scroll:this.onGuiScroll.bind(this)}),r.classList.add(Oy);const n=`${Oy}-${this.getCompId()}`;o.setAttribute("id",n);const a=e(s,i);de(o,a),ja(this.richSelectWrapper,o)}setIsLoading(){this.setLoadingState(Zc)}setLoadingState(e){const t=this.loadingState!==e;if(this.loadingState=e,this.toggleStateComp(),this.toggleVisibility(),t){const s=this.getStateAnnouncementText(e);s&&this.stateAnnouncementCallback?.(s)}}toggleStateComp(){const{eStateComp:e,eStateCompLabel:t,eLoadingIcon:s,loadingState:i,loadingLabel:r,noMatchesLabel:o,params:n}=this;if(e){if(i===Zc){t.textContent=r,s&&V(s,!0),V(e,!0);return}if(i===Qc&&n.allowNoResultsCopy){t.textContent=o,s&&V(s,!1),V(e,!0);return}V(e,!1)}}shouldBeVisible(){return this.loadingState===Qc?!!this.params.allowNoResultsCopy:this.loadingState!==xp}toggleVisibility(e){const t=this.getGui();e===void 0?V(t,this.shouldBeVisible()):V(t,e),this.scheduleMaybeRequestMoreRows()}setLoadMoreRowsCallback(e,t=10){this.loadMoreRowsCallback=e,this.loadMoreRowsThreshold=Math.max(t,1),this.maybeRequestMoreRows()}setStateAnnouncementCallback(e){this.stateAnnouncementCallback=e}navigateToPage(e){const t=super.navigateToPage(e,this.lastRowHovered);return t!=null&&Rt(this.beans,()=>{if(!this.isAlive())return null;this.highlightIndex(t)}),t}drawVirtualRows(e){super.drawVirtualRows(e),this.refreshSelectedItems(),this.lastRowHovered!==-1&&this.updateRenderedHighlightState(this.lastRowHovered)}highlightFilterMatch(e){this.forEachRenderedRow(t=>{t.highlightString(e)})}onNavigationKeyDown(e,t){Rt(this.beans,()=>{if(!this.currentList||!this.isAlive())return;const s=this.currentList.length,i=this.lastRowHovered,r=e===b.DOWN?1:-1,o=Math.min(Math.max(i===-1?0:i+r,0),s-1);this.highlightIndex(o),t()})}selectValue(e){if(!this.currentList||e==null)return!1;const t=this.getIndicesForValues(e),s=t.length>0;return s&&(this.refresh(),this.ensureIndexVisible(t[0]),this.refresh(!0)),this.selectListItems(Array.isArray(e)?e:[e]),s&&this.highlightIndex(t[0],!0),s}selectListItems(e,t=!1){t||this.selectedItems.clear();for(let s=0;se.length,getRow:s=>e[s],areRowsEqual:(s,i)=>s===i})}offsetHoveredIndexOnPrependedRows(e){e<=0||this.lastRowHovered<0||(this.lastRowHovered+=e)}restoreScrollOnPrependedRows(e,t){if(t<=0)return;const s=this.getGui(),i=this.getRowHeight(),r=e+t*i;this.awaitStable(()=>{this.isAlive()&&(s.scrollTop=r)})}getSelectedItems(){return this.selectedItems}getLastItemHovered(){return this.currentList?.[this.lastRowHovered]}highlightIndex(e,t){this.currentList&&(e<0||e>=this.currentList.length?(this.lastRowHovered=-1,this.setActiveOption()):(this.lastRowHovered=e,this.ensureIndexVisible(e,!t)&&!t&&this.refresh(!0)),this.updateRenderedHighlightState(e))}updateRenderedHighlightState(e){let t;this.forEachRenderedRow((s,i)=>{const r=e===i;s.toggleHighlighted(r),r&&(t=`${Vy}-${s.getCompId()}`)}),this.setActiveOption(t)}setActiveOption(e){Vd(this.richSelectWrapper,e??null),nt(this.richSelectWrapper,"data-active-option",e)}getIndicesForValues(e){const{currentList:t}=this;if(!t||t.length===0||e===void 0)return[];const s=Array.isArray(e)?e:[e];if(s.length===0)return[];const i=[];let r;for(const o of s){let n=t.indexOf(o);if(n===-1&&o!=null){r??(r=t.map(l=>this.valueFormatter(l)));const a=this.getComparableFormattedValue(o);n=r.indexOf(a)}n>=0&&i.push(n)}return i}toggleListItemSelection(e){const t=this.findItemInSelected(e);t!==void 0?this.selectedItems.delete(t):this.selectedItems.add(e),this.refreshSelectedItems(),this.dispatchValueSelected()}refreshSelectedItems(){this.forEachRenderedRow(e=>{const t=this.findItemInSelected(e.getValue())!==void 0;e.updateSelected(t)})}findItemInSelected(e){if(typeof e=="object"){if(this.selectedItems.has(e))return e;const t=this.valueFormatter(e);for(const s of this.selectedItems)if(this.valueFormatter(s)===t)return s}else return this.selectedItems.has(e)?e:void 0}getComparableFormattedValue(e){return e!=null&&typeof e=="object"?this.valueFormatter(e):String(e??"")}createRowComponent(e,t){const s=new Y7(this.params);t.setAttribute("id",`${Vy}-${s.getCompId()}`),s.setParentComponent(this),this.createBean(s),s.setState(e);const{highlightMatch:i,searchType:r="fuzzy"}=this.params;return i&&r!=="fuzzy"&&s.highlightString(this.getSearchString()),s}getRowForMouseEvent(e){if(!this.model)return-1;const s=this.getGui().getBoundingClientRect(),i=this.getScrollTop(),r=e.clientY-s.top+i;return Math.min(Math.max(Math.floor(r/this.getRowHeight()),0),this.model.getRowCount()-1)}onMouseMove(e){const t=this.getRowForMouseEvent(e);t!==-1&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.highlightIndex(t,!0))}onGuiScroll(){this.maybeRequestMoreRows(!0)}scheduleMaybeRequestMoreRows(){if(this.beans){Rt(this.beans,()=>this.maybeRequestMoreRows(!1));return}this.maybeRequestMoreRows(!1)}maybeRequestMoreRows(e=!1){const t=this.loadMoreRowsCallback,s=this.currentList;if(!t||!s||this.loadingState===Zc)return;const i=this.getGui();if(i.clientHeight<=0)return;const o=(i.scrollHeight-(i.scrollTop+i.clientHeight))/this.getRowHeight(),n=i.scrollTop/this.getRowHeight(),a=i.scrollHeight>i.clientHeight;n<=this.loadMoreRowsThreshold&&(e||!a)&&t("up"),o<=this.loadMoreRowsThreshold&&t("down")}getStateAnnouncementText(e){if(e===Zc)return this.loadingLabel;if(e===Qc&&this.params.allowNoResultsCopy)return this.noMatchesLabel}onMouseDown(e){e.preventDefault()}onMouseOut(e){this.getGui().contains(e.relatedTarget)||this.highlightIndex(-1)}onClick(e){const{multiSelect:t}=this.params;if(!this.currentList?.length)return;const s=this.getRowForMouseEvent(e),i=this.currentList[s];t?this.toggleListItemSelection(i):(this.selectListItems([i]),this.dispatchValueSelected())}dispatchValueSelected(){this.dispatchLocalEvent({type:"richSelectListRowSelected",fromEnterKey:!1,value:this.selectedItems})}destroy(){super.destroy(),this.eStateComp=void 0}};function Q7(e){return e?e.length?X7:Qc:xp}var By=300,J7={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed",children:[{tag:"span",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"ag-input-text-field",ref:"eInput",cls:"ag-rich-select-field-input"},{tag:"span",ref:"eDeselect",cls:"ag-rich-select-deselect-button ag-picker-field-icon",role:"presentation"},{tag:"span",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},Jc=class extends vc{constructor(e){const t=Rp(e?.valueFormatter),s=e?.agComponents?.includes(Vt)?e.agComponents:[Vt,...e?.agComponents??[]];super({...e,pickerAriaLabelKey:e?.pickerAriaLabelKey??"ariaLabelRichSelectField",pickerAriaLabelValue:e?.pickerAriaLabelValue??"Rich Select Field",pickerType:e?.pickerType??"ag-list",className:e?.className??"ag-rich-select",pickerIcon:e?.pickerIcon??"richSelectOpen",ariaRole:e?.ariaRole??"combobox",template:e?.template??J7,agComponents:s,modalPicker:e?.modalPicker??!1,valueFormatter:t,maxPickerHeight:e?.maxPickerHeight??"calc(var(--ag-row-height) * 6.5)"}),this.searchString="",this.loadMoreRowsThreshold=10,this.hasPagedAsyncSource=!1,this.searchStringCreator=null,this.eInput=x,this.eDeselect=x,this.skipWrapperAnnouncement=!1,this.onPillHorizontalArrowKeyDown=l=>{this.handleHorizontalNavigationKey(l)},this.valueFormatter=t;const{value:i,valueList:r,searchStringCreator:o,onSearch:n}=e??{};i!==void 0&&(this.value=i),o&&(this.searchStringCreator=o),r!=null&&this.setValueList({valueList:r,isInitial:!0});const{searchDebounceDelay:a=By}=this.config;n&&(this.onSearchCallbackDebounced=Ce(this,n,a)),this.registerCSS(j7)}wireBeans(e){this.userCompFactory=e.userCompFactory,this.ariaAnnounce=e.ariaAnnounce,this.registry=e.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0})),super.postConstruct(),this.createListComponent(),this.eDeselect.appendChild(_("richSelectRemove",this.beans));const{allowTyping:e,placeholder:t,multiSelect:s,suppressDeselectAll:i,suppressMultiSelectPillRenderer:r}=this.config;this.eDeselect.classList.add("ag-hidden"),e?(this.eInput.setAutoComplete(!1).setInputPlaceholder(t),s?(this.eWrapper.classList.add("ag-rich-select-typing-multi"),r||this.eDisplayField.classList.add("ag-rich-select-pill-display")):this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.setupAriaProperties();const{searchDebounceDelay:o=300}=this.config;this.clearSearchString=Ce(this,this.clearSearchString.bind(this),o),this.renderSelectedValue(),e&&this.eInput.onValueChange(n=>{this.openPickerOnTypingIfNeeded(n),this.updateTypingMultiSelectPlaceholder(n),this.searchTextFromString(n)}),this.addManagedElementListeners(this.eWrapper,{focus:this.onWrapperFocus.bind(this)}),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)}),i||this.addManagedElementListeners(this.eDeselect,{mousedown:this.onDeselectAllMouseDown.bind(this),click:this.onDeselectAllClick.bind(this)})}setupAriaProperties(){const{eWrapper:e,gos:t}=this;e.tabIndex=t.get("tabIndex");const s=this.getLocaleTextFunc();this.ariaDeleteSelection=s("ariaLabelRichSelectDeleteSelection","Press DELETE to deselect item"),this.ariaDeselectAllItems=s("ariaLabelRichSelectDeselectAllItems","Press DELETE to deselect all items"),this.ariaToggleSelection=s("ariaLabelRichSelectToggleSelection","Press SPACE to toggle selection")}createListComponent(){this.listComponent=this.createBean(new Z7(this.config,this.getFocusableElement(),()=>this.searchString)),this.listComponent.setLoadMoreRowsCallback(this.loadMoreRowsCallback,this.loadMoreRowsThreshold),this.listComponent.setStateAnnouncementCallback(e=>this.announceAriaValue(e)),this.listComponent.setParentComponent(this),this.addManagedListeners(this.listComponent,{richSelectListRowSelected:e=>{this.onListValueSelected(e.value,e.fromEnterKey)}})}renderSelectedValue(e){const{value:t,eDisplayField:s,config:i,gos:r}=this,{allowTyping:o,cellRenderer:n,cellRendererParams:a,initialInputValue:l,multiSelect:c,suppressDeselectAll:d,suppressMultiSelectPillRenderer:u,onSearch:h}=i,g=this.valueFormatter(t),p=!!(o&&c);if(o){const C=p?l??this.eInput.getValue()??"":l??(t===""?"":g);if(this.eInput.setValue(C,!!e&&!!h),!p)return;this.updateTypingMultiSelectPlaceholder(C)}if(c&&!d){const C=t==null||Array.isArray(t)&&t.length===0;this.eDeselect.classList.toggle("ag-hidden",C)}let f;if(c&&!u){this.createOrUpdatePillContainer(s);return}n&&!o&&(f=pu(this.userCompFactory,i,N(this.gos,{value:t,valueFormatted:g,cellRendererParams:a,getValue:()=>this.getValue(),setValue:C=>{this.setValue(C,!0)},setTooltip:(C,v)=>{r.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=v,this.tooltipFeature?.setTooltipAndRefresh(C)}})));let m;if(f&&(m=f.newAgStackInstance()),m)ee(s),Ny(m,s),m.then(C=>{this.addDestroyFunc(()=>this.destroyBean(C))});else{if(t!=null)s.innerText=g,s.classList.remove("ag-display-as-placeholder");else{const{placeholder:C}=i;D(C)?(s.textContent=C,s.classList.add("ag-display-as-placeholder")):ee(s)}this.shouldDisplayTooltip=ti(()=>this.eDisplayField),this.tooltipFeature?.setTooltipAndRefresh(g??null)}}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setAsyncValuesSource(e){const{source:t,thresholdRows:s,useAsyncSearch:i,onMisconfiguredSearchSource:r,onFirstValuesPageLoaded:o}=e;this.asyncRequests?.destroy();const n=z7({host:{setValueList:a=>this.setValueList(a),setIsLoading:()=>this.setIsLoading()},source:t,useAsyncSearch:i,onMisconfiguredSearchSource:r,onFirstValuesPageLoaded:o});if(this.asyncRequests=n.controller,this.hasPagedAsyncSource=n.hasPagedSource,n.onSearch){const{searchDebounceDelay:a=By}=this.config;this.onSearchCallbackDebounced=Ce(this,n.onSearch,a)}else this.config.onSearch||(this.onSearchCallbackDebounced=void 0);this.setLoadMoreRowsCallback(n.onLoadMoreRows,s??this.loadMoreRowsThreshold)}resetAsyncValues(e=""){this.hasPagedAsyncSource&&this.asyncRequests?.resetValuesPage(e)}setLoadMoreRowsCallback(e,t=10){this.loadMoreRowsCallback=e,this.loadMoreRowsThreshold=Math.max(t,1),this.listComponent?.setLoadMoreRowsCallback(this.loadMoreRowsCallback,this.loadMoreRowsThreshold)}setIsLoading(){this.listComponent?.setIsLoading()}setValueListInternal(e){const{listComponent:t,isPickerDisplayed:s,value:i}=this,{valueList:r,refresh:o,isInitial:n,scrollToCurrentValue:a=!0,prependedRowCount:l=0}=e;if(n&&this.setValues(r),!t)return;const c=l>0?t.getScrollTop():void 0;if(l>0&&t.offsetHoveredIndexOnPrependedRows(l),t.setCurrentList(r),!!o){if(s&&c!=null&&l>0&&t.restoreScrollOnPrependedRows?.(c,l),this.values){t.refresh(!0);const d=i!=null&&t.getIndicesForValues(i).length>0;s&&d&&a&&t.selectValue(i)}else s&&(t.selectValue(i)||t.refresh());this.alignPickerToComponent()}}setValueList(e){const{valueList:t}=e;if(!t||Array.isArray(t)){this.setValueListInternal(e);return}this.listComponent?.setIsLoading(),t.then(s=>{s!==void 0&&this.setValueListInternal({...e,valueList:s})}).catch(()=>{this.setValueListInternal({...e,valueList:[],refresh:!0})})}setValues(e){this.values=e,this.searchStrings=this.getSearchStringsFromValues(e||[])}showPicker(){const{listComponent:e,value:t}=this;if(!e)return;super.showPicker();const s=t??null;e.selectValue(s);const i=e.getIndicesForValues(s)[0];i!=null?(this.tooltipFeature?.attemptToHideTooltip(),e.highlightIndex(i)):e.refresh()}createOrUpdatePillContainer(e){if(!this.pillContainer){const s=this.pillContainer=this.createBean(new K7);this.addDestroyFunc(()=>{this.destroyBean(this.pillContainer),this.pillContainer=null}),ee(e),e.appendChild(s.getGui());const{config:i,eWrapper:r,ariaDeleteSelection:o}=this;s.init({eWrapper:r,valueFormatter:this.valueFormatter,onPillMouseDown:n=>{n.stopImmediatePropagation()},announceItemFocus:()=>{this.announceAriaValue(o)},focusAfterDelete:i.allowTyping?()=>this.focusTypingInputAtBoundary():void 0,focusAfterForwardBoundary:i.allowTyping?()=>this.focusTypingInputAtBoundary():void 0,onHorizontalArrowKeyDown:this.onPillHorizontalArrowKeyDown,getValue:()=>this.getValue(),setValue:n=>this.setValue(n,!0)})}const t=this.pillContainer.getGui().childElementCount;this.doWhileBlockingAnnouncement(()=>this.pillContainer?.refresh()),this.scrollTypingMultiSelectPillsToEndOnAdd(t)}scrollTypingMultiSelectPillsToEndOnAdd(e){const{allowTyping:t,multiSelect:s,suppressMultiSelectPillRenderer:i}=this.config;if(!t||!s||i)return;const r=this.pillContainer?.getGui();!r||r.childElementCount<=e||pr(r,r.scrollWidth,this.isRtl())}doWhileBlockingAnnouncement(e){this.skipWrapperAnnouncement=!0,e(),this.skipWrapperAnnouncement=!1}isPreviousHorizontalNavigation(e){return e===b.LEFT!==this.isRtl()}isRtl(){return!!this.gos?.get("enableRtl")}isTypingInputAtPillBoundary(){const e=this.eInput.getInputElement(),{selectionStart:t,selectionEnd:s,value:i}=e;return t==null||s==null||t!==s?!1:this.isRtl()?t===(i??"").length:t===0}focusTypingInputAtBoundary(){const e=this.eInput.getInputElement();e.focus();const t=this.isRtl()?e.value.length:0;e.setSelectionRange(t,t)}getActiveElementForKeyboardNavigation(){if(this.beans?.eRootDiv)return ie(this.beans);const e=this.getTypingInputElement();return e?e.ownerDocument?.activeElement??document.activeElement:document.activeElement}onWrapperFocus(){const{eInput:e,config:t}=this,{allowTyping:s,multiSelect:i,suppressDeselectAll:r}=t;if(s){const o=e.getFocusableElement();o.focus(),o.select()}else i&&!r&&!this.skipWrapperAnnouncement&&this.announceAriaValue(this.ariaDeselectAllItems)}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}onDeselectAllMouseDown(e){e.stopImmediatePropagation()}onDeselectAllClick(){this.setValue([],!0)}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===b.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!Il(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){e==null&&(e=""),this.searchString=e,this.onSearchCallbackDebounced&&this.setValueList({valueList:void 0,refresh:!0}),this.runSearch()}getSearchStringsFromValues(e){return typeof e[0]=="object"&&this.searchStringCreator?this.searchStringCreator(e):e.map(t=>t===""?"":this.valueFormatter(t))}filterListModel(e){const{filterList:t}=this.config;t&&this.setValueList({valueList:e,refresh:!0})}runSearch(){if(!this.listComponent)return;if(this.onSearchCallbackDebounced){this.onSearchCallbackDebounced(this.searchString);return}const e=this.searchStrings;if(!e){this.listComponent.highlightIndex(-1);return}const{suggestions:t,filteredValues:s}=this.getSuggestionsAndFilteredValues(this.searchString,e),{filterList:i,highlightMatch:r,searchType:o="fuzzy"}=this.config,n=!!(i&&this.searchString!=="");this.filterListModel(n?s:this.values||[]),this.highlightEmptyValue()||this.highlightListValue(t,s,n),r&&o!=="fuzzy"&&this.listComponent?.highlightFilterMatch(this.searchString),this.listComponent?.toggleVisibility()}highlightEmptyValue(){if(this.searchString===""){const e=this.searchStrings?.indexOf("");if(e!==void 0&&e!==-1)return this.listComponent?.highlightIndex(e),!0}return!1}highlightListValue(e,t,s){if(e.length){const i=s?0:this.searchStrings?.indexOf(e[0]);i!==void 0&&this.listComponent?.highlightIndex(i)}else if(this.listComponent?.highlightIndex(-1),!s||t.length)this.listComponent?.ensureIndexVisible(0);else if(s){const i=this.getFocusableElement();nt(i,"data-active-option",null),Vd(i,null)}}getSuggestionsAndFilteredValues(e,t){let s=[];const i=[];if(!e.length)return{suggestions:s,filteredValues:i};const{searchType:r="fuzzy",filterList:o}=this.config,n=this.values||[];if(r==="fuzzy"){const a=Ro({inputValue:e,allSuggestions:t,hideIrrelevant:!0});s=a.values;const l=a.indices;if(o&&l.length)for(let c=0;c{const c=a.toLocaleLowerCase(),d=this.searchString.toLocaleLowerCase(),u=r==="match"?c.startsWith(d):c.includes(d);return o&&u&&i.push(n[l]),u});return{suggestions:s,filteredValues:i}}clearSearchString(){this.searchString=""}setValue(e,t,s,i){if(this.value===e)return this.updateTypingMultiSelectPlaceholder(),this;const r=Array.isArray(e);if(e!=null){if(!r&&!this.listComponent?.getIndicesForValues(e)?.length)return this;s||this.listComponent?.selectValue(e)}return super.setValue(e,t),i?this.updateTypingMultiSelectPlaceholder():this.renderSelectedValue(s),this}onNavigationKeyDown(e,t,s){e.preventDefault();const i=t===b.DOWN;if(!this.isPickerDisplayed&&i){this.showPicker();return}this.listComponent?.onNavigationKeyDown(t,s)}onEnterKeyDown(e){const t=!!(this.config.allowTyping&&this.config.multiSelect);if(!this.isPickerDisplayed){t&&(e.preventDefault(),this.dispatchPickerEventAndHidePicker(this.value,!0));return}if(e.preventDefault(),this.listComponent?.getCurrentList()){const s=this.listComponent.getLastItemHovered();if(t){if(s!==void 0){const i=this.getCurrentSelectionWithAppendedItem(s);this.listComponent.selectValue(i),this.setValue(i,!1,!0),this.resetTypingMultiSelectSearchState(),this.hidePicker()}return}this.config.multiSelect||s===void 0?this.dispatchPickerEventAndHidePicker(this.value,!0):this.onListValueSelected(new Set([s]),!0)}}getCurrentSelectionWithAppendedItem(e){const t=this.getValue(),s=Array.isArray(t)?[...t]:t!=null?[t]:[];return s.some(i=>this.areValuesEquivalent(i,e))||s.push(e),s}areValuesEquivalent(e,t){return e===t?!0:typeof e=="object"&&typeof t=="object"&&e!=null&&t!=null?this.valueFormatter(e)===this.valueFormatter(t):!1}resetTypingMultiSelectSearchState(){if(this.searchString="",this.eInput.setValue("",!0),this.onSearchCallbackDebounced){this.setValueList({valueList:void 0,refresh:!0});return}this.config.filterList&&this.values&&this.setValueList({valueList:this.values,refresh:!0})}updateTypingMultiSelectPlaceholder(e){const{allowTyping:t,multiSelect:s,placeholder:i}=this.config;if(!t||!s)return;const r=e??this.eInput.getValue()??"",o=r.length>0,n=this.value,a=(Array.isArray(n)?n.length>0:n!=null)||(this.listComponent?.getSelectedItems().size??0)>0,l=!o&&!a?i:"";this.eInput.setInputPlaceholder(l),this.updateTypingMultiSelectInputSize(r,l)}updateTypingMultiSelectInputSize(e,t){const s=this.getTypingInputElement();if(!s)return;const r=Math.max(1,Math.min((e||t||"").length+1,32));if(s.size!==r&&(s.size=r),e){const o=this.pillContainer?.getGui();o&&pr(o,o.scrollWidth,this.isRtl())}}getTypingInputElement(){const e=this.eInput.getInputElement;if(typeof e=="function")return e.call(this.eInput)}openPickerOnTypingIfNeeded(e){const{isPickerDisplayed:t,config:{allowTyping:s,multiSelect:i}}=this;s&&i&&!t&&e&&this.showPicker()}onDeleteKeyDown(e){const{eWrapper:t,beans:s}=this;ie(s)===t&&(e.preventDefault(),this.setValue([],!0))}onBackspaceKeyDown(e){if(!this.isTypingInputAtPillBoundary())return;const t=this.getValue(),s=Array.isArray(t)?t:t!=null?[t]:Array.from(this.listComponent?.getSelectedItems()??[]);s.length&&(e.preventDefault(),this.setValue(s.slice(0,-1),!0))}onTabKeyDown(){const{config:e,isPickerDisplayed:t,listComponent:s}=this,{multiSelect:i}=e;if(!(!t||!s)){if(i){const r=this.getValueFromSet(s.getSelectedItems());r&&this.setValue(r,!1,!0,!0)}else{const r=s.getLastItemHovered();r!==void 0&&this.setValue(r,!1,!0)}this.hidePicker()}}getValueFromSet(e){const{multiSelect:t}=this.config;if(!t)return e.size?e.values().next().value:null;const s=Array.from(e);return s.length?s:null}onListValueSelected(e,t){const s=this.getValueFromSet(e);this.setValue(s,!1,!0);const{multiSelect:i,allowTyping:r}=this.config;i&&r?(this.resetTypingMultiSelectSearchState(),this.hidePicker()):i||this.dispatchPickerEventAndHidePicker(s,t)}dispatchPickerEventAndHidePicker(e,t){const s={type:"fieldPickerValueSelected",fromEnterKey:t,value:e};this.dispatchLocalEvent(s),this.hidePicker()}getFocusableElement(){const{allowTyping:e}=this.config;return e?this.eInput.getFocusableElement():super.getFocusableElement()}handleHorizontalNavigationKey(e){const{allowTyping:t,multiSelect:s}=this.config;if(!t){e.preventDefault(),this.listComponent?.highlightIndex(-1),this.pillContainer?.onNavigationKeyDown(e);return}const i=this.pillContainer;if(!i||!s)return;const r=this.getActiveElementForKeyboardNavigation(),o=this.isPreviousHorizontalNavigation(e.key),n=this.eInput.getInputElement();if(r===n){o&&this.isTypingInputAtPillBoundary()&&(this.listComponent?.highlightIndex(-1),i.onNavigationKeyDown(e));return}if(i.getGui().contains(r)){this.listComponent?.highlightIndex(-1);const a=r;i.onNavigationKeyDown(e),!o&&this.getActiveElementForKeyboardNavigation()===a&&this.focusTypingInputAtBoundary()}}handlePageNavigationKey(e,t){const{allowTyping:s}=this.config;if(s&&(t===b.PAGE_HOME||t===b.PAGE_END)){e.preventDefault();const i=this.eInput.getInputElement(),r=t===b.PAGE_HOME?0:i.value.length;i.setSelectionRange(r,r);return}e.preventDefault(),this.pickerComponent&&this.listComponent?.navigateToPage(t)}handleVerticalNavigationKey(e,t,s){s||this.onNavigationKeyDown(e,t,()=>{this.config.multiSelect&&(this.doWhileBlockingAnnouncement(()=>this.eWrapper.focus()),this.announceAriaValue(this.ariaToggleSelection))})}handleEscapeKey(e){this.isPickerDisplayed&&(Ne(this.listComponent.getGui())&&(e.preventDefault(),Ee(e)),this.hidePicker())}handleEnterKey(e,t){if(t){e.preventDefault();return}this.onEnterKeyDown(e)}handleSpaceKey(e,t){const{allowTyping:s,multiSelect:i}=this.config,{isPickerDisplayed:r,listComponent:o}=this,n=!t&&r&&i&&!!o&&(!s||(this.eInput.getValue()??"")==="");if((!s||t||n)&&e.preventDefault(),n&&o){const a=o.getLastItemHovered();a!==void 0&&o.toggleListItemSelection(a)}}handleBackspaceKey(e,t){!t&&this.config.allowTyping&&this.config.multiSelect&&this.onBackspaceKeyDown(e)}handleDeleteKey(e){this.config.multiSelect&&!this.config.suppressDeselectAll&&this.onDeleteKeyDown(e)}handleSearchWithoutTyping(e){this.config.allowTyping||this.buildSearchStringFromKeyboardEvent(e)}onKeyDown(e){const{key:t,isComposing:s}=e;switch(t){case b.LEFT:case b.RIGHT:this.handleHorizontalNavigationKey(e);break;case b.PAGE_HOME:case b.PAGE_END:case b.PAGE_UP:case b.PAGE_DOWN:this.handlePageNavigationKey(e,t);break;case b.DOWN:case b.UP:this.handleVerticalNavigationKey(e,t,s);break;case b.ESCAPE:this.handleEscapeKey(e);break;case b.ENTER:this.handleEnterKey(e,s);break;case b.SPACE:this.handleSpaceKey(e,s);break;case b.BACKSPACE:this.handleBackspaceKey(e,s);break;case b.TAB:this.onTabKeyDown();break;case b.DELETE:this.handleDeleteKey(e);break;default:this.handleSearchWithoutTyping(e)}}announceAriaValue(e){this.ariaAnnounce?.announceValue(e,"richSelect")}destroy(){this.asyncRequests?.destroy(),this.asyncRequests=void 0,this.hasPagedAsyncSource=!1,this.listComponent&&(this.listComponent=this.destroyBean(this.listComponent)),this.searchStrings=void 0,super.destroy()}};function Ny(e,t){e.then(s=>{const i=s.getGui();i!=null&&t.appendChild(i)})}function Rp(e){return t=>e?.(t)??String(t??"")}var e8={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"ag-input-text-field",ref:"eInput",cls:"ag-rich-select-field-input"},{tag:"span",ref:"eDeselect",cls:"ag-rich-select-deselect-button ag-picker-field-icon",role:"presentation"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},Hy=class extends Jc{constructor(e){super({...e,template:e8,agComponents:[Vt]}),this.params=e}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();const{wrapperClassName:e,ariaLabel:t}=this.params;V(this.eDisplayField,!1),e&&this.eWrapper.classList.add(e),Cs(this.eWrapper,""),de(this.eWrapper,t)}onEnterKeyDown(e){Ee(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}},zy=class extends E{constructor(e,t,s){super(),this.eGui=e,this.focusWrapper=t,this.eFocusableComp=s}postConstruct(){this.addManagedElementListeners(this.eGui,{keydown:t=>{switch(t.key){case b.TAB:t.defaultPrevented||Ee(t);break;case b.UP:case b.DOWN:Ee(t);break;case b.ESCAPE:if(Gt(t))return;this.eGui.contains(ie(this.beans))&&(t.preventDefault(),Ee(t),this.focusWrapper.focus());break}}});const e="ag-advanced-filter-builder-virtual-list-item-highlight";this.addManagedListeners(this.focusWrapper,{keydown:t=>{if(t.key===b.ENTER){if(Gt(t))return;ie(this.beans)===this.focusWrapper&&(t.preventDefault(),Ee(t),this.eFocusableComp.getFocusableElement().focus())}},focusin:()=>{this.focusWrapper.classList.add(e)},focusout:t=>{this.focusWrapper.contains(t.relatedTarget)||this.focusWrapper.classList.remove(e)}})}};function _y(e,t){return{pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderAddField",pickerAriaLabelValue:"Advanced Filter Builder Add Field",pickerType:"ag-list",valueList:[{key:"condition",displayValue:e("advancedFilterBuilderAddCondition")},{key:"join",displayValue:e("advancedFilterBuilderAddJoin")}],valueFormatter:s=>s==null?"":s.displayValue??s.key,pickerIcon:"advancedFilterBuilderAdd",maxPickerWidth:`${t??120}px`,wrapperClassName:"ag-advanced-filter-builder-item-button",ariaLabel:e("advancedFilterBuilderAddButtonTooltip")}}var t8={tag:"div",cls:"ag-advanced-filter-builder-item-wrapper",role:"presentation",children:[{tag:"div",ref:"eItem",cls:"ag-advanced-filter-builder-item",role:"presentation",children:[{tag:"div",cls:"ag-advanced-filter-builder-item-tree-lines",attrs:{"aria-hidden":"true"},children:[{tag:"div",cls:"ag-advanced-filter-builder-item-tree-line ag-advanced-filter-builder-item-tree-line-vertical-top ag-advanced-filter-builder-item-tree-line-horizontal"}]}]}]},s8=class extends A{constructor(e,t){super(t8),this.item=e,this.focusWrapper=t,this.eItem=x}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc,this.registry=e.registry}postConstruct(){on(this.focusWrapper,2);const e=_y(s=>this.advFilterExpSvc.translate(s),this.gos.get("advancedFilterBuilderParams")?.addSelectWidth),t=this.createManagedBean(new Hy(e));this.addManagedListeners(t,{fieldPickerValueSelected:({value:s})=>{this.dispatchLocalEvent({type:"advancedFilterBuilderAdded",item:this.item,isJoin:s.key==="join"})}}),this.eItem.appendChild(t.getGui()),this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>t.getGui(),getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip")})),this.createManagedBean(new zy(this.getGui(),this.focusWrapper,t)),de(this.focusWrapper,this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItem",[this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip"),`${this.item.level+1}`]))}afterAdd(){}},i8=class extends A{constructor(){super({tag:"div",cls:"ag-advanced-filter-builder-item-condition",role:"presentation"}),this.validationMessage=null}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc}init(e){const{item:t,createPill:s}=e;this.item=t,this.createPill=s,this.filterModel=t.filterModel,this.setupColumnCondition(this.filterModel),this.validate(),this.addDestroyFunc(()=>this.destroyBeans([this.eColumnPill,this.eOperatorPill,this.eOperandPill]))}getDragName(){return this.filterModel.colId?this.advFilterExpSvc.parseColumnFilterModel(this.filterModel):this.getDefaultColumnDisplayValue()}getAriaLabel(){return`${this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderFilterItem")} ${this.getDragName()}`}getValidationMessage(){return this.validationMessage}getFocusableElement(){return this.eColumnPill.getFocusableElement()}setupColumnCondition(e){const t=this.advFilterExpSvc.getColumnDetails(e.colId);this.baseCellDataType=t.baseCellDataType,this.column=t.column,this.numOperands=this.getNumOperands(this.getOperatorKey()),this.eColumnPill=this.createPill({key:this.getColumnKey(),displayValue:this.getColumnDisplayValue()??this.getDefaultColumnDisplayValue(),cssClass:"ag-advanced-filter-builder-column-pill",isSelect:!0,getEditorParams:()=>({values:this.advFilterExpSvc.getColumnAutocompleteEntries()}),update:s=>this.setColumnKey(s),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderColumnSelectField",pickerAriaLabelValue:"Advanced Filter Builder Column Select Field",ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderColumn")}),this.getGui().appendChild(this.eColumnPill.getGui()),D(this.getColumnKey())&&(this.createOperatorPill(),this.hasOperand()&&this.createOperandPill())}createOperatorPill(){this.eOperatorPill=this.createPill({key:this.getOperatorKey(),displayValue:this.getOperatorDisplayValue()??this.getDefaultOptionSelectValue(),cssClass:"ag-advanced-filter-builder-option-pill",isSelect:!0,getEditorParams:()=>({values:this.getOperatorAutocompleteEntries()}),update:e=>this.setOperatorKey(e),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderOptionSelectField",pickerAriaLabelValue:"Advanced Filter Builder Option Select Field",ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderOption")}),this.eColumnPill.getGui().insertAdjacentElement("afterend",this.eOperatorPill.getGui())}createOperandPill(){const{filter:e}=this.filterModel,t=(typeof e=="number"||typeof e=="bigint"?Xe(e):e)??"";this.eOperandPill=this.createPill({key:t,valueFormatter:s=>this.advFilterExpSvc.getOperandDisplayValue({...this.filterModel,filter:s},!0),baseCellDataType:this.baseCellDataType,cssClass:"ag-advanced-filter-builder-value-pill",isSelect:!1,update:s=>this.setOperand(s),ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderValue")}),this.getGui().appendChild(this.eOperandPill.getGui())}getColumnKey(){return this.filterModel.colId}getColumnDisplayValue(){return this.advFilterExpSvc.getColumnDisplayValue(this.filterModel)}getOperatorKey(){return this.filterModel.type}getOperatorDisplayValue(){return this.advFilterExpSvc.getOperatorDisplayValue(this.filterModel)}getOperandDisplayValue(){return this.advFilterExpSvc.getOperandDisplayValue(this.filterModel,!0)}hasOperand(){return this.numOperands>0}getOperatorAutocompleteEntries(){return this.column?this.advFilterExpSvc.getOperatorAutocompleteEntries(this.column,this.baseCellDataType):[]}setColumnKey(e){this.eOperatorPill||this.createOperatorPill();const t=this.advFilterExpSvc.getColumnDetails(e);this.column=t.column;const s=t.baseCellDataType;this.baseCellDataType!==s&&(this.baseCellDataType=s,this.setOperatorKey(void 0),this.eOperatorPill&&(ue(this.eOperatorPill.getGui()),this.destroyBean(this.eOperatorPill),this.createOperatorPill()),this.validate()),this.filterModel.colId=e,this.filterModel.filterType=this.baseCellDataType}setOperatorKey(e){const t=this.getNumOperands(e);t!==this.numOperands&&(this.numOperands=t,t===0?this.destroyOperandPill():(this.createOperandPill(),this.baseCellDataType!=="number"&&this.setOperand(""))),this.filterModel.type=e,this.validate()}setOperand(e){let t=e;this.baseCellDataType==="number"&&(t=D(e)?Number(e):""),this.filterModel.filter=t,this.validate()}getNumOperands(e){return this.advFilterExpSvc.getExpressionOperator(this.baseCellDataType,e)?.numOperands??0}destroyOperandPill(){delete this.filterModel.filter,this.eOperandPill?.getGui().remove(),this.destroyBean(this.eOperandPill),this.eOperandPill=void 0}validate(){let e=null;D(this.getColumnKey())?D(this.getOperatorKey())?this.numOperands>0&&!D(this.getOperandDisplayValue())&&(e=this.advFilterExpSvc.translate("advancedFilterBuilderValidationEnterValue")):e=this.advFilterExpSvc.translate("advancedFilterBuilderValidationSelectOption"):e=this.advFilterExpSvc.translate("advancedFilterBuilderValidationSelectColumn"),this.item.valid=!e,e!==this.validationMessage&&(this.validationMessage=e,this.dispatchLocalEvent({type:"advancedFilterBuilderValidChanged"}))}getDefaultColumnDisplayValue(){return this.advFilterExpSvc.translate("advancedFilterBuilderSelectColumn")}getDefaultOptionSelectValue(){return this.advFilterExpSvc.translate("advancedFilterBuilderSelectOption")}},r8={number:[aa],bigint:[ct],boolean:[ct],object:[ct],text:[ct],date:[Po],dateString:[Po],dateTime:[Po,e=>e.setIncludeTime(!0)],dateTimeString:[Po,e=>e.setIncludeTime(!0)]},o8={tag:"div",cls:"ag-advanced-filter-builder-pill-wrapper",role:"presentation",children:[{tag:"div",ref:"ePill",cls:"ag-advanced-filter-builder-pill",role:"button",children:[{tag:"span",ref:"eLabel",cls:"ag-advanced-filter-builder-pill-display"}]}]},n8=class extends A{constructor(e){super(o8),this.params=e,this.ePill=x,this.eLabel=x;const{value:t,valueFormatter:s}=e;this.value=t,this.displayValue=s(t)}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc}postConstruct(){const{cssClass:e,ariaLabel:t}=this.params;this.ePill.classList.add(e),this.activateTabIndex([this.ePill]),this.eLabel.id=`${this.getCompId()}`,rn(this.ePill,this.eLabel.id),de(this.ePill,t),this.renderValue(),this.addManagedListeners(this.ePill,{click:s=>{s.preventDefault(),this.showEditor()},keydown:s=>{s.key===b.ENTER&&(s.preventDefault(),Ee(s),this.showEditor())}}),this.addDestroyFunc(()=>this.destroyBean(this.eEditor))}getFocusableElement(){return this.ePill}showEditor(){if(this.eEditor)return;V(this.ePill,!1),this.eEditor=this.createEditorComp(this.params.type),this.eEditor.setValue(this.value);const e=this.eEditor.getGui();this.eEditor.addManagedElementListeners(e,{keydown:t=>{switch(t.key){case b.ENTER:t.preventDefault(),Ee(t),this.updateValue(!0);break;case b.ESCAPE:t.preventDefault(),Ee(t),this.hideEditor(!0);break}},focusout:()=>this.updateValue(!1)}),this.getGui().appendChild(e),this.eEditor.getFocusableElement().focus()}createEditorComp(e){const[t,s]=r8[e],i=this.createBean(new t);return s?.(i),i}hideEditor(e){const{eEditor:t}=this;t&&(this.eEditor=void 0,t.getGui().remove(),this.destroyBean(t),V(this.ePill,!0),e&&this.ePill.focus())}renderValue(){let e;const{displayValue:t,eLabel:s,params:i}=this,{type:r}=i,{classList:o}=s;o.remove("ag-advanced-filter-builder-value-empty","ag-advanced-filter-builder-value-number","ag-advanced-filter-builder-value-text"),D(t)?r==="number"||r==="bigint"?(e=t,o.add("ag-advanced-filter-builder-value-number")):(e=`"${t}"`,o.add("ag-advanced-filter-builder-value-text")):(e=this.advFilterExpSvc.translate("advancedFilterBuilderEnterValue"),o.add("ag-advanced-filter-builder-value-empty")),s.textContent=e}updateValue(e){if(!this.eEditor)return;const t=this.eEditor.getValue()??"";this.dispatchLocalEvent({type:"fieldValueChanged",value:t}),this.value=t,this.displayValue=this.params.valueFormatter(t),this.renderValue(),this.hideEditor(e)}},a8=class extends A{wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc}constructor(){super({tag:"div",cls:"ag-advanced-filter-builder-item-condition",role:"presentation"})}init(e){const{item:t,createPill:s}=e,i=t.filterModel;this.filterModel=i,this.ePill=s({key:i.type,displayValue:this.advFilterExpSvc.parseJoinOperator(i),cssClass:"ag-advanced-filter-builder-join-pill",isSelect:!0,getEditorParams:()=>({values:this.advFilterExpSvc.getJoinOperatorAutocompleteEntries()}),update:r=>i.type=r,pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderJoinSelectField",pickerAriaLabelValue:"Advanced Filter Builder Join Operator Select Field",ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderJoinOperator")}),this.getGui().appendChild(this.ePill.getGui()),this.addDestroyFunc(()=>this.destroyBean(this.ePill))}getDragName(){return this.advFilterExpSvc.parseJoinOperator(this.filterModel)}getAriaLabel(){return`${this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderGroupItem")} ${this.getDragName()}`}getValidationMessage(){return null}getFocusableElement(){return this.ePill.getFocusableElement()}},l8={tag:"div",cls:"ag-picker-field ag-advanced-filter-builder-pill-wrapper",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-advanced-filter-builder-pill ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display ag-advanced-filter-builder-pill-display"},{tag:"ag-input-text-field",ref:"eInput",cls:"ag-rich-select-field-input"},{tag:"span",ref:"eDeselect",cls:"ag-rich-select-deselect-button ag-picker-field-icon",role:"presentation"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},c8=class extends Jc{constructor(e){super({...e,template:l8,agComponents:[Vt]}),this.params=e}getFocusableElement(){return this.eWrapper}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();const{wrapperClassName:e,ariaLabel:t}=this.params;this.eWrapper.classList.add(e),Cs(this.eWrapper,""),de(this.eWrapper,t)}createPickerComponent(){if(!this.values){const{values:e}=this.params.getEditorParams();this.values=e;const t=this.value.key,s=e.find(i=>i.key===t)??{key:t,displayValue:this.value.displayValue};this.value=s}return super.createPickerComponent()}onEnterKeyDown(e){Ee(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}},d8={tag:"div",cls:"ag-advanced-filter-builder-item-wrapper",role:"presentation",children:[{tag:"div",cls:"ag-advanced-filter-builder-item",role:"presentation",children:[{tag:"div",ref:"eTreeLines",cls:"ag-advanced-filter-builder-item-tree-lines",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eValidation",cls:"ag-advanced-filter-builder-item-button ag-advanced-filter-builder-invalid",attrs:{"aria-hidden":"true"}}]},{tag:"div",ref:"eButtons",cls:"ag-advanced-filter-builder-item-buttons",children:[{tag:"span",ref:"eMoveUpButton",cls:"ag-advanced-filter-builder-item-button",role:"button"},{tag:"span",ref:"eMoveDownButton",cls:"ag-advanced-filter-builder-item-button",role:"button"},{tag:"div",ref:"eAddButton",role:"presentation"},{tag:"span",ref:"eRemoveButton",cls:"ag-advanced-filter-builder-item-button",role:"button"}]}]},Fp=class extends Pr{constructor(e,t,s){super(d8),this.item=e,this.dragFeature=t,this.focusWrapper=s,this.eTreeLines=x,this.eDragHandle=x,this.eButtons=x,this.eValidation=x,this.eMoveUpButton=x,this.eMoveDownButton=x,this.eAddButton=x,this.eRemoveButton=x,this.moveUpDisabled=!1,this.moveDownDisabled=!1}wireBeans(e){this.dragAndDrop=e.dragAndDrop,this.advFilterExpSvc=e.advFilterExpSvc,this.registry=e.registry}postConstruct(){const{filterModel:e,level:t,showMove:s}=this.item,i=e.filterType==="join";if(this.ePillWrapper=this.createManagedBean(i?new a8:new i8),this.ePillWrapper.init({item:this.item,createPill:r=>this.createPill(r)}),this.eDragHandle.insertAdjacentElement("afterend",this.ePillWrapper.getGui()),t===0){const r=re({tag:"div",cls:"ag-advanced-filter-builder-item-tree-line ag-advanced-filter-builder-item-tree-line-vertical-bottom ag-advanced-filter-builder-item-tree-line-root"});this.eTreeLines.appendChild(r),V(this.eDragHandle,!1),V(this.eButtons,!1),ot(this.focusWrapper,!0)}else this.setupTreeLines(t),this.eDragHandle.appendChild(_("advancedFilterBuilderDrag",this.beans)),this.setupValidation(),this.setupMoveButtons(s),this.setupAddButton(),this.setupRemoveButton(),this.setupDragging(),this.updateAriaExpanded();on(this.focusWrapper,t+1),this.initialiseTabGuard({}),this.createManagedBean(new zy(this.getGui(),this.focusWrapper,this.ePillWrapper)),this.updateAriaLabel(),this.addManagedListeners(this.ePillWrapper,{advancedFilterBuilderValueChanged:()=>this.dispatchLocalEvent({type:"advancedFilterBuilderValueChanged"}),advancedFilterBuilderValidChanged:()=>this.updateValidity()})}setState(e){const{level:t}=this.item;if(t===0)return;const{showMove:s}=this.item,{disableMoveUp:i,disableMoveDown:r,treeLines:o,showStartTreeLine:n}=e;this.updateTreeLines(o,n),this.updateAriaExpanded(),s&&(this.moveUpDisabled=!!i,this.moveDownDisabled=!!r,this.eMoveUpButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",i),this.eMoveDownButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",r),nn(this.eMoveUpButton,!!i),nn(this.eMoveDownButton,!!r),this.moveUpTooltipFeature?.refreshTooltip(),this.moveDownTooltipFeature?.refreshTooltip())}focusMoveButton(e){(e?this.eMoveUpButton:this.eMoveDownButton).focus()}afterAdd(){this.ePillWrapper.getFocusableElement().focus()}setupTreeLines(e){for(let t=0;tthis.eValidation,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.ePillWrapper.getValidationMessage(),getTooltipShowDelayOverride:()=>1e3})),this.updateValidity()}setupAddButton(){const e=_y(s=>this.advFilterExpSvc.translate(s),this.gos.get("advancedFilterBuilderParams")?.addSelectWidth),t=this.createManagedBean(new Hy(e));this.addManagedListeners(t,{fieldPickerValueSelected:({value:s})=>this.dispatchLocalEvent({type:"advancedFilterBuilderAdded",item:this.item,isJoin:s.key==="join"})}),this.eAddButton.appendChild(t.getGui()),this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eAddButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip")}))}setupRemoveButton(){this.eRemoveButton.appendChild(_("advancedFilterBuilderRemove",this.beans)),this.addManagedListeners(this.eRemoveButton,{click:()=>this.removeItem(),keydown:e=>{e.key===b.ENTER&&(e.preventDefault(),Ee(e),this.removeItem())}}),this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eRemoveButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advFilterExpSvc.translate("advancedFilterBuilderRemoveButtonTooltip")})),de(this.eRemoveButton,this.advFilterExpSvc.translate("advancedFilterBuilderRemoveButtonTooltip")),this.activateTabIndex([this.eRemoveButton])}setupMoveButtons(e){e?(this.eMoveUpButton.appendChild(_("advancedFilterBuilderMoveUp",this.beans)),this.addManagedListeners(this.eMoveUpButton,{click:()=>this.moveItem(!0),keydown:t=>{t.key===b.ENTER&&(t.preventDefault(),Ee(t),this.moveItem(!0))}}),this.moveUpTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eMoveUpButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveUpDisabled?null:this.advFilterExpSvc.translate("advancedFilterBuilderMoveUpButtonTooltip")})),de(this.eMoveUpButton,this.advFilterExpSvc.translate("advancedFilterBuilderMoveUpButtonTooltip")),this.eMoveDownButton.appendChild(_("advancedFilterBuilderMoveDown",this.beans)),this.addManagedListeners(this.eMoveDownButton,{click:()=>this.moveItem(!1),keydown:t=>{t.key===b.ENTER&&(t.preventDefault(),Ee(t),this.moveItem(!1))}}),this.moveDownTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eMoveDownButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveDownDisabled?null:this.advFilterExpSvc.translate("advancedFilterBuilderMoveDownButtonTooltip")})),de(this.eMoveDownButton,this.advFilterExpSvc.translate("advancedFilterBuilderMoveDownButtonTooltip")),this.activateTabIndex([this.eMoveUpButton,this.eMoveDownButton])):(V(this.eMoveUpButton,!1),V(this.eMoveDownButton,!1))}updateValidity(){zd(this.eValidation,!this.item.valid),this.validationTooltipFeature?.refreshTooltip(),this.updateAriaLabel()}createPill(e){const{key:t,cssClass:s,update:i,ariaLabel:r}=e,o=n=>{n!=null&&(i(n),this.dispatchLocalEvent({type:"advancedFilterBuilderValueChanged"}))};if(e.isSelect){const{getEditorParams:n,pickerAriaLabelKey:a,pickerAriaLabelValue:l,displayValue:c}=e,d=this.gos.get("advancedFilterBuilderParams"),u=`${d?.pillSelectMinWidth??140}px`,h=`${d?.pillSelectMaxWidth??200}px`,g=this.createBean(new c8({pickerAriaLabelKey:a,pickerAriaLabelValue:l,pickerType:"ag-list",value:{key:t,displayValue:c},valueFormatter:p=>p==null?"":p.displayValue??p.key,variableWidth:!0,minPickerWidth:u,maxPickerWidth:h,getEditorParams:n,wrapperClassName:s,ariaLabel:r,pickerIcon:"advancedFilterBuilderSelectOpen"}));return this.addManagedListeners(g,{fieldPickerValueSelected:({value:p})=>o(p?.key)}),g}else{const{baseCellDataType:n,valueFormatter:a}=e,l=this.createBean(new n8({value:t,valueFormatter:a,cssClass:s,type:n,ariaLabel:r}));return this.addManagedListeners(l,{fieldValueChanged:({value:c})=>o(c)}),l}}setupDragging(){const e={type:ns.AdvancedFilterBuilder,eElement:this.eDragHandle,dragItemName:()=>this.ePillWrapper.getDragName(),getDefaultIconName:()=>"notAllowed",getDragItem:()=>({}),onDragStarted:()=>this.dragFeature.dispatchLocalEvent({type:"advancedFilterBuilderDragStarted",item:this.item}),onDragStopped:()=>this.dragFeature.dispatchLocalEvent({type:"advancedFilterBuilderDragEnded"})};this.dragAndDrop.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDrop.removeDragSource(e))}updateAriaLabel(){const e=this.ePillWrapper.getAriaLabel(),t=`${this.item.level+1}`,s=this.ePillWrapper.getValidationMessage();let i;s?i=this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItemValidation",[e,t,s]):i=this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItem",[e,t]),de(this.focusWrapper,i)}updateAriaExpanded(){Bd(this.focusWrapper);const{filterModel:e}=this.item;e?.filterType==="join"&&e.conditions.length&&ot(this.focusWrapper,!0)}removeItem(){this.dispatchLocalEvent({type:"advancedFilterBuilderRemoved",item:this.item})}moveItem(e){this.dispatchLocalEvent({type:"advancedFilterBuilderMoved",item:this.item,backwards:e})}},u8={apply:"advancedFilterBuilderApply",clear:"advancedFilterBuilderClear",cancel:"advancedFilterBuilderCancel",reset:"advancedFilterBuilderReset"},h8={tag:"div",cls:"ag-advanced-filter-builder",role:"presentation",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eList",cls:"ag-advanced-filter-builder-list",role:"presentation"}]},g8=class extends A{constructor(){super(h8),this.eList=x}wireBeans(e){this.filterManager=e.filterManager,this.advancedFilter=e.advancedFilter,this.advFilterExpSvc=e.advFilterExpSvc}postConstruct(){const e=this.gos.get("advancedFilterBuilderParams");this.params={buttons:["apply","cancel"],...e},this.addManagedPropertyListener("advancedFilterBuilderParams",({currentValue:t})=>{this.params.showMoveButtons=!!t?.showMoveButtons,this.params.buttons=t?.buttons??["apply","cancel"],this.refreshList(!1)}),this.filterModel=this.setupFilterModel(),this.setupVirtualList(),this.dragFeature=this.createManagedBean(new N7(this,this.virtualList)),this.resetButtonsPanel(this.params.buttons)}refresh(){const e=this.virtualList;let t=e.getLastFocusedRow();this.setupFilterModel(),this.validateItems(),this.refreshList(!1),t!=null&&(e.getComponentAt(t)||(t=0),e.focusRow(t))}getNumItems(){return this.items.length}moveItem(e,t){!t||!e||this.moveItemToIndex(e,t.rowIndex,t.position)}afterGuiAttached(){this.virtualList.awaitStable(()=>this.virtualList.focusRow(0))}setupVirtualList(){const e=this.virtualList=this.createManagedBean(new Vo({cssIdentifier:"advanced-filter-builder",ariaRole:"tree",listName:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderList"),moveItemCallback:this.virtualListMoveItemCallback.bind(this)}));e.setComponentCreator(this.createItemComponent.bind(this)),e.setComponentUpdater(this.updateItemComponent.bind(this)),e.setRowHeight(40),this.eList.appendChild(e.getGui()),e.setModel({getRowCount:()=>this.items?.length||0,getRow:t=>this.items[t],areRowsEqual:(t,s)=>t===s}),this.buildList(),e.refresh()}resetButtonsPanel(e){const t=e&&e.length>0;let s=this.eButtons;if(t){const i=e.map(o=>({type:o,label:this.advFilterExpSvc.translate(u8[o])}));if(!s){s=this.createBean(new Mo),this.appendChild(s.getGui());const o=n=>({event:a})=>{this.updateModel(n),this.afterAction(n,a)};s.addManagedListeners(s,{apply:o("apply"),clear:o("clear"),reset:o("reset"),cancel:o("cancel")}),this.eButtons=s}s.updateButtons(i);const r=s.getApplyButton();if(r){const o=n=>this.toggleCss("ag-advanced-filter-builder-validation",n);this.addManagedElementListeners(r,{mouseenter:()=>o(!0),mouseleave:()=>o(!1)})}}else s&&(ue(s.getGui()),this.eButtons=this.destroyBean(s))}updateModel(e){switch(e){case"apply":this.advancedFilter.setModel(this.filterModel),this.filterManager?.onFilterChanged({source:"advancedFilter"});break;case"reset":this.advancedFilter.setModel(null),this.filterManager?.onFilterChanged({source:"advancedFilter"});break;case"cancel":break;case"clear":this.filterModel=this.formatFilterModel(null),this.refreshList(!1);break}}afterAction(e,t){switch(e){case"apply":{t?.preventDefault(),this.close();break}case"reset":{this.close();break}case"cancel":{this.close();break}}}removeItemFromParent(e){const t=e.parent.conditions.indexOf(e.filterModel);return e.parent.conditions.splice(t,1),t}moveItemToIndex(e,t,s){const i=this.items[t],r=i.filterModel?.filterType==="join"&&s==="bottom",o=r?i.filterModel:i.parent;if(!o||this.isChildOrSelf(o,e.filterModel)||i===e)return;this.removeItemFromParent(e);let n;r?n=0:(n=o.conditions.indexOf(i.filterModel),n===-1?n=o.conditions.length:s==="bottom"&&(n+=1)),o.conditions.splice(n,0,e.filterModel),this.refreshList(!1)}isChildOrSelf(e,t){return e===t||t.filterType==="join"&&t.conditions.some(s=>this.isChildOrSelf(e,s))}setupFilterModel(){const e=this.formatFilterModel(this.advancedFilter.getModel());return this.stringifiedModel=JSON.stringify(e),e}formatFilterModel(e){return e=e??{filterType:"join",type:"AND",conditions:[]},e.filterType!=="join"&&(e={filterType:"join",type:"AND",conditions:[e]}),e}buildList(){const e=(t,s,i,r)=>{if(s.push({filterModel:t,level:i,parent:r,valid:!0,showMove:this.params.showMoveButtons}),t.filterType==="join"){for(const o of t.conditions)e(o,s,i+1,t);i===0&&s.push({filterModel:null,level:i+1,parent:t,valid:!0})}};this.items=[],e(this.filterModel,this.items,0)}refreshList(e){if(!e){const t=[];for(const s of this.items)s.valid||t.push(s.filterModel);if(this.buildList(),t.length)for(const s of this.items)s.filterModel&&t.includes(s.filterModel)&&(s.valid=!1)}this.virtualList.refresh(e),this.validate()}updateItemComponent(e,t){const s=this.items.indexOf(e),i=(a,l)=>{const d=this.items.find(u=>u.filterModel===a)?.parent;if(d){const{conditions:u}=d;i(d,l),l.push(u[u.length-1]===a)}},r=[],{filterModel:o}=e;o&&(i(o,r),r[0]=!1);const n=o?.filterType==="join"&&!!o.conditions.length;t.setState({disableMoveUp:s===1,disableMoveDown:!this.canMoveDown(e,s),treeLines:r,showStartTreeLine:n})}createItemComponent(e,t){const s=this.createBean(e.filterModel?new Fp(e,this.dragFeature,t):new s8(e,t));return s.addManagedListeners(s,{advancedFilterBuilderRemoved:({item:i})=>this.removeItem(i),advancedFilterBuilderValueChanged:()=>this.validate(),advancedFilterBuilderAdded:({item:i,isJoin:r})=>this.addItem(i,r),advancedFilterBuilderMoved:({item:i,backwards:r})=>this.moveItemUpDown(i,r)}),s instanceof Fp&&this.updateItemComponent(e,s),s}addItem(e,t){const{parent:s,level:i,filterModel:r}=e,o=r?.filterType==="join",n=t?{filterType:"join",type:"AND",conditions:[]}:{},a=o?r:s;let l=o?0:a.conditions.indexOf(r);l>=0?(o||(l+=1),a.conditions.splice(l,0,n)):a.conditions.push(n);let c=this.items.indexOf(e);const d=c>=0;if(d){e.filterModel&&c++;const u=[{filterModel:n,level:o?i+1:i,parent:a,valid:t,showMove:this.params.showMoveButtons}];this.items.splice(c,0,...u)}this.refreshList(d),d&&this.virtualList.getComponentAt(c)?.afterAdd()}removeItem(e){const t=e.parent,{filterModel:s}=e,i=t.conditions.indexOf(s);t.conditions.splice(i,1);const r=e.filterModel?.filterType==="join",o=this.items.indexOf(e),n=!r&&o>=0;n&&this.items.splice(o,1),this.refreshList(n),o>=0&&this.virtualList.focusRow(o)}moveItemUpDown(e,t,s){const i=this.items.indexOf(e),r=t?i-1:i+1;if(r===0||!t&&!this.canMoveDown(e,i))return;const o=this.items[r],n=this.removeItemFromParent(e),{level:a,filterModel:l,parent:c}=e,{level:d,filterModel:u,parent:h}=o;if(t)if(d===a&&u.filterType==="join")u.conditions.push(l);else if(d<=a){const f=h.conditions.indexOf(u);h.conditions.splice(f,0,l)}else c.conditions[n-1].conditions.push(l);else if(d===a)if(u.filterType==="join")u.conditions.splice(0,0,l);else{const f=h.conditions.indexOf(u);h.conditions.splice(f+1,0,l)}else if(nC.filterModel===c),m=f.parent.conditions.indexOf(f.filterModel)+1;f.parent.conditions.splice(m,0,l)}this.refreshList(!1);const g=this.items.findIndex(({filterModel:f})=>f===l);if(g<0)return;const p=this.virtualList.getComponentAt(g);p instanceof Fp&&(s||p.focusMoveButton(t))}virtualListMoveItemCallback(e,t){const s=e.item,i=this.items.indexOf(s);i<=0||i===this.items.length-1||t&&i===1||!t&&!this.canMoveDown(s,i)||(this.moveItemUpDown(s,t,!0),this.virtualList.focusRow(i+(t?-1:1)))}canMoveDown(e,t){return!(e.level===1&&t===this.items.length-2||e.level===1&&e.parent.conditions[e.parent.conditions.length-1]===e.filterModel)}close(){this.advancedFilter.getCtrl().toggleFilterBuilder({source:"ui"})}validate(){let e=this.items.every(({valid:s})=>s),t=null;e?(e=JSON.stringify(this.filterModel)!==this.stringifiedModel,e||(t=this.advFilterExpSvc.translate("advancedFilterBuilderValidationAlreadyApplied"))):t=this.advFilterExpSvc.translate("advancedFilterBuilderValidationIncomplete"),this.eButtons?.updateValidity(e,t)}validateItems(){const e=s=>{s.type=void 0},t=s=>{delete s.filter};for(const s of this.items){if(!s.valid||!s.filterModel||s.filterModel.filterType==="join")continue;const{filterModel:i}=s,{colId:r}=i,o=this.advFilterExpSvc.getColumnAutocompleteEntries().find(({key:c})=>c===r),n=this.advFilterExpSvc.getColumnDetails(i.colId);if(!o||!n.column){s.valid=!1,i.colId=void 0,e(i),t(i);continue}const l=this.advFilterExpSvc.getDataTypeExpressionOperator(n.baseCellDataType).operators[i.type];if(!l){s.valid=!1,e(i),t(i);continue}l.numOperands>0&&!D(i.filter)&&(s.valid=!1)}}},p8=class extends E{constructor(e){super(),this.enabled=e}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.popupSvc=e.popupSvc,this.advFilterExpSvc=e.advFilterExpSvc,this.environment=e.environment}postConstruct(){this.hasAdvancedFilterParent=!!this.gos.get("advancedFilterParent"),this.ctrlsSvc.whenReady(this,()=>this.setAdvancedFilterComp()),this.addManagedEventListeners({advancedFilterEnabledChanged:({enabled:e})=>this.onEnabledChanged(e)}),this.addManagedPropertyListener("advancedFilterParent",()=>this.updateComps()),this.addManagedPropertyListener("advancedFilterBuilderParams",e=>{e.currentValue?.suppressFullScreenButton!==e.previousValue?.suppressFullScreenButton&&this.eBuilderDialog?.setMaximizable(e.currentValue?.suppressFullScreenButton??!0)}),this.addDestroyFunc(()=>{this.destroyAdvancedFilterComp(),this.destroyBean(this.eBuilderComp),this.eBuilderDialog?.isAlive()&&this.destroyBean(this.eBuilderDialog)})}setupHeaderComp(e){this.eHeaderComp&&(this.eHeaderComp?.getGui().remove(),this.destroyBean(this.eHeaderComp)),this.eHeaderComp=this.createManagedBean(new B7(this.enabled&&!this.hasAdvancedFilterParent)),e.insertAdjacentElement("beforebegin",this.eHeaderComp.getGui())}focusHeaderComp(){return this.eHeaderComp?(this.eHeaderComp.getFocusableElement().focus(),!0):!1}refreshComp(){this.eFilterComp?.refresh(),this.eHeaderComp?.refresh()}refreshBuilderComp(){this.eBuilderComp?.refresh()}getHeaderHeight(){return this.eHeaderComp?.getHeight()??0}setInputDisabled(e){this.eFilterComp?.setInputDisabled(e),this.eHeaderComp?.setInputDisabled(e)}toggleFilterBuilder(e){const{source:t,force:s,eventSource:i}=e;if(s&&this.eBuilderDialog||s===!1&&!this.eBuilderDialog)return;if(this.eBuilderDialog){this.builderDestroySource=t,this.destroyBean(this.eBuilderDialog);return}this.setInputDisabled(!0);const{width:r,height:o,minWidth:n}=this.getBuilderDialogSize(),{suppressFullScreenButton:a}={suppressFullScreenButton:!1,...this.gos.get("advancedFilterBuilderParams")};this.eBuilderComp=this.createBean(new g8),this.eBuilderDialog=this.createBean(new Xc({title:this.advFilterExpSvc.translate("advancedFilterBuilderTitle"),component:this.eBuilderComp,width:r,height:o,resizable:!0,movable:!0,maximizable:!a,centered:!0,closable:!0,minWidth:n,afterGuiAttached:()=>this.eBuilderComp?.afterGuiAttached(),postProcessPopupParams:{type:"advancedFilterBuilder",eventSource:i}})),this.dispatchFilterBuilderVisibleChangedEvent(t,!0),this.eBuilderDialog.addEventListener("destroyed",()=>{this.destroyBean(this.eBuilderComp),this.eBuilderComp=void 0,this.eBuilderDialog=void 0,this.setInputDisabled(!1),this.dispatchLocalEvent({type:"advancedFilterBuilderClosed"}),this.dispatchFilterBuilderVisibleChangedEvent(this.builderDestroySource??"ui",!1),this.builderDestroySource=void 0})}dispatchFilterBuilderVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:"advancedFilterBuilderVisibleChanged",source:e,visible:t})}getBuilderDialogSize(){const e=this.gos.get("advancedFilterBuilderParams")?.minWidth??500,t=this.popupSvc.getPopupParent(),s=Math.round(bi(t))-2,i=Math.round(hn(t)*.75)-2,r=Math.min(Math.max(700,e),s),o=Math.min(600,i);return{width:r,height:o,minWidth:e}}onEnabledChanged(e){this.enabled=e,this.updateComps()}updateComps(){this.setAdvancedFilterComp(),this.setHeaderCompEnabled(),this.eventSvc.dispatchEvent({type:"headerHeightChanged"})}setAdvancedFilterComp(){if(this.destroyAdvancedFilterComp(),!this.enabled)return;const e=this.gos.get("advancedFilterParent");if(this.hasAdvancedFilterParent=!!e,e){const t=this.createBean(new Ly),s=t.getGui();this.environment.applyThemeClasses(s),s.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),e.appendChild(s),this.eFilterComp=t}}setHeaderCompEnabled(){this.eHeaderComp?.setEnabled(this.enabled&&!this.hasAdvancedFilterParent)}destroyAdvancedFilterComp(){this.eFilterComp&&(ue(this.eFilterComp.getGui()),this.destroyBean(this.eFilterComp))}},f8=class{constructor(e){this.params=e,this.operators=[],this.operatorStartPositions=[],this.operatorEndPositions=[],this.activeOperator=0,this.validationError=null}parseExpression(e){this.operators.push(""),this.operatorStartPositions.push(e),this.operatorEndPositions.push(void 0);const{expression:t}=this.params;for(;er===this.parsedOperator)),this.params.advFilterExpSvc.generateAutocompleteListParams(i,"join",s)}updateExpression(e,t,s){let{expression:i}=this.params;const r=t.displayValue??t.key;if(s===0)for(let a=this.operatorEndPositions.length-1;a>0;a--){const l=this.operatorEndPositions[a];l!=null&&(i=Xi(i,this.operatorStartPositions[a],l,r).updatedValue)}const o=this.operatorStartPositions.length>s?this.operatorStartPositions[s]:e,n=(this.operatorEndPositions.length>s?this.operatorEndPositions[s]:void 0)??Cp(i,e,!0).endPosition;return Xi(i,o,n,r,!0)}getNumOperators(){return this.operators.length}getLastOperatorEndPosition(){return this.operatorEndPositions[this.operatorEndPositions.length-1]}parseOperator(e){const t=this.operators.length>this.activeOperator?this.operators[this.activeOperator]:"",s=this.params.advFilterExpSvc.getExpressionJoinOperators(),i=Yc(t,s,r=>r);if(i){this.operatorEndPositions[this.activeOperator]=e;const r=s[i];if(this.activeOperator){if(i!==this.parsedOperator)return this.validationError||(this.validationError={message:this.params.advFilterExpSvc.translate("advancedFilterValidationJoinOperatorMismatch"),startPosition:e-t.length+1,endPosition:e}),!1}else this.parsedOperator=i;return t!==r&&(vp(this.params,t,r,e),this.operators[this.activeOperator]=r),!0}else return i===null?!1:(this.validationError||(this.validationError={message:this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidJoinOperator"),startPosition:e-t.length+1,endPosition:e}),!0)}},m8=class $R{constructor(t,s){this.params=t,this.startPosition=s,this.expectingExpression=!0,this.expectingOperator=!1,this.expressionParsers=[],this.operatorParser=new f8(this.params),this.missingEndBracket=!1,this.extraEndBracket=!1}parseExpression(){let t=this.startPosition;const{expression:s}=this.params;for(;t0&&(this.missingEndBracket=!0),t}isValid(){return!this.missingEndBracket&&!this.extraEndBracket&&this.expressionParsers.length===this.operatorParser.getNumOperators()+1&&this.operatorParser.isValid()&&this.expressionParsers.every(t=>t.isValid())}getValidationError(){const t=this.operatorParser.getValidationError();for(let i=0;io.getFunction(t)),r=s==="&&"?"every":"some";return(o,n,a)=>i[r](l=>l(o,n,a))}getAutocompleteListParams(t){if(this.endPosition!=null&&t>this.endPosition+1)return;if(!this.expressionParsers.length)return this.getColumnAutocompleteListParams();const s=this.getExpressionParserIndex(t);if(s==null)return this.params.expression[t]==="("?{enabled:!1}:this.getColumnAutocompleteListParams();const r=this.expressionParsers[s].getAutocompleteListParams(t);if(!r){if(sthis.endPosition+1?null:this.operatorParser.updateExpression(t,s,o))}getModel(){return this.expressionParsers.length>1?{filterType:"join",type:this.operatorParser.getModel(),conditions:this.expressionParsers.map(t=>t.getModel())}:this.expressionParsers[0].getModel()}getColumnAutocompleteListParams(){return this.params.advFilterExpSvc.generateAutocompleteListParams(this.params.advFilterExpSvc.getColumnAutocompleteEntries(),"column","")}getExpressionParserIndex(t){let s;for(let i=0;it);i++)s=i;return s}},C8=class{constructor(e){this.params=e,this.valid=!1}parseExpression(){this.joinExpressionParser=new m8(this.params,0);const e=this.joinExpressionParser.parseExpression();return this.valid=e>=this.params.expression.length-1&&this.joinExpressionParser.isValid(),this.params.expression}isValid(){return this.valid}getValidationMessage(){const e=this.joinExpressionParser.getValidationError();if(!e)return null;const{message:t,startPosition:s,endPosition:i}=e;return s{const s=this.colModel.getColDefCol(e);return s?this.filterValueSvc.getValue(s,t):void 0}},this.addManagedPropertyListener("enableAdvancedFilter",e=>this.setEnabled(!!e.currentValue)),this.addManagedEventListeners({newColumnsLoaded:e=>this.onNewColumnsLoaded(e)}),this.addManagedPropertyListener("includeHiddenColumnsInAdvancedFilter",()=>{this.updateValidity()&&this.filterManager?.onFilterChanged({source:"advancedFilter"})})}isEnabled(){return this.enabled}isFilterPresent(){return!!this.expressionFunction}doesFilterPass(e){return this.expressionFunction(this.expressionProxy,e,this.expressionParams)}getModel(){const e=this.createExpressionParser(this.appliedExpression);return e?.parseExpression(),e?.getModel()??null}setModel(e){const t=(i,r)=>{if(i.filterType==="join"){const o=this.advFilterExpSvc.parseJoinOperator(i),n=i.conditions.map(a=>t(a)).filter(a=>D(a)).join(` ${o} `);return r||i.conditions.length<=1?n:`(${n})`}else return this.advFilterExpSvc.parseColumnFilterModel(i)},s=e?t(e,!0):null;this.setExpressionDisplayValue(s),this.applyExpression(),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp()}getExpressionDisplayValue(){return this.expression}setExpressionDisplayValue(e){this.expression=e}isCurrentExpressionApplied(){return this.appliedExpression===this.expression}createExpressionParser(e){return e?new C8({expression:e,colModel:this.colModel,dataTypeSvc:this.dataTypeSvc,valueSvc:this.valueSvc,advFilterExpSvc:this.advFilterExpSvc}):null}getDefaultExpression(e){const t=this.advFilterExpSvc.getColumnValue(e)+" ";return{updatedValue:t,updatedPosition:t.length}}isHeaderActive(){return!this.gos.get("advancedFilterParent")}getCtrl(){return this.ctrl}setEnabled(e,t){const s=this.enabled,i=ae(this.gos)||ft(this.gos);e&&!i&&F(123),this.enabled=e&&i,!t&&this.enabled!==s&&this.eventSvc.dispatchEvent({type:"advancedFilterEnabledChanged",enabled:this.enabled})}applyExpression(){const e=this.createExpressionParser(this.expression);e?.parseExpression(),this.applyExpressionFromParser(e)}getAppliedExpressionDisplayValue(){return this.appliedExpression}applyExpressionFromParser(e){if(this.isValid=!e||e.isValid(),!e||!this.isValid){this.expressionFunction=null,this.expressionParams=null,this.appliedExpression=null;return}const{expressionFunction:t,params:s}=e.getFunction();this.expressionFunction=t,this.expressionParams=s,this.appliedExpression=this.expression}updateValidity(){this.advFilterExpSvc.resetColumnCaches();const e=this.createExpressionParser(this.expression);e?.parseExpression();const s=(!e||e.isValid())!==this.isValid;return this.applyExpressionFromParser(e),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp(),s}onNewColumnsLoaded(e){if(e.source!=="gridInitializing"||!this.dataTypeSvc?.isPendingInference)return;this.ctrl.setInputDisabled(!0);const[t]=this.addManagedEventListeners({dataTypesInferred:()=>{t?.(),this.ctrl.setInputDisabled(!1)}})}},Wy={moduleName:"AdvancedFilter",version:Y,beans:[v8,T7],icons:{advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",advancedFilterBuilderSelectOpen:"small-down",richSelectRemove:"cancel",richSelectLoading:"loading"},apiFunctions:{getAdvancedFilterModel:v7,setAdvancedFilterModel:w7,showAdvancedFilterBuilder:b7,hideAdvancedFilterBuilder:S7},dependsOn:[le,ha,Oi,$s,Ic,mc],css:[C7]},Bo=class{constructor(e){this._defs={},this._nullable=!1,this.description=e}_collectNestedDefs(e){const t={...this._defs};for(const s of e)s&&typeof s=="object"&&"$defs"in s&&(Object.assign(t,s.$defs),delete s.$defs);return t}_toJSON(e={}){const t={type:this._nullable?[this.type,"null"]:this.type,description:this.description,...e};return Object.keys(this._defs).length>0&&(t.$defs=this._defs),t}nullable(){return this._nullable=!0,this}define(e,t){return this._defs[e]=t,this}},w8=class extends Bo{constructor(e){super(typeof e=="string"?e:e?.description),this.type="string",typeof e=="object"&&e&&(this._pattern=e.pattern,this._format=e.format)}pattern(e){return this._pattern=e,this}format(e){return this._format=e,this}toJSON(){return this._toJSON({pattern:this._pattern,format:this._format})}},b8=class extends Bo{constructor(e){super(typeof e=="string"?e:e?.description),this.type="number",typeof e=="object"&&e&&(this._minimum=e.minimum,this._maximum=e.maximum,this._exclusiveMinimum=e.exclusiveMinimum,this._exclusiveMaximum=e.exclusiveMaximum,this._multipleOf=e.multipleOf)}minimum(e){return this._minimum=e,this}exclusiveMinimum(e){return this._exclusiveMinimum=e,this}maximum(e){return this._maximum=e,this}exclusiveMaximum(e){return this._exclusiveMaximum=e,this}multipleOf(e){return this._multipleOf=e,this}toJSON(){return this._toJSON({minimum:this._minimum,exclusiveMinimum:this._exclusiveMinimum,maximum:this._maximum,exclusiveMaximum:this._exclusiveMaximum,multipleOf:this._multipleOf})}},Uy=class extends Bo{constructor(e,t){super(t),this._enum=e,this.type="string"}toJSON(){return this._toJSON({enum:this._enum})}},S8=class extends Uy{constructor(e,t){super([e],t)}},y8=class extends Bo{constructor(e){super(e),this.type="boolean"}toJSON(){return this._toJSON()}},x8=class extends Bo{constructor(e,t){super(typeof t=="string"?t:t?.description),this.items=e,this.type="array",typeof t=="object"&&t&&(this._minItems=t.minItems,this._maxItems=t.maxItems)}minItems(e){return this._minItems=e,this}maxItems(e){return this._maxItems=e,this}toJSON(){const e=this.items.toJSON(),t=this._collectNestedDefs([e]);return this._defs=t,this._toJSON({items:e,minItems:this._minItems,maxItems:this._maxItems})}},R8=class extends Bo{constructor(e,t){super(t),this.properties=e,this.type="object"}toJSON(){const e=Object.fromEntries(Object.keys(this.properties).map(s=>[s,this.properties[s].toJSON()])),t=this._collectNestedDefs(Object.values(e));return this._defs=t,this._toJSON({required:Object.keys(this.properties),additionalProperties:!1,properties:e})}},F8=class{constructor(e,t){this.schemas=e,this._nullable=!1,this._defs={},this.description=t}nullable(){return this._nullable=!0,this}define(e,t){return this._defs[e]=t,this}_collectNestedDefs(e){const t=this._defs;for(const s of e)s&&typeof s=="object"&&"$defs"in s&&(Object.assign(t,s.$defs),delete s.$defs);return t}toJSON(){const e=this.schemas.map(i=>i.toJSON()),t=this._collectNestedDefs(e),s={anyOf:this._nullable?[...e,{type:"null"}]:e};return this.description&&(s.description=this.description),Object.keys(t).length>0&&(s.$defs=t),s}},E8=class{constructor(e){this.id=e}nullable(){return this}toJSON(){return{$ref:`#/$defs/${this.id}`}}},G={string:e=>new w8(e),number:e=>new b8(e),enum:(e,t)=>new Uy(e,t),boolean:e=>new y8(e),array:(e,t)=>new x8(e,t),object:(e,t)=>new R8(e,t),union:(e,t)=>new F8(e,t),literal:(e,t)=>new S8(e,t),ref:e=>new E8(e)},P8=e=>{const{aggFuncSvc:t}=e;if(!t)return;const i=e.colModel.getCols().filter(r=>r.isAllowValue()&&t.getFuncNames(r).length>0);if(i.length!==0)return G.object({aggregationModel:G.array(G.union(i.map(r=>G.object({colId:G.literal(r.getColId(),"Column identifier"),aggFunc:G.enum(e.aggFuncSvc?.getFuncNames(r)||[],"Aggregation function")}))),"Array of column aggregations")},"Aggregation configuration for the grid").nullable()},M8=e=>{const s=e.colModel.getCols().filter(r=>r.isResizable());if(s.length===0)return;const i=s.map(r=>r.getColId());return G.object({columnSizingModel:G.array(G.union([G.object({colId:G.ref("resizableColumnId"),width:G.number("Fixed width in pixels").minimum(20)}),G.object({colId:G.ref("resizableColumnId"),flex:G.number("Flex sizing ratio").minimum(0)})]),"Array of column sizing configurations")},"Column sizing configuration for the grid").define("resizableColumnId",G.enum(i,"Column ID that supports resizing"))},T8=()=>G.object({hiddenColIds:G.array(G.ref("allColumnIds"),"Array of column IDs to hide")},"Column visibility configuration for the grid").nullable(),D8=({colModel:e,dataTypeSvc:t})=>{if(!t)return;const s=e.getCols(),i={boolean:[],object:[],date:[],dateString:[],dateTime:[],dateTimeString:[],number:[],bigint:[],text:[]};for(const n of s){const a=t.getBaseDataType(n);a&&i[a].push(n.colId)}const r=[],o={};for(const n of Object.keys(i))if(i[n].length>0){const a=`${n}AdvancedFilterModel`,l=H8[n];o[a]=l(i[n]),r.push({$ref:`#/$defs/${a}`})}return o.joinAdvancedFilterModel=G.object({filterType:G.literal("join","Filter type identifier for joining multiple advanced filter conditions"),type:G.enum(["AND","OR"],"Logical operator to combine multiple advanced filter conditions"),conditions:G.array(G.ref("advancedFilterModel"),"Array of advanced filter conditions to be combined")}),o.advancedFilterModel={anyOf:[...r,{$ref:"#/$defs/joinAdvancedFilterModel"}]},G.object({advancedFilterModel:G.ref("advancedFilterModel")},"Advanced filter configuration for the grid").nullable()},A8=e=>G.object({filterType:G.literal("boolean","Filter type identifier for boolean column filters"),colId:G.enum(e,"Column identifier for the boolean column to filter"),type:G.enum(["true","false"],"Boolean value to filter by")}),I8=e=>G.object({filterType:G.literal("object","Filter type identifier for object column filters"),colId:G.enum(e,"Column identifier for the object column to filter"),filter:G.string("Filter value to compare against object column values").nullable(),type:G.enum(["equals","notEqual","contains","notContains","startsWith","endsWith","blank","notBlank"],"Object filter operation type")}),k8=e=>G.object({filterType:G.literal("date","Filter type identifier for date column filters"),colId:G.enum(e,"Column identifier for the date column to filter"),filter:G.string({pattern:"^\\d{4}-\\d{2}-\\d{2}$",description:"Date value in YYYY-MM-DD format"}).nullable(),type:G.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"Date filter operation type")}),L8=e=>G.object({filterType:G.literal("date","Filter type identifier for date string column filters"),colId:G.enum(e,"Column identifier for the date string column to filter"),filter:G.string({pattern:"^\\d{4}-\\d{2}-\\d{2}$",description:"Date value in YYYY-MM-DD format"}).nullable(),type:G.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"Date string filter operation type")}),G8=e=>G.object({filterType:G.literal("dateTime","Filter type identifier for datetime column filters"),colId:G.enum(e,"Column identifier for the datetime column to filter"),filter:G.string({pattern:"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",description:"DateTime value in YYYY-MM-DDTHH:mm:ss format"}).nullable(),type:G.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"DateTime filter operation type")}),O8=e=>G.object({filterType:G.literal("dateTimeString","Filter type identifier for datetime string column filters"),colId:G.enum(e,"Column identifier for the datetime string column to filter"),filter:G.string({pattern:"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",description:"DateTime value in YYYY-MM-DD HH:mm:ss format"}).nullable(),type:G.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"DateTime string filter operation type")}),V8=e=>G.object({filterType:G.literal("number","Filter type identifier for number column filters"),colId:G.enum(e,"Column identifier for the number column to filter"),filter:G.number("Numeric value to filter by").nullable(),type:G.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"Number filter operation type")}),B8=e=>G.object({filterType:G.literal("bigint","Filter type identifier for bigint column filters"),colId:G.enum(e,"Column identifier for the bigint column to filter"),filter:G.string({pattern:"^-?\\d+$",description:"BigInt value to filter by"}).nullable(),type:G.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"BigInt filter operation type")}),N8=e=>G.object({filterType:G.literal("text","Filter type identifier for text column filters"),colId:G.enum(e,"Column identifier for the text column to filter"),filter:G.string("Text value to filter by").nullable(),type:G.enum(["equals","notEqual","contains","notContains","startsWith","endsWith","blank","notBlank"],"Text filter operation type")}),H8={boolean:A8,object:I8,date:k8,dateString:L8,dateTime:G8,dateTimeString:O8,number:V8,bigint:B8,text:N8},z8="agTextColumnFilter",$y="agNumberColumnFilter",Ky="agDateColumnFilter",_8="agSetColumnFilter",W8="agMultiColumnFilter",U8=[z8,$y,Ky],$8=(e,t)=>{const{advancedFilter:s}=e;return s?.isEnabled()?D8(e):K8(e,t)},K8=(e,t)=>{const{gos:s,colFilter:i,colModel:r}=e;if(!i)return;const n=r.getCols().filter(c=>c.isFilterAllowed());if(n.length===0)return;const a={},l=s.get("enableFilterHandlers");for(const c of n){const d=t?.columns?t.columns[c.getColId()]:void 0,u=c.getColDef(),h=i.getDefaultFilter(c),g=d?.includeSetValues??!1,p=jy(u.filter,u.filterParams,h,(f=!1,m=0)=>{if(!g)return[];let C;return f?l&&(C=i.getHandler(c,!0).getHandler(m)):C=i.getHandler(c,!0),C?C.getFilterKeys():[]});p&&(a[c.colId]=p.nullable())}return G.object({filterModel:G.object(a)}).nullable()};function jy(e,t,s,i){let r;if(typeof e=="string"?r=e:typeof e=="object"&&typeof e.component=="string"?r=e.component:(e===!0||typeof e=="object"&&e.component===!0)&&(r=s),!r)return null;if(U8.includes(r)){const o=t?.maxNumConditions,n=t?.filterOptions?t.filterOptions.map(l=>typeof l=="string"?l:typeof l=="object"&&l.displayKey?l.displayKey:null).filter(Boolean):void 0,a=t?.useIsoSeparator||!1;return j8(r,{maxConditions:o,filterOptions:n,useIsoSeparator:a})}else{if(r===_8)return Z8(i);if(r===W8)return Q8(t.filters,s,i)}return null}var j8=(e,t)=>e===Ky?X8(t):e===$y?Y8(t):q8(t),Ep=(e,t,s=2)=>s===1?e:G.object({filterType:G.literal(t,`Filter type identifier for ${t} filters with multiple conditions`),operator:G.enum(["AND","OR"],"Logical operator to combine multiple filter conditions. Must be included even with a single filter to adhere to the API."),conditions:G.array(e,"Array of filter conditions to be combined").minItems(2).maxItems(s)}),q8=e=>{const t=e.filterOptions??["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],s=G.object({filterType:G.literal("text","Filter type identifier for text filters"),type:G.enum(t,"Text filter operation type"),filter:G.string("Primary filter value").nullable(),filterTo:G.string("Secondary filter value for range operations").nullable()});return Ep(s,"text",e.maxConditions)},Y8=e=>{const t=e.filterOptions??["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"],s=G.object({filterType:G.literal("number","Filter type identifier for number filters"),type:G.enum(t,"Number filter operation type"),filter:G.number("Primary filter value").nullable(),filterTo:G.number("Secondary filter value for range operations").nullable()});return Ep(s,"number",e.maxConditions)},X8=e=>{const t=e.filterOptions??["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"],s=e.useIsoSeparator?"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",i=G.object({filterType:G.literal("date","Filter type identifier for date filters"),type:G.enum(t,"Date filter operation type"),dateFrom:G.string({pattern:s,description:"Primary date filter value in YYYY-MM-DD HH:mm:ss format"}).nullable(),dateTo:G.string({pattern:s,description:"Secondary date filter value for range operations in YYYY-MM-DD HH:mm:ss format"}).nullable()});return Ep(i,"date",e.maxConditions)},Z8=e=>{const t=e?e().filter(Boolean):[];return G.object({filterType:G.literal("set","Filter type identifier for set filters"),values:G.array(t.length>0?G.enum(t,"Available values to filter by"):G.string("Filter values"),"Array of values to include in the filter")})},Q8=(e,t,s=()=>[])=>G.object({filterType:G.literal("multi","Filter type identifier for multi-condition filters"),filterModels:G.array(G.union(e.map((i,r)=>jy(i.filter,i.filterParams,t,()=>s(!0,r))),"Union of different filter types that can be combined").nullable(),"Array of filter conditions to be combined with AND/OR logic")}),J8=e=>{const s=e.colModel.getCols().filter(i=>i.isAllowPivot()).map(i=>i.getColId());if(s.length!==0)return G.object({pivotMode:G.boolean("Whether pivot mode is enabled"),pivotColIds:G.array(G.enum(s,"Column ID that supports pivoting"),"Array of column IDs to use as pivot columns")},"Pivot configuration for the grid").nullable()},eH=e=>{const s=e.colModel.getCols().filter(r=>r.isAllowRowGroup());if(s.length===0)return;const i=s.map(r=>r.getColId());return G.object({groupColIds:G.array(G.enum(i,"Column ID that supports row grouping"),"Array of column IDs to group by")},"Row grouping configuration for the grid")},tH=e=>{const{sortSvc:t}=e;if(!t)return;const i=e.colModel.getCols().filter(o=>o.isSortable());if(i.length===0)return;const r=i.map(o=>o.getColId());return G.object({sortModel:G.array(G.object({colId:G.enum(r,"Column ID that supports sorting"),sort:G.enum(["asc","desc"],"Sort direction: ascending or descending"),type:G.enum(["default","absolute"],"Sort type: default or absolute values")}),"Array of sort configurations")},"Sort configuration for the grid").nullable()},sH={aggregation:P8,filter:$8,sort:tH,pivot:J8,columnVisibility:T8,columnSizing:M8,rowGroup:eH};function iH(e,t){const s=e.colModel.getCols().map(a=>a.getColId()),i={};for(const a of yC){if(t?.exclude?.includes(a))continue;const l=sH[a],c=l(e,t);c&&(i[a]=c.nullable())}const r=t?.columns??{},o=s.map(a=>r[a]?.description?`${a}: ${r[a].description}`:a).filter(Boolean).join(` `);return G.object(i).define("allColumnIds",G.enum(s,o)).toJSON()}var qy={moduleName:"AiToolkit",version:Y,beans:[],dependsOn:[le,ql],apiFunctions:{getStructuredSchema:iH}};function rH(e){return e.sideBar?.comp.isDisplayed()??!1}function oH(e,t){e.sideBar?.comp.setDisplayed(t)}function nH(e,t){e.sideBar?.comp.setSideBarPosition(t)}function aH(e,t,s){e.sideBar?.comp.openToolPanel(t,"api",s)}function lH(e){e.sideBar?.comp.close("api")}function cH(e){return e.sideBar?.comp.openedItem()??null}function dH(e){e.sideBar?.comp.refresh()}function uH(e){return e.sideBar?.comp.isToolPanelShowing()??!1}function hH(e,t){const s=e.sideBar?.comp.getToolPanelInstance(t);return Us(s)}function gH(e){return e.sideBar?.comp.getDef()}var pH=`.ag-tool-panel-wrapper{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-horizontal-size,var(--ag-side-bar-panel-width))}.ag-tool-panel-content{display:flex;height:100%;overflow:hidden auto}.ag-tool-panel-wrapper.ag-tool-panel-animating{ /* !important required to override .ag-hidden to tool panel remains visible while animating */display:block!important;transition:width var(--ag-side-bar-panel-animation-duration) ease-in-out}@media (prefers-reduced-motion:reduce){.ag-tool-panel-wrapper.ag-tool-panel-animating{transition:none}}.ag-tool-panel-external{display:flex;flex-direction:row}:where(.ag-tool-panel-external) .ag-tool-panel-wrapper{flex-grow:1}.ag-select-agg-func-item{align-items:center;display:flex;flex:1 1 auto;flex-flow:row nowrap;height:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.ag-tool-panel-horizontal-resize{cursor:ew-resize;height:100%;position:absolute;top:0;width:5px;z-index:1}.ag-side-bar{background-color:var(--ag-side-bar-background-color);display:flex;flex-direction:row-reverse;position:relative}:where(.ag-ltr) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{right:-3px}:where(.ag-rtl) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-ltr) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-rtl) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{right:-3px}.ag-side-bar-left{flex-direction:row;order:-1}.ag-side-buttons{background-color:var(--ag-side-button-bar-background-color);padding-top:var(--ag-side-button-bar-top-padding);position:relative}.ag-side-button{background-color:var(--ag-side-button-background-color);border-bottom:var(--ag-side-button-border);border-top:var(--ag-side-button-border);color:var(--ag-side-button-text-color);margin-top:-1px;position:relative}.ag-side-button:before{background-color:transparent;bottom:0;content:"";display:block;position:absolute;top:0;transition:background-color var(--ag-side-button-selected-underline-transition-duration);width:var(--ag-side-button-selected-underline-width)}:where(.ag-ltr) .ag-side-button:before{left:0}:where(.ag-rtl) .ag-side-button:before{right:0}.ag-side-button:hover{background-color:var(--ag-side-button-hover-background-color);color:var(--ag-side-button-hover-text-color)}.ag-side-button.ag-selected{background-color:var(--ag-side-button-selected-background-color);border-bottom:var(--ag-side-button-selected-border);border-top:var(--ag-side-button-selected-border);color:var(--ag-side-button-selected-text-color)}.ag-side-button.ag-selected:before{background-color:var(--ag-side-button-selected-underline-color)}.ag-side-button-button{align-items:center;display:flex;flex-direction:column;gap:var(--ag-spacing);position:relative;white-space:nowrap;width:100%;&:focus{box-shadow:none}}:where(.ag-ltr) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding)}:where(.ag-rtl) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding)}.ag-side-button-button:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-side-button-label{writing-mode:vertical-lr}@media (resolution <= 1.5x){.ag-side-button-label{font-family:"Segoe UI",var(--ag-font-family)}:where(.ag-ltr) .ag-side-button-label{transform:rotate(.05deg)}:where(.ag-rtl) .ag-side-button-label{transform:rotate(-.05deg)}}:where(.ag-ltr) .ag-side-bar-left,:where(.ag-rtl) .ag-side-bar-right{border-right:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-left:var(--ag-side-panel-border)}}:where(.ag-ltr) .ag-side-bar-right,:where(.ag-rtl) .ag-side-bar-left{border-left:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-right:var(--ag-side-panel-border)}}`,fH={tag:"div",cls:"ag-side-button",role:"presentation",children:[{tag:"button",ref:"eToggleButton",cls:"ag-button ag-side-button-button",role:"tab",attrs:{type:"button",tabindex:"-1","aria-expanded":"false"},children:[{tag:"div",ref:"eIconWrapper",cls:"ag-side-button-icon-wrapper",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eLabel",cls:"ag-side-button-label"}]}]},mH=class extends A{constructor(e){super(),this.toolPanelDef=e,this.eToggleButton=x,this.eIconWrapper=x,this.eLabel=x}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){this.setTemplate(fH,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}setLabel(){const e=this.toolPanelDef,t=this.getLocaleTextFunc()(e.labelKey,e.labelDefault);this.eLabel.textContent=t}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",_(this.toolPanelDef.iconKey,this.beans))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(e){this.toggleCss("ag-selected",e),ot(this.eToggleButton,e)}},CH={tag:"div",cls:"ag-side-buttons",role:"tablist"},vH=class extends A{constructor(){super(CH),this.buttonComps=[]}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){if(!(e.key!==b.TAB||!e.shiftKey)){if(Vs(this.beans,!0)){e.preventDefault();return}Ee(e)}}setActiveButton(e){for(const t of this.buttonComps)t.setSelected(e===t.getToolPanelId())}addButtonComp(e){const t=this.createBean(new mH(e));return this.buttonComps.push(t),this.appendChild(t),t.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:e.id})}),t}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),ee(this.getGui())}destroy(){this.clearButtons(),super.destroy()}},wH={selector:"AG-SIDE-BAR-BUTTONS",component:vH},Yy={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columnsToolPanel",toolPanel:"agColumnsToolPanel"},Xy={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agFiltersToolPanel"},bH={id:"filters-new",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agNewFiltersToolPanel"},ba={columns:Yy,filters:Xy,"filters-new":bH};function Pp(e){if(e){if(e===!0)return{toolPanels:[Yy,Xy],defaultToolPanel:"columns"};if(typeof e=="string")return Pp([e]);if(Array.isArray(e)){const t=[];for(const s of e){const i=ba[s];if(!i){F(215,{key:s,defaultByKey:ba});continue}t.push(i)}return t.length===0?void 0:{toolPanels:t,defaultToolPanel:t[0].id}}return{toolPanels:SH(e.toolPanels),defaultToolPanel:e.defaultToolPanel,hiddenByDefault:e.hiddenByDefault,position:e.position,hideButtons:e.hideButtons}}}function SH(e){const t=[];return e&&e.forEach(s=>{const i=yH(s);i&&t.push(i)}),t}function yH(e){return typeof e!="string"?e:ba[e]?ba[e]:(F(215,{key:e,defaultByKey:ba}),null)}var xH=class extends A{constructor(){super({tag:"div",cls:"ag-tool-panel-horizontal-resize"}),this.minWidth=100,this.maxWidth=null}postConstruct(){const e=this.beans.horizontalResizeSvc.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(e),this.inverted=this.gos.get("enableRtl")}dispatchResizeEvent(e,t,s){this.eventSvc.dispatchEvent({type:"toolPanelSizeChanged",width:s,started:e,ended:t})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(e){return this.onResizing(e,!0)}onResizing(e,t=!1){const s=this.inverted?-1:1;let i=Math.max(this.minWidth,Math.floor(this.startingWidth-e*s));this.maxWidth!=null&&(i=Math.min(this.maxWidth,i)),this.elementToResize.style.setProperty("--ag-horizontal-size",`${i}px`),this.dispatchResizeEvent(!1,t,i)}};function RH(e,t,s){return e.getCompDetails(t,FH,void 0,s,!0)}var FH={name:"toolPanel",optionalMethods:["refresh","getState"]},EH={tag:"div",cls:"ag-tool-panel-wrapper",role:"tabpanel",children:[{tag:"div",cls:"ag-tool-panel-content",ref:"eContent"}]},PH=class extends A{constructor(){super(EH),this.eContent=x,this.animationId=0,this.defParent=null}postConstruct(){const e=this.getGui(),t=this.resizeBar=this.createManagedBean(new xH);e.setAttribute("id",`ag-${this.getCompId()}`),t.elementToResize=e,this.appendChild(t)}getToolPanelId(){return this.toolPanelId}getDefParent(){return this.defParent}setDefParent(e){this.defParent=e}setToolPanelDef(e,t){const{id:s,minWidth:i,maxWidth:r,width:o,parent:n}=e;this.toolPanelId=s,this.defParent=n??null,o&&this.getGui().style.setProperty("--ag-side-bar-panel-width",`${o}px`);const a=RH(this.beans.userCompFactory,e,t);if(a==null)return!1;const l=a.newAgStackInstance();this.params=a.params,l.then(this.setToolPanelComponent.bind(this));const c=this.resizeBar;return i!=null&&(c.minWidth=i),r!=null&&(c.maxWidth=r),!0}setToolPanelComponent(e){this.toolPanelCompInstance=e;const{eContent:t}=this;t.appendChild(e.getGui()),this.addDestroyFunc(()=>{this.destroyBean(e)})}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(e){const t=this.gos.get("enableRtl"),s=e==="left",i=t?s:!s;this.resizeBar.inverted=i}refresh(){this.toolPanelCompInstance?.refresh(this.params)}animateDisplayed(e){if(this.isDisplayed()===e)return;const t=++this.animationId,{eContent:s}=this,i=()=>{this.animationId===t&&(r.classList.remove("ag-tool-panel-animating"),s.style.width="",r.style.width="")},r=this.getGui(),o=r.offsetWidth;this.setDisplayed(e),r.classList.add("ag-tool-panel-animating");const n=getComputedStyle(r).transitionDuration;if(!parseFloat(n)){i();return}r.style.transition="none",r.style.width="",s.style.width=`${s.offsetWidth}px`,r.style.width=`${o}px`;const a=r.offsetWidth;r.style.transition="",r.style.width=e?"":"0";const l=setTimeout(i,100);r.addEventListener("transitionstart",()=>clearTimeout(l),{once:!0}),r.addEventListener("transitionend",i,{once:!0})}},MH={tag:"div",cls:"ag-side-bar ag-unselectable",children:[{tag:"ag-side-bar-buttons",ref:"sideBarButtons"}]},TH=class extends A{constructor(){super(MH,[wH]),this.sideBarButtons=x,this.toolPanelWrappers=[],this.registerCSS(pH)}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));const{beans:e,gos:t}=this,{sideBar:s}=t.get("initialState")??{};this.setSideBarDef({sideBarDef:Pp(t.get("sideBar")),sideBarState:s}),this.addManagedPropertyListener("sideBar",()=>this.setState()),e.sideBar.comp=this;const i=this.getFocusableElement();this.createManagedBean(new Ii(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),ho(e,this,i),this.addManagedPropertyListener("enableAdvancedFilter",this.onAdvancedFilterChanged.bind(this))}getFocusableContainerName(){return"sideBar"}onTabKeyDown(e){if(e.defaultPrevented)return;const{beans:t,sideBarButtons:s}=this,i=this.getGui(),r=s.getGui(),o=ie(t),n=i.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),a=e.target,l=e.shiftKey;if(!n)return Vs(t,l,!0)?(e.preventDefault(),!0):(OC(e),!1);if(r.contains(o)){Ge(n,l)&&e.preventDefault();return}if(!l)return;let c=null;n.contains(o)?c=Qe(t,n,void 0,!0):My(n,a)&&(c=gp(n,a)),c||(c=r.querySelector(".ag-selected button"),c=Ne(c)?c:null),c&&c!==e.target&&(e.preventDefault(),c.focus())}handleKeyDown(e){const t=ie(this.beans),s=this.sideBarButtons;if(!s.getGui().contains(t))return;const i=s.getGui(),r=Array.prototype.slice.call(i.querySelectorAll(".ag-side-button")),o=r.findIndex(l=>l.contains(t));let n=null;switch(e.key){case b.LEFT:case b.UP:n=Math.max(0,o-1);break;case b.RIGHT:case b.DOWN:n=Math.min(o+1,r.length-1);break}if(n===null)return;const a=r[n].querySelector("button");a&&(a.focus(),e.preventDefault())}onToolPanelButtonClicked(e){const t=e.toolPanelId;this.openedItem()===t?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(t,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:e,sideBarState:t,existingToolPanelWrappers:s}){if(this.setDisplayed(!1),this.sideBar=e,e&&this.sideBarButtons.setDisplayed(!e.hideButtons),e?.toolPanels){const i=e.toolPanels;if(this.createToolPanelsAndSideButtons(i,t,s),!this.toolPanelWrappers.length)return;const r=t?t.visible:!e.hiddenByDefault;if(this.setDisplayed(r),this.setSideBarPosition(t?t.position:e.position),r)if(t){const{openToolPanel:o}=t;o&&this.openToolPanel(o,"sideBarInitializing")}else this.openToolPanel(e.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(e){e||(e="right"),this.position=e;const t=e==="left",s=t?"right":"left";this.toggleCss("ag-side-bar-left",t),this.toggleCss("ag-side-bar-right",!t);for(const i of this.toolPanelWrappers)i.setResizerSizerSide(s);return this.dispatchSideBarUpdated(),this}setDisplayed(e,t){super.setDisplayed(e,t),this.dispatchSideBarUpdated()}getState(){const e={};for(const t of this.toolPanelWrappers)e[t.getToolPanelId()]=t.getToolPanelInstance()?.getState?.();return{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:e}}createToolPanelsAndSideButtons(e,t,s){for(const i of e)this.createToolPanelAndSideButton(i,t?.toolPanels?.[i.id],s?.[i.id])}validateDef(e){const{id:t,toolPanel:s}=e;return t==null?(F(212),!1):Zy(s)&&this.beans.filterManager?.isAdvFilterEnabled()?(F(213),!1):!0}createToolPanelAndSideButton(e,t,s){if(!this.validateDef(e)){this.destroyBean(s);return}let i;if(s)i=s,i.setDefParent(e.parent??null);else if(i=this.createBean(new PH),!i.setToolPanelDef(e,N(this.gos,{initialState:t,onStateUpdated:()=>this.dispatchSideBarUpdated()})))return;i.setDisplayed(!1),this.renderToolPanelUnderParent(i,e.parent),this.toolPanelWrappers.push(i);const r=this.sideBarButtons.addButtonComp(e);ja(r.eToggleButton,i.getGui())}refresh(){for(const e of this.toolPanelWrappers)e.refresh()}renderToolPanelUnderParent(e,t){const s=e.getGui();t&&(this.beans.environment.applyThemeClasses(t,["ag-external","ag-tool-panel-external"]),s.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"));const i=t??e.getDefParent()??this.getGui();s.parentElement!==i&&i.appendChild(s)}getWrapper(e){return this.toolPanelWrappers.find(t=>t.getToolPanelId()===e)}openToolPanel(e,t="api",s){const i=this.openedItem(),o=!!e&&!!i||t==="sideBarInitializing";for(const l of this.toolPanelWrappers){const c=e===l.getToolPanelId();c&&this.renderToolPanelUnderParent(l,s??null),o?l.setDisplayed(c):l.animateDisplayed(c)}const n=this.openedItem();i!==n&&(this.sideBarButtons.setActiveButton(e),this.raiseToolPanelVisibleEvent(e,i??void 0,t))}getToolPanelInstance(e){const t=this.getWrapper(e);if(!t){F(214,{key:e});return}return t.getToolPanelInstance()}raiseToolPanelVisibleEvent(e,t,s){const i=!!e&&!!t,r=this.eventSvc;t&&r.dispatchEvent({type:"toolPanelVisibleChanged",source:s,key:t,visible:!1,switchingToolPanel:i}),e&&r.dispatchEvent({type:"toolPanelVisibleChanged",source:s,key:e,visible:!0,switchingToolPanel:i})}close(e="api"){this.openToolPanel(void 0,e)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let e=null;for(const t of this.toolPanelWrappers)t.isDisplayed()&&(e=t.getToolPanelId());return e}setState(e){const t=Pp(this.gos.get("sideBar")),s={};t&&this.sideBar&&t.toolPanels?.forEach(i=>{const{id:r}=i;if(!r)return;const o=this.sideBar.toolPanels?.find(c=>c.id===r);if(!o||i.toolPanel!==o.toolPanel)return;const n=this.getWrapper(r);if(!n)return;const a=N(this.gos,{...i.toolPanelParams??{},initialState:e?.toolPanels?.[r],onStateUpdated:()=>this.dispatchSideBarUpdated()});n.getToolPanelInstance()?.refresh(a)===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(c=>c!==n),ue(n.getGui()),s[r]=n)}),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,sideBarState:e,existingToolPanelWrappers:s})}dispatchSideBarUpdated(){this.eventSvc.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){for(const e of this.toolPanelWrappers)ue(e.getGui()),this.destroyBean(e);this.toolPanelWrappers.length=0}onAdvancedFilterChanged(){this.sideBar?.toolPanels?.some(t=>Zy(typeof t=="string"?t:t.toolPanel))&&this.setState()}destroy(){this.destroyToolPanelWrappers(),super.destroy()}};function Zy(e){return e==="agFiltersToolPanel"||e==="agNewFiltersToolPanel"}var DH={selector:"AG-SIDE-BAR",component:TH},AH=class extends E{constructor(){super(...arguments),this.beanName="sideBar"}getSelector(){return DH}},Sa={moduleName:"SideBar",version:Y,beans:[AH],apiFunctions:{isSideBarVisible:rH,setSideBarVisible:oH,setSideBarPosition:nH,openToolPanel:aH,closeToolPanel:lH,getOpenedToolPanel:cH,refreshToolPanel:dH,isToolPanelShowing:uH,getToolPanelInstance:hH,getSideBar:gH},dependsOn:[le,mh]},IH='.ag-menu-list{cursor:default;display:table;padding:var(--ag-spacing) 0;width:100%}.ag-menu-option,.ag-menu-separator{display:table-row}.ag-menu-option-part,.ag-menu-separator-part{display:table-cell;vertical-align:middle}.ag-menu-option{cursor:pointer;font-weight:500}:where(.ag-ltr) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:right}:where(.ag-rtl) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:left}.ag-menu-option-text{white-space:nowrap}.ag-menu-option-custom{display:contents}.ag-compact-menu-option{display:flex;flex-wrap:nowrap;width:100%}.ag-compact-menu-option-text{flex:1 1 auto;white-space:nowrap}.ag-menu-separator{height:calc(var(--ag-spacing)*2 + 1px)}.ag-menu-separator-part:after{border-top:solid var(--ag-border-width) var(--ag-menu-separator-color);content:"";display:block}.ag-compact-menu-option-active,.ag-menu-option-active{background-color:var(--ag-row-hover-color)}.ag-compact-menu-option-part,.ag-menu-option-part{line-height:var(--ag-icon-size);padding:calc(var(--ag-spacing) + 2px) 0}.ag-compact-menu-option-disabled,.ag-menu-option-disabled{cursor:not-allowed;opacity:.5}.ag-compact-menu-option-icon,.ag-menu-option-icon{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-compact-menu-option-icon,:where(.ag-ltr) .ag-menu-option-icon{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-compact-menu-option-icon,:where(.ag-rtl) .ag-menu-option-icon{padding-right:calc(var(--ag-spacing)*2)}.ag-compact-menu-option-text,.ag-menu-option-text{padding-left:calc(var(--ag-spacing)*2);padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-compact-menu-option-shortcut,:where(.ag-ltr) .ag-menu-option-shortcut{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-shortcut,:where(.ag-rtl) .ag-menu-option-shortcut{padding-left:var(--ag-spacing)}:where(.ag-ltr) .ag-compact-menu-option-popup-pointer,:where(.ag-ltr) .ag-menu-option-popup-pointer{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-popup-pointer,:where(.ag-rtl) .ag-menu-option-popup-pointer{padding-left:var(--ag-spacing)}.ag-menu-column-select-wrapper{height:265px;overflow:auto;:where(.ag-column-select){height:100%}}.ag-menu:where(.ag-tabs){min-width:290px}.ag-context-menu-loading-icon{pointer-events:none;position:absolute}',Qy=class extends Py{constructor(){super({warnNoIcon:()=>F(227)})}},ed={moduleName:"MenuItem",version:Y,userComponents:{agMenuItem:Qy},icons:{check:"tick",subMenuOpen:"small-right",subMenuOpenRtl:"small-left"},css:[IH]},kH=".ag-column-select{display:flex;flex:3 1 0px;flex-direction:column;overflow:hidden;position:relative}.ag-column-select-header{flex:none;height:var(--ag-header-height);padding-left:var(--ag-widget-container-horizontal-padding);padding-right:var(--ag-widget-container-horizontal-padding)}.ag-column-select-column,.ag-column-select-column-group,.ag-column-select-header{align-items:center;display:flex;gap:var(--ag-widget-horizontal-spacing);position:relative}.ag-column-select-column,.ag-column-select-column-group{height:100%}:where(.ag-ltr) .ag-column-select-column,:where(.ag-ltr) .ag-column-select-column-group{padding-left:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}:where(.ag-rtl) .ag-column-select-column,:where(.ag-rtl) .ag-column-select-column-group{padding-right:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}.ag-column-select-column-group:where(:not(:last-child)),.ag-column-select-column:where(:not(:last-child)){margin-bottom:var(--ag-widget-vertical-spacing)}.ag-column-select-header-icon{border-radius:var(--ag-border-radius);cursor:pointer;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-column-select-header-filter-wrapper{flex:1 1 auto}.ag-column-select-header-filter{width:100%}.ag-column-select-list{flex:1 1 0px;overflow:hidden}:where(.ag-ltr) .ag-column-select-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}:where(.ag-rtl) .ag-column-select-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}.ag-column-select-column-group-readonly,.ag-column-select-column-readonly{opacity:.5;pointer-events:none;.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-column-select-column-readonly{&.ag-icon-grip,.ag-icon-grip{opacity:.35}}.ag-column-select-virtual-list-viewport{padding:calc(var(--ag-widget-container-vertical-padding)*.5) 0}.ag-column-select-virtual-list-item{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-column-select-column-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-select-checkbox{display:flex}",LH=300,GH={tag:"div",cls:"ag-column-select-header",role:"presentation",children:[{tag:"div",ref:"eExpand",cls:"ag-column-select-header-icon"},{tag:"ag-checkbox",ref:"eSelect",cls:"ag-column-select-header-checkbox"},{tag:"ag-input-text-field",ref:"eFilterTextField",cls:"ag-column-select-header-filter-wrapper"}]},OH=class extends A{constructor(){super(GH,[ds,Vt]),this.eExpand=x,this.eSelect=x,this.eFilterTextField=x}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:t=>{t.key===b.SPACE&&(t.preventDefault(),this.onExpandClicked())}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});const e=this.getLocaleTextFunc();this.eSelect.setInputAriaLabel(e("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.toggleCss("ag-column-select-column-readonly",e)}init(e){this.params=e;const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.toggleCss("ag-column-select-column-readonly",t),this.beans.colModel.ready&&this.showOrHideOptions()}createExpandIcons(){const e=this.beans;this.eExpand.appendChild(this.eExpandChecked=_("columnSelectOpen",e)),this.eExpand.appendChild(this.eExpandUnchecked=_("columnSelectClosed",e)),this.eExpand.appendChild(this.eExpandIndeterminate=_("columnSelectIndeterminate",e)),this.setExpandState(0)}showOrHideOptions(){const e=this.params,t=!e.suppressColumnFilter,s=!e.suppressColumnSelectAll,i=!e.suppressColumnExpandAll,r=!!this.beans.colModel.colDefCols?.treeDepth,o=this.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(o("searchOoo","Search...")),V(this.eFilterTextField.getGui(),t),V(this.eSelect.getGui(),s),V(this.eExpand,i&&r)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=Ce(this,()=>{const e=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:e})},LH)),this.onFilterTextChangedDebounced()}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(e){this.expandState=e,V(this.eExpandChecked,e===0),V(this.eExpandUnchecked,e===1),V(this.eExpandIndeterminate,e===2)}setSelectionState(e){this.selectState=e,this.eSelect.setValue(this.selectState)}},VH={selector:"AG-PRIMARY-COLS-HEADER",component:OH};function No(e){return!!e&&typeof e.children<"u"}function Zi(e){return No(e)?e.groupId:e.colId}function Jy(e,t,s){const i=(n,a)=>{const c=n.children.map(Zi).includes(Zi(a)),d=W(n.children),u=d&&Zi(d)!==Zi(a);return c&&u};if(!No(e))return!0;const r=e,o=s;if(i(r,o)||r.groupId===t&&!r.children.map(Zi).includes(Zi(o)))return r.children.push(o),!0;for(let n=r.children.length-1;n>=0&&!Jy(r.children[n],t,s);n--);return!1}function e0(e){const t=(r,o)=>No(r)&&No(o)&&Zi(r)===Zi(o),s=(r,o)=>{if(!No(o))return r;const n=r,a=o;if(a.children&&a.groupId&&Jy(n,a.groupId,a.children[0]))return n;for(const l of a.children)s(n,l);return n},i=[];for(let r=1;r<=e.length;r++){const o=e[r-1],n=e[r];t(o,n)?e[r]=s(o,n):i.push(o)}return i}function t0(e,t){const s=[],i=(o,n)=>{if(No(o)){const a=o,l=typeof a.groupId<"u"?a.groupId:a.headerName,c=new br(a,l,!1,n),d=[];for(const u of a.children){const h=i(u,n+1);h&&d.push(h)}return c.setChildren(d),c}else{const a=o,l=a.colId?a.colId:a.field,c=e.getColDefCol(l);return c||s.push(a),c}},r=[];for(const o of t){const n=i(o,0);n&&r.push(n)}return s.length>0&&F(217,{invalidColIds:s}),r}function s0(e,t){const s=i0(NH(e)),i=e0(s);t(i)}function BH(e,t){const s=i0(e),i=e0(s);t(i)}function i0(e){const t=(s,i)=>{let r;if(Re(s))if(s.isPadding())r=i;else{const n=Object.assign({},s.getColGroupDef());n.groupId=s.getGroupId(),n.children=[i],r=n}else{const n=Object.assign({},s.getColDef());n.colId=s.getColId(),r=n}const o=s.getOriginalParent();return o?t(o,r):r};return e.map(s=>t(s,s.getColDef()))}function NH(e){return e.getCols().filter(t=>{const s=t.getColDef();return t.isPrimary()&&!s.showRowGroup})}var r0=class{constructor(e,t,s,i=!1,r){this.displayName=e,this.depth=s,this.group=i,this.localEventService=new As,i?(this.columnGroup=t,this._expanded=r,this.children=[]):this.column=t}get expanded(){return!!this._expanded}set expanded(e){e!==this._expanded&&(this._expanded=e,this.localEventService.dispatchEvent({type:"expandedChanged"}))}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}};function oe(e){return!!e?.buttons?.includes("apply")}function Dt(e,t){if(!oe(t))return;const s=e.sideBar?.comp.openedItem();if(!s)return;e.sideBar?.comp.getToolPanelInstance(s)?.refreshDeferredUi()}function o0(e,t,s,i,r){const o=HH(t);n0(e,o,s,i,r)}function n0(e,t,s,i,r){e.columnStateUpdateStrategy.getPivotMode(oe(r))?_H(e,t,s,i,r):zH(e,t,s,i,r)}function HH(e){const t=[],s=i=>{for(const r of i)r.passesFilter&&(r.group?s(r.children):t.push(r.column))};return s(e),t}function zH(e,t,s,i,r){const o=e.columnStateUpdateStrategy,n=[];for(const a of t)a.getColDef().lockVisible||o.isColumnVisibleInToolPanel(oe(r),a)!==s&&n.push({colId:a.getId(),hide:!s});o.applyColumnState(oe(r),n,i),Dt(e,r)}function _H(e,t,s,i,r){WH(e,t,s,i,r)}function WH(e,t,s,i,r){const o=e.columnStateUpdateStrategy,n=[],c=s?d=>{if(!o.isColumnSelectedInPivotModeToolPanel(oe(r),d))if(d.isAllowValue()){const u=typeof d.getAggFunc()=="string"?d.getAggFunc():e.aggFuncSvc?.getDefaultAggFunc(d);n.push({colId:d.getId(),aggFunc:u})}else d.isAllowRowGroup()?n.push({colId:d.getId(),rowGroup:!0}):d.isAllowPivot()&&n.push({colId:d.getId(),pivot:!0})}:d=>{o.isColumnSelectedInPivotModeToolPanel(oe(r),d)&&n.push({colId:d.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(c),o.applyColumnState(oe(r),n,i),Dt(e,r)}function a0(e,t){const{columns:s,visibleState:i,pivotState:r,eventType:o}=t,n=e.columnStateUpdateStrategy,a=n.getPivotMode(oe(t)),l=s.map(c=>{const d=c.getColId();if(a){const u=r?.[d];return{colId:d,pivot:u?.pivot,rowGroup:u?.rowGroup,aggFunc:u?.aggFunc}}else return{colId:d,hide:!i?.[d]}});n.applyColumnState(oe(t),l,o),Dt(e,t)}function UH(e){return{pivot:e.isPivotActive(),rowGroup:e.isRowGroupActive(),aggFunc:e.isValueActive()?e.getAggFunc():void 0}}function l0(e,t,s){if(!s)return UH(e);const i=t.getRowGroupColumns(s).includes(e),r=t.getPivotColumns(s).includes(e),o=t.getValueColumns(s).includes(e);return{pivot:r,rowGroup:i,aggFunc:o?t.getColumnAggFunc(s,e):void 0}}var c0=(e,t)=>{if(!t)return[];let s=e;for(let i=0,r=t.length;i{const i=e.aggData;i!==t&&(e.aggData=t,e.__localEventService&&$H(e,i,t,s))},d0=(e,t,s)=>{Ho(e,t,s);const i=e.pinnedSibling;i&&Ho(i,t,s);const r=e.sibling;if(r){Ho(r,t,s);const o=r.pinnedSibling;o&&Ho(o,t,s)}},$H=(e,t,s,i)=>{if(!s){if(!t)return;const n=Object.keys(t);for(let a=0,l=n.length;a{const r=t.getCol(s);let o=e._groupData;o||(o={},e._groupData=o);const n=r.getColId(),a=o[n];a!==i&&(o[n]=i,e.dispatchCellChangedEvent(r,i,a))},h0=(e,t,s)=>{if(!e)return;const i=e.group;i!==s&&(e.group=s,e.updateHasChildren(),i&&!s&&(Ho(e,null,t.colModel),e.setAllChildrenCount(null)),t.selectionSvc?.updateRowSelectable(e),e.dispatchRowEvent("groupChanged"))},Mp=(e,t,s)=>{h0(e,t,s),h0(e.pinnedSibling,t,s)},ya=(e,t)=>{const{gos:s,rowGroupColsSvc:i}=t;if(!i||!e)return!1;const r=s.get("groupLockGroupColumns");if(!e.isRowGroupActive()||r===0)return!1;if(r===-1)return!0;const o=i.columns.findIndex(n=>n.getColId()===e.getColId());return r>o},xa=(e,t,s)=>{const r=e(t,`${t==="groupBy"?"Group by":"Un-Group by"} ${s}`,[s]);return r.indexOf(s)>=0?r:`${r} ${s}`};function KH(e){const t=It(e),s="getSelection"in t?t.getSelection():null,i=[];for(let r=0;r<(s?.rangeCount??0);r++){const o=s?.getRangeAt(r);o&&i.push(o)}return{selection:s,ranges:i}}function jH(e,t){if(!e.gos.get("enableCellTextSelection")||!Di()&&!Ss())return t();const{selection:i,ranges:r}=KH(e);t(),i?.removeAllRanges();for(const o of r)i?.addRange(o)}var qH={name:"menuItem",optionalMethods:["setActive","select","setExpanded","configureDefaults"]},Tp={getMenuItemComp:(e,t,s)=>e.userCompFactory.getCompDetails(t,qH,"agMenuItem",N(e.gos,s),!0)?.newAgStackInstance()??$.resolve(),getPostProcessPopupParams:({column:e,node:t})=>({column:e,rowNode:t}),preserveRangesWhile:jH,stopPropagationCallbacks:Ai,warnNoItem:e=>{F(228,{menuItemOrString:e})}},YH=class extends jc{constructor(){super(Tp)}},Dp=class extends qc{constructor(e,t={column:null,node:null,value:null}){super(e,t,Tp)}},g0=class extends A{constructor(e,t,s,i={}){super({tag:"div",cls:"ag-menu"}),this.column=e,this.mouseEventOrTouch=t,this.parentEl=s,this.params=i,this.displayName=null}postConstruct(){const{column:e,beans:{colNames:t}}=this;this.initializeProperties(e);let s;if(bs(e)?s=t.getDisplayNameForColumn(e,"columnToolPanel"):s=t.getDisplayNameForProvidedColumnGroup(null,e,"columnToolPanel"),this.displayName=s,this.buildMenuItemMap(),this.isActive()){const i=this.mouseEventOrTouch;"preventDefault"in i&&i.preventDefault();const r=this.getMappedMenuItems();if(r.length===0)return;this.displayContextMenu(r)}}initializeProperties(e){const t=this.beans.columnStateUpdateStrategy;let s;Re(e)?s=e.getLeafColumns():s=[e],this.columns=s;const i=t.getPivotMode(oe(this.params));this.allowScrollIntoView=!i&&s.some(this.isColumnValidForScrollIntoView),this.allowGrouping=s.some(r=>r.isPrimary()&&r.isAllowRowGroup()),this.allowValues=s.some(r=>r.isPrimary()&&r.isAllowValue()),this.allowPivoting=i&&s.some(r=>r.isPrimary()&&r.isAllowPivot())}buildMenuItemMap(){const e=this.getLocaleTextFunc(),{beans:t,displayName:s}=this,i=this.beans.columnStateUpdateStrategy,r=new Map;this.menuItemMap=r;const o=oe(this.params),n=i.getPivotMode(o),a=new Set(i.getRowGroupColumns(o).map(g=>g.getColId())),l=new Set(i.getValueColumns(o).map(g=>g.getColId())),c=new Set(i.getPivotColumns(o).map(g=>g.getColId()));r.set("scrollIntoView",{allowedFunction:g=>!g.isPinned()&&!n&&this.isColumnValidForScrollIntoView(g),activeFunction:()=>!1,activateLabel:()=>e("scrollColumnIntoView",`Scroll ${s} into View`,[s]),activateFunction:()=>{const g=this.columns.find(this.isColumnValidForScrollIntoView);g&&this.beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(g)},deActivateFunction:()=>{},addIcon:"ensureColumnVisible"});const d=g=>g.isPrimary()&&g.isAllowRowGroup()&&!ya(g,t);r.set("rowGroup",{allowedFunction:d,activeFunction:g=>a.has(g.getColId()),activateLabel:()=>xa(e,"groupBy",s),deactivateLabel:()=>xa(e,"ungroupBy",s),activateFunction:()=>{const g=this.addColumnsToList(i.getRowGroupColumns(o),d);i.setRowGroupColumns(o,g,"toolPanelUi"),Dt(this.beans,this.params)},deActivateFunction:()=>{const g=this.removeColumnsFromList(i.getRowGroupColumns(o),d);i.setRowGroupColumns(o,g,"toolPanelUi"),Dt(this.beans,this.params)},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"});const u=g=>g.isPrimary()&&g.isAllowValue();r.set("value",{allowedFunction:u,activeFunction:g=>l.has(g.getColId()),activateLabel:()=>e("addToValues",`Add ${s} to values`,[s]),deactivateLabel:()=>e("removeFromValues",`Remove ${s} from values`,[s]),activateFunction:()=>{const g=this.addColumnsToList(i.getValueColumns(o),u);i.setValueColumns(o,g,"toolPanelUi"),Dt(this.beans,this.params)},deActivateFunction:()=>{const g=this.removeColumnsFromList(i.getValueColumns(o),u);i.setValueColumns(o,g,"toolPanelUi"),Dt(this.beans,this.params)},addIcon:"valuePanel",removeIcon:"valuePanel"});const h=g=>n&&g.isPrimary()&&g.isAllowPivot();r.set("pivot",{allowedFunction:h,activeFunction:g=>c.has(g.getColId()),activateLabel:()=>e("addToLabels",`Add ${s} to labels`,[s]),deactivateLabel:()=>e("removeFromLabels",`Remove ${s} from labels`,[s]),activateFunction:()=>{const g=this.addColumnsToList(i.getPivotColumns(o),h);i.setPivotColumns(o,g,"toolPanelUi"),Dt(this.beans,this.params)},deActivateFunction:()=>{const g=this.removeColumnsFromList(i.getPivotColumns(o),h);i.setPivotColumns(o,g,"toolPanelUi"),Dt(this.beans,this.params)},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}isColumnValidForScrollIntoView(e){if(!e.isVisible())return!1;const s=e.getParent();return s?s.getDisplayedChildren()?.includes(e)??!0:!0}addColumnsToList(e,t){return[...e].concat(this.columns.filter(s=>t(s)&&!e.includes(s)))}removeColumnsFromList(e,t){return e.filter(s=>!t(s)||!this.columns.includes(s))}displayContextMenu(e){const t=this.getGui(),s=this.createBean(new Dp),i=this.getLocaleTextFunc();let r=()=>{};t.appendChild(s.getGui()),s.addMenuItems(e),s.addManagedListeners(s,{closeMenu:()=>{this.parentEl.focus(),r()}});const o=this.beans.popupSvc,n=o.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:()=>Ge(s.getGui()),ariaLabel:i("ariaLabelContextMenu","Context Menu"),closedCallback:a=>{a instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(s)}});n&&(r=n.hideFunc),o.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEventOrTouch,ePopup:t})}isActive(){return this.allowScrollIntoView||this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const e=[],{menuItemMap:t,columns:s,displayName:i,beans:r}=this;for(const o of t.values()){const n=s.some(l=>o.allowedFunction(l)&&!o.activeFunction(l)),a=s.some(l=>o.allowedFunction(l)&&o.activeFunction(l));n&&e.push({name:o.activateLabel(i),icon:_(o.addIcon,r,null),action:()=>o.activateFunction()}),a&&o.removeIcon&&o.deactivateLabel&&e.push({name:o.deactivateLabel(i),icon:_(o.removeIcon,r,null),action:()=>o.deActivateFunction?.()})}return e}},XH={tag:"div",cls:"ag-column-select-column-group",children:[{tag:"span",ref:"eColumnGroupIcons",cls:"ag-column-group-icons",children:[{tag:"span",ref:"eGroupClosedIcon",cls:"ag-column-group-closed-icon"},{tag:"span",ref:"eGroupOpenedIcon",cls:"ag-column-group-opened-icon"}]},{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},p0=class extends A{constructor(e,t,s,i,r){super(),this.modelItem=e,this.allowDragging=t,this.eventType=s,this.focusWrapper=i,this.params=r,this.cbSelect=x,this.eLabel=x,this.eGroupOpenedIcon=x,this.eGroupClosedIcon=x,this.eColumnGroupIcons=x,this.processingColumnStateChange=!1;const{columnGroup:o,depth:n,displayName:a}=e;this.columnGroup=o,this.columnDepth=n,this.displayName=a}postConstruct(){this.setTemplate(XH,[ds]);const{beans:e,cbSelect:t,eLabel:s,displayName:i,columnDepth:r,modelItem:o,focusWrapper:n,columnGroup:a}=this,{registry:l,gos:c}=e,d=_("columnDrag",e);this.eDragHandle=d,d.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const u=t.getGui(),h=t.getInputElement();u.after(d),h.setAttribute("tabindex","-1"),s.textContent=i??"",this.setupExpandContract(),this.addCss("ag-column-select-indent-"+r),this.getGui().style.setProperty("--ag-indentation-level",String(r)),this.tooltipFeature=this.createOptionalManagedBean(l.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumnGroup",shouldDisplayTooltip:na(c,()=>s)})),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(s,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(o,{expandedChanged:this.onExpandChanged.bind(this)});const g=new as(this.getGui(),!1);this.addManagedListeners(g,{longTap:f=>this.onContextMenu(f.touchStart)}),this.addDestroyFunc(g.destroy.bind(g)),this.addManagedListeners(n,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip();const p=qu(a.getColGroupDef(),c,null,a);for(const f of p)this.toggleCss(f,!0)}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const e=this.columnGroup.getColGroupDef();if(!e)return;const t=()=>this.tooltipFeature?.setTooltipAndRefresh(e.headerTooltip);t(),this.addManagedEventListeners({newColumnsLoaded:t})}handleKeyDown(e){switch(e.key){case b.LEFT:e.preventDefault(),this.modelItem.expanded=!1;break;case b.RIGHT:e.preventDefault(),this.modelItem.expanded=!0;break;case b.SPACE:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(e){const{columnGroup:t,gos:s}=this;if(s.get("functionsReadOnly"))return;const i=this.createBean(new g0(t,e,this.focusWrapper,this.params));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}addVisibilityListenersToAllChildren(){const e=this.onColumnStateChanged.bind(this);for(const t of this.columnGroup.getLeafColumns())this.addManagedListeners(t,{visibleChanged:e,columnValueChanged:e,columnPivotChanged:e,columnRowGroupChanged:e})}setupDragging(){if(!this.allowDragging){V(this.eDragHandle,!1);return}const e=this.beans,{gos:t,eventSvc:s,dragAndDrop:i}=e;let r=!t.get("suppressDragLeaveHidesColumns");const o={type:ns.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>r?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{r=!t.get("suppressDragLeaveHidesColumns"),s.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{s.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{r&&a0(e,{columns:this.columnGroup.getLeafColumns(),visibleState:n?.visibleState,pivotState:n?.pivotState,eventType:this.eventType,buttons:this.params.buttons})},onGridExit:()=>{r&&this.onChangeCommon(!1)}};i.addDragSource(o,!0),this.addDestroyFunc(()=>i.removeDragSource(o))}createDragItem(){const e=this.columnGroup.getLeafColumns(),t={},s={},i=this.beans.columnStateUpdateStrategy,r=oe(this.params);for(const o of e){const n=o.getId();t[n]=o.isVisible(),s[n]=l0(o,i,r)}return{columns:e,visibleState:t,pivotState:s}}setupExpandContract(){const{beans:e,eGroupClosedIcon:t,eGroupOpenedIcon:s,eColumnGroupIcons:i}=this;t.appendChild(Bs("columnSelectClosed",e,null)),s.appendChild(Bs("columnSelectOpen",e,null));const r=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(t,{click:r}),this.addManagedElementListeners(s,{click:r});const o=new as(i,!0);this.addManagedListeners(o,{tap:r}),this.addDestroyFunc(o.destroy.bind(o))}onLabelClicked(){const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}getVisibleLeafColumns(){const e=[],t=s=>{for(const i of s)i.passesFilter&&(i.group?t(i.children):e.push(i.column))};return t(this.modelItem.children),e}onChangeCommon(e){this.refreshAriaLabel(),!this.processingColumnStateChange&&o0(this.beans,this.modelItem.children,e,this.eventType,this.params)}refreshAriaLabel(){const{cbSelect:e,focusWrapper:t,displayName:s}=this,i=this.getLocaleTextFunc(),r=i("ariaColumnGroup","Column Group"),o=e.getValue(),n=o===void 0?i("ariaIndeterminate","indeterminate"):o?i("ariaVisible","visible"):i("ariaHidden","hidden"),a=i("ariaToggleVisibility","Press SPACE to toggle visibility");de(t,`${s} ${r}`),e.setInputAriaLabel(`${a} (${n})`),rn(t,e.getInputElement().id)}onColumnStateChanged(){const e=this.workOutSelectedValue(),t=this.workOutReadOnlyValue();this.processingColumnStateChange=!0;const s=this.cbSelect;s.setValue(e),s.setReadOnly(t),this.toggleCss("ag-column-select-column-group-readonly",t),this.processingColumnStateChange=!1}workOutSelectedValue(){const t=this.beans.columnStateUpdateStrategy.getPivotMode(oe(this.params)),s=this.getVisibleLeafColumns();let i=0,r=0;for(const o of s)(t||!o.getColDef().lockVisible)&&(this.isColumnChecked(o)?i++:r++);if(!(i>0&&r>0))return i>0}workOutReadOnlyValue(){const e=this.beans.columnStateUpdateStrategy.getPivotMode(oe(this.params));let t=0;for(const s of this.columnGroup.getLeafColumns())e?s.isAnyFunctionAllowed()&&t++:s.getColDef().lockVisible||t++;return t===0}isColumnChecked(e){const t=this.beans.columnStateUpdateStrategy;return t.getPivotMode(oe(this.params))?t.isColumnSelectedInPivotModeToolPanel(oe(this.params),e):t.isColumnVisibleInToolPanel(oe(this.params),e)}onExpandOrContractClicked(){const e=this.modelItem,t=e.expanded;e.expanded=!t}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const e=this.modelItem.expanded;V(this.eGroupClosedIcon,!e),V(this.eGroupOpenedIcon,e)}refreshAriaExpanded(){ot(this.focusWrapper,this.modelItem.expanded)}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect,s=t.getValue();!t.isReadOnly()&&(e&&!s||!e&&s)&&t.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(e){this.cbSelect.setValue(e,!0)}},Ap=e=>Re(e)?e.getLeafColumns():e?[e]:[],ZH=(e,t,s,i)=>{if(!t||!e)return null;const r=i.indexOf(t),o=s?r:r+1,n=QH(i,e,o);return o-n},QH=(e,t,s)=>{if(!t)return 0;const i=t[0],r=t.length;return e.indexOf(i){const r=oe(i);return e.get("suppressMovableColumns")||t.columnStateUpdateStrategy.getPivotMode(r)?!0:!!s.find(({colDef:a})=>!!a.suppressMovable||!!a.lockPosition)},m0=(e,t,s,i)=>{if(!s)return;const{component:r}=s;let o=null,n=s.position==="top";if(r instanceof p0?(o=r.getColumns()[0],n=!0):r&&(o=r.column),!o)return;const a=oe(i),l=a?e.columnStateUpdateStrategy.getPrimaryColumns(a):e.colModel.getCols(),c=ZH(t,o,n,l);c!=null&&(e.columnStateUpdateStrategy.moveColumns(a,t,c,"toolPanelUi"),Dt(e,i))},JH=e=>e.column,ez={tag:"div",cls:"ag-column-select-column",children:[{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},tz=class extends A{constructor(e,t,s,i,r){super(),this.modelItem=e,this.allowDragging=t,this.groupsExist=s,this.focusWrapper=i,this.params=r,this.eLabel=x,this.cbSelect=x,this.processingColumnStateChange=!1;const{column:o,depth:n,displayName:a}=e;this.column=o,this.columnDepth=n,this.displayName=a}postConstruct(){this.setTemplate(ez,[ds]);const{beans:e,cbSelect:t,displayName:s,eLabel:i,columnDepth:r,groupsExist:o,column:n,gos:a,focusWrapper:l}=this,c=_("columnDrag",e);this.eDragHandle=c,c.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const d=t.getGui(),u=t.getInputElement();d.after(c),u.setAttribute("tabindex","-1"),i.textContent=s,o&&this.addCss("ag-column-select-add-group-indent"),this.addCss(`ag-column-select-indent-${r}`),this.getGui().style.setProperty("--ag-indentation-level",String(r)),this.tooltipFeature=this.createOptionalManagedBean(e.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumn",shouldDisplayTooltip:na(a,()=>i),getAdditionalParams:()=>({colDef:n.getColDef()})})),this.setupDragging();const h=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:h}),this.addManagedListeners(n,{columnValueChanged:h,columnPivotChanged:h,columnRowGroupChanged:h,visibleChanged:h}),this.addManagedListeners(l,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)});const g=new as(l);this.addManagedListeners(g,{longTap:f=>this.onContextMenu(f.touchStart)}),this.addDestroyFunc(g.destroy.bind(g)),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(i,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip();const p=qu(n.getColDef(),a,n,null);for(const f of p)this.toggleCss(f,!0)}getColumn(){return this.column}setupTooltip(){const e=()=>this.tooltipFeature?.setTooltipAndRefresh(this.column.getColDef().headerTooltip);e(),this.addManagedEventListeners({newColumnsLoaded:e})}onContextMenu(e){const{column:t,gos:s}=this;if(s.get("functionsReadOnly"))return;const i=this.createBean(new g0(t,e,this.focusWrapper,this.params));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}handleKeyDown(e){e.key===b.SPACE&&(e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}onChangeCommon(e){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&n0(this.beans,[this.column],e,"toolPanelUi",this.params))}refreshAriaLabel(){const{cbSelect:e,focusWrapper:t,displayName:s}=this,i=this.getLocaleTextFunc(),r=i("ariaColumn","Column"),o=e.getValue()?i("ariaVisible","visible"):i("ariaHidden","hidden"),n=i("ariaToggleVisibility","Press SPACE to toggle visibility");de(t,`${s} ${r}`),this.cbSelect.setInputAriaLabel(`${n} (${o})`),rn(t,e.getInputElement().id)}setupDragging(){const e=this.eDragHandle;if(!this.allowDragging){V(e,!1);return}const t=this.beans,{gos:s,eventSvc:i,dragAndDrop:r}=t;oe(this.params)&&e.setAttribute("data-column-tool-panel-deferred","");let o=!s.get("suppressDragLeaveHidesColumns");const n={type:ns.ToolPanel,eElement:e,dragItemName:this.displayName,getDefaultIconName:()=>o&&!oe(this.params)?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{o=!s.get("suppressDragLeaveHidesColumns"),i.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{i.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:a=>{o&&!oe(this.params)&&a0(t,{columns:[this.column],visibleState:a?.visibleState,pivotState:a?.pivotState,eventType:"toolPanelUi",buttons:this.params.buttons})},onGridExit:()=>{o&&!oe(this.params)&&this.onChangeCommon(!1)}};r.addDragSource(n,!0),this.addDestroyFunc(()=>r.removeDragSource(n))}createDragItem(){const e=this.column.getColId(),t={[e]:this.column.isVisible()},s=this.beans.columnStateUpdateStrategy,i={[e]:l0(this.column,s,oe(this.params))};return{columns:[this.column],visibleState:t,pivotState:i}}onColumnStateChanged(){this.processingColumnStateChange=!0;const e=this.beans.columnStateUpdateStrategy,t=e.getPivotMode(oe(this.params));if(t){const r=e.isColumnSelectedInPivotModeToolPanel(oe(this.params),this.column);this.cbSelect.setValue(r)}else this.cbSelect.setValue(e.isColumnVisibleInToolPanel(oe(this.params),this.column));let s=!0,i=!0;if(t){const r=this.gos.get("functionsReadOnly"),o=!this.column.isAnyFunctionAllowed();s=!r&&!o,i=s}else{const{enableRowGroup:r,enableValue:o,lockPosition:n,suppressMovable:a,lockVisible:l}=this.column.getColDef(),c=!!r||!!o,d=!!n||!!a;s=!l,i=c||!d}this.cbSelect.setReadOnly(!s),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!i),this.toggleCss("ag-column-select-column-readonly",!i&&!s),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect;e!==t.getValue()&&(t.isReadOnly()||t.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(e){F(158)}},sz=class{constructor(e){this.items=e}getRowCount(){return this.items.length}getRow(e){return this.items[e]}},iz="ag-column-select-list",rz=class extends A{constructor(){super({tag:"div",cls:iz,role:"presentation"}),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1,this.skipRefocus=!1}wireBeans(e){this.colModel=e.colModel}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[];for(const e of this.destroyColumnItemFuncs)e();this.destroyColumnItemFuncs=[]}init(e,t,s){this.params=e;const{suppressSyncLayoutWithGrid:i,contractColumnSelection:r,suppressColumnMove:o}=e;this.allowDragging=t,this.eventType=s,i||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const n=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:n,columnPivotModeChanged:n,columnRowGroupChanged:n,columnValueChanged:n,columnVisible:n,newColumnsLoaded:n}),this.expandGroupsByDefault=!r;const a=o||i,l=this.createManagedBean(new Vo({cssIdentifier:"column-select",ariaRole:"tree",moveItemCallback:(c,d)=>{a||this.moveItems(c,d)}}));this.virtualList=l,this.appendChild(l.getGui()),l.setComponentCreator((c,d)=>(on(d,c.depth+1),this.createComponentFromItem(c,d))),this.colModel.ready&&this.onColumnsChanged(),!a&&this.createItemDragFeature()}createItemDragFeature(){const{gos:e,beans:t,virtualList:s}=this;this.createManagedBean(new Gy(this,s,{dragSourceType:ns.ToolPanel,addListeners:(i,r,o)=>{i.addManagedEventListeners({columnPanelItemDragStart:r,columnPanelItemDragEnd:o})},getCurrentDragValue:i=>JH(i),isMoveBlocked:i=>f0(e,t,Ap(i),this.params),getNumRows:i=>i.getDisplayedColsList().length,moveItem:(i,r)=>m0(t,Ap(i),r,this.params)}))}moveItems(e,t){const{gos:s,beans:i}=this,{modelItem:r}=e,{group:o,columnGroup:n,column:a,expanded:l}=r,c=Ap(o?n:a);if(f0(s,i,c,this.params))return;const d=this.displayedColsList.indexOf(r),u=t?-1:1;let h=0;if(t){const p=e.columnDepth>0?a.getParent()?.getChildren():null;p?.length&&a===p[0]&&(h=-1)}else o&&(h=l?r.children.length:0);const g=Math.min(Math.max(d+h+u,0),this.displayedColsList.length-1);this.skipRefocus=!0,m0(i,c,{rowIndex:g,position:t?"top":"bottom",component:this.virtualList.getComponentAt(g)},this.params),this.focusRowIfAlive(g-h).then(()=>{this.skipRefocus=!1})}createComponentFromItem(e,t){const s=this.allowDragging;if(e.group){const r=new p0(e,s,this.eventType,t,this.params);return this.createBean(r),r}const i=new tz(e,s,this.groupsExist,t,this.params);return this.createBean(i),i}onColumnsChanged(){const e=this.params;this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!e.initialState);const t=this.getExpandedStates(),s=this.colModel.isPivotMode(),i=oe(e),r=i&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(i);(!e.suppressSyncLayoutWithGrid||i)&&!s||r?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const e={};if(this.isInitialState){const{expandedGroupIds:t}=this.params.initialState;for(const s of t)e[s]=!0;return e}return this.allColsTree?(this.forEachItem(t=>{if(!t.group)return;const s=t.columnGroup;s&&(e[s.getId()]=t.expanded)}),e):{}}setExpandedStates(e){if(!this.allColsTree)return;const{isInitialState:t}=this;this.forEachItem(s=>{if(!s.group)return;const i=s.columnGroup;if(i){const r=e[i.getId()];(r!=null||t)&&(s.expanded=!!r)}})}buildTreeFromWhatGridIsDisplaying(){const e=oe(this.params);if(e&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(e)){const t=this.beans.columnStateUpdateStrategy.getPrimaryColumns(e);if(t.length>0){BH(t,this.setColumnLayout.bind(this));return}}if(this.params.suppressSyncLayoutWithGrid){this.buildTreeFromProvidedColumnDefs();return}s0(this.colModel,this.setColumnLayout.bind(this))}setColumnLayout(e){const t=t0(this.colModel,e);this.buildListModel(t),this.groupsExist=e.some(s=>s&&typeof s.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){const e=this.colModel;this.buildListModel(e.getColDefColTree()),this.groupsExist=!!e.colDefCols?.treeDepth}buildListModel(e){const t=this.onColumnExpanded.bind(this),s=a=>{a.addEventListener("expandedChanged",t);const l=a.removeEventListener.bind(a,"expandedChanged",t);this.destroyColumnItemFuncs.push(l)},i=this.beans.colNames,r=(a,l,c)=>{for(const d of a)Re(d)?o(d,l,c):n(d,l,c)},o=(a,l,c)=>{if(a.getColGroupDef()?.suppressColumnsToolPanel)return;if(a.isPadding()){r(a.getChildren(),l,c);return}const h=i.getDisplayNameForProvidedColumnGroup(null,a,"columnToolPanel"),g=new r0(h,a,l,!0,this.expandGroupsByDefault);c.push(g),s(g),r(a.getChildren(),l+1,g.children)},n=(a,l,c)=>{if(a.getColDef()?.suppressColumnsToolPanel)return;const u=i.getDisplayNameForColumn(a,"columnToolPanel");c.push(new r0(u,a,l))};this.destroyColumnTree(),r(e,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const e=i=>{i.passesFilter&&(this.displayedColsList.push(i),i.group&&i.expanded&&i.children.forEach(e))},t=this.virtualList;this.allColsTree.forEach(e),t.setModel(new sz(this.displayedColsList));let s=null;this.skipRefocus||(s=t.getLastFocusedRow()),t.refresh(),s!=null&&this.focusRowIfAlive(s),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const e=this.getLocaleTextFunc(),t=e("ariaColumnPanelList","Column List"),s=e("columns","Columns"),i=this.displayedColsList.length;de(this.virtualList.getAriaElement(),`${t} ${i} ${s}`)}focusRowIfAlive(e){return e===-1?Promise.resolve():new Promise(t=>{window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e),t()},0)})}forEachItem(e){const t=i=>{for(const r of i)e(r),r.group&&t(r.children)},s=this.allColsTree;s&&t(s)}doSetExpandedAll(e){this.forEachItem(t=>{t.group&&(t.expanded=e)})}setGroupsExpanded(e,t){if(!t){this.doSetExpandedAll(e);return}const s=[];this.forEachItem(r=>{if(!r.group)return;const o=r.columnGroup.getId();t.indexOf(o)>=0&&(r.expanded=e,s.push(o))});const i=t.filter(r=>!s.includes(r));i.length>0&&F(157,{unrecognisedGroupIds:i})}getExpandState(){let e=0,t=0;return this.forEachItem(s=>{s.group&&(s.expanded?e++:t++)}),e>0&&t>0?2:t>0?1:0}doSetSelectedAll(e){o0(this.beans,this.allColsTree,e,this.eventType,this.params),this.syncVisibleSelectionState(),this.fireSelectionChangedEvent()}syncVisibleSelectionState(){for(let e=0;e{if(r.group||!r.passesFilter)return;const o=r.column,n=o.getColDef();let a;if(i){if(!o.isAllowPivot()&&!o.isAllowRowGroup()&&!o.isAllowValue())return;a=s.isColumnSelectedInPivotModeToolPanel(oe(this.params),o)??!1}else{if(n.lockVisible)return;a=s.isColumnVisibleInToolPanel(oe(this.params),o)??!1}a?e++:t++}),!(e>0&&t>0))return!(e===0||t>0)}setFilterText(e){this.filterText=D(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const e=s=>{if(!D(this.filterText))return!0;const i=s.displayName;return i==null||i.toLowerCase().indexOf(this.filterText)!==-1},t=(s,i)=>{let r=!1;if(s.group){const n=e(s);for(const a of s.children){const l=t(a,n||i);l&&(r=l)}}const o=i||r?!0:e(s);return s.passesFilter=o,o};for(const s of this.allColsTree)t(s,!1)}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const e=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:e})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const e=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:e})}getExpandedGroups(){const e=[];return this.allColsTree&&this.forEachItem(t=>{t.group&&t.expanded&&e.push(t.columnGroup.getId())}),e}},oz={selector:"AG-PRIMARY-COLS-LIST",component:rz},nz={tag:"div",cls:"ag-column-select",children:[{tag:"ag-primary-cols-header",ref:"primaryColsHeaderPanel"},{tag:"ag-primary-cols-list",ref:"primaryColsListPanel"}]},C0=class extends A{constructor(){super(nz,[VH,oz]),this.primaryColsHeaderPanel=x,this.primaryColsListPanel=x,this.registerCSS(kH)}init(e,t,s){const{primaryColsHeaderPanel:i,primaryColsListPanel:r}=this;i.init(t);const o=t.suppressColumnFilter,n=t.suppressColumnSelectAll;t.suppressColumnExpandAll&&o&&n&&i.setDisplayed(!1),this.addManagedListeners(r,{groupExpanded:l=>{i.setExpandState(l.state),t.onStateUpdated()},selectionChanged:l=>i.setSelectionState(l.state)}),r.init(t,e,s),this.addManagedListeners(i,{expandAll:r.doSetExpandedAll.bind(r,!0),collapseAll:r.doSetExpandedAll.bind(r,!1),selectAll:r.doSetSelectedAll.bind(r,!0),unselectAll:r.doSetSelectedAll.bind(r,!1),filterChanged:l=>r.setFilterText(l.filterText)}),this.positionableFeature=this.createManagedBean(new yl(this.getGui(),{minHeight:100}))}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1)}expandGroups(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)}collapseGroups(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)}setColumnLayout(e){this.primaryColsListPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},az=".ag-column-panel{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ag-pivot-mode-panel{display:flex;height:var(--ag-header-height)}.ag-pivot-mode-select{align-items:center;display:flex}:where(.ag-ltr) .ag-pivot-mode-select{margin-left:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-pivot-mode-select{margin-right:var(--ag-widget-container-horizontal-padding)}.ag-column-panel-column-select:where(:not(.ag-last-visible-child)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-column-select:where(:nth-child(n+2 of :not(.ag-hidden))){border-top:var(--ag-tool-panel-separator-border)}:where(.ag-column-panel) .ag-column-drop-vertical{flex:1 1 0px;min-height:50px}:where(.ag-column-panel) .ag-column-drop-vertical:where(:not(.ag-last-column-drop)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-buttons{display:flex;flex-wrap:wrap;gap:var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0;:where(.ag-standard-button){transition:background-color .25s ease-in-out,color .25s ease-in-out}}.ag-column-panel-buttons:where(:last-child){padding-bottom:var(--ag-widget-container-vertical-padding)}.ag-column-panel-buttons-button{line-height:1.5}:where(.ag-column-panel) .ag-column-panel-buttons-apply-button:not(:disabled){background-color:var(--ag-column-panel-apply-button-background-color);color:var(--ag-column-panel-apply-button-color)}",lz="ag-column-panel-deferred",cz=class extends A{constructor(){super({tag:"div",cls:"ag-column-panel"}),this.initialised=!1,this.childDestroyFuncs=[],this.isDeferModeEnabled=!1,this.isCommitting=!1,this.onDeferredApply=()=>{this.isCommitting=!0;try{this.beans.columnStateUpdateStrategy.commit(this.isDeferModeEnabled)}finally{this.isCommitting=!1}this.deferredButtonsComp?.updateValidity(!1),this.lastKnownGridState=this.captureGridState()},this.onDeferredCancel=()=>{this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled),this.deferredButtonsComp?.updateValidity(!1),this.refreshToolPanelLayouts(),this.pivotModePanel?.refreshEditStrategy(),this.lastKnownGridState=this.captureGridState()},this.onPivotModePanelValueChanged=()=>{this.refreshToolPanelLayouts(),this.setLastVisible(),this.deferredButtonsComp?.updateValidity(this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))},this.onColumnEverythingChanged=()=>{if(!this.isDeferModeEnabled||this.isCommitting)return;const e=this.captureGridState();if(!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled)){this.lastKnownGridState=e;return}const t=this.lastKnownGridState&&this.isGridStateEqual(this.lastKnownGridState,e);this.lastKnownGridState=e,t&&this.resetDeferredState()},this.onExternalGridChange=()=>{!this.isDeferModeEnabled||this.isCommitting||this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled)&&(this.resetDeferredState(),this.lastKnownGridState=this.captureGridState())},this.registerCSS(az)}wireBeans(e){this.colToolPanelFactory=e.colToolPanelFactory}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}init(e){const s={...N(this.gos,{suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1}),...e};this.params=s;const{childDestroyFuncs:i,colToolPanelFactory:r,gos:o}=this,n=o.isModuleRegistered("SharedPivot"),a=n||o.isModuleRegistered("SharedRowGrouping");this.isDeferModeEnabled=oe(s),this.toggleCss(lz,this.isDeferModeEnabled),!s.suppressPivotMode&&r&&n&&(this.pivotModePanel=r.createPivotModePanel(this,i,s,this.onPivotModePanelValueChanged));const l=this.createBean(new C0);if(this.primaryColsPanel=l,i.push(()=>this.destroyBean(this.primaryColsPanel)),l.init(!0,s,"toolPanelUi"),l.addCss("ag-column-panel-column-select"),this.appendChild(l),r){!s.suppressRowGroups&&a&&(this.rowGroupDropZonePanel=r.createRowGroupPanel(this,i,s)),!s.suppressValues&&a&&(this.valuesDropZonePanel=r.createValuesPanel(this,i,s)),!s.suppressPivots&&n&&(this.pivotDropZonePanel=r.createPivotPanel(this,i,s)),this.setLastVisible();const[c]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});i.push(()=>c())}if(this.isDeferModeEnabled){const c=this.onExternalGridChange;i.push(...this.addManagedEventListeners({columnEverythingChanged:this.onColumnEverythingChanged,sortChanged:c,columnVisible:c,columnRowGroupChanged:c,columnValueChanged:c,columnPivotChanged:c,columnPivotModeChanged:c,newColumnsLoaded:c,...s.suppressSyncLayoutWithGrid?{}:{columnMoved:c}}))}s.buttons&&(s.buttons.includes("apply")||F(298),s.buttons.length&&this.initDeferredButtons(s.buttons)),this.initialised=!0}initDeferredButtons(e){const t=this.createBean(new Mo({className:"ag-column-panel-buttons"}));this.deferredButtonsComp=t,this.childDestroyFuncs.push(()=>{this.deferredButtonsComp=this.destroyBean(this.deferredButtonsComp)});const s=this.getLocaleTextFunc(),i=e.map(r=>({type:r,label:s(r==="apply"?"applyColumnToolPanel":"cancelColumnToolPanel",r==="apply"?"Apply":"Cancel")}));t.updateButtons(i),t.updateValidity(!1),t.addManagedListeners(t,{apply:this.onDeferredApply,cancel:this.onDeferredCancel}),this.appendChild(t)}resetDeferredState(){this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled),this.deferredButtonsComp?.updateValidity(!1),this.refreshToolPanelLayouts(),this.pivotModePanel?.refreshEditStrategy()}captureGridState(){const{beans:e}=this,t=s=>(s??[]).map(i=>i.getColId());return{rowGroupColIds:t(e.rowGroupColsSvc?.columns),valueColIds:t(e.valueColsSvc?.columns),pivotColIds:t(e.pivotColsSvc?.columns),pivotMode:e.colModel.isPivotMode(),columnOrder:e.colModel.getCols().map(s=>s.getColId()),visibleColIds:e.colModel.getCols().filter(s=>s.isVisible()).map(s=>s.getColId()),sortState:e.colModel.getCols().filter(s=>s.getSort()).map(s=>`${s.getColId()}:${s.getSort()}:${s.getSortIndex()}`),aggFuncState:(e.valueColsSvc?.columns??[]).map(s=>s.getAggFunc()),widthState:e.colModel.getCols().map(s=>`${s.getColId()}:${s.getActualWidth()}`)}}isGridStateEqual(e,t){return be(e.rowGroupColIds,t.rowGroupColIds)&&be(e.valueColIds,t.valueColIds)&&be(e.pivotColIds,t.pivotColIds)&&e.pivotMode===t.pivotMode&&be(e.columnOrder,t.columnOrder)&&be(e.visibleColIds,t.visibleColIds)&&be(e.sortState,t.sortState)&&be(e.aggFuncState,t.aggFuncState)&&be(e.widthState,t.widthState)}refreshDeferredUi(){this.refreshToolPanelLayouts(),this.setLastVisible(),this.pivotModePanel?.refreshEditStrategy(),this.deferredButtonsComp?.updateValidity(this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))}refreshToolPanelLayouts(){this.primaryColsPanel.syncLayoutWithGrid(),this.rowGroupDropZonePanel?.refreshGui(),this.valuesDropZonePanel?.refreshGui(),this.pivotDropZonePanel?.refresh()}setPivotModeSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.pivotModePanel=t.setPanelVisible(this.pivotModePanel,e,t.createPivotModePanel.bind(t,this,this.childDestroyFuncs,this.params,this.onPivotModePanelValueChanged,!0)),this.setLastVisible())}setRowGroupsSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.rowGroupDropZonePanel=t.setPanelVisible(this.rowGroupDropZonePanel,e,t.createRowGroupPanel.bind(t,this,this.childDestroyFuncs,this.params)),this.setLastVisible())}setValuesSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.valuesDropZonePanel=t.setPanelVisible(this.valuesDropZonePanel,e,t.createValuesPanel.bind(t,this,this.childDestroyFuncs,this.params)),this.setLastVisible())}setPivotSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.pivotDropZonePanel=t.setPanelVisible(this.pivotDropZonePanel,e,t.createPivotPanel.bind(t,this,this.childDestroyFuncs,this.params)),this.pivotDropZonePanel?.setDisplayed(e),this.setLastVisible())}setResizers(){for(const e of[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel]){if(!e)continue;const t=e.getGui();e.toggleResizable(!t.classList.contains("ag-last-column-drop")&&!t.classList.contains("ag-hidden")&&!t.classList.contains("ag-last-visible-child"))}}setLastVisible(){const e=this.getGui(),t=Array.prototype.slice.call(e.querySelectorAll(".ag-column-drop"));for(const r of t)r.classList.remove("ag-last-column-drop");const s=e.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=W(s);i&&i.classList.add("ag-last-column-drop"),this.primaryColsPanel.getGui().classList.toggle("ag-last-visible-child",!i),this.setResizers()}resetChildrenHeight(){const t=this.getGui().children;for(let s=0;so.getGui().getBoundingClientRect()),r=i.findIndex(o=>this.horizontal?o.right>s&&o.lefts);if(r===-1){const o=this.gos.get("enableRtl");return i.every(l=>s>(this.horizontal?l.right:l.bottom))?o&&this.horizontal?0:this.childPillComponents.length:i.every(l=>s<(this.horizontal?l.left:l.top))?o&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=r?r+1:r}checkDragStartedBySelf(e){this.state==="notDragging"&&(this.state="rearrangeItems",this.potentialDndItems=this.getItems(e.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(e),this.refreshGui())}onDragging(e){this.checkDragStartedBySelf(e),this.checkInsertIndex(e)&&this.refreshGui()}handleDragEnterEnd(e){}onDragEnter(e){const t=this.getItems(e.dragSource.getDragItem());this.state="newItemsIn";const s=t.filter(r=>this.isItemDroppable(r,e)),i=s.every(r=>this.childPillComponents.map(o=>o.getItem()).indexOf(r)!==-1);if(s.length!==0){if(this.potentialDndItems=s,i){this.state="notDragging";return}this.handleDragEnterEnd(e),this.checkInsertIndex(e),this.refreshGui()}}isPotentialDndItems(){return!!this.potentialDndItems?.length}handleDragLeaveEnd(e){}onDragLeave(e){if(this.state==="rearrangeItems"){const t=this.getItems(e.dragSource.getDragItem());this.removeItems(t)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}onDragCancel(e){this.isPotentialDndItems()&&(this.state==="newItemsIn"&&this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}onDragStop(){this.isPotentialDndItems()&&(this.state==="newItemsIn"?this.addItems(this.potentialDndItems):this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}removeItems(e){const t=this.getExistingItems().filter(s=>!e.includes(s));this.updateItems(t),this.refreshGui()}addItems(e){if(!e)return;const t=this.getExistingItems().slice(),s=e.filter(i=>t.indexOf(i)<0);v0(t,s,this.insertIndex),this.updateItems(t),this.refreshGui()}addItem(e){this.insertIndex=this.getExistingItems().length,this.addItems([e])}rearrangeItems(e,t){let s;return t?s=this.getExistingItems().filter(i=>e.indexOf(i)===-1):s=this.getNonGhostItems().slice(),v0(s,e,this.insertIndex),be(s,this.getExistingItems())?!1:(this.updateItems(s),this.refreshGui(),!0)}refreshGui(){let e=0;this.horizontal||(e=this.ePillDropList.scrollTop);const t=this.resizeEnabled,s=this.getFocusedItem(),{eGridDiv:i}=this.beans,r=Dn();let o=null;r&&(o=Qe(this.beans,i)??Qe(this.beans,i,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),e!==0&&(this.ePillDropList.scrollTop=e),t&&this.toggleResizable(t),r&&this.restoreFocus(s,o)}getFocusedItem(){const e=this.getGui(),t=ie(this.beans);return e.contains(t)?Array.from(e.querySelectorAll(".ag-column-drop-cell")).indexOf(t):-1}focusItemAtIndex(e){const t=this.getGui(),i=Array.from(t.querySelectorAll(".ag-column-drop-cell"))[e];i&&i.focus({preventScroll:!0})}restoreFocus(e,t){const s=this.getGui(),i=Array.from(s.querySelectorAll(".ag-column-drop-cell"));if(e===-1)return;i.length===0&&t.focus();const r=Math.min(i.length-1,e),o=i[r];o&&o.focus()}focusList(e){const t=e?this.childPillComponents.length-1:0;this.restoreFocus(t,this.getFocusableElement())}getNonGhostItems(){const e=this.getExistingItems();return this.isPotentialDndItems()?e.filter(t=>!this.potentialDndItems.includes(t)):e}addItemsToGui(){const t=this.getNonGhostItems().map(s=>this.createItemComponent(s,!1));if(this.isPotentialDndItems()){const s=this.potentialDndItems.map(i=>this.createItemComponent(i,!0));this.insertIndex>=t.length?t.push(...s):t.splice(this.insertIndex,0,...s)}this.appendChild(this.ePillDropList),t.forEach((s,i)=>{i>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(s.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){const{childPillComponents:e,ePillDropList:t}=this,s=e.length;Ie(t,s===0?"presentation":"listbox");for(let i=0;ithis.destroyBean(s)),t||this.childPillComponents.push(s),s}addIconAndTitleToGui(){const{title:e,icon:t}=this.params;if(!e||!t)return;const s=re({tag:"div"});if(Ua(s,!0),this.addElementClasses(s,"title-bar"),this.addElementClasses(t,"icon"),this.toggleCss("ag-column-drop-empty",this.isExistingItemsEmpty()),s.appendChild(t),!this.horizontal){const i=re({tag:"span"});this.addElementClasses(i,"title"),i.textContent=e,s.appendChild(i)}this.appendChild(s)}isExistingItemsEmpty(){return this.getExistingItems().length===0}addEmptyMessageToGui(){const{emptyMessage:e}=this.params;if(!e||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;const t=re({tag:"span"});t.textContent=e,this.addElementClasses(t,"empty-message"),this.ePillDropList.appendChild(t)}addArrow(e){if(this.horizontal){const t=this.gos.get("enableRtl"),s=_(t?"panelDelimiterRtl":"panelDelimiter",this.beans);this.addElementClasses(s,"cell-separator"),e.appendChild(s)}}},hz={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},b0=class extends A{constructor(e,t,s,i,r){super(),this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=s,this.template=i,this.agComponents=r,this.eText=x,this.eDragHandle=x,this.eButton=x}postConstruct(){this.setTemplate(this.template??hz,this.agComponents);const e=this.getGui(),{beans:t,eDragHandle:s,eText:i,eButton:r}=this;this.addElementClasses(e),this.addElementClasses(s,"drag-handle"),this.addElementClasses(i,"text"),this.addElementClasses(r,"button"),s.appendChild(_("columnDrag",t)),r.appendChild(_("cancel",t)),this.tooltipFeature=this.createOptionalManagedBean(t.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui()})),this.setupComponents(),!this.ghost&&this.isDraggable()&&this.addDragSource(),this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){const e=this.getLocaleTextFunc(),t=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(t,e),de(this.getGui(),t.join(". "))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){const s=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(s)}}setupTooltip(){const e=()=>this.tooltipFeature?.setTooltipAndRefresh(this.getTooltip());e(),this.addManagedEventListeners({newColumnsLoaded:e})}getDragSourceId(){}getDefaultIconName(){return"notAllowed"}addDragSource(){const{beans:{dragAndDrop:e},eDragHandle:t}=this,s=this.createGetDragItem(),i=this.getDefaultIconName(),r={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>i,getDragItem:s,dragItemName:this.getDisplayName()};e?.addDragSource(r,!0),this.addDestroyFunc(()=>e?.removeDragSource(r))}setupComponents(){this.eText.textContent=this.getDisplayValue(),this.setupRemove(),this.ghost&&this.addCss("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){V(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const e={type:"columnRemove"};this.addGuiEventListener("keydown",s=>this.onKeyDown(s)),this.addManagedElementListeners(this.eButton,{click:s=>{this.dispatchLocalEvent(e),s.stopPropagation()}});const t=new as(this.eButton);this.addManagedListeners(t,{tap:()=>this.dispatchLocalEvent(e)}),this.addDestroyFunc(t.destroy.bind(t))}onKeyDown(e){e.key===b.DELETE&&this.isRemovable()&&(e.preventDefault(),this.dispatchLocalEvent({type:"columnRemove"}))}getDisplayValue(){return this.getDisplayName()}addElementClasses(e,t){t=t?`-${t}`:"";const s=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${s}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}},gz=class extends b0{constructor(e,t,s,i,r,o){super(t,s,r),this.column=e,this.dropZonePurpose=i,this.updateParams=o,this.eSortIndicator=x,this.popupShowing=!1,this.deferApply=oe(o)}postConstruct(){const{sortSvc:e,colNames:t}=this.beans;this.template={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},e?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:void 0,{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},e&&(this.agComponents=[e.getSortIndicatorSelector()]),this.displayName=t.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.deferApply&&this.eDragHandle.setAttribute("data-column-tool-panel-deferred",""),e&&(this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}})),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(e,t){const s=this.gos.get("rowGroupPanelSuppressSort"),i=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!i){const r=t("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");e.push(r)}if(this.isGroupingZone()&&this.column.isSortable()&&!s){const r=t("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");e.push(r)}super.addAdditionalAriaInstructions(e,t)}isMovable(){return this.isDraggable()}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const e=this.getLocaleTextFunc(),{name:t,aggFuncName:s}=this.getColumnAndAggFuncName(),i=e("ariaDropZoneColumnComponentAggFuncSeparator"," of "),r={asc:e("ariaDropZoneColumnComponentSortAscending","ascending"),desc:e("ariaDropZoneColumnComponentSortDescending","descending")},o=this.getCurrentSortDirection(this.column),n=this.gos.get("rowGroupPanelSuppressSort");return[s&&`${s}${i}`,t,this.isGroupingZone()&&!n&&o&&`, ${r[o]}`].filter(a=>!!a).join("")}getColumnAndAggFuncName(){const e=this.displayName;let t="";if(this.isAggregationZone()){const s=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column),i=typeof s=="string"?s:"agg";t=this.getLocaleTextFunc()(i,i)}return{name:e,aggFuncName:t}}setupSort(){if(!this.column.isSortable()||!this.isGroupingZone())return;const{gos:e,column:t,eSortIndicator:s}=this;if(!e.get("rowGroupPanelSuppressSort")){s.setupSort(t,!0,this.getSortDefOverride.bind(this));const i=r=>{r.preventDefault(),this.beans.columnStateUpdateStrategy.progressSortFromEvent(this.deferApply,t,r),s.refresh(),this.setupAria(),Dt(this.beans,this.updateParams)};this.addGuiEventListener("click",i),this.addGuiEventListener("keydown",r=>{r.key===b.ENTER&&this.isGroupingZone()&&i(r)})}}getCurrentSortDirection(e){return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply,e)?.direction??null}getSortDefOverride(){if(this.deferApply)return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply,this.column)}getDefaultIconName(){return"hide"}createGetDragItem(){const{column:e}=this;return()=>{const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(e){super.onKeyDown(e),e.key===b.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(e.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:e,aggFuncName:t}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${t}(${e})`:e}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const{aggFuncSvc:e,popupSvc:t}=this.beans,s=new Vo({cssIdentifier:"select-agg-func"}),i=e.getFuncNames(this.column),r=this.getGui(),o=s.getGui();s.setModel({getRow:function(g){return i[g]},getRowCount:function(){return i.length}}),this.createBean(s);const n=re({tag:"div",cls:"ag-select-agg-func-popup"});n.style.top="0px",n.style.left="0px",n.appendChild(o),n.style.width=`${r.clientWidth}px`;const[a]=this.addManagedElementListeners(n,{focusout:g=>{!n.contains(g.relatedTarget)&&d&&d.hideFunc()}}),l=g=>{this.destroyBean(s),this.popupShowing=!1,g?.key==="Escape"&&r.focus(),a&&a()},c=this.getLocaleTextFunc(),d=t.addPopup({modal:!0,eChild:n,closeOnEsc:!0,closedCallback:l,ariaLabel:c("ariaLabelAggregationFunction","Aggregation Function")});d&&s.setComponentCreator(this.createAggSelect.bind(this,d.hideFunc)),s.addGuiEventListener("keydown",g=>{if(g.key===b.ENTER||g.key===b.SPACE){const p=s.getLastFocusedRow();if(p==null)return;const f=s.getComponentAt(p);f&&f.selectItem()}}),t.positionPopupByComponent({type:"aggFuncSelect",eventSource:r,ePopup:n,keepWithinBounds:!0,additionalParams:{column:this.column},position:"under"}),s.refresh();const u=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column);let h=i.findIndex(g=>g===u);h===-1&&(h=0),s.focusRow(h)}createAggSelect(e,t){const s=()=>{if(e(),this.getGui().focus(),this.beans.columnStateUpdateStrategy.setColumnAggFunc(this.deferApply,this.column,t,"toolPanelDragAndDrop"),this.column){const a=this.getGui().querySelector(".ag-column-drop-cell-text");a&&(a.textContent=this.getDisplayValue()),this.setupAria()}Dt(this.beans,this.updateParams)},i=this.getLocaleTextFunc(),r=(t||"").toString(),o=i(r,r);return new pz(s,o)}isGroupingAndLocked(){return this.isGroupingZone()&&ya(this.column,this.beans)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return ns.ToolPanel}destroy(){super.destroy(),this.column=null}},pz=class extends A{constructor(e,t){super({tag:"div",cls:"ag-select-agg-func-item",children:t}),this.selectItem=e,this.addGuiEventListener("click",this.selectItem)}},Ip=class extends w0{constructor(e,t,s){super(e),this.dropZonePurpose=t,this.updateParams=s,this.addElementClasses(this.getGui(),this.dropZonePurpose.toLowerCase())}init(e){super.init(e),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(e){return e.columns??[]}isInterestedIn(e,t){return e===ns.HeaderCell?!0:e!==ns.ToolPanel?!1:this.horizontal?!t.hasAttribute("data-column-tool-panel-deferred"):!0}minimumAllowedNewInsertIndex(){const{gos:e,rowGroupColsSvc:t}=this.beans,s=e.get("groupLockGroupColumns"),i=t?.columns.length??0;return s===-1?i:Math.min(s,i)}showOrHideColumnOnExit(e){return this.isRowGroupPanel()&&ru(this.gos,!0)&&!e.fromNudge}handleDragEnterEnd(e){if(this.showOrHideColumnOnExit(e)){const i=e.dragSource.getDragItem().columns;this.setColumnsVisible(i,!1,"uiColumnDragged")}}handleDragLeaveEnd(e){if(this.showOrHideColumnOnExit(e)){const s=e.dragSource.getDragItem();this.setColumnsVisible(s.columns,!0,"uiColumnDragged")}}setColumnsVisible(e,t,s){if(!e||oe(this.updateParams))return;const i=e.filter(r=>!r.getColDef().lockVisible);this.beans.columnStateUpdateStrategy.setColumnsVisible(!1,i,t,s)}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(e,t,s,i){return new gz(e,t,s,this.dropZonePurpose,i,this.updateParams)}},S0=class extends Ip{constructor(e,t){super(e,"pivot",t)}postConstruct(){const e=this.getLocaleTextFunc(),t=e("pivotColumnsEmptyMessage","Drag here to set column labels"),s=e("pivots","Column Labels");super.init({icon:_("pivotPanel",this.beans,null),emptyMessage:t,title:s}),this.horizontal&&ho(this.beans,this,this.getGui()),this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const e=this.beans.colModel,t=e.isPivotMode();if(this.horizontal)switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":{const s=e.isPivotActive();this.setDisplayed(t&&s);break}default:this.setDisplayed(!1);break}else this.setDisplayed(this.beans.columnStateUpdateStrategy.getPivotMode(oe(this.updateParams)))}isItemDroppable(e,t){if(this.gos.get("functionsReadOnly")||!e.isPrimary())return!1;const s=this.beans.columnStateUpdateStrategy.getPivotColumns(oe(this.updateParams)).includes(e);return e.isAllowPivot()&&(!s||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.columnStateUpdateStrategy.setPivotColumns(oe(this.updateParams),e,"toolPanelUi"),Dt(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getPivotColumns(oe(this.updateParams))}getFocusableContainerName(){return"pivotToolbar"}},y0=class extends Ip{constructor(e,t){super(e,"rowGroup",t)}postConstruct(){const e=this.getLocaleTextFunc(),t=e("rowGroupColumnsEmptyMessage","Drag here to set row groups"),s=e("groups","Row Groups");super.init({icon:_("rowGroupPanel",this.beans,null),emptyMessage:t,title:s}),this.horizontal&&ho(this.beans,this,this.getGui()),this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}isItemDroppable(e,t){if(this.gos.get("functionsReadOnly")||!e.isPrimary()||e.colDef.showRowGroup)return!1;const s=this.beans.columnStateUpdateStrategy.getRowGroupColumns(oe(this.updateParams)).includes(e);return e.isAllowRowGroup()&&(!s||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.columnStateUpdateStrategy.setRowGroupColumns(oe(this.updateParams),e,"toolPanelUi"),Dt(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getRowGroupColumns(oe(this.updateParams))}getFocusableContainerName(){return"rowGroupToolbar"}},fz=class extends Ip{constructor(e,t){super(e,"aggregation",t)}postConstruct(){const e=this.getLocaleTextFunc(),t=e("valueColumnsEmptyMessage","Drag here to aggregate"),s=e("values","Values");super.init({icon:_("valuePanel",this.beans,null),emptyMessage:t,title:s}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(e,t){if(this.gos.get("functionsReadOnly")||!e.isPrimary())return!1;const s=this.beans.columnStateUpdateStrategy.getValueColumns(oe(this.updateParams)).includes(e);return e.isAllowValue()&&(!s||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.columnStateUpdateStrategy.setValueColumns(oe(this.updateParams),e,"toolPanelUi"),Dt(this.beans,this.updateParams)}getExistingItems(){return this.beans.columnStateUpdateStrategy.getValueColumns(oe(this.updateParams))}},mz={tag:"div",cls:"ag-pivot-mode-panel",children:[{tag:"ag-toggle-button",ref:"cbPivotMode",cls:"ag-pivot-mode-select"}]},Cz=class extends A{constructor(e,t){super(),this.params=e,this.onPivotModeValueChanged=t,this.cbPivotMode=x}getCurrentPivotMode(){return this.beans.columnStateUpdateStrategy.getPivotMode(oe(this.params))}syncFromGrid(){this.cbPivotMode.setValue(this.getCurrentPivotMode())}refreshEditStrategy(){this.syncFromGrid()}postConstruct(){this.setTemplate(mz,[QS]);const e=this.cbPivotMode;e.setValue(this.getCurrentPivotMode());const t=this.getLocaleTextFunc();e.setLabel(t("pivotMode","Pivot Mode"));const s=()=>{const r=!!e.getValue();this.beans.columnStateUpdateStrategy.setPivotMode(oe(this.params),r,"toolPanelUi"),this.onPivotModeValueChanged?.()},i=()=>{e.setValue(this.getCurrentPivotMode())};this.addManagedListeners(e,{fieldValueChanged:s}),this.addManagedEventListeners({newColumnsLoaded:i,columnPivotModeChanged:i})}},vz=class extends E{constructor(){super(...arguments),this.beanName="colToolPanelFactory"}setPanelVisible(e,t,s){return e?e.setDisplayed(t):t&&(e=s()),e}createRowGroupPanel(e,t,s){return this.createPanel(e,t,new y0(!1,s))}createValuesPanel(e,t,s){return this.createPanel(e,t,new fz(!1,s))}createPivotPanel(e,t,s){return this.createPanel(e,t,new S0(!1,s))}createPivotModePanel(e,t,s,i,r){return this.createPanel(e,t,new Cz(s,i),r)}createPanel(e,t,s,i){return s=e.createBean(s),t.push(()=>e.destroyBean(s)),i?e.prependChild(s):e.appendChild(s),s}},x0=()=>{},wz=class extends E{constructor(){super(...arguments),this.beanName="columnStateUpdateExecutionStrategy"}applyColumnState(e,t,s){this.getUpdateStrategy(e).applyColumnState(t,s)}commit(e){this.getUpdateStrategy(e).commit()}hasPendingChanges(e){return this.getUpdateStrategy(e).hasPendingChanges()}moveColumns(e,t,s,i){this.getUpdateStrategy(e).moveColumns(t,s,i)}reset(e){this.getUpdateStrategy(e).reset()}setColumnsVisible(e,t,s,i){this.getUpdateStrategy(e).setColumnsVisible(t,s,i)}isColumnVisibleInToolPanel(e,t){return this.getUpdateStrategy(e).isColumnVisibleInToolPanel(t)}setRowGroupColumns(e,t,s){this.getUpdateStrategy(e).setRowGroupColumns(t,s)}getRowGroupColumns(e){return this.getUpdateStrategy(e).getRowGroupColumns()}getPrimaryColumns(e){return this.getUpdateStrategy(e).getPrimaryColumns()}hasDeferredColumnOrder(e){return this.getUpdateStrategy(e).hasDeferredColumnOrder()}setValueColumns(e,t,s){this.getUpdateStrategy(e).setValueColumns(t,s)}getValueColumns(e){return this.getUpdateStrategy(e).getValueColumns()}setColumnAggFunc(e,t,s,i){this.getUpdateStrategy(e).setColumnAggFunc(t,s,i)}getColumnAggFunc(e,t){return this.getUpdateStrategy(e).getColumnAggFunc(t)}setPivotColumns(e,t,s){this.getUpdateStrategy(e).setPivotColumns(t,s)}getPivotColumns(e){return this.getUpdateStrategy(e).getPivotColumns()}setPivotMode(e,t,s){this.getUpdateStrategy(e).setPivotMode(t,s)}getPivotMode(e){return this.getUpdateStrategy(e).getPivotMode()}isColumnSelectedInPivotModeToolPanel(e,t){return this.getUpdateStrategy(e).isColumnSelectedInPivotModeToolPanel(t)}progressSortFromEvent(e,t,s){this.getUpdateStrategy(e).progressSortFromEvent(t,s)}getSortDef(e,t){return this.getUpdateStrategy(e).getSortDef(t)}getUpdateStrategy(e){return e?this.getDeferredUpdateStrategy():this.getSyncUpdateStrategy()}getSyncUpdateStrategy(){return this.syncUpdateStrategy??(this.syncUpdateStrategy=new bz(this.beans))}getDeferredUpdateStrategy(){return this.deferredUpdateStrategy??(this.deferredUpdateStrategy=new Sz(this.beans))}},bz=class{constructor(e){this.beans=e,this.lastPivotColIds=[],this.reset=x0,this.commit=x0,this.hasPendingChanges=()=>!1,this.hasDeferredColumnOrder=()=>!1}applyColumnState(e,t){e.length!==0&&qe(this.beans,{state:e},t)}moveColumns(e,t,s){this.beans.colMoves?.moveColumns(e,t,s),yz(this.beans)}setColumnsVisible(e,t,s){const i=e.filter(r=>!r.getColDef().lockVisible);this.beans.colModel.setColsVisible(i,t,s)}setRowGroupColumns(e,t){this.beans.rowGroupColsSvc?.setColumns(e,t)}getRowGroupColumns(){return this.beans.rowGroupColsSvc?.columns??[]}getPrimaryColumns(){return Gp(this.beans)}setValueColumns(e,t){this.beans.valueColsSvc?.setColumns(e,t)}getValueColumns(){return this.beans.valueColsSvc?.columns??[]}setColumnAggFunc(e,t,s){this.beans.valueColsSvc?.setColumnAggFunc?.(e,t,s)}getColumnAggFunc(e){return e.getAggFunc()}setPivotColumns(e,t){this.lastPivotColIds=e.map(s=>s.getColId()),this.beans.pivotColsSvc?.setColumns(e,t)}getPivotColumns(){return this.beans.pivotColsSvc?.columns??[]}setPivotMode(e,t){const{colModel:s,gos:i,ctrlsSvc:r}=this.beans;if(e===s.isPivotMode())return;const o=this.beans.pivotColsSvc?.columns.map(n=>n.getColId())??[];if(o.length>0&&(this.lastPivotColIds=o),!e){const n=this.beans.colModel.getColDefCols()??[];qe(this.beans,{state:n.map(a=>({colId:a.getColId(),pivot:!1,pivotIndex:null}))},t)}i.updateGridOptions({options:{pivotMode:e},source:t}),e&&this.lastPivotColIds.length>0&&this.beans.pivotColsSvc?.setColumns(this.lastPivotColIds,t);for(const n of r.getHeaderRowContainerCtrls())n.refresh()}progressSortFromEvent(e,t){this.beans.sortSvc?.progressSortFromEvent(e,t)}isColumnVisibleInToolPanel(e){return e.isVisible()}isColumnSelectedInPivotModeToolPanel(e){return e.isAnyFunctionActive()}getPivotMode(){return this.beans.colModel.isPivotMode()}getSortDef(e){return e.getSortDef()}},Sz=class{constructor(e){this.beans=e,this.state={},this.sequence=0,this.lastPivotColIds=[]}reset(){this.sequence=0,this.state={}}hasPendingChanges(){const{state:e,beans:t}=this,{columnState:s,columnOrder:i,rowGroup:r,aggregation:o,pivot:n,pivotMode:a,sort:l,aggFuncs:c}=e,d=u=>(u??[]).map(h=>h.getColId());if(s)for(const[u,h]of s.patches){const g=t.colModel.getColDefCol(u);if(g&&(h.hide!==void 0&&h.hide!==!g.isVisible()||h.rowGroup!==void 0&&!!h.rowGroup!==g.isRowGroupActive()||h.pivot!==void 0&&!!h.pivot!==g.isPivotActive()||h.aggFunc!==void 0&&(h.aggFunc??null)!==(g.getAggFunc()??null)))return!0}if(i&&!be(i.colIds,Lp(t))||r&&!be(r.colIds,d(t.rowGroupColsSvc?.columns))||o&&!be(o.colIds,d(t.valueColsSvc?.columns))||n&&!be(n.colIds,d(t.pivotColsSvc?.columns))||a&&a.pivotMode!==t.colModel.isPivotMode())return!0;if(l){for(const[u,h]of l.sortDefsByColId){const g=t.colModel.getColDefCol(u);if(g&&(h?.direction??null)!==(g.getSortDef()?.direction??null))return!0}if(l.baselineCleared){const u=Gp(t);for(const h of u)if(!l.sortDefsByColId.has(h.getColId())&&h.getSortDef()!==null)return!0}}if(c)for(const[u,h]of c.values){const g=t.colModel.getColDefCol(u);if(g&&h!==g.getAggFunc())return!0}return!1}commit(){const{beans:e,state:t}=this,s=[];for(const r of Object.keys(t)){const o=t[r];o&&s.push({type:r,...o})}const i=s.sort((r,o)=>r.seq-o.seq);for(const r of i)switch(r.type){case"columnState":{qe(e,{state:[...r.patches.values()]},r.eventType);break}case"columnOrder":{const o=r.colIds.map(n=>e.colModel.getColDefCol(n)).filter(n=>!!n&&Fa(n));if(!e.colModel.isPivotMode())for(let n=0;nFa(u)),d=(c>=0?c:0)+n;l[d]!==a&&e.colMoves?.moveColumns([a],d,r.eventType,!0)}R0(e,o);break}case"rowGroup":{e.rowGroupColsSvc?.setColumns(r.colIds,r.eventType);break}case"aggregation":{e.valueColsSvc?.setColumns(r.colIds,r.eventType);break}case"pivot":{this.lastPivotColIds=r.colIds,e.pivotColsSvc?.setColumns(r.colIds,r.eventType);break}case"pivotMode":{const{colModel:o,ctrlsSvc:n,gos:a,stateSvc:l}=e;if(r.pivotMode!==o.isPivotMode()){const c=e.pivotColsSvc?.columns.map(h=>h.getColId())??[];c.length>0&&(this.lastPivotColIds=c);const d=l?.getState().pivot?.pivotColIds??c,u=r.pivotMode?this.state.pivot?.colIds??this.lastPivotColIds:d;if(l?.setState({...l.getState(),pivot:{pivotMode:r.pivotMode,pivotColIds:u}},["pivot"]),!r.pivotMode){const h=e.colModel.getColDefCols()??[];qe(e,{state:h.map(g=>({colId:g.getColId(),pivot:!1,pivotIndex:null}))},r.eventType)}a.updateGridOptions({options:{pivotMode:r.pivotMode},source:r.eventType}),r.pivotMode&&u.length>0&&e.pivotColsSvc?.setColumns(u,r.eventType);for(const h of n.getHeaderRowContainerCtrls())h.refresh()}break}case"sort":{const o=[];let n=0;for(const[a,l]of r.sortDefsByColId)o.push({colId:a,sort:l?.direction??null,sortIndex:l?.direction?n++:null,sortType:l?.type??void 0});qe(e,{state:o,defaultState:r.baselineCleared?{sort:null,sortIndex:null,sortType:void 0}:void 0},r.eventType);break}case"aggFuncs":{for(const[o,n]of r.values){const a=e.colModel.getColDefCol(o);a&&e.valueColsSvc?.setColumnAggFunc?.(a,n,r.eventType)}break}}this.reset()}applyColumnState(e,t){for(const i of e)Op(this.state,i);const s=td(this.state);s.seq=ui(this.sequence),this.sequence=s.seq,s.eventType=t}moveColumns(e,t,s){const i=new Set(e.map(l=>l.getColId())),o=(this.state.columnOrder?.colIds??Lp(this.beans)).filter(l=>!i.has(l)),n=e.map(l=>l.getColId()),a=ui(this.sequence);this.sequence=a,this.state.columnOrder={colIds:[...o.slice(0,t),...n,...o.slice(t)],eventType:s,seq:a}}setColumnsVisible(e,t,s){for(const r of e)r.getColDef().lockVisible||Op(this.state,{colId:r.getColId(),hide:!t});const i=td(this.state);i.seq=ui(this.sequence),this.sequence=i.seq,i.eventType=s}setRowGroupColumns(e,t){Vp(this.state,"rowGroup");const s=ui(this.sequence);this.sequence=s,this.state.rowGroup={colIds:e.map(i=>i.getColId()),eventType:t,seq:s}}setValueColumns(e,t){Vp(this.state,"aggFunc");const s=new Set((this.beans.valueColsSvc?.columns??[]).map(o=>o.getColId())),i=F0(this.state);for(const o of e)if(!s.has(o.getColId())&&!i.values.has(o.getColId())){const n=o.getAggFunc(),a=n??this.beans.aggFuncSvc?.getDefaultAggFunc(o);a!=null&&i.values.set(o.getColId(),a)}const r=ui(this.sequence);this.sequence=r,i.seq=r,i.eventType=t,this.state.aggregation={colIds:e.map(o=>o.getColId()),eventType:t,seq:r}}setColumnAggFunc(e,t,s){Op(this.state,{colId:e.getColId(),aggFunc:t});const i=td(this.state);i.seq=ui(this.sequence),this.sequence=i.seq,i.eventType=s;const r=F0(this.state);r.seq=i.seq,r.eventType=s,r.values.set(e.getColId(),t)}getColumnAggFunc(e){const t=e.getColId();return this.state.aggFuncs?.values.has(t)?this.state.aggFuncs.values.get(t):e.getAggFunc()}isColumnVisibleInToolPanel(e){const t=this.state.columnState?.patches.get(e.getColId());return t?.hide!==void 0?!t.hide:e.isVisible()}isColumnSelectedInPivotModeToolPanel(e){const t=e.getColId(),s=this.state.columnState?.patches.get(t);let i;s?.rowGroup!==void 0?i=!!s.rowGroup:this.state.rowGroup?i=this.state.rowGroup.colIds.includes(t):i=e.isRowGroupActive();let r;s?.pivot!==void 0?r=!!s.pivot:this.state.pivot?r=this.state.pivot.colIds.includes(t):r=e.isPivotActive();let o;return s?.aggFunc!==void 0?o=s.aggFunc!=null:this.state.aggregation?o=this.state.aggregation.colIds.includes(t):o=e.isValueActive(),i||r||o}setPivotColumns(e,t){Vp(this.state,"pivot");const s=ui(this.sequence);this.sequence=s,this.state.pivot={colIds:e.map(i=>i.getColId()),eventType:t,seq:s}}setPivotMode(e,t){const s=ui(this.sequence);this.sequence=s,this.state.pivotMode={pivotMode:e,eventType:t,seq:s}}getRowGroupColumns(){return Ra(this.beans,kp(this.state.rowGroup?.colIds,this.beans.rowGroupColsSvc?.columns,this.state.columnState?.patches,e=>e.rowGroup==null?void 0:!!e.rowGroup))}getPrimaryColumns(){return Ra(this.beans,this.state.columnOrder?.colIds??Lp(this.beans))}hasDeferredColumnOrder(){return!!this.state.columnOrder}getValueColumns(){return Ra(this.beans,kp(this.state.aggregation?.colIds,this.beans.valueColsSvc?.columns,this.state.columnState?.patches,e=>e.aggFunc===void 0?void 0:e.aggFunc!=null))}getPivotColumns(){if(!this.getPivotMode())return[];const e=this.beans.pivotColsSvc?.columns,t=e?.length?e:Ra(this.beans,this.lastPivotColIds);return Ra(this.beans,kp(this.state.pivot?.colIds,t,this.state.columnState?.patches,s=>s.pivot==null?void 0:!!s.pivot))}getPivotMode(){return this.state.pivotMode?.pivotMode??this.beans.colModel.isPivotMode()}getSortDef(e){const t=this.state.sort,s=e.getColId(),i=t?.sortDefsByColId;return i?.has(s)?i.get(s)??null:t?.baselineCleared?null:e.getSortDef()}progressSortFromEvent(e,t){const s=this.state.sort??{sortDefsByColId:new Map,baselineCleared:!1,seq:0,eventType:"toolPanelUi"},{sortSvc:i}=this.beans,r=e.getColId();let o;s.sortDefsByColId.has(r)?o=s.sortDefsByColId.get(r):s.baselineCleared?o=null:o=e.getSortDef();const n=i?.getNextSortDirection(e,o);if(!n)return;const{gos:a}=this.beans;((a.get("multiSortKey")==="ctrl"?t.ctrlKey||t.metaKey:t.shiftKey)||a.get("alwaysMultiSort"))&&!a.get("suppressMultiSort")||(s.sortDefsByColId.clear(),s.baselineCleared=!0),s.sortDefsByColId.set(r,n.direction?n:null),s.seq=ui(this.sequence),this.sequence=s.seq,this.state.sort=s}};function Ra(e,t){return t?t.map(s=>e.colModel.getColDefCol(s)).filter(s=>!!s):[]}function kp(e,t,s,i){const r=[...e??t?.map(n=>n.getColId())??[]];if(!s?.size)return r;const o=new Set(r);for(const[n,a]of s){const l=i(a);if(l===void 0)continue;if(l){o.has(n)||(r.push(n),o.add(n));continue}if(!o.has(n))continue;o.delete(n);const c=r.indexOf(n);c>=0&&r.splice(c,1)}return r}function yz(e){const t=e.colModel.getCols().filter(s=>Fa(s)).map(s=>e.colModel.getColDefCol(s.getColId())).filter(s=>!!s);R0(e,t)}function R0(e,t){const s=xz(e);if(!s)return;const i=new Set(t);s.list=[...t,...s.list.filter(r=>Fa(r)&&!i.has(r))]}function Lp(e){return Gp(e).map(t=>t.getColId())}function Gp(e){return(e.colModel.getColDefCols()??e.colModel.getCols()).filter(t=>Fa(t))}function xz(e){const t=e.colModel.colDefCols,s=t?.list;if(Array.isArray(s))return t}function Fa(e){return e.isPrimary()?!Sr(e)&&!yr(e):!1}function ui(e){return e+1}function Op(e,t){const s=td(e),i=s.patches.get(t.colId);s.patches.set(t.colId,i?{...i,...t}:t)}function Vp(e,t){const s=e.columnState?.patches;if(s?.size)for(const[i,r]of s){if(!(t in r))continue;const o={...r};if(delete o[t],Object.keys(o).length===1){s.delete(i);continue}s.set(i,o)}}function td(e){let{columnState:t}=e;return t||(t={patches:new Map,seq:0,eventType:"toolPanelUi"},e.columnState=t),t}function F0(e){let{aggFuncs:t}=e;return t||(t={values:new Map,seq:0,eventType:"toolPanelUi"},e.aggFuncs=t),t}var Rz=class extends E{constructor(){super(...arguments),this.beanName="columnStateUpdateStrategy"}applyColumnState(e,t,s){this.delegate("applyColumnState",e,t,s)}commit(e){this.delegate("commit",e)}hasPendingChanges(e){return this.delegate("hasPendingChanges",e)}moveColumns(e,t,s,i){this.delegate("moveColumns",e,t,s,i)}reset(e){this.delegate("reset",e)}setColumnsVisible(e,t,s,i){this.delegate("setColumnsVisible",e,t,s,i)}isColumnVisibleInToolPanel(e,t){return this.delegate("isColumnVisibleInToolPanel",e,t)}setRowGroupColumns(e,t,s){this.delegate("setRowGroupColumns",e,t,s)}getRowGroupColumns(e){return this.delegate("getRowGroupColumns",e)}getPrimaryColumns(e){return this.delegate("getPrimaryColumns",e)}hasDeferredColumnOrder(e){return this.delegate("hasDeferredColumnOrder",e)}setValueColumns(e,t,s){this.delegate("setValueColumns",e,t,s)}getValueColumns(e){return this.delegate("getValueColumns",e)}setColumnAggFunc(e,t,s,i){this.delegate("setColumnAggFunc",e,t,s,i)}getColumnAggFunc(e,t){return this.delegate("getColumnAggFunc",e,t)}setPivotColumns(e,t,s){this.delegate("setPivotColumns",e,t,s)}getPivotColumns(e){return this.delegate("getPivotColumns",e)}setPivotMode(e,t,s){this.delegate("setPivotMode",e,t,s)}getPivotMode(e){return this.delegate("getPivotMode",e)}isColumnSelectedInPivotModeToolPanel(e,t){return this.delegate("isColumnSelectedInPivotModeToolPanel",e,t)}progressSortFromEvent(e,t,s){this.delegate("progressSortFromEvent",e,t,s)}getSortDef(e,t){return this.delegate("getSortDef",e,t)}getUpdateStrategy(){return this.executionStrategy??(this.executionStrategy=this.createManagedBean(new wz))}delegate(e,...t){const s=this.getUpdateStrategy();return s[e].bind(s)(...t)}},Bp={moduleName:"SharedColumnStateUpdateStrategy",version:Y,beans:[Rz],dependsOn:[le]},E0={moduleName:"ColumnsToolPanel",version:Y,beans:[vz],userComponents:{agColumnsToolPanel:cz},icons:{ensureColumnVisible:"column-arrow",columnsToolPanel:"columns",menuAddRowGroup:"group",menuRemoveRowGroup:"group",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},dependsOn:[le,Bp,Sa,$l,Oi,$s,ed]},Fz=class extends E{constructor(){super(...arguments),this.beanName="chartMenuItemMapper"}getChartItems(e){const t=this.beans,s=t.chartSvc,i=e==="pivotChart";if(!s)return null;const r=this.getLocaleTextFunc.bind(this),o=i?new Ez(t,s,r):new Pz(t,s,r),n=s.isEnterprise();let a=o.getMenuItem();if(a?.subMenu&&!n){const c=d=>({...d,subMenu:d.subMenu?.filter(u=>!u._enterprise).map(u=>c(u))});a=c(a)}const l=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;return l&&(a=this.filterAndOrderChartMenu(a,l,o.getConfigLookup())),this.cleanInternals(a)}cleanInternals(e){if(!e)return e;const t=s=>{delete s?._key,delete s?._enterprise;for(const i of s?.subMenu??[])t(i);return s};return t(e)}buildLookup(e){const t={},s=i=>{if(t[i._key]=i,i.subMenu)for(const r of i.subMenu)s(r)};return s(e),t}filterAndOrderChartMenu(e,t,s){const i=this.buildLookup(e),r={...e,subMenu:[]};for(const o of Object.keys(t)){const n=t[o],a=s[o];if(a===null)continue;if(a==null){F(173,{group:o});continue}const l=i[a._key];if(l)if(l.subMenu){const c=n.map(d=>{const u=a[d];if(u==null){F(174,{group:o,chartType:d});return}return i[u]}).filter(d=>d!==void 0);c.length>0&&(l.subMenu=c,r.subMenu?.push(l))}else r.subMenu?.push(l)}return r.subMenu?.length==0?null:r}},Ez=class{constructor(e,t,s){this.beans=e,this.chartSvc=t,this.getLocaleTextFunc=s}getMenuItem(){const e=this.getLocaleTextFunc(),t=(s,i,r,o,n=!1)=>({name:e(s,i+"\u200E"),action:()=>this.chartSvc.createPivotChart({chartType:r}),_key:o,_enterprise:n});return{name:e("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped","groupedColumn","pivotGroupedColumn"),t("stackedColumn","Stacked","stackedColumn","pivotStackedColumn"),t("normalizedColumn","100% Stacked","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped","groupedBar","pivotGroupedBar"),t("stackedBar","Stacked","stackedBar","pivotStackedBar"),t("normalizedBar","100% Stacked","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:e("pieChart","Pie"),subMenu:[t("pie","Pie","pie","pivotPie"),t("donut","Donut","donut","pivotDonut")]},{_key:"pivotLineChart",name:e("lineChart","Line"),subMenu:[t("lineChart","Line","line","pivotLineChart"),t("stackedLine","Stacked","stackedLine","pivotStackedLine"),t("normalizedLine","100% Stacked","normalizedLine","pivotNormalizedLine")]},{_key:"pivotAreaChart",name:e("areaChart","Area"),subMenu:[t("areaChart","Area","area","pivotArea"),t("stackedArea","Stacked","stackedArea","pivotStackedArea"),t("normalizedArea","100% Stacked","normalizedArea","pivotNormalizedArea")]},{_key:"pivotXYChart",name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter","scatter","pivotScatter"),t("bubble","Bubble","bubble","pivotBubble")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:e("statisticalChart","Statistical"),subMenu:[t("histogramChart","Histogram","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemapChart","Treemap","treemap","pivotTreemap",!0),t("sunburstChart","Sunburst","sunburst","pivotSunburst",!0)]},{_key:"pivotFunnel",name:e("funnel","Funnel"),subMenu:[t("funnel","Funnel","funnel","pivotFunnel"),t("coneFunnel","Cone Funnel","coneFunnel","pivotConeFunnel"),t("pyramid","Pyramid","pyramid","pivotPyramid")]},{_key:"pivotCombinationChart",name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line","columnLineCombo","pivotColumnLineCombo"),t("AreaColumnCombo","Area & Column","areaColumnCombo","pivotAreaColumnCombo")]}],icon:_("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart",stackedLine:"pivotStackedLine",normalizedLine:"pivotNormalizedLine"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},funnelGroup:{_key:"pivotFunnel",funnel:"pivotFunnel",coneFunnel:"pivotConeFunnel",pyramid:"pivotPyramid"},polarGroup:null,specializedGroup:null}}},Pz=class{constructor(e,t,s){this.beans=e,this.chartSvc=t,this.getLocaleTextFunc=s}getMenuItem(){const e=this.getLocaleTextFunc(),t=(s,i,r,o,n=!1)=>({name:e(s,i),action:()=>this.chartSvc.createChartFromCurrentRange(r),_key:o,_enterprise:n});return{name:e("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped","groupedColumn","rangeGroupedColumn"),t("stackedColumn","Stacked","stackedColumn","rangeStackedColumn"),t("normalizedColumn","100% Stacked","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped","groupedBar","rangeGroupedBar"),t("stackedBar","Stacked","stackedBar","rangeStackedBar"),t("normalizedBar","100% Stacked","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:e("pieChart","Pie"),subMenu:[t("pie","Pie","pie","rangePie"),t("donut","Donut","donut","rangeDonut")],_key:"rangePieChart"},{name:e("lineChart","Line"),subMenu:[t("lineChart","Line","line","rangeLineChart"),t("stackedLine","Stacked","stackedLine","rangeStackedLine"),t("normalizedLine","100% Stacked","normalizedLine","rangeNormalizedLine")],_key:"rangeLineChart"},{name:e("areaChart","Area"),subMenu:[t("areaChart","Area","area","rangeArea"),t("stackedArea","Stacked","stackedArea","rangeStackedArea"),t("normalizedArea","100% Stacked","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter","scatter","rangeScatter"),t("bubble","Bubble","bubble","rangeBubble")],_key:"rangeXYChart"},{name:e("polarChart","Polar"),subMenu:[t("radarLine","Radar Line","radarLine","rangeRadarLine"),t("radarArea","Radar Area","radarArea","rangeRadarArea"),t("nightingale","Nightingale","nightingale","rangeNightingale"),t("radialColumn","Radial Column","radialColumn","rangeRadialColumn"),t("radialBar","Radial Bar","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:e("statisticalChart","Statistical"),subMenu:[t("boxPlot","Box Plot","boxPlot","rangeBoxPlot",!0),t("histogramChart","Histogram","histogram","rangeHistogram",!1),t("rangeBar","Range Bar","rangeBar","rangeRangeBar",!0),t("rangeArea","Range Area","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemap","Treemap","treemap","rangeTreemap"),t("sunburst","Sunburst","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:e("specializedChart","Specialized"),subMenu:[t("heatmap","Heatmap","heatmap","rangeHeatmap"),t("waterfall","Waterfall","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:e("funnel","Funnel"),subMenu:[t("funnel","Funnel","funnel","rangeFunnel"),t("coneFunnel","Cone Funnel","coneFunnel","rangeConeFunnel"),t("pyramid","Pyramid","pyramid","rangePyramid")],_key:"rangeFunnel",_enterprise:!0},{name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line","columnLineCombo","rangeColumnLineCombo"),t("AreaColumnCombo","Area & Column","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:_("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart",stackedLine:"rangeStackedLine",normalizedLine:"rangeNormalizedLine"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},funnelGroup:{_key:"rangeFunnel",funnel:"rangeFunnel",coneFunnel:"rangeConeFunnel",pyramid:"rangePyramid"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}},Mz=class extends E{constructor(){super(...arguments),this.beanName="colChooserFactory"}createColumnSelectPanel(e,t,s,i){const r=e.createManagedBean(new C0),o=i??t?.getColDef().columnChooserParams??{},{contractColumnSelection:n,suppressColumnExpandAll:a,suppressColumnFilter:l,suppressColumnSelectAll:c,suppressSyncLayoutWithGrid:d,columnLayout:u}=o;return r.init(!!s,N(this.gos,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!n,suppressColumnExpandAll:!!a,suppressColumnFilter:!!l,suppressColumnSelectAll:!!c,suppressSyncLayoutWithGrid:!!u||!!d,onStateUpdated:()=>{}}),"columnMenu"),u&&r.setColumnLayout(u),r}showColumnChooser({column:e,chooserParams:t,eventSource:s,headerPosition:i}){this.hideActiveColumnChooser();const r=this.createColumnSelectPanel(this,e,!0,t),o=this.getLocaleTextFunc(),n=this.beans,{visibleCols:a,focusSvc:l,menuUtils:c}=n,d=a.allCols.indexOf(e),u=e?l.focusedHeader??i??null:null;this.activeColumnChooserDialog=this.createBean(new Xc({title:o("chooseColumns","Choose Columns"),component:r,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{Qe(n,r.getGui())?.focus({preventScroll:!0}),this.dispatchVisibleChangedEvent(!0,e)},closedCallback:h=>{const g=this.activeColumnChooser.getGui();this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,e),e&&c.restoreFocusOnClose({column:e,headerPosition:u,columnIndex:d,eventSource:s},g,h,!0)},postProcessPopupParams:{type:"columnChooser",column:e,eventSource:s}})),this.activeColumnChooser=r}hideActiveColumnChooser(){this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:"columnChooser",column:t??null})}},Tz={pinSubMenu:"PinnedColumn",pinLeft:"PinnedColumn",pinRight:"PinnedColumn",clearPinned:"PinnedColumn",pinRowSubMenu:"PinnedRow",pinBottom:"PinnedRow",pinTop:"PinnedRow",unpinRow:"PinnedRow",valueAggSubMenu:"SharedAggregation",autoSizeThis:"ColumnAutoSize",autoSizeAll:"ColumnAutoSize",rowGroup:"SharedRowGrouping",rowUnGroup:"SharedRowGrouping",resetColumns:"CommunityCore",expandAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],contractAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],copy:"Clipboard",copyWithHeaders:"Clipboard",copyWithGroupHeaders:"Clipboard",cut:"Clipboard",paste:"Clipboard",export:["CsvExport","ExcelExport"],csvExport:"CsvExport",excelExport:"ExcelExport",separator:"CommunityCore",pivotChart:"IntegratedCharts",chartRange:"IntegratedCharts",columnFilter:"ColumnFilter",columnChooser:"ColumnMenu",sortAscending:"Sort",sortDescending:"Sort",sortAbsoluteAscending:"Sort",sortAbsoluteDescending:"Sort",sortUnSort:"Sort"};function Dz(e,t){const s=Tz[t];s&&e.assertModuleRegistered(s,`menu item '${t}'`)}var _r="separator";function P0(e,t){if(e)for(let s=e.length-2;s>=0;s--){const i=e[s]===t,r=e[s+1]===t;i&&r&&e.splice(s+1,1)}}var Az={sortAscending:{fallback:"Sort Ascending",getSortDef:()=>({type:"default",direction:"asc"})},sortDescending:{fallback:"Sort Descending",getSortDef:()=>({type:"default",direction:"desc"})},sortAbsoluteAscending:{fallback:"Sort Absolute Ascending",getSortDef:()=>({type:"absolute",direction:"asc"})},sortAbsoluteDescending:{fallback:"Sort Absolute Descending",getSortDef:()=>({type:"absolute",direction:"desc"})},sortUnSort:{fallback:"Clear Sort",getSortDef:e=>({type:rs(e.getSortDef()?.type),direction:null})}},Iz=class extends E{constructor(){super(...arguments),this.beanName="menuItemMapper"}mapWithStockItems(e,t,s,i,r){if(!e)return[];const o=[],n=this.getLocaleTextFunc(),{beans:a,gos:l}=this,{pinnedCols:c,colAutosize:d,aggFuncSvc:u,rowGroupColsSvc:h,colNames:g,colModel:p,clipboardSvc:f,expansionSvc:m,focusSvc:C,csvCreator:v,excelCreator:w,menuSvc:S,colChooserFactory:y,sortSvc:R,chartMenuItemMapper:P,valueColsSvc:M,pinnedRowModel:T}=a,I=(k,L,j,U)=>{switch(Dz(l,k),k){case"pinSubMenu":return c&&L?{name:n("pinColumn","Pin Column"),icon:_("menuPin",a,null),subMenu:["clearPinned","pinLeft","pinRight"]}:null;case"pinLeft":return c&&L?{name:n("pinLeft","Pin Left"),action:()=>c.setColsPinned([L],"left",U),checked:!!L&&L.isPinnedLeft()}:null;case"pinRight":return c&&L?{name:n("pinRight","Pin Right"),action:()=>c.setColsPinned([L],"right",U),checked:!!L&&L.isPinnedRight()}:null;case"clearPinned":return c&&L?{name:n("noPin","No Pin"),action:()=>c.setColsPinned([L],null,U),checked:!!L&&!L.isPinned()}:null;case"pinRowSubMenu":{const O=l.get("enableRowPinning"),X=[],se=s?.rowPinned??s?.pinnedSibling?.rowPinned;return se&&X.push("unpinRow"),O&&O!=="bottom"&&se!="top"&&X.push("pinTop"),O&&O!=="top"&&se!="bottom"&&X.push("pinBottom"),T?.isManual()?{name:n("pinRow","Pin Row"),icon:_("rowPin",a,L),subMenu:X}:null}case"pinTop":return T?.isManual()?{name:n("pinTop","Pin to Top"),icon:_("rowPinTop",a,L),action:({node:O,column:X})=>O&&T.pinRow(O,"top",X)}:null;case"pinBottom":return T?.isManual()?{name:n("pinBottom","Pin to Bottom"),icon:_("rowPinBottom",a,L),action:({node:O,column:X})=>O&&T.pinRow(O,"bottom",X)}:null;case"unpinRow":return T?.isManual()?{name:n("unpinRow","Unpin Row"),icon:_("rowUnpin",a,L),action:({node:O,column:X})=>O&&T.pinRow(O,null,X)}:null;case"valueAggSubMenu":return u&&M&&(L?.isPrimary()||L?.getColDef().pivotValueColumn)?{name:n("valueAggregation","Value Aggregation"),icon:_("menuValue",a,null),subMenu:kz(L,u,M,n),disabled:l.get("functionsReadOnly")}:null;case"autoSizeThis":return d?{name:n("autosizeThisColumn","Autosize This Column"),action:()=>L&&d.autoSizeColumn(L,U,l.get("skipHeaderOnAutoSize"))}:null;case"autoSizeAll":return d?{name:n("autosizeAllColumns","Autosize All Columns"),action:()=>d.autoSizeAllColumns({source:U,skipHeader:l.get("skipHeaderOnAutoSize")})}:null;case"rowGroup":return h?{name:xa(n,"groupBy",g.getDisplayNameForColumn(L,"header")),disabled:l.get("functionsReadOnly")||L?.isRowGroupActive()||!L?.getColDef().enableRowGroup,action:()=>h.addColumns([L],U),icon:_("menuAddRowGroup",a,null)}:null;case"rowUnGroup":if(h&&l.isModuleRegistered("SharedRowGrouping")){const O=L?.getColDef().showRowGroup,X=l.get("groupLockGroupColumns");let se,we,pe;if(O===!0)se=n("ungroupAll","Un-Group All"),we=l.get("functionsReadOnly")||X===-1||X>=(h.columns.length??0),pe=()=>h.setColumns(h.columns.slice(0,X),U);else if(typeof O=="string"){const ge=p.getColDefCol(O),it=ge!=null?g.getDisplayNameForColumn(ge,"header"):O;se=xa(n,"ungroupBy",it),we=l.get("functionsReadOnly")||ya(ge,a),pe=()=>{h.removeColumns([O],U)}}else se=xa(n,"ungroupBy",g.getDisplayNameForColumn(L,"header")),we=l.get("functionsReadOnly")||!L?.isRowGroupActive()||!L?.getColDef().enableRowGroup||ya(L,a),pe=()=>h.removeColumns([L],U);return{name:se,disabled:we,action:pe,icon:_("menuRemoveRowGroup",a,null)}}else return null;case"resetColumns":return{name:n("resetColumns","Reset Columns"),action:()=>xh(a,U)};case"expandAll":return m?{name:n("expandAll","Expand All Row Groups"),action:()=>m.expandAll(!0)}:null;case"contractAll":return m?{name:n("collapseAll","Collapse All Row Groups"),action:()=>m.expandAll(!1)}:null;case"copy":return f?{name:n("copy","Copy"),shortcut:n("ctrlC","Ctrl+C"),icon:_("clipboardCopy",a,null),action:()=>f.copyToClipboard()}:null;case"copyWithHeaders":return f?{name:n("copyWithHeaders","Copy with Headers"),icon:_("clipboardCopy",a,null),action:()=>f.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return f?{name:n("copyWithGroupHeaders","Copy with Group Headers"),icon:_("clipboardCopy",a,null),action:()=>f.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(f){const O=C.getFocusedCell(),X=O?Ve(a,O):null,se=X?O?.column.isCellEditable(X):!1;return{name:n("cut","Cut"),shortcut:n("ctrlX","Ctrl+X"),icon:_("clipboardCut",a,null),disabled:!se||l.get("suppressCutToClipboard"),action:()=>f.cutToClipboard(void 0,"contextMenu")}}else return null;case"paste":if(f){const O=l.get("suppressClipboardApi")||l.get("suppressClipboardPaste")||!L||!s||!L.isCellEditable(s)||L.isSuppressPaste(s);return{name:n("paste","Paste"),shortcut:n("ctrlV","Ctrl+V"),icon:_("clipboardPaste",a,null),disabled:O,action:()=>f.pasteFromClipboard()}}else return null;case"export":{const O=[];return!l.get("suppressCsvExport")&&v&&O.push("csvExport"),!l.get("suppressExcelExport")&&w&&O.push("excelExport"),O.length?{name:n("export","Export"),subMenu:O,icon:_("save",a,null)}:null}case"csvExport":return v?{name:n("csvExport","CSV Export"),icon:_("csvExport",a,null),action:()=>v.exportDataAsCsv()}:null;case"excelExport":return w?{name:n("excelExport","Excel Export"),icon:_("excelExport",a,null),action:()=>w.exportDataAsExcel()}:null;case"separator":return k;case"pivotChart":case"chartRange":return P.getChartItems(k);case"columnFilter":return S&&L?{name:n("columnFilter","Column Filter"),icon:_("filter",a,null),action:()=>S.showFilterMenu({column:L,buttonElement:j(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":{const O=C.focusedHeader;return y?{name:n("columnChooser","Choose Columns"),icon:_("columns",a,null),action:()=>y.showColumnChooser({column:L,eventSource:j(),headerPosition:O})}:null}case"sortUnSort":case"sortAscending":case"sortDescending":case"sortAbsoluteAscending":case"sortAbsoluteDescending":{if(!R||!L)return null;const{fallback:O,getSortDef:X}=Az[k];return{name:n(k,O),icon:_(k,a,null),action:()=>R.setSortForColumn(L,X(L),!1,U)}}default:return F(176,{key:k}),null}};for(const k of e){let L;if(typeof k=="string"?L=I(k,t,i,r):L={...k},!L)continue;const j=L,{subMenu:U}=j;U&&U instanceof Array&&(j.subMenu=this.mapWithStockItems(U,t,s,i,r)),L!=null&&o.push(L)}return P0(o,_r),o}};function kz(e,t,s,i){let r;if(e.isPrimary())r=e;else{const n=e.getColDef().pivotValueColumn;r=D(n)?n:void 0}const o=[];if(r){const n=r.isValueActive(),a=t.getFuncNames(r);o.push({name:i("noAggregation","None"),action:()=>{s.removeColumns([r],"contextMenu"),s.setColumnAggFunc(r,void 0,"contextMenu")},checked:!n});for(const l of a)o.push({name:i(l,t.getDefaultFuncLabel(l)),action:()=>{s.setColumnAggFunc(r,l,"contextMenu"),s.addColumns([r],"contextMenu")},checked:n&&r.getAggFunc()===l})}return o}var Lz=class extends E{constructor(){super(...arguments),this.beanName="colMenuFactory"}createMenu(e,t,s,i){const r=e.createManagedBean(new Dp(0,{column:s??null,node:null,value:null})),o=this.beans.menuItemMapper.mapWithStockItems(t,s??null,null,i,"columnMenu");return r.addMenuItems(o),r}getMenuItems(e=null,t=null){const s=this.getDefaultMenuOptions(e);let i;const r=(e?.getColDef()??t?.getColGroupDef())?.mainMenuItems;if(Array.isArray(r))i=r;else if(typeof r=="function")i=r(N(this.gos,{column:e,columnGroup:t,defaultItems:s}));else{const o=this.gos.getCallback("getMainMenuItems");o?i=o({column:e,columnGroup:t,defaultItems:s}):i=s}return P0(i,_r),i}getDefaultMenuOptions(e){const t=[],{beans:s,gos:i}=this,{colChooserFactory:r,rowGroupColsSvc:o,colModel:n,expansionSvc:a,sortSvc:l,menuSvc:c,pinnedCols:d,aggFuncSvc:u,colAutosize:h}=s,g=He(i),p=()=>{!g&&r&&t.push("columnChooser"),t.push("resetColumns")};if(!e)return p(),t;const{colDef:f}=e,m=d&&!f.lockPinned,C=o?.columns.length??0,v=C>0,w=Ri(i),S=i.get("treeData"),y=e.isPrimary(),R=!y||u&&e.isAllowValue()&&(v||w||S);if(l&&!g&&e.isSortable()){const{isDefaultSortAllowed:P,isAbsoluteSortAllowed:M,isAbsoluteSort:T,isDefaultSort:I,isAscending:k,isDescending:L,direction:j}=lu(e,s);P&&!(k&&I)&&t.push("sortAscending"),P&&!(L&&I)&&t.push("sortDescending"),M&&!(k&&T)&&t.push("sortAbsoluteAscending"),M&&!(L&&T)&&t.push("sortAbsoluteDescending"),j&&t.push("sortUnSort"),t.push(_r)}if(c?.isFilterMenuItemEnabled(e)&&(t.push("columnFilter"),t.push(_r)),m&&t.push("pinSubMenu"),R&&t.push("valueAggSubMenu"),(m||R)&&t.push(_r),h&&(f.suppressAutoSize||t.push("autoSizeThis"),t.push("autoSizeAll"),t.push(_r)),o&&i.isModuleRegistered("SharedRowGrouping")){const P=t.length;f.showRowGroup?t.push("rowUnGroup"):e.isAllowRowGroup()&&y&&(e.isRowGroupActive()?ya(e,s)||t.push("rowUnGroup"):t.push("rowGroup")),t.length>P&&t.push(_r)}return p(),a&&(ae(i)||i.get("ssrmExpandAllAffectsAllRows"))&&(S||C>(n.isPivotMode()?1:0))&&(t.push("expandAll"),t.push("contractAll")),t}},M0="ag-context-menu-open",Gz=class extends E{constructor(){super(...arguments),this.beanName="contextMenuSvc",this.focusedCell=null}postConstruct(){this.menu=this.createManagedBean(new Ey({menuItemCallbacks:Tp,getMenuItems:this.getMenuItems.bind(this),mapMenuItems:this.mapWithStockItems.bind(this),beforeMenuOpen:this.beforeMenuOpen.bind(this),onMenuOpen:this.onMenuOpen.bind(this),onMenuClose:this.onMenuClose.bind(this),afterMenuDestroyed:this.afterMenuDestroyed.bind(this),onVisibleChanged:this.dispatchVisibleChangedEvent.bind(this),shouldBlockMenuOpen:()=>!!this.beans.overlays?.exclusive}))}hideActiveMenu(){this.menu.hideActiveMenu()}getMenuItems(e,t){const{column:s,node:i,value:r}=e,o=[],{clipboardSvc:n,chartSvc:a,csvCreator:l,excelCreator:c,colModel:d,rangeSvc:u,gos:h}=this.beans;if(D(i)&&n&&s&&(h.get("suppressCutToClipboard")||o.push("cut"),o.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")),h.get("enableCharts")&&a&&(d.isPivotMode()&&o.push("pivotChart"),u&&!u.isEmpty()&&o.push("chartRange")),D(i)){const m=h.get("enableRowPinning"),C=h.get("isRowPinnable");if(m){const R=i.level>-1&&i.footer,P=i.level===-1&&i.footer,M=Ri(h);(P&&!(M==="pinnedBottom"||M==="pinnedTop")||!P&&!R)&&(C?.(i)??!0)&&o.push("pinRowSubMenu")}const v=h.get("suppressExcelExport")||!c,w=h.get("suppressCsvExport")||!l;!ni()&&(!v||!w)&&o.push("export")}const g=o.length?o:void 0,p=s?.getColDef().contextMenuItems;return Array.isArray(p)?p:typeof p=="function"?p(N(h,{column:s,node:i,value:r,defaultItems:g,event:t})):h.getCallback("getContextMenuItems")?.({column:s,node:i,value:r,defaultItems:g,event:t})??o}getContextMenuPosition(e,t){const s=this.getRowCtrl(e),i=this.getCellGui(s,t);if(!i)return{x:0,y:s?.getRowYPosition()??0};const r=i.getBoundingClientRect();return{x:r.x+r.width/2,y:r.y+r.height/2}}showContextMenu(e){const t=e.rowNode??null,s=e.column??null;let{anchorToElement:i,value:r,source:o}=e;t&&s&&r==null&&(r=this.beans.valueSvc.getValueForDisplay({column:s,node:t,from:"edit"}).value),i==null&&(i=this.getContextMenuAnchorElement(t,s)),this.beans.menuUtils.onContextMenu({mouseEvent:e.mouseEvent??null,touchEvent:e.touchEvent??null,showMenuCallback:n=>this.menu.showMenu({node:t,column:s,value:r},n,i),source:o})}handleContextMenuMouseEvent(e,t,s,i){const r=i?.rowNode??s?.rowNode??null,o=i?.column??s?.findFullWidthInfoForEvent(e||t)?.column??null,{valueSvc:n,ctrlsSvc:a}=this.beans,l=o?n.getValue(o,r,"edit"):null,c=a.getGridBodyCtrl(),d=i?i.eGui:c.eGridBody;this.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:r,column:o,value:l,anchorToElement:d,source:"ui"})}beforeMenuOpen(e){e.column||this.beans.focusSvc.clearFocusedCell()}onMenuOpen(){const{ctrlsSvc:e,focusSvc:t}=this.beans;e.getGridBodyCtrl().eGridBody.classList.add(M0),this.focusedCell=t.getFocusedCell()}onMenuClose(){this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.classList.remove(M0)}afterMenuDestroyed(){const{beans:e,focusedCell:t}=this;_u(e,t)}dispatchVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:"contextMenuVisibleChanged",visible:e,source:t})}getRowCtrl(e){const{rowIndex:t,rowPinned:s}=e||{};if(t!=null)return this.beans.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:s})||void 0}getCellGui(e,t){return!e||!t?void 0:e.getCellCtrl(t)?.eGui||void 0}getContextMenuAnchorElement(e,t){const s=this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody,i=this.getRowCtrl(e);if(!i)return s;const r=this.getCellGui(i,t);return r||(i.isFullWidth()?i.getFullWidthElement():s)}mapWithStockItems(e,t,s){const{column:i,node:r}=t;return this.beans.menuItemMapper.mapWithStockItems(e,i,r,s,"contextMenu")}},Qi="filterMenuTab",Ji="generalMenuTab",Wr="columnsMenuTab",sd=[Ji,Qi,Wr],Oz=class extends E{constructor(){super(...arguments),this.beanName="enterpriseMenuFactory"}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(e,t,s,i,r){const{column:o,columnGroup:n}=this.splitColumnOrGroup(e),a=r?"filterMenuTab":void 0;this.showMenu(o,n,l=>{const c=l.getGui();this.beans.popupSvc.positionPopupUnderMouseEvent({type:s,additionalParams:{column:o},mouseEvent:t,ePopup:c}),a&&l.showTab?.(a),this.dispatchVisibleChangedEvent(!0,!1,o,n,a)},s,a,void 0,t.target,i)}splitColumnOrGroup(e){const t=e&&bs(e);return{column:t?e:void 0,columnGroup:t?void 0:e}}showMenuAfterButtonClick(e,t,s,i,r){let o=-1,n="left";this.gos.get("enableRtl")&&(o=1,n="right");const a=r?"filterMenuTab":void 0,l=a?[a]:void 0,c=He(this.gos),d=(c?9:4)*o,u=c?-23:4,{column:h,columnGroup:g}=this.splitColumnOrGroup(e);this.showMenu(h,g,p=>{const f=p.getGui();this.beans.popupSvc.positionPopupByComponent({type:s,additionalParams:{column:h},eventSource:t,ePopup:f,alignSide:n,nudgeX:d,nudgeY:u,position:"under",keepWithinBounds:!0}),a&&p.showTab?.(a),this.dispatchVisibleChangedEvent(!0,!1,h,g,a)},s,a,l,t,i)}showMenu(e,t,s,i,r,o,n,a){const l=this.getMenuParams(e,t,o,n);if(!l)return;const{menu:c,eMenuGui:d,anchorToElement:u,restoreFocusParams:h}=l,g=[],{menuUtils:p,popupSvc:f}=this.beans;g.push(C=>{const v=c.getGui();this.destroyBean(c),e&&(da(e,!1,"contextMenu"),p.restoreFocusOnClose(h,v,C)),a?.()});const m=this.getLocaleTextFunc();if(f.addPopup({modal:!0,eChild:d,closeOnEsc:!0,closedCallback:C=>{for(const v of g)v(C);this.dispatchVisibleChangedEvent(!1,!1,e,t,r)},afterGuiAttached:C=>c.afterGuiAttached(Object.assign({},{container:i},C)),positionCallback:r?()=>s(c):void 0,ariaLabel:m("ariaLabelColumnMenu","Column Menu")}),r||(c.showTabBasedOnPreviousSelection?.(),s(c)),au(this.gos)){const C=f.setPopupPositionRelatedToElement(d,u);C&&e&&this.addStopAnchoring(C,e,g)}c.addEventListener("tabSelected",C=>{this.dispatchVisibleChangedEvent(!1,!0,e),this.lastSelectedTab=C.key,this.dispatchVisibleChangedEvent(!0,!0,e)}),e&&da(e,!0,"contextMenu"),this.activeMenu=c,c.addEventListener("destroyed",()=>{this.activeMenu===c&&(this.activeMenu=null)})}addStopAnchoring(e,t,s){e.then(i=>{t.__addEventListener("leftChanged",i),t.__addEventListener("visibleChanged",i),s.push(()=>{t.__removeEventListener("leftChanged",i),t.__removeEventListener("visibleChanged",i)})})}getMenuParams(e,t,s,i){const{focusSvc:r,visibleCols:o,ctrlsSvc:n}=this.beans,a={column:e,headerPosition:r.focusedHeader,columnIndex:o.allCols.indexOf(e),eventSource:i},l=this.createMenu(e,t,a,s,i);return l?{menu:l,eMenuGui:l.getGui(),anchorToElement:i||n.getGridBodyCtrl().eGridBody,restoreFocusParams:a}:void 0}createMenu(e,t,s,i,r){if(He(this.gos))return this.createBean(new Vz(e,s,this.lastSelectedTab,i,r));{const o=this.beans.colMenuFactory.getMenuItems(e,t);return o.length?this.createBean(new Bz(o,e,s,r)):void 0}}dispatchVisibleChangedEvent(e,t,s,i,r){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:t,key:this.lastSelectedTab??r??(He(this.gos)?Ji:"columnMenu"),column:s??null,columnGroup:i??null})}isMenuEnabled(e){if(!He(this.gos))return!0;const t=!this.beans.filterManager?.isFilterAllowed(e),s=e.getColDef().menuTabs??sd;return(t&&s.includes(Qi)?s.length-1:s.length)>0}showMenuAfterContextMenuEvent(e,t,s){this.beans.menuUtils.onContextMenu({mouseEvent:t,touchEvent:s,source:"ui",showMenuCallback:i=>(this.showMenuAfterMouseEvent(e,i,"columnMenu"),!0)})}},Vz=class extends E{constructor(e,t,s,i,r){super(),this.column=e,this.restoreFocusParams=t,this.initialSelection=s,this.restrictTo=i,this.sourceElement=r,this.tabFactories={},this.includeChecks={};const{tabFactories:o,includeChecks:n}=this;o[Ji]=this.createMainPanel.bind(this),o[Qi]=this.createFilterPanel.bind(this),o[Wr]=this.createColumnsPanel.bind(this),n[Ji]=()=>!0,n[Qi]=()=>e?!!this.beans.filterManager?.isFilterAllowed(e):!1,n[Wr]=()=>!0}postConstruct(){const e=this.getTabsToCreate().map(s=>this.createTab(s)),t=new pp({items:e,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)});this.tabbedLayout=this.createBean(t),this.mainMenuList?.setParentComponent(t),this.addDestroyFunc(()=>this.destroyBean(t))}getTabsToCreate(){return this.restrictTo?this.restrictTo:(this.column?.getColDef().menuTabs??sd).filter(e=>this.isValidMenuTabItem(e)&&this.isNotSuppressed(e))}isValidMenuTabItem(e){let t=!0,s=sd;return this.restrictTo!=null&&(t=this.restrictTo.indexOf(e)>-1,s=this.restrictTo),t=t&&sd.indexOf(e)>-1,t||F(175,{menuTabName:e,itemsToConsider:s}),t}isNotSuppressed(e){return this.includeChecks[e]()}createTab(e){return this.tabFactories[e]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(e){const{tabItemColumns:t,tabbedLayout:s,tabItemFilter:i,tabItemGeneral:r}=this;t&&e===Wr?s.showItem(t):i&&e===Qi?s.showItem(i):r&&e===Ji?s.showItem(r):s.showFirstItem()}onTabItemClicked(e){let t=null;switch(e.item){case this.tabItemColumns:t=Wr;break;case this.tabItemFilter:t=Qi;break;case this.tabItemGeneral:t=Ji;break}t&&this.activateTab(t)}activateTab(e){const t={type:"tabSelected",key:e};this.dispatchLocalEvent(t)}createMainPanel(){const{beans:e,column:t}=this,s=e.colMenuFactory,i=s.createMenu(this,s.getMenuItems(t),this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=i,i.addEventListener("closeMenu",this.onHidePopup.bind(this));const r={title:_("legacyMenu",e,t),titleLabel:Ji.replace("MenuTab",""),bodyPromise:$.resolve(i.getGui()),name:Ji};return this.tabItemGeneral=r,r}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}createFilterPanel(){const e=this.column?this.createBean(new To(this.column,"COLUMN_MENU")):null;this.filterComp=e,e?.hasFilter()||Q(119);const t=i=>e?.afterGuiAttached(i),s=()=>e?.afterGuiDetached();return this.tabItemFilter={title:_("filterTab",this.beans,this.column),titleLabel:Qi.replace("MenuTab",""),bodyPromise:$.resolve(e?.getGui()),afterAttachedCallback:t,afterDetachedCallback:s,name:Qi},this.tabItemFilter}createColumnsPanel(){const e=re({tag:"div",cls:"ag-menu-column-select-wrapper"}),{beans:t,column:s}=this,r=t.colChooserFactory.createColumnSelectPanel(this,s).getGui();r.classList.add("ag-menu-column-select"),e.appendChild(r);const o={title:_("columns",t,s),titleLabel:Wr.replace("MenuTab",""),bodyPromise:$.resolve(e),name:Wr};return this.tabItemColumns=o,o}afterGuiAttached(e){const{container:t,hidePopup:s}=e;this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:s}),s&&(this.hidePopupFunc=s,this.addDestroyFunc(s))}getGui(){return this.tabbedLayout.getGui()}destroy(){super.destroy(),this.destroyBean(this.filterComp)}},Bz=class extends A{constructor(e,t,s,i){super({tag:"div",ref:"eColumnMenu",cls:"ag-menu ag-column-menu",role:"presentation"}),this.menuItems=e,this.column=t,this.restoreFocusParams=s,this.sourceElement=i,this.eColumnMenu=x}postConstruct(){const e=this.beans.colMenuFactory.createMenu(this,this.menuItems,this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=e,e.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(e.getGui())}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),Ge(this.mainMenuList.getGui())}};function Nz(e,t){const{contextMenuSvc:s}=e;if(!s)return;const{rowNode:i,column:r,value:o,x:n,y:a}=t||{};let{x:l,y:c}=s.getContextMenuPosition(i,r);n!=null&&(l=n),a!=null&&(c=a),s.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:l,clientY:c}),rowNode:i,column:r,value:o,source:"api"})}function Hz(e,t){e.colChooserFactory?.showColumnChooser({chooserParams:t})}function zz(e){e.colChooserFactory?.hideActiveColumnChooser()}var _z=class extends E{constructor(){super(...arguments),this.beanName="menuUtils"}restoreFocusOnClose(e,t,s,i){const{eventSource:r}=e,o=s instanceof KeyboardEvent;if(!i&&!o||!r)return;const n=ie(this.beans);!t.contains(n)&&!ms(this.beans)||this.focusHeaderCell(e)}closePopupAndRestoreFocusOnSelect(e,t,s){let i;s?.keyboardEvent&&(i=s.keyboardEvent),e(i&&{keyboardEvent:i});const r=this.beans,o=r.focusSvc,n=o.getFocusedCell();if(ms(r))if(n){const{rowIndex:a,rowPinned:l,column:c}=n;o.setFocusedCell({rowIndex:a,column:c,rowPinned:l,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(t)}onContextMenu(e){const{mouseEvent:t,touchEvent:s,showMenuCallback:i,source:r}=e;if(!this.gos.get("allowContextMenuWithControlKey")&&t&&(t.ctrlKey||t.metaKey)||(t&&this.blockMiddleClickScrollsIfNeeded(t),r==="ui"&&this.gos.get("suppressContextMenu")))return;const o=t??s.touches[0];if(i(o)){const n=t??s;n?.cancelable&&n.preventDefault()}}async focusHeaderCell(e){const{column:t,columnIndex:s,headerPosition:i,eventSource:r}=e,{visibleCols:o,headerNavigation:n,focusSvc:a}=this.beans,l=await o.allCols.some(c=>c===t);if(this.isAlive()){if(t?.isAlive()&&l&&r&&Ne(r)){const c=Fl(r);c&&(n?.scrollToColumn(t),c.focus())}else if(i&&s!==-1){const c=o.allCols,d=c[s]||W(c);d&&a.focusHeaderPosition({headerPosition:{headerRowIndex:i.headerRowIndex,column:d}})}}}blockMiddleClickScrollsIfNeeded(e){this.gos.get("suppressMiddleClickScrolls")&&e.which===2&&e.preventDefault()}},T0={moduleName:"MenuCore",version:Y,beans:[Iz,Fz,_z],icons:{chart:"chart",columns:"columns",loadingMenuItems:"loading",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",save:"save",csvExport:"csv",excelExport:"excel",sortAscending:"asc",sortDescending:"desc",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc",sortUnSort:"none"},dependsOn:[le,$s,wg,ed]},Np={moduleName:"ColumnMenu",version:Y,beans:[Oz,Lz,Mz],icons:{ensureColumnVisible:"column-arrow",legacyMenu:"menu",filterTab:"filter",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},apiFunctions:{showColumnChooser:Hz,hideColumnChooser:zz},dependsOn:[T0,Bp,Oi,$l]},Hp={moduleName:"ContextMenu",version:Y,beans:[Gz],apiFunctions:{showContextMenu:Nz},dependsOn:[T0]},Wz={moduleName:"Menu",version:Y,dependsOn:[Np,Hp]},Uz=10,D0=class extends Rr{constructor(){super({tag:"div",cls:"ag-cell-edit-wrapper"}),this.pendingInitialEventKey=null,this.initialEventKeyProcessed=!1}initialiseEditor(e){const{cellStartedEdit:t,values:s,valuesPage:i,eventKey:r}=this.params;this.pendingInitialEventKey=null,this.initialEventKeyProcessed=!1,ne(s)&&ne(i)&&F(180);const o=this.resolveAsyncMode(),{params:n,valueList:a}=this.buildRichSelectParams(o),l=this.createManagedBean(new Jc(n));this.eEditor=l,l.addCss("ag-cell-editor"),this.appendChild(l);const c=this.getAsyncValuesSource(o);c&&l.setAsyncValuesSource({source:c,thresholdRows:this.params.valuesPageLoadThreshold??Uz,useAsyncSearch:o.isFullAsync,onMisconfiguredSearchSource:o.isFullAsync?()=>F(294):void 0,onFirstValuesPageLoaded:()=>{this.pendingInitialEventKey!=null&&(this.consumeInitialEventKey(this.pendingInitialEventKey),this.pendingInitialEventKey=null)}}),this.eEditor.setValueList({valueList:a,refresh:!0,isInitial:!0}),o.isValuesPaged?(this.eEditor.resetAsyncValues(""),o.isFullAsync?this.consumeInitialEventKey(r):this.pendingInitialEventKey=r):a&&!Array.isArray(a)&&a.then(d=>{const u=this.getSearchStringCallback(d);u&&l.setSearchStringCreator(u),this.consumeInitialEventKey(r)}).catch(d=>{to("Rich Select",d),this.consumeInitialEventKey(r)}),this.addManagedListeners(l,{fieldPickerValueSelected:this.onEditorPickerValueSelected.bind(this)}),this.focusAfterAttached=t}onEditorPickerValueSelected(e){this.gos.get("editType")!=="fullRow"&&setTimeout(()=>this.params.stopEditing(!e.fromEnterKey))}getPlaceholderText(e=this.isFullAsync()){const{valuePlaceholder:t}=this.params;if(t!==void 0)return t;const s=this.getLocaleTextFunc();return e?s("typeToSearchOoo","Type to search..."):s("advancedFilterBuilderSelectOption","Select an option...")}isFullAsync(){const{allowTyping:e,filterListAsync:t,values:s,valuesPage:i}=this.params,r=typeof s=="function"||typeof i=="function";return t&&!e||!r&&t?(F(294),!1):!!(e&&t&&r)}isValuesPaged(){return typeof this.params.valuesPage=="function"}resolveAsyncMode(){return{isValuesPaged:this.isValuesPaged(),isFullAsync:this.isFullAsync()}}getInitialValueList(e=this.resolveAsyncMode()){const t=this.params,{values:s}=t;if(!e.isValuesPaged){if(!s)return[];if(Array.isArray(s))return s;if(typeof s!="function")return[];if(!e.isFullAsync)return s({...t})}}buildRichSelectParams(e=this.resolveAsyncMode()){const t=this.params,{cellRenderer:s,cellRendererParams:i,cellHeight:r,value:o,values:n,formatValue:a,searchDebounceDelay:l,valueListGap:c,valueListMaxHeight:d,valueListMaxWidth:u,allowTyping:h,filterList:g,searchType:p,highlightMatch:f,eventKey:m,multiSelect:C,suppressDeselectAll:v,suppressMultiSelectPillRenderer:w}=t,{isValuesPaged:S,isFullAsync:y}=e,R=a??(L=>String(L??"")),M={value:o,cellRenderer:s,cellRendererParams:i,cellRowHeight:r,searchDebounceDelay:l,valueFormatter:L=>Array.isArray(L)?L.map(j=>R(j)).join(", "):R(L),pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"virtual-list",pickerGap:c,allowTyping:h,filterList:g,searchType:p,highlightMatch:f,maxPickerHeight:d,maxPickerWidth:u,placeholder:this.getPlaceholderText(y),initialInputValue:m?.length===1?m:m===b.BACKSPACE?"":void 0,multiSelect:C,suppressDeselectAll:v,suppressMultiSelectPillRenderer:w},T=this.getInitialValueList(e),I=Array.isArray(n);return S?(T&&(M.valueList=T),y&&(M.allowNoResultsCopy=!0,M.filterList=!0)):I?(M.valueList=T,M.searchStringCreator=this.getSearchStringCallback(T)):typeof n=="function"&&y&&(M.allowNoResultsCopy=!0,M.filterList=!0),{params:M,valueList:T}}getAsyncValuesSource(e=this.resolveAsyncMode()){const{isFullAsync:t,isValuesPaged:s}=e;if(!(!t&&!s))return{searchValues:t?i=>this.getAsyncSearchValues(i):void 0,loadValuesPage:s?i=>this.getAsyncValuesPage(i):void 0,valuesPageInitialStartRow:s?i=>this.resolveValuesPageInitialStartRow(i):void 0,valuesPageSize:s?this.params.valuesPageSize:void 0}}getAsyncSearchValues(e){const{values:t}=this.params;return typeof t!="function"?[]:t({...this.params,search:e})}getAsyncValuesPage(e){const{valuesPage:t}=this.params;return typeof t!="function"?{values:[]}:t({...this.params,search:e.search,startRow:e.startRow,endRow:e.endRow,cursor:e.cursor})}resolveValuesPageInitialStartRow(e){if(e)return 0;const{valuesPageInitialStartRow:t,value:s}=this.params,i=typeof t=="function"?t(s):t;return Math.max(Math.floor(i??0),0)}getSearchStringCallback(e){if(typeof e[0]!="object")return;const t=this.params,{colDef:s,formatValue:i}=t,r=i??(n=>String(n??""));if(s.cellEditorParams?.formatValue)return n=>n.map(r);const{keyCreator:o}=s;if(o){F(266);const{column:n,node:a,data:l}=t;return c=>c.map(d=>{const u=N(this.gos,{value:d,colDef:s,column:n,node:a,data:l});return o(u)})}return n=>n.map(r)}afterGuiAttached(){const{focusAfterAttached:e,params:t}=this;setTimeout(()=>{if(!this.isAlive())return;const s=this.eEditor,{allowTyping:i,eventKey:r,cellStartedEdit:o}=t;if(e){const n=s.getFocusableElement();n.focus(),i&&(!r||r.length!==1)&&n.select()}o&&s.showPicker(),this.pendingInitialEventKey==null&&this.consumeInitialEventKey(r)})}consumeInitialEventKey(e){!e||this.initialEventKeyProcessed||(this.initialEventKeyProcessed=!0,this.processEventKey(e))}processEventKey(e){e&&(e===b.BACKSPACE?this.eEditor.searchTextFromString(null):e?.length===1&&this.eEditor.searchTextFromString(e))}focusIn(){this.eEditor.getFocusableElement().focus()}agSetEditValue(e){this.params.value=e,this.eEditor.setValue(e??null,!0)}getValue(){const{params:e}=this,t=this.eEditor.getValue();return e.parseValue?.(t)??t}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e;return t?t({value:this.getValue(),internalErrors:null,cellEditorParams:e}):null}},A0={moduleName:"RichSelect",version:Y,beans:[],userComponents:{agRichSelect:D0,agRichSelectCellEditor:D0},icons:{richSelectOpen:"small-down",richSelectRemove:"cancel",richSelectLoading:"loading"},dependsOn:[le,Es]},Ur="__AG_SELECT_ALL__",$r="__AG_ADD_SELECTION_TO_FILTER__",$z=class{constructor(e,t,s,i){this.valueSvc=e,this.getValueFormatter=t,this.formatter=s,this.column=i,this.displayedKeys=[]}updateDisplayedValuesToAllAvailable(e,t,s){this.displayedKeys=Array.from(s)}updateDisplayedValuesToMatchMiniFilter(e,t,s,i,r){this.displayedKeys=[];const o=this.getValueFormatter();for(const n of s)if(n==null)r&&this.displayedKeys.push(n);else{const a=e(n),l=this.valueSvc.formatValue(this.column,null,a,o,!1),c=this.formatter(l);i(c)&&this.displayedKeys.push(n)}}getDisplayedValueCount(){return this.displayedKeys.length}getDisplayedItem(e){return this.displayedKeys[e]}getSelectAllItem(){return Ur}getAddSelectionToFilterItem(){return $r}getDisplayedKeys(){return this.displayedKeys}forEachDisplayedKey(e){this.displayedKeys.forEach(e)}someDisplayedKey(e){return this.displayedKeys.some(e)}hasGroups(){return!1}refresh(){}},Kz={tag:"div",cls:"ag-set-filter-item",attrs:{"aria-hidden":"true"},children:[{tag:"span",cls:"ag-set-filter-group-icons",children:[{tag:"span",ref:"eGroupClosedIcon",cls:"ag-set-filter-group-closed-icon"},{tag:"span",ref:"eGroupOpenedIcon",cls:"ag-set-filter-group-opened-icon"},{tag:"span",ref:"eGroupIndeterminateIcon",cls:"ag-set-filter-group-indeterminate-icon"}]},{tag:"ag-checkbox",ref:"eCheckbox",cls:"ag-set-filter-item-checkbox"}]},jz={tag:"div",cls:"ag-set-filter-item",children:[{tag:"ag-checkbox",ref:"eCheckbox",cls:"ag-set-filter-item-checkbox"}]},qz=class extends A{constructor(e){super(e.isGroup?Kz:jz,[ds]),this.eCheckbox=x,this.eGroupOpenedIcon=x,this.eGroupClosedIcon=x,this.eGroupIndeterminateIcon=x,this.formattedValue=null,this.focusWrapper=e.focusWrapper,this.value=e.value,this.params=e.params,this.translate=e.translate,this.valueFormatter=e.valueFormatter,this.item=e.item,this.isSelected=e.isSelected,this.isTree=e.isTree,this.depth=e.depth??0,this.isGroup=e.isGroup,this.groupsExist=e.groupsExist,this.isExpanded=e.isExpanded,this.hasIndeterminateExpandState=e.hasIndeterminateExpandState}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"setFilterValue",shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0,getAdditionalParams:()=>{const{colDef:e,column:t}=this.params,s={colDef:e,column:t,valueFormatted:this.formattedValue??void 0};return this.isTree&&(s.level=this.depth),s}})),this.addDestroyFunc(()=>this.destroyCellRendererComponent?.()),this.render(),this.eCheckbox.setLabelEllipsis(!0).setValue(this.isSelected,!0).setDisabled(!!this.params.readOnly).getInputElement().setAttribute("tabindex","-1"),this.refreshVariableAriaLabels(),this.isTree&&(this.depth>0&&(this.addCss("ag-set-filter-indent-"+this.depth),this.getGui().style.setProperty("--ag-indentation-level",String(this.depth))),this.isGroup?this.setupExpansion():this.groupsExist&&this.addCss("ag-set-filter-add-group-indent"),on(this.getAriaElement(),this.depth+1)),this.refreshAriaChecked(),!this.params.readOnly&&this.eCheckbox.onValueChange(e=>this.onCheckboxChanged(!!e))}getFocusableElement(){return this.focusWrapper}setupExpansion(){const{eGroupClosedIcon:e,eGroupOpenedIcon:t,eGroupIndeterminateIcon:s,hasIndeterminateExpandState:i,beans:r}=this;e.appendChild(Bs("setFilterGroupClosed",r,null)),t.appendChild(Bs("setFilterGroupOpen",r,null));const o=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(e,{click:o}),this.addManagedElementListeners(t,{click:o}),i&&(s.appendChild(Bs("setFilterGroupIndeterminate",r,null)),this.addManagedElementListeners(s,{click:o})),this.setExpandedIcons(),this.refreshAriaExpanded()}onExpandOrContractClicked(){this.setExpanded(!this.isExpanded)}setExpanded(e,t){if(this.isGroup&&e!==this.isExpanded){this.isExpanded=e;const s={type:"expandedChanged",isExpanded:!!e,item:this.item};t||this.dispatchLocalEvent(s),this.setExpandedIcons(),this.refreshAriaExpanded()}}setExpandedIcons(){const{isExpanded:e,hasIndeterminateExpandState:t,eGroupClosedIcon:s,eGroupOpenedIcon:i,eGroupIndeterminateIcon:r}=this;V(s,t?e===!1:!e),V(i,e===!0),t&&V(r,e===void 0)}onCheckboxChanged(e){this.isSelected=e;const t={type:"selectionChanged",isSelected:e,item:this.item};this.dispatchLocalEvent(t),this.refreshVariableAriaLabels(),this.refreshAriaChecked()}toggleSelected(){this.params.readOnly||this.setSelected(!this.isSelected)}setSelected(e,t){this.isSelected=e,this.eCheckbox.setValue(e,t),this.refreshAriaChecked()}refreshVariableAriaLabels(){if(!this.isTree)return;const e=this.getLocaleTextFunc(),t=this.eCheckbox.getValue(),s=t===void 0?e("ariaIndeterminate","indeterminate"):t?e("ariaVisible","visible"):e("ariaHidden","hidden"),i=e("ariaToggleVisibility","Press SPACE to toggle visibility");Cs(this.eCheckbox.getInputElement(),void 0),this.eCheckbox.setInputAriaLabel(`${i} (${s})`)}setupFixedAriaLabels(e){if(!this.isTree)return;const s=this.getLocaleTextFunc()("ariaFilterValue","Filter Value"),i=this.getAriaElement();de(i,`${e} ${s}`),rn(i,this.eCheckbox.getInputElement().id)}refreshAriaChecked(){const e=this.getAriaElement();Hd(e,this.eCheckbox.getValue())}refreshAriaExpanded(){ot(this.getAriaElement(),!!this.isExpanded)}refresh(e,t,s){this.item=e,t!==this.isSelected&&this.setSelected(t,!0),this.setExpanded(s,!0);const{cellRendererComponent:i,cellRendererParams:r,beans:o,params:n}=this;if(this.valueFunction){const a=this.valueFunction();this.setTooltipAndCellRendererParams(a,a),i||this.renderCellWithoutCellRenderer()}if(i){const a=xr(o.userCompFactory,n,r);if(!i.refresh?.(a?.params??r)){const c=i;this.renderCell(),this.destroyBean(c)}}}render(){const{params:{column:e}}=this;let{value:t}=this,s=null;typeof t=="function"?(this.valueFunction=t,s=this.valueFunction(),t=s):this.isTree?s=Xe(t):s=this.getFormattedValue(e,t),this.formattedValue=s,this.setTooltipAndCellRendererParams(t,s),this.renderCell()}setTooltipAndCellRendererParams(e,t){const s=this.gos;if(this.params.showTooltips&&(!Fo(s)||!this.params.cellRenderer)){const i=t??Xe(e);this.shouldDisplayTooltip=na(s,()=>this.eCheckbox.getGui().querySelector(".ag-label")),this.tooltipFeature?.setTooltipAndRefresh(i)}this.cellRendererParams=N(s,{value:e,valueFormatted:t,colDef:this.params.colDef,column:this.params.column,setTooltip:(i,r)=>{s.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=r,this.tooltipFeature?.setTooltipAndRefresh(i)}})}getFormattedValue(e,t){return this.beans.valueSvc.formatValue(e,null,t,this.valueFormatter,!1)}renderCell(){const t=xr(this.beans.userCompFactory,this.params,this.cellRendererParams)?.newAgStackInstance();if(t==null){this.renderCellWithoutCellRenderer();return}t.then(s=>{s&&(this.cellRendererComponent=s,this.eCheckbox.setLabel(s.getGui()),this.destroyCellRendererComponent=()=>this.destroyBean(s))})}renderCellWithoutCellRenderer(){const{valueFormatted:e,value:t}=this.cellRendererParams;let s=e??t??this.translate("blanks");typeof s!="string"&&(F(208),s=""),this.eCheckbox.setLabel(s),this.setupFixedAriaLabels(s)}getComponentHolder(){return this.params.column.getColDef()}},Yz={loadingOoo:"Loading...",blanks:"(Blanks)",searchOoo:"Search...",selectAll:"(Select All)",selectAllSearchResults:"(Select All Search Results)",addCurrentSelectionToFilter:"Add current selection to filter",noMatches:"No matches.",ariaSearchFilterValues:"Search filter values",ariaFilterList:"Filter List",filterSummaryListInactive:"is (All)",filterSummaryListSeparator:", ",filterSummaryListShort:e=>`is (${e[0]})`,filterSummaryListLong:e=>`is (${e[0]}) and ${e[1]} more`};function zp(e,t,s){let i=e;return i?(i=i.map(r=>Xe(Ae(r))),!t&&s&&i.some(r=>r==null)?W(i)==null?null:i.filter(r=>r!=null):i):null}function Ht(e,t,s){return il(e,Yz,t,s)}function Xz(e){e.excelMode==="windows"?(e.buttons||(e.buttons=["apply","cancel"]),e.closeOnApply==null&&(e.closeOnApply=!0)):e.excelMode==="mac"&&(e.buttons||(e.buttons=["reset"]),e.applyMiniFilterWhileTyping==null&&(e.applyMiniFilterWhileTyping=!0),e.debounceMs==null&&(e.debounceMs=500)),e.excelMode&&e.defaultToNothingSelected&&(e.defaultToNothingSelected=!1,F(207))}function Zz(){return([e,t],[s,i])=>{if(t==null)return i==null?0:-1;if(i==null)return 1;for(let r=0;r=i.length)return 1;const o=sn(t[r],i[r]);if(o!==0)return o}return 0}}var I0=class{constructor(e,t,s,i){this.formatter=e,this.treeListPathGetter=t,this.treeListFormatter=s,this.treeDataOrGrouping=i,this.allDisplayedItemsTree=new Map,this.activeDisplayedItemsFlat=[],this.selectAllItem={depth:0,filterPasses:!0,available:!0,treeKey:Ur,children:this.allDisplayedItemsTree,expanded:!0,key:Ur,parentTreeKeys:[]},this.addSelectionToFilterItem={depth:0,filterPasses:!0,available:!0,treeKey:$r,expanded:!0,key:$r,parentTreeKeys:[]}}updateParams(e,t){this.treeListPathGetter=e,this.treeListFormatter=t}updateDisplayedValuesToAllAvailable(e,t,s,i){i==="reload"?this.generateItemTree(e,t,s):i==="otherFilter"?(this.updateAvailable(s),this.updateExpandAll()):i==="miniFilter"&&(this.resetFilter(),this.updateExpandAll()),this.flattenItems()}updateDisplayedValuesToMatchMiniFilter(e,t,s,i,r,o){o==="reload"?this.generateItemTree(e,t,s):o==="otherFilter"&&this.updateAvailable(s),this.updateFilter(i,r),this.updateExpandAll(),this.flattenItems()}generateItemTree(e,t,s){const i=new Map;this.allDisplayedItemsTree=i;let r=!1;const o=this.getTreeListPathGetter(e,s);for(const n of t){const a=e(n),l=o(a)??[null],c=l.length;c>1&&(r=!0);const d=s.has(n);let u=i,h,g=[];for(let p=0;pi;let s=!1;for(const i of t){const r=e(i);if(r instanceof Date){s=!0;break}else if(r!=null)break}return s?i=>Dr(i,!1):(F(211),i=>[String(i)])}flattenItems(){this.activeDisplayedItemsFlat=[];const e=t=>{for(const s of t.values())!s.filterPasses||!s.available||(this.activeDisplayedItemsFlat.push(s),s.children&&s.expanded&&e(s.children))};e(this.allDisplayedItemsTree)}resetFilter(){const e=t=>{const s=t.children;if(s)for(const i of s.values())e(i);t.filterPasses=!0};for(const t of this.allDisplayedItemsTree.values())e(t)}updateFilter(e,t){const s=i=>i.available?i.treeKey==null?t:e(this.formatter(this.treeListFormatter?this.treeListFormatter(i.treeKey,i.depth,i.parentTreeKeys):i.treeKey)):!1;for(const i of this.allDisplayedItemsTree.values())this.recursiveItemCheck(i,!1,s,"filterPasses")}getDisplayedValueCount(){return this.activeDisplayedItemsFlat.length}getDisplayedItem(e){return this.activeDisplayedItemsFlat[e]}getSelectAllItem(){return this.selectAllItem}getAddSelectionToFilterItem(){return this.addSelectionToFilterItem}getDisplayedKeys(){const e=[];return this.forEachDisplayedKey(t=>e.push(t)),e}forEachDisplayedKey(e){const t=(s,i)=>{const r=s.children;if(r){if(!s.expanded||!i)for(const o of r.values())o.filterPasses&&t(o,!1)}else e(s.key)};for(const s of this.activeDisplayedItemsFlat)t(s,!0)}someDisplayedKey(e){const t=(s,i)=>{const r=s.children;if(r){if(!s.expanded||!i){for(const o of r.values())if(o.filterPasses&&t(o,!1))return!0;return!1}}else return e(s.key);return!1};return this.activeDisplayedItemsFlat.some(s=>t(s,!0))}hasGroups(){return this.groupsExist}refresh(){this.updateExpandAll(),this.flattenItems()}updateExpandAll(){const e=(s,i,r)=>{for(const o of s.values()){if(!o.filterPasses||!o.available||!o.children)continue;if(i=i||!!o.expanded,r=r||!o.expanded,i&&r)return;const n=e(o.children,i,r);if(n===void 0)return;n?i=!0:r=!0}return i&&r?void 0:i},t=this.getSelectAllItem();t.expanded=e(t.children,!1,!1)}recursiveItemCheck(e,t,s,i){let r=!1;const o=e.children;if(o)for(const a of o.values()){const l=this.recursiveItemCheck(a,t||s(e),s,i);r=r||l}const n=t||r||s(e);return e[i]=n,n}updateAvailable(e){const t=s=>e.has(s.key);for(const s of this.allDisplayedItemsTree.values())this.recursiveItemCheck(s,!1,t,"available")}},k0=class extends An{constructor(){super("setFilter","set-filter"),this.filterType="set",this.eMiniFilter=x,this.eFilterLoading=x,this.eFilterLoadingIcon=x,this.eSetFilterList=x,this.eFilterNoMatches=x,this.hardRefreshVirtualList=!1,this.miniFilterText=null,this.addCurrentSelectionToFilter=!1,this.selectedKeys=new Set}setParams(e){super.setParams(e);const t=this.updateHandler(e.getHandler()),{column:s,textFormatter:i,treeList:r,treeListPathGetter:o,treeListFormatter:n}=e;this.formatter=i??(a=>a??null),this.displayValueModel=r?new I0(this.formatter,o,n,t.isTreeDataOrGrouping()):new $z(this.beans.valueSvc,()=>this.handler.valueFormatter,this.formatter,s),t.valueModel.allKeys.then(a=>{this.isAlive()&&(this.updateDisplayedValues("reload",a??[]),this.resetSelectionState(a??[]))}),t.valueModel.isLoading()&&this.setIsLoading(!0),this.initialiseFilterBodyUi()}refresh(e){return this.params.treeList!==e.treeList?!1:(this.updateHandler(e.getHandler()),super.refresh(e))}updateParams(e,t){super.updateParams(e,t),this.updateMiniFilter(),e.suppressSelectAll!==t.suppressSelectAll&&this.createVirtualListModel(e);const{textFormatter:s,treeListPathGetter:i,treeListFormatter:r}=e;this.formatter=s??(o=>o??null),this.displayValueModel instanceof I0&&this.displayValueModel.updateParams(i,r),this.handler.refreshFilterValues(!0)}updateHandler(e){if(this.handler!==e){for(const s of this.handlerDestroyFuncs??[])s();this.handlerDestroyFuncs=[...this.addManagedListeners(e,{anyFilterChanged:s=>{e.valueModel.allKeys.then(i=>{this.isAlive()&&(this.updateDisplayedValues("otherFilter",i??[]),s.updated&&(this.checkAndRefreshVirtualList(),this.showOrHideResults()))})},dataChanged:({hardRefresh:s})=>{e.valueModel.allKeys.then(i=>{this.isAlive()&&(this.updateDisplayedValues("reload",i??[]),this.setSelectedModel(this.state.model?.values??null),s&&(this.hardRefreshVirtualList=!0),this.checkAndRefreshVirtualList())})}}),...this.addManagedListeners(e.valueModel,{loadingStart:()=>this.setIsLoading(!0),loadingEnd:()=>this.setIsLoading(!1)})],this.handler=e}return e}updateUiVisibility(){}createBodyTemplate(){return{tag:"div",cls:"ag-set-filter",children:[{tag:"div",ref:"eFilterLoading",cls:"ag-filter-loading ag-loading ag-hidden",children:[{tag:"span",ref:"eFilterLoadingIcon",cls:"ag-loading-icon"},{tag:"span",cls:"ag-loading-text",children:Ht(this,"loadingOoo")}]},{tag:"ag-input-text-field",ref:"eMiniFilter",cls:"ag-mini-filter"},{tag:"div",ref:"eFilterNoMatches",cls:"ag-filter-no-matches ag-hidden",children:Ht(this,"noMatches")},{tag:"div",ref:"eSetFilterList",cls:"ag-set-filter-list",role:"presentation"}]}}getAgComponents(){return[Vt]}handleKeyDown(e){if(super.handleKeyDown(e),e.defaultPrevented)return;const t=()=>{if(!this.eSetFilterList.contains(ie(this.beans)))return;const s=this.virtualList.getLastFocusedRow();if(s==null)return;const i=this.virtualList.getComponentAt(s);if(i==null)return;e.preventDefault();const{readOnly:r}=this.params;if(!r)return i};switch(e.key){case b.SPACE:t()?.toggleSelected();break;case b.ENTER:this.handleKeyEnter(e);break;case b.LEFT:t()?.setExpanded(!1);break;case b.RIGHT:t()?.setExpanded(!0);break}}handleKeyEnter(e){e.preventDefault();const{excelMode:t,readOnly:s}=this.params;!t||s||(this.params.onAction("apply",void 0,e),this.params.excelMode==="mac"&&this.eMiniFilter.getInputElement().select())}setModelAndRefresh(e){return this.setSelectedModel(e).then(()=>{this.isAlive()&&this.checkAndRefreshVirtualList()})}setModelIntoUi(e){this.setMiniFilter(this.params.state.state?.miniFilterValue??null,!0);const t=e==null?null:e.values;return this.setModelAndRefresh(t)}getModelFromUi(){const e=this.getSelectedModel();return e?{values:e,filterType:this.filterType}:null}areNonNullModelsEqual(e,t){return be(e.values,t.values)}setIsLoading(e){V(this.eFilterLoading,e),e||(this.hardRefreshVirtualList=!0)}initialiseFilterBodyUi(){this.initVirtualList(),this.initMiniFilter(),this.initLoading()}initLoading(){const e=_("setFilterLoading",this.beans,this.params.column);e&&this.eFilterLoadingIcon.appendChild(e)}initVirtualList(){const e=Ht(this,"ariaFilterList"),t=!!this.params.treeList,s=this.virtualList=this.createBean(new Vo({cssIdentifier:"filter",ariaRole:t?"tree":"listbox",listName:e})),i=this.eSetFilterList;t&&i.classList.add("ag-set-filter-tree-list"),i.appendChild(s.getGui());const{cellHeight:r}=this.params;r!=null&&s.setRowHeight(r);const o=(a,l)=>this.createSetListItem(a,t,l);s.setComponentCreator(o);const n=(a,l)=>this.updateSetListItem(a,l);s.setComponentUpdater(n),this.createVirtualListModel(this.params)}createVirtualListModel(e){let t;e.suppressSelectAll?t=new Qz(this.displayValueModel):t=new Jz(this.displayValueModel,this.showAddCurrentSelectionToFilter.bind(this)),e.treeList&&(t=new e9(t)),this.virtualList.setModel(t)}getSelectAllLabel(){const e=this.miniFilterText==null||!this.params.excelMode?"selectAll":"selectAllSearchResults";return Ht(this,e)}getAddSelectionToFilterLabel(){return Ht(this,"addCurrentSelectionToFilter")}createSetListItem(e,t,s){const i=this.displayValueModel.hasGroups(),{isSelected:r,isExpanded:o}=this.isSelectedExpanded(e),{value:n,depth:a,isGroup:l,hasIndeterminateExpandState:c,selectedListener:d,expandedListener:u}=this.newSetListItemAttributes(e),h={focusWrapper:s,value:n,params:this.params,translate:p=>Ht(this,p),valueFormatter:this.handler.valueFormatter,item:e,isSelected:r,isTree:t,depth:a,groupsExist:i,isGroup:l,isExpanded:o,hasIndeterminateExpandState:c},g=this.createBean(new qz(h));return g.addEventListener("selectionChanged",d),u&&g.addEventListener("expandedChanged",u),g}newSetTreeItemAttributes(e){const t=this.displayValueModel.hasGroups();return e.key===Ur?{value:()=>this.getSelectAllLabel(),isGroup:t,depth:e.depth,hasIndeterminateExpandState:!0,selectedListener:s=>this.onSelectAll(s.isSelected),expandedListener:s=>this.onExpandAll(s.item,s.isExpanded)}:e.key===$r?{value:()=>this.getAddSelectionToFilterLabel(),depth:e.depth,isGroup:!1,hasIndeterminateExpandState:!1,selectedListener:s=>{this.addCurrentSelectionToFilter=s.isSelected,this.refreshAfterSelection()}}:e.children?{value:this.params.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,isGroup:!0,selectedListener:s=>this.onGroupItemSelected(s.item,s.isSelected),expandedListener:s=>this.onExpandedChanged(s.item,s.isExpanded)}:{value:this.params.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,selectedListener:s=>this.onItemSelected(s.item.key,s.isSelected)}}newSetListItemAttributes(e){return this.isSetFilterModelTreeItem(e)?this.newSetTreeItemAttributes(e):e===Ur?{value:()=>this.getSelectAllLabel(),selectedListener:t=>this.onSelectAll(t.isSelected)}:e===$r?{value:()=>this.getAddSelectionToFilterLabel(),selectedListener:t=>{this.addCurrentSelectionToFilter=t.isSelected,this.refreshAfterSelection()}}:{value:this.handler.valueModel.allValues.get(e)??null,selectedListener:t=>this.onItemSelected(t.item,t.isSelected)}}updateSetListItem(e,t){const{isSelected:s,isExpanded:i}=this.isSelectedExpanded(e);t.refresh(e,s,i)}isSelectedExpanded(e){let t,s;return this.isSetFilterModelTreeItem(e)?(s=e.expanded,e.key===Ur?t=this.isSelectAllSelected():e.key===$r?t=this.isAddCurrentSelectionToFilterChecked():e.children?t=this.areAllChildrenSelected(e):t=this.selectedKeys.has(e.key)):e===Ur?t=this.isSelectAllSelected():e===$r?t=this.isAddCurrentSelectionToFilterChecked():t=this.selectedKeys.has(e),{isSelected:t,isExpanded:s}}isSetFilterModelTreeItem(e){return e?.treeKey!==void 0}initMiniFilter(){const{eMiniFilter:e}=this;this.updateMiniFilter(),e.onValueChange(()=>this.onMiniFilterInput()),e.setInputAriaLabel(Ht(this,"ariaSearchFilterValues")),this.addManagedElementListeners(e.getInputElement(),{keydown:t=>this.onMiniFilterKeyDown(t)})}updateMiniFilter(){const{eMiniFilter:e,miniFilterText:t,params:s}=this;e.setDisplayed(!s.suppressMiniFilter),e.setValue(t)}afterGuiAttached(e){super.afterGuiAttached(e),this.resetExpansion(),this.refreshVirtualList();const{eMiniFilter:t}=this;t.setInputPlaceholder(Ht(this,"searchOoo")),e?.suppressFocus||(t.isDisplayed()?t.getFocusableElement().focus():this.virtualList.awaitStable(()=>this.virtualList.focusRow(0)))}afterGuiDetached(){super.afterGuiDetached();const{column:e,excelMode:t,model:s,onStateChange:i}=this.params;this.beans.colFilter?.shouldKeepStateOnDetach(e)||(t&&this.resetMiniFilter(),(t||s!==this.state.model)&&(i({model:s,state:this.getState()}),this.showOrHideResults()))}canApply(e){return this.params.excelMode?e==null||e.values.length>0:!0}onNewRowsLoaded(){}setFilterValues(e){F(283),this.handler.setFilterValues(e)}resetFilterValues(){F(283),this.handler.resetFilterValues()}refreshFilterValues(){F(283),this.doRefreshFilterValues()}doRefreshFilterValues(){this.handler.refreshFilterValues()}onAnyFilterChanged(){}onMiniFilterInput(e){if(!this.doSetMiniFilter(this.eMiniFilter.getValue()))return;if(e){this.showOrHideResults();return}const{applyMiniFilterWhileTyping:t,readOnly:s,excelMode:i}=this.params,r=!s&&(t||!!i),o=t&&!s?"debounce":void 0;this.updateUiAfterMiniFilterChange(r,o)}updateUiAfterMiniFilterChange(e,t){if(e){const{excelMode:s,readOnly:i,model:r}=this.params;s&&!i&&this.miniFilterText==null?this.setModelAndRefresh(r?.values??null):this.selectAllMatchingMiniFilter(!0)}this.checkAndRefreshVirtualList(),this.onUiChanged(e?t:"prevent"),this.showOrHideResults()}showOrHideResults(){const e=this.miniFilterText!=null&&this.displayValueModel.getDisplayedValueCount()<1;V(this.eFilterNoMatches,e),V(this.eSetFilterList,!e)}resetMiniFilter(){this.eMiniFilter.setValue(null,!0),this.doSetMiniFilter(null)}onMiniFilterKeyDown(e){const{excelMode:t,readOnly:s}=this.params;e.key===b.ENTER&&!t&&!s&&this.updateUiAfterMiniFilterChange(!0,"immediately")}focusRowIfAlive(e){return e==null?Promise.resolve():new Promise(t=>{window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e),t()},0)})}onSelectAll(e){e?this.selectAllMatchingMiniFilter():this.deselectAllMatchingMiniFilter(),this.refreshAfterSelection()}onGroupItemSelected(e,t){const s=i=>{if(!i.filterPasses)return;const r=i.children;if(r)for(const o of r.values())s(o);else this.setKeySelected(i.key,t)};s(e),this.refreshAfterSelection()}onItemSelected(e,t){this.setKeySelected(e,t),this.refreshAfterSelection()}onExpandAll(e,t){const s=i=>{if(i.filterPasses&&i.available&&i.children){for(const r of i.children.values())s(r);i.expanded=t}};s(e),this.refreshAfterExpansion()}onExpandedChanged(e,t){e.expanded=t,this.refreshAfterExpansion()}refreshAfterExpansion(){const e=this.virtualList.getLastFocusedRow();this.updateDisplayedValues("expansion"),this.checkAndRefreshVirtualList(),this.focusRowIfAlive(e)}refreshAfterSelection(){const e=this.virtualList.getLastFocusedRow();this.checkAndRefreshVirtualList(),this.onUiChanged(),this.focusRowIfAlive(e)}setMiniFilter(e,t){this.eMiniFilter.setValue(e,t),this.onMiniFilterInput(t)}doSetMiniFilter(e){return e=Ae(e),this.miniFilterText===e?!1:(e===null&&(this.addCurrentSelectionToFilter=!1),this.miniFilterText=e,this.updateDisplayedValues("miniFilter"),!0)}getMiniFilter(){return this.miniFilterText}getUiChangeEventParams(){return{miniFilterValue:this.miniFilterText}}getState(){const e=this.miniFilterText;return e?{miniFilterValue:e}:void 0}checkAndRefreshVirtualList(){this.virtualList.refresh(!this.hardRefreshVirtualList),this.hardRefreshVirtualList&&(this.hardRefreshVirtualList=!1)}getFilterKeys(){return F(283),this.handler.getFilterKeys()}getFilterValues(){return F(283),this.handler.getFilterValues()}refreshVirtualList(){this.params.refreshValuesOnOpen?this.doRefreshFilterValues():this.checkAndRefreshVirtualList()}isSelectAllSelected(){if(this.params.defaultToNothingSelected){if(this.hasSelections()&&this.isEverythingVisibleSelected())return!0;if(this.isNothingVisibleSelected())return!1}else{if(this.hasSelections()&&this.isNothingVisibleSelected())return!1;if(this.isEverythingVisibleSelected())return!0}}areAllChildrenSelected(e){const t=s=>{if(s.children){let i=!1,r=!1;for(const o of s.children.values()){if(!o.filterPasses||!o.available)continue;const n=t(o);if(n===void 0||(n?i=!0:r=!0,i&&r))return}return i}else return this.selectedKeys.has(s.key)};return this.params.defaultToNothingSelected?this.hasSelections()&&t(e):t(e)}resetExpansion(){if(!this.params.treeList)return;const e=this.displayValueModel.getSelectAllItem();if(this.isSetFilterModelTreeItem(e)){const t=s=>{const i=s.children;if(i){for(const r of i.values())t(r);s.expanded=!1}};t(e),this.updateDisplayedValues("expansion")}}getModelAsString(e){return this.handler.getModelAsString(e)}getPositionableElement(){return this.eSetFilterList}updateDisplayedValues(e,t){if(e==="expansion"){this.displayValueModel.refresh();return}const s=this.handler,i=s.valueModel;if(this.miniFilterText==null){this.displayValueModel.updateDisplayedValuesToAllAvailable(a=>i.allValues.get(a)??null,t,i.availableKeys,e);return}const r=s.caseFormat(this.formatter(this.miniFilterText)||""),o=a=>a!=null&&s.caseFormat(a).includes(r),n=!!this.params.excelMode&&o(Ht(this,"blanks"));this.displayValueModel.updateDisplayedValuesToMatchMiniFilter(a=>i.allValues.get(a)??null,t,i.availableKeys,o,n,e)}hasSelections(){return this.params.defaultToNothingSelected?this.selectedKeys.size>0:this.handler.valueModel.allValues.size!==this.selectedKeys.size}isInWindowsExcelMode(){return this.params.excelMode==="windows"}isAddCurrentSelectionToFilterChecked(){return this.isInWindowsExcelMode()&&this.addCurrentSelectionToFilter}showAddCurrentSelectionToFilter(){return this.isInWindowsExcelMode()&&D(this.miniFilterText)&&this.miniFilterText.length>0}selectAllMatchingMiniFilter(e=!1){this.miniFilterText==null?this.selectedKeys=new Set(this.handler.valueModel.allValues.keys()):(e&&this.selectedKeys.clear(),this.displayValueModel.forEachDisplayedKey(t=>this.selectedKeys.add(t)))}deselectAllMatchingMiniFilter(){this.miniFilterText==null?this.selectedKeys.clear():this.displayValueModel.forEachDisplayedKey(e=>this.selectedKeys.delete(e))}setKeySelected(e,t){t?this.selectedKeys.add(e):(this.params.excelMode&&this.isEverythingVisibleSelected()&&this.resetSelectionState(this.displayValueModel.getDisplayedKeys()),this.selectedKeys.delete(e))}isEverythingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>!this.selectedKeys.has(e))}isNothingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>this.selectedKeys.has(e))}getSelectedModel(){if(!this.hasSelections())return null;const e=this.isAddCurrentSelectionToFilterChecked()?this.params.model?.values:void 0;if(e?.length){if(this.selectedKeys){const t=new Set([...e,...this.selectedKeys]);return Array.from(t)}return Array.from(e)}return Array.from(this.selectedKeys)}setSelectedModel(e){const t=this.handler,s=t.valueModel;return s.allKeys.then(i=>{if(e==null)this.resetSelectionState(i??[]);else{this.selectedKeys.clear();const r=new Map;s.allValues.forEach((o,n)=>{r.set(t.caseFormat(n),n)}),e.forEach(o=>{const n=t.caseFormat(Ae(o)),a=r.get(n);a!==void 0&&this.selectedKeys.add(a)})}})}resetSelectionState(e){this.params.defaultToNothingSelected?this.selectedKeys.clear():this.selectedKeys=new Set(e)}getFilterHandler(){return this.handler}destroy(){this.virtualList=this.destroyBean(this.virtualList);for(const e of this.handlerDestroyFuncs??[])e();this.handler=void 0,this.displayValueModel=void 0,this.selectedKeys.clear(),super.destroy()}},Qz=class{constructor(e){this.model=e}getRowCount(){return this.model.getDisplayedValueCount()}getRow(e){return this.model.getDisplayedItem(e)}areRowsEqual(e,t){return e===t}},Jz=class{constructor(e,t){this.model=e,this.showAddCurrentSelectionToFilter=t}getRowCount(){const t=this.showAddCurrentSelectionToFilter()?2:1;return this.model.getDisplayedValueCount()+t}getRow(e){if(e===0)return this.model.getSelectAllItem();const t=this.showAddCurrentSelectionToFilter(),s=t?2:1;return e===1&&t?this.model.getAddSelectionToFilterItem():this.model.getDisplayedItem(e-s)}areRowsEqual(e,t){return e===t}},e9=class{constructor(e){this.model=e}getRowCount(){return this.model.getRowCount()}getRow(e){return this.model.getRow(e)}areRowsEqual(e,t){return e==null&&t==null?!0:e!=null&&t!=null&&e.treeKey===t.treeKey&&e.depth===t.depth}},t9=class extends E{constructor(e,t,s,i,r){super(),this.createKey=e,this.caseFormat=t,this.getValue=s,this.isTreeDataOrGrouping=i,this.isTreeData=r}extractUniqueValuesAsync(e,t){return new $(s=>{if(this.beans.rowModel.rowCountReady)s(this.extractUniqueValues(e,t));else{const[i]=this.addManagedEventListeners({rowCountReady:()=>{i?.(),s(this.extractUniqueValues(e,t))}})}})}extractUniqueValues(e,t){const s=new Map,i=this.extractExistingFormattedKeys(t),r=new Set,o=this.isTreeData(),n=this.isTreeDataOrGrouping(),a=this.beans.rowGroupColsSvc?.columns,l=this.gos.get("groupAllowUnbalanced"),c=(d,u)=>{const h=this.caseFormat(d);if(!r.has(h)){r.add(h);let g=d,p=Ae(u);const f=i?.get(h);f!=null&&(g=f,p=t.get(f)),s.set(g,p)}};return this.beans.rowModel.forEachLeafNode(d=>{if(!d.data||!e(d))return;if(n){this.addValueForTreeDataOrGrouping(d,o,a,c,l);return}const u=this.getValue(d);if(u!=null&&Array.isArray(u)){for(const h of u)c(this.createKey(h,d),h);u.length===0&&c(null,null)}else c(this.createKey(u,d),u)}),s}addValueForTreeDataOrGrouping(e,t,s=[],i,r){let o;if(t){if(e.childrenAfterGroup?.length)return;o=e.getRoute()??[e.key??e.id]}else o=s.map(a=>this.beans.valueSvc.getKeyForNode(a,e)),o.push(this.getValue(e));const n=zp(o,t,r);i(this.createKey(n),n)}extractExistingFormattedKeys(e){if(!e)return null;const t=new Map;return e.forEach((s,i)=>{t.set(this.caseFormat(i),i)}),t}},s9=class{constructor(e){this.caseFormat=e,this.keys=null}isNull(){return this.keys==null}isEmpty(){return!this.keys?.size}update(e){const t=new Set;this.keys=t;const s=e?.values;if(s){const i=this.caseFormat;for(let r=0,o=s.length;r(e[e.PROVIDED_LIST=0]="PROVIDED_LIST",e[e.PROVIDED_CALLBACK=1]="PROVIDED_CALLBACK",e[e.TAKEN_FROM_GRID_VALUES=2]="TAKEN_FROM_GRID_VALUES",e))(L0||{}),_p=L0,i9=class extends E{constructor(e,t,s,i,r){super(),this.clientSideValuesExtractor=e,this.caseFormat=t,this.createKey=s,this.isTreeDataOrGrouping=i,this.params=r,this.allValues=new Map,this.availableKeys=new Set,this.providedValues=null,this.initialised=!1}postConstruct(){const e=this.params,t=e.handlerParams.filterParams.values;this.updateParams(e),t==null?this.valuesType=2:(this.valuesType=Array.isArray(t)?0:1,this.providedValues=t),this.updateAllValues()}refresh(e){const t=e.handlerParams;if(t.source!=="colDef")return;const{values:s,suppressSorting:i}=t.filterParams,r=this.providedValues,o=this.params.handlerParams.filterParams.suppressSorting;this.params=e,this.updateParams(e),this.providedValues=s??null,(this.providedValues!==r||i!==o)&&(!s||s.length===0?(this.valuesType=2,this.providedValues=null):this.valuesType=Array.isArray(s)?0:1,this.updateAllValues())}updateParams(e){const{handlerParams:{colDef:t,filterParams:{comparator:s,treeList:i,treeListPathGetter:r}},usingComplexObjects:o}=e,n=s??t.comparator,a=this.isTreeDataOrGrouping();let l;a&&!n?l=Zz():i&&!r&&!n?l=([c,d],[u,h])=>sn(d,h):l=([c,d],[u,h])=>n(d,h),this.entryComparator=l,this.keyComparator=n??sn,this.compareByValue=!!(o&&n||a||i&&!r)}updateAllValues(){return this.allKeys=new $(e=>{switch(this.valuesType){case 2:this.getValuesFromRowsAsync().then(t=>e(this.processAllValues(t)));break;case 0:{e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(this.providedValues))));break}case 1:{this.dispatchLocalEvent({type:"loadingStart"});const t=this.providedValues,{column:s,colDef:i}=this.params.handlerParams,r=N(this.gos,{success:o=>{this.dispatchLocalEvent({type:"loadingEnd"}),e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(o))))},colDef:i,column:s});window.setTimeout(()=>t(r),0);break}}}),this.allKeys.then(e=>{this.updateAvailableKeys(e??[]),this.initialised=!0}),this.allKeys}getAvailableValues(e){return this.sortKeys(this.getValuesFromRows(e))}overrideValues(e){return this.allKeys.then(()=>{this.valuesType=0,this.providedValues=e})}refreshAvailable(){return new $(e=>{if(this.showAvailableOnly()){this.allKeys.then(t=>{const s=t??[];this.updateAvailableKeys(s),e(!0)});return}e(!1)})}refreshAll(){return new $(e=>{this.allKeys.then(()=>{this.updateAllValues().then(()=>{e()})})})}isLoading(){return!this.initialised&&this.valuesType===1}isInitialised(){return this.initialised}getValueForFormatter(e){return this.initialised?this.allValues.get(e):e}getAvailableKeys(e){return this.initialised?e.filter(t=>this.availableKeys.has(t)):e}getParamsForValuesFromRows(e){if(!this.clientSideValuesExtractor){Q(113);return}return e&&!this.params.handlerParams.filterParams.caseSensitive?this.allValues:void 0}getValuesFromRows(e){const t=this.getParamsForValuesFromRows(!0);return this.clientSideValuesExtractor?.extractUniqueValues(e,t)??null}getValuesFromRowsAsync(){const e=this.getParamsForValuesFromRows(!1);return this.clientSideValuesExtractor?.extractUniqueValuesAsync(()=>!0,e)??$.resolve(null)}processAllValues(e){const t=this.sortKeys(e);return this.allValues=e??new Map,t}uniqueValues(e){const t=new Map,s=new Set,{caseFormat:i,createKey:r}=this;for(const o of e??[]){const n=Ae(o),a=r(n),l=i(a);s.has(l)||(s.add(l),t.set(a,n))}return t}validateProvidedValues(e){if(this.params.usingComplexObjects&&e?.length){const t=e[0];t&&typeof t!="object"&&typeof t!="function"&&(this.createKey(t)==null?F(209):F(210))}return e}sortKeys(e){const t=e??new Map,s=this.params.handlerParams.filterParams;if(s.suppressSorting)return Array.from(t.keys());let i;return this.compareByValue?i=Array.from(t.entries()).sort(this.entryComparator).map(([r])=>r):i=Array.from(t.keys()).sort(this.keyComparator),s.excelMode&&t.has(null)&&(i=i.filter(r=>r!=null),i.push(null)),i}showAvailableOnly(){return this.valuesType===2}updateAvailableKeys(e){const t=this.showAvailableOnly()?this.getAvailableValues(s=>this.params.handlerParams.doesRowPassOtherFilter(s)):e;this.availableKeys=new Set(t),window.setTimeout(()=>{this.isAlive()&&this.dispatchLocalEvent({type:"availableValuesChanged"})})}},r9=class extends E{constructor(){super(...arguments),this.filterType="set",this.treeDataTreeList=!1,this.groupingTreeList=!1,this.caseSensitive=!1,this.noValueFormatterSupplied=!1}init(e){this.updateParams(e);const t=this.isTreeDataOrGrouping.bind(this),s=()=>this.treeDataTreeList,i=this.createKey,r=this.caseFormat.bind(this),{gos:o,beans:n}=this,a=ae(o,n.rowModel)?this.createManagedBean(new t9(i,r,e.getValue,t,s)):void 0,l=this.createManagedBean(new i9(a,r,i,t,{handlerParams:e,usingComplexObjects:!!(e.filterParams.keyCreator??e.colDef.keyCreator)}));this.addManagedListeners(l,{availableValuesChanged:e.onModelAsStringChange}),this.valueModel=l,this.appliedModel=new s9(this.caseFormat.bind(this)),this.appliedModel.update(e.model),this.validateModel(e),this.addEventListenersForDataChanges()}refresh(e){this.updateParams(e),this.valueModel.refresh({handlerParams:e,usingComplexObjects:!!(e.filterParams.keyCreator??e.colDef.keyCreator)}),this.appliedModel.update(e.model),this.validateModel(e)}updateParams(e){this.params=e;const{colDef:t,filterParams:{caseSensitive:s,treeList:i,keyCreator:r,valueFormatter:o}}=e;this.caseSensitive=!!s;const n=!!t.showRowGroup;this.treeDataTreeList=this.gos.get("treeData")&&!!i&&n,this.groupingTreeList=!!this.beans.rowGroupColsSvc?.columns.length&&!!i&&n;const a=r??t.keyCreator;this.createKey=this.generateCreateKey(a,this.isTreeDataOrGrouping()),this.setValueFormatter(o,a,!!i,!!t.refData)}doesFilterPass(e){const{appliedModel:t,treeDataTreeList:s,groupingTreeList:i}=this;if(t.isNull())return!0;if(t.isEmpty())return!1;const{node:r}=e;if(s)return this.doesFilterPassForTreeData(r);if(i)return this.doesFilterPassForGrouping(r);const o=this.params.getValue(r);return o!=null&&Array.isArray(o)?o.length===0?t.has(null):o.some(n=>t.has(this.createKey(n,r))):t.has(this.createKey(o,r))}getFormattedValue(e){let t=this.valueModel.getValueForFormatter(e);this.noValueFormatterSupplied&&this.isTreeDataOrGrouping()&&Array.isArray(t)&&(t=W(t));const s=this.beans.valueSvc.formatValue(this.params.column,null,t,this.valueFormatter,!1);return s??Xe(t)??Ht(this,"blanks")}getModelAsString(e,t){const{values:s}=e??{},i=t==="filterToolPanel";if(s==null)return i?Ht(this,"filterSummaryListInactive"):"";const r=this.valueModel.getAvailableKeys(s),o=r.length,n=i?3:10,a=r.slice(0,n).map(l=>this.getFormattedValue(l));if(i){const l=a.join(Ht(this,"filterSummaryListSeparator"));return o>3?Ht(this,"filterSummaryListLong",[l,String(o-3)]):Ht(this,"filterSummaryListShort",[l])}return`(${o}) ${a.join(",")}${o>10?",...":""}`}onAnyFilterChanged(){window.setTimeout(()=>{this.isAlive()&&this.valueModel.refreshAvailable().then(e=>{this.dispatchLocalEvent({type:"anyFilterChanged",updated:!!e})})})}onNewRowsLoaded(){this.syncAfterDataChange()}setFilterValues(e){this.valueModel.overrideValues(e).then(()=>{this.refreshFilterValues()})}resetFilterValues(){this.valueModel.valuesType=_p.TAKEN_FROM_GRID_VALUES,this.syncAfterDataChange()}refreshFilterValues(e){this.valueModel.isInitialised()&&this.valueModel.refreshAll().then(()=>{this.dispatchLocalEvent({type:"dataChanged",hardRefresh:!0}),this.validateModel(this.params,void 0,!e)})}getFilterKeys(){return Array.from(this.valueModel.allValues.keys())}getFilterValues(){return Array.from(this.valueModel.allValues.values())}isTreeDataOrGrouping(){return this.treeDataTreeList||this.groupingTreeList}caseFormat(e){return e==null||typeof e!="string"||this.caseSensitive?e:e.toUpperCase()}addEventListenersForDataChanges(){this.addManagedPropertyListeners(["groupAllowUnbalanced"],()=>this.syncAfterDataChange());const e=Ce(this,this.syncAfterDataChange.bind(this),0);this.addManagedEventListeners({cellValueChanged:t=>{t.column===this.params.column&&e()}})}syncAfterDataChange(){this.isValuesTakenFromGrid()&&this.valueModel.refreshAll().then(()=>{this.dispatchLocalEvent({type:"dataChanged"}),this.validateModel(this.params,{afterDataChange:!0})})}validateModel(e,t,s){const i=this.valueModel;i.allKeys.then(()=>{const r=e.model;if(r==null)return;const o=new Map,n=g=>o.set(this.caseFormat(g),g);if(s)for(const g of i.availableKeys)n(g);else i.allValues.forEach((g,p)=>n(p));const a=[];let l=!1;for(const g of r.values){const p=this.caseFormat(Ae(g)),f=o.get(p);f!==void 0?(a.push(f),f!==g&&(l=!0)):l=!0}const c=a.length,d=e.filterParams;if(c===0&&d.excelMode){e.onModelChange(null,t);return}const h=!d.defaultToNothingSelected&&(this.valueModel.valuesType===_p.TAKEN_FROM_GRID_VALUES||!d.suppressClearModelOnRefreshValues)&&c===o.size;if(l||!r.filterType||h){const g=h?null:{filterType:this.filterType,values:a};e.onModelChange(g,t)}})}isValuesTakenFromGrid(){return this.valueModel.valuesType===_p.TAKEN_FROM_GRID_VALUES}doesFilterPassForTreeData(e){if(e.childrenAfterGroup?.length)return!1;const{gos:t,appliedModel:s}=this;return s.has(this.createKey(zp(e.getRoute()??[e.key??e.id],!0,t.get("groupAllowUnbalanced"))))}doesFilterPassForGrouping(e){const{appliedModel:t,params:s,gos:i,beans:{rowGroupColsSvc:r,valueSvc:o}}=this,n=(r?.columns??[]).map(a=>o.getKeyForNode(a,e));return n.push(s.getValue(e)),t.has(this.createKey(zp(n,!1,i.get("groupAllowUnbalanced"))))}generateCreateKey(e,t){return t&&!e?(Q(250),()=>null):e?(s,i=null)=>{const r=this.getKeyCreatorParams(s,i);return Ae(e(r))}:s=>Ae(Xe(s))}getKeyCreatorParams(e,t=null){const{colDef:s,column:i}=this.params;return N(this.gos,{value:e,colDef:s,column:i,node:t,data:t?.data})}setValueFormatter(e,t,s,i){let r=e;if(!r){if(t&&!s){Q(249);return}this.noValueFormatterSupplied=!0,i||(r=o=>Xe(o.value))}this.valueFormatter=r}getCrossFilterModel(e){const{createKey:t,valueModel:s,params:i}=this;return e(t,s.availableKeys,i.model?.values)}destroy(){this.appliedModel.destroy(),super.destroy(),this.valueModel=void 0}},o9={tag:"div",cls:"ag-floating-filter-input ag-set-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},n9=class extends A{constructor(){super(o9,[Vt]),this.eFloatingFilterText=x}init(e){this.params=e,this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams(e)}setParams(e){const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0),s=this.getLocaleTextFunc();if(this.eFloatingFilterText.setInputAriaLabel(`${t} ${s("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const i=e;this.updateFloatingFilterText(i.model)}}refresh(e){this.params=e,this.setParams(e)}onParentModelChanged(e){this.updateFloatingFilterText(e)}parentSetFilterInstance(e){this.params.parentFilterInstance(t=>{if(!(t instanceof k0)){Q(248);return}e(t)})}updateFloatingFilterText(e){e==null?this.eFloatingFilterText.setValue(""):this.gos.get("enableFilterHandlers")?this.eFloatingFilterText.setValue(this.params.getHandler().getModelAsString?.(e)??""):this.parentSetFilterInstance(t=>{this.eFloatingFilterText.setValue(t.getModelAsString(e))})}},G0={moduleName:"SetFilter",version:Y,userComponents:{agSetColumnFilter:{classImp:k0,params:{useForm:!0},processParams:e=>(Xz(e),e)},agSetColumnFloatingFilter:n9},dynamicBeans:{agSetColumnFilterHandler:r9},icons:{setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",setFilterLoading:"loading"},dependsOn:[le,Ps]},a9=".ag-status-bar{border-top:var(--ag-footer-row-border);display:flex;justify-content:space-between;line-height:1.5;overflow:hidden;padding-left:calc(var(--ag-spacing)*4);padding-right:calc(var(--ag-spacing)*4)}.ag-status-panel,:where(.ag-status-panel.ag-status-panel-aggregations .ag-status-name-value){display:inline-flex}.ag-status-name-value{color:var(--ag-status-bar-label-color);font-weight:var(--ag-status-bar-label-font-weight);margin-left:var(--ag-spacing);margin-right:var(--ag-spacing);padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding);white-space:nowrap}.ag-status-name-value-value{color:var(--ag-status-bar-value-color);font-weight:var(--ag-status-bar-value-font-weight)}.ag-status-bar-left{display:inline-flex}.ag-status-bar-center{display:inline-flex;text-align:center}.ag-status-bar-right{display:inline-flex}";function l9(e,t,s){return e.getCompDetails(t,c9,void 0,s,!0)}var c9={name:"statusPanel",optionalMethods:["refresh"]},d9={agAggregationComponent:{rowModels:["clientSide","serverSide"],warnArgs:[221]},agFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[222]},agSelectedRowCountComponent:{rowModels:["clientSide","serverSide"],warnArgs:[223]},agTotalAndFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[224]},agTotalRowCountComponent:{rowModels:["clientSide"],warnArgs:[225]}},u9={tag:"div",cls:"ag-status-bar",children:[{tag:"div",ref:"eStatusBarLeft",cls:"ag-status-bar-left",role:"status"},{tag:"div",ref:"eStatusBarCenter",cls:"ag-status-bar-center",role:"status"},{tag:"div",ref:"eStatusBarRight",cls:"ag-status-bar-right",role:"status"}]},h9=class extends A{constructor(){super(u9),this.updateQueued=!1,this.panelsPromise=$.resolve(),this.eStatusBarLeft=x,this.eStatusBarCenter=x,this.eStatusBarRight=x,this.compDestroyFunctions={},this.registerCSS(a9)}wireBeans(e){this.userCompFactory=e.userCompFactory,this.statusBarSvc=e.statusBarSvc}postConstruct(){this.processStatusPanels(new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this)),ho(this.beans,this,this.getGui())}getFocusableContainerName(){return"statusBar"}getValidPanels(){const e=this.gos,t=e.get("statusBar")?.statusPanels;return t&&t.filter(s=>{const{rowModels:i,warnArgs:r}=d9[s.statusPanel]??{};return!i||i.includes(e.get("rowModelType"))?!0:(F(...r),!1)})}processStatusPanels(e){const t=this.getValidPanels();if(t){const s=t.filter(o=>o.align==="left"),i=t.filter(o=>o.align==="center"),r=t.filter(o=>!o.align||o.align==="right");this.panelsPromise=$.all([this.createAndRenderComponents(s,this.eStatusBarLeft,e),this.createAndRenderComponents(i,this.eStatusBarCenter,e),this.createAndRenderComponents(r,this.eStatusBarRight,e)])}else this.setDisplayed(!1)}handleStatusBarChanged(){this.updateQueued||(this.updateQueued=!0,this.panelsPromise.then(()=>{this.updateStatusBar(),this.updateQueued=!1}))}updateStatusBar(){const e=this.getValidPanels(),t=Array.isArray(e)&&e.length>0;this.setDisplayed(t);const s=new Map;if(t)for(const i of e){const r=i.key??i.statusPanel,o=this.statusBarSvc.getStatusPanel(r);if(o?.refresh){const n=N(this.gos,{...i.statusPanelParams??{},key:r});o.refresh(n)&&(s.set(r,o),delete this.compDestroyFunctions[r],ue(o.getGui()))}}this.resetStatusBar(),t&&this.processStatusPanels(s)}resetStatusBar(){ee(this.eStatusBarLeft),ee(this.eStatusBarCenter),ee(this.eStatusBarRight),this.destroyComponents(),this.statusBarSvc.unregisterAllComponents()}destroy(){this.destroyComponents(),super.destroy()}destroyComponents(){for(const e of Object.values(this.compDestroyFunctions))e();this.compDestroyFunctions={}}createAndRenderComponents(e,t,s){const i=[];for(const r of e){const o=r.key||r.statusPanel,n=s.get(o);let a;if(n)a=$.resolve(n);else{const l=l9(this.userCompFactory,r,N(this.gos,{key:o}));if(l==null)continue;a=l.newAgStackInstance()}i.push({key:o,promise:a})}return $.all(i.map(r=>r.promise)).then(()=>{for(const r of i)r.promise.then(o=>{const n=()=>{this.destroyBean(o)};this.isAlive()?(this.statusBarSvc.registerStatusPanel(r.key,o),t.appendChild(o.getGui()),this.compDestroyFunctions[r.key]=n):n()})})}},g9={selector:"AG-STATUS-BAR",component:h9},p9={tag:"div",cls:"ag-status-name-value",children:[{tag:"span",ref:"eLabel"},":\xA0",{tag:"span",ref:"eValue",cls:"ag-status-name-value-value"}]},f9=BigInt(Number.MIN_SAFE_INTEGER),m9=BigInt(Number.MAX_SAFE_INTEGER),Ea=class extends A{constructor(){super(p9),this.eLabel=x,this.eValue=x}setLabel(e,t){this.setDisplayed(!1),this.eLabel.textContent=this.getLocaleTextFunc()(e,t)}setValue(e,t){let s=null,i;typeof e=="bigint"?(i=e,e>=f9&&e<=m9&&(s=Number(e))):s=e,this.eValue.textContent=this.valueFormatter(N(this.gos,{value:s,bigintValue:i,totalRows:t,key:this.key}))}},C9={selector:"AG-NAME-VALUE",component:Ea},O0=e=>{let t=0;return e.forEachNodeAfterFilter(s=>{s.data&&t++}),t},Pa=e=>{let t=0;return e.forEachNode(s=>{s.data&&t++}),t};function v9(e,t){return typeof e!="number"?"":ci(Math.round(e*100)/100,t)}var w9={tag:"div",cls:"ag-status-panel ag-status-panel-aggregations",children:[{tag:"ag-name-value",ref:"avgAggregationComp"},{tag:"ag-name-value",ref:"countAggregationComp"},{tag:"ag-name-value",ref:"minAggregationComp"},{tag:"ag-name-value",ref:"maxAggregationComp"},{tag:"ag-name-value",ref:"sumAggregationComp"}]},b9=class extends A{constructor(){super(w9,[C9]),this.sumAggregationComp=x,this.countAggregationComp=x,this.minAggregationComp=x,this.maxAggregationComp=x,this.avgAggregationComp=x}postConstruct(){this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this),modelUpdated:this.onCellSelectionChanged.bind(this)})}init(e){this.refresh(e)}refresh(e){this.params=e;const t=e.valueFormatter??(i=>{const{value:r,bigintValue:o}=i;return o!=null?o.toString():v9(r,this.getLocaleTextFunc.bind(this))}),s=["avg","count","min","max","sum"];for(const i of s){const r=this.getAllowedAggregationValueComponent(i);r&&(r.key=i,r.valueFormatter=t.bind(this))}return this.onCellSelectionChanged(),!0}setAggregationComponentValue(e,t,s){const i=this.getAllowedAggregationValueComponent(e),r=Pa(this.beans.rowModel);D(i)&&i?(i.setValue(t,r),i.setDisplayed(s)):this.getAggregationValueComponent(e)?.setDisplayed(!1)}getAllowedAggregationValueComponent(e){const{aggFuncs:t}=this.params;return!t||t.includes(e)?this.getAggregationValueComponent(e):null}getAggregationValueComponent(e){const t=`${e}AggregationComp`;return this[t]}onCellSelectionChanged(){const e=this.beans,{rangeSvc:t,valueSvc:s}=e,i=t?.getCellRanges();let r=0,o=0n,n=!1,a=!1,l=0,c=0,d=null,u=null,h=null,g=null;const p=T=>{if(typeof T=="number")if(r+=T,(d===null||Tu)&&(u=T),!Number.isInteger(T)||!Number.isSafeInteger(T))a=!0;else{const I=BigInt(T);o+=I,(h===null||Ig)&&(g=I)}else{n=!0,o+=T,(h===null||Tg)&&(g=T);const I=Number(T);r+=I,(d===null||Iu)&&(u=I)}c++},f={};if(i?.length&&t)for(let T=0;T{if(k===null)return;const O=ai({rowPinned:k.rowPinned,column:U,rowIndex:k.rowIndex});if(f[O])return;f[O]=!0;const X=Ve(e,k);if(ne(X))return;let se=s.getValue(U,X,"data");if(!(ne(se)||se==="")&&(l++,!(typeof se=="object"&&"value"in se&&(se=se.value,se==="")))){if(typeof se=="string"){const we=se.trim();if(we==="")return;const pe=Number(we);if(!Number.isFinite(pe))return;r+pe>=Number.MAX_SAFE_INTEGER||r+pe<=Number.MIN_SAFE_INTEGER||pe>=Number.MAX_SAFE_INTEGER||pe<=Number.MIN_SAFE_INTEGER?(se=et(we),se===null&&(se=pe)):se=pe}(typeof se=="number"&&!isNaN(se)||typeof se=="bigint")&&p(se)}}),k=Je(e,k)}const m=l>1,C=c>1,v=n&&!a;let w;v?w=o/BigInt(c):w=r/c;const S=C?v?o:r:null,y=C?v?h:d:null,R=C?v?g:u:null,P=C?w:null,M=C;this.setAggregationComponentValue("count",l,m),this.setAggregationComponentValue("sum",S,C),this.setAggregationComponentValue("min",y,C),this.setAggregationComponentValue("max",R,C),this.setAggregationComponentValue("avg",P,M)}},S9=class extends Ea{postConstruct(){this.setLabel("filteredRows","Filtered"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);const e=this.onDataChanged.bind(this);this.addManagedEventListeners({modelUpdated:e})}onDataChanged(){const{rowModel:e}=this.beans,t=Pa(e),s=O0(e);this.setValue(s,t),this.setDisplayed(t!==s)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:t})=>ci(t,this.getLocaleTextFunc.bind(this)))}refresh(e){const{key:t,valueFormatter:s}=e;return this.key=t,this.updateValueFormatter(s),!0}},y9=class extends Ea{postConstruct(){this.setLabel("selectedRows","Selected"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-selected-row-count");const e=this.onRowSelectionChanged.bind(this);this.addManagedEventListeners({modelUpdated:e,selectionChanged:e})}onRowSelectionChanged(){const{selectionSvc:e,rowModel:t}=this.beans,s=e?.getSelectionCount()??0,i=Pa(t);if(this.setValue(s,i),s<0){this.setDisplayed(!0);return}this.setDisplayed(s>0)}init(e){this.refresh(e),this.onRowSelectionChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:t})=>t==null||t>=0?ci(t,this.getLocaleTextFunc.bind(this)):this.getLocaleTextFunc()("statusBarLastRowUnknown","?"))}refresh(e){const{key:t,valueFormatter:s}=e;return this.key=t,this.updateValueFormatter(s),!0}},x9=class extends Ea{postConstruct(){this.setLabel("totalAndFilteredRows","Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){const{rowModel:e}=this.beans,t=O0(e),s=Pa(e);this.setValue(t,s)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:t,totalRows:s})=>{const i=this.getLocaleTextFunc.bind(this),r=ci(t,i),o=ci(s??t,i);if(t===s)return r;const n=i();return`${r} ${n("of","of")} ${o}`})}refresh(e){const{key:t,valueFormatter:s}=e;return this.key=t,this.updateValueFormatter(s),!0}},R9=class extends Ea{postConstruct(){this.setLabel("totalRows","Total Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){const e=Pa(this.beans.rowModel);this.setValue(e,e)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:t})=>ci(t,this.getLocaleTextFunc.bind(this)))}refresh(e){const{key:t,valueFormatter:s}=e;return this.key=t,this.updateValueFormatter(s),!0}};function F9(e,t){const s=e.statusBarSvc?.getStatusPanel(t);return Us(s)}var E9=class extends E{constructor(){super(),this.beanName="statusBarSvc",this.comps=new Map}registerStatusPanel(e,t){this.comps.set(e,t)}unregisterStatusPanel(e){this.comps.delete(e)}unregisterAllComponents(){this.comps.clear()}getStatusPanel(e){return this.comps.get(e)}destroy(){this.unregisterAllComponents(),super.destroy()}},V0={moduleName:"StatusBar",version:Y,beans:[E9],userComponents:{agAggregationComponent:b9,agTotalRowCountComponent:R9,agFilteredRowCountComponent:S9,agTotalAndFilteredRowCountComponent:x9,agSelectedRowCountComponent:y9},selectors:[g9],apiFunctions:{getStatusPanel:F9},dependsOn:[le,ta]};function B0(e){return e.excelCreator?.getFactoryMode()==="MULTI_SHEET"?(F(161),!1):!0}function P9(e,t){if(B0(e))return e.excelCreator?.getDataAsExcel(t)}function M9(e,t){B0(e)&&e.excelCreator?.exportDataAsExcel(t)}function T9(e,t){return e.excelCreator?.setFactoryMode("MULTI_SHEET"),e.excelCreator?.getSheetDataForExcel(t)}function D9(e,t){return e.excelCreator?.getMultipleSheetsAsExcel(t)}function A9(e,t){e.excelCreator?.exportMultipleSheetsAsExcel(t)}var N0={moduleName:"ExcelExport",version:Y,beans:[QN],apiFunctions:{getDataAsExcel:P9,exportDataAsExcel:M9,getSheetDataForExcel:T9,getMultipleSheetsAsExcel:D9,exportMultipleSheetsAsExcel:A9},dependsOn:[cg,le]};function id(e){const{filters:t}=e;return t&&t.length>0?t:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}function rd(e,t){if(e!=null)for(let s=e.length-1;s>=0;s--)t(e[s],s)}function I9(e,t){return t.title!=null?t.title:e instanceof An?e.getFilterTitle():"Filter"}function od(e,t,s,i){const r=[],o=e?.filterModels;for(let n=0;nn==null)?null:{filterType:"multi",filterModels:r}}function hi(e,t){return e?.filterModels?.[t]??null}function nd(e,t,s,i){const r=s.filterValueGetter;return r?e.colFilter.createGetValue(t,r):i}var H0=class extends Pr{constructor(){super({tag:"div",cls:"ag-multi-filter ag-menu-list-compact"}),this.filterDefs=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.lastActivatedMenuItem=null}postConstruct(){this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e)})}refreshGui(e){return e===this.lastOpenedInContainer?$.resolve():(this.tabGuardFeature.removeAllChildrenExceptTabGuards(),this.destroyChildren(),$.all(this.getFilterWrappers().map((t,s)=>{if(!t)return $.resolve(null);const i=this.getFilterFromWrapper(t),r=this.getCompFromWrapper(t),o=this.filterDefs[s],n=I9(i,o);let a;if(o.display==="subMenu"&&e!=="toolPanel")a=this.insertFilterMenu(r,i,n).then(l=>l.getGui());else if(o.display==="subMenu"||o.display==="accordion"){const l=this.insertFilterGroup(i,r,n);a=$.resolve(l.getGui())}else a=$.resolve(r.getGui());return a})).then(t=>{t.forEach((s,i)=>{s&&(i>0&&this.appendChild(re({tag:"div",cls:"ag-filter-separator"})),this.appendChild(s))}),this.filterGuis=t,this.lastOpenedInContainer=e}))}destroyChildren(){for(const e of this.guiDestroyFuncs)e();this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(e,t,s){const i=e.getGui();Ie(i,"dialog");const r=this.createBean(new YH),o={getGui:()=>e.getGui(),afterGuiAttached:n=>{e.afterGuiAttached?.(n),e!==t&&t.afterGuiAttached?.(n)}};return r.init({menuItemDef:{name:s,subMenu:[],subMenuRole:"dialog",cssClasses:["ag-multi-filter-menu-item"],menuItem:Qy,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:o,contextParams:{column:null,node:null,value:null}}).then(()=>{r.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(r)),this.addManagedListeners(r,{menuItemActivated:a=>{this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==a.menuItem&&this.lastActivatedMenuItem.deactivate(),this.lastActivatedMenuItem=a.menuItem}});const n=r.getGui();return r.addManagedElementListeners(n,{keydown:a=>{const{key:l}=a;switch(l){case b.UP:case b.RIGHT:case b.DOWN:case b.LEFT:a.preventDefault(),l===b.RIGHT&&r.openSubMenu(!0);break}},focusin:()=>r.activate(),focusout:()=>{!r.isSubMenuOpen()&&!r.isSubMenuOpening()&&r.deactivate()}}),r})}insertFilterGroup(e,t,s){const i=this.createBean(new qs({title:s,cssIdentifier:"multi-filter"}));return this.guiDestroyFuncs.push(()=>this.destroyBean(i)),i.addItem(t.getGui()),i.toggleGroupExpand(!1),e.afterGuiAttached&&i.addManagedListeners(i,{expanded:()=>e.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})}),i}afterGuiAttached(e){let t;e?(this.hidePopup=e.hidePopup,t=this.refreshGui(e.container)):(this.hidePopup=void 0,t=$.resolve());const s=e?.suppressFocus;t.then(()=>{const{filterDefs:i,filterGuis:r,beans:o}=this,n=this.getFilterWrappers();let a=!!s;i&&rd(i,(c,d)=>{const u=d===0,h=c.display&&c.display!=="inline",g=s||!u||h,p={...e??{},suppressFocus:g},f=n[d],m=f?this.getFilterFromWrapper(f):void 0;if(f){const C=this.getCompFromWrapper(f);C!==m&&C.afterGuiAttached(p)}if(m&&(this.executeFunctionIfExistsOnFilter(m,"afterGuiAttached",p),u&&!g&&(a=!0)),!s&&u&&h){const C=r[d];C&&(Ge(C)||C.focus({preventScroll:!0}),a=!0)}});const l=ie(o);!a&&(ms(o)||this.getGui().contains(l))&&this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists("afterGuiDetached")}onAnyFilterChanged(){this.executeFunctionIfExists("onAnyFilterChanged",e=>this.executeOnWrapper(e,"onAnyFilterChanged"))}onNewRowsLoaded(){this.executeFunctionIfExists("onNewRowsLoaded",e=>this.executeOnWrapper(e,"onNewRowsLoaded"))}destroy(){this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeOnWrapper(e,t){}executeFunctionIfExists(e,t){rd(this.getFilterWrappers(),s=>{s&&(t?.(s),this.executeFunctionIfExistsOnFilter(this.getFilterFromWrapper(s),e))})}executeFunctionIfExistsOnFilter(e,t,...s){const i=e[t];typeof i=="function"&&i.apply(e,s)}onFocusIn(e){const t=this.lastActivatedMenuItem;t!=null&&!t.getGui().contains(e.target)&&(t.deactivate(),this.lastActivatedMenuItem=null)}},z0=class extends H0{constructor(){super(...arguments),this.filterType="multi",this.wrappers=[],this.activeFilterIndices=[],this.afterFiltersReadyFuncs=[]}init(e){this.params=e,this.filterDefs=id(e);const t=We(this.beans.colFilter.model,e.column.getColId()),{filterChangedCallback:s}=e;this.filterChangedCallback=s;const i=this.filterDefs.map((r,o)=>this.createFilter(r,o,t));return new $(r=>{$.all(i).then(o=>{this.wrappers=o,this.refreshGui("columnMenu").then(()=>{r()})})}).then(()=>{for(const r of this.afterFiltersReadyFuncs)r();this.afterFiltersReadyFuncs.length=0})}refresh(e){return this.params=e,!0}isFilterActive(){return this.wrappers.some(e=>{if(!e)return!1;const{filter:t,handler:s,model:i}=e;return s?i!=null:t.isFilterActive()})}getLastActiveFilterIndex(){const e=this.activeFilterIndices;return e.length>0?e[e.length-1]:null}doesFilterPass(e,t){return this.wrappers.every((s,i)=>{if(!s||t!=null&&i===t)return!0;const{handler:r,filter:o,model:n}=s;return r?n==null||r.doesFilterPass({...e,model:n,handlerParams:s.handlerParams}):!o.isFilterActive()||o.doesFilterPass(e)})}getModelFromUi(){return{filterType:this.filterType,filterModels:this.wrappers.map(t=>{if(!t)return null;const s=t.filter;return typeof s.getModelFromUi=="function"?s.getModelFromUi():null})}}getModel(){return this.isFilterActive()?{filterType:this.filterType,filterModels:this.wrappers.map(t=>{if(!t)return null;const{filter:s,handler:i,model:r}=t;return i?r:s.isFilterActive()?s.getModel():null})}:null}setModel(e){const t=(i,r)=>new $(o=>{const n=i.setModel(r);n?n.then(o):o()}),s=[];return this.wrappers.forEach((i,r)=>{if(!i)return;const o=hi(e,r),{filter:n,filterParams:a,handler:l,handlerParams:c,state:d}=i;if(l){const u={model:o,state:d?.state};i.state=u,i.model=o,s.push(bc(()=>$.resolve({filter:n,filterParams:a}),l,c,o,u,"api").then(()=>{this.updateActiveListForHandler(r,i.model)}))}else s.push(t(n,o).then(()=>{this.updateActiveListForFilter(r,n)}))}),$.all(s).then(()=>{})}applyModel(e="api"){let t=!1;for(const s of this.wrappers)if(s){const i=s.filter;i instanceof An&&(t=i.applyModel(e)||t)}return t}getChildFilterInstance(e){return this.wrappers[e]?.filter}getNumChildFilters(){return this.wrappers.length}destroy(){for(const e of this.wrappers)this.destroyBean(e?.filter),this.destroyBean(e?.handler);this.wrappers.length=0,super.destroy()}getFilterWrappers(){return this.wrappers}getFilterFromWrapper(e){return e.filter}getCompFromWrapper(e){return e.comp}executeOnWrapper(e,t){e.handler?.[t]?.()}createFilter(e,t,s){const i=this.params.column;let r=null,o;const n=this.beans,a=(g,p)=>{const f=this.wrappers[t];if(!f)return;const m={model:g,state:f.state?.state};f.state=m,f.model=g,bc(()=>$.resolve({filter:f.filter,filterParams:f.filterParams}),f.handler,f.handlerParams,g,m,"ui").then(()=>{this.onHandlerModelChanged(t,f.model,p)})},{compDetails:l,handler:c,handlerParams:d,createFilterUi:u}=n.colFilter.createFilterInstance(i,e,"agTextColumnFilter",(g,p)=>{const f={...g,filterChangedCallback:p?()=>{}:m=>{this.executeWhenAllFiltersReady(()=>this.onFilterModelChanged(t,m))},doesRowPassOtherFilter:m=>g.doesRowPassOtherFilter(m)&&this.doesFilterPass({node:m,data:m.data},t),getValue:nd(n,i,e,g.getValue)};return p&&(r=hi(s,t),o=this.updateDisplayParams(f,t,r,()=>l,()=>c,a)),f});if(!u)return $.resolve(null);let h;if(c){const{doesRowPassOtherFilter:g,getValue:p}=d;h={...d,onModelChange:a,doesRowPassOtherFilter:f=>g(f)&&this.doesFilterPass({node:f,data:f.data},t),getValue:nd(n,i,e,p)},c.init?.({...h,model:r,source:"init"})}return u().then(g=>{if(!c)return{filter:g,comp:g};const p=l?.params,f=o(g);return{filter:g,comp:f,filterParams:p,handler:c,handlerParams:h,model:r}})}updateDisplayParams(e,t,s,i,r,o){const n=this.params.column,a=new As;e.model=s,e.state={model:s},e.onModelChange=o,e.getHandler=r;const l=(d,u)=>{d.state=u,a.dispatchEvent({type:"filterStateChanged",column:n,state:u})};e.onStateChange=d=>{const u=this.wrappers[t];u&&(l(u,d),ca(u.filter,u.filterParams,u.model??null,d,"ui"))};const c=(d,u,h)=>{const g=this.wrappers[t];if(!g)return;const p=()=>g?.model??null;Sc({action:u,filterParams:g.filterParams,getFilterUi:()=>{const f=$.resolve(g.filter);return{created:!0,filterParams:g.filterParams,compDetails:i(),create:()=>f,promise:f}},getModel:p,getState:()=>g?.state??{model:p()},updateState:f=>l(g,f),updateModel:f=>g.filterParams?.onModelChange(f,h),processModelToApply:g.handler?.processModelToApply?.bind(g.handler)})};return e.onAction=(d,u,h)=>{c(n,d,u),a.dispatchEvent({type:"filterAction",column:n,action:d,event:h})},d=>{const u=i()?.params;return this.createManagedBean(new xg(n,{comp:d,params:u,isHandler:!0},a,c,!1))}}executeWhenAllFiltersReady(e){(this.wrappers?.length??0)>0?e():this.afterFiltersReadyFuncs.push(e)}updateActiveListForFilter(e,t){this.updateActiveList(e,()=>t?.isFilterActive())}updateActiveListForHandler(e,t){this.updateActiveList(e,()=>t!=null)}updateActiveList(e,t){const s=this.activeFilterIndices;De(this.activeFilterIndices,e),t()&&s.push(e)}onFilterModelChanged(e,t){this.updateActiveListForFilter(e,this.wrappers[e]?.filter),this.filterChanged(e,t)}onHandlerModelChanged(e,t,s){this.updateActiveListForHandler(e,t),this.filterChanged(e,s)}filterChanged(e,t){this.filterChangedCallback(t),this.wrappers.forEach((s,i)=>{if(e===i||!s)return;const{filter:r,handler:o}=s;o?.onAnyFilterChanged?.(),typeof r.onAnyFilterChanged=="function"&&r.onAnyFilterChanged()})}getModelAsString(e){if(!e?.filterModels?.length)return"";const t=this.getLastActiveFilterIndex()??0;return this.wrappers[t]?.filter?.getModelAsString?.(e.filterModels[t])??""}},k9=class extends E{constructor(){super(...arguments),this.filterType="multi",this.handlerWrappers=[],this.activeFilterIndices=[],this.filterDefs=[]}init(e){this.params=e;const t=id(e.filterParams);this.filterDefs=t,t.forEach((s,i)=>{const r=this.beans.colFilter.createHandler(e.column,s,"agTextColumnFilter");if(this.handlerWrappers.push(r),!r){F(278,{colId:e.column.getColId()});return}const{handler:o,handlerParams:n}=r;o.init?.({...this.updateHandlerParams(n,i,!0),model:hi(e.model,i),source:"init"})}),this.resetActiveList(e.model)}refresh(e){this.params=e;const{model:t,source:s,filterParams:i}=e,r=i?.filters;this.handlerWrappers.forEach((o,n)=>{if(o){const a=this.updateHandlerParams(e,n,!1,r?.[n].filterParams);o.handlerParams=a,o.handler.refresh?.({...a,model:hi(t,n),source:s})}}),e.source!=="floating"&&e.source!=="ui"&&this.resetActiveList(e.model),e.additionalEventAttributes?.fromButtons&&this.onAnyFilterChanged()}updateHandlerParams(e,t,s,i){const{onModelChange:r,doesRowPassOtherFilter:o,getValue:n}=e,a={...e,onModelChange:(l,c)=>r(od(this.params.model,this.handlerWrappers.length,l,t),c),doesRowPassOtherFilter:l=>o(l)&&this.doesFilterPass({node:l,data:l.data,model:this.params.model,handlerParams:a},t),getValue:nd(this.beans,e.column,this.filterDefs[t],n),filterParams:this.updateFilterParams(e,s,i)};return a}updateFilterParams(e,t,s){const i=e.filterParams;s?.buttons&&t&&F(292,{colId:e.column.getColId()});const r=s?{...i,...s}:i;if(!r.buttons)return r;if(s)return delete r.buttons,r;const{buttons:o,...n}=r;return n}doesFilterPass(e,t){const s=e.model?.filterModels;return s==null?!0:this.handlerWrappers.every((i,r)=>{const o=s[r];if(o==null||t!=null&&r===t)return!0;const n=i?.handler;return!n||n.doesFilterPass({...e,model:o,handlerParams:i.handlerParams})})}resetActiveList(e){this.activeFilterIndices=[];const t=e?.filterModels;if(t!=null)for(let s=0;s0?e[e.length-1]:null}getModelAsString(e,t){const s=t==="filterToolPanel",i=()=>s?this.getLocaleTextFunc()("filterSummaryInactive","is (All)"):"";if(!e?.filterModels?.length)return i();const r=this.getLastActiveFilterIndex()??0;return this.handlerWrappers[r]?.handler.getModelAsString?.(e.filterModels[r],t)??i()}getHandler(e){return this.handlerWrappers[e]?.handler}onAnyFilterChanged(){rd(this.handlerWrappers,e=>e?.handler?.onAnyFilterChanged?.())}onNewRowsLoaded(){rd(this.handlerWrappers,e=>e?.handler?.onNewRowsLoaded?.())}destroy(){for(const e of this.handlerWrappers)this.destroyBean(e?.handler);this.handlerWrappers.length=0,super.destroy()}},L9=class extends E{constructor(){super(...arguments),this.beanName="multiFilter"}getParamsForDataType(e,t,s,i){let r=e?.filters;const o=this.beans;r||(r=[{filter:xc(s.baseDataType)},{filter:"agSetColumnFilter"}]);const n=this.getLocaleTextFunc();return r=r.map(a=>{const{filter:l,filterParams:c,filterValueGetter:d}=a;if(typeof l!="string")return a;const{filterParams:u,filterValueGetter:h}=yc(l,c,d??t,s,i,o,n);return{...a,filterParams:u,filterValueGetter:h}}),{filterParams:{...e,filters:r}}}},_0=class extends H0{constructor(){super(...arguments),this.filterType="multi",this.filters=[],this.filterParams=[],this.validity=[]}init(e){this.params=e;const t=id(e).map(i=>{if(i.filterParams?.buttons){F(292,{colId:e.column.getColId()});const r={...i.filterParams};return delete r.buttons,{...i,filterParams:r}}return i});this.filterDefs=t,this.allState=e.state;const s=this.filterDefs.map((i,r)=>this.createFilter(i,r));return new $(i=>{$.all(s).then(r=>{this.filters=r,this.refreshGui("columnMenu").then(()=>{i()})})})}refresh(e){const{model:t,state:s,source:i}=e;if(i==="colDef")return!1;this.params=e;const r=this.filterParams;if(s===this.allState)return!0;this.allState=s;const o=s.state;return this.filters.forEach((n,a)=>{const l=hi(t,a),c={state:o?.[a],model:hi(s.model,a)};ca(n,r[a],l,c,i)}),!0}getLastActiveFilterIndex(){return this.getHandler().getLastActiveFilterIndex?.()??null}getChildFilterInstance(e){return this.filters[e]??void 0}getNumChildFilters(){return this.filters.length}destroy(){for(const e of this.filters)this.destroyBean(e);this.filters.length=0,super.destroy()}getFilterWrappers(){return this.filters}getFilterFromWrapper(e){return e}getCompFromWrapper(e){return e}createFilter(e,t){const s=this.beans.userCompFactory,i=this.updateParams(e,this.params,t),r=fu(s,e,i,"agTextColumnFilter");return r?(this.filterParams[t]=r.params,r.newAgStackInstance()):$.resolve(null)}updateParams(e,t,s){const{doesRowPassOtherFilter:i,model:r,onModelChange:o,state:n,onStateChange:a,column:l,source:c,onAction:d,onUiChange:u,getValue:h}=t,g=hi(r,s),p=n?{model:hi(n.model,s),state:n.state?.[s]}:{model:g},f=()=>{const C=this.getHandler();this.filters.forEach((v,w)=>{s!==w&&(C.getHandler(w)?.onAnyFilterChanged?.(),v?.onAnyFilterChanged?.())})},m=this.beans.colFilter;return{...m.createBaseFilterParams(l),...e,doesRowPassOtherFilter:C=>i(C)&&this.getHandler().doesFilterPass({node:C,data:C.data,model:this.params.model,handlerParams:m.getHandlerParams(l)},s),model:g,state:p,onModelChange:(C,v)=>{const{filters:w,params:S}=this,y=od(S.model,w.length,C,s);this.updateActiveList(s,C),o(y,v),f()},onStateChange:C=>this.onStateChange(a,s,C),getHandler:()=>this.getHandler().getHandler(s),onAction:(C,v,w)=>{if(lo(t))return;const S=C==="apply"||C==="reset";S&&this.updateActiveList(s,hi(this.params.state.model,s)),d(C,v,w),S&&f()},onUiChange:u,source:c,getValue:nd(this.beans,l,e,h)}}updateActiveList(e,t){this.getHandler().updateActiveList?.(e,t)}getHandler(){return this.params.getHandler()}onStateChange(e,t,s){const{model:i,state:r,valid:o}=s,n=this.validity;n[t]=o;const a=this.allState,l=od(a.model,this.filters.length,i,t),c=n.every(h=>h!==!1),d=[...a.state??[]];d[t]=r;const u={state:d,model:l,valid:c};this.allState=u,e(u)}getModelAsString(e){return this.getHandler().getModelAsString?.(e)??""}},G9={tag:"div",cls:"ag-multi-floating-filter ag-floating-filter-input"},O9=class extends A{constructor(){super(G9),this.floatingFilters=[],this.compDetailsList=[]}init(e){this.params=e;const{compDetailsList:t}=this.getCompDetailsList(e);return this.setParams(t)}setParams(e){const t=[];return e.forEach(s=>{const i=s?.newAgStackInstance();i!=null&&(this.compDetailsList.push(s),t.push(i))}),$.all(t).then(s=>{s.forEach((i,r)=>{this.floatingFilters.push(i);const o=i.getGui();this.appendChild(o),r>0&&V(o,!1)})})}refresh(e){this.params=e;const{compDetailsList:t,floatingFilterParamsList:s}=this.getCompDetailsList(e);if(t.length===this.compDetailsList.length&&t.every((r,o)=>!this.beans.colFilter?.areFilterCompsDifferent(this.compDetailsList[o],r))){if(s.forEach((r,o)=>{this.floatingFilters[o].refresh?.(r)}),this.gos.get("enableFilterHandlers")){const r=e;if(r.model==null)this.floatingFilters.forEach((o,n)=>{V(o.getGui(),n===0)});else{const o=r.getHandler()?.getLastActiveFilterIndex?.();this.floatingFilters.forEach((n,a)=>{const l=o==null?a===0:a===o;V(n.getGui(),l)})}}}else ee(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(t)}getCompDetailsList(e){const t=[],s=[],i=e.filterParams,r=e.currentParentModel,o=id(i);return o.forEach((n,a)=>{const l={...e,parentFilterInstance:d=>{this.parentMultiFilterInstance(u=>{const h=u.getChildFilterInstance(a);h!=null&&d(h)})},currentParentModel:()=>r()?.filterModels?.[a]??null};if(this.gos.get("enableFilterHandlers")){const d=l;d.model=d.model?.filterModels?.[a]??null;const{onModelChange:u,getHandler:h}=d;d.onModelChange=(g,p)=>u(od(this.params.model,o.length,g,a),p),d.getHandler=()=>h().getHandler(a)}Oe(l.filterParams,n.filterParams);const c=this.getCompDetails(n,l);c&&(t.push(c),s.push(l))}),{compDetailsList:t,floatingFilterParamsList:s}}onParentModelChanged(e,t){t?.afterFloatingFilter||this.parentMultiFilterInstance(s=>{if(e==null)this.floatingFilters.forEach((i,r)=>{i.onParentModelChanged(null,t),V(i.getGui(),r===0)});else{const i=s.getLastActiveFilterIndex();this.floatingFilters.forEach((r,o)=>{const n=e.filterModels.length>o?e.filterModels[o]:null;r.onParentModelChanged(n,t);const a=i==null?o===0:o===i;V(r.getGui(),a)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(e,t){const{colFilter:s,frameworkOverrides:i,userCompFactory:r}=this.beans,o=yg(i,e,()=>s.getDefaultFloatingFilter(this.params.column))??"agReadOnlyFloatingFilter";return mu(r,e,t,o)}parentMultiFilterInstance(e){this.params.parentFilterInstance(t=>{t instanceof z0||t instanceof _0||Q(120),e(t)})}},W0={moduleName:"MultiFilter",version:Y,userComponents:{agMultiColumnFilter:{getComp:e=>e.gos.get("enableFilterHandlers")?{classImp:_0,params:{useForm:!0}}:z0},agMultiColumnFloatingFilter:O9},beans:[L9],dynamicBeans:{agMultiColumnFilterHandler:k9},dependsOn:[le,Ps,ed]},V9=class extends E{constructor(){super(...arguments),this.beanName="aggColNameSvc"}getHeaderName(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const{valueColsSvc:s,colModel:i,rowGroupColsSvc:r}=this.beans,o=e.getColDef().pivotValueColumn,n=D(o);let a=null,l;if(n){const c=s?.columns??[],d=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&c.length===1,u=e.getColDef().pivotTotalColumnIds!==void 0;if(d&&!u)return t;a=o?o.getAggFunc():null,l=!0}else{const c=e.isValueActive(),d=r?.columns.length!==0,u=i.isPivotMode()||d||this.gos.get("treeData");c&&u?(a=e.getAggFunc(),l=!0):l=!1}if(l){const c=typeof a=="string"?a:"func";return`${this.getLocaleTextFunc()(c,c)}(${t})`}return t}},B9={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},N9=class extends E{constructor(){super(...arguments),this.beanName="aggFuncSvc",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){const e=this.aggFuncsMap;e.sum=H9,e.first=z9,e.last=_9,e.min=W9,e.max=U9,e.count=K9,e.avg=q9,this.initialised=!0}isAggFuncPossible(e,t){const i=this.getFuncNames(e).includes(t),r=D(this.aggFuncsMap[t]);return i&&r}getDefaultFuncLabel(e){return B9[e]??e}getDefaultAggFunc(e){const t=e.getColDef().defaultAggFunc;if(D(t)&&this.isAggFuncPossible(e,t))return t;if(this.isAggFuncPossible(e,"sum"))return"sum";const s=this.getFuncNames(e);return s?.length?s[0]:null}addAggFuncs(e){if(this.init(),!!e)for(const t of Object.keys(e))e[t]&&(this.aggFuncsMap[t]=e[t])}getAggFunc(e){return this.init(),this.aggFuncsMap[e]}getFuncNames(e){const t=e.getColDef().allowedAggFuncs;return t??Object.keys(this.aggFuncsMap).sort()}clear(){this.aggFuncsMap={}}};function H9(e){const{values:t}=e;let s=null;for(let i=0;i0?e.values[0]:null}function _9(e){return e.values.length>0?W(e.values):null}function W9(e){const{values:t}=e;let s=null;for(let i=0;ir)&&(s=r)}return s}function U9(e){const{values:t}=e;let s=null;for(let i=0;i0&&(r=s/(typeof s=="number"?i:BigInt(i)));const o=e.rowNode?.aggData?.[e.column?.getColId()];if(o&&o.count===i&&o.value===r)return o;const n=Object.create(j9);return n.count=i,n.value=r,n}var Y9=class extends E{constructor(){super(...arguments),this.beanName="aggChildrenSvc"}getAggregatedChildren(e,t,s){if(!e?.group)return[];if(e.rowPinned&&(e=e.pinnedSibling,!e))return[];const i=this.gos,r=U0(e,t,i);if(!s)return r;const o=[];return $0(r,t,i,o),o}},U0=(e,t,s)=>{const i=t?.colDef,r=i?.pivotKeys;return r?e.leafGroup&&r.length&&!i.pivotTotalColumnIds?c0(e.childrenMapped,r):e.childrenAfterFilter??e.childrenAfterGroup??[]:xi(s)||s.get("suppressAggFilteredOnly")?e.childrenAfterGroup??[]:e.childrenAfterFilter??e.childrenAfterGroup??[]},$0=(e,t,s,i)=>{for(let r=0,o=e.length;r{d0(R,null,S)})}return}this.hadAgg=!0;const o=s.colModel,n=s.aggFuncSvc,a=t.get("alwaysAggregateAtRootLevel")||!!Ri(t)||o.isPivotMode(),l=!xi(t)&&!t.get("suppressAggFilteredOnly"),c=s.valueSvc,d=s.gridApi,u=s.gridOptions.context,h=r??[],g=h.length,p=e?.kind==="cells"?e:void 0;let f;const m=new Array(g);for(let S=0;S=0&&(f=p),m[S]={column:y,colId:y.colId,colDef:y.colDef,aggFunc:K0(y.getAggFunc(),n,y),colSlot:R}}const C=s_(o,s.pivotResultCols,n),v=g>0?new Array(g):null,w=s.rowModel;Mt(w.rootNode,w.hierarchical,e,S=>{if(S.level===-1&&!a){Ho(S,null,o);return}let y;i?y=i({nodes:S.childrenAfterFilter}):v?C?y=t_(S,C,c,d,u):y=e_(S,m,g,v,f,l,c,d,u):y=null,d0(S,y,o)})}},e_=(e,t,s,i,r,o,n,a,l)=>{const c=(o?e.childrenAfterFilter:e.childrenAfterGroup)??[],d=c.length,u=e.data,h=Object.create(null),g=r?r.getSlot(e):-1,p=g>=0?e.aggData:void 0;let f=0;for(let m=0;m=0&&!r.hasCellBySlot(g,C.colSlot)?(i[m]=null,p&&(h[C.colId]=p[C.colId])):(i[m]=new Array(d),++f)}if(f===0)return h;for(let m=0;m{const o=t.length,n=e.leafGroup,a=e.data,l=e.childrenMapped,c=e.childrenAfterFilter??[],d=Object.create(null);let u,h;for(let g=0;g{if(typeof e=="function")return e;if(e==null)return null;const i=t.getAggFunc(e);return typeof i!="function"?(F(109,{inputValue:e.toString(),allSuggestions:t.getFuncNames(s)}),null):i},s_=(e,t,s)=>{if(!e.isPivotActive())return null;const i=t?.getAggregationOrderedList();if(!i||i.length===0)return null;const r=i.length,o=new Array(r);let n=0;for(let a=0;a{const t=e.childrenAfterAggFilter;let s=0;if(t){const r=t.length;s=r;for(let o=0;o=0?null:s;e.setAllChildrenCount(i),e.pinnedSibling?.setAllChildrenCount(i)},this.setAllChildrenCountGridGrouping=e=>{const t=e.childrenAfterAggFilter;let s=0;for(let i=0,r=t.length;i!p.node.group,c=p=>p.node.leafGroup,d=xi(this.gos)||(o?c:l),u=a?this.setAllChildrenCountTreeData:this.setAllChildrenCountGridGrouping,h=(p,f=!1)=>{if(p.childrenAfterFilter){if(p.childrenAfterAggFilter=p.childrenAfterFilter,f){const m=p.childrenAfterAggFilter;for(let C=0,v=m.length;C{p.childrenAfterAggFilter=p.childrenAfterFilter?.filter(f=>d({node:f})&&r.doesRowPassAggregateFilters({rowNode:f})?(h(f,!0),!0):f.childrenAfterAggFilter?.length)||null,p.hasChildren()?u(p):(p.setAllChildrenCount(null),p.pinnedSibling?.setAllChildrenCount(null)),p.sibling&&(p.sibling.childrenAfterAggFilter=p.childrenAfterAggFilter)};Mt(t.rootNode,t.hierarchical,e,n?g:h)}};function gi(e,t){if(e.sibling)return;const s=Gu(e,t);s.footer=!0,s.setRowTop(null),s.setRowIndex(null),s.oldRowTop=null,s.id="rowGroupFooter_"+e.id,s.sibling=e,e.sibling=s}function Wp(e){const t=e.sibling;t&&(t._destroy(!1),e.sibling=void 0,t.sibling=void 0)}var r_=class extends E{constructor(){super(...arguments),this.beanName="footerSvc"}addTotalRows(e,t,s,i,r,o){let n=e;if(r){const c=i&&Ri(this.gos);return o_(o,c)&&(gi(t,this.beans),s(t.sibling,n++)),n}const a=vr(this.gos);return(i&&a({node:t}))===o&&(gi(t,this.beans),s(t.sibling,n++)),n}getTopDisplayIndex(e,t,s,i){let r=t;if(e[0].footer){if(t===0)return 0;r-=1}const o=e[e.length-1],n=r>=s.length;return o.footer&&n?o.rowIndex:i(r)}doesCellShowTotalPrefix(e,t){return!e.footer||!t?.getColDef().showRowGroup?!1:this.gos.get("treeData")?!0:e.level===-1?this.beans.showRowGroupCols?.columns[0]===t:!!e.rowGroupColumn&&t?.isRowGroupDisplayed(e.rowGroupColumn.getId())}applyTotalPrefix(e,t,s,i){const r=i.getColDef().cellRendererParams?.totalValueGetter;if(r){const o=N(this.gos,{column:i,node:s,value:e,formattedValue:t});if(typeof r==="function")return r(o);if(typeof r=="string")return this.beans.expressionSvc?.evaluate(r,o);F(179)}return s.level===-1?this.getLocaleTextFunc()("footerTotal","Total")+" ":this.getTotalValue(t??e)??""}getTotalValue(e){return this.getLocaleTextFunc()("footerTotal","Total")+" "+(e??"")}};function o_(e,t){switch(t){case"top":case"pinnedTop":return e==="top";case"bottom":case"pinnedBottom":return e==="bottom";default:return!1}}var j0=class extends Lc{constructor(){super(...arguments),this.beanName="valueColsSvc",this.eventName="columnValueChanged",this.columnProcessors={set:(e,t,s)=>this.setValueActive(t,e,s),add:(e,t,s)=>this.setValueActive(!0,e,s),remove:(e,t,s)=>this.setValueActive(!1,e,s)},this.columnExtractors={setFlagFunc:(e,t,s)=>this.setColValueActive(e,t,s),getIndexFunc:()=>{},getInitialIndexFunc:()=>{},getValueFunc:e=>{const t=e.aggFunc;if(t===null||t==="")return null;if(t!==void 0)return!!t},getInitialValueFunc:e=>e.initialAggFunc!=null&&e.initialAggFunc!=""},this.modifyColumnsNoEventsCallbacks={addCol:e=>this.columns.push(e),removeCol:e=>De(this.columns,e)}}extractCols(e,t){this.columns=super.extractCols(e,t);for(const s of this.columns){const i=s.getColDef();i.aggFunc!=null&&i.aggFunc!=""?this.setColAggFunc(s,i.aggFunc):s.getAggFunc()||this.setColAggFunc(s,i.initialAggFunc)}return this.columns}setColumnAggFunc(e,t,s){if(!e)return;const i=this.colModel.getColDefCol(e);i&&(this.setColAggFunc(i,t),this.dispatchColumnChangedEvent(this.eventSvc,this.eventName,[i],s))}syncColumnWithState(e,t,s){const i=s("aggFunc").value1;i!==void 0&&(typeof i=="string"?(this.setColAggFunc(e,i),e.isValueActive()||(this.setColValueActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e))):(D(i)&&F(33),e.isValueActive()&&(this.setColValueActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e))))}setValueActive(e,t,s){if(e!==t.isValueActive()&&(this.setColValueActive(t,e,s),e&&!t.getAggFunc()&&this.aggFuncSvc)){const i=this.aggFuncSvc.getDefaultAggFunc(t);this.setColAggFunc(t,i)}}setColAggFunc(e,t){e.aggFunc=t,e.dispatchStateUpdatedEvent("aggFunc")}setColValueActive(e,t,s){e.aggregationActive!==t&&(e.aggregationActive=t,e.dispatchColEvent("columnValueChanged",s))}},Up={moduleName:"SharedAggregation",version:Y,beans:[N9,V9,r_,j0],apiFunctions:{addAggFuncs:X9,clearAggFuncs:Z9,setColumnAggFunc:Q9},dependsOn:[le]},$p={moduleName:"Aggregation",version:Y,beans:[J9,i_,Y9],rowModels:["clientSide"],dependsOn:[Up]},q0=class extends Lc{constructor(){super(...arguments),this.beanName="pivotColsSvc",this.eventName="columnPivotChanged",this.columnProcessors={set:(e,t,s)=>this.setColPivotActive(e,t,s),add:(e,t,s)=>this.setColPivotActive(e,!0,s),remove:(e,t,s)=>this.setColPivotActive(e,!1,s)},this.columnOrdering={enableProp:"pivot",initialEnableProp:"initialPivot",indexProp:"pivotIndex",initialIndexProp:"initialPivotIndex"},this.columnExtractors={setFlagFunc:(e,t,s)=>this.setColPivotActive(e,t,s),getIndexFunc:e=>e.pivotIndex,getInitialIndexFunc:e=>e.initialPivotIndex,getValueFunc:e=>e.pivot,getInitialValueFunc:e=>e.initialPivot},this.modifyColumnsNoEventsCallbacks={addCol:e=>{this.columns.includes(e)||this.columns.push(e)},removeCol:e=>De(this.columns,e)}}syncColumnWithState(e,t,s,i){const{value1:r,value2:o}=s("pivot","pivotIndex");(r!==void 0||o!==void 0)&&(typeof o=="number"||r?(e.isPivotActive()||(this.setColPivotActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)),i&&typeof o=="number"&&(i[e.getId()]=o)):e.isPivotActive()&&(this.setColPivotActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)))}setColPivotActive(e,t,s){e.pivotActive!==t&&(e.pivotActive=t,t&&this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,e)?.forEach(r=>this.setColPivotActive(r,t,s)),e.dispatchColEvent("columnPivotChanged",s)),e.dispatchStateUpdatedEvent("pivot")}},n_=class extends Lc{constructor(){super(...arguments),this.beanName="rowGroupColsSvc",this.eventName="columnRowGroupChanged",this.columnProcessors={set:(e,t,s)=>this.setActive(t,e,s),add:(e,t,s)=>this.setActive(!0,e,s),remove:(e,t,s)=>this.setActive(!1,e,s)},this.columnOrdering={enableProp:"rowGroup",initialEnableProp:"initialRowGroup",indexProp:"rowGroupIndex",initialIndexProp:"initialRowGroupIndex"},this.columnExtractors={setFlagFunc:(e,t,s)=>this.setColRowGroupActive(e,t,s),getIndexFunc:e=>e.rowGroupIndex,getInitialIndexFunc:e=>e.initialRowGroupIndex,getValueFunc:e=>e.rowGroup,getInitialValueFunc:e=>e.initialRowGroup},this.modifyColumnsNoEventsCallbacks={addCol:e=>{this.columns.includes(e)||this.columns.push(e)},removeCol:e=>De(this.columns,e)}}moveColumn(e,t,s){if(this.columns.length===0)return;const i=this.columns[e],r=this.columns.slice(e,t);this.columns.splice(e,1),this.columns.splice(t,0,i),this.updateIndexMap(),this.eventSvc.dispatchEvent({type:this.eventName,columns:r,column:r.length===1?r[0]:null,source:s})}syncColumnWithState(e,t,s,i){const{value1:r,value2:o}=s("rowGroup","rowGroupIndex");(r!==void 0||o!==void 0)&&(typeof o=="number"||r?(e.isRowGroupActive()||(this.setColRowGroupActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)),i&&typeof o=="number"&&(i[e.getId()]=o)):e.isRowGroupActive()&&(this.setColRowGroupActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)))}setActive(e,t,s){if(e===t.isRowGroupActive())return;this.setColRowGroupActive(t,e,s);const i=this.beans.groupHierarchyColSvc?.getColumn(t);ru(this.gos,e)&&!i&&this.colModel.setColsVisible([t],!e,s)}setColRowGroupActive(e,t,s){e.rowGroupActive!==t&&(e.rowGroupActive=t,t&&this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,e)?.forEach(r=>this.setColRowGroupActive(r,t,s)),e.dispatchColEvent("columnRowGroupChanged",s)),e.dispatchStateUpdatedEvent("rowGroup")}},a_=class extends E{constructor(){super(...arguments),this.beanName="autoColSvc"}postConstruct(){this.addManagedPropertyListener("autoGroupColumnDef",this.updateColumns.bind(this)),this.setupGroupHideColumnsUntilExpanded()}setupGroupHideColumnsUntilExpanded(){const e=()=>this.updateGroupColumnVisibility();this.addManagedEventListeners({modelUpdated:e}),this.addManagedPropertyListeners(["groupHideColumnsUntilExpanded","groupDisplayType","groupHideOpenParents"],e)}addColumns(e){const{columns:t}=this;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Mn(e))}createColumns(e,t,s){const i=this.beans,{colModel:r,gos:o,rowGroupColsSvc:n,colGroupSvc:a}=i,l=r.isPivotMode(),c=ul(o,l),d=l?o.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),u=n?.columns,g=!(u&&u.length>0||o.get("treeData"))||d||c,p=()=>{this.columns&&(os(i,this.columns.tree),this.columns=null)};if(g){p();return}const f=this.generateAutoCols(u),m=Pn(f,this.columns?.list||null),C=e.treeDepth,w=(this.columns?this.columns.treeDepth:-1)==C;if(m&&w){const P=new Map(f.map(M=>[M.getId(),M]));for(const M of this.columns?.list??[]){const T=P.get(M.getId());T&&M.setColDef(T.getColDef(),null,s)}return}p();const S=a?.findDepth(e.tree)??0,y=a?.balanceTreeForAutoCols(f,S)??[];this.columns={list:f,tree:y,treeDepth:S,map:{}},t(P=>{if(!P)return null;const M=P.filter(T=>!Sr(T));return[...f,...M]})}updateColumns(e){const t=Os(e.source);this.columns?.list.forEach((s,i)=>this.updateOneAutoCol(s,i,t))}getColumn(e){return this.columns?.list.find(t=>oi(t,e))??null}getColumns(){return this.columns?.list??null}generateAutoCols(e=[]){const t=[],{gos:s}=this,i=s.get("treeData");let r=Sn(s);return i&&r&&(F(182),r=!1),r?e.forEach((o,n)=>{t.push(this.createOneAutoCol(o,n))}):t.push(this.createOneAutoCol()),t}isSuppressAutoCol(){const e=this.gos;return e.get("groupDisplayType")==="custom"?!0:e.get("treeDataDisplayType")==="custom"}createOneAutoCol(e,t){let s;e?s=`${$t}-${e.getId()}`:s=$t;const i=this.createAutoColDef(s,e,t);i.colId=s;const r=new is(i,null,s,!0);return this.createBean(r),r}updateOneAutoCol(e,t,s){const i=e.getColDef(),r=typeof i.showRowGroup=="string"?i.showRowGroup:void 0,o=this.beans,n=r!=null?o.colModel.getColDefCol(r):void 0,a=e.getId(),l=this.createAutoColDef(a,n??void 0,t);e.setColDef(l,null,s),qe(o,{state:[Sl(l,a)]},s)}createAutoColDef(e,t,s){let i=this.createBaseColDef(t);const r=this.gos.get("autoGroupColumnDef");Oe(i,r),i=Mi(this.beans,i,e,!0),r?.groupRowEditable==null&&(i.groupRowEditable=void 0),r?.groupRowValueSetter==null&&(i.groupRowValueSetter=void 0),this.gos.get("treeData")||ne(i.field)&&ne(i.valueGetter)&&ne(i.filterValueGetter)&&i.filter!=="agGroupColumnFilter"&&(i.filter=!1),s&&s>0&&(i.headerCheckboxSelection=!1);const o=ws(this.gos),n=i.valueGetter||i.field!=null;return o&&!n&&(i.sortIndex=void 0,i.initialSort=void 0),i}createBaseColDef(e){const t=this.gos.get("autoGroupColumnDef"),i={headerName:this.getLocaleTextFunc()("group","Group"),showRowGroup:e?.getColId()??!0};return t&&(t.cellRenderer||t.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),e&&(i.headerName=this.beans.colNames.getDisplayNameForColumn(e,"header")??void 0,i.headerValueGetter=e.colDef.headerValueGetter),i}getDeepestExpandedLevel(e,t){let s=-1;if(!e)return s;for(const i of e){if(!i.group||!i.expanded)continue;if(i.level>s&&(s=i.level),s>=t)return s;const r=this.getDeepestExpandedLevel(i.childrenAfterGroup,t);if(r>s&&(s=r),s>=t)return s}return s}updateGroupColumnVisibility(){const e=this.columns?.list;if(!e||e.length===0)return;const{gos:t,visibleCols:s,rowModel:i}=this.beans,r=su(t);let o=!1;const n=(l,c)=>{c!==l.isVisible()&&(l.setVisible(c,"api"),o=!0)},a=()=>{for(const l of e)n(l,!0)};if(!r)a();else if(e.length>1){const l=e.length-2,c=i?.rootNode?.childrenAfterGroup,d=this.getDeepestExpandedLevel(c,l);if(d>=l)a();else for(let u=0;u=u)}o&&s.refresh("api")}destroy(){os(this.beans,this.columns?.tree),super.destroy()}},Kp=null,Y0=e=>{const t=Kp,s=new Uint32Array(1<<32-Math.clz32(e|63));return t&&s.set(t),Kp=s,s},l_=(e,t,s,i)=>{const r=t-i,o=s-1;if(r===1){let c=0;for(;e[c].level===o;)++c;if(c0){const d=e[c];e.copyWithin(1,0,c),e[0]=d}return e}const n=new Array(r);let a=0,l=0;for(let c=0;c{let s=e[0].level+1,i=s,r=0,o=s,n=Kp;(!n||s>=n.length)&&(n=Y0(s)),++n[s];for(let u=1;us?(s=h,s>=n.length&&(n=Y0(s))):h=0)return n.fill(0,i,s+1),e;const a=n[i],l=n[s];if(a+l===t)return n[i]=0,n[s]=0,l_(e,t,s,l);let c=0;for(let u=s;u>=i;--u){const h=n[u];n[u]=c,c+=h}const d=new Array(t);for(let u=0;u{if(t===2){if(e[0].level16)return c_(e,t);for(let s=1;s=0&&e[o].level=0;)s.set(t,-1),t=t.parent;return}const i=this.rows;do s.set(t,-1),i.push(t),t=t.parent;while(t!=null&&!s.has(t));this.unsorted=!0}addCell(e,t){if(t==null){this.addRow(e);return}if(e==null)return;const s=this.slots,i=this.bits,r=s.get(t)??this.ensureCol(t);let o=s.get(e);if(o===void 0)o=this.ensureRow(e);else if(o<0)return;const n=r<32?i:this.extraBits[(r>>>5)-1],a=1<<(r&31),l=n[o];if(l&a)return;n[o]=l|a;let c=e.parent;for(;c!=null;){const d=s.get(c);if(d<0)break;const u=n[d];if(u&a)break;n[d]=u|a,c=c.parent}}hasRow(e){return this.slots.has(e)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;const e=X0(this.rows);return this.rows=e,e}getSlot(e){return this.slots.get(e)??-1}hasCellBySlot(e,t){return e<0?!0:t<32?t>=0&&(this.bits[e]&1<>>5)-1][e]&1<<(t&31))!==0}ensureRow(e){const t=this.slots,s=this.rows,i=this.bits,r=this.extraBits;let o=i.push(0);const n=o-1;if(r!==null)for(let l=0,c=r.length;l=32){const s=(t>>>5)-1;let i=this.extraBits;i===null&&(i=[],this.extraBits=i),s>=i.length&&i.push(new Array(this.bits.length).fill(0))}return t}},Z0=class{constructor(){this.kind="rows",this.rows=[],this.unsorted=!1,this.rowSet=new Set}addRow(e){let t=e;if(t==null)return;const s=this.rowSet;if(s.has(t))return;const i=this.rows;do s.add(t),i.push(t),t=t.parent;while(t!=null&&!s.has(t));this.unsorted=!0}addCell(e,t){this.addRow(e)}hasRow(e){return this.rowSet.has(e)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;const e=X0(this.rows);return this.rows=e,e}},u_=class extends E{constructor(){super(...arguments),this.beanName="changedPathFactory"}newPath(e){return e?new d_:new Z0}ensureRowsPath(e){let t=e.changedPath;if(!t&&e.changedRowNodes&&!e.newData){const s=this.beans.rowModel;s.hierarchical&&(t=new Z0,e.changedPath=t,t.addRow(s.rootNode))}return t}},Q0=class extends E{addExpandedCss(e,t){t.isExpandable()&&(e.push("ag-row-group"),e.push(t.expanded?"ag-row-group-expanded":"ag-row-group-contracted"))}getRowExpandedListeners(e){const{rowNode:t}=e,s=this.updateExpandedCss.bind(this,e,t);return{expandedChanged:s,hasChildrenChanged:s}}setExpanded(e,t,s,i){if(e.expanded===t)return;e._expanded=t,e.dispatchRowEvent("expandedChanged");const r={...Lu(e,this.gos,"rowGroupOpened"),expanded:t,event:s||null};this.dispatchExpandedEvent(r,i)}defaultExpanded(e){const s=this.beans.gos,i=e.level??0,r=e.group&&s.get("isGroupOpenByDefault");if(!r){const n=s.get("groupDefaultExpanded");return n===-1||i{const o=r.rowComp;o.toggleCss("ag-row-group",s),o.toggleCss("ag-row-group-expanded",s&&i),o.toggleCss("ag-row-group-contracted",s&&!i),ot(r.element,s&&i)})}dispatchStateUpdatedEvent(){this.eventSvc.dispatchEvent({type:"rowExpansionStateChanged"})}},h_=class extends Q0{constructor(){super(...arguments),this.beanName="expansionSvc",this.events=null,this.dispatchExpandedDebounced=null}destroy(){super.destroy(),this.events=null,this.dispatchExpandedDebounced=null}setExpansionState(e){const t=new Set(e.expandedRowGroupIds);this.beans.rowModel.forEachNode(s=>{const i=s.id;i&&(s._expanded=t.has(i))}),this.onGroupExpandedOrCollapsed()}getInternalExpansionState(e=!1){const t=[],s=[];return this.beans.rowModel.forEachNode(i=>{const r=i.id;r&&(i.expanded?t.push(r):e&&i.isExpandable()&&s.push(r))}),{expandedRowGroupIds:t,collapsedRowGroupIds:s}}getExpansionState(){return this.getInternalExpansionState()}isExpanded(e){if(e.footer)return!!e._expanded;if(!(e.group||e.master)||e.leafGroup&&this.beans.colModel.isPivotMode())return!1;let t=e._expanded;return t===null&&(t=this.defaultExpanded(e)??!1,e._expanded=t),!!t}resetExpansion(){const{rowModel:e}=this.beans;e.forEachNode(t=>{!t.group&&!t.master||(t._expanded=null)}),this.onGroupExpandedOrCollapsed()}expandAll(e){const{gos:t,rowModel:s,colModel:i,eventSvc:r}=this.beans,o=t.get("treeData"),n=i.isPivotActive(),a=c=>{if(c)for(const d of c){const u=()=>{d._expanded=e,a(d.childrenAfterGroup)};if(d.master){u();continue}if(o){D(d.childrenAfterGroup)&&u();continue}if(n){!d.leafGroup&&u();continue}d.group&&u()}},l=s.rootNode;l&&a(l.childrenAfterGroup),this.onGroupExpandedOrCollapsed(),r.dispatchEvent({type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"})}onGroupExpandedOrCollapsed(){this.dispatchStateUpdatedEvent(),this.beans.rowModel.reMapRows()}setDetailsExpansionState(e){const t=this.getInternalExpansionState(!0),s=t.collapsedRowGroupIds.length===0;if(t.expandedRowGroupIds.length===0!==s)return s?e.expandAll():e.collapseAll()}dispatchExpandedEvent(e,t){if((this.events??(this.events=[])).push(e),t){this.dispatchExpandedEvents();return}let s=this.dispatchExpandedDebounced;if(!s){if(!this.isAlive())return;s=this.debounce(()=>this.dispatchExpandedEvents()),this.dispatchExpandedDebounced=s}s()}dispatchExpandedEvents(){const{eventSvc:e,rowRenderer:t}=this.beans,s=this.events,i=s?.length;if(!i)return;this.events=null;const r=new Array(i);for(let o=0;owindow.setTimeout(e,0);let s=!1;return()=>{if(!t.active){window.setTimeout(e,0);return}s||(s=!0,t.addDestroyTask(()=>{s=!1,e()}))}}};function J0(e){let t=e.get("groupHideParentOfSingleChild");return t||(t=e.get("groupRemoveSingleChildren"),!t&&e.get("groupRemoveLowestSingleChildren")&&(t="leafGroupsOnly")),{groupHideParentOfSingleChild:t,isGroupMultiAutoColumn:Sn(e),hideOpenParents:e.get("groupHideOpenParents"),grandTotalRow:Ri(e),groupTotalRow:vr(e)}}function e1(e,t,s){return e.groupHideParentOfSingleChild===!0&&s&&t.childrenAfterGroup.length===1}function t1(e,t,s){return e.groupHideParentOfSingleChild==="leafGroupsOnly"&&s&&t.leafGroup&&t.childrenAfterGroup.length===1}function s1(e,t,s,i,r,o){return i&&!s||r||o?!1:!e.hideOpenParents||t.master||t.level===-1?!0:!(!(i&&t.leafGroup)&&t.expanded)}var g_=class extends E{constructor(){super(...arguments),this.beanName="flattenStage",this.step="map",this.refreshProps=["groupHideParentOfSingleChild","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupTotalRow","masterDetail"]}execute(){const{beans:e,gos:t}=this,s=[],i=e.rowModel.rootNode;if(!i)return s;const r=e.colModel.isPivotMode(),o=r&&i.leafGroup&&i.aggData,n=o?[i]:i.childrenAfterSort,a=J0(t);this.recursivelyAddToRowsToDisplay(a,n,s,r,0);const l=s.length>0,c=a.grandTotalRow;if(!o&&l&&c)if(gi(i,e),c==="pinnedBottom"||c==="pinnedTop")this.beans.pinnedRowModel?.setGrandTotalPinned(c==="pinnedBottom"?"bottom":"top");else{const u=c==="top";this.addRowNodeToRowsToDisplay(a,i.sibling,s,0,u)}return s}recursivelyAddToRowsToDisplay(e,t,s,i,r){if(!t?.length)return;const o=this.beans.masterDetailSvc;for(let n=0;nthis.onCsrmCellChange(e),batchEditingStopped:()=>this.flushGroupEdits()})}destroy(){this.stopDragging(!0),super.destroy()}isGroupingDrop(e){return!e.rowDragManaged||!e.sameGrid||!this.gos.get("refreshAfterGroupEdit")?!1:!!this.beans.rowGroupColsSvc?.columns?.length&&!this.beans.colModel.isPivotMode()}initDraggingGroups(e){const t=new Map,s=i=>{const r=i.childrenAfterGroup;if(r){if(t.has(i))return;const o=r.slice();t.set(i,o);for(const n of o)s(n)}};for(const i of e.rows)i.group&&s(i);this.draggingGroups=t}canSetParent(e){return e.sameGrid?this.beans.groupStage?.treeData?!0:e.rowDragManaged&&!this.gos.get("refreshAfterGroupEdit")?!1:!!this.beans.rowGroupColsSvc?.columns?.length:!1}canDropRow(e,t){if(this.beans.groupStage?.treeData)return!f_(e,t.newParent);const{position:s,target:i,newParent:r,rootNode:o}=t,n=e.parent;if(e.group&&(r1(e,i)||r1(e,r)))return!1;if(s==="inside")return!0;if(r&&r!==n)return r!==o||n===o;const a=r??i?.parent??o;if(a!==n)return!1;const l=e.group?e.level:n.level??-1;let c=-1;return i?c=i.group?i.level:i.parent?.level??-1:a&&(c=a.level),!(l>=0&&c>=0&&c!==l)}fixRowsDrop(e,t,s,i){const r=!!this.beans.groupStage?.treeData;if(e.treeData=r,!(!!this.beans.rowGroupColsSvc?.columns?.length||this.gos.get("pivotMode"))&&!r)return;!this.draggingGroups&&this.isGroupingDrop(e)&&!e.suppressMoveWhenRowDragging&&this.initDraggingGroups(e);let n=e.target,a=null,l=!1;const c=e.rootNode,d=this.beans.rowModel,u=this.canStartGroup(n,r);this.updateDropTarget(e,s,u);const h=this.beans.pageBounds?.getLastRow?.()??d.getRowCount()-1;if(t&&(!n||i>=.5&&n.rowIndex===h?a=c:e.moved&&n&&this.dropGroupThrottled&&this.shouldDropTargetBeParent(e)&&(a=n),a||(a=n?.parent??c)),!s&&n&&u&&!(n.group&&n.expanded)&&this.startDropGroupDelay(n),a){if(n&&a===n&&a!==c){const g=a.expanded?kn(d,1,n):null;g?.parent===a?(n=g,i=-.5):l=!0}if(n&&!l){let g=n;for(;g&&g!==c&&g!==a;)n=g,g=g.parent}}e.target=n,e.newParent=a,e.yDelta=i,e.inside=l}clearNewSameParent(e,t){const s=e.newParent;s&&(!t||m_(e.rows,s))&&(e.newParent=null)}updateDropTarget(e,t,s){const i=s?e.target:null;this.dropGroupTarget&&this.dropGroupTarget!==i&&this.resetDragGroup(),i?.childrenAfterSort?.length&&(t&&this.dropGroupThrottled&&!i.expanded&&i.isExpandable?.()&&i.setExpanded(!0,void 0,!0),this.canDropInTarget(i,e)&&(this.dropGroupThrottled=!0,this.dropGroupTarget=i))}canDropInTarget(e,t){if(e.expanded)return!0;if(!e.group)return!1;if(t.pointerPos==="inside")return!0;if(t.treeData)return!1;const s=t.rows,i=e.level;for(let r=0,o=s.length;r{this.dropGroupTimer=null,this.dropGroupThrottled=!0,this.beans.dragAndDrop?.nudge()},t)}resetDragGroup(){this.dropGroupTimer!==null&&(window.clearTimeout(this.dropGroupTimer),this.dropGroupTimer=null),this.dropGroupTarget=null,this.dropGroupThrottled=!1}stopDragging(e){e&&(this.draggingGroups=null),this.resetDragGroup()}shouldDropTargetBeParent({target:e,rows:t,pointerPos:s,treeData:i}){if(!e||s==="none")return!1;if(s==="inside"||!i&&e.group&&!e.expanded)return!0;if(s==="above")return!1;const r=this.beans.rowModel;let n=e.rowIndex+1,a;do a=r.getRow(n++);while(a?.footer);const l=this.draggingGroups?.get(e)??e.childrenAfterGroup;if(a&&a.parent===e&&l?.length){const c=new Set(t);for(let d=0,u=l.length;d{c.has(v)||(c.add(v),h??(h=this.newGroupValues(o)),this.setRowGroup(v,h)&&u.add(v))},p=v=>{const w=this.draggingGroups?.get(v)??v.childrenAfterGroup,S=w?.length;if(S)for(let y=0;y=0?g(R):p(R)}};for(const v of e.rows)if(v.group)p(v);else{const w=v.sourceRowIndex>=0&&!v.destroyed?v:this.csrmFirstLeaf(v);w&&g(w)}const f=s==="inside"?"above":s,m=s==="inside"?this.findFirstLeafForParent(o,c)??i:i;let C=!1;if(c.size&&f!=="none"&&(C=ph(r._leafs,c,m,f==="above")),!u.size&&!C)return!1;d.reordered=C;for(const v of c)d.updates.add(v);return this.csrmRefresh(d),l?l.focusCell():n.clearFocusedCell(),!0}canStartGroup(e,t){return!e||e.level<0||e.footer||e.detail?!1:e.group?!0:t}flushGroupEdits(){const e=this.pendingEditRefresh;e&&(this.pendingEditRefresh=null,this.csrmRefresh(e))}csrmRefresh(e){const t=this.beans.rowModel;t.rootNode&&t.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e})}newGroupValues(e){const t=this.beans.rowGroupColsSvc?.columns??[],s=new Array(t.length);let i=-1,r=e;for(;r&&r.level>=0;){const o=t[r.level];if(o){const n=o.getColId(),a=r.level;s[a]=r.groupData?.[n]??r.key??void 0,a>i&&(i=a)}r=r.parent}return{values:s,columns:t,maxLevel:i}}setRowGroup(e,{values:t,columns:s,maxLevel:i}){if(i<0)return!1;const{valueSvc:r,changeDetectionSvc:o}=this.beans;let n=!1;o?.beginDeferred();try{for(let a=0;ai)continue;const c=t[a],d=r.getValue(l,e,"data");if(d===c||d==null&&c==null)continue;let u=c;const h=r.parseValue(l,e,c,d);h!==void 0&&(u=h),e.setDataValue(l,u,"rowDrag")&&(n=!0)}}finally{o?.endDeferred()}return n}onCsrmCellChange(e){const{column:t,node:s,source:i}=e;if(!this.gos.get("refreshAfterGroupEdit")||i==="rowDrag"||!t?.isRowGroupActive()||s.group||!s.data)return;if(this.beans.editSvc?.isBatchEditing()){let o=this.pendingEditRefresh;o||(o=i1(),this.pendingEditRefresh=o),o.updates.add(s)}else{const o=i1();o.updates.add(s),this.csrmRefresh(o)}}csrmFirstLeaf(e){if(!e)return null;const t=this.draggingGroups;let s=t?.get(e)??e.childrenAfterGroup;for(;s?.length;){const i=s[0];if(i.sourceRowIndex>=0)return i.destroyed?this.firstAliveChildLeaf(i):i;s=t?.get(i)??i.childrenAfterGroup}return Gi(e)}firstAliveChildLeaf(e){const t=this.draggingGroups?.get(e)??e.childrenAfterGroup;if(t){for(const s of t)if(s.sourceRowIndex>=0&&!s.destroyed)return s}return null}findFirstLeafForParent(e,t){if(!e)return null;const s=this.draggingGroups?.get(e)??e?.childrenAfterGroup;if(!s)return null;for(let i=0,r=s.length;i=0&&!t.has(o))return o;const n=this.findFirstLeafForParent(o,t);if(n!==null)return n}return null}},i1=()=>{const e=new Mr;return e.reordered=!0,e},r1=(e,t)=>{if(!e||!t)return!1;let s=t;for(;s;){if(s===e)return!0;s=s.parent}return!1},f_=(e,t)=>{if(!t||e.parent===t)return!1;let s=t;const i=e.id;for(;s;){if(s===e||i!=null&&s.id===i)return!0;s=s.parent}return!1},m_=(e,t)=>{for(let s=0,i=e.length;sthis.strategy?.onShowRowGroupColsSetChanged()})}invalidateGroupCols(){this.columnsInvalidated=!0,this.strategy?.invalidateGroupCols?.()}destroy(){this.strategy=this.destroyBean(this.strategy),super.destroy()}getNonLeaf(e){return this.strategy?.nonLeafsById?.get(e)}getNestedDataGetter(){return this.getStrategy()?.nestedDataGetter}onPropChange(e){const t=this.gos,s=this.strategy?.nestedDataGetter;return e.has("treeData")&&(this.gosTreeData=t.get("treeData")&&this.hasTreeData,this.columnsInvalidated=!0),this.strategy?.onPropChange?.(e),this.getNestedDataGetter()!==s}extractData(){const e=this.beans.rowModel.rootNode,t=this.nested?e?.childrenAfterGroup:e?._leafs;if(!t)return this.gos.get("rowData")??[];const s=t.length,i=new Array(s);let r=0;for(let o=0;o{const t=e.sibling;if(!t)return null;const s=t._leafs;return s!==void 0?s:ad(t)},ad=e=>{const t=e.childrenAfterGroup,s=t?.length;if(e._leafs=null,!s)return null;let i;const r=s===1?t[0]:null;if(r?.group&&r.sourceRowIndex<0)i=r._leafs,i===void 0&&(i=ad(r));else if(e.leafGroup)i=t;else{i=[];for(let o=0;o=0&&i.push(n),!n.group)continue;let a=n._leafs;if(a===void 0&&(a=ad(n)),a)for(let l=0,c=a.length;l{const i=e._leafs,r=e.sibling;e.treeNodeFlags=0,e.childrenAfterGroup=i,e.childrenMapped=null,e._groupData=void 0,e.aggData=null,r&&(r.childrenAfterGroup=e.childrenAfterGroup,r.childrenAfterAggFilter=e.childrenAfterAggFilter,r.childrenAfterFilter=e.childrenAfterFilter,r.childrenAfterSort=e.childrenAfterSort,r.childrenMapped=null,r._groupData=void 0,r.aggData=null);for(let o=0,n=i.length??0;o{e.key=null,e.treeNodeFlags=0,e.allChildrenCount=null,e.childrenAfterGroup=null,e.childrenAfterAggFilter=null,e.childrenAfterFilter=null,e.childrenAfterSort=null,e.childrenMapped=null,e.level=0,e._groupData=void 0};function n1(e,t,s){let i=e;const r=i.level-t.level;if(r<=0||!s.get("groupHideOpenParents"))return!1;for(let n=0;n{const{rowDragSvc:t}=this.beans;if(!this.params.rowDrag||!t)return;const s=t.createRowDragComp(()=>this.params.value,this.params.node);this.createManagedBean(s),this.eGui.insertAdjacentElement("afterbegin",s.getGui())};this.setupExpand(),e(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}getCellAriaRole(){const e=this.params.colDef?.cellAriaRole,t=this.params.column?.getColDef().cellAriaRole;return e||t||"gridcell"}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;const{visibleCols:e}=this.beans,t=this.params.pinned==="left",s=this.params.pinned==="right",i=!t&&!s;return this.gos.get("enableRtl")?e.isPinningLeft()?!s:!i:e.isPinningLeft()?!t:!i}addGroupValue(){const{params:{value:e,valueFormatted:t}}=this,s=this.getInnerCompDetails();this.comp.setInnerRenderer(s,t??e??null)}setupExpand(){const{colModel:e}=this.beans,{eGridCell:t,suppressDoubleClickExpand:s}=this.params,i=(l,c)=>{const d=_(l,this.beans,null);d&&(c.appendChild(d),this.addDestroyFunc(()=>d.remove()))};i("groupExpanded",this.eExpanded),i("groupContracted",this.eContracted);const r=this.comp,o=()=>{if(!this.isExpandable())return;const c=!!this.displayedNode.expanded;r.setExpandedDisplayed(c),r.setContractedDisplayed(!c),ot(t,c)},n=()=>{const l=this.isExpandable();r.toggleCss("ag-cell-expandable",l),r.toggleCss("ag-row-group",l);const c=!l&&e.isPivotMode();r.toggleCss("ag-pivot-leaf-group",c);const d=!e.isPivotMode()&&(!this.displayedNode.footer||this.displayedNode.level!==-1);r.toggleCss("ag-row-group-leaf-indent",!l&&d);const u=this.getChildCount(),h=u>0?`(${u})`:"";r.setChildCount(h),l?o():(r.setExpandedDisplayed(!1),r.setContractedDisplayed(!1),Bd(t))};(()=>{!s&&!this.isGroupCellEditable(this.displayedNode)&&this.addManagedListeners(t,{dblclick:this.onCellDblClicked.bind(this)}),this.addManagedListeners(this.eExpanded,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(this.eContracted,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedListeners(this.displayedNode,{allChildrenCountChanged:n,masterChanged:n,groupChanged:n,hasChildrenChanged:n,expandedChanged:o})})(),n()}getInnerCompDetails(){const{userCompFactory:e,findSvc:t}=this.beans,s=this.params;if(s.fullWidth){const l=this.gos.get("groupRowRendererParams"),c=Tn(e,l,s);return c||(t?.isMatch(s.node,null)?Tn(e,{...l,innerRenderer:"agFindCellRenderer"},s):void 0)}const i=l=>l&&l.componentClass==this.compClass,r=Tn(e,s,s);if(r&&!i(r))return r;const{displayedNode:{rowGroupColumn:o}}=this,n=o?.colDef,a=o&&s.column?.isRowGroupDisplayed(o.getId());if(n&&a){const l=xr(e,n,s);if(l)if(i(l)){if(n?.cellRendererParams?.innerRenderer)return Tn(e,n.cellRendererParams,s)}else return l}if(t?.isMatch(s.node,s.column))return xr(e,{...n??s.colDef,cellRenderer:"agFindCellRenderer"},s)}getChildCount(){const{column:e,suppressCount:t}=this.params;if(t)return 0;const{allChildrenCount:s,rowGroupColumn:i}=this.displayedNode;return!((s??0)>0&&(!i||!e||e?.isRowGroupDisplayed(i.getId())))||this.gos.get("showOpenedGroup")&&this.displayedNode!==this.node&&!n1(this.node,this.displayedNode,this.gos)?0:s??0}isExpandable(){const{node:e,column:t,colDef:s}=this.params;if(!this.displayedNode.isExpandable()||e.rowPinned)return!1;if(!t)return!0;if(e.hasChildren()&&s){const{showRowGroup:o}=s;if(!o)return!1;if(o===!0)return!0}return e===this.displayedNode?e.rowGroupColumn&&t?.isRowGroupDisplayed(e.rowGroupColumn.getId())?!0:e.master?s?.showRowGroup===!0||s?.showRowGroup==null:!1:n1(this.node,this.displayedNode,this.gos)}setupIndent(){const{suppressPadding:e,node:t,colDef:s}=this.params;if(e)return;const i=()=>{let r=t.uiLevel;s&&s.showRowGroup!==!0&&(r=0);const o="ag-row-group-indent-"+r;o!==this.indentClass&&(this.indentClass&&this.comp.toggleCss(this.indentClass,!1),this.indentClass=o,this.comp.toggleCss(o,!0),this.eGui.style.setProperty("--ag-indentation-level",String(r)))};this.addManagedListeners(t,{uiLevelChanged:i.bind(this)}),i()}setupCheckbox(){const{node:e}=this.params;!e.footer&&!e.rowPinned&&!e.detail&&(this.addManagedPropertyListener("rowSelection",({currentValue:s,previousValue:i})=>{const r=typeof s=="object"?s:void 0,o=typeof i=="object"?i:void 0;r?.checkboxLocation!==o?.checkboxLocation&&(this.destroyCheckbox(),this.addCheckbox())}),this.addCheckbox())}addCheckbox(){const{selectionSvc:e}=this.beans;if(!e||!Lt(this.gos))return;const{node:t,column:s}=this.params,i=this.gos.get("rowSelection"),r=ro(i);if(r==="selectionColumn")return;if(r==="autoGroupColumn"){const c=s?.getColDef().showRowGroup!=null,d=!s&&t.group;if(!(c||d))return}const o=typeof i=="object"?Fi(i):this.params.checkbox;if(!(typeof o=="function"||o===!0))return;if(typeof s?.getColDef().showRowGroup=="string"&&!this.isExpandable()){this.comp.setCheckboxSpacing(!0);return}const l=e.createCheckboxSelectionComponent();this.cbComp=l,this.createBean(l),l.init({rowNode:t,column:s,overrides:{isVisible:o,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(l.getGui()),this.comp.setCheckboxVisible(!0)}destroyCheckbox(){this.comp.setCheckboxSpacing(!1),this.comp.setCheckboxVisible(!1),this.cbComp?.getGui().remove(),this.cbComp=this.destroyBean(this.cbComp)}isGroupCellEditable(e){const t=this.params.column;return!!t&&(!!t.getColDef().groupRowEditable||this.gos.get("enableGroupEdit"))&&t.isCellEditable(e)}onExpandClicked(e){Gt(e)||(Ee(e),this.onExpandOrContract(e))}onKeyDown(e){!(e.key===b.ENTER)||this.params.suppressEnterExpand||this.isGroupCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){if(Gt(e))return;el(this.eExpanded,e)||el(this.eContracted,e)||this.onExpandOrContract(e)}onExpandOrContract(e){if(!this.isExpandable())return;const t=this.displayedNode,s=!t.expanded;!s&&t.sticky&&this.beans.ctrlsSvc.getScrollFeature().setVerticalScrollPosition(t.rowTop-t.stickyRowTop),t.setExpanded(s,e)}destroy(){super.destroy(),this.destroyCheckbox()}},b_={tag:"span",cls:"ag-cell-wrapper",children:[{tag:"span",ref:"eExpanded",cls:"ag-group-expanded ag-hidden"},{tag:"span",ref:"eContracted",cls:"ag-group-contracted ag-hidden"},{tag:"span",ref:"eCheckbox",cls:"ag-group-checkbox ag-invisible"},{tag:"span",ref:"eValue",cls:"ag-group-value"},{tag:"span",ref:"eChildCount",cls:"ag-group-child-count"}]},l1=class extends A{constructor(){super(b_),this.eExpanded=x,this.eContracted=x,this.eCheckbox=x,this.eValue=x,this.eChildCount=x}init(e){const t={setInnerRenderer:(o,n)=>this.setRenderDetails(o,n),setChildCount:o=>this.eChildCount.textContent=o,toggleCss:(o,n)=>this.toggleCss(o,n),setContractedDisplayed:o=>V(this.eContracted,o),setExpandedDisplayed:o=>V(this.eExpanded,o),setCheckboxVisible:o=>this.eCheckbox.classList.toggle("ag-invisible",!o),setCheckboxSpacing:o=>this.eCheckbox.classList.toggle("ag-group-checkbox-spacing",o)},s=this.createManagedBean(new a1),i=!e.colDef,r=this.getGui();s.init(t,r,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),i&&Ie(r,s.getCellAriaRole())}setRenderDetails(e,t){e?e.newAgStackInstance().then(s=>{if(!s)return;const i=()=>this.destroyBean(s);this.isAlive()?(this.eValue.appendChild(s.getGui()),this.addDestroyFunc(i)):i()}):this.eValue.innerText=t}destroy(){this.destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}},S_=".ag-group-checkbox-spacing{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-group-checkbox-spacing{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-checkbox-spacing{margin-left:var(--ag-cell-widget-spacing)}",y_=class extends E{constructor(){super(...arguments),this.beanName="showRowGroupColValueSvc"}getGroupValue(e,t,s){if(!t)return e.group?{displayedNode:e,value:e.groupValue}:null;const i=this.beans.valueSvc,r=t.colDef.showRowGroup;if(!r)return null;if(e.level===-1&&e.footer)return{displayedNode:e,value:null};if(typeof r=="string"){if((this.beans.rowGroupColsSvc?.getColumnIndex(r)??-1)>e.level)return null;const a=this.getDisplayedNode(e,t,!0);if(a)return{displayedNode:a,value:i.getValue(t,a,"data",s)}}const o=i.getValue(t,e,"data",s);if(o==null){const n=this.getDisplayedNode(e,t);if(n)return{displayedNode:n,value:i.getValue(t,n,"data",s)}}return{displayedNode:e,value:o}}formatAndPrefixGroupColValue(e,t,s=!1){const i=this.formatGroupColValue(e,t,s),{value:r,displayedNode:o}=e,n=this.beans.footerSvc;return n?.doesCellShowTotalPrefix(o,t)?n.applyTotalPrefix(r,i,o,t):o.footer&&o.level===-1?null:i}formatGroupColValue(e,t,s=!1){const i=this.beans.valueSvc,{displayedNode:r,value:o}=e,n=r.rowGroupColumn,a=r.group&&!t;if(n&&(a||t?.isRowGroupDisplayed(n.colId))){if(s&&n.colDef.useValueFormatterForExport===!1)return null;const c=i.formatValue(n,r,o);return c==null&&r.key===""?this.getLocaleTextFunc()("blanks","(Blanks)"):c}return!t||r.group||s&&t.colDef.useValueFormatterForExport===!1?null:i.formatValue(t,r,o)}getDisplayedNode(e,t,s=!1){const i=this.gos,r=i.get("groupHideOpenParents"),o=i.get("showOpenedGroup")&&!s;if(!r&&!o)return;const n=t.colDef.showRowGroup;if(n===!0)return e.group?void 0:e.parent??void 0;let a=e;for(;a&&a.rowGroupColumn?.getId()!=n;){const l=a===a.parent?.getFirstChild();if(!o&&!l)return;a=a.parent}if(a!==e)return a??void 0}},x_=class extends E{constructor(){super(...arguments),this.beanName="showRowGroupCols",this.columns=[],this.colsSet=new Set,this.colsMap=new Map}destroy(){super.destroy(),this.columns.length=0,this.colsSet.clear(),this.colsMap.clear()}refresh(){const{colModel:e,rowGroupColsSvc:t}=this.beans,s=this.columns,i=this.colsSet,r=this.colsMap;r.clear();const o=s.length;let n=0,a=!1;const l=e.getCols();for(let c=0,d=l.length;c=o||!i.has(u)),s[n++]=u}if(a||(a=n!==o),a){s.length=n,i.clear();for(let c=0;c{this.gridBodyCtrl=e.gridBodyCtrl}),this.resetStickyContainers()}setOffsetTop(e){this.extraTopHeight!==e&&(this.extraTopHeight=e,this.eventSvc.dispatchEvent({type:"stickyTopOffsetChanged",offset:e}))}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getLastPixelOfGroup(e){return this.isClientSide?E_(e):F_(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}updateStickyRows(e){const t=e==="top";let s=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,s);const i=new Set,{rowModel:r,rowRenderer:o,pinnedRowModel:n,pageBounds:a,rowContainerHeight:l}=this.beans,{pageFirstPixel:c,pageLastPixel:d}=a.getCurrentPagePixelRange(),u=t?o.firstVisibleVPixel-this.extraTopHeight:o.lastVisibleVPixel-this.extraTopHeight,h=l.divStretchOffset??0,g=c+h,p=d+h,f=w=>{if(i.add(w),t){const S=this.getLastPixelOfGroup(w),y=u+s+w.rowHeight;Sy?w.stickyRowTop=s-(S-y):w.stickyRowTop=s}s=0,i.forEach(S=>{const y=S.stickyRowTop+S.rowHeight;s{if(!w.displayed)return!1;if(w.footer){if(m===!0||m==="grand"&&w.level===-1||m==="group"&&w.level>-1)return!1;const S=w.sibling.rowIndex?w.sibling.rowIndex+1===w.rowIndex:!1;return e==="bottom"&&S||w.level===-1&&n?.getGrandTotalPinned()?!1:!i.has(w)}return w.isExpandable()?C===!0||e==="bottom"?!1:!i.has(w)&&!!w.expanded:!1};for(let w=0;w<100;w++){let S=u+s;t||(S=u-s),t&&Sp&&(S=p);const y=r.getRowIndexAtPixel(S),R=r.getRow(y);if(R==null)break;const M=this.getStickyAncestors(R).find(I=>(t?I.rowIndexy)&&v(I));if(M){f(M);continue}if((t?R.rowTopS)&&v(R)){f(R);continue}break}return t||i.forEach(w=>{w.stickyRowTop=s-(w.stickyRowTop+w.rowHeight)}),this.refreshNodesAndContainerHeight(e,i,s)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(e===!0)return!0;const t=e==="group",s=e==="grand";return t&&s?!0:s?"grand":t?"group":!1}canRowsBeSticky(){const e=bn(this.gos),t=this.areFooterRowsStickySuppressed(),s=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!s)}getStickyAncestors(e){const t=[];let s=e.footer?e.sibling:e.parent;for(;s;)s.sibling&&t.push(s.sibling),t.push(s),s=s.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some(s=>s.rowNode===e)){for(let s=0;s{a.has(g)||(g.sticky=!0,l.push(this.createRowCon(g,!1,!1)))});let c=!!l.length||n.length!==r.length;i?this.topContainerHeight!==s&&(this.topContainerHeight=s,this.gridBodyCtrl.setStickyTopHeight(s),c=!0):this.bottomContainerHeight!==s&&(this.bottomContainerHeight=s,this.gridBodyCtrl.setStickyBottomHeight(s),c=!0),this.destroyRowCtrls(o,!1);const d=[...n,...l];d.sort((g,p)=>p.rowNode.rowIndex-g.rowNode.rowIndex),i||d.reverse();for(const g of d)g.setRowTop(g.rowNode.stickyRowTop);const u=this.beans.pageBounds;let h=0;if(i){for(const g of t)g.rowIndexthis.topContainerHeight&&(h=this.topContainerHeight),this.setOffsetTop(h)}else{for(const g of t)g.rowIndex>u.getLastRow()&&(h+=g.rowHeight);h>this.bottomContainerHeight&&(h=this.bottomContainerHeight),this.setOffsetBottom(h)}return c?(i?this.stickyTopRowCtrls=d:this.stickyBottomRowCtrls=d,!0):!1}ensureRowHeightsValid(){let e=!1;const t=s=>{const i=s.rowNode;if(i.rowHeightEstimated){const r=Ze(this.beans,i);i.setRowHeight(r.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}};function F_(e){if(e.isExpandable()||e.footer){if(e.master&&e.detailNode)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let s=e.childStore?.getStoreBounds();return e.footer&&(s=e.sibling.childStore?.getStoreBounds()),(s?.heightPx??0)+(s?.topPx??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}function E_(e){if(e.isExpandable()||e.footer){if(e.footer&&e.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let i=e.footer?e.sibling:e;for(;i.isExpandable()&&i.expanded;)if(i.master&&i.detailNode)i=i.detailNode;else if(i.childrenAfterSort){if(i.childrenAfterSort.length===0)break;i=W(i.childrenAfterSort)}return i.rowTop+i.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}var P_=class extends E{constructor(){super(...arguments),this.beanName="stickyRowSvc"}createStickyRowFeature(e,t,s){const i=this.gos;if(bn(i)&&ae(i)||ft(i))return e.createManagedBean(new R_(t,s))}},c1={moduleName:"GroupCellRenderer",version:Y,userComponents:{agGroupRowRenderer:l1,agGroupCellRenderer:l1},dynamicBeans:{groupCellRendererCtrl:a1},icons:{groupContracted:"tree-closed",groupExpanded:"tree-open"},css:[S_],dependsOn:[le]},d1={moduleName:"GroupColumn",version:Y,beans:[a_,x_,y_,n_,q0,j0],dependsOn:[le,c1]},jp={moduleName:"ChangedPath",version:Y,beans:[u_],dependsOn:[le]},Ma={moduleName:"ClientSideRowModelHierarchy",version:Y,rowModels:["clientSide"],beans:[C_,g_,h_],dependsOn:[le,jp]},qp={moduleName:"StickyRow",version:Y,beans:[P_]},u1={moduleName:"GroupEdit",version:Y,beans:[p_],dependsOn:[le,Ma]},M_=({valueSvc:e,dataTypeSvc:t},s,i)=>{const r=e.getValue(s,i,"data");let o=null;return r instanceof Date?o=r:typeof r=="string"&&(o=(t?.getDateParserFunction(s)??_e)(r)??null),o},er=(e,t,s,i)=>r=>{const o=M_(e,t,r.node),n=Dr(o);return n?i?.(n[s])??n[s]:null},tr=({colNames:e},t,s)=>i=>{const r=e.getDisplayNameForColumn(t,i.location);return r?`${r} (${s})`:""},T_=Object.fromEntries($n.map(e=>[e,e.toLowerCase()])),D_=e=>{const t=$n[Number.parseInt(e,10)-1]??e,s=T_[t]??e;return{month:t,localeKey:s}};function h1(e){return e.groupHierarchy??e.rowGroupingHierarchy}var A_=class extends E{constructor(){super(...arguments),this.beanName="groupHierarchyColSvc",this.columns=null,this.sourceColumnMap=new WeakMap,this.inverseColumnMap=new WeakMap}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.filter(s=>!e.list.some(i=>i.getColId()===s.getColId())).concat(e.list),e.tree=t.tree.filter(s=>!e.tree.some(i=>i.getId()===s.getId())).concat(e.tree),Mn(e))}createColumns(e){const t=new WeakMap,s=new WeakMap,i=this.createGroupHierarchyColumns(e,t,s);if(Pn(i,this.columns?.list??[]))return;os(this.beans,this.columns?.tree),this.columns=null;const{colGroupSvc:o}=this.beans,n=o?.findDepth(e.tree)??0,a=o?.balanceTreeForAutoCols(i,n)??[];this.columns={list:i,tree:a,treeDepth:n,map:{}},this.sourceColumnMap=t,this.inverseColumnMap=s}updateColumns(e){}getColumn(e){return this.columns?.list.find(t=>oi(t,e))??null}getColumns(){return this.columns?.list??null}expandColumnInto(e,t){const s=this.getVirtualColumnsForColumn(t).concat(t);for(const i of s)e.some(r=>oi(r,i)||r.getColId()===i.getColId())||e.push(i)}compareVirtualColumns(e,t){const s=this.inverseColumnMap.get(e),i=this.inverseColumnMap.get(t);if(s&&s===i){const r=this.sourceColumnMap.get(s)??[];return r?.indexOf(e)-r?.indexOf(t)}return this.sourceColumnMap.get(e)?.includes(t)?1:this.sourceColumnMap.get(t)?.includes(e)?-1:null}insertVirtualColumnsForCol(e,t){const s=this.getVirtualColumnsForColumn(t);if(!s)return[];let i=e.indexOf(t);return i<0&&(i=e.length-1),za(e,s),e.splice(i,0,...s),s}getVirtualColumnsForColumn(e){return this.isGroupHierarchyColsEnabledForCol(e)?this.sourceColumnMap.get(e)??[]:[]}isGroupHierarchyColsEnabled(e){return e.list.some(t=>this.isGroupHierarchyColsEnabledForCol(t))}isGroupHierarchyColsEnabledForCol(e){const t=e.getColDef();return!!(h1(t)&&(t.rowGroup||t.enableRowGroup||t.rowGroupIndex!=null||t.pivot||t.enablePivot||t.pivotIndex!=null))}createGroupHierarchyColDefs(e){const t=[],s=e.getColDef(),i=h1(s);if(!i||!this.isGroupHierarchyColsEnabledForCol(e))return t;for(const r of i){let o=null;typeof r=="string"?o=this.createColDefForPart(r,e,s):o=r,o&&t.push(o)}return t}createGroupHierarchyColumns(e,t,s){if(!this.isGroupHierarchyColsEnabled(e))return[];const i=[];for(const r of e.list)for(const o of this.createGroupHierarchyColDefs(r)){const n=o.colId;this.gos.validateColDef(o,n,!0);const a=new is(o,null,n,!0);this.createBean(a),i.push(a),I_(t,r,a),s.set(a,r)}return i}createColDefForPart(e,t,s){const{beans:i,gos:r}=this,o=`${rC}-${t.getColId()}-${e}`,n={enableRowGroup:s.enableRowGroup,rowGroup:s.rowGroup,enablePivot:s.enablePivot,hide:!0,editable:!1},a=r.get("groupHierarchyConfig")??{};if(e in a){const u={...n,...a[e]};return u.colId??(u.colId=o),Mi(i,u,u.colId,!0)}const l=Mi(i,{colId:o,...n},o,!0),c=this.getLocaleTextFunc(),d=(u,h)=>c?.(u,h)??h;switch(e){case"year":return{...l,headerValueGetter:tr(i,t,d(e,"Year")),valueGetter:er(i,t,0)};case"quarter":return{...l,headerValueGetter:tr(i,t,d(e,"Quarter")),valueGetter:er(i,t,1,u=>(Math.floor(Number(u)/4)+1).toString())};case"month":return{...l,headerValueGetter:tr(i,t,d(e,"Month")),valueGetter:er(i,t,1)};case"formattedMonth":return{...l,headerValueGetter:tr(i,t,d("month","Month")),valueGetter:er(i,t,1,u=>{const h=D_(u);return d(h.localeKey,h.month)})};case"day":return{...l,headerValueGetter:tr(i,t,d(e,"Day")),valueGetter:er(i,t,2)};case"hour":return{...l,headerValueGetter:tr(i,t,d(e,"Hour")),valueGetter:er(i,t,3)};case"minute":return{...l,headerValueGetter:tr(i,t,d(e,"Minute")),valueGetter:er(i,t,4)};case"second":return{...l,headerValueGetter:tr(i,t,d(e,"Second")),valueGetter:er(i,t,5)};default:return null}}};function I_(e,t,s){const i=e.get(t);e.set(t,(i??[]).concat(s))}var k_={moduleName:"GroupHierarchy",version:Y,beans:[A_],dependsOn:[jp]},L_=class extends A{constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel());const e=this.onRowGroupChanged.bind(this);this.addManagedEventListeners({columnRowGroupChanged:e,newColumnsLoaded:e}),this.addManagedPropertyListener("rowGroupPanelShow",e),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){const e=re({tag:"div",cls:"ag-column-drop-wrapper",role:"presentation"}),t=new y0(!0);this.rowGroupComp=this.createManagedBean(t);const s=new S0(!0);this.pivotComp=this.createManagedBean(s),e.appendChild(t.getGui()),e.appendChild(s.getGui());const i=this.onDropPanelVisible.bind(this);return this.addManagedListeners(t,{displayChanged:i}),this.addManagedListeners(s,{displayChanged:i}),this.onDropPanelVisible(),e}onDropPanelVisible(){const{rowGroupComp:e,pivotComp:t}=this,s=e.isDisplayed()&&t.isDisplayed(),i="ag-column-drop-horizontal-half-width";e.toggleCss(i,s),t.toggleCss(i,s)}onRowGroupChanged(){const e=this.rowGroupComp;if(!e)return;const t=this.gos.get("rowGroupPanelShow");if(t==="always")e.setDisplayed(!0);else if(t==="onlyWhenGrouping"){const s=this.beans.rowGroupColsSvc?.columns?.length!==0;e.setDisplayed(s)}else e.setDisplayed(!1)}onPivotPanelShow(){const e=this.pivotComp;if(!e)return;const t=this.gos.get("pivotPanelShow");if(t==="always")e.setDisplayed(!0);else if(t==="onlyWhenPivoting"){const s=this.beans.colModel.isPivotActive();e.setDisplayed(s)}else e.setDisplayed(!1)}getFocusableContainers(){return[this.rowGroupComp,this.pivotComp].filter(e=>!!e)}},G_={selector:"AG-GRID-HEADER-DROP-ZONES",component:L_};function O_(e){return e.buttons&&(e.buttons=[]),e}var V_={tag:"div",cls:"ag-group-filter",children:[{tag:"div",ref:"eGroupField"},{tag:"div",ref:"eUnderlyingFilter"}]},B_=class extends Pr{constructor(){super(V_),this.filterType="group",this.eGroupField=x,this.eUnderlyingFilter=x}wireBeans(e){this.groupFilterSvc=e.groupFilter}postConstruct(){this.initialiseTabGuard({})}init(e){return this.params=e,this.updateParams().then(()=>{this.addHandlerListeners(this.updateGroups.bind(this))})}refresh(e){const t=e;return this.params=t,t.source==="colDef"&&this.updateParams(),!0}updateParams(){return this.validateParams(),this.updateGroups()}validateParams(){const{colDef:e}=this.params;e.field&&F(234),e.filterValueGetter&&F(235),e.filterParams&&F(236)}addHandlerListeners(e){const t=this.addManagedListeners(this.getHandler(),{sourceColumnsChanged:()=>{this.updateGroups()},destroyed:()=>{for(const s of t)s();this.addHandlerListeners(e)}})}updateGroups(){const{sourceColumns:e,selectedColumn:t}=this.updateGroupField();return this.dispatchLocalEvent({type:"columnsChanged"}),this.getUnderlyingFilters(e,t)}updateGroupField(){this.groupColumn=this.params.column;const e=this.getHandler();if(!e)return{sourceColumns:null};const{sourceColumns:t,hasMultipleColumns:s,selectedColumn:i}=e,r=this.eGroupField;return ee(r),this.eGroupFieldSelect&&this.destroyBean(this.eGroupFieldSelect),s&&t&&(this.createGroupFieldSelectElement(t,i),r.appendChild(this.eGroupFieldSelect.getGui()),r.appendChild(re({tag:"div",cls:"ag-filter-separator"}))),V(r,s),{sourceColumns:t,selectedColumn:i}}createGroupFieldSelectElement(e,t){const s=this.createManagedBean(new Ct);this.eGroupFieldSelect=s;const i=this.getLocaleTextFunc();s.setLabel(i("groupFilterSelect","Select field:")),s.setLabelAlignment("top"),s.addOptions(e.map(r=>({value:r.getColId(),text:this.beans.colNames.getDisplayNameForColumn(r,"groupFilter",!1)??void 0}))),s.setValue(t.getColId()),s.onValueChange(r=>this.updateSelectedColumn(r)),s.addCss("ag-group-filter-field-select-wrapper"),e.length===1&&s.setDisabled(!0)}getUnderlyingFilters(e,t){if(!e)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,$.resolve();const s=[],i=[],r=this.beans.colFilter;for(const o of e){const n=r.getOrCreateFilterUi(o);n&&s.push(n.then(a=>{a&&i.push({filter:a,column:o}),o.getColId()===t.getColId()&&(this.selectedFilter=a??void 0)}))}return $.all(s).then(()=>{this.filterColumnPairs=i})}addUnderlyingFilterElement(e){if(ee(this.eUnderlyingFilter),!e)return $.resolve();const t=this.createManagedBean(new To(e,"COLUMN_MENU"));return this.filterComp=t,t.hasFilter()?(this.eUnderlyingFilter.appendChild(t.getGui()),t.getFilter()?.then(()=>{t.afterGuiAttached?.(this.afterGuiAttachedParams),!this.afterGuiAttachedParams?.suppressFocus&&this.eGroupFieldSelect&&!this.eGroupFieldSelect.isDisabled()&&this.eGroupFieldSelect.getFocusableElement().focus()})??$.resolve()):$.resolve()}updateSelectedColumn(e){if(!e)return;this.filterComp?.afterGuiDetached(),this.destroyBean(this.filterComp);const t=this.getFilterColumnPair(e),s=t?.column;this.selectedFilter=t?.filter,this.getHandler().setSelectedColumn(s),this.dispatchLocalEvent({type:"columnsChanged"}),this.addUnderlyingFilterElement(s)}isFilterActive(){return this.groupFilterSvc.isFilterActive(this.groupColumn)}doesFilterPass(){return!0}getModel(){return null}setModel(){}afterGuiAttached(e){this.afterGuiAttachedParams=e,this.addUnderlyingFilterElement(this.getHandler().selectedColumn)}afterGuiDetached(){ee(this.eUnderlyingFilter),this.selectedFilter?.afterGuiDetached?.()}getSelectedColumn(){return this.getHandler().selectedColumn}getHandler(){return this.params.getHandler()}getFilterColumnPair(e){if(e)return this.filterColumnPairs?.find(({column:t})=>t.getColId()===e)}},N_=class extends E{init(e){this.params=e,this.validateModel(e),this.updateColumns(),this.addManagedEventListeners({columnRowGroupChanged:this.updateColumns.bind(this),filterDestroyed:t=>this.onFilterDestroyed(t)})}refresh(e){this.params=e,this.validateModel(e),e.source==="colDef"&&this.updateColumns()}doesFilterPass(){return!0}setSelectedColumn(e){this.selectedColumn=e,this.dispatchLocalEvent({type:"selectedColumnChanged"})}validateModel(e){e.model!=null&&e.onModelChange(null)}getSourceColumns(){const e=this.params.column;if(this.gos.get("treeData"))return F(237),[];const t=this.beans.groupFilter.getSourceColumns(e);return t||(F(183),[])}updateColumns(){const e=this.getSourceColumns(),t=e.filter(r=>r.isFilterAllowed());this.sourceColumns=t;let s,i;t.length?e.length===1?(s=t[0],i=!1):(s=this.selectedColumn,(!s||!t.some(r=>r.getId()===s.getId()))&&(s=t[0]),i=!0):(s=void 0,i=!1),this.selectedColumn=s,this.hasMultipleColumns=i,this.dispatchLocalEvent({type:"sourceColumnsChanged"})}onFilterDestroyed({column:e,source:t}){if(t==="gridDestroyed")return;const s=e.getColId();this.sourceColumns?.some(i=>i.getColId()===s)&&setTimeout(()=>{this.isAlive()&&this.updateColumns()})}},H_=class extends E{constructor(){super(...arguments),this.beanName="groupFilter"}postConstruct(){this.addManagedEventListeners({columnRowGroupChanged:()=>this.updateFilterFlags("columnRowGroupChanged")})}isGroupFilter(e){return e.getColDef().filter==="agGroupColumnFilter"}isFilterAllowed(e){const t=this.beans.colFilter;return!!this.getSourceColumns(e)?.some(s=>t?.isFilterAllowed(s))}isFilterActive(e){const t=this.beans.colFilter;return!!this.getSourceColumns(e)?.some(s=>t?.isFilterActive(s))}getSourceColumns(e){return this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(e)}updateFilterFlags(e,t){const{autoColSvc:s,colFilter:i}=this.beans;s?.getColumns()?.forEach(r=>{this.isGroupFilter(r)&&i?.setColFilterActive(r,this.isFilterActive(r),e,t)})}},z_={tag:"div",ref:"eFloatingFilter",cls:"ag-group-floating-filter ag-floating-filter-input",role:"presentation"},__=class extends A{constructor(){super(z_),this.eFloatingFilter=x,this.haveAddedColumnListeners=!1}init(e){this.params=e;const t=Sn(this.gos),s=this.onColChange.bind(this),i=r=>{t?this.setupUnderlyingFloatingFilterElement().then(()=>r()):(this.setupReadOnlyFloatingFilterElement(),r())};return this.gos.get("enableFilterHandlers")?new $(r=>i(r)).then(()=>{this.addHandlerListeners(e,s)}):new $(r=>{this.params.parentFilterInstance(o=>{this.parentFilterInstance=o,i(r)})}).then(()=>{this.addManagedListeners(this.parentFilterInstance,{columnsChanged:s})})}refresh(e){if(this.params=e,this.setParams(),this.gos.get("enableFilterHandlers"))if(this.showingUnderlyingFloatingFilter){const t=this.getSelectedColumn(),s=this.beans.colFilter.getFloatingFilterCompDetails(t,this.params.showParentFilter);this.underlyingFloatingFilter?.refresh?.(s?.params)}else this.updateDisplayedValue()}setParams(){const e=this.beans.colNames.getDisplayNameForColumn(this.params.column,"header",!0),t=this.getLocaleTextFunc();this.eFloatingFilterText?.setInputAriaLabel(`${e} ${t("ariaFilterInput","Filter Input")}`)}addHandlerListeners(e,t){const s=this.addManagedListeners(e.getHandler(),{selectedColumnChanged:t,sourceColumnsChanged:t,destroyed:()=>{for(const i of s)i();this.addHandlerListeners(this.params,t)}})}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new ct),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,ee(this.eFloatingFilter);const e=this.getSelectedColumn();if(e&&!e.isVisible()){const t=this.beans.colFilter,s=t.getFloatingFilterCompDetails(e,this.params.showParentFilter);if(s)return this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListeners(e,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)})),s.newAgStackInstance().then(i=>{this.underlyingFloatingFilter=i,this.underlyingFloatingFilter?.onParentModelChanged(t.getModelForColumn(e)),this.appendChild(i.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),$.resolve()}getSelectedColumn(){return this.gos.get("enableFilterHandlers")?this.params.getHandler().selectedColumn:this.parentFilterInstance.getSelectedColumn()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(e){if(!e.column)return;const t=this.beans.colFilter.getFloatingFilterCompDetails(e.column,this.params.showParentFilter);t&&this.underlyingFloatingFilter?.refresh?.(t.params)}onParentModelChanged(e,t){this.showingUnderlyingFloatingFilter?this.underlyingFloatingFilter?.onParentModelChanged(this.beans.colFilter.getModelForColumn(this.getSelectedColumn()),t):this.updateDisplayedValue()}updateDisplayedValue(){const e=this.eFloatingFilterText;if(!e)return;const t=this.beans.colFilter,s=this.getSelectedColumn(),i=r=>{if(!r)e.setValue(""),e.setDisplayed(!1);else{const o=s?t.getModelForColumn(s):null;e.setValue(o==null?"":r.getModelAsString?.(o)??""),e.setDisplayed(!0)}};s?this.gos.get("enableFilterHandlers")?i(t.getHandler(s)):t.getOrCreateFilterUi(s)?.then(r=>{i(r)}):i()}onColChange(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}},W_=(e,t)=>{if(!e){t.length=0;return}const s=e.length;t.length=s;for(let i=0;i{const s=e.length;if(s!==t?.length)return!0;for(let i=0;i0){s=!0;break}return s?(e.sort(g1),!0):!1}function g1(e,t){const s=e.sourceRowIndex,i=t.sourceRowIndex,r=s>=0,o=i>=0,n=r&&o,a=!r&&!o;return n?s-i:a?e.__objectId-t.__objectId:r?1:-1}var K_=class extends E{constructor(){super(...arguments),this.groupCols=[],this.nonLeafsById=new Map,this.checkGroupCols=!0,this.pivotMode=!1,this.groupEmpty=!1}invalidateGroupCols(){this.checkGroupCols=!0}destroy(){super.destroy(),this.groupCols.length=0,this.nonLeafsById.clear()}clearNonLeafs(){const e=this.nonLeafsById;for(const t of e.values())t._destroy(!1);e.clear()}loadGroupData(e){if(!e.group)return e._groupData=null,null;const t=e.rowGroupColumn,{valueSvc:s,showRowGroupCols:i}=this.beans,r={};if(e._groupData=r,!t)return r;const o=Gi(e),n=t.getId();if(!i)return r;const a=i.columns;for(let l=0,c=a.length;l{const i=s.childrenAfterGroup,r=i?.length;if(!r)return;const o=new Array(r);let n=0,a=!1,l;for(let c=0;c1)}}if(r.size)for(const l of r){this.insertOneNode(e,l);const c=l.parent;t?.addRow(c),o||(o=(c?.childrenAfterGroup?.length??0)>1)}a.size&&(p1(a),this.removeEmptyGroups(a,n)),o&&this.sortChildren(e,t)}sortChildren(e,t){Mt(e,!0,void 0,s=>{$_(s.childrenAfterGroup)&&t?.addRow(s)})}orderGroups(e){const t=this.gos.getCallback("initialGroupOrderComparator");if(!t)return;const s=this.beans,i=s.gridApi,r=s.gridOptions.context,o=(a,l)=>t({api:i,context:r,nodeA:a,nodeB:l}),n=a=>{const l=a.childrenAfterGroup,c=l?.length;if(!(!c||a.leafGroup)){c>1&&l.sort(o);for(let d=0,u=c;d=0;--a){const{col:l}=n[a];let c=s.getKeyForNode(l,t);if(c==null||c===""){if(!i)continue;c=""}if(!r?.parent||r.key!==c){o=!0;break}r=r.parent}return o||(o=!!r?.parent),o?(this.removeFromParent(t),this.insertOneNode(e,t),t.setData(t.data),!0):!1}groupShouldBeRemoved(e){const t=this.getChildrenMappedKey(e.key,e.rowGroupColumn),s=e.parent?.childrenMapped;return(s?!s[t]:!0)?!1:!!e.group&&(e.childrenAfterGroup?.length??0)===0}removeEmptyGroups(e,t){const s=this.beans.selectionSvc;let i;const r=Array.from(e),o=this.nonLeafsById;do{e.clear();for(let n=0;n=a-1,f=this.createGroup(s,c,u,g,p,t);this.addToParent(f,s),s=f}s.group||F(184,{parentGroupData:s.data,childNodeData:t.data}),t.parent=s,t.level=s.level+1,s.childrenAfterGroup.push(t),s.updateHasChildren(),ld(s)}createGroup(e,t,s,i,r,o){const n=t.col,a=(e.level>=0?e.id+"-":"row-group-")+(n.getColId()+"-"+s),l=this.nonLeafsById;let c=l.get(a),d=!0;if(c){if(c.childrenAfterGroup!==null)return c._expanded??(c._expanded=null),c;d=!1,ld(c)}else c=new lt(this.beans),c.group=!0,c.key=s,c.id=a,c.aggData=null,l.set(a,c);const u=f=>{f.childrenAfterGroup=h,f.childrenMapped=g,f.parent=e,f.level=i,f.rowGroupIndex=i,f.leafGroup=r},h=[],g={};if(u(c),c.field=t.field??null,c.rowGroupColumn=n,c.groupValue=this.beans.valueSvc.getValue(n,o,"data"),c._expanded??(c._expanded=null),d)return c.setAllChildrenCount(0),c.updateHasChildren(),c;const p=c.sibling;return p&&u(p),c.dispatchRowEvent("hasChildrenChanged"),c}getChildrenMappedKey(e,t){return t?t.getId()+"-"+e:e}onShowRowGroupColsSetChanged(){const{rowModel:e,valueSvc:t}=this.beans;for(const i of this.nonLeafsById.values()){i._groupData=void 0;const r=i.rowGroupColumn,o=r&&Gi(i);i.groupValue=o&&t.getValue(r,o,"data")}const s=e.rootNode?._leafs;if(s)for(let i=0,r=s.length;i{for(const t of e){const s=t?.childrenAfterGroup;if(!s)continue;const i=s.length;let r=0;for(let o=0;o{for(;e._leafs!==void 0;){const t=e.parent;if(!t)break;e._leafs=void 0,e=t}};function j_(e,t){e.rowGroupColsSvc?.setColumns(t,"api")}function q_(e,t){e.rowGroupColsSvc?.removeColumns(t,"api")}function Y_(e,t){e.rowGroupColsSvc?.addColumns(t,"api")}function X_(e,t,s){e.rowGroupColsSvc?.moveColumn?.(t,s,"api")}function Z_(e){return e.rowGroupColsSvc?.columns??[]}var Yp={moduleName:"SharedRowGrouping",version:Y,apiFunctions:{setRowGroupColumns:j_,removeRowGroupColumns:q_,addRowGroupColumns:Y_,getRowGroupColumns:Z_,moveRowGroupColumn:X_},dependsOn:[le,Up,d1,qp,k_]},Xp={moduleName:"RowGrouping",version:Y,dynamicBeans:{groupStrategy:K_},rowModels:["clientSide"],dependsOn:[Yp,$p,Ma,u1]},f1={moduleName:"RowGroupingPanel",version:Y,selectors:[G_],icons:{pivotPanel:"pivot",rowGroupPanel:"group",panelDelimiter:"small-right",panelDelimiterRtl:"small-left"},dependsOn:[Bp,$s]},m1={moduleName:"GroupFilter",version:Y,userComponents:{agGroupColumnFilter:{classImp:B_,processParams:O_},agGroupColumnFloatingFilter:__},beans:[H_],dynamicBeans:{agGroupColumnFilterHandler:N_},dependsOn:[le,Ps]},Q_=class extends E{constructor(){super(...arguments),this.beanName="rowModel",this.hierarchical=!1,this.firstRow=-1,this.lastRow=-1,this.rowCount=-1,this.rowNodesByIndex={},this.rootNode=null,this.viewportChangedContext=!1}ensureRowHeightsValid(e,t,s,i){return!1}postConstruct(){const e=this.beans,t=new lt(e);this.rootNode=t,t.level=-1,this.rowHeight=Et(e),this.addManagedEventListeners({viewportChanged:this.onViewportChanged.bind(this)}),this.addManagedPropertyListener("viewportDatasource",()=>this.updateDatasource()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=Et(e),this.updateRowHeights()})}start(){this.updateDatasource()}isLastRowIndexKnown(){return!0}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){const e=this.datasource;e&&(e.destroy?.(),this.beans.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)}updateDatasource(){const e=this.gos.get("viewportDatasource");e&&this.setViewportDatasource(e)}getPageSize(){return this.gos.get("viewportRowModelPageSize")}getBufferSize(){return this.gos.get("viewportRowModelBufferSize")}calculateFirstRow(e){const t=this.getBufferSize(),s=this.getPageSize(),i=e-t;return i<0?0:Math.floor(i/s)*s}calculateLastRow(e){if(e===-1)return e;const t=this.getBufferSize(),s=this.getPageSize(),i=e+t,r=Math.ceil(i/s)*s,o=this.rowCount-1;return Math.min(r,o)}onViewportChanged(e){const t=this.calculateFirstRow(e.firstRow),s=this.calculateLastRow(e.lastRow);(this.firstRow!==t||this.lastRow!==s)&&(this.firstRow=t,this.lastRow=s,this.purgeRowsNotInViewport(),this.viewportChangedContext=!0,this.datasource?.setViewportRange(this.firstRow,this.lastRow),this.viewportChangedContext=!1)}purgeRowsNotInViewport(){const e=this.rowNodesByIndex;for(const t of Object.keys(e)){const s=parseInt(t,10);if(sthis.lastRow){if(this.isRowFocused(s)||this.beans.editSvc?.isRowEditing(e[s]))continue;delete e[s]}}}isRowFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();return!t||t.rowPinned!=null?!1:t.rowIndex===e}setViewportDatasource(e){this.destroyDatasource(),this.datasource=e,this.rowCount=-1,e.init?e.init(N(this.gos,{setRowCount:this.setRowCount.bind(this),setRowData:this.setRowData.bind(this),getRow:this.getRow.bind(this)})):F(226)}getType(){return"viewport"}getRow(e){return this.rowNodesByIndex[e]||(this.rowNodesByIndex[e]=this.createBlankRowNode(e)),this.rowNodesByIndex[e]}getRowNode(e){let t;return this.forEachNode(s=>{s.id===e&&(t=s)}),t}getRowCount(){return this.rowCount===-1?0:this.rowCount}getRowIndexAtPixel(e){return this.rowHeight!==0?Math.floor(e/this.rowHeight):0}resetRowHeights(){}onRowHeightChanged(){}getRowBounds(e){const t=this.rowHeight;return{rowHeight:t,rowTop:t*e}}updateRowHeights(){const e=this.rowHeight;this.forEachNode(t=>{t.setRowHeight(e),t.setRowTop(e*t.rowIndex)}),this.eventSvc.dispatchEvent({type:"modelUpdated",newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1})}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}isEmpty(){return this.rowCount>0}getOverlayType(){return null}isRowsToRender(){return this.rowCount>0}getNodesInRangeForSelection(e,t){const s=e.rowIndex,i=t.rowIndex,r=sthis.lastRow,o=ithis.lastRow;if(r||o)return[];const n=[],a=s<=i?s:i,l=s<=i?i:s;for(let c=a;c<=l;c++)n.push(this.rowNodesByIndex[c]);return n}forEachNode(e){let t=0;for(const s of Object.keys(this.rowNodesByIndex)){const i=parseInt(s,10),r=this.rowNodesByIndex[i];e(r,t),t++}}setRowData(e){const t=Is(this.beans.gos),s=new Map;if(t)for(const i of Object.values(this.rowNodesByIndex))s.set(i.id,i);for(let i=this.firstRow;i<=this.lastRow;i++){const r=e[i];if(!r)continue;let o,n;t?(o=t({data:r,rowPinned:void 0,level:0,parentKeys:void 0}),n=s.get(o)):n=this.rowNodesByIndex[i],n?(n.updateData(r),n.setRowIndex(i),n.setRowTop(this.rowHeight*i)):(n=this.createBlankRowNode(i),n.setDataAndId(r,o??i.toString())),this.rowNodesByIndex[i]=n}this.viewportChangedContext||this.eventSvc.dispatchEvent({type:"modelUpdated",newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1})}createBlankRowNode(e){const t=new lt(this.beans),s=this.rowHeight;return t.setRowHeight(s),t.setRowTop(s*e),t.setRowIndex(e),t}setRowCount(e,t=!1){if(e===this.rowCount)return;this.rowCount=e;const s=this.eventSvc;s.dispatchEventOnce({type:"rowCountReady"}),s.dispatchEvent({type:"modelUpdated",newData:!1,newPage:!1,keepRenderedRows:t,animate:!1})}isRowPresent(e){return!!this.getRowNode(e.id)}},C1={moduleName:"ViewportRowModel",version:Y,rowModels:["viewport"],beans:[Q_],dependsOn:[le]};function J_(e,t){e.clipboardSvc?.copyToClipboard(t)}function eW(e,t){e.clipboardSvc?.cutToClipboard(t)}function tW(e,t){e.clipboardSvc?.copySelectedRowsToClipboard(t)}function sW(e,t){e.clipboardSvc?.copySelectedRangeToClipboard(t)}function iW(e){e.clipboardSvc?.copyRangeDown()}function rW(e){e.clipboardSvc?.pasteFromClipboard()}var cd="paste",Zp="dragCopy",Qp="clipboard";function oW(e,t=","){const s=[],i=o=>o==="\r"||o===` `;let r=!1;if(e==="")return[[""]];for(let o=0,n=0,a=0;a{s[o]||(s[o]=[]),s[o][n]||(s[o][n]="")};if(u(),c==='"'&&(r?d==='"'?(s[o][n]+='"',a++):r=!1:(l===void 0||l===t||i(l))&&(r=!0)),!r&&c!=='"'){if(c===t){n++,u();continue}else if(i(c)){n=0,o++,u(),c==="\r"&&d===` `&&a++;continue}}s[o][n]+=c}return s}var nW=class extends E{constructor(){super(...arguments),this.beanName="clipboardSvc",this.clientSideRowModel=null,this.gridCtrl=null,this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}postConstruct(){const{gos:e,rowModel:t,ctrlsSvc:s}=this.beans;ae(e,t)&&(this.clientSideRowModel=t),s.whenReady(this,i=>{this.gridCtrl=i.gridCtrl})}destroy(){super.destroy(),this.clientSideRowModel=null,this.gridCtrl=null}pasteFromClipboard(){!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard?.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(t=>{F(40,{e:t,method:"readText"}),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()}):this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let e=!1;const t=s=>{const i=Date.now();i-this.lastPasteOperationTime<50&&(e=!0,s.preventDefault()),this.lastPasteOperationTime=i};this.executeOnTempElement(s=>{s.addEventListener("paste",t),s.focus({preventScroll:!0})},s=>{const i=s.value;e?this.refocusLastFocusedCell():this.processClipboardData(i),s.removeEventListener("paste",t)})}refocusLastFocusedCell(){const{focusSvc:e}=this.beans,t=e.getFocusedCell();t&&e.setFocusedCell({rowIndex:t.rowIndex,column:t.column,rowPinned:t.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){const e=this.gos.get("clipboardDelimiter");return D(e)?e:" "}processClipboardData(e){if(e==null)return;let t=oW(e,this.getClipboardDelimiter());const s=this.gos.getCallback("processDataFromClipboard");if(s&&(t=s({data:t})),t==null)return;this.gos.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(t);const{rangeSvc:i,editSvc:r}=this.beans,o=(n,a,l,c)=>{i?.isMoreThanOneCell()&&!this.hasOnlyOneValueToPaste(t)?this.pasteIntoActiveRange(t,n,a,c):this.pasteStartingFromFocusedCell(t,n,a,l,c),r?.stopEditing(void 0,{source:cd})};this.doPasteOperation(o)}doPasteOperation(e){const t="clipboard",{eventSvc:s,focusSvc:i,rowRenderer:r,gos:o}=this.beans;s.dispatchEvent({type:"pasteStart",source:t});const{clientSideRowModel:n}=this,a=n?.rootNode,l=a&&this.beans.changedPathFactory?.newPath(o.get("aggregateOnlyChangedColumns")),c={},d=[],u=i.getFocusedCell();e(c,d,u,l);const h=d.slice();l&&(n.doAggregate(l),Mt(a,n.hierarchical,l,g=>{h.push(g)})),r.refreshCells({rowNodes:h}),this.dispatchFlashCells(c),this.fireRowChanged(d),this.refocusLastFocusedCell(),s.dispatchEvent({type:"pasteEnd",source:t})}getPreProcessRangeCallback(e){return t=>{const{rangeSvc:s}=this.beans;if(!s)return;const{rowDiff:i,colDiff:r}=this.getAdjustedRangeDimensionForPaste(t,e);i!==0&&s.extendRangeRowCountBy(t,i),r!==0&&s.extendRangeColumnCountBy(t,r)}}getAdjustedRangeDimensionForPaste(e,t){const s=this.beans.rangeSvc,i=t.length,r=s.getRangeRowCount(e),o=r>=i&&r%i===0,n=t[0].length,a=e.columns.length,l=a>=n&&a%n===0;return{rowDiff:o?0:i-r,colDiff:l?0:n-a}}pasteIntoActiveRange(e,t,s,i){let r=0,o=0;const n=(a,l,c,d)=>{if(d-r>=e.length){if(d%e.length!==0)return;r+=o,o=0}const h=e[d-r];s.push(l);const g=this.gos.getCallback("processCellFromClipboard"),p=c.columns,f=p.findIndex(Gs);f!==-1&&p.splice(f,1);for(let m=0;m=h.length&&(v=m%h.length);const w=this.processCell(l,C,h[v],Zp,g,!0);l.setDataValue(C,w,cd),i?.addCell(l.parent,C.getId());const{rowIndex:S,rowPinned:y}=a,R=ai({rowIndex:S,column:C,rowPinned:y});t[R]=!0}o++};this.iterateActiveRanges(n,!1,this.getPreProcessRangeCallback(e))}getDisplayedColumnsStartingAt(e){let t=e;const s=[],{visibleCols:i}=this.beans;for(;t&&yr(t);)t=i.getColAfter(t);for(;t!=null;)s.push(t),t=i.getColAfter(t);return s}pasteStartingFromFocusedCell(e,t,s,i,r){if(!i)return;const o={rowIndex:i.rowIndex,rowPinned:i.rowPinned},n=this.getDisplayedColumnsStartingAt(i.column);this.isPasteSingleValueIntoRange(e)?this.pasteSingleValueIntoRange(e,s,t,r):this.pasteMultipleValues(e,o,s,n,t,Qp,r)}isPasteSingleValueIntoRange(e){const t=this.beans.rangeSvc;return this.hasOnlyOneValueToPaste(e)&&!!t&&!t.isEmpty()}pasteSingleValueIntoRange(e,t,s,i){const r=e[0][0],o=(n,a,l)=>{t.push(a),l.columns.forEach(c=>this.updateCellValue(a,c,r,s,Qp,i))};this.iterateActiveRanges(o)}hasOnlyOneValueToPaste(e){return e.length===1&&e[0].length===1}copyRangeDown(){const{rangeSvc:e,gos:t,formula:s,valueSvc:i}=this.beans;if(!e||e.isEmpty())return;const r=[],o=(n,a,l,c)=>{const d=t.getCallback("processCellForClipboard"),u=t.getCallback("processCellFromClipboard"),h=(g,p,f)=>{const{columns:m}=f;r.length?(a.push(p),m.forEach((C,v)=>{if(!C.isCellEditable(p)||C.isSuppressPaste(p))return;C.isAllowFormula()&&s?.isFormula(r[v])&&(r[v]=s?.updateFormulaByOffset({value:r[v],rowDelta:1}));const S=this.processCell(p,C,r[v],Zp,u,!0);p.setDataValue(C,S,cd),c?.addCell(p.parent,C.getId());const{rowIndex:y,rowPinned:R}=g,P=ai({rowIndex:y,column:C,rowPinned:R});n[P]=!0})):m.forEach(C=>{const v=this.processCell(p,C,i.getValue(C,p,"batch"),Zp,d,!1,!0);r.push(v)})};this.iterateActiveRanges(h,!0)};this.doPasteOperation(o)}removeLastLineIfBlank(e){const t=W(e);if(t&&t.length===1&&t[0]===""){if(e.length===1)return;De(e,t)}}fireRowChanged(e){if(this.gos.get("editType")==="fullRow")for(const t of e)this.eventSvc.dispatchEvent({type:"rowValueChanged",node:t,data:t.data,rowIndex:t.rowIndex,rowPinned:t.rowPinned})}shouldSkipPasteRow(e,t,s){if(e.detail||e.footer)return!0;if(s&&e.group){for(const i of t)if(i.isCellEditable(e))return!1;return!0}return!1}pasteMultipleValues(e,t,s,i,r,o,n){let a=t;const l=this.beans,{gos:c}=l,d=this.clientSideRowModel!=null&&!c.get("enableGroupEdit")&&!c.get("treeData"),u=()=>{for(;a;){const h=Ve(l,a);if(a=Je(l,{rowPinned:a.rowPinned,rowIndex:a.rowIndex}),h!=null&&!this.shouldSkipPasteRow(h,i,d))return h}return null};for(const h of e){const g=u();g&&(h.forEach((p,f)=>this.updateCellValue(g,i[f],p,r,o,n)),s.push(g))}}updateCellValue(e,t,s,i,r,o){if(!e||!t?.isCellEditable(e)||t?.isSuppressPaste(e))return;const n=this.processCell(e,t,s,r,this.gos.getCallback("processCellFromClipboard"),!0);e.setDataValue(t,n,cd);const{rowIndex:a,rowPinned:l}=e,c=ai({rowIndex:a,column:t,rowPinned:l});i[c]=!0,o?.addCell(e.parent,t.getId())}copyToClipboard(e={}){this.copyOrCutToClipboard(e)}cutToClipboard(e={},t="api"){this.gos.get("suppressCutToClipboard")||(this.eventSvc.dispatchEvent({type:"cutStart",source:t}),this.copyOrCutToClipboard(e,!0),this.eventSvc.dispatchEvent({type:"cutEnd",source:t}))}copyOrCutToClipboard(e,t){let{includeHeaders:s,includeGroupHeaders:i}=e;const{gos:r,focusSvc:o}=this.beans;s==null&&(s=r.get("copyHeadersToClipboard")),i==null&&(i=r.get("copyGroupHeadersToClipboard"));const n={includeHeaders:s,includeGroupHeaders:i},a=r.get("rowSelection"),l=r.get("cellSelection");let c=null;this.shouldCopyCells(l,a)?(this.copySelectedRangeToClipboard(n),c=0):this.shouldCopyRows(a)?(this.copySelectedRowsToClipboard(n),c=1):o.isAnyCellFocused()&&(this.copyFocusedCellToClipboard(n),c=2),t&&c!==null&&this.clearCellsAfterCopy(c)}shouldCopyCells(e,t){const{rangeSvc:s,selectionSvc:i,gos:r}=this.beans;if(!s||s.isEmpty())return!1;if(e)return!(typeof t=="object"&&t.copySelectedRows&&!i?.isEmpty());{const o=r.get("suppressCopySingleCellRanges");return!(!s.isMoreThanOneCell()&&o)}}shouldCopyRows(e){const{selectionSvc:t,gos:s}=this.beans;return t?.isEmpty()??!0?!1:e&&typeof e!="string"?e.copySelectedRows??!1:!s.get("suppressCopyRowsToClipboard")}clearCellsAfterCopy(e){const t=this.beans,{rangeSvc:s,focusSvc:i,eventSvc:r}=t;if(r.dispatchEvent({type:"keyShortcutChangedCellStart"}),e===0)s.clearCellRangeCellValues({cellEventSource:"clipboardSvc"});else if(e===1)this.clearSelectedRows();else{const o=i.getFocusedCell();if(o==null)return;const n=Ve(t,o);n&&this.clearCellValue(n,o.column)}r.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){const{selectionSvc:e,visibleCols:t}=this.beans,s=e?.getSelectedNodes()??[],i=t.allCols;for(const r of s)for(const o of i)this.clearCellValue(r,o)}clearCellValue(e,t){if(!t.isCellEditable(e))return;const s=this.beans.valueSvc.getDeleteValue(t,e);e.setDataValue(t,s,"clipboardSvc")}iterateActiveRanges(e,t,s){const i=this.beans.rangeSvc;if(!i||i.isEmpty())return;const r=i.getCellRanges(),o=t?[r[0]]:r;for(const n of o)this.iterateActiveRange({cellRange:n,rowCallback:e,preProcessRange:s})}iterateActiveRange(e){const{cellRange:t,preProcessRange:s,rowCallback:i}=e,{beans:r}=this,{rangeSvc:o}=r;if(!o)return;s&&s(t);let n=o.getRangeStartRow(t);const a=o.getRangeEndRow(t);let l=0,c=!1;for(;!c&&n!=null;){const d=Ve(r,n);c=ve(n,a),i(n,d,t,l++),n=Je(r,n)}}copySelectedRangeToClipboard(e={}){const t=this.beans.rangeSvc;if(!t||t.isEmpty())return;const s=t.areAllRangesAbleToMerge(),{data:i,cellsToFlash:r}=s?this.buildDataFromMergedRanges(t,e):this.buildDataFromRanges(t,e);this.copyDataToClipboard(i),this.dispatchFlashCells(r)}buildDataFromMergedRanges(e,t){const s=new Set,i=e.getCellRanges(),r=new Map,o=[],n={},a=ae(this.gos,this.beans.rowModel),l=new Set;a||this.beans.rowModel.forEachNode(h=>{l.add(h.rowIndex)});for(const h of i){h.columns.forEach(f=>s.add(f));const{rowPositions:g,cellsToFlash:p}=this.getRangeRowPositionsAndCellsToFlash(e,h);for(const f of g){const m=l.has(f.rowIndex);if(!a&&!m)continue;const C=`${f.rowIndex}-${f.rowPinned||"null"}`;r.get(C)||(r.set(C,!0),o.push(f))}Object.assign(n,p)}const c=this.beans.visibleCols.allCols,d=Array.from(s);return d.sort((h,g)=>{const p=c.indexOf(h),f=c.indexOf(g);return p-f}),{data:this.buildExportParams({columns:d,rowPositions:o,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:n}}buildDataFromRanges(e,t){const s=e.getCellRanges(),i=[],r={};for(const o of s){const{rowPositions:n,cellsToFlash:a}=this.getRangeRowPositionsAndCellsToFlash(e,o);Object.assign(r,a),i.push(this.buildExportParams({columns:o.columns,rowPositions:n,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))}return{data:i.join(` `),cellsToFlash:r}}getRangeRowPositionsAndCellsToFlash(e,t){const s=[],i={},r=e.getRangeStartRow(t),o=e.getRangeEndRow(t);let n=r;for(;n;){s.push(n);for(const a of t.columns){const{rowIndex:l,rowPinned:c}=n,d=ai({rowIndex:l,column:a,rowPinned:c});i[d]=!0}if(ve(n,o))break;n=Je(this.beans,n)}return{rowPositions:s,cellsToFlash:i}}getCellsToFlashFromRowNodes(e){const t=this.beans.visibleCols.allCols,s={};for(let i=0;i{const{value:u,valueFormatted:h}=this.beans.valueSvc.getValueForDisplay({column:d,node:c,includeValueFormatted:!0,from:"batch"}),g=h??u??"",p=o.getCallback("processCellForClipboard");return p?p({column:d,node:c,value:g,type:Qp,formatValue:f=>this.beans.valueSvc.formatValue(d,c,f)??f,parseValue:f=>this.beans.valueSvc.parseValue(d,c,f,u)??f}):g},l={columnKeys:t,rowPositions:s,skipColumnHeaders:!i,skipColumnGroupHeaders:!r,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!s,valueFrom:"batch",processCellCallback:o.getCallback("processCellForClipboard"),processRowGroupCallback:a,processHeaderCallback:o.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:o.getCallback("processGroupHeaderForClipboard")};return n.getDataAsCsv(l,!0)}dispatchFlashCells(e){window.setTimeout(()=>{this.eventSvc.dispatchEvent({type:"flashCells",cells:e})},0)}processCell(e,t,s,i,r,o,n){const{valueSvc:a,formula:l}=this.beans;return r?r({column:t,node:e,value:s,type:i,formatValue:d=>a.formatValue(t,e??null,d)??d,parseValue:d=>a.parseValue(t,e??null,d,a.getValue(t,e,"edit"))}):o&&t.getColDef().useValueParserForImport!==!1?a.parseValue(t,e??null,s,a.getValue(t,e,"edit")):n&&t.getColDef().useValueFormatterForExport!==!1?l?.isFormula(s)?s:a.formatValue(t,e??null,s)??s:s}copyDataToClipboard(e){const t=this.gos.getCallback("sendToClipboard");if(t){t({data:e});return}if(!this.gos.get("suppressClipboardApi")&&navigator.clipboard){navigator.clipboard.writeText(e).catch(i=>{F(40,{e:i,method:"writeText"}),this.copyDataToClipboardLegacy(e)});return}this.copyDataToClipboardLegacy(e)}copyDataToClipboardLegacy(e){this.executeOnTempElement(t=>{const s=me(this.beans),i=ie(this.beans);t.value=e||" ",t.select(),t.focus({preventScroll:!0}),s.execCommand("copy")||F(41),i?.focus!=null&&i.focus({preventScroll:!0})})}executeOnTempElement(e,t){if(!this.gridCtrl)return;const s=me(this.beans),i=s.createElement("textarea"),r=i.style;r.width="1px",r.height="1px";const o=s.documentElement;r.top=o.scrollTop+"px",r.left=o.scrollLeft+"px",r.position="absolute",r.opacity="0",this.gridCtrl.getGui().appendChild(i);try{e(i)}catch{F(42)}t?window.setTimeout(()=>{t(i),i.remove()},100):i.remove()}},v1={moduleName:"Clipboard",version:Y,beans:[nW],apiFunctions:{copyToClipboard:J_,cutToClipboard:eW,copySelectedRowsToClipboard:tW,copySelectedRangeToClipboard:sW,copySelectedRangeDown:iW,pasteFromClipboard:rW},dependsOn:[le,hg,ta,Yg]},aW='.ag-row-number-cell{background-color:var(--ag-header-background-color);border:none;color:var(--ag-header-text-color);font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;width:100%}:where(.ag-ltr) .ag-row-number-cell{text-align:right}:where(.ag-rtl) .ag-row-number-cell{text-align:left}.ag-row-numbers-resizer{bottom:-2px;cursor:ns-resize;height:4px;position:absolute;width:100%}:where(.ag-ltr) .ag-row-numbers-resizer{left:0}:where(.ag-rtl) .ag-row-numbers-resizer{right:0}.ag-floating-bottom .ag-row-numbers-resizer{bottom:unset;top:-2px}:where(.ag-row-number-header.ag-row-number-selection-enabled){cursor:cell}.ag-row-number-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-row-number-range-selected{background-color:var(--ag-row-numbers-selected-color)}:where(.ag-ltr){.ag-row-number-header,:where(.ag-cell.ag-row-number-cell):not(.ag-cell-last-left-pinned){border-right:var(--ag-pinned-column-border)}:where(.ag-cell.ag-row-number-cell.ag-row-number-selection-enabled){cursor:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjUiPjxwYXRoIGQ9Ik0zLjQ0NSA4LjkxMVY3LjQwOUg5Ljc1VjYuMDE0bDIuNTM1IDIuMTQ2LTIuNTM1IDIuMTQ2VjguOTExeiIgc3R5bGU9InN0cm9rZTojZmZmO3N0cm9rZS13aWR0aDouNDFweCIgdHJhbnNmb3JtPSJtYXRyaXgoMS41Nzg0IDAgMCAxLjg2NDI5IC00LjQxMyAtNy4yMTIpIi8+PC9zdmc+"),auto}}:where(.ag-rtl){.ag-row-number-header,:where(.ag-cell.ag-row-number-cell):not(.ag-cell-first-right-pinned){border-left:var(--ag-pinned-column-border)}:where(.ag-cell.ag-row-number-cell.ag-row-number-selection-enabled){cursor:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjUiPjxwYXRoIGQ9Ik01Ljk3OSA4LjkxMXYxLjM5NUwzLjQ0NSA4LjE2bDIuNTM0LTIuMTQ2djEuMzk1aDYuMzA2djEuNTAyeiIgc3R5bGU9InN0cm9rZTojZmZmO3N0cm9rZS13aWR0aDouNDFweCIgdHJhbnNmb3JtPSJtYXRyaXgoMS41Nzg0IDAgMCAxLjg2NDI5IC00LjQxMyAtNy4yMTIpIi8+PC9zdmc+"),auto}}',lW={tag:"div",cls:"ag-row-numbers-resizer"},cW=class extends A{constructor(e){super(lW),this.cellCtrl=e,this.initialYPosition=-1,this.dragging=!1}postConstruct(){const{beans:e,cellCtrl:t}=this,{dragSvc:s,environment:i}=e;this.defaultRowHeight=i.getDefaultRowHeight(),s.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:this.onDragging.bind(this),onDragStop:this.onDragStop.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:!0,stopPropagationForTouch:!0});const r=t.getRowPosition();this.node=Ve(this.beans,r)}onDragStart(e){if(!this.node)return;const{beans:{ctrlsSvc:t,eventSvc:s}}=this;t.get("gridCtrl").setResizeCursor(Ju.Vertical),this.dragging=!0,this.initialHeight=this.node.rowHeight,s.dispatchEvent({type:"rowResizeStarted",node:this.node,event:e,rowHeight:this.initialHeight})}onDragging(e){let{clientY:t}=e;if(this.cellCtrl.rowNode.rowPinned==="bottom"&&(t*=-1),this.initialYPosition===-1||!this.dragging){this.initialYPosition=t;return}const{beans:s,initialHeight:i,initialYPosition:r,defaultRowHeight:o,node:n}=this;if(i==null)return;const a=n?.rowHeight,l=Math.max(i-(r-t),o);if(a===l)return;n?.setRowHeight(l);const{rowRenderer:c,rowModel:d,pinnedRowModel:u}=s,h=!!n?.rowPinned;h&&c.redraw({afterScroll:!0}),(!h||u?.isManual())&&d.onRowHeightChanged({animate:!1})}onDragStop(e){this.beans.eventSvc.dispatchEvent({type:"rowResizeEnded",node:this.node,event:e,rowHeight:this.node?.rowHeight}),this.clearDragDetails(!0)}onDragCancel(){this.clearDragDetails(!0)}clearDragDetails(e){this.initialYPosition=-1,this.initialHeight=null,this.dragging=!1,e&&this.beans.ctrlsSvc.get("gridCtrl").setResizeCursor(!1)}destroy(){this.clearDragDetails(!1),this.node=void 0,super.destroy()}};function w1(e){const t=si(e);return!(!t||typeof t!="object"||!t.enableRowResizer)}var dW=class{constructor(e,t){this.beans=e,this.cellCtrl=t}refreshRowResizer(){!w1(this.beans)||!this.isRowResizeSupported(this.cellCtrl.rowNode)?this.removeRowResizerFromCellComp():this.addResizerToCellComp()}isRowResizeSupported(e){const{pinnedRowModel:t,rowModel:s,visibleCols:i}=this.beans,r=!!s.onRowHeightChanged;return i.autoHeightCols.length?(F(276),!1):e.rowPinned!=null?t?.isManual()?r:!0:r}addResizerToCellComp(){const{beans:e,cellCtrl:t}=this;let{rowResizer:s}=this;if(!s){if(s=e.registry.createDynamicBean("rowNumberRowResizer",!1,t),!s)return;this.rowResizer=e.context.createBean(s)}t.comp.setRowResizerElement(s.getGui())}removeRowResizerFromCellComp(){const{rowResizer:e,beans:{context:t},cellCtrl:s}=this;e&&(s.comp?.setRowResizerElement(null),this.rowResizer=t.destroyBean(e))}destroy(){this.removeRowResizerFromCellComp()}},uW=class extends E{constructor(){super(...arguments),this.beanName="rowNumbersSvc",this.isIntegratedWithSelection=!1,this.lastColumnResized=0}postConstruct(){const e=Ce(this,this.refreshCells.bind(this),10);this.addManagedEventListeners({columnResized:()=>{this.lastColumnResized=Date.now()},cellFocused:this.onGridCellFocused.bind(this),modelUpdated:t=>{e(!1,!t.keepRenderedRows)},rangeSelectionChanged:()=>this.refreshCells(!0),pinnedRowsChanged:()=>e(!1,!0)}),this.addManagedPropertyListeners(["rowNumbers","cellSelection"],t=>{this.updateColumns(t)}),this.refreshSelectionIntegration(),this.registerRangeSelectionExtension()}shouldSkipColumn(e){return si(this.beans)&&Fe(e)}isAllColumnsSelectionCell(e){return si(this.beans)&&Fe(e.column)}isAllColumnsRange(e,t){return!si(this.beans)||t.length===0?!1:e.columns.length===t.length&&t.every(s=>e.columns.includes(s))}registerRangeSelectionExtension(){const e=this.beans.rangeSvc;e&&(e.registerRangeSelectionExtension(this),this.addDestroyFunc(()=>e.unregisterRangeSelectionExtension?.(this)))}addColumns(e){this.columns!=null&&(e.list=this.columns.list.concat(e.list),e.tree=this.columns.tree.concat(e.tree),Mn(e))}createColumns(e,t){const s=()=>{os(this.beans,this.columns?.tree),this.columns=null},{beans:i}=this;if(!si(i)){s();return}const r=e.treeDepth,n=(this.columns?.treeDepth??-1)==r,a=this.generateRowNumberCols();if(Pn(a,this.columns?.list??[])&&n)return;s();const{colGroupSvc:c}=this.beans,d=c?.findDepth(e.tree)??0,u=c?.balanceTreeForAutoCols(a,d)??[];this.columns={list:a,tree:u,treeDepth:d,map:{}},t(g=>{if(!g)return null;const p=g.filter(f=>!Fe(f));return[...a,...p]})}handleMouseDownOnCell(e,t){return!this.isIntegratedWithSelection||t.target.classList.contains("ag-row-numbers-resizer")?(this.beans.rangeSvc&&t.preventDefault(),t.stopImmediatePropagation(),!1):(!t.shiftKey&&!ml(this.beans,t)&&this.focusFirstRenderedCellAtRowPosition(e),!0)}handleKeyDownOnCell(e,t){return this.isIntegratedWithSelection&&t.key===b.ENTER?(this.selectRowCells(e,t),t.preventDefault(),!0):!1}selectRowCells(e,t){const{rangeSvc:s}=this.beans;s&&s.handleCellKeyboardSelect(t,e)}updateColumns(e){const t=Os(e.source);this.refreshSelectionIntegration();for(const s of this.columns?.list??[]){const i=this.createRowNumbersColDef();s.setColDef(i,null,t),qe(this.beans,{state:[Sl(i,s.getColId())]},t)}}getColumn(){return this.columns?.list.find(Fe)??null}getColumns(){return this.columns?.list??null}setupForHeader(e){const{column:t,eGridHeader:s}=e.params;Fe(t)&&(de(s,"Row Number"),this.addManagedElementListeners(s,{click:this.onHeaderClick.bind(this),keydown:this.onHeaderKeyDown.bind(this),focus:this.onHeaderFocus.bind(this)}))}onGridCellFocused(e){if(!this.isIntegratedWithSelection||e.rowIndex==null||!e.column||!Fe(e.column))return;const s=this.getLocaleTextFunc()("ariaSelectAllRowCells","Press Enter to select all cells on this row");this.beans.ariaAnnounce?.announceValue(s,"ariaSelectAllRowCells")}createRowNumbersRowResizerFeature(e){if(w1(this.beans))return new dW(this.beans,e)}refreshSelectionIntegration(){const{beans:e}=this,{gos:t,rangeSvc:s}=e,i=t.get("cellSelection");this.refreshRowNumberOverrides(),this.isIntegratedWithSelection=!!s&&!!i&&!this.isSuppressCellSelectionIntegration}refreshRowNumberOverrides(){const e=si(this.beans);if(this.rowNumberOverrides={},this.isSuppressCellSelectionIntegration=!1,!e||typeof e!="object")return;e.suppressCellSelectionIntegration&&(this.isSuppressCellSelectionIntegration=!0);const t=["contextMenuItems","context","onCellClicked","onCellContextMenu","onCellDoubleClicked","headerTooltip","headerStyle","headerComponent","headerComponentParams","suppressHeaderKeyboardEvent","suppressNavigable","tooltipField","tooltipValueGetter","tooltipComponent","tooltipComponentParams","tooltipComponentSelector","valueGetter","valueFormatter","width","maxWidth","minWidth","resizable","cellRenderer","cellRendererSelector","cellRendererParams"];for(const s of t)e[s]!=null&&(this.rowNumberOverrides[s]=e[s])}onHeaderFocus(){if(!this.isIntegratedWithSelection)return;const t=this.getLocaleTextFunc()("ariaSelectAllCells","Press Space or Enter to select all cells");this.beans.ariaAnnounce?.announceValue(t,"ariaSelectAllCells")}onHeaderKeyDown(e){!this.isIntegratedWithSelection||e.key!==b.SPACE&&e.key!==b.ENTER||(e.preventDefault(),this.selectAllCellsFromHeader())}onHeaderClick(e){Date.now()-this.lastColumnResized<100||!this.isIntegratedWithSelection||this.getColumn()?.resizing||this.focusAllCellsFromHeaderClick()}selectAllCellsFromHeader(){rh(this.beans)}focusAllCellsFromHeaderClick(){this.selectAllCellsFromHeader(),this.focusFirstRenderedCellAtRowPosition()}refreshCells(e,t){const s=this.getColumn();if(s){if(t){const i=this.beans.autoWidthCalc?.getPreferredWidthForElements([this.createDummyElement(s)],2);i!=null&&this.beans.colResize?.setColumnWidths([{key:s,newWidth:i}],!1,!0,"rowNumbersService")}this.beans.rowRenderer.refreshCells({columns:[s],force:e})}}createDummyElement(e){const t=re({tag:"div",cls:"ag-cell-value ag-cell"});let s=String(this.beans.rowModel.getRowCount()+1);if(typeof this.rowNumberOverrides.valueFormatter=="function"){const i=N(this.beans.gos,{data:void 0,value:s,node:null,column:e,colDef:e.colDef});s=this.rowNumberOverrides.valueFormatter(i)}return t.textContent=s,t}createRowNumbersColDef(){const{gos:e,contextMenuSvc:t}=this.beans,s=e.get("enableRtl");return{minWidth:60,width:60,resizable:!1,valueGetter:this.valueGetter.bind(this),contextMenuItems:this.isIntegratedWithSelection||!t?void 0:()=>[],...this.rowNumberOverrides,colId:En,chartDataType:"excluded",suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPinned:!0,pinned:s?"right":"left",lockPosition:s?"right":"left",editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,suppressSizeToFit:!0,suppressHeaderContextMenu:!0,headerClass:this.getHeaderClass(),cellClass:this.getCellClass.bind(this),cellAriaRole:"rowheader"}}valueGetter(e){const t=e.node,s=this.beans.formula?.active,i=t?.pinnedSibling;if(t?.rowPinned&&i){const r=s?i.formulaRowIndex:i.rowIndex;return`${r==null?"-":r+1}`}return String(((s?t?.formulaRowIndex:t?.rowIndex)||0)+1)}getHeaderClass(){const e=["ag-row-number-header"];return this.isIntegratedWithSelection&&e.push("ag-row-number-selection-enabled"),e}getCellClass(e){const{beans:t}=this,{rangeSvc:s,gos:i}=t,{node:r}=e,o=["ag-row-number-cell"],n=i.get("cellSelection");if(!s||!n)return o;this.isIntegratedWithSelection&&o.push("ag-row-number-selection-enabled");const a=s.getCellRanges();if(!a.length)return o;const l=this.beans.visibleCols.allCols.length-1,c=typeof n=="object"&&n.enableHeaderHighlight;for(const d of a)s.isRowInRange({rowIndex:r.rowIndex,rowPinned:r.rowPinned},d)&&(c&&o.push("ag-row-number-range-highlight"),d.columns.length===l&&o.push("ag-row-number-range-selected"));return o}generateRowNumberCols(){const{gos:e,beans:t}=this;if(!si(t))return[];const s=this.createRowNumbersColDef(),i=s.colId;e.validateColDef(s,i,!0);const r=new is(s,null,i,!1);return this.createBean(r),[r]}focusFirstRenderedCellAtRowPosition(e){const t=this.beans.editSvc;if(t?.isEditing()&&t.isRangeSelectionEnabledWhileEditing?.()||!e&&(e=Fr(this.beans),!e))return;const{beans:s,gos:i}=this,{visibleCols:r,colViewport:o}=s,n=i.get("enableRtl")?r.rightCols:r.leftCols;let a;if(n.length==1){const u=Ve(s,e);if(!u)return;a=o.getColsWithinViewport(u)}else a=n;const l=a.find(u=>!Fe(u));if(!l)return;const{rowPinned:c,rowIndex:d}=e;setTimeout(()=>{s.focusSvc.setFocusedCell({rowIndex:d,rowPinned:c,column:l,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})})}destroy(){os(this.beans,this.columns?.tree),this.rowNumberOverrides=null,super.destroy()}},Jp={moduleName:"RowNumbers",version:Y,beans:[uW],dynamicBeans:{rowNumberRowResizer:cW},dependsOn:[le,Qg,Oi],css:[aW]},hW={tag:"div",cls:"ag-filter-toolpanel-search",role:"presentation",children:[{tag:"div",ref:"eExpand",cls:"ag-filter-toolpanel-expand"},{tag:"ag-input-text-field",ref:"eFilterTextField",cls:"ag-filter-toolpanel-search-input"}]},gW=class extends A{constructor(){super(...arguments),this.eExpand=x,this.eFilterTextField=x}postConstruct(){this.setTemplate(hW,[Vt]);const e=this.getLocaleTextFunc();this.eFilterTextField.setAutoComplete(!1).setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")).onValueChange(this.onSearchTextChanged.bind(this)),this.createExpandIcons(),this.setExpandState(0),this.addManagedElementListeners(this.eExpand,{click:this.onExpandClicked.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)})}init(e){this.params=e,this.beans.colModel.ready&&this.showOrHideOptions()}createExpandIcons(){const{eExpand:e,beans:t}=this;e.appendChild(this.eExpandChecked=_("accordionOpen",t)),e.appendChild(this.eExpandUnchecked=_("accordionClosed",t)),e.appendChild(this.eExpandIndeterminate=_("accordionIndeterminate",t))}showOrHideOptions(){const{params:e,eFilterTextField:t}=this,s=!e.suppressFilterSearch,i=!e.suppressExpandAll,r=this.getLocaleTextFunc();t.setInputPlaceholder(r("searchOoo","Search..."));const o=a=>a.getOriginalParent()&&a.isFilterAllowed(),n=this.beans.colModel.getCols().some(o);V(t.getGui(),s),V(this.eExpand,i&&n)}onSearchTextChanged(){this.onSearchTextChangedDebounced||(this.onSearchTextChangedDebounced=Ce(this,()=>this.dispatchLocalEvent({type:"searchChanged",searchText:this.eFilterTextField.getValue()}),300)),this.onSearchTextChangedDebounced()}onExpandClicked(){const e=this.currentExpandState===0?{type:"collapseAll"}:{type:"expandAll"};this.dispatchLocalEvent(e)}setExpandState(e){this.currentExpandState=e,V(this.eExpandChecked,e===0),V(this.eExpandUnchecked,e===1),V(this.eExpandIndeterminate,e===2)}},pW={selector:"AG-FILTERS-TOOL-PANEL-HEADER",component:gW},fW={tag:"div",cls:"ag-filter-toolpanel-instance",children:[{tag:"div",ref:"eFilterToolPanelHeader",cls:"ag-filter-toolpanel-header ag-filter-toolpanel-instance-header",role:"button",attrs:{"aria-expanded":"false"},children:[{tag:"div",ref:"eExpand",cls:"ag-filter-toolpanel-expand"},{tag:"span",ref:"eFilterName",cls:"ag-header-cell-text"},{tag:"span",ref:"eFilterIcon",cls:"ag-header-icon ag-filter-icon ag-filter-toolpanel-instance-header-icon"}]},{tag:"div",ref:"agFilterToolPanelBody",cls:"ag-filter-toolpanel-instance-body ag-filter"}]},b1=class extends A{constructor(e,t){super(fW),this.hideHeader=e,this.expandedCallback=t,this.eFilterToolPanelHeader=x,this.eFilterName=x,this.agFilterToolPanelBody=x,this.eFilterIcon=x,this.eExpand=x,this.expanded=!1}postConstruct(){const{beans:e,eExpand:t,eFilterIcon:s}=this,i=_("accordionOpen",e);this.eExpandChecked=i;const r=_("accordionClosed",e);this.eExpandUnchecked=r,t.appendChild(i),t.appendChild(r);const o=this.getLocaleTextFunc();de(s,o("ariaFilterActive","Filter Active")),Ie(s,"img")}setColumn(e){this.column=e;const{beans:t,eFilterToolPanelHeader:s,eFilterIcon:i,eExpandChecked:r,hideHeader:o}=this;this.eFilterName.innerText=t.colNames.getDisplayNameForColumn(e,"filterToolPanel",!1)||"",this.addManagedListeners(s,{click:this.toggleExpanded.bind(this),keydown:this.onKeyDown.bind(this)}),this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)}),this.addInIcon("filterActive",i,e),V(i,this.isFilterActive()),V(r,!1),o?(V(s,!1),s.removeAttribute("tabindex")):s.setAttribute("tabindex","0"),this.addManagedListeners(e,{filterChanged:this.onFilterChanged.bind(this)})}onKeyDown(e){const{key:t}=e,{ENTER:s,SPACE:i,LEFT:r,RIGHT:o}=b;t!==s&&t!==i&&t!==r&&t!==o||(e.preventDefault(),t===s||t===i?this.toggleExpanded():t===b.LEFT?this.collapse():this.expand())}getColumn(){return this.column}getColumnFilterName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"filterToolPanel",!1)}addCssClassToTitleBar(e){this.eFilterToolPanelHeader.classList.add(e)}addInIcon(e,t,s){if(t==null)return;const i=_(e,this.beans,s);t.appendChild(i)}isFilterActive(){return!!this.beans.colFilter?.isFilterActive(this.column)}onFilterChanged(){V(this.eFilterIcon,this.isFilterActive()),this.dispatchLocalEvent({type:"filterChanged"})}toggleExpanded(){this.expanded?this.collapse():this.expand()}expand(){this.expanded||(this.expanded=!0,ot(this.eFilterToolPanelHeader,!0),V(this.eExpandChecked,!0),V(this.eExpandUnchecked,!1),this.addFilterElement(),this.expandedCallback())}addFilterElement(e){const t=re({tag:"div",cls:"ag-filter-toolpanel-instance-filter"}),s=this.createManagedBean(new To(this.column,"TOOLBAR"));this.filterComp=s,s.hasFilter()&&s.getFilter()?.then(i=>{this.underlyingFilter=i,i&&(t.appendChild(s.getGui()),this.agFilterToolPanelBody.appendChild(t),s.afterGuiAttached({container:"toolPanel",suppressFocus:e}))})}collapse(){if(!this.expanded)return;this.expanded=!1,ot(this.eFilterToolPanelHeader,!1),this.removeFilterElement(),V(this.eExpandChecked,!1),V(this.eExpandUnchecked,!0);const e=this.filterComp;e?.afterGuiDetached(),this.destroyBean(e),this.expandedCallback()}removeFilterElement(){ee(this.agFilterToolPanelBody)}isExpanded(){return this.expanded}onPanelHidden(){if(!this.expanded)return;const e=this.underlyingFilter;e&&e.afterGuiDetached?.()}onFilterOpened(e){e.source==="COLUMN_MENU"&&e.column===this.column&&this.expanded&&this.collapse()}},sr=class extends A{constructor(e,t,s,i,r){super(),this.columnGroup=e,this.childFilterComps=t,this.expandedCallback=s,this.depth=i,this.showingColumn=r,this.filterGroupComp=x}postConstruct(){const e={cssIdentifier:"filter-toolpanel",direction:"vertical"};this.setTemplate({tag:"div",cls:"ag-filter-toolpanel-group-wrapper",children:[{tag:"ag-group-component",ref:"filterGroupComp"}]},[Se],{filterGroupComp:e}),this.setGroupTitle();const{filterGroupComp:t,depth:s,childFilterComps:i,gos:r}=this;t.setAlignItems("stretch"),t.addCss(`ag-filter-toolpanel-group-level-${s}`),t.getGui().style.setProperty("--ag-indentation-level",String(s)),t.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${s}-header`);for(const n of i)t.addItem(n),n.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${s+1}-header`),n.getGui().style.setProperty("--ag-indentation-level",String(s+1));const o=this.showingColumn?this.columnGroup:void 0;this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getLocation:()=>"filterToolPanelColumnGroup",shouldDisplayTooltip:na(r,()=>t.getGui().querySelector(".ag-group-title")),getAdditionalParams:()=>({colDef:o?.getColDef(),column:o})})),this.refreshFilterClass(),this.addExpandCollapseListeners(),this.addFilterChangedListeners(),this.setupTooltip(),this.addInIcon("filterActive")}setupTooltip(){if(!this.showingColumn)return;const e=()=>{this.tooltipFeature?.setTooltipAndRefresh(this.columnGroup.getColDef().headerTooltip)};e(),this.addManagedEventListeners({newColumnsLoaded:e})}addCssClassToTitleBar(e){this.filterGroupComp.addCssClassToTitleBar(e)}onPanelHidden(){for(const e of this.childFilterComps)e.onPanelHidden()}isColumnGroup(){return Re(this.columnGroup)}isExpanded(){return this.filterGroupComp.isExpanded()}getChildren(){return this.childFilterComps}getFilterGroupName(){return this.filterGroupName??""}getFilterGroupId(){return this.columnGroup.getId()}hideGroupItem(e,t){this.filterGroupComp.hideItem(e,t)}hideGroup(e){this.setDisplayed(!e)}addInIcon(e){const t=_(e,this.beans);if(t){t.classList.add("ag-filter-toolpanel-group-instance-header-icon");const s=this.getLocaleTextFunc();de(t,s("ariaFilterActive","Filter Active")),Ie(t,"img")}this.filterGroupComp.addTitleBarWidget(t)}forEachToolPanelFilterChild(e){for(const t of this.childFilterComps)t instanceof b1&&e(t)}addExpandCollapseListeners(){const e=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(s=>s.expand()),t=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(s=>s.collapse());this.addManagedListeners(this.filterGroupComp,{expanded:e,collapsed:t})}getColumns(){return Re(this.columnGroup)?this.columnGroup.getLeafColumns():[this.columnGroup]}addFilterChangedListeners(){for(const e of this.getColumns())this.addManagedListeners(e,{filterChanged:()=>this.refreshFilterClass()});Re(this.columnGroup)||this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)})}refreshFilterClass(){const e=this.getColumns(),t=()=>e.some(s=>s.isFilterActive());this.filterGroupComp.toggleCss("ag-has-filter",t())}onFilterOpened(e){e.source==="COLUMN_MENU"&&e.column===this.columnGroup&&this.isExpanded()&&this.collapse()}expand(){this.filterGroupComp.toggleGroupExpand(!0)}collapse(){this.filterGroupComp.toggleGroupExpand(!1)}setGroupTitle(){const e=this.columnGroup,t=Re(e)?this.getColumnGroupName(e):this.getColumnName(e);this.filterGroupName=t,this.filterGroupComp.setTitle(t||"")}getColumnGroupName(e){return this.beans.colNames.getDisplayNameForProvidedColumnGroup(null,e,"filterToolPanel")}getColumnName(e){return this.beans.colNames.getDisplayNameForColumn(e,"filterToolPanel",!1)}destroyFilters(){this.childFilterComps=this.destroyBeans(this.childFilterComps),ee(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},mW=class extends A{constructor(){super({tag:"div",cls:"ag-filter-list-panel"}),this.initialised=!1,this.hasLoadedInitialState=!1,this.isInitialState=!1,this.filterGroupComps=[],this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending=!1}wireBeans(e){this.colModel=e.colModel}init(e){this.initialised=!0;const t=N(this.gos,{suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});Oe(t,e),this.params=t,t.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:()=>this.onColumnsChanged()}),this.addManagedEventListeners({newColumnsLoaded:()=>this.onColumnsChanged(),toolPanelVisibleChanged:s=>{s.key==="filters"&&!s.visible&&this.onPanelHidden()},dragStarted:()=>{this.suppressOnColumnsChanged=!0},dragStopped:()=>{this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending&&(this.onColumnsChangedPending=!1,this.onColumnsChanged())}}),this.colModel.ready&&this.onColumnsChanged()}onColumnsChanged(){if(this.suppressOnColumnsChanged){this.onColumnsChangedPending=!0;return}const e=this.colModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.syncFilterLayout():this.buildTreeFromProvidedColumnDefs(),this.refreshAriaLabel()}syncFilterLayout(){s0(this.colModel,this.setFiltersLayout.bind(this)),this.refreshAriaLabel()}buildTreeFromProvidedColumnDefs(){const e=this.colModel.getColDefColTree();this.recreateFilters(e)}setFiltersLayout(e){const t=t0(this.colModel,e);this.recreateFilters(t)}recreateFilters(e){const t=ie(this.beans);this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const s=this.getExpansionState();this.destroyFilters();const i=this.recursivelyAddComps(e,0,s);this.filterGroupComps=i;const r=i.length;if(r){for(const n of i)this.appendChild(n);this.setFirstAndLastVisible(0,r-1)}const o=this.searchFilterText;D(o)&&this.searchFilters(o),this.fireExpandedEvent(),this.getGui().contains(t)&&t.focus(),this.isInitialState=!1,this.refreshAriaLabel()}recursivelyAddComps(e,t,s){return e.map(i=>{if(Re(i))return this.recursivelyAddFilterGroupComps(i,t,s)?.flatMap(l=>l)??[];const r=i;if(!this.shouldDisplayFilter(r))return[];const o=t===0,n=new b1(o,()=>this.onFilterExpanded());if(this.createBean(n),n.setColumn(r),s.get(r.getId())&&n.expand(),t>0)return n;const a=this.createBean(new sr(r,[n],this.onGroupExpanded.bind(this),t,!0));return a.addCssClassToTitleBar("ag-filter-toolpanel-header"),s.get(a.getFilterGroupId())||a.collapse(),a}).flatMap(i=>i)}refreshAriaLabel(){const e=this.getLocaleTextFunc(),t=e("ariaFilterPanelList","Filter List"),s=e("filters","Filters"),l=this.getGui().querySelectorAll(".ag-filter-toolpanel-group-item:not(.ag-filter-toolpanel-group-wrapper, .ag-hidden)").length;de(this.getAriaElement(),`${t} ${l} ${s}`)}recursivelyAddFilterGroupComps(e,t,s){if(!this.filtersExistInChildren(e.getChildren()))return;if(e.getColGroupDef()?.suppressFiltersToolPanel)return[];const r=e.isPadding()?t:t+1,o=this.recursivelyAddComps(e.getChildren(),r,s).flatMap(l=>l);if(e.isPadding())return o;const n=new sr(e,o,this.onGroupExpanded.bind(this),t,!1);this.createBean(n),n.addCssClassToTitleBar("ag-filter-toolpanel-header");const a=s.get(n.getFilterGroupId());return(this.isInitialState&&!a||a===!1)&&n.collapse(),[n]}filtersExistInChildren(e){return e.some(t=>Re(t)?this.filtersExistInChildren(t.getChildren()):this.shouldDisplayFilter(t))}shouldDisplayFilter(e){const t=e.getColDef()?.suppressFiltersToolPanel;return e.isFilterAllowed()&&!t}getExpansionState(){const e=new Map;if(this.isInitialState){const{expandedColIds:s,expandedGroupIds:i}=this.params.initialState;for(const r of s)e.set(r,!0);for(const r of i)e.set(r,!0);return e}const t=s=>{e.set(s.getFilterGroupId(),s.isExpanded());for(const i of s.getChildren())i instanceof sr?t(i):e.set(i.getColumn().getId(),i.isExpanded())};return this.filterGroupComps.forEach(t),e}refresh(){}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}expandFilterGroups(e,t){const s=[],i=r=>{const o=r.getFilterGroupId();(!t||t.includes(o))&&(e&&r.isColumnGroup()?r.expand():r.collapse(),s.push(o));for(const a of r.getChildren())a instanceof sr&&i(a)};if(this.filterGroupComps.forEach(i),this.onGroupExpanded(),t){const r=t.filter(o=>s.indexOf(o)<0);r.length>0&&F(166,{unrecognisedGroupIds:r})}}expandFilters(e,t){const s=[],i=r=>{if(r instanceof sr){let a=!1;for(const l of r.getChildren())i(l)&&(e?(r.expand(),a=!0):r.isColumnGroup()||r.collapse());return a}const o=r.getColumn().getColId(),n=!t||t.includes(o);return n&&(e?r.expand():r.collapse(),s.push(o)),n};if(this.filterGroupComps.forEach(i),this.onGroupExpanded(),t){const r=t.filter(o=>s.indexOf(o)<0);r.length>0&&F(167,{unrecognisedColIds:r})}}onGroupExpanded(){this.fireExpandedEvent()}onFilterExpanded(){this.dispatchLocalEvent({type:"filterExpanded"})}fireExpandedEvent(){let e=0,t=0;const s=r=>{if(r.isColumnGroup()){r.isExpanded()?e++:t++;for(const o of r.getChildren())o instanceof sr&&s(o)}};this.filterGroupComps.forEach(s);let i;e>0&&t>0?i=2:t>0?i=1:i=0,this.dispatchLocalEvent({type:"groupExpanded",state:i})}performFilterSearch(e){this.searchFilterText=D(e)?e.toLowerCase():null,this.searchFilters(this.searchFilterText)}searchFilters(e){const t=o=>!D(e)||o.toLowerCase().indexOf(e)!==-1,s=(o,n)=>{if(!(o instanceof sr))return t(o.getColumnFilterName()||"");const a=o.getChildren(),l=t(o.getFilterGroupName()),c=n||l;if(c){o.hideGroup(!1);for(let u=0;u{const g=s(u,n);o.hideGroupItem(!g,h),g&&(d=!0)}),o.hideGroup(!d),d};let i,r;this.filterGroupComps.forEach((o,n)=>{s(o,!1);const a=o.getGui()?.classList.contains("ag-hidden");i===void 0?a||(i=n,r=n):!a&&r!==n&&(r=n)}),this.setFirstAndLastVisible(i,r),this.refreshAriaLabel()}setFirstAndLastVisible(e,t){this.filterGroupComps.forEach((s,i)=>{s.removeCss("ag-first-group-visible"),s.removeCss("ag-last-group-visible"),i===e&&s.addCss("ag-first-group-visible"),i===t&&s.addCss("ag-last-group-visible")})}onPanelHidden(){for(const e of this.filterGroupComps)e.onPanelHidden()}getExpandedFiltersAndGroups(){const e=[],t=new Set,s=i=>{if(i instanceof sr){for(const o of i.getChildren())s(o);const r=i.getFilterGroupId();i.isExpanded()&&!t.has(r)&&e.push(r)}else i.isExpanded()&&t.add(i.getColumn().getColId())};return this.filterGroupComps.forEach(s),{expandedGroupIds:e,expandedColIds:Array.from(t)}}destroyFilters(){this.filterGroupComps=this.destroyBeans(this.filterGroupComps),ee(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},CW={selector:"AG-FILTERS-TOOL-PANEL-LIST",component:mW},vW=".ag-filter-toolpanel{flex:1 1 0px;min-width:0}.ag-filter-toolpanel-header,.ag-filter-toolpanel-search{align-items:center;color:var(--ag-header-text-color);display:flex;font-weight:var(--ag-header-font-weight);padding:0 var(--ag-spacing);>:where(.ag-filter-icon),>:where(.ag-filter-toolpanel-expand),>:where(.ag-filter-toolpanel-search-input),>:where(.ag-header-cell-text){align-items:center;display:flex}}.ag-filter-toolpanel-header{padding-bottom:var(--ag-spacing);padding-top:var(--ag-spacing);position:relative;&:focus-visible{border-radius:var(--ag-border-radius);box-shadow:inset var(--ag-focus-shadow)}}:where(.ag-ltr) .ag-filter-toolpanel-group-instance-header-icon,:where(.ag-ltr) .ag-filter-toolpanel-instance-header-icon{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-group-instance-header-icon,:where(.ag-rtl) .ag-filter-toolpanel-instance-header-icon{margin-right:var(--ag-spacing)}.ag-filter-toolpanel-search{min-height:var(--ag-header-height);padding-bottom:var(--ag-spacing);padding-top:var(--ag-widget-container-vertical-padding)}:where(.ag-filter-toolpanel-group:not(.ag-has-filter)>.ag-group-title-bar) .ag-filter-toolpanel-group-instance-header-icon{display:none}.ag-filter-toolpanel-search-input{flex-grow:1;height:calc(var(--ag-spacing)*4)}:where(.ag-ltr) .ag-filter-toolpanel-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-group-title-bar-icon{margin-left:var(--ag-spacing)}.ag-filter-toolpanel-expand{cursor:pointer}:where(.ag-ltr) .ag-filter-toolpanel-expand{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-expand{margin-left:var(--ag-spacing)}:where(.ag-ltr) .ag-filter-toolpanel-group-title-bar,:where(.ag-ltr) .ag-filter-toolpanel-instance-header{padding-left:calc(var(--ag-spacing) + var(--ag-filter-tool-panel-group-indent)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-filter-toolpanel-group-title-bar,:where(.ag-rtl) .ag-filter-toolpanel-instance-header{padding-right:calc(var(--ag-spacing) + var(--ag-filter-tool-panel-group-indent)*var(--ag-indentation-level))}:where(.ag-ltr) .ag-filter-toolpanel-instance-body{margin-left:var(--ag-filter-tool-panel-group-indent)}:where(.ag-rtl) .ag-filter-toolpanel-instance-body{margin-right:var(--ag-filter-tool-panel-group-indent)}.ag-filter-toolpanel-instance-filter{background-color:var(--ag-chrome-background-color)}.ag-filter-toolpanel-group-level-0{border-top:none}",wW={tag:"div",cls:"ag-filter-toolpanel",children:[{tag:"ag-filters-tool-panel-header",ref:"filtersToolPanelHeaderPanel"},{tag:"ag-filters-tool-panel-list",ref:"filtersToolPanelListPanel"}]},bW=class extends A{constructor(){super(wW,[pW,CW]),this.filtersToolPanelHeaderPanel=x,this.filtersToolPanelListPanel=x,this.initialised=!1,this.listenerDestroyFuncs=[],this.registerCSS(vW)}init(e){if(this.initialised){for(const a of this.listenerDestroyFuncs)a();this.listenerDestroyFuncs=[]}this.initialised=!0;const s={...{suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1},...e};this.params=s;const{filtersToolPanelHeaderPanel:i,filtersToolPanelListPanel:r}=this;i.init(s),r.init(s);const{suppressExpandAll:o,suppressFilterSearch:n}=s;o&&n&&i.setDisplayed(!1),this.listenerDestroyFuncs.push(...this.addManagedListeners(i,{expandAll:()=>r.expandFilterGroups(!0),collapseAll:()=>r.expandFilterGroups(!1),searchChanged:a=>r.performFilterSearch(a.searchText)}),...this.addManagedListeners(r,{filterExpanded:s.onStateUpdated,groupExpanded:a=>{i.setExpandState(a.state),s.onStateUpdated()}}))}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}setFilterLayout(e){this.filtersToolPanelListPanel.setFiltersLayout(e)}expandFilterGroups(e){this.filtersToolPanelListPanel.expandFilterGroups(!0,e)}collapseFilterGroups(e){this.filtersToolPanelListPanel.expandFilterGroups(!1,e)}expandFilters(e){this.filtersToolPanelListPanel.expandFilters(!0,e)}collapseFilters(e){this.filtersToolPanelListPanel.expandFilters(!1,e)}syncLayoutWithGrid(){this.filtersToolPanelListPanel.syncFilterLayout()}refresh(e){return this.init(e),!0}getState(){return this.filtersToolPanelListPanel.getExpandedFiltersAndGroups()}},SW=class extends E{constructor(){super(...arguments),this.beanName="filterPanelSvc",this.states=new Map,this.orderedStates=[],this.initialStateApplied=!1,this.columnsLoaded=!1,this.isActive=!1}postConstruct(){if(!this.gos.get("enableFilterHandlers"))return;const e=this.updateFilterStates.bind(this),t=()=>this.dispatchStatesUpdates(void 0,!0),s=this.onFilterDestroyed.bind(this);this.addManagedEventListeners({newColumnsLoaded:()=>{this.columnsLoaded=!0,this.initialStateApplied||this.applyState(),e()},dataTypesInferred:e,filterChanged:e,filterDestroyed:s,filterHandlerDestroyed:s,filterOpened:t,filterClosed:t});const i=({column:r})=>{this.states.get(r.getColId())?.refresh?.(),t()};this.addManagedListeners(this.beans.colFilter,{filterStateChanged:i,filterModelAsStringChanged:i})}updateParams(e,t){this.params=e;let s=!1;if(t&&(this.currState=t,this.columnsLoaded)){const i=new Set(t.filters?.map(r=>r.colId));for(const r of this.getIds())i.has(r)||this.remove(r);this.clear(),this.applyState(),this.updateFilterStates(),s=!0}s||this.dispatchStatesUpdates(),this.beans.colFilter?.setGlobalButtons(!!e.buttons?.length)}getIds(){return Array.from(this.states.keys())}getAvailable(){const e=this.beans,t=[];for(const s of e.colModel.getColDefCols()??[]){const i=s.getColId();s.isFilterAllowed()&&!s.colDef.suppressFiltersToolPanel&&!this.states.get(i)&&t.push({id:i,name:S1(e,s)})}return t}add(e){this.createFilter(e,!0),this.dispatchStatesUpdates(e)}remove(e){const{states:t,orderedStates:s,beans:{colFilter:i,selectableFilter:r}}=this,o=t.get(e);if(!o)return;o.destroy?.();const n=o.state.column;t.delete(e),r?.clearActive(e),i?.destroyFilter(n),this.eventSvc.dispatchEvent({type:"filterSwitched",column:n});const a=s.indexOf(e);s.splice(a,1);const l=s[a];this.dispatchStatesUpdates(l)}getState(e){return this.states.get(e)?.state}updateFilterState(e,t,s,i){const r=this.getState(e);r&&(r[t]=s,i||this.dispatchLocalEvent({type:"filterPanelStateChanged",id:e,state:r}))}expand(e,t){const s=this.states.get(e);if(!s)return;s.destroy?.();const{handler:i,state:{column:r}}=s,o=this.createFilterState(r,i,t);this.states.set(e,o),this.dispatchLocalEvent({type:"filterPanelStateChanged",id:e,state:o.state})}updateType(e,t){const s=this.states.get(e);if(!s)return;const i=s.state;if(i.expanded===!1)return;const r=i.filterDefs;if(!r)return;const{colFilter:o,selectableFilter:n}=this.beans;n?.setActive(e,r,t),o.filterParamsChanged(e,"columnFilter");const a=i.column;this.eventSvc.dispatchEvent({type:"filterSwitched",column:a});const l=this.states.get(e);if(!l)return;const c=l.state;this.dispatchLocalEvent({type:"filterPanelStateChanged",id:e,state:c})}getActions(){const e=this.params?.buttons;if(!e?.length)return;const t=!!this.beans.colFilter?.canApplyAll();return{actions:e,canApply:t}}doAction(e){this.beans.colFilter?.updateAllModels(e)}getGridState(){const e=[];return this.states.forEach((t,s)=>{e.push({colId:s,expanded:t.state.expanded})}),{filters:e}}createFilter(e,t){const s=this.createFilterStateWrapper(e,t);s&&(this.states.set(e,s),this.orderedStates.push(e))}createFilterStateWrapper(e,t){const{colModel:s,colFilter:i}=this.beans,r=s.getColDefCol(e);if(r&&!r.colDef.suppressFiltersToolPanel){const o=i.getHandler(r,!0);if(o)return this.createFilterState(r,o,t)}}updateFilterStates(){if(!this.params)return;const e=this.beans.colFilter.getModel(),t=new Set;for(const s of Object.keys(e)){const i=this.states.get(s);i?i.refresh?.():this.createFilter(s),t.add(s)}this.states.forEach((s,i)=>{t.has(i)||s.refresh?.()}),this.dispatchStatesUpdates()}createFilterState(e,t,s){const i=this.beans,{colFilter:r,selectableFilter:o}=i,n=S1(i,e),a=e.getColId(),l=()=>!!this.params?.buttons&&r.hasUnappliedModel(a),c=l();if(s){const d=e.colDef,{filterDefs:u,activeFilterDef:h}=o?.getDefs(e,d)??{},g=this.createBean(new To(e,"TOOLBAR",!0));return{state:{column:e,name:n,isEditing:c,expanded:s,detail:g.getGui(),activeFilterDef:h,filterDefs:u,afterGuiAttached:g.afterGuiAttached.bind(g),afterGuiDetached:g.afterGuiDetached.bind(g)},handler:t,refresh:()=>{this.updateFilterState(a,"isEditing",l())},destroy:()=>this.destroyBean(g)}}else{const d=e.getColId(),u=()=>t.getModelAsString?.(r.getStateForColumn(d).model,"filterToolPanel")??"";return{state:{column:e,name:n,isEditing:c,expanded:!1,summary:u()},handler:t,refresh:()=>{this.updateFilterState(d,"isEditing",l(),!0),this.updateFilterState(d,"summary",u())}}}}onFilterDestroyed({column:e,source:t}){const{colFilter:s,filterManager:i}=this.beans;if(!s?.isAlive()||!i?.isFilterAllowed(e))return;const r=this.states,o=e.getColId(),n=r.get(o);if(n){const a=this.createFilterStateWrapper(o,n.state.expanded);a?(n.destroy?.(),r.set(o,a)):this.remove(o),t==="api"&&this.dispatchStatesUpdates()}}dispatchStatesUpdates(e,t){this.dispatchLocalEvent({type:"filterPanelStatesChanged",activeId:e,action:t})}applyState(){if(this.params&&this.columnsLoaded){this.initialStateApplied=!0;for(const{colId:e,expanded:t}of this.currState?.filters??[])this.createFilter(e,t)}}destroy(){this.clear(),this.params=void 0,this.currState=void 0,super.destroy()}clear(){const{states:e,orderedStates:t}=this;e.forEach(s=>s.destroy?.()),e.clear(),t.length=0}};function S1(e,t){return e.colNames.getDisplayNameForColumn(t,"filterToolPanel")??t.getColId()}var yW={addFilterCard:"Add Filter",ariaLabelAddFilterField:"Add Filter Field",ariaLabelFilterCardDelete:"Delete Filter",ariaLabelFilterCardHasEdits:"Has Edits",agTextColumnFilterDisplayName:"Simple Filter",agNumberColumnFilterDisplayName:"Simple Filter",agDateColumnFilterDisplayName:"Simple Filter",agSetColumnFilterDisplayName:"Selection Filter",agMultiColumnFilterDisplayName:"Combo Filter",addFilterPlaceholder:"Search columns..."};function zo(e,t){return il(e,yW,t)}function xW(e,t,s){let i=0;for(let r=0;r{const{filter:S,filterParams:y,name:R,filterValueGetter:P=l.filterValueGetter}=w,M=g?{...g,...y}:y;let T;d&&u&&(S==="agMultiColumnFilter"?T=i.multiFilter?.getParamsForDataType(M,P,d,u):T=yc(S,M,P,d,u,i,this.getLocaleTextFunc()));let I;if(!R){let k=S;typeof S=="boolean"&&(k=n?.getDefaultFilterFromDataType(()=>c)),typeof k=="string"?I=zo(this,`${k}DisplayName`):(F(280,{colId:e.getColId()}),I="")}return g||T||I?{...w,filterParams:M,name:I??R,...T}:w},m=(h??this.getDefaultFilters(e)).map(f);let C=s??this.selectedFilters.get(e.getColId())??p??(!h&&nu(r)?1:0);C>=m.length&&(C=0);const v=m[C];return{filterDefs:m,activeFilterDef:v}}setActive(e,t,s,i){const r=t.indexOf(s);if(r<0)return;const{selectedFilters:o,valueGetters:n}=this;o.set(e,r);const a=s.filterValueGetter;a?n.set(e,a):n.delete(e),i||this.onChange()}clearActive(e){const{selectedFilters:t,valueGetters:s}=this;t.delete(e),s.delete(e),this.onChange()}getState(){return Object.fromEntries(this.selectedFilters)}setState(e){this.clearAll();const t=this.beans.colModel;for(const s of Object.keys(e)){const i=t.getColDefCol(s);if(i){const r=this.getDefs(i,i.colDef,e[s]);r&&this.setActive(s,r.filterDefs,r.activeFilterDef,!0)}}}destroy(){this.clearAll(),super.destroy()}clearAll(){const{selectedFilters:e,valueGetters:t}=this;e.clear(),t.clear()}onChange(){this.dispatchLocalEvent({type:"selectedFilterChanged"})}getDefaultFilters(e){const t=this.beans,{gos:s,dataTypeSvc:i}=t,r=s.isModuleRegistered("MultiFilter"),o=i?.getBaseDataType(e);return[{filter:xc(o,!1)},{filter:"agSetColumnFilter"},...r?[{filter:"agMultiColumnFilter"}]:[]]}},FW={tag:"div",cls:"ag-filter-card ag-filter-card-add"},EW=class extends A{constructor(e){super(FW),this.options=new Map,this.setOptions(e)}postConstruct(){this.showButton()}refresh(e){this.setOptions(e);const{eSelect:t,options:s}=this;t&&t.setValueList({valueList:Array.from(s.keys()),refresh:!0})}showButton(){ee(this.getGui()),this.destroySelect();const e=re({tag:"button",cls:"ag-button ag-standard-button ag-filter-add-button",children:[{tag:"span",children:[()=>_("filterAdd",this.beans)]},{tag:"span",cls:"ag-filter-add-button-label",children:zo(this,"addFilterCard")}]});this.activateTabIndex([e]);const t=this.showSelect.bind(this);e.addEventListener("click",t),this.removeButton=()=>{e.removeEventListener("click",t)},this.appendChild(e),e.focus()}showSelect(){ee(this.getGui()),this.destroyButton();const e="ariaLabelAddFilterField",t={className:"ag-filter-add-select",pickerType:"virtual-list",pickerAriaLabelKey:e,pickerAriaLabelValue:zo(this,e),placeholder:zo(this,"addFilterPlaceholder"),value:"",valueList:Array.from(this.options.keys()),searchType:"matchAny",allowTyping:!0,filterList:!0,highlightMatch:!0,valueFormatter:i=>this.options.get(i)},s=this.createManagedBean(new Jc(t));this.eSelect=s,this.appendChild(s.getGui()),s.showPicker(),s.getFocusableElement().focus(),s.addManagedListeners(s,{fieldPickerValueSelected:({value:i})=>this.dispatchLocalEvent({type:"filterSelected",id:i}),pickerHidden:()=>{this.showButton()}})}setOptions(e){const t=this.options;t.clear();for(const{id:s,name:i}of e)t.set(s,i)}destroySelect(){this.eSelect=this.destroyBean(this.eSelect)}destroyButton(){this.removeButton=this.removeButton?.()}destroy(){this.destroySelect(),this.destroyButton(),super.destroy()}},PW={tag:"div",cls:"ag-filter-card-body",children:[{tag:"ag-select",cls:"ag-filter-type-select",ref:"eFilterType"}]},MW=class extends A{constructor(){super(...arguments),this.eFilterType=x}postConstruct(){const e={onValueChange:t=>this.dispatchLocalEvent({type:"filterTypeChanged",filterDef:t})};this.setTemplate(PW,[Wi],{eFilterType:e}),this.eFilterType.setDisplayed(!1)}refresh(e){const t=this.state;this.state=e;const{activeFilterDef:s,filterDefs:i,detail:r,afterGuiAttached:o,afterGuiDetached:n}=e,{activeFilterDef:a,filterDefs:l,detail:c}=t??{},d=this.eFilterType;if(i!==l){d.clearOptions();const u=i?.map(h=>({value:h,text:h.name}));u&&d.clearOptions().addOptions(u).setValue(s,!0),d.setDisplayed(!!u)}else s!==a&&d.setValue(s,!0);r!==c&&(c&&(ue(c),n()),this.appendChild(r),o({container:"newFiltersToolPanel",suppressFocus:!0}))}},TW={tag:"div",cls:"ag-filter-card-summary",attrs:{"aria-hidden":"true"}},DW=class extends A{constructor(){super(TW)}refresh(e){this.getGui().textContent=e.summary}},AW={tag:"div",cls:"ag-filter-card",children:[{tag:"div",cls:"ag-filter-card-header",role:"presentation",children:[{tag:"div",cls:"ag-filter-card-heading",role:"heading",attrs:{"aria-level":"2"},children:[{tag:"button",ref:"eExpand",cls:"ag-button ag-filter-card-expand",children:[{tag:"span",ref:"eTitle",cls:"ag-filter-card-title"},{tag:"span",ref:"eEditing",cls:"ag-filter-card-editing-icon"},{tag:"span",ref:"eExpandIcon",cls:"ag-filter-card-expand-icon"}]}]},{tag:"button",ref:"eDelete",cls:"ag-button ag-filter-card-delete",children:[{tag:"span",ref:"eDeleteIcon",cls:"ag-filter-card-delete-icon"}]}]}]},IW=class extends A{constructor(e){super(AW),this.id=e,this.eTitle=x,this.eExpand=x,this.eDelete=x,this.eExpandIcon=x,this.eDeleteIcon=x,this.eEditing=x}postConstruct(){const{beans:e,eDelete:t,eExpand:s,eDeleteIcon:i,eEditing:r,id:o}=this,n=e.filterPanelSvc;de(t,zo(this,"ariaLabelFilterCardDelete")),i.appendChild(Bs("close",e,null)),this.activateTabIndex([s,t]),this.addManagedElementListeners(s,{click:()=>n.expand(o,!this.state?.expanded)}),this.addManagedElementListeners(t,{click:()=>n.remove(o)}),this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)}),r.appendChild(Bs("filterCardEditing",e,null))}refresh(e){const{eExpand:t,eEditing:s,state:i,beans:r}=this;this.state=e;const{name:o,expanded:n,isEditing:a}=e;this.eTitle.textContent=o,V(s,a),(!i||n!==i.expanded)&&this.toggleExpand(e);let l=n?null:`${o} ${e.summary}`;a&&(l=`${l??o}. ${zo(this,"ariaLabelFilterCardHasEdits")}`),de(t,l);const c=u=>{if(u)return ue(u.getGui()),this.destroyBean(u)},d=(u,h,g)=>(u||(u=this.createBean(new h),g?.(u),this.appendChild(u.getGui())),u.refresh(e),u);if(e.expanded){this.summaryComp=c(this.summaryComp);const u=d(this.detailComp,MW,g=>g.addManagedListeners(g,{filterTypeChanged:({filterDef:p})=>r.filterPanelSvc.updateType(this.id,p)}));this.detailComp=u;const h=`ag-${this.getCompId()}-filter`;u.getGui().id=h,Ka(t,h)}else this.detailComp=c(this.detailComp),this.summaryComp=d(this.summaryComp,DW),Ka(t,null)}toggleExpand(e){const t=!!e.expanded,{eExpandIcon:s,eExpand:i,beans:r}=this;ee(s),s.appendChild(Bs(t?"filterCardCollapse":"filterCardExpand",r,null)),ot(i,t)}onFilterOpened(e){const{state:t,beans:s,id:i}=this;e.source==="COLUMN_MENU"&&e.column===t?.column&&t?.expanded&&s.filterPanelSvc.expand(i,!1)}destroy(){this.detailComp=this.destroyBean(this.detailComp),this.summaryComp=this.destroyBean(this.summaryComp),this.state=void 0,super.destroy()}};function kW(e){return!!e?.id}function LW(e){return!!e?.action}var GW={tag:"div",cls:"ag-filter-panel",children:[{tag:"div",cls:"ag-filter-panel-container",ref:"eContainer"}]},OW=class extends A{constructor(){super(GW),this.eContainer=x,this.filters=new Map}refresh(e){if(LW(e)){this.refreshActions();return}if(kW(e)){this.filters.get(e.id)?.refresh(e.state);return}const{eContainer:t,filters:s,beans:i}=this,r=i.filterPanelSvc,o=r.getIds(),n=new Map,a=!ms(i),l=a?ie(i):void 0,c=a&&t.contains(l),d=[],u=[];for(const C of o){const v=s.get(C)??this.createBean(new IW(C));v.refresh(r.getState(C)),n.set(C,v),u.push(v.getGui())}this.filters=n;const h=[];s.forEach((C,v)=>{d.push(C.getGui()),n.has(v)||h.push(C)});let g=this.addFilterComp;g&&d.push(g.getGui());const p=r.getAvailable();p.length?(g||(g=this.createBean(new EW(p)),g.addManagedListeners(g,{filterSelected:({id:C})=>r.add(C)})),g.refresh(p),u.push(g.getGui())):g=this.destroyBean(g),this.addFilterComp=g,xW(t,u,d);for(const C of h)this.destroyBean(C);const f=e?.activeId,m=f&&n.get(f)?.getGui();m?Ge(m):c&&ms(i)&&Ge(u[u.length-1]??t),this.refreshActions()}refreshActions(){const e=this.beans.filterPanelSvc,{actions:t,canApply:s}=e.getActions()??{};let i=this.buttonComp;if(t?.length){const r=t.map(o=>({type:o,label:jt(this,`${o}Filter`)}));if(!i){i=this.createBean(new Mo({className:"ag-filter-panel-buttons"})),this.getGui().appendChild(i.getGui());const o={};for(const n of["apply","clear","reset","cancel"])o[n]=()=>e.doAction(n);i.addManagedListeners(i,o)}i.updateButtons(r),i.updateValidity(s!==!1)}else i&&(ue(i.getGui()),i=this.destroyBean(i));this.buttonComp=i}destroy(){this.beans.filterPanelSvc?.clear?.(),this.addFilterComp=this.destroyBean(this.addFilterComp),this.buttonComp=this.destroyBean(this.buttonComp);const e=this.filters;e.forEach(t=>this.destroyBean(t)),e.clear(),super.destroy()}},VW=".ag-filter-panel{display:flex;flex-direction:column;width:100%;:where(.ag-standard-button){transition:background-color .25s ease-in-out,color .25s ease-in-out}}.ag-filter-panel .ag-simple-filter-body-wrapper{padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-panel .ag-mini-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-vertical-spacing)}.ag-filter-panel-container{display:flex;flex:1;flex-direction:column;gap:var(--ag-widget-container-vertical-padding);overflow:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-card{background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius)}.ag-filter-card-header{align-items:center;display:flex;flex-direction:row;gap:var(--ag-spacing);padding-top:var(--ag-widget-vertical-spacing)}.ag-filter-card-heading{flex:1;overflow:hidden;padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));padding-top:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing))}:where(.ag-ltr) .ag-filter-card-heading{padding-left:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-filter-card-heading{padding-right:var(--ag-widget-horizontal-spacing)}.ag-filter-card-expand{align-items:center;display:flex;flex-direction:row;width:100%}.ag-filter-card-title{font-weight:var(--ag-header-font-weight);overflow:hidden;text-overflow:ellipsis}.ag-filter-card-expand-icon{display:flex;flex:1;justify-content:end}.ag-filter-card-editing-icon{margin:0 var(--ag-spacing)}.ag-filter-card-delete-icon,.ag-filter-card-editing-icon,.ag-filter-card-expand-icon,.ag-filter-card-summary{color:var(--ag-filter-panel-card-subtle-color)}.ag-filter-card-delete-icon,.ag-filter-card-expand-icon{transition:color .25s ease-in-out}.ag-filter-card-delete-icon:hover,.ag-filter-card-expand-icon:hover,.ag-filter-card-heading:hover .ag-filter-card-expand-icon{color:var(--ag-filter-panel-card-subtle-hover-color)}.ag-filter-add-button,.ag-filter-card-delete,.ag-filter-card-expand{border-radius:var(--ag-button-border-radius)}.ag-filter-card-summary,.ag-filter-type-select{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-filter-card-delete{margin-right:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-filter-card-delete{margin-left:var(--ag-widget-horizontal-spacing)}.ag-filter-card-summary{margin-bottom:var(--ag-widget-container-vertical-padding)}.ag-filter-type-select{padding-top:var(--ag-widget-vertical-spacing)}.ag-filter-card-add{border:0;padding:0}.ag-filter-add-button{align-items:center;display:flex;flex-direction:row;line-height:1.5;width:100%}:where(.ag-ltr) .ag-filter-add-button-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-add-button-label{margin-right:var(--ag-spacing)}.ag-filter-add-select{border:0;.ag-rich-select-value{border:0;padding:calc(((1.5*var(--ag-font-size) + 2*var(--ag-button-vertical-padding)) - var(--ag-input-height))/2) var(--ag-spacing)}}:where(.ag-ltr) .ag-filter-add-select{.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)!important}}:where(.ag-rtl) .ag-filter-add-select{.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)!important}}.ag-filter-panel-buttons{display:flex;flex-wrap:wrap;gap:var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-panel-buttons-button{line-height:1.5}.ag-filter-panel .ag-filter-panel-buttons-apply-button{background-color:var(--ag-filter-panel-apply-button-background-color);color:var(--ag-filter-panel-apply-button-color)}.ag-filter-panel-buttons:where(:last-child),.ag-filter-panel-container:where(:last-child){padding-bottom:var(--ag-widget-container-vertical-padding)}.ag-filter-panel .ag-set-filter-body-wrapper,.ag-filter-panel .ag-simple-filter-body-wrapper{padding-bottom:var(--ag-widget-container-vertical-padding)}",BW=class extends A{constructor(){super(),this.registerCSS(VW)}init(e){if(!this.gos.get("enableFilterHandlers")){F(282);return}const t=this.beans.filterPanelSvc;t.isActive=!0,this.addDestroyFunc(()=>{t.isActive=!1}),this.updateParams(e,e.initialState);const s=this.createManagedBean(new OW);this.filterPanel=s;const i=r=>{s.refresh(r),e.onStateUpdated()};i(),this.addManagedListeners(t,{filterPanelStatesChanged:i,filterPanelStateChanged:i})}getGui(){return this.filterPanel?.getGui()}refresh(e){return this.updateParams(e,e.initialState),!0}updateParams(e,t){this.beans.filterPanelSvc?.updateParams(e,t)}getState(){return this.beans.filterPanelSvc?.getGridState()??{}}},y1={moduleName:"FiltersToolPanel",version:Y,userComponents:{agFiltersToolPanel:bW},icons:{filtersToolPanel:"filter"},dependsOn:[Sa,le,Ps]},x1={moduleName:"NewFiltersToolPanel",version:Y,userComponents:{agNewFiltersToolPanel:BW},beans:[SW,RW],icons:{filterAdd:"filter-add",filtersToolPanel:"filter",richSelectOpen:"small-down",richSelectRemove:"cancel",richSelectLoading:"loading",filterCardExpand:"chevron-down",filterCardCollapse:"chevron-up",filterCardEditing:"edit"},dependsOn:[Sa,le,Ps]},R1=class extends E{constructor(){super(...arguments),this.loadRowDataVersion=0}wireBeans(e){this.environment=e.environment}init(e,t){this.params=t,this.comp=e,t.pinned==null&&(this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.createDetailGrid(),this.loadRowData(),this.addManagedEventListeners({fullWidthRowFocused:this.onFullWidthRowFocused.bind(this)}))}onFullWidthRowFocused(e){const t=this.params,s={rowIndex:t.node.rowIndex,rowPinned:t.node.rowPinned},i={rowIndex:e.rowIndex,rowPinned:e.rowPinned};ve(s,i)&&Ge(this.comp.getGui(),e.fromBelow)}setAutoHeightClasses(){const e=this.gos.get("detailRowAutoHeight"),t=e?"ag-details-row-auto-height":"ag-details-row-fixed-height",s=e?"ag-details-grid-auto-height":"ag-details-grid-fixed-height",i=this.comp;i.toggleCss(t,!0),i.toggleDetailGridCss(s,!0)}setupRefreshStrategy(){const e=this.params.refreshStrategy;if(e=="everything"||e=="nothing"||e=="rows"){this.refreshStrategy=e;return}e!=null&&F(170,{providedStrategy:e}),this.refreshStrategy="rows"}createDetailGrid(){const{params:e,gos:t}=this;if(ne(e.detailGridOptions)){F(171);return}const s=t.get("theme"),i=e.detailGridOptions.theme;i&&i!==s&&F(267);const r={themeStyleContainer:this.environment.eStyleContainer,...e.detailGridOptions,theme:s};t.get("detailRowAutoHeight")&&(r.domLayout="autoHeight"),this.comp.setDetailGrid(r)}registerDetailWithMaster(e){const{params:t,beans:{selectionSvc:s,findSvc:i,expansionSvc:r}}=this,o=t.node.id,n=t.api,a={id:o,api:e},l=t.node;if(n.isDestroyed())return;n.addDetailGridInfo(o,a),l.detailGridInfo=a;const c=l.parent;i?.registerDetailGrid(l,e);function d(){c&&s?.refreshMasterNodeState(c)}function u({source:g}){if(g==="expandAll")return e.expandAll();if(g==="collapseAll")return e.collapseAll()}function h({node:g,source:p}){g!==c||p==="masterDetail"||e.isDestroyed()||s?.setDetailSelectionState(c,t.detailGridOptions,e)}e.addEventListener("firstDataRendered",()=>{if(e.isDestroyed()||n.isDestroyed())return;s?.setDetailSelectionState(c,t.detailGridOptions,e),e.addEventListener("selectionChanged",d),n.addEventListener("rowSelected",h),e.isModuleRegistered("CsrmSsrmSharedApiModule")&&(n.addEventListener("expandOrCollapseAll",u),r?.setDetailsExpansionState(e))}),this.addManagedListeners(c,{masterChanged:g=>{g.node.master||this.onDestroy(a)}}),this.addDestroyFunc(()=>this.onDestroy(a))}onDestroy(e){const{params:t}=this,s=t.node,i=t.api;s.detailGridInfo===e&&(i.isDestroyed()||i.removeDetailGridInfo(s.id),s.detailGridInfo=null)}loadRowData(){this.loadRowDataVersion++;const e=this.loadRowDataVersion,t=this.params;if(t.detailGridOptions?.rowModelType==="serverSide"){t.node.detailGridInfo?.api?.refreshServerSide({purge:!0});return}const s=t.getDetailRowData;if(!s){F(172);return}const i=o=>{this.loadRowDataVersion===e&&this.comp.setRowData(o)},r={node:t.node,data:t.node.data,successCallback:i,context:N(this.gos,{}).context};s(r)}refresh(){switch(this.refreshStrategy){case"nothing":return!0;case"everything":return!1}return this.loadRowData(),!0}},NW=class{constructor(e){this.parentWrapper=e}wrap(e,t,s,i){return this.parentWrapper.wrap(e,t,s,i)}},HW={tag:"div",cls:"ag-details-row"},zW={tag:"div",cls:"ag-details-row",role:"gridcell",children:[{tag:"div",ref:"eDetailGrid",cls:"ag-details-grid",role:"presentation"}]},_W=class extends A{constructor(){super(...arguments),this.eDetailGrid=x}wireBeans(e){this.context=e.context}init(e){this.params=e,this.selectAndSetTemplate();const t={toggleCss:(s,i)=>this.toggleCss(s,i),toggleDetailGridCss:(s,i)=>this.eDetailGrid.classList.toggle(s,i),setDetailGrid:s=>this.setDetailGrid(s),setRowData:s=>this.setRowData(s),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new R1),this.ctrl.init(t,e)}refresh(){return this.ctrl?.refresh()??!1}selectAndSetTemplate(){const e=this.params;if(e.pinned){this.setTemplate(HW);return}const t=()=>{this.setTemplate(zW)};if(ne(e.template))t();else if(typeof e.template=="string")this.setTemplate(e.template,[]);else if(typeof e.template=="function"){const s=e.template,i=s(e);this.setTemplate(i,[])}else F(168),t();this.eDetailGrid==null&&F(169)}setDetailGrid(e){if(!this.eDetailGrid)return;const t=this.context.getBean("frameworkCompWrapper"),s=new NW(t),{frameworkOverrides:i}=this.beans,r=ob(this.eDetailGrid,e,{frameworkOverrides:i,providedBeanInstances:{frameworkCompWrapper:s},modules:Dm(this.params.api.getGridId(),e.rowModelType??"clientSide")});this.detailApi=r,this.ctrl?.registerDetailWithMaster(r),this.addDestroyFunc(()=>{r.destroy()})}setRowData(e){this.detailApi?.setGridOption("rowData",e)}};function dd(e,t){const s=e.masterDetailSvc?.store;return s?t(s):void 0}function WW(e,t,s){dd(e,i=>{i[t]=s})}function UW(e,t){dd(e,s=>{delete s[t]})}function $W(e,t){return dd(e,s=>s[t])}function KW(e,t){dd(e,s=>{let i=0;Object.values(s).forEach(r=>{r&&t(r,i++)})})}var jW=".ag-details-row{width:100%}.ag-details-row-fixed-height{height:100%}.ag-details-grid{width:100%}.ag-details-grid-fixed-height{height:100%}",qW=class extends E{constructor(){super(...arguments),this.beanName="masterDetailSvc",this.store={}}isEnabled(){return this.gos.get("masterDetail")}postConstruct(){const e=this.gos;ae(e)&&(this.enabled=this.isEnabled()),ft(e)&&this.addEventListeners()}addEventListeners(){const e=i=>{this.setMaster(i.node,!1,!0)};let t;const s=()=>{if(t){for(const i of t)i();t=void 0}this.isEnabled()&&(t=this.addManagedListeners(this.beans.eventSvc,{rowNodeDataChanged:e}))};s(),this.gos.addPropertyEventListener("masterDetail",s)}refreshModel(e){if(e.changedProps){const t=this.isEnabled();if(this.enabled!==t){this.setMasters(null);return}}e.rowDataUpdated&&this.setMasters(e.changedRowNodes)}setMaster(e,t,s){const i=e.master,r=this.isEnabled();let o=r;const n=this.gos,a=n.get("isRowMaster"),l=n.get("treeData");if(r)if(t||s){if(a){const c=e.data;o=!!c&&!!a(c)}}else o=i;l||(o&&t||!o&&i)&&(e._expanded??(e._expanded=null)),o!==i&&(e.master=o,e.dispatchRowEvent("masterChanged"))}setMasters(e){if(this.enabled=this.isEnabled(),e){for(const t of e.updates)this.setMaster(t,!1,!0);for(const t of e.adds)this.setMaster(t,!0,!1)}else{const t=at(this.beans)?.rootNode?._leafs;if(t)for(let s=0,i=t.length;s{const n=t.clientHeight;if(n!=null&&n>0){const a=()=>{const{rowModel:l}=this.beans,{rowNode:c}=e;c.setRowHeight(n),(ae(s,l)||ft(s,l))&&l.onRowHeightChanged()};window.setTimeout(a,0)}},o=vs(i,t,r);e.addDestroyFunc(o),r()}destroy(){this.store={},super.destroy()}},YW={moduleName:"SharedMasterDetail",version:Y,beans:[qW],userComponents:{agDetailCellRenderer:_W},dynamicBeans:{detailCellRendererCtrl:R1},apiFunctions:{addDetailGridInfo:WW,removeDetailGridInfo:UW,getDetailGridInfo:$W,forEachDetailGridInfo:KW},dependsOn:[le,c1,qp],css:[jW]},F1={moduleName:"MasterDetail",version:Y,dependsOn:[YW,Ma,qg]},E1=class extends A{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}postConstruct(){this.beans.dragSvc.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragging:e=>{let t=!1;if(this.dragging||(t=!0,this.dragging=!0,cr(this.beans).classList?.add(this.getDraggingCssClass())),this.updateValuesOnMove(e),t){this.changedCalculatedValues=!1;return}this.beans.rangeSvc.autoScrollService.check(e),this.changedCalculatedValues&&(this.onDrag(e),this.changedCalculatedValues=!1)},onDragStop:e=>{this.dragging=!1,this.onDragEnd(e),this.clearDragProperties()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedEventListeners({cellSelectionChanged:this.updateLocalRangeIfNeeded.bind(this)}),this.addManagedElementListeners(this.getGui(),{pointerdown:P1,mousedown:P1})}getLastCellHovered(){return this.lastCellHovered}getDraggingCssClass(){return`ag-dragging-${this.type===0?"fill":"range"}-handle`}updateValuesOnMove(e){const t=fh(this.gos,e);!t||this.shouldSkipCell(t)||this.lastCellHovered&&uo(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}clearDragProperties(){this.clearValues(),this.beans.rangeSvc.autoScrollService.ensureCleared(),cr(this.beans).classList?.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging&&this.destroy()}getType(){return this.type}refresh(e,t){const s=this.cellCtrl,i=this.getGui(),r=t??W(this.beans.rangeSvc.getCellRanges()),o=r.startRow,n=r.endRow;if(o&&n&&(ze(n,o)?(this.rangeStartRow=n,this.rangeEndRow=o):(this.rangeStartRow=o,this.rangeEndRow=n)),s!==e||!Ne(i)){this.cellCtrl=e;const a=e.comp.getParentOfValue();a&&a.appendChild(i)}this.cellRange=r}clearValues(){this.lastCellHovered=void 0}destroy(){if(!this.shouldDestroyOnEndDragging&&this.dragging){V(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.getGui()?.remove()}updateLocalRangeIfNeeded(e){if(!this.cellRange)return;const{id:t,type:s}=this.cellRange;if(!t||t!==e.id)return;const i=this.beans.rangeSvc?.getCellRanges().find(r=>r.id===t&&r.type===s);i&&i!==this.cellRange&&(this.cellRange=i)}},P1=e=>{e.stopPropagation()};function XW(e){const t=e.length;let s=0;if(t<=1)return e;for(let u=0;u1){s=Math.max(s,parseInt(g[1],10));continue}Math.floor(h)!==h&&(s=Math.max(s,h.toString().split(".")[1].length))}let i=0,r=0,o=0,n=0,a=0;for(let u=0;un?"x":"y":l=a,l!==this.dragAxis&&(this.dragAxis=l,this.changedCalculatedValues=!0)}shouldSkipCell(e){return Fe(e.column)}onDrag(e){if(!this.initialPosition){const s=this.cellCtrl;if(!s)return;this.initialPosition=s.cellPosition}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t=this.dragAxis==="x",{cellRange:s,rangeStartRow:i,rangeEndRow:r,beans:{rangeSvc:o}}=this,n=s.columns.length;let a;if(!this.isUp&&!this.isLeft)a=o.createCellRangeFromCellRangeParams({rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,columnStart:s.columns[0],rowEndIndex:t?r.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?r.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:s.columns[n-1]});else{const l=t?i:this.lastCellMarked;a=o.createCellRangeFromCellRangeParams({rowStartIndex:l.rowIndex,rowStartPinned:l.rowPinned,columnStart:t?this.lastCellMarked.column:s.columns[0],rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnEnd:s.columns[n-1]})}a&&this.performFill({event:e,initialRange:s,finalRange:a,shouldUpdateRange:!0})}onDragCancel(){this.initialXY=null,this.markedCells.length&&this.clearMarkedPath()}performFill({event:e,initialRange:t,finalRange:s,shouldUpdateRange:i}){const{eventSvc:r,rangeSvc:o}=this.beans;r.dispatchEvent({type:"fillStart"}),this.handleValueChanged(t,s,e),i&&o.setCellRanges([s]),r.dispatchEvent({type:"fillEnd",initialRange:t,finalRange:s})}getFillHandleDirection(){const e=pl(this.gos)?.direction;return e?e!=="x"&&e!=="y"&&e!=="xy"?(F(177),"xy"):e:"xy"}handleValueChanged(e,t,s){const{beans:i}=this,{rangeSvc:r,gos:o,valueSvc:n}=i,a=r.getRangeEndRow(e),l=r.getRangeStartRow(e),c=r.getRangeEndRow(t),d=r.getRangeStartRow(t),u=this.dragAxis==="y";if(this.isReduce&&!pl(o)?.suppressClearOnFillReduction){const R=u?e.columns:e.columns.filter(M=>t.columns.indexOf(M)<0),P=u?Je(i,c):d;P&&this.clearCellsInRange(P,a,R);return}const h=[],g=[],p=[],f=[];let m=!0,C=0;const v=()=>{h.length=0,g.length=0,p.length=0,f.length=0,C=0},w=(R,P)=>{let M=this.isUp?a:l,T=!1;for(u&&(m=!0,v());!T&&M;){const I=Ve(i,M);if(!I)break;if(u&&R)S(h,R,I,()=>!ve(M,this.isUp?l:a));else if(P){m=!0,v();for(const k of P)S(h,k,I,()=>k!==(this.isLeft?e.columns[0]:W(e.columns)))}T=ve(M,this.isUp?d:c),M=this.isUp?Yt(this.beans,M):Je(i,M)}},S=(R,P,M,T)=>{let I,k=!1;if(m)I=n.getValue(P,M,"edit"),g.push(I),p.push(n.getValue(P,M,"edit",!0)),f.push(n.getValueForDisplay({column:P,node:M,from:"edit"}).valueFormatted),m=T();else{const{value:L,fromUserFunction:j,sourceCol:U,sourceRowNode:O}=this.processValues({event:s,values:R,initialValues:g,initialNonAggregatedValues:p,initialFormattedValues:f,col:P,rowNode:M,idx:C++});if(I=L,P.isCellEditable(M)){const X=n.getValue(P,M,"edit");if(!j){if(U){const se=U.getColDef();if(se.useValueFormatterForExport!==!1&&se.valueFormatter){const we=n.getValueForDisplay({column:U,node:O,includeValueFormatted:!0,from:"edit"}).valueFormatted;we!=null&&(I=we)}}P.getColDef().useValueParserForImport!==!1&&(I=n.parseValue(P,M,U?I:Xe(I),X))}!j||X!==I?M.setDataValue(P,I,"rangeSvc"):k=!0}}k||R.push({value:I,column:P,rowNode:M})},{changeDetectionSvc:y}=this.beans;y?.beginDeferred();try{if(u)e.columns.forEach(R=>{w(R)});else{const R=this.isLeft?[...t.columns].reverse():t.columns;w(void 0,R)}this.beans.editSvc?.stopEditing(void 0,{source:"fillHandle"})}finally{y?.endDeferred()}}clearCellsInRange(e,t,s){const i={startRow:e,endRow:t,columns:s,startColumn:s[0]};this.beans.rangeSvc.clearCellRangeCellValues({cellRanges:[i],restoreSourceInBatch:!0})}processValues(e){const{formula:t,valueSvc:s}=this.beans,{event:i,values:r,initialValues:o,initialNonAggregatedValues:n,initialFormattedValues:a,col:l,rowNode:c,idx:d}=e,u=pl(this.gos)?.setFillValue,h=this.dragAxis==="y";let g;if(h?g=this.isUp?"up":"down":g=this.isLeft?"left":"right",u){const m=N(this.gos,{event:i,values:r.map(({value:v})=>v),initialValues:o,initialNonAggregatedValues:n,initialFormattedValues:a,currentIndex:d,currentCellValue:s.getValue(l,c,"edit"),direction:g,column:l,rowNode:c}),C=u(m);if(C!==!1)return{value:C,fromUserFunction:!0}}const p=m=>typeof m=="number"&&Number.isFinite(m)||typeof m=="string"&&/^[+-]?\d+(?:\.\d+)?$/.test(m.trim()),f=r.every(({value:m})=>p(m));if(i.altKey||!f){const m=String(W(r)?.value??"");if(f&&o.length===1){const R=this.isUp||this.isLeft?-1:1;return{value:parseFloat(m)+1*R,fromUserFunction:!1}}const{value:C,column:v,rowNode:w}=r[d%r.length];let S;const y=v.isAllowFormula()&&t?.isFormula(m);if(y){const R=g==="up"?-1:g==="down"?1:0,P=g==="left"?-1:g==="right"?1:0;S=t.updateFormulaByOffset({value:m,rowDelta:R,columnDelta:P})}else S=C;return{value:S,fromUserFunction:!1,sourceCol:y?void 0:v,sourceRowNode:w}}return{value:W(XW(r.map(({value:m})=>Number(m)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){for(const e of this.markedCells){if(!e.isAlive())continue;const{comp:t}=e;t.toggleCss("ag-selection-fill-top",!1),t.toggleCss("ag-selection-fill-right",!1),t.toggleCss("ag-selection-fill-bottom",!1),t.toggleCss("ag-selection-fill-left",!1)}this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(ve(t,e))return;const s=ze(t,e),{rangeStartRow:i,rangeEndRow:r}=this;s&&(t.rowPinned==i.rowPinned&&t.rowIndex>=i.rowIndex||i.rowPinned!=r.rowPinned&&t.rowPinned==r.rowPinned&&t.rowIndex<=r.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,s),this.isReduce=!1)}else{const s=e.column,i=t.column;if(s===i)return;const r=this.beans.visibleCols.allCols,o=r.indexOf(s),n=r.indexOf(i);n<=o&&n>=r.indexOf(this.cellRange.columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,n=4),e.toggleCss(iU,o),cn(i,r>0?!0:void 0),e.toggleCss(rU,this.isSingleCell()),this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),s=!t&&e.top,i=!t&&e.right,r=!t&&e.bottom,o=!t&&e.left,n=this.cellComp;n.toggleCss(nU,s),n.toggleCss(aU,i),n.toggleCss(lU,r),n.toggleCss(cU,o)}isSingleCell(){const{rangeSvc:e}=this;return this.rangeCount===1&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeSvc:e}=this;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(s=>[qt.DIMENSION,qt.VALUE].includes(s.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshRangeStyleAndHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,s=!1,i=!1,r=!1;const{rangeSvc:o,beans:{visibleCols:n},cellCtrl:{cellPosition:a}}=this,l=a.column,c=o.getCellRanges().filter(h=>o.isCellInSpecificRange(a,h));if(!c.length)return{top:t,right:s,bottom:i,left:r};let d,u;e?(d=n.getColAfter(l),u=n.getColBefore(l)):(d=n.getColBefore(l),u=n.getColAfter(l)),d||(r=!0),u||(s=!0);for(let h=0;h=0;i--){const r=s[i],o=r.colorClass;if(o&&e.isCellInSpecificRange(this.cellCtrl.cellPosition,r))return o}return null}refreshHandleColor(e){const t=this.selectionHandle?.getGui?.(),s=e?.colorClass??null;if(!t){this.handleColorClass=null;return}this.handleColorClass&&this.handleColorClass!==s&&t.classList.remove(this.handleColorClass),s?t.classList.add(s):this.handleColorClass&&t.classList.remove(this.handleColorClass),this.handleColorClass=s??null}getRangeForHandle(){const{gos:e,editSvc:t}=this.beans,s=this.rangeSvc,i=s.getCellRanges(),r=i.length;if(this.rangeCount<1||r<1)return null;const o=t?.isRangeSelectionEnabledWhileEditing(),n=o?i:[W(i)];for(const a of n){const{cellPosition:l,column:c}=this.cellCtrl,d=D1(e)&&!c.isSuppressFillHandle(),u=dU(e);let g=!t?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&(o||r===1&&(d||u));if(this.hasChartRange&&(g=a.type===qt.VALUE),g&&a.endRow!=null&&s.isContiguousRange(a)&&s.isBottomRightCell(a,l))return a}return null}addSelectionHandle(e){const{beans:t}=this,s=t.editSvc?.isRangeSelectionEnabledWhileEditing(),i=e.type,o=!s&&D1(t.gos)&&ne(i)?0:1;if(this.selectionHandle&&this.selectionHandle.getType()!==o&&(this.selectionHandle=t.context.destroyBean(this.selectionHandle)),!this.selectionHandle){const n=t.registry.createDynamicBean(o===0?"fillHandle":"rangeHandle",!1);n&&(this.selectionHandle=t.context.createBean(n))}this.selectionHandle?.refresh(this.cellCtrl,e)}destroy(){this.unsetComp()}},hU=class extends E{constructor(e){super(),this.eContainer=e}postConstruct(){const{beans:e,gos:t,eContainer:s}=this,i=e.rangeSvc,r={eElement:s,onDragStart:i.onDragStart.bind(i),onDragStop:i.onDragStop.bind(i),onDragging:i.onDragging.bind(i)},o=e.dragSvc,n=o.addDragSource.bind(o,r),a=o.removeDragSource.bind(o,r);this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{mt(t)?n():a()}),this.addDestroyFunc(a),mt(t)&&n()}},gU=class extends E{constructor(e,t){super(),this.column=e,this.eGui=t}postConstruct(){this.addManagedElementListeners(this.eGui,{click:e=>e&&this.onClick(e)})}onClick(e){this.beans.rangeSvc?.handleColumnSelection(this.column,e)}},pU=class extends E{constructor(e,t){super(),this.column=e,this.comp=t,this.columnMap=new Map,this.isActive=!1,this.resetColumnMap()}postConstruct(){this.addManagedPropertyListener("cellSelection",()=>{this.refreshActive()}),this.refreshActive(),this.setupRangeHeaderHighlight()}resetColumnMap(){this.columnMap.clear();let e;this.column.isColumn?e=[this.column]:e=this.column.getDisplayedLeafColumns();for(const t of e)this.columnMap.set(t,!1)}refreshActive(){const{gos:e,rangeSvc:t}=this.beans,s=e.get("cellSelection");this.isActive=!!(s&&t&&typeof s=="object"&&s.enableHeaderHighlight)}setupRangeHeaderHighlight(){const e=this.onRangeSelectionChanged.bind(this);this.addManagedEventListeners({rangeSelectionChanged:e,columnPinned:e,columnMoved:e,columnGroupOpened:e}),e()}onRangeSelectionChanged(){if(!this.isActive)return;this.resetColumnMap();const e=this.beans.rangeSvc.getCellRanges();let t=!1,s=!0;for(const i of e){if(t)break;for(const r of i.columns)this.columnMap.has(r)&&(this.columnMap.set(r,!0),t||(t=!0))}for(const i of Array.from(this.columnMap.values()))if(i===!1){s=!1;break}this.comp.toggleCss("ag-header-range-highlight",t&&s)}destroy(){super.destroy(),this.comp=null,this.column=null}},fU=class extends E{constructor(){super(...arguments),this.beanName="rangeSvc",this.rangeSelectionExtensions=[],this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1,this.columnRangeSelectionCtx={}}wireBeans(e){this.rowModel=e.rowModel,this.dragSvc=e.dragSvc,this.colModel=e.colModel,this.visibleCols=e.visibleCols,this.cellNavigation=e.cellNavigation,this.ctrlsSvc=e.ctrlsSvc}postConstruct(){const e=this.onColumnsChanged.bind(this),t=()=>this.removeAllCellRanges(),s=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnVisible:e,columnValueChanged:e,columnPivotModeChanged:t,columnRowGroupChanged:t,columnPivotChanged:t,columnGroupOpened:s,columnMoved:s,columnPinned:s}),this.ctrlsSvc.whenReady(this,i=>{const r=i.gridBodyCtrl;this.autoScrollService=new _l({scrollContainer:r.eBodyViewport,scrollAxis:"xy",getVerticalPosition:()=>r.scrollFeature.getVScrollPosition().top,setVerticalPosition:o=>r.scrollFeature.setVerticalScrollPosition(o),getHorizontalPosition:()=>r.scrollFeature.getHScrollPosition().left,setHorizontalPosition:o=>r.scrollFeature.setHorizontalScrollPosition(o),shouldSkipVerticalScroll:()=>!je(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!r.scrollFeature.isHorizontalScrollShowing()})})}registerRangeSelectionExtension(e){this.rangeSelectionExtensions.includes(e)||this.rangeSelectionExtensions.push(e)}unregisterRangeSelectionExtension(e){De(this.rangeSelectionExtensions,e)}shouldSuppressRangeSelection(e){return this.rangeSelectionExtensions.some(t=>t.shouldSuppressRangeSelection?.(e))}shouldSkipColumn(e){return this.rangeSelectionExtensions.some(t=>t.shouldSkipColumn?.(e))}isAllColumnsSelectionCell(e){return this.rangeSelectionExtensions.some(t=>t.isAllColumnsSelectionCell?.(e))}isAllColumnsRange(e,t){return this.rangeSelectionExtensions.some(s=>s.isAllColumnsRange?.(e,t))}updateSelectionModeForCell(e){this.setSelectionMode(this.isAllColumnsSelectionCell(e))}onDragStart(e){const t=this.gos,s=e.target;if(!mt(t)||sh(t,s)?.isSuppressMouseEvent(e)||this.shouldSuppressRangeSelection(s))return;const{shiftKey:i}=e,r=this.isMultiRange(e),o=i&&!!this.cellRanges?.length;!r&&(!o||D(W(this.cellRanges).type))&&this.removeAllCellRanges(!0);const n=this.dragSvc.startTarget;if(n&&this.updateValuesOnMove(n),!!this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=r&&this.getCellRangeCount(this.lastCellHovered)>1,o||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=W(this.cellRanges);else{const a={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned},l=this.getColumnsFromModel([this.lastCellHovered.column]);if(!l?.length)return;this.draggingRange={startRow:a,endRow:a,columns:l,startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.addEventListener("scroll",this.bodyScrollListener,{passive:!0}),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}onDragging(e){const{dragging:t,lastCellHovered:s,newestRangeStartCell:i,autoScrollService:r,cellHasChanged:o}=this;if(!t||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const n=g=>s&&s.rowPinned===g&&i.rowPinned===g,a=n("top")||n("bottom");if(r.check(e,a),!o||!s)return;const l=i?.column,c=s?.column,d=this.calculateColumnsBetween(l,c);if(!d)return;const{rowIndex:u,rowPinned:h}=s;this.draggingRange.endRow={rowIndex:u,rowPinned:h},this.draggingRange.columns=d,this.dispatchChangedEvent(!1,!1,this.draggingRange.id)}onDragStop(){if(!this.dragging)return;const{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.removeEventListener("scroll",this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,e)}onColumnsChanged(){this.refreshLastRangeStart();const e=this.visibleCols.allCols;for(const s of this.cellRanges){const i=s.columns;s.columns=s.columns.filter(o=>o.isVisible()&&e.indexOf(o)!==-1),!be(i,s.columns)&&this.dispatchChangedEvent(!1,!0,s.id)}const t=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(s=>s.columns.length>0),t>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const e=W(this.cellRanges);e&&this.refreshRangeStart(e)}isContiguousRange(e){const t=e.columns;if(!t.length)return!1;const s=this.visibleCols.allCols,i=t.map(r=>s.indexOf(r)).sort((r,o)=>r-o);return W(i)-i[0]+1===t.length}getRangeStartRow(e){return e.startRow&&e.endRow?ze(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:(this.beans.pinnedRowModel?.getPinnedTopRowCount()??0)>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return ze(e.startRow,e.endRow)?e.endRow:e.startRow;const t=this.beans.pinnedRowModel?.getPinnedBottomRowCount()??0;return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}getRangeRowCount(e){const t=this.beans,s=this.getRangeStartRow(e),i=this.getRangeEndRow(e),r=Hu(t,s);return Hu(t,i)-r+1}handleCellMouseDown(e,t){const s=e.ctrlKey||e.metaKey;this.handleCellSelectionInput(t,{target:e.target,shiftKey:e.shiftKey,isRightClick:ml(this.beans,e),isMultiRange:this.isMultiRange(e),isMultiKey:s,preventDefault:()=>e.preventDefault()})}handleCellKeyboardSelect(e,t){const s=e.ctrlKey||e.metaKey;this.handleCellSelectionInput(t,{target:e.target,shiftKey:e.shiftKey,isRightClick:!1,isMultiRange:this.isMultiRangeForKeyState(s),isMultiKey:s,preventDefault:()=>e.preventDefault()})}handleCellSelectionInput(e,t){const{target:s,shiftKey:i,isRightClick:r,isMultiRange:o,isMultiKey:n,preventDefault:a}=t;if(this.shouldSuppressRangeSelection(s))return;const l=this.isAllColumnsSelectionCell(e);if(l&&a(),i)return this.extendLatestRangeToCell(e);if(l&&r)return;this.updateSelectionModeForCell(e);const c=this.calculateColumnsBetween(e.column,e.column);if(!c)return;const d=l?this.findContainingRange({columns:c,startRow:e,endRow:e}):void 0;l&&!!d&&o&&n&&d?this.removeRowFromAllColumnsRange(e,d):this.setRangeToCell(e,o)}isMultiRange(e){return this.isMultiRangeForKeyState(e.ctrlKey||e.metaKey)}isMultiRangeForKeyState(e){const{editingWithRanges:t,allowMulti:s}=this.getMultiRangeContext();return t||(s?e:!1)}getMultiRangeContext(){const{gos:e,editSvc:t}=this.beans,s=!!t?.isEditing()&&!!t?.isRangeSelectionEnabledWhileEditing(),i=$m(e)&&!s;return{editingWithRanges:s,suppressMultiRanges:i,allowMulti:!i}}removeRowFromAllColumnsRange(e,t){const{beans:s,cellRanges:i}=this,r=Fr(s),o=Er(s),n=this.getRangeStartRow(t),a=this.getRangeEndRow(t);if(!n&&ve(r,e))ud(t,Je(s,r),"top");else if(!a&&ve(o,e))ud(t,Yt(s,o),"bottom");else if(ve(n,a))De(i,t);else if(ve(n,e))ud(t,Je(s,e),"top");else if(ve(a,e))ud(t,Yt(s,e),"bottom");else{const l=Yt(s,e),c=Je(s,e);t.startRow=n,t.endRow=l??void 0,i.push({...t,startRow:c??void 0,endRow:a})}this.dispatchChangedEvent(!0,!0)}setRangeToCell(e,t=!1){const{gos:s}=this;if(!mt(s))return;this.updateSelectionModeForCell(e);const i=this.calculateColumnsBetween(e.column,e.column);if(!i)return;const{suppressMultiRanges:r}=this.getMultiRangeContext();(r||!t||ne(this.cellRanges))&&this.removeAllCellRanges(!0);const o={rowIndex:e.rowIndex,rowPinned:e.rowPinned},n={startRow:o,endRow:o,columns:i,startColumn:e.column},a=this.ensureRangeStartColumn(n);a&&(this.cellRanges.push(n),this.setNewestRangeStartCell({...e,column:a}),this.onDragStop(),this.dispatchChangedEvent(!0,!0))}getRangeLastColumn(e){const t=e.columns[0],s=W(e.columns);return this.newestRangeStartCell?.column===t?s:t}extendRangeRowCountBy(e,t){const{beans:s}=this,{startRow:i,endRow:r}=e;if(!i||!r)return;let o=0,n;const a=ze(r,i);a?n=i:n=r;const l=t>0?Je:Yt,c=Math.abs(t);for(;ot.indexOf(i)).filter(i=>i>-1).sort((i,r)=>i-r);return{left:t[s[0]],right:t[W(s)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=e.key,s=e.ctrlKey||e.metaKey,i=W(this.cellRanges),r=this.newestRangeStartCell,o=i.endRow.rowIndex,n=i.endRow.rowPinned,l={column:this.getRangeLastColumn(i),rowIndex:o,rowPinned:n},c=this.cellNavigation.getNextCellToFocus(t,l,s);if(c&&!this.shouldSkipColumn(c.column))return this.setCellRange({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:c.rowIndex,rowEndPinned:c.rowPinned,columnStart:r.column,columnEnd:c.column}),c}setCellRange(e){mt(this.gos)&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){if(be(this.cellRanges,e)||!this.verifyCellRanges(this.gos))return;this.setSelectionMode(!1),this.removeAllCellRanges(!0);const t=this.getColumnsFromModel(this.visibleCols.allCols)??[];let s=!1;for(const i of e){if(i.columns&&i.startRow){const r=this.getColumnsFromModel(i.columns);if(!r||r.length===0)continue;i.columns=r;const{startRow:o}=i;this.setNewestRangeStartCell({rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:i.columns[0]})}!s&&t.length>0&&this.isAllColumnsRange(i,t)&&(s=!0),this.cellRanges.push(i)}this.setSelectionMode(s),this.dispatchChangedEvent(!1,!0)}clearCellRangeCellValues(e){const{beans:t,eventSvc:s}=this,{cellEventSource:i="rangeSvc",dispatchWrapperEvents:r,wrapperEventSource:o="deleteKey",restoreSourceInBatch:n}=e;let{cellRanges:a}=e;r&&(s.dispatchEvent({type:"cellSelectionDeleteStart",source:o}),s.dispatchEvent({type:"rangeDeleteStart",source:o})),a||(a=this.cellRanges);const{valueSvc:l,editSvc:c}=t,d=!!c?.isBatchEditing(),{changeDetectionSvc:u}=t;u?.beginDeferred();try{this.forEachEditableCellInRanges(a,(h,g)=>{if(n&&d){c?.batchResetToSourceValue({rowNode:h,column:g});return}const p=l.getDeleteValue(g,h);h.setDataValue(g,p,i)})}finally{u?.endDeferred()}r&&(s.dispatchEvent({type:"cellSelectionDeleteEnd",source:o}),s.dispatchEvent({type:"rangeDeleteEnd",source:o}))}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(e,t){const{columns:s,columnStart:i,columnEnd:r,rowStartIndex:o,rowStartPinned:n,rowEndIndex:a,rowEndPinned:l}=e,c=this.getColumnsFromParams(s,i,r);if(!c||!t&&c.columns.length===0)return;const{columns:d,startsOnTheRight:u}=c,h=A1(o,n),g=A1(a,l);return{startRow:h,endRow:g,columns:d,startColumn:this.getColumnFromModel(i)??(u?W(d):d[0])}}addCellRange(e){const t=this.gos;if(!mt(t)||!this.verifyCellRanges(t))return;this.setSelectionMode(!1);const s=this.createCellRangeFromCellRangeParams(e);if(s)return s.startRow&&this.setNewestRangeStartCell({rowIndex:s.startRow.rowIndex,rowPinned:s.startRow.rowPinned,column:s.startColumn}),this.cellRanges.push(s),this.dispatchChangedEvent(!1,!0,s.id),s}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){const e=this.cellRanges.length;if(e===0)return!1;if(e>1)return!0;const t=this.cellRanges[0],s=this.getRangeStartRow(t),i=this.getRangeEndRow(t);return s.rowPinned!==i.rowPinned||s.rowIndex!==i.rowIndex||t.columns.length!==1}areAllRangesAbleToMerge(){const e=new Map;if(this.cellRanges.length<=1)return!0;for(const i of this.cellRanges)this.forEachRowInRange(i,r=>{const o=`${r.rowPinned||"normal"}_${r.rowIndex}`,n=e.get(o),a=i.columns.map(l=>l.getId());if(n){const l=a.filter(c=>n.indexOf(c)===-1);n.push(...l)}else e.set(o,a)});let s;for(const i of e.values()){const r=i.sort().join();if(s===void 0){s=r;continue}if(s!==r)return!1}return!0}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){const s=t.columns?.includes(e.column),i=this.isRowInRange(e,t);return s&&i}isColumnInAnyRange(e){const{beans:t}=this,s=Fr(t),i=Er(t);if(!s||!i)return!1;const r=e.isColumn?[e]:e.getDisplayedLeafColumns();return this.findContainingRange({columns:r,startRow:s,endRow:i},!0)!=null}findContainingRange({columns:e,startRow:t,endRow:s},i=!1){const r=this.cellRanges;for(let o=r.length-1;o>=0;o--){const n=r[o],a=e.every(c=>n.columns.includes(c));let l=!1;if(i)l=ve(n.startRow,t)&&ve(n.endRow,s);else{const c=t&&this.isRowInRange(t,n),d=s&&this.isRowInRange(s,n);l=!!c&&!!d}if(a&&l)return n}}isBottomRightCell(e,t){const s=this.visibleCols.allCols,i=e.columns.map(c=>s.indexOf(c)).sort((c,d)=>c-d),{startRow:r,endRow:o}=e,n=ze(r,o)?o:r,a=s.indexOf(t.column)===W(i),l=t.rowIndex===n.rowIndex&&Ae(t.rowPinned)===Ae(n.rowPinned);return a&&l}getCellRangeCount(e){return this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t){const s=this.getRangeStartRow(t),i=this.getRangeEndRow(t),r=ve(e,s),o=ve(e,i);if(r||o)return!0;const n=!ze(e,s),a=ze(e,i);return n&&a}intersectLastRange(e){const{editingWithRanges:t,suppressMultiRanges:s}=this.getMultiRangeContext();if(t||s||e&&this.dragging||this.isEmpty())return;const i=W(this.cellRanges),r=this.getRangeStartRow(i),o=this.getRangeEndRow(i),n=[];for(const a of this.cellRanges.slice(0,-1)){const l=this.getRangeStartRow(a),c=this.getRangeEndRow(a),d=a.columns,u=d.filter(g=>i.columns.indexOf(g)===-1);if(u.length===d.length){n.push(a);continue}if(ze(o,l)||ze(c,r)){n.push(a);continue}const h=n.length;if(ze(l,r)){const g={columns:[...d],startColumn:i.startColumn,startRow:{...l},endRow:Yt(this.beans,r)};n.push(g)}if(u.length>0){const g={columns:u,startColumn:u.includes(i.startColumn)?i.startColumn:u[0],startRow:mU([{...r},{...l}]),endRow:CU([{...o},{...c}])};n.push(g)}ze(o,c)&&n.push({columns:[...d],startColumn:i.startColumn,startRow:Je(this.beans,o),endRow:{...c}}),n.length-h===1&&(n[n.length-1].id=a.id)}this.cellRanges=n,e&&this.dispatchChangedEvent(!1,!0)}createRangeHighlightFeature(e,t,s){e.createManagedBean(new pU(t,s))}setSelectionMode(e){this.selectionMode=e?1:0}refreshRangeStart(e){const{columns:t}=e,s=this.ensureRangeStartColumn(e);if(!s)return;const i=(l,c)=>{const d=e.columns.filter(u=>u!==l);l?(e.startColumn=l,e.columns=c?[l,...d]:[...d,l]):e.columns=d},{left:r,right:o}=this.getRangeEdgeColumns(e);if(s===t[0]&&s!==r){i(r,!0);return}s===W(t)&&s===o&&i(o,!1)}setNewestRangeStartCell(e){this.newestRangeStartCell=e}getColumnsFromParams(e,t,s){const i=!e&&!t&&!s;let r,o=!1;return i||e?r=this.getColumnsFromModel(i?void 0:e):t&&s&&(r=this.calculateColumnsBetween(t,s),r?.length&&(o=r[0]!==this.getColumnFromModel(t))),r?{columns:r,startsOnTheRight:o}:void 0}verifyCellRanges(e){const{suppressMultiRanges:t}=this.getMultiRangeContext(),s=Um(e)&&t&&this.cellRanges.length>1;return s&&F(93),!s}forEachRowInRange(e,t){const s=this.getRangeStartRow(e),i=this.getRangeEndRow(e);let r=s;for(;r&&(t(r),!ve(r,i));)r=Je(this.beans,r)}forEachEditableCellInRanges(e,t){const{beans:s}=this;for(const i of e)this.forEachRowInRange(i,r=>{const o=Ve(s,r);if(o)for(let n=0;n0,c=t.ctrlKey||t.metaKey,d=!a||c,u=Fr(i),h=Er(i);if(!u||!h)return;if(t.key===b.ENTER&&t.preventDefault(),t.shiftKey){const p=r.root;if(!p)return;const f=e.isColumn?e:W(e.getLeafColumns()),m=this.findContainingRange({columns:[p],startRow:u,endRow:h},!0);if(!m){De(o,r.lastCellRange),this.selectColumns(this.calculateColumnsBetween(p,f),u,h);return}this.updateRangeRowBoundary({cellRange:m,boundary:"end",cellPosition:{column:f,...h}});return}l&&(n||!c&&!a)&&this.removeAllCellRanges(!0);const g=(p,f)=>{const m=this.findContainingRange({columns:p,startRow:u,endRow:h},!0);if(m&&d)this.deselectColumnsFromRange(m,p);else{const C=this.selectColumns(p,u,h);C&&(r.lastCellRange=C)}r.root=f};if(e.isColumn)g([e],e);else{const p=e.getDisplayedLeafColumns();g(p,p[0])}}deselectColumnsFromRange(e,t){za(e.columns,t),t.includes(e.startColumn)&&(e.startColumn=e.columns[0]),e.columns.length===0&&De(this.cellRanges,e),this.dispatchChangedEvent(!0,!0)}selectColumns(e,t,s){return this.addCellRange({columns:e,columnStart:e[0],columnEnd:W(e),rowStartIndex:t.rowIndex,rowStartPinned:t.rowPinned,rowEndIndex:s.rowIndex,rowEndPinned:s.rowPinned})}};function A1(e,t){return e!=null?{rowIndex:e,rowPinned:t}:void 0}function mU(e){let t;for(const s of e)(t===void 0||ze(t,s))&&(t=s);return t}function CU(e){let t;for(const s of e)(t===void 0||ze(s,t))&&(t=s);return t}function vU(e,t){const{startRow:s,endRow:i}=e,r=ze(s,i)?i:s,o=t.rowIndex===r.rowIndex&&t.rowPinned===r.rowPinned,n=e.columns[0],a=W(e.columns),l=e.startColumn===n?a:n;return t.column===l&&o}function ud(e,t,s){let i;s==="top"?i=!e.startRow||!e.endRow||ze(e.startRow,e.endRow)?"startRow":"endRow":i=!e.startRow||!e.endRow||ze(e.startRow,e.endRow)?"endRow":"startRow",e[i]=t??void 0}var hd={moduleName:"CellSelection",version:Y,beans:[fU],dynamicBeans:{fillHandle:QW,rangeHandle:JW},apiFunctions:{getCellRanges:tU,addCellRange:sU,clearRangeSelection:M1,clearCellSelection:M1},dependsOn:[le,ta,Wl],css:[eU]},wU={moduleName:"RangeSelection",version:Y,dependsOn:[hd]},bU={tag:"div",cls:"ag-loading",children:[{tag:"span",ref:"eLoadingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eLoadingText",cls:"ag-loading-text"}]},SU=class extends A{constructor(){super(bU),this.eLoadingIcon=x,this.eLoadingText=x}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){this.eLoadingText.textContent=this.getLocaleTextFunc()("loadingError","ERR")}setupLoading(){const e=_("groupLoading",this.beans,null);e&&this.eLoadingIcon.appendChild(e),this.eLoadingText.textContent=this.getLocaleTextFunc()("loadingOoo","Loading...")}refresh(e){return!1}},yU={moduleName:"LoadingCellRenderer",version:Y,userComponents:{agLoadingCellRenderer:SU},icons:{groupLoading:"loading"},dependsOn:[le]};function xU(e){return e.colModel.isPivotMode()}function RU(e,t,s){return e.pivotResultCols?.lookupPivotResultCol(t,s)??null}function FU(e,t){e.valueColsSvc?.setColumns(t,"api")}function EU(e){return e.valueColsSvc?.columns??[]}function PU(e,t){e.valueColsSvc?.removeColumns(t,"api")}function MU(e,t){e.valueColsSvc?.addColumns(t,"api")}function TU(e,t){e.pivotColsSvc?.setColumns(t,"api")}function DU(e,t){e.pivotColsSvc?.removeColumns(t,"api")}function AU(e,t){e.pivotColsSvc?.addColumns(t,"api")}function IU(e){return e.pivotColsSvc?.columns??[]}function kU(e,t){e.pivotResultCols?.setPivotResultCols(t,"api")}function LU(e){const t=e.pivotResultCols?.getPivotResultCols();return t?t.list:null}var I1="PivotRowTotal_",GU=({headerName:e},{headerName:t})=>e&&!t?1:!e&&t?-1:!e&&!t?0:et?1:0,OU=e=>(t,s)=>e(t.headerName,s.headerName),VU=class extends E{constructor(){super(...arguments),this.beanName="pivotColDefSvc"}wireBeans(e){this.colModel=e.colModel,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.colNames=e.colNames}postConstruct(){const e=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=e(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=e()});const t=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=t(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=t()})}createPivotColumnDefs(e){const t=this.createPivotColumnsFromUniqueValues(e);function s(r,o=[]){return r.forEach(n=>{n.children!==void 0?s(n.children,o):o.push(n)}),o}const i=s(t);return this.addRowGroupTotals(t,i),this.addExpandablePivotGroups(t,i),this.addPivotTotalsToGroups(t,i),t}createPivotColumnsFromUniqueValues(e){const t=this.pivotColsSvc?.columns??[],s=t.length;return this.recursivelyBuildGroup(0,e,[],s,t)}recursivelyBuildGroup(e,t,s,i,r){if(e>=i)return this.buildMeasureCols(s);const{pivotComparator:o}=r[e].getColDef(),n=o?OU(o):GU,a=this.valueColsSvc?.columns;if(a?.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&e===i-1){const c=[];for(const d of t.keys()){const u=[...s,d],h=this.createColDef(a[0],d,u);h.columnGroupShow="open",c.push(h)}return c.sort(n),c}const l=[];for(const c of t.keys()){const d=this.pivotDefaultExpanded===-1||e{const i=this.colNames.getDisplayNameForColumn(s,"header"),r=this.createColDef(s,i,e);return r.columnGroupShow="open",r})}addExpandablePivotGroups(e,t){const s=this.gos.get("suppressExpandablePivotGroups");if(s||this.gos.get("pivotColumnGroupTotals"))return;const i=(r,o,n)=>{if("children"in r){const{valueColsSvc:c}=this,{columns:d=[]}=c??{},u=new Map;r.children.forEach(p=>{i(p,o,u)});const h=!r.children.some(p=>p.children),g=h&&d.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(const p of d){const f=this.colNames.getDisplayNameForColumn(p,"header"),m=this.createColDef(p,f,r.pivotKeys);m.pivotTotalColumnIds=u.get(p.getColId()),m.columnGroupShow=s?"open":"closed",m.aggFunc=p.getAggFunc(),(!h||g)&&(r.children.push(m),o.push(m))}this.merge(n,u);return}if(!r.pivotValueColumn)return;const a=r.pivotValueColumn.getColId();n.has(a)?n.get(a).push(r.colId):n.set(a,[r.colId])};e.forEach(r=>{i(r,t,new Map)})}addPivotTotalsToGroups(e,t){if(!this.gos.get("pivotColumnGroupTotals"))return;const s=this.gos.get("pivotColumnGroupTotals")==="after",i=this.valueColsSvc?.columns,r=i?.map(o=>o.getAggFunc());if(!(!r||r.length<1||!this.sameAggFuncs(r))&&i){const o=i[0];e.forEach(n=>{this.recursivelyAddPivotTotal(n,t,o,s)})}}recursivelyAddPivotTotal(e,t,s,i){const r=e;if(!r.children){const n=e;return n.colId?[n.colId]:null}let o=[];if(r.children.forEach(n=>{const a=this.recursivelyAddPivotTotal(n,t,s,i);a&&(o=o.concat(a))}),r.children.length>1){const a=this.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),l=this.createColDef(s,a,e.pivotKeys,!0);l.pivotTotalColumnIds=o,l.aggFunc=s.getAggFunc(),l.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const c=e.children;i?c.push(l):c.unshift(l),t.push(l)}return o}addRowGroupTotals(e,t){if(!this.gos.get("pivotRowTotals"))return;const s=this.gos.get("pivotRowTotals")==="after",r=(this.valueColsSvc?.columns??[]).slice();s||r.reverse();const o=r.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let n=0;no.data?.[o.colDef.field],r.pivotKeys=s,r.pivotValueColumn=e,r.filter===!0&&(r.filter="agNumberColumnFilter"),r}sameAggFuncs(e){if(e.length==1)return!0;for(let t=1;t{const o=[...e.has(i)?e.get(i):[],...s];e.set(i,o)})}generateColumnGroupId(e){return`pivotGroup_${(this.pivotColsSvc?.columns??[]).map(s=>s.getColId()).join("-")}_${e.join("-")}`}generateColumnId(e,t){return`pivot_${(this.pivotColsSvc?.columns??[]).map(i=>i.getColId()).join("-")}_${e.join("-")}_${t}`}createColDefsFromFields(e){const t=new Map;for(let r=0;r{const l=[];for(const[u,h]of n){const g=s(`${r}${this.fieldSeparator}${u}`,u,h,a+1);l.push(g)}if(l.length===0){const u=this.colModel.getColDefCol(o);if(u){const g=this.colNames.getDisplayNameForColumn(u,"header")??o,p=this.createColDef(u,g,void 0,!1);return p.colId=r,p.aggFunc=u.getAggFunc(),p.valueGetter=f=>f.data?.[r],p}return{colId:r,headerName:o,valueGetter:g=>g.data?.[r]}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&l.length===1&&"colId"in l[0]?(l[0].headerName=o,l[0]):{openByDefault:this.pivotDefaultExpanded===-1||a{r.forEach(o=>{if(D(o.children)){const a=o;s&&s(a),i(a.children)}else t&&t(o)})};e&&i(e)}},k1="Exceeded maximum allowed pivot column count.",gd=e=>{const t={};return e.forEach((s,i)=>t[i]=s instanceof Map?gd(s):s),t},NU=class extends E{constructor(){super(...arguments),this.beanName="pivotStage",this.step="pivot",this.refreshProps=["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"],this.uniqueValues=new Map,this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(e){this.valueSvc=e.valueSvc,this.colModel=e.colModel,this.pivotResultCols=e.pivotResultCols,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueColsSvc=e.valueColsSvc,this.pivotColsSvc=e.pivotColsSvc,this.pivotColDefSvc=e.pivotColDefSvc}execute(e){return this.colModel.isPivotActive()?this.executePivotOn(e):this.executePivotOff()}executePivotOff(){return this.aggregationColumnsHashLastTime=null,this.uniqueValues=new Map,this.pivotResultCols.isPivotResultColsPresent()?(this.pivotResultCols.setPivotResultCols(null,"rowModelUpdated"),!0):!1}executePivotOn(e){const t=this.valueColsSvc?.columns.length??1,s=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=s===-1?-1:s/t;let i;try{i=this.bucketUpRowNodes(e)}catch(C){if(C.message===k1)return this.pivotResultCols.setPivotResultCols([],"rowModelUpdated"),this.eventSvc.dispatchEvent({type:"pivotMaxColumnsExceeded",message:C.message}),this.lastTimeFailed=!0,!1;throw C}const r=this.setUniqueValues(i),o=this.valueColsSvc?.columns??[],n=o.map(C=>`${C.getId()}-${C.getColDef().headerName}`).join("#"),a=o.map(C=>C.getAggFunc().toString()).join("#"),l=this.aggregationColumnsHashLastTime!==n,c=this.aggregationFuncsHashLastTime!==a;this.aggregationColumnsHashLastTime=n,this.aggregationFuncsHashLastTime=a;const d=(this.rowGroupColsSvc?.columns??[]).map(C=>C.getId()).join("#"),u=d!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=d;const h=this.gos.get("pivotRowTotals"),g=this.gos.get("pivotColumnGroupTotals"),p=this.gos.get("suppressExpandablePivotGroups"),f=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),m=h!==this.pivotRowTotalsLastTime||g!==this.pivotColumnGroupTotalsLastTime||p!==this.suppressExpandablePivotGroupsLastTime||f!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=h,this.pivotColumnGroupTotalsLastTime=g,this.suppressExpandablePivotGroupsLastTime=p,this.removePivotHeaderRowWhenSingleValueColumnLastTime=f,this.lastTimeFailed||r||l||u||c||m){const C=this.pivotColDefSvc.createPivotColumnDefs(this.uniqueValues);return this.pivotResultCols.setPivotResultCols(C,"rowModelUpdated"),this.lastTimeFailed=!1,!0}return this.lastTimeFailed=!1,!1}setUniqueValues(e){return Ds(gd(this.uniqueValues),gd(e))?!1:(this.uniqueValues=e,!0)}bucketUpRowNodes(e){this.currentUniqueCount=0;const t=new Map;Mt(this.beans.rowModel.rootNode,this.beans.rowModel.hierarchical,e,i=>{i.leafGroup&&(i.childrenMapped=null)});const s=i=>{if(i.leafGroup)this.bucketRowNode(i,t);else{const r=i.childrenAfterFilter;if(r)for(let o=0,n=r.length;othis.maxUniqueValues;if(n&&h)throw new Error(k1)}r.has(u)||r.set(u,[]),r.get(u).push(d)}if(s===t.length-1)return r;const a=new Map;for(const l of r.keys())a.set(l,this.bucketChildren(r.get(l),t,s+1,i.get(l)));return a}},L1={moduleName:"SharedPivot",version:Y,beans:[BU,VU,q0],apiFunctions:{isPivotMode:xU,getPivotResultColumn:RU,setValueColumns:FU,getValueColumns:EU,removeValueColumns:PU,addValueColumns:MU,setPivotColumns:TU,removePivotColumns:DU,addPivotColumns:AU,getPivotColumns:IU,setPivotResultColumns:kU,getPivotResultColumns:LU},dependsOn:[Yp,yh]},G1={moduleName:"Pivot",version:Y,rowModels:["clientSide"],beans:[NU],dependsOn:[L1,Xp,Ma]},O1=e=>{const t=e.split(".");if(t.includes("__proto__"))return()=>{};const s=t.length;return s<2?i=>i?.[e]:i=>{let r=0;do if(i=i?.[t[r++]],r===s)return i;while(typeof i=="object")}},zt=2147483648,Jt=1073741824,pd=536870912,Da=268435455,ef=String.fromCodePoint(31,41150,8291),tf=3,HU=class extends E{constructor(){super(...arguments),this.nestedDataGetter=null,this.parentIdGetter=null,this.nonLeafsById=null,this.nodesToUnselect=null,this.fullReload=!1}postConstruct(){this.onPropChange(null)}onPropChange(e){const t=this.gos;if(!e||e.has("treeDataParentIdField")){const s=t.get("treeDataParentIdField"),i=s?O1(s):null;this.fullReload||(this.fullReload=this.parentIdGetter!==i),this.parentIdGetter=i,i&&(this.nestedDataGetter=null)}if(!e||e.has("treeDataChildrenField")){const s=this.parentIdGetter?"":t.get("treeDataChildrenField"),i=s?O1(s):null;this.fullReload||(this.fullReload=this.nestedDataGetter!==i),this.nestedDataGetter=i}}destroy(){this.nodesToUnselect=null,this.reset(),super.destroy()}reset(){this.clearNonLeafs(),this.deselectHiddenNodes(!1),this.fullReload=!0}clearNonLeafs(){const e=this.nonLeafsById;if(e){for(const t of e.values())t._destroy(!1);e.clear(),this.nonLeafsById=null}}getNonLeaf(e){return this.nonLeafsById?.get(e)}loadGroupData(e){const t=e.key;if(t==null)return e._groupData=null,null;const s={};e._groupData=s;const i=this.beans.showRowGroupCols?.columns;if(i)for(let r=0,o=i.length;r0&&a!==c&&(this.handleCycles(e),this.traverseRoot(e,i)),e.treeNodeFlags=0,this.deselectHiddenNodes(n||r),l}flagUpdatedNodes(e){const{adds:t,updates:s,removals:i}=e;let r=i.length>0;if(t.size>0){r=!0;for(const o of t)o.treeNodeFlags|=Jt}if(s.size>0){r=!0;for(const o of s)o.treeNodeFlags|=Jt}return r}initRowsParents(e){const t=e._leafs,s=t.length;let i=!1;for(let r=0;r=0||i.treeNodeFlags&pd||i.treeParent===null){i.treeNodeFlags=r;break}i.treeNodeFlags=r|pd|e.treeNodeFlags&Jt,e=i}return t}destroyFillerRows(e){const t=this.nonLeafsById;if(t){for(const s of t.values())(s.treeParent===null||!(s.treeNodeFlags&Da))&&(t.delete(s.id),s._destroy(e),this.hideRow(s));t.size===0&&(this.nonLeafsById=null)}}initRowsChildrenSize(e){this.initRowChildrenSize(e);const t=e._leafs,s=t.length;for(let r=0;r=0){if(t!==null){e.childrenAfterGroup=null,e.childrenAfterFilter=null,e.childrenAfterAggFilter=null,e.childrenAfterSort=null;const n=e.sibling;n&&(n.childrenAfterGroup=null,n.childrenAfterFilter=null,n.childrenAfterAggFilter=null,n.childrenAfterSort=null)}}else if(r!==o||t===s)if(!t||t===s){e.childrenAfterGroup=t=new Array(o);const n=e.sibling;n&&(n.childrenAfterGroup=t)}else t.length=o}preprocessRows(e){const t=e._leafs,s=t.length;let i=0,r=!1;for(let o=0;o0&&i?.addRow(e),e._leafs=void 0),n+1}handleCycles(e){const t=new Set,s=o=>{if(t.has(o))return!1;t.add(o);for(const n of o.childrenAfterGroup??[])s(n);return!0};s(e);const i=e.childrenAfterGroup;i.length=0;const r=e._leafs;for(let o=0,n=r.length;o=0;--h){const g=t.get(l.slice(0,i[h]));if(g){u=g,d=h+1;break}}d0?t[r-1]+tf:0,n=t[r];i+="-"+r+"-"+e.slice(o,n),++r}return i+"-"+s+"-"}deselectHiddenNodes(e){const t=this.beans.selectionSvc,s=this.nodesToUnselect,i="rowDataChanged";if(s&&(this.nodesToUnselect=null,t?.setNodesSelected({newValue:!1,nodes:s,suppressFinishActions:!0,source:i})),(s||e)&&t?.updateGroupsFromChildrenSelections?.(i),s){const r=t?.getSelectedNodes()??null;this.eventSvc.dispatchEvent({type:"selectionChanged",source:i,selectedNodes:r,serverSideState:null})}}hideRow(e){e.isSelected()&&(this.nodesToUnselect??(this.nodesToUnselect=[])).push(e),e.parent=null,e.group=!1,e.treeParent=null,e.treeNodeFlags=0,e.childrenAfterGroup=null,e.childrenAfterFilter=null,e.childrenAfterAggFilter=null,e.childrenAfterSort=null,e._leafs=void 0,e._groupData=null,e.aggData=null;const t=e.sibling;t&&(t.childrenAfterGroup=null,t.childrenAfterFilter=null,t.childrenAfterAggFilter=null,t.childrenAfterSort=null),e.updateHasChildren(),e.rowIndex!==null&&e.clearRowTopAndRowIndex()}onShowRowGroupColsSetChanged(){const e=this.beans.rowModel.rootNode._leafs;if(!e)return;for(let s=0,i=e.length;se.sourceRowIndex-t.sourceRowIndex,_U=(e,t)=>{t._expanded!==void 0&&e._expanded===void 0&&e.treeParent!==null&&e.sourceRowIndex<0&&(e._expanded=t._expanded)},fd=(e,t)=>{const s=e._groupData!==void 0;e.key=t,e.groupValue=t;const i=e.sibling;i&&(i.key=t),s&&(e._groupData=void 0,e.setData(e.data))},V1={moduleName:"SharedTreeData",version:Y,dependsOn:[le,Up,d1,jp,qp]},B1={moduleName:"TreeData",version:Y,dynamicBeans:{treeGroupStrategy:HU},rowModels:["clientSide"],dependsOn:[V1,$p,Ma,u1]},WU="ag-Grid-MissingKey",UU=class extends E{constructor(){super(...arguments),this.beanName="ssrmBlockUtils"}wireBeans(e){this.valueSvc=e.valueSvc,this.showRowGroupCols=e.showRowGroupCols,this.nodeManager=e.ssrmNodeManager,this.expansionSvc=e.expansionSvc,this.serverSideRowModel=e.rowModel,this.storeFactory=e.ssrmStoreFactory}createRowNode(e){const t=new lt(this.beans),s=e.rowHeight!=null?e.rowHeight:Et(this.beans);return t.setRowHeight(s),t.group=e.group,t.leafGroup=e.leafGroup,t.level=e.level,t.uiLevel=e.level,t.parent=e.parent,t.stub=!0,t.__needsRefreshWhenVisible=!1,t.group&&(t.expanded=!1,t.field=e.field,t.rowGroupColumn=e.rowGroupColumn,t.rowGroupIndex=e.level),t}destroyRowNode(e,t=!1){e.childStore&&!t&&(this.destroyBean(e.childStore),e.childStore=null);const s=e.sibling;s&&!e.footer&&this.destroyRowNode(s,!1),e._destroy(!0),e.id!=null&&this.nodeManager.removeNode(e)}setTreeGroupInfo(e){e.updateHasChildren();const t=this.gos.get("getServerSideGroupKey"),s=e.hasChildren();s&&t!=null&&(e.key=t(e.data)),!s&&e.childStore!=null&&(this.destroyBean(e.childStore),e.childStore=null,e.master||(e.expanded=!1))}setRowGroupInfo(e){if(e.key=this.valueSvc.getValue(e.rowGroupColumn,e,"data"),(e.key===null||e.key===void 0)&&Jr(()=>{F(190,{rowGroupId:e.rowGroupColumn?.getId(),data:e.data})},"SSBlock-BadKey"),this.gos.get("groupAllowUnbalanced")&&e.key===""){const r=this.serverSideRowModel.getParams();e.childStore=this.createBean(this.storeFactory.createStore(r,e))}vr(this.beans.gos)({node:e})&&(gi(e,this.beans),e.sibling&&(e.sibling.uiLevel=e.uiLevel+1))}setMasterDetailInfo(e){const t=this.gos.get("isRowMaster");t!=null?e.master=t(e.data):e.master=!0}updateDataIntoRowNode(e,t){e.updateData(t),this.gos.get("treeData")?(this.setTreeGroupInfo(e),this.setChildCountIntoRowNode(e),this.updateRowFooter(e)):e.group?(this.setChildCountIntoRowNode(e),this.updateRowFooter(e)):this.gos.get("masterDetail")}updateRowFooter(e){if(!e.footer){if(e.group&&vr(this.beans.gos)({node:e})&&!e.sibling){gi(e,this.beans);return}e.sibling&&Wp(e)}}setDataIntoRowNode(e,t,s,i){e.stub=!1;const r=this.gos.get("treeData");e.setDataAndId(t,s);const o=e.group;(r||!o)&&this.gos.get("masterDetail")&&this.setMasterDetailInfo(e),r?this.setTreeGroupInfo(e):o&&this.setRowGroupInfo(e),(r||o)&&(this.setGroupDataIntoRowNode(e),this.setChildCountIntoRowNode(e)),D(t)&&(e.setRowHeight(Ze(this.beans,e,!1,i).height),e.sibling?.setRowHeight(Ze(this.beans,e.sibling,!1,i).height))}setChildCountIntoRowNode(e){const t=this.gos.get("getChildCount");t&&e.setAllChildrenCount(t(e.data))}setGroupDataIntoRowNode(e){const t=e.key;e.groupValue=t,e.sibling&&(e.sibling.groupValue=t);const s=this.showRowGroupCols?.columns;if(!s)return;const i=this.gos.get("treeData");for(const r of s){let o=e._groupData;if(o||(o={},e._groupData=o),i)o[r.getColId()]=t;else if(r.isRowGroupDisplayed(e.rowGroupColumn.getId())){const n=this.valueSvc.getValue(e.rowGroupColumn,e,"data");o[r.getColId()]=n}}}clearDisplayIndex(e){e.clearRowTopAndRowIndex(),e.hasChildren()&&!!e.childStore&&e.childStore?.clearDisplayIndexes(),e.master&&e.detailNode&&e.detailNode?.clearRowTopAndRowIndex()}setDisplayIndex(e,t,s,i){const r=this.gos.get("groupAllowUnbalanced")&&e.group&&e.key==="";if(this.gos.get("groupHideOpenParents")&&e.group&&e.expanded||r?(e.setRowIndex(null),e.setRowTop(null)):(e.setRowIndex(t.value++),e.setRowTop(s.value),s.value+=e.rowHeight),e.setUiLevel(i),e.footer)return;if(e.master&&(e.expanded&&e.detailNode?(e.detailNode.setRowIndex(t.value++),e.detailNode.setRowTop(s.value),s.value+=e.detailNode.rowHeight):e.detailNode&&e.detailNode.clearRowTopAndRowIndex()),e.hasChildren()&&!!e.childStore){const l=e.childStore;e.expanded||r?l.setDisplayIndexes(t,s,r?i:i+1):l.clearDisplayIndexes()}}extractRowBounds(e,t){const s=i=>({rowHeight:i.rowHeight,rowTop:i.rowTop});if(e.rowIndex===t)return s(e);if(e.hasChildren()&&e.expanded&&e.childStore){const i=e.childStore;if(i.isDisplayIndexInStore(t))return i.getRowBounds(t)}else if(e.master&&e.expanded&&e.detailNode&&e.detailNode.rowIndex===t)return s(e.detailNode)}isPixelInNodeRange(e,t){return!D(e.rowTop)||!D(e.rowHeight)?!1:t>=e.rowTop&&t=0;)s.key===""?t.push(WU):t.push(s.key),s=s.parent;if(t.length>0)return t.reverse().join("-")}checkOpenByDefault(e){const t=!!this.expansionSvc?.isNodeExpanded(e),s=e._expanded;!!s!==t?e.setExpanded(t):s===void 0&&(e._expanded=t)}},$U=class extends E{constructor(){super(...arguments),this.beanName="ssrmExpandListener"}postConstruct(){ft(this.gos)&&this.addManagedEventListeners({rowExpansionStateChanged:this.onRowExpandStateChanged.bind(this)})}onRowExpandStateChanged(){const e=this.beans,t=e.expansionSvc;e.rowModel.forEachNode(s=>{t.updateExpandedState(s)}),this.eventSvc.dispatchEvent({type:"storeUpdated"})}},KU=class extends E{constructor(){super(...arguments),this.beanName="ssrmFilterListener"}wireBeans(e){this.serverSideRowModel=e.rowModel,this.filterManager=e.filterManager,this.listenerUtils=e.ssrmListenerUtils}postConstruct(){ft(this.gos)&&this.addManagedEventListeners({advancedFilterEnabledChanged:()=>this.onFilterChanged(!0),filterChanged:()=>this.onFilterChanged()})}onFilterChanged(e){const t=this.serverSideRowModel.getParams();if(!t)return;const s=t.filterModel;let i,r;if(this.filterManager?.isAdvFilterEnabled()){i=this.filterManager.getAdvFilterModel();const l=e?Object.keys(s??{}):this.getAdvancedFilterColumns(s),c=this.getAdvancedFilterColumns(i);for(const d of l)c.add(d);r=Array.from(c)}else if(i=this.filterManager?.getFilterModel()??{},e){const l=this.getAdvancedFilterColumns(s);for(const c of Object.keys(i))l.add(c);r=Array.from(l)}else r=this.findChangedColumns(s,i);const o=this.listenerUtils.isSortingWithValueColumn(r),n=this.listenerUtils.isSortingWithSecondaryColumn(r),a={valueColChanged:o,secondaryColChanged:n,changedColumns:r};this.serverSideRowModel.refreshAfterFilter(i,a)}findChangedColumns(e,t){const s={};for(const r of Object.keys(e))s[r]=!0;for(const r of Object.keys(t))s[r]=!0;const i=[];for(const r of Object.keys(s))!Ds(e[r],t[r])&&i.push(r);return i}getAdvancedFilterColumns(e){const t=new Set;if(!e)return t;const s=i=>{if(i.filterType==="join")for(const r of i.conditions)s(r);else t.add(i.colId)};return s(e),t}},jU=class extends E{constructor(){super(...arguments),this.beanName="ssrmListenerUtils"}wireBeans(e){this.pivotResultCols=e.pivotResultCols,this.valueColsSvc=e.valueColsSvc}isSortingWithValueColumn(e){const t=(this.valueColsSvc?.columns??[]).map(s=>s.getColId());for(let s=0;s-1)return!0;return!1}isSortingWithSecondaryColumn(e){const t=this.pivotResultCols?.getPivotResultCols();if(!t)return!1;const s=t.list.map(i=>i.getColId());for(let i=0;i-1)return!0;return!1}},qU=class extends E{constructor(){super(...arguments),this.beanName="ssrmSortSvc"}wireBeans(e){this.sortSvc=e.sortSvc,this.serverSideRowModel=e.rowModel,this.listenerUtils=e.ssrmListenerUtils}postConstruct(){ft(this.gos)&&this.addManagedEventListeners({sortChanged:this.onSortChanged.bind(this)})}onSortChanged(){const e=this.serverSideRowModel.getParams();if(!e)return;const t=this.sortSvc.getSortModel(),s=e.sortModel,i=this.findChangedColumnsInSort(t,s),r=this.listenerUtils.isSortingWithValueColumn(i),o=this.listenerUtils.isSortingWithSecondaryColumn(i),n={valueColChanged:r,secondaryColChanged:o,changedColumns:i};this.serverSideRowModel.refreshAfterSort(t,n)}findChangedColumnsInSort(e,t){let s=[];for(const o of[e,t])if(o){const n=o.map(a=>a.colId);s=s.concat(n)}const i=(o,n)=>{const a=o?o.sort:null,l=n?n.sort:null;return a!==l},r=(o,n)=>{const a=o?t.indexOf(o):-1,l=n?e.indexOf(n):-1;return a!==l};return s.filter(o=>{const n=t.find(l=>l.colId===o),a=e.find(l=>l.colId===o);return i(n,a)||r(n,a)})}},YU=class extends E{constructor(){super(...arguments),this.beanName="ssrmNodeManager",this.rowNodes=new Map}addRowNode(e){const t=e.id;this.rowNodes.has(t)&&F(187,{rowId:t,firstData:this.rowNodes.get(t).data,secondData:e.data}),this.rowNodes.set(t,e)}removeNode(e){const t=e.id;this.rowNodes.delete(t)}destroy(){this.clear(),super.destroy()}clear(){this.rowNodes.clear(),super.destroy()}},XU=class extends E{constructor(){super(...arguments),this.beanName="rowModel",this.hierarchical=!0,this.started=!1,this.managingPivotResultColumns=!1,this.onRowHeightChanged_debounced=Ce(this,this.onRowHeightChanged.bind(this),100)}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.pivotResultCols=e.pivotResultCols,this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.filterManager=e.filterManager,this.sortSvc=e.sortSvc,this.rowRenderer=e.rowRenderer,this.nodeManager=e.ssrmNodeManager,this.storeFactory=e.ssrmStoreFactory,this.pivotColDefSvc=e.pivotColDefSvc}ensureRowHeightsValid(){return!1}start(){this.started=!0,this.updateDatasource()}destroyDatasource(){this.datasource&&(this.datasource.destroy&&this.datasource.destroy(),this.rowRenderer.datasourceChanged(),this.datasource=void 0)}postConstruct(){const e=this.resetRootStore.bind(this);this.addManagedEventListeners({newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onStoreUpdated.bind(this),columnValueChanged:e,columnPivotChanged:e,columnRowGroupChanged:e,columnPivotModeChanged:e}),this.addManagedPropertyListeners(["masterDetail","treeData","removePivotHeaderRowWhenSingleValueColumn","cacheBlockSize"],e),this.addManagedPropertyListeners(["groupAllowUnbalanced","groupTotalRow"],()=>this.onStoreUpdated()),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights()),this.verifyProps(),this.addManagedPropertyListener("serverSideDatasource",()=>this.updateDatasource())}updateDatasource(){const e=this.gos.get("serverSideDatasource");e&&this.setDatasource(e)}verifyProps(){Lt(this.gos)&&!this.gos.exists("getRowId")&&F(188,{feature:"selection"})}setDatasource(e){this.started&&(this.destroyDatasource(),this.datasource=e,this.resetRootStore())}applyRowData(e,t,s){const i=this.getRootStore();if(!i)return;const r=i.getChildStore(s);r&&r.applyRowData(e,t,e.rowData.length)}isLastRowIndexKnown(){const e=this.getRootStore();return e?e.isLastRowIndexKnown():!1}onColumnEverything(){if(!this.storeParams){this.resetRootStore();return}const e=this.columnsToValueObjects(this.rowGroupColsSvc?.columns),t=this.columnsToValueObjects(this.valueColsSvc?.columns),s=this.columnsToValueObjects(this.pivotColsSvc?.columns),i=c=>{const d={};for(const g of c.oldCols)d[g.id]=g;const u=c.newCols.every(g=>{const p=d[g.id];return p&&delete d[g.id],p&&p.field===g.field&&p.aggFunc===g.aggFunc}),h=!c.allowRemovedColumns&&!!Object.values(d).length;return u&&!h},r=!Ds(this.storeParams.sortModel,this.sortSvc?.getSortModel()??[]),o=!i({oldCols:this.storeParams.rowGroupCols,newCols:e}),n=!i({oldCols:this.storeParams.pivotCols,newCols:s}),a=!!e?.length&&!i({oldCols:this.storeParams.valueCols,newCols:t,allowRemovedColumns:!0});if(r||o||n||a)this.resetRootStore();else{const c=this.createStoreParams();this.storeParams.rowGroupCols=c.rowGroupCols,this.storeParams.pivotCols=c.pivotCols,this.storeParams.valueCols=c.valueCols}}destroyRootStore(){this.rootNode?.childStore&&(this.rootNode.childStore=this.destroyBean(this.rootNode.childStore),this.nodeManager.clear())}refreshAfterSort(e,t){this.storeParams&&(this.storeParams.sortModel=e);const s=this.getRootStore();s&&(s.refreshAfterSort(t),this.onStoreUpdated())}generateSecondaryColumns(e){if(!this.pivotColDefSvc){this.gos.assertModuleRegistered("SharedPivot",2);return}const t=this.pivotColDefSvc.createColDefsFromFields(e);this.managingPivotResultColumns=!0,this.pivotResultCols?.setPivotResultCols(t,"rowModelUpdated")}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes(),t=Ze(this.beans,this.rootNode);if(this.rootNode.setRowHeight(t.height,t.estimated),this.rootNode.sibling){const s=Ze(this.beans,this.rootNode.sibling);this.rootNode.sibling.setRowHeight(s.height,s.estimated)}e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{const s=Ze(this.beans,t);t.setRowHeight(s.height,s.estimated);const i=t.detailNode;if(i){const r=Ze(this.beans,i);i.setRowHeight(r.height,r.estimated)}if(t.sibling){const r=Ze(this.beans,t.sibling);i?.setRowHeight(r.height,r.estimated)}e=!0}),e}resetRootStore(){this.destroyRootStore(),this.rootNode=new lt(this.beans),this.rootNode.group=!0,this.rootNode.level=-1,this.datasource&&(this.storeParams=this.createStoreParams(),this.rootNode.childStore=this.createBean(this.storeFactory.createStore(this.storeParams,this.rootNode)),this.updateRowIndexesAndBounds()),this.managingPivotResultColumns&&(this.pivotResultCols?.setPivotResultCols(null,"api"),this.managingPivotResultColumns=!1),this.dispatchModelUpdated(!0)}columnsToValueObjects(e=[]){return e.map(t=>({id:t.getId(),aggFunc:t.getAggFunc(),displayName:this.colNames.getDisplayNameForColumn(t,"model"),field:t.getColDef().field}))}createStoreParams(){const e=this.columnsToValueObjects(this.rowGroupColsSvc?.columns),t=this.columnsToValueObjects(this.valueColsSvc?.columns),s=this.columnsToValueObjects(this.pivotColsSvc?.columns),i=dl(this.gos);return{valueCols:t,rowGroupCols:e,pivotCols:s,pivotMode:this.colModel.isPivotMode(),filterModel:this.filterManager?.isAdvFilterEnabled()?this.filterManager?.getAdvFilterModel():this.filterManager?.getFilterModel()??{},sortModel:this.sortSvc?.getSortModel()??[],datasource:this.datasource,lastAccessedSequence:{value:0},dynamicRowHeight:i}}getParams(){return this.storeParams}dispatchModelUpdated(e=!1){this.eventSvc.dispatchEvent({type:"modelUpdated",animate:!e,keepRenderedRows:!e,newPage:!1,newData:!1})}onStoreUpdated(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()}onRowHeightChanged(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()}updateRowIndexesAndBounds(){const e=this.getRootStore();e&&e.setDisplayIndexes({value:0},{value:0},0)}retryLoads(){const e=this.getRootStore();e&&(e.retryLoads(),this.onStoreUpdated())}getRow(e){const t=this.getRootStore();if(t)return t.getRowUsingDisplayIndex(e)}refreshAfterFilter(e,t){this.storeParams&&(this.storeParams.filterModel=e);const s=this.getRootStore();s&&(s.refreshAfterFilter(t),this.onStoreUpdated())}getRootStore(){return this.rootNode?.childStore}getRowCount(){const e=this.getRootStore();return e?e.getDisplayIndexEnd():0}getTopLevelRowCount(){const e=this.getRootStore();return e?e.getRowCount():1}getTopLevelRowDisplayedIndex(e){const t=this.getRootStore();return t?t.getTopLevelRowDisplayedIndex(e):e}getRowBounds(e){const t=this.getRootStore();return t?t.getRowBounds(e):{rowTop:0,rowHeight:Et(this.beans)}}getBlockStates(){const e=this.getRootStore();if(!e)return;const t={};return e.forEachStoreDeep(s=>{const i=s.getBlockStates();for(const r of Object.keys(i))t[r]=i[r]}),t}getRowIndexAtPixel(e){const t=this.getRootStore();return e<=0||!t?0:t.getRowIndexAtPixel(e)}isEmpty(){return!1}getOverlayType(){return this.getRootStore()?.getDisplayIndexEnd()===0?this.filterManager?.isAnyFilterPresent()?"noMatchingRows":"noRows":null}isRowsToRender(){return this.getRootStore()!=null&&this.getRowCount()>0}getType(){return"serverSide"}forEachNode(e){const t=this.getRootStore();t&&t.forEachNodeDeep(e)}forEachDisplayedNode(e){const t=(s,i)=>{s.stub||!s.displayed||e(s,i)};this.forEachNode(t)}forEachNodeAfterFilterAndSort(e,t=!1){const s=this.getRootStore();s&&s.forEachNodeDeepAfterFilterAndSort(e,void 0,t)}executeOnStore(e,t){if(!this.started)return!1;const s=this.getRootStore();if(!s)return!0;const i=s.getChildStore(e);return i&&t(i),!0}refreshStore(e={}){const t=e.route?e.route:[];this.executeOnStore(t,s=>s.refreshStore(e.purge==!0))}getStoreState(){const e=[],t=this.getRootStore();return t&&t.addStoreStates(e),e}getNodesInRangeForSelection(e,t){const s=e.rowIndex,i=t.rowIndex;if(s===null&&i===null)return[];if(i===null)return e?[e]:[];if(s===null)return[t];const r=[],[o,n]=[s,i].sort((a,l)=>a-l);return this.forEachNode(a=>{const l=a.rowIndex;l==null||a.stub||l>=o&&l<=n&&r.push(a)}),r.length!==n-o+1?null:r}getRowNode(e){let t;return this.forEachNode(s=>{s.id===e&&(t=s),s.detailNode&&s.detailNode.id===e&&(t=s.detailNode)}),t}isRowPresent(e){return!!this.getRowNode(e.id)}setRowCount(e,t){const s=this.getRootStore();s&&s.setRowCount(e,t)}destroy(){this.destroyDatasource(),this.destroyRootStore(),super.destroy()}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}};function ZU(e){return e.selectionSvc?.getSelectionState()??null}function QU(e,t){e.selectionSvc?.setSelectionState(t,"api")}function JU(e,t){return e.ssrmTxnManager?.applyTransaction(t)}function e$(e,t){const s=t.startRow??0,i=t.route??[];if(s<0){F(189,{startRow:s});return}co(e)?.applyRowData(t.successParams,s,i)}function t$(e,t,s){return e.ssrmTxnManager?.applyTransactionAsync(t,s)}function s$(e){co(e)?.retryLoads()}function i$(e){return e.ssrmTxnManager?.flushAsyncTransactions()}function r$(e,t){co(e)?.refreshStore(t)}function o$(e){return co(e)?.getStoreState()??[]}var md=class extends E{constructor(){super(...arguments),this.name="expand",this.expanded=new Set,this.collapsed=new Set,this.initialState=new Map}setExpandedState({expandedRowGroupIds:e,collapsedRowGroupIds:t}){this.expanded=new Set(e),this.collapsed=new Set(t);for(const s of this.expanded)this.initialState.set(s,!1);for(const s of this.collapsed)this.initialState.set(s,!0)}getExpandedState(){return{expandedRowGroupIds:Array.from(this.expanded),collapsedRowGroupIds:Array.from(this.collapsed)}}setRowExpanded(e,t){const s=e.id,i=this.initialState.get(s)===t;if(t){this.collapsed.delete(s),i||this.expanded.add(s);return}this.expanded.delete(s),i||this.collapsed.add(s)}isRowExpanded(e){const t=e.id;if(this.expanded.has(t))return!0;if(this.collapsed.has(t))return!1;const s=this.initialState.get(t);if(s!=null)return s;const i=this.getInitialRowState(e);return this.initialState.set(t,i),i}getInitialRowState(e){if(!e.isExpandable())return!1;const t=this.gos.getCallback("isServerSideGroupOpenByDefault");if(!t)return!1;const s={data:e.data,rowNode:e};return t(s)}isRowInitialised(e){return this.initialState.has(e)}expandAll(e){this.beans.rowModel.forEachNode(t=>{this.setRowExpanded(t,e)})}},N1=class extends E{constructor(){super(...arguments),this.name="expandAll",this.allExpanded=void 0,this.flipped=new Set}setExpandedState(e){this.allExpanded=e.expandAll,this.flipped=new Set(e.invertedRowGroupIds)}getExpandedState(){return{expandAll:this.allExpanded,invertedRowGroupIds:Array.from(this.flipped)}}setRowExpanded(e,t){const s=e.id;if(t===this.allExpanded){this.flipped.delete(s);return}this.flipped.add(s)}isRowExpanded(e){const t=e.id;return this.allExpanded!==this.flipped.has(t)}isRowInitialised(){return!0}expandAll(e){this.allExpanded=e,this.flipped.clear()}},n$=class extends Q0{constructor(){super(...arguments),this.beanName="expansionSvc"}wireBeans(e){this.serverSideRowModel=e.rowModel,this.storeFactory=e.ssrmStoreFactory}setStrategy(e){this.destroyBean(this.strategy),this.strategy=this.createManagedBean(e)}postConstruct(){const e=()=>{this.setStrategy(new md)};this.addManagedEventListeners({columnRowGroupChanged:e,columnPivotChanged:e,columnPivotModeChanged:e}),this.addManagedPropertyListener("ssrmExpandAllAffectsAllRows",t=>{t.currentValue||(this.setStrategy(new md),this.updateAllNodes(),this.dispatchStateUpdatedEvent())}),e()}setExpansionState(e){const t="expandAll"in e,s=this.isExpandAllStrategy(this.strategy);t!==s&&this.setStrategy(t?new N1:new md),this.strategy.setExpandedState(e),this.dispatchStateUpdatedEvent(),this.updateAllNodes()}getExpansionState(){return this.strategy.getExpandedState()}updateAllNodes(){this.serverSideRowModel.forEachNode(e=>{super.setExpanded(e,this.isNodeExpanded(e))})}isExpanded(e){let t=e._expanded;return t===null&&(t=this.defaultExpanded(e),e._expanded=t),t}isNodeExpanded(e){return this.strategy.isRowExpanded(e)}setExpanded(e,t,s,i){this.strategy.setRowExpanded(e,t),super.setExpanded(e,t,s),this.dispatchStateUpdatedEvent(),this.updateExpandedState(e)}resetExpansion(){this.setStrategy(new md),this.updateAllNodes(),this.dispatchStateUpdatedEvent()}expandAll(e){const t=this.beans.gos.get("ssrmExpandAllAffectsAllRows");!this.isExpandAllStrategy(this.strategy)&&t&&this.setStrategy(new N1),this.strategy.expandAll(e),this.updateAllNodes(),this.dispatchStateUpdatedEvent(),this.beans.eventSvc.dispatchEvent({type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"})}isExpandAllStrategy(e){return e.name==="expandAll"}onGroupExpandedOrCollapsed(){}setDetailsExpansionState(e){const{gos:t}=this.beans;if(!t.get("ssrmExpandAllAffectsAllRows"))return;const s=this.getExpansionState();if(s.expandAll===void 0)return;const r=s.expandAll&&s.invertedRowGroupIds.length===0;if((!s.expandAll&&s.invertedRowGroupIds.length===0)!==r)return r?e.expandAll():e.collapseAll()}dispatchExpandedEvent(e){this.eventSvc.dispatchEvent(e),this.beans.rowRenderer.refreshRowByNode(e.node)}updateExpandedState(e){const t=e.childStore;if(e.expanded){if(e.master&&!e.detailNode&&(e.detailNode=this.createDetailNode(e)),!t&&e.hasChildren()){const s=this.serverSideRowModel.getParams();e.childStore=this.createBean(this.storeFactory.createStore(s,e))}}else t&&this.gos.get("purgeClosedRowNodes")&&(e.childStore=this.destroyBean(t))}createDetailNode(e){const t=new lt(this.beans);t.detail=!0,t.selectable=!1,t.parent=e,D(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1;const s=200,i=Ze(this.beans,t).height;return t.rowHeight=i||s,t}},sf=class extends E{constructor(e){super(),this.selectionCtx=e,this.selectedState={selectAll:!1,toggledNodes:new Set},this.selectAllUsed=!1,this.selectedNodes={}}getSelectedState(){return{selectAll:this.selectedState.selectAll,toggledNodes:[...this.selectedState.toggledNodes]}}setSelectedState(e){if(typeof e!="object"){Q(116);return}if(!("selectAll"in e)){Q(116);return}if(typeof e.selectAll!="boolean"){Q(117);return}if(!("toggledNodes"in e)||!Array.isArray(e.toggledNodes))return F(197);const t={selectAll:e.selectAll,toggledNodes:new Set};e.toggledNodes.forEach(i=>{typeof i=="string"?t.toggledNodes.add(i):F(196,{key:i})});const s=t.selectAll||t.toggledNodes.size>1;if(gl(this.gos)&&!ks(this.gos)&&s){F(130);return}this.selectedState=t}deleteSelectionStateFromParent(e,t){if(this.selectedState.toggledNodes.size===0)return!1;let s=!1;for(const i of t)this.selectedState.toggledNodes.delete(i)&&(s=!0);return s}setNodesSelected(e){const{nodes:t,clearSelection:s,newValue:i,source:r}=e;if(t.length===0)return 0;const o=s&&i;if(!ks(this.gos)||o){if(t.length>1)return Q(130),0;const a=t[0],l=a.footer?a.sibling:a;return i&&l.selectable?(this.selectedNodes={[l.id]:l},this.selectedState={selectAll:!1,toggledNodes:new Set([l.id])}):(this.selectedNodes={},this.selectedState={selectAll:!1,toggledNodes:new Set}),1}const n=(a,l=i)=>{const c=a.footer?a.sibling:a;l&&c.selectable?this.selectedNodes[c.id]=c:delete this.selectedNodes[c.id],l===this.selectedState.selectAll||!c.selectable?this.selectedState.toggledNodes.delete(c.id):this.selectedState.toggledNodes.add(c.id)};for(const a of t)n(a);return t.length===1&&r==="api"&&this.selectionCtx.setRoot(t[0].footer?t[0].sibling:t[0]),1}processNewRow(e){this.selectedNodes[e.id]&&(this.selectedNodes[e.id]=e)}isNodeSelected(e){const t=this.selectedState.toggledNodes.has(e.id);return this.selectedState.selectAll?!t:t}getSelectedNodes(e=!1,t=!0){const{selectedState:{selectAll:s},selectedNodes:i,selectAllUsed:r}=this;return t&&r&&F(199),e&&s?null:Object.values(i)}getSelectedRows(){return(this.getSelectedNodes()??[]).map(e=>e.data)}getSelectionCount(){return this.selectedState.selectAll?-1:this.selectedState.toggledNodes.size}isEmpty(){return!this.selectedState.selectAll&&!this.selectedState.toggledNodes?.size}selectAllRowNodes(){this.reset(!0)}deselectAllRowNodes(){this.reset(!1)}reset(e){this.selectedState={selectAll:e,toggledNodes:new Set},this.selectedNodes={},this.selectAllUsed||(this.selectAllUsed=e)}getSelectAllState(){return this.selectedState.selectAll?this.selectedState.toggledNodes.size>0?null:!0:this.selectedState.toggledNodes.size>0?null:!1}},Cd=class extends E{constructor(e){super(),this.selectionCtx=e,this.selectedState={selectAllChildren:!1,toggledNodes:new Map}}wireBeans(e){this.rowModel=e.rowModel,this.rowGroupColsSvc=e.rowGroupColsSvc,this.filterManager=e.filterManager,this.selectionSvc=e.selectionSvc}postConstruct(){this.addManagedEventListeners({modelUpdated:()=>this.removeRedundantState(),columnRowGroupChanged:()=>this.selectionSvc.reset("rowGroupChanged")})}getSelectedState(){const{gos:e,rowGroupColsSvc:t,selectedState:s}=this,i=e.get("treeData"),r=(o,n,a)=>{const l={nodeId:a};if((i||t&&n<=t.columns.length)&&(l.selectAllChildren=o.selectAllChildren),o.toggledNodes.size){const c=[];o.toggledNodes.forEach((d,u)=>{const h=r(d,n+1,u);c.push(h)}),l.toggledNodes=c}return l};return r(s,0)}setSelectedState(e){if("selectAll"in e){Q(111);return}const t=(s,i)=>{if(typeof s!="object")throw Q(243),new Error;if("selectAllChildren"in s&&typeof s.selectAllChildren!="boolean")throw Q(244),new Error;if("toggledNodes"in s){if(!Array.isArray(s.toggledNodes))throw Q(245),new Error;if(!s.toggledNodes.every(l=>typeof l=="object"&&"nodeId"in l&&typeof l.nodeId=="string"))throw Q(246),new Error}const r=s.selectAllChildren??!i,o=s.toggledNodes?.map(a=>[a.nodeId,t(a,r)]);if(o?.some(([,a])=>r===a.selectAllChildren&&a.toggledNodes.size===0))throw Q(247),new Error;return{selectAllChildren:r,toggledNodes:new Map(o)}};try{this.selectedState=t(e,!!e.selectAllChildren)}catch{}}deleteSelectionStateFromParent(e,t){let s=this.selectedState;const i=[...e];for(;s&&i.length;)s=s.toggledNodes.get(i.pop());if(!s)return!1;let r=!1;for(const o of t)s?.toggledNodes.delete(o)&&(r=!0);return r&&this.removeRedundantState(),r}setNodesSelected({nodes:e,newValue:t,clearSelection:s,source:i}){if(e.length===0)return 0;const r=s&&t;if(!ks(this.gos)||r){if(e.length>1)return Q(130),0;this.deselectAllRowNodes()}for(const o of e){const n=o.footer?o.sibling:o,a=this.getRouteToNode(n);this.recursivelySelectNode(a,this.selectedState,t)}return this.removeRedundantState(),e.length===1&&i==="api"&&this.selectionCtx.setRoot(e[0].footer?e[0].sibling:e[0]),1}isNodeSelected(e){const t=this.getRouteToNode(e);return this.isNodePathSelected(t,this.selectedState)}isNodePathSelected([e,...t],s){if(t.length===0){const i=s.toggledNodes.has(e.id);return e.hasChildren()&&s.toggledNodes.get(e.id)?.toggledNodes.size?void 0:s.selectAllChildren?!i:i}if(s.toggledNodes.has(e.id)){const i=s.toggledNodes.get(e.id);if(i)return this.isNodePathSelected(t,i)}return s.selectAllChildren}getRouteToNode(e){const t=[];let s=e;for(;s.parent;)t.push(s),s=s.parent;return t.reverse()}removeRedundantState(){if(this.filterManager?.isAnyFilterPresent())return;const e=(t=this.selectedState,s,i)=>{if(t.toggledNodes.forEach((n,a)=>{e(n,a,t)}),s){const a=this.rowModel.getRowNode(s)?.childStore;if(a?.isLastRowIndexKnown()&&t.toggledNodes.size>=a.getRowCount()){for(const d of t.toggledNodes.entries()){const[u,h]=d;if(h.toggledNodes.size>0||!this.rowModel.getRowNode(u))return}t.selectAllChildren=!t.selectAllChildren,t.toggledNodes.clear()}}const r=t.toggledNodes.size===0,o=i?.selectAllChildren===t.selectAllChildren;r&&o&&i?.toggledNodes.delete(s)};e()}recursivelySelectNode([e,...t],s,i){if(!e)return;if(!t.length){const a=e.selectable;if(s.selectAllChildren===i||!a){s.toggledNodes.delete(e.id);return}const c={selectAllChildren:i,toggledNodes:new Map};s.toggledNodes.set(e.id,c);return}const o=s.toggledNodes.has(e.id),n=s.toggledNodes.get(e.id)??{selectAllChildren:s.selectAllChildren,toggledNodes:new Map};o||s.toggledNodes.set(e.id,n),this.recursivelySelectNode(t,n,i),s.selectAllChildren===n.selectAllChildren&&n.toggledNodes.size===0&&s.toggledNodes.delete(e.id)}getSelectedNodes(e=!1){if(F(202),this.selectedState.selectAllChildren&&e)return null;const t=[];return this.rowModel.forEachNode(s=>{s.isSelected()&&t.push(s)}),t}processNewRow(){}getSelectedRows(){return this.getSelectedNodes()?.map(e=>e.data)??[]}getSelectionCount(){return-1}isEmpty(){return!this.selectedState.selectAllChildren&&!this.selectedState.toggledNodes?.size}selectAllRowNodes(){this.reset(!0)}deselectAllRowNodes(){this.reset(!1)}reset(e){this.selectedState={selectAllChildren:e,toggledNodes:new Map}}getSelectAllState(){return this.selectedState.selectAllChildren?this.selectedState.toggledNodes.size>0?null:!0:this.selectedState.toggledNodes.size>0?null:!1}},a$=class extends Xg{constructor(){super(...arguments),this.beanName="selectionSvc"}postConstruct(){super.postConstruct(),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{const s=Pi(this.gos),i=s&&this.selectionStrategy instanceof sf?Cd:!s&&this.selectionStrategy instanceof Cd?sf:void 0;i&&(this.destroyBean(this.selectionStrategy),this.selectionStrategy=this.createManagedBean(new i(this.selectionCtx)),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged("api"))}),this.addManagedPropertyListeners(["rowSelection"],()=>{const s=wr(this.gos);s!==this.selectionMode&&(this.selectionMode=s,this.deselectAllRowNodes({source:"api"}))}),this.selectionMode=wr(this.gos);const t=Pi(this.gos)?Cd:sf;this.selectionStrategy=this.createManagedBean(new t(this.selectionCtx))}handleSelectionEvent(e,t,s){if(this.isRowSelectionBlocked(t))return 0;let i=0;const r=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,s);return r==null?0:(this.selectionCtx.selectAll=!1,"select"in r?(r.reset?this.selectionStrategy.deselectAllRowNodes({source:"api"}):this.selectionStrategy.setNodesSelected({nodes:r.deselect,newValue:!1,source:s}),i=this.selectionStrategy.setNodesSelected({nodes:r.select,newValue:!0,source:s})):i=this.selectionStrategy.setNodesSelected({nodes:[r.node],newValue:r.newValue,clearSelection:r.clearSelection,event:e,source:s}),this.shotgunResetNodeSelectionState(s),this.dispatchSelectionChanged(s),i)}getSelectionState(){return this.selectionStrategy.getSelectedState()}setSelectionState(e,t){if(!Lt(this.gos)){e&&F(132);return}Array.isArray(e)||(e?(this.selectionStrategy.setSelectedState(e),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged(t)):this.deselectAllRowNodes({source:t}))}setNodesSelected(e){if(!Lt(this.gos)&&e.newValue)return F(132),0;const{nodes:t,...s}=e;if(t.length>1&&this.selectionMode!=="multiRow")return F(130),0;const i={nodes:t.filter(o=>o.selectable),...s};if(!i.nodes.length)return 0;const r=this.selectionStrategy.setNodesSelected(i);return this.shotgunResetNodeSelectionState(i.source),this.dispatchSelectionChanged(i.source),r}deleteSelectionStateFromParent(e,t){this.selectionStrategy.deleteSelectionStateFromParent(e,t)&&(this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged("api"))}shotgunResetNodeSelectionState(e){this.beans.rowModel.forEachNode(t=>{if(t.stub)return;const s=this.selectionStrategy.isNodeSelected(t);s!==t.isSelected()&&this.selectRowNode(t,s,void 0,e)})}getSelectedNodes(){return this.selectionStrategy.getSelectedNodes()??[]}getSelectedRows(){return this.selectionStrategy.getSelectedRows()}getSelectionCount(){return this.selectionStrategy.getSelectionCount()}syncInRowNode(e){this.selectionStrategy.processNewRow(e);const t=this.selectionStrategy.isNodeSelected(e);if(t!=!1&&!e.selectable){this.selectionStrategy.setNodesSelected({nodes:[e],newValue:!1,source:"api"}),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged("api");return}e.__selected=t}reset(){this.selectionStrategy.deselectAllRowNodes({source:"api"}),this.selectionCtx.reset()}isEmpty(){return this.selectionStrategy.isEmpty()}hasNodesToSelect(){return!0}selectAllRowNodes(e){if(!Lt(this.gos)){F(132);return}if(H1(e),gl(this.gos)&&!ks(this.gos))return F(130);this.selectionStrategy.selectAllRowNodes(e),this.selectionCtx.selectAll=!0,this.beans.rowModel.forEachNode(t=>{t.stub||this.selectRowNode(t,!0,void 0,e.source)}),this.dispatchSelectionChanged(e.source)}deselectAllRowNodes(e){H1(e),this.selectionStrategy.deselectAllRowNodes(e),this.selectionCtx.selectAll=!1,this.beans.rowModel.forEachNode(t=>{t.stub||this.selectRowNode(t,!1,void 0,e.source)}),this.dispatchSelectionChanged(e.source)}getSelectAllState(e){return this.selectionStrategy.getSelectAllState(e)}getBestCostNodeSelection(){return F(194,{method:"getBestCostNodeSelection"})}updateSelectable(){if(!Lt(this.gos))return;const e=[];this.beans.rowModel.forEachNode(t=>{!this.updateRowSelectable(t,!0)&&t.isSelected()&&e.push(t)}),e.length&&this.setNodesSelected({nodes:e,newValue:!1,source:"selectableChanged"})}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.selectionStrategy instanceof Cd?null:this.selectionStrategy.getSelectedNodes(!0,!1),serverSideState:this.getSelectionState()})}updateSelectableAfterGrouping(){return Q(194,{method:"updateSelectableAfterGrouping"})}refreshMasterNodeState(){}setDetailSelectionState(){}};function H1({selectAll:e}){(e==="filtered"||e==="currentPage")&&F(195,{justCurrentPage:e==="currentPage"})}var l$=class extends E{constructor(){super(...arguments),this.beanName="rowChildrenSvc"}getHasChildrenValue(e){const t=this.gos.get("treeData"),s=this.gos.get("isServerSideGroup");return!e.stub&&!e.footer&&(t?!!s&&s(e.data):!!e.group)}},c$=class extends E{constructor(){super(...arguments),this.beanName="lazyBlockLoadingSvc",this.outboundRequests=0,this.cacheLoadingNodesMap=new Map,this.isCheckQueued=!1,this.nextBlockToLoad=void 0}wireBeans(e){this.rowRenderer=e.rowRenderer,this.rowModel=e.rowModel}postConstruct(){this.maxOutboundRequests=iu(this.gos)}subscribe(e){this.cacheLoadingNodesMap.set(e,new Set)}unsubscribe(e){this.cacheLoadingNodesMap.delete(e)}queueLoadCheck(){this.isCheckQueued||(this.isCheckQueued=!0,setTimeout(()=>{this.queueLoadAction(),this.isCheckQueued=!1}))}onLoadComplete(){this.outboundRequests-=1,this.queueLoadCheck()}hasAvailableLoadBandwidth(){return this.maxOutboundRequests===void 0?!0:this.outboundRequests{i.isAlive()&&(this.loaderTimeout=void 0,this.attemptLoad(i,s,r),this.nextBlockToLoad=void 0)},this.gos.get("blockLoadDebounceMillis"))}}attemptLoad(e,t,s){this.hasAvailableLoadBandwidth()&&(this.executeLoad(e,t,s),this.queueLoadCheck())}executeLoad(e,t,s){const i=e.getSsrmParams(),r={startRow:t,endRow:s,rowGroupCols:i.rowGroupCols,valueCols:i.valueCols,pivotCols:i.pivotCols,pivotMode:i.pivotMode,groupKeys:e.store.getParentNode().getRoute()??[],filterModel:i.filterModel,sortModel:i.sortModel},o=this.cacheLoadingNodesMap.get(e),n=()=>{for(let u=0;u{for(let u=0;u{this.onLoadComplete(),e.onLoadSuccess(t,s-t,u),n()},c=()=>{this.onLoadComplete(),e.onLoadFailed(t,s-t),n()},d=N(this.gos,{request:r,success:l,fail:c,parentNode:e.store.getParentNode()});a(),this.outboundRequests+=1,e.getSsrmParams().datasource?.getRows(d)}getBlockToLoad(){const e=this.rowRenderer.firstRenderedRow,t=this.rowRenderer.lastRenderedRow;for(let a=e;a<=t;a++){const l=this.rowModel.getRow(a);if(!l)continue;const c=l.parent?.childStore;if(!c)continue;const d=c.getCache(),u=d.getNodes().getBy("node",l);if(!(!u||this.cacheLoadingNodesMap.get(d)?.has(u.index))&&(l.__needsRefreshWhenVisible||l.stub&&!l.failedLoad))return{cache:d,index:d.getBlockStartIndex(u.index)}}let s=null,i=null,r=Number.MAX_SAFE_INTEGER;for(const a of this.cacheLoadingNodesMap.keys())a.getNodesToRefresh().forEach(c=>{if(c.rowIndex==null){i=c,s=a;return}const d=a.getNodes().getBy("node",c);if(!d||this.cacheLoadingNodesMap.get(a)?.has(d.index))return;const h=Math.abs(e-c.rowIndex),g=Math.abs(c.rowIndex-t);h[t,new Map]))}getSize(){return this.maps.get(this.indexes[0]).size}getBy(e,t){return this.maps.get(e).get(t)}set(e){for(const t of this.indexes)this.maps.get(t).set(e[t],e)}delete(e){for(const t of this.indexes)this.maps.get(t).delete(e[t])}clear(){this.maps.forEach(e=>e.clear())}getIterator(e){return this.maps.get(e).values()}forEach(e){const t=this.getIterator(this.indexes[0]);let s;for(;(s=t.next())&&!s.done;)e(s.value)}find(e){const t=this.getIterator(this.indexes[0]);let s;for(;(s=t.next())&&!s.done;)if(e(s.value))return s.value}filter(e){const t=this.getIterator(this.indexes[0]);let s;const i=[];for(;(s=t.next())&&!s.done;)e(s.value)&&i.push(s.value);return i}},u$=100,rf=class extends E{constructor(e,t,s,i){super(),this.live=!0,this.removedNodeCache=new Map,this.store=e,this.numberOfRows=t,this.isLastRowKnown=s,this.storeParams=i}wireBeans(e){this.rowRenderer=e.rowRenderer,this.blockUtils=e.ssrmBlockUtils,this.focusSvc=e.focusSvc,this.nodeManager=e.ssrmNodeManager,this.serverSideRowModel=e.rowModel,this.rowNodeSorter=e.rowNodeSorter,this.sortSvc=e.sortSvc,this.lazyBlockLoadingSvc=e.lazyBlockLoadingSvc,this.colModel=e.colModel}postConstruct(){this.lazyBlockLoadingSvc.subscribe(this),this.nodeMap=new d$("index","id","node"),this.nodeDisplayIndexMap=new Map,this.nodesToRefresh=new Set;const{blockUtils:e,gos:t,store:s}=this;this.defaultNodeIdPrefix=e.createNodeIdPrefix(s.getParentNode()),this.getRowIdFunc=Is(t),this.isMasterDetail=t.get("masterDetail")}destroy(){this.lazyBlockLoadingSvc.unsubscribe(this),this.numberOfRows=0,this.nodeMap.forEach(e=>this.blockUtils.destroyRowNode(e.node)),this.nodeMap.clear(),this.nodeDisplayIndexMap.clear(),this.nodesToRefresh.clear(),this.live=!1,super.destroy()}getRowByDisplayIndex(e){if(!this.store.isDisplayIndexInStore(e))return;const t=this.nodeDisplayIndexMap.get(e);if(t)return(t.stub||t.__needsRefreshWhenVisible)&&this.lazyBlockLoadingSvc.queueLoadCheck(),t;if(this.gos.get("groupHideOpenParents")||this.gos.get("groupAllowUnbalanced")){const l=this.nodeMap.find(c=>!!c.node.childStore?.isDisplayIndexInStore(e));if(l)return l.node.childStore?.getRowUsingDisplayIndex(e)}if(e===this.store.getDisplayIndexStart())return this.createStubNode(0,e);const i=this.nodeDisplayIndexMap.get(e-1);if(i){if(this.isMasterDetail&&i.master&&i.expanded)return i.detailNode;if(i.expanded&&i.childStore?.isDisplayIndexInStore(e))return i.childStore?.getRowUsingDisplayIndex(e);const l=this.nodeMap.getBy("node",i);return this.createStubNode(l.index+1,e)}const r=this.getSurroundingNodesByDisplayIndex(e);if(r==null){const l=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(l,e)}const{previousNode:o,nextNode:n}=r;if(o?.node.expanded&&o.node.childStore?.isDisplayIndexInStore(e))return o.node.childStore?.getRowUsingDisplayIndex(e);if(n){const l=n.node.rowIndex-e,c=n.index-l;return this.createStubNode(c,e)}const a=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(a,e)}createStubNode(e,t){const s=this.store.getRowBounds(t),i=this.createRowAtIndex(e,null,r=>{r.setRowIndex(t),r.setRowTop(s.rowTop),this.nodeDisplayIndexMap.set(t,r)});if(e===0&&this.gos.get("groupHideOpenParents")){const r=this.store.getParentNode().groupData;if(r)for(const o of Object.keys(r))u0(i,this.colModel,o,r[o])}return this.lazyBlockLoadingSvc.queueLoadCheck(),i}getRowByStoreIndex(e){return this.nodeMap.getBy("index",e)?.node}skipDisplayIndexes(e,t,s){if(e===0)return;const i=Et(this.beans);t.value+=e,s.value+=e*i}setDisplayIndexes(e,t,s){this.nodeDisplayIndexMap.clear();const i={};this.nodeMap.forEach(n=>{i[n.index]=n.node});let r=-1;for(const n of Object.keys(i)){const a=i[n],l=Number(n),c=l-1-r;this.skipDisplayIndexes(c,e,t);const d=l===0;if(a.firstChild!==d&&(a.firstChild=d,a.dispatchRowEvent("firstChildChanged")),d&&this.gos.get("groupHideOpenParents")){const u=this.store.getParentNode().groupData;if(u)for(const h of Object.keys(u))u0(a,this.colModel,h,d?u[h]:void 0)}this.blockUtils.setDisplayIndex(a,e,t,s),a.rowIndex!=null&&this.nodeDisplayIndexMap.set(a.rowIndex,a),r=l}const o=this.numberOfRows-1-r;this.skipDisplayIndexes(o,e,t),this.purgeExcessRows()}getRowCount(){return this.numberOfRows}setRowCount(e,t){this.numberOfRows=e,t!=null&&(this.isLastRowKnown=t,t===!1&&(this.numberOfRows+=1)),this.fireStoreUpdatedEvent()}getNodes(){return this.nodeMap}getNodeCachedByDisplayIndex(e){return this.nodeDisplayIndexMap.get(e)??null}getNodesToRefresh(){return this.nodesToRefresh}getSurroundingNodesByDisplayIndex(e){let t,s;return this.nodeMap.forEach(i=>{if(e>i.node.rowIndex){(s==null||s.node.rowIndexi.node.rowIndex)&&(t=i)}),!s&&!t?null:{previousNode:s,nextNode:t}}getDisplayIndexFromStoreIndex(e){const t=this.nodeMap.getBy("index",e);if(t)return t.node.rowIndex;let s,i;if(this.nodeMap.forEach(n=>{if(e>n.index){(i==null||i.indexn.index)&&(s=n)}),!s)return this.store.getDisplayIndexEnd()-(this.numberOfRows-e);if(!i)return this.store.getDisplayIndexStart()+e;const r=e-i.index;return(i.node.childStore?.getDisplayIndexEnd()??i.node.rowIndex)+r}createRowAtIndex(e,t,s){const i=this.nodeMap.getBy("index",e);if(i){const{node:o}=i;if(o.__needsRefreshWhenVisible=!1,this.doesNodeMatch(t,o))return this.blockUtils.updateDataIntoRowNode(o,t),this.nodesToRefresh.delete(o),o;if(this.getRowIdFunc==null&&o.hasChildren()&&o.expanded)return this.nodesToRefresh.delete(o),o;this.destroyRowAtIndex(e)}if(t&&this.getRowIdFunc!=null){const o=this.getRowId(t),n=o&&this.removedNodeCache?.get(o);if(n)return this.removedNodeCache?.delete(o),this.blockUtils.updateDataIntoRowNode(n,t),this.nodeMap.set({id:n.id,node:n,index:e}),this.nodesToRefresh.delete(n),n.__needsRefreshWhenVisible=!1,n;const a=this.nodeMap.getBy("id",o);if(a){this.nodeMap.delete(a);const{node:l,index:c}=a;return this.blockUtils.updateDataIntoRowNode(l,t),this.nodeMap.set({id:l.id,node:l,index:e}),this.nodesToRefresh.delete(l),l.__needsRefreshWhenVisible=!1,this.getBlockStartIndex(c)===this.getBlockStartIndex(e)||this.markBlockForVerify(c),l}}const r=this.blockUtils.createRowNode(this.store.getRowDetails());if(t!=null){const o=this.getPrefixedId(this.store.getIdSequence().value++);this.blockUtils.setDataIntoRowNode(r,t,o,void 0),this.blockUtils.checkOpenByDefault(r),this.nodeManager.addRowNode(r)}return this.nodeMap.set({id:r.id,node:r,index:e}),s&&s(r),r}getBlockStates(){const e={},t={};this.nodeMap.forEach(({node:o,index:n})=>{const a=this.getBlockStartIndex(n);!o.stub&&!o.failedLoad&&(e[a]=(e[a]??0)+1);let l="loaded";o.failedLoad?l="failed":this.lazyBlockLoadingSvc.isRowLoading(this,a)?l="loading":(this.nodesToRefresh.has(o)||o.stub)&&(l="needsLoading"),t[a]||(t[a]=new Set),t[a].add(l)});const s={loading:4,failed:3,needsLoading:2,loaded:1},i=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),r={};for(const o of Object.keys(t)){const a=[...t[o]].sort((d,u)=>(s[d]??0)-(s[u]??0))[0],l=Number(o)/this.getBlockSize(),c=i?`${i}-${l}`:String(l);r[c]={blockNumber:l,startRow:Number(o),endRow:Number(o)+this.getBlockSize(),pageStatus:a,loadedRowCount:e[o]??0}}return r}destroyRowAtIndex(e){const t=this.nodeMap.getBy("index",e);t&&(this.nodeMap.delete(t),this.nodeDisplayIndexMap.delete(t.node.rowIndex),this.nodesToRefresh.size>0?this.removedNodeCache.set(t.node.id,t.node):this.blockUtils.destroyRowNode(t.node),this.nodesToRefresh.delete(t.node))}getSsrmParams(){return this.store.getSsrmParams()}getPrefixedId(e){return this.defaultNodeIdPrefix?this.defaultNodeIdPrefix+"-"+e:e.toString()}markBlockForVerify(e){const[t,s]=this.getBlockBounds(e);this.nodeMap.filter(r=>r.index>=t&&r.index{r.__needsRefreshWhenVisible=!0})}doesNodeMatch(e,t){if(t.stub)return!1;const s=this.getRowId(e);return s===null?t.data===e:t.id===s}purgeStubsOutsideOfViewport(){const{firstRenderedRow:e,lastRenderedRow:t}=this.rowRenderer,s=this.getBlockStartIndex(e),[,i]=this.getBlockBounds(t);this.nodeMap.forEach(r=>{this.lazyBlockLoadingSvc.isRowLoading(this,r.index)||r.node.failedLoad||r.node.stub&&(r.indexi)&&this.destroyRowAtIndex(r.index)})}getBlocksDistanceFromRow(e,t){const s={};return e.forEach(({node:i,index:r})=>{const[o,n]=this.getBlockBounds(r);if(o in s)return;const a=Math.abs(i.rowIndex-t);let l;const c=this.nodeMap.getBy("index",[n-1]);c&&(l=Math.abs(c.node.rowIndex-t));const d=l==null||a{const f=this.getBlockStartIndex(g);s.add(f),p.rowIndex>=e&&p.rowIndex<=t&&i.add(f)});const r=Math.max(i.size,this.storeParams.maxBlocksInCache??0),n=s.size-r;if(n<=0)return;let a=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;i.forEach(g=>{a>g&&(a=g),l{const f=this.getBlockStartIndex(p);return!(f>=a&&f<=l)&&!this.isNodeCached(g)});if(c.length===0)return;const d=e+(t-e)/2,u=this.getBlocksDistanceFromRow(c,d),h=this.getBlockSize();u.sort((g,p)=>Math.sign(p[1]-g[1]));for(let g=0;g{const r=this.getRowId(i);if(t.has(r)){s.add(r);return}t.add(r)}),[...s]}onLoadSuccess(e,t,s){if(!this.live)return;const i=s.groupLevelInfo;if(this.store.setStoreInfo(i),this.getRowIdFunc!=null){const n=this.extractDuplicateIds(s.rowData);if(n.length>0){const a=n.join(", ");F(205,{duplicateIdText:a}),this.onLoadFailed(e,t);return}}s.pivotResultFields&&this.serverSideRowModel.generateSecondaryColumns(s.pivotResultFields);const r=this.nodesToRefresh.size>0;if(s.rowData.forEach((n,a)=>{const l=e+a,c=this.nodeMap.getBy("index",l);if(c?.node?.stub){this.createRowAtIndex(l,n);return}if(c&&this.doesNodeMatch(n,c.node)){this.blockUtils.updateDataIntoRowNode(c.node,n),this.nodesToRefresh.delete(c.node),c.node.__needsRefreshWhenVisible=!1;return}this.createRowAtIndex(l,n)}),s.rowCount!=null&&s.rowCount!==-1)this.numberOfRows=s.rowCount,this.isLastRowKnown=!0;else if(t>s.rowData.length)this.numberOfRows=e+s.rowData.length,this.isLastRowKnown=!0;else if(!this.isLastRowKnown){const n=e+s.rowData.length+1;n>this.numberOfRows&&(this.numberOfRows=n)}this.isLastRowKnown&&this.nodeMap.filter(a=>a.index>=this.numberOfRows).forEach(a=>this.destroyRowAtIndex(a.index)),this.fireStoreUpdatedEvent();const o=this.nodesToRefresh.size===0;r&&o&&this.fireRefreshFinishedEvent()}fireRefreshFinishedEvent(){this.nodesToRefresh.size===0&&(this.removedNodeCache.forEach(t=>{this.blockUtils.destroyRowNode(t)}),this.removedNodeCache=new Map,this.store.fireRefreshFinishedEvent())}isStoreFullyLoaded(){const e=this.isLastRowKnown,t=this.nodeMap.getSize()===this.numberOfRows;if(!e||!t||this.nodesToRefresh.size>0)return;let s=-1;return this.nodeMap.find(r=>(s+=1,!!(r.index!==s||r.node.__needsRefreshWhenVisible||r.node.stub)))==null}isLastRowIndexKnown(){return this.isLastRowKnown}onLoadFailed(e,t){if(!this.live)return;const s=this.nodesToRefresh.size>0;for(let r=e;r{e.node.stub&&!e.node.failedLoad||this.nodesToRefresh.add(e.node)}),this.lazyBlockLoadingSvc.queueLoadCheck(),this.isLastRowKnown&&this.numberOfRows===0&&(this.numberOfRows=1,this.isLastRowKnown=!1,this.fireStoreUpdatedEvent())}isNodeInCache(e){return!!this.nodeMap.getBy("id",e)}fireStoreUpdatedEvent(){this.live&&this.store.fireStoreUpdatedEvent()}getRowId(e){if(this.getRowIdFunc==null)return null;const{level:t}=this.store.getRowDetails(),s=this.store.getParentNode().getRoute()??[];return this.getRowIdFunc({data:e,parentKeys:s.length>0?s:void 0,level:t})}getOrderedNodeMap(){const e={};return this.nodeMap.forEach(t=>e[t.index]=t),e}clearDisplayIndexes(){this.nodeDisplayIndexMap.clear()}clientSideSortRows(){const e=this.sortSvc?.getSortOptions()??[],t=e.some(n=>n.sort!=null),s=this.rowNodeSorter;if(!t||!s)return;const i=new Array(this.nodeMap.getSize()),r=this.nodeMap;r.forEach(n=>i[n.index]=n.node),r.clear();const o=s.doFullSortInPlace(i,e);for(let n=0,a=o.length;n{const i=this.getRowId(s),r=this.nodeMap.getBy("id",i);r&&(this.blockUtils.updateDataIntoRowNode(r.node,s),t.push(r.node))}),t}insertRowNodes(e,t){const s=this.store.getRowCount()-(this.store.getParentNode().sibling?1:0),i=t==null&&this.isLastRowKnown?s:t;if(i==null||s{const c=this.getRowId(l);c&&this.isNodeInCache(c)||(r[c]=l)});const o=Object.values(r),n=o.length;if(n===0)return[];const a=this.nodeMap.filter(l=>l.index>=i);return a.forEach(l=>this.nodeMap.delete(l)),a.forEach(l=>{this.nodeMap.set({node:l.node,index:l.index+n,id:l.id})}),this.numberOfRows+=n,o.map((l,c)=>this.createRowAtIndex(i+c,l))}removeRowNodes(e,t){const s=[],i=[];let r=0;const o=[...e],n=this.getOrderedNodeMap();let a=-1;for(const c of Object.keys(n)){a+=1;const d=n[c],u=o.findIndex(g=>g===d.id);if(u!==-1){o.splice(u,1),this.destroyRowAtIndex(Number(c)),s.push(d.node),r+=1;continue}if(r===0)continue;const h=Number(c);a!==h&&i.push(d.node),this.nodeMap.delete(d),this.nodeMap.set({id:d.id,node:d.node,index:h-r})}return t!=null&&t>=0?(this.numberOfRows=t,this.isLastRowKnown=!0):this.numberOfRows-=r,o.length>0&&i.length>0&&(i.forEach(c=>c.__needsRefreshWhenVisible=!0),this.lazyBlockLoadingSvc.queueLoadCheck()),s}getBlockSize(){return this.storeParams.cacheBlockSize||u$}getBlockStartIndex(e){const t=this.getBlockSize();return e-e%t}getBlockBounds(e){const t=this.getBlockStartIndex(e),s=this.getBlockSize();return[t,t+s]}},h$=class extends E{constructor(e,t,s){super(),this.idSequence={value:0},this.ssrmParams=e,this.parentRowNode=s,this.storeParams=t,this.level=s.level+1,this.group=e.rowGroupCols?this.levelt({level:this.level,parentKeys:this.parentRowNode.getRoute()??[],data:h})),u=[...new Set(d)];n=this.cache.removeRowNodes(u,e.rowCount)}const a=this.gos.get("serverSideEnableClientSideSort"),l=r?.length||o?.length;return i&&a&&l&&this.cache.clientSideSortRows(),this.updateSelectionAfterTransaction(r,n),{status:ys.Applied,update:r,add:o,remove:n}}updateSelectionAfterTransaction(e,t){if(!this.selectionSvc)return;const s=[];for(const i of e??[])i.isSelected()&&!i.selectable&&s.push(i);for(const i of t??[])i.isSelected()&&s.push(i);s.length&&this.selectionSvc.setNodesSelected({newValue:!1,clearSelection:!1,nodes:s,source:"rowDataChanged"})}clearDisplayIndexes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.cache.getNodes().forEach(e=>this.blockUtils.clearDisplayIndex(e.node)),this.parentRowNode.sibling&&this.blockUtils.clearDisplayIndex(this.parentRowNode.sibling),this.cache.clearDisplayIndexes()}getDisplayIndexStart(){return this.displayIndexStart}getDisplayIndexEnd(){return this.displayIndexEnd}getRowCount(){return this.parentRowNode.sibling?this.cache.getRowCount()+1:this.cache.getRowCount()}setRowCount(e,t){this.cache.setRowCount(e,t)}isDisplayIndexInStore(e){return this.cache.getRowCount()===0?!1:this.displayIndexStart<=e&&e-1&&vr(this.gos)({node:this.parentRowNode});i||Wp(this.parentRowNode),i==="top"&&(gi(this.parentRowNode,this.beans),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t,s)),this.cache.setDisplayIndexes(e,t,s),i==="bottom"&&(gi(this.parentRowNode,this.beans),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t,s)),this.displayIndexEnd=e.value,this.heightPx=t.value-this.topPx}forEachStoreDeep(e,t={value:0}){e(this,t.value++),this.cache.getNodes().forEach(s=>{const i=s.node.childStore;i&&i.forEachStoreDeep(e,t)})}forEachNodeDeep(e,t={value:0}){this.cache.getNodes().forEach(s=>{e(s.node,t.value++);const i=s.node.childStore;i&&i.forEachNodeDeep(e,t)})}forEachNodeDeepAfterFilterAndSort(e,t={value:0},s=!1){const i=this.parentRowNode.level>-1&&vr(this.gos)({node:this.parentRowNode});i==="top"&&e(this.parentRowNode.sibling,t.value++);const r=this.cache.getOrderedNodeMap();for(const o of Object.values(r)){e(o.node,t.value++);const n=o.node.childStore;n&&n.forEachNodeDeepAfterFilterAndSort(e,t,s)}i==="bottom"&&e(this.parentRowNode.sibling,t.value++)}retryLoads(){this.cache.getNodes().forEach(({node:e})=>{e.failedLoad&&(e.failedLoad=!1,e.__needsRefreshWhenVisible=!0,e.stub=!0)}),this.forEachChildStoreShallow(e=>e.retryLoads()),this.fireStoreUpdatedEvent()}getRowUsingDisplayIndex(e){return this.parentRowNode.sibling&&e===this.parentRowNode.sibling.rowIndex?this.parentRowNode.sibling:this.cache.getRowByDisplayIndex(e)}getRowBounds(e){if(!this.isDisplayIndexInStore(e))return null;const t=this.cache.getNodeCachedByDisplayIndex(e);if(t){const a=this.blockUtils.extractRowBounds(t,e);if(a)return a}const{previousNode:s,nextNode:i}=this.cache.getSurroundingNodesByDisplayIndex(e)??{};if(s){const a=this.blockUtils.extractRowBounds(s.node,e);if(a!=null)return a}const r=Et(this.beans);if(i){const a=(i.node.rowIndex-e)*r;return{rowTop:i.node.rowTop-a,rowHeight:r}}const o=this.topPx+this.heightPx,n=(this.getDisplayIndexEnd()-e)*r;return{rowTop:o-n,rowHeight:r}}isPixelInRange(e){return e>=this.topPx&&e=this.topPx+this.heightPx)return this.getDisplayIndexEnd()-1;if(this.parentRowNode.sibling&&e>this.parentRowNode.sibling.rowTop&&e{const c=Math.abs(e-l.rowTop);if(l.rowTop{const s=this.cache.getNodes().find(i=>i.node.key==t);return s?s.node:null})}forEachChildStoreShallow(e){this.cache.getNodes().forEach(({node:t})=>{t.childStore&&e(t.childStore)})}refreshAfterSort(e){if(this.storeUtils.isServerSideSortAllLevels()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)){const s=this.cache.isStoreFullyLoaded(),i=this.gos.get("serverSideEnableClientSideSort");if(!(s&&i)){const o=this.cache.getRowCount(),n=this.cache.isLastRowIndexKnown();this.destroyBean(this.cache),this.cache=this.createManagedBean(new rf(this,o,n,this.storeParams));return}this.cache.clientSideSortRows()}this.forEachChildStoreShallow(s=>s.refreshAfterSort(e))}refreshAfterFilter(e){if(!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)){this.refreshStore(!0);return}this.forEachChildStoreShallow(s=>s.refreshAfterFilter(e))}refreshStore(e){if(e){this.destroyBean(this.cache),this.cache=this.createManagedBean(new rf(this,1,!1,this.storeParams)),this.fireStoreUpdatedEvent();return}this.cache.markNodesForRefresh()}getTopLevelRowDisplayedIndex(e){return this.cache.getDisplayIndexFromStoreIndex(e)??e}isLastRowIndexKnown(){return this.cache.isLastRowIndexKnown()}getRowNodesInRange(e,t){return this.cache.getNodes().filter(({node:s})=>s.rowIndex>=e.rowIndex&&s.rowIndex<=t.rowIndex).map(({node:s})=>s)}addStoreStates(e){e.push({route:this.parentRowNode.getRoute()??[],rowCount:this.getRowCount(),lastRowIndexKnown:this.isLastRowIndexKnown(),info:this.info,maxBlocksInCache:this.storeParams.maxBlocksInCache,cacheBlockSize:this.storeParams.cacheBlockSize}),this.forEachChildStoreShallow(t=>t.addStoreStates(e))}getIdSequence(){return this.idSequence}getParentNode(){return this.parentRowNode}getRowDetails(){return{field:this.groupField,group:this.group,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn}}getSsrmParams(){return this.ssrmParams}setStoreInfo(e){e&&Object.assign(this.info,e)}fireStoreUpdatedEvent(){this.eventSvc.dispatchEvent({type:"storeUpdated"})}fireRefreshFinishedEvent(){this.eventSvc.dispatchEvent({type:"storeRefreshed",route:this.parentRowNode.getRoute()})}getBlockStates(){return this.cache.getBlockStates()}getStoreBounds(){return{topPx:this.topPx,heightPx:this.heightPx}}getCache(){return this.cache}getFirstNode(){return this.cache.getNodes().getBy("index",0)?.node??null}},g$=class extends E{constructor(){super(...arguments),this.beanName="ssrmStoreFactory"}wireBeans(e){this.colModel=e.colModel,this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc,this.rowAutoHeight=e.rowAutoHeight}createStore(e,t){const s=this.getStoreParams(e,t);return new h$(e,s,t)}getStoreParams(e,t){const s=this.getLevelSpecificParams(t),i=this.getBlockSize(s),r=this.getMaxBlocksInCache(e,s);return{cacheBlockSize:i,maxBlocksInCache:r}}getMaxBlocksInCache(e,t){const s=t?.maxBlocksInCache!=null?t.maxBlocksInCache:this.gos.get("maxBlocksInCache");if(s!=null&&s>=0){if(e.dynamicRowHeight){F(203);return}if(this.rowAutoHeight?.active){F(204);return}return s}}getBlockSize(e){const t=e?.cacheBlockSize!=null?e.cacheBlockSize:this.gos.get("cacheBlockSize");return t!=null&&t>0?t:100}getLevelSpecificParams(e){const t=this.gos.getCallback("getServerSideGroupLevelParams");if(!t)return;const s={level:e.level+1,parentRowNode:e.level>=0?e:void 0,rowGroupColumns:this.rowGroupColsSvc?.columns??[],pivotColumns:this.pivotColsSvc?.columns??[],pivotMode:this.colModel.isPivotMode()};return t(s)}},p$=class extends E{constructor(){super(...arguments),this.beanName="ssrmStoreUtils"}wireBeans(e){this.colModel=e.colModel,this.serverSideRowModel=e.rowModel,this.storeFactory=e.ssrmStoreFactory}getChildStore(e,t,s){if(!e?.length)return t;const i=e[0],r=s(i);if(r){if(e.length===1&&!r.childStore){const a=this.serverSideRowModel.getParams();r.childStore=this.createBean(this.storeFactory.createStore(a,r))}const o=e.slice(1,e.length),n=r.childStore;return n?n.getChildStore(o):null}return null}isServerRefreshNeeded(e,t,s){if(s.valueColChanged||s.secondaryColChanged)return!0;const i=e.level+1;if(!(i-1?!0:this.colModel.getCols().filter(d=>d.getColDef().showRowGroup&&s.changedColumns.includes(d.getId())).map(d=>d.getColDef().showRowGroup).some(d=>d===!0||d===n)}getServerSideInitialRowCount(){return this.gos.get("serverSideInitialRowCount")}isServerSideSortAllLevels(){return this.gos.get("serverSideSortAllLevels")&&ft(this.gos)}isServerSideOnlyRefreshFilteredGroups(){return this.gos.get("serverSideOnlyRefreshFilteredGroups")&&ft(this.gos)}},f$=class extends E{constructor(){super(...arguments),this.beanName="ssrmTxnManager",this.asyncTransactions=[]}wireBeans(e){this.valueCache=e.valueCache,this.serverSideRowModel=e.rowModel,this.selectionSvc=e.selectionSvc}applyTransactionAsync(e,t){this.asyncTransactionsTimeout==null&&this.scheduleExecuteAsync(),this.asyncTransactions.push({transaction:e,callback:t})}scheduleExecuteAsync(){const e=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimeout=window.setTimeout(()=>{this.executeAsyncTransactions()},e)}executeAsyncTransactions(){if(!this.asyncTransactions)return;const e=[],t=[],s=[];let i=!1;for(const r of this.asyncTransactions){let o;if(this.serverSideRowModel.executeOnStore(r.transaction.route,l=>{o=l.applyTransaction(r.transaction)})?o==null&&(o={status:ys.StoreNotFound}):o={status:ys.StoreNotStarted},t.push(o),o.status==ys.StoreLoading){s.push(r);continue}r.callback&&e.push(()=>r.callback(o)),o.status===ys.Applied&&(i=!0)}e.length>0&&window.setTimeout(()=>{for(const r of e)r()},0),this.asyncTransactionsTimeout=void 0,this.asyncTransactions=s,i&&(this.valueCache?.onDataChanged(),this.eventSvc.dispatchEvent({type:"storeUpdated"})),t.length>0&&this.eventSvc.dispatchEvent({type:"asyncTransactionsFlushed",results:t})}flushAsyncTransactions(){this.asyncTransactionsTimeout!=null&&clearTimeout(this.asyncTransactionsTimeout),this.executeAsyncTransactions()}applyTransaction(e){let t;if(this.serverSideRowModel.executeOnStore(e.route,i=>{t=i.applyTransaction(e)}))if(t){if(this.valueCache?.onDataChanged(),t.remove&&this.selectionSvc){const i=t.remove.map(r=>r.id);this.selectionSvc.deleteSelectionStateFromParent(e.route||[],i)}return this.eventSvc.dispatchEvent({type:"storeUpdated"}),t}else return{status:ys.StoreNotFound};else return{status:ys.StoreNotStarted}}},z1={moduleName:"ServerSideRowModel",version:Y,rowModels:["serverSide"],beans:[XU,$U,p$,UU,YU,f$,KU,g$,jU,a$,c$,l$,n$,qU],dependsOn:[le,uc,Zg,L1,V1,yU]},_1={moduleName:"ServerSideRowModelApi",version:Y,apiFunctions:{getServerSideSelectionState:ZU,setServerSideSelectionState:QU,applyServerSideTransaction:JU,applyServerSideTransactionAsync:t$,applyServerSideRowData:e$,retryServerSideLoads:s$,flushServerSideAsyncTransactions:i$,refreshServerSide:r$,getServerSideGroupLevelState:o$,resetRowHeights:gc,onRowHeightChanged:hc},dependsOn:[le,ng,og,ag]},W1=/\$?[A-Za-z]+\$?[0-9]+(?::\$?[A-Za-z]+\$?[0-9]+)?/g,m$=/^(\$?)([A-Za-z]+)(\$?)([0-9]+)(?::(\$?)([A-Za-z]+)(\$?)([0-9]+))?$/,C$=/[A-Za-z0-9]/,Aa=e=>!!e&&C$.test(e),vd=e=>!!e&&/[A-Za-z]/.test(e),U1=e=>Aa(e??void 0),$1=(e,t,s)=>{const i=t>0?e[t-1]:null;if(U1(i))return!1;if(s.endsWith(":"))return!0;const r=t+s.length,o=r{const i=(t.allowTrailingColon??!1)&&e.endsWith(":")?e.slice(0,-1):e,r=m$.exec(i);if(!r)return null;const[,o,n,a,l,c,d,u,h]=r;return{startCol:n,startRow:l,startColAbsolute:o==="$",startRowAbsolute:a==="$",...!!(d&&h)?{endCol:d,endRow:h,endColAbsolute:c==="$",endRowAbsolute:u==="$"}:null}},K1=e=>{const t=[];let s,i=0;for(W1.lastIndex=0;(s=W1.exec(e))!=null;){let r=s[0];const o=s.index??0,n=o+r.length;n","&"]),q1=(e,t)=>{for(let s=t-1;s>=0;s--){const i=e[s];if(i!=null&&i.trim()!=="")return i}return null},w$="ag-formula-token-color",b$="ag-formula-range-color",nf=(e,t)=>{const s=t??0;return{tokenClass:`${w$}-${s+1}`,rangeClass:`${b$}-${s+1}`,colorIndex:s}},af=e=>{if(!e)return null;const t=/ag-formula-range-color-(\d+)/.exec(e);if(!t)return null;const s=parseInt(t[1],10);return Number.isFinite(s)?s-1:null},S$=(e,t,s)=>{if(!e)return;const{rangeClass:i}=nf(t,s);e.colorClass=i},Y1=(e,t)=>{const s=of(t,{allowTrailingColon:!0});if(!s)return null;const{formula:i}=e,{startCol:r,startRow:o,endCol:n,endRow:a}=s,l=r,c=n??r,d=i?.getColByRef(l),u=i?.getColByRef(c);if(!d||!u)return null;const h=parseInt(o,10)-1,g=a?parseInt(a,10)-1:h;if(h<0||g<0)return null;const p=e.rowModel;return!p?.getFormulaRow(h)||!p.getFormulaRow(g)?null:{rowStartIndex:h,rowEndIndex:g,columnStart:d,columnEnd:u}},y$=e=>{const t=e.rangeSvc?.getCellRanges(),s=t?.length?t[t.length-1]:null;return s?ir(e,s):null},ir=(e,t)=>{const{rangeSvc:s,formula:i}=e;if(!s||!i)return null;const r=s.getRangeStartRow(t),o=s.getRangeEndRow(t);if(!r||!o||r.rowPinned||o.rowPinned)return null;const n=Math.min(r.rowIndex,o.rowIndex)+1,a=Math.max(r.rowIndex,o.rowIndex)+1,l=t.columns?.filter(m=>!yr(m)&&!!i.getColRef(m));if(!l?.length)return null;const c=[...l],d=c[0],u=c[c.length-1],h=i.getColRef(d),g=i.getColRef(u);return!h||!g?null:h===g&&n===a?`${h}${n}`:`${h}${n}:${g}${a}`},_o=(e,t)=>{const s=K1(t),{formula:i}=e;if(!i)return s;const r=[];let o=0;for(const n of s)Y1(e,n.ref)&&(r.push({...n,index:o}),o+=1);return r},X1=(e,t)=>_o(e,t).map(({ref:i,index:r})=>({ref:i,index:r})),x$=class extends E{constructor(e){super(),this.field=e,this.functionAutocompleteList=null,this.functionAutocompleteToken=null,this.functionAutocompleteEntries=null,this.functionAutocompleteSearch=null}postConstruct(){this.addManagedElementListeners(this.field.getContentElement(),{keydown:this.onContentKeyDown.bind(this),mouseup:this.updateFunctionAutocomplete.bind(this),focusin:this.updateFunctionAutocomplete.bind(this),focusout:this.closeFunctionAutocomplete.bind(this)}),this.addDestroyFunc(()=>this.closeFunctionAutocomplete())}onPlainValueUpdated(){this.closeFunctionAutocomplete()}onFormulaValueUpdated(){this.updateFunctionAutocomplete()}onContentKeyDown(e){if(this.functionAutocompleteList)switch(e.key){case b.ENTER:case b.TAB:e.preventDefault(),e.stopPropagation(),this.confirmFunctionAutocomplete();return;case b.ESCAPE:e.preventDefault(),e.stopPropagation(),this.closeFunctionAutocomplete();return;case b.UP:case b.DOWN:this.functionAutocompleteList.onNavigationKeyDown(e,e.key);return}switch(e.key){case b.LEFT:case b.RIGHT:case b.PAGE_HOME:case b.PAGE_END:this.scheduleFunctionAutocompleteUpdate();break}}scheduleFunctionAutocompleteUpdate(){setTimeout(()=>{this.isAlive()&&this.updateFunctionAutocomplete()})}updateFunctionAutocomplete(){if(!this.isContentFocused()){this.closeFunctionAutocomplete();return}const{field:e,beans:t}=this,s=e.getCurrentValue();if(!s.trimStart().startsWith("=")){this.closeFunctionAutocomplete();return}const r=e.getCaretOffsetsForAutocomplete(s);if(!r){this.closeFunctionAutocomplete();return}if(F$(t,s,r.valueOffset)){this.closeFunctionAutocomplete();return}const o=R$(s,r.valueOffset,t.formula??null);if(!o){this.closeFunctionAutocomplete();return}const{prefix:n}=o;if(!n.length){this.closeFunctionAutocomplete();return}const a=this.getFunctionAutocompleteEntries();if(!a.length){this.closeFunctionAutocomplete();return}const l=n.toLocaleLowerCase();if(!a.some(({key:d})=>d.toLocaleLowerCase().startsWith(l))){this.closeFunctionAutocomplete();return}this.functionAutocompleteToken=o,this.openFunctionAutocomplete(a),this.functionAutocompleteList&&this.functionAutocompleteSearch!==n&&(this.functionAutocompleteList.setSearch(n),this.functionAutocompleteSearch=n)}getFunctionAutocompleteEntries(){const e=this.beans.formula,t=e?.active?e.getFunctionNames?.()??[]:[];return(!this.functionAutocompleteEntries||this.functionAutocompleteEntries.length!==t.length)&&(this.functionAutocompleteEntries=t.map(s=>({key:s}))),this.functionAutocompleteEntries}openFunctionAutocomplete(e){if(this.functionAutocompleteList||!e.length)return;const t=this.beans.popupSvc;if(!t)return;let s=null;const i=()=>{this.functionAutocompleteList&&s&&t.positionPopupByComponent(s)};this.functionAutocompleteList=this.createManagedBean(new Iy({autocompleteEntries:e,onConfirmed:()=>this.confirmFunctionAutocomplete(),useStartsWithSearch:!0,autoSizeList:!0,maxVisibleItems:10,onListHeightChanged:i}));const r=this.functionAutocompleteList.getGui();s={ePopup:r,type:"autocomplete",eventSource:this.field.getGui(),position:"under",alignSide:this.gos.get("enableRtl")?"right":"left",keepWithinBounds:!0};const o=t.addPopup({eChild:r,anchorToElement:this.field.getGui(),positionCallback:i,ariaLabel:"Formula functions"});this.functionAutocompleteHidePopup=o.hideFunc,this.functionAutocompleteList.afterGuiAttached()}closeFunctionAutocomplete(){this.functionAutocompleteToken=null,this.functionAutocompleteSearch=null,this.functionAutocompleteList&&(this.functionAutocompleteHidePopup?.(),this.functionAutocompleteHidePopup=void 0,this.destroyBean(this.functionAutocompleteList),this.functionAutocompleteList=null)}confirmFunctionAutocomplete(){const e=this.functionAutocompleteToken,t=this.functionAutocompleteList?.getSelectedValue();if(!e||!t){this.closeFunctionAutocomplete();return}const{field:s}=this,i=s.getCurrentValue(),r=t.key,o=i.slice(0,e.start)+r+i.slice(e.end),n=e.start+r.length,a=o[n]==="("?o:o.slice(0,n)+"("+o.slice(n);s.getContentElement().focus({preventScroll:!0}),s.applyFormulaValueChange({currentValue:i,nextValue:a,caret:n+1}),this.closeFunctionAutocomplete()}isContentFocused(){return me(this.beans).activeElement===this.field.getContentElement()}},R$=(e,t,s)=>{if(t<0||t>e.length||E$(e,t))return null;let i=t;for(;i>0&&Aa(e[i-1]);)i--;let r=t;for(;r{for(const i of _o(e,t))if(s>=i.start&&s<=i.end)return!0;return!1},E$=(e,t)=>{let s=!1;for(let i=0;i{this.rangeSelectionEnabled=!1,this.suppressRangeEvents=!1,this.ignoreNextRangeEvent=!1,this.skipNextValueUpdate=!1,this.clearTrackedRanges(!0)}}postConstruct(){this.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this)}),this.addDestroyFunc(()=>this.disableRangeSelectionWhileEditing()),this.addDestroyFunc(()=>this.unregisterActiveEditor())}onValueUpdated(e,t){if(this.skipNextValueUpdate){this.skipNextValueUpdate=!1;return}if(this.isActiveEditor()){if(t){this.enableRangeSelectionWhileEditing()&&(this.skipNextValueUpdate=!0,this.field.setValue(e,!0)),this.syncRangesFromFormula(e);return}this.disableRangeSelectionWhileEditing()}}setEditingCellRef(e,t,s){this.editingColumn=e,this.editingRowIndex=t??void 0,this.editingCellRef=s}setEditorActive(e){if(e){this.registerActiveEditor();return}this.unregisterActiveEditor()}withSelectionChangeHandlingSuppressed(e){const t=this.suppressSelectionChangeHandling;this.suppressSelectionChangeHandling=!0;try{e()}finally{this.suppressSelectionChangeHandling=t}}deactivateForFocusLoss(){this.isActiveEditor()&&(this.handleEditorDeactivated(),this.beans.editSvc?.disableRangeSelectionWhileEditing?.(),this.unregisterActiveEditor())}registerActiveEditor(){const e=this.field.getCompId(),{formulaInputManager:t}=this.beans;if(!t||!t.registerActiveEditor(e,this.handleEditorDeactivated))return;this.rangeSelectionEnabled=!1,this.suppressRangeEvents=!1,this.ignoreNextRangeEvent=!1,this.skipNextValueUpdate=!1,this.clearTrackedRanges(!1);const i=this.field.getCurrentValue(),r=i.trimStart().startsWith("=");this.onValueUpdated(i,r)}unregisterActiveEditor(){const e=this.field.getCompId(),{formulaInputManager:t}=this.beans;t&&t.unregisterActiveEditor(e,this.handleEditorDeactivated)}isActiveEditor(){const e=this.field.getCompId(),{formulaInputManager:t}=this.beans;return!!t&&t.isActiveEditor(e)}getTrackedRefCount(e){return this.trackedRangeRefs.get(e)??0}hasTrackedRef(e){return this.getTrackedRefCount(e)>0}addTrackedRef(e){this.trackedRangeRefs.set(e,this.getTrackedRefCount(e)+1)}removeTrackedRef(e){const t=this.getTrackedRefCount(e)-1;if(t<=0){this.trackedRangeRefs.delete(e);return}this.trackedRangeRefs.set(e,t)}enableRangeSelectionWhileEditing(){return this.rangeSelectionEnabled?!1:(this.rangeSelectionEnabled=!0,this.beans.editSvc?.enableRangeSelectionWhileEditing?.(),!0)}disableRangeSelectionWhileEditing(){!this.rangeSelectionEnabled&&!this.trackedRangeRefs.size||(this.rangeSelectionEnabled=!1,this.beans.editSvc?.disableRangeSelectionWhileEditing?.(),this.clearTrackedRanges(this.isActiveEditor()))}clearTrackedRanges(e=!0){e&&Array.from(this.trackedRangeRefs.keys()).forEach(s=>this.removeRangeForRef(s)),this.trackedRangeRefs.clear(),this.trackedRanges.clear()}getLiveRanges(){return this.beans.rangeSvc?.getCellRanges()??[]}withSuppressedRangeEvents(e){this.suppressRangeEvents=!0,e(),this.suppressRangeEvents=!1}setCellRangesSilently(e){const t=this.beans.rangeSvc;t&&this.withSuppressedRangeEvents(()=>t.setCellRanges(e))}getColorIndexForTokenOrRef(e,t){return this.field.getColorIndexForToken(t??null)??this.field.getColorIndexForRef(e)}normaliseRefForComparison(e){return e?(e.endsWith(":")?e.slice(0,-1):e).replace(/\$/g,"").toUpperCase():null}tagRangeColor(e,t,s){const{rangeClass:i}=nf(t,s);return e.colorClass===i?!1:(S$(e,t,s),!0)}trackRange(e,t,s){const i=this.trackedRanges.get(e),r=s!==void 0?s:i?.tokenIndex??null;i?i.ref!==t&&(this.removeTrackedRef(i.ref),this.addTrackedRef(t)):this.addTrackedRef(t),this.trackedRanges.set(e,{ref:t,tokenIndex:r})}getUntrackedFormulaRangesByRef(){const e=new Map,t=this.getLiveRanges();for(const s of t){if(this.trackedRanges.has(s)||af(s.colorClass)==null)continue;const i=ir(this.beans,s);if(!i||i===this.editingCellRef)continue;const r=e.get(i);r?r.push(s):e.set(i,[s])}return e}syncRangesFromFormula(e){const t=e??this.field.getCurrentValue()??"";if(!this.rangeSelectionEnabled){this.clearTrackedRanges();return}const s=X1(this.beans,t),i=new Map;for(const c of s){const{ref:d,index:u}=c;if(d===this.editingCellRef)continue;const h=i.get(d)??[];h.push(u),i.set(d,h)}for(const c of Array.from(this.trackedRangeRefs.keys()))i.has(c)||this.removeRangeForRef(c);if(!this.beans.rangeSvc)return;const o=new Set(this.getLiveRanges());for(const[c,d]of this.trackedRanges.entries())o.has(c)||(this.trackedRanges.delete(c),this.removeTrackedRef(d.ref));const n=this.getUntrackedFormulaRangesByRef();let a=!1;for(const[c,d]of i.entries()){const u=[];for(const[g,p]of this.trackedRanges.entries())p.ref===c&&u.push(g);const h=n.get(c);for(;u.lengthd.length;){const g=u.pop();g&&this.removeTrackedRange(g)}for(;u.length!l.includes(u));d.length!==c.length&&(this.setCellRangesSilently(d),a=!0)}a&&this.refreshRangeStyling()}onCellSelectionChanged(e){if(!this.isActiveEditor()||!this.rangeSelectionEnabled||!this.beans.editSvc?.isRangeSelectionEnabledWhileEditing?.())return;if(this.ignoreNextRangeEvent){this.ignoreNextRangeEvent=!1;return}if(this.suppressSelectionChangeHandling)return;const{finished:t,started:s}=e,i=this.getLiveRanges(),r=i.filter(u=>!this.isSpecialOnlyRange(u));if(r.length!==i.length){this.setCellRangesSilently(r),this.refocusEditingCell();return}const o=i.length?W(i):null,n=o?ir(this.beans,o):null,a=!!o&&!this.trackedRanges.has(o)&&!!n&&n!==this.editingCellRef,l=t&&(s||a),c=this.ensureTrackedRangeColors();if(this.suppressRangeEvents){c&&this.refreshRangeStyling();return}if((s||a)&&this.field.rememberCaret(),!a&&this.handleRemovedRangeTokens()){this.field.restoreCaretAfterToken(),this.refocusEditingCell();return}if(this.updateTrackedRangeTokens())return;const d=y$(this.beans);if(!d||d===this.editingCellRef){this.refocusEditingCell();return}if(l){const{action:u,previousRef:h,tokenIndex:g}=this.field.applyRangeInsert(d);if(u==="none"){this.keepLatestSelectionOnly(o),this.beans.editSvc?.stopEditing(void 0,{source:"edit"});return}if(u==="replace"&&h===d){this.discardLatestRangeForRef(d),this.field.restoreCaretAfterToken(),this.refocusEditingCell();return}this.tagLatestRangeForRef(d,g),this.handleRangeTokenUpdate(h,d,!0,u==="insert",g),this.syncRangesFromFormula(this.field.getCurrentValue()),this.field.restoreCaretAfterToken(),this.refocusEditingCell();return}if(!s&&!t){const{previousRef:u,tokenIndex:h}=this.field.insertOrReplaceToken(d,!1);this.tagLatestRangeForRef(d,h),this.handleRangeTokenUpdate(u,d,!1,!1),this.refocusEditingCell();return}this.tagLatestRangeForRef(d),t&&(this.field.restoreCaretAfterToken(),this.refocusEditingCell())}keepLatestSelectionOnly(e){!e||this.getLiveRanges().length<=1||this.setCellRangesSilently([e])}isSpecialOnlyRange(e){const t=e.columns;return!!t?.length&&t.every(s=>yr(s))}handleRangeTokenUpdate(e,t,s,i,r){if(s){!i&&e&&e!==t&&this.removeRangeForRef(e,r),this.addRangeForRef(t,!0,r);return}if(i||!e){this.addTrackedRef(t);return}e!==t&&(this.removeTrackedRef(e),this.addTrackedRef(t))}addRangeForRef(e,t,s){const i=this.beans.rangeSvc;if(!i)return;let r;if(t)r=this.findLatestRangeForRef(e,!0)??this.findLatestRangeForRef(e,!1);else{const o=Y1(this.beans,e);if(!o)return;this.withSuppressedRangeEvents(()=>{r=i.addCellRange(o)})}if(r){const o=this.getColorIndexForTokenOrRef(e,s);this.tagRangeColor(r,e,o),this.trackRange(r,e,s),this.refreshRangeStyling()}return r}findLatestRangeForRef(e,t){const s=this.getLiveRanges();for(let i=s.length-1;i>=0;i--){const r=s[i];if(ir(this.beans,r)===e&&!(t&&this.trackedRanges.has(r)))return r}}tagLatestRangeForRef(e,t){const{trackedRanges:s}=this,i=this.getLiveRanges(),r=i.length?W(i):null;if(!r)return;const o=s.get(r)?.tokenIndex??null,n=this.getColorIndexForTokenOrRef(e,t??o);this.tagRangeColor(r,e,n),this.refreshRangeStyling()}discardLatestRangeForRef(e){const t=this.getLiveRanges();if(!t.length)return;const s=W(t);if(ir(this.beans,s)===e){if(this.trackedRanges.has(s)){this.removeTrackedRange(s);return}this.setCellRangesSilently(t.slice(0,-1))}}ensureTrackedRangeColors(){const e=this.getLiveRanges();if(!e.length)return!1;let t=!1;for(const s of e){const i=this.trackedRanges.get(s),r=i?.ref??ir(this.beans,s);if(!r||!this.hasTrackedRef(r))continue;const o=i?.tokenIndex??null,n=this.field.getColorIndexForToken(o),a=af(s.colorClass),l=n??(this.field.hasColorForRef(r)?this.field.getColorIndexForRef(r):this.field.moveColorToRef(void 0,r,a??void 0));l!=null&&(this.tagRangeColor(s,r,l)&&(t=!0),this.trackedRanges.has(s)||this.trackRange(s,r,o))}return t}handleRemovedRangeTokens(){if(!this.beans.rangeSvc||this.trackedRanges.size===0)return!1;const e=this.field.getCurrentValue(),t=X1(this.beans,e).filter(({ref:l})=>l!==this.editingCellRef);if(!t.length)return!1;const s=this.getLiveRanges(),i=new Set(s),r=new Map;for(const l of s){const c=ir(this.beans,l);!c||c===this.editingCellRef||r.set(c,(r.get(c)??0)+1)}const o=new Map;for(const l of t){const{ref:c}=l;o.set(c,(o.get(c)??0)+1)}for(const[l,c]of Array.from(o.entries())){const d=r.get(l)??0,u=c-d;u>0?o.set(l,u):o.delete(l)}if(!o.size)return!1;const n=[];for(const[l,c]of Array.from(this.trackedRanges.entries())){if(i.has(l))continue;const{ref:d}=c,u=o.get(d)??0;u<=0||(o.set(d,u-1),n.push({range:l,tracked:c}))}if(!n.length)return!1;n.sort((l,c)=>(c.tracked.tokenIndex??-1)-(l.tracked.tokenIndex??-1));let a=!1;for(const{range:l,tracked:c}of n){const{ref:d,tokenIndex:u}=c;a=this.field.removeTokenRef(d,u??null)||a,this.trackedRanges.delete(l),this.removeTrackedRef(d)}return a&&this.syncRangesFromFormula(this.field.getCurrentValue()),a}refreshRangeStyling(){const{eventSvc:e}=this.beans;e&&(this.ensureTrackedRangeColors(),this.ignoreNextRangeEvent=!0,e.dispatchEvent({type:"cellSelectionChanged",started:!1,finished:!1}))}refocusEditingCell(){const{focusSvc:e}=this.beans,{editingColumn:t,editingRowIndex:s}=this;!e||t==null||s==null||e.setFocusedCell({column:t,rowIndex:s,rowPinned:null,preventScrollOnBrowserFocus:!0})}removeTrackedRange(e){const t=this.trackedRanges.get(e);if(!t)return;const s=this.getLiveRanges(),i=s.filter(r=>r!==e);i.length!==s.length&&this.setCellRangesSilently(i),this.trackedRanges.delete(e),this.removeTrackedRef(t.ref)}removeRangeForRef(e,t){if(!(!e||!this.hasTrackedRef(e))){if(t!=null){let s=!1;for(const[i,r]of Array.from(this.trackedRanges.entries())){const{ref:o,tokenIndex:n}=r;if(!(o!==e||n!==t)){this.removeTrackedRange(i),s=!0;break}}if(!s){for(const[i,r]of Array.from(this.trackedRanges.entries()))if(r.ref===e){this.removeTrackedRange(i);break}}return}for(const[s,i]of Array.from(this.trackedRanges.entries()))i.ref===e&&this.removeTrackedRange(s)}}updateTrackedRangeTokens(){if(!this.beans.rangeSvc)return!1;const e=this.getLiveRanges(),t=this.normaliseRefForComparison(this.editingCellRef);let s=!1;for(const i of e){const r=this.trackedRanges.get(i);if(!r)continue;const{ref:o,tokenIndex:n}=r,a=ir(this.beans,i),l=this.normaliseRefForComparison(o),c=this.normaliseRefForComparison(a);if(!a||!c||c===l||c===t)continue;const{colorClass:d}=i,h=this.field.getColorIndexForToken(n??null)??this.field.moveColorToRef(o,a,af(d)??void 0),g=this.field.replaceTokenRef(o,a,h,n);g!=null&&(this.tagRangeColor(i,a,h),this.trackRange(i,a,g??n??null),s=!0)}return s&&this.refreshRangeStyling(),s}},lf=7,M$={"/":"\xF7","*":"\xD7"},T$={"\xF7":"/","\xD7":"*"},D$=class extends Jg{constructor(){super({renderValueToElement:!1,className:"ag-formula-input-field"}),this.currentValue="",this.selectionCaretOffset=null,this.lastTokenValueOffset=null,this.lastTokenValueLength=null,this.lastTokenCaretOffset=null,this.focusFromMouseTime=null,this.suppressNextFocusCaretPlacement=!1,this.formulaColorByRef=new Map,this.registerCSS(v$),this.registerCSS(Ay)}postConstruct(){super.postConstruct(),this.rangeSyncFeature=this.createManagedBean(new P$(this)),this.autocompleteFeature=this.createManagedBean(new x$(this)),this.addManagedElementListeners(this.getContentElement(),{input:this.onContentInput.bind(this),focus:this.onContentFocus.bind(this),blur:this.onContentBlur.bind(this),mousedown:this.onContentMouseDown.bind(this)})}setValue(e,t){const s=e==null?"":String(e),{isFormula:i,hasFormulaPrefix:r}=this.getFormulaState(s);return i?(this.applyFormulaValue(s,{currentValue:this.getCurrentValue(),silent:t}),this.rangeSyncFeature?.onValueUpdated(s,r),this):(this.applyPlainValue(s,{silent:t,dispatch:!0}),this.rangeSyncFeature?.onValueUpdated(s,r),this)}getCurrentValue(){const e=Q1(this.getContentElement());return e!==this.currentValue&&this.setEditorValue(e,!0),this.currentValue}setEditingCellRef(e,t){const s=e?this.beans.formula?.getColRef(e):void 0,i=s&&t!=null&&t!==void 0?`${s}${t+1}`:void 0;if(!i){this.rangeSyncFeature?.setEditingCellRef(void 0,void 0,void 0);return}this.rangeSyncFeature?.setEditingCellRef(e,t,i)}rememberCaret(){const e=Kr(this.beans,this.getContentElement(),this.getCurrentValue());this.selectionCaretOffset=e??this.currentValue.length}setEditorValue(e,t=!1){return this.currentValue=e,super.setValue(e,t),this}renderFormula(e){O$({beans:this.beans,contentElement:this.getContentElement(),getColorIndexForToken:this.getColorIndexForToken.bind(this),...e})}renderPlainValue(e,t){const s=this.getContentElement(),i=t??Kr(this.beans,s,this.currentValue);s.textContent=e??"";const r=i!=null?Math.min(i,e.length):null;uf(this.beans,s,r)}withSelectionChangeHandlingSuppressed(e){if(!this.rangeSyncFeature){e();return}this.rangeSyncFeature.withSelectionChangeHandlingSuppressed(e)}getColorIndexForRef(e){if(!cf(this.beans))return null;const t=this.formulaColorByRef.get(e);if(t!=null)return t;const s=this.formulaColorByRef.size%lf;return this.formulaColorByRef.set(e,s),s}getColorIndexForToken(e){return!cf(this.beans)||e==null?null:e%lf}hasColorForRef(e){return this.formulaColorByRef.has(e)}moveColorToRef(e,t,s){const i=e&&this.formulaColorByRef.has(e)?this.getColorIndexForRef(e):s??this.formulaColorByRef.get(t)??this.getColorIndexForRef(t);return e&&e!==t&&this.formulaColorByRef.delete(e),i==null?null:(this.formulaColorByRef.set(t,i),i)}updateFormulaColorsFromValue(e){if(e=e==null?"":String(e),!cf(this.beans)){this.formulaColorByRef.clear();return}const t=A$(this.beans,e);let s=t.length!==this.formulaColorByRef.size;const i=new Map;t.forEach((r,o)=>{const n=o%lf;i.set(r,n),this.formulaColorByRef.get(r)!==n&&(s=!0)}),s&&(this.formulaColorByRef.clear(),i.forEach((r,o)=>this.formulaColorByRef.set(o,r)))}onContentInput(){const e=this.getContentElement(),t=this.getCurrentValue(),s=Kr(this.beans,e,t),i=Q1(e),{isFormula:r,hasFormulaPrefix:o}=this.getFormulaState(i);if(!r){this.applyPlainValue(i,{caret:s,dispatch:!0}),this.rangeSyncFeature?.onValueUpdated(i,o);return}this.applyFormulaValue(i,{currentValue:t,caret:s??void 0,dispatch:!0}),this.rangeSyncFeature?.onValueUpdated(i,o)}onContentFocus(){if(this.rangeSyncFeature?.setEditorActive(!0),this.suppressNextFocusCaretPlacement){this.suppressNextFocusCaretPlacement=!1;return}const{focusFromMouseTime:e}=this,t=e!=null;this.focusFromMouseTime=null,!t&&Qa(this.beans,this.getContentElement())}onContentBlur(e){this.focusFromMouseTime=null;const t=e.relatedTarget,s=t?.closest(".ag-cell-editor"),i=t?.closest(".ag-cell");!t||this.getGui().contains(t)||!s||!i||this.rangeSyncFeature?.deactivateForFocusLoss()}onContentMouseDown(){this.focusFromMouseTime=Date.now()}insertOrReplaceToken(e,t){const s=this.getTokenInsertOffsets(t);if(!s)return{};const{caretOffset:i,valueOffset:r}=s,o=t||this.lastTokenValueLength==null?0:this.lastTokenValueLength,n=this.getCurrentValue(),a=n.slice(0,r)+e+n.slice(r+o),l=df(this.beans,a,r)?.index??null;let c;return this.applyFormulaValueChange({currentValue:n,nextValue:a,caret:i+e.length,updateTracking:()=>{c=this.updateLastTokenTracking(e,i,r)}}),{previousRef:c,tokenIndex:l}}removeTokenRef(e,t){const s=this.getCurrentValue(),i=_o(this.beans,s);let r;if(t!=null&&(r=i.find(l=>l.index===t),r&&r.ref!==e&&(r=void 0)),r||(r=i.find(l=>l.ref===e)),!r)return!1;const o=s.slice(0,r.start)+s.slice(r.end),n=this.selectionCaretOffset??r.start,a=Math.min(n,o.length);return this.applyFormulaValueChange({currentValue:s,nextValue:o,caret:a,updateTracking:()=>{this.lastTokenValueOffset=null,this.lastTokenValueLength=null,this.lastTokenCaretOffset=a,this.lastTokenRef=void 0}}),!0}applyRangeInsert(e){const t=this.getCurrentValue(),s=this.getCaretOffsets(t);if(!s){const{previousRef:l,tokenIndex:c}=this.insertOrReplaceToken(e,!0);return{action:"insert",previousRef:l,tokenIndex:c}}const{valueOffset:i}=s,r=df(this.beans,t,i);if(r){const{end:l,ref:c}=r;if(c.endsWith(":")&&i===l){const{previousRef:h,tokenIndex:g}=this.insertOrReplaceToken(e,!0);return{action:"insert",previousRef:h,tokenIndex:g}}const{previousRef:d,tokenIndex:u}=this.replaceTokenAtMatch(r,e);return{action:"replace",previousRef:d,tokenIndex:u}}const o=I$(t,i);if(o){const l=t.slice(0,o.start)+e+t.slice(o.end),c=df(this.beans,l,o.start)?.index??null,{previousRef:d}=this.replaceTokenAtMatch(o,e,c);return{action:"replace",previousRef:d,tokenIndex:c}}if(!k$(t,i))return{action:"none"};const{previousRef:n,tokenIndex:a}=this.insertOrReplaceToken(e,!0);return{action:"insert",previousRef:n,tokenIndex:a}}restoreCaretAfterToken(){const t=(this.lastTokenCaretOffset??Kr(this.beans,this.getContentElement(),this.getCurrentValue())??this.currentValue.length)+(this.lastTokenValueLength??0);this.selectionCaretOffset=null,this.suppressNextFocusCaretPlacement=!0,setTimeout(()=>{this.isAlive()&&(this.getContentElement().focus({preventScroll:!0}),me(this.beans).activeElement===this.getContentElement()&&(this.suppressNextFocusCaretPlacement=!1),uf(this.beans,this.getContentElement(),t))})}replaceTokenAtMatch(e,t,s){const i=this.getCurrentValue(),r=i.slice(0,e.start)+t+i.slice(e.end);return this.applyFormulaValueChange({currentValue:i,nextValue:r,caret:e.start+t.length,updateTracking:()=>{this.updateLastTokenTracking(t,e.start,e.start)}}),{previousRef:e.ref,tokenIndex:s??e.index}}getValueOffsetFromCaret(e){const t=this.getContentElement();let s=e,i=0;for(const r of Array.from(t.childNodes)){const o=Wo(r),n=wd(r).length;if(s<=o)return i+(o===n?s:0);s-=o,i+=n}return this.currentValue.length}getTokenInsertOffsets(e){return this.getCaretOffsets(this.getCurrentValue(),{useCachedCaret:!0,useCachedValueOffset:!e})}getCaretOffsetsForAutocomplete(e){return this.getCaretOffsets(e)}getCaretOffsets(e,t={useCachedCaret:!1,useCachedValueOffset:!1}){const{beans:s}=this,{useCachedCaret:i,useCachedValueOffset:r}=t,o=this.getContentElement(),n=i?this.selectionCaretOffset??Kr(s,o,e)??this.currentValue.length:Kr(s,o,e);if(n==null)return null;const a=r&&this.lastTokenValueOffset!=null?this.lastTokenValueOffset:this.getValueOffsetFromCaret(n);return a==null?null:{caretOffset:n,valueOffset:a}}updateLastTokenTracking(e,t,s){const i=this.lastTokenRef;return this.lastTokenValueOffset=s,this.lastTokenValueLength=e.length,this.lastTokenCaretOffset=t,this.lastTokenRef=e,i}getFormulaState(e){const t=e.trimStart().startsWith("=");return{isFormula:this.beans.formula?.isFormula(e)??t,hasFormulaPrefix:t}}dispatchValueChanged(){this.dispatchLocalEvent({type:"fieldValueChanged"})}applyPlainValue(e,t){this.formulaColorByRef.clear(),this.renderPlainValue(e,t.caret),this.setEditorValue(e,t.silent),t.dispatch&&this.dispatchValueChanged(),this.autocompleteFeature?.onPlainValueUpdated()}applyFormulaValue(e,t){this.updateFormulaColorsFromValue(e),this.renderFormula({value:e,currentValue:t.currentValue??this.getCurrentValue(),caret:t.caret??void 0}),this.setEditorValue(e,t.silent),t.dispatch&&this.dispatchValueChanged(),this.autocompleteFeature?.onFormulaValueUpdated()}applyFormulaValueChange(e){const{currentValue:t,nextValue:s,caret:i}=e;this.updateFormulaColorsFromValue(s),e.updateTracking?.(),this.setEditorValue(s),this.renderFormula({currentValue:t,value:s,caret:i}),this.dispatchValueChanged(),this.autocompleteFeature?.onFormulaValueUpdated()}replaceTokenRef(e,t,s,i){const r=this.getContentElement();let o;if(i!=null&&(o=r.querySelector(`.ag-formula-token[data-formula-token-index="${i}"]`)??void 0,o&&ex(o)!==e&&(o=void 0)),o||(o=Array.from(r.querySelectorAll(".ag-formula-token")).find(u=>ex(u)===e)),!o)return null;const n=Z1(r,o),a=Z1(r,o,!0);if(n==null||a==null)return null;const l=this.getCurrentValue();s!=null&&this.formulaColorByRef.set(t,s);const c=l.slice(0,a)+t+l.slice(a+e.length),d=V$(o);return this.applyFormulaValueChange({currentValue:l,nextValue:c,caret:n+t.length,updateTracking:()=>{this.updateLastTokenTracking(t,n,a)}}),d??i??null}},cf=e=>{const{gos:t,rangeSvc:s}=e;return!!s&&!!t.get("cellSelection")},A$=(e,t)=>{const s=[],i=new Set;for(const r of _o(e,t)){const o=r.ref;i.has(o)||(i.add(o),s.push(o))}return s},df=(e,t,s)=>{for(const i of _o(e,t))if(s>=i.start&&s<=i.end)return{ref:i.ref,start:i.start,end:i.end,index:i.index};return null},I$=(e,t)=>{for(const s of K1(e))if(t>=s.start&&t<=s.end)return{ref:s.ref,start:s.start,end:s.end,index:s.index};return null},k$=(e,t)=>{const s=q1(e,t);return s==null||j1.has(s)},L$=(e,t,s)=>{const i=[];let r=0;const o=_o(e,t),n=me(e);for(const a of o){a.start>r&&i.push(n.createTextNode(tx(t.slice(r,a.start))));const l=s(a.index);i.push(G$(a.ref,l,l!=null,a.index)),r=a.end}return r{const r={"aria-label":e,"data-formula-ref":e,"data-formula-token-index":i.toString()};let o;if(s&&t!=null){const a=nf(e,t);o=a.tokenClass,r["data-formula-range-class"]=a.rangeClass}const n=re({tag:"span",cls:"ag-formula-token",attrs:r,children:e});return o&&n.classList.add(o),n},O$=e=>{const{beans:t,contentElement:s,currentValue:i,value:r,getColorIndexForToken:o,caret:n}=e,a=n??Kr(t,s,i),l=r.length;s.textContent="";for(const d of L$(t,r,o))s.append(d);const c=a!=null?Math.min(a,l):null;uf(t,s,c)},Z1=(e,t,s=!1)=>{if(!e.contains(t))return null;let i=0;for(const r of Array.from(e.childNodes)){if(r===t)return i;i+=s?wd(r).length:Wo(r)}return null},Q1=e=>{let t="";return e.childNodes.forEach(s=>{t+=wd(s)}),t},wd=e=>e.nodeType===Node.TEXT_NODE?sx(e.textContent??""):e.nodeType===Node.ELEMENT_NODE?Array.from(e.childNodes).map(t=>wd(t)).join(""):"",Wo=e=>e.nodeType===Node.TEXT_NODE?e.textContent?.length??0:e.nodeType===Node.ELEMENT_NODE?Array.from(e.childNodes).reduce((t,s)=>t+Wo(s),0):0,J1=(e,t)=>{let s=t;for(let i=0;io){s-=o;continue}return r.nodeType===Node.TEXT_NODE?{node:r,localOffset:s}:J1(r,s)}return{node:e,localOffset:e.childNodes.length}},uf=(e,t,s)=>{if(s==null)return;const i=Xr(e),r=me(e),o=i.getSelection(),n=r.createRange(),{node:a,localOffset:l}=J1(t,s);if(!(!a||!o||!t.isConnected||!a.isConnected)){n.setStart(a,l),n.collapse(!0),o.removeAllRanges();try{o.addRange(n)}catch{}}},Kr=(e,t,s)=>{const r=Xr(e).getSelection();if(!r||r.rangeCount===0)return s?.length??null;const o=r.getRangeAt(0);if(!t.contains(o.startContainer))return s?.length??null;if(o.startContainer===t){let l=0;for(let c=0;csx(e.textContent??e.dataset.formulaRef??""),V$=e=>{const t=e.dataset.formulaTokenIndex;if(!t)return null;const s=parseInt(t,10);return Number.isFinite(s)?s:null},tx=e=>e.replace(/[/*]/g,t=>M$[t]??t),sx=e=>e.replace(/[÷×]/g,t=>T$[t]??t),B$={1:["invalidFormulaValidation","Invalid formula."],2:["formulaParseInvalidCellReference","Invalid cell reference: ${variable}."],3:["formulaParseInvalidRangeEndReference","Invalid range end reference."],4:["formulaParseUnterminatedString","Unterminated string."],5:["formulaParseUnexpectedCharacter","Unexpected character: ${variable}."],6:["formulaParseOperatorStackUnderflow","Operator stack underflow."],7:["formulaParseMissingOperand","Missing operand for '${variable}'."],8:["formulaParseInternalUnexpectedFrameDuringReduction","Internal error: unexpected frame during reduction."],9:["formulaParseInternalUnexpectedFrameBeforeOpenParen","Internal error: unexpected frame before '('."],10:["formulaParseMisplacedComma","Misplaced comma."],11:["formulaParseCommaOutsideFunctionCall","Comma outside of a function call."],12:["formulaParseInternalUnexpectedFrameBeforeCloseParen","Internal error: unexpected frame before ')'."],13:["formulaParseMismatchedParentheses","Mismatched parentheses."],14:["formulaParseUnsupportedOperand","Unsupported operand: ${variable}."],15:["formulaParseMismatchedParenthesesOrUnfinishedFunctionCall","Mismatched parentheses or unfinished function call."],16:["formulaParseInvalidExpression","Invalid expression."],17:["formulaParseFormulasMustBeginWithEquals","Formulas must begin with =."],18:["formulaSerializeStringContainsQuote",'String contains a quote (") which the tokenizer does not support.',"#PARSE!"],19:["formulaSerializeCannotProduceAbsoluteColumnLabelFromId","Cannot produce absolute COLUMN label from id '${variable}'."],20:["formulaSerializeCannotProduceAbsoluteRowIndexFromId","Cannot produce absolute ROW index from id '${variable}'."],21:["formulaSerializeCannotProduceRowIndexFromId","Cannot produce ROW index from id '${variable}'."],22:["formulaSerializeCannotMapColumnIdToA1Label","Cannot map column id '${variable}' to A1 label."],23:["formulaSerializeCannotParseAbsoluteRowIndex","Cannot parse absolute row index '${variable}'."],24:["formulaSerializeCannotMapRowIdToA1Index","Cannot map row id '${variable}' to A1 index."],25:["formulaEvalRangeNotAllowedInScalarContext","Range is not allowed in scalar context."],26:["formulaEvalUnknownReferenceToCell","Unknown reference to cell.","#REF!"],27:["formulaEvalUnsupportedOperation","Unsupported operation ${variable}.","#NAME?"],28:["formulaEvalInvalidAbsoluteRow","Invalid absolute row.","#REF!"],29:["formulaEvalUnrecognisedRowId","Unrecognised row id.","#REF!"],30:["formulaEvalInvalidAbsoluteColumn","Invalid absolute column.","#REF!"],31:["formulaEvalUnrecognisedColumnId","Unrecognised column id.","#REF!"],32:["formulaEvalUnrecognisedRowInRange","Unrecognised row in range.","#REF!"],33:["formulaEvalUnrecognisedReferenceToCell","Unrecognised reference to cell.","#REF!"],34:["formulaEvalIncompleteRangeReference","Incomplete range reference.","#REF!"],35:["formulaFunctionExpectedExactlyArguments","${variable}: expected exactly ${variable} arguments."],36:["formulaFunctionExpectedAtMostArguments","${variable}: expected at most ${variable} arguments."],37:["formulaFunctionExpectedAtLeastArguments","${variable}: expected at least ${variable} arguments."],38:["formulaFunctionInvalidCriteriaWildcardsWithComparator","Invalid criteria: wildcards with comparator.","#VALUE!"],39:["formulaFunctionNonNumericArgument","${variable}: non-numeric argument.","#VALUE!"],40:["formulaFunctionDivisionByZero","${variable}: division by zero.","#DIV/0!"],41:["formulaFunctionCannotCombineDatesWithBigInt","${variable}: cannot combine dates with BigInt.","#VALUE!"],42:["formulaFunctionRequiresAtLeastOneNumericValue","${variable}: requires at least one numeric value.","#PARSE!"],43:["formulaFunctionRequiresAtLeastOneValue","${variable}: requires at least one value."],44:["formulaFunctionAllValuesMustBeNumbers","${variable}: all values must be numbers.","#VALUE!"],45:["formulaFunctionArgumentMustBeRange","${variable}: ${variable} argument must be a range.","#VALUE!"],46:["formulaFunctionArgumentMustBeValue","${variable}: ${variable} argument must be a value.","#VALUE!"],47:["formulaFunctionRangesHaveDifferentSizes","${variable}: ranges have different sizes.","#VALUE!"],48:["formulaFunctionValuesMustBeNumeric","${variable}: values must be numeric.","#VALUE!"],49:["formulaFunctionValuesMustBeIntegers","${variable}: values must be integers.","#VALUE!"],50:["formulaFunctionUnsupportedValueType","${variable}: unsupported value type.","#VALUE!"],51:["formulaServiceCircularReference","Circular reference.","#CIRCREF!"],52:["formulaServiceExpectedParsableFormula","Expected parsable formula.","#PARSE!"],53:["formulaServiceInternalSchedulingError","Internal scheduling error."],54:["formulaFunctionDivNonNumericArgument","DIV: non-numeric argument.","#VALUE!"],55:["formulaFunctionDivDivisionByZero","DIV: division by zero.","#DIV/0!"],56:["formulaFunctionSumCannotCombineDatesWithBigInt","SUM: cannot combine dates with BigInt.","#VALUE!"],57:["formulaFunctionSumRequiresAtLeastOneNumericValue","SUM: requires at least one numeric value.","#PARSE!"],58:["formulaFunctionAvgRequiresAtLeastOneValue","AVG: requires at least one value."],59:["formulaFunctionMedianAllValuesMustBeNumbers","MEDIAN: all values must be numbers.","#VALUE!"],60:["formulaFunctionMedianRequiresAtLeastOneValue","MEDIAN: requires at least one value."],61:["formulaFunctionSumifFirstArgumentMustBeRange","SUMIF: first argument must be a range.","#VALUE!"],62:["formulaFunctionSumifSecondArgumentMustBeValue","SUMIF: second argument must be a value (criteria).","#VALUE!"],63:["formulaFunctionSumifThirdArgumentMustBeRange","SUMIF: third argument must be a range (sum_range).","#VALUE!"],64:["formulaFunctionSumifRangesHaveDifferentSizes","SUMIF: ranges have different sizes.","#VALUE!"],65:["formulaFunctionCountifFirstArgumentMustBeRange","COUNTIF: first argument must be a range.","#VALUE!"],66:["formulaFunctionCountifSecondArgumentMustBeValue","COUNTIF: second argument must be a value (criteria).","#VALUE!"],67:["formulaFunctionConcatUnsupportedValueType","CONCAT: unsupported value type.","#VALUE!"],68:["formulaFunctionMinRequiresAtLeastOneValue","MIN: requires at least one value."],69:["formulaFunctionMaxRequiresAtLeastOneValue","MAX: requires at least one value."],70:["formulaFunctionPercentNonNumericArgument","PERCENT: non-numeric argument.","#VALUE!"],71:["formulaFunctionPowerNonNumericArgument","POWER: non-numeric argument.","#VALUE!"]},N$=(e,t)=>{if(!t?.length)return e;let s=e,i=0;for(;i{if(e?.length)return e.map(t=>String(t))},hf=e=>B$[e],H$=(e,t)=>{const[,s]=hf(e);return N$(s,ix(t))},z$=(e,t,s)=>{const[i,r]=hf(t),o=ix(s);return e(i,r,o)},_$=class extends Rr{constructor(){super({tag:"div",cls:"ag-cell-edit-wrapper"}),this.eEditor=x,this.focusAfterAttached=!1}initialiseEditor(e){const t=this.createManagedBean(new D$);this.eEditor=t,t.addCss("ag-cell-editor"),this.appendChild(t),this.addManagedElementListeners(t.getContentElement(),{keydown:n=>this.onFormulaInputKeyDown(n,e.onKeyDown)});const{eventKey:s,cellStartedEdit:i}=e;let r;i?(this.focusAfterAttached=!0,s===b.BACKSPACE||s===b.DELETE?r="":s&&s.length===1?r=s:r=this.getStartValue(e)):r=this.getStartValue(e);const o=r==null?"":String(r);this.eEditor.setEditingCellRef(e.column,e.rowIndex),this.eEditor.setValue(o,!0)}onFormulaInputKeyDown(e,t){const{key:s}=e;if(s!==b.TAB||e.defaultPrevented)return;const{focusSvc:i}=this.beans,r=i?.getFocusedCell();this.eEditor.withSelectionChangeHandlingSuppressed(()=>{t?.(e)});const o=i?.getFocusedCell();let n=!1;if(r&&o){const{rowIndex:l,rowPinned:c,column:d}=r,{rowIndex:u,rowPinned:h,column:g}=o;n=l!==u||c!==h||d!==g}const{defaultPrevented:a}=e;(a||n)&&e.preventDefault(),e.stopPropagation()}getStartValue(e){const{value:t}=e;return t?.toString()??t}agSetEditValue(e){this.params.value=e;const t=this.getStartValue(this.params);this.eEditor.setValue(t??"",!0)}isPopup(){return!1}afterGuiAttached(){if(!this.focusAfterAttached)return;const{beans:e,eEditor:t}=this;Ss()||this.focusIn(),Qa(e,t.getContentElement())}focusIn(){this.eEditor.getContentElement().focus({preventScroll:!0})}getValue(){const e=this.eEditor.getCurrentValue(),{value:t,parseValue:s}=this.params;return typeof e=="string"&&this.isFormulaText(e)?e:e==null&&t==null?t:s(String(e))}getValidationElement(){return this.eEditor.getContentElement()}getValidationErrors(){const{params:e}=this,t=this.eEditor.getCurrentValue(),s=this.getLocaleTextFunc(),{getValidationErrors:i,validateFormulas:r}=e;let o=null;return(r===!0||!!i)&&typeof t=="string"&&this.isFormulaText(t)&&(this.beans.formula?.normaliseFormula(t,!0)||(o=[z$(s,1)])),i?i({value:this.getValue(),internalErrors:o,cellEditorParams:e}):o}isFormulaText(e){const t=e==null?"":String(e);return this.beans.formula?.isFormula(t)??t.trimStart().startsWith("=")}},W$='.formula-error:after{background-color:var(--ag-invalid-color);content:"";height:12px;position:absolute;top:-6px;width:12px}:where(.ag-ltr) .formula-error:after{right:-6px;transform:rotate(45deg)}:where(.ag-rtl) .formula-error:after{left:-6px;transform:rotate(-45deg)}',U$=class extends E{constructor(){super(...arguments),this.beanName="formulaDataSvc",this.hasSource=!1}postConstruct(){const e=this.gos.get("formulaDataSource");e&&this.setDataSource(e)}hasDataSource(){return this.hasSource}getFormula(e){const t=this.dataSource?.getFormula(e);return lr(t)?t:void 0}setFormula(e){this.dataSource?.setFormula(e)}setDataSource(e){this.dataSource=e,this.hasSource=!0,e.init?.(this.createInitParams())}createInitParams(){return N(this.gos,{})}destroy(){this.dataSource?.destroy?.(),super.destroy()}},$$=class extends E{constructor(){super(...arguments),this.beanName="formulaInputManager",this.activeEditor=null,this.activeEditorDeactivate=null}postConstruct(){this.registerRangeSelectionExtension()}registerActiveEditor(e,t){if(this.activeEditor===e&&this.activeEditorDeactivate===t)return!1;const s=this.activeEditorDeactivate;return s&&s!==t&&s(),this.activeEditor=e,this.activeEditorDeactivate=t,!0}unregisterActiveEditor(e,t){this.activeEditor===e&&this.activeEditorDeactivate===t&&(this.activeEditor=null,this.activeEditorDeactivate=null)}isActiveEditor(e){return this.activeEditor===e}shouldSuppressRangeSelection(e){const t=e;return t?.closest?this.activeEditor!=null?!!t.closest(".ag-cell-editor"):!!t.closest(".ag-formula-input-field"):!1}registerRangeSelectionExtension(){const e=this.beans.rangeSvc;e&&(e.registerRangeSelectionExtension(this),this.addDestroyFunc(()=>e.unregisterRangeSelectionExtension?.(this)))}},rx=[{symbol:"%",fixity:"postfix",precedence:100},{symbol:"-",fixity:"prefix",precedence:90},{symbol:"+",fixity:"prefix",precedence:90},{symbol:"^",fixity:"infix",precedence:80,associativity:"right"},{symbol:"*",fixity:"infix",precedence:70,associativity:"left",isAssociative:!0},{symbol:"/",fixity:"infix",precedence:70,associativity:"left"},{symbol:"+",fixity:"infix",precedence:60,associativity:"left",isAssociative:!0},{symbol:"-",fixity:"infix",precedence:60,associativity:"left"},{symbol:"&",fixity:"infix",precedence:55,associativity:"left",isAssociative:!0},{symbol:"=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<>",fixity:"infix",precedence:50,associativity:"left"},{symbol:">=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<=",fixity:"infix",precedence:50,associativity:"left"},{symbol:">",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<",fixity:"infix",precedence:50,associativity:"left"}],bd=new Map;for(const e of rx){const t=bd.get(e.symbol)??[];t.push(e),bd.set(e.symbol,t)}function Uo(e,t){const s=bd.get(e)??[];return t?s.find(i=>i.fixity===t):s[0]}var K$=[...new Set(rx.map(e=>e.symbol))].sort((e,t)=>t.length-e.length),gf=bd,j$=e=>{if(e?.length)return e.map(t=>String(t))},J=class extends Error{constructor(e,t,s){const i=typeof e=="string",r=!i&&Array.isArray(t)?j$(t):void 0,o=i?e:H$(e,r);if(super(o),this.name="FormulaError",i)this.type=typeof t=="string"?t:"#ERROR!",this.errorId=null,this.localeKey=null,this.defaultMessage=e,this.variableValues=void 0;else{const[n,a,l]=hf(e);this.type=s??l??"#ERROR!",this.errorId=e,this.localeKey=n,this.defaultMessage=a,this.variableValues=r}}getTranslatedMessage(e){return this.localeKey?e(this.localeKey,this.defaultMessage,this.variableValues):this.message}},dt=class extends J{constructor(e,t,s,i){super(e,i,"#PARSE!"),this.errorStart=t,this.errorEnd=s}},q$=(e,t,s)=>{const i=t.trim();if(i.startsWith('"')&&i.endsWith('"')&&i.length>2)return i.slice(1,-1);if(i.toLowerCase()==="true")return!0;if(i.toLowerCase()==="false")return!1;const r=Number(i);if(!isNaN(r))return r;const o=of(i);if(o){const{startCol:n,startRow:a,startColAbsolute:l,startRowAbsolute:c,endCol:d,endRow:u,endColAbsolute:h,endRowAbsolute:g}=o,p=(m,C,v,w,S)=>{const y=m||S?C.toUpperCase():e.formula?.getColByRef(C)?.colId,R=v||S?w:at(e)?.getFormulaRow(Number(w)-1)?.id;if(y==null||R==null)throw new dt(2,0,0,[i]);return{column:{id:y,absolute:m},row:{id:R,absolute:v}}},f=p(l,n,c,a,s);if(d&&u){const m=p(h??!1,d,g??!1,u,s);f.endColumn=m.column,f.endRow=m.row}return f}return null};function Y$(e){const t=[];let s=0;const i=(r,o)=>{let n=o;const a=()=>r[n]==="$"?(n++,!0):!1,l=()=>{const h=n;for(;nh},c=()=>{const h=n;for(;nh},d=()=>{const h=n;return a(),!l()||(a(),!c())?(n=h,!1):!0};if(!d())return 0;if(r[n]===":"){const h=n;if(n++,!d())throw new dt(3,h,n)}const u=r.slice(o,n);return $1(r,o,u)?n-o:0};for(;s=e.length)throw new dt(4,s,e.length);t.push(e.slice(s,n+1)),s=n+1;continue}if(/[0-9]/.test(r)||r==="."&&/[0-9]/.test(e[s+1])){let n=s+1;for(;n0){t.push(e.slice(s,s+n)),s+=n;continue}let a=s+1;for(;ae.startsWith(n,s));if(!o)throw new dt(5,s,s+1,[r]);t.push(o),s+=o.length}return t}function X$(e,t){return e.fixity!=="infix"||t.fixity!=="infix"?!0:e.associativity==="right"&&e.precedence===t.precedence?!1:e.precedence>=t.precedence}function Z$(e,t){const s=gf.get(e);if(!s)return null;const i=t!==void 0&&gf.has(t);return t!==void 0&&!i&&!(t==="("||t===",")&&t!=="("||t===")"?s.find(n=>n.fixity==="postfix")??s.find(n=>n.fixity==="infix")??null:s.find(n=>n.fixity==="prefix")??s.find(n=>n.fixity==="infix")??null}function Q$(e,t,s){const i=Y$(t),r=[],o=[],n=()=>{const l=o.pop();if(!l)throw new dt(6,0,0);if(l.kind==="op"){const c=l.def;if(c.fixity!=="infix"){const h=r.pop();if(!h)throw new dt(7,0,0,[c.symbol]);if(c.symbol==="+"&&c.fixity==="prefix"){r.push(h);return}if(c.fixity==="postfix"&&c.symbol==="%"){r.push({type:"operation",operation:c.symbol,operands:[h]});return}c.symbol==="-"&&c.fixity==="prefix"?r.push({type:"operation",operation:"-",operands:[{type:"operand",value:0},h]}):r.push({type:"operation",operation:c.symbol,operands:[h]});return}const d=r.pop(),u=r.pop();if(!u||!d)throw new dt(7,0,0,[c.symbol]);r.push({type:"operation",operation:c.symbol,operands:[u,d]});return}throw new dt(8,0,0)};let a=0;for(;au.outLen&&h.args.push(r.pop()),a++;continue}if(l===")"){for(;;){const g=o[o.length-1];if(!g||g.kind==="parenthesis")break;if(g.kind==="op")n();else throw new dt(12,a,a+1)}const u=o[o.length-1];if(!u||u.kind!=="parenthesis")throw new dt(13,a,a+1);const h=u.outLen;if(o.pop(),o[o.length-1]?.kind==="function"){const g=o.pop();r.length>h&&g.args.push(r.pop()),r.push({type:"operation",operation:g.name,operands:g.args})}a++;continue}const c=gf.has(l)?Z$(l,i[a-1]):null;if(c){for(;;){const u=o[o.length-1];if(!u||u.kind!=="op")break;if(X$(u.def,c))n();else break}o.push({kind:"op",def:c}),a++;continue}const d=q$(e,l,s);if(d==null)throw new dt(14,0,l.length,[l]);r.push({type:"operand",value:d}),a++}for(;o.length;)if(o[o.length-1].kind==="op")n();else throw new dt(15,0,0);if(r.length!==1)throw new dt(16,0,0);return r[0]}var pf=(e,t,s=!1)=>{if(!lr(t))throw new dt(17,0,1);const i=t.slice(1).trim();return cx(Q$(e,i,s))};function ff(e,t){return e.type==="operation"&&e.operation.toUpperCase()===t.toUpperCase()}function ox(e,t=!1){return!e||e.type!=="operand"?t:!!e.value}function nx(e){if(!e||e.type!=="operand")return null;const t=e.value;return typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):null}function ax(e){if(!ff(e,"COLUMN"))return null;const t=nx(e.operands[0]);if(t==null)return null;const s=ox(e.operands[1],!1);return{id:t,absolute:s}}function lx(e){if(!ff(e,"ROW"))return null;const t=nx(e.operands[0]);if(t==null)return null;const s=ox(e.operands[1],!1);return{id:t,absolute:s}}function J$(e){if(!ff(e,"REF"))return null;const t=e.operands;if(t.length!==2&&t.length!==4)return null;const s=ax(t[0]),i=lx(t[1]);if(!s||!i)return null;const r={column:s,row:i};if(t.length===4){const o=ax(t[2]),n=lx(t[3]);if(!o||!n)return null;r.endColumn=o,r.endRow=n}return{type:"operand",value:r}}function cx(e){if(e.type==="operation"){const t=e.operands.map(cx),s={type:"operation",operation:e.operation,operands:t};return J$(s)??s}return e}var Sd=e=>e.type==="operation";function dx(e,t){const s=e.colModel.getColById(t);return s?e.formula?.getColRef(s)??null:null}function eK(e,t){return e.formula?.getColByRef?.(t)?.colId??null}function tK(e,t,s){const i=e.getColById(s);if(!i)return null;const r=t.indexOf(i);return r>=0?r:null}function sK(e,t){const s=e[t];return s?s.getId()??null:null}function mf(e,t){const s=e.rowModel?.getRowNode?.(t);return s?.formulaRowIndex!=null?s.formulaRowIndex+1:null}function ux(e,t){return at(e)?.getFormulaRow?.(t-1)?.id??null}function Cf(e){if(e.includes('"'))throw new J(18);return`"${e}"`}function iK(e,t){const s=/^[A-Za-z]+$/.test(t.id);if(t.absolute){if(s)return t.id.toUpperCase();const i=dx(e,t.id);if(i)return i.toUpperCase();throw new J(19,[t.id])}else{if(s){const i=eK(e,t.id);if(i)return i}return t.id}}function rK(e,t){const{id:s,absolute:i}=t;if(i){if(ux(e,Number(s))==null)throw new J(20,[s])}else if(mf(e,s)==null)throw new J(21,[s]);return s}function hx(e,t){if(t.absolute)return t.id;const s=dx(e,t.id);if(s)return s.toUpperCase();throw new J(22,[t.id])}function gx(e,t){if(t.absolute){const i=Number(t.id);if(Number.isFinite(i)&&i>=1)return i;throw new J(23,[t.id])}const s=mf(e,t.id);if(s!=null)return s;throw new J(24,[t.id])}function oK(e,t,s){const i=(a,l)=>(a?"$":"")+String(l),r=s?t.column.id:hx(e,t.column),o=s?t.row.id:gx(e,t.row),n=i(t.column.absolute,r)+i(t.row.absolute,o);if(t.endColumn&&t.endRow){const a=s?t.endColumn.id:hx(e,t.endColumn),l=s?t.endRow.id:gx(e,t.endRow);return`${n}:${i(t.endColumn.absolute,a)}${i(t.endRow.absolute,l)}`}return n}function nK(e,t){const s=o=>`COLUMN(${Cf(iK(e,o))}${o.absolute?",true":""})`,i=o=>`ROW(${Cf(rK(e,o))}${o.absolute?",true":""})`,r=`REF(${s(t.column)},${i(t.row)}`;return t.endColumn&&t.endRow?`${r},${s(t.endColumn)},${i(t.endRow)})`:`${r})`}function px(e){if(!Sd(e)||e.operation!=="-"||e.operands.length!==2)return null;const[t,s]=e.operands;return t.type==="operand"&&t.value===0?s:null}function aK(e){return Sd(e)?!!Uo(e.operation,"infix"):!1}function fx(e,t,s){if(!Sd(t)||px(t))return!1;const i=Uo(t.operation,"infix");if(!i||i.fixity!=="infix")return!1;const r=e.precedence,o=i.precedence;if(or)return!1;if(e.associativity==="right"){const a=i.symbol===e.symbol;return s==="left"&&a}return e.isAssociative===!0?!1:s==="right"}function lK(e){if(!Sd(e))return!1;const t=Uo(e.operation,"infix");return t?!(t.symbol==="^"):!1}function mx(e,t,s,i){const r=n=>s?nK(e,n):oK(e,n,i);function o(n){if(n.type==="operand"){const c=n.value;return typeof c=="string"?Cf(c):typeof c=="number"?String(c):typeof c=="boolean"?c?"TRUE":"FALSE":r(c)}const a=px(n);if(a){const c=o(a);return lK(a)?`-(${c})`:`-${c}`}const l=n.operation.toUpperCase();if(n.operands.length===1){const c=n.operands[0],d=Uo(l,"postfix");if(d)return`${o(c)}${d.symbol}`;const u=Uo(l,"prefix");if(u){const h=o(c);return aK(c)?`${u.symbol}(${h})`:`${u.symbol}${h}`}return`${l}(${o(c)})`}if(n.operands.length===2){const c=Uo(l,"infix");if(c){const[d,u]=n.operands,h=fx(c,d,"left")?`(${o(d)})`:o(d),g=fx(c,u,"right")?`(${o(u)})`:o(u);return`${h}${c.symbol}${g}`}}return`${l}(${n.operands.map(o).join(",")})`}return"="+o(t)}function Cx(e){return!!(e.endColumn&&e.endRow)}function vf(e,t){const{row:s,column:i}=t,r=s.absolute?at(e)?.getFormulaRow(Number(s.id)-1):e.rowModel.getRowNode(s.id),o=i.absolute?e.formula.getColByRef(i.id):e.colModel.getColById(i.id);return!r||!o?null:{row:r,column:o}}function vx(e,t,s,i){if(t.type==="operand"){const a=t.value;if(typeof a!="object")return a;if(Cx(a))throw new J(25);const l=vf(e,a);if(!l)throw new J(26);return s(l)}const r=e.formula?.getFunction(t.operation);if(!r)throw new J(27,[t.operation]);const{args:o,values:n}=uK(e,t.operands,s,i);return r({row:i.row,column:i.column,args:o,values:n})}function wx(e,t,s,i){if(t.type==="operand"){const o=t.value;if(typeof o!="object")return{kind:"value",value:o};if(Cx(o))return gK(e,o,s);const n=vf(e,o);if(!n)throw new J(26);return{kind:"value",value:s(n)}}return{kind:"value",value:vx(e,t,s,i)}}var cK=class{constructor(e,t,s,i){this.beans=e,this.operandNodes=t,this.getCellValue=s,this.caller=i,this.i=0,this.res={done:!1,value:void 0}}next(){return this.i>=this.operandNodes.length?(this.res.done=!0,this.res.value=void 0,this.res):(this.res.done=!1,this.res.value=wx(this.beans,this.operandNodes[this.i++],this.getCellValue,this.caller),this.res)}[Symbol.iterator](){return this}},dK=class{constructor(e,t,s,i){this.beans=e,this.operandNodes=t,this.getCellValue=s,this.caller=i,this.i=0,this.inner=null,this.res={done:!1,value:void 0}}next(){for(;;){if(this.inner){const t=this.inner.next();if(!t.done)return this.res.done=!1,this.res.value=t.value,this.res;this.inner=null;continue}if(this.i>=this.operandNodes.length)return this.res.done=!0,this.res.value=void 0,this.res;const e=wx(this.beans,this.operandNodes[this.i++],this.getCellValue,this.caller);if(e.kind==="value")return this.res.done=!1,this.res.value=e.value,this.res;this.inner=e[Symbol.iterator]()}}[Symbol.iterator](){return this}};function uK(e,t,s,i){return{args:{[Symbol.iterator](){return new cK(e,t,s,i)}},values:{[Symbol.iterator](){return new dK(e,t,s,i)}}}}function yd(e,t){if(t.absolute){const i=Number(t.id)-1;if(!Number.isFinite(i)||i<0)throw new J(28);return i}const s=e.rowModel?.getRowNode?.(t.id);if(s?.formulaRowIndex==null)throw new J(29);return s.formulaRowIndex}function xd(e,t){if(t.absolute){const i=e.formula?.getColByRef(t.id);if(!i)throw new J(30);return i}const s=e.colModel.getColById(t.id);if(!s)throw new J(31);return s}var hK=class{constructor(e,t,s,i,r,o){this.beans=e,this.rowStartIndex=t,this.rowEndIndex=s,this.colStart=i,this.colEnd=r,this.getCellValue=o,this.cols=null,this.currentRowIndex=this.rowStartIndex,this.currentColIdx=-1,this.colStartIdx=-1,this.colEndIdx=-1,this.res={done:!1,value:void 0}}initColsOnce(){if(this.cols)return;this.cols=this.beans.colModel.getCols()??[];const e=bx(this.beans,this.colStart,this.colEnd);if(!e){this.colStartIdx=-1,this.colEndIdx=-1;return}[this.colStartIdx,this.colEndIdx]=e,this.currentColIdx=this.colStartIdx}next(){if(!this.cols&&(this.initColsOnce(),this.colStartIdx<0))return this.res.done=!0,this.res;if(this.currentRowIndex<=this.rowEndIndex){const e=at(this.beans)?.getFormulaRow(this.currentRowIndex);if(!e)throw new J(32);const t=this.cols[this.currentColIdx];return this.currentColIdxi)throw new J(36,[t,i]);if(r.lengthe.kind==="range",Sx=e=>e.kind==="value",CK=["<=",">=","<>","<",">","="];function vK(e){for(const t of CK)if(e.startsWith(t))return t;return null}function bf(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(e instanceof Date)return+e;if(typeof e=="string"){const t=Number(e);if(!Number.isNaN(t))return t}return null}function yx(e){if(e==null)return"";switch(typeof e){case"string":return e;case"number":return String(e);case"boolean":return e?"TRUE":"FALSE"}return e instanceof Date?String(+e):String(e)}function wK(e){let t="^";for(let s=0;s{let i=bf(t),r=bf(s);switch((i==null||r==null)&&(i=t,r=yx(s).toUpperCase()),e){case"<":return r":return r>i;case"<=":return r<=i;case">=":return r>=i;case"=":return r===i;case"<>":return r!==i}return!1},SK=(e,t,s)=>{const i=yx(s),r=t.test(i);return e==="="?r:!r},yK=e=>e==null||e==="";function xx(e){if(typeof e=="number")return n=>bf(n)===e;if(typeof e!="string")return n=>e===n;const t=e.trim();if(t==="")return yK;const s=vK(t),i=s?t.substring(s.length):t;if(!/[*?]/.test(i))return bK.bind(null,s??"=",i.toUpperCase());if(s&&s!=="="&&s!=="<>")throw new J(38);const o=wK(i);return SK.bind(null,s??"=",o)}var Rx=(e,t,s)=>{if(!s||t===0||s.absolute)return;const{visibleCols:i,colModel:r}=e,o=i.allCols,n=tK(r,o,s.id);if(n==null)return;const a=n+t;if(a<0)return;const l=sK(o,a);l&&(s.id=l)},Fx=(e,t,s,i)=>{if(!s||t===0||s.absolute)return;if(i){const a=Number(s.id);if(!Number.isFinite(a))return;s.id=String(a+t);return}const r=mf(e,s.id);if(r==null)return;const o=r+t;if(o<1)return;const n=ux(e,o);n&&(s.id=n)},xK=e=>!!e&&typeof e=="object"&&e!==null&&"row"in e&&"column"in e,Ex=(e,t,s,i,r)=>{if(t.type==="operand"){const{value:o}=t;if(!xK(o))return;const{row:n,column:a,endRow:l,endColumn:c}=o;Fx(e,s,n,r),Rx(e,i,a),Fx(e,s,l,r),Rx(e,i,c);return}if(t.type==="operation")for(const o of t.operands)Ex(e,o,s,i,r)},RK=({values:e})=>{let t=0;for(const s of e)s!=null&&s!==""&&!isNaN(s)&&t++;return t},FK=({values:e})=>{let t=0;for(const s of e)s!=null&&s!==""&&t++;return t},EK=({values:e})=>{let t=0;for(const s of e)(s==null||s==="")&&t++;return t},PK=({args:e})=>{const[t,s]=ps(e,"COUNTIF",2);if(!wf(t))throw new J(65);if(!Sx(s))throw new J(66);const i=xx(s.value);let r=0;for(const o of t)i(o)&&r++;return r},MK=()=>new Date,TK=()=>{const e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate())},DK=({values:e})=>{const[t,s]=ps(e,"EQUALS",2);return t===s},AK=({values:e})=>{const[t,s]=ps(e,"NOT_EQUALS",2);return t!==s},IK=({values:e})=>{const[t,s]=ps(e,"GT",2);return t>s},kK=({values:e})=>{const[t,s]=ps(e,"GTE",2);return t>=s},LK=({values:e})=>{const[t,s]=ps(e,"LT",2);return t{const[t,s]=ps(e,"LTE",2);return t<=s},OK=({values:e})=>{const[t,s,i]=ps(e,"IF",3);return t?s:i},VK=({values:e})=>{let t=null;for(const s of e)s!=null&&(t===null||s{let t=null;for(const s of e)s!=null&&(t===null||s>t)&&(t=s);if(t===null)throw new J(69);return t},NK=e=>typeof e=="number"&&Number.isFinite(e),Px=24*60*60*1e3;function HK(e){return e.getTime()/Px}function Rd(e){return new Date(e*Px)}function Ko(e){return e instanceof Date}function Ys(e,t){if(typeof t=="bigint"){const s=Number(t);if(Number.isFinite(s))return s;throw new J(48,[e])}if(NK(t))return t;if(Ko(t))return HK(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string"){const s=Number(t.trim());if(Number.isFinite(s))return s}throw new J(48,[e])}function jo(e,t){return typeof t=="bigint"?t:Ys(e,t)}function Xs(e,t){if(typeof t=="bigint")return t;if(!Number.isFinite(t)||!Number.isInteger(t))throw new J(49,[e]);return BigInt(t)}var Mx=({values:e})=>{let t=1,s=null;for(const i of $o(e)){const r=jo("PRODUCT",i);if(typeof r=="bigint"){if(s??(s=Xs("PRODUCT",t)),r===0n)return 0n;s*=r;continue}if(s!=null){s*=Xs("PRODUCT",r);continue}if(r===0)return 0;t*=r}return s??t},zK=({values:e})=>{const[t,s]=ps($o(e),"DIVIDE",2),i=Ys("DIV",t),r=Ys("DIV",s);if(i==null||r==null)throw new J(54);if(r===0)throw new J(55);return i/r},Sf=({values:e})=>{let t=!1,s=0,i=null,r=!1;for(const o of $o(e)){t||(t=Ko(o));const n=jo("SUM",o);if(typeof n=="bigint"){if(t)throw new J(56);i??(i=Xs("SUM",s)),i+=n,r=!0;continue}if(typeof i=="bigint"){if(t)throw new J(56);i+=Xs("SUM",n),r=!0;continue}s+=n,r=!0}if(!r)throw new J(57);return typeof i=="bigint"?i:t?Rd(s):s},_K=({values:e})=>{const[t,s]=ps($o(e),"MINUS",2),i=Ko(t),r=Ko(s);if(i||r){const a=Ys("MINUS",t),l=Ys("MINUS",s);return i&&!r?Rd(a-l):a-l}const o=jo("MINUS",t),n=jo("MINUS",s);return typeof o=="bigint"||typeof n=="bigint"?Xs("MINUS",o)-Xs("MINUS",n):o-n},WK=({values:e})=>{const[t]=ps(e,"PERCENT",1),s=Ys("PERCENT",t);if(s==null)throw new J(70);return s/100},Tx=({values:e})=>{const[t,s]=ps(e,"POWER",2),i=Ys("POWER",t),r=Ys("POWER",s);if(i==null||r==null)throw new J(71);return Math.pow(i,r)},UK=({values:e})=>{let t=0,s=0,i=!0;for(const o of $o(e)){const n=Ys("AVG",o);n!=null&&(t+=n,s++,i&&(i=Ko(o)))}if(s===0)throw new J(58);const r=t/s;return i?Rd(r):r},$K=({values:e})=>{let t=!0;const s=[];for(const o of $o(e)){const n=Ys("MEDIAN",o);if(n==null)throw new J(59);s.push(n),t&&(t=Ko(o))}if(s.length===0)throw new J(60);s.sort((o,n)=>o-n);const i=Math.floor(s.length/2),r=s.length%2===1?s[i]:(s[i-1]+s[i])/2;return t?Rd(r):r},KK=()=>Math.random(),jK=({args:e})=>{const[t,s,i]=mK(e,"SUMIF",2,3);if(!wf(t))throw new J(61);if(!Sx(s))throw new J(62);if(i&&!wf(i))throw new J(63);const r=xx(s.value);if(!i){let u=0,h=null;for(const g of t)if(r(g)){const p=jo("SUMIF",g);typeof p=="bigint"?(h??(h=Xs("SUMIF",u)),h+=p):h!=null?h+=Xs("SUMIF",p):u+=p}return h??u}const o=t.rowEnd-t.rowStart,n=i.rowEnd-i.rowStart;if(o!==n)throw new J(64);const a=t[Symbol.iterator](),l=i[Symbol.iterator]();let c=0,d=null;for(;;){const u=a.next(),h=l.next();if(u.done||h.done){if(u.done!==h.done)throw new J(64);break}if(r(u.value)){const g=jo("SUMIF",h.value);typeof g=="bigint"?(d??(d=Xs("SUMIF",c)),d+=g):d!=null?d+=Xs("SUMIF",g):c+=g}}return d??c},yf=({values:e})=>{let t="";for(const s of e)if(s!=null)switch(typeof s){case"string":{t+=s;break}case"number":{t+=String(s);break}case"boolean":{t+=s?"TRUE":"FALSE";break}case"object":{t+=s.toString();break}default:throw new J(67)}return t},Dx={IF:OK,NOW:MK,TODAY:TK,PRODUCT:Mx,SUM:Sf,ADD:Sf,SUMIF:jK,POWER:Tx,MIN:VK,MAX:BK,AVERAGE:UK,MEDIAN:$K,COUNT:RK,COUNTA:FK,COUNTBLANK:EK,COUNTIF:PK,RAND:KK,CONCAT:yf,CONCATENATE:yf,"+":Sf,"-":_K,"*":Mx,"/":zK,"^":Tx,"%":WK,"=":DK,"&":yf,"<>":AK,">":IK,">=":kK,"<":LK,"<=":GK},qK=class{constructor(e,t,s,i){this.rowNode=e,this.column=t,this.formulaString=s,this.beans=i,this.error=null,this.ast=null,this.astStale=!0,this._value=void 0,this._valueStale=!0}setFormulaString(e){this.formulaString!==e&&(this.formulaString=e,this.astStale=!0,this._valueStale=!0)}setComputedValue(e){this._value=e,this._valueStale=!1,this.error=null}setError(e){this.error=e,this._valueStale=!1}isValueReady(){return!this._valueStale}getValue(){return this.error?.type??this._value}getError(){return this.error}getAst(){if(!this.astStale)return this.ast;const e=pf(this.beans,this.formulaString);return this.ast=e??null,this.astStale=!1,this.ast}},YK=class extends E{constructor(){super(...arguments),this.beanName="formula",this.cachedResult=new WeakMap,this.colRefMap=new Map,this.functionNames=null,this.active=!1}setFormulasActive(e){const s=e.list.some(i=>i.isAllowFormula())&&this.checkForIncompatibleServices(e);s!==this.active&&(this.active=s,this.refreshFormulas(!0))}checkForIncompatibleServices(e){return this.gos.get("masterDetail")?(F(295,{blockedService:"Master Detail"}),!1):this.gos.get("treeData")?(F(295,{blockedService:"Tree Data"}),!1):this.gos.get("enableCellExpressions")?(F(295,{blockedService:"Cell Expressions"}),!1):e.list.every(t=>t.isAllowPivot()||t.isPivotActive()?(F(295,{blockedService:"Column Pivoting"}),!1):t.isAllowRowGroup()||t.isRowGroupActive()?(F(295,{blockedService:"Row Groups"}),!1):t.isAllowValue()||t.isValueActive()||t.getAggFunc()?(F(295,{blockedService:"Value Aggregation"}),!1):!0)}postConstruct(){this.setupFunctions();const e=()=>{this.active&&this.refreshFormulas(!0)},t=()=>{this.active&&this.setupColRefMap()};this.addManagedPropertyListeners(["masterDetail","enableCellExpressions"],s=>{const{colModel:i}=this.beans;i.cols?.list.some(o=>o.isAllowFormula())&&i.refreshAll(Os(s.source))}),this.addManagedListeners(this.beans.eventSvc,{modelUpdated:e,cellValueChanged:e,rowDataUpdated:e,newColumnsLoaded:t,columnMoved:t})}updateFormulaByOffset(e){const{value:t,rowDelta:s=0,columnDelta:i=0,useRefFormat:r=!0}=e,{beans:o}=this;try{const n=!r,a=pf(o,t,n);return Ex(o,a,s,i,n),mx(o,a,r,n)}catch{return t}}setupFunctions(){this.supportedOperations=new Map,Object.keys(Dx).forEach(t=>{this.supportedOperations.set(t,Dx[t])}),this.functionNames=null;const e=this.gos.get("formulaFuncs");e&&Object.keys(e).forEach(t=>{this.supportedOperations.set(t.toUpperCase(),e[t].func)})}getFunctionNames(){if(this.functionNames)return this.functionNames;const e=[];for(const t of this.supportedOperations.keys())vd(t[0])&&[...t].every(s=>Aa(s))&&e.push(t);return e.sort((t,s)=>t.localeCompare(s)),this.functionNames=e,e}setupColRefMap(){if(!this.active){this.colRefMap=new Map;return}const e="abcdefghijklmnopqrstuvwxyz",t=e.length,s=this.beans.colModel.getCols(),i=new Map;let r=0;s?.forEach(o=>{if(!o.isPrimary())return;let n="",a=r++;for(;n=e[a%t]+n,!(a{let n=e.get(r);if(n?.has(o))throw new J(51);n||(n=new Set,e.set(r,n)),n.add(o)},s=(r,o)=>{const n=e.get(r);n&&(n.delete(o),n.size===0&&e.delete(r))},i=r=>{for(const[o,n]of e)for(const a of n)this.ensureCellFormula(o,a)?.setError(r)};return this.activeCtx={setVisited:s,setVisiting:t,errorAllVisitors:i}}makeFormulaFrame(e){const s=this.ensureCellFormula(e.row,e.column).getAst();if(!s)throw new J(52);const i=fK(this.beans,s,this.ensureCellFormula.bind(this));return{address:e,ast:s,unresolvedDepIterator:i}}resolveValue(e,t){const s=this.ensureCellFormula(t,e);if(!s)return this.fetchRawValue(e,t);if(s.isValueReady())return s.getValue();const i=!!this.activeCtx,{setVisited:r,setVisiting:o,errorAllVisitors:n}=this.getVisitorContext(),a=[];try{for(o(t,e),a.push(this.makeFormulaFrame({row:t,column:e}));a.length;){const{address:l,ast:c,unresolvedDepIterator:d}=a[a.length-1],{row:u,column:h}=l,g=this.ensureCellFormula(u,h);if(g.isValueReady()){if(a.pop(),r(u,h),g.error)throw g.error;continue}const p=d.next();if(!p.done){const v=p.value,w=this.ensureCellFormula(v.row,v.column);if(!w||w.isValueReady())continue;o(v.row,v.column),a.push(this.makeFormulaFrame(v));continue}const f=vx(this.beans,c,v=>{const w=this.ensureCellFormula(v.row,v.column);if(w){if(!w.isValueReady())throw new J(53);const S=w.getError();if(S)throw S;return w.getValue()}return this.fetchRawValue(v.column,v.row)},{row:u,column:h}),m=this.coerceFormulaValue(h,f),C=g.getError();if(C)throw r(u,h),C;g.setComputedValue(m),r(u,h),a.pop()}if(!s.isValueReady())throw new J(53);return s.getValue()}catch(l){const c=l instanceof J?l:new J(String(l?.message??l));return n(c),c.type}finally{i||(this.activeCtx=null)}}},Ax={moduleName:"Formula",version:Y,userComponents:{agFormulaCellEditor:_$},beans:[YK,U$,$$],dependsOn:[Jp],css:[W$]},XK=".ag-sparkline-wrapper{height:100%;line-height:normal;position:absolute;top:0;width:100%}",xf=Symbol("WrappedFunctionMarker"),Ix=(e,t)=>{if(e[xf])return e;const s=(...i)=>t(e,...i);return s[xf]=xf,s},ZK="Sparkline - ${chartType} displaying ${count} values between ${min} and ${max}. Starts at ${start} and ends at ${end}.",QK="Sparkline - ${chartType} displaying 1 value, ${value}.",JK="Sparkline - ${chartType} displaying no values.",ej=(e,t)=>{const s=t?.type??"line";switch(s){case"line":return e("lineChart","Line");case"area":return e("areaChart","Area");case"bar":return e("barChart","Bar");default:return s}},tj=(e,t)=>{let s=0,i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o,n;for(const a of e){const l=oj(a,t);l!=null&&(o==null&&(o=l),n=l,s++,i=Math.min(i,l),r=Math.max(r,l))}return s===0?{count:s}:{count:s,min:i,max:r,start:o,end:n}};function sj(e){const{translate:t,chartType:s,summary:i,formatNumber:r}=e;let o,n,a,l;if(!ij(i))o="ariaSparklineChartDescriptionEmpty",n=JK,a=[s],l={chartType:s};else if(i.count===1){const c=r(i.start);o="ariaSparklineChartDescriptionSingleValue",n=QK,a=[s,c],l={chartType:s,value:c}}else{const[c,d,u,h,g]=[i.count,i.min,i.max,i.start,i.end].map(r);o="ariaSparklineChartDescription",n=ZK,a=[s,c,d,u,h,g],l={chartType:s,count:c,min:d,max:u,start:h,end:g}}return{template:t(o,n,a),values:l}}var ij=e=>e.count>0&&e.min!=null&&e.max!=null&&e.start!=null&&e.end!=null,rj=(e,t)=>e.replace(/\$\{([^}]+)\}/g,(s,i)=>t[i]??s),oj=(e,t)=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(e&&typeof e=="object"){const s=Array.isArray(e)?e[1]:e[t];return typeof s=="number"&&Number.isFinite(s)?s:null}return null};function nj(e){return{content:`${e.xValue} ${e.yValue}`}}function aj(e){return{content:`${e.yValue}`}}var kx="ag-sparkline",lj=class extends A{constructor(){super({tag:"div",cls:`${kx}-wrapper`,children:[{tag:"span",ref:"eSparkline"}]}),this.eSparkline=x,this.cachedWidth=0,this.cachedHeight=0,this.dataRef=[],this.processedData=[]}postConstruct(){this.env=this.beans.environment,this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes","styleNonce"],()=>this.refresh(this.params))}createListener(e=!0){return()=>this.updateSize(this.params?.column?.getActualWidth()??0,(this.params?.node.rowHeight??0)-2,e)}initGridObserver(){const e=this.createListener(),t=this.createListener(!1),s=this.params?.column,i=this.params?.node;s.__addEventListener("columnStateUpdated",e),i.__addEventListener("heightChanged",e),this.addDestroyFunc(()=>{s.__removeEventListener("columnStateUpdated",e),i.__removeEventListener("heightChanged",e)}),t()}updateSize(e,t,s=!0){if(e-=this.env.getCellPadding(),e!==this.cachedWidth||t!==this.cachedHeight){this.cachedWidth=e,this.cachedHeight=t;const i=this.refresh.bind(this);s?Cn(()=>this.isAlive()&&i()):i()}}init(e){this.params=e;const{eParentOfValue:t}=e,s=`${kx}-cell-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",s),Cs(t,s),this.addDestroyFunc(()=>Cs(t)),this.initGridObserver()}refresh(e=this.params){var t;this.params=e;const s=this.processData(e?.value);this.refreshAriaLabel(s);const i=this.cachedWidth,r=this.cachedHeight,o=this.gos.get("styleNonce");if(!this.sparklineInstance&&e&&i>0&&r>0){if(this.sparklineOptions={container:this.eSparkline,width:i,height:r,...e.sparklineOptions,...o?{styleNonce:o}:{},data:s},(t=this.sparklineOptions).type??(t.type="line"),this.sparklineOptions.tooltip?.renderer)this.wrapTooltipRenderer();else{const a=this.getDefaultTooltipRenderer();this.sparklineOptions.tooltip={...this.sparklineOptions.tooltip,renderer:a}}const n=this.sparklineOptions?.theme;return this.sparklineOptions.type==="bar"&&this.sparklineOptions.itemStyler?this.wrapItemStyler(this.sparklineOptions):n?.overrides?.bar?.series?.itemStyler&&this.wrapItemStyler(n.overrides.bar.series),this.sparklineInstance=e.createSparkline(this.sparklineOptions),!0}else if(this.sparklineInstance)return this.sparklineInstance.update({...this.sparklineOptions,data:s,width:i,height:r,...o?{styleNonce:o}:{}}),!0;return!1}refreshAriaLabel(e){const t=this.getLocaleTextFunc(),s=this.getLocaleTextFunc.bind(this),i=this.params?.sparklineOptions?.yKey??this.sparklineOptions?.yKey??"y",r=tj(e,i),o=this.params?.sparklineOptions??this.sparklineOptions,{template:n,values:a}=sj({translate:t,chartType:ej(t,o),summary:r,formatNumber:l=>ci(l,s)});de(this.getGui(),rj(n,a))}processData(e){return e?.length?(this.dataRef!==e&&(this.dataRef=e,this.processedData=Array.isArray(e[0])?e.filter(t=>t!=null):e),this.processedData):e??[]}createContext(){return{data:this.params?.data,cellData:this.params?.value}}getDefaultTooltipRenderer(e){const t=e?.title,s=this.sparklineOptions.xKey,i=Array.isArray(this.sparklineOptions.data?.[0]);return!t&&(s||i)?nj:aj}wrapItemStyler(e){e.itemStyler=Ix(e.itemStyler,(t,s)=>t({...s,context:this.createContext()}))}wrapTooltipRenderer(){this.sparklineOptions.tooltip={...this.sparklineOptions.tooltip,renderer:Ix(this.sparklineOptions.tooltip.renderer,(e,t)=>{const s=e({...t,context:this.createContext()});return typeof s=="string"?s:{...this.getDefaultTooltipRenderer(s)(t),...s}})}}destroy(){super.destroy(),this.sparklineInstance?.destroy()}},Lx="Sparklines",Rf={moduleName:Lx,version:Y,dependsOn:[le],validate:()=>({isValid:!1,message:cl(258)}),with:e=>(e.setup(),{moduleName:Lx,version:Y,dependsOn:[le],css:[XK],userComponents:{agSparklineCellRenderer:{classImp:lj,params:{createSparkline:e.createSparkline}}},validate:()=>({isValid:!0})})},cj=".ag-find-cell{display:block;overflow:hidden;text-overflow:ellipsis}.ag-find-match{background-color:var(--ag-find-match-background-color);color:var(--ag-find-match-color)}.ag-find-active-match{background-color:var(--ag-find-active-match-background-color);color:var(--ag-find-active-match-color)}";function dj(e){e.findSvc?.next()}function uj(e){e.findSvc?.previous()}function hj(e){return e.findSvc?.totalMatches??0}function gj(e,t,s){e.findSvc?.goTo(t,s)}function pj(e){e.findSvc?.clearActive()}function fj(e){return e.findSvc?.activeMatch}function mj(e,t){const{node:s,column:i}=t;return e.findSvc?.getNumMatches(s,i)??0}function Cj(e,t){return e.findSvc?.getParts(t)??[]}function vj(e){return e.findSvc?.refresh(!0)}var wj={tag:"span",cls:"ag-find-cell"},bj=class extends A{constructor(){super(wj)}init(e){this.refresh(e)}refresh(e){const{node:t,column:s}=e,{findSvc:i,valueSvc:r}=this.beans,{value:o,valueFormatted:n}=r.getValueForDisplay({column:s,node:t,includeValueFormatted:!0,from:"edit"}),a=n??o??"",l=this.getGui();ee(l);const c=i?.getParts({value:a,node:t,column:s??null});if(!c)l.textContent=es(a)??"",l.classList.remove("ag-find-cell-active-match");else{let d=!1;for(const{value:u,match:h,activeMatch:g}of c){const p=es(u)??"";if(h){const f=re({tag:"mark",cls:"ag-find-match"});f.textContent=p,g&&(f.classList.add("ag-find-active-match"),d=!0),l.appendChild(f)}else l.appendChild(document.createTextNode(p))}l.classList.toggle("ag-find-cell-active-match",d)}return!0}};function Gx(e){return e?.toLocaleLowerCase()}function Ia(e,t,s){const i=t(es(s));let r=0;if(i?.length){let o=-1;for(;o=i.indexOf(e,o+1),o!=-1;)r++}return r}var Sj=class extends E{constructor(){super(...arguments),this.beanName="findSvc",this.active=!1,this.topMatches=new Map,this.topNodes=[],this.topNumMatches=0,this.centerMatches=new Map,this.centerNodes=[],this.centerNumMatches=0,this.bottomMatches=new Map,this.bottomNodes=[],this.caseFormat=Gx,this.scrollOnRefresh=!1,this.totalMatches=0}postConstruct(){if(!ae(this.gos))return;const e=this.refresh.bind(this,!1),t=this.refresh.bind(this,!0),s=Ce(this,()=>{this.isAlive()&&t()},0);this.refreshDebounced=s,this.addManagedPropertyListener("findSearchValue",e),this.addManagedPropertyListener("findOptions",({currentValue:r,previousValue:o})=>{Ds(r,o)||e()}),this.addManagedPropertyListeners(["groupSuppressBlankHeader","showOpenedGroup"],t),this.addManagedEventListeners({modelUpdated:t,displayedColumnsChanged:t,pinnedRowDataChanged:t,cellValueChanged:s,rowNodeDataChanged:s,cellEditingStopped:s,cellEditValuesChanged:s,batchEditingStopped:s});const i=this.beans.rowSpanSvc;i&&this.addManagedListeners(i,{spannedCellsUpdated:s}),e()}next(){this.findAcrossContainers(!1,["top",null,"bottom"],1,1)}previous(){this.findAcrossContainers(!0,["bottom",null,"top"],this.totalMatches,-1)}goTo(e,t){if(!t&&e===this.activeMatch?.numOverall)return;const{topMatches:s,topNumMatches:i,centerMatches:r,centerNumMatches:o,bottomMatches:n}=this;if(e<=i){this.goToInContainer(s,e,0);return}if(e<=o){this.goToInContainer(r,e,i);return}this.goToInContainer(n,e,i+o)}clearActive(){this.activeMatch&&this.setActive(void 0)}isMatch(e,t){return this.active&&!!this.getMatches(e.rowPinned).get(e)?.some(([s])=>s===t)}getNumMatches(e,t){return this.getMatches(e.rowPinned).get(e)?.find(([s])=>s===t)?.[1]??0}getParts(e){const{value:t,node:s,column:i,precedingNumMatches:r}=e,o=this.findSearchValue,n=es(t)??"";if(ne(o))return[{value:n}];const a=this.caseFormat(n)??"",l=this.getActiveMatchNum(s,i)-(r??0);let c=0,d=0;const u=o.length,h=[];for(;;){const g=a.indexOf(o,c);if(g!=-1){d++,g>c&&h.push({value:n.slice(c,g)});const p=g+u;h.push({value:n.slice(g,p),match:!0,activeMatch:d===l}),c=p}else return cs.get("findOptions")?.searchDetail,r=o=>{const a=this.centerMatches.get(e)?.[0]?.[1]??0;o!==a&&this.refreshDebounced()};t.addEventListener("findChanged",o=>{t.isDestroyed()||!this.isAlive()||!this.active||!i()||r(o.totalMatches)}),t.addEventListener("gridPreDestroyed",()=>{if(!this.isAlive()||!this.active||!i())return;const o=e.parent,n=this.findSearchValue;if(!o||!n)return;const a=s.get("detailCellRendererParams")?.getFindMatches?.({node:o,data:o.data,findSearchValue:s.get("findSearchValue"),updateMatches:this.refreshDebounced,getMatchesForValue:l=>Ia(n,this.caseFormat,l)})??0;r(a)}),i()&&t.setGridOption("findSearchValue",s.get("findSearchValue"))}refresh(e){const t=new Set([...this.topNodes,...this.centerNodes,...this.bottomNodes]);this.topNodes=[],this.centerNodes=[],this.bottomNodes=[];const{topNodes:s,topMatches:i,centerMatches:r,centerNodes:o,bottomNodes:n,bottomMatches:a,beans:{gos:l,visibleCols:c,rowModel:d,valueSvc:u,pinnedRowModel:h,pagination:g,rowSpanSvc:p,masterDetailSvc:f,colModel:m},findSearchValue:C}=this,v=l.get("findOptions"),w=v?.caseSensitive?Z=>Z??void 0:Gx;this.caseFormat=w;const S=l.get("findSearchValue"),y=w(S?.trim());this.findSearchValue=y,i.clear(),r.clear(),a.clear();const R=e?this.activeMatch:void 0;this.activeMatch=void 0;const P=l.get("masterDetail")&&v?.searchDetail&&f;if(ne(y)){if(this.active=!1,this.topNumMatches=0,this.centerNumMatches=0,this.totalMatches=0,this.refreshRows(t),P){const Z=f.store;for(const _t of Object.keys(Z))Z[_t]?.api?.findClearActive()}ne(C)||this.dispatchFindChanged();return}const M=c.allCols,T=l.getCallback("isFullWidthRow"),I=l.get("detailCellRendererParams"),k=l.get("fullWidthCellRendererParams"),L=l.get("groupRowRendererParams"),j=J0(l),U=m.isPivotMode();let O=0,X,se,we=!1;const pe=(Z,_t,Ms,qf)=>{if(!Ms)return;let fe=X.get(Z);fe||(fe=[],X.set(Z,fe),se.push(Z),qf||t.add(Z)),fe.push([_t,Ms]),O+=Ms},ge=Z=>{if(we){let fe=Z.rowIndex,rt=Z.parent;for(;fe==null&&rt;)fe=rt.rowIndex,rt=rt.parent;if(fe==null||!g.isRowInPage(fe))return}const _t=Z.hasChildren();if(!s1(j,Z,_t,U,e1(j,Z,_t),t1(j,Z,_t)))return;const Ms=Z.data;if(T?.({rowNode:Z})){if(k){const fe=k.getFindMatches?.({node:Z,data:Ms,findSearchValue:S,updateMatches:this.refreshDebounced,getMatchesForValue:rt=>Ia(y,w,rt)})??0;pe(Z,null,fe)}return}if(hl(l,Z,U)){let fe;const rt=L?.getFindText;if(rt){const Qo=u.getValueForDisplay({node:Z,from:"batch"}).value;fe=rt(N(l,{value:Qo,node:Z,data:Ms,column:null,colDef:null,getValueFormatted:()=>{const{valueFormatted:Jo}=u.getValueForDisplay({node:Z,includeValueFormatted:!0,from:"batch"});return Jo}}))}else{const{value:Qo,valueFormatted:Jo}=u.getValueForDisplay({node:Z,includeValueFormatted:!0,from:"batch"});fe=Jo??Qo}const Ci=Ia(y,w,fe);pe(Z,null,Ci);return}const qf=Z.level>0&&l.get("groupHideOpenParents")&&Z.parent?.getFirstChild()===Z&&!Z.parent?.expanded;for(const fe of M){if(yr(fe))continue;const rt=p?.getCellSpan(fe,Z);if(rt&&rt.firstNode!==Z||fe.colDef.showRowGroup&&qf)continue;let Ci;const Qo=fe.colDef,Jo=Qo.getFindText;if(Jo){const Yf=u.getValueForDisplay({column:fe,node:Z,from:"batch"}).value;Ci=Jo(N(l,{value:Yf,node:Z,data:Ms,column:fe,colDef:Qo,getValueFormatted:()=>{const{valueFormatted:Xf}=u.getValueForDisplay({column:fe,node:Z,includeValueFormatted:!0,from:"batch"});return Xf}}))}else{const{value:Yf,valueFormatted:Xf}=u.getValueForDisplay({column:fe,node:Z,includeValueFormatted:!0,from:"batch"});Ci=Xf??Yf}const mQ=Ia(y,w,Ci);pe(Z,fe,mQ)}if(Z.master&&P){const fe=Z.detailNode;if(fe){const rt=fe.detailGridInfo?.api;if(rt){rt.setGridOption("findSearchValue",S);const Ci=rt.findGetTotalMatches();pe(fe,null,Ci);return}}if(I){const rt=I.getFindMatches?.({node:Z,data:Ms,findSearchValue:S,updateMatches:this.refreshDebounced,getMatchesForValue:Ci=>Ia(y,w,Ci)})??0;pe(fe??{parent:Z,dummy:!0},null,rt,!fe)}}};X=i,se=s,h?.forEachPinnedRow("top",ge),this.topNumMatches=O;let it=O;X=r,se=o,O=0,we=!!g&&!!v?.currentPageOnly,d.forEachNodeAfterFilterAndSort(ge,!0),this.centerNumMatches=O,it+=O,X=a,se=n,O=0,we=!1,h?.forEachPinnedRow("bottom",ge),it+=O,this.totalMatches=it,this.active=!0,this.refreshRows(t),R&&this.resetActiveMatch(R),this.dispatchFindChanged()}resetActiveMatch(e){const{column:t,numInMatch:s}=e;let i=e.node;if(i.dummy){const c=i.parent?.detailNode;if(!c)return;i=c}const r=i.rowPinned??null;if(!this.getMatches(r)?.get(i)?.some(([c,d])=>c===t&&d>=s))return;let n=0;r==null?n=this.topNumMatches:r==="bottom"&&(n=this.topNumMatches+this.centerNumMatches),(()=>{const c=this.getMatches(r);for(const d of c.keys()){const u=d===i,h=c.get(d);for(const[g,p]of h){if(u&&g===t){n+=s;return}n+=p}}})();const l={...e,node:i,numOverall:n};this.activeMatch=l,this.refreshRows(new Set([i]),t==null?void 0:new Set([t])),this.scrollOnRefresh&&(this.scrollOnRefresh=!1,this.scrollToActive(l)),this.setDetailActive(l)}refreshRows(e,t){e.size&&this.beans.rowRenderer.refreshCells({rowNodes:[...e],columns:t?[...t]:void 0,force:!0,suppressFlash:!0})}findAcrossContainers(e,t,s,i){if(!this.totalMatches){this.setActive();return}const r=this.activeMatch;let o=t;if(r){const{column:n,node:a,numInMatch:l,numOverall:c}=r,d=a.rowPinned??null,u=c+i;if(this.findInContainer(d,e,u,a,n,l))return;const g=t.indexOf(d),p=t.length;if(t.slice(g+1,p).some(m=>this.findInContainer(m,e,u)))return;o=t.slice(0,g+1)}o.some(n=>this.findInContainer(n,e,s))}findInContainer(e,t,s,i,r,o){const n=this.getMatches(e),a=this.getRowNodes(e),l=t?-1:1;if(i!=null){const h=n.get(i),g=h?.findIndex(([f])=>f===r);if(g!=null&&g!=-1){const[f,m]=h[g];if(t?o>1:og===i);c=a[h+l]}if(c==null)return!1;const d=n.get(c),u=d?.[t?d.length-1:0];if(u){const[h,g]=u;return this.setActive({column:h,node:c,numInMatch:t?g:1,numOverall:s}),!0}return!1}dispatchFindChanged(){const{eventSvc:e,activeMatch:t,totalMatches:s,findSearchValue:i}=this;e.dispatchEvent({type:"findChanged",activeMatch:t,totalMatches:s,findSearchValue:i})}setActive(e){if(e&&e.node.rowIndex==null){const s=e.node;let i=s.footer?s.sibling:s.parent;for(;i&&i.level!==-1;)i.expanded=!0,i=i.parent;this.activeMatch=e,this.scrollOnRefresh=!0,this.beans.expansionSvc?.onGroupExpandedOrCollapsed();return}const t=this.activeMatch;this.activeMatch=e,this.refreshAndScrollToActive(e,t),e&&this.setDetailActive(e),this.dispatchFindChanged()}setDetailActive({node:e,numInMatch:t}){e.detail&&e.detailGridInfo?.api?.findGoTo(t)}refreshAndScrollToActive(e,t){if(e||t){const s=new Set,i=new Set;let r=!1;const o=n=>{if(!n)return;const{node:a,column:l}=n;s.add(a),l==null?r=!0:i.add(l)};o(e),o(t),this.refreshRows(s,r?void 0:i)}e&&this.scrollToActive(e)}scrollToActive({node:{rowPinned:e,rowIndex:t},column:s}){const{ctrlsSvc:i,pagination:r,gos:o}=this.beans,n=i.getScrollFeature();e==null&&t!=null&&(r&&!o.get("findOptions")?.currentPageOnly&&!r.isRowInPage(t)&&r.goToPageWithIndex(t),n.ensureIndexVisible(t)),n.ensureColumnVisible(s)}goToInContainer(e,t,s){let i=s;for(const r of e.keys()){const o=e.get(r);for(const[n,a]of o){if(t<=i+a){this.setActive({column:n,node:r,numInMatch:t-i,numOverall:t});return}i+=a}}}getMatches(e){return e==="top"?this.topMatches:e==="bottom"?this.bottomMatches:this.centerMatches}getRowNodes(e){return e==="top"?this.topNodes:e==="bottom"?this.bottomNodes:this.centerNodes}getActiveMatchNum(e,t){const s=this.activeMatch;return s!=null&&s.node===e&&s.column===t?s.numInMatch:0}destroy(){this.topMatches.clear(),this.topNodes.length=0,this.centerMatches.clear(),this.centerNodes.length=0,this.bottomMatches.clear(),this.bottomNodes.length=0,this.activeMatch=void 0,super.destroy()}},yj={moduleName:"FindCore",version:Y,rowModels:["clientSide"],beans:[Sj],userComponents:{agFindCellRenderer:bj},css:[cj]},Ox={moduleName:"Find",version:Y,apiFunctions:{findGetTotalMatches:hj,findGoTo:gj,findNext:dj,findPrevious:uj,findGetActiveMatch:fj,findGetNumMatches:mj,findGetParts:Cj,findClearActive:pj,findRefresh:vj},dependsOn:[le,yj]};function xj({editSvc:e,gos:t,rowModel:s}){if(!ae(t,s)){F(289,{rowModelType:t.get("rowModelType")});return}e?.startBatchEditing()}function Rj({editSvc:e}){e?.stopBatchEditing({cancel:!0,source:"api",forceCancel:!0})}function Fj({editSvc:e}){e?.stopBatchEditing({source:"api",forceStop:!0,commit:!0})}function Ej(e){return e.editSvc?.isBatchEditing()??!1}var Vx={moduleName:"BatchEdit",version:Y,beans:[],apiFunctions:{isBatchEditing:Ej,startBatchEdit:xj,cancelBatchEdit:Rj,commitBatchEdit:Fj},dependsOn:[Es,le],css:[]},Fd=(e,t)=>t===!1||t===null?!1:Bx(e)?t==="overwrite"?"overwrite":!1:typeof t=="string"?t:e==="sum"?"uniform":e==="avg"||e==null||t===!0?"overwrite":!1,Bx=e=>e==="count"||e==="min"||e==="max"||e==="first"||e==="last",Pj=e=>e==="sum"||e==="avg",Zs=e=>{if(typeof e=="number")return e;if(typeof e=="bigint"||typeof e=="string"){const t=Number(e);return Number.isFinite(t)?t:0}if(typeof e=="boolean")return e?1:0;if(e!=null&&typeof e=="object"){if(typeof e.toNumber=="function")return Zs(e.toNumber());if("value"in e)return Zs(e.value)}return 0},Nx=e=>Number.isFinite(e)?BigInt(Math.round(e)):0n,qo=e=>{if(typeof e=="bigint")return e;if(typeof e=="number")return Nx(e);if(typeof e=="boolean")return e?1n:0n;if(typeof e=="string")try{return BigInt(e)}catch{return Nx(Number(e))}if(e!=null&&typeof e=="object"){if(typeof e.toNumber=="function")return qo(e.toNumber());if("value"in e)return qo(e.value)}return 0n},Ff=e=>{const t=typeof e;if(t==="number"||t==="bigint"||t==="boolean")return!0;if(t==="string")return Number.isFinite(Number(e));if(e!=null&&t==="object"){if(typeof e.toNumber=="function")return!0;if("value"in e)return Ff(e.value)}return!1},Mj=e=>{if(e.cellDataType==="bigint")return 0;const t=e.cellEditorParams;if(t==null||typeof t!="object")return;const s=t.precision;if(typeof s=="number"&&Number.isInteger(s)&&s>=0)return s;const i=t.step;if(typeof i=="number"&&Number.isInteger(i))return 0},Tj=class{constructor(e,t,s){this.params=e;const{aggregatedChildren:i,column:r,newValue:o}=e,n=qo(o),a=qo(e.oldValue),l=i.length,c=BigInt(l);this.children=i,this.column=r,this.count=l,this.bigCount=c,this.newValue=o,this.strategy=Fd(s,t?.distribution),s==="avg"?(this.target=n*c,this.oldTarget=a*c):(this.target=n,this.oldTarget=a),this.getVal=t?.getValue,this.setVal=t?.setValue}run(){const{strategy:e,newValue:t}=this;if(e===!1)return!1;if(e==="overwrite")return this.writeAll(t);const{target:s,oldTarget:i}=this;return s===0n&&!Ff(t)?this.writeAll(t):e==="increment"&&s===i?!1:e==="uniform"?this.writeUniformDirect(s):e==="increment"?this.writeIncrementDirect(s-i):this.writePercentage()}readOne(e){const{children:t,column:s,getVal:i}=this,r=t[e];if(i){const{colDef:o,api:n,context:a}=this.params;return qo(i({node:r,data:r.data,column:s,colDef:o,api:n,context:a,groupParams:this.params}))}return qo(r.getDataValue(s,"value"))}writeOne(e,t){const{children:s,column:i,setVal:r}=this,o=s[e];if(r){const{colDef:n,api:a,context:l}=this.params;return r({node:o,data:o.data,column:i,colDef:n,api:a,context:l,groupParams:this.params,value:t})}return o.setDataValue(i,t,"data")}writeAll(e){const{count:t}=this;let s=!1;for(let i=0;i=0n?1n:-1n;let a=!1;for(let l=0;l=0n?1n:-1n;let a=!1;for(let l=0;l0n&&a=0?d:void 0:this.precision=Mj(o),this.getVal=t?.getValue,this.setVal=t?.setValue}run(){const{strategy:e,newValue:t}=this;if(e===!1)return!1;if(e==="overwrite")return this.writeAll(t);if(this.target===0&&!Ff(t))return this.writeAll(t);if(e==="increment"&&this.target===this.oldTarget)return!1;switch(e){case"uniform":return this.distributeUniform();case"increment":return this.distributeIncrement();default:return this.isAvg?this.distributePercentageAvg():this.distributePercentage()}}readOne(e){const{column:t,getVal:s}=this;if(s){const{colDef:i,api:r,context:o}=this.params;return Zs(s({node:e,data:e.data,column:t,colDef:i,api:r,context:o,groupParams:this.params}))}return Zs(e.getDataValue(t,"value"))}readValueAndCount(e){const{column:t,getVal:s}=this;let i;if(s){const{colDef:r,api:o,context:n}=this.params;i=s({node:e,data:e.data,column:t,colDef:r,api:o,context:n,groupParams:this.params})}else i=e.getDataValue(t);if(e.group){if(i!=null&&typeof i=="object"){const{value:r,count:o}=i;if(r!=null&&typeof o=="number"&&o>0)return typeof r=="number"?i:{value:Zs(r),count:o}}return{value:Zs(i),count:e.allLeafChildren?.length||1}}return{value:Zs(i),count:1}}writeOne(e,t){const{column:s,setVal:i}=this;if(i){const{colDef:r,api:o,context:n}=this.params;return i({node:e,data:e.data,column:s,colDef:r,api:o,context:n,groupParams:this.params,value:t})}return e.setDataValue(s,t,"data")}writeAll(e){const{children:t,count:s}=this;let i=!1;for(let r=0;r=0?1:-1;let d=!1;for(let u=0;u=0?1:-1;let u=!1;for(let h=0;h=0?1:-1;let h=!1;for(let g=0;g=0?1:-1;let f=!1;for(let m=0;m{const{aggregatedChildren:s,colDef:i}=e;if(s.length===0)return!1;const r=i.aggFunc??null,o=zx(t,r);return o===!1?!1:typeof o=="function"?o(e)??!0:i.cellDataType==="bigint"?new Tj(e,o,r).run():new Dj(e,o,r).run()};function zx(e,t){if(!e)return;const s=e.distribution;if(s===!1||s===null)return!1;const i=Bx(t),r=e.default;if(typeof s=="object"){const o=typeof t=="string"?s[t]:void 0;return o!==void 0?Ef(o,i,e):i?!1:Ef(r,!1,e)??Pf(e)}if(i)return s==="overwrite"?Pf(e,"overwrite"):!1;if(s===void 0&&!Pj(t)){const o=Ef(r,!1,e);if(o!==void 0)return o}return e}function Ef(e,t,s){if(e===!1||e===null)return!1;if(e!==void 0){if(typeof e=="function")return e;if(typeof e=="object"){const i=e.distribution;if(t&&i!=="overwrite"&&i!==!0)return!1;const{precision:r,getValue:o,setValue:n}=s;return{distribution:t?"overwrite":i,precision:e.precision??r,getValue:e.getValue??o,setValue:e.setValue??n}}return t&&e!=="overwrite"&&e!==!0?!1:Pf(s,t?"overwrite":e)}}function Pf(e,t){return{distribution:t,precision:e.precision,getValue:e.getValue,setValue:e.setValue}}var Aj=class extends E{constructor(){super(...arguments),this.beanName="rowGroupingEditValueSvc"}isGroupCellEditable(e,t){const s=t.getColDef();if(!t.isColumnFunc(e,s.groupRowEditable))return!1;const i=s.groupRowValueSetter;if(typeof i=="function")return!0;const r=s.aggFunc??null;if(typeof i=="object"){const o=zx(i,r);return typeof o=="function"||o!==!1&&Fd(r,o?.distribution)!==!1}return Fd(r,i??void 0)!==!1}setGroupDataValue(e,t,s,i,r,o){const n=t.getColDef();let a=n.groupRowValueSetter;if(a==null){const d=n.groupRowEditable;a=d&&t.isColumnFunc(e,d)?!0:void 0}if(!a)return;const l=this.gos.addCommon({node:e,data:e.data,oldValue:i,newValue:s,colDef:n,column:t,eventSource:r,valueChanged:o,aggregatedChildren:this.beans.aggChildrenSvc?.getAggregatedChildren(e,t)??[]});return(typeof a=="function"?a(l):Hx(l,a===!0?void 0:a))??!0}},_x={moduleName:"RowGroupingEdit",version:Y,beans:[Aj],dependsOn:[le,Yp]},Ij=class extends E{constructor(e){super(),this.beanName="agChartsExports",this.isEnterprise=!1,this.create=e.create,this._Theme=e._Theme,this._Scene=e._Scene,this.isEnterprise=e.isEnterprise,this._Util=e._Util}};function Wx(e){return e.chart!=null?e.chart:e}var kj=new Set(["__proto__","constructor","prototype"]);function rr(e,t,s){if(e==null)return s;const i=t.split(".");let r=e;for(;i.length>1;)if(r=r[i.shift()],r==null)return s;const o=r[i[0]];return o??s}function Lj(e,t,s){if(e==null)return;const i=t.split(".");let r=e;i.filter(o=>!kj.has(o)).forEach((o,n)=>{r[o]||(r[o]={}),n{const w=S=>S?Object.keys(S).some(y=>rr(S[y],"title.enabled",!1)):!1;return w(h)||w(g)})()):void 0,Qj(),i,f,h,g,{...o??{}},r].filter(w=>!!w).reduce((w,S)=>({baseTheme:w,overrides:S}),u);if(n&&c===a){const w=e.agChartsExports._Theme.getChartTheme(u).palette;qj(n,w)||(v.palette=n)}return v}function qj(e,t){const s=(i,r)=>i===r?!0:i?.length!==r?.length?!1:i?.every((o,n)=>o===r?.[n])??!1;return s(e.fills,t.fills)&&s(e.strokes,t.strokes)}function kf(e,t){return Object.keys(t.themes).includes(e)}function Yj(e,t,s){const r={tooltip:{delay:500},legend:{listeners:{legendItemClick:n=>{const a=e.getChart(),l=[n.seriesId,`${n.seriesId}-filtered-out`];for(const c of a.series.filter(d=>l.includes(d.id)))c.toggleSeriesItem(void 0,"category",n.itemId,void 0)}}},listeners:{click:n=>t.crossFilterCallback(n,!0)}};if(s==="pie"||s==="donut")return{[s]:{series:{fills:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"fills"},{$if:[{$eq:[{$value:"$parentIndex"},0]},{$mix:[{$value:"$1"},{$ref:"backgroundColor"},.7]},{$value:"$1"}]}]},strokes:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"strokes"},{$if:[{$eq:[{$value:"$parentIndex"},0]},{$mix:[{$value:"$1"},{$ref:"backgroundColor"},.7]},{$value:"$1"}]}]}},...r}};const o={};return s!=="line"&&(o.fill={$if:[{$isEven:[{$value:"$index"}]},{$palette:"fill"},{$mix:[{$path:["../$prevIndex/fill",{$palette:"fill"}]},{$ref:"backgroundColor"},.7]}]}),{[s]:{series:{stroke:{$if:[{$isEven:[{$value:"$index"}]},{$palette:"stroke"},{$mix:[{$path:["../$prevIndex/fill",{$palette:"stroke"}]},{$ref:"backgroundColor"},.7]}]},...o},...r}}}var Xj=qx.reduce((e,t)=>({...e,[t]:{title:{_enabledFromTheme:!0}}}),{});function Zj(e,t,s){const i=e.getExtraPaddingDirections();return{common:{...t?{animation:{duration:500}}:void 0,axes:Xj,padding:{top:!s&&i.includes("top")?40:20,right:i.includes("right")?30:20,bottom:i.includes("bottom")?40:20,left:i.includes("left")?30:20}}}}function Qj(){return{pie:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}},donut:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}}}}function Jj(e){let t=e.getChartThemeName();const s=e.getChartThemes();return s.includes(t)||(t=s[0]),t}function Yx(e,t){const{customChartThemes:s}=e,i=s?.[t];return i||F(140,{name:t}),i}function Lf(e,t){const s={highlightedItem:{strokeWidth:2}};return t||(s.unhighlightedSeries={opacity:1}),e||(s.unhighlightedItem={opacity:1}),s}var Yo=class{constructor(e){this.chartProxyParams=e,this.clearThemeOverrides=!1,this.agChartsExports=e.agChartsExports,this.chart=e.chartInstance,this.chartType=e.chartType,this.crossFiltering=e.crossFiltering,this.crossFilterCallback=e.crossFilterCallback,this.standaloneChartType=ye(this.chartType),this.chart==null?this.chart=e.agChartsExports.create(this.getCommonChartOptions()):this.clearThemeOverrides=!0}crossFilteringReset(){}update(e){this.getChartRef().update(this.getUpdateOptions(e,this.getCommonChartOptions(e.updatedOverrides)))}updateThemeOverrides(e){this.getChartRef().updateDelta({theme:{overrides:e}})}getChart(){return Wx(this.chart)}getChartRef(){return this.chart}downloadChart(e,t,s){const{chart:i}=this,r=Wx(i),o=t||r.title.node.getPlainText(),{width:n,height:a}=e||{};i.download({width:n,height:a,fileName:o,fileFormat:s})}getChartImageDataURL(e){return this.getChart().getCanvasDataURL(e)}getChartOptions(){return this.chart.getOptions()}getChartThemeOverrides(){return this.getChartOptions().theme.overrides??{}}getChartPalette(){return this.agChartsExports._Theme.getChartTheme(this.getChartOptions().theme).palette}setPaired(e){const t=ye(this.chartProxyParams.chartType);this.chart.updateDelta({theme:{overrides:{[t]:{paired:e}}}})}isPaired(){const e=ye(this.chartProxyParams.chartType);return rr(this.getChartThemeOverrides(),`${e}.paired`,!0)}lookupCustomChartTheme(e){return Yx(this.chartProxyParams,e)}getSeriesGroupType(){}transformCategoryData(e,t){return e.map((s,i)=>{const r=s[t],o=r?.toString?r.toString():"",n={...s};return n[t]={id:i,value:r,toString:()=>o},n})}getCommonChartOptions(e){const t=this.clearThemeOverrides?{}:this.chart?.getOptions()??{},s=this.chart!=null?this.getActiveFormattingPanelOverrides():void 0;this.clearThemeOverrides=!1;const i=this.chartProxyParams.styleNonce,r=jj(this.chartProxyParams,this,this.agChartsExports.isEnterprise,this.getChartThemeDefaults(),e??s);return{...t,mode:"integrated",...i?{styleNonce:i}:{},suppressFieldDotNotation:!0,theme:r,container:this.chartProxyParams.parentElement}}getChartThemeDefaults(){const e={enabled:!0,snap:!0,label:{enabled:!1}},t=this.agChartsExports.isEnterprise?{zoom:{enabled:!0},animation:{enabled:!0,duration:500},axes:{number:{crosshair:e},category:{crosshair:e},log:{crosshair:e},time:{crosshair:e}}}:{};t.minHeight=0,t.minWidth=0,t.navigator={enabled:!1,height:18},t.context=this.chartProxyParams.context;const s={common:t};return this.setSeriesChartThemeDefaults(s),s}setSeriesChartThemeDefaults(e){const t=this.getSeriesChartThemeDefaults();t&&(e[this.standaloneChartType]=t)}getSeriesChartThemeDefaults(){}getActiveFormattingPanelOverrides(){return this.clearThemeOverrides?{}:this.chart?.getOptions().theme?.overrides??{}}destroy({keepChartInstance:e=!1}={}){if(e)return this.chart.resetAnimations(),this.chart;this.destroyChart()}destroyChart(){this.chart&&(this.chart.destroy(),this.chart=void 0)}},nr=class extends Yo{constructor(){super(...arguments),this.crossFilteringAllPoints=new Set,this.crossFilteringSelectedPoints=[],this.isSingleSeries=!1}getUpdateOptions(e,t){const s=this.getAxes(e,t);return{...t,data:this.getData(e,s),axes:s,series:this.getSeries(e)}}getData(e,t){const s=["area","line"].includes(this.standaloneChartType);return this.crossFiltering&&s?this.getCrossFilterData(e):this.getDataTransformedData(e,t)}getDataTransformedData(e,t){const s=t.x.type,{categories:i,data:r}=e,[o]=i;switch(s){case"category":return this.transformCategoryData(r,o.id);case"time":return this.transformTimeData(r,o.id,o.convertTime);default:return r}}getXAxisType(e){return e.grouping?"grouped-category":this.isXAxisOfType(e,"time",t=>t instanceof Date)?"time":this.isXAxisOfType(e,"number")?"number":"category"}isXAxisOfType(e,t,s){const[i]=e.categories;if(i?.chartDataType)return i.chartDataType===t;if(!s)return!1;const r=e.data[0];return r?s(r[i.id]):!1}transformTimeData(e,t,s){return e[0]?.[t]instanceof Date?e:e.map(r=>{const o=r[t];return typeof o=="string"?{...r,[t]:s?s(o):_e(o)}:r})}crossFilteringReset(){this.crossFilteringSelectedPoints=[],this.crossFilteringAllPoints.clear()}crossFilteringPointSelected(e){return this.crossFilteringSelectedPoints.length==0||this.crossFilteringSelectedPoints.includes(e)}crossFilteringDeselectedPoints(){return this.crossFilteringSelectedPoints.length>0&&this.crossFilteringAllPoints.size!==this.crossFilteringSelectedPoints.length}extractLineAreaCrossFilterSeries(e,t){const[s]=t.categories,i=r=>this.standaloneChartType==="area"?t.getCrossFilteringContext().lastSelectedChartId===t.chartId?r+"-total":r:r+"-total";return e.map(r=>(r.yKey=i(r.yKey),r.listeners={seriesNodeClick:o=>{const n=o.datum[r.xKey],a=o.event.metaKey||o.event.ctrlKey;this.crossFilteringAddSelectedPoint(a,n),this.crossFilterCallback(o)}},r.marker={itemStyler:o=>{const n=o.datum[s.id],a=o.highlightState==="highlighted-item";return{fill:a?"yellow":o.fill,size:a?14:this.crossFilteringPointSelected(n)?8:0}}},this.standaloneChartType==="area"&&(r.fillOpacity=this.crossFilteringDeselectedPoints()?.3:1),this.standaloneChartType==="line"&&(r.strokeOpacity=this.crossFilteringDeselectedPoints()?.3:1),r))}getCrossFilterData(e){this.crossFilteringAllPoints.clear();const[t]=e.categories,s=e.fields[0].colId,i=`${s}-filtered-out`,r=e.getCrossFilteringContext().lastSelectedChartId;return e.data.map(o=>{const n=o[t.id];this.crossFilteringAllPoints.add(n);const a=this.crossFilteringPointSelected(n);return this.standaloneChartType==="area"&&r===e.chartId&&(o[`${s}-total`]=a?o[s]:o[s]+o[i]),this.standaloneChartType==="line"&&(o[`${s}-total`]=a?o[s]:o[s]+o[i]),o})}crossFilteringAddSelectedPoint(e,t){e?this.crossFilteringSelectedPoints.push(t):this.crossFilteringSelectedPoints=[t]}isHorizontal(e){const t=this.standaloneChartType;if(t!=="waterfall"&&t!=="box-plot"&&t!=="range-bar")return!1;const s=e.theme,i=r=>{const o=r?.overrides?.[t]?.series?.direction;return o!=null?o==="horizontal":typeof r?.baseTheme=="object"?i(r.baseTheme):!1};return i(s)}getSeriesChartThemeDefaults(){return{series:{highlight:Lf(this.crossFiltering,this.isSingleSeries)}}}},eq=class extends nr{getSeries(e){const t=e.fields[0];return[{type:this.standaloneChartType,xKey:t.colId,xName:t.displayName,yName:this.chartProxyParams.translate("histogramFrequency"),areaPlot:!1}]}getAxes(e){return{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}}}},tq=class extends nr{constructor(){super(...arguments),this.isSingleSeries=!0}getAxes(e,t){const s=this.isHorizontal(t),i=s?"y":"x",r=s?"x":"y";return{[i]:{type:this.getXAxisType(e),position:s?"left":"bottom"},[r]:{type:"number",position:s?"bottom":"left"}}}getSeries(e){const[t]=e.categories,[s]=e.fields;return[{type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:s.colId,yName:s.displayName??void 0}]}},sq=class extends Yo{getUpdateOptions(e,t){return{...t,data:this.transformFunnelCategories(e),series:this.getSeries(e)}}transformFunnelCategories(e){const{data:t}=e,[{id:s}]=e.categories;return t.map((i,r)=>({...i,[s]:{name:i[s],id:r,toString:()=>String(i[s])}}))}getSeriesChartThemeDefaults(){const e={crosshair:{enabled:!1}};return{zoom:{enabled:!1},...this.chartType!=="pyramid"&&{axes:{category:e,number:e}}}}getSeries(e){const[{id:t}]=e.categories,[{colId:s}]=e.fields;return[{type:this.standaloneChartType,stageKey:t,valueKey:s}]}},Pd="AG-GRID-DEFAULT-LABEL-KEY";function iq(e,t){const s=Xx(e,i,r);return Gf(s);function i(n){return t.length}function r(n,a){const l=t[a],c=n[l];return o(c)}function o(n){return n==null?null:String(n)}}function rq(e,t){const s=Xx(e,i,r);return Gf(s);function i(o){return t(o)?.length??0}function r(o,n){const a=t(o);return a&&a[n]}}function Gf(e,t=null,s){const{depth:i,rootValues:r,value:o,children:n}=e;if(r)return r.map(l=>({[Pd]:t,...l}));if(i===0)return[{[Pd]:t,...o}];const a=[];for(const[l,c]of n.entries())a.push(...Gf(c,l,!0));return s?[{[Pd]:t,children:a,...o??{}}]:a}function Xx(e,t,s){const i={depth:0,children:new Map};for(const o of e){const n=t(o);r(o,n,s,0,i)}return i;function r(o,n,a,l,c){if(l===n)return l===0?(c.rootValues||(c.rootValues=[]),c.rootValues.push(o)):c.value=o,c;{const d=a(o,l),u=c.children.get(d),h=r(o,n,a,l+1,u||{depth:0,children:new Map});return c.children.set(d,h),c.depth=Math.max(1+h.depth,c.depth),c}}}var oq=class extends Yo{getUpdateOptions(e,t){const{fields:s}=e,[i,r]=s;return{...t,series:this.getSeries(i,r),data:this.getData(e,i,r)}}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200},position:"right"}}}getSeries(e,t){return[{type:this.standaloneChartType,labelKey:Pd,sizeKey:e?.colId,sizeName:e?.displayName??void 0,colorKey:t?.colId,colorName:t?.displayName??void 0}]}getData(e,t,s){const{categories:i,data:r,groupData:o,grouping:n}=e;if(n){const a=s?r.concat(o?.map(l=>{const c={...l};return delete c[t.colId],c})??[]):r;return rq(a,l=>l[$t]?.value??null)}else{const a=i.map(({id:l})=>l);return iq(r,a)}}},nq=class extends Yo{getAxes(e){const t=this.standaloneChartType==="radial-bar";return{angle:{type:t?"angle-number":"angle-category"},radius:{type:t?"radius-category":"radius-number"}}}getSeries(e){const{fields:t,categories:s,seriesGroupType:i}=e,[r]=s,o=this.standaloneChartType==="radial-bar",n=this.getSeriesGroupTypeOptions(i);return t.map(a=>({type:this.standaloneChartType,angleKey:o?a.colId:r.id,angleName:o?a.displayName??void 0:r.name,radiusKey:o?r.id:a.colId,radiusName:o?r.name:a.displayName??void 0,...n}))}getSeriesGroupType(){const e=this.standaloneChartType;if(!["nightingale","radial-bar","radial-column"].includes(e))return;const t=this.getChart().series?.[0]?.properties.toJson(),s=()=>t.normalizedTo?"normalized":"stacked";return e==="nightingale"?t.grouped?"grouped":s():t.stacked?s():"grouped"}getUpdateOptions(e,t){const s=this.getAxes(e);return{...t,data:this.getData(e,s),axes:s,series:this.getSeries(e)}}getData(e,t){if(t.angle.type==="angle-category"||t.radius.type==="radius-category"){const[i]=e.categories;return this.transformCategoryData(e.data,i.id)}else return e.data}getSeriesGroupTypeOptions(e){return e?{grouped:e==="grouped"||void 0,stacked:e!=="grouped"||void 0,normalizedTo:e==="normalized"?100:void 0}:{}}getSeriesChartThemeDefaults(){return{series:{highlight:Lf(this.crossFiltering)}}}},aq="AG-GRID-DEFAULT-HEATMAP-CATEGORY-KEY",lq="AG-GRID-DEFAULT-HEATMAP-SERIES-KEY",cq="AG-GRID-DEFAULT-HEATMAP-VALUE-KEY";function dq(e,t){return e.reduce((s,i,r,o)=>s.concat(t(i,r,o)),new Array)}var uq=class extends Yo{getUpdateOptions(e,t){const s=lq,i=cq,r=aq;return{...t,series:this.getSeries(e,s,i,r),data:this.getData(e,s,i,r)}}getSeries(e,t,s,i){const[r]=e.categories;return[{type:this.standaloneChartType,yKey:i,xKey:t,colorKey:s,yName:r.name,xName:void 0,colorName:void 0}]}getData(e,t,s,i){const[r]=e.categories;return dq(e.data,(o,n)=>{const a=o[r.id],l=a==null?"":String(a),c={id:n,value:a,toString:()=>l};return e.fields.map(({colId:d,displayName:u})=>({...o,[t]:u,[s]:o[d],[i]:c}))})}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200},position:"right"},series:{tooltip:{renderer:hq}}}}};function hq(e){const{xKey:t,yKey:s,colorKey:i,yName:r,datum:o}=e;return{title:"",data:[{label:r,value:o[s]},{label:o[t],value:i&&o[i]}].map(({label:a,value:l})=>({label:String(a),value:String(l)}))}}var gq=class extends E{wireBeans(e){this.sortSvc=e.sortSvc,this.gridRowModel=e.rowModel,this.colModel=e.colModel,this.valueSvc=e.valueSvc,this.pivotResultCols=e.pivotResultCols,this.rowNodeSorter=e.rowNodeSorter}getData(e){if(e.crossFiltering){if(e.grouping)return F(141),{chartData:[],colNames:{}};if(!ae(this.gos))return F(142),{chartData:[],colNames:{}}}ft(this.gos)&&e.pivoting&&this.updatePivotKeysForSSRM();const s=this.extractRowsFromGridRowModel(e);return s.chartData=this.aggregateRowsByDimension(e,s.chartData),s}extractRowsFromGridRowModel(e){const{crossFiltering:t,startRow:s,endRow:i,valueCols:r,dimensionCols:o,grouping:n,crossFilteringSort:a,combineGroupValues:l}=e;let c=[];const d={},u={},h={};let g={},p=[],f;if(t)g=this.getFilteredRowNodes(),p=this.getAllRowNodes(a),f=p.length;else{const S=this.gridRowModel.getRowCount()-1;s===i&&s===0&&o.length===0&&r.length===0?f=0:f=(i>=0?Math.min(i,S):S)-s+1}if(f>0)for(const S of r){let y=[];const R=S.getColDef().pivotKeys;R&&(y=R.slice());const P=S.getColDef().headerName;P&&y.push(P),y.length>0&&(d[S.getId()]=y)}let m=0,C=0;const v={};for(let S=0;Sj.filter(Boolean).join(" - ")};if(l){const X=U.toString(),se=v[X];se?U=se:v[X]=U}R[M]=U,y.group&&(u[L.toString()]=S-m);const O=L.slice(1,L.length).toString();O&&(h[O]=u[O])}else R[M]=I}else R[Qs]=S+1}for(const P of r){const M=P.getColId();if(t){const T=M+"-filtered-out",I=this.valueSvc.getValue(P,y,"data");let k=I;I!=null&&(typeof I.toNumber=="function"?k=I.toNumber():typeof I.value=="number"&&(k=I.value)),g[y.id]?(R[M]=k,R[T]=e.aggFunc||e.isScatter?void 0:0):(R[M]=e.aggFunc||e.isScatter?void 0:0,R[T]=k)}else{let T=this.valueSvc.getValue(P,y,"data");T&&typeof T.value=="number"&&(T=T.value),T&&Object.prototype.hasOwnProperty.call(T,"toString")&&(T=parseFloat(T.toString())),R[M]=T!=null&&typeof T.toNumber=="function"?T.toNumber():T}}c.push(R)}let w;if(n){const S=Object.values(h),y=c;c=[],w=[];for(let R=0;Rtypeof w[g]<"u").map(w=>w[g]),f=l({values:p,column:h,colDef:h.colDef,pivotResultColumn:void 0,rowNode:void 0,data:void 0,aggregatedChildren:[],api:c,context:d});u[g]=f&&typeof f.value<"u"?f.value:f;const m=`${g}-filtered-out`,C=u.__children.filter(w=>typeof w[m]<"u").map(w=>w[m]),v=l({values:C,column:h,colDef:h.colDef,pivotResultColumn:void 0,rowNode:void 0,data:void 0,aggregatedChildren:[],api:c,context:d});u[m]=v&&typeof v.value<"u"?v.value:v}else{const p=u.__children.map(m=>m[g]),f=l({values:p,column:h,colDef:h.colDef,pivotResultColumn:void 0,rowNode:void 0,data:void 0,aggregatedChildren:[],api:c,context:d});u[g]=f&&typeof f.value<"u"?f.value:f}}}return n}updatePivotKeysForSSRM(){const e=this.pivotResultCols?.getPivotResultCols()?.list;if(!e)return;const t=this.extractPivotKeySeparator(e);for(const s of e)if(t==="")s.getColDef().pivotKeys=[];else{const i=s.getColId().split(t);s.getColDef().pivotKeys=i.slice(0,i.length-1)}}extractPivotKeySeparator(e){if(e.length===0)return"";const t=(i,r)=>{const o=i.getGroupId();return i.getParent()?t(i.getParent(),o):r.split(o)[1][0]},s=e[0];return s.getParent()==null?"":t(s.getParent(),s.getColId())}getGroupLabels(e,t){const s=[t];for(;e&&e.level!==0;)if(e=e.parent,e)if(e.group){const i=this.colModel.getCol($t);if(i){const r=this.valueSvc.getValue(i,e,"data"),o=r?.toString?String(r.toString()):" ";s.push(o)}}else s.push(e.key);return s}getFilteredRowNodes(){const e={};return this.gridRowModel.forEachNodeAfterFilterAndSort(t=>{e[t.id]=t}),e}getAllRowNodes(e){const t=[];this.gridRowModel.forEachNode(r=>{t.push(r)});const s=this.rowNodeSorter;if(!s)return t;const i=e===!0?this.sortSvc?.getSortOptions():e;return!i||i.length==0?t:s.doFullSortInPlace(t,i)}},pq=class extends E{constructor(){super(...arguments),this.valueColsWithoutSeriesType=new Set}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.valueSvc=e.valueSvc}postConstruct(){const e=()=>this.valueColsWithoutSeriesType.clear();this.addManagedEventListeners({newColumnsLoaded:e,rowDataUpdated:e})}getColumn(e){return this.colModel.getColDefCol(e)}getAllDisplayedColumns(){return this.beans.visibleCols.allCols}getColDisplayName(e){return this.colNames.getDisplayNameForColumn(e,"chart")}getColGroupDisplayName(e){return this.colNames.getDisplayNameForColumnGroup(e,"chart")}getRowGroupColumns(){return this.beans.rowGroupColsSvc?.columns??[]}getGroupDisplayColumns(){return this.beans.showRowGroupCols?.columns??[]}isPivotMode(){return this.colModel.isPivotMode()}isPivotActive(){return this.colModel.isPivotActive()}getChartColumns(){const e=this.colModel.getCols(),t=new Set,s=new Set;for(const i of e){const r=i.getColDef(),o=r.chartDataType;if(o)switch(o){case"category":case"time":t.add(i);continue;case"series":s.add(i);continue;case"excluded":continue;default:F(153,{chartDataType:o});break}if(r.colId==="ag-Grid-AutoColumn"){t.add(i);continue}if(!i.isPrimary()){s.add(i);continue}(this.isInferredValueCol(i)?s:t).add(i)}return{dimensionCols:t,valueCols:s}}isInferredValueCol(e){const t=e.getColId();if(t==="ag-Grid-AutoColumn")return!1;const s=Ve(this.beans,{rowIndex:0,rowPinned:null});if(!s)return this.valueColsWithoutSeriesType.has(t);let i=this.valueSvc.getValue(e,s,"data");i==null&&(i=this.extractLeafData(s,e)),i!=null&&(typeof i.toNumber=="function"?i=i.toNumber():typeof i.value=="number"&&(i=i.value));const r=typeof i=="number"||e.colDef.cellDataType==="number"||["series","time"].includes(e.colDef.chartDataType);return r?this.valueColsWithoutSeriesType.add(t):i==null&&e.colDef.cellDataType!=="number"&&F(265,{colId:t}),r}extractLeafData(e,t){const s=e.data&&this.valueSvc.getValue(t,e,"data");if(s!=null)return s;const i=e.childrenAfterGroup;if(i)for(let r=0,o=i.length;r0;(this.chartDataModel.chartType==="customCombo"||e)&&(this.chartDataModel.chartType="customCombo",this.savedCustomSeriesChartTypes=this.seriesChartTypes||[])}updateSeriesChartTypes(){if(this.chartDataModel.isComboChart()){if(this.seriesChartTypes=this.seriesChartTypes.map(e=>{const t=["groupedColumn","stackedColumn","stackedArea"].includes(e.chartType);return e.secondaryAxis=t?!1:e.secondaryAxis,e}),this.chartDataModel.chartType==="customCombo"){this.updateSeriesChartTypesForCustomCombo();return}this.updateChartSeriesTypesForBuiltInCombos()}}updateSeriesChartTypesForCustomCombo(){!(this.seriesChartTypes&&this.seriesChartTypes.length>0)&&!this.suppressComboChartWarnings&&F(150),this.seriesChartTypes=this.seriesChartTypes.map(i=>(fq.has(i.chartType)||(F(151,{chartType:i.chartType}),i.chartType="line"),i));const t=i=>{(!this.savedCustomSeriesChartTypes||this.savedCustomSeriesChartTypes.length===0)&&(this.savedCustomSeriesChartTypes=this.seriesChartTypes);const r=this.savedCustomSeriesChartTypes.find(o=>o.colId===i.colId);return r||(i.selected&&!this.suppressComboChartWarnings&&F(152,{colId:i.colId}),{colId:i.colId,chartType:"line",secondaryAxis:!1})},s=this.chartDataModel.valueColState.map(t);this.seriesChartTypes=s,this.savedCustomSeriesChartTypes=s,this.suppressComboChartWarnings=!0}updateChartSeriesTypesForBuiltInCombos(){const{chartType:e,valueColState:t}=this.chartDataModel,s=e==="columnLineCombo"?"groupedColumn":"stackedArea",i=e==="columnLineCombo"?"line":"groupedColumn",r=t.filter(n=>n.selected),o=Math.ceil(r.length/2);this.seriesChartTypes=r.map((n,a)=>{const l=a>=o?i:s;return{colId:n.colId,chartType:l,secondaryAxis:!1}})}},Qs="AG-GRID-DEFAULT-CATEGORY",Cq=class extends E{constructor(e){super(),this.unlinked=!1,this.chartData=[],this.valueColState=[],this.dimensionColState=[],this.colNames={},this.crossFiltering=!1,this.crossFilteringSort=!0,this.grouping=!1,this.useGroupColumnAsCategory=!1,this.params=e,this.chartId=e.chartId,this.setParams(e)}wireBeans(e){this.rangeSvc=e.rangeSvc,this.chartTranslation=e.chartTranslation}setParams(e){const{chartType:t,pivotChart:s,chartThemeName:i,switchCategorySeries:r,aggFunc:o,cellRange:n,suppressChartRanges:a,unlinkChart:l,crossFiltering:c,crossFilteringSort:d,seriesGroupType:u,useGroupColumnAsCategory:h}=e;this.chartType=t,this.pivotChart=s??!1,this.chartThemeName=i,this.switchCategorySeries=!!r,this.aggFunc=o,this.referenceCellRange=n,this.suppliedCellRange=n,this.suppressChartRanges=a??!1,this.unlinked=!!l,this.crossFiltering=!!c,this.crossFilteringSort=d??!0,this.seriesGroupType=u,this.useGroupColumnAsCategory=!!h}postConstruct(){this.datasource=this.createManagedBean(new gq),this.chartColSvc=this.createManagedBean(new pq),this.comboChartModel=this.createManagedBean(new mq(this)),this.updateCellRanges({setColsFromRange:!0}),this.updateData()}updateModel(e){const{cellRange:t,seriesChartTypes:s}=e;t!==this.suppliedCellRange&&(this.dimensionCellRange=void 0,this.valueCellRange=void 0),this.setParams(e),this.updateSelectedDimensions(t?.columns),this.updateCellRanges({setColsFromRange:!0}),(this.isComboChart()||s)&&this.comboChartModel.update(s),this.unlinked||this.updateData()}updateCellRanges(e){const{updatedColState:t,resetOrder:s,maintainColState:i,setColsFromRange:r}=e??{};this.valueCellRange&&(this.referenceCellRange=this.valueCellRange);const{dimensionCols:o,valueCols:n}=this.chartColSvc.getChartColumns(),a=this.getAllColumnsFromRanges();t&&this.updateColumnState(t,s),this.setDimensionCellRange(o,a,t),this.setValueCellRange(n,a,r),!t&&!i&&(this.resetColumnState(),this.syncDimensionCellRange()),this.comboChartModel.updateSeriesChartTypes()}updateData(){const{startRow:e,endRow:t}=this.getRowIndexes();this.pivotChart&&this.resetColumnState(),this.grouping=this.isGrouping();const s={aggFunc:this.aggFunc,dimensionCols:this.getSelectedDimensions(),grouping:this.grouping,pivoting:this.isPivotActive(),crossFiltering:this.crossFiltering,crossFilteringSort:this.getCrossFilteringSort(),valueCols:this.getSelectedValueCols(),startRow:e,endRow:t,isScatter:["scatter","bubble"].includes(this.chartType),combineGroupValues:Wj(ye(this.chartType))},{chartData:i,colNames:r,groupChartData:o}=this.datasource.getData(s);this.chartData=i,this.groupChartData=o,this.colNames=r,this.categoryAxisType=void 0}isGrouping(){const e=this.gos.get("treeData"),t=e?null:this.chartColSvc.getRowGroupColumns(),s=e||t&&t.length>0,i=this.getSelectedDimensions().map(({colId:n})=>n),o=this.chartColSvc.getGroupDisplayColumns().map(n=>n.getColId()).some(n=>i.includes(n));return!!s&&o}getSelectedValueCols(){return this.valueColState.filter(e=>e.selected).map(e=>e.column)}getSelectedDimensions(){return this.dimensionColState.filter(e=>e.selected)}getValueColState(){return this.valueColState.map(this.displayNameMapper.bind(this))}displayNameMapper(e){const{column:t}=e;if(t){const s=this.getColDisplayName(t);e.displayName=this.isPivotMode()?this.getPivotDisplayName(t,s):s}else{const s=this.colNames[e.colId];e.displayName=s?s.join(" - "):this.getColDisplayName(t)}return e}getPivotDisplayName(e,t){let s=!1,i=[t];const r=o=>{if(!o)return;const n=this.chartColSvc.getColGroupDisplayName(o);n?.length?(i.unshift(n),r(o.getParent())):s=!0};if(r(e.getParent()),s){const o=this.colNames[e.getColId()];o&&(i=o)}return i.join(" - ")}getColDisplayName(e){return this.chartColSvc.getColDisplayName(e)}isPivotMode(){return this.chartColSvc.isPivotMode()}getChartDataType(e){const t=this.chartColSvc.getColumn(e);return t?t.getColDef().chartDataType:void 0}getConvertTime(e){const t=this.chartColSvc.getColumn(e);if(t?.colDef.cellDataType==="dateString")return this.beans.dataTypeSvc?.getDateParserFunction(t)}isPivotActive(){return this.chartColSvc.isPivotActive()}createCellRange(e,...t){return{id:this.chartId,startRow:this.referenceCellRange.startRow,endRow:this.referenceCellRange.endRow,columns:t,startColumn:e===qt.DIMENSION||this.referenceCellRange.startColumn==null?t[0]:this.referenceCellRange.startColumn,type:e}}getAllColumnsFromRanges(){if(this.pivotChart)return new Set(this.chartColSvc.getAllDisplayedColumns());const e=this.dimensionCellRange||this.valueCellRange?[]:this.referenceCellRange.columns;return this.dimensionCellRange&&e.push(...this.dimensionCellRange.columns),this.valueCellRange&&e.push(...this.valueCellRange.columns),new Set(e)}getRowIndexes(){let e=0,t=0;const{rangeSvc:s,valueCellRange:i,dimensionCellRange:r}=this,o=i||r;if(s&&o){e=s.getRangeStartRow(o).rowIndex;const n=s.getRangeEndRow(o);t=n.rowPinned==="bottom"?-1:n.rowIndex}return{startRow:e,endRow:t}}resetColumnState(){const{dimensionCols:e,valueCols:t}=this.chartColSvc.getChartColumns(),s=this.getAllColumnsFromRanges(),i=this.valueColState.length<1;this.dimensionColState=[],this.valueColState=[];const r=jr(ye(this.chartType));let o=!1,n=1;const a=this.suppliedCellRange.columns[0],l=this.gos.get("treeData"),c=l?null:this.chartColSvc.getRowGroupColumns(),d=l||c&&c.length>0;e.forEach(g=>{const p=Sr(g),f=this.crossFiltering&&this.aggFunc?a.getColId()===g.getColId():this.useGroupColumnAsCategory&&d&&p||(!o||r)&&s.has(g);this.dimensionColState.push({column:g,colId:g.getColId(),displayName:this.getColDisplayName(g),selected:f,order:n++}),f&&(o=!0)});const u={colId:Qs,displayName:this.chartTranslation.translate("defaultCategory"),selected:!o,order:0};this.dimensionColState.unshift(u);const h=this.referenceCellRange.columns.filter(g=>t.has(g));t.forEach(g=>{i&&this.referenceCellRange.columns.includes(g)&&(g=h.shift()),this.valueColState.push({column:g,colId:g.getColId(),displayName:this.getColDisplayName(g),selected:s.has(g),order:n++})})}updateColumnState(e,t){const s=c=>c.colId===e.colId,{dimensionColState:i,valueColState:r}=this,o=i.find(s),n=r.find(s);if(o)if(jr(ye(this.chartType)))o.selected=e.selected;else{const d=e.selected?o:i.filter(u=>u!==o).find(({selected:u})=>u);i.forEach(u=>u.selected=u===d)}else n&&(n.selected=e.selected);const a=[...i,...r],l=[];t||(a.forEach((c,d)=>{d===e.order&&l.push(e.colId),c.colId!==e.colId&&l.push(c.colId)}),a.forEach(c=>{const d=l.indexOf(c.colId);c.order=d>=0?l.indexOf(c.colId):a.length-1})),this.reorderColState()}reorderColState(){const e=(t,s)=>t.order-s.order;this.dimensionColState.sort(e),this.valueColState.sort(e)}setDimensionCellRange(e,t,s){this.dimensionCellRange=void 0;const i=jr(ye(this.chartType));if(!s&&!this.dimensionColState.length){const a=new Array;e.forEach(l=>{a.length>0&&!i||!t.has(l)||a.push(l)}),a.length>0&&(this.dimensionCellRange=this.createCellRange(qt.DIMENSION,...a));return}let r=s?[s]:[];if(this.crossFiltering&&this.aggFunc){const a=this.suppliedCellRange.columns[0];r=this.dimensionColState.filter(l=>l.colId===a.getColId())}else(i||r.length===0||r.some(({column:a})=>!a||!e.has(a)))&&(r=this.dimensionColState.filter(a=>a.selected));const o=r.length===1?r[0].colId===Qs:!1,n=r.map(({column:a})=>a).filter(a=>a!=null);n.length>0&&!o&&(this.dimensionCellRange=this.createCellRange(qt.DIMENSION,...n))}setValueCellRange(e,t,s){this.valueCellRange=void 0;const i=[],r=Ed(this.chartType);let o=0;if(e.forEach(n=>{s?(r==null||oa.selected&&a.colId===n.getColId())&&i.push(n)}),i.length>0){let n=[];this.valueColState.length>0?n=this.valueColState.map(a=>a.colId):t.forEach(a=>n.push(a.getColId())),i.sort((a,l)=>n.indexOf(a.getColId())-n.indexOf(l.getColId())),this.valueCellRange=this.createCellRange(qt.VALUE,...i)}}resetCellRanges(e,t){if(!e&&!t)return;const{dimensionCols:s,valueCols:i}=this.chartColSvc.getChartColumns(),r=this.getAllColumnsFromRanges();e&&this.setDimensionCellRange(s,r),t&&this.setValueCellRange(i,r)}updateSelectedDimensions(e){const t=new Set(e.map(i=>i.getColId()));if(jr(ye(this.chartType))){const i=this.dimensionColState.filter(o=>t.has(o.colId)),r=new Set(i.map(o=>o.colId));this.dimensionColState=this.dimensionColState.map(o=>({...o,selected:r.has(o.colId)}))}else{const r=(this.dimensionColState.find(o=>t.has(o.colId))||this.dimensionColState[0]).colId;this.dimensionColState=this.dimensionColState.map(o=>({...o,selected:o.colId===r}))}}syncDimensionCellRange(){const e=this.getSelectedDimensions();if(e.length===0)return;const t=e.map(({column:s})=>s).filter(s=>s!=null);t.length>0&&(this.dimensionCellRange=this.createCellRange(qt.DIMENSION,...t))}isComboChart(e){return Mf(e??this.chartType)}getCrossFilteringSort(){const e=this.crossFilteringSort;if(typeof e=="boolean")return e;const t=[];return e.forEach(({sort:s,colId:i})=>{const r=this.chartColSvc.getColumn(i);r&&t.push({sort:s,column:r,type:rs(r.getSortDef()?.type)})}),t}},Zx=class extends nr{getAxes(e,t){return{x:{type:this.getXAxisType(e),position:this.isHorizontal(t)?"left":"bottom"},y:{type:"number",position:this.isHorizontal(t)?"bottom":"left"}}}computeSeriesStatistics(e,t){const{data:s,fields:i}=e,[r]=e.categories,o=r.id||Qs,n=this.groupDataByCategory(o,s);return Array.from(n).map(([a,l])=>{const c={[r.id]:a};return i.forEach((d,u)=>{const h=l.map(p=>p[d.colId]).filter(p=>typeof p=="number"&&!isNaN(p)),g=t(h);for(const p of Object.keys(g)){const f=`${p}:${u}`;c[f]=h.length>0?g[p]:null}}),c})}groupDataByCategory(e,t){const s=i=>{if(e===Qs)return 1;const r=i[e];return r==null?"":r instanceof Date?r.getTime():r};return t.reduce((i,r)=>{const o=s(r),n=i.get(o);return n?n.push(r):i.set(o,[r]),i},new Map)}},vq=class extends Zx{getSeries(e){const[t]=e.categories;return e.fields.map((s,i)=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:s.displayName??void 0,minName:"Min",q1Name:"Q1",medianName:"Median",q3Name:"Q3",maxName:"Max",minKey:`min:${i}`,q1Key:`q1:${i}`,medianKey:`median:${i}`,q3Key:`q3:${i}`,maxKey:`max:${i}`}))}getData(e){return this.computeSeriesStatistics(e,t=>{const s=t.sort((i,r)=>i-r);return{min:s[0],q1:this.quantile(s,.25),median:this.quantile(s,.5),q3:this.quantile(s,.75),max:s[s.length-1]}})}quantile(e,t){const s=(e.length-1)*t,i=Math.floor(s),r=s-i;return e[i+1]!==void 0?e[i]+r*(e[i+1]-e[i]):e[i]}},wq=class extends Zx{getSeries(e){const[t]=e.categories;return e.fields.map((s,i)=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:s.displayName??void 0,yLowName:"Min",yHighName:"Max",yLowKey:`min:${i}`,yHighKey:`max:${i}`}))}getData(e){return this.computeSeriesStatistics(e,t=>({min:Math.min(...t),max:Math.max(...t)}))}},bq=class extends E{constructor(){super(...arguments),this.beanName="enterpriseChartProxyFactory"}createChartProxy(e){switch(e.chartType){case"histogram":return new eq(e);case"radarLine":case"radarArea":case"nightingale":case"radialColumn":case"radialBar":return new nq(e);case"rangeBar":case"rangeArea":return new wq(e);case"boxPlot":return new vq(e);case"treemap":case"sunburst":return new oq(e);case"heatmap":return new uq(e);case"waterfall":return new tq(e);case"funnel":case"coneFunnel":case"pyramid":return new sq(e)}}},Qx=class extends E{constructor(e,t,s,i){super(),this.chartController=e,this.eGui=t,this.cssClass=s,this.createPanels=i,this.panels=[]}postConstruct(){this.addManagedListeners(this.chartController,{chartUpdated:()=>this.refreshPanels(!0),chartApiUpdate:()=>this.refreshPanels(!1)})}addComponent(e){this.createBean(e),this.panels.push(e),e.addCss(this.cssClass),this.eGui.appendChild(e.getGui())}refreshPanels(e){const t=this.chartController.getChartType(),s=this.chartController.isGrouping(),i=ye(t);e&&t===this.chartType&&s===this.isGrouping||(this.destroyPanels(),this.createPanels(t,i),this.chartType=t,this.isGrouping=s)}destroyPanels(){for(const e of this.panels)ue(e.getGui()),this.destroyBean(e);this.panels=[]}destroy(){this.destroyPanels(),super.destroy()}},Sq=class extends A{constructor(e){super(),this.chartMenuParamsFactory=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuParamsFactory.addEnableParams("animation.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("animation"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultNumberInputParams("animation.duration","durationMillis",{min:0});this.setTemplate(`
`,[Se,la],{animationGroup:e,animationHeightInput:t})}},Jx=class extends hp{constructor(e){super({...e,dialogCallbacks:Dy})}},Js={selector:"AG-COLOR-PICKER",component:Jx},yq=class extends A{constructor(e){super(),this.chartMenuParamsFactory=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuParamsFactory.addEnableParams("crosshair.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("crosshair"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.label.enabled","crosshairLabel"),s=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.snap","crosshairSnap"),i=this.chartMenuParamsFactory.getDefaultColorPickerParams("crosshair.stroke","color");this.setTemplate(`
`,[Se,ds,Js],{crosshairGroup:e,crosshairLabelCheckbox:t,crosshairSnapCheckbox:s,crosshairStrokeColorPicker:i})}},xq=class extends A{constructor(e){super(),this.chartMenuParamsFactory=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuParamsFactory.addEnableParams("navigator.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("navigator"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultSliderParams("navigator.height","height",60);t.minValue=10;const s=this.chartMenuParamsFactory.getDefaultCheckboxParams("navigator.miniChart.enabled","miniChart");this.setTemplate(`
`,[Se,Tt,ds],{navigatorGroup:e,navigatorHeightSlider:t,navigatorMiniChartCheckbox:s})}},Rq=class extends A{constructor(e){super(),this.chartMenuParamsFactory=e,this.zoomScrollingStepInput=x}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuParamsFactory.addEnableParams("zoom.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("zoom"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableScrolling","scrollingZoom"),s=this.chartMenuParamsFactory.getDefaultSliderParams("zoom.scrollingStep","scrollingStep",1);s.step=.01,s.minValue=s.step;const i=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableSelecting","selectingZoom");t.onValueChange=(r=>o=>{r&&(r(o),this.zoomScrollingStepInput.setDisabled(!o))})(t.onValueChange),this.setTemplate(`
`,[Se,ds,Tt],{zoomGroup:e,zoomScrollingCheckbox:t,zoomScrollingStepInput:s,zoomSelectingCheckbox:i}),this.zoomScrollingStepInput.setDisabled(!t.value)}},Fq=["navigator","zoom","animation","crosshair"],Eq=class extends A{constructor(e){super('
'),this.chartMenuContext=e}postConstruct(){this.chartPanelFeature=this.createManagedBean(new Qx(this.chartMenuContext.chartController,this.getGui(),"ag-chart-advanced-settings-section",(e,t)=>this.createPanels(e,t))),this.chartPanelFeature.refreshPanels()}createPanels(e,t){for(const s of Fq){if(!this.isGroupPanelShownForSeries(s,t))continue;const i=this.createPanel(s);this.chartPanelFeature.addComponent(i)}}isGroupPanelShownForSeries(e,t){return e==="animation"||or(t)&&!Tf(t)}createPanel(e){const{chartMenuParamsFactory:t,chartAxisMenuParamsFactory:s}=this.chartMenuContext;switch(e){case"navigator":return new xq(t);case"zoom":return new Rq(t);case"animation":return new Sq(t);case"crosshair":return new yq(s)}}},Pq=class extends E{constructor(){super(...arguments),this.beanName="advSettingsMenuFactory"}showMenu(e,t){this.hideMenu();const s=this.createBean(new Mq(e));this.activeDialog=this.createBean(new Xc({title:this.beans.chartTranslation.translate("advancedSettings"),component:s,width:300,height:400,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{Kt(s.getGui())[0]?.focus()},closedCallback:()=>{this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=void 0,t?.focus({preventScroll:!0})}})),this.activeMenu=s}hideMenu(){this.activeDialog&&this.destroyBean(this.activeDialog)}destroy(){this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=this.destroyBean(this.activeDialog),super.destroy()}},Mq=class extends Pr{constructor(e){super('
'),this.chartMenuContext=e}postConstruct(){this.advancedSettingsPanel=this.createManagedBean(new Eq(this.chartMenuContext)),this.getGui().appendChild(this.advancedSettingsPanel.getGui()),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),focusTrapActive:!0})}onTabKeyDown(e){if(e.defaultPrevented)return;e.preventDefault();const t=e.shiftKey,s=this.advancedSettingsPanel.getGui(),i=Qe(this.beans,s,!1,t);if(i)i.focus();else{const r=Kt(s);r.length&&r[t?r.length-1:0].focus()}}},Tq=class extends E{constructor(){super(...arguments),this.beanName="chartMenuListFactory"}wireBeans(e){this.popupSvc=e.popupSvc,this.chartMenuSvc=e.chartMenuSvc,this.chartTranslation=e.chartTranslation}showMenuList(e){const{eventSource:t,showMenu:s,chartMenuContext:i,closeOnElementClick:r}=e,o=this.chartMenuSvc.doChartToolPanelsExist(i.chartController),n=this.mapWithStockItems(this.getMenuItems(i.chartController,o),i,s,t,o);if(!n.length)return;const a=this.createBean(new Dq(n));this.activeChartMenuList=a;let l=-1,c="left";this.gos.get("enableRtl")&&(l=1,c="right");const d=a.getGui();this.popupSvc.addPopup({modal:!0,eChild:d,closeOnEsc:!0,alwaysOnTop:!0,closedCallback:()=>{this.destroyBean(a),this.activeChartMenuList=void 0,ms(this.beans)&&t.focus({preventScroll:!0})},afterGuiAttached:u=>{a.afterGuiAttached(u,r)},positionCallback:()=>{this.popupSvc.positionPopupByComponent({type:"chartMenu",eventSource:t,ePopup:d,alignSide:c,nudgeX:4*l,nudgeY:4,position:"under",keepWithinBounds:!0})},ariaLabel:"Chart Menu"})}getMenuItems(e,t){const s=[...t?["chartEdit"]:[],...e.isEnterprise()?["chartAdvancedSettings"]:[],e.isChartLinked()?"chartUnlink":"chartLink","chartDownload"],i=this.gos.get("chartMenuItems");return i?Array.isArray(i)?i:i(N(this.gos,{defaultItems:s,chartId:e.getChartId()})):s}mapWithStockItems(e,t,s,i,r){if(!e)return[];const o=[];for(const n of e){let a;if(typeof n=="string"?a=this.getStockMenuItem(n,t,s,i,r):a={...n},!a)continue;const{subMenu:l}=a;Array.isArray(l)&&(a.subMenu=this.mapWithStockItems(l,t,s,i,r)),o.push(a)}return o}getStockMenuItem(e,t,s,i,r){switch(e){case"chartEdit":return r?this.createMenuItem(this.chartTranslation.translate("chartEdit"),"chartsMenuEdit",s):null;case"chartAdvancedSettings":return this.createMenuItem(this.chartTranslation.translate("chartAdvancedSettings"),"chartsMenuAdvancedSettings",()=>this.chartMenuSvc.openAdvancedSettings(t,i));case"chartUnlink":return t.chartController.isChartLinked()?this.createMenuItem(this.chartTranslation.translate("chartUnlink"),"unlinked",()=>this.chartMenuSvc.toggleLinked(t)):null;case"chartLink":return t.chartController.isChartLinked()?null:this.createMenuItem(this.chartTranslation.translate("chartLink"),"linked",()=>this.chartMenuSvc.toggleLinked(t));case"chartDownload":return this.createMenuItem(this.chartTranslation.translate("chartDownload"),"chartsDownload",()=>this.chartMenuSvc.downloadChart(t))}return null}createMenuItem(e,t,s){return{name:e,icon:_(t,this.beans,null),action:s}}destroy(){this.destroyBean(this.activeChartMenuList),super.destroy()}},Dq=class extends A{constructor(e){super(` `),this.menuItems=e,this.eChartsMenu=x}postConstruct(){this.mainMenuList=this.createManagedBean(new Dp(0)),this.mainMenuList.addMenuItems(this.menuItems),this.mainMenuList.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eChartsMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(){this.hidePopupFunc?.()}afterGuiAttached({hidePopup:e},t){const s=Date.now();if(e&&(this.hidePopupFunc=e,this.addDestroyFunc(e),t)){const i=()=>{Date.now()-s<500||this.hidePopupFunc()};t.addEventListener("click",i),this.addDestroyFunc(()=>{t?.removeEventListener("click",i)})}Ge(this.mainMenuList.getGui())}},Aq=class extends E{constructor(){super(...arguments),this.beanName="chartCrossFilterSvc"}filter(e,t=!1){const s=this.beans.filterManager,i=s?.getFilterModel()??{};if(t){Object.keys(i).length>0&&s?.setFilterModel(null);return}let r=eR(e);r.indexOf("-filtered-out")&&(r=r.replace("-filtered-out","")),this.updateFilters(i,e,r)}updateFilters(e,t,s){const i=eR(t),r=this.convertRawValue(s,t.datum[i]);if(r===void 0)return;const o=this.beans.filterManager;o?.getColumnFilterInstance(s).then(n=>{const a=n?.filterType;let l,c=p=>p;if(a==="multi"){const p=kq(n);l=p.setFilter,c=p.processModel??c}else a==="set"&&(l=n);if(!l){F(154,{colId:s});return}const d=t.event.metaKey||t.event.ctrlKey,u=l.getFilterHandler().getCrossFilterModel((p,f,m)=>Lq(d,p(r),f,m)),h=c(u),g=d?{...e}:{};g[s]=h,o?.setFilterModel(g)})}convertRawValue(e,t){const{colModel:s,dataTypeSvc:i}=this.beans,r=s.getColById(e),o=r?.colDef;return o&&i&&o.chartDataType==="time"&&o.cellDataType==="dateString"?i.getDateFormatterFunction(r)(t):t}};function Iq(e,t,s){const i=new Array(s);for(let r=0;rIq(r,s,t)}}return{}}function eR(e){return e.xKey||e.calloutLabelKey}function Lq(e,t,s,i){let r;if(e)if(s.has(t)&&(i==null||i.includes(t)))if(r=[],i==null)for(const o of s)o!==t&&r.push(o);else for(const o of i)o!==t&&s.has(o)&&r.push(o);else{if(i==null)r=Array.from(s);else{r=[];for(const o of i)s.has(o)&&r.push(o)}r.push(t)}else r=[t];return{filterType:"set",values:r}}var Gq=["chartUnlink","chartLink","chartDownload","chartMenu"],Md={settings:"chartSettings",data:"chartData",format:"chartFormat"},Oq=class extends E{constructor(){super(...arguments),this.beanName="chartMenuSvc"}wireBeans(e){this.advSettingsMenuFactory=e.advSettingsMenuFactory}downloadChart(e,t,s,i){e.chartController.getChartProxy().downloadChart(t,s,i)}toggleLinked(e){e.chartController.detachChartRange()}openAdvancedSettings(e,t){this.advSettingsMenuFactory?.showMenu(e,t)}hideAdvancedSettings(){this.advSettingsMenuFactory?.hideMenu()}getChartToolbarOptions(){const e=["chartMenu"],t=this.gos.getCallback("getChartToolbarItems");return t?t({defaultItems:e}).filter(i=>Gq.includes(i)?!0:(F(155,{option:i}),!1)):e}getChartToolPanels(e){const t=this.gos.get("chartToolPanelsDef");let i=t?.panels?.map(n=>{const a=Md[n];return a||F(156,{panel:n}),a}).filter(n=>!!n)??Object.values(Md);e.isPivotChart()&&(i=i.filter(n=>n!=="chartData"));const r=t?.defaultToolPanel,o=r&&Md[r]||i[0];return{panels:i,defaultPanel:o}}doesChartToolbarExist(){return this.getChartToolbarOptions().length>0}doChartToolPanelsExist(e){const{panels:t}=this.getChartToolPanels(e);return t.length>0}},Vq={pivotChartTitle:"Pivot Chart",rangeChartTitle:"Range Chart",settings:"Chart",data:"Set Up",format:"Customize",categories:"Categories",defaultCategory:"(None)",series:"Series",switchCategorySeries:"Switch Category / Series",categoryValues:"Category Values",seriesLabels:"Series Labels",aggregate:"Aggregate",xyValues:"X Y Values",paired:"Paired Mode",axis:"Axis",xAxis:"Horizontal Axis",yAxis:"Vertical Axis",polarAxis:"Polar Axis",radiusAxis:"Radius Axis",navigator:"Navigator",zoom:"Zoom",animation:"Animation",crosshair:"Crosshair",color:"Color",thickness:"Thickness",preferredLength:"Preferred Length",xType:"X Type",axisType:"Axis Type",automatic:"Automatic",category:"Category",number:"Number",time:"Time",timeFormat:"Time Format",autoRotate:"Auto Rotate",labelRotation:"Rotation",circle:"Circle",polygon:"Polygon",square:"Square",cross:"Cross",diamond:"Diamond",plus:"Plus",triangle:"Triangle",heart:"Heart",orientation:"Orientation",fixed:"Fixed",parallel:"Parallel",perpendicular:"Perpendicular",radiusAxisPosition:"Position",ticks:"Ticks",gridLines:"Grid Lines",width:"Width",height:"Height",length:"Length",padding:"Padding",spacing:"Spacing",chartStyle:"Chart Style",title:"Title",chartTitles:"Titles",chartTitle:"Chart Title",chartSubtitle:"Subtitle",horizontalAxisTitle:"Horizontal Axis Title",verticalAxisTitle:"Vertical Axis Title",polarAxisTitle:"Polar Axis Title",titlePlaceholder:"Chart Title",background:"Background",font:"Font",weight:"Weight",top:"Top",right:"Right",bottom:"Bottom",left:"Left",labels:"Labels",calloutLabels:"Callout Labels",sectorLabels:"Sector Labels",positionRatio:"Position Ratio",size:"Size",shape:"Shape",minSize:"Minimum Size",maxSize:"Maximum Size",legend:"Legend",position:"Position",markerSize:"Marker Size",markerStroke:"Marker Stroke",markerPadding:"Marker Padding",itemSpacing:"Item Spacing",itemPaddingX:"Item Padding X",itemPaddingY:"Item Padding Y",layoutHorizontalSpacing:"Horizontal Spacing",layoutVerticalSpacing:"Vertical Spacing",strokeWidth:"Stroke Width",offset:"Offset",offsets:"Offsets",tooltips:"Tooltips",callout:"Callout",markers:"Markers",shadow:"Shadow",blur:"Blur",xOffset:"X Offset",yOffset:"Y Offset",lineWidth:"Line Width",lineDash:"Line Dash",lineDashOffset:"Dash Offset",scrollingZoom:"Scrolling",scrollingStep:"Scrolling Step",selectingZoom:"Selecting",durationMillis:"Duration (ms)",crosshairLabel:"Label",crosshairSnap:"Snap to Node",normal:"Normal",bold:"Bold",italic:"Italic",boldItalic:"Bold Italic",predefined:"Predefined",fillOpacity:"Fill Opacity",strokeColor:"Line Color",strokeOpacity:"Line Opacity",miniChart:"Mini-Chart",histogramBinCount:"Bin count",connectorLine:"Connector Line",seriesItems:"Series Items",seriesItemType:"Item Type",seriesItemPositive:"Positive",seriesItemNegative:"Negative",seriesItemLabels:"Item Labels",columnGroup:"Column",barGroup:"Bar",pieGroup:"Pie",lineGroup:"Line",scatterGroup:"X Y (Scatter)",areaGroup:"Area",polarGroup:"Polar",statisticalGroup:"Statistical",hierarchicalGroup:"Hierarchical",specializedGroup:"Specialized",combinationGroup:"Combination",groupedColumnTooltip:"Grouped",stackedColumnTooltip:"Stacked",normalizedColumnTooltip:"100% Stacked",groupedBarTooltip:"Grouped",stackedBarTooltip:"Stacked",normalizedBarTooltip:"100% Stacked",pieTooltip:"Pie",donutTooltip:"Donut",lineTooltip:"Line",stackedLineTooltip:"Stacked",normalizedLineTooltip:"100% Stacked",groupedAreaTooltip:"Area",stackedAreaTooltip:"Stacked",normalizedAreaTooltip:"100% Stacked",scatterTooltip:"Scatter",bubbleTooltip:"Bubble",histogramTooltip:"Histogram",radialColumnTooltip:"Radial Column",radialBarTooltip:"Radial Bar",radarLineTooltip:"Radar Line",radarAreaTooltip:"Radar Area",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Range Bar",rangeAreaTooltip:"Range Area",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Sunburst",waterfallTooltip:"Waterfall",heatmapTooltip:"Heatmap",columnLineComboTooltip:"Column & Line",areaColumnComboTooltip:"Area & Column",customComboTooltip:"Custom Combination",innerRadius:"Inner Radius",startAngle:"Start Angle",endAngle:"End Angle",reverseDirection:"Reverse Direction",groupPadding:"Group Padding",seriesPadding:"Series Padding",tile:"Tile",whisker:"Whisker",cap:"Cap",capLengthRatio:"Length Ratio",labelPlacement:"Placement",inside:"Inside",outside:"Outside",noDataToChart:"No data available to be charted.",pivotChartRequiresPivotMode:"Pivot Chart requires Pivot Mode enabled.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Linked to Grid",chartUnlinkToolbarTooltip:"Unlinked from Grid",chartDownloadToolbarTooltip:"Download Chart",chartMenuToolbarTooltip:"Menu",chartEdit:"Edit Chart",chartAdvancedSettings:"Advanced Settings",chartLink:"Link to Grid",chartUnlink:"Unlink from Grid",chartDownload:"Download Chart",histogramFrequency:"Frequency",seriesChartType:"Series Chart Type",seriesType:"Series Type",secondaryAxis:"Secondary Axis",seriesAdd:"Add a series",categoryAdd:"Add a category",bar:"Bar",column:"Column",histogram:"Histogram",advancedSettings:"Advanced Settings",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Group Type",groupedSeriesGroupType:"Grouped",stackedSeriesGroupType:"Stacked",normalizedSeriesGroupType:"100% Stacked",legendEnabled:"Enabled",groupedColumnFull:"Grouped Column",stackedColumnFull:"Stacked Column",normalizedColumnFull:"100% Stacked Column",groupedBarFull:"Grouped Bar",stackedBarFull:"Stacked Bar",normalizedBarFull:"100% Stacked Bar",stackedAreaFull:"Stacked Area",normalizedAreaFull:"100% Stacked Area",stackedLineFull:"Stacked Line",normalizedLineFull:"100% Stacked Line",customCombo:"Custom Combination",funnel:"Funnel",coneFunnel:"Cone Funnel",pyramid:"Pyramid",funnelGroup:"Funnel",funnelTooltip:"Funnel",coneFunnelTooltip:"Cone Funnel",pyramidTooltip:"Pyramid",dropOff:"Drop-Off",stageLabels:"Stage Labels",reverse:"Reverse",tooltipMode:"Tooltip Mode",tooltipModeSingle:"Single",tooltipModeShared:"Multiple",tooltipModeCompact:"Compact",groupedColumn:"Grouped",stackedColumn:"Stacked",pie:"Pie",donut:"Donut",line:"Line",scatter:"Scatter",bubble:"Bubble",area:"Area",stackedArea:"Stacked",radarLine:"Radar Line",radarArea:"Radar Area",nightingale:"Nightingale",radialColumn:"Radial Column",radialBar:"Radial Bar",boxPlot:"Box Plot",rangeBar:"Range Bar",rangeArea:"Range Area",treemap:"Treemap",sunburst:"Sunburst",waterfall:"Waterfall",heatmap:"Heatmap",columnLineCombo:"Column & Line",AreaColumnCombo:"Area & Column",ariaChartMenuClose:"Close Chart Edit Menu",ariaChartSelected:"Selected",group:"Group",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM",sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Bq=class extends E{constructor(){super(...arguments),this.beanName="chartTranslation"}translate(e){const t=this.getLocaleTextFunc(),s=Vq[e];return t(e,s)}},Xo=e=>t=>t==null?!0:e(t),tR=e=>typeof e=="string",Of=e=>typeof e=="boolean",Nq=e=>typeof e=="object",ei=(e,t)=>s=>`AG Grid - unable to update chart as invalid params supplied: \`${e}: ${s}\`, expected ${t}.`,sR=e=>`${e} is not supported in AG Charts Community ('ag-charts-enterprise' hasn't been loaded). See https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/ for more details.`,Hq=["doughnut"],Vf=["type","chartId","chartType","chartThemeName","chartThemeOverrides","unlinkChart"];function zq(e){return!!$x(e)||Mf(e)}function _q(e){return Hq.includes(e)}var Wq=Xo(e=>{if(zq(e))return!0;if(_q(e)){const t=ka(e);return ss(`The chart type '${e}' has been deprecated. Please use '${t}' instead.`),t}return!1}),Uq=Xo(e=>typeof e=="object"),$q=Xo(e=>typeof e=="object"),Kq=Xo(e=>typeof e=="string"||typeof e=="function"),iR=e=>({property:"chartType",validationFn:Xo(t=>e||!t||!Nj(t)),warnMessage:t=>sR(`The '${t}' chart type`)}),rR=e=>({property:"switchCategorySeries",validationFn:Xo(t=>{if(!t||e)return!0}),warnMessage:()=>sR("'switchCategorySeries' has been ignored as it"),warnIfFixed:!0}),Bf=()=>[{property:"chartId",validationFn:tR,warnMessage:ei("chartId","string")},{property:"chartType",validationFn:Wq,warnMessage:ei("chartType","ChartType")},{property:"chartThemeName",validationFn:tR,warnMessage:ei("chartThemeName","string")},{property:"chartThemeOverrides",validationFn:Uq,warnMessage:ei("chartThemeOverrides","AgChartThemeOverrides")},{property:"unlinkChart",validationFn:Of,warnMessage:ei("unlinkChart","boolean")}],oR=e=>[{property:"cellRange",validationFn:$q,warnMessage:ei("cellRange","ChartParamsCellRange")},{property:"suppressChartRanges",validationFn:Of,warnMessage:ei("suppressChartRanges","boolean")},{property:"aggFunc",validationFn:Kq,warnMessage:ei("aggFunc","string or IAggFunc")},rR(e)];function jq(e,t){switch(e.type){case"rangeChartUpdate":return Yq(e,t);case"pivotChartUpdate":return Xq(e);case"crossFilterChartUpdate":return Zq(e,t);default:return ss(`Invalid value supplied for 'type': ${e.type}. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.`),!1}}function qq(e,t){return Td(e,[iR(t),rR(t)])}function Yq(e,t){const s=[...Bf(),iR(t),...oR(t),{property:"seriesChartTypes",validationFn:i=>i===void 0||Array.isArray(i)&&i.every(Nq),warnMessage:ei("seriesChartTypes","Array of SeriesChartType")},{property:"useGroupColumnAsCategory",validationFn:Of,warnMessage:ei("useGroupColumnAsCategory","boolean")}];return Td(e,s,[...Vf,"cellRange","suppressChartRanges","switchCategorySeries","aggFunc","seriesChartTypes","seriesGroupType","useGroupColumnAsCategory"],"UpdateRangeChartParams")}function Xq(e){const t=[...Bf()];return Td(e,t,[...Vf],"UpdatePivotChartParams")}function Zq(e,t){const s=[...Bf(),...oR(t)];return Td(e,s,[...Vf,"cellRange","suppressChartRanges","aggFunc"],"UpdateCrossFilterChartParams")}function Td(e,t,s,i){let r;for(const o of t){const{property:n,validationFn:a,warnMessage:l,warnIfFixed:c}=o;if(n in e){const d=e[n],u=a(d);if(u===!0)continue;if(u===!1)return ss(l(d)),!1;r=r||{...e},r[n]=u,c&&ss(l(d))}}if(s){for(const o of Object.keys(e))if(!s.includes(o))return ss(`Unexpected property supplied. ${i} does not contain: \`${o}\`.`),!1}return r||!0}var nR=["ag-default","ag-material","ag-sheets","ag-polychroma","ag-vivid"],Qq=class extends E{constructor(e){super(),this.model=e,this.isEnterprise=()=>this.agChartsExports.isEnterprise}wireBeans(e){this.rangeSvc=e.rangeSvc,this.agChartsExports=e.agChartsExports}postConstruct(){this.setChartRange(),this.model.unlinked&&this.rangeSvc&&this.rangeSvc.setCellRanges([]);const e=this.updateForGridChange.bind(this,{});this.addManagedEventListeners({cellSelectionChanged:t=>{t.id&&t.id===this.model.chartId&&this.updateForRangeChange()},columnMoved:e,columnPinned:e,columnVisible:e,columnRowGroupChanged:e,modelUpdated:e,cellValueChanged:this.updateForDataChange.bind(this),cellEditValuesChanged:this.updateForDataChange.bind(this)})}update(e){if(!this.validUpdateType(e))return!1;const t=jq(e,this.agChartsExports.isEnterprise);if(!t)return!1;const s=t===!0?e:t;return this.applyValidatedChartParams(s),!0}applyValidatedChartParams(e){const{chartId:t,chartType:s,chartThemeName:i,unlinkChart:r}=e,n={...{chartId:t,pivotChart:this.model.pivotChart,chartType:s??this.model.chartType,chartThemeName:i??this.model.chartThemeName,unlinkChart:r??this.model.unlinked,cellRange:this.model.suppliedCellRange,switchCategorySeries:this.model.switchCategorySeries,aggFunc:this.model.aggFunc,seriesChartTypes:void 0,suppressChartRanges:!1,crossFiltering:!1}};switch(e.type){case"rangeChartUpdate":n.cellRange=this.createCellRange(e)??this.model.suppliedCellRange,n.switchCategorySeries=e.switchCategorySeries??this.model.switchCategorySeries,n.aggFunc=e.aggFunc??this.model.aggFunc,n.seriesChartTypes=e.seriesChartTypes,n.suppressChartRanges=e.suppressChartRanges??this.model.suppressChartRanges,n.seriesGroupType=e.seriesGroupType??this.model.seriesGroupType,n.useGroupColumnAsCategory=e.useGroupColumnAsCategory??this.model.useGroupColumnAsCategory;break;case"crossFilterChartUpdate":n.cellRange=this.createCellRange(e)??this.model.suppliedCellRange,n.switchCategorySeries=!1,n.aggFunc=e.aggFunc??this.model.aggFunc,n.crossFiltering=!0,n.crossFilteringSort=this.model.crossFilteringSort,n.suppressChartRanges=e.suppressChartRanges??this.model.suppressChartRanges;break;case"pivotChartUpdate":n.switchCategorySeries=!1;break}this.model.updateModel(n),n.unlinkChart||n.suppressChartRanges?this.rangeSvc?.setCellRanges([]):this.setChartRange()}updateForGridChange(e){if(this.model.unlinked)return;const{maintainColState:t,setColsFromRange:s}=e??{};this.model.updateCellRanges({maintainColState:t,setColsFromRange:s}),this.model.updateData(),this.setChartRange()}updateForDataChange(){this.model.unlinked||(this.model.updateData(),this.raiseChartModelUpdateEvent())}updateForRangeChange(){this.updateForGridChange({setColsFromRange:!0}),this.raiseChartRangeSelectionChangedEvent()}updateForPanelChange(e){this.model.updateCellRanges(e),this.model.updateData(),e.skipAnimation&&this.getChartProxy().getChartRef().skipAnimations(),this.setChartRange(),this.raiseChartRangeSelectionChangedEvent()}updateThemeOverrides(e){this.chartProxy.updateThemeOverrides(e)}getChartUpdateParams(e){const s=this.getSelectedValueColState().map(a=>({colId:a.colId,displayName:a.displayName})),i=this.getChartData(),r=this.getSelectedDimensions(),o=this.model,n={data:i,groupData:o.groupChartData,grouping:this.isGrouping(),categories:r.map(({colId:a,displayName:l})=>{const c=o.categoryAxisType??o.getChartDataType(a);return{id:a,name:l,chartDataType:c,convertTime:c==="time"?o.getConvertTime(a):void 0}}),fields:s,chartId:this.getChartId(),getCrossFilteringContext:()=>({lastSelectedChartId:"xxx"}),seriesChartTypes:this.getSeriesChartTypes(),updatedOverrides:e,seriesGroupType:o.seriesGroupType};return this.isCategorySeriesSwitched()?this.invertCategorySeriesParams(n):n}invertCategorySeriesParams(e){const[t]=e.categories,s=[{id:Qs,name:""}],i=e.data.map((o,n)=>{const a=`${t.id}:${n}`,l=o[t.id],c=l==null?"":String(l);return{colId:a,displayName:c}}),r=e.fields.map(o=>{const n={[Qs]:o.displayName};for(const[a,l]of e.data.entries()){const c=`${t.id}:${a}`,d=l[o.colId];n[c]=d}return n});return{...e,categories:s,fields:i,data:r}}getChartModel(){const e=this.model.pivotChart?"pivot":"range",t=this.isComboChart()?this.model.comboChartModel.seriesChartTypes:void 0;return{modelType:e,chartId:this.model.chartId,chartType:this.model.chartType,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy?.getChartThemeOverrides(),chartPalette:this.chartProxy?.getChartPalette(),cellRange:this.getCellRangeParams(),switchCategorySeries:this.model.switchCategorySeries,suppressChartRanges:this.model.suppressChartRanges,aggFunc:this.model.aggFunc,unlinkChart:this.model.unlinked,seriesChartTypes:t,seriesGroupType:this.model.seriesGroupType,useGroupColumnAsCategory:this.model.useGroupColumnAsCategory}}getChartId(){return this.model.chartId}getChartData(){return this.model.chartData}getChartType(){return this.model.chartType}setChartType(e){this.updateMultiSeriesAndCategory(this.model.chartType,e),this.model.chartType=e,this.model.comboChartModel.updateSeriesChartTypes(),this.model.switchCategorySeries=!1,this.model.categoryAxisType=void 0,this.model.seriesGroupType=void 0,this.raiseChartModelUpdateEvent()}isCategorySeriesSwitched(){return this.model.switchCategorySeries&&!this.model.isGrouping()}switchCategorySeries(e){jx(this.getChartType())&&(this.model.switchCategorySeries=e,this.raiseChartModelUpdateEvent())}getAggFunc(){return this.model.aggFunc}setAggFunc(e,t){this.model.aggFunc!==e&&(this.model.aggFunc=e,!t&&(this.model.updateData(),this.raiseChartModelUpdateEvent()))}updateMultiSeriesAndCategory(e,t){const s=(a,l)=>{let c=0;for(const d of a)d.selected&&(c>=l?d.selected=!1:c++);c===0&&(a[0].selected=!0)},i=Af(t),r=Ed(t),o=i!=null&&(Af(e)??100)>(i??100),n=r!=null&&(Ed(e)??100)>(r??100);o&&s(this.model.dimensionColState,i),n&&s(this.model.valueColState,r),(o||n)&&(this.model.resetCellRanges(o,n),this.setChartRange(!0))}setChartThemeName(e,t){this.model.chartThemeName=e,t||this.raiseChartModelUpdateEvent()}getChartThemeName(){return this.model.chartThemeName}isPivotChart(){return this.model.pivotChart}isPivotMode(){return this.model.isPivotMode()}isGrouping(){return this.model.isGrouping()}isCrossFilterChart(){return this.model.crossFiltering}getThemeNames(){return this.gos.get("chartThemes")||nR}getThemes(){return this.getThemeNames().map(t=>{const i=kf(t,this.agChartsExports._Theme)?t:this.chartProxy.lookupCustomChartTheme(t);return this.agChartsExports._Theme.getChartTheme(i)})}getPalettes(){return this.getThemes().map(t=>t.palette)}getSelectedValueColState(){return this.model.getValueColState().filter(e=>e.selected)}getSelectedDimensions(){return this.model.getSelectedDimensions()}getColStateForMenu(){return{dimensionCols:this.model.dimensionColState,valueCols:this.model.getValueColState()}}setChartRange(e=!1){this.rangeSvc&&!this.model.suppressChartRanges&&!this.model.unlinked&&this.rangeSvc.setCellRanges(this.getCellRanges()),e||this.raiseChartModelUpdateEvent()}detachChartRange(){this.model.unlinked=!this.model.unlinked,this.model.unlinked?this.rangeSvc&&this.rangeSvc.setCellRanges([]):this.updateForGridChange(),this.dispatchLocalEvent({type:"chartLinkedChanged"})}setChartProxy(e){this.chartProxy=e}getChartProxy(){return this.chartProxy}isActiveXYChart(){return["scatter","bubble"].includes(this.getChartType())}isChartLinked(){return!this.model.unlinked}customComboExists(){const e=this.model.comboChartModel.savedCustomSeriesChartTypes;return e&&e.length>0}getSeriesChartTypes(){return this.model.comboChartModel.seriesChartTypes}isComboChart(e){return this.model.isComboChart(e)}updateSeriesChartType(e,t,s){const i=this.model.comboChartModel.seriesChartTypes.find(r=>r.colId===e);if(i){const r=this.model.chartType!=="customCombo";r&&(this.model.chartType="customCombo");const o=i.chartType;t!=null&&(i.chartType=t),s!=null&&(i.secondaryAxis=s),this.model.comboChartModel.savedCustomSeriesChartTypes=this.model.comboChartModel.seriesChartTypes,this.model.comboChartModel.updateSeriesChartTypes(),this.updateForDataChange(),r&&this.dispatchLocalEvent({type:"chartTypeChanged"}),o!==t&&this.dispatchLocalEvent({type:"chartSeriesChartTypeChanged"}),this.raiseChartOptionsChangedEvent()}}getActiveSeriesChartTypes(){const e=this.getSelectedValueColState().map(t=>t.colId);return this.getSeriesChartTypes().filter(t=>e.includes(t.colId))}getChartSeriesTypes(e){const t=e??this.getChartType();return this.isComboChart(t)?["line","bar","area"]:[ye(t)]}getChartSeriesType(){const e=this.getSeriesChartTypes();if(e.length===0)return"bar";const t=e[0].chartType;return t==="columnLineCombo"?"bar":t==="areaColumnCombo"?"area":ye(t)}getCellRanges(){return[this.model.dimensionCellRange,this.model.valueCellRange].filter(e=>e)}createCellRange(e){return e.cellRange&&this.rangeSvc?.createPartialCellRangeFromRangeParams(e.cellRange,!0)}validUpdateType(e){if(!e.type)return F(136),!1;const t={"Range Chart":()=>!this.isPivotChart()&&!this.isCrossFilterChart(),"Pivot Chart":()=>this.isPivotChart(),"Cross Filter Chart":()=>this.isCrossFilterChart()},s=Object.keys(t).find(r=>t[r]())??"Range Chart",i=e.type===`${s[0].toLowerCase()}${s.slice(1).replace(/ /g,"")}Update`;return i||F(137,{currentChartType:s,type:e.type}),i}getCellRangeParams(){const e=this.getCellRanges(),t=e[0],s=t?.startRow||null,i=t?.endRow||null;return{rowStartIndex:s?.rowIndex??null,rowStartPinned:s?.rowPinned,rowEndIndex:i?.rowIndex??null,rowEndPinned:i?.rowPinned,columns:e.reduce((r,o)=>r.concat(o.columns.map(n=>n.getId())),[])}}setCategoryAxisType(e){this.model.categoryAxisType=e,this.raiseChartModelUpdateEvent()}getSeriesGroupType(){return this.model.seriesGroupType??this.chartProxy.getSeriesGroupType()}setSeriesGroupType(e){this.model.seriesGroupType=e,this.raiseChartModelUpdateEvent()}raiseChartModelUpdateEvent(){this.dispatchLocalEvent({type:"chartModelUpdate"}),this.raiseChartOptionsChangedEvent()}raiseChartUpdatedEvent(){this.dispatchLocalEvent({type:"chartUpdated"})}raiseChartApiUpdateEvent(){this.dispatchLocalEvent({type:"chartApiUpdate"})}raiseChartOptionsChangedEvent(){const{chartId:e,chartType:t}=this.getChartModel();this.eventSvc.dispatchEvent({type:"chartOptionsChanged",chartId:e,chartType:t,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy?.getChartThemeOverrides()})}raiseChartRangeSelectionChangedEvent(){this.eventSvc.dispatchEvent({type:"chartRangeSelectionChanged",id:this.model.chartId,chartId:this.model.chartId,cellRange:this.getCellRangeParams()})}destroy(){super.destroy(),this.rangeSvc&&this.rangeSvc.setCellRanges([])}},Jq=class extends nr{getAxes(e){const t={x:{type:this.getXAxisType(e),position:"bottom"},y:{type:"number",position:"left"}};return this.isNormalised()&&(t.y.label={...t.y.label,formatter:s=>Math.round(s.value)+"%"}),t}getSeries(e){const[t]=e.categories,s=e.fields.map(i=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:i.colId,yName:i.displayName,normalizedTo:this.chartType==="normalizedArea"?100:void 0,stacked:["normalizedArea","stackedArea"].includes(this.chartType)}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(s,e):s}isNormalised(){return!this.crossFiltering&&this.chartType==="normalizedArea"}},eY=new Set(["bar","groupedBar","stackedBar","normalizedBar"]),tY=class extends nr{getAxes(e){const t={x:{type:this.getXAxisType(e),position:this.isHorizontal()?"left":"bottom"},y:{type:"number",position:this.isHorizontal()?"bottom":"left"}};return this.isNormalised()&&(t.y.label={...t.y.label,formatter:s=>Math.round(s.value)+"%"}),t}getSeries(e){const[t]=e.categories,s=e.fields.map(i=>({type:this.standaloneChartType,direction:this.isHorizontal()?"horizontal":"vertical",stacked:this.crossFiltering||zj(this.chartType),normalizedTo:this.isNormalised()?100:void 0,xKey:t.id,xName:t.name,yKey:i.colId,yName:i.displayName}));return this.crossFiltering?this.extractCrossFilterSeries(s):s}extractCrossFilterSeries(e){const t=[];for(let s=0;sMath.round(s.value)+"%"}),t}getSeries(e){const[t]=e.categories,s=["normalizedLine","stackedLine"].includes(this.chartType),i=e.fields.map(r=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:r.colId,yName:r.displayName,normalizedTo:s&&this.isNormalised()?100:void 0,stacked:s}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(i,e):i}isNormalised(){const e=["normalizedLine"];return!this.crossFiltering&&e.includes(this.chartType)}},iY=class extends nr{getAxes(e){return{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}}}getSeries(e){const[t]=e.categories,s=this.isPaired(),i=this.getSeriesDefinitions(e.fields,s),r=t.id===Qs?void 0:t,o=i.map(n=>n?.sizeField?{type:"bubble",xKey:n.xField.colId,xName:n.xField.displayName??void 0,yKey:n.yField.colId,yName:n.yField.displayName??void 0,title:`${n.yField.displayName} vs ${n.xField.displayName}`,sizeKey:n.sizeField.colId,sizeName:n.sizeField.displayName??"",labelKey:r?r.id:n.yField.colId,labelName:r?r.name:void 0}:{type:"scatter",xKey:n.xField.colId,xName:n.xField.displayName??void 0,yKey:n.yField.colId,yName:n.yField.displayName??void 0,title:`${n.yField.displayName} vs ${n.xField.displayName}`,labelKey:r?r.id:n.yField.colId,labelName:r?r.name:void 0});return this.crossFiltering?this.extractCrossFilterSeries(o,e):o}extractCrossFilterSeries(e,t){const{data:s}=t,i=l=>`${l}-filtered-out`,r=(l,c)=>{const d=[1/0,-1/0];if(c!=null)for(const u of l){const h=u[c]??u[i(c)];hd[1]&&(d[1]=h)}if(d[0]<=d[1])return d},o=l=>{let c;if(l.type==="bubble"){const{sizeKey:d}=l;c=r(s,d)}return{...l,domain:c,highlight:{highlightedItem:{fill:"yellow"}},listeners:{...l.listeners,seriesNodeClick:this.crossFilterCallback}}},n=l=>{const{yKey:c,xKey:d}=l;let u={};return l.type==="bubble"&&(u={sizeKey:i(l.sizeKey)}),{...l,...u,yKey:i(c),xKey:i(d),showInLegend:!1,listeners:{...l.listeners,seriesNodeClick:h=>{const g=h.datum[i(d)],p={...h,xKey:d,datum:{...h.datum,[d]:g}};this.crossFilterCallback(p)}}}},a=e.map(o);return[...a,...a.map(n)]}getSeriesDefinitions(e,t){if(e.length<2)return[];const s=this.chartType==="bubble";if(t)return s?e.map((r,o)=>o%3===0?{xField:r,yField:e[o+1],sizeField:e[o+2]}:null).filter(r=>r?.yField&&r.sizeField):e.map((r,o)=>o%2===0?{xField:r,yField:e[o+1]}:null).filter(r=>r?.yField);const i=e[0];return s?e.map((r,o)=>o%2===1?{xField:i,yField:r,sizeField:e[o+1]}:null).filter(r=>r?.sizeField):e.filter((r,o)=>o>0).map(r=>({xField:i,yField:r}))}},rY=class extends nr{getAxes(e){const t=e?e.fields:[],s=new Map(t.map(n=>[n.colId,n])),{primaryYKeys:i,secondaryYKeys:r}=this.getYKeys(t,e.seriesChartTypes),o={x:{type:this.getXAxisType(e),position:"bottom"}};return i.length>0&&(o.y={type:"number",position:"left"}),r.length>0&&r.forEach(n=>{const a=s.get(n);if(!(a&&a.colId===n))return;const c={type:"number",position:"right"};o[`y_${n}`]=c}),o}getSeries(e){const{fields:t,seriesChartTypes:s}=e,[i]=e.categories;return t.map(r=>{const o=s.find(n=>n.colId===r.colId);if(o){const n=o.chartType,l=["groupedColumn","groupedBar"].includes(n)?{grouped:!0}:{},c=o.secondaryAxis?`y_${r.colId}`:"y";return{type:ye(n),xKey:i.id,yKey:r.colId,yName:r.displayName,yKeyAxis:c,stacked:["stackedArea","stackedColumn"].includes(n),...l}}})}getYKeys(e,t){const s=[],i=[];for(const r of e){const o=r.colId,n=t.find(a=>a.colId===o);n&&(n.secondaryAxis?i.push(o):s.push(o))}return{primaryYKeys:s,secondaryYKeys:i}}setSeriesChartThemeDefaults(e){const t=this.getSeriesChartThemeDefaults();if(!t)return;const s=new Set;for(const i of this.chartProxyParams.seriesChartTypes)s.add(i.chartType);for(const i of s)e[ye(i)]=t}};function oY(e){const t=e.currentOffset;e.currentOffset-=e.offsetAmount;const s=e.currentOffset;return e.currentOffset-=e.offsetAmount,{outerRadiusOffset:t,innerRadiusOffset:s}}var nY=class extends Yo{getUpdateOptions(e,t){return{...t,data:this.crossFiltering?this.getCrossFilterData(e):e.data,series:this.getSeries(e)}}getSeries(e){const[t]=e.categories,s=e.fields.length,i={currentOffset:0,offsetAmount:s>1?20:40},r=this.getFields(e).map(o=>{const n={type:this.standaloneChartType,angleKey:o.colId,angleName:o.displayName,sectorLabelKey:o.colId,calloutLabelName:t.name,calloutLabelKey:t.id};if(this.chartType==="donut"||this.chartType==="doughnut"){const{outerRadiusOffset:a,innerRadiusOffset:l}=oY(i),c=o.displayName?{title:{text:o.displayName,showInLegend:s>1}}:void 0;return{...n,type:"donut",outerRadiusOffset:a,innerRadiusOffset:l,...c}}return n});return this.crossFiltering?this.extractCrossFilterSeries(r):r}getCrossFilterData(e){const t=e.fields[0].colId,s=`${t}-filtered-out`;return e.data.map(i=>{const r=i[t]+i[s];return i[`${t}-total`]=r,i[s]=1,i[t]=i[t]/r,i})}extractCrossFilterSeries(e){const t=e[0],s=t.angleKey,i={...t,radiusMin:0,radiusMax:1,listeners:{seriesNodeClick:this.crossFilterCallback},legendItemKey:t.calloutLabelKey,angleKey:`${s}-total`},r={...i,radiusKey:s,sectorLabelKey:`${s}-total`};return[{...i,radiusKey:`${s}-filtered-out`,showInLegend:!1},r]}getFields(e){return this.chartType==="pie"?e.fields.slice(0,1):e.fields}getSeriesChartThemeDefaults(){return{series:{highlight:Lf(this.crossFiltering)}}}},aY=class extends A{constructor(){super('
'),this.eMenu=x,this.buttonListenersDestroyFuncs=[]}wireBeans(e){this.chartTranslation=e.chartTranslation}updateParams(e){const{buttons:t}=e;this.createButtons(t)}createButtons(e){for(const s of this.buttonListenersDestroyFuncs)s?.();this.buttonListenersDestroyFuncs=[];const t=this.eMenu;ee(t);for(const s of e){const{buttonName:i,iconName:r,callback:o}=s,n=this.createButton(r),a=this.chartTranslation.translate(i+"ToolbarTooltip");a&&n instanceof HTMLElement&&(n.title=a),this.buttonListenersDestroyFuncs.push(...this.addManagedElementListeners(n,{click:l=>o(l.currentTarget)})),t.appendChild(n)}}createButton(e){const t=_(e,this.beans);t.classList.add("ag-chart-menu-icon");const s=re({tag:"button",attrs:{type:"button"},cls:"ag-chart-menu-toolbar-button"});return s.appendChild(t),s}destroy(){this.buttonListenersDestroyFuncs=[],super.destroy()}},lY=".ag-pill-select{display:flex;flex-direction:column}.ag-pill-select .ag-column-drop-list{padding:0}:where(.ag-pill-select){.ag-select{padding-top:var(--ag-spacing)}.ag-picker-field-wrapper{background-color:transparent;border:0}.ag-picker-field-display{cursor:pointer;font-weight:500}.ag-picker-field-display,.ag-picker-field-icon{color:var(--ag-chart-menu-label-color)}}",cY=class extends A{constructor(e){super(''),this.config=e??{};const{selectedValueList:t,valueFormatter:s,valueList:i}=this.config;this.selectedValues=t??[],this.valueList=i??[],this.valueFormatter=s??(r=>pt(r)),this.registerCSS(lY)}postConstruct(){const{ariaLabel:e,onValuesChange:t,dragSourceId:s}=this.config;this.dropZonePanel=this.createManagedBean(new uY({getValues:()=>this.selectedValues,setValues:r=>this.updateValues(r),isDraggable:()=>this.selectedValues.length>1},r=>this.valueFormatter(r),e,s)),this.getGui().appendChild(this.dropZonePanel.getGui()),this.initSelect(),t!=null&&(this.onValuesChange=t)}setValues(e,t){const{added:s,removed:i,updated:r}=this.getChanges(this.valueList,e);let o=!1;return(s.length||i.length||r.length)&&(o=!0),this.valueList=e,this.updateValues(t,o,!0),this}setValueFormatter(e){return this.valueFormatter=e,this}initSelect(){const e=this.createSelectOptions();if(!e.length)return!1;const{selectPlaceholder:t}=this.config;return this.eSelect=this.createBean(new Ct({options:e,placeholder:t,onValueChange:s=>this.addValue(s),pickerIcon:"chartsMenuAdd"})),this.getGui().appendChild(this.eSelect.getGui()),!0}createSelectOptions(){const e=[],{maxSelection:t}=this.config;if(t&&this.selectedValues.length>=t)return e;for(const s of this.valueList)this.selectedValues.includes(s)||e.push({value:s,text:this.valueFormatter(s)});return e}addValue(e){this.dropZonePanel.addItem(e)}updateValues(e,t,s){const i=this.selectedValues;this.selectedValues=e;const r=this.getChanges(i,e),o=t||r.added.length||r.removed.length,n=ie(this.beans),a=this.eSelect?.getGui().contains(n),l=this.dropZonePanel?.getGui().contains(n);s||this.onValuesChange?.(r);const c=o?!this.refreshSelect():!1;this.dropZonePanel.refreshGui(),o&&a&&(c?this.dropZonePanel.focusList(!0):this.eSelect?.getFocusableElement().focus()),l&&!e.length&&this.eSelect?.getFocusableElement().focus()}getChanges(e,t){const s=t.filter(o=>!e.includes(o)),i=e.filter(o=>!t.includes(o)),r=t.filter((o,n)=>e[n]!==o);return{added:s,removed:i,updated:r,selected:t}}refreshSelect(){if(!this.eSelect)return this.initSelect();const e=this.createSelectOptions();return e.length?(this.eSelect.clearOptions().addOptions(e).setValue(void 0,!0),!0):(ue(this.eSelect.getGui()),this.eSelect=this.destroyBean(this.eSelect),!1)}destroy(){this.destroyBean(this.eSelect),super.destroy()}},dY=class extends b0{constructor(e,t,s,i,r,o){super(t,s,!1),this.value=e,this.valueFormatter=i,this.draggable=r,this.sourceId=o}getItem(){return this.value}getDisplayName(){return this.valueFormatter(this.value)}getAriaDisplayName(){return this.getDisplayName()}getTooltip(){}createGetDragItem(){return()=>({value:this.value})}getDragSourceType(){return ns.ChartPanel}getDragSourceId(){return this.sourceId}isMovable(){return this.isDraggable()}isDraggable(){return this.draggable}},uY=class extends w0{constructor(e,t,s,i){super(!1),this.model=e,this.valueFormatter=t,this.ariaLabel=s,this.sourceId=i}postConstruct(){super.init()}isItemDroppable(e,t){return this.isSourceEventFromTarget(t)||this.sourceId!=null&&this.sourceId===t.dragSource.sourceId}updateItems(e){this.model.setValues(e)}getExistingItems(){return this.model.getValues()}getIconName(){return this.isPotentialDndItems()?"move":"notAllowed"}getAriaLabel(){return this.ariaLabel}createPillComponent(e,t,s){return new dY(e,t,s,this.valueFormatter,this.model.isDraggable(),this.sourceId)}getItems(e){return[e.value]}isInterestedIn(e){return e===ns.ChartPanel}},aR=class extends A{constructor(e,t,s,i){super(i),this.chartController=e,this.allowMultipleSelection=t,this.maxSelection=s}wireBeans(e){this.chartTranslation=e.chartTranslation}addItem(e){this.groupComp.addItem(e)}createGroup(e,t,s,i,r){if(this.allowMultipleSelection){const o=e.filter(n=>n.selected);this.valuePillSelect=this.groupComp.createManagedBean(new cY({valueList:e,selectedValueList:o,valueFormatter:t,selectPlaceholder:this.chartTranslation.translate(s),dragSourceId:i,onValuesChange:n=>this.onValueChange(n),maxSelection:this.maxSelection})),this.groupComp.addItem(this.valuePillSelect)}else{const o=this.createValueSelectParams(e);o.onValueChange=n=>{for(const a of e)a.selected=!1;n.selected=!0,n.colId===Qs&&this.chartController.setAggFunc(void 0,!0),this.chartController.updateForPanelChange({updatedColState:n,skipAnimation:r?.()})},this.valueSelect=this.groupComp.createManagedBean(new Ct(o)),this.groupComp.addItem(this.valueSelect)}}refreshValueSelect(e){if(!this.valueSelect)return;const{options:t,value:s}=this.createValueSelectParams(e);this.valueSelect.clearOptions().addOptions(t).setValue(s,!0)}createValueSelectParams(e){let t;return{options:e.map(i=>{const r=i.displayName??"";return i.selected&&(t=i),{value:i,text:r}}),value:t}}onValueChange({added:e,updated:t,removed:s,selected:i}){let r,o;const n=()=>{i.forEach((a,l)=>{a.order=l}),o=!0};e.length?(r=e[0],r.selected=!0,n()):s.length?(r=s[0],r.selected=!1):t.length&&(n(),r=t[0]),r&&this.chartController.updateForPanelChange({updatedColState:r,resetOrder:o})}destroy(){this.valuePillSelect=void 0,this.valueSelect=void 0,super.destroy()}},hY="sum",gY=class extends aR{constructor(e,t,s,i,r){super(e,s,void 0,'
'),this.title=t,this.dimensionCols=i,this.isOpen=r}postConstruct(){this.groupComp=this.createBean(new qs({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.createGroup(this.dimensionCols,e=>e.displayName??"","categoryAdd","categorySelect",()=>!this.chartController.getAggFunc()),this.createAggFuncControls(this.dimensionCols),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){this.valuePillSelect?.setValues(e,e.filter(t=>t.selected)),this.refreshValueSelect(e),this.refreshAggFuncControls(e,this.chartController.getAggFunc())}createAggFuncControls(e){const t=this.chartController.getAggFunc();this.groupComp.addItem(this.aggFuncToggle=this.createBean(new Vr({label:this.chartTranslation.translate("aggregate"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:t!=null,onValueChange:s=>{const i=s?hY:void 0;this.chartController.setAggFunc(i),this.aggFuncSelect?.setValue(i,!0),this.aggFuncSelect?.setDisplayed(i!=null)}}))),this.groupComp.addItem(this.aggFuncSelect=this.createBean(new Ct({options:[{value:"sum",text:this.chartTranslation.translate("sum")},{value:"first",text:this.chartTranslation.translate("first")},{value:"last",text:this.chartTranslation.translate("last")},{value:"min",text:this.chartTranslation.translate("min")},{value:"max",text:this.chartTranslation.translate("max")},{value:"count",text:this.chartTranslation.translate("count")},{value:"avg",text:this.chartTranslation.translate("avg")}],value:typeof t=="string"?t:void 0,onValueChange:s=>{this.chartController.setAggFunc(s)}}))),this.refreshAggFuncControls(e,t)}refreshAggFuncControls(e,t){const i=e.filter(r=>r.selected).some(r=>r.colId!==Qs);this.aggFuncToggle?.setValue(t!=null),this.aggFuncSelect?.setValue(typeof t=="string"?t:void 0,!0),this.aggFuncToggle?.setDisplayed(i),this.aggFuncSelect?.setDisplayed(i&&t!=null)}clearAggFuncControls(){this.aggFuncToggle=this.destroyBean(this.aggFuncToggle),this.aggFuncSelect=this.destroyBean(this.aggFuncSelect)}destroy(){this.clearAggFuncControls(),this.groupComp=this.destroyBean(this.groupComp),super.destroy()}},qr=class extends E{constructor(e){super(),this.chartOptionsProxy=e}wireBeans(e){this.chartTranslation=e.chartTranslation}getDefaultColorPickerParams(e,t,s){return this.addValueParams(e,{label:this.chartTranslation.translate(t??"color"),labelWidth:"flex",inputWidth:"flex",labelAlignment:"top",pickerGap:6},s)}getDefaultNumberInputParams(e,t,s){return this.addValueParams(e,{label:this.chartTranslation.translate(t),labelAlignment:"top",labelWidth:"flex",inputWidth:"flex",precision:s?.precision,step:s?.step,min:s?.min,max:s?.max},{parseInputValue:i=>{const r=Number(i);return isNaN(r)?void 0:r},formatInputValue:i=>i==null?"":`${i}`})}getDefaultSliderParams(e,t,s,i){let r=this.chartOptionsProxy.getValue(e)??0;i&&Array.isArray(r)&&(r=r[0]);const o=this.getDefaultSliderParamsWithoutValueParams(r,t,s);return o.onValueChange=n=>this.chartOptionsProxy.setValue(e,i?[n]:n),o}getDefaultSliderParamsWithoutValueParams(e,t,s){return{label:this.chartTranslation.translate(t),minValue:0,maxValue:Math.max(e,s),textFieldWidth:45,value:`${e}`}}getDefaultCheckboxParams(e,t,s){const i=this.chartOptionsProxy.getValue(e),r={label:this.chartTranslation.translate(t),value:i,readOnly:s?.readOnly,passive:s?.passive};return r.onValueChange=o=>{this.chartOptionsProxy.setValue(e,typeof o=="boolean"?o:void 0)},r}getDefaultToggleParams(e,t,s){const i=this.chartOptionsProxy.getValue(e),r={label:this.chartTranslation.translate(t),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:i,readOnly:s?.readOnly,passive:s?.passive};return r.onValueChange=o=>{this.chartOptionsProxy.setValue(e,typeof o=="boolean"?o:void 0)},r}getDefaultSelectParams(e,t,s){return this.getDefaultSelectParamsWithoutValueParams(t,s,this.chartOptionsProxy.getValue(e),i=>{this.chartOptionsProxy.setValue(e,i)})}getDefaultSelectParamsWithoutValueParams(e,t,s,i){return{label:this.chartTranslation.translate(e),labelAlignment:"top",options:t,pickerGap:6,value:s,onValueChange:i}}getDefaultFontPanelParams(e,t){const s=i=>`${e}.${i}`;return this.addEnableParams(s("enabled"),{name:this.chartTranslation.translate(t),suppressEnabledCheckbox:!1,chartMenuParamsFactory:this,keyMapper:s})}addValueParams(e,t,s){const i=this.chartOptionsProxy.getValue(e);return t.value=s?.formatInputValue?s.formatInputValue(i):i,t.onValueChange=r=>{const o=s?.parseInputValue?s.parseInputValue(r):r;this.chartOptionsProxy.setValue(e,o)},t}addEnableParams(e,t){return t.enabled=this.chartOptionsProxy.getValue(e)??!1,t.onEnableChange=s=>this.chartOptionsProxy.setValue(e,s),t}getChartOptions(){return this.chartOptionsProxy}},pY=class extends A{constructor(e,t){super(),this.chartMenuContext=e,this.isOpen=t,this.chartSpecificGroup=x,this.hasContent=!1}wireBeans(e){this.chartTranslation=e.chartTranslation,this.chartSvc=e.chartSvc}postConstruct(){const t={title:this.getTitle(),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen,items:[...this.createDirectionSelect(),this.createReverseSelect(),this.createGroupTypeSelect()]};this.setTemplate(`
`,[Se],{chartSpecificGroup:t}),this.setDisplayed(this.hasContent)}refresh(){this.hasContent=!1,this.chartSpecificGroup.setTitle(this.getTitle()),this.updateDirectionSelect(),this.updateReverseSelect(),this.updateGroupTypeSelect(),this.setDisplayed(this.hasContent)}getTitle(){const e=this.chartMenuContext.chartController.getChartType();return this.chartTranslation.translate(If(e))}createDirectionSelect(){if(!this.chartSvc.isEnterprise())return[];const{chartOptionsService:e,chartController:t}=this.chartMenuContext,s=e.getSeriesOptionsProxy(()=>ye(t.getChartType())),i=this.createManagedBean(new qr(s)),r=["horizontal","vertical"].map(a=>({value:a,text:this.chartTranslation.translate(a)})),o=i.getDefaultSelectParams("direction","direction",r),n=o.onValueChange;return o.onValueChange=a=>{n(a),t.raiseChartModelUpdateEvent()},this.directionSelect=this.createManagedBean(new Ct(o)),this.updateDirectionSelect(),[this.directionSelect]}createReverseSelect(){const{chartMenuParamsFactory:e}=this.chartMenuContext,t=e.getDefaultToggleParams("series.reverse","reverse");return this.reverseToggle=this.createManagedBean(new Vr(t)),this.updateReverseSelect(),this.reverseToggle}updateReverseSelect(){const e=this.chartMenuContext.chartController.getChartType()==="pyramid";this.updateDisplayed(this.reverseToggle,e)}updateDirectionSelect(){const e=$j(this.chartMenuContext.chartController.getChartType());this.updateDisplayed(this.directionSelect,e)}createGroupTypeSelect(){const{chartController:e,chartMenuParamsFactory:t}=this.chartMenuContext;return this.groupTypeSelect=this.createManagedBean(new Ct(t.getDefaultSelectParamsWithoutValueParams("seriesGroupType",Vj.map(s=>({value:s,text:this.chartTranslation.translate(`${s}SeriesGroupType`)})),e.getSeriesGroupType(),s=>e.setSeriesGroupType(s)))),this.updateGroupTypeSelect(),this.groupTypeSelect}updateGroupTypeSelect(){const e=["radialColumn","radialBar","nightingale"].includes(this.chartMenuContext.chartController.getChartType());this.updateDisplayed(this.groupTypeSelect,e)}updateDisplayed(e,t){e?.setDisplayed(t),e&&(this.hasContent=this.hasContent||t)}},fY=class extends A{constructor(e,t,s){super('
'),this.chartController=e,this.columns=t,this.isOpen=s,this.selectedColIds=[],this.chartTypeComps=new Map,this.secondaryAxisComps=new Map}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.createSeriesChartTypeGroup(this.columns)}refresh(e){be(this.getValidColIds(e),this.selectedColIds)?this.refreshComps():this.recreate(e)}recreate(e){this.isOpen=this.seriesChartTypeGroupComp.isExpanded(),ee(this.getGui()),this.destroyBean(this.seriesChartTypeGroupComp),this.columns=e,this.selectedColIds=[],this.clearComps(),this.postConstruct()}getValidColIds(e){const t=this.chartController.getSeriesChartTypes();return e.filter(s=>s.selected&&!!t.filter(i=>i.colId===s.colId)[0]).map(({colId:s})=>s)}createSeriesChartTypeGroup(e){this.seriesChartTypeGroupComp=this.createBean(new qs({title:this.chartTranslation.translate("seriesChartType"),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen}));const t=this.chartController.getSeriesChartTypes();for(const s of e){if(!s.selected)continue;const i=t.filter(c=>c.colId===s.colId)[0];if(!i)continue;this.selectedColIds.push(s.colId);const r=this.seriesChartTypeGroupComp.createManagedBean(new qs({title:s.displayName,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-format-sub-level"})),o=c=>["groupedColumn","stackedColumn","stackedArea"].includes(c),n=this.seriesChartTypeGroupComp.createManagedBean(new Vi({label:this.chartTranslation.translate("secondaryAxis"),labelWidth:"flex",disabled:o(i.chartType),value:!!i.secondaryAxis,onValueChange:c=>this.chartController.updateSeriesChartType(s.colId,void 0,c)}));r.addItem(n);const a=["line","area","stackedArea","groupedColumn","stackedColumn"].map(c=>({value:c,text:this.chartTranslation.translate(If(c))})),l=r.createManagedBean(new Ct({options:a,value:i.chartType,onValueChange:c=>this.chartController.updateSeriesChartType(s.colId,c)}));r.addItem(l),this.seriesChartTypeGroupComp.addItem(r),this.chartTypeComps.set(s.colId,l),this.secondaryAxisComps.set(s.colId,n)}this.getGui().appendChild(this.seriesChartTypeGroupComp.getGui())}refreshComps(){const e=this.chartController.getSeriesChartTypes();for(const t of this.selectedColIds){const s=e.find(o=>o.colId===t);if(!s)continue;const i=this.chartTypeComps.get(t),r=this.secondaryAxisComps.get(t);i?.setValue(s.chartType),r?.setValue(!!s.secondaryAxis),r?.setDisabled(this.isSecondaryAxisDisabled(s.chartType))}}clearComps(){this.chartTypeComps.clear(),this.secondaryAxisComps.clear()}isSecondaryAxisDisabled(e){return["groupedColumn","stackedColumn","stackedArea"].includes(e)}destroy(){this.clearComps(),this.seriesChartTypeGroupComp=this.destroyBean(this.seriesChartTypeGroupComp),super.destroy()}},mY=class extends aR{constructor(e,t,s,i,r,o,n){super(e,i,r,'
'),this.chartOptionsService=t,this.title=s,this.valueCols=o,this.isOpen=n}postConstruct(){if(this.groupComp=this.createBean(new qs({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.chartController.isActiveXYChart()){const e=this.groupComp.createManagedBean(new Vr({label:this.chartTranslation.translate("paired"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.chartOptionsService.getPairedMode(),onValueChange:t=>{this.chartOptionsService.setPairedMode(!!t),this.chartController.updateForGridChange({maintainColState:!0})}}));this.groupComp.addItem(e)}this.createGroup(this.valueCols,this.generateGetSeriesLabel(this.valueCols),"seriesAdd","seriesSelect"),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){this.valuePillSelect?.setValueFormatter(this.generateGetSeriesLabel(e)),this.valuePillSelect?.setValues(e,e.filter(t=>t.selected)),this.refreshValueSelect(e)}generateGetSeriesLabel(e){if(!this.chartController.isActiveXYChart())return o=>o.displayName??"";const t=e.filter(o=>o.selected),s=this.chartController.getChartType()==="bubble",i=this.chartOptionsService.getPairedMode(),r=new Map;return r.set(0,"X"),r.set(1,"Y"),r.set(2,"size"),o=>{const n=o.displayName??"";if(!o.selected)return n;const a=t.indexOf(o);if(a===-1)return n;let l;return i?l=r.get(a%(s?3:2)):a===0?l="X":l=s&&a%2===0?"size":"Y",`${n} (${l})`}}destroy(){this.groupComp=this.destroyBean(this.groupComp),super.destroy()}},CY={groups:[{type:"categories",isOpen:!0},{type:"series",isOpen:!0},{type:"seriesChartType",isOpen:!0},{type:"chartSpecific",isOpen:!0}]},vY=class extends A{constructor(e){super('
'),this.chartMenuContext=e,this.isSwitchCategorySeriesToggled=!1,this.restoreSwitchCategorySeriesToggleFocus=!1,this.panels=[],this.chartController=e.chartController}wireBeans(e){this.chartTranslation=e.chartTranslation,this.chartSvc=e.chartSvc}postConstruct(){this.createSwitchCategorySeriesToggle(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched(),this.updatePanels();const e=this.updatePanels.bind(this);this.addManagedListeners(this.chartController,{chartModelUpdate:e,chartApiUpdate:e})}destroy(){this.clearPanelComponents(),super.destroy()}updatePanels(){const e=this.chartType,t=this.isSwitchCategorySeriesToggled,{dimensionCols:s,valueCols:i}=this.chartController.getColStateForMenu();this.chartType=this.chartController.getChartType(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched();const r=this.isSwitchCategorySeriesToggled!==t;this.canRefresh(e,this.chartType)&&!r?(this.categoriesDataPanel?.refresh(s),this.seriesDataPanel?.refresh(i),this.seriesChartTypePanel?.refresh(i),this.chartSpecificPanel?.refresh()):this.recreatePanels(s,i);const o=jx(this.chartType)&&this.chartSvc.isEnterprise()&&!this.chartController.isGrouping();V(this.switchCategorySeriesToggle.getGui(),o),r&&this.switchCategorySeriesToggle?.setValue(this.chartController.isCategorySeriesSwitched()),this.restoreSwitchCategorySeriesToggleFocus&&(this.restoreSwitchCategorySeriesToggleFocus=!1,o&&this.switchCategorySeriesToggle.getFocusableElement().focus())}canRefresh(e,t){if(e===void 0)return!1;if(e===t)return!0;const s=i=>["columnLineCombo","areaColumnCombo","customCombo"].includes(i);return!!(s(e)&&s(t))}recreatePanels(e,t){this.clearPanelComponents();const{chartType:s}=this;if(!s)return;const i=this.chartController.isCategorySeriesSwitched();this.getDataPanelDef().groups?.forEach(({type:r,isOpen:o})=>{r===(i?"series":"categories")?(this.categoriesDataPanel=this.createBean(new gY(this.chartController,this.getCategoryGroupTitle(i),this.getCategoryGroupMultipleSelect(s,i),e,o)),this.panels.push(this.categoriesDataPanel)):r===(i?"categories":"series")?(this.seriesDataPanel=this.createBean(new mY(this.chartController,this.chartMenuContext.chartOptionsService,this.getSeriesGroupTitle(i),this.getSeriesGroupMultipleSelect(s,i),this.getSeriesGroupMaxSelection(s,i),t,o)),this.panels.push(this.seriesDataPanel)):r==="seriesChartType"?this.chartController.isComboChart()&&(this.seriesChartTypePanel=this.createBean(new fY(this.chartController,t,o)),this.panels.push(this.seriesChartTypePanel)):r==="chartSpecific"?(this.chartSpecificPanel=this.createBean(new pY(this.chartMenuContext,o)),this.panels.push(this.chartSpecificPanel)):F(144,{type:r})}),(i?this.categoriesDataPanel:this.seriesDataPanel)?.addItem(this.switchCategorySeriesToggle.getGui()),this.addPanelComponents()}addPanelComponents(){if(!this.panels.length)return;const t=me(this.beans).createDocumentFragment();for(const s of this.panels)s.addCss("ag-chart-data-section"),t.appendChild(s.getGui());this.getGui().appendChild(t)}clearPanelComponents(){for(const e of this.panels)e.getGui().remove(),this.destroyBean(e);this.panels=[]}getDataPanelDef(){return this.gos.get("chartToolPanelsDef")?.dataPanel??CY}getCategoryGroupTitle(e){return e?this.chartTranslation.translate("seriesLabels"):this.chartTranslation.translate(this.chartController.isActiveXYChart()?"labels":"categories")}getCategoryGroupMultipleSelect(e,t){return t?!1:Af(e)!==1}getSeriesGroupTitle(e){return e?this.chartTranslation.translate("categoryValues"):this.chartTranslation.translate(this.chartController.isActiveXYChart()?"xyValues":"series")}getSeriesGroupMultipleSelect(e,t){return this.getSeriesGroupMaxSelection(e,t)!==1}getSeriesGroupMaxSelection(e,t){if(!t)return Ed(e)}createSwitchCategorySeriesToggle(){this.switchCategorySeriesToggle=this.createManagedBean(new Vr({label:this.chartTranslation.translate("switchCategorySeries"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.chartController.isCategorySeriesSwitched(),onValueChange:e=>{this.restoreSwitchCategorySeriesToggleFocus=!0,this.chartController.switchCategorySeries(e)}}))}},wY=class extends Kl{constructor(e){super(e,`
`,[la]),this.eLabel=x,this.eParentCircle=x,this.eChildCircle=x,this.eAngleValue=x,this.radius=0,this.offsetX=0,this.offsetY=0}wireBeans(e){this.dragSvc=e.dragSvc}postConstruct(){super.postConstruct();const{value:e,onValueChange:t}=this.config;e!=null&&this.setValue(e,void 0,!0),t!=null&&this.onValueChange(t),this.dragListener={eElement:this.eParentCircle,dragStartPixels:0,onDragStart:()=>{this.parentCircleRect=this.eParentCircle.getBoundingClientRect()},onDragging:s=>this.calculateAngleDrag(s),onDragStop:()=>{}},this.dragSvc?.addDragSource(this.dragListener),this.eAngleValue.setLabel("").setLabelWidth(5).setInputWidth(45).setMin(0).setMax(360).setValue(`${this.degrees}`).onValueChange(s=>{(s==null||s==="")&&(s="0"),s=this.eAngleValue.normalizeValue(s);let i=parseFloat(s);i>180&&(i=i-360),this.setValue(i)}),this.updateNumberInput(),D(this.getValue())&&this.eAngleValue.setValue(this.normalizeNegativeValue(this.getValue()).toString()),this.addManagedListeners(this,{fieldValueChanged:()=>{this.eAngleValue.getInputElement().contains(ie(this.beans))||this.updateNumberInput()}})}updateNumberInput(){const e=this.normalizeNegativeValue(this.getValue());this.eAngleValue.setValue(e.toString())}positionChildCircle(e){const t=this.parentCircleRect||{width:24,height:24},s=this.eChildCircle,i=t.width/2,r=t.height/2;s.style.left=`${i+Math.cos(e)*8}px`,s.style.top=`${r+Math.sin(e)*8}px`}calculatePolar(){const e=this.offsetX,t=this.offsetY,s=Math.atan2(t,e);this.degrees=this.toDegrees(s),this.radius=Math.sqrt(e*e+t*t),this.positionChildCircle(s)}calculateCartesian(){const e=this.toRadians(this.getValue()),t=this.getRadius();this.setOffsetX(Math.cos(e)*t).setOffsetY(Math.sin(e)*t)}setOffsetX(e){return this.offsetX!==e&&(this.offsetX=e,this.calculatePolar()),this}setOffsetY(e){return this.offsetY!==e&&(this.offsetY=e,this.calculatePolar()),this}calculateAngleDrag(e){const t=this.parentCircleRect,s=t.width/2,i=t.height/2,r=e.clientX-t.left,o=e.clientY-t.top,n=r-s,a=o-i,l=Math.atan2(a,n);this.setValue(l,!0)}toDegrees(e){return e/Math.PI*180}toRadians(e){return e/180*Math.PI}normalizeNegativeValue(e){return e<0?360+e:e}normalizeAngle180(e){return e%=Math.PI*2,e<-Math.PI?e+=Math.PI*2:e>=Math.PI&&(e-=Math.PI*2),e}getRadius(){return this.radius}setRadius(e){return this.radius===e?this:(this.radius=e,this.calculateCartesian(),this)}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>{e(this.degrees)}}),this}getValue(e){return e?this.toRadians(this.degrees):this.degrees}setValue(e,t,s){let i;return t?i=e:i=this.normalizeAngle180(this.toRadians(e)),e=this.toDegrees(i),this.degrees!==e&&(this.degrees=Math.floor(e),this.calculateCartesian(),this.positionChildCircle(i),s||this.dispatchLocalEvent({type:"fieldValueChanged"})),this}setWidth(e){return ts(this.getGui(),e),this}setDisabled(e){return super.setDisabled(e),this.eAngleValue.setDisabled(e),this}destroy(){this.dragSvc?.removeDragSource(this.dragListener),super.destroy()}};function bY(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}var ar=class extends A{constructor(e){super(),this.params=e,this.fontGroup=x,this.activeComps=[],this.chartOptions=e.chartMenuParamsFactory.getChartOptions()}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{cssIdentifier:e="charts-format-sub-level",name:t,enabled:s,onEnableChange:i,suppressEnabledCheckbox:r,chartMenuParamsFactory:o,keyMapper:n}=this.params,a={cssIdentifier:e,direction:"vertical",suppressOpenCloseIcons:!0,title:t,enabled:s,suppressEnabledCheckbox:!0,onEnableChange:l=>{i&&i(l)},useToggle:!r};this.setTemplate(`
`,[Se,Wi,Js],{fontGroup:a,familySelect:this.getFamilySelectParams(),weightStyleSelect:this.getWeightStyleSelectParams(),sizeSelect:this.getSizeSelectParams(),colorPicker:o.getDefaultColorPickerParams(n("color"))}),this.toggleCss("ag-font-panel-no-header",!t)}addItem(e,t){t?this.fontGroup.prependItem(e):this.fontGroup.addItem(e),this.activeComps.push(e)}setEnabled(e){this.fontGroup.setEnabled(e)}getFamilySelectParams(){const e=["Arial, sans-serif","Aria Black, sans-serif","Book Antiqua, serif","Charcoal, sans-serif","Comic Sans MS, cursive","Courier, monospace","Courier New, monospace","Gadget, sans-serif","Geneva, sans-serif","Helvetica, sans-serif","Impact, sans-serif","Lucida Console, monospace","Lucida Grande, sans-serif","Lucida Sans Unicode, sans-serif","Monaco, monospace","Palatino Linotype, serif","Palatino, serif","Times New Roman, serif","Times, serif","Verdana, sans-serif"],t=this.getInitialFontValue("fontFamily");let s=e[0];if(t){const o=e.map(n=>n.toLowerCase()).indexOf(t.toLowerCase());if(o>=0)s=e[o];else{const n=bY(t);e.push(n),s=n}}const i=e.sort().map(r=>({value:r,text:r}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams("font",i,`${s}`,r=>this.setFont({fontFamily:r}))}getSizeSelectParams(){const e=[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36],t=this.getInitialFontValue("fontSize");e.includes(t)||e.push(t);const s=e.sort((i,r)=>i-r).map(i=>({value:`${i}`,text:`${i}`}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams("size",s,`${t}`,i=>this.setFont({fontSize:parseInt(i,10)}))}getWeightStyleSelectParams(){const e=this.getInitialFontValue("fontWeight")??"normal",t=this.getInitialFontValue("fontStyle")??"normal",s=[{name:"normal",weight:"normal",style:"normal"},{name:"bold",weight:"bold",style:"normal"},{name:"italic",weight:"normal",style:"italic"},{name:"boldItalic",weight:"bold",style:"italic"}];let i=s.find(o=>o.weight===e&&o.style===t);i||(i={name:"predefined",weight:e,style:t},s.unshift(i));const r=s.map(o=>({value:o.name,text:this.chartTranslation.translate(o.name)}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams("weight",r,i.name,o=>{const n=s.find(a=>a.name===o);this.setFont({fontWeight:n.weight,fontStyle:n.style})})}destroyActiveComps(){for(const e of this.activeComps)ue(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActiveComps(),super.destroy()}setFont(e){const{keyMapper:t}=this.params;for(const s of Object.keys(e)){const i=e[s];i&&this.chartOptions.setValue(t(s),i)}}getInitialFontValue(e){const{keyMapper:t}=this.params;return this.chartOptions.getValue(t(e))}},SY=class extends A{constructor(e){super(),this.chartMenuUtils=e,this.axisTicksSizeSlider=x}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{chartMenuUtils:e}=this,t=e.addEnableParams("tick.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("ticks"),suppressEnabledCheckbox:!0,useToggle:!0}),s=e.getDefaultColorPickerParams("tick.stroke"),i=e.getDefaultSliderParams("tick.width","width",10),r=e.getDefaultSliderParams("tick.size","length",30);this.setTemplate(`
`,[Se,Js,Tt],{axisTicksGroup:t,axisTicksColorPicker:s,axisTicksWidthSlider:i,axisTicksSizeSlider:r})}setTickSizeSliderDisplayed(e){this.axisTicksSizeSlider.setDisplayed(e)}},yY=class extends A{constructor(e){super(),this.chartMenuUtils=e,this.chartOptions=e.getChartOptions()}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuUtils.addEnableParams("gridLine.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("gridLines"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.getGridLineColorPickerParams("color"),s=this.getGridLineWidthSliderParams("thickness"),i=this.getGridLineDashSliderParams("lineDash");this.setTemplate(`
`,[Se,Js,Tt],{gridLineGroup:e,gridLineColorPicker:t,gridLineWidthSlider:s,gridLineLineDashSlider:i})}getGridLineColorPickerParams(e){return this.chartMenuUtils.getDefaultColorPickerParams("gridLine.style",e,{formatInputValue:t=>t?.[0]?.stroke,parseInputValue:t=>{const s=this.chartOptions.getValue("gridLine.style")??[];return s.length===0?[{stroke:t,lineDash:[]}]:[{...s[0],stroke:t}]}})}getGridLineWidthSliderParams(e){return this.chartMenuUtils.getDefaultSliderParams("gridLine.width",e,10)}getGridLineDashSliderParams(e){const s=this.chartOptions.getValue("gridLine.style")?.[0]?.lineDash?.[0],i=this.chartMenuUtils.getDefaultSliderParamsWithoutValueParams(s??0,e,30);return i.onValueChange=r=>{const o=this.chartOptions.getValue("gridLine.style.0.stroke");this.chartOptions.setValue("gridLine.style",[{lineDash:[r],stroke:o}])},i}},xY="%d %B %Y",Dd=class extends A{constructor(e,t){super(),this.axisType=e,this.options=t,this.axisGroup=x,this.axisTypeSelect=x,this.axisPositionSelect=x,this.axisTimeFormatSelect=x,this.activePanels=[],this.updateFuncs=[];const{chartOptionsService:s,seriesType:i,chartController:r}=t;this.chartOptionsService=s,this.chartController=r,this.chartOptionsSeriesProxy=s.getSeriesOptionsProxy(()=>i)}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{isExpandedOnInit:e,chartOptionsService:t,registerGroupComponent:s}=this.options,i=this.axisType,r={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate(i),expanded:e,suppressEnabledCheckbox:!0},o=t.getCartesianAxisOptionsProxy(this.axisType),n=this.createManagedBean(new qr(o)),a=this.createManagedBean(new qr(t.getCartesianAxisThemeOverridesProxy(this.axisType))),l=this.getAxisTypeSelectParams(n,t.getCartesianAxisAppliedThemeOverridesProxy(this.axisType)),c=this.getAxisPositionSelectParams(n),d=this.getAxisTimeFormatSelectParams(n),u=this.getAxisColorInputParams(a),h=this.getAxisLineWidthSliderParams(a);this.setTemplate(`
`,[Se,Wi,Js,Tt],{axisGroup:r,axisTypeSelect:l??void 0,axisPositionSelect:c??void 0,axisTimeFormatSelect:d??void 0,axisColorInput:u,axisLineWidthSlider:h}),s(this.axisGroup),this.axisTypeSelect.setDisplayed(!!l.options?.length),c||this.removeTemplateComponent(this.axisPositionSelect);const g=()=>{const f=o.getValue("type")==="time";V(this.axisTimeFormatSelect.getGui(),f)};d?(g(),this.addManagedEventListeners({chartOptionsChanged:()=>{g()}})):this.removeTemplateComponent(this.axisTimeFormatSelect),this.initGridLines(a),this.initAxisTicks(a),this.initAxisLabels(a);const p=()=>{for(const f of this.updateFuncs)f()};this.addManagedListeners(this.chartController,{chartUpdated:p,chartModelUpdate:()=>setTimeout(()=>{this.isAlive()&&(this.refreshAxisTypeSelect(n),g())})})}getAxisTypeSelectParams(e,t){const s=e.getChartOptions(),i=this.getAxisTypeSelectOptions(),r=e.getDefaultSelectParams("type","axisType",i);return r.onValueChange=o=>{const n=s.getValue("type");if(o===n)return;const a=t.getValue("*"),l=n==="time",c=o==="time",d=l!==c?c?xY:void 0:null;d===void 0&&s.clearValue?.("label","format"),this.chartOptionsService.setCartesianCategoryAxisType(this.axisType,o),d!=null&&s.setValue("label.format",d),t.setValue("*",a)},r}refreshAxisTypeSelect(e){const t=this.getAxisTypeSelectOptions(),s=!!t.length;this.axisTypeSelect.setDisplayed(s),s&&this.axisTypeSelect.clearOptions().addOptions(t).setValue(e.getChartOptions().getValue("type"))}getAxisTypeSelectOptions(){const e=this.chartController,t=e.getChartType(),s=()=>{const i=e.getChartData()[0];return i?e.getSelectedDimensions().every(r=>!isNaN(parseFloat(i[r.colId]))):!1};return["heatmap","histogram","boxPlot","rangeBar","scatter","bubble"].includes(t)||e.isGrouping()||!this.isCategoryAxis()||e.isCategorySeriesSwitched()||!s()?[]:["category","number","time"].map(i=>({value:i,text:this.translate(i)}))}isCategoryAxis(){const e=this.chartOptionsSeriesProxy.getValue("direction")==="horizontal";return e&&this.axisType==="yAxis"||!e&&this.axisType==="xAxis"}getAxisPositionSelectParams(e){const t=((s,i)=>{if(s==="heatmap")return null;if(i==="xAxis")return[{value:"top",text:this.translate("top")},{value:"bottom",text:this.translate("bottom")}];if(i==="yAxis")return[{value:"left",text:this.translate("left")},{value:"right",text:this.translate("right")}]})(this.chartController.getChartType(),this.axisType);return t?e.getDefaultSelectParams("position","position",t):null}getAxisTimeFormatSelectParams(e){if(!this.isCategoryAxis())return null;const t=[{value:"%d/%m/%Y",text:this.translate("timeFormatSlashesDDMMYYYY")},{value:"%m/%d/%Y",text:this.translate("timeFormatSlashesMMDDYYYY")},{value:"%d/%m/%y",text:this.translate("timeFormatSlashesDDMMYY")},{value:"%m/%d/%y",text:this.translate("timeFormatSlashesMMDDYY")},{value:"%d.%e.%y",text:this.translate("timeFormatDotsDDMYY")},{value:"%e.%d.%y",text:this.translate("timeFormatDotsMDDYY")},{value:"%Y-%m-%d",text:this.translate("timeFormatDashesYYYYMMDD")},{value:"%d %B %Y",text:this.translate("timeFormatSpacesDDMMMMYYYY")},{value:"%H:%M:%S",text:this.translate("timeFormatHHMMSS")},{value:"%I:%M:%S %p",text:this.translate("timeFormatHHMMSSAmPm")}];return e.getDefaultSelectParams("label.format","timeFormat",t)}getAxisColorInputParams(e){return e.getDefaultColorPickerParams("line.stroke")}getAxisLineWidthSliderParams(e){const t=e.getChartOptions(),s=()=>t.getValue("line.enabled")?t.getValue("line.width"):null,i=o=>{t.setValues([{expression:"line.enabled",value:o!=null},{expression:"line.width",value:o??0}])},r=e.getDefaultSliderParamsWithoutValueParams(s()??0,"thickness",10);return r.onValueChange=o=>{i(o===0?null:o)},r}initGridLines(e){if(this.chartController.getChartType()==="heatmap")return;const s=this.createBean(new yY(e));this.axisGroup.addItem(s),this.activePanels.push(s)}initAxisTicks(e){if(!this.hasConfigurableAxisTicks())return;const t=this.createBean(new SY(e));this.axisGroup.addItem(t),this.activePanels.push(t);const s=()=>t.setTickSizeSliderDisplayed(this.isGroupedCategoryAxis());this.updateFuncs.push(s),s()}hasConfigurableAxisTicks(){switch(this.chartController.getChartType()){case"radarLine":case"radarArea":case"rangeBar":case"boxPlot":case"waterfall":return!1;default:return!0}}initAxisLabels(e){const t={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:e,keyMapper:i=>`label.${i}`},s=this.createBean(new ar(t));this.axisGroup.addItem(s),this.activePanels.push(s),this.addAdditionalLabelComps(s,e)}addAdditionalLabelComps(e,t){this.addLabelPadding(e,t);const s=this.createRotationWidget("labelRotation",t),i=this.initLabelRotation(s,t);e.addItem(i),e.addItem(s)}initLabelRotation(e,t){const s=t.getChartOptions(),i=()=>s.getValue("label.rotation"),r=()=>s.getValue("label.autoRotate"),o=d=>{d&&(this.prevRotation=i()),s.setValues([{expression:"label.autoRotate",value:d},{expression:"label.rotation",value:d?void 0:this.prevRotation}]),e.setDisplayed(!d)},a=typeof i()=="number"?!1:r(),l=this.createBean(new Vi({label:this.translate("autoRotate"),value:a,onValueChange:o}));e.setDisplayed(!a);const c=()=>l.setDisplayed(this.isGroupedCategoryAxis());return this.updateFuncs.push(c),c(),l}createRotationWidget(e,t){const s=t.getChartOptions(),i=()=>s.getValue("label.rotation"),r=l=>s.setValue("label.rotation",l),n=`${this.chartTranslation.translate(e)} \xB0`,a=new wY({label:n,labelWidth:"flex",value:i()??0,onValueChange:r});return this.updateFuncs.push(()=>{a.setValue(i()??0)}),this.createBean(a)}isGroupedCategoryAxis(){return this.chartOptionsService.getCartesianAxisOptionsProxy(this.axisType).getValue("type")==="grouped-category"?!this.isCategoryAxis():!0}addLabelPadding(e,t){const s=this.createBean(new Nt(t.getDefaultSliderParams("label.spacing","padding",30)));e.addItem(s)}translate(e){return this.chartTranslation.translate(e)}removeTemplateComponent(e){ue(e.getGui()),this.destroyBean(e)}destroyActivePanels(){for(const e of this.activePanels)ue(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActivePanels(),super.destroy()}},RY=class extends A{constructor(e){super(),this.options=e,this.axisGroup=x}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{isExpandedOnInit:e,chartAxisMenuParamsFactory:t,registerGroupComponent:s}=this.options,i={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("polarAxis"),expanded:e,suppressEnabledCheckbox:!0},r=t.getDefaultColorPickerParams("line.stroke"),o=t.getDefaultSliderParams("line.width","thickness",10);this.setTemplate(`
`,[Se,Js,Tt],{axisGroup:i,axisColorInput:r,axisLineWidthSlider:o}),s(this.axisGroup),this.initAxis(),this.initAxisLabels(),this.initRadiusAxis()}initAxis(){const e=this.options.chartController.getChartType();if(["radarLine","radarArea"].includes(e)){const s=[{value:"circle",text:this.translate("circle")},{value:"polygon",text:this.translate("polygon")}];this.axisGroup.addItem(this.createSelect({labelKey:"shape",options:s,property:"shape"}))}e!=="pie"&&this.axisGroup.addItem(this.createSlider({labelKey:"innerRadius",defaultMaxValue:1,property:"innerRadiusRatio"}))}initAxisLabels(){const e={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:this.options.chartAxisMenuParamsFactory,keyMapper:i=>`label.${i}`},t=this.createManagedBean(new ar(e)),s=this.createOrientationWidget();t.addItem(s),this.axisGroup.addItem(t)}createOrientationWidget(){const e=[{value:"fixed",text:this.translate("fixed")},{value:"parallel",text:this.translate("parallel")},{value:"perpendicular",text:this.translate("perpendicular")}];return this.createSelect({labelKey:"orientation",options:e,property:"label.orientation"})}initRadiusAxis(){const e=ye(this.options.chartController.getChartType());if(!_j(e))return;const t=[this.createSlider({labelKey:"groupPadding",defaultMaxValue:1,property:"paddingInner"}),this.createSlider({labelKey:"seriesPadding",defaultMaxValue:1,property:"groupPaddingInner"})],s=this.createManagedBean(new qs({cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,enabled:!0,suppressEnabledCheckbox:!0,title:this.translate("padding"),items:t})).hideEnabledCheckbox(!0).hideOpenCloseIcons(!0);this.axisGroup.addItem(s)}createSlider(e){const{labelKey:t,defaultMaxValue:s,step:i=.05,property:r}=e,o=this.options.chartAxisMenuParamsFactory.getDefaultSliderParams(r,t,s);return o.step=i,this.createManagedBean(new Nt(o))}createSelect(e){const{labelKey:t,options:s,property:i}=e;return this.createManagedBean(new Ct(this.options.chartAxisMenuParamsFactory.getDefaultSelectParams(i,t,s)))}translate(e){return this.chartTranslation.translate(e)}},FY=class extends A{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuUtils.addEnableParams("background.visible",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("background"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuUtils.getDefaultColorPickerParams("background.fill");this.setTemplate(`
`,[Se,Js],{chartBackgroundGroup:e,colorPicker:t})}},EY=class extends A{constructor(e,t){super(),this.chartMenuUtils=e,this.chartController=t,this.paddingTopSlider=x}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("padding"),suppressEnabledCheckbox:!0},t=s=>this.chartMenuUtils.getDefaultSliderParams("padding."+s,s,200);this.setTemplate(`
`,[Se,Tt],{chartPaddingGroup:e,paddingTopSlider:t("top"),paddingRightSlider:t("right"),paddingBottomSlider:t("bottom"),paddingLeftSlider:t("left")}),this.addManagedEventListeners({chartOptionsChanged:s=>{this.updateTopPadding(s.chartOptions)}})}updateTopPadding(e){const t=[...this.chartController.getChartSeriesTypes(),"common"].map(s=>e?.[s]?.padding?.top).find(s=>s!=null);t!=null&&this.paddingTopSlider.setValue(`${t}`)}},PY=class extends A{constructor(e){super(),this.options=e,this.chartGroup=x}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{chartController:e,chartMenuParamsFactory:t,isExpandedOnInit:s,registerGroupComponent:i}=this.options,r={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslation.translate("chartStyle"),expanded:s,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new EY(t,e)),this.createManagedBean(new FY(t))]};this.setTemplate(`
`,[Se],{chartGroup:r}),i(this.chartGroup)}},MY=class extends E{constructor(e){super(),this.groupContainer=e,this.id=0,this.groupComponents=new Map}addGroupComponent(e){const t=this.id++;this.groupComponents.set(t,e),e.isExpanded()&&(this.expandedGroupComponent=t),e.onExpandedChange(s=>{if(s){const i=this.expandedGroupComponent;if(this.expandedGroupComponent=t,i!=null){const r=e.getGui(),o=r.offsetTop-this.groupContainer.parentElement.scrollTop;this.groupComponents.get(i)?.toggleGroupExpand(!1,!0);let n=r.offsetTop-o;n<0&&(n=0),n!==this.groupContainer.parentElement.scrollTop&&(this.groupContainer.parentElement.scrollTop=n)}}else this.expandedGroupComponent=void 0})}destroy(){this.groupComponents.clear(),super.destroy()}},TY=class extends A{constructor(e,t){super(),this.options=e,this.legendGroup=x,this.enabledGroup=x,this.isGradient=["treemap","sunburst","heatmap"].includes(e.seriesType),this.key=this.isGradient?"gradientLegend":"legend",this.chartController=t.chartController}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{chartMenuParamsFactory:e,isExpandedOnInit:t,registerGroupComponent:s}=this.options,i=this.createManagedBean(new Ct(e.getDefaultSelectParams(`${this.key}.position`,"position",["top","right","bottom","left"].map(n=>({value:n,text:this.chartTranslation.translate(n)})))));this.enabledGroup=this.createManagedBean(new qs(e.addEnableParams(`${this.key}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("legendEnabled"),suppressEnabledCheckbox:!0,useToggle:!0,items:[this.createLabelPanel(e),i,...this.getItems(e)]})));const r={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslation.translate("legend"),suppressEnabledCheckbox:!0,expanded:t,items:[this.enabledGroup]};this.setTemplate(`
`,[Se],{legendGroup:r}),s(this.legendGroup);const o=this.updateLegendEnabledState.bind(this);this.addManagedListeners(this.chartController,{chartModelUpdate:o,chartApiUpdate:o})}updateLegendEnabledState(){const{valueCols:e}=this.chartController.getColStateForMenu();this.enabledGroup.setEnabled(e.filter(t=>t.selected).length>1)}getItems(e){const t=(s,i,r)=>this.createManagedBean(new Nt(e.getDefaultSliderParams(`${this.key}.${s}`,i,r)));return this.isGradient?[this.createManagedBean(new Vi(e.addValueParams("gradientLegend.reverseOrder",{label:this.chartTranslation.translate("reverseDirection"),labelWidth:"flex"}))),t("gradient.thickness","thickness",40),t("gradient.preferredLength","preferredLength",300),t("spacing","spacing",200)]:[t("spacing","spacing",200),t("item.marker.size","markerSize",40),t("item.marker.strokeWidth","markerStroke",10),t("item.marker.padding","itemSpacing",20),t("item.paddingX","layoutHorizontalSpacing",50),t("item.paddingY","layoutVerticalSpacing",50)]}createLabelPanel(e){const t=this.isGradient?"gradientLegend.scale.label":"legend.item.label",s={enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:e,keyMapper:i=>`${t}.${i}`,cssIdentifier:"charts-format-sub-level-no-header"};return this.createManagedBean(new ar(s))}},DY=class extends A{constructor(e){super(),this.params=e,this.toggleableGroup=x,this.activeComps=[],this.chartOptions=e.chartMenuParamsFactory.getChartOptions()}postConstruct(){const{tag:e,cssIdentifier:t="charts-format-sub-level",title:s,suppressEnabledCheckbox:i}=this.params,r=this.params.chartMenuParamsFactory.addEnableParams(`${e}.enabled`,{cssIdentifier:t,direction:"vertical",suppressOpenCloseIcons:!0,title:s,suppressEnabledCheckbox:!0,useToggle:!i});this.setTemplate(`
`,[Se],{toggleableGroup:r}),this.toggleCss("ag-toggleable-group-panel-no-header",!s)}addItem(e,t){t?this.toggleableGroup.prependItem(e):this.toggleableGroup.addItem(e),this.activeComps.push(e)}setEnabled(e){this.toggleableGroup.setEnabled(e)}destroyActiveComps(){for(const e of this.activeComps)ue(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActiveComps(),super.destroy()}},AY=class extends A{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("callout"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
`,[Se,Tt],{calloutGroup:e,calloutLengthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.length","length",40),calloutStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.strokeWidth","strokeWidth",10),labelOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLabel.offset","offset",30)})}},IY=class extends A{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("cap"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0},t=this.chartMenuUtils.getDefaultSliderParams("cap.lengthRatio","capLengthRatio",1);t.step=.05,this.setTemplate(`
`,[Se,Tt],{capsGroup:e,capLengthRatioSlider:t})}},kY=class extends A{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("connectorLine"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
`,[Se,Js,Tt],{lineGroup:e,lineColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("line.stroke"),lineStrokeWidthSlider:this.getSliderParams("strokeWidth",10,"line.strokeWidth"),lineDashSlider:this.getSliderParams("lineDash",30,"line.lineDash",1,!0),lineOpacitySlider:this.getSliderParams("strokeOpacity",1,"line.strokeOpacity",.05)})}getSliderParams(e,t,s,i=1,r=!1){const o=this.chartMenuUtils.getDefaultSliderParams(s,e,t,r);return o.step=i,o}};function lR(e){return["square","circle","cross","diamond","plus","triangle","heart"].map(t=>({value:t,text:e.translate(t)}))}var LY=class extends A{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuUtils.addEnableParams("marker.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("markers"),suppressEnabledCheckbox:!0,useToggle:!0,suppressOpenCloseIcons:!0});this.setTemplate(`
`,[Se,Wi,Tt],{seriesMarkersGroup:e,seriesMarkerShapeSelect:this.chartMenuUtils.getDefaultSelectParams("marker.shape","shape",lR(this.chartTranslation)),seriesMarkerSizeSlider:this.chartMenuUtils.getDefaultSliderParams("marker.size","size",60),seriesMarkerStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams("marker.strokeWidth","strokeWidth",10)})}},GY=class extends A{constructor(e){super(),this.chartMenuUtils=e,this.seriesItemsGroup=x,this.activePanels=[]}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("seriesItems"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
`,[Se,Wi],{seriesItemsGroup:e,seriesItemSelect:this.getSeriesItemsParams()}),this.initSeriesControls()}getSeriesItemsParams(){const e=[{value:"positive",text:this.chartTranslation.translate("seriesItemPositive")},{value:"negative",text:this.chartTranslation.translate("seriesItemNegative")}],t=s=>{this.destroyActivePanels(),this.initSeriesControls(s)};return this.chartMenuUtils.getDefaultSelectParamsWithoutValueParams("seriesItemType",e,"positive",t)}initSeriesControls(e="positive"){this.initSlider("strokeWidth",10,`item.${e}.strokeWidth`),this.initSlider("lineDash",30,`item.${e}.lineDash`,1,!0),this.initSlider("strokeOpacity",1,`item.${e}.strokeOpacity`,.05,!1),this.initSlider("fillOpacity",1,`item.${e}.fillOpacity`,.05,!1),this.initItemLabels(e)}initSlider(e,t,s,i=1,r=!1){const o=this.chartMenuUtils.getDefaultSliderParams(s,e,t,r);o.step=i;const n=this.seriesItemsGroup.createManagedBean(new Nt(o));this.seriesItemsGroup.addItem(n),this.activePanels.push(n)}initItemLabels(e){const t=this.chartMenuUtils.getDefaultFontPanelParams(`item.${e}.label`,"seriesItemLabels"),s=this.createBean(new ar(t));this.seriesItemsGroup.addItem(s),this.activePanels.push(s)}destroyActivePanels(){for(const e of this.activePanels)ue(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActivePanels(),super.destroy()}},OY=class extends A{constructor(e,t="shadow"){super(),this.chartMenuUtils=e,this.propertyKey=t}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.propertyKey,t=this.chartMenuUtils.addEnableParams(`${e}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("shadow"),suppressEnabledCheckbox:!0,useToggle:!0}),s=this.chartMenuUtils.getDefaultColorPickerParams(`${e}.color`);this.setTemplate(`
`,[Se,Js,Tt],{shadowGroup:t,shadowColorPicker:s,shadowBlurSlider:this.getSliderParams("blur",0,20),shadowXOffsetSlider:this.getSliderParams("xOffset",-10,10),shadowYOffsetSlider:this.getSliderParams("yOffset",-10,10)})}getSliderParams(e,t,s){const i=`${this.propertyKey}.${e}`,r=this.chartMenuUtils.getDefaultSliderParams(i,e,s);return r.minValue=t,r}},VY=class extends A{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
`,[Se,Tt],{groupSpacing:{...e,title:this.chartTranslation.translate("group")},tileSpacing:{...e,title:this.chartTranslation.translate("tile")},groupPaddingSlider:this.getSliderParams("padding","group.padding"),groupSpacingSlider:this.getSliderParams("spacing","group.gap"),tilePaddingSlider:this.getSliderParams("padding","tile.padding"),tileSpacingSlider:this.getSliderParams("spacing","tile.gap")})}getSliderParams(e,t){return this.chartMenuUtils.getDefaultSliderParams(t,e,10)}};function BY(e){return e[0].toUpperCase()+e.substring(1)}var NY=class extends A{constructor(e){super(),this.chartMenuUtils=e,this.tooltipMode=x}postConstruct(){const{chartMenuUtils:e,beans:t}=this,s="tooltip",i=t.chartTranslation,r=e.addEnableParams(`${s}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:i.translate("tooltips"),suppressEnabledCheckbox:!0,useToggle:!0}),o="tooltipMode",n=["single","shared","compact"].map(c=>({value:c,text:i.translate(`${o}${BY(c)}`)})),a=`${s}.mode`,l=e.getDefaultSelectParams(a,o,n);this.setTemplate(`
`,[Se,Wi],{tooltipGroup:r,tooltipMode:l}),this.addManagedEventListeners({chartOptionsChanged:()=>{const c=e.getChartOptions().getValue(a);this.tooltipMode.setValue(c,!0)}})}},HY=class extends A{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("whisker"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
`,[Se,Js,Tt],{whiskersGroup:e,whiskerColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("whisker.stroke"),whiskerThicknessSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeWidth","strokeWidth",10),whiskerOpacitySlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeOpacity","strokeOpacity",1),whiskerLineDashSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDash","lineDash",30,!0),whiskerLineDashOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDashOffset","lineDashOffset",30)})}},Te="tooltips",ut="strokeWidth",La="lineWidth",St="lineDash",Ye="lineOpacity",yt="fillOpacity",Ue="labels",fi="shadow",Ad="stageLabels",Ga="markers",zY=class extends A{constructor(e){super(),this.options=e,this.seriesGroup=x,this.activePanels=[],this.widgetFuncs={lineWidth:()=>this.initStrokeWidth(La),[ut]:()=>this.initStrokeWidth("strokeWidth"),lineColor:()=>this.initLineColor(),[St]:()=>this.initLineDash(),[Ye]:()=>this.initOpacity("strokeOpacity"),[yt]:()=>this.initOpacity("fillOpacity"),markers:()=>new LY(this.chartMenuUtils),[Ue]:()=>this.initLabels(),sectorLabels:()=>this.initSectorLabels(),[fi]:()=>new OY(this.chartMenuUtils),[Te]:()=>new NY(this.options.chartMenuParamsFactory),bins:()=>this.initBins(),whiskers:()=>new HY(this.chartMenuUtils),caps:()=>new IY(this.chartMenuUtils),connectorLine:()=>new kY(this.chartMenuUtils),seriesItems:()=>new GY(this.chartMenuUtils),tileSpacing:()=>new VY(this.chartMenuUtils),shape:()=>this.initShape(),size:()=>this.initSize("size","size"),minSize:()=>this.initSize("size","minSize"),maxSize:()=>this.initSize("maxSize","maxSize"),dropoff:()=>this.initDropOff(),stageLabels:()=>this.initStageLabels()},this.seriesWidgetMappings={bar:[Te,ut,St,Ye,yt,Ue,fi],pie:[Te,ut,Ye,yt,Ue,"sectorLabels",fi],donut:[Te,ut,Ye,yt,Ue,"sectorLabels",fi],line:[Te,La,St,Ye,Ga,Ue],scatter:[Te,"shape","size",ut,Ue],bubble:[Te,"shape","minSize","maxSize",ut,Ue],area:[Te,La,St,Ye,yt,Ga,Ue,fi],histogram:[Te,"bins",ut,St,Ye,yt,Ue,fi],"radial-column":[Te,ut,St,Ye,yt,Ue],"radial-bar":[Te,ut,St,Ye,yt,Ue],"radar-line":[Te,ut,St,Ye,Ga,Ue],"radar-area":[Te,ut,St,Ye,yt,Ga,Ue],nightingale:[Te,ut,St,Ye,yt,Ue],"box-plot":[Te,ut,St,Ye,yt,"whiskers","caps"],"range-bar":[Te,ut,St,Ye,yt,Ue],"range-area":[Te,La,St,Ye,yt,Ga,Ue,fi],treemap:[Te,"tileSpacing"],sunburst:[Te],heatmap:[Te,Ue,"lineColor",La,Ye],waterfall:[Te,"connectorLine","seriesItems"],funnel:[Te,ut,St,Ye,yt,Ue,"dropoff",Ad,fi],"cone-funnel":[Te,ut,St,Ye,yt,Ue,Ad],pyramid:[Te,ut,St,Ye,yt,Ue,Ad,fi]},this.seriesType=e.seriesType}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{isExpandedOnInit:e,chartOptionsService:t,chartController:s,registerGroupComponent:i}=this.options,r={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("series"),expanded:e,suppressEnabledCheckbox:!0};this.setTemplate(`
`,[Se],{seriesGroup:r}),i(this.seriesGroup),this.chartMenuUtils=this.createManagedBean(new qr(t.getSeriesOptionsProxy(()=>this.seriesType))),this.addManagedListeners(s,{chartSeriesChartTypeChanged:this.refreshWidgets.bind(this)}),this.refreshWidgets()}refreshWidgets(){const{chartController:e}=this.options;this.destroyActivePanels(),e.getChartProxy().getChart().waitForUpdate().then(()=>{if(this.isAlive()){e.isComboChart()&&(this.updateSeriesType(),this.initSeriesSelect());for(const i of this.seriesWidgetMappings[this.seriesType]??[]){const r=this.widgetFuncs[i]();let o;if(Array.isArray(r)){const n=this.createBean(r[0]);o=n,r[1](n)}else o=this.createBean(r);this.seriesGroup.addItem(o),this.activePanels.push(o)}}}).catch(s=>Q(105,{e:s}))}initSeriesSelect(){const e=this.createBean(new Ct(this.chartMenuUtils.getDefaultSelectParamsWithoutValueParams("seriesType",this.getSeriesSelectOptions(),`${this.seriesType}`,t=>{this.seriesType=t,this.refreshWidgets()})));this.seriesGroup.addItem(e),this.activePanels.push(e)}initLineColor(){return new Jx(this.chartMenuUtils.getDefaultColorPickerParams("stroke","strokeColor"))}initStrokeWidth(e,t){return new Nt(this.chartMenuUtils.getDefaultSliderParams(t?`${t}.${e}`:"strokeWidth",e,10))}initLineDash(e){return new Nt(this.chartMenuUtils.getDefaultSliderParams(e?`${e}.lineDash`:"lineDash","lineDash",30,!0))}initOpacity(e,t){const s=this.chartMenuUtils.getDefaultSliderParams(t?`${t}.${e}`:e,e,1);return s.step=.05,new Nt(s)}initDropOff(){return[new DY({tag:"dropOff",cssIdentifier:"charts-format-sub-level",title:this.translate("dropOff"),suppressEnabledCheckbox:!1,chartMenuParamsFactory:this.chartMenuUtils}),s=>{for(const i of[this.initStrokeWidth("strokeWidth","dropOff"),this.initLineDash("dropOff"),this.initOpacity("strokeOpacity","dropOff"),this.initOpacity("fillOpacity","dropOff")]){const r=s.createManagedBean(i);s.addItem(r),this.activePanels.push(r)}}]}initLabels(){const e=Kx(this.seriesType),t=e?"calloutLabel":"label",s=e?"calloutLabels":"labels",i=this.chartMenuUtils.getDefaultFontPanelParams(t,s);return[new ar(i),n=>{if(e){const a=n.createManagedBean(new AY(this.chartMenuUtils));n.addItem(a),this.activePanels.push(a)}if(this.seriesType==="range-bar"){const a=[{value:"inside",text:this.translate("inside")},{value:"outside",text:this.translate("outside")}],l=n.createManagedBean(new Ct(this.chartMenuUtils.getDefaultSelectParams("label.placement","labelPlacement",a)));n.addItem(l),this.activePanels.push(l);const c=n.createManagedBean(new Nt(this.chartMenuUtils.getDefaultSliderParams("label.padding","padding",200)));n.addItem(c),this.activePanels.push(c)}}]}initSectorLabels(){const e=this.chartMenuUtils.getDefaultFontPanelParams("sectorLabel","sectorLabels");return[new ar(e),i=>{const r=this.chartMenuUtils.getDefaultSliderParams("sectorLabel.positionRatio","positionRatio",1);r.step=.05;const o=i.createManagedBean(new Nt(r));i.addItem(o)}]}initStageLabels(){return new ar(this.chartMenuUtils.getDefaultFontPanelParams("stageLabel",Ad))}initBins(){const e=this.chartMenuUtils.getDefaultSliderParams("binCount","histogramBinCount",20),t=this.chartMenuUtils.getChartOptions(),s=(t.getValue("bins")??t.getValue("calculatedBins",!0)).length;return e.value=`${s}`,e.maxValue=Math.max(s,20),new Nt(e)}initShape(){return new Ct(this.chartMenuUtils.getDefaultSelectParams("shape","shape",lR(this.chartTranslation)))}initSize(e,t){return new Nt(this.chartMenuUtils.getDefaultSliderParams(e,t,60))}getSeriesSelectOptions(){const e=this.getActiveSeriesTypes();return["area","bar","line"].filter(t=>e.includes(t)).map(t=>({value:t,text:this.translate(t)}))}updateSeriesType(){const e=this.getActiveSeriesTypes();!e.includes(this.seriesType)&&e.length>0&&(this.seriesType=e[0])}getActiveSeriesTypes(){return this.options.chartController.getActiveSeriesChartTypes().map(e=>ye(e.chartType))}translate(e){return this.chartTranslation.translate(e)}destroyActivePanels(){for(const e of this.activePanels)ue(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActivePanels(),super.destroy()}},Oa=class extends A{constructor(e,t,s){super("
"),this.chartMenuUtils=e,this.name=t,this.key=s,this.chartOptions=e.getChartOptions()}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.initFontPanel()}hasTitle(){const e=this.chartOptions.getValue(this.key);return e?.enabled&&e.text&&e.text.length>0}initFontPanel(){const e=this.hasTitle(),t={name:this.chartTranslation.translate(this.name),enabled:e,suppressEnabledCheckbox:!1,chartMenuParamsFactory:this.chartMenuUtils,keyMapper:s=>`${this.key}.${s}`,onEnableChange:s=>this.onEnableChange(s)};this.fontPanel=this.createManagedBean(new ar(t)),this.fontPanel.addItem(this.createBean(new ct(this.getTextInputParams())),!0),this.fontPanel.addItem(this.createBean(new Nt(this.getSpacingSliderParams()))),this.getGui().appendChild(this.fontPanel.getGui())}getTextInputParams(){return this.chartMenuUtils.addValueParams(`${this.key}.text`,{label:this.chartTranslation.translate("title"),labelAlignment:"top"})}getSpacingSliderParams(){return this.chartMenuUtils.getDefaultSliderParams(`${this.key}.spacing`,"spacing",100)}onEnableChange(e){this.chartOptions.setValue(`${this.key}.enabled`,e)}},_Y=class extends Oa{wireBeans(e){super.wireBeans(e),this.chartMenuSvc=e.chartMenuSvc}postConstruct(){this.titlePlaceholder=this.chartTranslation.translate("titlePlaceholder"),super.postConstruct(),this.addManagedEventListeners({chartTitleEdit:()=>{this.fontPanel.setEnabled(this.hasTitle())}})}getTextInputParams(){const e=super.getTextInputParams();return this.shouldOverrideTextWithPlaceholder(e.value)&&(e.value=this.titlePlaceholder),e}getSpacingSliderParams(){const e=super.getSpacingSliderParams();return e.value="10",e}onEnableChange(e){if(this.chartMenuSvc.doesChartToolbarExist()){const s=this.chartOptions.getValue("padding.top");this.chartOptions.setValue("padding.top",e?s-20:s+20)}this.chartOptions.setValue(`${this.key}.enabled`,e);const t=this.chartOptions.getValue(`${this.key}.text`);e&&this.shouldOverrideTextWithPlaceholder(t)&&this.chartOptions.setValue(`${this.key}.text`,this.titlePlaceholder)}shouldOverrideTextWithPlaceholder(e){return e==="Title"||e?.trim().length===0}},WY=class extends A{constructor(e){super(),this.options=e,this.titleGroup=x}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{chartMenuParamsFactory:e,chartAxisMenuParamsFactory:t,chartOptionsService:s,seriesType:i,isExpandedOnInit:r=!1,registerGroupComponent:o}=this.options,n=[];if(or(i)&&i!=="pyramid"){const l=c=>this.createManagedBean(new qr(s.getCartesianAxisThemeOverridesProxy(c)));n.push(this.createManagedBean(new Oa(l("xAxis"),"horizontalAxisTitle","title"))),n.push(this.createManagedBean(new Oa(l("yAxis"),"verticalAxisTitle","title")))}else Df(i)&&n.push(this.createManagedBean(new Oa(t,"polarAxisTitle","title")));const a={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslation.translate("chartTitles"),expanded:r,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new _Y(e,"chartTitle","title")),this.createManagedBean(new Oa(e,"chartSubtitle","subtitle")),...n]};this.setTemplate(`
`,[Se],{titleGroup:a}),o(this.titleGroup)}},UY={groups:[{type:"chart"},{type:"titles"},{type:"legend"},{type:"series"},{type:"axis"}]},cR=["axis","horizontalAxis","verticalAxis"],$Y=class extends A{constructor(e){super('
'),this.chartMenuContext=e}postConstruct(){this.groupExpansionFeature=this.createManagedBean(new MY(this.getGui())),this.chartPanelFeature=this.createManagedBean(new Qx(this.chartMenuContext.chartController,this.getGui(),"ag-chart-format-section",(e,t)=>this.createPanels(t))),this.chartPanelFeature.refreshPanels()}createPanels(e){let t=!1;this.getFormatPanelDef().groups?.forEach(({type:s,isOpen:i=!1})=>{if(!this.isGroupPanelShownInSeries(s,e))return;i&&(t&&F(145,{group:s}),t=!0);const r=n=>this.groupExpansionFeature.addGroupComponent(n),o={...this.chartMenuContext,isExpandedOnInit:i,seriesType:e,registerGroupComponent:r};switch(s){case"chart":this.chartPanelFeature.addComponent(new PY(o));break;case"titles":this.chartPanelFeature.addComponent(new WY(o));break;case"legend":this.chartPanelFeature.addComponent(new TY(o,this.chartMenuContext));break;case"axis":Df(e)?this.chartPanelFeature.addComponent(new RY(o)):or(e)&&(this.chartPanelFeature.addComponent(new Dd("xAxis",o)),this.chartPanelFeature.addComponent(new Dd("yAxis",o)));break;case"horizontalAxis":this.chartPanelFeature.addComponent(new Dd("xAxis",o));break;case"verticalAxis":this.chartPanelFeature.addComponent(new Dd("yAxis",o));break;case"series":this.chartPanelFeature.addComponent(new zY(o));break;default:F(147,{group:s})}})}getFormatPanelDef(){const e=this.gos.get("chartToolPanelsDef")?.formatPanel;return e||UY}isGroupPanelShownInSeries(e,t){const s=["chart","titles","legend","series"].includes(e)||or(t)&&cR.includes(e)||Df(t)&&e==="axis",i=Tf(t)&&e==="legend"||Tf(t)&&cR.includes(e);return s&&!i}},KY="ag-chart-mini-thumbnail-canvas",Yr=class extends A{constructor(e,t,s){super(),this.agChartsExports=t,this.tooltipName=s,this.size=58,this.padding=5;const{_Scene:i}=t;this.root=new i.Group;const r=e.ownerDocument.createElement("canvas"),o=new i.Scene({canvasElement:r,pixelRatio:e.ownerDocument.defaultView?.devicePixelRatio??1,width:this.size,height:this.size,willReadFrequently:!1});o.canvas.element.classList.add(KY),o.setRoot(this.root),o.setContainer(e),this.scene=o}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.scene.canvas.element.title=this.chartTranslation.translate(this.tooltipName);try{this.scene.render()}catch(e){Q(108,{e})}}};function Va(e){const{stacked:t,size:s,padding:i,xScalePadding:r,xScaleDomain:o,yScaleDomain:n,agChartsExports:{_Scene:a}}=e,l=new a.CategoryScale;l.domain=o,l.range=[i,s-i],l.paddingInner=r,l.paddingOuter=r;const c=new a.LinearScale;c.domain=n,c.range=[s-i,i];const d=(u,h,g)=>u.map((p,f)=>{const m=g.convert(p),C=new a.Rect;return C.x=h.convert(f),C.y=m,C.width=h.bandwidth,C.height=g.convert(0)-m,C.strokeWidth=0,C.crisp=!0,C});return t?e.data.map(u=>d(u,l,c)):d(e.data,l,c)}function jY(e,t,s,i){const r=[],o=[];for(const l of t)for(const[c,d]of l)r.push(c),o.push(d);const n=new e.LinearScale;n.domain=[Math.min(...r),Math.max(...r)],n.range=[i,s-i];const a=new e.LinearScale;return a.domain=[Math.min(...o),Math.max(...o)],a.range=[s-i,i],{xScale:n,yScale:a}}function dR(e,t,s,i){const r=[0,t[0].length-1],o=t.reduce((l,c)=>{for(const d of c)dl[1]&&(l[1]=d);return l},[1/0,-1/0]);o[0]--,o[o.length-1]++;const n=new e.LinearScale;n.domain=r,n.range=[i,s-i];const a=new e.LinearScale;return a.domain=o,a.range=[s-i,i],{xScale:n,yScale:a}}function uR(e,t,s){return e.map(i=>i.map((r,o)=>[o>0?"lineTo":"moveTo",t.convert(o),s.convert(r)]))}function qY(e,t,s){return e.map(([i,r],o)=>[o>0?"lineTo":"moveTo",t.convert(i),s.convert(r)])}function YY(e){const t=e[0],s=e[1],i=W(e);return(s[1]!==i[1]||s[2]!==i[2])&&e.push([t[0],s[1],s[2]]),e}function hR(e,t){const s=new e.Path;return t.forEach(([i,r,o])=>s.path[i](r,o)),s}function XY(e,t,s){return e.map((i,r,o)=>{const a=[...s?ZY(o,r,t):gR(i,t)].reverse().map(([d,u,h])=>["lineTo",u,h]),l=i[0],c=W(a);return(l[1]!==c[1]||l[2]!==c[2])&&a.push(["lineTo",l[1],l[2]]),[...i,...a]})}function ZY(e,t,s){return t===0?gR(e[t],s):[...e[t-1]]}function gR(e,t){return e.map(([s,i])=>[s,i,t.convert(0)])}function pR(e,t){const s=hR(e,t);return s.fill=void 0,s.lineCap="round",s.strokeWidth=3,s}function QY({_Scene:e},t,s,i,r){const{xScale:o,yScale:n}=jY(e,s,i,r),d=s.map(h=>qY(h,o,n)).map(h=>YY(h)).map(h=>pR(e,h)).reduce((h,g)=>h.concat(g),[]),u=new e.Group;return u.setClipRect(new e.BBox(r,r,i-r*2,i-r*2)),u.append(d),t.append(u),d}function Nf({_Scene:e},t,s,i,r){const{xScale:o,yScale:n}=dR(e,s,i,r),l=uR(s,o,n).map(d=>pR(e,d)),c=new e.Group;return c.setClipRect(new e.BBox(r,r,i-r*2,i-r*2)),c.append(l),t.append(c),l}function JY(e,t,s,i,r,o=!1){const{xScale:n,yScale:a}=dR(e,s,i,r),l=XY(uR(s,n,a),a,o),c=new e.Group;c.setClipRect(new e.BBox(r,r,i-r*2,i-r*2));const d=l.map(u=>hR(e,u));return c.append(d),t.append(c),d}function fR(e){return e.map((t,s,i)=>t.map((r,o)=>i.slice(0,s+1).reduce((n,a)=>n+a[o],0)))}function mR(e){const t=e.map((s,i)=>e.reduce((r,o)=>Math.max(r,o[i]),0));return e.map(s=>s.map((i,r)=>i/t[r]*19))}function CR(e,t,s,i,r,o,n=0){const{_Scene:a}=e,l=new a.LinearScale;l.domain=[0,7],l.range=[-Math.PI,Math.PI].map(p=>p+Math.PI/2);const c=new a.LinearScale;c.domain=[0,10],c.range=[r,o];const d=[],u=i/2,h=s.map(p=>{const f=new a.Path;return f.strokeWidth=1,f.strokeOpacity=.5,f.lineCap="round",f.fill=void 0,f.fillOpacity=.8,p.forEach((m,C)=>{const v=l.convert(C),w=r+o-c.convert(m),S=w*Math.cos(v)+u,y=w*Math.sin(v)+u;if(f.path[C>0?"lineTo":"moveTo"](S,y),n>0){const R=new a.Marker({shape:"circle"});R.x=S,R.y=y,R.size=n,d.push(R)}}),f.path.closePath(),f}),g=new a.Group;return g.append([...h,...d]),t.append(g),{paths:h,markers:d}}function Id(e){let[t,s]=[1/0,-1/0];return{processedData:e.reduce((r,o,n)=>{const a=n>0?r[n-1]:void 0;r[n]??(r[n]=[]);const l=r[n];return o.forEach((c,d)=>{a&&(c+=a[d]),l[d]=c,l[d]s&&(s=l[d])}),r},[]),min:t,max:s}}var eX=[[[13,16],[13,12],[3,12],[3,16]],[[12,11],[12,7],[4,7],[4,11]],[[10.125,6],[10.125,1.5],[5.875,1.5],[5.875,6]]],Hf=class extends Yr{constructor(e,t,s,i,r,o="funnelTooltip",n=eX){super(e,t,o),this.shapes=QY(t,this.root,n,this.size,this.padding),this.updateColors(s,i)}updateColors(e,t){for(const s of this.shapes)s.fill=e[0],s.stroke=t[0],s.strokeWidth=0}},tX={chartType:"funnel",miniChart:Hf},sX=[[[13,16],[10.75,11.5],[5.25,11.5],[3,16]],[[10.75,11.5],[8.875,6],[7.125,6],[5.25,11.5]],[[8.875,6],[8.875,1.5],[7.125,1.5],[7.125,6]]],iX=class extends Hf{constructor(e,t,s,i,r,o="coneFunnelTooltip"){super(e,t,s,i,r,o,sX)}updateColors(e,t){this.shapes.forEach((s,i)=>{s.fill=e[0],s.fillOpacity=1-i*.2,s.stroke=t[0],s.strokeWidth=0})}},rX={chartType:"coneFunnel",miniChart:iX},oX=[[[8,16],[10,12],[6,12]],[[10.5,11],[12.5,7],[3.5,7],[5.5,11]],[[13,6],[15.5,1.5],[.5,1.5],[3,6]]],nX=class extends Hf{constructor(e,t,s,i,r,o="pyramidTooltip"){super(e,t,s,i,r,o,oX)}updateColors(e,t){this.shapes.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i],s.strokeWidth=0})}},aX={chartType:"pyramid",miniChart:nX},At=class extends Yr{constructor(e,t,s){super(e,t,s),this.stroke="gray",this.axisOvershoot=3}postConstruct(){const{_Scene:e}=this.agChartsExports,t=this.size,s=this.padding,i=new e.Line;i.x1=s,i.y1=s,i.x2=s,i.y2=t-s+this.axisOvershoot,i.stroke=this.stroke;const r=new e.Line;r.x1=s-this.axisOvershoot+1,r.y1=t-s,r.x2=t-s+1,r.y2=t-s,r.stroke=this.stroke;const o=this.root;o.append(i),o.append(r),super.postConstruct()}},lX=class extends At{constructor(e,t,s,i){super(e,t,"groupedColumnTooltip"),this.columnData=[2,3,4];const{root:r,columnData:o,size:n,padding:a}=this;this.columns=Va({stacked:!1,root:r,data:o,size:n,padding:a,xScaleDomain:[0,1,2],yScaleDomain:[0,4],xScalePadding:.3,agChartsExports:t}),r.append(this.columns),this.updateColors(s,i)}updateColors(e,t){this.columns.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}},cX={chartType:"groupedColumn",miniChart:lX},dX=[[8,12,16],[6,9,12],[2,3,4]],vR=class extends At{constructor(e,t,s,i,r,o=dX,n=[0,16],a="stackedColumnTooltip"){super(e,t,a);const{root:l,size:c,padding:d}=this;this.stackedColumns=Va({stacked:!0,root:l,data:o,size:c,padding:d,xScaleDomain:[0,1,2],yScaleDomain:n,xScalePadding:.3,agChartsExports:t}),l.append(Od(this.stackedColumns)),this.updateColors(s,i)}updateColors(e,t){this.stackedColumns.forEach((s,i)=>{for(const r of s)r.fill=e[i],r.stroke=t[i]})}},uX={chartType:"stackedColumn",miniChart:vR},hX=[[10,10,10],[6,7,8],[2,4,6]],gX=class extends vR{constructor(e,t,s,i,r){super(e,t,s,i,r,hX,[0,10],"normalizedColumnTooltip")}},pX={chartType:"normalizedColumn",miniChart:gX},fX=class extends At{constructor(e,t,s,i){super(e,t,"groupedBarTooltip");const{_Scene:r}=t,o=this.padding,n=this.size,a=[2,3,4],l=new r.CategoryScale;l.domain=[0,1,2],l.range=[o,n-o],l.paddingInner=.3,l.paddingOuter=.3;const c=new r.LinearScale;c.domain=[0,4],c.range=[n-o,o];const d=c.convert(0),u=l.bandwidth;this.bars=a.map((h,g)=>{const p=new r.Rect;return p.x=o,p.y=l.convert(g),p.width=d-c.convert(h),p.height=u,p.strokeWidth=0,p.crisp=!0,p}),this.updateColors(s,i),this.root.append(this.bars)}updateColors(e,t){this.bars.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}},mX={chartType:"groupedBar",miniChart:fX},CX=[[8,12,16],[6,9,12],[2,3,4]],wR=class extends At{constructor(e,t,s,i,r,o=CX,n=[0,16],a="stackedBarTooltip"){super(e,t,a);const{_Scene:l}=t,c=this.size,d=this.padding,u=new l.CategoryScale;u.domain=[0,1,2],u.range=[d,c-d],u.paddingInner=.3,u.paddingOuter=.3;const h=new l.LinearScale;h.domain=n,h.range=[c-d,d];const g=h.convert(0),p=u.bandwidth;this.bars=o.map(f=>f.map((m,C)=>{const v=new l.Rect;return v.x=d,v.y=u.convert(C),v.width=g-h.convert(m),v.height=p,v.strokeWidth=0,v.crisp=!0,v})),this.updateColors(s,i),this.root.append(Od(this.bars))}updateColors(e,t){this.bars.forEach((s,i)=>s.forEach(r=>{r.fill=e[i],r.stroke=t[i]}))}},vX={chartType:"stackedBar",miniChart:wR},wX=[[10,10,10],[6,7,8],[2,4,6]],bX=class extends wR{constructor(e,t,s,i,r){super(e,t,s,i,r,wX,[0,10],"normalizedBarTooltip")}},SX={chartType:"normalizedBar",miniChart:bX},bR=class extends Yr{constructor(e,t,s,i,r,o=.6,n="donutTooltip"){super(e,t,n);const{size:a,padding:l,agChartsExports:{_Scene:c}}=this,d=(a-l*2)/2,u=d+l,h=c.toRadians,g=[[h(-90),h(30)],[h(30),h(120)],[h(120),h(180)],[h(180),h(210)],[h(210),h(240)],[h(240),h(270)]];this.sectors=g.map(([p,f])=>{const m=new c.Sector;return m.centerX=u,m.centerY=u,m.innerRadius=d*o,m.outerRadius=d,m.startAngle=p,m.endAngle=f,m.stroke=void 0,m.strokeWidth=0,m.inset=.75,m}),this.updateColors(s,i),this.root.append(this.sectors)}updateColors(e,t){this.sectors.forEach((s,i)=>{s.fill=e[i%e.length],s.stroke=t[i%t.length]})}},SR={chartType:"donut",miniChart:bR},yX=class extends bR{constructor(e,t,s,i,r){super(e,t,s,i,r,0,"pieTooltip")}},xX={chartType:"pie",miniChart:yX},zf=[[1,3,5],[2,6,4],[5,3,1]],_f=class extends At{constructor(e,t,s,i,r,o=zf,n="lineTooltip"){super(e,t,n);const{size:a,padding:l,root:c}=this;this.lines=Nf(t,c,o,a,l),this.updateColors(s,i)}updateColors(e,t){this.lines.forEach((s,i)=>{s.stroke=e[i]})}},RX={chartType:"line",miniChart:_f},yR=fR(zf),FX=class extends _f{constructor(e,t,s,i,r,o=yR,n="stackedLineTooltip"){super(e,t,s,i,r,o,n)}},EX={chartType:"stackedLine",miniChart:FX},PX=mR(yR),MX=class extends _f{constructor(e,t,s,i,r,o=PX,n="normalizedLineTooltip"){super(e,t,s,i,r,o,n)}},TX={chartType:"normalizedLine",miniChart:MX},DX=class extends At{constructor(e,t,s,i){super(e,t,"scatterTooltip");const{size:r,padding:o,agChartsExports:{_Scene:n}}=this,a=[[[.3,3],[1.1,.9],[2,.4],[3.4,2.4]],[[0,.3],[1,2],[2.4,1.4],[3,0]]],l=new n.LinearScale;l.domain=[-.5,4],l.range=[o*2,r-o];const c=new n.LinearScale;c.domain=[-.5,3.5],c.range=[r-o,o];const d=[];a.forEach(h=>{h.forEach(([g,p])=>{const f=new n.Arc;f.strokeWidth=0,f.centerX=l.convert(g),f.centerY=c.convert(p),f.radius=2.5,d.push(f)})}),this.points=d,this.updateColors(s,i);const u=new n.Group;u.setClipRect(new n.BBox(o,o,r-o*2,r-o*2)),u.append(this.points),this.root.append(u)}updateColors(e,t){this.points.forEach((s,i)=>{s.stroke=t[i%t.length],s.fill=e[i%e.length]})}},AX={chartType:"scatter",miniChart:DX},IX=class extends At{constructor(e,t,s,i){super(e,t,"bubbleTooltip");const{size:r,padding:o,agChartsExports:{_Scene:n}}=this,a=[[[.1,.3,5],[.5,.4,7],[.2,.8,7]],[[.8,.7,5],[.7,.3,9]]],l=new n.LinearScale;l.domain=[0,1],l.range=[o*2,r-o];const c=new n.LinearScale;c.domain=[0,1],c.range=[r-o,o];const d=[];a.forEach(h=>{h.forEach(([g,p,f])=>{const m=new n.Arc;m.strokeWidth=0,m.centerX=l.convert(g),m.centerY=c.convert(p),m.radius=f,m.fillOpacity=.7,d.push(m)})}),this.points=d,this.updateColors(s,i);const u=new n.Group;u.setClipRect(new n.BBox(o,o,r-o*2,r-o*2)),u.append(this.points),this.root.append(u)}updateColors(e,t){this.points.forEach((s,i)=>{s.stroke=t[i%t.length],s.fill=e[i%e.length]})}},kX={chartType:"bubble",miniChart:IX},xR=zf,RR=class extends At{constructor(e,t,s,i,r,o=xR,n="groupedAreaTooltip",a=!1){super(e,t,n),this.areas=JY(t._Scene,this.root,o,this.size,this.padding,a),this.updateColors(s,i)}updateColors(e,t){this.areas.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i],s.strokeWidth=1,s.strokeOpacity=.75,s.fillOpacity=.7})}},LX={chartType:"area",miniChart:RR},FR=fR(xR),ER=class extends RR{constructor(e,t,s,i,r,o=FR,n="stackedAreaTooltip"){super(e,t,s,i,r,o,n,!0)}updateColors(e,t){this.areas.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}},GX={chartType:"stackedArea",miniChart:ER},OX=mR(FR),VX=class extends ER{constructor(e,t,s,i,r,o=OX,n="normalizedAreaTooltip"){super(e,t,s,i,r,o,n)}},BX={chartType:"normalizedArea",miniChart:VX},NX=class extends At{constructor(e,t,s,i){super(e,t,"histogramTooltip");const{padding:r,size:o,agChartsExports:{_Scene:n}}=this,a=[2,5,11,13,10,6,1],l=new n.LinearScale;l.domain=[0,a.length],l.range=[r,o-r];const c=new n.LinearScale;c.domain=[0,a.reduce((u,h)=>Math.max(u,h),0)],c.range=[o-r,r];const d=c.convert(0);this.bars=a.map((u,h)=>{const g=c.convert(u),p=l.convert(h),f=l.convert(h+1),m=new n.Rect;return m.x=p,m.y=g,m.width=f-p,m.height=d-g,m.strokeWidth=1,m.strokeOpacity=.75,m.crisp=!0,m}),this.updateColors(s,i),this.root.append(this.bars)}updateColors([e],[t]){for(const s of this.bars)s.fill=e,s.stroke=t}},HX={chartType:"histogram",miniChart:NX},Zo=class extends Yr{constructor(e,t,s){super(e,t,s),this.stroke="gray",this.showRadiusAxisLine=!0,this.showAngleAxisLines=!0}postConstruct(){const{_Scene:e}=this.agChartsExports,t=this.size,s=this.padding,i=s*2,r=(t-i)/2,o=this.showAngleAxisLines?[r,r*.8,r*.6,r*.4]:[],n=new e.Line;n.x1=t/2,n.y1=s,n.x2=t/2,n.y2=t-s-r-o[o.length-1],n.stroke=this.stroke,n.strokeOpacity=.5,n.fill=void 0,n.visible=this.showRadiusAxisLine;const a=s+r;this.gridLines=o.map((c,d)=>{const u=new e.Path;return u.path.arc(a,a,c,0,2*Math.PI),u.strokeWidth=1,u.stroke=this.stroke,u.strokeOpacity=d===0?.5:.2,u.fill=void 0,u});const l=this.root;l.append(n),this.gridLines.length>0&&l.append(this.gridLines),super.postConstruct()}},zX=class extends Zo{constructor(e,t,s,i){super(e,t,"radialColumnTooltip"),this.data=[[6,8,10,2,6,5],[4,4,3,6,4,4],[5,4,2,9,8,9]],this.showRadiusAxisLine=!1;const{padding:r,size:o,data:n,agChartsExports:{_Scene:a}}=this,l=(o-r*2)/2,d=l*.4,u=new a.CategoryScale;u.domain=n[0].map((C,v)=>v),u.range=[0,2*Math.PI],u.paddingInner=0,u.paddingOuter=0;const h=u.bandwidth*.7,{processedData:g,max:p}=Id(n),f=new a.LinearScale;f.domain=[0,p],f.range=[d,l];const m=this.size/2;this.series=g.map((C,v)=>{const S=v===0?void 0:g[v-1],y=new a.TranslatableGroup({zIndex:1e6}),R=C.map((P,M)=>{const T=S?.[M],I=f.convert(P),k=f.convert(T??0),L=u.convert(M),j=L+h,U=a.getRadialColumnWidth(L,j,l,.5,.5),O=new a.RadialColumnShape;return O.columnWidth=U,O.innerRadius=k,O.outerRadius=I,O.startAngle=L,O.endAngle=j,O.isBeveled=!0,O.axisInnerRadius=d,O.axisOuterRadius=l,O.stroke=void 0,O.strokeWidth=0,O});return y.append(R),y.translationX=m,y.translationY=m,y}),this.root.append(this.series),this.updateColors(s,i)}updateColors(e,t){this.series.forEach((s,i)=>{for(const r of s.children())r.fill=e[i%e.length],r.stroke=t[i%t.length]})}},_X={chartType:"radialColumn",miniChart:zX},WX=class extends Zo{constructor(e,t,s,i){super(e,t,"radialBarTooltip"),this.data=[[6,8,10],[4,4,3],[5,4,2]],this.showRadiusAxisLine=!1;const{size:r,padding:o,data:n,agChartsExports:{_Scene:a}}=this,l=(r-o)/2,d=l*.4,u=new a.CategoryScale;u.domain=n[0].map((w,S)=>S),u.range=[d,l],u.paddingInner=.5,u.paddingOuter=0;const h=u.bandwidth,{processedData:g,max:p}=Id(n),f=new a.LinearScale;f.domain=[0,Math.ceil(p*1.5)];const m=3/2*Math.PI,C=m+2*Math.PI;f.range=[m,C];const v=r/2;this.series=g.map((w,S)=>{const y=S<0?void 0:g[S-1],R=new a.Group({zIndex:1e6}),P=w.map((M,T)=>{const I=y?.[T]??0,k=u.convert(T),L=k-h,j=f.convert(I),U=f.convert(M),O=new a.Sector;return O.centerX=v,O.centerY=v,O.innerRadius=L,O.outerRadius=k,O.startAngle=j,O.endAngle=U,O.stroke=void 0,O.strokeWidth=0,O});return R.append(P),R}),this.root.append(this.series),this.updateColors(s,i)}updateColors(e,t){this.series.forEach((s,i)=>{for(const r of s.children())r.fill=e[i%e.length],r.stroke=t[i%t.length]})}},UX={chartType:"radialBar",miniChart:WX},$X=class extends Zo{constructor(e,t,s,i){super(e,t,"radarLineTooltip"),this.markerSize=4,this.data=[[8,7,8,7,8,8,7,8],[6,8,5,10,6,7,4,6],[0,3,3,5,4,4,2,0]],this.showRadiusAxisLine=!1;const{size:r,padding:o,root:n,data:a}=this,l=(r-o*2)/2,c=0,{paths:d,markers:u}=CR(t,n,a,r,l,c,this.markerSize);this.lines=d,this.markers=u,this.updateColors(s,i)}updateColors(e,t){this.lines.forEach((s,i)=>{const r=this.data[i].length;s.stroke=e[i];const o=i*r,n=o+r,a=this.markers.slice(o,n);for(const l of a)l.stroke=t[i],l.fill=e[i]})}},KX={chartType:"radarLine",miniChart:$X},jX=class extends Zo{constructor(e,t,s,i){super(e,t,"radarAreaTooltip"),this.data=[[8,10,5,7,4,1,5,8],[1,1,2,7,7,8,10,1],[4,5,9,9,4,2,3,4]];const{size:r,padding:o,root:n,data:a}=this;this.showRadiusAxisLine=!1;const l=(r-o*2)/2,c=l-r*.3;this.areas=CR(t,n,a,r,l,c).paths,this.updateColors(s,i)}updateColors(e,t){this.areas.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}},qX={chartType:"radarArea",miniChart:jX},YX=class extends Zo{constructor(e,t,s,i){super(e,t,"nightingaleTooltip"),this.data=[[6,10,9,8,7,8],[4,6,5,4,5,5],[3,5,4,3,4,7]],this.showRadiusAxisLine=!1;const{size:r,padding:o,data:n,agChartsExports:{_Scene:a}}=this,l=(r-o*2)/2,c=new a.CategoryScale;c.domain=n[0].map((f,m)=>m),c.range=[-Math.PI,Math.PI],c.paddingInner=0,c.paddingOuter=0;const d=c.bandwidth*.7,{processedData:u,max:h}=Id(n),g=new a.LinearScale;g.domain=[0,h],g.range=[0,l];const p=r/2;this.series=u.map((f,m)=>{const C=m<0?void 0:u[m-1],v=new a.Group({zIndex:1e6}),w=f.map((S,y)=>{const R=C?.[y],P=g.convert(S),M=g.convert(R??0),T=c.convert(y),I=T+d,k=new a.Sector;return k.centerX=p,k.centerY=p,k.innerRadius=M,k.outerRadius=P,k.startAngle=T,k.endAngle=I,k.stroke=void 0,k.strokeWidth=0,k});return v.append(w),v}),this.root.append(this.series),this.updateColors(s,i)}updateColors(e,t){this.series.forEach((s,i)=>{for(const r of s.children())r.fill=e[i%e.length],r.stroke=t[i%t.length]})}},XX={chartType:"nightingale",miniChart:YX},ZX=class extends At{constructor(e,t,s,i){super(e,t,"rangeBarTooltip");const r=[3,3.5,3];this.bars=this.createRangeBar(this.root,r,this.size,this.padding,"vertical"),this.updateColors(s,i)}updateColors(e,t){this.bars.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}createRangeBar(e,t,s,i,r){const o=r==="horizontal",n=2*i,{_Scene:a}=this.agChartsExports,l=new a.CategoryScale;l.domain=t.map((p,f)=>f),l.range=[i,s-i],l.paddingInner=.3,l.paddingOuter=.3;const c=.7,d=1.3,u=new a.LinearScale;u.domain=[t.reduce((p,f)=>Math.min(p,f),1/0)*c,t.reduce((p,f)=>Math.max(p,f),0)*d],u.range=[n,s-n];const h=l.bandwidth,g=t.map((p,f)=>{const[m,C]=[p*c,p*d],v=l.convert(f),w=u.convert(m),S=u.convert(C)-w,y=new a.Rect;return y.x=o?w:v,y.y=o?v:w,y.width=o?S:h,y.height=o?h:S,y.strokeWidth=0,y.crisp=!0,y});return e.append(g),g}},QX={chartType:"rangeBar",miniChart:ZX},JX=class extends At{constructor(e,t,s,i){super(e,t,"rangeAreaTooltip");const r=4,o=[Wf({offset:.375*r,length:r,pattern:{low:3,high:5,period:r}}),Wf({offset:.375*r,length:r,pattern:{low:2.25,high:4.25,period:r}}),Wf({offset:.75*r,length:r,pattern:{low:2.5,high:4.5,period:r}})],n=1.75,a=o.map(d=>d.map(([u,h])=>({x:u,low:h-.5*n,high:h+.5*n}))),{lines:l,areas:c}=this.createRangeArea(this.root,a,this.size,this.padding);this.lines=l,this.areas=c,this.updateColors(s,i)}updateColors(e,t){e=MR(e,1,2),t=MR(t,1,2),this.lines.forEach(([s,i],r)=>{s.fill=void 0,s.stroke=t[r],i.fill=void 0,i.stroke=t[r]}),this.areas.forEach((s,i)=>{s.fill=e[i]})}createRangeArea(e,t,s,i){const r=t.reduce((f,m)=>m.reduce((C,{x:v})=>Math.min(C,v),f),1/0),o=t.reduce((f,m)=>m.reduce((C,{x:v})=>Math.max(C,v),f),-1/0),n=t.reduce((f,m)=>m.reduce((C,{low:v})=>Math.min(C,v),f),1/0),a=t.reduce((f,m)=>m.reduce((C,{high:v})=>Math.max(C,v),f),-1/0),{_Scene:l}=this.agChartsExports,c=new l.LinearScale;c.domain=[r,o],c.range=[i,s-i];const d=2*i,u=new l.LinearScale;u.domain=[n,a],u.range=[s-d,d];const h=[],g=[];return t.map(f=>{const m=new l.Path,C=new l.Path,v=new l.Path;return h.push([m,C]),g.push(v),m.strokeWidth=0,C.strokeWidth=0,v.strokeWidth=0,v.fillOpacity=.8,m.path.clear(),C.path.clear(),v.path.clear(),f.map((w,S)=>{const{x:y,low:R,high:P}=w,M=c.convert(y),T=u.convert(R),I=u.convert(P),k=S>0?"lineTo":"moveTo";return m.path[k](M,I),C.path[k](M,T),v.path[k](M,I),[M,T]})}).forEach((f,m)=>{const C=f.length-1,v=g[m];for(let w=C;w>=0;w--){const[S,y]=f[w];v.path.lineTo(S,y)}}),e.append(g.concat(...h)),{lines:h,areas:g}}};function Wf(e){const{offset:t,length:s,pattern:i}=e,r=a(t,s,i),o=0,n=s;return(r.length===0||r[0][0]!==o)&&r.unshift(l(o,t,i)),r[r.length-1][0]!==n&&r.push(l(n,t,i)),r;function a(d,u,h){const{period:g}=h,p=d/g,m=[0,.5].map(v=>v-p).map(PR).sort((v,w)=>v-w);return Array.from({length:Math.floor(m.length*(g/u))},(v,w)=>m[w%m.length]+Math.floor(w/m.length)).map(v=>v*g).map(v=>l(v,d,h))}function l(d,u,h){return[d,c(u+d,h)]}function c(d,u){const{low:h,high:g,period:p}=u,f=PR(d/p),m=f>.5?1-2*(f-.5):2*f;return h+(g-h)*m}}function PR(e){const t=e%1;return t<0?t+1:t}function MR(e,t,s){const i=[...e],r=i[t];return i[t]=i[s],i[s]=r,i}var eZ={chartType:"rangeArea",miniChart:JX},tZ=class extends At{constructor(e,t,s,i,r){super(e,t,"boxPlotTooltip");const{size:o,padding:n,agChartsExports:{_Scene:a}}=this,l=[11,11.5,10.5],c=1.2,d=1.1,u=.9,h=.8,g=new a.LinearScale;g.domain=[l.reduce((C,v)=>Math.min(C,v),1/0)*h,l.reduce((C,v)=>Math.max(C,v),0)*c],g.range=[o-1.5*n,n];const p=new a.CategoryScale;p.domain=l.map((C,v)=>v),p.range=[n,o-n],p.paddingInner=.4,p.paddingOuter=.2;const f=Math.round(p.bandwidth),m=Math.round(p.bandwidth/2);this.boxPlotGroups=l.map((C,v)=>{const[w,S,y,R]=[C*h,C*u,C*d,C*c],P=Math.round(g.convert(y)),M=Math.round(p.convert(v)),T=Math.round(M+f),I=Math.round(g.convert(S)),k=Math.round(g.convert(w)),L=Math.round(g.convert(C)),j=Math.round(g.convert(R)),U=M+m,O=new a.Group,X=new a.Rect,se=new a.Line,we=new a.Line,pe=new a.Line,ge=new a.Line,it=new a.Line;return X.x=M,X.y=P,X.width=f,X.height=I-P,X.strokeWidth=1,X.strokeOpacity=.75,X.crisp=!0,this.setLineProperties(se,M,T,L,L),this.setLineProperties(we,U,U,j,P),this.setLineProperties(pe,U,U,k,I),this.setLineProperties(ge,M,T,j,j),this.setLineProperties(it,M,T,k,k),O.append([X,se,we,pe,ge,it]),O}),this.updateColors(s,i,r),this.root.append(this.boxPlotGroups)}updateColors(e,t,s){const{_Theme:i}=this.agChartsExports;this.boxPlotGroups.forEach((r,o)=>{for(const n of r.children()){const a=e[o%e.length];n.fill=s?a:i.resolveOperation({$mix:[a,{$ref:"backgroundColor"},.7]}),n.stroke=t[o%t.length]}})}setLineProperties(e,t,s,i,r){e.x1=t,e.x2=s,e.y1=i,e.y2=r,e.strokeOpacity=.75}},sZ={chartType:"boxPlot",miniChart:tZ},iZ=class extends Yr{constructor(e,t,s,i,r){super(e,t,"treemapTooltip");const{size:o,padding:n,agChartsExports:{_Scene:a}}=this,l=[[1,1],[3,2,1]],d=l.length%2===0?.3:.2,u=[n,o-n],h=l.length,g=h*(h+1)/2,p=d/(h-1),f=u[1]-u[0],m=f-d;let C=u[0];this.rects=l.reduce((w,S,y)=>{w??(w=[]);const R=(h-y)/g,P=m*R,M=S.length,T=S.reduce((U,O)=>U+O,0),I=d/(M-1||1),k=M>1?f-d:f;let L=u[0];const j=S.map(U=>{const O=new a.Rect,X=k*U/T;return O.x=C,O.y=L,O.width=P,O.height=X,O.strokeWidth=.75,O.crisp=!0,L+=X+I,O});return C+=P+p,w.push(...j),w},[]),this.updateColors(s,i,r);const v=new a.Group;v.setClipRect(new a.BBox(n,n,o-n,o-n)),v.append(this.rects),this.root.append(v)}updateColors(e,t,s){const{_Theme:i}=this.agChartsExports;this.rects.forEach((r,o)=>{r.fill=e[o%t.length],r.stroke=s?t[o%t.length]:i.resolveOperation({$ref:"backgroundColor"})})}},rZ={chartType:"treemap",miniChart:iZ},oZ=class extends Zo{constructor(e,t,s,i){super(e,t,"sunburstTooltip"),this.data=[[[],[]],[[],[]],[[],[]]],this.angleOffset=-Math.PI/2,this.innerRadiusRatio=0,this.showRadiusAxisLine=!1,this.showAngleAxisLines=!1;const{data:r,size:o,padding:n,angleOffset:a,innerRadiusRatio:l,agChartsExports:{_Scene:c}}=this,d=(o-n*2)/2,u=[a+0,a+2*Math.PI],h=Math.abs(u[1]-u[0]),g=[d*l,d],p=Math.abs(g[1]-g[0]);let f=0;const m=(y,R)=>{for(const P of y){const M=R+1;f=Math.max(f,M),m(P,M)}};m(r,0);const C=p/f,v=this.size/2,w=u[0];this.series=[];const S=(y,R,P,M,T)=>{if(!Array.isArray(y))return;const k=R+1;let L=P;y.forEach((j,U,O)=>{let X=T;X||(X=new c.Group,this.series.push(X));const se=g[0]+R*C,we=g[0]+k*C,pe=1/O.length,ge=L,it=ge+M*pe,Z=new c.Sector;Z.centerX=v,Z.centerY=v,Z.innerRadius=se,Z.outerRadius=we,Z.startAngle=ge,Z.endAngle=it,Z.stroke=void 0,Z.strokeWidth=0,Z.inset=.75,L=it,X.append(Z),S(j,k,ge,Math.abs(it-ge),X)})};S(r,0,w,h),this.root.append(this.series),this.updateColors(s,i)}updateColors(e,t){this.series.forEach((s,i)=>{for(const r of s.children())r.fill=e[i%e.length],r.stroke=t[i%t.length]})}},nZ={chartType:"sunburst",miniChart:oZ},aZ=class extends Yr{constructor(e,t,s,i,r){super(e,t,"heatmapTooltip");const{size:o,padding:n,agChartsExports:{_Scene:a}}=this,l=3,c=Array.from({length:l},(m,C)=>Array.from({length:l},(v,w)=>w)),d=c.map((m,C)=>C),u=new a.CategoryScale;u.domain=d,u.range=[n,o-n],u.paddingInner=.01,u.paddingOuter=.1;const h=new a.CategoryScale;h.domain=d,h.range=[n,o-n],h.paddingInner=.01,h.paddingOuter=.1;const g=u.bandwidth??0,p=h.bandwidth??0;this.rects=c.reduce((m,C,v)=>{m??(m=[]);const w=C.map((S,y)=>{const R=new a.Rect;return R.x=u.convert(v),R.y=h.convert(y),R.width=g,R.height=p,R.strokeWidth=0,R.crisp=!0,R});return m.push(...w),m},[]),this.updateColors(s,i,r);const f=new a.Group;f.setClipRect(new a.BBox(n,n,o-n,o-n)),f.append(this.rects),this.root.append(f)}updateColors(e,t,s){const{_Theme:i,_Util:r}=this.agChartsExports,o=s?[e[0],e[1]]:i.resolveOperation({$palette:"divergingColors"}),n=s?t[0]:i.resolveOperation({$ref:"backgroundColor"}),a=r.interpolateColor(o[0],o[1]);this.rects.forEach((l,c)=>{l.fill=a(c*.2),l.stroke=n})}},lZ={chartType:"heatmap",miniChart:aZ},cZ=class extends At{constructor(e,t,s,i,r){super(e,t,"waterfallTooltip"),this.data=[4,3,-3,6,-3],this.bars=this.createWaterfall(this.root,this.data,this.size,this.padding,"vertical").bars,this.updateColors(s,i,r)}updateColors(e,t,s){const{data:i,agChartsExports:{_Theme:r}}=this,o={fill:s?e[0]:r.resolveOperation({$palette:"altUp.fill"}),stroke:s?t[0]:r.resolveOperation({$palette:"altUp.stroke"})},n={fill:s?e[1]:r.resolveOperation({$palette:"altDown.fill"}),stroke:s?t[1]:r.resolveOperation({$palette:"altDown.stroke"})};this.bars.forEach((a,l)=>{const c=i[l]>=0;a.fill=c?o.fill:n.fill,a.stroke=c?o.stroke:n.stroke})}createWaterfall(e,t,s,i,r){const o=2*i,{processedData:n,min:a,max:l}=Id(t.map(w=>[w])),c=n.reduce((w,S)=>w.concat(S),[]),{_Scene:d}=this.agChartsExports,u=new d.LinearScale;u.domain=[Math.min(a,0),l],u.range=[s-o,o];const h=new d.CategoryScale;h.domain=t.map((w,S)=>S),h.range=[i,s-i],h.paddingInner=.2,h.paddingOuter=.3;const g=h.bandwidth,p=new d.Path;p.stroke="#575757",p.strokeWidth=0;const f=Math.floor(p.strokeWidth)%2/2,m=p.path;m.clear();const C=r==="horizontal",v=c.map((w,S)=>{const y=S>0?c[S-1]:0,P=t[S]>0,M=Math.round(u.convert(w)),T=Math.round(u.convert(y)),I=(P?M:T)-f,k=(P?T:M)+f,L=Math.abs(k-I),j=h.convert(S),U=new d.Rect;U.x=C?I:j,U.y=C?j:I,U.width=C?L:g,U.height=C?g:L,U.strokeWidth=0,U.crisp=!0;const O=M+f,X=T+f;if(S>0){const pe=C?X:U.x,ge=C?U.y:X;m.lineTo(pe,ge)}const se=C?O:U.x,we=C?U.y:O;return m.moveTo(se,we),U});return e.append([p,...v]),{bars:v}}},dZ={chartType:"waterfall",miniChart:cZ},uZ=class extends At{constructor(e,t,s,i){super(e,t,"columnLineComboTooltip"),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];const{root:r,columnData:o,lineData:n,size:a,padding:l}=this;this.columns=Va({stacked:!1,root:r,data:o,size:a,padding:l,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5,agChartsExports:t}),r.append(this.columns),this.lines=Nf(t,r,n,a,l),this.updateColors(s,i)}updateColors(e,t){this.columns.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]}),this.lines.forEach((s,i)=>{s.stroke=e[i+2]})}},hZ={chartType:"columnLineCombo",miniChart:uZ},gZ=class extends At{constructor(e,t,s,i){super(e,t,"areaColumnComboTooltip"),this.columnData=[3,4.5],this.areaData=[[5,4,6,5,4]];const{root:r,columnData:o,areaData:n,size:a,padding:l,agChartsExports:{_Scene:c}}=this;this.columns=Va({stacked:!1,root:r,data:o,size:a,padding:l,xScaleDomain:[0,1],yScaleDomain:[0,6],xScalePadding:.5,agChartsExports:t});const d=new c.CategoryScale;d.range=[l,a-l],d.domain=[0,1,2,3,4],d.paddingInner=1,d.paddingOuter=0;const u=new c.LinearScale;u.range=[a-l,l],u.domain=[0,6];const h=[],g=u.convert(0),p=d.convert(0);n.forEach((C,v)=>{const w=h[v]||(h[v]=[]);C.forEach((y,R)=>{const P=y,M=R,T=d.convert(M),I=u.convert(P);w[R]={x:T,y:I}});const S=d.convert(C.length-1);h[v].push({x:S,y:g},{x:p,y:g})}),this.areas=h.map(C=>{const v=new c.Path;v.strokeWidth=0,v.fillOpacity=.8;const w=v.path;return C.forEach((S,y)=>w[y>0?"lineTo":"moveTo"](S.x,S.y)),v});const f=new c.Group;f.setClipRect(new c.BBox(l,l,a-l*2,a-l*2));const m=new c.Group;m.setClipRect(new c.BBox(l,l,a-l*2,a-l*2)),f.append(this.areas),m.append(this.columns),r.append(f),r.append(m),this.updateColors(s,i)}updateColors(e,t){this.areas.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]}),this.columns.forEach((s,i)=>{s.fill=e[i+1],s.stroke=t[i+1]})}},pZ={chartType:"areaColumnCombo",miniChart:gZ},fZ=class extends Yr{constructor(e,t,s,i){super(e,t,"customComboTooltip"),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];const{root:r,columnData:o,lineData:n,size:a,padding:l,agChartsExports:{_Scene:c}}=this;this.columns=Va({stacked:!1,root:r,data:o,size:a,padding:l,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5,agChartsExports:t}),r.append(this.columns),this.lines=Nf(this.agChartsExports,r,n,a,l);const d="grey",u=3,h=new c.Line;h.x1=l,h.y1=l,h.x2=l,h.y2=a-l+u,h.stroke=d;const g=new c.Line;g.x1=l-u+1,g.y1=a-l,g.x2=a-l+1,g.y2=a-l,g.stroke=d;const p=new c.Path;this.buildPenIconPath(p),p.fill="whitesmoke",p.stroke="darkslategrey",p.strokeWidth=1,r.append([g,h,p]),this.updateColors(s,i)}updateColors(e,t){this.columns.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]}),this.lines.forEach((s,i)=>{s.stroke=e[i+2]})}buildPenIconPath(e){const{path:t}=e;t.moveTo(25.76,43.46),t.lineTo(31.27,48.53),t.moveTo(49.86,22),t.lineTo(49.86,22),t.cubicCurveTo(49.01994659053345,21.317514933510974,47.89593834348529,21.09645997825817,46.86,21.41),t.lineTo(46.86,21.41),t.cubicCurveTo(45.55460035985361,21.77260167850787,44.38777081121966,22.517979360321792,43.51,23.55),t.lineTo(25.51,43.8),t.lineTo(25.43,43.89),t.lineTo(23.01,51.89),t.lineTo(22.83,52.46),t.lineTo(31.02,48.86),t.lineTo(49.02,28.52),t.lineTo(49.02,28.52),t.cubicCurveTo(49.940716461596224,27.521914221246085,50.54302631059587,26.2720342455763,50.75,24.93),t.lineTo(50.75,24.93),t.cubicCurveTo(50.95363374988308,23.866379846512814,50.62080640232334,22.77066734274871,49.86,22),t.closePath(),t.moveTo(41.76,25.5),t.lineTo(47.34,30.5),t.moveTo(40.74,26.65),t.lineTo(46.25,31.71)}},mZ={chartType:"customCombo",miniChart:fZ},TR={columnGroup:{column:{range:!0,pivot:!0,enterprise:!1,icon:cX},stackedColumn:{range:!0,pivot:!0,enterprise:!1,icon:uX},normalizedColumn:{range:!0,pivot:!0,enterprise:!1,icon:pX}},barGroup:{bar:{range:!0,pivot:!0,enterprise:!1,icon:mX},stackedBar:{range:!0,pivot:!0,enterprise:!1,icon:vX},normalizedBar:{range:!0,pivot:!0,enterprise:!1,icon:SX}},pieGroup:{pie:{range:!0,pivot:!0,enterprise:!1,icon:xX},donut:{range:!0,pivot:!0,enterprise:!1,icon:SR},doughnut:{range:!0,pivot:!0,enterprise:!1,icon:SR}},lineGroup:{line:{range:!0,pivot:!0,enterprise:!1,icon:RX},stackedLine:{range:!0,pivot:!0,enterprise:!1,icon:EX},normalizedLine:{range:!0,pivot:!0,enterprise:!1,icon:TX}},scatterGroup:{scatter:{range:!0,pivot:!0,enterprise:!1,icon:AX},bubble:{range:!0,pivot:!0,enterprise:!1,icon:kX}},areaGroup:{area:{range:!0,pivot:!0,enterprise:!1,icon:LX},stackedArea:{range:!0,pivot:!0,enterprise:!1,icon:GX},normalizedArea:{range:!0,pivot:!0,enterprise:!1,icon:BX}},polarGroup:{radarLine:{range:!0,pivot:!1,enterprise:!0,icon:KX},radarArea:{range:!0,pivot:!1,enterprise:!0,icon:qX},nightingale:{range:!0,pivot:!1,enterprise:!0,icon:XX},radialColumn:{range:!0,pivot:!1,enterprise:!0,icon:_X},radialBar:{range:!0,pivot:!1,enterprise:!0,icon:UX}},statisticalGroup:{boxPlot:{range:!0,pivot:!1,enterprise:!0,icon:sZ},histogram:{range:!0,pivot:!1,enterprise:!1,icon:HX},rangeBar:{range:!0,pivot:!1,enterprise:!0,icon:QX},rangeArea:{range:!0,pivot:!1,enterprise:!0,icon:eZ}},hierarchicalGroup:{treemap:{range:!0,pivot:!0,enterprise:!0,icon:rZ},sunburst:{range:!0,pivot:!0,enterprise:!0,icon:nZ}},specializedGroup:{heatmap:{range:!0,pivot:!1,enterprise:!0,icon:lZ},waterfall:{range:!0,pivot:!1,enterprise:!0,icon:dZ}},combinationGroup:{columnLineCombo:{range:!0,pivot:!0,enterprise:!1,icon:hZ},areaColumnCombo:{range:!0,pivot:!0,enterprise:!1,icon:pZ},customCombo:{range:!0,pivot:!0,enterprise:!1,icon:mZ}},funnelGroup:{funnel:{range:!0,pivot:!1,enterprise:!0,icon:tX},coneFunnel:{range:!0,pivot:!1,enterprise:!0,icon:rX},pyramid:{range:!0,pivot:!1,enterprise:!0,icon:aX}}},CZ={columnGroup:["column","stackedColumn","normalizedColumn"],barGroup:["bar","stackedBar","normalizedBar"],pieGroup:["pie","donut"],lineGroup:["line","stackedLine","normalizedLine"],areaGroup:["area","stackedArea","normalizedArea"],scatterGroup:["scatter","bubble"],polarGroup:["radarLine","radarArea","nightingale","radialColumn","radialBar"],statisticalGroup:["boxPlot","histogram","rangeBar","rangeArea"],hierarchicalGroup:["treemap","sunburst"],specializedGroup:["heatmap","waterfall"],funnelGroup:["funnel","coneFunnel","pyramid"],combinationGroup:["columnLineCombo","areaColumnCombo","customCombo"]},vZ=class extends A{constructor(e,t,s,i,r=CZ){super('
'),this.wrappers=new Map,this.chartController=e,this.fills=t,this.strokes=s,this.isCustomTheme=i,this.chartGroups={...r}}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){!this.chartController.customComboExists()&&this.chartGroups.combinationGroup&&(this.chartGroups.combinationGroup=this.chartGroups.combinationGroup.filter(o=>o!=="customCombo"));const e=this.getGui(),t=this.chartController.isEnterprise(),s=this.chartController.isPivotChart(),i=!s,r=Object.keys(this.chartGroups).map(o=>{const n=o in TR?TR[o]:void 0;if(!n)return F(148,{group:o}),null;const l=(this.chartGroups[o]??[]).map(c=>{const d=c in n?n[c]:void 0;return d?!t&&d.enterprise?null:i&&d.range||s&&d.pivot?d:null:(F(149,{group:o,chartType:c}),null)}).filter(c=>c!=null);return l.length===0?null:{label:this.chartTranslation.translate(o),items:l}}).filter(o=>o!=null);for(const{label:o,items:n}of r){const a=this.createBean(new qs({title:o,suppressEnabledCheckbox:!0,enabled:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-settings",direction:"horizontal",suppressKeyboardNavigation:!0}));for(const l of n){const{miniChart:c,chartType:d}=l.icon,u=document.createElement("div");u.classList.add("ag-chart-mini-thumbnail"),u.setAttribute("tabindex","0"),u.setAttribute("role","button");const h=d,g=()=>{this.chartController.setChartType(h),this.updateSelectedMiniChart()};this.addManagedListeners(u,{click:g,keydown:p=>{(p.key==b.ENTER||p.key===b.SPACE)&&(p.preventDefault(),g())}}),this.wrappers.set(h,u),this.createBean(new c(u,this.beans.agChartsExports,this.fills,this.strokes,this.isCustomTheme)),a.addItem(u)}e.appendChild(a.getGui())}this.updateSelectedMiniChart()}updateSelectedMiniChart(){const e=this.chartController.getChartType();this.wrappers.forEach((t,s)=>{const i=s===e;t.classList.toggle("ag-selected",i);const r=this.chartTranslation.translate(If(s)),o=i?`${r}. ${this.chartTranslation.translate("ariaChartSelected")}`:r;de(t,o)})}destroy(){this.wrappers.clear(),super.destroy()}},wZ=class extends A{constructor(e){super(`
`),this.chartController=e,this.eMiniChartsContainer=x,this.eNavBar=x,this.eCardSelector=x,this.ePrevBtn=x,this.eNextBtn=x,this.miniChartsContainers=[],this.cardItems=[],this.activePaletteIndex=0,this.palettes=[],this.themes=[]}postConstruct(){this.resetPalettes();const e=this.gos.get("enableRtl");this.ePrevBtn.insertAdjacentElement("afterbegin",_(e?"chartsThemeNext":"chartsThemePrevious",this.beans)),this.eNextBtn.insertAdjacentElement("afterbegin",_(e?"chartsThemePrevious":"chartsThemeNext",this.beans)),this.addManagedElementListeners(this.ePrevBtn,{click:()=>this.setActivePalette(this.getPrev(),"left")}),this.addManagedElementListeners(this.eNextBtn,{click:()=>this.setActivePalette(this.getNext(),"right")});const t=()=>this.resetPalettes(!0);this.addManagedListeners(this.chartController,{chartTypeChanged:t,chartApiUpdate:t}),this.scrollSelectedIntoView()}scrollSelectedIntoView(){setTimeout(()=>{const e=i=>!i.getGui().classList.contains("ag-hidden"),s=this.miniChartsContainers.find(e).getGui().querySelector(".ag-selected");if(s){const i=s.offsetParent;i&&this.eMiniChartsContainer.scrollTo(0,i.offsetTop)}},250)}resetPalettes(e){const t=this.chartController.getPalettes(),s=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;if(be(t,this.palettes)&&!e||this.isAnimating)return;this.palettes=t,this.themes=this.chartController.getThemeNames(),this.activePaletteIndex=this.themes.findIndex(r=>r===this.chartController.getChartThemeName()),this.cardItems=[],ee(this.eCardSelector),this.destroyMiniCharts();const{themes:i}=this;this.palettes.forEach((r,o)=>{const n=this.activePaletteIndex===o,{fills:a=[],strokes:l=[]}=r,c=i[o],d=!kf(c,this.beans.agChartsExports._Theme),u=this.createBean(new vZ(this.chartController,a,l,d,s));this.miniChartsContainers.push(u),this.eMiniChartsContainer.appendChild(u.getGui()),this.addCardLink(o),n?u.updateSelectedMiniChart():u.setDisplayed(!1)}),V(this.eNavBar,this.palettes.length>1),dn(this.cardItems[this.activePaletteIndex],"ag-selected","ag-not-selected")}addCardLink(e){const t=document.createElement("div");t.classList.add("ag-chart-settings-card-item"),this.addManagedElementListeners(t,{click:()=>{this.setActivePalette(e,e=this.palettes.length&&(e=0),e}setActivePalette(e,t){if(this.isAnimating||this.activePaletteIndex===e)return;dn(this.cardItems[e],"ag-selected","ag-not-selected");const s=this.miniChartsContainers[this.activePaletteIndex],i=s.getGui(),r=this.miniChartsContainers[e],o=r.getGui();s.updateSelectedMiniChart(),r.updateSelectedMiniChart();const n=t==="left"?-1:1,a=o.style.left=`${bi(this.getGui())*n}px`;this.activePaletteIndex=e,this.isAnimating=!0;const l="ag-animating";r.setDisplayed(!0),s.addCss(l),r.addCss(l),this.chartController.setChartThemeName(this.themes[e]),window.setTimeout(()=>{i.style.left=`${-parseFloat(a)}px`,o.style.left="0px"},0),window.setTimeout(()=>{this.isAnimating=!1,s.removeCss(l),r.removeCss(l),s.setDisplayed(!1)},300)}destroyMiniCharts(){ee(this.eMiniChartsContainer),this.miniChartsContainers=this.destroyBeans(this.miniChartsContainers)}destroy(){this.destroyMiniCharts(),super.destroy()}},bZ="data",SZ="format",yZ=class extends A{constructor(e,t){super(),this.panels=e,this.chartMenuContext=t,this.tabs=[]}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){for(const e of this.panels){const t=e.replace("chart","").toLowerCase(),s=this.createPanel(t),i=this.createTab(e,t,s);this.tabs.push(i),this.addDestroyFunc(()=>this.destroyBean(s))}this.tabbedLayout=new pp({items:this.tabs,cssClass:"ag-chart-tabbed-menu",keepScrollPosition:!0,suppressFocusBodyOnOpen:!0,suppressTrapFocus:!0,enableCloseButton:!0,closeButtonAriaLabel:this.chartTranslation.translate("ariaChartMenuClose"),onCloseClicked:()=>{this.eventSource?.focus({preventScroll:!0}),this.dispatchLocalEvent({type:"closed"})}}),this.createBean(this.tabbedLayout)}createTab(e,t,s){const i=re({tag:"div",cls:`ag-chart-tab ag-chart-${t}`});this.createBean(s),i.appendChild(s.getGui());const r=this.chartTranslation.translate(t);return{title:re({tag:"div",children:r}),titleLabel:r,bodyPromise:$.resolve(i),getScrollableContainer:()=>i.querySelector(".ag-scrollable-container")||i,name:e}}showTab(e){const t=this.tabs[e];this.tabbedLayout.showItem(t)}getGui(){return this.tabbedLayout?.getGui()}showMenu(e,t){this.eventSource=e,t||this.tabbedLayout?.focusHeader(!0)}destroy(){this.parentComponent?.isAlive()&&this.destroyBean(this.parentComponent),super.destroy()}createPanel(e){switch(e){case bZ:return new vY(this.chartMenuContext);case SZ:return new $Y(this.chartMenuContext);default:return new wZ(this.chartMenuContext.chartController)}}},xZ=class extends A{constructor(e,t,s){super('
'),this.eChartContainer=e,this.eMenuPanelContainer=t,this.chartMenuContext=s,this.buttons={chartLink:{iconName:"linked",callback:()=>this.chartMenuSvc.toggleLinked(this.chartMenuContext)},chartUnlink:{iconName:"unlinked",callback:()=>this.chartMenuSvc.toggleLinked(this.chartMenuContext)},chartDownload:{iconName:"chartsDownload",callback:()=>this.chartMenuSvc.downloadChart(this.chartMenuContext)},chartMenu:{iconName:"chartsMenu",callback:i=>this.showMenuList(i)}},this.panels=[],this.menuVisible=!1,this.chartController=s.chartController}wireBeans(e){this.chartMenuSvc=e.chartMenuSvc,this.chartMenuListFactory=e.chartMenuListFactory}postConstruct(){this.chartToolbar=this.createManagedBean(new aY),this.getGui().appendChild(this.chartToolbar.getGui()),this.refreshToolbarAndPanels(),this.addManagedEventListeners({chartCreated:e=>{e.chartId===this.chartController.getChartId()&&this.gos.get("chartToolPanelsDef")?.defaultToolPanel&&this.showMenu({panel:this.defaultPanel,suppressFocus:!0})}}),this.addManagedListeners(this.chartController,{chartLinkedChanged:this.refreshToolbarAndPanels.bind(this)}),this.refreshMenuClasses(),this.addManagedListeners(this.chartController,{chartApiUpdate:this.refreshToolbarAndPanels.bind(this)})}isVisible(){return this.menuVisible}getExtraPaddingDirections(){return["chartMenu","chartLink","chartUnlink","chartDownload"].some(e=>this.chartToolbarOptions.includes(e))?["top"]:[]}refreshToolbarAndPanels(){this.initToolbarOptionsAndPanels(),this.updateToolbar()}initToolbarOptionsAndPanels(){const{panels:e,defaultPanel:t}=this.chartMenuSvc.getChartToolPanels(this.chartController);this.panels=e,this.defaultPanel=t,this.chartToolbarOptions=this.chartMenuSvc.getChartToolbarOptions()}updateToolbar(){const e=this.chartToolbarOptions.map(t=>{const{iconName:s,callback:i}=this.buttons[t];return{buttonName:t,iconName:s,callback:i}});this.chartToolbar.updateParams({buttons:e})}createMenuPanel(e){const t=this.menuPanel=this.createBean(new dp({height:"100%",closable:!0,hideTitleBar:!0,cssIdentifier:"chart-menu"}));return t.setParentComponent(this),this.eMenuPanelContainer.appendChild(t.getGui()),this.tabbedMenu=this.createBean(new yZ(this.panels,this.chartMenuContext)),this.addManagedListeners(this.tabbedMenu,{closed:()=>{this.hideMenu()}}),this.addManagedListeners(t,{destroyed:()=>this.destroyBean(this.tabbedMenu)}),new $(s=>{window.setTimeout(()=>{t.setBodyComponent(this.tabbedMenu),this.tabbedMenu.showTab(e),s(t)},100)})}showContainer(e,t){this.menuPanel&&(this.menuVisible=!0,this.refreshMenuClasses(),this.tabbedMenu.showMenu(e,t))}showMenu(e){const{panel:t,eventSource:s,suppressFocus:i}=e??{};if(this.menuPanel&&!t)this.showContainer(s,i);else{const r=t||this.defaultPanel;let o=this.panels.indexOf(r);o<0&&(F(143,{panel:t}),o=this.panels.indexOf(this.defaultPanel)),this.menuPanel?(this.tabbedMenu.showTab(o),this.showContainer(s,i)):this.createMenuPanel(o).then(()=>this.showContainer(s,i))}}hideMenu(){this.menuVisible=!1,this.refreshMenuClasses()}refreshMenuClasses(){this.eChartContainer.classList.toggle("ag-chart-menu-visible",this.menuVisible),this.eChartContainer.classList.toggle("ag-chart-menu-hidden",!this.menuVisible)}showMenuList(e){this.chartMenuListFactory.showMenuList({eventSource:e,showMenu:()=>this.showMenu({eventSource:e}),chartMenuContext:this.chartMenuContext,closeOnElementClick:this.eChartContainer})}destroy(){super.destroy(),this.menuPanel?.isAlive()&&this.destroyBean(this.menuPanel),this.tabbedMenu?.isAlive()&&this.destroyBean(this.tabbedMenu)}},DR=["number","category","time","grouped-category"],RZ=["angle-category","angle-number","radius-category","radius-number"],FZ=[...DR,...RZ],EZ=class extends E{constructor(e){super(),this.chartController=e}getChartThemeOverridesProxy(){return{getValue:e=>this.getChartOption(e),setValue:(e,t)=>this.setChartThemeOverrides([{expression:e,value:t}]),setValues:e=>this.setChartThemeOverrides(e)}}getAxisThemeOverridesProxy(){return{getValue:e=>this.getAxisProperty(e),setValue:(e,t)=>this.setAxisThemeOverrides([{expression:e,value:t}]),setValues:e=>this.setAxisThemeOverrides(e)}}getCartesianAxisOptionsProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,s)=>this.setCartesianAxisOptions(e,[{expression:t,value:s}]),setValues:t=>this.setCartesianAxisOptions(e,t),clearValue:(t,s)=>this.clearCartesianAxisOptions(e,t,s)}}getCartesianAxisThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,s)=>this.setCartesianAxisThemeOverrides(e,[{expression:t,value:s}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getCartesianAxisAppliedThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisThemeOverride(e,t==="*"?null:t),setValue:(t,s)=>this.setCartesianAxisThemeOverrides(e,[{expression:t==="*"?null:t,value:s}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getSeriesOptionsProxy(e){return{getValue:(t,s)=>this.getSeriesOption(e(),t,s),setValue:(t,s)=>this.setSeriesOptions(e(),[{expression:t,value:s}]),setValues:t=>this.setSeriesOptions(e(),t)}}getPersistedChartThemeOverrides(e,t,s,i){const r=this.getRetainedChartThemeOverrideKeys(s,i),o=this.getRetainedChartAxisThemeOverrideKeys(null,s,i),n=this.createChartOptions();for(const a of r){const l=this.retrieveChartOptionsThemeOverride(e,s,a);l!==void 0&&this.assignChartOptionsThemeOverride(n,i,a,l)}return t&&this.assignPersistedAxisOverrides({existingAxes:t,retainedChartAxisThemeOverrideKeys:o,existingChartOptions:e,targetChartOptions:n,existingChartType:s,targetChartType:i}),n.theme.overrides}assignPersistedAxisOverrides(e){const{existingAxes:t,retainedChartAxisThemeOverrideKeys:s,existingChartOptions:i,targetChartOptions:r,existingChartType:o,targetChartType:n}=e;for(const{expression:a,targetAxisTypes:l}of s)for(const c of t.map(d=>d.type)){const d=this.retrieveChartOptionsThemeOverride(i,o,["axes",c,a].join("."));if(d!==void 0)for(const u of l)this.assignChartOptionsThemeOverride(r,n,["axes",u,a].join("."),d)}}getRetainedChartThemeOverrideKeys(e,t){const s=["animation"],i=["zoom","navigator"],r=((o,n)=>{const a=new Array;return or(ye(o))&&or(ye(n))&&a.push(...i),a})(e,t);return[...s,...r]}getRetainedChartAxisThemeOverrideKeys(e,t,s){return or(ye(t))&&or(ye(s))?this.getRetainedCartesianAxisThemeOverrideKeys(e).map(r=>({expression:r,targetAxisTypes:DR})):[]}getRetainedCartesianAxisThemeOverrideKeys(e){const t=e==="xAxis"?["",".top",".bottom"]:e==="yAxis"?["",".left",".right"]:["",".left",".right",".top",".bottom"],s=["crosshair"],i=new Array;for(const r of s)for(const o of t)i.push(`${r}${o}`);return i}getChartOption(e){return rr(this.getChart(),e,void 0)}setChartThemeOverrides(e){const t=this.getChartType(),s=this.createChartOptions();for(const{expression:i,value:r}of e)this.assignChartOptionsThemeOverride(s,t,i,r);this.applyChartOptions(s)}applyChartOptions(e,t){if(Object.keys(e).length===0)return;this.updateChart(e),!t?.silent&&this.raiseChartOptionsChangedEvent()}awaitChartOptionUpdate(e){this.chartController.getChartProxy().getChart().waitForUpdate().then(()=>e()).catch(s=>Q(108,{e:s}))}getAxisProperty(e){return rr(this.getChart().axes?.x,e,void 0)}setAxisThemeOverrides(e){const t=this.getChart(),s=this.getChartType(),i=this.createChartOptions();for(const{expression:r,value:o}of e){const n=Object.values(t.axes??{}).filter(a=>{const l=r.split(".");let c=a;for(const d of l){if(!(d in c))return!1;c=c[d]}return!0});if(n)for(const a of n)this.isValidAxisType(a)&&this.assignChartAxisThemeOverride(i,s,a.type,null,r,o)}this.applyChartOptions(i)}getCartesianAxisProperty(e,t){const s=this.getChartAxes(),i=this.getCartesianAxis(s,e);return rr(i,t,void 0)}getCartesianAxisThemeOverride(e,t){const s=this.getChartAxes(),i=this.getCartesianAxis(s,e);if(!i||!this.isValidAxisType(i))return;const r=this.getChartType(),o=this.getChart().getOptions();return this.retrieveChartAxisThemeOverride(o,r,i.type,e==="yAxis"?["left","right"]:["bottom","top"],t)}setCartesianAxisThemeOverrides(e,t){const s=this.getChartAxes(),i=this.getCartesianAxis(s,e);if(!i||!this.isValidAxisType(i))return;const r=this.getChartType(),o=this.createChartOptions();for(const{expression:n,value:a}of t)this.assignChartAxisThemeOverride(o,r,i.type,e==="yAxis"?["left","right"]:["bottom","top"],n,a);this.applyChartOptions(o)}setCartesianAxisOptions(e,t){this.updateCartesianAxisOptions(e,s=>{const i=e==="yAxis"?"y":"x";for(const{expression:r,value:o}of t)this.assignChartOption(s,`axes.${i}.${r}`,o)})}clearCartesianAxisOptions(e,t,s){this.updateCartesianAxisOptions(e,i=>{const r=e==="yAxis"?"y":"x";this.clearChartOption(i,`axes.${r}.${t}`,s)})}updateCartesianAxisOptions(e,t){const s=this.getChart().getOptions(),i="axes"in s?s.axes:void 0;if(!s||!i)return;const r=this.getChartAxes(),o=this.getCartesianAxis(r,e);if(!o)return;const n=this.createChartOptions();n.axes=i,t(n,o,s),this.applyChartOptions(n)}setCartesianCategoryAxisType(e,t){this.updateCartesianAxisOptions(e,(s,i,r)=>{const o=this.getChartType();this.assignPersistedAxisOverrides({existingAxes:[i],retainedChartAxisThemeOverrideKeys:this.getRetainedChartAxisThemeOverrideKeys(e,o,o),existingChartOptions:r,targetChartOptions:s,existingChartType:o,targetChartType:o}),this.assignChartOption(s,"axes.x.type",t),this.chartController.setCategoryAxisType(t)})}getCartesianAxis(e,t){if(!(e.length<2))switch(t){case"xAxis":return e[0].direction==="x"?e[0]:e[1];case"yAxis":return e[1].direction==="y"?e[1]:e[0]}}getSeriesOption(e,t,s){const i=this.getChart().series.find(r=>PZ(e,r));return rr(s?i:i?.properties.toJson(),t,void 0)}setSeriesOptions(e,t){const s=this.createChartOptions();for(const{expression:i,value:r}of t)this.assignChartOptionsSeriesThemeOverride(s,e,`series.${i}`,r);this.applyChartOptions(s)}getPairedMode(){return this.chartController.getChartProxy().isPaired()}setPairedMode(e){this.chartController.getChartProxy().setPaired(e)}getChartAxes(){const e=this.getChart();return Object.values(e.axes??{})}retrieveChartAxisThemeOverride(e,t,s,i,r){if(i)for(const o of i){const n=this.retrieveChartOptionsThemeOverride(e,t,["axes",s,o,...r?[r]:[]].join("."));if(n!==void 0)return n}else return this.retrieveChartOptionsThemeOverride(e,t,["axes",s,...r?[r]:[]].join("."))}assignChartAxisThemeOverride(e,t,s,i,r,o){if(i)for(const n of i)this.assignChartOptionsThemeOverride(e,t,["axes",s,n,...r?[r]:[]].join("."),o);else this.assignChartOptionsThemeOverride(e,t,["axes",s,...r?[r]:[]].join("."),o)}isValidAxisType(e){return FZ.includes(e.type)}getChartType(){return this.chartController.getChartType()}getChart(){return this.chartController.getChartProxy().getChart()}updateChart(e){const t=this.chartController.getChartProxy().getChartRef();t.skipAnimations(),t.updateDelta(e)}createChartOptions(){return{theme:{overrides:{}}}}retrieveChartOptionsThemeOverride(e,t,s){const i=this.getChartThemeOverridesSeriesTypeKeys(t);for(const r of i){const o=this.retrieveChartOptionsSeriesThemeOverride(e,r,s);if(o!==void 0)return o}}assignChartOptionsThemeOverride(e,t,s,i){const r=this.getChartThemeOverridesSeriesTypeKeys(t);for(const o of r)this.assignChartOptionsSeriesThemeOverride(e,o,s,i)}retrieveChartOptionsSeriesThemeOverride(e,t,s){return this.retrieveChartOption(e,["theme","overrides",t,...s?[s]:[]].join("."))}assignChartOptionsSeriesThemeOverride(e,t,s,i){this.assignChartOption(e,["theme","overrides",t,...s?[s]:[]].join("."),i)}getChartThemeOverridesSeriesTypeKeys(e){const t=this.chartController.getChartSeriesTypes(e);return this.chartController.isComboChart()&&t.push("common"),t}retrieveChartOption(e,t){return rr(e,t,void 0)}assignChartOption(e,t,s){Lj(e,t,s)}clearChartOption(e,t,s){const i=rr(e,t,void 0);i&&delete i[s]}raiseChartOptionsChangedEvent(){const e=this.chartController.getChartModel();this.eventSvc.dispatchEvent({type:"chartOptionsChanged",chartId:e.chartId,chartType:e.chartType,chartThemeName:this.chartController.getChartThemeName(),chartOptions:e.chartOptions})}};function PZ(e,t){return Bj(e)&&t.type===e}var MZ=class extends A{constructor(e){super(`
`),this.eChart=x,this.eWrapper=x,this.eChartContainer=x,this.eMenuContainer=x,this.eEmpty=x,this.params=e}wireBeans(e){this.crossFilterService=e.chartCrossFilterSvc,this.chartTranslation=e.chartTranslation,this.chartMenuSvc=e.chartMenuSvc,this.focusSvc=e.focusSvc,this.popupSvc=e.popupSvc,this.enterpriseChartProxyFactory=e.enterpriseChartProxyFactory,this.environment=e.environment}postConstruct(){const e={...this.params,chartType:ka(this.params.chartType),chartThemeName:this.getThemeName()},t=this.gos.get("enableRtl");this.eWrapper.classList.add(t?"ag-rtl":"ag-ltr");const s=this.createBean(new Cq(e));this.chartController=this.createManagedBean(new Qq(s)),this.chartOptionsService=this.createManagedBean(new EZ(this.chartController)),this.validateCustomThemes(),this.createChart(),this.params.insideDialog?this.addDialog():(this.addManagedEventListeners({stylesChanged:this.updateTheme.bind(this)}),this.updateTheme()),this.addMenu(),this.addManagedElementListeners(this.getGui(),{focusin:this.setActiveChartCellRange.bind(this)}),this.addManagedListeners(this.chartController,{chartModelUpdate:this.update.bind(this)}),this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes"],this.reactivePropertyUpdate.bind(this)),this.update(),this.raiseChartCreatedEvent()}updateTheme(){this.environment.applyThemeClasses(this.getGui())}createChart(){let e;this.chartProxy&&(e=this.chartProxy.destroy({keepChartInstance:!0}));const t=(r,o)=>{const n=this.params.crossFilteringContext;n.lastSelectedChartId=o?"":this.chartController.getChartId(),o&&this.params.crossFilteringResetCallback(),this.crossFilterService.filter(r,o)},s=this.chartController.getChartType(),i={agChartsExports:this.beans.agChartsExports,chartType:s,chartInstance:e,getChartThemeName:this.getChartThemeName.bind(this),getChartThemes:this.getChartThemes.bind(this),customChartThemes:this.gos.get("customChartThemes"),styleNonce:this.gos.get("styleNonce"),getGridOptionsChartThemeOverrides:()=>this.getGridOptionsChartThemeOverrides(),getExtraPaddingDirections:()=>this.chartMenu?.getExtraPaddingDirections()??[],apiChartThemeOverrides:this.params.chartThemeOverrides,crossFiltering:this.params.crossFiltering??!1,crossFilterCallback:t,parentElement:this.eChart,grouping:this.chartController.isGrouping(),chartThemeToRestore:this.params.chartThemeName,chartOptionsToRestore:this.params.chartOptionsToRestore,chartPaletteToRestore:this.params.chartPaletteToRestore,seriesChartTypes:this.chartController.getSeriesChartTypes(),translate:r=>this.chartTranslation.translate(r),context:N(this.gos,{})};if(this.params.chartOptionsToRestore=void 0,this.chartType=s,this.chartProxy=this.createChartProxy(i),!this.chartProxy){F(138,{chartType:i.chartType});return}this.chartController.setChartProxy(this.chartProxy),this.createMenuContext()}createMenuContext(){if(this.chartMenuContext)return;const e=this.createManagedBean(new qr(this.chartOptionsService.getChartThemeOverridesProxy())),t=this.createManagedBean(new qr(this.chartOptionsService.getAxisThemeOverridesProxy()));this.chartMenuContext={chartController:this.chartController,chartOptionsService:this.chartOptionsService,chartMenuParamsFactory:e,chartAxisMenuParamsFactory:t}}getChartThemeName(){return this.chartController.getChartThemeName()}getChartThemes(){return this.chartController.getThemeNames()}getGridOptionsChartThemeOverrides(){return this.gos.get("chartThemeOverrides")}createChartProxy(e){const{chartType:t}=e;switch(t){case"column":case"bar":case"groupedColumn":case"stackedColumn":case"normalizedColumn":case"groupedBar":case"stackedBar":case"normalizedBar":return new tY(e);case"pie":case"donut":case"doughnut":return new nY(e);case"area":case"stackedArea":case"normalizedArea":return new Jq(e);case"line":case"stackedLine":case"normalizedLine":return new sY(e);case"scatter":case"bubble":return new iY(e);case"columnLineCombo":case"areaColumnCombo":case"customCombo":return new rY(e)}const s=this.enterpriseChartProxyFactory?.createChartProxy(e);if(!s)throw Ft(251,{chartType:t});return s}addDialog(){const e=this.chartTranslation.translate(this.params.pivotChart?"pivotChartTitle":"rangeChartTitle"),{width:t,height:s}=this.getBestDialogSize(),i=this.params.focusDialogOnOpen?()=>setTimeout(()=>Ge(this.getGui())):void 0;this.chartDialog=new Xc({resizable:!0,movable:!0,maximizable:!0,title:e,width:t,height:s,component:this,centered:!0,closable:!0,afterGuiAttached:i,postProcessPopupParams:{type:"chart"}}),this.createBean(this.chartDialog),this.chartDialog.addEventListener("destroyed",()=>{this.destroy(),this.chartMenuSvc.hideAdvancedSettings();const r=this.focusSvc.getFocusedCell();setTimeout(()=>{this.focusSvc.isAlive()&&(r?this.focusSvc.setFocusedCell({...r,forceBrowserFocus:!0}):zu(this.beans))})})}getBestDialogSize(){const e=this.popupSvc.getPopupParent(),t=bi(e)*.75,s=hn(e)*.75,i=.553,r=this.chartProxy.getChart();let o=this.params.insideDialog?850:r.width,n=this.params.insideDialog?470:r.height;return(o>t||n>s)&&(o=Math.min(o,t),n=Math.round(o*i),n>s&&(n=s,o=Math.min(o,Math.round(n/i)))),{width:o,height:n}}addMenu(){this.params.crossFiltering||(this.chartMenu=this.createBean(new xZ(this.eChartContainer,this.eMenuContainer,this.chartMenuContext)),this.eChartContainer.appendChild(this.chartMenu.getGui()))}update(e){if(e?.chartId&&!this.chartController.update(e))return;const t=this.chartTypeChanged(e),s=t||this.chartEmpty?(r=>{const o=this.chartType,n=r,a=this.chartProxy.getChart(),l=a?.getOptions(),c=Object.values(a?.axes??{});return this.chartOptionsService.getPersistedChartThemeOverrides(l,c,o,n??o)})(t):void 0;t&&this.createChart(),s&&e?.chartThemeOverrides&&Oe(s,e.chartThemeOverrides);const i=s??e?.chartThemeOverrides;this.updateChart(i),e?.chartId&&this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartApiUpdateEvent()})}updateChart(e){const{chartProxy:t}=this,s=this.chartController.getSelectedValueColState(),i=this.chartController.getChartData(),r=this.handleEmptyChart(i,s.length);if(this.chartEmpty=r,r){e&&this.chartController.updateThemeOverrides(e);return}const o=this.chartController.getChartUpdateParams(e);t.update(o),this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartUpdatedEvent()})}chartTypeChanged(e){const[t,s]=[this.chartController.getChartType(),e?.chartType],i=s?ka(s):void 0;return this.chartType!==t?i??t:i&&t!==i?i:null}getChartModel(){return this.chartController.getChartModel()}getChartImageDataURL(e){return this.chartProxy.getChartImageDataURL(e)}handleEmptyChart(e,t){const s=this.chartController.isPivotChart()&&!this.chartController.isPivotMode(),i=this.chartController.getChartType();let r=1;this.chartController.isActiveXYChart()?r=i==="bubble"?3:2:jr(ye(i))&&(r=0);const o=ti!=null))for(const i of Object.keys(s))t[i]=null;return Object.keys(t)}validateCustomThemes(){const e=this.getChartThemes(),t=this.gos.get("customChartThemes");if(t)for(const s of this.getAllKeysInObjects([t]))e.includes(s)||F(139,{customThemeName:s})}reactivePropertyUpdate(){this.chartController.setChartThemeName(this.getThemeName(),!0);const e=this.getChartId(),t=this.chartController.isCrossFilterChart()?"crossFilter":this.getChartModel().modelType,s=this.gos.get("chartThemeOverrides")||{};this.update({type:`${t}ChartUpdate`,chartId:e,chartThemeOverrides:s})}raiseChartCreatedEvent(){this.chartProxy.getChart().waitForUpdate().then(()=>{this.eventSvc.dispatchEvent({type:"chartCreated",chartId:this.chartController.getChartId()})})}raiseChartDestroyedEvent(){this.eventSvc.dispatchEvent({type:"chartDestroyed",chartId:this.chartController.getChartId()})}destroy(){super.destroy(),this.chartProxy&&this.chartProxy.destroy(),this.destroyBean(this.chartMenu),this.chartDialog?.isAlive()&&this.destroyBean(this.chartDialog),this.onDestroyColorSchemeChangeListener?.();const e=this.getGui();ee(e),ue(e),this.raiseChartDestroyedEvent()}},Ba=!1;function TZ(e){const t=e.version;return e.version==null&&(e.version=$Z(e)),e=ht("23.0.0",e,DZ),e=ht("24.0.0",e,AZ),e=ht("25.1.0",e,IZ),e=ht("26.0.0",e,kZ),e=ht("26.1.0",e,LZ),e=ht("26.2.0",e,GZ),e=ht("28.0.0",e,OZ),e=ht("28.2.0",e,VZ),e=ht("29.0.0",e,BZ),e=ht("29.1.0",e,AR),e=ht("29.2.0",e,IR),e=ht("30.0.0",e,NZ),e=ht("31.0.0",e,HZ),e=ht("32.0.0",e,zZ),e=ht("33.0.0",e,_Z),e=ht("34.0.0",e,WZ),e=UZ(e),e=ht(Y,e,s=>s),Ba&&t!==e.version&&console.log("AG Grid: ChartModel migration complete",{model:e}),e}function DZ(e){return e=gt("chartOptions.legend.item.marker.type","shape",e),e=gt("chartOptions.seriesDefaults.marker.type","shape",e),e=gt("chartOptions.legend.padding","spacing",e),e}function AZ(e){e=xe("chartOptions.seriesDefaults.marker.minSize",e);const{chartType:t,chartPalette:s,chartOptions:{xAxis:i,yAxis:r,...o},...n}=e,l=Kj(t)?.map((d,u)=>({type:d,...u===0?i:r}));return{chartType:t,chartThemeName:{borneo:"ag-default",material:"ag-material",bright:"ag-vivid"}[s]??"ag-default",chartOptions:{...o,axes:l,xAxis:i,yAxis:r},...n}}function IZ(e){return e=gt("chartOptions.seriesDefaults.label.minRequiredAngle","minAngle",e),e}function kZ(e){return e=mi("chartOptions.seriesDefaults.highlightStyle",e,({dimOpacity:s,...i})=>({...i,...s!=null?{series:{dimOpacity:s}}:{}})),e=xe("chart",e),e=xe("chartOptions.seriesDefaults.tooltipClass",e),e=xe("chartOptions.seriesDefaults.tooltipTracking",e),e=LR("chartOptions.axes[].label.rotation",0,e),e=LR("chartOptions.axes[].label.rotation",335,e),e}function LZ(e){const t=({item:s,series:i,...r})=>({item:{...r,...s},...i?{series:i}:{}});return e=mi("chartOptions.seriesDefaults.highlightStyle",e,t),e=mi("chartOptions.series[].highlightStyle",e,t),e}function GZ(e){e=kd("chartOptions.seriesDefaults.fill.opacity","chartOptions.seriesDefaults.fillOpacity",e),e=kd("chartOptions.seriesDefaults.stroke.opacity","chartOptions.seriesDefaults.strokeOpacity",e),e=kd("chartOptions.seriesDefaults.stroke.width","chartOptions.seriesDefaults.strokeWidth",e),e=xe("chartOptions.seriesDefaults.fill",e),e=xe("chartOptions.seriesDefaults.stroke",e),e=xe("chartOptions.seriesDefaults.callout.colors",e),e=xe("chartOptions.xAxis",e),e=xe("chartOptions.yAxis",e);const{chartType:t,chartOptions:{axes:s,series:i,seriesDefaults:r,...o},...n}=e,a=ka(t),l=ye(a),c=[l],d={};if(!Kx(l)){const h={top:{},bottom:{},left:{},right:{}},g=s.map(({type:p,...f})=>({[p]:{...h,...f}})).reduce(VR,{});for(const p of qx.filter(f=>g[f]==null))g[p]={...h};d.axes=g}const u=c.map(h=>({[h]:{...d,series:r,...o}})).reduce(VR,{});return e={...n,chartType:a,chartOptions:u},e}function OZ(e){return e=xe("chartOptions.*.title.padding",e),e=xe("chartOptions.*.subtitle.padding",e),e=xe("chartOptions.*.axes.*.title.padding",e),e=Uf("chartOptions.*.axes.*.title.enabled",!1,e),e}function VZ(e){return e=gt("chartOptions.pie.series.callout","calloutLine",e),e=gt("chartOptions.pie.series.label","calloutLabel",e),e=gt("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=gt("chartOptions.pie.series.labelName","sectorLabelName",e),e=gt("chartOptions.donut.series.callout","calloutLine",e),e=gt("chartOptions.donut.series.label","calloutLabel",e),e=gt("chartOptions.donut.series.labelKey","sectorLabelKey",e),e=gt("chartOptions.donut.series.labelName","sectorLabelName",e),e}function BZ(e){return e=Na("chartOptions.scatter.series.fill","chartOptions.scatter.series.marker.fill",e),e=Na("chartOptions.scatter.series.fillOpacity","chartOptions.scatter.series.marker.fillOpacity",e),e=Na("chartOptions.scatter.series.stroke","chartOptions.scatter.series.marker.stroke",e),e=Na("chartOptions.scatter.series.strokeOpacity","chartOptions.scatter.series.marker.strokeOpacity",e),e=Na("chartOptions.scatter.series.strokeWidth","chartOptions.scatter.series.marker.strokeWidth",e),e=kd("chartOptions.scatter.series.paired","chartOptions.scatter.paired",e),e}function AR(e){return e=xe("chartOptions.axes[].tick.count",e),e}function IR(e){return e=mi("chartOptions.*.tooltip",e,({tracking:s,...i})=>{const r={...i};return s===!1?(r.position??(r.position={type:"pointer"}),r.range??(r.range="nearest")):s===!0&&(r.position??(r.position={type:"node"}),r.range??(r.range="nearest")),r}),e}function NZ(e){return e=gt("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=gt("chartOptions.pie.series.labelName","sectorLabelName",e),e=AR(e),e=IR(e),e=xe("chartOptions.*.series.flipXY",e),e=GR("chartOptions.common.legend.enabled",!0,e),e=Uf("chartOptions.common.legend.position","right",e),e}function HZ(e){const t={"ag-pastel":"ag-sheets","ag-solar":"ag-polychroma"},s=gt("chartOptions.column","bar",e),i=t[s.chartThemeName]||s.chartThemeName;return{...s,chartThemeName:i}}function zZ(e){return e=fs("chartOptions.*.autoSize",!0,e,(t,s)=>{t[s]===!0||t[s]===!1&&(t.minHeight=600,t.minWidth=300),delete t[s]}),e}function _Z(e){return e=xe("chartOptions.*.axes.category.label.format",e),e=xe("chartOptions.*.axes.category.crosshair.label.format",e),e=xe("chartOptions.*.axes.angle-category.label.format",e),e=xe("chartOptions.*.axes.radius-category.label.format",e),e=gt("chartOptions.*.axes.*.label.padding","spacing",e),e=gt("chartOptions.*.navigator.miniChart.label.padding","spacing",e),e=xe("chartOptions.*.axes.*.crossLines.label.className",e),e=fs("chartOptions.*.axes.*.crossLines.label.position",!0,e,(t,s)=>{typeof t[s]=="string"&&(t[s]=t[s].replace(/([A-Z])/,"-$1").toLowerCase())}),e=xe("chartOptions.bullet",e),e=OR("chartOptions.bar.series.label.placement",e,{inside:"inside-center",outside:"inside-end"}),e=OR("chartOptions.waterfall.series.item.*.label.placement",e,{inside:"inside-center",start:"outside-start",end:"outside-end"}),e=xe("chartOptions.*.navigator.min",e),e=xe("chartOptions.*.navigator.max",e),e=xe("chartOptions.*.zoom.ratioX",e),e=xe("chartOptions.*.zoom.ratioY",e),e=xe("chartOptions.*.zoom.rangeX",e),e=xe("chartOptions.*.zoom.rangeY",e),e}function WZ(e){return fs("chartOptions.series[].highlightStyle",!0,e,(s,i)=>{const r=s[i];if(r==null)return;const o={};if(r.item&&(o.highlightedItem=r.item),r.series){const{dimOpacity:n,...a}=r.series;n!=null&&(o.unhighlightedSeries={opacity:n}),Object.keys(a).length>0&&(o.highlightedSeries=a)}delete s[i],s.highlight=o}),e}function UZ(e){return e=xe("chartOptions.*.width",e),e=xe("chartOptions.*.height",e),e=Uf("chartOptions.*.axes.category.label.autoRotate",!0,e),e}function $Z(e){const t=e;if(e.version!=null)return e.version;const s=(c,...d)=>Object.keys(c||{}).some(u=>d.includes(u)),i=t.chartOptions,r=s(i,"seriesDefaults")?i?.seriesDefaults:i?.[Object.keys(i)[0]],o={"27.0.0":s(t,"seriesChartTypes"),"26.2.0":!s(i,"seriesDefaults"),"26.1.0":s(r?.highlightStyle,"item"),"26.0.0":s(r?.highlightStyle,"series"),"25.1.0":s(r?.label,"minAngle"),"25.0.0":s(t,"modelType","aggFunc","unlinkChart","suppressChartRanges")||s(r,"lineDash","lineDashOffset"),"24.0.0":s(t,"chartThemeName","chart")||s(i,"series"),"23.2.0":s(i,"navigator"),"23.0.0":s(i?.legend?.item?.marker,"shape"),"22.1.0":s(t,"chartPalette","chartType")},n="27.1.0",a=Object.entries(o).filter(([c,d])=>d);Ba&&console.log("AG Grid: ChartModel migration",{heuristicVersionCandidates:a});const[l=n]=a[0];return Ba&&console.log("AG Grid: ChartModel migration",{heuristicVersion:l}),l}function ht(e,t,s){if(kR(e)>kR(t.version)){Ba&&console.log("AG Grid: ChartModel migration",{migratingTo:e});const i=s(t);return i.version=e,Ba&&console.log("AG Grid: ChartModel migration",{migratedTo:e,result:i}),i}return t}function KZ(e){const t=e.includes("-beta")?e.replace(/-beta.*/,""):e,s=typeof t=="string"?t.split(".").map(i=>Number(i)):[];if(s.length!==3||s.some(i=>isNaN(i)))throw new Error(Ft(253,{version:t}));return{major:s[0],minor:s[1],patch:s[2]}}function kR(e){const{major:t,minor:s,patch:i}=KZ(e);return t*1e4+s*100+i}function LR(e,t,s){return fs(e,!0,s,(i,r)=>{i[r]===t&&delete i[r]})}function Uf(e,t,s){return fs(e,!1,s,(i,r)=>{i[r]==null&&(i[r]=t)})}function GR(e,t,s){typeof e=="string"&&(e=e.split("."));const i=e[0];return e.length>1&&(s[i]=GR(e.slice(1),t,s[i]??{})),Object.keys(s).includes(i)||(s[i]=t),s}function kd(e,t,s){let i,r=!1;return s=fs(e,!0,s,(o,n)=>{r=!0,i=o[n],delete o[n]}),r?fs(t,!1,s,(o,n)=>{o[n]=i}):s}function Na(e,t,s){let i,r=!1;return s=fs(e,!0,s,(o,n)=>{r=!0,i=o[n],delete o[n]}),r?fs(t,!1,s,(o,n)=>{o[n]===void 0&&(o[n]=i)}):s}function gt(e,t,s){return fs(e,!0,s,(i,r)=>{i[t]=i[r],delete i[r]})}function xe(e,t){return fs(e,!0,t,(s,i)=>delete s[i])}function fs(e,t,s,i){const r=e instanceof Array?e:e.split("."),o=r.slice(0,r.length-1),n=r[r.length-1];return mi(o,s,a=>{const l=Object.keys(a).includes(n);if(t&&!l)return a;const c={...a};return i(c,n),c})}function mi(e,t,s){const i=e instanceof Array?e:e.split(".");if(t={...t},i.length===0)return s(t);if(i[0].startsWith("{")){const r=i[0].substring(1,i[0].lastIndexOf("}")).split(",");for(const o of r)t[o]!=null&&(t[o]=mi(i.slice(1),t[o],s))}else if(i[0].endsWith("[]")){const r=i[0].substring(0,e[0].indexOf("["));t[r]instanceof Array&&(t[r]=t[r].map(o=>mi(i.slice(1),o,s)))}else if(i[0]==="*")for(const r of Object.keys(t))t[r]=mi(i.slice(1),t[r],s);else t[i[0]]!=null&&(t[i[0]]=mi(i.slice(1),t[i[0]],s));return t}function OR(e,t,s){return fs(e,!0,t,(i,r)=>{typeof i[r]=="string"&&(i[r]=s[r]??r)})}var VR=(e,t)=>({...e,...t}),jZ=class extends E{constructor(){super(...arguments),this.beanName="chartSvc",this.activeCharts=new Set,this.activeChartComps=new Set,this.crossFilteringContext={lastSelectedChartId:""},this.isEnterprise=()=>this.agChartsExports.isEnterprise}wireBeans(e){this.visibleCols=e.visibleCols,this.rangeSvc=e.rangeSvc,this.agChartsExports=e.agChartsExports}updateChart(e){if(this.activeChartComps.size===0){F(124);return}const t=[...this.activeChartComps].find(s=>s.getChartId()===e.chartId);if(!t){F(125,{chartId:e.chartId});return}t.update(e)}getChartModels(){const e=[],t=s=>({...s,version:Y});for(const s of this.activeChartComps)e.push(t(s.getChartModel()));return e}getChartRef(e){let t;for(const s of this.activeCharts)s.chartId===e&&(t=s);return t}getChartComp(e){let t;for(const s of this.activeChartComps)s.getChartId()===e&&(t=s);return t}getChartImageDataURL(e){let t;for(const s of this.activeChartComps)s.getChartId()===e.chartId&&(t=s.getChartImageDataURL(e.fileFormat));return t}downloadChart(e){Array.from(this.activeChartComps).find(s=>s.getChartId()===e.chartId)?.downloadChart(e.dimensions,e.fileName,e.fileFormat)}openChartToolPanel(e){Array.from(this.activeChartComps).find(s=>s.getChartId()===e.chartId)?.openChartToolPanel(e.panel)}closeChartToolPanel(e){Array.from(this.activeChartComps).find(s=>s.getChartId()===e)?.closeChartToolPanel()}createChartFromCurrentRange(e="groupedColumn",t){const s=this.getSelectedRange();return this.createChart({cellRange:s,chartType:e,focusDialogOnOpen:!t})}restoreChart(e,t){if(!e){F(126);return}e.version!==Y&&(e=TZ(e));let s,i,r,o;if(e.modelType==="pivot"?(this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"}),s=this.createCellRange(void 0,!0),i=!0,r=!0):(s=this.createCellRange(e.cellRange),o=e.chartPalette,r=e.suppressChartRanges),!!s)return this.createChart({...e,cellRange:s,pivotChart:i,suppressChartRanges:r,chartContainer:t,chartOptionsToRestore:e.chartOptions,chartPaletteToRestore:o})}createRangeChart(e,t){const s=this.createCellRange(e.cellRange);if(s)return this.createChart({...e,cellRange:s,focusDialogOnOpen:!t})}createPivotChart(e,t){this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"});const s=this.createCellRange(void 0,!0);if(s)return this.createChart({...e,cellRange:s,pivotChart:!0,suppressChartRanges:!0,focusDialogOnOpen:!t})}createCrossFilterChart(e,t){const s=this.createCellRange(e.cellRange);if(!s)return;const r=typeof e.suppressChartRanges<"u"&&e.suppressChartRanges!==null?e.suppressChartRanges:!0;return this.createChart({...e,cellRange:s,suppressChartRanges:r,crossFiltering:!0,crossFilteringSort:e.sort,focusDialogOnOpen:!t})}createChart(e){const t=qq(e,this.agChartsExports.isEnterprise);if(!t)return;e=t===!0?e:t;const{chartType:s,chartContainer:i}=e,r=this.gos.getCallback("createChartContainer"),o={...e,chartId:this.generateId(),chartType:ka(s),insideDialog:!(i||r),crossFilteringContext:this.crossFilteringContext,crossFilteringResetCallback:()=>{for(const l of this.activeChartComps)l.crossFilteringReset()}},n=new MZ(o);this.createBean(n);const a=this.createChartRef(n);return i?i.appendChild(a.chartElement):r?r(a):n.addEventListener("destroyed",()=>{this.activeChartComps.delete(n),this.activeCharts.delete(a)}),a}createChartRef(e){const t={destroyChart:()=>{this.activeCharts.has(t)&&(this.destroyBean(e),this.activeChartComps.delete(e),this.activeCharts.delete(t))},focusChart:()=>{Ge(e.getGui())},chartElement:e.getGui(),chart:e.getUnderlyingChart(),chartId:e.getChartModel().chartId,setMaximized:e.setMaximized.bind(e)};return this.activeCharts.add(t),this.activeChartComps.add(e),t}getSelectedRange(){const e=this.rangeSvc?.getCellRanges();if(!e||e.length===0)return{columns:[]};const t=new Set;let s=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(const{startRow:o,endRow:n,columns:a}of e){if(!(o&&n))continue;for(const h of a)t.add(h);let{rowIndex:l,rowPinned:c}=o,{rowIndex:d,rowPinned:u}=n;if(c==="top"){if(u==="top")continue;l=0}if(u==="bottom"){if(c==="bottom")continue;d=this.beans.pageBounds.getLastRow()}l!==void 0&&(s=Math.min(s,l)),d!==void 0&&(i=Math.max(i,d))}if(s===Number.MAX_VALUE||i===-Number.MAX_VALUE)return{columns:[]};const r=Array.from(t);return{columns:r,startColumn:r[0],startRow:{rowIndex:s,rowPinned:void 0},endRow:{rowIndex:i,rowPinned:void 0}}}generateId(){return`id-${Math.random().toString(36).substring(2,18)}`}createCellRange(e,t){const s=t?{rowStartIndex:null,rowStartPinned:void 0,rowEndIndex:null,rowEndPinned:void 0,columns:this.visibleCols.allCols.map(r=>r.getColId())}:e,i=s&&this.rangeSvc?.createPartialCellRangeFromRangeParams(s,!0);return i||F(127,{allRange:t}),i}destroy(){for(const e of this.activeCharts)e.destroyChart();super.destroy()}};function qZ(e){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.getChartModels())}function YZ(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.getChartRef(t))}function XZ(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.getChartImageDataURL(t))}function ZZ(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.downloadChart(t))}function QZ(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.openChartToolPanel(t))}function JZ(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.closeChartToolPanel(t.chartId))}function eQ(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.createRangeChart(t,!0))}function tQ(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.createPivotChart(t,!0))}function sQ(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.createCrossFilterChart(t,!0))}function iQ(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.updateChart(t))}function rQ(e,t,s){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.restoreChart(t,s))}var oQ=`.ag-chart{display:flex;height:100%;position:relative;width:100%}.ag-chart-components-wrapper{display:flex}.ag-chart-canvas-wrapper,.ag-chart-components-wrapper{flex:1 1 auto;position:relative}.ag-chart-menu{background:var(--ag-background-color);background-color:color-mix(in srgb,transparent,var(--ag-background-color) 30%);border-radius:var(--ag-border-radius);display:flex;flex-direction:row;gap:20px;padding:4px 2px;position:absolute;top:8px;width:auto;--ag-icon-size:20px}:where(.ag-ltr) .ag-chart-menu{justify-content:right;right:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}:where(.ag-rtl) .ag-chart-menu{justify-content:left;left:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}.ag-chart-docked-container{min-width:var(--ag-chart-menu-panel-width);position:relative}:where(.ag-chart-menu-hidden)~.ag-chart-docked-container{display:none}.ag-chart-tabbed-menu{display:flex;flex-direction:column;height:100%;overflow:hidden;width:100%}.ag-chart-tabbed-menu-header{cursor:default;flex:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-tabbed-menu-body{align-items:stretch;display:flex;flex:1 1 auto;overflow:hidden;position:relative}.ag-chart-tabbed-menu-body:after{background:linear-gradient(var(--ag-background-color),transparent);content:"";display:block;height:16px;left:0;position:absolute;right:0;top:0}.ag-chart-tab{overflow:hidden;overflow-y:auto;width:100%}.ag-chart-settings{overflow-x:hidden}.ag-chart-settings-wrapper{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;width:100%}.ag-chart-settings-nav-bar{align-items:center;border-top:solid var(--ag-border-width) var(--ag-border-color);display:flex;height:30px;padding:0 10px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-chart-settings-card-selector{align-items:center;display:flex;flex:1 1 auto;height:100%;justify-content:space-around;padding:0 10px}.ag-chart-settings-card-item{background-color:var(--ag-foreground-color);border-radius:4px;cursor:pointer;height:8px;position:relative;width:8px;&.ag-not-selected{opacity:.2}&.ag-selected{background-color:var(--ag-accent-color)}}.ag-chart-settings-card-item:before{background-color:transparent;content:" ";display:block;height:20px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:50%;width:20px}.ag-chart-settings-next,.ag-chart-settings-prev{flex:none;position:relative}.ag-chart-settings-next:focus-within,.ag-chart-settings-prev:focus-within{border-radius:1px;box-shadow:var(--ag-focus-shadow)}.ag-chart-settings-next-button,.ag-chart-settings-prev-button{cursor:pointer;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.ag-chart-settings-mini-charts-container{flex:1 1 auto;overflow:hidden auto;position:relative}.ag-chart-settings-mini-wrapper{display:flex;flex-direction:column;left:0;min-height:100%;overflow:hidden;padding-bottom:var(--ag-widget-container-vertical-padding);position:absolute;top:0;width:100%;&.ag-animating{transition:left .3s;transition-timing-function:ease-in-out}}.ag-chart-mini-thumbnail{border:solid var(--ag-border-width) var(--ag-border-color);border-radius:5px;cursor:pointer;padding:1px;&.ag-selected{border-color:var(--ag-accent-color);border-width:calc(var(--ag-border-width) + 1px);padding:unset}&:focus-visible{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}}.ag-chart-mini-thumbnail-canvas{display:block}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper,.ag-chart-format-wrapper{display:flex;flex-direction:column;padding-bottom:16px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper{height:100%;overflow-y:auto}.ag-chart-advanced-settings{background-color:var(--ag-chrome-background-color)}.ag-chart-advanced-settings,.ag-chart-advanced-settings-wrapper{width:100%}.ag-chart-advanced-settings-wrapper{padding-bottom:0}.ag-chart-advanced-settings-section{border-bottom:solid var(--ag-border-width) var(--ag-border-color);display:flex;margin:0;padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding)}.ag-chart-empty-text{align-items:center;background-color:var(--ag-background-color);display:flex;height:100%;justify-content:center;top:0;width:100%}.ag-charts-font-size-color{align-self:stretch;display:flex;justify-content:space-between}.ag-chart-menu-icon{border-radius:var(--ag-border-radius);cursor:pointer;margin:2px 0;opacity:.8}.ag-chart-menu-icon:hover{opacity:1}.ag-chart-menu-toolbar-button{background-color:unset;border:0;border-radius:1px;padding:0 2px}.ag-chart-data-column-drag-handle{margin-left:var(--ag-spacing)}.ag-chart-data-section,.ag-chart-format-section{display:flex;margin:0;:where(.ag-label:not(.ag-group-title-bar)){color:var(--ag-chart-menu-label-color)}:where(.ag-label-align-top .ag-label){margin-bottom:var(--ag-widget-vertical-spacing);margin-top:calc(var(--ag-widget-vertical-spacing)*.5)}:where(.ag-slider.ag-label-align-top .ag-label){margin-bottom:0}.ag-label{display:inline-block}}.ag-chart-menu-panel{--ag-panel-background-color:var(--ag-chrome-background-color)}:where(.ag-ltr) .ag-chart-menu-panel{border-left:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-chart-menu-panel{border-right:solid var(--ag-border-width) var(--ag-border-color)}.ag-chart-data-wrapper,.ag-chart-format-wrapper{margin:0;padding:0}.ag-group{.ag-charts-data-group-item{padding-bottom:var(--ag-widget-container-vertical-padding);position:relative}.ag-charts-data-group-item:where(:not(:last-child)){margin-bottom:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-title-bar{background-color:unset;position:relative}.ag-charts-data-group-item:where(:not(.ag-charts-format-sub-level-group,.ag-pill-select,.ag-select)){height:var(--ag-list-item-height)}.ag-charts-data-group-item:where(.ag-picker-field){margin-top:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-item,.ag-charts-format-top-level-group-item{margin:var(--ag-spacing) 0}.ag-charts-format-sub-level-group-container{display:flex;flex-direction:column;padding:var(--ag-widget-vertical-spacing) 0}.ag-charts-settings-group-container{border-top:none;display:grid;font-weight:500;grid-template-columns:60px 1fr 60px 1fr 60px;row-gap:8px;:where(.ag-chart-mini-thumbnail:nth-child(3n+1)){grid-column:1}:where(.ag-chart-mini-thumbnail:nth-child(3n+2)){grid-column:3}:where(.ag-chart-mini-thumbnail:nth-child(3n+3)){grid-column:5}}.ag-charts-data-group-title-bar,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-title-bar{border-top:none;font-weight:500;margin:0;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:relative}.ag-charts-format-sub-level-group-title-bar{background:none;font-weight:500;padding:var(--ag-widget-vertical-spacing) 0}&.ag-charts-data-group,&.ag-charts-format-top-level-group{border-top:solid var(--ag-border-width) var(--ag-border-color)}.ag-charts-data-group-container,.ag-charts-format-top-level-group-container,.ag-charts-settings-group-container{margin:0;padding:0 var(--ag-widget-container-horizontal-padding)}.ag-charts-format-sub-level-group-item,.ag-charts-format-sub-level-no-header-group-item,.ag-charts-format-top-level-group-item{margin-bottom:var(--ag-widget-vertical-spacing)}&.ag-charts-format-sub-level-group,&.ag-charts-format-top-level-group,.ag-charts-format-sub-level-group-item:last-child,.ag-charts-format-top-level-group-item{margin:0;padding:0}.ag-charts-advanced-settings-top-level-group-container{margin:0}.ag-charts-advanced-settings-top-level-group-container,.ag-charts-advanced-settings-top-level-group-title-bar{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-charts-advanced-settings-top-level-group-item{margin-bottom:0;margin-top:calc(var(--ag-widget-vertical-spacing)*2)}}.ag-chart-settings-card-item.ag-not-selected:hover{opacity:.35}.ag-angle-select{align-items:center;display:flex}.ag-angle-select-wrapper{display:flex}.ag-angle-select-parent-circle{background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:12px;display:block;height:24px;position:relative;width:24px}.ag-angle-select-child-circle{background-color:var(--ag-foreground-color);border-radius:3px;height:6px;left:12px;margin-left:-3px;margin-top:-4px;position:absolute;top:4px;width:6px}.ag-slider-wrapper{display:flex;:where(.ag-input-field){flex:1 1 auto}}.ag-color-panel{display:flex;flex-direction:column;padding:var(--ag-spacing);text-align:center;width:100%}.ag-spectrum-color{cursor:default;flex:1 1 auto;overflow:visible;position:relative}.ag-spectrum-color,.ag-spectrum-fill{border-radius:var(--ag-border-radius)}.ag-spectrum-fill{inset:0;position:absolute}.ag-spectrum-val{background-image:linear-gradient(0deg,#000,hsla(20,42%,65%,0));cursor:pointer}.ag-spectrum-dragger{background:#000;border:var(--ag-color-picker-thumb-border-width) solid #fff;border-radius:var(--ag-color-picker-thumb-size);box-shadow:0 0 2px 0 rgba(0,0,0,.24);cursor:pointer;height:var(--ag-color-picker-thumb-size);pointer-events:none;position:absolute;width:var(--ag-color-picker-thumb-size)}.ag-spectrum-alpha,.ag-spectrum-hue{cursor:default}.ag-spectrum-hue-background{background:linear-gradient(270deg,red 3%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);height:100%;width:100%}.ag-spectrum-alpha-background{background:linear-gradient(to right,var(--ag-internal-spectrum-alpha-color-from),var(--ag-internal-spectrum-alpha-color-to)),url('data:image/svg+xml;utf8,') 0 0 /4px 4px;height:100%;width:100%}.ag-spectrum-tool{cursor:pointer;height:var(--ag-color-picker-track-size);margin-bottom:10px;position:relative}.ag-spectrum-slider,.ag-spectrum-tool{border-radius:var(--ag-color-picker-thumb-size)}.ag-spectrum-slider{border:var(--ag-color-picker-thumb-border-width) solid #fff;box-shadow:0 1px 4px 0 rgba(0,0,0,.37);height:var(--ag-color-picker-thumb-size);margin-top:calc(var(--ag-color-picker-track-size)/2*-1 + var(--ag-color-picker-thumb-size)/2*-1);pointer-events:none;position:absolute;width:var(--ag-color-picker-thumb-size)}:where(.ag-spectrum-alpha) .ag-spectrum-slider{background:linear-gradient(to bottom,var(--ag-internal-spectrum-alpha-color),var(--ag-internal-spectrum-alpha-color)) var(--ag-background-color)}.ag-recent-colors{display:flex;gap:6px;margin:10px var(--ag-spacing) 2px}.ag-recent-color{border:solid var(--ag-border-width) var(--ag-border-color);cursor:pointer}.ag-angle-select[disabled]{opacity:.5;pointer-events:none}:where(.ag-ltr) .ag-angle-select-field,:where(.ag-ltr) .ag-slider-field{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-angle-select-field,:where(.ag-rtl) .ag-slider-field{margin-left:calc(var(--ag-spacing)*2)}.ag-color-dialog{border-radius:5px}:where(.ag-color-picker){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}.ag-picker-field-display{align-items:center;display:flex;flex-direction:row;min-height:var(--ag-list-item-height)}}:where(.ag-ltr) .ag-color-picker-color,:where(.ag-ltr) .ag-color-picker-value{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-color-picker-color,:where(.ag-rtl) .ag-color-picker-value{margin-left:var(--ag-spacing)}.ag-spectrum-tools{padding:10px 0 0}.ag-spectrum-alpha-background,.ag-spectrum-hue-background{border-radius:var(--ag-color-picker-track-border-radius)}.ag-color-input-color,.ag-color-picker-color,.ag-recent-color{border-radius:var(--ag-color-picker-color-border-radius)}.ag-spectrum-sat{background-image:linear-gradient(90deg,#fff,hsla(20,42%,65%,0))}.ag-recent-color,.ag-spectrum-color,.ag-spectrum-slider{&:where(:not(:disabled,[readonly])):focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-color-input-color,.ag-color-picker-color{border:solid var(--ag-border-width) var(--ag-border-color);height:var(--ag-icon-size);width:var(--ag-icon-size)}:where(.ag-ltr) .ag-color-input .ag-input-field-input{padding-left:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}:where(.ag-rtl) .ag-color-input .ag-input-field-input{padding-right:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}:where(.ag-color-input) .ag-color-input-color{position:absolute}:where(.ag-ltr) :where(.ag-color-input) .ag-color-input-color{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-color-input) .ag-color-input-color{margin-right:var(--ag-spacing)}.ag-range-field{align-items:center;display:flex;:where(.ag-input-wrapper){height:100%}}.ag-range-field-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;height:100%;overflow:visible;padding:0;width:100%;&:disabled{opacity:.5}}.ag-range-field-input{&::-webkit-slider-runnable-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-webkit-slider-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-webkit-slider-runnable-track{background-color:var(--ag-accent-color)}}.ag-range-field-input{&::-moz-range-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-moz-ag-range-thumb{-moz-appearance:none;appearance:none;background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-moz-ag-range-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-moz-ag-range-track{background-color:var(--ag-accent-color)}}`,BR=28,NR=6;function $f(e){return e?.match(/\d+\.\d+\.\d+/)}function nQ({gridMajorVersion:e,chartsMajorVersion:t}){const s=parseInt(e,10),i=parseInt(t,10),r=s-BR,o=i-NR,n=r>=0;return r===o&&n}function aQ(e){if(!e||!$f(e))return;const[t,s]=e.split(".")||[],i=`${t}.${s}.x`,o=parseInt(t,10)-BR+NR;if(o<0)return;const a=`${o}.${s}.x`;return{gridMajorMinor:i,chartsMajorMinor:a}}function Ld({type:e,gridVersion:t,chartsVersion:s}){const i="AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.";if(!t)return i;const r=aQ(t);if(!r)return i;const{gridMajorMinor:o,chartsMajorMinor:n}=r;return e==="incompatible"?`AG Grid version ${t} and AG Charts version ${s} is not supported. AG Grid version ${o} should be used with AG Chart ${n}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:e==="invalidCharts"?`AG Grid version ${o} should be used with AG Chart ${n} not ${s}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:i}function lQ({gridVersion:e,chartsVersion:t}){if(!$f(t))return{isValid:!1,message:Ld({type:"invalidCharts",gridVersion:e,chartsVersion:t})};if(!$f(e))return{isValid:!1,message:Ld({type:"invalidGrid",gridVersion:e,chartsVersion:t})};const[s,i]=e.split(".")||[],[r,o,n]=t.split(".")||[],a=nQ({gridMajorVersion:s,chartsMajorVersion:r});return a&&i===o||n.includes("beta")?{isValid:!0}:!a||i!==o?{isValid:!1,message:Ld({type:"incompatible",gridVersion:e,chartsVersion:t})}:{isValid:!1,message:Ld({type:"invalid",gridVersion:e,chartsVersion:t})}}var cQ={linked:"linked",unlinked:"unlinked",chartsMenu:"menu-alt",chartsDownload:"save",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",chartsColorPicker:"small-down",chartsThemePrevious:"previous",chartsThemeNext:"next"},dQ={getChartModels:qZ,getChartRef:YZ,getChartImageDataURL:XZ,downloadChart:ZZ,openChartToolPanel:QZ,closeChartToolPanel:JZ,createRangeChart:eQ,createPivotChart:tQ,createCrossFilterChart:sQ,updateChart:iQ,restoreChart:rQ},Kf=[hd,le,Oi,$s,ed],HR="IntegratedCharts",uQ={moduleName:"GridCharts",version:Y,dependsOn:Kf,validate:()=>({isValid:!1,message:`AG Grid: As of v33, the "GridChartsModule" has been deprecated. Please use "IntegratedChartsModule.with(...)" instead. ${cl(257)}`})},jf={moduleName:HR,version:Y,dependsOn:Kf,validate:()=>({isValid:!1,message:cl(257)}),with:e=>{if(e.setup(),e.setGridContext?.(!0),e.isEnterprise&&e.setLicenseKey){const t={setLicenseKey:e.setLicenseKey};pa.setChartsLicenseManager(t)}return{moduleName:HR,version:Y,icons:cQ,apiFunctions:dQ,dependsOn:Kf,css:[oQ],validate:()=>lQ({gridVersion:Y,chartsVersion:e.VERSION}),beans:[Ij.bind(null,e),jZ,Bq,Aq,Tq,Oq,bq,Pq]}}},zR=[XS,v1,E0,N0,y1,x1,F1,Np,Hp,hd,A0,Jp,Xp,f1,m1,z1,_1,Ax,G0,W0,Wy,Sa,V0,C1,G1,B1,Ox,Vx,_x,qy],_R="AllEnterprise",WR={with:e=>({moduleName:_R,version:Y,dependsOn:[...zR,jf.with(e),Rf.with(e)]}),moduleName:_R,version:Y,dependsOn:zR};function hQ(){const e=globalThis?.agCharts,t=e?.AgChartsEnterpriseModule??e?.AgChartsCommunityModule;t&&nl.registerModules([jf.with(t),Rf.with(t)])}function gQ(e,t,s){return hQ(),ob(e,t,s)}if(Am(),nl.registerModules([WR]),typeof Ts.exports=="object"&&typeof en=="object"){var pQ=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Object.getOwnPropertyNames(t))!Object.prototype.hasOwnProperty.call(e,r)&&r!==s&&Object.defineProperty(e,r,{get:()=>t[r],enumerable:!(i=Object.getOwnPropertyDescriptor(t,r))||i.enumerable});return e};Ts.exports=pQ(Ts.exports,en)}return Ts.exports});