diff --git a/grid/index.js b/grid/index.js new file mode 100644 index 0000000..00abd9d --- /dev/null +++ b/grid/index.js @@ -0,0 +1 @@ +function e(e){if(e?.length)return e[e.length-1]}function t(e,t,o){if(e===t)return!0;if(!e||!t)return null==e&&null==t;const s=e.length;if(s!==t.length)return!1;for(let i=0;i=0&&e.splice(o,1)}function i(e,t){let o=0,s=0;for(;o=0;s--)e.splice(o,0,t[s])}var r=e=>null==e||""===e?null:e;function l(e){return null!=e&&""!==e}function a(e){return!l(e)}var d=e=>null!=e&&"function"==typeof e.toString?e.toString():null,c=(e,t)=>(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null),h=(e,t,o=!1)=>null==e?null==t?0:-1:null==t?1:("object"==typeof e&&e.toNumber&&(e=e.toNumber()),"object"==typeof t&&t.toNumber&&(t=t.toNumber()),o&&"string"==typeof e?e.localeCompare(t):e>t?1:e{const o=s?()=>s.wrapIncoming(e):e;t?this.dispatchAsync(o):o()},n=this.getListeners(o,t,!1);if((n?.size??0)>0){const t=new Set(n);for(const o of t)n?.has(o)&&i(()=>o(e))}const r=this.getGlobalListeners(t);if(r.size>0){const t=new Set(r);for(const s of t)i(()=>s(o,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const e=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)},t=this.frameworkOverrides;t?t.wrapIncoming(e):e(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}},g=/[&<>"']/g,p={"&":"&","<":"<",">":">",'"':""","'":"'"};function m(e){return e?.toString().toString()??null}function f(e){return m(e)?.replace(g,e=>p[e])??null}function C(e){return"string"==typeof e&&e.startsWith("=")&&e.length>1}function v(e){return e.eRootDiv.getRootNode()}function w(e){return v(e).activeElement}function b(e){const{gos:t,eRootDiv:o}=e;let s=null;const i=t.get("getDocument");return i&&l(i)?s=i():o&&(s=o.ownerDocument),s&&l(s)?s:document}function y(e){const t=w(e);return null===t||t===b(e).body}function S(e){return b(e).defaultView||window}function R(e){let t=null,o=null;try{t=b(e).fullscreenElement}catch(s){}finally{t||(t=v(e));o=t.querySelector("body")||(t instanceof ShadowRoot?t:t instanceof Document?t?.documentElement:t)}return o}function x(e,t,o){null==o||"string"==typeof o&&""==o?D(e,t):F(e,t,o)}function F(e,t,o){e.setAttribute(M(t),o.toString())}function D(e,t){e.removeAttribute(M(t))}function M(e){return`aria-${e}`}function P(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function E(e,t){x(e,"label",t)}function T(e,t){x(e,"labelledby",t)}function I(e,t){x(e,"describedby",t)}function A(e,t){x(e,"live",t)}function k(e,t){x(e,"invalid",t)}function L(e,t){x(e,"hidden",t)}function G(e,t){F(e,"expanded",t)}function N(e,t){F(e,"setsize",t)}function B(e,t){F(e,"posinset",t)}function H(e,t){F(e,"rowindex",t)}function O(e,t){F(e,"colindex",t)}function V(e,t){x(e,"selected",t)}function z(e,t){x(e,"owns",t)}function W(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}function U(e,t,o){const s=e.parentElement;let i=s&&s.firstChild;for(;i;)t&&i.classList.toggle(t,i===e),o&&i.classList.toggle(o,i!==e),i=i.nextSibling}var $="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function j(e){return!!e&&!!e.matches("input, select, button, textarea")&&!!e.matches($)&&re(e)}function K(e,t,o={}){const{skipAriaHidden:s}=o;e.classList.toggle("ag-hidden",!t),s||L(e,!t)}function _(e,t){const o="disabled",s=t?e=>e.setAttribute(o,""):e=>e.removeAttribute(o);s(e);const i=e.querySelectorAll("input")??[];for(const n of i)s(n)}function q(e,t,o){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof o){if(++s>o)break}else if(e===o)break}return!1}function Y(e){const{height:t,width:o,borderTopWidth:s,borderRightWidth:i,borderBottomWidth:n,borderLeftWidth:r,paddingTop:l,paddingRight:a,paddingBottom:d,paddingLeft:c,marginTop:h,marginRight:u,marginBottom:g,marginLeft:p,boxSizing:m}=window.getComputedStyle(e),f=Number.parseFloat;return{height:f(t||"0"),width:f(o||"0"),borderTopWidth:f(s||"0"),borderRightWidth:f(i||"0"),borderBottomWidth:f(n||"0"),borderLeftWidth:f(r||"0"),paddingTop:f(l||"0"),paddingRight:f(a||"0"),paddingBottom:f(d||"0"),paddingLeft:f(c||"0"),marginTop:f(h||"0"),marginRight:f(u||"0"),marginBottom:f(g||"0"),marginLeft:f(p||"0"),boxSizing:m}}function Z(e){const t=Y(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function Q(e){const t=Y(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function X(e){const{height:t,marginBottom:o,marginTop:s}=Y(e);return Math.floor(t+o+s)}function J(e){const{width:t,marginLeft:o,marginRight:s}=Y(e);return Math.floor(t+o+s)}function ee(e){const t=e.getBoundingClientRect(),{borderTopWidth:o,borderLeftWidth:s,borderRightWidth:i,borderBottomWidth:n}=Y(e);return{top:t.top+(o||0),left:t.left+(s||0),right:t.right+(i||0),bottom:t.bottom+(n||0)}}function te(e,t){let o=e.scrollLeft;return t&&(o=Math.abs(o)),o}function oe(e,t,o){o&&(t*=-1),e.scrollLeft=t}function se(e){for(;e?.firstChild;)e.firstChild.remove()}function ie(e){e?.parentNode&&e.remove()}function ne(e){return!!e.offsetParent}function re(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!ne(e)||"visible"!==window.getComputedStyle(e).visibility)}function le(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function ae(e,t,o){o&&o.nextSibling===t||(e.firstChild?o?o.nextSibling?e.insertBefore(t,o.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.prepend(t):e.appendChild(t))}function de(e,t){for(let o=0;o`-${e.toLocaleLowerCase()}`)}function he(e,t){if(t)for(const o of Object.keys(t)){const s=t[o];if(!o?.length||null==s)continue;const i=ce(o),n=s.toString(),r=n.replace(/\s*!important/g,""),l=r.length!=n.length?"important":void 0;e.style.setProperty(i,r,l)}}function ue(e){return()=>{const t=e();return!t||function(e){return e.clientWidthi?.disconnect()}function be(e,t){const o=S(e);o.requestAnimationFrame?o.requestAnimationFrame(t):o.webkitRequestAnimationFrame?o.webkitRequestAnimationFrame(t):o.setTimeout(t,0)}var ye,Se="data-ref";function Re(){return ye??(ye=document.createTextNode(" ")),ye.cloneNode()}function xe(e){const{attrs:t,children:o,cls:s,ref:i,role:n,tag:r}=e,l=document.createElement(r);if(s&&(l.className=s),i&&l.setAttribute(Se,i),n&&l.setAttribute("role",n),t)for(const a of Object.keys(t))l.setAttribute(a,t[a]);if(o)if("string"==typeof o)l.textContent=o;else{let e=!0;for(const t of o)t&&("string"==typeof t?(l.appendChild(document.createTextNode(t)),e=!1):"function"==typeof t?l.appendChild(t()):(e&&(l.appendChild(Re()),e=!1),l.append(xe(t)),l.appendChild(Re())))}return l}var Fe=["touchstart","touchend","touchmove","touchcancel","scroll"],De=["wheel"],Me={},Pe=/* @__PURE__ */(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof Me[t])return Me[t];const o=document.createElement(e[t]||"div");return Me[t="on"+t]=t in o}})();function Ee(e,t){return!(!t||!e)&&function(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():function(e){const t=[];let o=e.target;for(;o;)t.push(o),o=o.parentElement;return t}(t)}(t).indexOf(e)>=0}function Te(e,t,o){if(0===o)return!1;const s=Math.abs(e.clientX-t.clientX),i=Math.abs(e.clientY-t.clientY);return Math.max(s,i)<=o}var Ie=(e,t)=>{const o=e.identifier;for(let s=0,i=t.length;s{for(const o of t){const[t,s,i,n]=o;t.addEventListener(s,i,n),e.push(o)}},Le=e=>{if(e){for(const[t,o,s,i]of e)t.removeEventListener(o,s,i);e.length=0}},Ge=e=>{e.cancelable&&e.preventDefault()};function Ne(e,t){return t}function Be(e){return e?.getLocaleTextFunc()??Ne}var He=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 s;if(function(e){return void 0!==e.__addEventListener}(e))e.__addEventListener(t,o),s=()=>(e.__removeEventListener(t,o),null);else{const i=function(e){return"global"===e.eventServiceType}(e);e instanceof HTMLElement?function(e,t,o){const s=(e=>{const t=Fe.includes(e),o=De.includes(e);return!!t||!o&&void 0})(t);let i;null!=s&&(i={passive:s}),e.addEventListener(t,o,i)}(e,t,o):i?e.addListener(t,o):e.addEventListener(t,o),s=i?()=>(e.removeListener(t,o),null):()=>(e.removeEventListener(t,o),null)}return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==s),null)}setupPropertyListener(e,t){const{gos:o}=this;o.addPropertyEventListener(e,t);const s=()=>(o.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==s),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const o=e.join("-")+this.propertyListenerId++,s=e=>{if(e.changeSet){if(e.changeSet&&e.changeSet.id===this.lastChangeSetIdLookup[o])return;this.lastChangeSetIdLookup[o]=e.changeSet.id}t({type:"propertyChanged",changeSet:e.changeSet,source:e.source})};for(const i of e)this.setupPropertyListener(i,s)}getLocaleTextFunc(){return Be(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 o=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),o}createBean(e,t,o){return(t||this.stubContext).createBean(e,o)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}},Oe=class extends He{},Ve=/* @__PURE__ */new Set,ze=(e,t)=>{Ve.has(t)||(Ve.add(t),e())};ze._set=Ve;var We={pending:!1,funcs:[]},Ue={pending:!1,funcs:[]};function $e(e,t="setTimeout",o){const s="raf"===t?Ue:We;if(s.funcs.push(e),s.pending)return;s.pending=!0;const i=()=>{const e=s.funcs.slice();s.funcs.length=0,s.pending=!1;for(const t of e)t()};"raf"===t?be(o,i):window.setTimeout(i,0)}function je(e,t,o){let s;return function(...i){const n=this;return window.clearTimeout(s),s=window.setTimeout(function(){e.isAlive()&&t.apply(n,i)},o),s}}function Ke(e,t){let o=0;return function(...s){const i=Date.now();i-o{null!=n&&(window.clearInterval(n),n=null)};e.addDestroyFunc(l);const a=()=>{const e=Date.now()-i>s;(t()||e)&&(o(),r=!0,l())};a(),r||(n=window.setInterval(a,10))}var qe=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]);function Ye(e,t,o=!0,s=!1){l(t)&&function(e,t){if(null!=e)if(Array.isArray(e))for(let o=0;o!qe.has(e)))t(o,e[o])}(t,(t,i)=>{let n=e[t];n!==i&&(s&&null==n&&null!=i&&"object"==typeof i&&i.constructor===Object&&(n={},e[t]=n),Ze(i)&&Ze(n)&&!Array.isArray(n)?Ye(n,i,o,s):(o||void 0!==i)&&(e[t]=i))})}function Ze(e){return"object"==typeof e&&null!==e}var Qe=class e{static applyGlobalGridOptions(t){if(!e.gridOptions)return{...t};let o={};return Ye(o,e.gridOptions,!0,!0),"deep"===e.mergeStrategy?Ye(o,t,!0,!0):o={...o,...t},e.gridOptions.context&&(o.context=e.gridOptions.context),t.context&&("deep"===e.mergeStrategy&&o.context&&Ye(t.context,o.context,!0,!0),o.context=t.context),o}static applyGlobalGridOption(t,o){if("deep"===e.mergeStrategy){const i=(s=t,Xe.gridOptions?.[s]);if(i&&"object"==typeof i&&"object"==typeof o)return e.applyGlobalGridOptions({[t]:o})[t]}var s;return o}};Qe.gridOptions=void 0,Qe.mergeStrategy="shallow";var Xe=Qe,Je={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:"\t",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},et="https://www.ag-grid.com";function tt(e,t,...o){e.get("debug")}function ot(e,...t){ze(()=>{},e+t?.join(""))}function st(e,...t){ze(()=>{},e+t?.join(""))}var it,nt=/* @__PURE__ */new Set,rt={},lt={},at=!1,dt=!1;function ct(e,t,o=!1){o||(at=!0),function(e){it||(it=e.version);const t=e=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${e} Please update all modules to the same version.`;e.version?function(e){const[t,o]=e.version.split(".")||[],[s,i]=it.split(".")||[];return t===s&&o===i}(e)||st(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${it}.`)):st(t(`'${e.moduleName}' is incompatible.`));const o=e.validate?.();o&&!o.isValid&&st(`${o.message}`)}(e);const s=e.rowModels??["all"];let i;nt.add(e),void 0!==t?(dt=!0,void 0===lt[t]&&(lt[t]={}),i=lt[t]):i=rt;for(const n of s)void 0===i[n]&&(i[n]={}),i[n][e.moduleName]=e;if(e.dependsOn)for(const n of e.dependsOn)ct(n,t,o)}function ht(e,t,o){const s=o=>!!rt[o]?.[e]||!!lt[t]?.[o]?.[e];return s(o)||s("all")}function ut(){return dt}function gt(e,t){const o=lt[e]??{};return[...Object.values(o.all??{}),...Object.values(o[t]??{})]}var pt=class{static register(e){ct(e,void 0)}static registerModules(e){for(const t of e)ct(t,void 0)}},mt="35.2.0",ft="_version_",Ct=null,vt=`${et}/javascript-data-grid`;function wt(e,t,o){return Ct?.(e,t)??[Ft(e,t,o)]}function bt(e,t,o,s,i){e(`${s?"warning":"error"} #${t}`,...wt(t,o,i))}function yt(e){let t=e;return e instanceof Error?t=e.toString():"object"==typeof e&&(t=function(e){if(!e)return String(e);const t={};for(const o of Object.keys(e))"object"!=typeof e[o]&&"function"!=typeof e[o]&&(t[o]=e[o]);return JSON.stringify(t)}(e)),t}function St(e){return void 0===e?"undefined":null===e?"null":e}function Rt(e,t){return`${e}?${t.toString()}`}function xt(e,t){const o=new URLSearchParams;if(o.append(ft,mt),t)for(const n of Object.keys(t))o.append(n,yt(t[n]));const s=`${vt}/errors/${e}`,i=Rt(s,o);return i.length<=2e3?i:function(e,t){const o=Array.from(t.entries()).sort((e,t)=>t[1].length-e[1].length);let s=Rt(e,t);for(const[i,n]of o){if(i===ft)continue;const o=s.length-2e3;if(o<=0)break;const r="...",l=o+3,a=n.length-l>100?n.slice(0,n.length-l)+r:n.slice(0,100)+r;t.set(i,a),s=Rt(e,t)}return s}(s,o)}var Ft=(e,t,o)=>`${`${o?o+" \n":""}Visit ${xt(e,t)}`}${o?"":" \n Alternatively register the ValidationModule to see the full message in the console."}`;function Dt(...e){bt(ot,e[0],e[1],!0)}function Mt(...e){bt(st,e[0],e[1],!1)}function Pt(e,t,o){bt(st,e,t,!1,o)}function Et(...e){return function(e,t){const o=t[0];return`error #${o} `+wt(o,t[1],void 0).join(" ")}(0,e)}function Tt(e,t){return e.get("rowModelType")===t}function It(e,t){return Tt(e,"clientSide")}function At(e,t){return Tt(e,"serverSide")}function kt(e,t){return e.get("domLayout")===t}function Lt(e){return void 0!==ao(e)}function Gt(e){return"function"==typeof e.get("getRowHeight")}function Nt(e,t,o=!1,s){const{gos:i,environment:n}=e;if(null==s&&(s=n.getDefaultRowHeight()),Gt(i)){if(o)return{height:s,estimated:!0};const e={node:t,data:t.data},n=i.getCallback("getRowHeight")(e);if(Ht(n))return 0===n&&Dt(23),{height:Math.max(1,n),estimated:!1}}if(t.detail&&i.get("masterDetail"))return function(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return Ht(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}(i);const r=i.get("rowHeight");return{height:r&&Ht(r)?r:s,estimated:!1}}function Bt(e){const{environment:t,gos:o}=e,s=o.get("rowHeight");if(!s||a(s))return t.getDefaultRowHeight();const i=t.refreshRowHeightVariable();return-1!==i?i:(Dt(24),t.getDefaultRowHeight())}function Ht(e){return!isNaN(e)&&"number"==typeof e&&isFinite(e)}function Ot(e,t,o){const s=t[e.getDomDataKey()];return s?s[o]:void 0}function Vt(e,t,o,s){const i=e.getDomDataKey();let n=t[i];a(n)&&(n={},t[i]=n),n[o]=s}function zt(e){return!e.get("ensureDomOrder")&&e.get("animateRows")}function Wt(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||kt(e,"print"))}function Ut(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function $t(e){const t=e.get("groupAggFiltering");return"function"==typeof t?e.getCallback("groupAggFiltering"):!0===t?()=>!0:void 0}function jt(e){return e.get("grandTotalRow")}function Kt(e){const t=e.get("groupTotalRow");return"function"==typeof t?e.getCallback("groupTotalRow"):()=>t??void 0}function _t(e){return!!e.get("groupHideOpenParents")||"multipleColumns"===e.get("groupDisplayType")}function qt(e){return _t(e)&&e.get("groupHideColumnsUntilExpanded")&&It(e)}function Yt(e,t){return!t&&"groupRows"===e.get("groupDisplayType")}function Zt(e,t,o){return!!t.group&&!t.footer&&Yt(e,o)}function Qt(e){const t=e.getCallback("getRowId");return void 0===t?t:e=>{let o=t(e);return"string"!=typeof o&&(ze(()=>Dt(25,{id:o}),"getRowIdString"),o=String(o)),o}}function Xt(e,t){const o=e.get("suppressGroupChangesColumnVisibility");if(!0===o)return!1;if(t&&"suppressHideOnGroup"===o)return!1;if(!t&&"suppressShowOnUngroup"===o)return!1;const s=e.get("suppressRowGroupHidesColumns");if(t&&!0===s)return!1;const i=e.get("suppressMakeColumnVisibleAfterUnGroup");return!(!t&&!0===i)}function Jt(e){return e?.checkboxes??!0}function eo(e){return"multiRow"===e?.mode&&(e.headerCheckbox??!0)}function to(e){if("object"==typeof e)return e.checkboxLocation??"selectionColumn"}function oo(e){return e?.hideDisabledCheckboxes??!1}function so(e){const t=e.get("cellSelection");return void 0!==t?!!t:e.get("enableRangeSelection")}function io(e){const t=e.get("cellSelection");return void 0===t?{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}:"boolean"!=typeof t&&"fill"===t.handle?.mode?t.handle:void 0}function no(e){const t=e.get("cellSelection")??!1;return("object"==typeof t&&t.enableColumnSelection)??!1}function ro(e){const t=e.get("rowSelection")??"single";if("string"==typeof t){const t=e.get("suppressRowClickSelection"),o=e.get("suppressRowDeselection");return(!t||!o)&&(t?"enableDeselection":!o||"enableSelection")}return("singleRow"===t.mode||"multiRow"===t.mode)&&(t.enableClickSelection??!1)}function lo(e){const t=e.get("rowSelection");return"string"==typeof t?e.get("isRowSelectable"):t?.isRowSelectable}function ao(e){const t="beanName"in e&&"gos"===e.beanName?e.get("rowSelection"):e.rowSelection;if("string"==typeof t)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 co(e){return"multiRow"===ao(e)}function ho(e){const t=e.get("rowSelection");if("string"==typeof t){const t=e.get("groupSelectsChildren"),o=e.get("groupSelectsFiltered");return t&&o?"filteredDescendants":t?"descendants":"self"}return"multiRow"===t?.mode?t.groupSelects:void 0}function uo(e,t=!0){const o=e.get("rowSelection");return"object"!=typeof o?t?"all":void 0:"multiRow"===o.mode?o.selectAll:"all"}function go(e){const t=ho(e);return"descendants"===t||"filteredDescendants"===t}function po(e){const t=e.get("rowSelection");return"object"==typeof t&&t.masterSelects||"self"}function mo(e){return"legacy"===e.get("columnMenu")}function fo(e){return!mo(e)}function Co(e,t){return e.addCommon(t)}function vo({gos:e},t){return 2===t.button||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var wo={resizable:!0,sortable:!0},bo=0;function yo(){return bo++}function So(e){return e instanceof Fo}var Ro=["asc","desc",null],xo=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],Fo=class extends Oe{constructor(e,t,o,s){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=o,this.primary=s,this.isColumn=!0,this.instanceId=yo(),this.autoHeaderHeight=null,this.sortDef=Do(),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 u,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=f(o)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:o,colFlex:s}}=this;t?.initCol(this);const i=e.hide;this.visible=void 0!==i?!i:!e.initialHide,o?.initCol(this),s?.initCol(this)}setColDef(e,t,o){const s=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),s&&(this.beans.rowSpanSvc?.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",o)}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:o}}=this,s=e.get("suppressFieldDotNotation");this.fieldContainsDots=l(t)&&t.includes(".")&&!s,this.tooltipFieldContainsDots=l(o)&&o.includes(".")&&!s}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:t=>{const o=e.recreateColDef(this.colDef);this.setColDef(o,o,t.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 o=this.frameworkEventListenerService?.wrap(e,t)??t;this.colEventSvc.addEventListener(e,o)}removeEventListener(e,t){const o=this.frameworkEventListenerService?.unwrap(e,t)??t;this.colEventSvc.removeEventListener(e,o)}createColumnFunctionCallbackParams(e){return Co(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]??wo[e]}isColumnFunc(e,t){return"boolean"==typeof t?t:"function"==typeof t&&t(this.createColumnFunctionCallbackParams(e))}createColumnEvent(e,t){return Co(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:o}=this.colDef,s=null===t?t:Ao(t?.type),i=null===o?o:Ao(o?.type);return s&&e.push(s),i&&e.push(i),e}getSortingOrder(){const e=this.getColDefAllowedSortTypes().includes("absolute")?xo:Ro;return(this.colDef.sortingOrder??this.gos.get("sortingOrder")??e).map(e=>Do(e))}getAvailableSortTypes(){const e=this.getSortingOrder().reduce((e,t)=>(t.direction&&e.push(t.type),e),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"asc"===this.getSort()}isSortDescending(){return"desc"===this.getSort()}isSortNone(){return a(this.getSort())}isSorting(){return l(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 Dt(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"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(e,t){const o=!0===e;this.visible!==o&&(this.visible=o,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 o=!0;for(;e;){if(!e.isPadding()){o=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:o}}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 Co(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(a(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),o=this.colDef.colSpan(t);return Math.max(o,1)}getRowSpan(e){if(a(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),o=this.colDef.rowSpan(t);return Math.max(o,1)}setActualWidth(e,t,o=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,null!=this.flex&&"flex"!==t&&"gridInitializing"!==t&&(this.flex=null),o||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!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}isAllowFormula(){return!0===this.colDef.allowFormula}dispatchColEvent(e,t,o){const s=this.createColumnEvent(e,t);o&&Ye(s,o),this.colEventSvc.dispatchEvent(s)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function Do(e){return Eo(e)?{direction:e.direction,type:e.type}:{direction:Io(e),type:Ao(e)}}function Mo(e){return"asc"===e||"desc"===e||null===e}function Po(e){return"default"===e||"absolute"===e}function Eo(e){if(!e||"object"!=typeof e)return!1;const t=e;return Po(t.type)&&Mo(t.direction)}function To(e,t){return e?t?e.type===t.type&&e.direction===t.direction:!e||null===e.direction:!t||null===t.direction}function Io(e){return Mo(e)?e:null}function Ao(e){return Po(e)?e:"default"}function ko(e,t,o){const s=o?.()??t.sortSvc.getDisplaySortForColumn(e),i=Ao(s?.type),n=Io(s?.direction),r=e.getAvailableSortTypes();return{isDefaultSortAllowed:r.has("default"),isAbsoluteSortAllowed:r.has("absolute"),isAbsoluteSort:"absolute"===i,isDefaultSort:"default"===i,isAscending:"asc"===n,isDescending:"desc"===n,direction:n}}function Lo(e){return e instanceof Go}var Go=class extends Oe{constructor(e,t,o,s){super(),this.colGroupDef=e,this.groupId=t,this.padding=o,this.level=s,this.isColumn=!1,this.expandable=!1,this.instanceId=yo(),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())}isPadding(){return this.padding}setExpanded(e){this.expanded=void 0!==e&&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)So(t)?e(t):Lo(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)So(t)?e.push(t):Lo(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,o=!1;const s=this.findChildrenRemovingPadding();for(let n=0,r=s.length;n{for(const s of o)Lo(s)&&s.isPadding()?t(s.children):e.push(s)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},No={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function Bo(e,t,o){const s={},i=e.gos;return Object.assign(s,i.get("defaultColGroupDef")),Object.assign(s,t),i.validateColDef(s,o),s}var Ho=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t0&&Dt(273,{providedId:e,usedId:t}),this.existingKeys[t]=!0,t}o++}}},Oo=(e,t)=>{Lo(e)&&e.setupExpandable(),e.originalParent=t};function Vo(e,t=null,o,s,i){const{existingCols:n,existingGroups:r}=Wo(s),l=new Map(n.map(e=>[e.getId(),e])),a=new Map(r.map(e=>[e.getId(),e]));let d=0;const c=(t,s)=>{if(d=Math.max(d,s),qo(t)){if(!e.colGroupSvc)return null;const o=t.groupId,i=a.get(o),n=new Go(Bo(e,t,o),o,!1,s);return e.context.createBean(n),i&&n.setExpanded(i.isExpanded()),n.setChildren(t.children.map(e=>c(e,s+1))),n}const n=t.colId;let r=l.get(n);const h=_o(e,t,r?.getColId()??n);return r?(r.setColDef(h,t,i),Ko(e,r,h,i)):(r=new Fo(h,t,n,o),e.context.createBean(r)),e.dataTypeSvc?.addColumnListeners(r),r},h=t?.map(e=>c(e,0))??[];let u=0;const g=e.colGroupSvc?e.colGroupSvc.balanceColumnTree(h,0,d,{getUniqueKey:(e,t)=>String(++u)}):h;return Yo(null,g,Oo),{columnTree:g,treeDepth:d}}function zo(e,t=null,o,s,i){const n=new Ho,{existingCols:r,existingGroups:l,existingColKeys:a}=Wo(s);n.addExistingKeys(a);const d=Uo(e,t,0,o,r,n,l,i),{colGroupSvc:c}=e,h=c?.findMaxDepth(d,0)??0,u=c?c.balanceColumnTree(d,0,h,n):d;return Yo(null,u,Oo),{columnTree:u,treeDepth:h}}function Wo(e){const t=[],o=[],s=[];return e&&Yo(null,e,e=>{if(Lo(e)){const t=e;o.push(t)}else{const o=e;s.push(o.getId()),t.push(o)}}),{existingCols:t,existingGroups:o,existingColKeys:s}}function Uo(e,t,o,s,i,n,r,l){if(!t)return[];const{colGroupSvc:a}=e,d=new Array(t.length);for(let c=0;c0))if(null!=o.width)t.setActualWidth(o.width,s);else{const e=t.getActualWidth();t.setActualWidth(e,s)}}function _o(e,t,o,s){const{gos:i,dataTypeSvc:n}=e,r={},l=i.get("defaultColDef");Ye(r,l,!1,!0);const a=function(e,t,o,s){const i=e.dataTypeSvc?.updateColDefAndGetColumnType(t,o,s),n=o.type??i??t.type;return t.type=n,n?is(n):void 0}(e,r,t,o);a&&function(e,t,o){if(!t.length)return;const s=Object.assign({},No),i=e.gos.get("columnTypes")||{};for(const n of Object.keys(i)){const e=i[n];n in s?Dt(34,{key:n}):(e.type&&Dt(35),s[n]=e)}for(const n of t){const e=s[n.trim()];e?Ye(o,e,!1,!0):Dt(36,{t:n})}}(e,a,r);const d=r.cellDataType;Ye(r,t,!1,!0),void 0!==d&&(r.cellDataType=d);const c=i.get("autoGroupColumnDef"),h=Ut(i);return t.rowGroup&&c&&h&&Ye(r,{sort:c.sort,initialSort:c.initialSort},!1,!0),n?.postProcess(r),n?.validateColDef(r,t,l,o),i.validateColDef(r,o,s),r}function qo(e){return void 0!==e.children}function Yo(e,t,o){if(t)for(let s=0;s{for(let s=0;se+t.getActualWidth(),0)}function Jo(e,t,o){const s={};if(!t)return;Yo(null,t,e=>{s[e.getInstanceId()]=e}),o&&Yo(null,o,e=>{s[e.getInstanceId()]=null});const i=Object.values(s).filter(e=>null!=e);e.context.destroyBeans(i)}function es(e){return e.getId().startsWith(Zo)}function ts(e){return("string"==typeof e?e:"getColId"in e?e.getColId():e.colId)?.startsWith("ag-Grid-SelectionColumn")??!1}function os(e){return("string"==typeof e?e:"getColId"in e?e.getColId():e.colId)?.startsWith("ag-Grid-RowNumbersColumn")??!1}function ss(e){return ts(e)||os(e)}function is(e){let t=[];return e instanceof Array?t=e:"string"==typeof e&&(t=e.split(",")),t}function ns(e,o){return t(e,o,(e,t)=>e.getColId()===t.getColId())}function rs(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function ls(e){return"optionsUpdated"===e?"gridOptionsChanged":e}function as(e,t){return e===t||e.colId==t||e.getColDef()===t}function ds(e,t){const o={...e,sort:void 0,colId:t},s=cs(e);return s&&(o.sort=s.direction,o.sortType=s.type),o}function cs(e){const{sort:t,initialSort:o}=e,s=Eo(t)||Mo(t),i=Eo(o)||Mo(o);return s?Do(t):i?Do(o):null}function hs(e,t){return e+"_"+t}function us(e){return e instanceof gs}var gs=class extends Oe{constructor(e,t,o,s){super(),this.providedColumnGroup=e,this.groupId=t,this.partId=o,this.pinned=s,this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.colIdSanitised=f(this.getUniqueId())}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}getUniqueId(){return hs(this.groupId,this.partId)}isEmptyGroup(){return 0===this.displayedChildren.length}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!(!e||0===e.length)&&e.every(e=>e.isMoving())}checkLeft(){for(const e of this.displayedChildren)us(e)&&e.checkLeft();if(this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=e(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??[])So(t)?e.push(t):us(t)&&t.addDisplayedLeafColumns(e)}addLeafColumns(e){for(const t of this.children??[])So(t)?e.push(t):us(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()?1+e.getPaddingLevel():0}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e?.isPadding();)e=e.getParent();if(!e||!e.getProvidedColumnGroup().isExpandable())return this.displayedChildren=this.children,void this.dispatchLocalEvent({type:"displayedChildrenChanged"});for(const t of this.children??[])if(!us(t)||t.displayedChildren?.length)switch(t.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(t);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(t);break;default:this.displayedChildren.push(t)}this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},ps="Backspace",ms="Tab",fs="Enter",Cs="Escape",vs=" ",ws="ArrowLeft",bs="ArrowUp",ys="ArrowRight",Ss="ArrowDown",Rs="Delete",xs="F2",Fs="PageUp",Ds="PageDown",Ms="Home",Ps="End",Es="KeyA",Ts="KeyC",Is="KeyD",As="KeyV",ks="KeyY",Ls="KeyZ";function Gs(e){const{keyCode:t}=e;let o;switch(t){case 65:o=Es;break;case 67:o=Ts;break;case 86:o=As;break;case 68:o=Is;break;case 90:o=Ls;break;case 89:o=ks;break;default:o=e.code}return o}var Ns=class e{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e(e=>this.onDone(e),e=>this.onReject(e))}static all(t){return t.length?new e(e=>{let o=t.length;const s=new Array(o);t.forEach((t,i)=>{t.then(t=>{s[i]=t,o--,0===o&&e(s)})})}):e.resolve()}static resolve(t=null){return new e(e=>e(t))}then(t){return new e(e=>{1===this.status?e(t(this.resolution)):this.waiters.push(o=>e(t(o)))})}onDone(e){this.status=1,this.resolution=e;for(const t of this.waiters)t(e)}onReject(e){}},Bs=class extends He{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 o={capturePointer:!0,dragSource:e,eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:t=>this.onDragStart(e,t),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push(o),this.beans.dragSvc.addDragSource(o)}setDragImageCompIcon(e,t=!1){const o=this.dragImageComp;o&&(t||this.dragImageLastIcon!==e)&&(this.dragImageLastIcon=e,o.setIcon(e,t))}removeDragSource(e){const{dragSourceAndParamsList:t,beans:o}=this;for(let s=0,i=t.length;s{for(const o of t){const{width:t,height:s,left:i,right:n,top:r,bottom:l}=o.getBoundingClientRect();if(0===t||0===s)return!1;const a=e.clientX>=i&&e.clientX=r&&e.clientY0}findExternalZone(e){const t=this.dropTargets;for(let o=0,s=t.length;o0?"down":p<0?"up":null,hDirection:g<0?"left":g>0?"right":null,initialSourcePointerOffsetX:l,initialSourcePointerOffsetY:a,dragSource:s,fromNudge:o,dragItem:i,dropZoneTarget:d,dropTarget:n?.dropTarget??null,changed:!!n?.changed});return this.lastDraggingEvent=m,m}positionDragImageComp(e){const t=this.dragImageComp?.getGui();t&&function(e,t,o){const s=e.getBoundingClientRect().height,i=function(e){return R(e)?.clientWidth??(window.innerWidth||-1)}(o)-2,n=function(e){return R(e)?.clientHeight??(window.innerHeight||-1)}(o)-2;if(!e.offsetParent)return;const r=ee(e.offsetParent),{clientY:l,clientX:a}=t;let d=l-r.top-s/2,c=a-r.left-10;const h=b(o),u=h.defaultView||window,g=u.pageYOffset||h.documentElement.scrollTop,p=u.pageXOffset||h.documentElement.scrollLeft;i>0&&c+e.clientWidth>i+p&&(c=i+p-e.clientWidth),c<0&&(c=0),n>0&&d+e.clientHeight>n+g&&(d=n+g-e.clientHeight),d<0&&(d=0),e.style.left=`${c}px`,e.style.top=`${d}px`}(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(e=>{const o=this.lastMouseEvent;if(t!==this.dragImageCompPromise||!o||!this.isAlive())return void this.destroyBean(e);this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0;const s=this.dragImageComp;s!==e&&(this.dragImageComp=e,this.removeDragImageComp(s)),e&&(this.appendDragImageComp(e),this.updateDragImageComp(),this.positionDragImageComp(o))})}appendDragImageComp(e){const t=e.getGui(),o=t.style;o.position="absolute",o.zIndex="9999",this.beans.dragSvc?.hasPointerCapture()&&(o.pointerEvents="none"),this.gos.setInstanceDomData(t),this.beans.environment.applyThemeClasses(t),o.top="20px",o.left="20px";const s=R(this.beans);s?s.appendChild(t):this.warnNoBody()}updateDragImageComp(){const{dragImageComp:e,dragSource:t,lastDropTarget:o,lastDraggingEvent:s,dragImageLastLabel:i}=this;if(!e)return;this.setDragImageCompIcon(o?.getIconName?.(s)??null);let n=t?.dragItemName;"function"==typeof n&&(n=n(s)),n||(n=""),i!==n&&(this.dragImageLastLabel=n,e.setLabel(n))}};function Hs(e){return"object"==typeof e&&!!e.component}function Os(e,t,o,s){const{name:i}=o;let n,r,l,a,d,c;if(t){const o=t,h=o[i+"Selector"],u=h?h(s):null,g=t=>{"string"==typeof t?n=t:null!=t&&!0!==t&&(e.isFrameworkComponent(t)?l=t:r=t)};u?(g(u.component),a=u.params,d=u.popup,c=u.popupPosition):g(o[i])}return{compName:n,jsComp:r,fwComp:l,paramsFromSelector:a,popupFromSelector:d,popupPositionFromSelector:c}}var Vs={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},zs={name:"headerComponent",optionalMethods:["refresh"]},Ws={name:"innerHeaderComponent"},Us={name:"innerHeaderGroupComponent"},$s={name:"headerGroupComponent"},js={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},Ks={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},_s={name:"loadingCellRenderer",cellRenderer:!0},qs={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},Ys={name:"tooltipComponent"},Zs={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},Qs={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},Xs={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},Js={name:"loadingCellRenderer",cellRenderer:!0},ei={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},ti={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function oi(e,t,o){return e.getCompDetails(t,js,void 0,o)}function si(e,t,o){return e.getCompDetails(t,Ks,void 0,o)}function ii(e,t,o){return e.getCompDetails(t,_s,"agSkeletonCellRenderer",o,!0)}function ni(e,t,o){return e.getCompDetails(t,qs,"agCellEditor",o,!0)}function ri(e,t,o,s){const i=t.filter;return Hs(i)&&(t={filter:i.component,filterParams:t.filterParams}),e.getCompDetails(t,Zs,s,o,!0)}function li(e,t,o,s){return e.getCompDetails(t,Qs,s,o)}function ai(e,t){return Os(e,t,Zs)}function di(e,t,o){return e.mergeParams(t,Zs,o)}var ci=/* @__PURE__ */(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))(ci||{}),hi="ag-resizer-wrapper",ui=(e,t)=>({tag:"div",ref:`${e}Resizer`,cls:`ag-resizer ag-resizer-${t}`}),gi={tag:"div",cls:hi,children:[ui("eTopLeft","topLeft"),ui("eTop","top"),ui("eTopRight","topRight"),ui("eRight","right"),ui("eBottomRight","bottomRight"),ui("eBottom","bottom"),ui("eBottomLeft","bottomLeft"),ui("eLeft","left")]},pi=class extends He{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:o}=this.offsetParent,s=o/2-this.getWidth()/2,i=t/2-this.getHeight()/2;this.offsetElement(s,i,e)}initialisePosition(e){if(this.positioned)return;const{centered:t,forcePopupParentAsOffsetParent:o,minWidth:s,width:i,minHeight:n,height:r,x:l,y:a}=this.config;this.offsetParent||this.setOffsetParent();let d=0,c=0;const h=re(this.element);if(h){const e=this.findBoundaryElement(),t=window.getComputedStyle(e);if(null!=t.minWidth){const o=e.offsetWidth-this.element.offsetWidth;c=Number.parseInt(t.minWidth,10)-o}if(null!=t.minHeight){const o=e.offsetHeight-this.element.offsetHeight;d=Number.parseInt(t.minHeight,10)-o}}if(this.minHeight=n||d,this.minWidth=s||c,i&&this.setWidth(i),r&&this.setHeight(r),i&&r||this.refreshSize(),t)this.center(e);else if(l||a)this.offsetElement(l,a,e);else if(h&&o){let t=this.boundaryEl,o=!0;if(t||(t=this.findBoundaryElement(),o=!1),t){const s=Number.parseFloat(t.style.top),i=Number.parseFloat(t.style.left);o?this.offsetElement(Number.isNaN(i)?0:i,Number.isNaN(s)?0:s,e):this.setPosition(i,s)}}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 o=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragSvc?.addDragSource(o),this.moveElementDragListener=o):(this.dragSvc?.removeDragSource(o),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}for(const t of Object.keys(e)){const o=!!e[t],s=this.getResizerElement(t),i={dragStartPixels:0,eElement:s,onDragStart:e=>this.onResizeStart(e,t),onDragging:this.onResize.bind(this),onDragStop:e=>this.onResizeEnd(e,t)};(o||!this.isAlive()&&!o)&&(o?(this.dragSvc?.addDragSource(i),this.resizeListeners.push(i),s.style.pointerEvents="all"):s.style.pointerEvents="none",this.resizable[t]=o)}}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=`${t}px`),-1!==e&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,o=this.element;let s=!1;if("string"==typeof e&&e.includes("%"))me(o,e),e=X(o),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const t=this.getAvailableHeight();t&&e>t&&(e=t)}this.getHeight()!==e&&(s?(o.style.maxHeight="unset",o.style.minHeight="unset"):t?me(o,e):(o.style.height=`${e}px`,o.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:Number.parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:o}=this.offsetParent;if(!o)return null;const s=this.element.getBoundingClientRect(),i=this.offsetParent.getBoundingClientRect(),n=e?this.position.y:s.top,r=e?0:i.top;let l=0;if(t){const e=this.element.parentElement;if(e){const{bottom:t}=e.getBoundingClientRect();l=t-s.bottom}}return o+r-n-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:o}=this.config;let s=!1;if("string"==typeof e&&e.includes("%"))pe(t,e),e=J(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:t}=this.offsetParent,s=o?this.position.x:this.element.getBoundingClientRect().left;t&&e+s>t&&(e=t-s)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?pe(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:Number.parseFloat(e)))}offsetElement(e=0,t=0,o){const{forcePopupParentAsOffsetParent:s}=this.config,i=s?this.boundaryEl:this.element;i&&(this.popupSvc?.positionPopup({ePopup:i,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t}),postProcessCallback:o}),this.setPosition(Number.parseFloat(i.style.left),Number.parseFloat(i.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;e&&this.popupSvc?(this.resizeObserverSubscriber?.(),this.resizeObserverSubscriber=we(this.beans,this.popupSvc?.getPopupParent(),()=>{const e=this.getAvailableHeight();this.element.style.setProperty("max-height",`${e}px`)})):(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:o,isTop:s,anywhereWithin:i,topBuffer:n}=e,r=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!o,!!i,r)?0:r,movementY:this.shouldSkipY(t,!!s,n,l)?0:l}}shouldSkipX(e,t,o,s){const i=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:i.left;let a=l<=0&&n.left>=e.clientX||n.right<=e.clientX&&n.right<=r.right;return!!a||(a=t?s<0&&e.clientX>l+n.left||s>0&&e.clientXr.right||s>0&&e.clientXr.right||s>0&&e.clientX=e.clientY||n.bottom<=e.clientY&&n.bottom<=r.bottom;return!!a||(a=t?s<0&&e.clientY>l+n.top+o||s>0&&e.clientYr.bottom||s>0&&e.clientY({element:this.element.querySelector(`[data-ref=${e}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(xe(gi)),this.createResizeMap(),this.resizersAdded=!0)}removeResizers(){this.resizerMap=void 0,this.element.querySelector(`.${hi}`)?.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:o,forcePopupParentAsOffsetParent:s}=this.config;o||s||this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter(e=>!e.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,o=0;for(const s of e){const e=!!s.style.flex&&"0 0 auto"!==s.style.flex;if(s===this.element)continue;let i=this.minHeight||0,n=this.minWidth||0;if(e){const e=window.getComputedStyle(s);e.minHeight&&(i=Number.parseInt(e.minHeight,10)),e.minWidth&&(n=Number.parseInt(e.minWidth,10))}else i=s.offsetHeight,n=s.offsetWidth;t+=i,o+=n}return{height:t,width:o}}applySizeToSiblings(e){let t=null;const o=this.getSiblings();if(o){for(let s=0;se)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:o}=this.config,{isTop:s,isRight:i,isBottom:n,isLeft:r}=this.currentResizer,l=i||r,a=n||s,{movementX:d,movementY:c}=this.calculateMouseMovement({e:e,isLeft:r,isTop:s}),h=this.position.x,u=this.position.y;let g=0,p=0;if(l&&d){const e=r?-1:1,t=this.getWidth(),o=t+d*e;let s=!1;r&&(g=t-o,(h+g<=0||o<=this.minWidth)&&(s=!0,g=0)),s||this.setWidth(o)}if(a&&c){const e=s?-1:1,t=this.getHeight(),o=t+c*e;let i=!1;s?(p=t-o,(u+p<=0||o<=this.minHeight)&&(i=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&tthis.element.parentElement.offsetHeight&&(i=!0),i||this.setHeight(o)}this.updateDragStartPosition(e.clientX,e.clientY),((t||o)&&g||p)&&this.offsetElement(h+g,u+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:o}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:i,movementY:n}=this.calculateMouseMovement({e:e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+i,o+n),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("static"!==window.getComputedStyle(e).position)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()}},mi=class extends pi{};function fi(e){return"function"==typeof e?.getGui}var Ci,vi,wi,bi,yi,Si,Ri,xi=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){if(e){if(e.includes(" ")){const o=(e||"").split(" ");if(o.length>1){for(const e of o)this.toggleCss(e,t);return}}this.cssClassStates[e]!==t&&e.length&&(this.getGui()?.classList.toggle(e,t),this.cssClassStates[e]=t)}}},Fi=0,Di=class extends He{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=Fi++,this.cssManager=new xi(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(e=>[e.selector,e])),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(Se):null}applyElementsToComponent(e,t,o,s=null){if(void 0===t&&(t=this.getDataRefAttribute(e)),t){const i=this[t];if(null===i)this[t]=s??e;else{const e=o?.[t];if(!this.suppressDataRefValidation&&!e)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${i}`)}}}createChildComponentsFromTags(e,t){const o=[];for(const s of e.childNodes??[])o.push(s);for(const s of o){if(!(s instanceof HTMLElement))continue;const o=this.createComponentFromElement(s,e=>{const t=e.getGui();if(t)for(const o of s.attributes??[])t.setAttribute(o.name,o.value)},t);if(o){if(o.addItems&&s.children.length){this.createChildComponentsFromTags(s,t);const e=Array.prototype.slice.call(s.children);o.addItems(e)}this.swapComponentForNode(o,e,s)}else s.childNodes&&this.createChildComponentsFromTags(s,t)}}createComponentFromElement(e,t,o){const s=e.nodeName,i=this.getDataRefAttribute(e),n=0===s.indexOf("AG-"),r=n?this.componentSelectors.get(s):null;let l=null;if(r){const e=o&&i?o[i]:void 0;l=new r.component(e),l.setParentComponent(this),this.createBean(l,null,t)}else if(n)throw new Error(`selector: ${s}`);return this.applyElementsToComponent(e,i,o,l),l}swapComponentForNode(e,t,o){const s=e.getGui();t.replaceChild(s,o),t.insertBefore(document.createComment(o.nodeName),s),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e,t){const o=t??this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const s of e)s.setAttribute("tabindex",o.toString())}setTemplate(e,t,o){let s;s="string"==typeof e||null==e?le(e):xe(e),this.setTemplateFromElement(s,t,o)}setTemplateFromElement(e,t,o,s=!1){if(this.eGui=e,this.suppressDataRefValidation=s,t)for(let i=0;ithis.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===Mi?(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=Mi}},Mi=Symbol(),Pi=class extends Di{};function Ei(){return void 0===Ci&&(Ci=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),Ci}function Ti(){return void 0===vi&&(vi=/(firefox)/i.test(navigator.userAgent)),vi}function Ii(){return void 0===wi&&(wi=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),wi}function Ai(){return void 0===bi&&(bi=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),bi}function ki(e){if(!e)return null;const t=e.tabIndex,o=e.getAttribute("tabIndex");return-1!==t||null!==o&&(""!==o||Ti())?t.toString():null}function Li(){return null==Si&&Gi(),Si}function Gi(){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 o=t.offsetWidth-t.clientWidth;0===o&&0===t.clientWidth&&(o=null),t.parentNode&&t.remove(),null!=o&&(Si=o,yi=0===o)}function Ni(){return null==yi&&Gi(),yi}var Bi=!1,Hi=0;function Oi(e){const t=Bi,o="keydown"===e.type;o&&(e.ctrlKey||e.metaKey||e.altKey)||t!==o&&(Bi=o)}function Vi(){return Bi}function zi(e,t,o=!1){let s=$;t&&(s+=", "+t),o&&(s+=', [tabindex="-1"]');const i=Array.prototype.slice.apply(e.querySelectorAll("[tabindex], input, select, button, textarea, [href]")).filter(e=>re(e)),n=Array.prototype.slice.apply(e.querySelectorAll(s));return n.length?(r=n,i.filter(e=>-1===r.indexOf(e))):i;var r}function Wi(t,o=!1,s=!1,i=!1){const n=zi(t,i?".ag-tab-guard":null,s),r=o?e(n):n[0];return!!r&&(r.focus({preventScroll:!0}),!0)}function Ui(e,t,o,s){const i=zi(t,o?':not([tabindex="-1"])':null),n=w(e);let r;r=o?i.findIndex(e=>e.contains(n)):i.indexOf(n);const l=r+(s?-1:1);return l<0||l>=i.length?null:i[l]}function $i(e,t=5){let o=0;for(;e&&null===ki(e)&&++o<=t;)e=e.parentElement;return null===ki(e)?null:e}var ji="ag-focus-managed",Ki=class extends He{constructor(e,t={isStopPropagation:()=>!1,stopPropagation:()=>{}},o={}){super(),this.eFocusable=e,this.stopPropagationCallbacks=t,this.callbacks=o,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:e=>{if(e.defaultPrevented)return;const t=Ui(this.beans,this.eFocusable,!1,e.shiftKey);t&&(t.focus(),e.preventDefault())},...o}}postConstruct(){const{eFocusable:e,callbacks:{onFocusIn:t,onFocusOut:o}}=this;e.classList.add(ji),this.addKeyDownListeners(e),t&&this.addManagedElementListeners(e,{focusin:t}),o&&this.addManagedElementListeners(e,{focusout:o})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:e=>{if(e.defaultPrevented||this.stopPropagationCallbacks.isStopPropagation(e))return;const{callbacks:t}=this;t.shouldStopEventPropagation(e)?this.stopPropagationCallbacks.stopPropagation(e):e.key===ms?t.onTabKeyDown(e):t.handleKeyDown&&t.handleKeyDown(e)}})}},_i="__ag_Grid_Stop_Propagation";function qi(e){e[_i]=!0}function Yi(e){return!0===e[_i]}var Zi={isStopPropagation:Yi,stopPropagation:qi},Qi=class extends Ki{constructor(e,t){super(e,Zi,t)}},Xi={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 Ji(e,t,o){return function(e,t,o,s){const i=Xi[o];return e.getLocaleTextFunc()(o,"function"==typeof i?i(s):i,s)}(e,0,t,o)}function en(e){return(e.buttons?.indexOf("apply")??-1)>=0}var tn=class extends Pi{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 Qi(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=this.createBean(new mi(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,o=this.params;this.params=t;const{source:s,state:i,additionalEventAttributes:n}=t;"colDef"===s&&this.updateParams(t,o);const r=this.state;this.state=i;const l=n?.fromAction;return(l&&"apply"!==l||i.model!==r.model||!this.areStatesEqual(i.state,r.state))&&this.setModelIntoUi(i.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=en(e),this.setupApplyDebounced()}doesFilterPass(e){Dt(283);const{getHandler:t,model:o,column:s}=this.params;return t().doesFilterPass({...e,model:o,handlerParams:this.beans.colFilter.getHandlerParams(s)})}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return Dt(284),null!=this.params.model}setupApplyDebounced(){const e=function(e,t){const{debounceMs:o}=e;return en(e)?(null!=o&&Dt(71),0):o??t}(this.params,this.defaultDebounceMs),t=je(this,this.checkApplyDebounce.bind(this),e);this.applyDebounced=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.doApplyModel())}getModel(){return Dt(285),this.params.model}setModel(e){Dt(286);const{beans:t,params:o}=this;return t.colFilter.setModelForColumnLegacy(o.column,e)}applyModel(e="api"){return this.doApplyModel()}canApply(e){return!0}doApplyModel(e){const{params:t,state:{valid:o=!0,model:s}}=this;if(!o)return!1;const i=!this.areModelsEqual(t.model,s);return i&&t.onAction("apply",e),i}onNewRowsLoaded(){}onUiChanged(e,t=!1){this.updateUiVisibility();const o=this.getModelFromUi(),s={model:o,state:this.getState(),valid:this.canApply(o)};this.state=s;const{params:i,gos:n,eventSvc:r,applyActive:l}=this;i.onStateChange(s),i.onUiChange(this.getUiChangeEventParams()),n.get("enableFilterHandlers")||r.dispatchEvent({type:"filterModified",column:i.column,filterInstance:this}),s.valid&&(e??(e=l?void 0:"debounce"),"immediately"===e?this.doApplyModel({afterFloatingFilter:t,afterDataChange:!1}):"debounce"===e&&this.applyDebounced())}getState(){}getUiChangeEventParams(){}afterGuiAttached(e){this.lastContainerType=e?.container,this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){const{positionableFeature:t,gos:o}=this;if(!t)return;const s="floatingFilter"===e||"columnFilter"===e;s?(t.restoreLastSize(),t.setResizable(o.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(t.removeSizeFromEl(),t.setResizable(!1)),t.constrainSizeToAvailableHeight(s)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}destroy(){this.positionableFeature=this.destroyBean(this.positionableFeature),super.destroy()}translate(e,t){return Ji(this,e,t)}getPositionableElement(){return this.getGui()}areModelsEqual(e,t){return e===t||null==e&&null==t||null!=e&&null!=t&&this.areNonNullModelsEqual(e,t)}},on=class extends Di{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()}},sn=class extends on{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 nn(e){const t=e.rowModel;return"clientSide"===t.getType()?t:void 0}var rn=0,ln=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=rn++,this.alreadyRendered=!1,this.formulaRowIndex=null,this.hovered=!1,this.__selected=!1,this.beans=e}get groupData(){const e=this._groupData;return void 0!==e?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 void 0===e?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):-1===this.level||!!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:o,eventSvc:s}=this.beans,i=this.data;this.data=e,o?.onDataChanged(),this.updateDataOnDetailNode(),this.resetQuickFilterAggregateText();const n=this.createDataChangedEvent(e,i,t);if(this.__localEventService?.dispatchEvent(n),this.sibling){this.sibling.data=e;const o=this.sibling.createDataChangedEvent(e,i,t);this.sibling.__localEventService?.dispatchEvent(o)}s.dispatchEvent({type:"rowNodeDataChanged",node:this});const r=this.pinnedSibling;r&&(r.data=e,r.__localEventService?.dispatchEvent(r.createDataChangedEvent(e,i,t)),s.dispatchEvent({type:"rowNodeDataChanged",node:r}))}updateDataOnDetailNode(){const e=this.detailNode;e&&(e.data=this.data)}createDataChangedEvent(e,t,o){return{type:"dataChanged",node:this,oldData:t,newData:e,update:o}}getRowIndexString(){return null==this.rowIndex?(Mt(13),null):"top"===this.rowPinned?"t-"+this.rowIndex:"bottom"===this.rowPinned?"b-"+this.rowIndex:this.rowIndex.toString()}setDataAndId(e,t){const{selectionSvc:o}=this.beans,s=o?.createDaemonNode?.(this),i=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),o&&(o.updateRowSelectable(this),o.syncInRowNode(this,s));const n=this.createDataChangedEvent(e,i,!1);this.__localEventService?.dispatchEvent(n)}setId(e){const t=Qt(this.beans.gos);if(t)if(this.data){const e=this.parent?.getRoute()??[];this.id=t({data:this.data,parentKeys:e.length>0?e:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith("row-group-")&&Mt(14,{groupPrefix:"row-group-"})}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=null!==e;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,o){this.beans.expansionSvc?.setExpanded(this,e,t,o)}setDataValue(e,t,o){const{colModel:s,valueSvc:i,gos:n,editSvc:r}=this.beans;if(null==e)return!1;let l=s.getCol(e)??s.getColDefCol(e);if(!l)return!1;if(!this.group){const e=l.getColDef();e.pivotValueColumn&&(l=e.pivotValueColumn)}const a=i.getValueForDisplay({column:l,node:this,from:"data"}).value;if(n.get("readOnlyEdit")){const{beans:{eventSvc:e},data:s,rowIndex:i,rowPinned:n}=this;return e.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:i,rowPinned:n,column:l,colDef:l.colDef,data:s,node:this,oldValue:a,newValue:t,value:t,source:o}),!1}if("data"!==o&&r&&!r.committing){const e=r.setDataValue({rowNode:this,column:l},t,o);if(null!=e)return e}const d=i.setValue(this,l,t,o);return this.dispatchCellChangedEvent(l,t,a),d&&this.pinnedSibling?.dispatchCellChangedEvent(l,t,a),d}getDataValue(e,t="data"){const{colModel:o,valueSvc:s,formula:i}=this.beans;if(null==e)return;const n=o.getCol(e)??o.getColDefCol(e);if(!n)return;const r="data-raw"===t,l=r||"value"===t?"data":t;let a=s.getValue(n,this,l,r);if(!r&&(i&&n.isAllowFormula()&&i.isFormula(a)&&(a=i.resolveValue(n,this)),"data"!==t&&n.getAggFunc()&&"object"==typeof a&&null!=a)){if("function"==typeof a.toNumber)return a.toNumber();if("value"in a)return a.value}return a}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 null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}dispatchCellChangedEvent(e,t,o){const s={type:"cellChanged",node:this,column:e,newValue:t,oldValue:o};this.__localEventService?.dispatchEvent(s)}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 o=0,s=t.length;o{if(dn){if(dn.has(e))return!1}else dn=/* @__PURE__ */new WeakSet;return dn.add(e),!0})(e))return;const t=e.touches[0];this.touchStart=t;const o=this.handlers;if(!o.length){const e=this.eElement,t=e.ownerDocument,s=this.onTouchMove.bind(this),i=this.onTouchEnd.bind(this),n=this.onTouchCancel.bind(this),r={passive:!0},l={passive:!1};ke(o,[e,"touchmove",s,r],[t,"touchcancel",n,r],[t,"touchend",i,l],[t,"contextmenu",Ge,l])}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}))},550)}onTouchMove(e){const{moved:t,touchStart:o}=this;if(!t&&o){const t=Ie(o,e.touches);t&&!Te(t,o,4)&&(this.clearLongPress(),this.moved=!0)}}onTouchEnd(e){const t=this.touchStart;t&&Ie(t,e.changedTouches)&&(this.moved||(this.eventSvc?.dispatchEvent({type:"tap",touchStart:t}),this.checkDoubleTap(t)),this.preventClick&&Ge(e),this.cancel())}onTouchCancel(e){const t=this.touchStart;t&&Ie(t,e.changedTouches)&&(this.lastTapTime=null,this.cancel())}checkDoubleTap(e){let t=Date.now();const o=this.lastTapTime;o&&t-o>500&&(this.eventSvc?.dispatchEvent({type:"doubleTap",touchStart:e}),t=null),this.lastTapTime=t}cancel(){this.clearLongPress(),Le(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}},un=/* @__PURE__ */(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(un||{}),gn=1,pn=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,this.instanceId=gn++,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 e=new t;e.beanName&&(this.beans[e.beanName]=e),this.createdBeans.push(e)}for(const t of e.derivedBeans??[]){const{beanName:e,bean:o}=t(this);this.beans[e]=o,this.createdBeans.push(o)}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 o=this.beans;for(const s of e)s.preWireBeans?.(o),s.wireBeans?.(o);for(const s of e)s.preConstruct?.();t&&e.forEach(t);for(const s of e)s.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 Cn(e,t){return((e.beanName?fn[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER)-((t.beanName?fn[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER)}function vn(e,t){return"gridDestroySvc"===e?.beanName?-1:"gridDestroySvc"===t?.beanName?1:0}function wn(e){const{rowIndex:t,rowPinned:o,column:s}=e;return`${t}.${null==o?"null":o}.${s.getId()}`}function bn(e,t){const o=e.column===t.column,s=e.rowPinned===t.rowPinned,i=e.rowIndex===t.rowIndex;return o&&s&&i}function yn(e,t){switch(e.rowPinned){case"top":if("top"!==t.rowPinned)return!0;break;case"bottom":if("bottom"!==t.rowPinned)return!1;break;default:if(l(t.rowPinned))return"top"!==t.rowPinned}return e.rowIndexe.rowNode.rowIndex===t.rowIndex),a=l?n:r,d=(o?-1:1)*(l?-1:1);let c;for(let h=0;h{if(!t.defaultPrevented&&!0!==t[Bn]&&t.key===ms){const s=t.shiftKey;Ui(e,o,!1,s)||Ln(e,s)&&t.preventDefault()}}})}function An(e){return e.gos.get("suppressHeaderFocus")||!!e.overlays?.exclusive}function kn(e){return e.gos.get("suppressCellFocus")||!!e.overlays?.exclusive}function Ln(e,t,o=!1){const s=e.ctrlsSvc.get("gridCtrl"),i=s.focusNextInnerContainer(t);return!0===i||(!1===i?i:((o||!t&&!s.isDetailGrid()&&s.isFocusInsideGridBody())&&s.forceFocusOutOfContainer(t),!1))}function Gn(e,t){const o=e.getFocusableContainerName();return"gridBody"===o?t():Nn(e,()=>zi(e.getGui(),".ag-tab-guard").length>0)?o:null}function Nn(e,t){e.setAllowFocus?.(!0);try{return t()}finally{e.setAllowFocus?.(!1)}}var Bn="__ag_Grid_Skip_Focusable_Container";function Hn(e){return e.cols?e.cols.treeDepth+1:-1}function On(e){return e.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0}function Vn(e){const t=[],o=e.ctrlsSvc.getHeaderRowContainerCtrls();for(const s of o){if(!s)continue;const o=s.getGroupRowCount()||0;for(let i=0;in)&&(t[i]=s)}}}return t}function zn(e,t){let o=e.colModel.isPivotMode()?function(e){return e.gos.get("pivotGroupHeaderHeight")??jn(e)}(e):jn(e);const s=t.getHeaderCellCtrls();for(const i of s){const{column:e}=i,t=e.getAutoHeaderHeight();null!=t&&t>o&&e.isAutoHeaderHeight()&&(o=t)}return o}function Wn(e){let t=e.colModel.isPivotMode()?function(e){return e.gos.get("pivotHeaderHeight")??Un(e)}(e):Un(e);return e.colModel.forAllCols(e=>{const o=e.getAutoHeaderHeight();null!=o&&o>t&&e.isAutoHeaderHeight()&&(t=o)}),t}function Un(e){return e.gos.get("headerHeight")??e.environment.getDefaultHeaderHeight()}function $n(e){return e.gos.get("floatingFiltersHeight")??Un(e)}function jn(e){return e.gos.get("groupHeaderHeight")??Un(e)}var Kn=class extends Oe{setComp(e,t,o){this.comp=e,this.eGui=t;const{beans:s}=this,{headerNavigation:i,touchSvc:n,ctrlsSvc:r}=s;i&&this.createManagedBean(new Qi(o,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,s),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,s)}),this.onPivotModeChanged(s),this.setupHeaderHeight();const l=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:l}),n?.mockHeaderContextMenu(this,l),r.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:()=>be(this.beans,()=>e()),stylesChanged:e,advancedFilterEnabledChanged:e})}setHeaderHeight(){const{beans:e}=this;let t=0;const o=Vn(e).reduce((e,t)=>e+t,0),s=Wn(e);e.filterManager?.hasFloatingFilters()&&(t+=$n(e)),t+=o,t+=s;const i=t+e.environment.getHeaderRowBorderWidth();if(this.headerHeightWithBorder!==i){this.headerHeightWithBorder=i;const e=`${i}px`;this.comp.setHeightAndMinHeight(e)}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 t=e.visibleCols.allCols.some(e=>e.isSpanHeaderHeight());this.comp.toggleCss("ag-header-allow-overflow",t)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),o=e.shiftKey,s=o!==t?"LEFT":"RIGHT",{beans:i}=this,{headerNavigation:n,focusSvc:r}=i;(n.navigateHorizontally(s,!0,e)||!o&&r.focusOverlay(!1)||Ln(i,o,!0))&&e.preventDefault()}handleKeyDown(e){let t=null;const{headerNavigation:o}=this.beans;switch(e.key){case ws:t="LEFT";case ys:l(t)||(t="RIGHT"),o.navigateHorizontally(t,!1,e)&&e.preventDefault();break;case bs:t="UP";case Ss:l(t)||(t="DOWN"),o.navigateVertically(t,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const{relatedTarget:t}=e,{eGui:o,beans:s}=this;!t&&o.contains(w(s))||o.contains(t)||(s.focusSvc.focusedHeader=null)}onHeaderContextMenu(e,t,o){const{menuSvc:s,ctrlsSvc:i}=this.beans;if(!e&&!o||!s?.isHeaderContextMenuEnabled())return;const{target:n}=e??t;n!==this.eGui&&n!==i.getHeaderRowContainerCtrl()?.eViewport||s.showHeaderContextMenu(void 0,e,o)}},_n=class extends Pi{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},qn={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"}]},Yn=class extends _n{constructor(e){super(qn,e),this.eResize=null,this.eHeaderCompWrapper=null,this.headerCompVersion=0}postConstruct(){const e=this.getGui(),t=()=>{const e=this.ctrl.getSelectAllGui();e&&(this.eResize.insertAdjacentElement("afterend",e),this.addDestroyFunc(()=>e.remove()))},o={setWidth:t=>e.style.width=t,toggleCss:(e,t)=>this.toggleCss(e,t),setUserStyles:t=>he(e,t),setAriaSort:t=>t?function(e,t){F(e,"sort",t)}(e,t):void D(e,"sort"),setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerComp,refreshSelectAllGui:t,removeSelectAllGui:()=>this.ctrl.getSelectAllGui()?.remove()};this.ctrl.setComp(o,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(e=>this.afterCompCreated(t,e))}afterCompCreated(e,t){e==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())):this.destroyBean(t)}},Zn={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"}]},Qn=class extends _n{constructor(e){super(Zn,e),this.eResize=null,this.eHeaderCompWrapper=null}postConstruct(){const e=this.getGui();this.ctrl.setComp({toggleCss:(e,t)=>this.toggleCss(e,t),setUserStyles:t=>he(e,t),setHeaderWrapperHidden:e=>{e?this.eHeaderCompWrapper.style.setProperty("display","none"):this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:e=>{null!=e?this.eHeaderCompWrapper.style.setProperty("max-height",`${e}px`):this.eHeaderCompWrapper.style.removeProperty("max-height"),this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",null!=e)},setResizableDisplayed:e=>K(this.eResize,e),setWidth:t=>e.style.width=t,setAriaExpanded:t=>{return o="aria-expanded",null!=(s=t)?e.setAttribute(o,s):e.removeAttribute(o);var o,s},setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerGroupComp},e,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(e){e.newAgStackInstance().then(e=>this.afterHeaderCompCreated(e))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive())return void t();const o=this.getGui(),s=e.getGui();this.eHeaderCompWrapper.appendChild(s),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(o)}},Xn={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"}}]}]},Jn=class extends _n{constructor(e){super(Xn,e),this.eFloatingFilterBody=null,this.eButtonWrapper=null,this.eButtonShowMainFilter=null}postConstruct(){const e=this.getGui();this.ctrl.setComp({toggleCss:(e,t)=>this.toggleCss(e,t),setUserStyles:t=>he(e,t),addOrRemoveBodyCssClass:(e,t)=>this.eFloatingFilterBody.classList.toggle(e,t),setButtonWrapperDisplayed:e=>K(this.eButtonWrapper,e),setCompDetails:e=>this.setCompDetails(e),getFloatingFilterComp:()=>this.compPromise,setWidth:t=>e.style.width=t,setMenuIcon:e=>this.eButtonShowMainFilter.appendChild(e)},e,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(e){if(!e)return this.destroyFloatingFilterComp(),void(this.compPromise=null);this.compPromise=e.newAgStackInstance(),this.compPromise.then(e=>this.afterCompCreated(e))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp?.getGui().remove(),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp)}afterCompCreated(e){e&&(this.isAlive()?(this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached?.()):this.destroyBean(e))}},er=class extends Pi{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"))),H(this.getGui(),this.ctrl.getAriaRowIndex()),this.ctrl.setComp({setHeight:e=>this.getGui().style.height=e,setTop:e=>this.getGui().style.top=e,setHeaderCtrls:(e,t)=>this.setHeaderCtrls(e,t),setWidth:e=>this.getGui().style.width=e,setRowIndex:e=>H(this.getGui(),e)},void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const o=this.headerComps;this.headerComps={};for(const s of e){const e=s.instanceId;let t=o[e];delete o[e],null==t&&(t=this.createHeaderComp(s),this.getGui().appendChild(t.getGui())),this.headerComps[e]=t}if(Object.values(o).forEach(e=>{e.getGui().remove(),this.destroyBean(e)}),t){const e=Object.values(this.headerComps);e.sort((e,t)=>e.getCtrl().column.getLeft()-t.getCtrl().column.getLeft());const t=e.map(e=>e.getGui());de(this.getGui(),t)}}createHeaderComp(e){let t;switch(this.ctrl.type){case"group":t=new Qn(e);break;case"filter":t=new Jn(e);break;default:t=new Yn(e)}return this.createBean(t),t.setParentComponent(this),t}},tr=class extends Oe{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=kt(this.gos,"print"),{visibleCols:t,scrollVisibleSvc:o}=this.beans,s=t.bodyWidth,i=t.getColsLeftWidth(),n=t.getDisplayedColumnsRightWidth();let r;e?r=s+i+n:(r=s,this.addSpacer&&0===(this.gos.get("enableRtl")?i:n)&&o.verticalScrollShowing&&(r+=o.getScrollbarWidth())),this.callback(r)}};function or(e,t,o){return o&&e.addDestroyFunc(()=>t.destroyBean(o)),o??e}var sr=class extends Oe{constructor(e,t,o,s){super(),this.columnOrGroup=e,this.eCell=t,this.colsSpanning=s,this.columnOrGroup=e,this.ariaEl=t.querySelector("[role=columnheader]")||t,this.beans=o}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){const{beans:t,colsSpanning:o}=this;return t.gos.get("enableRtl")&&o?e(o):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,o=e.get("suppressColumnMoveAnimation"),s=l(this.columnOrGroup.getOldLeft());t?.isActive()&&s&&!o?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=this.modifyLeftForPrintLayout(e,e.getOldLeft()),o=this.modifyLeftForPrintLayout(e,e.getLeft());this.setLeft(t),this.actualLeft=o,this.beans.colAnimation.executeNextVMTurn(()=>{this.actualLeft===o&&this.setLeft(o)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){const{gos:o,visibleCols:s}=this.beans;if(!kt(o,"print"))return t;if("left"===e.getPinned())return t;const i=s.getColsLeftWidth();return"right"===e.getPinned()?i+s.bodyWidth+t:i+t}setLeft(e){if(l(e)&&(this.eCell.style.left=`${e}px`),us(this.columnOrGroup)){const e=this.columnOrGroup.getLeafColumns();if(!e.length)return;e.length>1&&F(this.ariaEl,"colspan",e.length)}}};function ir(e,t,o,s){return a(e)?[]:lr(e.headerClass,e,t,o,s)}function nr(e,t,o,s){return a(e)?[]:lr(e.toolPanelClass,e,t,o,s)}function rr(e,t,o){e.toggleCss("ag-column-first",o.isColAtEdge(t,"first")),e.toggleCss("ag-column-last",o.isColAtEdge(t,"last"))}function lr(e,t,o,s,i){if(a(e))return[];let n;return n="function"==typeof e?e(function(e,t,o,s){return Co(t,{colDef:e,column:o,columnGroup:s})}(t,o,s,i)):e,"string"==typeof n?[n]:Array.isArray(n)?[...n]:[]}var ar=0,dr="headerCtrl",cr=class extends Oe{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()+"-"+ar++}postConstruct(){const e=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],e),this.addManagedEventListeners({overlayExclusiveChanged:e})}setComp(e,t,o,s,i){t.setAttribute("col-id",this.column.colIdSanitised),this.wireComp(e,t,o,s,i),this.reAttemptToFocus&&(this.reAttemptToFocus=!1,this.focus(this.lastFocusEvent??void 0))}shouldStopEventPropagation(e){const{headerRowIndex:t,column:o}=this.beans.focusSvc.focusedHeader,s=o.getDefinition(),i=s?.suppressHeaderKeyboardEvent;return!!l(i)&&!!i(Co(this.gos,{colDef:s,column:o,headerRowIndex:t,event:e}))}getWrapperHasFocus(){return w(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 o;o="function"==typeof t?t(this.getHeaderClassParams()):t,o&&this.comp.setUserStyles(o)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(e){const{wrapperElement:t,checkMeasuringCallback:o,compBean:s}=e,{beans:i}=this,n=e=>{if(!this.isAlive()||!s.isAlive())return;const{paddingTop:o,paddingBottom:r,borderBottomWidth:l,borderTopWidth:a}=Y(this.eGui),d=o+r+l+a,c=t.offsetHeight+d;!(e<5)||b(i)?.contains(t)&&0!=c?this.setColHeaderHeight(this.column,c):$e(()=>n(e+1),"raf",i)};let r,l=!1;const a=()=>{const e=this.column.isAutoHeaderHeight();e&&!l&&d(),!e&&l&&c()},d=()=>{l=!0,this.comp.toggleCss("ag-header-cell-auto-height",!0),n(0),r=we(this.beans,t,()=>n(0))},c=()=>{l=!1,r&&r(),this.comp.toggleCss("ag-header-cell-auto-height",!1),r=void 0};a(),s.addDestroyFunc(()=>c()),s.addManagedListeners(this.column,{widthChanged:()=>l&&n(0)}),s.addManagedEventListeners({sortChanged:()=>{l&&window.setTimeout(()=>n(0))}}),o&&o(a)}onDisplayedColumnsChanged(){const{comp:e,column:t,beans:o,eGui:s}=this;e&&t&&s&&(rr(e,t,o.visibleCols),O(s,o.visibleCols.getAriaColIndex(t)))}addResizeAndMoveKeyboardListeners(e){e.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){const e=An(this.beans);this.eGui&&ve(this.eGui,"tabindex",e?null:"-1")}onGuiKeyDown(e){const t=w(this.beans),o=e.key===ws||e.key===ys;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),t!==this.eGui||!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey)return;if((this.isResizing||o)&&(e.preventDefault(),e.stopImmediatePropagation()),(e.ctrlKey||e.metaKey)&&Gs(e)===Ts)return this.beans.clipboardSvc?.copyToClipboard();if(!o)return;const s=e.key===ws!==this.gos.get("enableRtl")?"left":"right";if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const t=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(t,e.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(s)}moveHeader(e){this.beans.colMoves?.moveHeader(e,this.eGui,this.column,this.rowCtrl.pinned,this)}getViewportAdjustedResizeDiff(e){const t=this.getResizeDiff(e),{pinnedCols:o}=this.beans;return o?o.getHeaderResizeDiff(t,this.column):t}getResizeDiff(e){const{gos:t,column:o}=this;let s=e.key===ws!==t.get("enableRtl");const i=o.getPinned(),n=t.get("enableRtl");return i&&n!==("right"===i)&&(s=!s),(s?-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 Ds:case Fs:case Ms:case Ps:t&&e.preventDefault()}}addDomData(e){const t=dr,{eGui:o,gos:s}=this;Vt(s,o,t,this),e.addDestroyFunc(()=>Vt(s,o,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,o){const s=e??t,{menuSvc:i,gos:n}=this.beans;n.get("preventDefaultOnContextMenu")&&s.preventDefault(),i?.isHeaderContextMenuEnabled(o)&&i.showHeaderContextMenu(o,e,t),this.dispatchColumnMouseEvent("columnHeaderContextMenu",o)}dispatchColumnMouseEvent(e,t){this.eventSvc.dispatchEvent({type:e,column:t})}setColHeaderHeight(e,t){if(!e.setAutoHeaderHeight(t))return;const{eventSvc:o}=this;e.isColumn?o.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"}):o.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}},hr=class extends cr{constructor(){super(...arguments),this.refreshFunctions={},this.userHeaderClasses=/* @__PURE__ */new Set,this.ariaDescriptionProperties=/* @__PURE__ */new Map}wireComp(e,t,o,s,i){this.comp=e;const{rowCtrl:n,column:r,beans:l}=this,{colResize:a,context:d,colHover:c,rangeSvc:h}=l,u=or(this,d,i);this.setGui(t,u),this.updateState(),this.setupWidth(u),this.setupMovingCss(u),this.setupMenuClass(u),this.setupSortableClass(u),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:s,checkMeasuringCallback:e=>this.setRefreshFunction("measuring",e),compBean:u}),this.addColumnHoverListener(u),this.setupFilterClass(u),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(u),this.setupSelectAll(u),this.setupUserComp(),this.refreshAria(),a?this.resizeFeature=u.createManagedBean(a.createResizeFeature(n.pinned,r,o,e,this)):K(o,!1),c?.createHoverFeature(u,[r],t),h?.createRangeHighlightFeature(u,r,e),u.createManagedBean(new sr(r,t,l)),u.createManagedBean(new Qi(t,{shouldStopEventPropagation:e=>this.shouldStopEventPropagation(e),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(u),u.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader","enableAdvancedFilter"],()=>this.refresh()),u.addManagedListeners(r,{colDefChanged:()=>this.refresh(),formulaRefChanged:()=>this.refresh(),headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});const g=()=>this.checkDisplayName();u.addManagedEventListeners({columnValueChanged:g,columnRowGroupChanged:g,columnPivotChanged:g,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),u.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,o=e.colDef;return Co(t.gos,{colDef:o,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 function(e,t,o){return e.getCompDetails(t,zs,"agColumnHeader",o)}(this.beans.userCompFactory,t,e)}createParams(){const{menuSvc:e,sortSvc:t,colFilter:o,gos:s}=this.beans;return Co(s,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!e?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!o&&(!this.openFilterEnabled||mo(this.gos)),showColumnMenu:(t,o)=>{e?.showColumnMenu({column:this.column,buttonElement:t,positionBy:"button",onClosedCallback:o})},showColumnMenuAfterMouseClick:(t,o)=>{e?.showColumnMenu({column:this.column,mouseEvent:t,positionBy:"mouse",onClosedCallback:o})},showFilter:t=>{e?.showFilterMenu({column:this.column,buttonElement:t,containerType:"columnFilter",positionBy:"button"})},progressSort:e=>{t?.progressSort(this.column,!!e,"uiColumnSorted")},setSort:(e,o)=>{t?.setSortForColumn(this.column,Do(e),!!o,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(e,t)=>{s.assertModuleRegistered("Tooltip",3),this.setupTooltip(e,t)}})}setupSelectAll(e){const{selectionSvc:t}=this.beans;t&&(this.selectAllFeature=e.createOptionalManagedBean(t.createSelectAllFeature(this.column)),this.selectAllFeature?.setComp(this),e.addManagedPropertyListener("rowSelection",()=>{const o=t.createSelectAllFeature(this.column);o&&!this.selectAllFeature?(this.selectAllFeature=e.createManagedBean(o),this.selectAllFeature?.setComp(this),this.comp.refreshSelectAllGui()):this.selectAllFeature&&!o&&(this.comp.removeSelectAllGui(),this.selectAllFeature=this.destroyBean(this.selectAllFeature))}))}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===vs?this.selectAllFeature?.onSpaceKeyDown(e):e.key===fs?this.onEnterKeyDown(e):e.key===Ss&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){const{column:t,gos:o,sortable:s,beans:i}=this;let n=!1;(e.ctrlKey||e.metaKey)&&(n=this.showMenuOnKeyPress(e,!0)),n||(!e.altKey&&no(o)?i.rangeSvc?.handleColumnSelection(t,e):s&&i.sortSvc?.progressSort(t,e.shiftKey,"uiColumnSorted"))}showMenuOnKeyPress(e,t){const o=this.comp.getUserCompInstance();return!!ur(o)&&!!o.onMenuKeyboardShortcut(t)&&(e.preventDefault(),!0)}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription()),Vi()&&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 e=ir(this.column.getColDef(),this.gos,this.column,null),t=this.userHeaderClasses;this.userHeaderClasses=new Set(e);for(const o of e)t.has(o)?t.delete(o):this.comp.toggleCss(o,!0);for(const o of t)this.comp.toggleCss(o,!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();e&&(null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e))}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!!t&&!!t.refresh&&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 e=this.column.getActualWidth();this.comp.setWidth(`${e}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 e=this.column.isFilterActive();this.comp.toggleCss("ag-header-cell-filtered",e),this.refreshAria()};e.addManagedListeners(this.column,{filterActiveChanged:t}),t()}setupWrapTextClass(){const e=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.toggleCss("ag-header-cell-wrap-text",e)};e(),this.setRefreshFunction("wrapText",e)}onHeaderHighlightChanged(){const e=this.column.getHighlighted(),t=0===e,o=1===e;this.comp.toggleCss("ag-header-highlight-before",t),this.comp.toggleCss("ag-header-highlight-after",o)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:o,beans:s}=this,i=Vn(this.beans),n=0===i.reduce((e,t)=>e+t,0);if(o.toggleCss("ag-header-parent-hidden",n),!t.isSpanHeaderHeight())return e.style.removeProperty("top"),e.style.removeProperty("height"),o.toggleCss("ag-header-span-height",!1),void o.toggleCss("ag-header-span-total",!1);const{numberOfParents:r,isSpanningTotal:l}=this.column.getColumnGroupPaddingInfo();o.toggleCss("ag-header-span-height",r>0);const a=Wn(s);if(0===r)return o.toggleCss("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",`${a}px`);o.toggleCss("ag-header-span-total",l);const d=(this.column.getFirstRealParent()?.getLevel()??-1)+1,c=i.length-d;let h=0;for(let u=0;u"filter"===e?-1:t.charCodeAt(0)-e.charCodeAt(0)).map(e=>o.get(e)).join(". ");e.ariaAnnounce?.announceValue(s,"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=e=>this.handleMouseOverChange("mouseenter"===e.type);e.addManagedListeners(this.eGui,{mouseenter:t,mouseleave:t,click:()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},contextmenu:e=>this.handleContextMenuMouseEvent(e,void 0,this.column)})}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 ur(t)?t.getAnchorElementForMenu(e):this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function ur(e){return"function"==typeof e?.getAnchorElementForMenu&&"function"==typeof e.onMenuKeyboardShortcut}var gr=0,pr=class extends Oe{constructor(e,t,o){super(),this.rowIndex=e,this.pinned=t,this.type=o,this.instanceId=gr++,this.comp=null,this.allCtrls=[];let s="ag-header-row-column";"group"===o?s="ag-header-row-group":"filter"===o&&(s="ag-header-row-filter"),this.headerRowClass=`ag-header-row ${s}`}setRowIndex(e){this.rowIndex=e,this.comp?.setRowIndex(this.getAriaRowIndex()),this.onRowHeightChanged()}postConstruct(){this.isPrintLayout=kt(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){return!!this.comp&&this.allCtrls.every(e=>null!=e.eGui)}setComp(e,t,o=!0){this.comp=e,t=or(this,this.beans.context,t),o&&(this.setRowIndex(this.rowIndex),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners(t)}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){const t=this.onRowHeightChanged.bind(this),o=this.onDisplayedColumnsChanged.bind(this);e.addManagedEventListeners({columnResized:this.setWidth.bind(this),displayedColumnsChanged:o,virtualColumnsChanged:e=>this.onVirtualColumnsChanged(e.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,stylesChanged:t,advancedFilterEnabledChanged:t}),e.addManagedPropertyListener("domLayout",o),e.addManagedPropertyListener("ensureDomOrder",e=>this.isEnsureDomOrder=e.currentValue),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}onDisplayedColumnsChanged(){this.isPrintLayout=kt(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?null!=this.pinned?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=Vn(this.beans);for(let s=0;s{const{focusSvc:t,visibleCols:o}=this.beans;return!!t.isHeaderWrapperFocused(e)&&o.isVisible(e.column)};if(e)for(const[s,i]of e)o(i)?this.ctrlsById.set(s,i):this.destroyBean(i);return this.allCtrls=Array.from(this.ctrlsById.values()),this.allCtrls}getHeaderCellCtrls(){return this.allCtrls}recycleAndCreateHeaderCtrls(e,t,o){if(e.isEmptyGroup())return;const s=e.getUniqueId();let i;if(o&&(i=o.get(s),o.delete(s)),i&&i.column!=e&&(this.destroyBean(i),i=void 0),null==i)switch(this.type){case"filter":i=this.createBean(this.beans.registry.createDynamicBean("headerFilterCellCtrl",!0,e,this));break;case"group":i=this.createBean(this.beans.registry.createDynamicBean("headerGroupCellCtrl",!0,e,this));break;default:i=this.createBean(new hr(e,this))}t.set(s,i)}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"group"===this.type?this.beans.colViewport.getHeadersToRender(e,this.rowIndex):this.beans.colViewport.getColumnHeadersToRender(e)}focusHeader(e,t){const o=this.allCtrls.find(t=>t.column==e);return!!o&&o.focus(t)}destroy(){this.allCtrls=this.destroyBeans(this.allCtrls),this.ctrlsById=void 0,this.comp=null,super.destroy()}},mr=class extends Oe{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:o,ctrlsSvc:s,colModel:i,colMoves:n}=this.beans;this.setupCenterWidth(),o?.setupHeaderPinnedWidth(this),this.setupDragAndDrop(n,this.eViewport);const r=this.refresh.bind(this,!0);this.addManagedEventListeners({displayedColumnsChanged:r,advancedFilterEnabledChanged:r});const l=`${"string"==typeof this.pinned?this.pinned:"center"}Header`;s.register(l,this),i.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:o,visibleCols:s}=this.beans;let i=0;const n=t.getFocusHeaderToUseAfterRefresh(),r=this.getAllCtrls();(()=>{const t=s.headerGroupRowCount;i=t,e||(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls));const o=this.groupsRowCtrls.length;if(o!==t)if(o>t){for(let e=t;e{const t=i++;this.hidden?this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl):null!=this.columnsRowCtrl&&e?this.columnsRowCtrl.rowIndex!==t&&this.columnsRowCtrl.setRowIndex(t):(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.columnsRowCtrl=this.createBean(new pr(t,this.pinned,"column")))})(),(()=>{this.includeFloatingFilter=!!o?.hasFloatingFilters()&&!this.hidden;const t=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void t();e||t();const s=i++;this.filtersRowCtrl?this.filtersRowCtrl.rowIndex!==s&&this.filtersRowCtrl.setRowIndex(s):this.filtersRowCtrl=this.createBean(new pr(s,this.pinned,"filter"))})();const l=this.getAllCtrls();this.comp.setCtrls(l),this.restoreFocusOnHeader(t,n),r.length!==l.length&&this.beans.eventSvc.dispatchEvent({type:"headerRowsChanged"})}getHeaderCtrlForColumn(e){const t=t=>t?.getHeaderCellCtrls().find(t=>t.column===e);if(So(e))return t(this.columnsRowCtrl);if(0!==this.groupsRowCtrls.length)for(let o=0;othis.comp.setCenterWidth(`${e}px`),!0))}},fr={tag:"div",cls:"ag-pinned-left-header",role:"rowgroup"},Cr={tag:"div",cls:"ag-pinned-right-header",role:"rowgroup"},vr={tag:"div",cls:"ag-header-viewport",role:"rowgroup",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eCenterContainer",cls:"ag-header-container",role:"presentation"}]},wr=class extends Pi{constructor(e){super(),this.eCenterContainer=null,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate(),this.createManagedBean(new mr(this.pinned)).setComp({setDisplayed:e=>this.setDisplayed(e),setCtrls:e=>this.setCtrls(e),setCenterWidth:e=>this.eCenterContainer.style.width=e,setViewportScrollLeft:e=>this.getGui().scrollLeft=e,setPinnedContainerWidth:e=>{const t=this.getGui();t.style.width=e,t.style.maxWidth=e,t.style.minWidth=e}},this.getGui())}selectAndSetTemplate(){const e="left"==this.pinned,t="right"==this.pinned,o=e?fr:t?Cr:vr;this.setTemplate(o),this.eRowContainer=null!==this.eCenterContainer?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),e.getGui().remove()}setCtrls(e){const t=this.headerRowComps;let o;this.headerRowComps={},this.rowCompsList=[];const s=e=>{const t=e.getGui();t.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(t),o&&ae(this.eRowContainer,t,o),o=t};for(const i of e){const e=i.instanceId,o=t[e];delete t[e];const n=o||this.createBean(new er(i));this.headerRowComps[e]=n,this.rowCompsList.push(n),s(n)}for(const i of Object.values(t))this.destroyRowComp(i)}},br={tag:"div",cls:"ag-header",role:"presentation"},yr={selector:"AG-HEADER-ROOT",component:class extends Pi{constructor(){super(br)}postConstruct(){this.createManagedBean(new Kn).setComp({toggleCss:(e,t)=>this.toggleCss(e,t),setHeightAndMinHeight:e=>{this.getGui().style.height=e,this.getGui().style.minHeight=e}},this.getGui(),this.getFocusableElement());const e=e=>{this.createManagedBean(e),this.appendChild(e)};e(new wr("left")),e(new wr(null)),e(new wr("right"))}}},Sr={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},Rr=class extends Oe{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:"autoHeight"===e,normal:"normal"===e,print:"print"===e},o=t.autoHeight?Sr.AUTO_HEIGHT:t.print?Sr.PRINT:Sr.NORMAL;this.view.updateLayoutClasses(o,t)}},xr=class extends Pi{constructor(e,t){super(),this.direction=t,this.eViewport=null,this.eContainer=null,this.hideTimeout=0,this.setTemplate(e)}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.toggleCss("ag-apple-scrollbar",Ii()||Ai())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=Ni(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.toggleCss("ag-scrollbar-active",!0),o=()=>this.toggleCss("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:o,touchend:o})}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),be(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;_e(this,()=>re(t),()=>this.setScrollPosition(e),100)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}},Fr={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"}]},Dr={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:class extends xr{constructor(){super(Fr,"horizontal"),this.eLeftSpacer=null,this.eRightSpacer=null,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 tr(e=>this.eContainer.style.width=`${e}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(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 o=!this.enableRtl&&e,s=this.scrollVisibleSvc.getScrollbarWidth();o&&(t+=s),pe(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=s);let i=this.visibleCols.getColsLeftWidth();this.enableRtl&&e&&(i+=s),pe(this.eLeftSpacer,i),this.eLeftSpacer.classList.toggle("ag-scroller-corner",i<=s)}setScrollVisible(){const e=this.scrollVisibleSvc.horizontalScrollShowing,t=this.invisibleScrollbar,o=this.gos.get("suppressHorizontalScroll"),s=e&&this.scrollVisibleSvc.getScrollbarWidth()||0,i=o?0:0===s&&t?16:s,n=()=>{this.setScrollVisibleDebounce=0,this.toggleCss("ag-scrollbar-invisible",t),me(this.getGui(),i),me(this.eViewport,i),me(this.eContainer,i),i||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 te(this.eViewport,this.enableRtl)}setScrollPosition(e){re(this.eViewport)||this.attemptSettingScrollPosition(e),oe(this.eViewport,e,this.enableRtl)}}},Mr=class extends Oe{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,o=null!=t?`${t}px`:"";this.eContainer.style.height=o,this.eViewport&&(this.eViewport.style.height=o)}},Pr={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"}]}]},Er={selector:"AG-FAKE-VERTICAL-SCROLL",component:class extends xr{constructor(){super(Pr,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new Mr(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,o=this.invisibleScrollbar,s=t&&e.getScrollbarWidth()||0,i=0===s&&o?16:s;this.toggleCss("ag-scrollbar-invisible",o),pe(this.getGui(),i),pe(this.eViewport,i),pe(this.eContainer,i),this.setDisplayed(t,{skipAriaHidden:!0})}onRowContainerHeightChanged(e){const t=e.getGridBodyCtrl().eBodyViewport,o=this.getScrollPosition(),s=t.scrollTop;o!=s&&this.setScrollPosition(s,!0)}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(e,t){t||re(this.eViewport)||this.attemptSettingScrollPosition(e),this.eViewport.scrollTop=e}}},Tr="Viewport",Ir="fakeVScrollComp",Ar=["fakeHScrollComp","centerHeader","topCenter","bottomCenter","stickyTopCenter","stickyBottomCenter"],kr=class extends Oe{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=je(this,()=>this.lastScrollSource[1]=null,150),this.resetLastVScrollDebounced=je(this,()=>this.lastScrollSource[0]=null,150)}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,e=>{this.centerRowsCtrl=e.center,this.fakeVScrollComp=e.fakeVScrollComp,this.fakeHScrollComp=e.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,Tr)});for(const e of Ar){const t=this.ctrlsSvc.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){const e=this.gos.get("debounceVerticalScrollbar"),t=e?je(this,this.onVScroll.bind(this,Tr),100):this.onVScroll.bind(this,Tr),o=e?je(this,this.onVScroll.bind(this,Ir),100):this.onVScroll.bind(this,Ir);this.addManagedElementListeners(this.eBodyViewport,{scroll:t}),this.registerScrollPartner(this.fakeVScrollComp,o)}registerScrollPartner(e,t){e.onScrollCallback(t)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){null!=this.centerRowsCtrl&&(void 0===e&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft()),this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e)))}setScrollLeftForAllContainersExceptCurrent(e){for(const t of[...Ar,Tr])this.lastScrollSource[1]!==t&&oe(this.getViewportForSource(t),e,this.enableRtl)}getViewportForSource(e){return e===Tr?this.centerRowsCtrl.eViewport:this.ctrlsSvc.get(e).eViewport}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(0===t?this.lastScrollSource[0]=e:this.lastScrollSource[1]=e,!0):this.lastScrollSource[t]===e}onHScroll(e){if(!this.isControllingScroll(e,1))return;const{scrollLeft:t}=this.centerRowsCtrl.eViewport;if(this.shouldBlockScrollUpdate(1,t,!0))return;const o=te(this.getViewportForSource(e),this.enableRtl);this.doHorizontalScroll(o),this.resetLastHScrollDebounced()}onVScroll(e){if(!this.isControllingScroll(e,0))return;const t=e===Tr?this.eBodyViewport.scrollTop:this.fakeVScrollComp.getScrollPosition();let o=t;if(this.shouldBlockScrollUpdate(0,o,!0))return;e===Tr?this.fakeVScrollComp.setScrollPosition(o):(this.eBodyViewport.scrollTop=t,o=this.eBodyViewport.scrollTop,this.invalidateVerticalScroll(),o!==t&&this.fakeVScrollComp.setScrollPosition(o,!0));const{animationFrameSvc:s}=this;s?.setScrollTop(o),this.nextScrollTop=o,s?.active?s.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:1===e?"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"})},150)}shouldBlockScrollUpdate(e,t,o=!1){return!(o&&!Ai())&&(0===e?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=Z(this.eBodyViewport),{scrollHeight:o}=this.eBodyViewport;return!!(e<0||e+t>o)}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:o}=this.centerRowsCtrl.eViewport;if(this.enableRtl){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>o}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){const e=this.scrollLeft;let t=!1;for(const o of Ar)if(this.getViewportForSource(o).scrollLeft!==e){t=!0;break}t&&this.onHScroll(Tr)}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 o=this.centerRowsCtrl.eViewport.scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(e=this.enableRtl?e>0?0:o:Math.min(Math.max(e,0),o)),oe(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:e,lastScrollTop:t}=this;return{top:t,bottom:t+e}}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:o}=this.beans,s=o.getRowCount();let i=-1;for(let n=0;n=0&&this.ensureIndexVisible(i,t)}ensureIndexVisible(e,t,o=0){if(kt(this.gos,"print"))return;const{rowModel:s}=this.beans,i=s.getRowCount();if("number"!=typeof e||e<0||e>=i)return void Dt(88,{index:e});this.clearRetryListeners();const{frameworkOverrides:n,pageBounds:r,rowContainerHeight:l,rowRenderer:a}=this.beans;n.wrapIncoming(()=>{const i=this.ctrlsSvc.getGridBodyCtrl(),n=s.getRow(e);let d,c,h=0;this.invalidateVerticalScroll();do{const{stickyTopHeight:e,stickyBottomHeight:o}=i,s=n.rowTop,u=n.rowHeight,g=r.getPixelOffset(),p=n.rowTop-g,m=p+n.rowHeight,f=this.getVScrollPosition(),C=l.divStretchOffset,v=f.top+C,w=f.bottom+C,b=w-v,y=l.getScrollPositionForPixel(p),S=l.getScrollPositionForPixel(m-b),R=Math.min((y+S)/2,p);let x=null;"top"===t?x=y-e:"bottom"===t?x=S+o:"middle"===t?x=R:v+e>p?x=y-e:w-ob?y-e:S+o),null!==x&&(this.setVerticalScrollPosition(x),a.redraw({afterScroll:!0})),d=s!==n.rowTop||u!==n.rowHeight,c=e!==i.stickyTopHeight||o!==i.stickyBottomHeight,h++}while((d||c)&&h<10);if(this.animationFrameSvc?.flushAllFrames(),o<10&&(n?.stub||!this.beans.rowAutoHeight?.areRowsMeasured())){const i=this.getVScrollPosition().top;this.clearRetryListenerFncs=this.addManagedEventListeners({bodyScroll:()=>{i!==this.getVScrollPosition().top&&this.clearRetryListeners()},modelUpdated:()=>{this.clearRetryListeners(),e>=s.getRowCount()||this.ensureIndexVisible(e,t,o+1)}})}})}clearRetryListeners(){for(const e of this.clearRetryListenerFncs)e();this.clearRetryListenerFncs=[]}ensureColumnVisible(e,t="auto"){const{colModel:o,frameworkOverrides:s}=this.beans,i=o.getCol(e);if(!i)return;if(i.isPinned())return;if(!this.visibleCols.isColDisplayed(i))return;const n=this.getPositionedHorizontalScroll(i,t);s.wrapIncoming(()=>{null!==n&&this.centerRowsCtrl.setCenterViewportScrollLeft(n),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameSvc?.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:o,columnAfterEnd:s}=this.isColumnOutsideViewport(e),i=this.centerRowsCtrl.getCenterWidth()i:os}}getColumnBounds(e){const t=this.enableRtl,o=this.visibleCols.bodyWidth,s=e.getActualWidth(),i=e.getLeft(),n=t?-1:1,r=t?o-i:i;return{colLeft:r,colMiddle:r+s/2*n,colRight:r+s*n}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft();return{start:t,end:e+t,width:e}}},Lr={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 Gr(e,t,o,s,i,n){const r=Lr[o],l=Lr[r.opposite],a=!i||re(i),d=!n||re(n),c=r.overflow(e);if(c<=0)return!1;if(!t||0===s)return!0;const h=l.overflow(t);if(h<=0)return!0;if(c<=s){if(a&&d&&function({candidateOverflow:e,candidateScrollSize:t,candidateClientSize:o,scrollbarWidth:s}){if(e<=0||e>s)return!1;return t>o&&t<=o+s}({candidateOverflow:h,candidateScrollSize:l.scrollSize(t),candidateClientSize:l.clientSize(t),scrollbarWidth:s}))return!1;const o=r.clientSize(e)+s;return r.scrollSize(e)<=o}return!0}var Nr=class extends Oe{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:o}=this,s=()=>{be(e,()=>{this.onCenterViewportResized()})};t.registerViewportResizeListener(s),o.registerBodyViewportResizeListener(s)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleSvc.updateScrollGap(),this.centerContainerCtrl.isViewportInTheDOMTree()){const{pinnedCols:e,colFlex:t}=this.beans;e?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const o=this.centerContainerCtrl.getCenterWidth();o!==this.centerWidth&&(this.centerWidth=o,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=Z(this.gridBodyCtrl.eBodyViewport);this.bodyHeight!==e&&(this.bodyHeight=e,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,o=e.getCenterWidth(),s=e.getViewportScrollLeft();t.colViewport.setScrollPosition(o,s)}};function Br(e){return!(e.altKey||e.ctrlKey||e.metaKey)&&1===e.key?.length}function Hr(e,t,o,s){const i=t.getColDef().cellRendererParams?.suppressMouseEventHandling;return Or(e,t,o,s,i)}function Or(e,t,o,s,i){return!!i&&i(Co(e,{column:t,node:o,event:s}))}function Vr(e,t,o){let s=t;for(;s;){const t=Ot(e,s,o);if(t)return t;s=s.parentElement}return null}var zr="cellCtrl";function Wr(e,t){return Vr(e,t,zr)}var Ur="renderedRow";function $r(e,t){return Vr(e,t,Ur)}function jr(e,t,o,s,i){const n=s?s.getColDef().suppressKeyboardEvent:void 0;if(!n)return!1;const r=Co(e,{event:t,editing:i,column:s,node:o,data:o.data,colDef:s.getColDef()});return!(!n||!n(r))}var Kr=class extends Oe{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";Pe("pointerdown")?e="pointerdown":Pe("touchstart")&&(e="touchstart");const t=["dblclick","contextmenu","mouseover","mouseout","click",e];for(const o of t){const e=this.processMouseEvent.bind(this,o);this.addManagedElementListeners(this.element,{[o]:e})}}processMouseEvent(e,t){if(!Ae(this.beans,t)||Yi(t))return;const{cellCtrl:o,rowCtrl:s}=this.getControlsForEventTarget(t.target);"contextmenu"===e?(o?.column&&o.dispatchCellContextMenuEvent(t),this.beans.contextMenuSvc?.handleContextMenuMouseEvent(t,void 0,s,o)):(o&&o.onMouseEvent(e,t),s&&s.onMouseEvent(e,t))}getControlsForEventTarget(e){const{gos:t}=this;return{cellCtrl:Wr(t,e),rowCtrl:$r(t,e)}}processKeyboardEvent(e,t){const{cellCtrl:o,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(o?this.processCellKeyboardEvent(o,e,t):s?.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,o){const s=this.editSvc?.isEditing(e,{withOpenEditor:!0})??!1;jr(this.gos,o,e.rowNode,e.column,s)||"keydown"===t&&(!s&&this.beans.navigation?.handlePageScrollingKey(o)||e.onKeyDown(o),this.doGridOperations(o,s),Br(o)&&e.processCharacter(o)),"keydown"===t&&this.eventSvc.dispatchEvent(e.createEvent(o,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,o){const{rowNode:s}=e,{focusSvc:i,navigation:n}=this.beans,r=i.getFocusedCell()?.column;if(!jr(this.gos,o,s,r,!1)){const s=o.key;if("keydown"===t)switch(s){case Ms:case Ps:case Fs:case Ds:n?.handlePageScrollingKey(o,!0);break;case ws:case ys:if(!this.gos.get("embedFullWidthRows"))break;case bs:case Ss:e.onKeyboardNavigate(o);break;case ms:e.onTabKeyDown(o)}}"keydown"===t&&this.eventSvc.dispatchEvent(e.createRowEvent("cellKeyDown",o))}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!Ae(this.beans,e))return;const o=Gs(e),{clipboardSvc:s,undoRedo:i}=this.beans;return o===Es?this.onCtrlAndA(e):o===Ts?this.onCtrlAndC(s,e):o===Is?this.onCtrlAndD(s,e):o===As?this.onCtrlAndV(s,e):"KeyX"===o?this.onCtrlAndX(s,e):o===ks?this.onCtrlAndY(i):o===Ls?this.onCtrlAndZ(i,e):void 0}onCtrlAndA(e){const{beans:{rowModel:t,rangeSvc:o,selectionSvc:s},gos:i}=this;o&&so(i)&&!function(e){const t=e.get("rowSelection");return"string"!=typeof t&&"multiRow"===t?.mode&&(t.ctrlASelectsRows??!1)}(i)&&t.isRowsToRender()?function(e){const{pinnedRowModel:t,rowModel:o,rangeSvc:s,visibleCols:i}=e;if(!s||0===i.allCols.length)return;const n=t?.isEmpty("top")??1?null:"top";let r,l;t?.isEmpty("bottom")??1?(r=null,l=o.getRowCount()-1):(r="bottom",l=t?.getPinnedBottomRowCount()??-1),s.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:l,rowEndPinned:r})}(this.beans):s&&s.selectAllRowNodes({source:"keyboardSelectAll",selectAll:uo(i)}),e.preventDefault()}onCtrlAndC(e,t){if(!e||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:o}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(o,{withOpenEditor:!0})||(t.preventDefault(),e.copyToClipboard())}onCtrlAndX(e,t){if(!e||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:o}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(o,{withOpenEditor:!0})||(t.preventDefault(),e.cutToClipboard(void 0,"ui"))}onCtrlAndV(e,t){const{cellCtrl:o}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(o,{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")}},_r=e=>e.topRowCtrls,qr=e=>e.getStickyTopRowCtrls(),Yr=e=>e.getStickyBottomRowCtrls(),Zr=e=>e.bottomRowCtrls,Qr=e=>e.allRowCtrls,Xr=e=>e.getCtrls("top"),Jr=e=>e.getCtrls("center"),el=e=>e.getCtrls("bottom"),tl={center:{type:"center",name:"center-cols",getRowCtrls:Qr,getSpannedRowCtrls:Jr},left:{type:"left",name:"pinned-left-cols",pinnedType:"left",getRowCtrls:Qr,getSpannedRowCtrls:Jr},right:{type:"right",name:"pinned-right-cols",pinnedType:"right",getRowCtrls:Qr,getSpannedRowCtrls:Jr},fullWidth:{type:"fullWidth",name:"full-width",fullWidth:!0,getRowCtrls:Qr},topCenter:{type:"center",name:"floating-top",getRowCtrls:_r,getSpannedRowCtrls:Xr},topLeft:{type:"left",name:"pinned-left-floating",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:_r,getSpannedRowCtrls:Xr},topRight:{type:"right",name:"pinned-right-floating",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:_r,getSpannedRowCtrls:Xr},topFullWidth:{type:"fullWidth",name:"floating-top-full-width",fullWidth:!0,getRowCtrls:_r},stickyTopCenter:{type:"center",name:"sticky-top",getRowCtrls:qr},stickyTopLeft:{type:"left",name:"pinned-left-sticky-top",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:qr},stickyTopRight:{type:"right",name:"pinned-right-sticky-top",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:qr},stickyTopFullWidth:{type:"fullWidth",name:"sticky-top-full-width",fullWidth:!0,getRowCtrls:qr},stickyBottomCenter:{type:"center",name:"sticky-bottom",getRowCtrls:Yr},stickyBottomLeft:{type:"left",name:"pinned-left-sticky-bottom",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:Yr},stickyBottomRight:{type:"right",name:"pinned-right-sticky-bottom",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:Yr},stickyBottomFullWidth:{type:"fullWidth",name:"sticky-bottom-full-width",fullWidth:!0,getRowCtrls:Yr},bottomCenter:{type:"center",name:"floating-bottom",getRowCtrls:Zr,getSpannedRowCtrls:el},bottomLeft:{type:"left",name:"pinned-left-floating-bottom",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:Zr,getSpannedRowCtrls:el},bottomRight:{type:"right",name:"pinned-right-floating-bottom",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:Zr,getSpannedRowCtrls:el},bottomFullWidth:{type:"fullWidth",name:"floating-bottom-full-width",fullWidth:!0,getRowCtrls:Zr}};function ol(e){return`ag-${nl(e).name}-viewport`}function sl(e){const t=nl(e);return t.container??`ag-${t.name}-container`}function il(e){return`ag-${nl(e).name}-spanned-cells-container`}function nl(e){return tl[e]}var rl=["center","left","right","fullWidth"],ll=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],al=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],dl=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],cl=["stickyTopCenter","stickyTopLeft","stickyTopRight"],hl=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],ul=[...cl,"stickyTopFullWidth",...hl,"stickyBottomFullWidth"],gl=["topCenter","topLeft","topRight","bottomCenter","bottomLeft","bottomRight","center","left","right",...cl,...hl],pl=class extends Oe{constructor(e){super(),this.name=e,this.visible=!0,this.EMPTY_CTRLS=[],this.options=nl(e)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new Nr(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,o,s){this.comp=e,this.eContainer=t,this.eSpannedContainer=o,this.eViewport=s,this.createManagedBean(new Kr(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();const{pinnedCols:i,rangeSvc:n}=this.beans,r=()=>this.onPinnedWidthChanged();this.forContainers(al,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(i?.createPinnedWidthFeature(!0,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:r})}),this.forContainers(dl,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(i?.createPinnedWidthFeature(!1,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:r})}),this.forContainers(rl,()=>this.createManagedBean(new Mr(this.eContainer,"center"===this.name?s:void 0))),n&&this.forContainers(gl,()=>this.createManagedBean(n.createDragListenerFeature(this.eContainer))),this.forContainers(ll,()=>this.createManagedBean(new tr(e=>this.comp.setContainerWidth(`${e}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,o=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({displayedColumnsChanged:o,displayedColumnsWidthChanged:o,displayedRowsChanged:e=>this.onDisplayedRowsChanged(e.afterScroll)}),o(),this.onDisplayedRowsChanged(),e&&this.options.getSpannedRowCtrls&&t.get("enableCellSpan")&&this.addManagedListeners(e,{spannedRowsUpdated:()=>{const t=this.options.getSpannedRowCtrls(e);t&&this.comp.setSpannedRowCtrls(t,!1)}})}listenOnDomOrder(){if(ul.indexOf(this.name)>=0)return void this.comp.setDomOrder(!0);const e=()=>{const e=this.gos.get("ensureDomOrder"),t=kt(this.gos,"print");this.comp.setDomOrder(e||t)};this.addManagedPropertyListener("domLayout",e),e()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const{dragSvc:e}=this.beans;if(!e)return;const t=t=>{e.dragging&&t.cancelable&&t.preventDefault()};this.eContainer.addEventListener("touchmove",t,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",t))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),o=this.getCenterViewportScrollLeft();this.beans.colViewport.setScrollPosition(t,o,e)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return Q(this.eViewport)}getCenterViewportScrollLeft(){return te(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=we(this.beans,this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return ne(this.eViewport)}getViewportScrollLeft(){return te(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){const{beans:e,gos:t,eViewport:o}=this,s=t.get("alwaysShowHorizontalScroll"),{ctrlsSvc:i}=e,n=i.getGridBodyCtrl()?.eBodyViewport,r=i.get("fakeHScrollComp")?.getGui(),l=i.get("fakeVScrollComp")?.getGui();return s||function(e,t,o=Li()||0,s,i){return Gr(e,t,"horizontal",o,s,i)}(o,n,void 0,r,l)}setHorizontalScroll(e){this.comp.setHorizontalScroll(e)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){oe(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(null!=this.options.pinnedType)||!!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||0===t.length)return void this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});const o=kt(this.gos,"print"),s=this.gos.get("embedFullWidthRows")||o,i=t.filter(e=>{const t=e.isFullWidth();return this.options.fullWidth?!s&&t:s||!t});this.comp.setRowCtrls({rowCtrls:i,useFlushSync:e})}},ml="ag-force-vertical-scroll",fl=class extends Oe{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,o,s,i,n,r){this.comp=e,this.eGridBody=t,this.eBodyViewport=o,this.eTop=s,this.eBottom=i,this.eStickyTop=n,this.eStickyBottom=r,this.eCenterColsViewport=o.querySelector(`.${ol("center")}`),this.eFullWidthContainer=o.querySelector(`.${sl("fullWidth")}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",e=>this.setCellTextSelection(e.currentValue)),this.createManagedBean(new Rr(this.comp)),this.scrollFeature=this.createManagedBean(new kr(o)),this.beans.rowDragSvc?.setupRowDrag(o,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,o,i,n,r]),this.setGridRootRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),this.filterManager?.setupAdvFilterHeaderComp(s),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){const e=this.setFloatingHeights.bind(this),t=this.setGridRootRole.bind(this),o=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:o,rowResizeEnded:o}),this.addManagedPropertyListener("treeData",t)}toggleRowResizeStyles(e){const t="rowResizeStarted"===e.type;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 o=`calc(100% + ${(t&&e.getScrollbarWidth()||0)+(Ni()?16:0)}px)`;be(this.beans,()=>this.comp.setBodyViewportWidth(o)),this.updateScrollingClasses()}setGridRootRole(){const{rowGroupColsSvc:e,colModel:t,gos:o}=this;let s=o.get("treeData");if(!s){const o=t.isPivotMode();s=(e?e.columns.length:0)>=(o?2:1)}this.comp.setGridRootRole(s?"treegrid":"grid")}addFocusListeners(e){for(const t of e)this.addManagedElementListeners(t,{focusin:e=>{const{target:o}=e,s=q(o,"ag-root",t);t.classList.toggle("ag-has-focus",!s)},focusout:e=>{const{target:o,relatedTarget:s}=e,i=t.contains(s),n=q(s,"ag-root",t);q(o,"ag-root",t)||i&&!n||t.classList.remove("ag-has-focus")}})}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",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,o=t.isLastRowIndexKnown()?t.getRowCount():-1,s=-1===o?-1:e+o;this.comp.setRowCount(s)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const{gos:e,comp:t,ctrlsSvc:o}=this,s=e.get("alwaysShowVerticalScroll"),i=s?ml:null,n=kt(e,"normal");t.setAlwaysVerticalScrollClass(i,s);const r=o.get("center")?.eViewport,l=o.get("fakeHScrollComp")?.getGui(),a=o.get("fakeVScrollComp")?.getGui();return s||n&&function(e,t,o=Li()||0,s,i){return Gr(e,t,"vertical",o,s,i)}(this.eBodyViewport,r,void 0,a,l)}setupRowAnimationCssClass(){const{rowContainerHeight:e,environment:t}=this.beans;let o=t.sizesMeasured;const s=()=>{const t=o&&zt(this.gos)&&!e.stretching,s=t?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(s,t)};s(),this.addManagedEventListeners({heightScaleChanged:s}),this.addManagedPropertyListener("animateRows",s),this.addManagedEventListeners({stylesChanged:()=>{!o&&t.sizesMeasured&&(o=!0,s())}})}addBodyViewportListener(){const{eBodyViewport:e,eStickyTop:t,eStickyBottom:o,eTop:s,eBottom:i,beans:{popupSvc:n,touchSvc:r}}=this,l=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(e,{contextmenu:l}),r?.mockBodyContextMenu(this,l),this.addManagedElementListeners(e,{wheel:this.onBodyViewportWheel.bind(this,n)});const a=this.onStickyWheel.bind(this);for(const c of[t,o,s,i])this.addManagedElementListeners(c,{wheel:a});const d=this.onHorizontalWheel.bind(this);for(const c of["left","right","topLeft","topRight","bottomLeft","bottomRight"])this.addManagedElementListeners(this.ctrlsSvc.get(c).eContainer,{wheel:d});this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:e=>this.onFullWidthContainerWheel(e)})}onFullWidthContainerWheel(e){const{deltaX:t,deltaY:o,shiftKey:s}=e;(s||Math.abs(t)>Math.abs(o))&&Ae(this.beans,e)&&this.scrollGridBodyToMatchEvent(e)}onStickyWheel(e){const{deltaY:t}=e;this.scrollVertically(t)>0&&e.preventDefault()}onHorizontalWheel(e){const{deltaX:t,deltaY:o,shiftKey:s}=e;(s||Math.abs(t)>Math.abs(o))&&this.scrollGridBodyToMatchEvent(e)}scrollGridBodyToMatchEvent(e){const{deltaX:t,deltaY:o}=e;e.preventDefault(),this.eCenterColsViewport.scrollBy({left:t||o})}onBodyViewportContextMenu(e,t,o){if(!e&&!o)return;this.gos.get("preventDefaultOnContextMenu")&&(e||o).preventDefault();const{target:s}=e||t;s!==this.eBodyViewport&&s!==this.ctrlsSvc.get("center").eViewport||this.beans.contextMenuSvc?.showContextMenu({mouseEvent:e,touchEvent:o,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,o=e?.getPinnedTopTotalHeight(),s=e?.getPinnedBottomTotalHeight(),i=t.getPinnedRowBorderWidth()-t.getRowBorderWidth(),n=o?i+o:0,r=s?i+s:0;this.comp.setTopHeight(n),this.comp.setBottomHeight(r),this.comp.setTopInvisible(n<=0),this.comp.setBottomInvisible(r<=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){const e=this.scrollVisibleSvc.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${e}px)`)}else this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%")}setStickyTopOffsetTop(){const e=this.ctrlsSvc.get("gridHeaderCtrl").headerHeight+(this.filterManager?.getHeaderHeight()??0),t=this.pinnedRowModel?.getPinnedTopTotalHeight()??0;let o=0;e>0&&(o+=e),t>0&&(o+=t),o>0&&(o+=1),this.comp.setStickyTopTop(`${o}px`)}setStickyBottomOffsetBottom(){const{pinnedRowModel:e,scrollVisibleSvc:t,comp:o}=this,s=(e?.getPinnedBottomTotalHeight()??0)+(t.horizontalScrollShowing&&t.getScrollbarWidth()||0);o.setStickyBottomBottom(`${s}px`)}};function Cl(e){return xe(e)}var vl=class extends Pi{constructor(e,t,o,s,i){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=s;const n=Cl({tag:"div",role:t.getCellAriaRole(),attrs:{"comp-id":`${this.getCompId()}`,"col-id":t.column.colIdSanitised}});let r;this.eCell=n,t.isCellSpanning()?(r=Cl({tag:"div",cls:"ag-spanned-cell-wrapper",role:"presentation"}),r.appendChild(n),this.setTemplateFromElement(r)):this.setTemplateFromElement(n),this.cellCssManager=new xi(()=>n),this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1),t.setComp({toggleCss:(e,t)=>this.cellCssManager.toggleCss(e,t),setUserStyles:e=>he(n,e),getFocusableElement:()=>n,setIncludeSelection:e=>this.includeSelection=e,setIncludeRowDrag:e=>this.includeRowDrag=e,setIncludeDndSource:e=>this.includeDndSource=e,setRowResizerElement:e=>this.setRowResizerElement(e),setRenderDetails:(e,t,o)=>this.setRenderDetails(e,t,o),setEditDetails:(e,t,o)=>this.setEditDetails(e,t,o),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue(),refreshEditStyles:(e,t)=>this.refreshEditStyles(e,t)},n,r,this.eCellWrapper,o,i,void 0)}getParentOfValue(){return this.eCellValue??this.eCellWrapper??this.eCell}setRowResizerElement(e){this.rowResizerElement&&ie(this.rowResizerElement),this.rowResizerElement=e,e&&this.eCell.appendChild(e)}setRenderDetails(e,t,o){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=null==this.firstRender;const s=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?(o||s||!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,o){e?this.createCellEditorInstance(e,t,o):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,o=t||this.forceWrapper,s=o&&null==this.eCellWrapper;s&&(this.eCellWrapper=Cl({tag:"div",cls:"ag-cell-wrapper",role:"presentation"}),this.eCell.appendChild(this.eCellWrapper));const i=!o&&null!=this.eCellWrapper;i&&(ie(this.eCellWrapper),this.eCellWrapper=void 0),this.cellCssManager.toggleCss("ag-cell-value",!o);const n=!e&&o,r=n&&null==this.eCellValue;r&&(this.eCellValue=Cl({tag:"span",cls:this.cellCtrl.getCellValueClass(),role:"presentation"}),this.eCellWrapper.appendChild(this.eCellValue));const l=!n&&null!=this.eCellValue;l&&(ie(this.eCellValue),this.eCellValue=void 0);const a=s||i||r||l;return a&&this.removeControls(),!e&&t&&this.addControls(),a}addControls(){const{cellCtrl:e,eCellWrapper:t,eCellValue:o,includeRowDrag:s,includeDndSource:i,includeSelection:n}=this,r=e=>{e&&t.insertBefore(e.getGui(),o)};s&&null==this.rowDraggingComp&&(this.rowDraggingComp=e.createRowDragComp(),r(this.rowDraggingComp)),i&&null==this.dndSourceComp&&(this.dndSourceComp=e.createDndSource(),r(this.dndSourceComp)),n&&null==this.checkboxSelectionComp&&(this.checkboxSelectionComp=e.createSelectionCheckbox(),r(this.checkboxSelectionComp))}createCellEditorInstance(e,t,o){const s=this.editorVersion,i=e.newAgStackInstance(),{params:n}=e;i.then(e=>this.afterCellEditorCreated(s,e,n,t,o)),a(this.cellEditor)&&n.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();se(t);const o=m(e);null!=o&&(t.textContent=o)}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),ie(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;(this.cellEditorPopupWrapper?.getGui().contains(w(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),ie(this.cellEditorGui),this.cellCtrl.disableEditorTooltipFeature(),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(null==this.cellRenderer?.refresh)return!1;if(this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return!0===t||void 0===t}createCellRendererInstance(e){const t=this.rendererVersion,o=e=>o=>{if(this.rendererVersion!==t||!this.isAlive())return;const s=e.newAgStackInstance(),i=this.afterCellRendererCreated.bind(this,t,e.componentClass);s?.then(i)},{animationFrameSvc:s}=this.beans;let i;if(i=s?.active&&this.firstRender?(e,t=!1)=>{s.createTask(o(e),this.rowNode.rowIndex,"p2",e.componentFromFramework,t)}:e=>o(e)(),e.params?.deferRender&&!this.cellCtrl.rowNode.group){const{loadingComp:t,onReady:o}=this.cellCtrl.getDeferLoadingCellRenderer();t&&(i(t),o.then(()=>i(e,!0)))}else i(e)}afterCellRendererCreated(e,t,o){if(!this.isAlive()||e!==this.rendererVersion)return void this.beans.context.destroyBean(o);this.cellRenderer=o,this.cellRendererClass=t;const s=o.getGui();if(this.cellRendererGui=s,null!=s){const e=this.getParentOfValue();se(e),e.appendChild(s)}}afterCellEditorCreated(e,t,o,s,i){const n=e!==this.editorVersion,{context:r}=this.beans;if(n)return void r.destroyBean(t);if(t.isCancelBeforeStart?.())return r.destroyBean(t),void this.cellCtrl.stopEditing(!0);if(!t.getGui)return Dt(97,{colId:this.column.getId()}),void r.destroyBean(t);this.cellEditor=t,this.cellEditorGui=t.getGui();const l=s||t.isPopup?.();l?this.addPopupCellEditor(o,i):this.addInCellEditor(),this.refreshEditStyles(!0,l),t.afterGuiAttached?.(),this.cellCtrl.enableEditorTooltipFeature(t),this.cellCtrl.cellEditorAttached()}refreshEditStyles(e,t){const{cellCssManager:o}=this;o.toggleCss("ag-cell-inline-editing",e&&!t),o.toggleCss("ag-cell-popup-editing",e&&!!t),o.toggleCss("ag-cell-not-inline-editing",!e||!!t)}addInCellEditor(){const{eCell:e}=this;e.contains(w(this.beans))&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),se(this.getParentOfValue()),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){const{gos:o,context:s,popupSvc:i,editSvc:n}=this.beans;"fullRow"===o.get("editType")&&Dt(98);const r=this.cellEditorPopupWrapper=s.createBean(n.createPopupEditorWrapper(e)),{cellEditor:l,cellEditorGui:a,eCell:d,rowNode:c,column:h,cellCtrl:u}=this,g=r.getGui();a&&g.appendChild(a);const p=o.get("stopEditingWhenCellsLoseFocus"),m={ePopup:g,additionalParams:{column:h,rowNode:c},type:"popupCellEditor",eventSource:d,position:null!=t?t:l.getPopupPosition?.()??"over",alignSide:o.get("enableRtl")?"right":"left",keepWithinBounds:!0},f=i.positionPopupByComponent.bind(i,m),C=i.addPopup({modal:p,eChild:g,closeOnEsc:!0,closedCallback:e=>{u.onPopupEditorClosed(e)},anchorToElement:d,positionCallback:f,ariaOwns:d});C&&(this.hideEditorPopup=C.hideFunc)}detach(){this.getGui().remove()}destroy(){this.destroyRenderer(),this.destroyEditor(),this.removeControls(),super.destroy()}},wl=class extends Pi{constructor(e,t,o){super(),this.cellComps=/* @__PURE__ */new Map,this.beans=t,this.rowCtrl=e;const s=Cl({tag:"div",role:"row",attrs:{"comp-id":`${this.getCompId()}`}});this.setInitialStyle(s,o),this.setTemplateFromElement(s);const i=s.style;this.domOrder=this.rowCtrl.getDomOrder(),e.setComp({setDomOrder:e=>this.domOrder=e,setCellCtrls:e=>this.setCellCtrls(e),showFullWidth:e=>this.showFullWidth(e),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,getFullWidthCellRendererParams:()=>this.fullWidthCellRendererParams,toggleCss:(e,t)=>this.toggleCss(e,t),setUserStyles:e=>he(s,e),setTop:e=>i.top=e,setTransform:e=>i.transform=e,setRowIndex:e=>s.setAttribute("row-index",e),setRowId:e=>s.setAttribute("row-id",e),setRowBusinessKey:e=>s.setAttribute("row-business-key",e),refreshFullWidth:e=>{const t=e();return this.fullWidthCellRendererParams=t,this.fullWidthCellRenderer?.refresh?.(t)??!1}},this.getGui(),o,void 0),this.addDestroyFunc(()=>{e.unsetComp(o)})}setInitialStyle(e,t){const o=this.rowCtrl.getInitialTransform(t);if(o)e.style.setProperty("transform",o);else{const o=this.rowCtrl.getInitialRowTop(t);o&&e.style.setProperty("top",o)}}showFullWidth(e){e.newAgStackInstance().then(t=>{if(this.isAlive()){const o=t.getGui();this.getGui().appendChild(o),this.rowCtrl.setupDetailRowAutoHeight(o),this.setFullWidthRowComp(t,e.params)}else this.beans.context.destroyBean(t)})}setCellCtrls(e){const t=new Map(this.cellComps);for(const o of e){const e=o.instanceId;this.cellComps.has(e)?t.delete(e):this.newCellComp(o)}this.destroyCells(t),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];for(const o of e){const e=this.cellComps.get(o.instanceId);e&&t.push(e.getGui())}de(this.getGui(),t)}newCellComp(e){const t=this.beans.editSvc?.isEditing(e,{withOpenEditor:!0})??!1,o=new vl(this.beans,e,this.rowCtrl.printLayout,this.getGui(),t);this.cellComps.set(e.instanceId,o),this.getGui().appendChild(o.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 e=t.cellCtrl.instanceId;this.cellComps.get(e)===t&&(t.detach(),t.destroy(),this.cellComps.delete(e))}}},bl={selector:"AG-ROW-CONTAINER",component:class extends Pi{constructor(e){super(),this.eViewport=null,this.eContainer=null,this.eSpannedContainer=null,this.rowCompsNoSpan={},this.rowCompsWithSpan={},this.name=e?.name,this.options=nl(this.name)}postConstruct(){this.setTemplate(function(e,t,o){const s=!!o.gos.get("enableCellSpan")&&!!t.getSpannedRowCtrls,i={tag:"div",ref:"eContainer",cls:sl(e),role:"rowgroup"};if("center"===t.type||s){const t={tag:"div",ref:"eSpannedContainer",cls:`ag-spanning-container ${il(e)}`,role:"presentation"};return i.role="presentation",{tag:"div",ref:"eViewport",cls:`ag-viewport ${ol(e)}`,role:"rowgroup",children:[i,s?t:null]}}return i}(this.name,this.options,this.beans)),this.createManagedBean(new pl(this.name)).setComp({setHorizontalScroll:e=>this.eViewport.scrollLeft=e,setViewportHeight:e=>this.eViewport.style.height=e,setRowCtrls:({rowCtrls:e})=>this.setRowCtrls(e),setSpannedRowCtrls:e=>this.setRowCtrls(e,!0),setDomOrder:e=>{this.domOrder=e},setContainerWidth:e=>{this.eContainer.style.width=e,this.eSpannedContainer&&(this.eSpannedContainer.style.width=e)},setOffsetTop:e=>{const t=`translateY(${e})`;this.eContainer.style.transform=t,this.eSpannedContainer&&(this.eSpannedContainer.style.transform=t)}},this.eContainer,this.eSpannedContainer,this.eViewport)}destroy(){this.setRowCtrls([]),this.setRowCtrls([],!0),super.destroy(),this.lastPlacedElement=null}setRowCtrls(e,t){const{beans:o,options:s}=this,i=t?this.eSpannedContainer:this.eContainer,n=t?{...this.rowCompsWithSpan}:{...this.rowCompsNoSpan},r={};t?this.rowCompsWithSpan=r:this.rowCompsNoSpan=r,this.lastPlacedElement=null;const l=[];for(const a of e){const e=a.instanceId,t=n[e];let i;if(t)i=t,delete n[e];else{if(!a.rowNode.displayed)continue;i=new wl(a,o,s.type)}r[e]=i,l.push([i,!t])}this.removeOldRows(Object.values(n)),this.addRowNodes(l,i)}addRowNodes(e,t){const{domOrder:o}=this;for(const[s,i]of e){const e=s.getGui();o?this.ensureDomOrder(e,t):i&&t.appendChild(e)}}removeOldRows(e){for(const t of e)t.getGui().remove(),t.destroy()}ensureDomOrder(e,t){ae(t,e,this.lastPlacedElement),this.lastPlacedElement=e}}};function yl(e,t){return t.map(t=>{const o=`e${t[0].toUpperCase()+t.substring(1)}RowContainer`;return e[o]={name:t},{tag:"ag-row-container",ref:o,attrs:{name:t}}})}var Sl={selector:"AG-GRID-BODY",component:class extends Pi{constructor(){super(...arguments),this.eGridRoot=null,this.eBodyViewport=null,this.eStickyTop=null,this.eStickyBottom=null,this.eTop=null,this.eBottom=null,this.eBody=null}postConstruct(){const{overlays:e,rangeSvc:t}=this.beans,o=e?.getOverlayWrapperSelector(),{paramsMap:s,elementParams:i}=function(e){const t={};return{paramsMap:t,elementParams:{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:yl(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:yl(t,["left","center","right","fullWidth"])},{tag:"ag-fake-vertical-scroll"}]},{tag:"div",ref:"eStickyTop",cls:"ag-sticky-top",role:"presentation",children:yl(t,["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])},{tag:"div",ref:"eStickyBottom",cls:"ag-sticky-bottom",role:"presentation",children:yl(t,["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])},{tag:"div",ref:"eBottom",cls:"ag-floating-bottom",role:"presentation",children:yl(t,["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])},{tag:"ag-fake-horizontal-scroll"},e?{tag:"ag-overlay-wrapper"}:null]}}}(!!o);this.setTemplate(i,[...o?[o]:[],Dr,Er,yr,bl],s);const n=(e,t)=>{const o=`${e}px`;t.style.minHeight=o,t.style.height=o},r={setRowAnimationCssOnBodyViewport:(e,t)=>this.setRowAnimationCssOnBodyViewport(e,t),setColumnCount:e=>{F(this.getGui(),"colcount",e)},setRowCount:e=>{F(this.getGui(),"rowcount",e)},setTopHeight:e=>n(e,this.eTop),setBottomHeight:e=>n(e,this.eBottom),setTopInvisible:e=>this.eTop.classList.toggle("ag-invisible",e),setBottomInvisible:e=>this.eBottom.classList.toggle("ag-invisible",e),setStickyTopHeight:e=>this.eStickyTop.style.height=e,setStickyTopTop:e=>this.eStickyTop.style.top=e,setStickyTopWidth:e=>this.eStickyTop.style.width=e,setStickyBottomHeight:e=>{this.eStickyBottom.style.height=e,this.eStickyBottom.classList.toggle("ag-invisible","0px"===e)},setStickyBottomBottom:e=>this.eStickyBottom.style.bottom=e,setStickyBottomWidth:e=>this.eStickyBottom.style.width=e,setColumnMovingCss:(e,t)=>this.toggleCss(e,t),updateLayoutClasses:(e,t)=>{const o=[this.eBodyViewport.classList,this.eBody.classList];for(const s of o)s.toggle(Sr.AUTO_HEIGHT,t.autoHeight),s.toggle(Sr.NORMAL,t.normal),s.toggle(Sr.PRINT,t.print);this.toggleCss(Sr.AUTO_HEIGHT,t.autoHeight),this.toggleCss(Sr.NORMAL,t.normal),this.toggleCss(Sr.PRINT,t.print)},setAlwaysVerticalScrollClass:(e,t)=>this.eBodyViewport.classList.toggle(ml,t),registerBodyViewportResizeListener:e=>{const t=we(this.beans,this.eBodyViewport,e);this.addDestroyFunc(()=>t())},setPinnedTopBottomOverflowY:e=>this.eTop.style.overflowY=this.eBottom.style.overflowY=e,setCellSelectableCss:(e,t)=>{for(const o of[this.eTop,this.eBodyViewport,this.eBottom])o.classList.toggle(e,t)},setBodyViewportWidth:e=>this.eBodyViewport.style.width=e,setGridRootRole:e=>P(this.eGridRoot,e)};this.ctrl=this.createManagedBean(new fl),this.ctrl.setComp(r,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(t&&so(this.gos)||co(this.gos))&&F(this.getGui(),"multiselectable",!0)}setRowAnimationCssOnBodyViewport(e,t){const o=this.eBodyViewport.classList;o.toggle("ag-row-animation",t),o.toggle("ag-row-no-animation",!t)}getFocusableContainerName(){return"gridBody"}}},Rl="ag-tab-guard-top",xl=class extends He{constructor(e,t){super(),this.stopPropagationCallbacks=t,this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:o,eTopGuard:s,eBottomGuard:i,focusTrapActive:n,forceFocusOutWhenTabGuardsAreEmpty:r,isFocusableContainer:l,focusInnerElement:a,onFocusIn:d,onFocusOut:c,shouldStopEventPropagation:h,onTabKeyDown:u,handleKeyDown:g,isEmpty:p,eFocusableElement:m}=e;this.comp=o,this.eTopGuard=s,this.eBottomGuard=i,this.providedFocusInnerElement=a,this.eFocusableElement=m,this.focusTrapActive=!!n,this.forceFocusOutWhenTabGuardsAreEmpty=!!r,this.isFocusableContainer=!!l,this.providedFocusIn=d,this.providedFocusOut=c,this.providedShouldStopEventPropagation=h,this.providedOnTabKeyDown=u,this.providedHandleKeyDown=g,this.providedIsEmpty=p}postConstruct(){this.createManagedBean(new Ki(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()}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)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);if(this.forceFocusOutWhenTabGuardsAreEmpty&&(this.providedIsEmpty?this.providedIsEmpty():0===zi(this.eFocusableElement,".ag-tab-guard").length))return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);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=zi(b(this.beans).body,null,!0),o=t.indexOf(e?this.eTopGuard:this.eBottomGuard);if(-1===o)return;let s,i;e?(s=0,i=o):(s=o+1,i=t.length);const n=t.slice(s,i),r=this.gos.get("tabIndex");n.sort((e,t)=>{const o=Number.parseInt(e.getAttribute("tabindex")||"0"),s=Number.parseInt(t.getAttribute("tabindex")||"0");return s===r?1:o===r?-1:0===o?1:0===s?-1:o-s}),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)return void this.providedOnTabKeyDown(e);if(this.focusTrapActive)return;if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const o=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),o&&(o.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=zi(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)}getNextFocusableElement(e){return Ui(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}},Fl=class extends He{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:o,eFocusableElement:s,stopPropagationCallbacks:i}=this,n=[t,o],r={setTabIndex:e=>{for(const t of n)null==e?t.removeAttribute("tabindex"):t.setAttribute("tabindex",e)}};this.addTabGuards(t,o);const{focusTrapActive:l=!1,onFocusIn:a,onFocusOut:d,focusInnerElement:c,handleKeyDown:h,onTabKeyDown:u,shouldStopEventPropagation:g,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:m,isFocusableContainer:f}=e;this.tabGuardCtrl=this.createManagedBean(new xl({comp:r,focusTrapActive:l,eTopGuard:t,eBottomGuard:o,eFocusableElement:s,onFocusIn:a,onFocusOut:d,focusInnerElement:c,handleKeyDown:h,onTabKeyDown:u,shouldStopEventPropagation:g,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:m,isFocusableContainer:f},i))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=b(this.beans).createElement("div"),o="top"===e?Rl:"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",o),P(t,"presentation"),t}addTabGuards(e,t){const o=this.eFocusableElement;o.prepend(e),o.append(t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];se(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,o){Ce(t)||(t=t.getGui());const{eBottomGuard:s}=this;s?s.before(t):e(t,o)}destroy(){const{eTopGuard:e,eBottomGuard:t}=this;ie(e),ie(t),super.destroy()}},Dl=class extends Di{initialiseTabGuard(e,t){this.tabGuardFeature=this.createManagedBean(new Fl(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)}},Ml=class extends Dl{initialiseTabGuard(e){super.initialiseTabGuard(e,Zi)}},Pl=(e,t)=>Nn(e,()=>Wi(e.getGui(),t,!1,!0)),El=e=>e?.getFocusableContainerName()??"external",Tl=class extends Oe{constructor(){super(...arguments),this.additionalFocusableContainers=/* @__PURE__ */new Set}setComp(e,t,o){this.view=e,this.eGridHostDiv=t,this.eGui=o,this.eGui.setAttribute("grid-id",this.beans.context.getId());const{dragAndDrop:s,ctrlsSvc:i}=this.beans;s?.registerGridDropTarget(()=>this.eGui,this),this.createManagedBean(new Rr(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");const n=we(this.beans,this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>n()),i.register("gridCtrl",this)}isDetailGrid(){return $i(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;!1===e?t.setCursor(null):t.setCursor(1===e?"ew-resize":"ns-resize")}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),{indexWithFocus:o,nextIndex:s}=this.getNextFocusableIndex(t,e),i=-1===o?e?t.length-1:0:s,{gos:n,beans:{focusSvc:r,navigation:l}}=this,a=n.getCallback("tabToNextGridContainer");if(a){const s=r.getDefaultTabToNextGridContainerTarget({backwards:e,focusableContainers:t,nextIndex:i}),n=El(t[i]),h=null==s&&"gridBody"===n?"gridBody":null==(c=s)?"external":"string"==typeof c?c:"gridBody",u=a({backwards:e,previousContainer:El(t[o]),nextContainer:h,defaultTarget:s});if(void 0!==u){if("boolean"==typeof u)return u;if("string"==typeof u){if("gridBody"===u)return this.focusGridBodyDefault(e)||void 0;const o=t.find(e=>e.getFocusableContainerName()===u);if(!o)return;return!!Pl(o,e)||void 0}return d=u,null!=d?.headerRowIndex?r.focusHeaderPosition({headerPosition:u})||void 0:(l?.ensureCellVisible(u),r.setFocusedCell({...u,forceBrowserFocus:!0}),r.isCellFocused(u)||void 0)}}var d,c;return this.focusNextInnerContainerDefault({backwards:e,focusableContainers:t,indexWithFocus:o,nextIndex:i})||void 0}focusInnerElement(t){const{gos:o,beans:s,beans:{focusSvc:i,visibleCols:n}}=this;if(o.getCallback("focusGridInnerElement")?.({fromBottom:!!t}))return!0;const r=this.getFocusableContainers();if(t)return!!this.focusNextInnerContainerDefault({backwards:!0,focusableContainers:r,indexWithFocus:r.length,nextIndex:r.length-1})||i.focusGridView({column:e(n.allCols),backwards:!0});const l=n.allCols;if(0===o.get("headerHeight")||An(s)){if(i.focusGridView({column:l[0],backwards:t}))return!0;for(let e=1;ee.getGui().contains(o));return{indexWithFocus:s,nextIndex:s+(t?-1:1)}}focusGridBodyDefault(t){const{gos:o,beans:s,beans:{focusSvc:i,visibleCols:{allCols:n}}}=this;return t?i.focusGridView({column:e(n),backwards:!0}):0===o.get("headerHeight")||An(s)?i.focusGridView({column:n[0]}):i.focusFirstHeader()}focusNextInnerContainerDefault(e){const{backwards:t,focusableContainers:o,indexWithFocus:s}=e,i=t?-1:1;for(let n=e.nextIndex;n>=0&&nn:sthis.destroyBean(this),setRtlClass:e=>this.addCss(e),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:e=>{this.getGui().style.userSelect=null!=e?e:"",this.getGui().style.webkitUserSelect=null!=e?e:""},setCursor:e=>{this.getGui().style.cursor=null!=e?e:""}},t=this.createManagedBean(new Tl),o=t.getOptionalSelectors(),s=this.createTemplate(o),i=[Sl,...Object.values(o).filter(e=>!!e)];this.setTemplate(s,i),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>t.focusInnerElement(e),forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:()=>!t.isFocusable()})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{e.remove(),tt(this.gos)})}updateLayoutClasses(e,t){const o=this.rootWrapperBody.classList,{AUTO_HEIGHT:s,NORMAL:i,PRINT:n}=Sr,{autoHeight:r,normal:l,print:a}=t;o.toggle(s,r),o.toggle(i,l),o.toggle(n,a),this.toggleCss(s,r),this.toggleCss(i,l),this.toggleCss(n,a)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?{tag:"ag-grid-header-drop-zones",ref:"gridHeaderDropZones"}:null,o=e.sideBarSelector?{tag:"ag-side-bar",ref:"sideBar"}:null,s=e.statusBarSelector?{tag:"ag-status-bar",ref:"statusBar"}:null,i=e.watermarkSelector?{tag:"ag-watermark"}: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"},o]},s,e.paginationSelector?{tag:"ag-pagination",ref:"pagination"}:null,i]}}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){e||!this.pagination?.isDisplayed()?super.forceFocusOutOfContainer(e):this.pagination.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(e=>re(e.getGui()))}},Al=(e,t)=>{for(const o of Object.keys(t))t[o]=e;return t},kl={dispatchEvent:"CommunityCore",...Al("CommunityCore",{destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,isModuleRegistered:0}),...Al("GridState",{getState:0,setState:0}),...Al("SharedRowSelection",{setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0}),...Al("RowApi",{redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRowIndex:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0}),...Al("ScrollApi",{getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0}),...Al("KeyboardNavigation",{getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0}),...Al("EventApi",{addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0}),...Al("ValueCache",{expireValueCache:0}),...Al("CellApi",{getCellValue:0}),...Al("SharedMenu",{showColumnMenu:0,hidePopupMenu:0}),...Al("Sort",{onSortChanged:0}),...Al("PinnedRow",{getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,forEachPinnedRow:0}),...Al("Overlay",{showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0}),...Al("RenderApi",{setGridAriaProperty:0,refreshCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0}),...Al("HighlightChanges",{flashCells:0}),...Al("RowDrag",{addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getRowDropPositionIndicator:0,setRowDropPositionIndicator:0}),...Al("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}),...Al("ColumnAutoSize",{sizeColumnsToFit:0,autoSizeColumns:0,autoSizeAllColumns:0}),...Al("ColumnGroup",{setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumnGroup:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0}),...Al("ColumnMove",{moveColumnByIndex:0,moveColumns:0}),...Al("ColumnResize",{setColumnWidths:0}),...Al("ColumnHover",{isColumnHovered:0}),...Al("EditCore",{getCellEditorInstances:0,getEditingCells:0,getEditRowValues:0,stopEditing:0,startEditingCell:0,isEditing:0,validateEdit:0}),...Al("BatchEdit",{startBatchEdit:0,cancelBatchEdit:0,commitBatchEdit:0,isBatchEditing:0}),...Al("UndoRedoEdit",{undoCellEditing:0,redoCellEditing:0,getCurrentUndoSize:0,getCurrentRedoSize:0}),...Al("FilterCore",{isAnyFilterPresent:0,onFilterChanged:0}),...Al("ColumnFilter",{isColumnFilterPresent:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,hideColumnFilter:0,getColumnFilterHandler:0,doFilterAction:0}),...Al("QuickFilter",{isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0}),...Al("Find",{findGetActiveMatch:0,findGetTotalMatches:0,findGoTo:0,findNext:0,findPrevious:0,findGetNumMatches:0,findGetParts:0,findClearActive:0,findRefresh:0}),...Al("Pagination",{paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0}),...Al("CsrmSsrmSharedApi",{expandAll:0,collapseAll:0,resetRowGroupExpansion:0}),...Al("SsrmInfiniteSharedApi",{setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...Al("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}),...Al("CsvExport",{getDataAsCsv:0,exportDataAsCsv:0}),...Al("InfiniteRowModel",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...Al("AdvancedFilter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...Al("IntegratedCharts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...Al("Clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...Al("ExcelExport",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...Al("SharedMasterDetail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...Al("ContextMenu",{showContextMenu:0}),...Al("ColumnMenu",{showColumnChooser:0,hideColumnChooser:0}),...Al("CellSelection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...Al("SharedRowGrouping",{setRowGroupColumns:0,removeRowGroupColumns:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0}),...Al("SharedAggregation",{addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0}),...Al("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}),...Al("ServerSideRowModelApi",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0,onRowHeightChanged:0,resetRowHeights:0}),...Al("SideBar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...Al("StatusBar",{getStatusPanel:0}),...Al("AiToolkit",{getStructuredSchema:0})},Ll={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},Gl=(e,t)=>e.eventSvc.dispatchEvent(t),Nl=class{};function Bl(e,t){e.gos.updateGridOptions({options:t})}function Hl(e,t,o){const s=Ol(e,t,o);if(s){const{className:e}=s;if("string"==typeof e&&e.includes("ag-icon")||"object"==typeof e&&e["ag-icon"])return s}const i=Cl({tag:"span"});return i.appendChild(s),i}function Ol(e,t,o){let s=null;"smallDown"===e?Dt(262):"smallLeft"===e?Dt(263):"smallRight"===e&&Dt(264);const i=o?.getColDef().icons;if(i&&(s=i[e]),t.gos&&!s){const o=t.gos.get("icons");o&&(s=o[e])}if(s){let t;if("function"==typeof s)t=s();else{if("string"!=typeof s)return void Dt(38,{iconName:e});t=s}return"string"==typeof t?le(t):Ce(t)?t:void Dt(133,{iconName:e})}{const o=t.registry.getIcon(e);return o||t.validation?.validateIcon(e),Cl({tag:"span",cls:`ag-icon ag-icon-${o??e}`,role:"presentation",attrs:{unselectable:"on"}})}}Reflect.defineProperty(Nl,"name",{value:"GridApi"});var Vl,zl,Wl={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"}]}]},Ul=(e,t)=>{if(null!=t&&e?.setPointerCapture)try{return e.setPointerCapture(t),e.hasPointerCapture(t)}catch{}return!1},$l=e=>{const{eElement:t,onLost:o}=e;t&&o&&(t.removeEventListener("lostpointercapture",o),e.onLost=null)},jl={passive:!0},Kl={passive:!1},_l=e=>{if(zl){if(zl.has(e))return!1}else zl=/* @__PURE__ */new WeakSet;return zl.add(e),!0},ql=class extends He{constructor(){super(...arguments),this.beanName="dragSvc",this.dragging=!1,this.drag=null,this.dragSources=[]}get startTarget(){return this.drag?.start.target??null}isPointer(){return!!Vl?.has(v(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)Yl(t);e.length=0,super.destroy()}removeDragSource(e){const t=this.dragSources;for(let o=0,s=t.length;othis.onPointerDown(e,t),Kl],[t,"mousedown",t=>this.onMouseDown(e,t)]);const r=this.gos.get("suppressTouch");o&&!r&&ke(s,[t,"touchstart",t=>this.onTouchStart(e,t),Kl])}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("mousemove"===t||"pointermove"===t)&&e.cancelable&&Ae(this.beans,e)&&!j(Ql(e))}initDrag(e,...t){this.drag=e;const o=this.beans,s=e=>this.onScroll(e),i=v(o),n=b(o);ke(e.handlers,[i,"contextmenu",Ge],[i,"keydown",e=>this.onKeyDown(e)],[n,"scroll",s,{capture:!0}],[n.defaultView||window,"scroll",s],...t)}destroyDrag(){this.dragging=!1;const e=this.drag;if(e){const t=e.rootEl;Vl?.get(t)===e&&Vl.delete(t),this.drag=null,(e=>{if(!e)return;$l(e);const{eElement:t,pointerId:o}=e;if(t){try{t.releasePointerCapture(o)}catch{}e.eElement=null}})(e.pointerCapture),Le(e.handlers)}}onPointerDown(e,t){if(this.isPointer())return;const o=this.beans;if(zl?.has(t))return;const s=t.pointerType;if("touch"===s){if(o.gos.get("suppressTouch")||!e.includeTouch)return;if(e.stopPropagationForTouch&&t.stopPropagation(),j(Ql(t)))return}if(!t.isPrimary)return;if("mouse"===s&&0!==t.button)return;this.destroyDrag();const i=v(o),n=e.eElement,r=t.pointerId,l=new Zl(i,e,t,r);Vl??(Vl=/* @__PURE__ */new WeakMap),Vl.set(i,l);const a=e=>this.draggingPreventDefault(e);this.initDrag(l,[i,"pointerup",e=>{e.pointerId===r&&this.onMouseOrPointerUp(e)}],[i,"pointercancel",e=>{e.pointerId===r&&_l(e)&&this.cancelDrag()}],[i,"pointermove",e=>{e.pointerId===r&&this.onMouseOrPointerMove(e)},Kl],[i,"touchmove",a,Kl],[n,"mousemove",a,Kl]),0===e.dragStartPixels?this.onMouseOrPointerMove(t):_l(t)}onTouchStart(e,t){if(this.gos.get("suppressTouch")||!e.includeTouch)return;if(!_l(t))return;if(j(Ql(t)))return;if(e.stopPropagationForTouch&&t.stopPropagation(),this.isPointer())return void(this.dragging&&Ge(t));this.destroyDrag();const o=this.beans,s=new Zl(v(o),e,t.touches[0]),i=e=>this.onTouchUp(e),n=e=>this.onTouchCancel(e),r=v(o),l=t.target??e.eElement;this.initDrag(s,[l,"touchmove",e=>this.onTouchMove(e),jl],[l,"touchend",i,jl],[l,"touchcancel",n,jl],[r,"touchmove",e=>this.draggingPreventDefault(e),Kl],[r,"touchend",i,Kl],[r,"touchcancel",n,Kl]),0===e.dragStartPixels&&this.onMove(s.start)}draggingPreventDefault(e){this.dragging&&Ge(e)}onMouseDown(e,t){if(0!==t.button)return;if(zl?.has(t))return;if(this.isPointer())return;const o=this.beans;this.destroyDrag();const s=new Zl(v(o),e,t),i=v(o);this.initDrag(s,[i,"mousemove",e=>this.onMouseOrPointerMove(e)],[i,"mouseup",e=>this.onMouseOrPointerUp(e)]),0===e.dragStartPixels?this.onMouseOrPointerMove(t):_l(t)}onScroll(e){if(!_l(e))return;const t=this.drag,o=t?.lastDrag;o&&this.dragging&&t.params?.onDragging?.(o)}onMouseOrPointerMove(e){_l(e)&&(Ei()&&b(this.beans).getSelection()?.removeAllRanges(),this.shouldPreventMouseEvent(e)&&Ge(e),this.onMove(e))}onTouchCancel(e){const t=this.drag;t&&_l(e)&&Ie(t.start,e.changedTouches)&&this.cancelDrag()}onTouchMove(e){const t=this.drag;if(!t||!_l(e))return;const o=Ie(t.start,e.touches);o&&(this.onMove(o),this.draggingPreventDefault(e))}onMove(e){const t=this.drag;if(!t)return;t.lastDrag=e;const o=t.params;if(!this.dragging){const s=t.start;if(Te(e,s,o.dragStartPixels??4))return;if(this.dragging=!0,o.capturePointer&&(t.pointerCapture=((e,t)=>{if("undefined"==typeof PointerEvent||!(t instanceof PointerEvent))return null;const o=t.pointerId;if(!Ul(e,o))return null;const s={eElement:e,pointerId:o,onLost(e){((e,t)=>{$l(e);const{eElement:o,pointerId:s}=e;o&&t.pointerId===s&&Ul(o,s)})(s,e)}};return e.addEventListener("lostpointercapture",s.onLost),s})(this.beans.eRootDiv,e)),this.eventSvc.dispatchEvent({type:"dragStarted",target:o.eElement}),o.onDragStart?.(s),this.drag!==t)return;if(o.onDragging?.(s),this.drag!==t)return}o.onDragging?.(e)}onTouchUp(e){const t=this.drag;t&&_l(e)&&this.onUp(Ie(t.start,e.changedTouches))}onMouseOrPointerUp(e){_l(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===Cs&&this.cancelDrag()}},Yl=e=>{Le(e.handlers);const t=e.oldTouchAction;if(null!=t){const o=e.params.eElement.style;o&&(o.touchAction=t)}},Zl=class{constructor(e,t,o,s=null){this.rootEl=e,this.params=t,this.start=o,this.pointerId=s,this.handlers=[],this.lastDrag=null,this.pointerCapture=null,this.eElement=t.eElement}},Ql=e=>{const t=e.target;return t instanceof Element?t:null},Xl=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 null!==this.tickingInterval}check(e,t=!1){const o=!this.scrollVertically||t||this.shouldSkipVerticalScroll(),s=!this.scrollHorizontally||this.shouldSkipHorizontalScroll();if(o&&s)return;const i=this.scrollContainer.getBoundingClientRect(),n=this.scrollByTick;this.tickLeft=!s&&e.clientXi.right-n,this.tickUp=!o&&e.clientYi.bottom-n,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){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)}},Jl=class{constructor(){this.reordered=!1,this.removals=[],this.updates=/* @__PURE__ */new Set,this.adds=/* @__PURE__ */new Set}},ea=e=>{let t=e.childrenAfterGroup;for(;t?.length;){const e=t[0];if(e.sourceRowIndex>=0)return e;t=e.childrenAfterGroup}};function ta(e,t){return Wr(e,t.target)?.getFocusedCellPosition()??null}function oa(e,t){const o=kt(e.gos,"normal"),s=t;let i,n;null!=s.clientX||null!=s.clientY?(i=s.clientX,n=s.clientY):(i=s.x,n=s.y);const{pageFirstPixel:r}=e.pageBounds.getCurrentPagePixelRange();if(n+=r,o){const t=e.ctrlsSvc.getScrollFeature(),o=t.getVScrollPosition();i+=t.getHScrollPosition().left,n+=o.top}return{x:i,y:n}}var sa={moduleName:"Drag",version:mt,beans:[class extends ql{shouldPreventMouseEvent(e){return this.gos.get("enableCellTextSelection")&&super.shouldPreventMouseEvent(e)}}]},ia={moduleName:"SharedDragAndDrop",version:mt,beans:[class extends Bs{createEvent(e){return Co(this.gos,e)}createDragImageComp(e){const{gos:t,beans:o}=this;return(s=o.userCompFactory,i=Co(t,{dragSource:e}),s.getCompDetailsFromGridOptions(Vs,"agDragAndDropImage",i,!0))?.newAgStackInstance();var s,i}handleEnter(e,t){e?.onGridEnter?.(t)}handleExit(e,t){e?.onGridExit?.(t)}warnNoBody(){Dt(54)}isDropZoneWithinThisGrid(e){return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(e.dropZoneTarget)}registerGridDropTarget(e,t){const o={getContainer:e,isInterestedIn:e=>1===e||0===e,getIconName:()=>"notAllowed"};this.addDropTarget(o),t.addDestroyFunc(()=>this.removeDropTarget(o))}}],dependsOn:[sa],userComponents:{agDragAndDropImage:class extends Pi{constructor(){super(),this.dragSource=null,this.eIcon=null,this.eLabel=null,this.eGhost=null,this.registerCSS(".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)}")}postConstruct(){const e=e=>Hl(e,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(Wl),this.beans.environment.applyThemeClasses(this.eGhost)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t){const{eGhost:o,eIcon:s,dragSource:i,dropIconMap:n,gos:r}=this;se(s);let l=null;e||(e=i?.getDefaultIconName?i.getDefaultIconName():"notAllowed"),l=n[e],o.classList.toggle("ag-dnd-ghost-not-allowed","notAllowed"===e),s.classList.toggle("ag-shake-left-to-right",t),l===n.hide&&r.get("suppressDragLeaveHidesColumns")||l&&s.appendChild(l)}setLabel(e){this.eLabel.textContent=e}}},icons:{columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",rowDrag:"grip"}},na={moduleName:"HorizontalResize",version:mt,beans:[class extends Oe{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:o}=this.beans;return o.addDragSource(t),()=>o.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const o=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(o)}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)}}],dependsOn:[sa]},ra=class extends Oe{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 o of t)o.isPrimary()&&(o.isAnyFunctionActive()||(o.isAllowValue()?this.columnsToAggregate.push(o):o.isAllowRowGroup()?this.columnsToGroup.push(o):o.isAllowPivot()&&this.columnsToPivot.push(o)))}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:o,pivotColsSvc:s}=this.beans;this.columnsToAggregate.length>0&&t?.addColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&o?.addColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&s?.addColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function la(o){const{isFromHeader:s,fromLeft:i,xPosition:n,fromEnter:r,fakeEvent:l,pinned:a,gos:d,colModel:c,colMoves:h,visibleCols:u}=o;let{allMovingColumns:g}=o;s&&(g=function(e){const t=[...e];for(const o of e){let e=null,s=o.getParent();for(;null!=s&&1===s.getDisplayedLeafColumns().length;)e=s,s=s.getParent();if(null!=e){const o=e.getColGroupDef()?.marryChildren?e.getProvidedColumnGroup().getLeafColumns():e.getLeafColumns();for(const e of o)t.includes(e)||t.push(e)}}return t}(g));const p=g.slice();var m,f;m=c.getCols(),!(f=p)||f.length<=1||f.filter(e=>m.indexOf(e)<0).length>0||f.sort((e,t)=>m.indexOf(e)-m.indexOf(t));const C=function(e){const{movingCols:t,draggingRight:o,xPosition:s,pinned:i,gos:n,colModel:r,visibleCols:l}=e;if(n.get("suppressMovableColumns")||t.some(e=>e.getColDef().suppressMovable))return[];const a=function(e,t){switch(t){case"left":return e.leftCols;case"right":return e.rightCols;default:return e.centerCols}}(l,i),d=r.getCols(),c=a.filter(e=>t.includes(e)),h=a.filter(e=>!t.includes(e)),u=d.filter(e=>!t.includes(e));let g,p=0,m=s;if(o){let e=0;for(const t of c)e+=t.getActualWidth();m-=e}if(m>0){for(let e=0;e0){const e=h[p-1];g=u.indexOf(e)+1}else g=u.indexOf(h[0]),-1===g&&(g=0);const f=[g],C=(e,t)=>e-t;if(o){let e=g+1;const t=d.length-1;for(;e<=t;)f.push(e),e++;f.sort(C)}else{let e=g;const t=d.length-1;let o=d[e];for(;e<=t&&a.indexOf(o)<0;)e++,f.push(e),o=d[e];e=g-1;const s=0;for(;e>=s;)f.push(e),e--;f.sort(C).reverse()}return f}({movingCols:p,draggingRight:i,xPosition:n,pinned:a,gos:d,colModel:c,visibleCols:u}),v=function(t,o){const s=o.getCols(),i=t.map(e=>s.indexOf(e)).sort((e,t)=>e-t),n=i[0];return e(i)-n!==i.length-1?null:n}(p,c);if(0===C.length)return;const w=C[0];if(null!==v&&(s||!r)&&!l){if(!i&&w>=v)return;if(i&&w<=v)return}const b=function(e,o,s,i){const n=i.allCols;let r=null,l=null;for(let a=0;an.includes(e));if(null===l)l=c;else if(!t(c,l))break;const h=da(d);(null===r||hc.getCols().length-p.length?void 0:{columns:p,toIndex:y}}function aa(e){const{columns:t,toIndex:o}=la(e)||{},{finished:s,colMoves:i}=e;return t&&null!=o?(i.moveColumns(t,o,"uiColumnMoved",s),s?null:{columns:t,toIndex:o}):null}function da(e){function t(e){const t=[];let o=e.getOriginalParent();for(;null!=o;)t.push(o),o=o.getOriginalParent();return t}let o=0;for(let s=0;sn.length?[i,n]:[n,i];for(const e of i)-1===n.indexOf(e)&&o++}return o}function ca(e){const{pinned:t,fromKeyboard:o,gos:s,ctrlsSvc:i,useHeaderRow:n,skipScrollPadding:r}=e;let l=i.getHeaderRowContainerCtrl(t)?.eViewport,{x:a}=e;return l?(o&&(a-=l.getBoundingClientRect().left),s.get("enableRtl")&&(n&&(l=l.querySelector(".ag-header-row")),a=l.clientWidth-a),null!=t||r||(a+=i.get("center").getCenterViewportScrollLeft()),a):0}function ha(e,t){for(const o of e)o.moving=t,o.dispatchColEvent("movingChanged","uiColumnMoved")}var ua=class extends Oe{constructor(e){super(),this.pinned=e,this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.isCenterContainer=!l(e)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){const{pinned:e,lastDraggingEvent:t}=this,{dragItem:o}=t||{},s=o?.columns??[];for(const i of s){const t=i.getPinned();if(i.getColDef().lockPinned){if(t==e)return"move";continue}const s=o?.containerType;if(s===e||!e)return"move";if(e&&(!t||s!==e))return"pinned"}return"notAllowed"}onDragEnter(e){const t=e.dragItem,o=t.columns;if(0===e.dragSource.type)this.setColumnsVisible(o,!0,"uiColumnDragged");else{const e=t.visibleState,s=(o||[]).filter(t=>e[t.getId()]&&!t.isVisible());this.setColumnsVisible(s,!0,"uiColumnDragged")}this.gos.get("suppressMoveWhenColumnDragging")||this.attemptToPinColumns(o,this.pinned),this.onDragging(e,!0,!0)}onDragging(e=this.lastDraggingEvent,t=!1,o=!1,s=!1){const{gos:i,ctrlsSvc:n}=this.beans,r=i.get("suppressMoveWhenColumnDragging");if(s&&!r)return void this.finishColumnMoving();if(this.lastDraggingEvent=e,!e||!s&&a(e.hDirection))return;const l=ca({x:e.x,pinned:this.pinned,gos:i,ctrlsSvc:n});t||this.checkCenterForScrolling(l),r?this.handleColumnDragWhileSuppressingMovement(e,t,o,l,s):this.handleColumnDragWhileAllowingMovement(e,t,o,l,s)}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,o){if(!e?.length)return;const s=e.filter(e=>!e.getColDef().lockVisible);s.length&&this.beans.colModel.setColsVisible(s,t,o)}finishColumnMoving(){this.clearHighlighted();const e=this.lastMovedInfo;if(!e)return;const{columns:t,toIndex:o}=e;this.beans.colMoves.moveColumns(t,o,"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,o,s,i){const n=this.getAllMovingColumns(e,!0);if(i){const e=this.isAttemptingToPin(n);e&&this.attemptToPinColumns(n,void 0,!0);const{fromLeft:s,xPosition:i}=this.getNormalisedXPositionInfo(n,e)||{};if(null==s||null==i)return void this.finishColumnMoving();this.moveColumnsAfterHighlight({allMovingColumns:n,xPosition:i,fromEnter:t,fakeEvent:o,fromLeft:s})}else{if(!this.beans.dragAndDrop.isDropZoneWithinThisGrid(e))return;this.highlightHoveredColumn(n,s)}}handleColumnDragWhileAllowingMovement(e,t,o,s,i){const n=this.getAllMovingColumns(e),r="right"===this.normaliseDirection(e.hDirection),l=1===e.dragSource.type,a=aa({...this.getMoveColumnParams({allMovingColumns:n,isFromHeader:l,xPosition:s,fromLeft:r,fromEnter:t,fakeEvent:o}),finished:i});a&&(this.lastMovedInfo=a)}getAllMovingColumns(e,t=!1){const o=e.dragSource.getDragItem();let s=null;return t?(s=o.columnsInSplit,s||(s=o.columns)):s=o.columns,s?s.filter(e=>!e.getColDef().lockPinned||e.getPinned()==this.pinned):[]}getMoveColumnParams(e){const{allMovingColumns:t,isFromHeader:o,xPosition:s,fromLeft:i,fromEnter:n,fakeEvent:r}=e,{gos:l,colModel:a,colMoves:d,visibleCols:c}=this.beans;return{allMovingColumns:t,isFromHeader:o,fromLeft:i,xPosition:s,pinned:this.pinned,fromEnter:n,fakeEvent:r,gos:l,colModel:a,colMoves:d,visibleCols:c}}highlightHoveredColumn(t,o){const{gos:s,colModel:i}=this.beans,n=s.get("enableRtl"),r=i.getCols().filter(e=>e.isVisible()&&e.getPinned()===this.pinned);let l,a=null,d=null,c=null;for(const e of r){if(d=e.getActualWidth(),a=this.getNormalisedColumnLeft(e,0,n),null!=a&&a<=o&&a+d>=o){c=e;break}a=null,d=null}if(c)-1!==t.indexOf(c)&&(c=null);else{for(let t=r.length-1;t>=0;t--){const o=r[t],s=r[t].getParent();if(!s){c=o;break}const i=s?.getDisplayedLeafColumns();if(i.length){c=e(i);break}}if(!c)return;a=this.getNormalisedColumnLeft(c,0,n),d=c.getActualWidth()}if(null!=c&&null!=a&&null!=d){if(o-a7;return t&&o||e.some(e=>e.getPinned()!==this.pinned)}moveColumnsAfterHighlight(e){const{allMovingColumns:t,xPosition:o,fromEnter:s,fakeEvent:i,fromLeft:n}=e,{columns:r,toIndex:l}=la(this.getMoveColumnParams({allMovingColumns:t,isFromHeader:!0,xPosition:o,fromLeft:n,fromEnter:s,fakeEvent:i}))||{};r&&null!=l&&(this.lastMovedInfo={columns:r,toIndex:l}),this.finishColumnMoving()}clearHighlighted(){const{lastHighlightedColumn:e}=this;e&&(ga(e.column,null),this.lastHighlightedColumn=null)}checkCenterForScrolling(e){if(!this.isCenterContainer)return;const t=this.beans.ctrlsSvc.get("center"),o=t.getCenterViewportScrollLeft(),s=o+t.getCenterWidth();let i,n;this.gos.get("enableRtl")?(i=es-50):(n=es-50),this.needToMoveRight=i,this.needToMoveLeft=n,n||i?this.ensureIntervalStarted():this.ensureIntervalCleared()}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),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+5*this.intervalCount,e>100&&(e=100);let t=null;const o=this.gridBodyCon.scrollFeature;if(this.needToMoveLeft?t=o.scrollHorizontally(-e):this.needToMoveRight&&(t=o.scrollHorizontally(e)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const{pinnedCols:e,dragAndDrop:t,gos:o}=this.beans;if(this.failedMoveAttempts<=8||!e)return;if(t.setDragImageCompIcon("pinned"),!o.get("suppressMoveWhenColumnDragging")){const e=this.lastDraggingEvent?.dragItem.columns;this.attemptToPinColumns(e,void 0,!0)}}}getPinDirection(){return this.needToMoveLeft||"left"===this.pinned?"left":this.needToMoveRight||"right"===this.pinned?"right":void 0}attemptToPinColumns(e,t,o=!1){const s=(e||[]).filter(e=>!e.getColDef().lockPinned);if(!s.length)return 0;o&&(t=this.getPinDirection());const{pinnedCols:i,dragAndDrop:n}=this.beans;return i?.setColsPinned(s,t,"uiColumnDragged"),o&&n.nudge(),s.length}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}};function ga(e,t){e.highlighted!==t&&(e.highlighted=t,e.dispatchColEvent("headerHighlightChanged","uiColumnMoved"))}var pa=class extends Oe{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){const{ctrlsSvc:e,dragAndDrop:t}=this.beans,o=this.pinned;e.whenReady(this,e=>{let t;const s=e.gridBodyCtrl.eBodyViewport;switch(o){case"left":t=[[s,e.left.eContainer],[e.bottomLeft.eContainer],[e.topLeft.eContainer]];break;case"right":t=[[s,e.right.eContainer],[e.bottomRight.eContainer],[e.topRight.eContainer]];break;default:t=[[s,e.center.eViewport],[e.bottomCenter.eViewport],[e.topCenter.eViewport]]}this.eSecondaryContainers=t}),this.moveColumnFeature=this.createManagedBean(new ua(o)),this.bodyDropPivotTarget=this.createManagedBean(new ra(o)),t.addDropTarget(this),this.addDestroyFunc(()=>t.removeDropTarget(this))}isInterestedIn(e){return 1===e||0===e&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.beans.colModel.isPivotMode()&&0===e.dragSource.type}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 ma(e,t){const o=[],s=[],i=[];return e.forEach(e=>{const t=e.getColDef().lockPosition;"right"===t?i.push(e):"left"===t||!0===t?o.push(e):s.push(e)}),t.get("enableRtl")?[...i,...s,...o]:[...o,...s,...i]}function fa(e,t){let o=!0;return Yo(null,t,t=>{if(!Lo(t))return;const s=t;if(!s.getColGroupDef()?.marryChildren)return;const i=[];for(const o of s.getLeafColumns()){const t=e.indexOf(o);i.push(t)}Math.max.apply(Math,i)-Math.min.apply(Math,i)>s.getLeafColumns().length-1&&(o=!1)}),o}var Ca={moduleName:"ColumnMove",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="colMoves"}moveColumnByIndex(e,t,o){const s=this.beans.colModel.getCols();if(!s)return;const i=s[e];this.moveColumns([i],t,o)}moveColumns(e,t,o,s=!0){const{colModel:i,colAnimation:r,visibleCols:l,eventSvc:a}=this.beans,d=i.getCols();if(!d)return;if(t>d.length-e.length)return void Dt(30,{toIndex:t});r?.start();const c=i.getColsForKeys(e);this.doesMovePassRules(c,t)&&(n(i.getCols(),c,t),l.refresh(o),a.dispatchEvent({type:"columnMoved",columns:c,column:1===c.length?c[0]:null,toIndex:t,finished:s,source:o})),r?.finish()}doesMovePassRules(e,t){const o=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(o)}doesOrderPassRules(e){const{colModel:t,gos:o}=this.beans;return!!fa(e,t.getColTree())&&!!(e=>{const t=e=>e?"left"===e||!0===e?-1:1:0,s=o.get("enableRtl");let i=s?1:-1,n=!0;for(const o of e){const e=t(o.getColDef().lockPosition);s?e>i&&(n=!1):ea?"hide":"notAllowed",getDragItem:d?()=>function(e,t){const o=e.getProvidedColumnGroup().getLeafColumns(),i={};for(const s of o)i[s.getId()]=s.isVisible();const n=[];for(const a of t)o.indexOf(a)>=0&&(n.push(a),s(o,a));for(const s of o)n.push(s);const r=[],l=e.getLeafColumns();for(const s of n)-1!==l.indexOf(s)&&r.push(s);return{columns:n,columnsInSplit:r,visibleState:i,containerType:r[0]?.pinned}}(t,l.allCols):()=>function(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t,containerType:e.pinned}}(t),dragItemName:o,onDragStarted:()=>{a=!i.get("suppressDragLeaveHidesColumns"),ha(c,!0)},onDragStopped:()=>ha(c,!1),onDragCancelled:()=>ha(c,!1),onGridEnter:e=>{if(a){const{columns:t=[],visibleState:o}=e??{},s=d?e=>!o||o[e.getColId()]:()=>!0,i=t.filter(e=>!e.getColDef().lockVisible&&s(e));n.setColsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{if(a){const t=e?.columns?.filter(e=>!e.getColDef().lockVisible)||[];n.setColsVisible(t,!1,"uiColumnMoved")}}};return r.addDragSource(h,!0),h}},class extends Oe{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:o,executeLaterFuncs:s}=this;if(0===o.length&&0===s.length)return e(),void t();const i=e=>{for(;e.length;){const t=e.pop();t&&t()}};this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e(),i(o)},0),window.setTimeout(()=>{t(),i(s)},200)})}}],apiFunctions:{moveColumnByIndex:function(e,t,o){e.colMoves?.moveColumnByIndex(t,o,"api")},moveColumns:function(e,t,o){e.colMoves?.moveColumns(t,o,"api")}},dependsOn:[ia],css:[":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}}"]},va={moduleName:"AutoWidth",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="autoWidthCalc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const o=this.getHeaderCellForColumn(e);if(!o)return-1;const s=this.beans.rowRenderer.getAllCellsNotSpanningForColumn(e);return t||s.push(o),this.getPreferredWidthForElements(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.getPreferredWidthForElements([t]):-1}getPreferredWidthForElements(e,t){const o=document.createElement("form");o.style.position="fixed";const s=this.centerRowContainerCtrl.eContainer;for(const n of e)this.cloneItemIntoDummy(n,o);s.appendChild(o);const i=Math.ceil(o.getBoundingClientRect().width);return o.remove(),i+(t??this.gos.get("autoSizePadding"))}getHeaderCellForColumn(e){let t=null;for(const o of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()){const s=o.getHtmlElementForColumnHeader(e);null!=s&&(t=s)}return t}cloneItemIntoDummy(e,t){const o=e.cloneNode(!0);o.style.width="",o.style.position="static",o.style.left="";const s=document.createElement("div"),i=s.classList;["ag-header-cell","ag-header-group-cell"].some(e=>o.classList.contains(e))?(i.add("ag-header","ag-header-row"),s.style.position="static"):i.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(e=>n.classList.contains(e))){for(let e=0;ee.getPinned());e.dispatchEvent({type:"columnPinned",pinned:null!=i?i:null,columns:t,column:s,source:o})}function ya(e,t,o,s){e.dispatchEvent({type:t,columns:o,column:o&&1==o.length?o[0]:null,source:s})}function Sa(e,t,o,s,i=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:1===t.length?t[0]:null,flexColumns:i,finished:o,source:s})}var Ra=class extends Oe{constructor(e,t,o,s){super(),this.comp=e,this.eResize=t,this.pinned=o,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable())return void this.comp.setResizableDisplayed(!1);const{horizontalResizeSvc:e,gos:t,colAutosize:o}=this.beans,s=e.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});this.addDestroyFunc(s),!t.get("suppressAutoSize")&&o&&this.addDestroyFunc(o.addColumnGroupResize(this.eResize,this.columnGroup,()=>this.resizeLeafColumnsToFit("uiColumnResized")))}onResizeStart(e){const{columnsToResize:t,resizeStartWidth:o,resizeRatios:s,groupAfterColumns:i,groupAfterStartWidth:n,groupAfterRatios:r}=this.getInitialValues(e);this.resizeCols=t,this.resizeStartWidth=o,this.resizeRatios=s,this.resizeTakeFromCols=i,this.resizeTakeFromStartWidth=n,this.resizeTakeFromRatios=r,this.toggleColumnResizing(!0)}onResizing(e,t,o="uiColumnResized"){const s=this.normaliseDragChange(t),i=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(i,o,e)}getInitialValues(e){const t=e=>e.reduce((e,t)=>e+t.getActualWidth(),0),o=(e,t)=>e.map(e=>e.getActualWidth()/t),s=this.getColumnsToResize(),i=t(s),n={columnsToResize:s,resizeStartWidth:i,resizeRatios:o(s,i)};let r=null;if(e&&(r=this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup,"After")??null),r){const e=n.groupAfterColumns=r.getDisplayedLeafColumns().filter(e=>e.isResizable());n.groupAfterRatios=o(e,n.groupAfterStartWidth=t(e))}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),o=this.getInitialValues();t>o.resizeStartWidth&&this.resizeColumns(o,t,e,!0)}resizeColumnsFromLocalValues(e,t,o=!0){if(!this.resizeCols||!this.resizeRatios)return;const s={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols,groupAfterStartWidth:this.resizeTakeFromStartWidth,groupAfterRatios:this.resizeTakeFromRatios};this.resizeColumns(s,e,t,o)}resizeColumns(e,t,o,s=!0){const{columnsToResize:i,resizeStartWidth:n,resizeRatios:r,groupAfterColumns:l,groupAfterStartWidth:a,groupAfterRatios:d}=e,c=[];if(c.push({columns:i,ratios:r,width:t}),l){const e=t-n;c.push({columns:l,ratios:d,width:a-e})}this.beans.colResize?.resizeColumnSets({resizeSets:c,finished:s,source:o}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.toggleCss("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(e=>e.isResizable())}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?"left"!==this.pinned&&(t*=-1):"right"===this.pinned&&(t*=-1),t}destroy(){super.destroy(),this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}},xa=class extends Oe{constructor(e,t,o,s,i){super(),this.pinned=e,this.column=t,this.eResize=o,this.comp=s,this.ctrl=i}postConstruct(){const e=[];let t,o;const s=()=>{if(K(this.eResize,t),!t)return;const{horizontalResizeSvc:s,colAutosize:i}=this.beans,n=s.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});e.push(n),o&&i&&e.push(i.addColumnAutosizeListeners(this.eResize,this.column))},i=()=>{for(const t of e)t();e.length=0},n=()=>{const e=this.column.isResizable(),n=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;e===t&&n===o||(t=e,o=n,i(),s())};n(),this.addDestroyFunc(i),this.ctrl.setRefreshFunction("resize",n)}onResizing(e,t){const{column:o,lastResizeAmount:s,resizeStartWidth:i,beans:n}=this,r=this.normaliseResizeAmount(t),l=[{key:o,newWidth:i+r}],{pinnedCols:a,ctrlsSvc:d,colResize:c}=n;this.column.getPinned()&&(a?.leftWidth??0)+(a?.rightWidth??0)+(r-s)>Q(d.getGridBodyCtrl().eBodyViewport)-50||(this.lastResizeAmount=r,c?.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 o="left"!==this.pinned,s="right"===this.pinned;return this.gos.get("enableRtl")?o&&(t*=-1):s&&(t*=-1),t}},Fa={moduleName:"ColumnResize",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="colResize"}setColumnWidths(e,t,o,s){const i=[],{colModel:n,gos:r,visibleCols:l}=this.beans;for(const a of e){const e=n.getColDefCol(a.key)||n.getCol(a.key);if(e&&(i.push({width:a.newWidth,ratios:[1],columns:[e]}),"shift"===r.get("colResizeDefault")&&(t=!t),t)){const t=l.getColAfter(e);if(!t)continue;const o=e.getActualWidth()-a.newWidth,s=t.getActualWidth()+o;i.push({width:s,ratios:[1],columns:[t]})}}0!==i.length&&this.resizeColumnSets({resizeSets:i,finished:o,source:s})}resizeColumnSets(e){const{resizeSets:t,finished:o,source:s}=e;if(t&&!t.every(e=>function(e){const{columns:t,width:o}=e;let s=0,i=0,n=!0;for(const r of t){s+=r.getMinWidth()||0;const e=r.getMaxWidth();e>0?i+=e:n=!1}return o>=s&&(!n||o<=i)}(e))){if(o){const e=t&&t.length>0?t[0].columns:null;Sa(this.eventSvc,e,o,s)}return}const i=[],n=[];for(const d of t){const{width:e,columns:t,ratios:o}=d,r={},l={};for(const s of t)n.push(s);let a=!0,c=0;for(;a;){if(c++,c>1e3){Mt(31);break}a=!1;const s=[];let i=0,n=e;t.forEach((e,t)=>{if(l[e.getId()])n-=r[e.getId()];else{s.push(e);const n=o[t];i+=n}});const d=1/i;s.forEach((t,i)=>{let c;i===s.length-1?c=n:(c=Math.round(o[i]*e*d),n-=c);const h=t.getMinWidth(),u=t.getMaxWidth();c0&&c>u&&(c=u,l[t.getId()]=!0,a=!0),r[t.getId()]=c})}for(const n of t){const e=r[n.getId()];n.getActualWidth()!==e&&(n.setActualWidth(e,s),i.push(n))}}const r=i.length>0;let l=[];if(r){const{colFlex:e,visibleCols:t,colViewport:o}=this.beans;l=e?.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0})??[],t.setLeftValues(s),t.updateBodyWidths(),o.checkViewportColumns()}const a=n.concat(l);(r||o)&&Sa(this.eventSvc,a,o,s,l)}resizeHeader(e,t,o){if(!e.isResizable())return;const s=e.getActualWidth(),i=e.getMinWidth(),n=e.getMaxWidth(),r=Math.min(Math.max(s+t,i),n);this.setColumnWidths([{key:e,newWidth:r}],o,!0,"uiColumnResized")}createResizeFeature(e,t,o,s,i){return new xa(e,t,o,s,i)}createGroupResizeFeature(e,t,o,s){return new Ra(e,t,o,s)}}],apiFunctions:{setColumnWidths:function(e,t,o=!0,s="api"){e.colResize?.setColumnWidths(t,!1,o,s)}},dependsOn:[na,va]},Da=class extends Oe{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",0===e)}},Ma=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let o;return o="number"!=typeof t?0:t+1,this.existingIds[e]=o,o}};function Pa(e,t){for(let o=0;o=0&&(e[s]=e[e.length-1],e.pop())}}function Ea(e,t,o){if(e)for(let s=0;s{So(e)&&t.push(e)}),t}var Ia={moduleName:"ColumnGroup",version:mt,dynamicBeans:{headerGroupCellCtrl:class extends cr{constructor(){super(...arguments),this.onSuppressColMoveChange=()=>{!this.isAlive()||this.isSuppressMoving()?this.removeDragSource():this.dragSource||this.setDragSource(this.eGui)}}wireComp(e,t,o,s,i){const{column:n,beans:r}=this,{context:l,colNames:a,colHover:d,rangeSvc:c,colResize:h}=r;this.comp=e,i=or(this,l,i),this.setGui(t,i),this.displayName=a.getDisplayNameForColumnGroup(n,"header"),this.refreshHeaderStyles(),this.addClasses(),this.setupMovingCss(i),this.setupExpandable(i),this.setupTooltip(),this.refreshAnnouncement(),this.setupAutoHeight({wrapperElement:s,compBean:i}),this.setupUserComp(),this.addHeaderMouseListeners(i,s),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();const u=this.rowCtrl.pinned,g=n.getProvidedColumnGroup().getLeafColumns();d?.createHoverFeature(i,g,t),c?.createRangeHighlightFeature(i,n,e),i.createManagedBean(new sr(n,t,r)),i.createManagedBean(new Da(e,n)),h?this.resizeFeature=i.createManagedBean(h.createGroupResizeFeature(e,o,u,n)):e.setResizableDisplayed(!1),i.createManagedBean(new Qi(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(i,g),this.addManagedEventListeners({cellSelectionChanged:()=>this.refreshAnnouncement()}),i.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(i),i.addDestroyFunc(()=>this.clearComponent())}getHeaderClassParams(){const{column:e,beans:t}=this,o=e.getDefinition();return Co(t.gos,{colDef:o,columnGroup:e,floatingFilter:!1})}refreshMaxHeaderHeight(){const{gos:e,comp:t}=this,o=e.get("groupHeaderHeight");null!=o?0===o?t.setHeaderWrapperHidden(!0):t.setHeaderWrapperMaxHeight(o):(t.setHeaderWrapperHidden(!1),t.setHeaderWrapperMaxHeight(null))}addHighlightListeners(e,t){if(this.beans.gos.get("suppressMoveWhenColumnDragging"))for(const o of t)e.addManagedListeners(o,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,o)})}onLeafColumnHighlightChanged(t){const o=this.column.getDisplayedLeafColumns(),s=o[0]===t,i=e(o)===t;if(!s&&!i)return;const n=t.getHighlighted();let r=!1,l=!1;if(this.rowCtrl.getHeaderCellCtrls().find(e=>e.column.isMoving())){const e=this.beans.gos.get("enableRtl"),t=1===n,o=0===n;s&&(e?l=t:r=o),i&&(e?r=o:l=t)}this.comp.toggleCss("ag-header-highlight-before",r),this.comp.toggleCss("ag-header-highlight-after",l)}resizeHeader(e,t){const{resizeFeature:o}=this;if(!o)return;const s=o.getInitialValues(t);o.resizeColumns(s,s.resizeStartWidth+e,"uiColumnResized",!0)}resizeLeafColumnsToFit(e){this.resizeFeature?.resizeLeafColumnsToFit(e)}setupUserComp(){const{colGroupSvc:e,userCompFactory:t,gos:o,enterpriseMenuFactory:s}=this.beans,i=this.column,n=i.getProvidedColumnGroup(),r=function(e,t){const o=t.columnGroup.getColGroupDef();return e.getCompDetails(o,$s,"agColumnGroupHeader",t)}(t,Co(o,{displayName:this.displayName,columnGroup:i,setExpanded:t=>{e.setColumnGroupOpened(n,t,"gridInitializing")},setTooltip:(e,t)=>{o.assertModuleRegistered("Tooltip",3),this.setupTooltip(e,t)},showColumnMenu:(e,t)=>s?.showMenuAfterButtonClick(n,e,"columnMenu",t),showColumnMenuAfterMouseClick:(e,t)=>s?.showMenuAfterMouseEvent(n,e,"columnMenu",t),eGridHeader:this.eGui}));r&&this.comp.setUserCompDetails(r)}addHeaderMouseListeners(e,t){const{column:o,comp:s,beans:{rangeSvc:i},gos:n}=this,r=e=>this.handleMouseOverChange("mouseenter"===e.type);e.addManagedListeners(this.eGui,{mouseenter:r,mouseleave:r,click:()=>this.dispatchColumnMouseEvent("columnHeaderClicked",o.getProvidedColumnGroup()),contextmenu:e=>this.handleContextMenuMouseEvent(e,void 0,o.getProvidedColumnGroup())}),s.toggleCss("ag-header-group-cell-selectable",no(n));const l=i?.createHeaderGroupCellMouseListenerFeature(this.column,t);l&&this.createManagedBean(l)}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 o=this.refreshExpanded.bind(this);e.addManagedListeners(t,{expandedChanged:o,expandableChanged:o})}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(),o=ir(t,this.gos,null,e);e.isPadding()?(o.push("ag-header-group-cell-no-group"),e.getLeafColumns().every(e=>e.isSpanHeaderHeight())&&o.push("ag-header-span-height")):(o.push("ag-header-group-cell-with-group"),t?.wrapHeaderText&&o.push("ag-header-cell-wrap-text"));for(const s of o)this.comp.toggleCss(s,!0)}setupMovingCss(e){const{column:t}=this,o=t.getProvidedColumnGroup().getLeafColumns(),s=()=>this.comp.toggleCss("ag-header-cell-moving",t.isMoving());for(const i of o)e.addManagedListeners(i,{movingChanged:s});s()}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription())}handleKeyDown(e){if(super.handleKeyDown(e),!this.getWrapperHasFocus())return;const{column:t,expandable:o,gos:s,beans:i}=this,n=no(s);if(e.key==fs)if(n&&!e.altKey)i.rangeSvc?.handleColumnSelection(t,e);else if(o){const e=!t.isExpanded();i.colGroupSvc.setColumnGroupOpened(t.getProvidedColumnGroup(),e,"uiColumnExpanded")}}refreshAnnouncement(){let e;const{gos:t}=this;no(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:o}=this;o&&t.contains(w(e))&&e.ariaAnnounce?.announceValue(o,"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()}}},beans:[class extends Oe{constructor(){super(...arguments),this.beanName="colGroupSvc"}getColumnGroupState(){const e=[];return Yo(null,this.beans.colModel.getColTree(),t=>{Lo(t)&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})}),e}resetColumnGroupState(e){const t=this.beans.colModel.getColDefColTree();if(!t)return;const o=[];Yo(null,t,e=>{if(Lo(e)){const t=e.getColGroupDef(),s={groupId:e.getGroupId(),open:t?t.openByDefault:void 0};o.push(s)}}),this.setColumnGroupState(o,e)}setColumnGroupState(e,t){const{colModel:o,colAnimation:s,visibleCols:i,eventSvc:n}=this.beans;if(!o.getColTree().length)return;s?.start();const r=[];for(const l of e){const e=l.groupId,t=l.open,o=this.getProvidedColGroup(e);o&&o.isExpanded()!==t&&(o.setExpanded(t),r.push(o))}i.refresh(t,!0),r.length&&n.dispatchEvent({type:"columnGroupOpened",columnGroup:1===r.length?r[0]:void 0,columnGroups:r}),s?.finish()}setColumnGroupOpened(e,t,o){let s;s=Lo(e)?e.getId():e||"",this.setColumnGroupState([{groupId:s,open:t}],o)}getProvidedColGroup(e){let t=null;return Yo(null,this.beans.colModel.getColTree(),o=>{Lo(o)&&o.getId()===e&&(t=o)}),t}getGroupAtDirection(t,o){const s=t.getProvidedColumnGroup().getLevel()+t.getPaddingLevel(),i=t.getDisplayedLeafColumns(),n="After"===o?e(i):i[0],r=`getCol${o}`;for(;;){const e=this.beans.visibleCols[r](n);if(!e)return null;const o=this.getColGroupAtLevel(e,s);if(o!==t)return o}}getColGroupAtLevel(e,t){let o,s,i=e.getParent();for(;o=i.getProvidedColumnGroup().getLevel(),s=i.getPaddingLevel(),!(o+s<=t);)i=i.getParent();return i}updateOpenClosedVisibility(){Ea(this.beans.visibleCols.getAllTrees(),!1,e=>{us(e)&&e.calculateDisplayedColumns()})}getColumnGroup(e,t){if(!e)return null;if(us(e))return e;const o=this.beans.visibleCols.getAllTrees(),s="number"==typeof t;let i=null;return Ea(o,!1,o=>{if(us(o)){const n=o;let r;r=s?e===n.getGroupId()&&t===n.getPartId():e===n.getGroupId(),r&&(i=n)}}),i}createColumnGroups(e){const{columns:t,idCreator:o,pinned:s,oldDisplayedGroups:i,isStandaloneStructure:n}=e,r=this.mapOldGroupsById(i),l=[];let a=t;for(;a.length;){const e=a;a=[];let t=0;const i=i=>{const d=t;t=i;const c=e[d],h=(us(c)?c.getProvidedColumnGroup():c).getOriginalParent();if(null==h){for(let t=d;tLo(e))){l.setChildren([r]);continue}l.setChildren(e);break}i.push(r)}}return i}findDepth(e){let t=0,o=e;for(;o?.[0]&&Lo(o[0]);)t++,o=o[0].getChildren();return t}findMaxDepth(e,t){let o=t;for(let s=0;s=0;o--){const t=new Go(null,`FAKE_PATH_${s.getId()}_${o}`,!0,o);this.createBean(t),t.setChildren([e]),e.originalParent=t,e=t}0===t&&(s.originalParent=null),o.push(e)}return o}findExistingGroup(e,t){if(null!=e.groupId)for(let o=0;o{for(const s of e)if(us(s)){const e=s;t[s.getUniqueId()]=e,o(e.getChildren())}};return e&&o(e),t}setupParentsIntoCols(e,t){for(const o of e??[])if(o.parent!==t&&(this.beans.colViewport.colsWithinViewportHash=""),o.parent=t,us(o)){const e=o;this.setupParentsIntoCols(e.getChildren(),e)}}}],apiFunctions:{getAllDisplayedColumnGroups:function(e){return e.visibleCols.getAllTrees()},getCenterDisplayedColumnGroups:function(e){return e.visibleCols.treeCenter},getColumnGroup:function(e,t,o){return e.colGroupSvc?.getColumnGroup(t,o)??null},getColumnGroupState:function(e){return e.colGroupSvc?.getColumnGroupState()??[]},getDisplayNameForColumnGroup:function(e,t,o){return e.colNames.getDisplayNameForColumnGroup(t,o)||""},getLeftDisplayedColumnGroups:function(e){return e.visibleCols.treeLeft},getProvidedColumnGroup:function(e,t){return e.colGroupSvc?.getProvidedColGroup(t)??null},getRightDisplayedColumnGroups:function(e){return e.visibleCols.treeRight},resetColumnGroupState:function(e){e.colGroupSvc?.resetColumnGroupState("api")},setColumnGroupOpened:function(e,t,o){e.colGroupSvc?.setColumnGroupOpened(t,o,"api")},setColumnGroupState:function(e,t){e.colGroupSvc?.setColumnGroupState(t,"api")}}};function Aa(e,t,o){const{colModel:i,rowGroupColsSvc:n,pivotColsSvc:r,autoColSvc:a,selectionColSvc:d,colAnimation:c,visibleCols:h,pivotResultCols:u,environment:g,valueColsSvc:p,eventSvc:m,gos:f}=e,C=i.getColDefCols()??[],v=d?.getColumns();if(!C.length&&!v?.length)return!1;if(t?.state&&!t.state.forEach)return Dt(32),!1;const w=(s,i,a,d,c)=>{if(!s)return;const h=((e,t)=>(o,s)=>{const i={value1:void 0,value2:void 0};let n=!1;return e&&(void 0!==e[o]&&(i.value1=e[o],n=!0),l(s)&&void 0!==e[s]&&(i.value2=e[s],n=!0)),!n&&t&&(void 0!==t[o]&&(i.value1=t[o]),l(s)&&void 0!==t[s]&&(i.value2=t[s])),i})(i,t.defaultState),u=h("flex").value1,m=h("sort").value1,f=h("sortType").value1,C=Mo(m)||Po(f),v=Ao(f),w=Io(m),b=C?{type:v,direction:w}:void 0;if(jo(e,s,h("hide").value1,b,h("sortIndex").value1,h("pinned").value1,u,o),null==u){const e=h("width").value1;if(null!=e){const t=s.getColDef().minWidth??g.getDefaultColumnMinWidth();null!=t&&e>=t&&s.setActualWidth(e,o)}}!c&&s.isPrimary()&&(p?.syncColumnWithState(s,o,h),n?.syncColumnWithState(s,o,h,a),r?.syncColumnWithState(s,o,h,d))},b=(l,c,u)=>{const g=ka(e,o),p=c.slice(),C={},v={},b=[],y=[],S=[];let R=0;const x=n?.columns.slice()??[],F=r?.columns.slice()??[];for(const e of l){const t=e.colId;if(t.startsWith("ag-Grid-AutoColumn")){b.push(e),S.push(e);continue}if(ts(t)){y.push(e),S.push(e);continue}const o=u(t);o?(w(o,e,C,v,!1),s(p,o)):(S.push(e),R+=1)}const D=e=>w(e,null,C,v,!1);p.forEach(D),n?.sortColumns(Na.bind(n,C,x)),r?.sortColumns(Na.bind(r,v,F)),i.refreshCols(!1,o);const M=(e,t,o=[])=>{for(const i of t){const t=e(i.colId);s(o,t),w(t,i,null,null,!0)}o.forEach(D)};return M(e=>a?.getColumn(e)??null,b,a?.getColumns()?.slice()),M(e=>d?.getColumn(e)??null,y,d?.getColumns()?.slice()),function(e,t,o){if(!e.applyOrder||!e.state)return;const s=[];for(const i of e.state)null!=i.colId&&s.push(i.colId);!function(e,t,o,s){if(null==e)return;let i=[];const n={};for(const l of t){if(n[l])continue;const t=e.map[l];t&&(i.push(t),n[l]=!0)}let r=0;for(const l of e.list){const e=l.getColId();null==n[e]&&(e.startsWith("ag-Grid-AutoColumn")?i.splice(r++,0,l):i.push(l))}i=ma(i,s),fa(i,o.getColTree())?e.list=i:Dt(39)}(t.cols,s,t,o)}(t,i,f),h.refresh(o),m.dispatchEvent({type:"columnEverythingChanged",source:o}),g(),{unmatchedAndAutoStates:S,unmatchedCount:R}};c?.start();let{unmatchedAndAutoStates:y,unmatchedCount:S}=b(t.state||[],C,e=>i.getColDefCol(e));return(y.length>0||l(t.defaultState))&&(S=b(y,u?.getPivotResultCols()?.list??[],e=>u?.getPivotResultCol(e)??null).unmatchedCount),c?.finish(),0===S}function ka(e,o){const{rowGroupColsSvc:s,pivotColsSvc:i,valueColsSvc:n,colModel:r,sortSvc:l,eventSvc:a}=e,d={rowGroupColumns:s?.columns.slice()??[],pivotColumns:i?.columns.slice()??[],valueColumns:n?.columns.slice()??[]},c=La(e),h={};for(const t of c)h[t.colId]=t;return()=>{const n=(e,s,i,n)=>{if(t(s.map(n),i.map(n)))return;const r=new Set(s);for(const t of i)r.delete(t)||r.add(t);const l=[...r];a.dispatchEvent({type:e,columns:l,column:1===l.length?l[0]:null,source:o})},u=e=>{const t=[];return r.forAllCols(o=>{const s=h[o.getColId()];s&&e(s,o)&&t.push(o)}),t},g=e=>e.getColId();n("columnRowGroupChanged",d.rowGroupColumns,s?.columns??[],g),n("columnPivotChanged",d.pivotColumns,i?.columns??[],g);const p=u((e,t)=>{const o=null!=e.aggFunc,s=o!=t.isValueActive(),i=o&&e.aggFunc!=t.getAggFunc();return s||i});p.length>0&&ya(a,"columnValueChanged",p,o),Sa(a,u((e,t)=>e.width!=t.getActualWidth()),!0,o),ba(a,u((e,t)=>e.pinned!=t.getPinned()),o),function(e,t,o){if(!t.length)return;const s=1===t.length?t[0]:null,i=wa(t,e=>e.isVisible());e.dispatchEvent({type:"columnVisible",visible:i,columns:t,column:s,source:o})}(a,u((e,t)=>e.hide==t.isVisible()),o);const m=u((e,t)=>!To(t.getSortDef(),{type:Ao(e.sortType),direction:Io(e.sort)})||e.sortIndex!=t.getSortIndex());m.length>0&&l?.dispatchSortChangedEvents(o,m),function(e,t,o,s,i){const n={};for(const c of t)n[c.colId]=c;const r={};for(const c of e)n[c.colId]&&(r[c.colId]=!0);const l=e.filter(e=>r[e.colId]),a=t.filter(e=>r[e.colId]),d=[];a.forEach((e,t)=>{const o=l?.[t];if(o&&o.colId!==e.colId){const e=s.getCol(o.colId);e&&d.push(e)}}),d.length&&i.dispatchEvent({type:"columnMoved",columns:d,column:1===d.length?d[0]:null,finished:!0,source:o})}(c,La(e),o,r,a)}}function La(e){const{colModel:t,rowGroupColsSvc:o,pivotColsSvc:s}=e;if(a(t.getColDefCols())||!t.isAlive())return[];const i=o?.columns,n=s?.columns,r=[];t.forAllCols(e=>(e=>{const t=e.isRowGroupActive()&&i?i.indexOf(e):null,o=e.isPivotActive()&&n?n.indexOf(e):null,s=e.isValueActive()?e.getAggFunc():null,l=null!=e.getSortIndex()?e.getSortIndex():null;r.push({colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:e.getSort(),sortType:e.getSortDef()?.type,sortIndex:l,aggFunc:s,rowGroup:e.isRowGroupActive(),rowGroupIndex:t,pivot:e.isPivotActive(),pivotIndex:o,flex:e.getFlex()??null})})(e));const l=new Map(t.getCols().map((e,t)=>[e.getColId(),t]));return r.sort((e,t)=>(l.has(e.colId)?l.get(e.colId):-1)-(l.has(t.colId)?l.get(t.colId):-1)),r}function Ga(e){const t=(e,t)=>null!=e?e:null!=t?t:null,o=e.getColDef(),s=Do(t(o.sort,o.initialSort)),i=s.direction,n=s.type,r=t(o.sortIndex,o.initialSortIndex),l=t(o.hide,o.initialHide),a=t(o.pinned,o.initialPinned),d=t(o.width,o.initialWidth),c=t(o.flex,o.initialFlex);let h=t(o.rowGroupIndex,o.initialRowGroupIndex),u=t(o.rowGroup,o.initialRowGroup);null!=h||u||(h=null,u=null);let g=t(o.pivotIndex,o.initialPivotIndex),p=t(o.pivot,o.initialPivot);null!=g||p||(g=null,p=null);const m=t(o.aggFunc,o.initialAggFunc);return{colId:e.getColId(),sort:i,sortType:n,sortIndex:r,hide:l,pinned:a,width:d,flex:c,rowGroup:u,rowGroupIndex:h,pivot:p,pivotIndex:g,aggFunc:m}}var Na=(e,t,o,s)=>{const i=e[o.getId()],n=e[s.getId()],r=null!=i,l=null!=n;if(r&&l)return i-n;if(r)return-1;if(l)return 1;const a=t.indexOf(o),d=t.indexOf(s),c=a>=0;return c&&d>=0?a-d:c?-1:1},Ba=class extends Di{constructor(e,t,o){super(t,o),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-label-align-right){.ag-label,.ag-wrapper{flex:none}}.ag-label-align-top{align-items:flex-start;flex-direction:column}:where(.ag-label-align-top){.ag-label,.ag-wrapper{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}")}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:o,labelAlignment:s,disabled:i,labelEllipsis:n}=this.config;null!=i&&this.setDisabled(i),null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=o&&this.setLabelWidth(o),null!=n&&this.setLabelEllipsis(n),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;se(t),"string"==typeof e?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),""===e?(K(t,!1),P(t,"presentation")):(K(t,!0),P(t,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const t=this.getGui().classList;return t.toggle("ag-label-align-left","left"===e),t.toggle("ag-label-align-right","right"===e),t.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||ge(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return _(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},Ha=class extends Ba{constructor(e,t,o,s){super(e,t,o),this.className=s}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:o,ariaLabel:s}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),null!=o&&this.onValueChange(o),null!=s&&this.setAriaLabel(s),this.className&&this.addCss(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),o=this.getLabel();null==o||""==o||null!==e.getAttribute("aria-label")?T(e,""):T(e,t??"")}setAriaLabel(e){return E(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return pe(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"})),this}},Oa=class extends Ha{constructor(e,t,o="text",s="input"){super(e,e?.template??function(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"}]}]}}(s),[],t),this.inputType=o,this.displayFieldTag=s,this.eLabel=null,this.eWrapper=null,this.eInput=null}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:o,className:s}=this;e.classList.add(`${s}-label`),t.classList.add(`${s}-input-wrapper`),o.classList.add(`${s}-input`),this.addCss("ag-input-field"),o.id=o.id||`ag-${this.getCompId()}-input`;const{inputName:i,inputWidth:n,inputPlaceholder:r,autoComplete:l,tabIndex:a}=this.config;null!=i&&this.setInputName(i),null!=n&&this.setInputWidth(n),null!=r&&this.setInputPlaceholder(r),null!=l&&this.setAutoComplete(l),this.addInputListeners(),this.activateTabIndex([o],a)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){"input"===this.displayFieldTag&&(this.inputType=e,ve(this.eInput,"type",e))}getInputElement(){return this.eInput}getWrapperElement(){return this.eWrapper}setInputWidth(e){return ge(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return ve(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return E(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return _(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(!0===e)ve(this.eInput,"autocomplete",null);else{const t="string"==typeof e?e:"off";ve(this.eInput,"autocomplete",t)}return this}},Va=class extends Oa{constructor(e,t="ag-checkbox",o="checkbox"){super(e,t,o),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t,name:o}=this.config;"boolean"==typeof e&&this.setReadOnly(e),"boolean"==typeof t&&this.setPassive(t),null!=o&&this.setName(o)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0;const o=this.eInput;o.checked=e,o.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,o){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:o});const s=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:s.id,name:s.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),o=this.selected=e.target.checked;this.refreshSelectedClass(o),this.dispatchChange(o,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",!0===e),t.toggle("ag-indeterminate",null==e)}},za={selector:"AG-CHECKBOX",component:Va},Wa={tag:"div",cls:"ag-cell-wrapper ag-checkbox-cell",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},Ua={tag:"div",cls:"ag-skeleton-container"},$a={moduleName:"CheckboxCellRenderer",version:mt,userComponents:{agCheckboxCellRenderer:class extends Pi{constructor(){super(Wa,[za]),this.eCheckbox=null,this.registerCSS(".ag-checkbox-cell{height:100%}")}init(e){this.refresh(e);const{eCheckbox:t,beans:o}=this,s=t.getInputElement();s.setAttribute("tabindex","-1"),A(s,"polite"),this.addManagedListeners(s,{click:e=>{if(qi(e),t.isDisabled())return;const o=t.getValue();this.onCheckboxChanged(o)},dblclick:e=>{qi(e)}}),this.addManagedElementListeners(e.eGridCell,{keydown:s=>{if(s.key===vs&&!t.isDisabled()){e.eGridCell===w(o)&&t.toggle();const i=t.getValue();this.onCheckboxChanged(i),s.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,o=!0;const{value:s,column:i,node:n}=e;if(n.group&&i)if("boolean"==typeof s)t=s;else{const e=i.getColId();e.startsWith("ag-Grid-AutoColumn")?t=null==s||""===s?void 0:"true"===s:n.aggData&&void 0!==n.aggData[e]||n.sourceRowIndex>=0?t=s??void 0:o=!1}else t=s??void 0;const{eCheckbox:r}=this;if(!o)return void r.setDisplayed(!1);r.setValue(t);const l=e.disabled??!i?.isCellEditable(n);r.setDisabled(l);const a=this.getLocaleTextFunc(),d=W(a,t),c=l?d:`${a("ariaToggleCellValue","Press SPACE to toggle cell value")} (${d})`;r.setInputAriaLabel(c)}onCheckboxChanged(e){const{params:t}=this,{column:o,node:s,value:i}=t,{editSvc:n}=this.beans;if(!o)return;const r={rowNode:s,column:o};n?.dispatchCellEvent(r,null,"cellEditingStarted",{value:i});const l=s.setDataValue(o,e,"ui");n?.dispatchCellEvent(r,null,"cellEditingStopped",{oldValue:i,newValue:e,valueChanged:l}),l||this.updateCheckbox(t)}}}},ja={moduleName:"SkeletonCellRenderer",version:mt,userComponents:{agSkeletonCellRenderer:class extends Pi{constructor(){super(Ua)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>T(e.eParentOfValue)),T(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");E(this.getGui(),t)}setupLoading(e){const t=Cl({tag:"div",cls:"ag-skeleton-effect"}),o=e.node.rowIndex;if(null!=o){const e=75+25*(o%2==0?Math.sin(o):Math.cos(o));t.style.width=`${e}%`}this.getGui().appendChild(t);const s=this.getLocaleTextFunc(),i=e.deferRender?s("ariaDeferSkeletonCellLoading","Cell is loading"):s("ariaSkeletonCellLoading","Row data is loading");E(this.getGui(),i)}refresh(e){return!1}}}},Ka=e=>{if("bigint"==typeof e)return e;let t;if("number"==typeof e)t=e;else if("string"==typeof e){if(t=e.trim(),""===t)return null;if(t.endsWith("n")&&(t=t.slice(0,-1)),!/^[+-]?\d+$/.test(t))return null}if(null==t)return null;try{return BigInt(t)}catch{return null}},_a=new RegExp("[T ]"),qa=new RegExp("^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}\\D?)?");function Ya(e,t){return e.toString().padStart(t,"0")}function Za(e,t=!0,o="T"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(e=>Ya(e,2)).join("-");return t&&(s+=o+[e.getHours(),e.getMinutes(),e.getSeconds()].map(e=>Ya(e,2)).join(":")),s}function Qa(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),Ya(e.getDate(),2),Ya(e.getHours(),2),`:${Ya(e.getMinutes(),2)}`,`:${Ya(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,Ya(e.getDate(),2)].map(String):null}var Xa=["January","February","March","April","May","June","July","August","September","October","November","December"];function Ja(e,t=!1){return!!ed(e,t)}function ed(e,t=!1,o){if(!e)return null;if(!o&&!qa.test(e))return null;const[s,i]=e.split(_a);if(!s)return null;const n=s.split("-").map(e=>Number.parseInt(e,10));if(3!==n.filter(e=>!isNaN(e)).length)return null;const[r,l,a]=n,d=new Date(r,l-1,a);if(d.getFullYear()!==r||d.getMonth()!==l-1||d.getDate()!==a)return null;if(!i&&t)return null;if(!i||"00:00:00"===i)return d;const[c,h,u]=i.split(":").map(e=>Number.parseInt(e,10));if(c>=0&&c<24)d.setHours(c);else if(t)return null;if(h>=0&&h<60)d.setMinutes(h);else if(t)return null;if(u>=0&&u<60)d.setSeconds(u);else if(t)return null;return d}function td(e,t,o){if(!t||!e)return;if(!o)return e[t];const s=t.split(".");let i=e;for(let n=0;n{const{node:s,colDef:i,column:n,value:r}=o;if(s?.group){const t=(i.pivotValueColumn??n).getAggFunc();if(t){if("first"===t||"last"===t)return e.valueFormatter(o);const{baseDataType:s}=e;if(!(l=s,"number"!==l&&"bigint"!==l||"count"===t)){if((e=>"bigint"==typeof e||"number"==typeof e)(r))return e.valueFormatter(o);if(null==r)return;if("object"==typeof r){if("function"==typeof r.toNumber)return e.valueFormatter({...o,value:r.toNumber()});if("value"in r)return e.valueFormatter({...o,value:r.value})}}return}}else if(t.get("groupHideOpenParents")&&o.column.isRowGroupActive()&&"string"==typeof o.value&&!e.dataTypeMatcher?.(o.value))return;var l;return e.valueFormatter(o)}}function rd(e,t){if(null==e)return null==t?0:-1;if(null==t)return 1;const o=Ka(e),s=Ka(t);return null!=o&&null!=s?o===s?0:o>s?1:-1:0}function ld(e,t){if(null==e)return null==t?0:-1;if(null==t)return 1;const o=ad(e),s=ad(t);return null!=o&&null!=s?o===s?0:o>s?1:-1:0}function ad(e){const t=Ka(e);return null==t?null:t<0n?-t:t}function dd(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([o,s])=>function(e,t,o,s){if(!t[o])return!1;const i=e[o];return null===i?(t[o]=!1,!1):void 0===s?!!i:i===s}(e,t,o,s))}function cd(e,t){const o=Ga(e);for(const s of t)delete o[s],"rowGroup"===s?delete o.rowGroupIndex:"pivot"===s&&delete o.pivotIndex;return o}var hd={moduleName:"DataType",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="dataTypeSvc",this.dataTypeDefinitions={},this.isPendingInference=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[],this.columnDefinitionPropsPerDataType={number:()=>({cellEditor:"agNumberCellEditor"}),bigint:({filterModuleBean:e})=>e?{cellEditor:"agTextCellEditor"}:{cellEditor:"agTextCellEditor",comparator:{default:rd,absolute:ld}},boolean:()=>({cellEditor:"agCheckboxCellEditor",cellRenderer:"agCheckboxCellRenderer",getFindText:()=>null,suppressKeyboardEvent:({node:e,event:t,column:o})=>t.key===vs&&o.isCellEditable(e)}),date:({formatValue:e})=>({cellEditor:"agDateCellEditor",keyCreator:e}),dateString:({formatValue:e})=>({cellEditor:"agDateStringCellEditor",keyCreator:e}),dateTime(e){return this.date(e)},dateTimeString(e){return this.dateString(e)},object:({formatValue:e,colModel:t,colId:o})=>({cellEditorParams:{useFormatter:!0},comparator:(s,i)=>{const n=t.getColDefCol(o),r=n?.getColDef();if(!n||!r)return 0;const l=null==s?"":e({column:n,node:null,value:s}),a=null==i?"":e({column:n,node:null,value:i});return l===a?0:l>a?1:-1},keyCreator:e}),text:()=>({})}}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={},o={},s=e=>t=>{const{column:o,node:s,value:i}=t;let n=o.getColDef().valueFormatter;return n===e.groupSafeValueFormatter&&(n=e.valueFormatter),this.beans.valueSvc.formatValue(o,s,i,n)};for(const c of Object.keys(e)){const i=e[c],n={...i,groupSafeValueFormatter:nd(i,this.gos)};t[c]=n,o[c]=s(n)}const i=this.gos.get("dataTypeDefinitions")??{},n={};for(const c of Object.keys(i)){const r=i[c],l=this.processDataTypeDefinition(r,i,[c],e);l&&(t[c]=l,r.dataTypeMatcher&&(n[c]=r.dataTypeMatcher),o[c]=s(l))}const{valueParser:r,valueFormatter:l}=e.object,{valueParser:a,valueFormatter:d}=t.object;this.hasObjectValueParser=a!==r,this.hasObjectValueFormatter=d!==l,this.formatValueFuncs=o,this.dataTypeDefinitions=t,this.dataTypeMatchers=this.sortKeysInMatchers(n,e)}sortKeysInMatchers(e,t){const o={...e};for(const s of od)delete o[s],o[s]=e[s]??t[s].dataTypeMatcher;return o}processDataTypeDefinition(e,t,o,s){let i;const n=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let o=s[n];const r=t[n];if(o&&r&&(o=r),!id(e,o,n))return;i=sd(o,e)}else{if(o.includes(n))return void Dt(44);const r=t[n];if(!id(e,r,n))return;const l=this.processDataTypeDefinition(r,t,[...o,n],s);if(!l)return;i=sd(l,e)}return{...i,groupSafeValueFormatter:nd(i,this.gos)}}updateColDefAndGetColumnType(e,t,o){let{cellDataType:s}=t;void 0===s&&(s=e.cellDataType);const{field:i}=t;if(null!=s&&!0!==s||(s=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(i,o)),this.addFormulaCellEditorToColDef(e,t),!s)return void(e.cellDataType=!1);const n=this.dataTypeDefinitions[s];if(n)return e.cellDataType=s,n.groupSafeValueFormatter&&(e.valueFormatter=n.groupSafeValueFormatter),n.valueParser&&(e.valueParser=n.valueParser),n.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,s,n,o),n.columnTypes;Dt(47,{cellDataType:s})}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 o=e=>{t.add(e.key)};e.__addEventListener("columnStateUpdated",o),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.__removeEventListener("columnStateUpdated",o))}canInferCellDataType(e,t){const{gos:o}=this;if(!It(o))return!1;const s={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(dd(t,s))return!1;const i=null===t.type?e.type:t.type;if(i){const e=o.get("columnTypes")??{};if(is(i).some(t=>{const o=e[t.trim()];return o&&dd(o,s)}))return!1}return!dd(e,s)}inferCellDataType(e,t){if(!e)return;let o;const s=this.getInitialData();return s?o=td(s,e,e.includes(".")&&!this.gos.get("suppressFieldDotNotation")):this.initWaitForRowData(t),null!=o?Object.keys(this.dataTypeMatchers).find(e=>this.dataTypeMatchers[e](o))??"object":void 0}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const e=this.beans.rowModel.rootNode?._leafs;if(e?.length)return e[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=/* @__PURE__ */new Set,this.isPendingInference)return;this.isPendingInference=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions,{colAutosize:o,eventSvc:s}=this.beans;t&&o&&(o.shouldQueueResizeOperations=!0);const[i]=this.addManagedEventListeners({rowDataUpdateStarted:e=>{const{firstRowData:n}=e;n&&(i?.(),this.isPendingInference=!1,this.processColumnsPendingInference(n,t),this.columnStateUpdatesPendingInference={},t&&o?.processResizeOperations(),s.dispatchEvent({type:"dataTypesInferred"}))}})}processColumnsPendingInference(e,t){this.initialData=e;const o=[];this.destroyColumnStateUpdateListeners();const s={},i={};for(const n of Object.keys(this.columnStateUpdatesPendingInference)){const e=this.columnStateUpdatesPendingInference[n],r=this.colModel.getCol(n);if(!r)continue;const l=r.getColDef();if(!this.resetColDefIntoCol(r,"cellDataTypeInferred"))continue;const a=r.getColDef();if(t&&a.type&&a.type!==l.type){const t=cd(r,e);t.rowGroup&&null==t.rowGroupIndex&&(s[n]=t),t.pivot&&null==t.pivotIndex&&(i[n]=t),o.push(t)}}t&&o.push(...this.generateColumnStateForRowGroupAndPivotIndexes(s,i)),o.length&&Aa(this.beans,{state:o},"cellDataTypeInferred"),this.initialData=null}generateColumnStateForRowGroupAndPivotIndexes(e,t){const o={},{rowGroupColsSvc:s,pivotColsSvc:i}=this.beans;return s?.restoreColumnOrder(o,e),i?.restoreColumnOrder(o,t),Object.values(o)}resetColDefIntoCol(e,t){const o=e.getUserProvidedColDef();if(!o)return!1;const s=_o(this.beans,o,e.getColId());return e.setColDef(s,o,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"dateTime"===e||"dateTimeString"===e}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(null==t)return!0;const o=this.getDataTypeDefinition(e)?.dataTypeMatcher;return!o||!(!e.getColDef().allowFormula||!this.beans.formula?.isFormula(t))||o(t)}validateColDef(e,t,o,s){if("object"===e.cellDataType){const i=e=>null==e?.cellDataType||!0===e?.cellDataType,n=i(t)&&i(o),r=e=>Dt(48,{property:e,inferred:n,colId:s}),{object:l}=this.dataTypeDefinitions;e.valueFormatter!==l.groupSafeValueFormatter||this.hasObjectValueFormatter||r("Formatter"),e.editable&&e.valueParser===l.valueParser&&!this.hasObjectValueParser&&r("Parser")}}postProcess(e){const t=e.cellDataType;if(!t||"string"!=typeof t)return;const{dataTypeDefinitions:o,beans:s,formatValueFuncs:i}=this,n=o[t];n&&s.colFilter?.setColDefPropsForDataType(e,n,i[t])}getFormatValue(e){return this.formatValueFuncs[e]}isColPendingInference(e){return this.isPendingInference&&!!this.columnStateUpdatesPendingInference[e]}setColDefPropertiesForBaseDataType(e,t,o,s){const i=this.formatValueFuncs[t],n=this.columnDefinitionPropsPerDataType[o.baseDataType]({colDef:e,cellDataType:t,colModel:this.colModel,dataTypeDefinition:o,colId:s,formatValue:i,filterModuleBean:this.beans.filterManager});"agFormulaCellEditor"===e.cellEditor&&n.cellEditor!==e.cellEditor&&(n.cellEditor=e.cellEditor),Object.assign(e,n)}getDateObjectTypeDef(e){const t=this.getLocaleTextFunc(),o=this.getDateIncludesTimeFlag(e);return{baseDataType:e,valueParser:e=>ed(e.newValue&&String(e.newValue)),valueFormatter:e=>null==e.value?"":e.value instanceof Date&&!isNaN(e.value.getTime())?Za(e.value,o)??"":t("invalidDate","Invalid Date"),dataTypeMatcher:e=>e instanceof Date}}getDateStringTypeDef(e){const t=this.getDateIncludesTimeFlag(e);return{baseDataType:e,dateParser:e=>ed(e)??void 0,dateFormatter:e=>Za(e??null,t)??void 0,valueParser:e=>Ja(String(e.newValue))?e.newValue:null,valueFormatter:e=>Ja(String(e.value))?String(e.value):"",dataTypeMatcher:e=>"string"==typeof e&&Ja(e)}}getDefaultDataTypes(){const e=this.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:e=>""===e.newValue?.trim?.()?null:Number(e.newValue),valueFormatter:t=>null==t.value?"":"number"!=typeof t.value||isNaN(t.value)?e("invalidNumber","Invalid Number"):String(t.value),dataTypeMatcher:e=>"number"==typeof e},bigint:{baseDataType:"bigint",valueParser:e=>{const{newValue:t}=e;return null==t||"string"==typeof t&&""===t.trim()?null:Ka(t)},valueFormatter:t=>null==t.value?"":"bigint"!=typeof t.value?e("invalidBigInt","Invalid BigInt"):String(t.value),dataTypeMatcher:e=>"bigint"==typeof e},text:{baseDataType:"text",valueParser:e=>""===e.newValue?null:d(e.newValue),dataTypeMatcher:e=>"string"==typeof e},boolean:{baseDataType:"boolean",valueParser:e=>null==e.newValue?e.newValue:""===e.newValue?.trim?.()?null:"true"===String(e.newValue).toLowerCase(),valueFormatter:e=>null==e.value?"":String(e.value),dataTypeMatcher:e=>"boolean"==typeof e},date:this.getDateObjectTypeDef("date"),dateString:this.getDateStringTypeDef("dateString"),dateTime:this.getDateObjectTypeDef("dateTime"),dateTimeString:{...this.getDateStringTypeDef("dateTimeString"),dataTypeMatcher:e=>"string"==typeof e&&function(e){return Ja(e,!0)}(e)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:e=>d(e.value)??""}}}destroyColumnStateUpdateListeners(){for(const e of this.columnStateUpdateListenerDestroyFuncs)e();this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}}],dependsOn:[$a]},ud={moduleName:"ColumnFlex",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="colFlex",this.columnsHidden=!1}refreshFlexedColumns(e={}){const t=e.source??"flex";null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth);const o=this.flexViewportWidth,{visibleCols:s,colDelayRenderSvc:i}=this.beans,n=s.centerCols;let r=-1;if(e.resizingCols){const t=new Set(e.resizingCols);for(let e=n.length-1;e>=0;e--)if(t.has(n[e])){r=e;break}}let l=!1;const a=n.map((e,t)=>{const o=e.getFlex(),s=null!=o&&o>0&&t>r;return l||(l=s),{col:e,isFlex:s,flex:Math.max(0,o??0),initialSize:e.getActualWidth(),min:e.getMinWidth(),max:e.getMaxWidth(),targetSize:0}});if(l?(i?.hideColumns("colFlex"),this.columnsHidden=!0):this.columnsHidden&&this.revealColumns(i),!o||!l)return[];let d=a.length,c=a.reduce((e,t)=>e+t.flex,0),h=o;const u=(e,o)=>{e.frozenSize=o,e.col.setActualWidth(o,t),h-=o,c-=e.flex,d-=1},g=e=>null!=e.frozenSize;for(const m of a)m.isFlex||u(m,m.initialSize);for(;d>0;){const e=Math.round(c<1?h*c:h);let t,o=0,s=0;for(const r of a){if(g(r))continue;t=r,s+=e*(r.flex/c);const i=s-o,n=Math.round(i);r.targetSize=n,o+=n}t&&(t.targetSize+=e-o);let i=0;for(const r of a){if(g(r))continue;const e=r.targetSize,t=Math.min(Math.max(e,r.min),r.max);i+=t-e,r.violationType=t===e?void 0:t0?"min":"max";for(const r of a)g(r)||"all"!==n&&r.violationType!==n||u(r,r.targetSize)}e.skipSetLeft||s.setLeftValues(t),e.updateBodyWidths&&s.updateBodyWidths();const p=a.filter(e=>e.isFlex&&!e.violationType).map(e=>e.col);if(e.fireResizedEvent){const e=a.filter(e=>e.initialSize!==e.frozenSize).map(e=>e.col),o=a.filter(e=>e.flex).map(e=>e.col);Sa(this.eventSvc,e,!0,t,o)}return this.revealColumns(i),p}revealColumns(e){this.columnsHidden&&(e?.revealColumns("colFlex"),this.columnsHidden=!1)}initCol(e){const{flex:t,initialFlex:o}=e.colDef;void 0!==t?e.flex=t:void 0!==o&&(e.flex=o)}setColFlex(e,t){e.flex=t??null,e.dispatchStateUpdatedEvent("flex")}}]},gd={moduleName:"CellRendererFunction",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="agCompUtils"}adaptFunction(e,t){return e.cellRenderer?class{refresh(){return!1}getGui(){return this.eGui}init(e){const o=t(e),s=typeof o;this.eGui="string"!==s&&"number"!==s&&"boolean"!==s?null!=o?o:Cl({tag:"span"}):le(""+o+"")}}:null}}]},pd=class extends He{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,...o){if(!this.dynamicBeans)throw new Error(this.getDynamicError(e,!0));const s=this.dynamicBeans[e];if(null!=s)return new s(...o);if(t)throw new Error(this.getDynamicError(e,!1))}};function md(e){return"object"==typeof e&&!!e.getComp}var fd="object"!=typeof window||!window?.document?.fonts?.forEach,Cd=(e,t,o,s,i,n,r=!1)=>{if(fd)return;s&&(e=`@layer ${CSS.escape(s).replaceAll("\\.",".")} { ${e} }`);let l=yd.map.get(t);if(l||(l=[],yd.map.set(t,l)),l.some(t=>t.css===e))return;const a=document.createElement("style");n&&a.setAttribute("nonce",n),a.dataset.agCss=o,a.dataset.agCssVersion=mt,a.textContent=e;const d={css:e,el:a,priority:i,isParams:r};let c;for(const h of l){if(h.priority>i)break;c=h}if(c){c.el.after(a);const e=l.indexOf(c);l.splice(e+1,0,d)}else"STYLE"===t.nodeName?t.after(a):t.insertBefore(a,t.querySelector(":not(title, meta)")),l.push(d)},vd=(e,t,o,s)=>{Cd(':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}',e,"shared",t,0,o),s?.forEach((s,i)=>s.forEach(s=>Cd(s,e,i,t,0,o)))},wd=(e,t=!1)=>{const o=/* @__PURE__ */new Set;for(const i of yd.grids.values())i.styleContainer===e&&o.add(i.paramsCss);const s=yd.map.get(e)??[];for(let i=s.length-1;i>=0;i--)(t||s[i].isParams&&!o.has(s[i].css))&&(s[i].el.remove(),s.splice(i,1))},bd=()=>{const e=globalThis.agStyleInjectionVersions??(globalThis.agStyleInjectionVersions=/* @__PURE__ */new Map);let t=e.get(mt);return t||(t={map:/* @__PURE__ */new WeakMap,grids:/* @__PURE__ */new Map,paramsId:0},e.set(mt,t)),t},yd=bd(),Sd=e=>new Fd(e),Rd="$default",xd=0,Fd=class{constructor({feature:e,params:t,modeParams:o={},css:s,cssImports:i}){this.feature=e,this.css=s,this.cssImports=i,this.modeParams={[Rd]:{...o[Rd]??{},...t??{}},...o}}use(e,t,o){let s=this._inject;if(null==s){let{css:e}=this;if(e){const t=`ag-theme-${this.feature??"part"}-${++xd}`;"function"==typeof e&&(e=e()),e=`:where(.${t}) {\n${e}\n}\n`;for(const o of this.cssImports??[])e=`@import url(${JSON.stringify(o)});\n${e}`;s={css:e,class:t}}else s=!1;this._inject=s}return s&&e&&Cd(s.css,e,s.class,t,1,o),!!s&&s.class}},Dd=e=>{return`--ag-${t=e,t.replace(/[A-Z]|\d+/g,e=>`-${e}`).toLowerCase()}`;var t},Md=e=>`var(${Dd(e)})`,Pd=e=>({ref:"accentColor",mix:e}),Ed=e=>({ref:"foregroundColor",mix:e}),Td=e=>({ref:"foregroundColor",mix:e,onto:"backgroundColor"}),Id={ref:"backgroundColor"},Ad={ref:"foregroundColor"},kd={ref:"accentColor"},Ld={backgroundColor:"#fff",foregroundColor:"#181d1f",borderColor:Ed(.15),chromeBackgroundColor:Td(.02),browserColorScheme:"light"},Gd={...Ld,textColor:Ad,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:Pd(.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:Id,dragAndDropImageBorder:!0,dragAndDropImageNotAllowedBorder:{color:{ref:"invalidColor",onto:"dragAndDropImageBackgroundColor",mix:.5}},dragAndDropImageShadow:{ref:"popupShadow"},iconSize:16,iconColor:"inherit",toggleButtonWidth:28,toggleButtonHeight:18,toggleButtonOnBackgroundColor:kd,toggleButtonOffBackgroundColor:Td(.3),toggleButtonSwitchBackgroundColor:Id,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:Id,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:Ed(.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:Ed(.2)},menuBackgroundColor:Td(.03),menuTextColor:Td(.95),menuShadow:{ref:"popupShadow"},menuSeparatorColor:{ref:"borderColor"}},Nd=["colorScheme","color","length","scale","borderStyle","border","shadow","image","fontFamily","fontWeight","duration"],Bd=(()=>{const e=/* @__PURE__ */new Map;return t=>{const o=t;return e.has(o)||e.set(o,(s=(s=t).toLowerCase(),Nd.find(e=>s.endsWith(e.toLowerCase()))??"length")),e.get(o);var s}})(),Hd=e=>"object"==typeof e&&e?.ref?Md(e.ref):"string"==typeof e?e:"number"==typeof e&&String(e),Od=e=>{if("string"==typeof e)return e;if("object"==typeof e&&e&&"ref"in e){const t=Md(e.ref);return null==e.mix?t:`color-mix(in srgb, ${e.onto?Md(e.onto):"transparent"}, ${t} ${(e=>Math.max(0,Math.min(100,e)))(100*e.mix)}%)`}return!1},Vd=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"object"==typeof e&&e&&"calc"in e?`calc(${e.calc.replace(/ ?[*/+] ?/g," $& ").replace(/-?\b[a-z][a-z0-9]*\b(?![-(])/gi,e=>"-"===e[0]?e:" "+Md(e)+" ")})`:!("object"!=typeof e||!e||!("ref"in e))&&Md(e.ref),zd=(e,t)=>"string"==typeof e?e:!0===e?zd({},t):!1===e?"columnBorder"===t?zd({color:"transparent"},t):"none":"object"==typeof e&&e&&"ref"in e?Md(e.ref):Ud(e.style??"solid")+" "+Vd(e.width??{ref:"borderWidth"})+" "+Od(e.color??{ref:"borderColor"}),Wd=e=>[Vd(e.offsetX??0),Vd(e.offsetY??0),Vd(e.radius??0),Vd(e.spread??0),Od(e.color??{ref:"foregroundColor"}),...e.inset?["inset"]:[]].join(" "),Ud=Hd,$d=e=>"string"==typeof e?e.includes(",")?e:jd(e):"object"==typeof e&&e&&"googleFont"in e?$d(e.googleFont):"object"==typeof e&&e&&"ref"in e?Md(e.ref):!!Array.isArray(e)&&e.map(e=>("object"==typeof e&&"googleFont"in e&&(e=e.googleFont),jd(e))).join(", "),jd=e=>/^[\w-]+$|\w\(/.test(e)?e:JSON.stringify(e),Kd=e=>"string"==typeof e?e:"object"==typeof e&&e&&"url"in e?`url(${JSON.stringify(e.url)})`:"object"==typeof e&&e&&"svg"in e?Kd({url:`data:image/svg+xml,${encodeURIComponent(e.svg)}`}):!("object"!=typeof e||!e||!("ref"in e))&&Md(e.ref),_d={color:Od,colorScheme:Hd,length:Vd,scale:Hd,border:zd,borderStyle:Ud,shadow:e=>"string"==typeof e?e:!1===e?"none":"object"==typeof e&&e&&"ref"in e?Md(e.ref):Array.isArray(e)?e.map(Wd).join(", "):Wd(e),image:Kd,fontFamily:$d,fontWeight:Hd,duration:(e,t,o)=>"string"==typeof e?e:"number"==typeof e?(e>=10&&o?.warn(104,{value:e,param:t}),`${e}s`):!("object"!=typeof e||!e||!("ref"in e))&&Md(e.ref)},qd=(e,t,o)=>_d[Bd(e)](t,e,o),Yd=class e{constructor(e,t=[]){this.params=e,this.parts=t}withPart(t){return"function"==typeof t&&(t=t()),t instanceof Fd?new e(this.params,[...this.parts,t]):(this.params.themeLogger.preInitErr(259,"Invalid part",{part:t}),this)}withoutPart(e){return this.withPart(Sd({feature:e}))}withParams(e,t=Rd){return this.withPart(Sd({modeParams:{[t]:e}}))}_startUse({styleContainer:e,cssLayer:t,nonce:o,loadThemeGoogleFonts:s,moduleCss:i}){if(fd)return;Jd(),vd(e,t,o,i);const n=Qd(this);if(n.length>0)for(const r of n)s&&ec(r,o);for(const r of this.parts)r.use(e,t,o)}_getCssClass(){return this._cssClassCache??(this._cssClassCache=Zd(this.parts).map(e=>e.use(void 0,void 0,void 0)).filter(Boolean).concat(this._getParamsClassName()).join(" "))}_getParamsClassName(){return this._paramsClassName??(this._paramsClassName="ag-theme-params-"+ ++bd().paramsId)}_getModeParams(){let e=this._paramsCache;if(!e){const t={[Rd]:{...Gd}};for(const e of Zd(this.parts))for(const o of Object.keys(e.modeParams)){const s=e.modeParams[o];if(s){const e=t[o]??(t[o]={}),i=/* @__PURE__ */new Set;for(const t of Object.keys(s)){const o=s[t];void 0!==o&&(e[t]=o,i.add(t))}if(o===Rd)for(const o of Object.keys(t)){const e=t[o];if(o!==Rd)for(const t of i)delete e[t]}}}this._paramsCache=e=t}return e}_getParamsCss(){if(!this._paramsCssCache){let e="",t="";const o=this._getModeParams(),{overridePrefix:s,themeLogger:i}=this.params,n=s?`--ag-${s}-`:void 0;for(const a of Object.keys(o)){const s=o[a];if(a!==Rd){const o=`:where([data-ag-theme-mode="${"object"==typeof CSS?CSS.escape(a):a}"]) & {\n`;e+=o,t+=o}for(const o of Object.keys(s).sort()){const r=s[o],l=qd(o,r,i);if(!1===l)i.error(107,{key:o,value:r});else{const s=Dd(o),i=n?s.replace("--ag-",n):s,r=s.replace("--ag-","--ag-inherited-");e+=`\t${s}: var(${r}, ${l});\n`,t+=`\t${r}: var(${i});\n`}}a!==Rd&&(e+="}\n",t+="}\n")}const r=`:where(.${this._getParamsClassName()})`;let l=`${r} {\n${e}}\n`;l+=`:has(> ${r}):not(${r}) {\n${t}}\n`,this._paramsCssCache=l}return this._paramsCssCache}},Zd=e=>{const t=/* @__PURE__ */new Map;for(const s of e)t.set(s.feature,s);const o=[];for(const s of e)s.feature&&t.get(s.feature)!==s||o.push(s);return o},Qd=e=>{const t=/* @__PURE__ */new Set,o=e=>{if(Array.isArray(e))e.forEach(o);else{const o=e?.googleFont;"string"==typeof o&&t.add(o)}};return Object.values(e._getModeParams()).flatMap(e=>Object.values(e)).forEach(o),Array.from(t).sort()},Xd=!1,Jd=()=>{if(!Xd){Xd=!0;for(const e of Array.from(document.head.querySelectorAll('style[data-ag-scope="legacy"]')))e.remove()}},ec=async(e,t)=>{Cd(`@import url('https://${tc}/css2?family=${encodeURIComponent(e)}:wght@100;200;300;400;500;600;700;800;900&display=swap');\n`,document.head,`googleFont:${e}`,void 0,0,t)},tc="fonts.googleapis.com",oc={changeKey:"listItemHeight",type:"length",defaultValue:24},sc=class extends He{constructor(){super(...arguments),this.beanName="environment",this.sizeEls=/* @__PURE__ */new Map,this.lastKnownValues=/* @__PURE__ */new Map,this.sizesMeasured=!1,this.globalCSS=[]}wireBeans(e){this.eRootDiv=e.eRootDiv}postConstruct(){const{gos:e,eRootDiv:t}=this;e.setInstanceDomData(t);const o=e.get("themeStyleContainer"),s="undefined"!=typeof ShadowRoot,i=s&&t.getRootNode()instanceof ShadowRoot;this.eStyleContainer=("function"==typeof o?o():o)??(i?t:document.head),o||i||!s||nc(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(oc),this.initVariables(),this.addDestroyFunc(()=>(e=>{const t=yd.grids.get(e)?.styleContainer;t&&(yd.grids.delete(e),Array.from(yd.grids.values()).some(e=>e.styleContainer===t)?wd(t):(wd(t,!0),yd.map.delete(t)))})(this)),this.mutationObserver=new MutationObserver(()=>{this.fireStylesChangedEvent("theme")}),this.addDestroyFunc(()=>this.mutationObserver.disconnect())}applyThemeClasses(e,t=[]){const{theme:o}=this,s=o?o._getCssClass():this.applyLegacyThemeClasses();for(const i of Array.from(e.classList))i.startsWith("ag-theme-")&&e.classList.remove(i);if(s){const o=e.className;e.className=`${o}${o?" ":""}${s}${t?.length?" "+t.join(" "):""}`}}applyLegacyThemeClasses(){let e="";this.mutationObserver.disconnect();let t=this.eRootDiv;for(;t;){let o=!1;for(const s of Array.from(t.classList))s.startsWith("ag-theme-")&&(o=!0,e=e?`${e} ${s}`:s);o&&this.mutationObserver.observe(t,{attributes:!0,attributeFilter:["class"]}),t=t.parentElement}return e}addGlobalCSS(e,t){this.theme?Cd(e,this.eStyleContainer,t,this.cssLayer,0,this.styleNonce):this.globalCSS.push([e,t])}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(oc)}getCSSVariablePixelValue(e){const t=this.lastKnownValues.get(e);if(null!=t)return t;const o=this.measureSizeEl(e);return"detached"===o||"no-styles"===o?(e.cacheDefault&&this.lastKnownValues.set(e,e.defaultValue),e.defaultValue):(this.lastKnownValues.set(e,o),o)}measureSizeEl(e){const t=this.getSizeEl(e);if(null==t.offsetParent)return"detached";const o=t.offsetWidth;return o===ic?"no-styles":(this.sizesMeasured=!0,o)}getMeasurementContainer(){let e=this.eMeasurementContainer;return e||(e=this.eMeasurementContainer=xe({tag:"div",cls:"ag-measurement-container"}),this.eRootDiv.appendChild(e)),e}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;const o=this.getMeasurementContainer();t=xe({tag:"div"});const s=this.setSizeElStyles(t,e);o.appendChild(t),this.sizeEls.set(e,t);const{type:i,noWarn:n}=e;if("length"!==i&&"border"!==i)return t;let r=this.measureSizeEl(e);"no-styles"!==r||n||this.varError(s,e.defaultValue);const l=we(this.beans,t,()=>{const t=this.measureSizeEl(e);"detached"!==t&&"no-styles"!==t&&(this.lastKnownValues.set(e,t),t!==r&&(r=t,this.fireStylesChangedEvent(e.changeKey)))});return this.addDestroyFunc(()=>l()),t}setSizeElStyles(e,t){const{changeKey:o,type:s}=t;let i=Dd(o);return"border"===s?(i.endsWith("-width")&&(i=i.slice(0,-6)),e.className="ag-measurement-element-border",e.style.setProperty("--ag-internal-measurement-border",`var(${i}, solid ${ic}px)`)):e.style.width=`var(${i}, ${ic}px)`,i}handleThemeChange(){const{gos:e,theme:t}=this,o=e.get("theme");let s;if("legacy"===o)s=void 0;else{const e=o??this.getDefaultTheme();e instanceof Yd?s=e:this.themeError(e)}s!==t&&this.handleNewTheme(s),this.postProcessThemeChange(s,o)}handleNewTheme(e){const{gos:t,eRootDiv:o,globalCSS:s}=this,i=this.getAdditionalCss();if(e){vd(this.eStyleContainer,this.cssLayer,this.styleNonce,i);for(const[e,t]of s)Cd(e,this.eStyleContainer,t,this.cssLayer,0,this.styleNonce);s.length=0}this.theme=e,e?._startUse({loadThemeGoogleFonts:t.get("loadThemeGoogleFonts"),styleContainer:this.eStyleContainer,cssLayer:this.cssLayer,nonce:this.styleNonce,moduleCss:i}),((e,t,o,s,i,n)=>{if(fd)return;const r=yd.grids.get(e);r?r.paramsCss=t:yd.grids.set(e,{styleContainer:s,paramsCss:t}),wd(s),t&&o&&Cd(t,s,o,i,2,n,!0)})(this,e?._getParamsCss()??null,e?._getParamsClassName()??null,this.eStyleContainer,this.cssLayer,this.styleNonce),this.applyThemeClasses(o),this.fireStylesChangedEvent("theme")}fireStylesChangedEvent(e){this.eventSvc.dispatchEvent({type:"stylesChanged",[`${e}Changed`]:!0})}},ic=15538,nc=(e,t,o)=>{let s=60;const i=setInterval(()=>{"undefined"!=typeof ShadowRoot&&e.getRootNode()instanceof ShadowRoot&&(t(),clearInterval(i)),(e.isConnected||--s<0)&&clearInterval(i)},1e3);o(()=>clearInterval(i))},rc={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:Id,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:kd,rangeSelectionBackgroundColor:Pd(.2),rangeSelectionChartBackgroundColor:"#0058FF1A",rangeSelectionChartCategoryBackgroundColor:"#00FF841A",rangeSelectionHighlightColor:Pd(.5),rangeHeaderHighlightColor:{ref:"foregroundColor",mix:.08,onto:"headerBackgroundColor"},rowNumbersSelectedColor:Pd(.5),rowHoverColor:Pd(.08),columnHoverColor:Pd(.05),selectedRowBackgroundColor:Pd(.12),modalOverlayBackgroundColor:{ref:"backgroundColor",mix:.66},dataBackgroundColor:Id,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:Ed(.7),headerColumnResizeHandleHeight:"30%",headerColumnResizeHandleWidth:2,headerColumnResizeHandleColor:{ref:"borderColor"},iconButtonColor:{ref:"iconColor"},iconButtonBackgroundColor:"transparent",iconButtonBackgroundSpread:4,iconButtonBorderRadius:1,iconButtonHoverColor:{ref:"iconButtonColor"},iconButtonHoverBackgroundColor:Ed(.1),iconButtonActiveColor:kd,iconButtonActiveBackgroundColor:Pd(.28),iconButtonActiveIndicatorColor:kd,setFilterIndentSize:{ref:"iconSize"},chartMenuPanelWidth:260,chartMenuLabelColor:Ed(.8),cellEditingBorder:{color:kd},cellEditingShadow:{ref:"cardShadow"},fullRowEditInvalidBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:.25},columnSelectIndentSize:{ref:"iconSize"},toolPanelSeparatorBorder:!0,columnDropCellBackgroundColor:Ed(.07),columnDropCellTextColor:{ref:"textColor"},columnDropCellDragHandleColor:{ref:"textColor"},columnDropCellBorder:{color:Ed(.13)},selectCellBackgroundColor:Ed(.07),selectCellBorder:{color:Ed(.13)},advancedFilterBuilderButtonBarBorder:!0,advancedFilterBuilderIndentSize:{calc:"spacing * 2 + iconSize"},advancedFilterBuilderJoinPillColor:"#f08e8d",advancedFilterBuilderColumnPillColor:"#a6e194",advancedFilterBuilderOptionPillColor:"#f3c08b",advancedFilterBuilderValuePillColor:"#85c0e4",filterPanelApplyButtonColor:Id,filterPanelApplyButtonBackgroundColor:kd,columnPanelApplyButtonColor:Id,columnPanelApplyButtonBackgroundColor:kd,filterPanelCardSubtleColor:{ref:"textColor",mix:.7},filterPanelCardSubtleHoverColor:{ref:"textColor"},findMatchColor:Ad,findMatchBackgroundColor:"#ffff00",findActiveMatchColor:Ad,findActiveMatchBackgroundColor:"#ffa500",filterToolPanelGroupIndent:{ref:"spacing"},rowLoadingSkeletonEffectColor:Ed(.15),statusBarLabelColor:Ad,statusBarLabelFontWeight:500,statusBarValueColor:Ad,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},lc={cellBatchEditBackgroundColor:"rgba(220 181 139 / 16%)",cellBatchEditTextColor:"#422f00",rowBatchEditBackgroundColor:{ref:"cellBatchEditBackgroundColor"},rowBatchEditTextColor:{ref:"cellBatchEditTextColor"}},ac={...lc,cellBatchEditTextColor:"#f3d0b3"},dc=/* @__PURE__ */(()=>Sd({feature:"batchEditStyle",params:lc,css:".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)}"}))(),cc={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"}},hc=/* @__PURE__ */(()=>Sd({feature:"buttonStyle",params:{...cc,buttonBackgroundColor:Id,buttonBorder:!0,buttonHoverBackgroundColor:{ref:"rowHoverColor"},buttonActiveBorder:{color:kd}},css:":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)}"}))(),uc=/* @__PURE__ */(()=>Sd({feature:"columnDropStyle",css:".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}"}))(),gc={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"}}},pc=/* @__PURE__ */(()=>Sd({feature:"formulaStyle",params:gc}))(),mc={warn:(...e)=>{Dt(e[0],e[1])},error:(...e)=>{Mt(e[0],e[1])},preInitErr:(...e)=>{Pt(e[0],e[2],e[1])}},fc=/* @__PURE__ */(()=>Sd({feature:"checkboxStyle",params:{checkboxBorderWidth:1,checkboxBorderRadius:{ref:"borderRadius"},checkboxUncheckedBackgroundColor:Id,checkboxUncheckedBorderColor:Td(.3),checkboxCheckedBackgroundColor:kd,checkboxCheckedBorderColor:{ref:"checkboxCheckedBackgroundColor"},checkboxCheckedShapeImage:{svg:''},checkboxCheckedShapeColor:Id,checkboxIndeterminateBackgroundColor:Td(.3),checkboxIndeterminateBorderColor:{ref:"checkboxIndeterminateBackgroundColor"},checkboxIndeterminateShapeImage:{svg:''},checkboxIndeterminateShapeColor:Id,radioCheckedShapeImage:{svg:''}},css:'.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)}}'}))(),Cc=()=>({...Ld,...ac,backgroundColor:"hsl(217, 0%, 17%)",foregroundColor:"#FFF",chromeBackgroundColor:Td(.05),rowHoverColor:Pd(.15),selectedRowBackgroundColor:Pd(.2),menuBackgroundColor:Td(.1),browserColorScheme:"dark",popupShadow:"0 0px 20px #000A",cardShadow:"0 1px 4px 1px #000A",advancedFilterBuilderJoinPillColor:"#7a3a37",advancedFilterBuilderColumnPillColor:"#355f2d",advancedFilterBuilderOptionPillColor:"#5a3168",advancedFilterBuilderValuePillColor:"#374c86",filterPanelApplyButtonColor:Ad,columnPanelApplyButtonColor:Ad,findMatchColor:Id,findActiveMatchColor:Id,checkboxUncheckedBorderColor:Td(.4),toggleButtonOffBackgroundColor:Td(.4),rowBatchEditBackgroundColor:Td(.1),formulaToken1Color:"#4da3e5",formulaToken2Color:"#f55864",formulaToken3Color:"#b688f2",formulaToken4Color:"#24bb4a",formulaToken5Color:"#e772ba",formulaToken6Color:"#f69b5f",formulaToken7Color:"#a3e6ff"}),vc=/* @__PURE__ */(()=>Sd({feature:"colorScheme",params:Ld,modeParams:{light:Ld,dark:Cc(),"dark-blue":{...Cc(),backgroundColor:"#1f2836"}}}))(),wc={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:''},bc={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":''},yc=(e,t=1.5)=>{const o=bc[e];if(o)return o;const s=wc[e];if(!s)throw new Error(`Missing icon data for ${e}`);return``+s+""},Sc=(e={})=>Sd({feature:"iconSet",css:()=>((e={})=>{let t="";for(const o of[...Object.keys(wc),...Object.keys(bc)]){const s=yc(o,e.strokeWidth);t+=`.ag-icon-${o}::before { mask-image: url('data:image/svg+xml,${encodeURIComponent(s)}'); }\n`}return t})(e)}),Rc=/* @__PURE__ */Sc({strokeWidth:1}),xc=/* @__PURE__ */Sc(),Fc={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},Dc=/* @__PURE__ */(()=>Sd({feature:"inputStyle",params:{...Fc,inputBackgroundColor:Id,inputBorder:!0,inputBorderRadius:{ref:"borderRadius"},inputPaddingStart:{ref:"spacing"},inputFocusBorder:{color:kd},inputFocusShadow:{ref:"focusShadow"},inputDisabledBackgroundColor:Td(.06),inputDisabledTextColor:{ref:"textColor",mix:.5},inputInvalidBorder:{color:{ref:"invalidColor"}},pickerButtonBorder:!0,pickerListBorder:!0},css:()=>':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)}}.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)}}}'}))(),Mc={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},Pc=/* @__PURE__ */(()=>Sd({feature:"tabStyle",params:{...Mc,tabBarBorder:!0,tabBarBackgroundColor:Ed(.05),tabTextColor:{ref:"textColor",mix:.7},tabSelectedTextColor:{ref:"textColor"},tabHoverTextColor:{ref:"textColor"},tabSelectedBorderColor:{ref:"borderColor"},tabSelectedBackgroundColor:Id},css:'.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}'}))(),Ec=/* @__PURE__ */(()=>{return(e=mc,new Yd({themeLogger:e,overridePrefix:void 0})).withParams(rc).withPart(hc).withPart(uc).withPart(dc).withPart(pc).withPart(fc).withPart(vc).withPart(xc).withPart(Pc).withPart(Dc).withPart(uc).withParams({fontFamily:[{googleFont:"IBM Plex Sans"},"-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu"]});var e})(),Tc=(e,t,o,s,i)=>({changeKey:e,type:t,defaultValue:o,noWarn:s,cacheDefault:i}),Ic=Tc("cellHorizontalPadding","length",16),Ac=Tc("indentationLevel","length",0,!0,!0),kc=Tc("rowGroupIndentSize","length",0),Lc=Tc("rowHeight","length",42),Gc=Tc("headerHeight","length",48),Nc=Tc("rowBorderWidth","border",1),Bc=Tc("pinnedRowBorderWidth","border",1),Hc=Tc("headerRowBorderWidth","border",1),Oc=class extends He{constructor(){super(...arguments),this.beanName="eventSvc",this.eventServiceType="global",this.globalSvc=new u}addListener(e,t,o){this.globalSvc.addEventListener(e,t,o)}removeListener(e,t,o){this.globalSvc.removeEventListener(e,t,o)}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))}};function Vc(e,t,o){const s=e.visibleCols.headerGroupRowCount;if(o>=s)return{column:t,headerRowIndex:o};let i=t.getParent();for(;i&&i.getProvidedColumnGroup().getLevel()>o;)i=i.getParent();const n=t.isSpanHeaderHeight();return!i||n&&i.isPadding()?{column:t,headerRowIndex:s}:{column:i,headerRowIndex:i.getProvidedColumnGroup().getLevel()}}var zc=/* @__PURE__ */new Set(["gridPreDestroyed","fillStart","pasteStart"]),Wc=["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"].reduce((e,t)=>{var o;return e[t]=!(o=t)||o.length<2?o:"on"+o[0].toUpperCase()+o.substring(1),e},{}),Uc={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 $c(e){return`"${e}"`}var jc={allowFormula:"Formula",aggFunc:"SharedAggregation",autoHeight:"RowAutoHeight",cellClass:"CellStyle",cellClassRules:"CellStyle",cellEditor:({cellEditor:e,editable:t,groupRowEditable:o})=>t||o?"string"==typeof e?Uc[e]??"CustomEditor":"CustomEditor":null,cellRenderer:({cellRenderer:e})=>"string"!=typeof e?null:Uc[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&&"string"!=typeof e&&"boolean"!=typeof e?"CustomFilter":"string"==typeof e?Uc[e]??"ColumnFilter":"ColumnFilter",floatingFilter:"ColumnFilter",getQuickFilterText:"QuickFilter",headerTooltip:"Tooltip",headerTooltipValueGetter:"Tooltip",mainMenuItems:"ColumnMenu",menuTabs:e=>{const t=["columnsMenuTab","generalMenuTab"];return e.menuTabs?.some(e=>t.includes(e))?"ColumnMenu":null},pivot:"SharedPivot",pivotIndex:"SharedPivot",rowDrag:"RowDrag",rowGroup:"SharedRowGrouping",rowGroupIndex:"SharedRowGrouping",tooltipField:"Tooltip",tooltipValueGetter:"Tooltip",tooltipComponentSelector:"Tooltip",spanRows:"CellSpan",groupHierarchy:"SharedRowGrouping"},Kc={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},_c=["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"],qc=["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"],Yc=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector","suppressOverlays"],Zc=["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"],Qc=["theme","rowSelection"],Xc=["cellSelection","sideBar","rowNumbers","suppressGroupChangesColumnVisibility","groupAggFiltering","suppressStickyTotalRow","groupHideParentOfSingleChild","enableRowPinning"],Jc=["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"],eh=["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"];function th(e,t,o){return"number"==typeof t||null==t?null==t||t>=o?null:`${e}: value should be greater than or equal to ${o}`:`${e}: value should be a number`}var oh={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"},sh=()=>{const e={autoSizePadding:{validate:({autoSizePadding:e})=>th("autoSizePadding",e,0)},cacheBlockSize:{supportedRowModels:["serverSide","infinite"],validate:({cacheBlockSize:e})=>th("cacheBlockSize",e,1)},cacheOverflowSize:{validate:({cacheOverflowSize:e})=>th("cacheOverflowSize",e,1)},datasource:{supportedRowModels:["infinite"]},domLayout:{validate:e=>{const t=e.domLayout,o=["autoHeight","normal","print"];return t&&!o.includes(t)?`domLayout must be one of [${o.join()}], currently it's ${t}`: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:e,pinnedTopRowData:t,pinnedBottomRowData:o})=>e&&(t||o)?"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:e,isRowPinnable:t,pinnedTopRowData:o,pinnedBottomRowData:s})=>t&&(o||s)?"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinnable`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.":!e&&t?"`isRowPinnable` requires `enableRowPinning` to be set.":null},isRowPinned:{supportedRowModels:["clientSide"],validate:({enableRowPinning:e,isRowPinned:t,pinnedTopRowData:o,pinnedBottomRowData:s})=>t&&(o||s)?"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinned`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.":!e&&t?"`isRowPinned` requires `enableRowPinning` to be set.":null},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupHideColumnsUntilExpanded:{supportedRowModels:["clientSide"],validate:({groupHideColumnsUntilExpanded:e,groupHideOpenParents:t,groupDisplayType:o})=>e&&!t&&"multipleColumns"!==o?"`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:e={}},t,o){for(const s of Object.keys(e))o.validation?.validateColDef(e[s]);return null}},icons:{validate:({icons:e})=>{if(e){if(e.smallDown)return Et(262);if(e.smallLeft)return Et(263);if(e.smallRight)return Et(264)}return null}},infiniteInitialRowCount:{validate:({infiniteInitialRowCount:e})=>th("infiniteInitialRowCount",e,1)},initialGroupOrderComparator:{supportedRowModels:["clientSide"]},ssrmExpandAllAffectsAllRows:{validate:e=>{if("boolean"==typeof e.ssrmExpandAllAffectsAllRows){if("serverSide"!==e.rowModelType)return"'ssrmExpandAllAffectsAllRows' is only supported with the Server Side Row Model.";if(e.ssrmExpandAllAffectsAllRows&&"function"!=typeof e.getRowId)return"'getRowId' callback must be provided for Server Side Row Model grouping to work correctly."}return null}},keepDetailRowsCount:{validate:({keepDetailRowsCount:e})=>th("keepDetailRowsCount",e,1)},paginationPageSize:{validate:({paginationPageSize:e})=>th("paginationPageSize",e,1)},paginationPageSizeSelector:{validate:e=>{const t=e.paginationPageSizeSelector;return"boolean"==typeof t||null==t||t.length?null:"'paginationPageSizeSelector' cannot be an empty array.\n 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:e})=>th("rowBuffer",e,0)},rowClass:{validate:e=>"function"==typeof e.rowClass?"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:e})=>e&&"string"==typeof e?'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.':e&&"object"!=typeof e?"Expected `RowSelectionOptions` object for the `rowSelection` property.":e&&"multiRow"!==e.mode&&"singleRow"!==e.mode?`Selection mode "${e.mode}" is invalid. Use one of 'singleRow' or 'multiRow'.`:null},rowStyle:{validate:e=>{const t=e.rowStyle;return t&&"function"==typeof t?"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:e})=>th("serverSideInitialRowCount",e,1)},serverSideOnlyRefreshFilteredGroups:{supportedRowModels:["serverSide"]},serverSideSortAllLevels:{supportedRowModels:["serverSide"]},sortingOrder:{validate:e=>{const t=e.sortingOrder;if(Array.isArray(t)&&t.length>0){const e=t.filter(e=>!Do(e));if(e.length>0)return`sortingOrder must be an array of type (SortDirection | SortDef)[], incorrect items are: ${e.map(e=>"string"==typeof e||null==e?St(e):JSON.stringify(e))}]`}else if(!Array.isArray(t)||!t.length)return`sortingOrder must be an array with at least one element, currently it's ${t}`;return null}},tooltipHideDelay:{validate:e=>e.tooltipHideDelay&&e.tooltipHideDelay<0?"tooltipHideDelay should not be lower than 0":null},tooltipShowDelay:{validate:e=>e.tooltipShowDelay&&e.tooltipShowDelay<0?"tooltipShowDelay should not be lower than 0":null},tooltipSwitchShowDelay:{validate:e=>e.tooltipSwitchShowDelay&&e.tooltipSwitchShowDelay<0?"tooltipSwitchShowDelay should not be lower than 0":null},treeData:{supportedRowModels:["clientSide","serverSide"],validate:e=>{const t=e.rowModelType??"clientSide";switch(t){case"clientSide":{const{treeDataChildrenField:t,treeDataParentIdField:o,getDataPath:s,getRowId:i}=e;if(!t&&!o&&!s)return"treeData requires either 'treeDataChildrenField' or 'treeDataParentIdField' or 'getDataPath' in the clientSide row model.";if(t){if(s)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(!i)return"getRowId callback not provided, tree data with parent id cannot be built.";if(s)return"Cannot use both 'treeDataParentIdField' and 'getDataPath' at the same time."}return null}case"serverSide":{const o=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${t} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:o}}return null}},viewportDatasource:{supportedRowModels:["viewport"]},viewportRowModelBufferSize:{validate:({viewportRowModelBufferSize:e})=>th("viewportRowModelBufferSize",e,0)},viewportRowModelPageSize:{validate:({viewportRowModelPageSize:e})=>th("viewportRowModelPageSize",e,1)},rowDragEntireRow:{dependencies:{cellSelection:{required:[void 0]}}},autoGroupColumnDef:{validate:({autoGroupColumnDef:e,showOpenedGroup:t})=>e?.field&&t?"autoGroupColumnDef.field and showOpenedGroup are not supported when used together.":e?.valueGetter&&t?"autoGroupColumnDef.valueGetter and showOpenedGroup are not supported when used together.":null},renderingMode:{validate:e=>{const t=e.renderingMode,o=["default","legacy"];return t&&!o.includes(t)?`renderingMode must be one of [${o.join()}], currently it's ${t}`:null}},autoSizeStrategy:{validate:({autoSizeStrategy:e})=>{if(!e)return null;const t=e.type;return"fitCellContents"!==t&&"fitGridWidth"!==t&&"fitProvidedWidth"!==t?`Invalid Auto-size strategy. \`autoSizeStrategy\` must be one of ${["fitCellContents","fitGridWidth","fitProvidedWidth"].map(e=>'"'+e+'"').join(", ")}, currently it's ${t}`:"fitProvidedWidth"===t&&"number"!=typeof e.width?`When using the 'fitProvidedWidth' auto-size strategy, must provide a numeric \`width\`. You provided ${e.width}`:null}}},t={};for(const o of Jc)t[o]={expectedType:"boolean"};for(const o of Zc)t[o]={expectedType:"number"};return Ye(t,e),t},ih=0,nh=0,rh="__ag_grid_instance",lh=class extends Oe{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:o,gos:s}=this.beans;if(no(s)&&!e.altKey)o?.handleColumnSelection(this.column,e);else if(this.column.isSortable()){const o=this.column.isMoving(),s=Date.now()-this.lastMovingChanged<50;o||s||t?.progressSortFromEvent(this.column,e)}}},ah=class extends Oe{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:o}=t;o.whenReady(this,()=>{const t=this.refreshPosition.bind(this);null==e.getPinned()&&this.addManagedEventListeners({bodyScroll:e=>{"horizontal"===e.direction&&this.updateSticky(e.left)}}),this.addManagedListeners(e,{leftChanged:t,displayedChildrenChanged:t}),this.addManagedEventListeners({columnResized:t}),this.refreshPosition()})}refreshPosition(){const{columnGroup:e,beans:t}=this,o=e.getLeft(),s=e.getActualWidth();if(null==o||0===s)return this.left=null,this.right=null,void this.setSticky(!1);this.left=o,this.right=o+s;const i=t.colViewport.getScrollPosition();null!=i&&this.updateSticky(i)}updateSticky(e){const{beans:t,left:o,right:s}=this;if(null==o||null==s)return void this.setSticky(!1);const{gos:i,visibleCols:n}=t,r=i.get("enableRtl")?n.bodyWidth-e:e;this.setSticky(or)}setSticky(e){const{isSticky:t,eLabel:o}=this;t!==e&&(this.isSticky=e,o.classList.toggle("ag-sticky-label",e))}},dh={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"}]},ch={moduleName:"ColumnHeaderComp",version:mt,userComponents:{agColumnHeader:class extends Pi{constructor(){super(...arguments),this.eFilter=null,this.eFilterButton=null,this.eSortIndicator=null,this.eMenu=null,this.eLabel=null,this.eText=null,this.eColRef=null,this.eSortOrder=null,this.eSortAsc=null,this.eSortDesc=null,this.eSortMixed=null,this.eSortNone=null,this.eSortAbsoluteAsc=null,this.eSortAbsoluteDesc=null,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||null!=this.currentSuppressMenuHide&&this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||t.enableFilterButton!=e.enableFilterButton||t.enableFilterIcon!=e.enableFilterIcon)return!1;if(this.innerHeaderComponent){const t={...e};Ye(t,e.innerHeaderComponentParams),this.innerHeaderComponent.refresh?.(t)}else this.setDisplayName(e);return!0}workOutTemplate(e,t){const{formula:o}=this.beans,s=e.template;return s?s?.trim?s.trim():s:function(e,t){const o={"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:o},{tag:"span",ref:"eFilterButton",cls:"ag-header-icon ag-header-cell-filter-button",attrs:o},{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:o},t?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:null]}]}}(!!o?.active,t)}init(e){this.params=e;const{sortSvc:t,touchSvc:o,rowNumbersSvc:s,userCompFactory:i}=this.beans,n=t?.getSortIndicatorSelector();this.currentTemplate=this.workOutTemplate(e,!!n),this.setTemplate(this.currentTemplate,n?[n]:void 0),this.eLabel&&(this.mouseListener??(this.mouseListener=this.createManagedBean(new lh(e.column,this.eLabel)))),o?.setupForHeader(this),this.setMenu(),this.setupSort(),this.setupColumnRefIndicator(),s?.setupForHeader(this),this.setupFilterIcon(),this.setupFilterButton(),this.workOutInnerHeaderComponent(i,e),this.setDisplayName(e)}workOutInnerHeaderComponent(e,t){const o=function(e,t,o){return e.getCompDetails(t,Ws,void 0,o)}(e,t,t);o&&(this.isLoadingInnerComponent=!0,o.newAgStackInstance().then(e=>{this.isLoadingInnerComponent=!1,e&&(this.isAlive()?(this.innerHeaderComponent=e,this.eText&&this.eText.appendChild(e.getGui())):this.destroyBean(e))}))}setDisplayName(e){const{displayName:t}=e,o=this.currentDisplayName;this.currentDisplayName=t,!this.eText||o===t||this.innerHeaderComponent||this.isLoadingInnerComponent||(this.eText.textContent=m(t))}addInIcon(e,t,o){const s=Ol(e,this.beans,o);s&&t.appendChild(s)}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)return ie(this.eMenu),void(this.eMenu=void 0);const{gos:e,eMenu:t,params:o}=this,s=mo(e);this.addInIcon(s?"menu":"menuAlt",t,o.column),t.classList.toggle("ag-header-menu-icon",!s);const i=this.shouldSuppressMenuHide();this.currentSuppressMenuHide=i,this.addManagedElementListeners(t,{click:()=>this.showColumnMenu(this.eMenu)}),this.toggleMenuAlwaysShow(i)}toggleMenuAlwaysShow(e){this.eMenu?.classList.toggle("ag-header-menu-always-show",e)}showColumnMenu(e){const{currentSuppressMenuHide:t,params:o}=this;t||this.toggleMenuAlwaysShow(!0),o.showColumnMenu(e,()=>{t||this.toggleMenuAlwaysShow(!1)})}onMenuKeyboardShortcut(e){const{params:t,gos:o,beans:s,eMenu:i,eFilterButton:n}=this,r=t.column,l=mo(o);if(e&&!l){if(s.menuSvc?.isFilterMenuInHeaderEnabled(r))return t.showFilter(n??i??this.getGui()),!0}else if(t.enableMenu)return this.showColumnMenu(i??n??this.getGui()),!0;return!1}setupSort(){const{sortSvc:e}=this.beans;if(!e)return;const{enableSorting:t,column:o}=this.params;if(this.currentSort=t,!this.eSortIndicator){this.eSortIndicator=this.createBean(e.createSortIndicator(!0));const{eSortIndicator:t,eSortOrder:o,eSortAsc:s,eSortDesc:i,eSortMixed:n,eSortNone:r,eSortAbsoluteAsc:l,eSortAbsoluteDesc:a}=this;t.attachCustomElements(o,s,i,n,r,l,a)}this.eSortIndicator.setupSort(o),this.currentSort&&e.setupHeader(this,o)}setupColumnRefIndicator(){const{eColRef:e,beans:{editModelSvc:t},params:o}=this;e&&(this.currentRef=o.column.formulaRef,e.textContent=this.currentRef,K(e,!1),this.addManagedEventListeners({cellEditingStarted:()=>{const o=t?.getEditPositions();K(e,!!this.currentRef&&!!o?.some(e=>e.column.isAllowFormula()))},cellEditingStopped:()=>{K(e,!1)}}))}setupFilterIcon(){const{eFilter:e,params:t}=this;e&&this.configureFilter(t.enableFilterIcon,e,()=>{K(e,t.column.isFilterActive(),{skipAriaHidden:!0})},"filterActive")}setupFilterButton(){const{eFilterButton:e,params:t}=this;e&&(this.configureFilter(t.enableFilterButton,e,this.onFilterChangedButton.bind(this),"filter")?this.addManagedElementListeners(e,{click:()=>t.showFilter(e)}):this.eFilterButton=void 0)}configureFilter(e,t,o,s){if(!e)return ie(t),!1;const i=this.params.column;return this.addInIcon(s,t,i),this.addManagedListeners(i,{filterChanged:o}),o(),!0}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){const{eFilterButton:t,eMenu:o}=this;return e?t??o??this.getGui():o??t??this.getGui()}destroy(){super.destroy(),this.innerHeaderComponent=this.destroyBean(this.innerHeaderComponent),this.mouseListener=this.destroyBean(this.mouseListener)}}},icons:{menu:"menu",menuAlt:"menu-alt"}},hh={moduleName:"ColumnGroupHeaderComp",version:mt,userComponents:{agColumnGroupHeader:class extends Pi{constructor(){super(dh),this.agOpened=null,this.agClosed=null,this.agLabel=null,this.isLoadingInnerComponent=!1}init(e){const{userCompFactory:t,touchSvc:o}=this.beans;this.params=e,this.checkWarnings(),this.workOutInnerHeaderGroupComponent(t,e),this.setupLabel(e),this.addGroupExpandIcon(e),this.setupExpandIcons(),o?.setupForHeaderGroup(this)}checkWarnings(){this.params.template&&Dt(89)}workOutInnerHeaderGroupComponent(e,t){const o=function(e,t,o){return e.getCompDetails(t,Us,void 0,o)}(e,t,t);o&&(this.isLoadingInnerComponent=!0,o.newAgStackInstance().then(e=>{this.isLoadingInnerComponent=!1,e&&(this.isAlive()?(this.innerHeaderGroupComponent=e,this.agLabel.appendChild(e.getGui())):this.destroyBean(e))}))}setupExpandIcons(){const{agOpened:e,agClosed:t,params:{columnGroup:o},beans:{colGroupSvc:s}}=this;this.addInIcon("columnGroupOpened",e),this.addInIcon("columnGroupClosed",t);const i=e=>{if(Yi(e))return;const t=!o.isExpanded();s.setColumnGroupOpened(o.getProvidedColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(t,i),this.addTouchAndClickListeners(e,i);const n=e=>{qi(e)};this.addManagedElementListeners(t,{dblclick:n}),this.addManagedElementListeners(e,{dblclick:n}),this.addManagedElementListeners(this.getGui(),{dblclick:i}),this.updateIconVisibility();const r=o.getProvidedColumnGroup(),l=this.updateIconVisibility.bind(this);this.addManagedListeners(r,{expandedChanged:l,expandableChanged:l})}addTouchAndClickListeners(e,t){this.beans.touchSvc?.setupForHeaderGroupElement(this,e,t),this.addManagedElementListeners(e,{click:t})}updateIconVisibility(){const{agOpened:e,agClosed:t,params:{columnGroup:o}}=this;if(o.isExpandable()){const s=o.isExpanded();K(e,s),K(t,!s)}else K(e,!1),K(t,!1)}addInIcon(e,t){const o=Ol(e,this.beans,null);o&&t.appendChild(o)}addGroupExpandIcon(e){if(!e.columnGroup.isExpandable()){const{agOpened:e,agClosed:t}=this;K(e,!1),K(t,!1)}}setupLabel(e){const{displayName:t,columnGroup:o}=e,{innerHeaderGroupComponent:s,isLoadingInnerComponent:i}=this,n=s||i;l(t)&&!n&&(this.agLabel.textContent=m(t)),o.getColGroupDef()?.suppressStickyLabel||this.createManagedBean(new ah(this.getGui(),o))}destroy(){super.destroy(),this.innerHeaderGroupComponent&&(this.destroyBean(this.innerHeaderGroupComponent),this.innerHeaderGroupComponent=void 0)}}},icons:{columnGroupOpened:"expanded",columnGroupClosed:"contracted"}},uh={moduleName:"AnimationFrame",version:mt,beans:[class extends Oe{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,0===e&&(this.scrollGoingDown=!0),this.lastScrollTop=e}postConstruct(){this.active=!this.gos.get("suppressAnimationFrame"),this.batchFrameworkComps=this.beans.frameworkOverrides.batchFrameworkComps}verify(){!1===this.active&&Dt(92)}createTask(e,t,o,s,i=!1){this.verify();let n=o;s&&this.batchFrameworkComps&&(n="f1");const r={task:e,index:t,createOrder:++this.taskCount,deferred:i};this.addTaskToList(this[n],r),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((e,o)=>e.deferred!==o.deferred?e.deferred?-1:1:e.index!==o.index?t*(o.index-e.index):o.createOrder-e.createOrder),e.sorted=!0}addDestroyTask(e){this.verify(),this.destroyTasks.push(e),this.schedule()}executeFrame(e){const{p1:t,p2:o,f1:s,destroyTasks:i,beans:n}=this,{ctrlsSvc:r,frameworkOverrides:l}=n,a=t.list,d=o.list,c=s.list,h=Date.now();let u=0;const g=e<=0,p=r.getScrollFeature();for(;g||u{for(;(g||u{};else{if(!i.length)break;n=i.pop()}n()}u=Date.now()-h}a.length||d.length||c.length||i.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);be(this.beans,e)}isQueueEmpty(){return!this.ticking}}]},gh={moduleName:"Touch",version:mt,beans:[class extends Oe{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){Ai()&&this.mockContextMenu(e,e.element,(t,o,s)=>{const{rowCtrl:i,cellCtrl:n}=e.getControlsForEventTarget(s?.target??null);n?.column&&n.dispatchCellContextMenuEvent(s??null),this.beans.contextMenuSvc?.handleContextMenuMouseEvent(void 0,s,i,n)})}handleCellDoubleClick(e,t){return!!(()=>{if(!Ai()||Pe("dblclick"))return!1;const t=Date.now(),o=t-e.lastIPadMouseClickEvent<200;return e.lastIPadMouseClickEvent=t,o})()&&(e.onCellDoubleClicked(t),t.preventDefault(),!0)}setupForHeader(e){const{gos:t,sortSvc:o,menuSvc:s}=this.beans;if(t.get("suppressTouch"))return;const{params:i,eMenu:n,eFilterButton:r}=e,a=new hn(e.getGui(),!0);e.addDestroyFunc(()=>a.destroy());const d=e.shouldSuppressMenuHide(),c=d&&l(n)&&i.enableMenu,h=!!s?.isHeaderContextMenuEnabled(i.column),u=((e,t,o)=>t||e&&o)(i.enableMenu,h,mo(t));let g=a;c&&(g=new hn(n,!0),e.addDestroyFunc(()=>g.destroy()));const p=e=>i.showColumnMenuAfterMouseClick(e.touchStart);if(c&&i.enableMenu&&e.addManagedListeners(g,{tap:p}),u&&e.addManagedListeners(a,{longTap:p}),i.enableSorting){const t=e=>{const t=e.touchStart.target;d&&(n?.contains(t)||r?.contains(t))||o?.progressSort(i.column,!1,"uiColumnSorted")};e.addManagedListeners(a,{tap:t})}if(i.enableFilterButton&&r){const t=new hn(r,!0);e.addManagedListeners(t,{tap:()=>i.showFilter(r)}),e.addDestroyFunc(()=>t.destroy())}}setupForHeaderGroup(e){const t=e.params;if(this.beans.menuSvc?.isHeaderContextMenuEnabled(t.columnGroup.getProvidedColumnGroup())){const o=new hn(t.eGridHeader,!0),s=e=>t.showColumnMenuAfterMouseClick(e.touchStart);e.addManagedListeners(o,{longTap:s}),e.addDestroyFunc(()=>o.destroy())}}setupForHeaderGroupElement(e,t,o){const s=new hn(t,!0);e.addManagedListeners(s,{tap:o}),e.addDestroyFunc(()=>s.destroy())}mockContextMenu(e,t,o){if(!Ai())return;const s=new hn(t);e.addManagedListeners(s,{longTap:e=>{Ae(this.beans,e.touchEvent)&&o(void 0,e.touchStart,e.touchEvent)}}),e.addDestroyFunc(()=>s.destroy())}}]};function ph(e){const t=e;return null!=t?.getFrameworkComponentInstance?t.getFrameworkComponentInstance():e}var mh=class{constructor(){this.cellValidations=/* @__PURE__ */new Map}getCellValidation(e){const{rowNode:t,column:o}=e||{};return this.cellValidations?.get(t)?.get(o)}hasCellValidation(e){return e?.rowNode&&e.column?!!this.getCellValidation(e):this.cellValidations.size>0}setCellValidation(e,t){const{rowNode:o,column:s}=e;this.cellValidations.has(o)||this.cellValidations.set(o,/* @__PURE__ */new Map),this.cellValidations.get(o).set(s,t)}clearCellValidation(e){const{rowNode:t,column:o}=e;this.cellValidations.get(t)?.delete(o)}setCellValidationMap(e){this.cellValidations=e}getCellValidationMap(){return this.cellValidations}clearCellValidationMap(){this.cellValidations.clear()}},fh=class{constructor(){this.rowValidations=/* @__PURE__ */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 Ch(e,t={}){const{rowIndex:o,rowId:s,rowCtrl:i,rowPinned:n}=t;if(i)return i;const{rowModel:r,rowRenderer:l}=e;let{rowNode:a}=t;return a||(s?a=function(e,t,o){const{rowModel:s,pinnedRowModel:i}=e;let n;return n??(n=s?.getRowNode(t)),o?n??(n=i?.getPinnedRowById(t,o)):(n??(n=i?.getPinnedRowById(t,"top")),n??(n=i?.getPinnedRowById(t,"bottom"))),n}(e,s,n):null!=o&&(a=r.getRow(o))),a?l.getRowCtrlByNode(a):void 0}function vh(e,t={}){const{cellCtrl:o,colId:s,columnId:i,column:n}=t;if(o)return o;const r=e.colModel.getCol(s??i??bh(n)),l=t.rowCtrl??Ch(e,t),a=l?.getCellCtrl(r)??void 0;if(a)return a;const d=t.rowNode??l?.rowNode;return d?e.rowRenderer.getCellCtrls([d],[r])?.[0]:void 0}function wh(e){const{editSvc:t}=e;t?.isBatchEditing()?(Ph(e,{persist:!0}),Ih(e)):t?.stopEditing(void 0,{source:"api"})}function bh(e){if(e)return"string"==typeof e?e:e.getColId()}var yh=Symbol("unedited");function Sh({pendingValue:e,sourceValue:t}){return e===yh&&(e=t),e!==t}function Rh(e,t,o){const{key:s,event:i,cellStartedEdit:n,silent:r}=o??{},{editModelSvc:l,gos:a,userCompFactory:d}=e,c=vh(e,t),h=c?.comp?.getCellEditor(),u=Fh(e,t,s,n&&!r),g=l?.getEdit(t),p=u.value??g?.sourceValue;if(h)return l?.setEdit(t,{editorValue:Th(e,p,!0,t.column),state:"editing"}),void h.refresh?.(u);const m=t.column.getColDef(),f=ni(d,m,u);if(!f)return;const{popupFromSelector:C,popupPositionFromSelector:v}=f,w=C??!!m.cellEditorPopup,b=v??m.cellEditorPopupPosition;if(Mh(f.params,i),!c)return;const{rangeFeature:y,rowCtrl:S,comp:R,onEditorAttachedFuncs:x}=c;l?.setEdit(t,{editorValue:Th(e,p,!0,t.column),state:"editing",editorState:{cellStartedEditing:void 0,cellStoppedEditing:void 0}}),c.editCompDetails=f,x.push(()=>y?.unsetComp()),R?.setEditDetails(f,w,b,a.get("reactiveCustomComponents")),S?.refreshRow({suppressFlash:!0}),function(e,t,o,s,i){const{editSvc:n,editModelSvc:r}=e,l=r?.getEdit(t);i||"editing"!==l?.state||l?.editorState?.cellStartedEditing||(n?.dispatchCellEvent(t,o,"cellEditingStarted",{value:s}),r?.setEdit(t,{editorState:{cellStartedEditing:!0}}))}(e,t,i,p,r)}function xh(e,t,o){const s={editorValueExists:!1};if(Gh(e)&&((t.getValidationErrors?.())?.length??0)>0)return s;if(o?.isCancelling)return s;if(o?.isStopping){const e=t?.isCancelAfterEnd?.();if(e)return{...s,isCancelAfterEnd:e}}return{editorValue:t.getValue(),editorValueExists:!0}}function Fh(e,t,o,s){const{valueSvc:i,gos:n,editSvc:r}=e,l=e.gos.get("enableGroupEdit"),a=vh(e,t),d=t.rowNode?.rowIndex??void 0,c=r?.isBatchEditing(),h=e.colModel.getCol(t.column.getId()),{rowNode:u,column:g}=t,p=a.comp?.getCellEditor(),m=r?.getCellDataValue(t),f=void 0===m?p?xh(e,p)?.editorValue:void 0:m,C=f===yh?i.getValueForDisplay({column:h,node:u,from:"edit"})?.value:f;let v=l?f:C;return g.isAllowFormula()&&e.formula?.isFormula(v)&&(v=e.formula?.normaliseFormula(v,!0)??v),Co(n,{value:v,eventKey:o??null,column:g,colDef:g.getColDef(),rowIndex:d,node:u,data:u.data,cellStartedEdit:!!s,onKeyDown:a?.onKeyDown.bind(a),stopEditing:o=>{r.stopEditing(t,{source:c?"ui":"api",suppressNavigateAfterEdit:o}),Ah(e,t,{})},eGridCell:a?.eGui,parseValue:e=>i.parseValue(h,u,e,a?.value),formatValue:a?.formatValue.bind(a),validate:()=>{r?.validateEdit()}})}function Dh(e,t){const{editModelSvc:o}=e;o?.getEditMap().forEach((e,s)=>{e.forEach((e,i)=>{(t||"editing"!==e.state&&e.pendingValue!==yh)&&(Sh(e)||"editing"===e.state&&!t||o?.removeEdits({rowNode:s,column:i}))})})}function Mh(e,t){return t instanceof KeyboardEvent&&"agNumberCellEditor"===e.column.getColDef().cellEditor?e.suppressPreventDefault=["-","+",".","e"].includes(t?.key??"")||e.suppressPreventDefault:t?.preventDefault?.(),e}function Ph(e,t){for(const o of e.editModelSvc?.getEditPositions()??[]){const s=vh(e,o);if(!s)continue;const i=s.comp?.getCellEditor();if(!i)continue;const{editorValue:n,editorValueExists:r,isCancelAfterEnd:l}=xh(e,i,t);if(l){const{cellStartedEditing:t,cellStoppedEditing:s}=e.editModelSvc?.getEdit(o)?.editorState||{};e.editModelSvc?.setEdit(o,{editorState:{isCancelAfterEnd:l,cellStartedEditing:t,cellStoppedEditing:s}})}Eh(e,o,n,0,!r,t)}}function Eh(e,t,o,s,i,n){const{editModelSvc:r,valueSvc:l}=e;if(!r)return;const{rowNode:a,column:d}=t;if(!a||!d)return;let c=r.getEdit(t);if(void 0===c?.sourceValue){const o=c?Th(e,c.editorValue,!1,d):yh,s={sourceValue:l.getValue(d,a,"data"),pendingValue:o};n?.persist&&(s.state="changed"),c=r.setEdit(t,s)}r.setEdit(t,{editorValue:i?Th(e,c.sourceValue,!0,d):o}),n?.persist&&function(e,t){const{editModelSvc:o}=e,s=o?.getEdit(t),i={pendingValue:Th(e,s?.editorValue,!1,t.column)};s?.editorState?.cellStoppedEditing||"editing"===s?.state||(i.state="changed"),o?.setEdit(t,i)}(e,t)}function Th(e,t,o,s){const{formula:i}=e;return s.isAllowFormula()&&i?.isFormula(t)?i?.normaliseFormula(t,o)??t:t}function Ih(e,t,o={}){if(t||(t=e.editModelSvc?.getEditPositions()),t)for(const s of t)Ah(e,s,o)}function Ah(e,t,o,s=vh(e,t)){const i=e.editModelSvc,n=i?.getEdit(t);let r;if(r=n&&"editing"!==n.state&&n.editorState?.cellStoppedEditing?n.state:"changed",!s)return void(n&&i?.setEdit(t,{state:r}));const l=s.comp,a=l?.getCellEditor();if(l&&!a)return s?.refreshCell(),void(n&&(i?.setEdit(t,{state:r}),Lh(e,t,e.gos.get("enableGroupEdit")?kh(n,o?.cancel):{valueChanged:!1,newValue:void 0,oldValue:n.sourceValue},o)));if(Gh(e)){const e=n&&a?.getValidationErrors?.(),o=i?.getCellValidationModel();e?.length?o?.setCellValidation(t,{errorMessages:e}):o?.clearCellValidation(t)}n&&i?.setEdit(t,{state:r}),l?.setEditDetails(),l?.refreshEditStyles(!1,!1),s?.refreshCell({force:!0,suppressFlash:!0});const d=i?.getEdit(t);if(d&&"editing"!==d.state){const s=o?.cancel;Lh(e,t,e.gos.get("enableGroupEdit")?kh(d,s):function(e,t,o){if(o||e.editorState.isCancelAfterEnd)return{valueChanged:!1,newValue:void 0,oldValue:e.sourceValue};let s=e.editorValue;return null!=s&&s!==yh||(s=t?.pendingValue),s===yh&&(s=void 0),{valueChanged:Sh(e),newValue:s,oldValue:e.sourceValue}}(d,n,s),o)}}function kh(e,t){const{sourceValue:o,pendingValue:s}=e;let i;return t||s===yh||(i=s),{valueChanged:!t&&Sh(e),newValue:i,oldValue:o,value:o}}function Lh(e,t,o,{silent:s,event:i}={}){const{editSvc:n,editModelSvc:r}=e,{editorState:l}=r?.getEdit(t)||{},{isCancelBeforeStart:a,cellStartedEditing:d,cellStoppedEditing:c}=l||{};s||a||!d||c||(n?.dispatchCellEvent(t,i,"cellEditingStopped",o),r?.setEdit(t,{editorState:{cellStoppedEditing:!0}}))}function Gh(e){return!!e.gos.get("getFullRowEditValidationErrors")||function(e){if(!e)return!1;for(let t=0,o=e.length;t0,t=e?r.join(". "):"";k(l,e),e&&s.announceValue(`${a} ${r}`,"editorValidation"),l instanceof HTMLInputElement?l.setCustomValidity(t):l.classList.toggle("invalid",e)}r?.length>0&&o.setCellValidation({rowNode:i,column:n},{errorMessages:r}),d.add(c.rowCtrl)}if(Ph(e,{persist:!1}),n?.setCellValidationModel(o),l){const t=Bh(e);n?.setRowValidationModel(t)}for(const c of d.values()){c.rowEditStyleFeature?.applyRowStyles();for(const e of c.getAllCellCtrls())e.tooltipFeature?.refreshTooltip(!0),e.editorTooltipFeature?.refreshTooltip(!0),e.editStyleFeature?.applyCellStyles?.()}}var Bh=e=>{const t=new fh,o=e.gos.get("getFullRowEditValidationErrors"),s=e.editModelSvc?.getEditMap();if(!s)return t;for(const i of s.keys()){const e=s.get(i);if(!e)continue;const n=[],{rowIndex:r,rowPinned:l}=i;for(const t of e.keys()){const o=e.get(t);if(!o)continue;const{editorValue:s,pendingValue:i,sourceValue:a}=o,d=s??(i===yh?void 0:i)??a;n.push({column:t,colId:t.getColId(),rowIndex:r,rowPinned:l,oldValue:a,newValue:d})}const a=o?.({editorsState:n})??[];a.length>0&&t.setRowValidation({rowNode:i},{errorMessages:a})}return t};function Hh(e){return!(!e.rowPinned||!e.pinnedSibling)}function Oh(e,t,o,s){const i="top"===t;if(!o)return Oh(e,t,i?e.getPinnedTopRow(0):e.getPinnedBottomRow(0),s);if(!s){const s=i?e.getPinnedTopRowCount():e.getPinnedBottomRowCount();return Oh(e,t,o,i?e.getPinnedTopRow(s-1):e.getPinnedBottomRow(s-1))}let n=!1,r=!1;const l=[];return e.forEachPinnedRow(t,e=>e!==o||n?n&&e===s?(r=!0,void l.push(e)):void(n&&!r&&l.push(e)):(n=!0,void l.push(e))),l}var Vh=class extends Oe{constructor(e,t,o,s){super(),this.cellCtrl=e,this.rowNode=o,this.rowCtrl=s,this.beans=t}init(){this.eGui=this.cellCtrl.eGui}onKeyDown(e){const t=e.key;if(t!==fs||!os(this.cellCtrl.column)||!this.beans.rowNumbersSvc?.handleKeyDownOnCell(this.cellCtrl.cellPosition,e))switch(t){case fs:this.onEnterKeyDown(e);break;case xs:this.onF2KeyDown(e);break;case Cs:this.onEscapeKeyDown(e);break;case ms:this.onTabKeyDown(e);break;case ps:case Rs:this.onBackspaceOrDeleteKeyDown(t,e);break;case Ss:case bs:case ys:case ws:this.onNavigationKeyDown(e,t)}}onNavigationKeyDown(e,t){const{cellCtrl:o,beans:s}=this;if(!s.editSvc?.isEditing(o,{withOpenEditor:!0})){if(e.shiftKey&&o.isRangeSelectionEnabled())this.onShiftRangeSelect(e);else{const i=o.getFocusedCellPosition();s.navigation?.navigateToNextCell(e,t,i,!0)}e.preventDefault()}}onShiftRangeSelect(e){const{rangeSvc:t,navigation:o}=this.beans;if(!t)return;const s=t.extendLatestRangeInDirection(e);s&&(e.key===ws||e.key===ys?o?.ensureColumnVisible(s.column):o?.ensureRowVisible(s.rowIndex))}onTabKeyDown(e){this.beans.navigation?.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:o,beans:s,rowNode:i}=this,{gos:n,rangeSvc:r,eventSvc:l,editSvc:a}=s;if(l.dispatchEvent({type:"keyShortcutChangedCellStart"}),function(e,t=!1){return e===Rs||!t&&e===ps&&Ii()}(e,n.get("enableCellEditingOnBackspace"))&&!a?.isEditing(o,{withOpenEditor:!0})){if(r&&so(n))r.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(o.isCellEditable()){const e=s.valueSvc.getDeleteValue(o.column,i);i.setDataValue(o.column,e,"cellClear")}}else a?.isEditing(o,{withOpenEditor:!0})||s.editSvc?.startEditing(o,{startedEdit:!0,event:t});l.dispatchEvent({type:"keyShortcutChangedCellEnd"})}onEnterKeyDown(e){const{cellCtrl:t,beans:o}=this,{editSvc:s,navigation:i}=o,n=s?.isEditing(t,{withOpenEditor:!0}),r=t.rowNode,l=s?.isRowEditing(r,{withOpenEditor:!0}),a=t=>{s?.startEditing(t,{startedEdit:!0,event:e,source:"edit"})&&e.preventDefault()};if(n||l){if(this.isCtrlEnter(e))return void s?.applyBulkEdit(t,o?.rangeSvc?.getCellRanges()||[]);if(Nh(o),"block-stop"===s?.checkNavWithValidation(void 0,e))return;s?.isEditing(t,{withOpenEditor:!0})?s?.stopEditing(t,{event:e,source:"edit"}):l&&!t.isCellEditable()?s?.stopEditing({rowNode:r},{event:e,source:"edit"}):a(t)}else if(o.gos.get("enterNavigatesVertically")){const o=e.shiftKey?bs:Ss;i?.navigateToNextCell(null,o,t.cellPosition,!1)}else{if(s?.hasValidationErrors())return;s?.hasValidationErrors(t)&&s.revertSingleCellEdit(t,!0),a(t)}}isCtrlEnter(e){return(e.ctrlKey||e.metaKey)&&e.key===fs}onF2KeyDown(e){const{cellCtrl:t,beans:{editSvc:o}}=this;o?.isEditing()&&(Nh(this.beans),"block-stop"===o?.checkNavWithValidation(void 0,e))||o?.startEditing(t,{startedEdit:!0,event:e})}onEscapeKeyDown(e){const{cellCtrl:t,beans:{editSvc:o}}=this;"block-stop"===o?.checkNavWithValidation(t,e)&&o.revertSingleCellEdit(t),setTimeout(()=>{o?.stopEditing(t,{event:e,cancel:!0})})}processCharacter(e){const t=e.target!==this.eGui,{beans:{editSvc:o},cellCtrl:s}=this;if(!t&&!o?.isEditing(s,{withOpenEditor:!0}))if(e.key===vs)this.onSpaceKeyDown(e);else if(o?.isCellEditable(s,"ui")){if(o?.hasValidationErrors()&&!o?.hasValidationErrors(s))return;o?.startEditing(s,{startedEdit:!0,event:e,source:"api",editable:!0}),s.editCompDetails?.params?.suppressPreventDefault||e.preventDefault()}}onSpaceKeyDown(e){const{gos:t,editSvc:o}=this.beans,{rowNode:s}=this.cellCtrl;!o?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&Lt(t)&&this.beans.selectionSvc?.handleSelectionEvent(e,s,"spaceKey"),e.preventDefault()}},zh=class extends Oe{constructor(e,t,o){super(),this.cellCtrl=e,this.column=o,this.beans=t}onMouseEvent(e,t){if(!Yi(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)}}onCellClicked(e){if(this.beans.touchSvc?.handleCellDoubleClick(this,e))return;const{eventSvc:t,rangeSvc:o,editSvc:s,editModelSvc:i,frameworkOverrides:n,gos:r}=this.beans,l=e.ctrlKey||e.metaKey,{cellCtrl:a}=this,{column:d,cellPosition:c,rowNode:h}=a,u=Hr(r,d,h,e);o&&l&&!u&&o.getCellRangeCount(c)>1&&o.intersectLastRange(!0);const g=a.createEvent(e,"cellClicked");g.isEventHandlingSuppressed=u,t.dispatchEvent(g);const p=d.getColDef();if(p.onCellClicked&&window.setTimeout(()=>{n.wrapOutgoing(()=>{p.onCellClicked(g)})},0),!u&&"editing"!==i?.getState(a)){const t=s?.isEditing(),o=s?.isRangeSelectionEnabledWhileEditing(),n=i?.getCellValidationModel().getCellValidationMap().size??0,r=i?.getRowValidationModel().getRowValidationMap().size??0;if(t&&(o||n>0||r>0))return;s?.shouldStartEditing(a,e)?s?.startEditing(a,{event:e}):s?.shouldStopEditing(a,e)&&("fullRow"===this.beans.gos.get("editType")?s?.stopEditing(a,{event:e,source:"edit"}):s?.stopEditing(void 0,{event:e,source:"edit"}))}}onCellDoubleClicked(e){const{column:t,beans:o,cellCtrl:s}=this,{eventSvc:i,frameworkOverrides:n,editSvc:r,editModelSvc:l,gos:a}=o,d=Hr(a,s.column,s.rowNode,e),c=t.getColDef(),h=s.createEvent(e,"cellDoubleClicked");if(h.isEventHandlingSuppressed=d,i.dispatchEvent(h),"function"==typeof c.onCellDoubleClicked&&window.setTimeout(()=>{n.wrapOutgoing(()=>{c.onCellDoubleClicked(h)})},0),!d&&r?.shouldStartEditing(s,e)&&"editing"!==l?.getState(s)){const t=r?.isEditing(),o=r?.isRangeSelectionEnabledWhileEditing(),i=l?.getCellValidationModel().getCellValidationMap().size??0,n=l?.getRowValidationModel().getRowValidationMap().size??0;if(t&&(o||i>0||n>0))return;r?.startEditing(s,{event:e})}}onMouseDown(e){const{shiftKey:t}=e,o=e.target,{cellCtrl:s,beans:i}=this,{eventSvc:n,rangeSvc:r,rowNumbersSvc:l,focusSvc:a,gos:d,editSvc:c}=i,{column:h,rowNode:u,cellPosition:g}=s,p=Hr(d,h,u,e),m=()=>{const t=s.createEvent(e,"cellMouseDown");t.isEventHandlingSuppressed=p,n.dispatchEvent(t)};if(p)return void m();if(this.isRightClickInExistingRange(e))return;const f=r&&!r.isEmpty(),C=this.containsWidget(o),v=os(h);if(!l||!v||l.handleMouseDownOnCell(g,e)){if(!t||!f){const t=c?.isEditing(s),i=d.get("enableCellTextSelection")&&e.defaultPrevented,n=(Ei()||i)&&!t&&!j(o)&&!C;s.focusCell(n,e)}if(t&&f&&!a.isCellFocused(g)){e.preventDefault();const t=a.getFocusedCell();if(t){const{column:o,rowIndex:s,rowPinned:i}=t,n=!!c?.isRangeSelectionEnabledWhileEditing?.();c?.isEditing(t)&&!n&&c?.stopEditing(t),n||a.setFocusedCell({column:o,rowIndex:s,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,sourceEvent:e})}}C||(r?.handleCellMouseDown(e,g),m())}}isRightClickInExistingRange(e){const{rangeSvc:t}=this.beans;if(t){const o=t.isCellInAnyRange(this.cellCtrl.cellPosition),s=vo(this.beans,e);if(o&&s)return!0}return!1}containsWidget(e){return q(e,"ag-selection-checkbox",3)||q(e,"ag-drag-handle",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const{eventSvc:t,colHover:o}=this.beans;t.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOut")),o?.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const{eventSvc:t,colHover:o}=this.beans;t.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOver")),o?.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.eGui,o=t.contains(e.target),s=t.contains(e.relatedTarget);return o&&s}},Wh=class extends Oe{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();null!=t&&(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();t(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){null!=this.column.getColDef().colSpan&&(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,o=e.getColSpan(t),s=[];if(1===o)s.push(e);else{let t=e;const i=e.getPinned();for(let e=0;t&&ethis.removeFeatures()),this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.setupFocus(),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(s,r),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 l=n?this.isCellEditable():void 0,a=!l&&this.hasEdit&&this.editSvc?.isEditing(this,{withOpenEditor:!0});if(l||a?this.editSvc?.startEditing(this,{startedEdit:!1,source:"api",silent:!0,continueEditing:!0,editable:l}):this.showValue(!1,!0),this.onCompAttachedFuncs.length){for(const e of this.onCompAttachedFuncs)e();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 null!=e.cellRenderer||null!=e.cellRendererSelector}getValueToDisplay(){return this.valueFormatted??this.value}getDeferLoadingCellRenderer(){const{beans:e,column:t}=this,{userCompFactory:o,ctrlsSvc:s,eventSvc:i}=e,n=t.getColDef(),r=this.createCellRendererParams();r.deferRender=!0;const l=ii(o,n,r);if(s.getGridBodyCtrl()?.scrollFeature?.isScrolling()){let e;const t=new Ns(t=>{e=t}),[o]=this.addManagedListeners(i,{bodyScrollEnd:()=>{e(),o()}});return{loadingComp:l,onReady:t}}return{loadingComp:l,onReady:Ns.resolve()}}showValue(e,t){const{beans:o,column:s,rowNode:i,rangeFeature:n}=this,{userCompFactory:r}=o;let l,a=this.getValueToDisplay();const d=i.stub&&null==i.groupData?.[s.getId()],c=s.getColDef();if(d||this.isCellRenderer()){const e=this.createCellRendererParams();l=!d||os(s)?si(r,c,e):ii(r,c,e)}if(!l&&!d&&o.findSvc?.isMatch(i,s)){const e=this.createCellRendererParams();l=si(r,{...s.getColDef(),cellRenderer:"agFindCellRenderer"},e)}if(this.hasEdit&&this.editSvc.isBatchEditing()&&this.editSvc.isRowEditing(i,{checkSiblings:!0})){const e=this.editSvc.prepDetailsDuringBatch(this,{compDetails:l,valueToDisplay:a});e&&(e.compDetails?l=e.compDetails:e.valueToDisplay&&(a=e.valueToDisplay))}this.comp.setRenderDetails(l,a,e),this.customRowDragComp?.refreshVisibility(),!t&&n&&be(o,()=>n?.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(){let e="";return"agCheckboxCellRenderer"===this.column.getColDef().cellRenderer&&(e=" ag-allow-overflow"),`ag-cell-value${e}`}isIncludeControl(e,t=!1){return(null==this.rowNode.rowPinned||t&&Hh(this.rowNode))&&!!e}isCheckboxSelection(e){const{rowSelection:t,groupDisplayType:o}=this.beans.gridOptions,s=to(t),i=ts(this.column);return("custom"!==o||"selectionColumn"===s||!i)&&(e.checkboxSelection||i&&"object"==typeof t&&Jt(t))}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(this.isCheckboxSelection(e),!0),o=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),s=this.includeDndSource!=this.isIncludeControl(e.dndSource),i=this.isAutoHeight!=this.column.isAutoHeight();return t||o||s||i}onPopupEditorClosed(e){const{editSvc:t}=this.beans;if(!t?.isEditing(this,{withOpenEditor:!0}))return;const o=e instanceof KeyboardEvent,s=e instanceof MouseEvent,i=o&&e.key===Cs;t.stopEditing(this,{source:t.isBatchEditing()?"ui":"api",cancel:i,event:o||s?e:void 0}),i&&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:o,rowNode:s,comp:i,eGui:n,beans:{valueSvc:r,gos:l,editSvc:a}}=this;return Co(l,{value:e,valueFormatted:t,getValue:()=>r.getValueForDisplay({column:o,node:s,from:"edit"}).value,setValue:e=>a?.setDataValue({rowNode:s,column:o},e)||s.setDataValue(o,e),formatValue:this.formatValue.bind(this),data:s.data,node:s,pinned:o.getPinned(),colDef:o.getColDef(),column:o,refreshCell:this.refreshCell.bind(this),eGridCell:n,eParentOfValue:i.getParentOfValue(),registerRowDragger:(e,t,o,s)=>this.registerRowDragger(e,t,s),setTooltip:(e,t)=>{l.assertModuleRegistered("Tooltip",3),this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(e,t),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:e,comp:t}=this;!t?.getCellEditor()&&e.isEditing(this,{withOpenEditor:!0})&&e.startEditing(this,{startedEdit:!1,source:"api",silent:!0})}}refreshCell(e){const{editStyleFeature:t,customStyleFeature:o,rowCtrl:{rowEditStyleFeature:s},beans:{cellFlashSvc:i,filterManager:n},column:r,comp:l,suppressRefreshCell:a,tooltipFeature:d}=this;if(a)return;const{field:c,valueGetter:h,showRowGroup:u,enableCellChangeFlash:g}=r.getColDef(),p=null==c&&null==h&&null==u,m=e?.newData??!1,f=p||e&&(e.force||m),C=!!l,v=this.updateAndFormatValue(C);if(C){if(f||v){this.showValue(!!m,!1);const r=n?.isSuppressFlashingCellsBecauseFiltering();e?.suppressFlash||r||!g||i?.flashCell(this),t?.applyCellStyles?.(),o?.applyUserStyles(),o?.applyClassesFromColDef(),s?.applyRowStyles(),this.checkFormulaError()}d?.refreshTooltip(),o?.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,o=this.valueFormatted,{value:s,valueFormatted:i}=this.beans.valueSvc.getValueForDisplay({column:this.column,node:this.rowNode,includeValueFormatted:!0,from:"edit"});return this.value=s,this.valueFormatted=i,!e||!this.valuesAreEqual(t,this.value)||this.valueFormatted!=o}valuesAreEqual(e,t){const o=this.column.getColDef();return o.equals?o.equals(e,t):e===t}addDomData(e){const t=this.eGui;Vt(this.beans.gos,t,zr,this),e.addDestroyFunc(()=>Vt(this.beans.gos,t,zr,null))}createEvent(e,t){const{rowNode:o,column:s,value:i,beans:n}=this;return function(e,t,o,{rowNode:s,column:i},n){return Co(e.gos,{type:o,node:s,data:s.data,value:n,column:i,colDef:i.getColDef(),rowPinned:s.rowPinned,event:t,rowIndex:s.rowIndex})}(n,e,t,{rowNode:o,column:s},i)}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:o}=this;rr(e,t,o.visibleCols)}refreshAriaColIndex(){const e=this.beans.visibleCols.getAriaColIndex(this.column);O(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 null!=this.rangeFeature}focusCell(e=!1,t){const o=this.editSvc?.allowedFocusTargetOnValidation(this);o&&o!==this||this.beans.focusSvc.setFocusedCell({...this.getFocusedCellPosition(),forceBrowserFocus:e,sourceEvent:t})}restoreFocus(e=!1){const{beans:{editSvc:t,focusSvc:o},comp:s}=this;if(!s||t?.isEditing(this)||!this.isCellFocused()||!o.shouldTakeFocus())return;const i=()=>{if(!this.isAlive())return;const e=s.getFocusableElement();this.isCellFocused()&&e.focus({preventScroll:!0})};e?setTimeout(i,0):i()}onRowIndexChanged(){this.createCellPosition(),this.refreshAriaRowIndex(),this.onCellFocused(),this.restoreFocus(),this.rangeFeature?.onCellSelectionChanged(),this.rowResizeFeature?.refreshRowResizer()}onSuppressCellFocusChanged(e){const t=this.eGui;t&&ve(t,"tabindex",e?void 0:-1)}onFirstRightPinnedChanged(){if(!this.comp)return;const e=this.column.isFirstRightPinned();this.comp.toggleCss("ag-cell-first-right-pinned",e)}onLastLeftPinnedChanged(){if(!this.comp)return;const e=this.column.isLastLeftPinned();this.comp.toggleCss("ag-cell-last-left-pinned",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(kn(t))return;if(!this.comp)return void(e&&(this.focusEventWhileNotReady=e));const o=this.isCellFocused(),s=t.editSvc?.isEditing(this)??!1;if(this.comp.toggleCss("ag-cell-focus",o),o&&(e?.forceBrowserFocus||!this.hasBrowserFocus()&&this.beans.focusSvc.shouldTakeFocus())){let o=this.comp.getFocusableElement();if(s){const e=zi(o,null,!0);e.length&&(o=e[0])}const i=!e||e.preventScrollOnBrowserFocus;o.focus({preventScroll:i}),function(e,t){if(!t.isContentEditable)return;const o=S(e).getSelection();if(!o)return;const s=b(e).createRange();s.selectNodeContents(t),s.collapse(!1),o.removeAllRanges(),o.addRange(s)}(t,o)}o&&this.focusEventWhileNotReady&&(this.focusEventWhileNotReady=null),o&&e&&this.rowCtrl.announceDescription()}createCellPosition(){const{rowIndex:e,rowPinned:t}=this.rowNode;this.cellPosition={rowIndex:e,rowPinned:r(t),column:this.column}}applyStaticCssClasses(){const{comp:e}=this;e.toggleCss("ag-cell",!0),e.toggleCss("ag-cell-not-inline-editing",!0);const t=1==this.column.isAutoHeight();e.toggleCss("ag-cell-auto-height",t),e.toggleCss("ag-cell-normal-height",!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=1==this.column.getColDef().wrapText;this.comp.toggleCss("ag-cell-wrap-text",e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),o=this.createEvent(e,"cellContextMenu"),{beans:s}=this;s.eventSvc.dispatchEvent(o),t.onCellContextMenu&&window.setTimeout(()=>{s.frameworkOverrides.wrapOutgoing(()=>{t.onCellContextMenu(o)})},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(w(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,o){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(e,t);const s=this.createRowDragComp(e,t,o);s&&(this.customRowDragComp=s,this.addDestroyFunc(()=>{this.beans.context.destroyBean(s),this.customRowDragComp=null}),s.refreshVisibility())}createRowDragComp(e,t,o){const s=this.beans.rowDragSvc?.createRowDragCompForCell(this.rowNode,this.column,()=>this.value,e,t,o);if(s)return this.beans.context.createBean(s),s}cellEditorAttached(){for(const e of this.onEditorAttachedFuncs)e();this.onEditorAttachedFuncs=[]}setFocusedCellPosition(e){}getFocusedCellPosition(){return this.cellPosition}refreshAriaRowIndex(){if(!os(this.column)||!this.eGui)return;const{ariaRowIndex:e}=this.rowCtrl;null!=e&&H(this.eGui,e)}getRootElement(){return this.eGui}};function jh(e,t,o,s,i,n){if(null==o&&null==t)return;const r={},l={},a=(e,t)=>{for(const o of e.split(" "))""!=o.trim()&&t(o)};if(o){const t=Object.keys(o);for(let i=0;i{c?r[e]=!0:l[e]=!0})}}if(t&&n)for(const d of Object.keys(t))a(d,e=>{r[e]||(l[e]=!0)});n&&Object.keys(l).forEach(n),Object.keys(r).forEach(i)}function Kh(e){if(e.group)return e.level;const t=e.parent;return t?t.level+1:0}var _h=0,qh=class extends Oe{constructor(e,t,o,s,i){super(),this.rowNode=e,this.useAnimationFrameForCreate=s,this.printLayout=i,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+"-"+_h++,this.rowId=f(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusSvc.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=Kh(this.rowNode),this.setRowType(),this.setAnimateFlags(o),this.rowStyles=this.processStylesFromGridOptions(),this.rowEditStyleFeature=t.editSvc?.createRowStyleFeature(this),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){"function"==typeof this.businessKeyForNodeFunc&&(this.businessKey=f(this.businessKeyForNodeFunc(this.rowNode)))}updateGui(e,t){"left"===e?this.leftGui=t:"right"===e?this.rightGui=t:"fullWidth"===e?this.fullWidthGui=t:this.centerGui=t}setComp(e,t,o,s){const{context:i,rowRenderer:n}=this.beans,r={rowComp:e,element:t,containerType:o,compBean:s=or(this,i,s)};this.allRowGuis.push(r),this.updateGui(o,r),this.initialiseRowComp(r);const l=this.rowNode,a="FullWidthLoading"===this.rowType||l.stub,d=!l.data&&"infinite"===this.beans.rowModel.getType();a||d||l.rowPinned||n.dispatchFirstDataRenderedEvent(),this.setupFocus()}unsetComp(e){this.allRowGuis=this.allRowGuis.filter(t=>t.containerType!==e),this.updateGui(e,void 0)}isCacheable(){return"FullWidthDetail"===this.rowType&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";for(const o of this.allRowGuis)o.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 o=e.rowComp,s=this.getInitialRowClasses(e.containerType);for(const i of s)o.toggleCss(i,!0);this.executeSlideAndFadeAnimations(e),this.rowNode.group&&G(e.element,!!this.rowNode.expanded),this.setRowCompRowId(o),this.setRowCompRowBusinessKey(o),Vt(t,e.element,Ur,this),e.compBean.addDestroyFunc(()=>Vt(t,e.element,Ur,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){null!=this.businessKey&&e.setRowBusinessKey(this.businessKey)}setRowCompRowId(e){const t=f(this.rowNode.id);this.rowId=t,null!=t&&e.setRowId(t)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&($e(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1),this.fadeInAnimation[t]&&($e(()=>{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 o=this.createBean(t,this.beans.context);this.rowDragComps.push(o),e.compBean.addDestroyFunc(()=>{this.rowDragComps=this.rowDragComps.filter(e=>e!==o),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,this.beans.context),this.destroyBean(o,this.beans.context)})}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType),o=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(o)}getFullWidthCellRenderers(){return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(e=>e?.rowComp?.getFullWidthCellRenderer()):[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");e&&this.areAllContainersReady()&&e({eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}areAllContainersReady(){const{leftGui:e,centerGui:t,rightGui:o,beans:{visibleCols:s}}=this,i=!!e||!s.isPinningLeft(),n=!!t,r=!!o||!s.isPinningRight();return i&&n&&r}isNodeFullWidthCell(){if(this.rowNode.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return!!e&&e({rowNode:this.rowNode})}setRowType(){const{rowNode:e,gos:t,beans:{colModel:o}}=this,s=e.stub&&!t.get("suppressServerSideFullWidthLoadingRow")&&!t.get("groupHideOpenParents"),i=this.isNodeFullWidthCell(),n=t.get("masterDetail")&&e.detail,r=Zt(t,e,o.isPivotMode());this.rowType=s?"FullWidthLoading":n?"FullWidthDetail":i?"FullWidth":r?"FullWidthGroup":"Normal"}updateColumnLists(e=!1,t=!1){if(this.isFullWidth())return;const{animationFrameSvc:o}=this.beans;!o?.active||e||this.printLayout?this.updateColumnListsImpl(t):this.updateColumnListsPending||(o.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 $h(e,this.rowNode,this.beans,this)}isCorrectCtrlForSpan(e){return!this.beans.rowSpanSvc?.isCellSpanning(e.column,this.rowNode)}createCellCtrls(e,t,o=null){const s={list:[],map:{}},i=(e,t,o)=>{null!=o?s.list.splice(o,0,t):s.list.push(t),s.map[e]=t},n=[];for(const d of t){const t=d.getInstanceId();let o=e.map[t];o&&!this.isCorrectCtrlForSpan(o)&&(o.destroy(),o=void 0),o||(o=this.getNewCellCtrl(d)),o&&i(t,o)}for(const d of e.list){const e=d.column.getInstanceId();null==s.map[e]&&(this.isCellEligibleToBeRemoved(d,o)?d.destroy():n.push([e,d]))}if(n.length)for(const[d,c]of n){const e=s.list.findIndex(e=>e.column.getLeft()>c.column.getLeft());i(d,c,-1===e?void 0:Math.max(e-1,0))}const{focusSvc:r,visibleCols:l}=this.beans,a=r.getFocusedCell();if(a&&a.column.getPinned()==o){const e=a.column.getInstanceId();if(!s.map[e]&&l.allCols.includes(a.column)){const t=this.createFocusedCellCtrl();if(t){const o=s.list.findIndex(e=>e.column.getLeft()>t.column.getLeft());i(e,t,-1===o?void 0:Math.max(o-1,0))}}}return s}createFocusedCellCtrl(){const{focusSvc:e,rowSpanSvc:t}=this.beans,o=e.getFocusedCell();if(!o)return;const s=t?.getCellSpan(o.column,this.rowNode);if(s){if(s.firstNode!==this.rowNode||!s.doesSpanContain(o))return}else if(!e.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))return;return this.getNewCellCtrl(o.column)}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){for(const t of this.allRowGuis){const o=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(o,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 o=e.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,o);const s=t.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,s,"left");const i=t.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,i,"right")}}isCellEligibleToBeRemoved(e,t){const o=!0,{column:s}=e;if(s.getPinned()!=t)return o;if(!this.isCorrectCtrlForSpan(e))return o;const{visibleCols:i,editSvc:n}=this.beans,r=n?.isEditing(e),l=e.isCellFocused();return r||l?!(i.allCols.indexOf(s)>=0)&&o:o}getDomOrder(){return this.gos.get("ensureDomOrder")||kt(this.gos,"print")}listenOnDomOrder(e){e.compBean.addManagedPropertyListeners(["domLayout","ensureDomOrder"],()=>{e.rowComp.setDomOrder(this.getDomOrder())})}setAnimateFlags(e){if(this.rowNode.sticky||!e)return;const t=l(this.rowNode.oldRowTop),{visibleCols:o}=this.beans,s=o.isPinningLeft(),i=o.isPinningRight();if(t){const{slideInAnimation:e}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(e.fullWidth=!0);e.center=!0,e.left=s,e.right=i}else{const{fadeInAnimation:e}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(e.fullWidth=!0);e.center=!0,e.left=s,e.right=i}}isFullWidth(){return"Normal"!==this.rowType}refreshFullWidth(){const e=(e,t)=>!e||e.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(e.element,t).params),t=e(this.fullWidthGui,null),o=e(this.centerGui,null),s=e(this.leftGui,"left"),i=e(this.rightGui,"right");return t&&o&&s&&i}addListeners(){const{beans:e,gos:t,rowNode:o}=this,{expansionSvc:s,eventSvc:i,context:n,rowSpanSvc:r}=e;this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),...s?.getRowExpandedListeners(this)??{}}),o.detail&&this.addManagedListeners(o.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)}),this.addManagedListeners(o,{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(i,{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()}),r&&this.addManagedListeners(r,{spannedCellsUpdated:({pinned:e})=>{e&&!o.rowPinned||this.updateColumnLists()}}),this.addDestroyFunc(()=>{this.rowDragComps=this.destroyBeans(this.rowDragComps,n),this.tooltipFeature=this.destroyBean(this.tooltipFeature,n),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,n)}),this.addManagedPropertyListeners(["rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules"],this.postProcessCss.bind(this)),this.addManagedPropertyListener("rowDragEntireRow",()=>{if(t.get("rowDragEntireRow"))for(const e of this.allRowGuis)this.addRowDraggerToRow(e);else this.rowDragComps=this.destroyBeans(this.rowDragComps,n)}),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())if(this.isFullWidth())this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode);else{for(const t of this.getAllCellCtrls())t.refreshCell(e);for(const e of this.allRowGuis)this.setRowCompRowId(e.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(e.rowComp);this.onRowSelected(),this.postProcessCss()}else this.beans.rowRenderer.redrawRow(this.rowNode)}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",o="above"===t,s="inside"===t,i="below"===t,n="none"!==t,r=o||i,l=this.rowNode.uiLevel,a=r&&l>0,d=a?l.toString():"0";for(const c of this.allRowGuis){const e=c.rowComp;e.toggleCss("ag-row-highlight-above",o),e.toggleCss("ag-row-highlight-inside",s),e.toggleCss("ag-row-highlight-below",i),e.toggleCss("ag-row-highlight-indent",a),n?c.element.style.setProperty("--ag-row-highlight-level",d):c.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:r(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.findFullWidthInfoForEvent(e);if(!t)return;const{rowGui:o,column:s}=t;if(o.element!==e.target)return;const i=this.rowNode,{focusSvc:n,navigation:r}=this.beans,l=n.getFocusedCell(),a={rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:l?.column??s};r?.navigateToNextCell(e,e.key,a,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||Yi(e))return;const t=this.allRowGuis.find(t=>t.element.contains(e.target)),o=t?t.element:null,s=o===e.target,i=w(this.beans);let n=!1;o&&i&&(n=o.contains(i)&&i.classList.contains("ag-cell"));let r=null;s||n||(r=Ui(this.beans,o,!1,e.shiftKey)),(this.isFullWidth()&&s||!r)&&this.beans.navigation?.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){const e=this.allRowGuis.find(e=>re(e.element))?.element;return e?e.getBoundingClientRect().top:0}onSuppressCellFocusChanged(e){const t=this.isFullWidth()&&e?void 0:this.gos.get("tabIndex");for(const o of this.allRowGuis)ve(o.element,"tabindex",t)}setupFocus(){this.isFullWidth()&&(this.restoreFullWidthFocus(!0),this.onFullWidthRowFocused(this.focusEventWhileNotReady??void 0))}restoreFullWidthFocus(e=!1){const{focusSvc:t,editSvc:o}=this.beans;if(o?.isEditing(this))return;if(!t.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned)||!t.shouldTakeFocus())return;const s=this.getFullWidthRowGuiForFocus();if(!s)return;const i=()=>{this.isAlive()&&t.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned)&&s.element.focus({preventScroll:!0})};e?setTimeout(i,0):i()}getFullWidthRowGuiForFocus(e){if(this.fullWidthGui)return this.fullWidthGui;const t=this.beans.focusSvc.getFocusedCell(),o=this.beans.colModel.getCol(e?.column??t?.column);if(!o)return;const s=o?.pinned;return"right"===s?this.rightGui:"left"===s?this.leftGui:this.centerGui}setFullWidthRowFocusedClass(e,t){this.forEachGui(void 0,o=>{o.element.classList.toggle("ag-full-width-focus",t&&o===e)})}onFullWidthRowFocused(e){const{focusSvc:t}=this.beans;if(!this.isFullWidth()||!t.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))return void this.setFullWidthRowFocusedClass(void 0,!1);const o=this.getFullWidthRowGuiForFocus(e);if(!o)return e&&(this.focusEventWhileNotReady=e),void this.setFullWidthRowFocusedClass(void 0,!1);this.setFullWidthRowFocusedClass(o,!0),this.focusEventWhileNotReady=null,e?.forceBrowserFocus&&o.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 o={list:[],map:{}};for(const s of e.list)s!==t&&(o.list.push(s),o.map[s.column.getInstanceId()]=s);return o}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)}}createRowEvent(e,t){const{rowNode:o}=this;return Co(this.gos,{type:e,node:o,data:o.data,rowIndex:o.rowIndex,rowPinned:o.rowPinned,event:t})}createRowEventWithSource(e,t){const o=this.createRowEvent(e,t);return o.source=this,o}onRowDblClick(e){if(Yi(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),o=this.getColumnForFullWidth(t);return t&&o?{rowGui:t,column:o}:void 0}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=q(e.target,"ag-row-drag",3),!this.isFullWidth()||this.isSuppressMouseEvent(e))return;const{rangeSvc:t,focusSvc:o}=this.beans;t?.removeAllCellRanges();const s=this.findFullWidthInfoForEvent(e);if(!s)return;const{rowGui:i,column:n}=s,r=i.element,l=e.target,a=this.rowNode;let d=e.defaultPrevented||Ei();r&&r.contains(l)&&j(l)&&(d=!1),o.setFocusedCell({rowIndex:a.rowIndex,column:n,rowPinned:a.rowPinned,forceBrowserFocus:d})}isSuppressMouseEvent(e){const{gos:t,rowNode:o}=this;if(this.isFullWidth())return function(e,t,o,s){const i=t?.suppressMouseEventHandling;return Or(e,void 0,o,s,i)}(t,this.findFullWidthRowGui(e.target)?.rowComp.getFullWidthCellRendererParams(),o,e);const s=Wr(t,e.target);return null!=s&&Hr(t,s.column,o,e)}onRowClick(e){if(Yi(e)||this.lastMouseDownOnDragger)return;const t=this.isSuppressMouseEvent(e),{eventSvc:o,selectionSvc:s}=this.beans,i=this.createRowEventWithSource("rowClicked",e);i.isEventHandlingSuppressed=t,o.dispatchEvent(i),t||s?.handleSelectionEvent(e,this.rowNode,"rowClicked")}setupDetailRowAutoHeight(e){"FullWidthDetail"===this.rowType&&this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this,e)}createFullWidthCompDetails(e,t){const{gos:o,rowNode:s}=this,i=Co(o,{fullWidth:!0,data:s.data,node:s,value:s.key,valueFormatted:s.key,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(e,t,o,s)=>this.addFullWidthRowDragging(e,t,o,s),setTooltip:(e,t)=>{o.assertModuleRegistered("Tooltip",3),this.setupFullWidthRowTooltip(e,t)}}),n=this.beans.userCompFactory;switch(this.rowType){case"FullWidthDetail":return function(e,t){return e.getCompDetailsFromGridOptions(ti,"agDetailCellRenderer",t,!0)}(n,i);case"FullWidthGroup":{const{value:e,valueFormatted:t}=this.beans.valueSvc.getValueForDisplay({node:this.rowNode,includeValueFormatted:!0,from:"edit"});return i.value=e,i.valueFormatted=t,function(e,t){return e.getCompDetailsFromGridOptions(ei,"agGroupRowRenderer",t,!0)}(n,i)}case"FullWidthLoading":return function(e,t){return e.getCompDetailsFromGridOptions(Js,"agLoadingCellRenderer",t,!0)}(n,i);default:return function(e,t){return e.getCompDetailsFromGridOptions(Xs,void 0,t,!0)}(n,i)}}setupFullWidthRowTooltip(e,t){this.fullWidthGui&&(this.tooltipFeature=this.beans.tooltipSvc?.setupFullWidthRowTooltip(this.tooltipFeature,this,e,t))}addFullWidthRowDragging(e,t,o="",s){const{rowDragSvc:i,context:n}=this.beans;if(!i||!this.isFullWidth())return;const r=i.createRowDragComp(()=>o,this.rowNode,void 0,e,t,s);this.createBean(r,n),this.addDestroyFunc(()=>{this.destroyBean(r,n)})}onUiLevelChanged(){const e=Kh(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,o="ag-row-level-"+this.rowLevel;for(const e of this.allRowGuis)e.rowComp.toggleCss(t,!0),e.rowComp.toggleCss(o,!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 t of this.allRowGuis)t.rowComp.toggleCss("ag-row-first",e)}if(this.lastRowOnPage!==t){this.lastRowOnPage=t;for(const e of this.allRowGuis)e.rowComp.toggleCss("ag-row-last",t)}}getAllCellCtrls(){return 0===this.leftCellCtrls.list.length&&0===this.rightCellCtrls.list.length?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 e of this.allRowGuis)e.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,e=>e.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){return"left"===e||"right"===e?e:null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),o=this.isFullWidth(),{rowNode:s,beans:i}=this,n=[];n.push("ag-row"),n.push(this.rowFocused?"ag-row-focus":"ag-row-no-focus"),this.fadeInAnimation[e]&&n.push("ag-opacity-zero"),n.push(s.rowIndex%2==0?"ag-row-even":"ag-row-odd"),s.isRowPinned()&&(n.push("ag-row-pinned"),i.pinnedRowModel?.isManual()&&n.push("ag-row-pinned-manual")),!s.isRowPinned()&&s.pinnedSibling&&n.push("ag-row-pinned-source"),s.isSelected()&&n.push("ag-row-selected"),s.footer&&n.push("ag-row-footer"),n.push("ag-row-level-"+this.rowLevel),s.stub&&n.push("ag-row-loading"),o&&n.push("ag-full-width-row"),i.expansionSvc?.addExpandedCss(n,s),s.dragging&&n.push("ag-row-dragging");const{rowStyleSvc:r}=i;return r&&(r.processClassesFromGridOptions(n,s),r.preProcessRowClassRules(n,s)),n.push(this.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),this.isFirstRowOnPage()&&n.push("ag-row-first"),this.isLastRowOnPage()&&n.push("ag-row-last"),o&&("left"===t&&n.push("ag-cell-last-left-pinned"),"right"===t&&n.push("ag-cell-first-right-pinned")),n}processStylesFromGridOptions(){return this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode)??this.emptyStyle}onRowSelected(e){this.beans.selectionSvc?.onRowCtrlSelected(this,e=>{e!==this.centerGui&&e!==this.fullWidthGui||this.announceDescription()},e)}announceDescription(){this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode)}addHoverFunctionality(e){if(!this.active)return;const{element:t,compBean:o}=e,{rowNode:s,beans:i,gos:n}=this;o.addManagedListeners(t,{pointerenter:e=>{"mouse"===e.pointerType&&s.dispatchRowEvent("mouseEnter")},pointerleave:e=>{"mouse"===e.pointerType&&s.dispatchRowEvent("mouseLeave")}}),o.addManagedListeners(s,{mouseEnter:()=>{i.dragSvc?.dragging||n.get("suppressRowHoverHighlight")||(t.classList.add("ag-row-hover"),s.setHovered(!0))},mouseLeave:()=>{this.resetHoveredStatus(t)}})}resetHoveredStatus(e){const t=e?[e]:this.allRowGuis.map(e=>e.element);for(const o of t)o.classList.remove("ag-row-hover");this.rowNode.setHovered(!1)}roundRowTopToBounds(e){const t=this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition(),o=this.applyPaginationOffset(t.top,!0)-100,s=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(o,e),s)}forEachGui(e,t){if(e)t(e);else for(const o of this.allRowGuis)t(o)}isRowRendered(){return this.allRowGuis.length>0}onRowHeightChanged(e){if(null==this.rowNode.rowHeight)return;const t=this.rowNode.rowHeight,o=this.beans.environment.getDefaultRowHeight(),s=Gt(this.gos)?Nt(this.beans,this.rowNode).height:void 0,i=s?Math.min(o,s)-2+"px":void 0;this.forEachGui(e,e=>{e.element.style.height=`${t}px`,i&&e.element.style.setProperty("--ag-line-height",i)})}destroyFirstPass(e=!1){this.active=!1;const{rowNode:t}=this;if(!e&&zt(this.gos)&&!t.sticky)if(null!=t.rowTop){const e=this.roundRowTopToBounds(t.rowTop);this.setRowTop(e)}else for(const s of this.allRowGuis)s.rowComp.toggleCss("ag-opacity-zero",!0);this.fullWidthGui?.element.contains(w(this.beans))&&this.beans.focusSvc.attemptToRecoverFocus(),t.setHovered(!1);const o=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(o),this.beans.eventSvc.dispatchEvent(o),super.destroy()}destroySecondPass(){this.allRowGuis.length=0;const e=e=>{for(const t of e.list)t.destroy();return{list:[],map:{}}};this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,e=>{e.rowComp.toggleCss("ag-row-focus",this.rowFocused),e.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){return this.rowNode.isRowPinned()||this.rowNode.sticky?e:e+this.beans.pageBounds.getPixelOffset()*(t?1:-1)}setRowTop(e){if(!this.printLayout&&l(e)){const t=this.applyPaginationOffset(e),o=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeight.getRealPixelPosition(t)}px`;this.setRowTopStyle(o)}}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 o;if(t.sticky)o=t.stickyRowTop;else{const s=this.slideInAnimation[e]?this.roundRowTopToBounds(t.oldRowTop):t.rowTop,i=this.applyPaginationOffset(s);o=t.isRowPinned()?i:this.beans.rowContainerHeight.getRealPixelPosition(i)}return o+"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 o=null;for(const s of this.getAllCellCtrls())s.column==e&&(o=s);if(null!=o||t)return o;for(const s of this.getAllCellCtrls())s?.getColSpanningList().indexOf(e)>=0&&(o=s);return o}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}updateRowIndexes(e){const t=this.rowNode.getRowIndexString();if(null===t)return;const o=(this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.beans.filterManager?.getHeaderRowCount()??0),s=this.rowNode.rowIndex%2==0,i=this.ariaRowIndex=o+this.rowNode.rowIndex+1;this.forEachGui(e,e=>{e.rowComp.setRowIndex(t),e.rowComp.toggleCss("ag-row-even",s),e.rowComp.toggleCss("ag-row-odd",!s),H(e.element,i)})}};function Yh(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}var Zh={moduleName:"KeyboardNavigation",version:mt,beans:[class extends Oe{constructor(){super(),this.beanName="navigation",this.onPageDown=Ke(this.onPageDown,100),this.onPageUp=Ke(this.onPageUp,100)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const o=e.key,s=e.altKey,i=e.ctrlKey||e.metaKey,n=!!this.beans.rangeSvc&&e.shiftKey,r=ta(this.gos,e);let l=!1;switch(o){case Ms:case Ps:i||s||(this.onHomeOrEndKey(o),l=!0);break;case ws:case ys:case bs:case Ss:if(!r)return!1;!i||s||n||(this.onCtrlUpDownLeftRight(o,r),l=!0);break;case Ds:case Fs:i||s||(l=this.handlePageUpDown(o,r,t))}return l&&e.preventDefault(),l}handlePageUpDown(e,t,o){return o&&(t=this.beans.focusSvc.getFocusedCell()),!!t&&(e===Fs?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo({scrollIndex:e,scrollType:t,scrollColumn:o,focusIndex:s,focusColumn:i,isAsync:n,rowPinned:r}){const{scrollFeature:a}=this.gridBodyCon;l(o)&&!o.isPinned()&&a.ensureColumnVisible(o),l(e)&&a.ensureIndexVisible(e,t),n||a.ensureIndexVisible(s);const{focusSvc:d}=this.beans;d.setFocusedCell({rowIndex:s,column:i,rowPinned:r,forceBrowserFocus:!0}),this.setRangeToCellIfSupported({rowIndex:s,rowPinned:r,column:i})}onPageDown(e){const t=this.beans,o=Yh(t),s=this.getViewportHeight(),{pageBounds:i,rowModel:n,rowAutoHeight:r}=t,l=i.getPixelOffset(),a=o.top+s,d=n.getRowIndexAtPixel(a+l);r?.active?this.navigateToNextPageWithAutoHeight(e,d):this.navigateToNextPage(e,d)}onPageUp(e){const t=this.beans,o=Yh(t),{pageBounds:s,rowModel:i,rowAutoHeight:n}=t,r=s.getPixelOffset(),l=o.top,a=i.getRowIndexAtPixel(l+r);n?.active?this.navigateToNextPageWithAutoHeight(e,a,!0):this.navigateToNextPage(e,a,!0)}navigateToNextPage(e,t,o=!1){const{pageBounds:s,rowModel:i}=this.beans,n=this.getViewportHeight(),r=s.getFirstRow(),l=s.getLastRow(),a=s.getPixelOffset(),d=i.getRow(e.rowIndex),c=o?d?.rowHeight-n-a:n-a,h=d?.rowTop+c;let u,g=i.getRowIndexAtPixel(h+a);if(g===e.rowIndex){const s=o?-1:1;t=g=e.rowIndex+s}o?(u="bottom",gl&&(g=l),t>l&&(t=l)),this.isRowTallerThanView(i.getRow(g))&&(t=g,u="top"),this.navigateTo({scrollIndex:t,scrollType:u,scrollColumn:null,focusIndex:g,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,o=!1){this.navigateTo({scrollIndex:t,scrollType:o?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const s=this.getNextFocusIndexForAutoHeight(e,o);this.navigateTo({scrollIndex:t,scrollType:o?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){const o=t?-1:1,s=this.getViewportHeight(),{pageBounds:i,rowModel:n}=this.beans,r=i.getLastRow();let l=0,a=e.rowIndex;for(;a>=0&&a<=r;){const e=n.getRow(a);if(e){const t=e.rowHeight??0;if(l+t>s)break;l+=t}a+=o}return Math.max(0,Math.min(a,r))}getViewportHeight(){const e=this.beans,t=Yh(e),o=this.beans.scrollVisibleSvc.getScrollbarWidth();let s=t.bottom-t.top;return e.ctrlsSvc.get("center").isHorizontalScrollShowing()&&(s-=o),s}isRowTallerThanView(e){if(!e)return!1;const t=e.rowHeight;return"number"==typeof t&&t>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const o=this.beans.cellNavigation.getNextCellToFocus(e,t,!0);if(!o)return;const{rowIndex:s,rowPinned:i,column:n}=this.getNormalisedPosition(o)??o,r=n;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:r,focusIndex:s,focusColumn:r,rowPinned:i})}onHomeOrEndKey(e){const t=e===Ms,{visibleCols:o,pageBounds:s,rowModel:i}=this.beans,n=o.allCols,r=t?s.getFirstRow():s.getLastRow(),l=i.getRow(r);if(!l)return;const a=(t?n:[...n].reverse()).find(e=>!e.isSuppressNavigable(l)&&!os(e));a&&this.navigateTo({scrollIndex:r,scrollType:null,scrollColumn:a,focusIndex:r,focusColumn:a})}onTabKeyDown(e,t){const o=t.shiftKey,s=this.tabToNextCellCommon(e,o,t),i=this.beans,{ctrlsSvc:n,pageBounds:r,focusSvc:l,gos:a}=i;if(!1===s)if(o){const{rowIndex:o,rowPinned:s}=e.getRowPosition();(s?0===o:o===r.getFirstRow())&&(0===a.get("headerHeight")||An(i)?Ln(i,!0,!0):(t.preventDefault(),l.focusPreviousFromFirstCell(t)))}else e instanceof $h&&e.focusCell(!0),(l.focusOverlay(!1)||Ln(i,o))&&t.preventDefault();else s?t.preventDefault():null===s&&n.get("gridCtrl").allowFocusForNextCoreContainer(o)}tabToNextCell(e,t){const o=this.beans,{focusSvc:s,rowRenderer:i}=o,n=s.getFocusedCell();if(!n)return!1;let r=Dn(o,n);return!(!r&&(r=i.getRowByPosition(n),!r?.isFullWidth())||!this.tabToNextCellCommon(r,e,t,"api"))}tabToNextCellCommon(e,t,o,s="ui"){const{editSvc:i,focusSvc:n}=this.beans;let r;const l=e instanceof $h?e:e.getAllCellCtrls()?.[0];return r=i?.isEditing()?i?.moveToNextCell(l,t,o,s):this.moveToNextCellNotEditing(e,t,o),null===r?r:r||!!n.focusedHeader}moveToNextCellNotEditing(t,o,s){const i=this.beans.visibleCols.allCols;let n;if(t instanceof qh){if(n={...t.getRowPosition(),column:o?i[0]:e(i)},this.gos.get("embedFullWidthRows")&&s){const e=t.findFullWidthInfoForEvent(s);e&&(n.column=e.column)}}else n=t.getFocusedCellPosition();const r=this.findNextCellToFocusOn(n,{backwards:o,startEditing:!1});if(!1===r)return null;if(r instanceof $h)r.focusCell(!0);else if(r)return this.tryToFocusFullWidthRow(r,o);return l(r)}findNextCellToFocusOn(e,{backwards:t,startEditing:o,skipToNextEditableCell:s}){let i=e;const n=this.beans,{cellNavigation:r,gos:a,focusSvc:d,rowRenderer:c}=n;for(;;){e!==i&&(e=i),t||(i=this.getLastCellOfColSpan(i)),i=r.getNextTabbedCell(i,t);const h=a.getCallback("tabToNextCell");if(l(h)){const s=h({backwards:t,editing:o,previousCellPosition:e,nextCellPosition:i||null});if(!0===s)i=e;else{if(!1===s)return!1;i={rowIndex:s.rowIndex,column:s.column,rowPinned:s.rowPinned}}}if(!i)return null;if(i.rowIndex<0){const e=On(n);return d.focusHeaderPosition({headerPosition:{headerRowIndex:e+i.rowIndex,column:i.column},fromCell:!0}),null}const u="fullRow"===a.get("editType");if(o&&(!u||s)&&!this.isCellEditable(i))continue;this.ensureCellVisible(i);const g=Dn(n,i);if(!g){const e=c.getRowByPosition(i);if(!e||!e.isFullWidth()||o)continue;return{...e.getRowPosition(),column:i?.column}}if(!r.isSuppressNavigable(g.column,g.rowNode))return g.setFocusedCellPosition(i),this.setRangeToCellIfSupported(i),g}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}lookupRowNodeForCell({rowIndex:e,rowPinned:t}){const{pinnedRowModel:o,rowModel:s}=this.beans;return"top"===t?o?.getPinnedTopRow(e):"bottom"===t?o?.getPinnedBottomRow(e):s.getRow(e)}navigateToNextCell(e,t,o,s){let i=o,n=!1;const r=this.beans,{cellNavigation:d,focusSvc:c,gos:h}=r;for(;i&&(i===o||!this.isValidNavigateCell(i));)h.get("enableRtl")?t===ws&&(i=this.getLastCellOfColSpan(i)):t===ys&&(i=this.getLastCellOfColSpan(i)),i=d.getNextCellToFocus(t,i),n=a(i);if(n&&e&&e.key===bs&&(i={rowIndex:-1,rowPinned:null,column:o.column}),s){const s=h.getCallback("navigateToNextCell");if(l(s)){const n=s({key:t,previousCellPosition:o,nextCellPosition:i||null,event:e});i=l(n)?{rowPinned:n.rowPinned,rowIndex:n.rowIndex,column:n.column}:null}}if(!i)return;if(i.rowIndex<0){const t=On(r);return void c.focusHeaderPosition({headerPosition:{headerRowIndex:t+i.rowIndex,column:i.column??o.column},event:e||void 0,fromCell:!0})}const u=this.getNormalisedPosition(i);u?this.focusPosition(u):this.tryToFocusFullWidthRow(i)}getNormalisedPosition(e){if(this.beans.spannedRowRenderer?.getCellByPosition(e))return e;this.ensureCellVisible(e);const t=Dn(this.beans,e);return t?(e=t.getFocusedCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(t,o){const{visibleCols:s,rowRenderer:i,focusSvc:n,eventSvc:r}=this.beans,l=s.allCols;if(!i.getRowByPosition(t)?.isFullWidth())return!1;const a=n.getFocusedCell(),d={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column||(o?e(l):l[0])};this.focusPosition(d);const c=null==o?null!=a&&yn(d,a):o;return r.dispatchEvent({type:"fullWidthRowFocused",rowIndex:d.rowIndex,rowPinned:d.rowPinned,column:d.column,isFullWidthCell:!0,fromBelow:c}),!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){os(e.column)||this.beans.rangeSvc?.setRangeToCell(e)}isValidNavigateCell(e){return!!Fn(this.beans,e)}getLastCellOfColSpan(t){const o=Dn(this.beans,t);if(!o)return t;const s=o.getColSpanningList();return 1===s.length?t:{rowIndex:t.rowIndex,column:e(s),rowPinned:t.rowPinned}}ensureCellVisible(e){const t=Wt(this.gos),o=this.beans.rowModel.getRow(e.rowIndex),s=t&&o?.sticky,{scrollFeature:i}=this.gridBodyCon;!s&&a(e.rowPinned)&&i.ensureIndexVisible(e.rowIndex),e.column.isPinned()||i.ensureColumnVisible(e.column)}ensureColumnVisible(e){const t=this.gridBodyCon.scrollFeature;e.isPinned()||t.ensureColumnVisible(e)}ensureRowVisible(e){this.gridBodyCon.scrollFeature.ensureIndexVisible(e)}},class extends Oe{constructor(){super(...arguments),this.beanName="cellNavigation"}wireBeans(e){this.rowSpanSvc=e.rowSpanSvc}getNextCellToFocus(e,t,o=!1){return o?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const o=e===bs,s=e===Ss,i=e===ws;let n,r;const{pageBounds:l,gos:a,visibleCols:d,pinnedRowModel:c}=this.beans,{rowPinned:h}=t;if(o||s)r=h&&c?o?0:"top"===h?c.getPinnedTopRowCount()-1:c.getPinnedBottomRowCount()-1:o?l.getFirstRow():l.getLastRow(),n=t.column;else{const e=a.get("enableRtl");r=t.rowIndex,n=(i!==e?d.allCols:[...d.allCols].reverse()).find(e=>!os(e)&&this.isCellGoodToFocusOn({rowIndex:r,rowPinned:null,column:e}))}return n?{rowIndex:r,rowPinned:h,column:n}:null}getNextCellToFocusWithoutCtrlPressed(e,t){let o=t,s=!1;for(;!s;){switch(e){case bs:o=this.getCellAbove(o);break;case Ss:o=this.getCellBelow(o);break;case ys:o=this.gos.get("enableRtl")?this.getCellToLeft(o):this.getCellToRight(o);break;case ws:o=this.gos.get("enableRtl")?this.getCellToRight(o):this.getCellToLeft(o);break;default:o=null,Dt(8,{key:e})}s=!o||this.isCellGoodToFocusOn(o)}return o}isCellGoodToFocusOn(e){const t=e.column;let o;const{pinnedRowModel:s,rowModel:i}=this.beans;switch(e.rowPinned){case"top":o=s?.getPinnedTopRow(e.rowIndex);break;case"bottom":o=s?.getPinnedBottomRow(e.rowIndex);break;default:o=i.getRow(e.rowIndex)}return!!o&&!this.isSuppressNavigable(t,o)}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,o=En(this.beans,t,!0);return o?{rowIndex:o.rowIndex,column:e.column,rowPinned:o.rowPinned}:null}getCellAbove(e){if(!e)return null;const t=this.rowSpanSvc?.getCellStart(e)??e,o=Mn(this.beans,{rowIndex:t.rowIndex,rowPinned:t.rowPinned},!0);return o?{rowIndex:o.rowIndex,column:e.column,rowPinned:o.rowPinned}:null}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const{visibleCols:t,pagination:o}=this.beans,s=t.allCols;let i=e.rowIndex,n=e.rowPinned,r=t.getColAfter(e.column);if(!r){r=s[0];const t=En(this.beans,e,!0);if(a(t))return null;if(!t.rowPinned&&!(o?.isRowInPage(t.rowIndex)??1))return null;i=t?t.rowIndex:null,n=t?t.rowPinned:null}return{rowIndex:i,column:r,rowPinned:n}}getNextTabbedCellBackwards(t){const{beans:o}=this,{visibleCols:s,pagination:i}=o,n=s.allCols;let r=t.rowIndex,l=t.rowPinned,d=s.getColBefore(t.column);if(!d){d=e(n);const s=Mn(o,{rowIndex:t.rowIndex,rowPinned:t.rowPinned},!0);if(a(s))return null;if(!s.rowPinned&&!(i?.isRowInPage(s.rowIndex)??1))return null;r=s?s.rowIndex:null,l=s?s.rowPinned:null}return{rowIndex:r,column:d,rowPinned:l}}isSuppressNavigable(e,t){const{suppressNavigable:o}=e.colDef;return"boolean"==typeof o?o:"function"==typeof o&&o(e.createColumnFunctionCallbackParams(t))}},class extends Oe{constructor(){super(...arguments),this.beanName="headerNavigation",this.currentHeaderRowWithoutSpan=-1}postConstruct(){const e=this.beans;e.ctrlsSvc.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl});const t=b(e);this.addManagedElementListeners(t,{mousedown:()=>{this.currentHeaderRowWithoutSpan=-1}})}getHeaderPositionForColumn(t,o){let s;const{colModel:i,colGroupSvc:n,ctrlsSvc:r}=this.beans;if("string"==typeof t?(s=i.getCol(t),s||(s=n?.getColumnGroup(t)??null)):s=t,!s)return null;const l=r.getHeaderRowContainerCtrl()?.getAllCtrls(),a="filter"===e(l||[]).type,d=On(this.beans)-1;let c=-1,h=s;for(;h;)c++,h=h.getParent();let u=c;return o&&a&&u===d-1&&u++,-1===u?null:{headerRowIndex:u,column:s}}navigateVertically(e,t){const{focusSvc:o,visibleCols:s}=this.beans,{focusedHeader:i}=o;if(!i)return!1;const{headerRowIndex:n}=i,r=i.column,l=On(this.beans),a=this.getHeaderRowType(n),d=s.headerGroupRowCount;let{headerRowIndex:c,column:h,headerRowIndexWithoutSpan:u}="UP"===e?function(e,t,o){const s=o-1;if("filter"!==e){const e=t instanceof Fo&&t.isSpanHeaderHeight();let o=t.getParent();for(;o&&(o.getProvidedColumnGroup().getLevel()>s||e&&o.isPadding());)o=o.getParent();if(o)return e?{column:o,headerRowIndex:o.getProvidedColumnGroup().getLevel(),headerRowIndexWithoutSpan:s}:{column:o,headerRowIndex:s,headerRowIndexWithoutSpan:s}}return{column:t,headerRowIndex:s,headerRowIndexWithoutSpan:s}}(a,r,n):function(e,t,o){const s=t+1,i={column:e,headerRowIndex:s,headerRowIndexWithoutSpan:s};if(e instanceof gs){if(s>=o)return{column:e.getDisplayedLeafColumns()[0],headerRowIndex:o,headerRowIndexWithoutSpan:s};let t=e.getDisplayedChildren()[0];if(t instanceof gs&&t.isPadding()){const e=t.getDisplayedLeafColumns()[0];e.isSpanHeaderHeight()&&(t=e)}i.column=t,t instanceof Fo&&t.isSpanHeaderHeight()&&(i.headerRowIndex=o,i.headerRowIndexWithoutSpan=s)}return i}(r,n,d),g=!1;return c<0&&(c=0,h=r,g=!0),c>=l?(c=-1,this.currentHeaderRowWithoutSpan=-1):void 0!==u&&(this.currentHeaderRowWithoutSpan=u),!(!g&&!h)&&o.focusHeaderPosition({headerPosition:{headerRowIndex:c,column:h},allowUserOverride:!0,event:t})}navigateHorizontally(e,t=!1,o){const{focusSvc:s,gos:i}=this.beans,n={...s.focusedHeader};let r,l;-1!==this.currentHeaderRowWithoutSpan?n.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=n.headerRowIndex,"LEFT"===e!==i.get("enableRtl")?(l="Before",r=this.findHeader(n,l)):(l="After",r=this.findHeader(n,l));const a=i.getCallback("tabToNextHeader");if(t&&a){const e=s.focusHeaderPositionFromUserFunc({userFunc:a,headerPosition:r,direction:l});if(e){const{headerRowIndex:e}=s.focusedHeader||{};null!=e&&e!=n.headerRowIndex&&(this.currentHeaderRowWithoutSpan=e)}return e}return r||!t?s.focusHeaderPosition({headerPosition:r,direction:l,fromTab:t,allowUserOverride:!0,event:o}):this.focusNextHeaderRow(n,l,o)}focusNextHeaderRow(t,o,s){const i=this.beans,n=t.headerRowIndex;let r,l=null;const a=On(i),d=this.beans.visibleCols.allCols;if("Before"===o){if(n<=0)return!1;l=e(d),r=n-1,this.currentHeaderRowWithoutSpan-=1}else l=d[0],r=n+1,this.currentHeaderRowWithoutSpan=a&&(h=-1),i.focusSvc.focusHeaderPosition({headerPosition:{column:c,headerRowIndex:h},direction:o,fromTab:!0,allowUserOverride:!0,event:s})}scrollToColumn(t,o="After"){if(t.getPinned())return;let s;if(us(t)){const i=t.getDisplayedLeafColumns();s="Before"===o?e(i):i[0]}else s=t;this.gridBodyCon.scrollFeature.ensureColumnVisible(s)}findHeader(e,t){const{colGroupSvc:o,visibleCols:s}=this.beans;let i=e.column;if(i instanceof gs){const e=i.getDisplayedLeafColumns();i="Before"===t?e[0]:e[e.length-1]}const n="Before"===t?s.getColBefore(i):s.getColAfter(i);if(!n)return;const r=s.headerGroupRowCount;if(e.headerRowIndex>=r)return{headerRowIndex:e.headerRowIndex,column:n};const l=o?.getColGroupAtLevel(n,e.headerRowIndex);return l?l.isPadding()&&n.isSpanHeaderHeight()?{headerRowIndex:s.headerGroupRowCount,column:n}:{headerRowIndex:e.headerRowIndex,column:l??n}:{headerRowIndex:n instanceof Fo&&n.isSpanHeaderHeight()?s.headerGroupRowCount:e.headerRowIndex,column:n}}getHeaderRowType(e){const t=this.beans.ctrlsSvc.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}}],apiFunctions:{getFocusedCell:function(e){return e.focusSvc.getFocusedCell()},clearFocusedCell:function(e){return e.focusSvc.clearFocusedCell()},setFocusedCell:function(e,t,o,s){e.focusSvc.setFocusedCell({rowIndex:t,column:o,rowPinned:s,forceBrowserFocus:!0})},setFocusedHeader:function(e,t,o=!1){const s=e.headerNavigation?.getHeaderPositionForColumn(t,o);s&&e.focusSvc.focusHeaderPosition({headerPosition:s})},tabToNextCell:function(e,t){return e.navigation?.tabToNextCell(!1,t)??!1},tabToPreviousCell:function(e,t){return e.navigation?.tabToNextCell(!0,t)??!1}}},Qh=class extends Oe{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 o of this.elements)o&&(K(o,t),pe(o,e))}},Xh={moduleName:"PinnedColumn",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="pinnedCols"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl});const e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const{gos:e,visibleCols:t,eventSvc:o}=this.beans,s=kt(e,"print"),i=s?0:t.getColsLeftWidth(),n=s?0:t.getDisplayedColumnsRightWidth();i!=this.leftWidth&&(this.leftWidth=i,o.dispatchEvent({type:"leftPinnedWidthChanged"})),n!=this.rightWidth&&(this.rightWidth=n,o.dispatchEvent({type:"rightPinnedWidthChanged"}))}keepPinnedColumnsNarrowerThanViewport(){const e=Q(this.gridBodyCtrl.eBodyViewport);if(e<=50)return;const t=this.getPinnedColumnsOverflowingViewport(e-50),o=this.gos.getCallback("processUnpinnedColumns"),{columns:s,hasLockedPinned:i}=t;let n=s;(n.length||i)&&(o&&(n=o({columns:n,viewportWidth:e})),n?.length&&(n=n.filter(e=>!os(e)),this.setColsPinned(n,null,"viewportSizeFeature")))}createPinnedWidthFeature(e,...t){return new Qh(e,t)}setColsPinned(e,t,o){const{colModel:s,colAnimation:i,visibleCols:n,gos:r}=this.beans;if(!s.cols)return;if(!e?.length)return;if(kt(r,"print"))return void Dt(37);let l;i?.start(),l=!0===t||"left"===t?"left":"right"===t?"right":null;const a=[];for(const d of e){if(!d)continue;const e=s.getCol(d);e&&e.getPinned()!==l&&(this.setColPinned(e,l),a.push(e))}a.length&&(n.refresh(o),ba(this.eventSvc,a,o)),i?.finish()}initCol(e){const{pinned:t,initialPinned:o}=e.colDef;void 0!==t?this.setColPinned(e,t):this.setColPinned(e,o)}setColPinned(e,t){e.pinned=!0===t||"left"===t?"left":"right"===t?"right":null,e.dispatchStateUpdatedEvent("pinned")}setupHeaderPinnedWidth(e){const{scrollVisibleSvc:t}=this.beans;if(null==e.pinned)return;const o="left"===e.pinned,s="right"===e.pinned;e.hidden=!0;const i=()=>{const i=o?this.leftWidth:this.rightWidth;if(null==i)return;const n=0==i,r=e.hidden!==n,l=this.gos.get("enableRtl"),a=t.getScrollbarWidth(),d=t.verticalScrollShowing&&(l&&o||!l&&s)?i+a:i;e.comp.setPinnedContainerWidth(`${d}px`),e.comp.setDisplayed(!n),r&&(e.hidden=n,e.refresh())};e.addManagedEventListeners({leftPinnedWidthChanged:i,rightPinnedWidthChanged:i,scrollVisibilityChanged:i,scrollbarWidthChanged:i})}getHeaderResizeDiff(e,t){if(t.getPinned()){const{leftWidth:t,rightWidth:o}=this,s=Q(this.beans.ctrlsSvc.getGridBodyCtrl().eBodyViewport)-50;if(t+o+e>s){if(!(s>t+o))return 0;e=s-t-o}}return e}getPinnedColumnsOverflowingViewport(e){const t=(this.rightWidth??0)+(this.leftWidth??0);let o=!1;if(t0;){if(r0){const e=i[l++];if(e.colDef.lockPinned){o=!0;continue}d-=e.getActualWidth(),a.push(e)}}return{columns:a,hasLockedPinned:o}}}],css:[".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}"]},Jh=class extends He{constructor(){super(),this.beanName="ariaAnnounce",this.descriptionContainer=null,this.pendingAnnouncements=/* @__PURE__ */new Map,this.lastAnnouncement="",this.updateAnnouncement=je(this,this.updateAnnouncement.bind(this),200)}postConstruct(){const e=this.beans,t=this.descriptionContainer=b(e).createElement("div");t.classList.add("ag-aria-description-container"),A(t,"polite"),x(t,"relevant","additions text"),x(t,"atomic",!0),e.eRootDiv.appendChild(t)}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;null!=t&&""!=t.replace(/[ .]/g,"")?(this.lastAnnouncement===t&&(t=`${t}​`),this.lastAnnouncement=t,this.descriptionContainer.textContent=t):this.lastAnnouncement=""}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(se(e),e.remove()),this.descriptionContainer=null,this.pendingAnnouncements.clear()}},eu={moduleName:"Aria",version:mt,beans:[class extends Jh{}]},tu="ag-delay-render",ou={moduleName:"ColumnDelayRender",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="colDelayRenderSvc",this.hideRequested=!1,this.alreadyRevealed=!1,this.timesRetried=0,this.requesters=/* @__PURE__ */new Set}hideColumns(e){this.alreadyRevealed||this.requesters.has(e)||(this.requesters.add(e),this.hideRequested||(this.beans.ctrlsSvc.whenReady(this,e=>{e.gridBodyCtrl.eGridBody.classList.add(tu)}),this.hideRequested=!0))}revealColumns(e){if(this.alreadyRevealed||!this.isAlive())return;if(this.requesters.delete(e),this.requesters.size>0)return;const{renderStatus:t,ctrlsSvc:o}=this.beans;if(t){if(!t.areHeaderCellsRendered()&&this.timesRetried<5)return this.timesRetried++,void setTimeout(()=>this.revealColumns(e));this.timesRetried=0}o.getGridBodyCtrl().eGridBody.classList.remove(tu),this.alreadyRevealed=!0}}],css:[":where(.ag-delay-render){.ag-cell,.ag-header-cell,.ag-header-group-cell,.ag-row,.ag-spanned-cell-wrapper{visibility:hidden}}"]},su=class extends Pi{constructor(){super()}},iu={tag:"div",cls:"ag-overlay-exporting-center",children:[{tag:"span",ref:"eExportingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eExportingText",cls:"ag-exporting-text"}]},nu={tag:"div",cls:"ag-overlay-loading-center",children:[{tag:"span",ref:"eLoadingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eLoadingText",cls:"ag-loading-text"}]},ru={tag:"span",cls:"ag-overlay-no-matching-rows-center"},lu={tag:"span",cls:"ag-overlay-no-rows-center"},au={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"}]}]},du=class extends Pi{constructor(){super(au),this.eOverlayWrapper=null,this.activeOverlay=null,this.activePromise=null,this.activeCssClass=null,this.elToFocusAfter=null,this.overlayExclusive=!1,this.oldWrapperPadding=null,this.registerCSS(".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)}")}handleKeyDown(t){if(t.key!==ms||t.defaultPrevented||Yi(t))return;const{beans:o,eOverlayWrapper:s}=this;if(s&&Ui(o,s,!1,t.shiftKey))return;let i=!1;i=t.shiftKey?o.focusSvc.focusGridView({column:e(o.visibleCols.allCols),backwards:!0,canFocusOverlay:!1}):Ln(o,!1),i&&t.preventDefault()}updateLayoutClasses(e,t){const o=this.eOverlayWrapper;if(!o)return;const s=o.classList,{AUTO_HEIGHT:i,NORMAL:n,PRINT:r}=Sr;s.toggle(i,t.autoHeight),s.toggle(n,t.normal),s.toggle(r,t.print)}postConstruct(){this.createManagedBean(new Rr(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;t?(this.activeCssClass&&t.toggle(this.activeCssClass,!1),this.activeCssClass=e,t.toggle(e,!0)):this.activeCssClass=null}showOverlay(e,t,o){if(this.destroyActiveOverlay(),this.elToFocusAfter=null,this.activePromise=e,this.overlayExclusive=o,!e)return this.refreshWrapperPadding(),Ns.resolve();if(this.setWrapperTypeClass(t),this.setDisplayed(!0,{skipAriaHidden:!0}),this.refreshWrapperPadding(),o&&this.isGridFocused()){const e=w(this.beans);e&&!y(this.beans)&&(this.elToFocusAfter=e)}return e.then(t=>{const s=this.eOverlayWrapper;s?this.activePromise===e?(this.activePromise=null,t&&(this.activeOverlay!==t&&(s.appendChild(t.getGui()),this.activeOverlay=t),o&&this.isGridFocused()&&Wi(s))):this.activeOverlay!==t&&(this.destroyBean(t),t=null):this.destroyBean(t)}),e}refreshWrapperPadding(){if(!this.eOverlayWrapper)return void(this.oldWrapperPadding=null);let e=0;(!!this.activeOverlay||!!this.activePromise)&&!this.overlayExclusive&&(e=this.beans.ctrlsSvc.get("gridHeaderCtrl")?.headerHeight||0),e!==this.oldWrapperPadding&&(this.oldWrapperPadding=e,this.eOverlayWrapper.style.setProperty("padding-top",`${e}px`))}destroyActiveOverlay(){this.activePromise=null;const e=this.activeOverlay;if(!e)return this.overlayExclusive=!1,this.elToFocusAfter=null,void this.refreshWrapperPadding();let t=this.elToFocusAfter;this.elToFocusAfter=null,this.activeOverlay=null,this.overlayExclusive=!1,t&&!this.isGridFocused()&&(t=null),this.destroyBean(e);const o=this.eOverlayWrapper;o&&se(o),t?.focus?.({preventScroll:!0}),this.refreshWrapperPadding()}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}isGridFocused(){const e=w(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}},cu={selector:"AG-OVERLAY-WRAPPER",component:du},hu=["refresh"],uu=e=>({name:e,optionalMethods:hu}),gu={id:"agLoadingOverlay",overlayType:"loading",comp:uu("loadingOverlayComponent"),wrapperCls:"ag-overlay-loading-wrapper",exclusive:!0,compKey:"loadingOverlayComponent",paramsKey:"loadingOverlayComponentParams",isSuppressed:e=>{const t=e.get("loading");return!1===t||!0===e.get("suppressLoadingOverlay")&&!0!==t}},pu={id:"agNoRowsOverlay",overlayType:"noRows",comp:uu("noRowsOverlayComponent"),wrapperCls:"ag-overlay-no-rows-wrapper",compKey:"noRowsOverlayComponent",paramsKey:"noRowsOverlayComponentParams",isSuppressed:e=>e.get("suppressNoRowsOverlay")},mu={id:"agNoMatchingRowsOverlay",overlayType:"noMatchingRows",comp:uu("noMatchingRowsOverlayComponent"),wrapperCls:"ag-overlay-no-matching-rows-wrapper"},fu={id:"agExportingOverlay",overlayType:"exporting",comp:uu("exportingOverlayComponent"),wrapperCls:"ag-overlay-exporting-wrapper",exclusive:!0},Cu={id:"activeOverlay",comp:uu("activeOverlay"),wrapperCls:"ag-overlay-modal-wrapper",exclusive:!0},vu={moduleName:"Overlay",version:mt,userComponents:{agLoadingOverlay:class extends su{constructor(){super(...arguments),this.eLoadingIcon=null,this.eLoadingText=null}init(e){const{beans:t,gos:o}=this,s=r(o.get("overlayLoadingTemplate")?.trim());if(this.setTemplate(s??nu),!s){const o=Ol("overlayLoading",t,null);o&&this.eLoadingIcon.appendChild(o);const s=e.loading?.overlayText??this.getLocaleTextFunc()("loadingOoo","Loading...");this.eLoadingText.textContent=s,t.ariaAnnounce.announceValue(s,"overlay")}}},agNoRowsOverlay:class extends su{init(e){const{beans:t,gos:o}=this,s=r(o.get("overlayNoRowsTemplate")?.trim());if(this.setTemplate(s??lu),!s){const o=e.noRows?.overlayText??this.getLocaleTextFunc()("noRowsToShow","No Rows To Show");this.getGui().textContent=o,t.ariaAnnounce.announceValue(o,"overlay")}}},agNoMatchingRowsOverlay:class extends su{init(e){const{beans:t}=this;this.setTemplate(ru);const o=e.noMatchingRows?.overlayText??this.getLocaleTextFunc()("noMatchingRows","No Matching Rows");this.getGui().textContent=o,t.ariaAnnounce.announceValue(o,"overlay")}},agExportingOverlay:class extends su{constructor(){super(...arguments),this.eExportingIcon=null,this.eExportingText=null}init(e){const{beans:t}=this;this.setTemplate(iu);const o=Ol("overlayExporting",t,null);o&&this.eExportingIcon.appendChild(o);const s=e.exporting?.overlayText??this.getLocaleTextFunc()("exportingOoo","Exporting...");this.eExportingText.textContent=s,t.ariaAnnounce.announceValue(s,"overlay")}}},apiFunctions:{showLoadingOverlay:function(e){e.overlays?.showLoadingOverlay()},showNoRowsOverlay:function(e){e.overlays?.showNoRowsOverlay()},hideOverlay:function(e){e.overlays?.hideOverlay()}},icons:{overlayLoading:"loading",overlayExporting:"loading"},beans:[class extends Oe{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=It(e);const t=()=>{this.userForcedNoRows||this.updateOverlay(!1)},[o,s,i,n]=this.addManagedEventListeners({newColumnsLoaded:t,rowCountReady:()=>{this.disableInitialOverlay(),t(),s()},rowDataUpdated:t,modelUpdated:t});this.newColumnsLoadedCleanup=o,this.addManagedPropertyListeners(["loading","activeOverlay","activeOverlayParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams"],e=>this.onPropChange(new Set(e.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"))return;if(this.isDisabled(gu))return;const t=e.get("loading");(t||void 0===t)&&this.doShowOverlay(gu)}showNoRowsOverlay(){this.showInitialOverlay=!1;const e=this.gos;!this.eWrapper||e.get("activeOverlay")||e.get("loading")||this.isDisabled(pu)||(this.userForcedNoRows=!0,this.doShowOverlay(pu))}async showExportOverlay(e){const{gos:t,beans:o}=this;if(!this.eWrapper||t.get("activeOverlay")||t.get("loading")||this.isDisabled(fu)||this.userForcedNoRows&&this.currentDef===pu)return void e();const s=this.getDesiredDefWithOverride(fu);if(!s)return void e();this.exportsInProgress++,this.focusedCell=o.focusSvc.getFocusedCell(),await this.doShowOverlay(s),await new Promise(e=>setTimeout(()=>e()));const i=Date.now();try{e()}finally{const e=Date.now()-i,t=Math.max(0,300-e),s=()=>{this.exportsInProgress--,0===this.exportsInProgress&&(this.updateOverlay(!1),function(e,t){const o=e.focusSvc,s=o.getFocusedCell();if(s&&t&&bn(s,t)){const{rowIndex:s,rowPinned:i,column:n}=t;y(e)&&o.setFocusedCell({rowIndex:s,column:n,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!Vi()})}}(o,this.focusedCell),this.focusedCell=null)};t>0?setTimeout(()=>s(),t):s()}}hideOverlay(){const e=this.gos;this.showInitialOverlay=!1;const t=this.userForcedNoRows;this.userForcedNoRows=!1,e.get("loading")?Dt(99):e.get("activeOverlay")?Dt(296):this.currentDef!==mu?(this.doHideOverlay(),t&&this.getOverlayDef()!==pu&&this.updateOverlay(!1)):Dt(297)}getOverlayWrapperSelector(){return cu}getOverlayWrapperCompClass(){return du}onPropChange(e){const t=e.has("activeOverlay");if((t||e.has("loading"))&&this.updateOverlay(t))return;const o=this.currentDef,s=this.eWrapper?.activeOverlay;if(s&&o){const t=e.has("activeOverlayParams");if(o===Cu)t&&s.refresh?.(this.makeCompParams(!0));else{const t=o.paramsKey;(e.has("overlayComponentParams")||t&&e.has(t))&&s.refresh?.(this.makeCompParams(!1,t,o.overlayType))}}}updateOverlay(e){const t=this.eWrapper;if(!t)return this.currentDef=null,!1;const o=this.getDesiredDefWithOverride(),s=this.currentDef,i=o===Cu&&e;return o!==s?o?(this.doShowOverlay(o),!0):(this.disableInitialOverlay(),this.doHideOverlay()):i&&o?(t.hideOverlay(),this.doShowOverlay(o),!0):(o||this.disableInitialOverlay(),!1)}getDesiredDefWithOverride(e){const{gos:t}=this;let o=(s=t.get("activeOverlay"))?{agLoadingOverlay:gu,agNoRowsOverlay:pu,agNoMatchingRowsOverlay:mu,agExportingOverlay:fu}[s]??Cu:null;var s;return o||(o=e??this.getOverlayDef(),o&&this.isDisabled(o)&&(o=null)),o}getOverlayDef(){const{gos:e,beans:t}=this,{rowModel:o}=t,s=e.get("loading");if(void 0!==s){if(this.disableInitialOverlay(),s)return gu}else if(this.showInitialOverlay){if(!(this.isDisabled(gu)||e.get("columnDefs")&&e.get("rowData")))return gu;this.disableInitialOverlay()}else this.disableInitialOverlay();return(i=o.getOverlayType())?{loading:gu,noRows:pu,noMatchingRows:mu,exporting:fu}[i]:null;var i}disableInitialOverlay(){this.showInitialOverlay=!1,this.newColumnsLoadedCleanup?.(),this.newColumnsLoadedCleanup=null}doShowOverlay(e){const{gos:t,beans:o}=this,{userCompFactory:s}=o;this.currentDef=e;const i=e!==Cu,n=!!e.exclusive;let r,l;this.exclusive=n,(e.paramsKey&&t.get(e.paramsKey)||e.compKey&&t.get(e.compKey))&&(r=e.paramsKey),i&&(t.get("overlayComponent")||t.get("overlayComponentSelector"))&&(l=s.getCompDetailsFromGridOptions({name:"overlayComponent",optionalMethods:["refresh"]},void 0,this.makeCompParams(!1,e.paramsKey,e.overlayType))),l??(l=s.getCompDetailsFromGridOptions(e.comp,i?e.id:void 0,this.makeCompParams(!i,r,e.overlayType),!1));const a=l?.newAgStackInstance()??null,d=this.eWrapper?this.eWrapper.showOverlay(a,e.wrapperCls,n):Ns.resolve();return this.eWrapper?.refreshWrapperPadding(),this.setExclusive(n),d}makeCompParams(e,t,o){const{gos:s}=this;return Co(s,(e?s.get("activeOverlayParams"):{...s.get("overlayComponentParams"),...t&&s.get(t)||null,overlayType:o})??{})}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)||!0===e.isSuppressed?.(t)}}]},wu=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.rowNode.id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(e){if(null==e?.id)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 null!=this.entriesMap[e.id]}removeRow(e){const t=e.id,o=this.entriesMap[t];delete this.entriesMap[t],s(this.entriesList,o)}removeFromCache(e){const t=e.rowNode.id;delete this.entriesMap[t],s(this.entriesList,e)}getEntries(){return this.entriesList}};function bu(e){if(!e)return;const t={top:{},bottom:{},normal:{}};for(const o of e){const e=o.id;switch(o.rowPinned){case"top":t.top[e]=o;break;case"bottom":t.bottom[e]=o;break;default:t.normal[e]=o}}return t}function yu(e,t){const o=e.id;switch(e.rowPinned){case"top":return null!=t.top[o];case"bottom":return null!=t.bottom[o];default:return null!=t.normal[o]}}var Su=e=>{if(e.data)return e;let t=e.childrenAfterGroup;for(;t?.length;){const e=t[0];if(e.data)return e;t=e.childrenAfterGroup}},Ru=e=>{if(!e)return e;if("bigint"==typeof e)return e<0n?-e:e;const t=Number(e);return isNaN(t)?e:Math.abs(t)},xu=(e,t)=>({tag:"span",ref:`eSort${e}`,cls:`ag-sort-indicator-icon ag-sort-${t} ag-hidden`,attrs:{"aria-hidden":"true"}}),Fu={tag:"span",cls:"ag-sort-indicator-container",children:[xu("Order","order"),xu("Asc","ascending-icon"),xu("Desc","descending-icon"),xu("Mixed","mixed-icon"),xu("AbsoluteAsc","absolute-ascending-icon"),xu("AbsoluteDesc","absolute-descending-icon"),xu("None","none-icon")]},Du=class extends Pi{constructor(e){super(),this.eSortOrder=null,this.eSortAsc=null,this.eSortDesc=null,this.eSortMixed=null,this.eSortNone=null,this.eSortAbsoluteAsc=null,this.eSortAbsoluteDesc=null,e||this.setTemplate(Fu)}attachCustomElements(e,t,o,s,i,n,r){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=o,this.eSortMixed=s,this.eSortNone=i,this.eSortAbsoluteAsc=n,this.eSortAbsoluteDesc=r}setupSort(e,t=!1,o){if(this.column=e,this.suppressOrder=t,this.getSortDefOverride=o,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 s=this.updateIcons.bind(this),i=this.onSortChanged.bind(this);this.addManagedPropertyListener("unSortIcon",s),this.addManagedEventListeners({newColumnsLoaded:s,sortChanged:i,columnRowGroupChanged:i}),this.onSortChanged()}addInIcon(e,t,o){if(null==t)return;const s=Ol(e,this.beans,o);s&&t.appendChild(s)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const{eSortAsc:e,eSortDesc:t,eSortAbsoluteAsc:o,eSortAbsoluteDesc:s,eSortNone:i,column:n,gos:r,beans:l}=this,a=ko(n,l,this.getSortDefOverride),d=a.isDefaultSortAllowed,c=a.isAbsoluteSortAllowed,{isAbsoluteSort:h,isDefaultSort:u,isAscending:g,isDescending:p,direction:m}=a;e&&K(e,g&&u&&d,{skipAriaHidden:!0}),t&&K(t,p&&u&&d,{skipAriaHidden:!0}),i&&K(i,!(!n.getColDef().unSortIcon&&!r.get("unSortIcon")||m),{skipAriaHidden:!0}),o&&K(o,g&&h&&c,{skipAriaHidden:!0}),s&&K(s,p&&h&&c,{skipAriaHidden:!0})}setupMultiSortIndicator(){const{eSortMixed:e,column:t,gos:o}=this;this.addInIcon("sortUnSort",e,t);const s=t.getColDef().showRowGroup;Ut(o)&&s&&(this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator())}updateMultiSortIndicator(){const{eSortMixed:e,beans:t,column:o}=this;e&&K(e,"mixed"===t.sortSvc.getDisplaySortForColumn(o)?.direction,{skipAriaHidden:!0})}updateSortOrder(){const{eSortOrder:e,column:t,beans:{sortSvc:o}}=this;if(!e)return;const s=o.getColumnsWithSortingOrdered(),i=o.getDisplaySortIndexForColumn(t)??-1,n=s.some(e=>o.getDisplaySortIndexForColumn(e)??!1);K(e,i>=0&&n,{skipAriaHidden:!0}),i>=0?e.textContent=(i+1).toString():se(e)}refresh(){this.onSortChanged()}},Mu={selector:"AG-SORT-INDICATOR",component:Du},Pu={moduleName:"Sort",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="sortSvc"}progressSort(e,t,o){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,o)}progressSortFromEvent(e,t){const o="ctrl"===this.gos.get("multiSortKey")?t.ctrlKey||t.metaKey:t.shiftKey;this.progressSort(e,o,"uiColumnSorted")}setSortForColumn(e,t,o,s){const{gos:i,showRowGroupCols:n}=this.beans;let r=[e];if(Ut(i)&&e.getColDef().showRowGroup){const t=(n?.getSourceColumnsForGroupColumn?.(e))?.filter(e=>e.isSortable());t&&(r=[e,...t])}for(const a of r)this.setColSort(a,t,s);const l=[];if(!o&&!i.get("alwaysMultiSort")||i.get("suppressMultiSort")){const e=this.clearSortBarTheseColumns(r,s);l.push(...e)}this.updateSortIndex(e),l.push(...r),this.dispatchSortChangedEvents(s,l)}updateSortIndex(e){const{gos:t,colModel:o,showRowGroupCols:s}=this.beans,i=Ut(t),n=s?.getShowRowGroupCol(e.getId()),r=i&&n||e,l=this.getColumnsWithSortingOrdered();o.forAllCols(e=>this.setColSortIndex(e,null));const a=l.filter(e=>!(i&&e.getColDef().showRowGroup||e===r));(r.getSortDef()?[...a,r]:a).forEach((e,t)=>this.setColSortIndex(e,t))}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 o={type:"sortChanged",source:e};t&&(o.columns=t),this.eventSvc.dispatchEvent(o)}clearSortBarTheseColumns(e,t){const o=[];return this.beans.colModel.forAllCols(s=>{e.includes(s)||(s.getSortDef()&&o.push(s),this.setColSort(s,void 0,t))}),o}getNextSortDirection(e,t){const o=e.getSortingOrder(),s=void 0===t?e.getSortDef():Do(t);let i=o.findIndex(e=>To(e,s))+1;return i>=o.length&&(i=0),Do(o[i])}getIndexedSortMap(){const{gos:e,colModel:t,showRowGroupCols:o,rowGroupColsSvc:s}=this.beans;let i=[];if(t.forAllCols(e=>{e.getSortDef()&&i.push(e)}),t.isPivotMode()){const t=Ut(e);i=i.filter(e=>{const s=!!e.getAggFunc(),i=!e.isPrimary(),n=t?o?.getShowRowGroupCol(e.getId()):e.getColDef().showRowGroup;return s||i||n})}const n=s?.columns.filter(e=>!!e.getSortDef())??[],r={};i.forEach((e,t)=>r[e.getId()]=t),i.sort((e,t)=>{const o=e.getSortIndex(),s=t.getSortIndex();return null!=o&&null!=s?o-s:null==o&&null==s?r[e.getId()]>r[t.getId()]?1:-1:null==s?-1:1});const l=Ut(e)&&!!n.length;l&&(i=[...new Set(i.map(e=>o?.getShowRowGroupCol(e.getId())??e))]);const a=/* @__PURE__ */new Map;if(i.forEach((e,t)=>a.set(e,t)),l)for(const d of n){const e=o.getShowRowGroupCol(d.getId());a.set(d,a.get(e))}return a}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([,e],[,t])=>e-t).map(([e])=>e)}collectSortItems(e=!1){const t=[],o=this.getColumnsWithSortingOrdered();for(const s of o){const o=s.getSortDef()?.direction;if(!o)continue;const i={sort:o,type:Ao(s.getSortDef()?.type)};e?i.colId=s.getId():i.column=s,t.push(i)}return t}getSortModel(){return this.collectSortItems(!0)}getSortOptions(){return this.collectSortItems()}canColumnDisplayMixedSort(e){const t=Ut(this.gos),o=!!e.getColDef().showRowGroup;return t&&o}getDisplaySortForColumn(e){const t=this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!t?.length)return e.getSortDef();const o=null!=e.getColDef().field||e.getColDef().valueGetter?[e,...t]:t,s=o[0].getSortDef();return o.every(e=>To(e.getSortDef(),s))?s:{type:Ao(e.getSortDef()?.type),direction:"mixed"}}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}setupHeader(e,t){const o=()=>{const{type:o,direction:s}=Do(t.getSortDef());if(e.toggleCss("ag-header-cell-sorted-asc","asc"===s),e.toggleCss("ag-header-cell-sorted-desc","desc"===s),e.toggleCss("ag-header-cell-sorted-abs-asc","absolute"===o&&"asc"===s),e.toggleCss("ag-header-cell-sorted-abs-desc","absolute"===o&&"desc"===s),e.toggleCss("ag-header-cell-sorted-none",!s),t.getColDef().showRowGroup){const o=!(this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(t))?.every(e=>s==e.getSortDef()?.direction);e.toggleCss("ag-header-cell-sorted-mixed",o)}};e.addManagedEventListeners({sortChanged:o,columnPinned:o,columnRowGroupChanged:o,displayedColumnsChanged:o})}initCol(e){const{sortIndex:t,initialSortIndex:o}=e.colDef,s=cs(e.colDef);s&&e.setSortDef(s,!0),void 0!==t?null!==t&&(e.sortIndex=t):null!==o&&(e.sortIndex=o)}updateColSort(e,t,o){void 0!==t&&this.setColSort(e,Do(t),o)}setColSort(e,t,o){To(e.getSortDef(),t)||(e.setSortDef(Do(t),void 0===t),e.dispatchColEvent("sortChanged",o)),e.dispatchStateUpdatedEvent("sort")}setColSortIndex(e,t){e.sortIndex=t,e.dispatchStateUpdatedEvent("sortIndex")}createSortIndicator(e){return new Du(e)}getSortIndicatorSelector(){return Mu}},class extends Oe{constructor(){super(...arguments),this.beanName="rowNodeSorter",this.accentedSort=!1,this.primaryColumnsSortGroups=!1,this.pivotActive=!1}postConstruct(){this.firstLeaf=It(this.gos)?ea:Su,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=Ut(this.gos)}updatePivotModeState(){this.pivotActive=this.beans.colModel.isPivotActive()}doFullSortInPlace(e,t){return e.sort((e,o)=>this.compareRowNodes(t,e,o))}compareRowNodes(e,t,o){if(t===o)return 0;const s=this.accentedSort;for(let i=0,n=e.length;i{const{sibling:o,pinnedSibling:s}=t;e.refreshRowByNode(t),e.refreshRowByNode(o),e.refreshRowByNode(s),e.refreshRowByNode(o?.pinnedSibling),e.refreshRowByNode(s?.sibling)},Tu={moduleName:"Expression",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="expressionSvc",this.cache={}}evaluate(e,t){if("string"==typeof e)return this.evaluateExpression(e,t);Mt(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(o){return Mt(16,{expression:e,params:t,e:o}),null}}createExpressionFunction(e){const t=this.cache;if(t[e])return t[e];const o=this.createFunctionBody(e),s=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",o);return t[e]=s,s}createFunctionBody(e){return e.includes("return")?e:"return "+e+";"}}]},Iu={moduleName:"ChangeDetection",version:mt,beans:[class extends Oe{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=nn(this.beans),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}beginDeferred(){this.deferredDepth++}endDeferred(){if(0===this.deferredDepth)return;if(--this.deferredDepth>0)return;const e=this.batchedPath,t=this.batchedNodes;this.batchedPath=null,this.batchedNodes=null,e&&this.csrm?.doAggregate(e);const{rowRenderer:o}=this.beans;if(t)for(const s of t)Eu(o,s);if(e){const t=e.getSortedRows();for(let e=0,s=t.length;e{const{beans:o,fns:{[e]:s}}=this;return s?s(o,...t):this.apiNotFound(e)}}}apiNotFound(e){const{beans:t,gos:o,preDestroyLink:s}=this;if(t){const t=kl[e];o.assertModuleRegistered(t,`api.${e}`)&&Dt(27,{fnName:e,module:t})}else Dt(26,{fnName:e,preDestroyLink:s})}destroy(){super.destroy(),this.fns=Ll,this.beans=null}},class extends pd{constructor(){super(...arguments),this.agGridDefaults={},this.agGridDefaultOverrides={},this.jsComps={},this.selectors={},this.icons={}}postConstruct(){const e=this.gos.get("components");if(null!=e)for(const t of Object.keys(e))this.jsComps[t]=e[t]}registerModule(e){const{icons:t,userComponents:o,dynamicBeans:s,selectors:i}=e;if(o){const e=(e,t,o,s)=>{this.agGridDefaults[e]=t,(o||s)&&(this.agGridDefaultOverrides[e]={params:o,processParams:s})};for(const t of Object.keys(o)){let s=o[t];if(md(s)&&(s=s.getComp(this.beans)),"object"==typeof s){const{classImp:o,params:i,processParams:n}=s;e(t,o,i,n)}else e(t,s)}}this.registerDynamicBeans(s);for(const n of i??[])this.selectors[n.selector]=n;if(t)for(const n of Object.keys(t))this.icons[n]=t[n]}getUserComponent(e,t){const o=(e,t,o,s)=>({componentFromFramework:t,component:e,params:o,processParams:s}),{frameworkOverrides:s}=this.beans,i=s.frameworkComponent(t,this.gos.get("components"));if(null!=i)return o(i,!0);const n=this.jsComps[t];if(n)return o(n,s.isFrameworkComponent(n));const r=this.agGridDefaults[t];if(r){const e=this.agGridDefaultOverrides[t];return o(r,!1,e?.params,e?.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?Et(279,{name:e}):this.beans.validation?.missingDynamicBean(e)??Et(256)}},class extends Oe{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,o,s=!1){return this.getCompDetails(this.gridOptions,e,t,o,s)}getCompDetails(e,t,o,s,i=!1){const{name:n,cellRenderer:r}=t;let l,a,{compName:d,jsComp:c,fwComp:h,paramsFromSelector:u,popupFromSelector:g,popupPositionFromSelector:p}=Os(this.beans.frameworkOverrides,e,t,s);const m=e=>{const t=this.registry.getUserComponent(n,e);t&&(c=t.componentFromFramework?void 0:t.component,h=t.componentFromFramework?t.component:void 0,l=t.params,a=t.processParams)};var f;if(null!=d&&m(d),null==c&&null==h&&null!=o&&m(o),!c||!r||(f=c)&&f.prototype&&"getGui"in f.prototype||(c=this.agCompUtils?.adaptFunction(t,c)),!c&&!h){const{validation:e}=this.beans;return void(!i||d===o&&o?o&&!e&&Mt(146,{comp:o}):d?e?.isProvidedUserComp(d)||Mt(50,{compName:d}):o?e||Mt(260,{...this.gos.getModuleErrorParams(),propName:n,compName:o}):Mt(216,{name:n}))}const C=this.mergeParams(e,t,s,u,l,a),v=null==c,w=c??h;return{componentFromFramework:v,componentClass:w,params:C,type:t,popupFromSelector:g,popupPositionFromSelector:p,newAgStackInstance:()=>this.newAgStackInstance(w,v,C,t)}}newAgStackInstance(e,t,o,s){let i;i=t?this.frameworkCompWrapper.wrap(e,s.mandatoryMethods,s.optionalMethods,s):new e,this.createBean(i);const n=i.init?.(o);return null==n?Ns.resolve(i):n.then(()=>i)}mergeParams(e,t,o,s=null,i,n){const r={...o,...i},l=e?.[t.name+"Params"];return"function"==typeof l?Ye(r,l(o)):"object"==typeof l&&Ye(r,l),Ye(r,s),n?n(r):r}},class extends Oe{constructor(){super(...arguments),this.beanName="rowContainerHeight",this.scrollY=0,this.uiBodyHeight=0}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=function(){if(void 0!==Ri)return Ri;if(!document.body)return-1;let e=1e6;const t=Ti()?6e6:1e9,o=document.createElement("div");for(document.body.appendChild(o);;){const s=2*e;if(o.style.height=s+"px",s>t||o.clientHeight!==s)break;e=s}return o.remove(),Ri=e,e}(),tt(this.gos,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*this.pixelsToShave;tt(this.gos,this.pixelsToShave),this.setDivStretchOffset(e)}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="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventSvc.dispatchEvent({type:"heightScaleChanged"}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&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=e/(this.modelHeight-this.getUiBodyHeight());return this.maxScrollY*t}},class extends Oe{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:o,colModel:s,colGroupSvc:i,colViewport:n,selectionColSvc:r}=this.beans;t||this.buildTrees(s,i),i?.updateOpenClosedVisibility(),this.leftCols=Ta(this.treeLeft),this.centerCols=Ta(this.treeCenter),this.rightCols=Ta(this.treeRight),r?.refreshVisibility(this.leftCols,this.centerCols,this.rightCols),this.joinColsAriaOrder(s),this.joinCols(),this.headerGroupRowCount=this.getHeaderRowCount(),this.setLeftValues(e),this.autoHeightCols=this.allCols.filter(e=>e.isAutoHeight()),o?.refreshFlexedColumns(),this.updateBodyWidths(),this.setFirstRightAndLastLeftPinned(s,this.leftCols,this.rightCols,e),n.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 o=t.getParent();for(;o;){if(!o.isPadding()){const t=o.getProvidedColumnGroup().getLevel()+1;t>e&&(e=t);break}o=o.getParent()}}return e}updateBodyWidths(){const e=Xo(this.centerCols),t=Xo(this.leftCols),o=Xo(this.rightCols);this.isBodyWidthDirty=this.bodyWidth!==e,this.bodyWidth===e&&this.leftWidth===t&&this.rightWidth===o||(this.bodyWidth=e,this.leftWidth=t,this.rightWidth=o,this.eventSvc.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventSvc.dispatchEvent({type:"displayedColumnsWidthChanged"}))}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(t,o,s,i){let n,r;this.gos.get("enableRtl")?(n=o?o[0]:null,r=s?e(s):null):(n=o?e(o):null,r=s?s[0]:null);for(const e of t.getCols())e.setLastLeftPinned(e===n,i),e.setFirstRightPinned(e===r,i)}buildTrees(e,t){const o=e.getColsToShow(),s=o.filter(e=>"left"==e.getPinned()),i=o.filter(e=>"right"==e.getPinned()),n=o.filter(e=>"left"!=e.getPinned()&&"right"!=e.getPinned()),r=new Ma,l=e=>t?t.createColumnGroups(e):e.columns;this.treeLeft=l({columns:s,idCreator:r,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=l({columns:i,idCreator:r,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=l({columns:n,idCreator:r,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.ariaOrderColumns=[]}joinColsAriaOrder(e){const t=e.getCols(),o=[],s=[],i=[];for(const n of t){const e=n.getPinned();e?!0===e||"left"===e?o.push(n):i.push(n):s.push(n)}this.ariaOrderColumns=o.concat(s).concat(i)}getAriaColIndex(e){let t;return t=us(e)?e.getLeafColumns()[0]:e,this.ariaOrderColumns.indexOf(t)+1}setLeftValuesOfGroups(){for(const e of[this.treeLeft,this.treeRight,this.treeCenter])for(const t of e)us(t)&&t.checkLeft()}setLeftValuesOfCols(e){const{colModel:t}=this.beans;if(!t.getColDefCols())return;const o=t.getCols().slice(0),s=this.gos.get("enableRtl");for(const i of[this.leftCols,this.rightCols,this.centerCols]){if(s){let t=Xo(i);for(const o of i)t-=o.getActualWidth(),o.setLeft(t,e)}else{let t=0;for(const o of i)o.setLeft(t,e),t+=o.getActualWidth()}Pa(o,i)}for(const i of o)i.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:o}}=this;return o.colSpanActive?this.getColsForRow(e,t):t}getRightColsForRow(e){const{rightCols:t,beans:{colModel:o}}=this;return o.colSpanActive?this.getColsForRow(e,t):t}getColsForRow(e,t,o,s){const i=[];let n=null;for(let r=0;r1){const e=d-1;for(let o=1;o<=e;o++)c.push(t[r+o]);r+=e}let h;if(o){h=!1;for(const e of c)o(e)&&(h=!0)}else h=!0;h&&(0===i.length&&n&&s&&s(l)&&i.push(n),i.push(l)),n=l}return i}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getColBefore(e){const t=this.allCols,o=t.indexOf(e);return o>0?t[o-1]:null}isPinningLeft(){return this.leftCols.length>0}isPinningRight(){return this.rightCols.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=e=>{this.colsAndGroupsMap[e.getUniqueId()]=e};Ea(this.treeCenter,!1,e),Ea(this.treeLeft,!1,e),Ea(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}getFirstColumn(){const t=this.gos.get("enableRtl"),o=["leftCols","centerCols","rightCols"];t&&o.reverse();for(let s=0;s(t,o)=>{if(!this.isAlive())return;const s=zc.has(t);if(s&&!e||!s&&e)return;if(!function(e){return!!Wc[e]}(t))return;const i=(e,t)=>{const o=Wc[e],s=this.gridOptions[o];"function"==typeof s&&this.beans.frameworkOverrides.wrapOutgoing(()=>s(t))};if(this.gridReadyFired)i(t,o);else if("gridReady"===t){i(t,o),this.gridReadyFired=!0;for(const e of this.queueEvents)i(e.eventName,e.event);this.queueEvents=[]}else this.queueEvents.push({eventName:t,event:o})}}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]??Je[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return l(this.gridOptions[e])}mergeGridCommonParams(e){return e?t=>e(this.addCommon(t)):e}updateGridOptions({options:e,force:t,source:o="api"}){const s={id:ih++,properties:[]},i=[],{gridOptions:n,validation:r}=this;for(const l of Object.keys(e)){const a=Xe.applyGlobalGridOption(l,e[l]);r?.warnOnInitialPropertyUpdate(o,l);const d=t||"object"==typeof a&&"api"===o,c=n[l];if(d||c!==a){n[l]=a;const e={type:l,currentValue:a,previousValue:c,changeSet:s,source:o};i.push(e)}}this.validateGridOptions(this.gridOptions),s.properties=i.map(e=>e.type);for(const l of i)tt(this,l.type,l.previousValue,l.currentValue),this.propEventSvc.dispatchEvent(l)}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 o of Object.keys(e)){const s=e[o];if(null==s||!1===s)continue;let i=t[o];"function"==typeof i&&(i=i(e,this.gridOptions,this.beans)),i&&this.assertModuleRegistered(i,o)}}validateGridOptions(e){this.validateOptions(e,oh),this.validation?.processGridOptions(e)}validateColDef(e,t,o){!o&&this.beans.dataTypeSvc?.isColPendingInference(t)||(this.validateOptions(e,jc),this.validation?.validateColDef(e))}assertModuleRegistered(e,t){const o=Array.isArray(e)?e.some(e=>this.isModuleRegistered(e)):this.isModuleRegistered(e);return o||Mt(200,{...this.getModuleErrorParams(),moduleName:e,reasonOrId:t}),o}getModuleErrorParams(){return{gridId:this.gridId,gridScoped:ut(),rowModelType:this.get("rowModelType"),isUmd:!1}}isModuleRegistered(e){return ht(e,this.gridId,this.get("rowModelType"))}setInstanceDomData(e){e[rh]=this.instanceId}isElementInThisInstance(e){let t=e;for(;t;){const e=t[rh];if(l(e))return e===this.instanceId;t=t.parentElement}return!1}},class extends Oe{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(ls(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),ls(e.source)))}createColsFromColDefs(e){const{beans:t}=this,{valueCache:o,colAutosize:s,rowGroupColsSvc:i,pivotColsSvc:n,valueColsSvc:r,visibleCols:l,eventSvc:a,groupHierarchyColSvc:d}=t,c=this.colDefs?ka(t,e):void 0;o?.expire();const h=this.colDefCols?.list,u=this.colDefCols?.tree,g=zo(t,this.colDefs,!0,u,e);Jo(t,this.colDefCols?.tree,g.columnTree);const p=g.columnTree,m=g.treeDepth,f=Qo(p),C={};for(const v of f)C[v.getId()]=v;this.colDefCols={tree:p,treeDepth:m,list:f,map:C},this.createColumnsForService([d],this.colDefCols,e),i?.extractCols(e,h),n?.extractCols(e,h),r?.extractCols(e,h),this.ready=!0,this.changeEventsDispatching=!0,this.refreshCols(!0,e),this.changeEventsDispatching=!1,l.refresh(e),a.dispatchEvent({type:"columnEverythingChanged",source:e}),c&&(this.changeEventsDispatching=!0,c(),this.changeEventsDispatching=!1),a.dispatchEvent({type:"newColumnsLoaded",source:e}),"gridInitializing"===e&&s?.applyAutosizeStrategy()}refreshCols(e,o){if(!this.colDefCols)return;const s=this.cols?.tree;this.saveColOrder();const{autoColSvc:i,selectionColSvc:n,rowNumbersSvc:r,quickFilter:l,pivotResultCols:a,showRowGroupCols:d,rowAutoHeight:c,visibleCols:h,colViewport:u,eventSvc:g,formula:p}=this.beans,m=this.selectCols(a,this.colDefCols);p?.setFormulasActive(m),this.createColumnsForService([i,n,r],m,o);const f=(C=this.gos,this.showingPivotResult?!C.get("enableStrictPivotColumnOrder"):C.get("maintainColumnOrder"));var C;e&&!f||this.restoreColOrder(m),this.positionLockedCols(m),d?.refresh(),l?.refreshCols(),this.setColSpanActive(),c?.setAutoHeightActive(m),h.clear(),u.clear(),t(s,this.cols.tree)||g.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,o){for(const s of e)s&&(s.createColumns(t,e=>{this.lastOrder=e(this.lastOrder),this.lastPivotOrder=e(this.lastPivotOrder)},o),s.addColumns(t))}selectCols(e,t){const o=e?.getPivotResultCols()??null;this.showingPivotResult=null!=o;const{map:s,list:i,tree:n,treeDepth:r}=o??t;return this.cols={list:i.slice(),map:{...s},tree:n.slice(),treeDepth:r},o&&(o.list.some(e=>void 0!==this.cols?.map[e.getColId()])||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const{beans:e,showingPivotResult:t,cols:o}=this,{valueColsSvc:s,selectionColSvc:i,gos:n}=e,r=this.isPivotMode()&&!t,l=i?.isSelectionColumnEnabled(),a=function({gos:e,formula:t}){const o=e.get("rowNumbers");return o||!!t?.active&&!1!==o}(e),d=s?.columns,c=qt(n);return o.list.filter(e=>{const t=es(e);return r?d?.includes(e)||t&&(!c||e.isVisible())||l&&ts(e)||a&&os(e):t&&!c||e.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,o){Aa(this.beans,{state:e.map(e=>({colId:"string"==typeof e?e:e.getColId(),hide:!t}))},o)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const o=t.filter(t=>null!=e.map[t.getId()]);if(0===o.length)return;if(o.length===e.list.length)return void(e.list=o);const s=e=>{const t=e.getOriginalParent();return!!t&&(t.getChildren().length>1||s(t))};if(!o.some(e=>s(e))){const t=new Set(o);for(const s of e.list)t.has(s)||o.push(s);return void(e.list=o)}const i=/* @__PURE__ */new Map;for(let h=0;h!i.has(e));if(0===n.length)return void(e.list=o);const r=(e,t)=>{const o=t?t.getOriginalParent():e.getOriginalParent();if(!o)return null;let s=null,n=null;for(const r of o.getChildren())if(r!==t&&r!==e){if(r instanceof Fo){const e=i.get(r);if(null==e)continue;(null==s||s{const t=i.get(e);null!=t&&(null==s||s=0;h--)d[c--]=l[h];for(let h=o.length-1;h>=0;h--){const e=o[h],t=a.get(e);if(t)if(Array.isArray(t))for(let o=t.length-1;o>=0;o--){const e=t[o];d[c--]=e}else d[c--]=t;d[c--]=e}e.list=d}positionLockedCols(e){e.list=ma(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=>null!=e.getColDef().colSpan)}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode)return;if(this.pivotMode=e,!this.ready)return;this.refreshCols(!1,t);const{visibleCols:o,eventSvc:s}=this.beans;o.refresh(t),s.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=ls(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){Jo(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:n}=this.beans;o(this.colDefCols?.list,e)||o(s?.columns?.list,e)||o(i?.columns?.list,e)||o(n?.columns?.list,e)||o(t?.getPivotResultCols()?.list,e)}getColsForKeys(e){return e?e.map(e=>this.getCol(e)).filter(e=>null!=e):[]}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return null==e?null:this.getColFromCollection(e,this.cols)}getColById(e){return this.cols?.map[e]??null}getColFromCollection(e,t){if(null==t)return null;const{map:o,list:s}=t;if("string"==typeof e&&o[e])return o[e];for(let l=0;l{const e=()=>{for(const e of this.getAllCellCtrls())e.onCellSelectionChanged()},t=()=>{for(const e of this.getAllCellCtrls())e.updateRangeBordersIfRangeCount()},o=()=>{this.eventSvc.addListener("cellSelectionChanged",e),this.eventSvc.addListener("columnMoved",t),this.eventSvc.addListener("columnPinned",t),this.eventSvc.addListener("columnVisible",t)},s=()=>{this.eventSvc.removeListener("cellSelectionChanged",e),this.eventSvc.removeListener("columnMoved",t),this.eventSvc.removeListener("columnPinned",t),this.eventSvc.removeListener("columnVisible",t)};this.addDestroyFunc(()=>s()),this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{so(this.gos)?o():s()}),so(this.gos)&&o()}}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",e=>this.onSuppressCellFocusChanged(e.currentValue)),this.addManagedPropertyListeners(["groupSuppressBlankHeader","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.addManagedPropertyListener("cellSelection",({currentValue:e,previousValue:t})=>{(!t&&e||t&&!e)&&this.redrawRows()});const{stickyRowSvc:e,gos:t,showRowGroupCols:o}=this.beans;if(o&&this.addManagedPropertyListener("showOpenedGroup",()=>{const e=o.columns;e.length&&this.refreshCells({columns:e,force:!0})}),e)this.stickyRowFeature=e.createStickyRowFeature(this,this.createRowCon.bind(this),this.destroyRowCtrls.bind(this));else{const e=this.gridBodyCtrl;e.setStickyTopHeight(0),e.setStickyBottomHeight(0)}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=kt(t,"print"),this.embedFullWidthRows=this.printLayout||t.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount();this.cachedRowCtrls=new wu(null!=e?e:3)}}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),o=this.cachedRowCtrls?.getEntries()??[];t.length>0||o.length>0?this.allRowCtrls=[...e,...t,...o]:this.allRowCtrls=e}isCellBeingRendered(e,t){const o=this.rowCtrlsByRowIndex[e];return t&&o?!(!o.isFullWidth()&&!this.beans.spannedRowRenderer?.getCellByPosition({rowIndex:e,column:t,rowPinned:null})&&!o.getCellCtrl(t)&&o.isRowRendered()):!!o}updateCellFocus(e){for(const t of this.getAllCellCtrls())t.onCellFocused(e);for(const t of this.getFullWidthRowCtrls())t.onFullWidthRowFocused(e)}onCellFocusChanged(e){if(null!=e?.rowIndex&&!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 o of this.getAllCellCtrls())t.onFlashCells(o,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 e=e=>{for(const o of this.getAllCellCtrls())o.column===t&&e(o)},o=()=>{e(e=>e.onLeftChanged())},s=()=>{e(e=>e.onWidthChanged())},i=()=>{e(e=>e.onFirstRightPinnedChanged())},n=()=>{e(e=>e.onLastLeftPinnedChanged())},r=()=>{e(e=>e.onColDefChanged())};t.__addEventListener("leftChanged",o),t.__addEventListener("widthChanged",s),t.__addEventListener("firstRightPinnedChanged",i),t.__addEventListener("lastLeftPinnedChanged",n),t.__addEventListener("colDefChanged",r),this.destroyFuncsForColumnListeners.push(()=>{t.__removeEventListener("leftChanged",o),t.__removeEventListener("widthChanged",s),t.__removeEventListener("firstRightPinnedChanged",i),t.__removeEventListener("lastLeftPinnedChanged",n),t.__removeEventListener("colDefChanged",r)})}}onDomLayoutChanged(){const e=kt(this.gos,"print"),t=e||this.gos.get("embedFullWidthRows"),o=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,o&&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 o of this.getAllRowCtrls()){const s=o.getCellCtrl(e,!0)?.eGui;s&&t.push(s)}return t}refreshFloatingRowComps(e=!0){this.refreshFloatingRows(this.topRowCtrls,"top",e),this.refreshFloatingRows(this.bottomRowCtrls,"bottom",e)}refreshFloatingRows(e,t,o){const{pinnedRowModel:s,beans:i,printLayout:n}=this,r=Object.fromEntries(e.map(e=>[e.rowNode.id,e]));s?.forEachPinnedRow(t,(l,a)=>{const d=e[a];d&&void 0===s.getPinnedRowById(d.rowNode.id,t)&&(d.destroyFirstPass(),d.destroySecondPass()),l.id in r&&o?(e[a]=r[l.id],delete r[l.id]):e[a]=new qh(l,i,!1,!1,n)}),e.length=("top"===t?s?.getPinnedTopRowCount():s?.getPinnedBottomRowCount())??0}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}onPinnedRowsChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){if(e.sticky)this.stickyRowFeature?.refreshStickyNode(e);else{if(this.cachedRowCtrls?.has(e))return void this.cachedRowCtrls.removeRow(e);{const t=t=>{const o=t[e.rowIndex];o&&o.rowNode===e&&(o.destroyFirstPass(),o.destroySecondPass(),t[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":t(this.topRowCtrls);break;case"bottom":t(this.bottomRowCtrls);break;default:t(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"})),null==e)this.redrawAfterModelUpdate();else{for(const t of e??[])this.redrawRow(t,!0);this.dispatchDisplayedRowsChanged(!1)}}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.beans.focusSvc?.getFocusCellToUseAfterRefresh();this.updateContainerHeights(),this.scrollToTopIfNewData(e);const o=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&zt(this.gos),i=o?this.getRowsToRecycle():null;o||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender();const{stickyRowFeature:n,gos:r}=this;if(n){n.checkStickyRows();const e=n.extraTopHeight+n.extraBottomHeight;e&&this.updateContainerHeights(e)}this.recycleRows(i,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(r.get("enableRowPinning")?o:void 0),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,o=this.gos.get("suppressScrollOnNewData");t&&!o&&(this.gridBodyCtrl.scrollFeature.scrollToTop(),this.stickyRowFeature?.resetOffsets())}updateContainerHeights(e=0){const{rowContainerHeight:t}=this;if(this.printLayout)return void t.setModelHeight(null);let o=this.pageBounds.getCurrentPageHeight();0===o&&(o=1),t.setModelHeight(o+e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error(Et(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,o=this.findPositionToFocus(e);o?e.rowIndex===o.rowIndex&&e.rowPinned==o.rowPinned?t.doesRowOrCellHaveBrowserFocus()||this.updateCellFocus(Co(this.gos,{...o,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"})):t.setFocusedCell({...o,preventScrollOnBrowserFocus:!0,forceBrowserFocus:!0}):t.focusHeaderPosition({headerPosition:{headerRowIndex:On(this.beans)-1,column:e.column}})}findPositionToFocus(e){const{pagination:t,pageBounds:o}=this.beans;let s=e;for(null==s.rowPinned&&t&&o&&!t.isRowInPage(s.rowIndex)&&(s={rowPinned:null,rowIndex:o.getFirstRow()});s;){if(null==s.rowPinned&&o)if(s.rowIndexo.getLastRow()&&(s={rowPinned:null,rowIndex:o.getLastRow()});const t=this.getRowByPosition(s);if(t?.isAlive())return{...t.getRowPosition(),column:e.column};s=Mn(this.beans,s)}return null}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),o=t.length;for(let s=0;syu(e.rowNode,t)):o}getCellCtrls(e,t){let o;l(t)&&(o={},t.forEach(e=>{const t=this.colModel.getCol(e);l(t)&&(o[t.getId()]=!0)}));const s=[];for(const i of this.getRowCtrls(e))for(const e of i.getAllCellCtrls()){const t=e.column.getId();o&&!o[t]||s.push(e)}return s}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 o of Object.keys(this.rowCtrlsByRowIndex))null==this.rowCtrlsByRowIndex[o].rowNode.id&&e.push(o);this.removeRowCtrls(e);const t={};for(const o of Object.values(this.rowCtrlsByRowIndex))t[o.rowNode.id]=o;return this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){for(const o of e){const e=this.rowCtrlsByRowIndex[o];e&&(e.destroyFirstPass(t),e.destroySecondPass()),delete this.rowCtrlsByRowIndex[o]}}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{focusSvc:t,animationFrameSvc:o}=this.beans,{afterScroll:s}=e;let i;const n=this.stickyRowFeature;n&&(i=t?.getFocusCellToUseAfterRefresh()||void 0);const r=this.firstRenderedRow,l=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let a=!1;if(n){a=n.checkStickyRows();const e=n.extraTopHeight+n.extraBottomHeight;e&&this.updateContainerHeights(e)}const d=this.firstRenderedRow!==r||this.lastRenderedRow!==l;if((!s||a||d)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,s),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(s&&!a),null!=i)){const e=t?.getFocusCellToUseAfterRefresh();null!=i&&null==e&&(o?.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const o={};for(const i of e)o[i]=!0;const s=Object.keys(this.rowCtrlsByRowIndex).filter(e=>!o[e]);this.removeRowCtrls(s,t)}calculateIndexesToDraw(e){const t=[];for(let r=this.firstRenderedRow;r<=this.lastRenderedRow;r++)t.push(r);const o=this.beans.pagination,s=this.beans.focusSvc?.getFocusedCell()?.rowIndex;null!=s&&(sthis.lastRenderedRow)&&(!o||o.isRowInPage(s))&&s{const o=e.rowNode.rowIndex;null!=o&&o!==s&&(othis.lastRenderedRow)&&this.doNotUnVirtualiseRow(e)&&t.push(o)};for(const r of Object.values(this.rowCtrlsByRowIndex))i(r);if(e)for(const r of Object.values(e))i(r);t.sort((e,t)=>e-t);const n=[];for(let r=0;r{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(),o=e.isPinningRight();this.pinningLeft===t&&o===this.pinningRight||(this.pinningLeft=t,this.pinningRight=o,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];for(const t of this.getFullWidthRowCtrls()){const o=t.rowNode.rowIndex;e.push(o.toString())}this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=bu(e);return this.getAllRowCtrls().filter(e=>{if(!e.isFullWidth())return!1;const o=e.rowNode;return!(null!=t&&!yu(o,t))})}createOrUpdateRowCtrl(e,t,o,s){let i,n=this.rowCtrlsByRowIndex[e];if(n||(i=this.rowModel.getRow(e),l(i)&&l(t)&&t[i.id]&&i.alreadyRendered&&(n=t[i.id],t[i.id]=null)),!n){if(i||(i=this.rowModel.getRow(e)),!l(i))return;n=this.createRowCon(i,o,s)}i&&(i.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=n}destroyRowCtrls(e,t){const o=[];if(e)for(const s of Object.values(e))if(s)if(this.cachedRowCtrls&&s.isCacheable())this.cachedRowCtrls.addRow(s);else if(s.destroyFirstPass(!t),t){const e=s.instanceId;this.zombieRowCtrls[e]=s,o.push(()=>{s.destroySecondPass(),delete this.zombieRowCtrls[e]})}else s.destroySecondPass();t&&(o.push(()=>{this.isAlive()&&(this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged())}),window.setTimeout(()=>{for(const e of o)e()},400))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){return this.getRowBuffer()*Bt(this.beans)}workOutFirstAndLastRowsToRender(){const{rowContainerHeight:e,pageBounds:t,rowModel:o}=this;let s,i;if(e.updateOffset(),o.isRowsToRender())if(this.printLayout)this.beans.environment.refreshRowHeightVariable(),s=t.getFirstRow(),i=t.getLastRow();else{const n=this.getRowBufferInPixels(),r=this.ctrlsSvc.getScrollFeature(),l=this.gos.get("suppressRowVirtualisation");let a,d,c=!1;do{const o=t.getPixelOffset(),{pageFirstPixel:s,pageLastPixel:i}=t.getCurrentPagePixelRange(),h=e.divStretchOffset,u=r.getVScrollPosition(),g=u.top,p=u.bottom;l?(a=s+h,d=i+h):(a=Math.max(g+o-n,s)+h,d=Math.min(p+o+n,i)+h),this.firstVisibleVPixel=Math.max(g+o,s)+h,this.lastVisibleVPixel=Math.min(p+o,i)+h,c=this.ensureAllRowsInRangeHaveHeightsCalculated(a,d)}while(c);let h=o.getRowIndexAtPixel(a),u=o.getRowIndexAtPixel(d);const g=t.getFirstRow(),p=t.getLastRow();hp&&(u=p),s=h,i=u}else s=0,i=-1;const n=kt(this.gos,"normal"),r=this.gos.get("suppressMaxRenderedRowRestriction"),l=Math.max(this.getRowBuffer(),500);n&&!r&&i-s>l&&(i=s+l);const a=s!==this.firstRenderedRow,d=i!==this.lastRenderedRow;(a||d)&&(this.firstRenderedRow=s,this.lastRenderedRow=i,this.eventSvc.dispatchEvent({type:"viewportChanged",firstRow:s,lastRow:i}))}dispatchFirstDataRenderedEvent(){this.dataFirstRenderedFired||(this.dataFirstRenderedFired=!0,be(this.beans,()=>{this.beans.eventSvc.dispatchEvent({type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow})}))}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const o=this.pinnedRowModel?.ensureRowHeightsValid(),s=this.stickyRowFeature?.ensureRowHeightsValid(),{pageBounds:i,rowModel:n}=this,r=n.ensureRowHeightsValid(e,t,i.getFirstRow(),i.getLastRow());return(r||s)&&this.eventSvc.dispatchEvent({type:"recalculateRowBounds"}),!!(s||r||o)&&(this.updateContainerHeights(),!0)}doNotUnVirtualiseRow(e){const t=e.rowNode,o=this.focusSvc.isRowFocused(t.rowIndex,t.rowPinned),s=this.editSvc?.isEditing(e),i=t.detail;return(o||s||i)&&!!this.isRowPresent(t)||!1}isRowPresent(e){return!!this.rowModel.isRowPresent(e)&&(this.beans.pagination?.isRowInPage(e.rowIndex)??!0)}createRowCon(e,t,o){const s=this.cachedRowCtrls?.getRow(e)??null;if(s)return s;const i=o&&!this.printLayout&&!!this.beans.animationFrameSvc?.active;return new qh(e,this.beans,t,i,this.printLayout)}getRenderedNodes(){const e=Object.values(this.rowCtrlsByRowIndex).map(e=>e.rowNode);return[...this.getStickyTopRowCtrls().map(e=>e.rowNode),...e,...this.getStickyBottomRowCtrls().map(e=>e.rowNode)]}getRowByPosition(e){let t;const{rowIndex:o}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[o];break;case"bottom":t=this.bottomRowCtrls[o];break;default:t=this.rowCtrlsByRowIndex[o],t||(t=this.getStickyTopRowCtrls().find(e=>e.rowNode.rowIndex===o)||null,t||(t=this.getStickyBottomRowCtrls().find(e=>e.rowNode.rowIndex===o)||null))}return t}isRangeInRenderedViewport(e,t){if(null==e||null==t)return!1;const o=e>this.lastRenderedRow;return!(tthis.callColumnCellValueChangedHandler(e);this.eventSvc.addListener("cellValueChanged",o,!0),this.addDestroyFunc(()=>this.eventSvc.removeListener("cellValueChanged",o,!0)),this.addManagedPropertyListener("treeData",e=>this.isTreeData=e.currentValue)}getValueForDisplay(e){const t=this.beans,o=e.column,s=e.node,i=t.showRowGroupColValueSvc,n=!o&&s.group,r=o?.colDef.showRowGroup,l=!this.isTreeData||s.footer;if(i&&l&&(n||r)){const t=i.getGroupValue(s,o,this.displayIgnoresAggData(s));return null==t?{value:null,valueFormatted:null}:{value:t.value,valueFormatted:e.includeValueFormatted?i.formatAndPrefixGroupColValue(t,o,e.exporting):null}}if(!o)return{value:s.key,valueFormatted:null};let a=this.getValue(o,s,e.from,this.displayIgnoresAggData(s)),d=a;const c=t.formula;return o.isAllowFormula()&&c?.isFormula(a)&&(e.useRawFormula?(a=c.normaliseFormula(a,!0),d=c.resolveValue(o,s)):(a=c.resolveValue(o,s),d=a)),{value:a,valueFormatted:!e.includeValueFormatted||e.exporting&&!1===o.colDef.useValueFormatterForExport?null:this.formatValue(o,s,d)}}getValue(e,t,o,s=!1){if(this.initialised||this.init(),!t)return;const i=e.colDef,n=t.group;if(!n){const t=i.pivotValueColumn;t&&(e=t)}const r=this.editSvc?.getPendingEditValue(t,e,o);if(void 0!==r)return r;let l=this.resolveValue(e,t,s,n);if(void 0!==l){if(this.cellExpressions&&C(l)){const o=l.substring(1);l=this.executeValueGetter(o,t.data,e,t)}return l}if(n){const e=i.showRowGroup;if("string"==typeof e){const o=this.rowGroupColsSvc?.getColumnIndex(e);if(null!=o&&o>t.level)return null}}}displayIgnoresAggData(e){return!(!e.group||e.footer||-1===e.level||!e.sibling||this.gos.get("groupSuppressBlankHeader")||e.leafGroup&&this.colModel.isPivotMode()||!e.expanded)}resolveValue(e,t,o,s){const i=e.colDef,n=e.colId,r=!s&&this.formulaDataSvc;if(r&&r.hasDataSource()&&!0===i.allowFormula){const o=r.getFormula({column:e,rowNode:t});if(C(o))return o}const l=s&&!o?t.aggData:void 0,a=this.isTreeData;if(a&&void 0!==l?.[n])return l[n];const d=t.data,c=i.field,h=i.valueGetter;if(a){if(h)return this.executeValueGetter(h,d,e,t);if(c&&d)return td(d,c,e.isFieldContainsDots())}const u=t.groupData;if(u&&n in u)return u[n];if(void 0!==l?.[n])return l[n];const g=i.showRowGroup,p="string"!=typeof g||!s,m=this.isSsrm,f=m&&o&&!!i.aggFunc;return h&&!f?p?this.executeValueGetter(h,d,e,t):void 0:m&&t.footer&&t.field&&(!0===g||g===t.field)?td(d,t.field,e.isFieldContainsDots()):c&&d&&!f&&p?td(d,c,e.isFieldContainsDots()):void 0}parseValue(e,t,o,s){const i=e.getColDef();if(i.allowFormula&&this.beans.formula?.isFormula(o))return o;const n=i.valueParser;if(l(n)){const r=Co(this.gos,{node:t,data:t?.data,oldValue:s,newValue:o,colDef:i,column:e});return"function"==typeof n?n(r):this.expressionSvc?.evaluate(n,r)}return o}getDeleteValue(e,t){return l(e.getColDef().valueParser)?this.parseValue(e,t,"",this.getValueForDisplay({column:e,node:t,from:"edit"}).value)??null:null}formatValue(e,t,o,s,i=!0){const{expressionSvc:n}=this.beans;let r,l=null;const a=e.getColDef();if(s?r=s:i&&(r=a.valueFormatter),r){const s=t?t.data:null,i=Co(this.gos,{value:o,node:t,data:s,colDef:a,column:e});l="function"==typeof r?r(i):n?n.evaluate(r,i):null}else if(a.refData)return a.refData[o]||"";return null==l&&Array.isArray(o)&&(l=o.join(", ")),l}setValue(e,t,o,s){const i=t.getColDef();if(!e.data&&this.canCreateRowNodeData(e,i)&&(e.data={}),!this.isSetValueSupported(t,e,o,i))return!1;const n=this.getValue(t,e,"data"),r=Co(this.gos,{node:e,data:e.data,oldValue:n,newValue:o,colDef:i,column:t});let l=!1;if(e.data){const n=this.handleExternalFormulaChange({column:t,eventSource:s,newValue:o,setterParams:r,rowNode:e});if(null!==n)return n;l=this.computeValueChange({column:t,rowNode:e,newValue:o,params:r,rowData:e.data,valueSetter:i.valueSetter,field:i.field})??!0}const a=this.beans.changeDetectionSvc;a?.beginDeferred();try{if(e.group){const i=this.beans.rowGroupingEditValueSvc?.setGroupDataValue(e,t,o,n,s,l||o!==n);if(void 0!==i)return!(!l&&!i)&&this.finishValueChange(e,t,r,s,o)}return!!l&&this.finishValueChange(e,t,r,s)}finally{a?.endDeferred()}}canCreateRowNodeData(e,t){return!e.group||null==t.groupRowValueSetter&&null==t.groupRowEditable&&!t.pivotValueColumn}finishValueChange(e,t,o,s,i){e.resetQuickFilterAggregateText(),this.valueCache?.onDataChanged();const n=void 0===i?this.getValue(t,e,"data"):i;return this.dispatchCellValueChangedEvent(e,o,n,s),e.pinnedSibling&&this.dispatchCellValueChangedEvent(e.pinnedSibling,o,n,s),!0}isSetValueSupported(e,t,o,s){const{field:i,valueSetter:n}=s,r=this.beans.formula,l=e.isAllowFormula()&&r?.isFormula(o),d=!!this.formulaDataSvc?.hasDataSource();return!a(i)||!a(n)||d&&l?!(this.dataTypeSvc&&!this.dataTypeSvc.checkType(e,o)&&(Dt(135),1)):!(!t.group||!s.groupRowValueSetter&&!s.groupRowEditable)||(Dt(17),!1)}handleExternalFormulaChange(e){const{column:t,rowNode:o,newValue:s,eventSource:i,setterParams:n}=e,r=this.beans.formula,d=this.formulaDataSvc;if(!d?.hasDataSource()||!t.isAllowFormula())return null;const c=r?.isFormula(s),h=d.getFormula({column:t,rowNode:o});if(c){if(h===s)return!1;d.setFormula({column:t,rowNode:o,formula:s});const e=r?.resolveValue(t,o),c=t.getColDef();if(l(c.valueSetter)||!a(c.field)){const s={...n,newValue:e};this.computeValueChange({column:t,rowNode:o,newValue:e,params:s,rowData:o.data,valueSetter:c.valueSetter,field:c.field})}return this.finishValueChange(o,t,n,i)}return void 0!==h&&d.setFormula({column:t,rowNode:o,formula:void 0}),null}computeValueChange(e){const{valueSetter:t,params:o,rowData:s,field:i,column:n,newValue:r}=e;return l(t)?"function"==typeof t?t(o):this.expressionSvc?.evaluate(t,o):!!s&&this.setValueUsingField(s,i,r,n.isFieldContainsDots())}dispatchCellValueChangedEvent(e,t,o,s){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:o,newRawValue:t.newValue,value:o,source:s})}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&this.beans.frameworkOverrides.wrapOutgoing(()=>{t(e)})}setValueUsingField(e,t,o,s){if(!t)return!1;let i=!1;if(s){const s=t.split(".");let n=e;for(;s.length>0&&n;){const e=s.shift();0===s.length?(i=n[e]===o,i||(n[e]=o)):n=n[e]}}else i=e[t]===o,i||(e[t]=o);return!i}executeValueGetterWithValueCache(e,t,o,s){const i=o.getColId(),n=this.valueCache.getValue(s,i);if(void 0!==n)return n;const r=this.executeValueGetterWithoutValueCache(e,t,o,s);return this.valueCache.setValue(s,i,r),r}executeValueGetterWithoutValueCache(e,t,o,s){const i=Co(this.gos,{data:t,node:s,column:o,colDef:o.getColDef(),getValue:e=>this.getValueCallback(s,e)});let n;return n="function"==typeof e?e(i):this.expressionSvc?.evaluate(e,i),n}getValueCallback(e,t){const o=this.colModel.getColDefCol(t);return o?this.getValue(o,e,"data"):null}getKeyForNode(e,t){const o=this.getValue(e,t,"data"),s=e.getColDef().keyCreator;let i=o;return s&&(i=s(Co(this.gos,{value:o,colDef:e.getColDef(),column:e,node:t,data:t.data}))),"string"==typeof i||null==i||(i=String(i),"[object Object]"===i&&Dt(121)),i}},class extends Oe{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(function(e){const t=b(e);var o;return o=t,Hi>0||(o.addEventListener("keydown",Oi),o.addEventListener("mousedown",Oi)),Hi++,()=>{Hi--,function(e){Hi>0||(e.removeEventListener("keydown",Oi),e.removeEventListener("mousedown",Oi))}(t)}}(this.beans))}attemptToRecoverFocus(){this.needsFocusRestored=!0,null!=this.focusFallbackTimeout&&clearTimeout(this.focusFallbackTimeout),this.focusFallbackTimeout=window.setTimeout(this.setFocusRecovered.bind(this),100)}setFocusRecovered(){this.needsFocusRestored=!1,null!=this.focusFallbackTimeout&&(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;e!==this.colModel.getCol(e.getId())&&this.clearFocusedCell()}getFocusCellToUseAfterRefresh(){const{gos:e,focusedCell:t}=this;return e.get("suppressFocusAfterRefresh")||e.get("suppressCellFocus")||!t?null:this.doesRowOrCellHaveBrowserFocus()?t:null}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeader?null:this.isDomDataPresentInHierarchy(w(this.beans),dr)?this.focusedHeader:null}doesRowOrCellHaveBrowserFocus(){const e=w(this.beans);return!!this.isDomDataPresentInHierarchy(e,zr,!0)||this.isDomDataPresentInHierarchy(e,Ur,!0)}isDomDataPresentInHierarchy(e,t,o){let s=e;for(;s;){const e=Ot(this.gos,s,t);if(e)return!e.destroyed||!o||(this.attemptToRecoverFocus(),!1);s=s.parentNode}return!1}getFocusedCell(){return this.focusedCell}getFocusEventParams(e){const{rowIndex:t,rowPinned:o,column:s}=e,i={rowIndex:t,rowPinned:o,column:s,isFullWidthCell:!1},n=this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:o});return n&&(i.isFullWidthCell=n.isFullWidth()),i}clearFocusedCell(){if(null==this.focusedCell)return;const e=this.getFocusEventParams(this.focusedCell);this.focusedCell=null,this.eventSvc.dispatchEvent({type:"cellFocusCleared",...e})}setFocusedCell(e){this.setFocusRecovered();const{column:t,rowIndex:o,rowPinned:s,forceBrowserFocus:i=!1,preventScrollOnBrowserFocus:n=!1,sourceEvent:l}=e,a=this.colModel.getCol(t);if(!a)return void(this.focusedCell=null);this.focusedCell={rowIndex:o,rowPinned:r(s),column:a};const d=this.getFocusEventParams(this.focusedCell);this.eventSvc.dispatchEvent({type:"cellFocused",...d,...this.previousCellFocusParams&&{previousParams:this.previousCellFocusParams},forceBrowserFocus:i,preventScrollOnBrowserFocus:n,sourceEvent:l}),this.previousCellFocusParams=d}isCellFocused(e){return null!=this.focusedCell&&bn(e,this.focusedCell)}isHeaderWrapperFocused(e){if(null==this.focusedHeader)return!1;const{column:t,rowCtrl:{rowIndex:o,pinned:s}}=e,{column:i,headerRowIndex:n}=this.focusedHeader;return t===i&&o===n&&s==i.getPinned()}focusHeaderPosition(e){if(this.setFocusRecovered(),An(this.beans))return!1;const{direction:t,fromTab:o,allowUserOverride:s,event:i,fromCell:n,rowWithoutSpanValue:r,scroll:l=!0}=e;let{headerPosition:a}=e;if(n&&this.filterManager?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(a);if(s){const e=this.focusedHeader,s=On(this.beans);if(o){const o=this.gos.getCallback("tabToNextHeader");o&&(a=this.getHeaderPositionFromUserFunc({userFunc:o,direction:t,currentPosition:e,headerPosition:a,headerRowCount:s}))}else{const t=this.gos.getCallback("navigateToNextHeader");if(t&&i){const o=t({key:i.key,previousHeaderPosition:e,nextHeaderPosition:a,headerRowCount:s,event:i});a=null===o?e:o}}}return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:t,event:i,fromCell:n,rowWithoutSpanValue:r,scroll:l})}focusHeaderPositionFromUserFunc(e){if(An(this.beans))return!1;const{userFunc:t,headerPosition:o,direction:s,event:i}=e,n=this.focusedHeader,r=On(this.beans),l=this.getHeaderPositionFromUserFunc({userFunc:t,direction:s,currentPosition:n,headerPosition:o,headerRowCount:r});return!!l&&this.focusProvidedHeaderPosition({headerPosition:l,direction:s,event:i})}getHeaderPositionFromUserFunc(e){const{userFunc:t,direction:o,currentPosition:s,headerPosition:i,headerRowCount:n}=e,r=t({backwards:"Before"===o,previousHeaderPosition:s,nextHeaderPosition:i,headerRowCount:n});return!0===r?s:!1===r?null:r}focusProvidedHeaderPosition(e){const{headerPosition:t,direction:o,fromCell:s,rowWithoutSpanValue:i,event:n,scroll:r=!0}=e,{column:l,headerRowIndex:a}=t,{filterManager:d,ctrlsSvc:c,headerNavigation:h}=this.beans;if(this.focusedHeader&&(u=e.headerPosition,g=this.focusedHeader,u.headerRowIndex===g.headerRowIndex&&u.column===g.column))return!1;var u,g;if(-1===a)return d?.isAdvFilterHeaderActive()?this.focusAdvancedFilter(t):this.focusGridView({column:l,event:n});r&&h?.scrollToColumn(l,o);const p=c.getHeaderRowContainerCtrl(l.getPinned())?.focusHeader(t.headerRowIndex,l,n)||!1;return h&&p&&(null!=i||s)&&(h.currentHeaderRowWithoutSpan=i??-1),p}focusFirstHeader(){if(this.overlays?.exclusive&&this.focusOverlay())return!0;const e=this.visibleCols.allCols[0];if(!e)return!1;const t=Vc(this.beans,e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(t){if(this.overlays?.exclusive&&this.focusOverlay(!0))return!0;const o=On(this.beans)-1,s=e(this.visibleCols.allCols);return this.focusHeaderPosition({headerPosition:{headerRowIndex:o,column:s},rowWithoutSpanValue:-1,event:t})}focusPreviousFromFirstCell(e){return this.filterManager?.isAdvFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCell}isRowFocused(e,t){return null!=this.focusedCell&&this.focusedCell.rowIndex===e&&this.focusedCell.rowPinned===r(t)}focusOverlay(e){const t=this.overlays?.isVisible()&&this.overlays.eWrapper?.getGui();return!!t&&Wi(t,e)}getDefaultTabToNextGridContainerTarget(e){const{backwards:t,focusableContainers:o}=e,s=t?-1:1;let i;const n=()=>(void 0===i&&(i=this.getGridBodyTabTarget(t)),i);for(let r=e.nextIndex;r>=0&&rthis.refreshRowHeightVariable()),this.getSizeEl(Lc),this.getSizeEl(Gc),this.getSizeEl(Nc),this.getSizeEl(Bc),this.refreshRowBorderWidthVariable()}getPinnedRowBorderWidth(){return this.getCSSVariablePixelValue(Bc)}getRowBorderWidth(){return this.getCSSVariablePixelValue(Nc)}getHeaderRowBorderWidth(){return this.getCSSVariablePixelValue(Hc)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(Lc)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(Gc)}getDefaultCellHorizontalPadding(){return this.getCSSVariablePixelValue(Ic)}getCellPaddingLeft(){const e=this.getDefaultCellHorizontalPadding(),t=this.getCSSVariablePixelValue(Ac);return e-1+this.getCSSVariablePixelValue(kc)*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(),o=this.gos.get("rowHeight");if(null==o||isNaN(o)||!isFinite(o))return null!==t&&e.style.setProperty("--ag-line-height",null),-1;const s=`${o}px`;return t!=s?(e.style.setProperty("--ag-line-height",s),o):""!=t?Number.parseFloat(t):-1}fireStylesChangedEvent(e){"rowBorderWidth"===e&&this.refreshRowBorderWidthVariable(),super.fireStylesChangedEvent(e)}refreshRowBorderWidthVariable(){const e=this.getCSSVariablePixelValue(Nc);this.eRootDiv.style.setProperty("--ag-internal-row-border-width",`${e}px`)}postProcessThemeChange(e,t){e&&getComputedStyle(this.getMeasurementContainer()).getPropertyValue("--ag-legacy-styles-loaded")&&Mt(t?106:239)}getAdditionalCss(){const e=/* @__PURE__ */new Map;return e.set("core",['.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)}}']),function(e,t){for(const o of t.sort((e,t)=>e.moduleName.localeCompare(t.moduleName))){const t=o.css;t&&e.set(`module-${o.moduleName}`,t)}}(e,Array.from(new Set(nt))),e}getDefaultTheme(){return Ec}varError(e,t){Dt(9,{variable:{cssName:e,defaultValue:t}})}themeError(e){Mt(240,{theme:e})}shadowRootError(){Mt(293)}},class extends Oe{constructor(){super(...arguments),this.beanName="scrollVisibleSvc"}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.colAnimation=e.colAnimation}postConstruct(){const{gos:e}=this;this.horizontalScrollShowing=!0===e.get("alwaysShowHorizontalScroll"),this.verticalScrollShowing=!0===e.get("alwaysShowVerticalScroll"),this.getScrollbarWidth();const t=this.updateScrollVisible.bind(this);this.addManagedEventListeners({displayedColumnsChanged:t,displayedColumnsWidthChanged:t,newColumnsLoaded:t})}updateScrollVisible(){const{colAnimation:e}=this;e?.isActive()?e.executeLaterVMTurn(()=>{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(),o=e.hasVerticalScrollGap();this.horizontalScrollGap===t&&this.verticalScrollGap===o||(this.horizontalScrollGap=t,this.verticalScrollGap=o,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(null==this.scrollbarWidth){const e=this.gos.get("scrollbarWidth"),t="number"==typeof e&&e>=0?e:Li();null!=t&&(this.scrollbarWidth=t,this.eventSvc.dispatchEvent({type:"scrollbarWidthChanged"}))}return this.scrollbarWidth}},class extends Oe{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=23===e.length&&e.every(e=>e?.isAlive()??!1)}whenReady(e,t){this.ready?t(this.params):this.readyCallbacks.push(t),e.addDestroyFunc(()=>{const e=this.readyCallbacks.indexOf(t);e>=0&&this.readyCallbacks.splice(e,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:o}=this.params;return[e,o,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}},class extends Oe{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:o}=this.beans;t.setColumnDefs(e??[],"gridInitializing"),o.start()}gridReady(){const{eventSvc:e,gos:t}=this;e.dispatchEvent({type:"gridReady"}),tt(t,t.isModuleRegistered("EnterpriseCore"))}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t)return this.waitingForColumns?(this.waitingForColumns=!1,void this.setColumnsAndData(t)):void this.beans.colModel.setColumnDefs(t,ls(e.source))}},class extends Oe{constructor(){super(...arguments),this.beanName="colNames"}getDisplayNameForColumn(e,t,o=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t),{aggColNameSvc:i}=this.beans;return o&&i?i.getHeaderName(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,o){const s=t?.getColGroupDef();return s?this.getHeaderName(s,null,e,t,o):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,o,s,i){const n=e.headerValueGetter;if(n){const r=Co(this.gos,{colDef:e,column:t,columnGroup:o,providedColumnGroup:s,location:i});return"function"==typeof n?n(r):"string"==typeof n?this.beans.expressionSvc?.evaluate(n,r)??null:""}return null!=e.headerName?e.headerName:e.field?(r=e.field)&&null!=r?r.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\./g," ").split(" ").map(e=>e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):"")).join(" "):null:"";var r}},class extends Oe{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,o=!1){const{visibleCols:s}=this,i=s.isBodyWidthDirty;if(e!==this.scrollWidth||t!==this.scrollPosition||i){if(this.scrollWidth=e,this.scrollPosition=t,s.isBodyWidthDirty=!0,this.gos.get("enableRtl")){const o=s.bodyWidth;this.viewportLeft=o-t-e,this.viewportRight=o-t}else this.viewportLeft=t,this.viewportRight=e+t;this.colModel.ready&&this.checkViewportColumns(o)}}getColumnHeadersToRender(e){switch(e){case"left":return this.columnsToRenderLeft;case"right":return this.columnsToRenderRight;default:return this.columnsToRenderCenter}}getHeadersToRender(e,t){let o;switch(e){case"left":o=this.rowsOfHeadersToRenderLeft[t];break;case"right":o=this.rowsOfHeadersToRenderRight[t];break;default:o=this.rowsOfHeadersToRenderCenter[t]}return o??[]}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||0===this.viewportRight}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return!(!e.isAutoHeaderHeight()&&!function(e){for(;e;){if(e.isAutoHeaderHeight())return!0;e=e.getParent()}return!1}(e))||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,o=t+e.getActualWidth(),s=this.viewportLeft-200,i=this.viewportRight+200;return!(ti&&o>i)}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=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),{visibleCols:o}=this,s=o.centerCols;return o.getColsForRow(e,s,t,e=>{const t=e.getLeft();return l(t)&&t>this.viewportLeft})}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 o=e=>{const t=/* @__PURE__ */new Set,o={};for(const s of e){let e=s.getParent();const i=s.isSpanHeaderHeight();for(;e&&!t.has(e);){if(i&&e.isPadding()){e=e.getParent();continue}const s=e.getProvidedColumnGroup().getLevel();o[s]??(o[s]=[]),o[s].push(e),t.add(e),e=e.getParent()}}return o};this.rowsOfHeadersToRenderLeft=o(e),this.rowsOfHeadersToRenderRight=o(t),this.rowsOfHeadersToRenderCenter=o(this.headerColsWithinViewport)}extractViewport(){this.extractViewportColumns();const e=this.getViewportColumns().map(e=>`${e.getId()}-${e.getPinned()||"normal"}`).join("#"),t=this.colsWithinViewportHash!==e;return t&&(this.colsWithinViewportHash=e,this.calculateHeaderRows()),t}},class extends Oe{constructor(){super(...arguments),this.beanName="iconSvc"}createIconNoSpan(e,t){return Ol(e,this.beans,t?.column)}}],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:function(e){return e.context.getId()},destroy:function(e){e.gridDestroySvc.destroy()},isDestroyed:function(e){return e.gridDestroySvc.destroyCalled},getGridOption:function(e,t){return e.gos.get(t)},setGridOption:function(e,t,o){Bl(e,{[t]:o})},updateGridOptions:Bl,isModuleRegistered:function(e,t){const o=t.replace(/Module$/,"");return e.gos.isModuleRegistered(o)}},dependsOn:[hd,Ca,Fa,Pu,ch,Ia,hh,vu,Iu,uh,Zh,Xh,eu,gh,gd,ud,Tu,ja,ou]};function ku(e){const{inputValue:t,allSuggestions:o,hideIrrelevant:s,filterByPercentageOfBestMatch:i}=e;let n=(o??[]).map((e,o)=>({value:e,relevance:Lu(t,e),idx:o}));if(n.sort((e,t)=>e.relevance-t.relevance),s&&(n=n.filter(e=>e.relevance0&&i&&i>0){const e=n[0].relevance*i;n=n.filter(t=>e-t.relevance<0)}const r=[],l=[];for(const a of n)r.push(a.value),l.push(a.idx);return{values:r,indices:l}}function Lu(e,t){const o=e.length,s=t.length;if(0===s)return o||0;let i,n=e.toLocaleLowerCase(),r=t.toLocaleLowerCase();e.length1&&i>1){const o=e[h-2],s=n[h-2],l=t[i-2];s===r[i-2]&&(d++,o===l&&d++)}h{const l=function(e,t){const o=[];for(const s of Array.isArray(e)?e:[e]){const e=Bu[s];if(e)for(const s of e){const e=Hu[s];e&&e!==t||o.push(s)}else o.push(s)}return o}(t,i),a="string"==typeof e?e:ju[e];if(r)return function(e,t){const o=t.filter(e=>"IntegratedCharts"===e||"Sparklines"===e);let s="";return!globalThis?.agCharts&&o.length>0?s=`Unable to use ${e} as either the ag-charts-community or ag-charts-enterprise script needs to be included alongside ag-grid-enterprise.\n`:t.some(e=>Gu[e])&&(s+=`Unable to use ${e} as that requires the ag-grid-enterprise script to be included.\n`),s}(a,l);const d=l.filter(e=>"IntegratedCharts"===e||"Sparklines"===e),c=d.length>0?`${d.map(e=>Ou(e)).join()} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.`:"";return`Unable to use ${a} as ${l.length>1?"one of "+l.map(e=>Ou(e)).join(", "):Ou(l[0])} is not registered${o?" for gridId: "+s:""}. ${c} Check if you have registered the module:\n\n${(e=>{const t=e.map(e=>`import { ${Ou(e)} } from '${Gu[e]?"ag-grid-enterprise":"ag-grid-community"}';`);return e.some(e=>"IntegratedCharts"===e||"Sparklines"===e)&&t.push("import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';"),`import { ModuleRegistry } from 'ag-grid-community'; \n${t.join(" \n")} \n\nModuleRegistry.registerModules([ ${e.map(e=>Ou(e,!0)).join(", ")} ]); \n\nFor more info see: ${vt}/modules/`})(l)}`+(n?` \n\n${n}`:"")},Wu=e=>`${e} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.\n\nimport { AgChartsEnterpriseModule } from 'ag-charts-enterprise';\nimport { ModuleRegistry } from 'ag-grid-community';\nimport { ${e} } from 'ag-grid-enterprise';\n \nModuleRegistry.registerModules([${e}.with(AgChartsEnterpriseModule)]);\n `,Uu={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:o})=>["Processing of the expression failed","Expression = ",e,"Params = ",t,"Exception = ",o],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:\n "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.\n Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\n 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:e,method:t})=>`${e}\n${(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.`)(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:o})=>`Cell data type is "object"${t?" (inferred)":""} but no Value ${e} has been provided${o?` for column "${o}"`:""}. Please either provide an object data type definition with a Value ${e}, or set:\n - "colDef.value${e}"${t&&"Parser"===e?"\n - \"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:o,pageSizeOptions:s})=>`'paginationPageSize=${e}'${t?"":" (default value)"}, but ${e} is not included in${o?"":" the default"} paginationPageSizeSelector=[${s?.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:o,jsComps:s})=>{const i=[],n=ku({inputValue:t,allSuggestions:[...Object.keys(o??[]).filter(e=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(e)),...Object.keys(s??[]).filter(e=>!!s[e])],hideIrrelevant:!0,filterByPercentageOfBestMatch:.8}).values;return i.push(`Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.\n`),n.length>0&&i.push(` Did you mean: [${n.slice(0,3)}]?\n`),i.push("If using a custom component check it has been registered correctly."),i},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: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: ${vt}/theming-migration/`,107:({key:e,value:t})=>`Invalid value for theme param ${e} - ${t}`,108:({e:e})=>["chart update failed",e],109:({inputValue:e,allSuggestions:t})=>{const o=ku({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.`,o.length>0?` Did you mean: [${o.slice(0,3)}]?`:"","If using a custom aggregation function check it has been registered correctly."].join("\n")},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.\n 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:o})=>["duplicate group keys for row data, keys should be unique",e,t,...o??[]],187:({rowId:e,firstData:t,secondData:o})=>[`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",o],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:zu,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 ${vt}/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. \nPlease 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. \nYour code probably called a grid API method while the grid was in the render stage. \nTo overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). \nTo 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:()=>Wu("IntegratedChartsModule"),258:()=>Wu("SparklinesModule"),259:({part:e})=>`the argument to theme.withPart must be a Theming API part object, received: ${e}`,260:({propName:e,compName:t,gridScoped:o,gridId:s,rowModelType:i})=>zu({reasonOrId:`AG Grid '${e}' component: ${t}`,moduleName:Uc[t],gridId:s,gridScoped:o,rowModelType:i}),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 ${vt}/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:()=>"No AG Grid modules are registered! It is recommended to start with all Community features via the AllCommunityModule:\n \n import { ModuleRegistry, AllCommunityModule } from 'ag-grid-community';\n \n ModuleRegistry.registerModules([ AllCommunityModule ]);\n ",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."}return t},275:Vu,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 $u(e,t){const o=Uu[e];if(!o)return[`Missing error text for error id ${e}!`];const s=o(t),i=`\nSee ${xt(e,t)}`;return Array.isArray(s)?s.concat(i):[s,i]}var ju={1:"Charting Aggregation",2:"pivotResultFields",3:"setTooltip"},Ku=class{constructor(e="javascript"){var t;this.frameworkName=e,this.renderingEngine="vanilla",this.batchFrameworkComps=!1,this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e(),this.baseDocLink=`${et}/${this.frameworkName}-data-grid`,t=this.baseDocLink,vt=t}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return this.baseDocLink+(e?"/"+e:"")}},_u=/* @__PURE__ */new WeakMap,qu=/* @__PURE__ */new WeakMap;function Yu(e,t,o){if(!t)return Mt(11),{};const s=o;let i;if(!s?.setThemeOnGridDiv){const t=Cl({tag:"div"});t.style.height="100%",e.appendChild(t),e=t,i=()=>e.remove()}return(new Qu).create(e,t,t=>{const o=new Il(e);t.createBean(o)},void 0,o,i)}var Zu=1,Qu=class{create(e,t,o,s,i,n){const r=Xe.applyGlobalGridOptions(t),l=r.gridId??String(Zu++),a=this.getRegisteredModules(i,l,r.rowModelType),d=this.createBeansList(r.rowModelType,a,l),c=this.createProvidedBeans(e,r,i);if(!d)return;const h=new pn({providedBeanInstances:c,beanClasses:d,id:l,beanInitComparator:Cn,beanDestroyComparator:vn,derivedBeans:[mn],destroyCallback:()=>{qu.delete(u),_u.delete(e),function(e){delete lt[e]}(l),n?.()}});this.registerModuleFeatures(h,a),o(h),h.getBean("syncSvc").start(),s?.(h);const u=h.getBean("gridApi");return _u.set(e,u),qu.set(u,e),u}getRegisteredModules(e,t,o){return ct(Au,void 0,!0),e?.modules?.forEach(e=>ct(e,t)),function(e,t){const o=lt[e]??{};return[...Object.values(rt.all??{}),...Object.values(o.all??{}),...Object.values(rt[t]??{}),...Object.values(o[t]??{})]}(t,Xu(o))}registerModuleFeatures(e,t){const o=e.getBean("registry"),s=e.getBean("apiFunctionSvc");for(const i of t){o.registerModule(i);const e=i.apiFunctions;if(e){const t=Object.keys(e);for(const o of t)s?.addFunction(o,e[o])}}}createProvidedBeans(e,t,o){let s=o?o.frameworkOverrides:null;a(s)&&(s=new Ku);const i={gridOptions:t,eGridDiv:e,eRootDiv:e,globalListener:o?o.globalListener:null,globalSyncListener:o?o.globalSyncListener:null,frameworkOverrides:s,withinStudio:o?.withinStudio};return o?.providedBeanInstances&&Object.assign(i,o.providedBeanInstances),i}createBeansList(e,t,o){const s={clientSide:"ClientSideRowModel",infinite:"InfiniteRowModel",serverSide:"ServerSideRowModel",viewport:"ViewportRowModel"},i=Xu(e),n=s[i];if(!n)return void Pt(201,{rowModelType:i},`Unknown rowModelType ${i}.`);if(!at)return void Pt(272,void 0,"No AG Grid modules are registered! It is recommended to start with all Community features via the AllCommunityModule:\n \n import { ModuleRegistry, AllCommunityModule } from 'ag-grid-community';\n \n ModuleRegistry.registerModules([ AllCommunityModule ]);\n ");if(!e){const e=Object.entries(s).filter(([e,t])=>ht(t,o,e));if(1==e.length){const[t,o]=e[0];if(t!==i){const e={moduleName:o,rowModelType:t};return void Pt(275,e,Vu(e))}}}if(!ht(n,o,i)){const e=!1,t=`rowModelType = '${i}'`,s=e?`Unable to use ${t} as that requires the ag-grid-enterprise script to be included.\n`:`Missing module ${n}Module for rowModelType ${i}.`;return void Pt(200,{reasonOrId:t,moduleName:n,gridScoped:ut(),gridId:o,rowModelType:i,isUmd:e},s)}const r=/* @__PURE__ */new Set;for(const l of t)for(const e of l.beans??[])r.add(e);return Array.from(r)}};function Xu(e){return e??"clientSide"}var Ju=(e,t)=>{for(let o=0,s=e.length;o{if(null!=o){const e=o.getSortedRows();for(let t=0,o=e.length;t{const l=e.level+1;for(let a=0,d=t.length;a{if(!h&&void 0!==h){const t=e.sourceRowIndex;h=t<=u,u=t}e.data!==t&&(e.updateData(t),r.has(e)||l.add(e),!e.selectable&&e.isSelected()&&d.push(e))},m=(e,t,o)=>{for(let s=0,n=t.length;s0;if(f){const e=o._leafs??(o._leafs=[]);void 0===h?lg(e,a,n):rg(e,a)&&(n.reordered=!0)}(f||g||l.size)&&(e.rowDataUpdated=!0,this.deselect(d))}deleteUnusedNodes(e,{removals:t},o,s){const i=this.rootNode._leafs;for(let n=0,r=i.length;n0}updateRowData(e,t,o){if(this.dispatchRowDataUpdateStarted(e.add),this.beans.groupStage?.getNestedDataGetter())return Dt(268),{remove:[],update:[],add:[]};const s=[],i=Qt(this.gos),n=this.executeRemove(i,e,t,s,o),r=this.executeUpdate(i,e,t,s),l=this.executeAdd(e,t);return this.deselect(s),{remove:n,update:r,add:l}}executeRemove(e,{remove:t},{adds:o,updates:s,removals:i},n,r){const l=this.rootNode._leafs,a=l?.length,d=t?.length;if(!d||!a)return[];let c=0,h=a,u=0;const g=new Array(d);for(let p=0;pu&&(u=a),g[c++]=l,this.destroyNode(l,r)&&(l.isSelected()&&n.push(l),o.delete(l)||(s.delete(l),i.push(l)))}return g.length=c,c&&ng(l,h,u),g}executeUpdate(e,{update:t},{adds:o,updates:s},i){const n=t?.length;if(!n)return[];const r=new Array(n);let l=0;for(let a=0;a=a;--e){const o=s[e];o.sourceRowIndex=t,s[t--]=o}t.reordered=!0}s.length=l;const d=new Array(r),c=t.adds;for(let h=0;h=o||Number.isNaN(t))return o;t=Math.ceil(t);const s=this.gos;return t>0&&s.get("treeData")&&s.get("getDataPath")&&(t=og(e,t)),t}},og=(e,t)=>{for(let o=0,s=e.length;o{e.group=!0,e.level=-1,e._expanded=!0,e.id="ROOT_NODE_ID",0!==e._leafs?.length&&(e._leafs=[]);const t=[],o=[],s=[],i=[];e.childrenAfterGroup=t,e.childrenAfterSort=o,e.childrenAfterAggFilter=s,e.childrenAfterFilter=i;const n=e.sibling;return n&&(n.childrenAfterGroup=t,n.childrenAfterSort=o,n.childrenAfterAggFilter=s,n.childrenAfterFilter=i,n.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},ig=(e,t)=>{if(e)for(let o=0,s=e.length;o{for(let s=t=Math.max(0,t),i=e.length;s{e.length=t.size;let o=0,s=!1,i=!1;for(const n of t){const t=n.sourceRowIndex;t===o?i||(i=s):(t>=0?i=!0:s=!0,n.sourceRowIndex=o,e[o]=n),++o}return i},lg=(e,t,{adds:o})=>{const s=e.length,i=t.size;i>s&&(e.length=i);let n=0;for(let r=0;r{const t=e.childrenAfterSort,o=e.sibling;if(o&&(o.childrenAfterSort=t),t)for(let s=0,i=t.length-1;s<=i;s++){const e=t[s],o=0===s,n=s===i;e.firstChild!==o&&(e.firstChild=o,e.dispatchRowEvent("firstChildChanged")),e.lastChild!==n&&(e.lastChild=n,e.dispatchRowEvent("lastChildChanged")),e.childIndex!==s&&(e.childIndex=s,e.dispatchRowEvent("childIndexChanged"))}},cg=(e,t)=>{const o=t.childrenAfterGroup;if(o)for(let s=0,i=o.length;s{this.beans.groupStage?.invalidateGroupCols(),this.refreshModel({step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")})};this.addManagedEventListeners({newColumnsLoaded:o,columnRowGroupChanged:o,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,o=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(e=>!!e);this.stages=o;for(let s=o.length-1;s>=0;--s){const e=o[s];for(const o of e.refreshProps)t.set(o,s)}this.addManagedPropertyListeners([...t.keys(),"rowData"],e=>{const t=e.changeSet?.properties;t&&this.onPropChange(t)}),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,o,s){let i,n=!1;do{i=!1;const r=this.getRowIndexAtPixel(e),l=this.getRowIndexAtPixel(t),a=Math.max(r,o),d=Math.min(l,s);for(let e=a;e<=d;e++){const t=this.getRow(e);if(t.rowHeightEstimated){const e=Nt(this.beans,t);t.setRowHeight(e.height),i=!0,n=!0}}i&&this.setRowTopAndRowIndex()}while(i);return n}onPropChange(e){const{nodeManager:t,gos:o,beans:s}=this,i=s.groupStage;if(!t)return;const n=new Set(e),r=i?.onPropChange(n);let l;n.has("rowData")?l=o.get("rowData"):r&&(l=i?.extractData()),l&&!Array.isArray(l)&&(l=null,Dt(1));const a={step:"nothing",changedProps:n};if(l){const e=!r&&!this.isEmpty()&&l.length>0&&o.exists("getRowId")&&!o.get("resetRowDataOnUpdate");this.refreshingData=!0,e?(a.keepRenderedRows=!0,a.animate=!o.get("suppressAnimationFrame"),a.changedRowNodes=new Jl,t.setImmutableRowData(a,l)):(a.rowDataUpdated=!0,a.newData=!0,t.setNewRowData(l),this.rowNodesCountReady=!0)}const d=a.rowDataUpdated?"group":this.getRefreshedStage(e);d&&(a.step=d,this.refreshModel(a))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:o}=this;if(!t)return null;const s=t.length;let i=s;for(let n=0,r=e.length;n{null==e?.id||t.has(e.id)||e.clearRowTopAndRowIndex()},s=t=>{o(t),o(t.detailNode),o(t.sibling);const i=t.childrenAfterGroup;if(t.hasChildren()&&i&&(!e||-1===t.level||t.expanded))for(let e=0,o=i.length;e{let t=i[e];if(this.gos.get("groupHideOpenParents"))for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex},r=t.footerSvc;return r?r?.getTopDisplayIndex(s,e,i,n):n(e)}getTopLevelIndexFromDisplayedIndex(e){const{rootNode:t,rowsToDisplay:o}=this;if(!t||!o.length||o[0]===t)return e;let s=this.getRow(e);s.footer&&(s=s.sibling);let i=s.parent;for(;i&&i!==t;)s=i,i=s.parent;const n=t.childrenAfterSort?.indexOf(s)??-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:zt(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const e=0===t.length||t.some(e=>e.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:e,keepRenderedRows:!0,animate:zt(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:zt(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:o,rowDataUpdated:s}=e;return!(!t||o||!s||t.removals.length||t.adds.size)}reMapRows(){if(this.refreshingModel||this.refreshingData)return this.noKeepRenderedRows=!0,this.noKeepUndoRedoStack=!0,void(this.noAnimate=!0);this.refreshModel({step:"map",keepRenderedRows:!1,keepUndoRedoStack:!1,animate:!1})}refreshModel(e){const{nodeManager:t,eventSvc:o,started:s}=this;if(!t)return;const i=!!e.rowDataUpdated;if(s&&i&&o.dispatchEvent({type:"rowDataUpdated"}),this.deferRefresh(e))return this.setPendingRefreshFlags(e),void(this.rowDataUpdatedPending||(this.rowDataUpdatedPending=i));this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.updateRefreshParams(e);let n=!1;this.refreshingModel=!0;try{this.executeRefresh(e,i),n=!0}finally{this.refreshingData=!1,this.refreshingModel=!1,n||this.setPendingRefreshFlags(e)}this.clearPendingRefreshFlags(),o.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}executeRefresh(e,t){const{beans:o,rootNode:s}=this;o.masterDetailSvc?.refreshModel(e),t&&"group"!==e.step&&o.colFilter?.refreshModel();let i=e.changedPath;switch(i?.addRow(s),"group"===e.step&&(this.doGrouping(s,e),i??(i=e.changedPath)),i??(i=o.changedPathFactory?.ensureRowsPath(e,s)),e.step){case"group":case"filter":this.doFilter(i);case"pivot":this.doPivot(i)&&(i=void 0,e.changedPath=void 0);case"aggregate":this.doAggregate(i);case"filter_aggregates":this.doFilterAggregates(i);case"sort":this.doSort(i,e.changedRowNodes);case"map":this.doRowsToDisplay()}const n=/* @__PURE__ */new Set;this.setRowTopAndRowIndex(n),this.clearRowTopAndRowIndex(i,n),this.updateRefreshParams(e)}deferRefresh(e){return!(!this.refreshingModel&&!this.beans.colModel.changeEventsDispatching&&(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()&&0===this.getRowCount())return"noMatchingRows"}else if(this.rowCountReady||0==(t.get("rowData")?.length??0))return"noRows";return null}getNodesInRangeForSelection(e,t){let o=!1,s=!1;const i=[],n=go(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(!s)if(o&&(r===t||r===e)&&(s=!0,n&&r.group))cg(i,r);else{if(!o){if(r!==t&&r!==e)return;o=!0,t===e&&(s=!0)}r.group&&n||i.push(r)}}),i}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,o=t.length;if(this.isEmpty()||0===o)return-1;let s=0,i=o-1;if(e<=0)return 0;if(t[i].rowTop<=e)return i;let n=-1,r=-1;for(;;){const o=Math.floor((s+i)/2),l=t[o];if(this.isRowInPixel(l,e))return o;if(l.rowTope&&(i=o-1),n===s&&r===i)return o;n=s,r=i}}isRowInPixel(e,t){const o=e.rowTop,s=o+e.rowHeight;return o<=t&&s>t}forEachLeafNode(e){const t=this.rootNode?._leafs;if(t)for(let o=0,s=t.length;oe.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,e=>e.childrenAfterSort)}forEachPivotNode(e,t,o){const{colModel:s,rowGroupColsSvc:i}=this.beans;if(!s.isPivotMode())return;if(!i?.columns.length)return void e(this.rootNode,0);const n=o?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,e=>e.leafGroup?null:e[n])}depthFirstSearchRowNodes(e,t=!1,o=e=>e.childrenAfterGroup,s=this.rootNode,i=0){let n=i;if(!s)return n;const r=s===this.rootNode;if(r||e(s,n++),s.hasChildren()&&!s.footer){const i=r||this.hierarchical?o(s):null;if(i){const l=this.beans.footerSvc;n=l?.addTotalRows(n,s,e,t,r,"top")??n;for(const s of i)n=this.depthFirstSearchRowNodes(e,t,o,s,n);return l?.addTotalRows(n,s,e,t,r,"bottom")??n}}return n}doAggregate(e){this.rootNode&&this.beans.aggStage?.execute(e)}doFilterAggregates(e){const t=this.rootNode,o=this.beans.filterAggStage;if(o&&this.hierarchical)return void o.execute(e);t.childrenAfterAggFilter=t.childrenAfterFilter;const s=t.sibling;s&&(s.childrenAfterAggFilter=t.childrenAfterFilter)}doSort(e,t){const o=this.beans.sortStage;o?o.execute(e,t):eg(this.rootNode,this.hierarchical,e,e=>{e.childrenAfterSort=e.childrenAfterAggFilter.slice(0),dg(e)})}doGrouping(e,t){const o=this.beans.groupStage?.execute(t);if(void 0===o){const t=e._leafs;e.childrenAfterGroup=t,e.updateHasChildren();const o=e.sibling;o&&(o.childrenAfterGroup=t)}(o||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;t?t.execute(e):eg(this.rootNode,this.hierarchical,e,e=>{e.childrenAfterFilter=e.childrenAfterGroup,ag(e)})}doPivot(e){return this.beans.pivotStage?.execute(e)??!1}getRowNode(e){const t=this.nodeManager?.getRowNode(e);return"object"==typeof t?t:this.beans.groupStage?.getNonLeaf(e)}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const e=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),e)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){const{nodeManager:e,beans:t,eventSvc:o,asyncTransactions:s}=this;if(!e)return;t.valueCache?.onDataChanged();const i=[],n=[],r=new Jl,l=!this.gos.get("suppressAnimationFrame");for(const{rowDataTransaction:a,callback:d}of s??[]){this.rowNodesCountReady=!0,this.refreshingData=!0;const t=e.updateRowData(a,r,l);i.push(t),d&&n.push(d.bind(null,t))}this.commitTransactions(r,l),n.length>0&&setTimeout(()=>{for(let e=0,t=n.length;e0&&o.dispatchEvent({type:"asyncTransactionsFlushed",results:i}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){const t=this.nodeManager;if(!t)return null;this.beans.valueCache?.onDataChanged(),this.rowNodesCountReady=!0;const o=new Jl,s=!this.gos.get("suppressAnimationFrame");this.refreshingData=!0;const i=t.updateRowData(e,o,s);return this.commitTransactions(o,s),i}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 t=e?.childrenAfterSort??[];this.formulaRows=t,this.rowsToDisplay=t.filter(e=>!e.softFiltered);for(const e of this.rowsToDisplay)e.setUiLevel(0);return}const o=t.flattenStage;if(o)return void(this.rowsToDisplay=o.execute());const s=this.rootNode.childrenAfterSort??[];for(const i of s)i.setUiLevel(0);this.rowsToDisplay=s}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const o=e.sibling;o?.setRowHeight(o.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const o=t.detailNode;o?.setRowHeight(o.rowHeight,!0);const s=t.sibling;s?.setRowHeight(s.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()}},class extends Oe{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e,t){const o=this.beans.sortSvc.getSortOptions(),s=o.length>0&&!!t&&this.gos.get("deltaSort"),{gos:i,colModel:n,rowGroupColsSvc:r,rowNodeSorter:l,rowRenderer:a,showRowGroupCols:d}=this.beans,c=i.get("groupMaintainOrder"),h=n.getCols().some(e=>e.isRowGroupActive()),u=r?.columns,g=n.isPivotMode(),p=i.getCallback("postSortRows");let m,f=!1;if(eg(this.beans.rowModel.rootNode,this.beans.rowModel.hierarchical,e,i=>{const n=g&&i.leafGroup;let r=c&&h&&!i.leafGroup;r&&(m??(m=this.shouldSortContainsGroupCols(o)),r&&(r=!m));let a=null;if(r){let e=!1;if(u){const t=i.level+1;t{const t=e.childrenAfterSort,o=e.childrenAfterAggFilter,s=t?.length,i=o?.length;if(!s||!i)return null;const n=new Array(i),r=/* @__PURE__ */new Set;for(let a=0;a{const n=t.childrenAfterSort,r=t.childrenAfterAggFilter;if(!r)return n&&n.length>0?n:[];const l=r.length;if(l<=1)return n?.length!==l||0!==l&&n[0]!==r[0]?r.slice():n;if(!n||l<=4)return e.doFullSortInPlace(r.slice(),i);const a=/* @__PURE__ */new Map,{updates:d,adds:c}=o,h=[];for(let g=0;g{let s=0;o.length=t.size;for(let i=0,n=e.length;ie.compareRowNodes(i,t,o)||~a.get(t)-~a.get(o)),u===l?h:((e,t,o,s,i,n)=>{const r=new Array(n);let l,a=0,d=o[a],c=-1,h=0,u=0;const g=o.length,p=s.length;for(;;){if(c<0){if(h>=p)break;if(l=s[h++],c=i.get(l)??-1,c<0)continue}if((e.compareRowNodes(t,d,l)||~i.get(d)-c)<0){if(r[u++]=d,++a>=g)break;d=o[a]}else r[u++]=l,c=-1}for(;a=0&&(r[u++]=e)}return r})(e,i,h,n,a,l))})(l,i,t,e,o):l.doFullSortInPlace(i.childrenAfterAggFilter.slice(),o));a||(a=i.childrenAfterAggFilter?.slice()??[]),f||(f=i.childrenAfterSort?.[0]!==a[0]),i.childrenAfterSort=a,dg(i),p&&p({nodes:i.childrenAfterSort})}),f&&i.get("groupHideOpenParents")){const e=d?.columns;e?.length&&a.refreshCells({columns:e,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(Ut(this.gos)){for(let o=0;oi&&(t=i),t}function pg({ctrlsSvc:e,scrollVisibleSvc:t}){const o=e.getGridBodyCtrl(),s=o.isVerticalScrollShowing()?t.getScrollbarWidth():0;return Q(o.eGridBody)-s}var mg="ag-animate-autosize";function fg({ctrlsSvc:e,gos:t},o){if(!t.get("animateColumnResizing")||t.get("enableRtl")||!e.isAlive())return;const s=e.getGridBodyCtrl().eGridBody.classList;o?s.add(mg):s.remove(mg)}var Cg={moduleName:"ColumnAutoSize",version:mt,beans:[class extends Oe{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 o=!1;const s=t.type;if("fitGridWidth"===s||"fitProvidedWidth"===s)o=!0;else if("fitCellContents"===s){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const s=e.get("rowData");o=null!=s&&s.length>0&&It(e)}o&&this.beans.colDelayRenderSvc?.hideColumns(s)}}autoSizeCols(e){const{eventSvc:t,visibleCols:o,colModel:s}=this.beans;fg(this.beans,!0),this.innerAutoSizeCols(e).then(i=>{const n=e=>Sa(t,Array.from(e),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return fg(this.beans,!1),n(i);const r=pg(this.beans),l=e.colKeys.filter(e=>!(s.getCol(e)?.getColDef().suppressAutoSize||os(e)||(e=>o.leftCols.some(t=>as(t,e)))(e)||(e=>o.rightCols.some(t=>as(t,e)))(e)));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:e.columnLimits?.map(e=>({...e,key:e.colId})),colKeys:l,onlyScaleUp:!0,animate:!1}),fg(this.beans,!1),n(i)})}innerAutoSizeCols(e){return new Promise((t,o)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,o));const{colKeys:s,skipHeader:i,skipHeaderGroups:n,stopAtGroup:r,defaultMaxWidth:l,defaultMinWidth:a,columnLimits:d=[],source:c="api"}=e,{animationFrameSvc:h,renderStatus:u,colModel:g,autoWidthCalc:p,visibleCols:m}=this.beans;if(h?.flushAllFrames(),this.timesDelayed<5&&u&&(!u.areHeaderCellsRendered()||!u.areCellsRendered()))return this.timesDelayed++,void setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,o)});this.timesDelayed=0;const f=/* @__PURE__ */new Set;let C=-1;const v=Object.fromEntries(d.map(({colId:e,...t})=>[e,t])),w=i??this.gos.get("skipHeaderOnAutoSize"),b=n??w;for(;0!==C;){C=0;const e=[];for(const t of s){if(!t||ss(t))continue;const o=g.getCol(t);if(!o||f.has(o)||o.getColDef().suppressAutoSize)continue;const s=p.getPreferredWidthForColumn(o,w);if(s>0){const e=v[o.colId]??{};e.minWidth??(e.minWidth=a),e.maxWidth??(e.maxWidth=l);const t=gg(o,s,e);o.setActualWidth(t,c),f.add(o),C++}e.push(o)}e.length&&m.refresh(c)}b||this.autoSizeColumnGroupsByColumns(s,c,r),t(f)})}autoSizeColumn(e,t,o){this.autoSizeCols({colKeys:[e],skipHeader:o,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,o){const{colModel:s,ctrlsSvc:i}=this.beans,n=/* @__PURE__ */new Set,r=s.getColsForKeys(e);for(const a of r){let e=a.getParent();for(;e&&e!=o;)e.isPadding()||n.add(e),e=e.getParent()}let l;for(const a of n){for(const e of i.getHeaderRowContainerCtrls())if(l=e.getHeaderCtrlForColumn(a),l)break;l?.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){this.shouldQueueResizeOperations?this.pushResizeOperation(()=>this.autoSizeAllColumns(e)):this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",o)};e.addEventListener("dblclick",s);const i=new hn(e);return i.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),i.destroy()}}addColumnGroupResize(e,t,o){const s=this.gos.get("skipHeaderOnAutoSize"),i=()=>{const e=[],i=t.getDisplayedLeafColumns();for(const t of i)t.getColDef().suppressAutoSize||e.push(t.getColId());e.length>0&&this.autoSizeCols({colKeys:e,skipHeader:s,stopAtGroup:t,source:"uiColumnResized"}),o()};return e.addEventListener("dblclick",i),()=>e.removeEventListener("dblclick",i)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const o=pg(this.beans);o>0?this.sizeColumnsToFit(o,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):100===t?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):500===t?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Dt(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",o,i){if(this.shouldQueueResizeOperations)return void this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,o,i));const{beans:n}=this,r=i?.animate??!0;r&&fg(n,!0);const l={};for(const{key:s,...C}of i?.columnLimits??[])l["string"==typeof s?s:s.getColId()]=C;const a=n.visibleCols.allCols;if(e<=0||!a.length)return;const d=Xo(a);if(i?.onlyScaleUp&&d>e)return;if(e===d&&a.every(e=>{if(e.colDef.suppressSizeToFit)return!0;const t=l?.[e.getId()],o=t?.minWidth??i?.defaultMinWidth,s=t?.maxWidth??i?.defaultMaxWidth,n=e.getActualWidth();return(null==o||n>=o)&&(null==s||n<=s)}))return;const c=[],h=[];for(const s of a){const e=i?.colKeys?.some(e=>as(s,e))??!0;s.getColDef().suppressSizeToFit||!e?h.push(s):c.push(s)}const u=c.slice(0);let g=!1;const p=e=>{s(c,e),h.push(e)},m={};for(const s of c){i?.onlyScaleUp&&(m[s.getColId()]=s.getActualWidth()),s.resetActualWidth(t);const e=l?.[s.getId()],o=e?.minWidth??i?.defaultMinWidth??-1/0,n=e?.maxWidth??i?.defaultMaxWidth??1/0,r=s.getActualWidth(),a=Math.max(Math.min(r,n),o);a!=r&&s.setActualWidth(a,t,!0)}for(;!g;){g=!0;const o=e-Xo(h);if(o<=0)for(const e of c){const o=l?.[e.getId()]?.minWidth??i?.defaultMinWidth??e.minWidth;e.setActualWidth(o,t,!0)}else{const e=o/Xo(c);let s=o;for(let o=c.length-1;o>=0;o--){const n=c[o],r=n.getColId(),a=m[r],d=l?.[r],h=d?.minWidth??i?.defaultMinWidth??a,u=d?.maxWidth??i?.defaultMaxWidth,f=Math.max(h??-1/0,n.getMinWidth()),C=Math.min(u??1/0,n.getMaxWidth());let v=Math.round(n.getActualWidth()*e);vC?(v=C,p(n),g=!1):0===o&&(v=s),n.setActualWidth(v,t,!0),s-=v}}}for(const s of u)s.fireColumnWidthChangedEvent(t);const f=n.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),o||(Sa(this.eventSvc,u,!0,t),r&&fg(n,!1))}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,o=e.get("autoSizeStrategy");"fitGridWidth"!==o?.type&&"fitProvidedWidth"!==o?.type||setTimeout(()=>{if(!this.isAlive())return;const e=o.type;if("fitGridWidth"===e){const{columnLimits:e,defaultMinWidth:t,defaultMaxWidth:s}=o,i=e?.map(({colId:e,minWidth:t,maxWidth:o})=>({key:e,minWidth:t,maxWidth:o}));this.sizeColumnsToFitGridBody({defaultMinWidth:t,defaultMaxWidth:s,columnLimits:i})}else"fitProvidedWidth"===e&&this.sizeColumnsToFit(o.width,"sizeColumnsToFit");t?.revealColumns(e)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{if(!this.isAlive())return;const o="autosizeColumns";e?this.autoSizeCols({...t,source:o,colKeys:e}):this.autoSizeAllColumns({...t,source:o}),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()}}],apiFunctions:{sizeColumnsToFit:function(e,t){"number"==typeof t?e.colAutosize?.sizeColumnsToFit(t,"api"):e.colAutosize?.sizeColumnsToFitGridBody(t)},autoSizeColumns:ug,autoSizeAllColumns:function(e,t){t&&"object"==typeof t?ug(e,t):e.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:t})}},dependsOn:[va],css:[":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}}"]},vg={moduleName:"SharedExport",version:mt,beans:[class extends Oe{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:o,columnKeys:s,skipRowGroups:i,exportRowNumbers:n}=t,r=this.getColumnsToExport({allColumns:o,skipRowGroups:i,columnKeys:s,exportRowNumbers:n});return[this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t)].reduce((e,t)=>t(e),e).parse()}processRow(e,t,o,s){const i=t.shouldRowBeSkipped||(()=>!1),n=null!=t.rowPositions||!!t.onlySelected,r=this.gos.get("groupHideOpenParents")&&!n,l=this.colModel.isPivotMode()?s.leafGroup:!s.group,a=!!s.footer,d=1===s.allChildrenCount&&1===s.childrenAfterGroup?.length&&function(e,t){const o=e.get("groupHideParentOfSingleChild");return!0===o||!("leafGroupsOnly"!==o||!t.leafGroup)||!!e.get("groupRemoveSingleChildren")||!(!e.get("groupRemoveLowestSingleChildren")||!t.leafGroup)}(this.gos,s);if(!l&&!a&&(t.skipRowGroups||d||r)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&"top"===s.rowPinned||t.skipPinnedBottom&&"bottom"===s.rowPinned||s.stub)return;if(-1===s.level&&!l&&!a)return;if(i(Co(this.gos,{node:s})))return;const c=e.onNewBodyRow(s);if(o.forEach((e,t)=>{c.onColumn(e,t,s)}),t.getCustomContentBelowRow){const o=t.getCustomContentBelowRow(Co(this.gos,{node:s}));o&&e.addCustomContent(o)}}appendContent(e){return t=>{const o=e.appendContent;return o&&t.addCustomContent(o),t}}prependContent(e){return t=>{const o=e.prependContent;return o&&t.addCustomContent(o),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return o=>{if(!e.skipColumnGroupHeaders){const s=new Ma,{colGroupSvc:i}=this.beans,n=i?i.createColumnGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(n,o,e.processGroupHeaderCallback)}return o}}exportHeaders(e,t){return o=>{if(!e.skipColumnHeaders){const e=o.onNewHeaderRow();t.forEach((t,o)=>{e.onColumn(t,o,void 0)})}return o}}processPinnedTopRows(e,t){return o=>{const s=this.processRow.bind(this,o,e,t);return e.rowPositions?e.rowPositions.filter(e=>"top"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel?.getPinnedTopRow(e.rowIndex)).forEach(s):this.pinnedRowModel?.isManual()||this.pinnedRowModel?.forEachPinnedRow("top",s),o}}processRows(e,t){return o=>{const s=this.rowModel,i=It(this.gos),n=At(this.gos),r=!i&&e.onlySelected,l=this.processRow.bind(this,o,e,t),{exportedRows:a="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(e=>null==e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>s.getRow(e.rowIndex)).forEach(l);else if(this.colModel.isPivotMode())i?s.forEachPivotNode(l,!0,"filteredAndSorted"===a):n?s.forEachNodeAfterFilterAndSort(l,!0):s.forEachNode(l);else if(e.onlySelectedAllPages||r){const e=this.beans.selectionSvc?.getSelectedNodes()??[];this.replicateSortedOrder(e),e.forEach(l)}else"all"===a?s.forEachNode(l):i||n?s.forEachNodeAfterFilterAndSort(l,!0):s.forEachNode(l);return o}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:o}=this.beans;if(!t||!o)return;const s=t.getSortOptions(),i=(e,t)=>null!=e.rowIndex&&null!=t.rowIndex?e.rowIndex-t.rowIndex:e.level===t.level?e.parent?.id===t.parent?.id?o.compareRowNodes(s,e,t)||(e.rowIndex??-1)-(t.rowIndex??-1):i(e.parent,t.parent):e.level>t.level?i(e.parent,t):i(e,t.parent);e.sort(i)}processPinnedBottomRows(e,t){return o=>{const s=this.processRow.bind(this,o,e,t);return e.rowPositions?e.rowPositions.filter(e=>"bottom"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel?.getPinnedBottomRow(e.rowIndex)).forEach(s):this.pinnedRowModel?.isManual()||this.pinnedRowModel?.forEachPinnedRow("bottom",s),o}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:o=!1,exportRowNumbers:s=!1,columnKeys:i}=e,{colModel:n,gos:r,visibleCols:l}=this,a=n.isPivotMode(),d=e=>!ts(e)&&(!os(e)||s);if(i?.length)return n.getColsForKeys(i).filter(d);const c=r.get("treeData");let h=[];return h=t&&!a?n.getCols():l.allCols,h=h.filter(e=>d(e)&&(!(o&&!c)||!es(e))),h}recursivelyAddHeaderGroups(e,t,o){const s=[];for(const i of e){const e=i;if(e.getChildren)for(const t of e.getChildren()??[])s.push(t)}e.length>0&&us(e[0])&&this.doAddHeaderHeader(t,e,o),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,o)}doAddHeaderHeader(t,o,s){const i=t.onNewHeaderGroupingRow();let n=0;for(const r of o){const t=r;let o;o=s?s(Co(this.gos,{columnGroup:t})):this.beans.colNames.getDisplayNameForColumnGroup(t,"header");const l=(t.isExpandable()?t.getLeafColumns():[]).reduce((t,o,s,i)=>{let n=e(t);return"open"!==o.getColumnGroupShow()?n&&null==n[1]&&(n[1]=s-1):n&&null==n[1]||(n=[s],t.push(n)),s===i.length-1&&n&&null==n[1]&&(n[1]=s),t},[]);i.onColumn(t,o||"",n++,t.getLeafColumns().length-1,l)}}}]},wg=class extends Oe{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 bg(e,t){const o=document.defaultView||window;if(!o)return void Dt(52);const s=document.createElement("a"),i=o.URL.createObjectURL(t);s.setAttribute("href",i),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:o})),s.remove(),o.setTimeout(()=>{o.URL.revokeObjectURL(i)},0)}var yg,Sg=class{constructor(e){this.valueFrom="data";const{colModel:t,rowGroupColsSvc:o,colNames:s,valueSvc:i,gos:n,processCellCallback:r,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:d,valueFrom:c}=e;this.colModel=t,this.rowGroupColsSvc=o,this.colNames=s,this.valueSvc=i,this.gos=n,this.processCellCallback=r,this.processHeaderCallback=l,this.processGroupHeaderCallback=a,this.processRowGroupCallback=d,c&&(this.valueFrom=c)}prepare(e){}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e){const{column:t,node:o,currentColumnIndex:s,accumulatedRowIndex:i,type:n,useRawFormula:r}=e,l=0===s&&Zt(this.gos,o,this.colModel.isPivotMode());if(this.processRowGroupCallback&&(this.gos.get("treeData")||o.group)&&(t.isRowGroupDisplayed(o.rowGroupColumn?.getColId()??"")||l))return{value:this.processRowGroupCallback(Co(this.gos,{column:t,node:o}))??""};if(this.processCellCallback)return{value:this.processCellCallback(Co(this.gos,{accumulatedRowIndex:i,column:t,node:o,value:this.valueSvc.getValueForDisplay({column:t,node:o,from:this.valueFrom}).value,type:n,parseValue:e=>this.valueSvc.parseValue(t,o,e,this.valueSvc.getValue(t,o,this.valueFrom)),formatValue:e=>this.valueSvc.formatValue(t,o,e)??e}))??""};const a=this.gos.get("treeData"),d=this.valueSvc,c=-1===o.level&&o.footer,h=!0===t.colDef.showRowGroup&&(o.group||a);if(!c&&(l||h)){let e="",s=o;for(;s&&-1!==s.level;){const{value:o,valueFormatted:i}=d.getValueForDisplay({column:l?void 0:t,node:s,includeValueFormatted:!0,exporting:!0,from:this.valueFrom});e=` -> ${i??o??""}${e}`,s=s.parent}return{value:e,valueFormatted:e}}const{value:u,valueFormatted:g}=d.getValueForDisplay({column:t,node:o,includeValueFormatted:!0,exporting:!0,useRawFormula:r,from:this.valueFrom});return{value:u??"",valueFormatted:g}}getHeaderName(e,t){return e?e(Co(this.gos,{column:t})):this.colNames.getDisplayNameForColumn(t,"csv",!0)}},Rg=class extends Sg{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:o}=e;this.suppressQuotes=t,this.columnSeparator=o}addCustomContent(e){e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach(e=>{this.beginNewLine(),e.forEach((e,t)=>{0!==t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e.data.value||""),e.mergeAcross&&this.appendEmptyCells(e.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,o,s){0!=o&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,o){0!=t&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue({column:e,node:o,currentColumnIndex:t,accumulatedRowIndex:t,type:"csv",useRawFormula:!1});this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return'""';let t;return"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(Dt(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1}},xg={moduleName:"CsvExport",version:mt,beans:[class extends wg{constructor(){super(...arguments),this.beanName="csvCreator"}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void Dt(51);const t=()=>{const t=this.getMergedParams(e),o=this.getData(t),s=new Blob(["\ufeff",o],{type:"text/plain"}),i=t.fileName,n="function"==typeof i?i(Co(this.gos,{})):i;bg(this.getFileName(n),s)},{overlays:o}=this.beans;o?o.showExportOverlay(t):t()}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const o=t?Object.assign({},e):this.getMergedParams(e);return this.getData(o)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:o,rowGroupColsSvc:s,valueSvc:i,gos:n}=this.beans,{processCellCallback:r,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:d,suppressQuotes:c,columnSeparator:h,valueFrom:u}=e;return new Rg({colModel:t,colNames:o,valueSvc:i,gos:n,processCellCallback:r||void 0,processHeaderCallback:l||void 0,processGroupHeaderCallback:a||void 0,processRowGroupCallback:d||void 0,suppressQuotes:c||!1,columnSeparator:h||",",rowGroupColsSvc:s,valueFrom:u})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}}],apiFunctions:{getDataAsCsv:function(e,t){return e.csvCreator?.getDataAsCsv(t)},exportDataAsCsv:function(e,t){e.csvCreator?.exportDataAsCsv(t)}},dependsOn:[vg]},Fg=class extends He{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}postConstruct(){this.refreshTooltip()}setBrowserTooltip(e,t){const o="title",s=this.ctrl.getGui();s&&(null==e||""==e&&!t?s.removeAttribute(o):s.setAttribute(o,e))}updateTooltipText(){const{getTooltipValue:e}=this.ctrl;e&&(this.tooltip=e())}createTooltipFeatureIfNeeded(){if(null==this.tooltipManager){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()}},Dg=!1,Mg=class extends He{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();0===this.tooltipTrigger&&this.addManagedListeners(e,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),1===this.tooltipTrigger&&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&&"hover"!==e?1:0}onMouseEnter(e){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),Ai()||(Dg?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(e)},100):this.prepareToShowTooltip(e))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&2===this.state&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){const t=e.relatedTarget,o=this.tooltipCtrl.getGui(),s=this.tooltipComp?.getGui();this.isInteractingWithTooltip||o.contains(t)||this.interactionEnabled&&s?.contains(t)||this.setToDoNothing()}onKeyDown(){this.isInteractingWithTooltip&&(this.isInteractingWithTooltip=!1),this.setToDoNothing()}prepareToShowTooltip(e){if(0!=this.state||Dg)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()-yg<1e3}setToDoNothing(e){e||2!==this.state||this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.clearEventHandlers(),this.onDocumentKeyDownCallback&&(this.onDocumentKeyDownCallback(),this.onDocumentKeyDownCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const e=this.getTooltipValue(),t=this.tooltipCtrl;if(!l(e)||t.shouldDisplayTooltip&&!t.shouldDisplayTooltip())return void this.setToDoNothing();const o=this.gos.addCommon({location:t.getLocation?.()??"UNKNOWN",value:e,hideTooltipCallback:()=>this.hideTooltip(!0),...t.getAdditionalParams?.()});this.state=2,this.tooltipInstanceCount++;const s=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.createTooltipComp(o,s)}hideTooltip(e){!e&&this.isInteractingWithTooltip||(this.tooltipComp&&(this.destroyTooltipComp(),yg=Date.now()),this.eventSvc.dispatchEvent({type:"tooltipHide",parentGui:this.tooltipCtrl.getGui()}),e&&(this.isInteractingWithTooltip=!1),this.setToDoNothing(!0))}newTooltipComponentCallback(e,t){if(2!==this.state||this.tooltipInstanceCount!==e)return void this.destroyBean(t);const o=t.getGui();this.tooltipComp=t,o.classList.contains("ag-tooltip")||o.classList.add("ag-tooltip-custom"),0===this.tooltipTrigger&&o.classList.add("ag-tooltip-animate"),this.interactionEnabled&&o.classList.add("ag-tooltip-interactive");const s=this.getLocaleTextFunc(),i=this.popupSvc?.addPopup({eChild:o,ariaLabel:s("ariaLabelTooltip","Tooltip")});if(i&&(this.tooltipPopupDestroyFunc=i.hideFunc),this.positionTooltip(),1===this.tooltipTrigger){const e=()=>this.setToDoNothing();[this.onBodyScrollEventCallback]=this.addManagedEventListeners({bodyScroll:e}),this.setEventHandlers(e)}this.interactionEnabled&&([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(o,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),[this.onDocumentKeyDownCallback]=this.addManagedElementListeners(b(this.beans),{keydown:e=>{o.contains(e?.target)||this.onKeyDown()}}),1===this.tooltipTrigger&&([this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(o,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}))),this.eventSvc.dispatchEvent({type:"tooltipShow",tooltipGui:o,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=w(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,o=0===this.tooltipTrigger?1e3:0;window.setTimeout(()=>{e(),this.destroyBean(t)},o),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(){Dg=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},100)}unlockService(){Dg=!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()}},Pg=0,Eg=class extends He{constructor(){super(...arguments),this.beanName="popupSvc",this.popupList=[]}postConstruct(){this.addManagedEventListeners({stylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){return this.gos.get("popupParent")||this.getDefaultPopupParent()}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:o,nudgeY:s,skipObserver:i}=e;this.positionPopup({ePopup:t,nudgeX:o,nudgeY:s,keepWithinBounds:!0,skipObserver:i,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:o,nudgeY:s,keepWithinBounds:i,eventSource:n,alignSide:r="left",position:l="over",type:a}=e,d=n.getBoundingClientRect(),c=this.getParentRect();this.setAlignedTo(n,t),this.positionPopup({ePopup:t,nudgeX:o,nudgeY:s,keepWithinBounds:i,updatePosition:()=>{let o,i=d.left-c.left;return"right"===r&&(i-=t.offsetWidth-d.width),"over"===l?(o=d.top-c.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),o="under"===this.shouldRenderUnderOrAbove(t,d,c,e.nudgeY||0)?d.top-c.top+d.height:d.top-t.offsetHeight-2*(s||0)-c.top),{x:i,y:o}},postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,a,t,n,null)})}positionPopupForMenu(e){const{eventSource:t,ePopup:o,event:s}=e,i=t.getBoundingClientRect(),n=this.getParentRect();this.setAlignedTo(t,o);let r=!1;this.positionPopup({ePopup:o,keepWithinBounds:!0,updatePosition:()=>{const e=this.keepXYWithinBounds(o,i.top-n.top,0),t=o.clientWidth>0?o.clientWidth:200;r||(o.style.minWidth=`${t}px`,r=!0);const s=n.right-n.left-t;let l;return this.gos.get("enableRtl")?(l=d(),l<0&&(l=a(),this.setAlignedStyles(o,"left")),l>s&&(l=0,this.setAlignedStyles(o,"right"))):(l=a(),l>s&&(l=d(),this.setAlignedStyles(o,"right")),l<0&&(l=0,this.setAlignedStyles(o,"left"))),{x:l,y:e};function a(){return i.right-n.left-2}function d(){return i.left-n.left-t}},postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,"subMenu",o,t,s instanceof MouseEvent?s:void 0)})}shouldRenderUnderOrAbove(e,t,o,s){const i=o.bottom-t.bottom,n=t.top-o.top,r=e.offsetHeight+s;return i>r?"under":n>r||n>i?"above":"under"}setAlignedStyles(e,t){const o=this.getPopupIndex(e);if(-1===o)return;const{alignedToElement:s}=this.popupList[o];if(s){for(const t of["right","left","over","above","under"])s.classList.remove(`ag-has-popup-positioned-${t}`),e.classList.remove(`ag-popup-positioned-${t}`);t&&(s.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}}setAlignedTo(e,t){const o=this.getPopupIndex(t);-1!==o&&(this.popupList[o].alignedToElement=e)}positionPopup(e){const{ePopup:t,keepWithinBounds:o,nudgeX:s,nudgeY:i,skipObserver:n,updatePosition:r}=e,l={width:0,height:0},a=(n=!1)=>{let{x:a,y:d}=r();n&&t.clientWidth===l.width&&t.clientHeight===l.height||(l.width=t.clientWidth,l.height=t.clientHeight,s&&(a+=s),i&&(d+=i),o&&(a=this.keepXYWithinBounds(t,a,1),d=this.keepXYWithinBounds(t,d,0)),t.style.left=`${a}px`,t.style.top=`${d}px`,e.postProcessCallback&&e.postProcessCallback())};if(a(),!n){const e=we(this.beans,t,()=>a(!0));setTimeout(()=>e(),200)}}getParentRect(){const e=b(this.beans);let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),ee(t)}keepXYWithinBounds(e,t,o){const s=0===o,i=s?"clientHeight":"clientWidth",n=s?"top":"left",r=s?"height":"width",l=s?"scrollTop":"scrollLeft",a=b(this.beans),d=a.documentElement,c=this.getPopupParent(),h=e.getBoundingClientRect(),u=c.getBoundingClientRect(),g=a.documentElement.getBoundingClientRect(),p=c===a.body,m=Math.ceil(h[r]);let f=p?(s?X:J)(d)+d[l]:c[i];p&&(f-=Math.abs(g[n]-u[n]));const C=f-m;return Math.min(Math.max(t,0),Math.max(C,0))}addPopup(e){const{eChild:t,ariaLabel:o,ariaOwns:s,alwaysOnTop:i,positionCallback:n,anchorToElement:r}=e,l=this.getPopupIndex(t);if(-1!==l)return{hideFunc:this.popupList[l].hideFunc};this.initialisePopupPosition(t);const a=this.createPopupWrapper(t,!!i,o,s),d=this.addEventListenersToPopup({...e,wrapperEl:a});return n&&n(),this.addPopupToPopupList(t,a,d,r),{hideFunc:d}}initialisePopupPosition(e){const t=this.getPopupParent().getBoundingClientRect();l(e.style.top)||(e.style.top=-1*t.top+"px"),l(e.style.left)||(e.style.left=-1*t.left+"px")}createPopupWrapper(e,t,o,s){const i=this.getPopupParent(),{environment:n,gos:r}=this.beans,l=xe({tag:"div"});return n.applyThemeClasses(l),l.classList.add("ag-popup"),e.classList.add(r.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||P(e,"dialog"),o?E(e,o):s&&(e.id||(e.id=`popup-component-${Pg}`),z(s,e.id)),l.appendChild(e),i.appendChild(l),t?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),l}addEventListenersToPopup(e){const t=this.beans,o=b(t),{wrapperEl:s,eChild:i,closedCallback:n,afterGuiAttached:r,closeOnEsc:l,modal:a,ariaOwns:d}=e;let c=!1;const h=e=>{s.contains(w(t))&&(e.key!==Cs||this.isStopPropagation(e)||p({keyboardEvent:e}))},u=e=>p({mouseEvent:e}),g=e=>p({touchEvent:e}),p=(e={})=>{const{mouseEvent:t,touchEvent:r,keyboardEvent:l,forceHide:a}=e;(a||!this.isEventFromCurrentPopup({mouseEvent:t,touchEvent:r},i)&&!c)&&(c=!0,s.remove(),o.removeEventListener("keydown",h),o.removeEventListener("mousedown",u),o.removeEventListener("touchstart",g),o.removeEventListener("contextmenu",u),this.eventSvc.removeListener("dragStarted",u),n&&n(t||r||l),this.removePopupFromPopupList(i,d))};return r&&r({hidePopup:p}),window.setTimeout(()=>{l&&o.addEventListener("keydown",h),a&&(o.addEventListener("mousedown",u),this.eventSvc.addListener("dragStarted",u),o.addEventListener("touchstart",g),o.addEventListener("contextmenu",u))},0),p}addPopupToPopupList(e,t,o,s){this.popupList.push({element:e,wrapper:t,hideFunc:o,instanceId:Pg,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s),Pg+=1}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const o=this.getPopupIndex(e);if(-1===o)return;const s=this.popupList[o];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then(e=>e&&e()),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const i=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=i,s.isAnchored=!0,i}removePopupFromPopupList(e,t){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),t&&z(t,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),o=t.getBoundingClientRect(),{element:s,ePopup:i}=e,n=s.getBoundingClientRect(),r=e=>Number.parseInt(e.substring(0,e.length-1),10),l=(e,t)=>{const s=o[e]-n[e],l=r(i.style[e]);return{initialDiff:s,lastDiff:s,initial:l,last:l,direction:t}},a=l("top",0),d=l("left",1),c=this.beans.frameworkOverrides;return new Ns(o=>{c.wrapIncoming(()=>{var n;(n=()=>{const o=t.getBoundingClientRect(),n=s.getBoundingClientRect();if(0==n.top&&0==n.left&&0==n.height&&0==n.width)return void e.hidePopup();const l=(e,t)=>{const s=r(i.style[t]);e.last!==s&&(e.initial=s,e.last=s);const l=o[t]-n[t];if(l!=e.lastDiff){const o=this.keepXYWithinBounds(i,e.initial+e.initialDiff-l,e.direction);i.style[t]=`${o}px`,e.last=o}e.lastDiff=l};l(a,"top"),l(d,"left")},new Ns(e=>{e(window.setInterval(n,200))})).then(e=>{o(()=>{null!=e&&window.clearInterval(e)})})},"popupPositioning")})}isEventFromCurrentPopup(e,t){const{mouseEvent:o,touchEvent:s}=e,i=o||s;if(!i)return!1;const n=this.getPopupIndex(t);if(-1===n)return!1;for(let r=n;re.element)}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return Yi(e)}}]};function Ig(e){return"whenTruncated"===e.get("tooltipShowMode")}function Ag(e,t){return Ig(e)?ue(t):void 0}var kg=(e,t)=>{const o=e;return"function"==typeof o.getTranslatedMessage?o.getTranslatedMessage(t):e.message},Lg=(e,t,o)=>{const{editModelSvc:s}=e,i=s?.getCellValidationModel()?.getCellValidation(t)?.errorMessages,n=s?.getRowValidationModel().getRowValidation(t)?.errorMessages,r=i||n;return r?.length?r.join(o("tooltipValidationErrorSeparator",". ")):void 0},Gg={moduleName:"Tooltip",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,o,s){e&&t.destroyBean(e);const i=this.gos,n=Ig(i),{column:r,eGui:l}=t,a=r.getColDef();s||!n||a.headerComponent||(s=ue(()=>l.querySelector(".ag-header-cell-text")));const d="header",c=this.beans.colNames.getDisplayNameForColumn(r,"header",!0),h=o??c,u={getGui:()=>l,getLocation:()=>d,getTooltipValue:()=>o??a?.headerTooltipValueGetter?.(Co(i,{location:d,colDef:a,column:r,value:h,valueFormatted:c}))??a?.headerTooltip,shouldDisplayTooltip:s,getAdditionalParams:()=>({column:r,colDef:r.getColDef()})};let g=this.createTooltipFeature(u);return g&&(g=t.createBean(g),t.setRefreshFunction("tooltip",()=>g.refreshTooltip())),g}setupHeaderGroupTooltip(e,t,o,s){e&&t.destroyBean(e);const i=this.gos,n=Ig(i),{column:r,eGui:l}=t,a=r.getColGroupDef();s||!n||a?.headerGroupComponent||(s=ue(()=>l.querySelector(".ag-header-group-text")));const d="headerGroup",c=this.beans.colNames.getDisplayNameForColumnGroup(r,"header"),h=o??c,u={getGui:()=>l,getLocation:()=>d,getTooltipValue:()=>o??a?.headerTooltipValueGetter?.(Co(i,{location:d,colDef:a,column:r,value:h,valueFormatted:c}))??a?.headerTooltip,shouldDisplayTooltip:s,getAdditionalParams:()=>{const e={column:r};return a&&(e.colDef=a),e}},g=this.createTooltipFeature(u);return g?t.createBean(g):g}enableCellTooltipFeature(e,t,o){const{beans:s}=this,{column:i,rowNode:n}=e,r=((e,t,o)=>{const{editSvc:s}=e,{column:i}=t,n=((e,t)=>{if(Ig(e.gos)){if(t.isCellRenderer()){const e=t.column.getColDef();if(!e.showRowGroup&&"agGroupCellRenderer"!==e.cellRenderer)return;return ue(()=>{const e=t.eGui;return e.querySelector(".ag-group-value")||e.querySelector(".ag-cell-value")||e})}return ue(()=>{const e=t.eGui;return 0===e.children.length?e:e.querySelector(".ag-cell-value")})}})(e,t),r=()=>!s?.isEditing(t)&&(!n||!!i.isTooltipEnabled()&&n());return{shouldDisplayDefault:r,shouldDisplayColumnTooltip:r,shouldDisplayCustomTooltip:o??r}})(s,e,o),a=this.getLocaleTextFunc();let d=null;const c=()=>(d=(({beans:e,ctrl:t,value:o,displayFunctions:s,translate:i})=>{const{editSvc:n,formula:r,gos:a}=e,{column:d,rowNode:c}=t;if(r?.active&&d.isAllowFormula()){const e=r.getFormulaError(d,c);if(e)return{value:kg(e,i),location:"cellFormula",shouldDisplay:()=>!!r?.getFormulaError(d,c)}}if(!n?.isEditing(t)){const o=Lg(e,t,i);if(o)return{value:o,location:"cellEditor",shouldDisplay:()=>!n?.isEditing(t)&&!!Lg(e,t,i)}}const{shouldDisplayCustomTooltip:h,shouldDisplayColumnTooltip:u}=s;if(null!=o)return{value:o,location:"cell",shouldDisplay:h};const g=d.getColDef(),p=c.data;if(g.tooltipField&&l(p))return{value:td(p,g.tooltipField,d.isTooltipFieldContainsDots()),location:"cell",shouldDisplay:u};const m=g.tooltipValueGetter;return m?{value:m(Co(a,{location:"cell",colDef:d.getColDef(),column:d,rowIndex:t.cellPosition.rowIndex,node:c,data:c.data,value:t.value,valueFormatted:t.valueFormatted})),location:"cell",shouldDisplay:u}:null})({beans:s,ctrl:e,value:t,displayFunctions:r,translate:a}),d),h={getGui:()=>e.eGui,getLocation:()=>d?.location??"cell",getTooltipValue:()=>c()?.value,shouldDisplayTooltip:()=>{const e=d??c();return!!e&&(!e.shouldDisplay||e.shouldDisplay())},getAdditionalParams:()=>({column:i,colDef:i.getColDef(),rowIndex:e.cellPosition.rowIndex,node:n,data:n.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(h,s)}setupFullWidthRowTooltip(e,t,o,s){const i={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>o,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:s},n=this.beans,r=n.context;e&&t.destroyBean(e,r);const l=this.createTooltipFeature(i,n);if(l)return t.createBean(l,r)}setupCellEditorTooltip(e,t){const{beans:o}=this,{context:s}=o,i=t.getValidationElement?.(!0)||!t.isPopup?.()&&e.eGui;if(!i)return;const n=this.createTooltipFeature({getGui:()=>i,getTooltipValue:()=>Lg(o,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{const{editModelSvc:e}=o,t=e?.getRowValidationModel()?.getRowValidationMap(),s=e?.getCellValidationModel()?.getCellValidationMap(),i=!!t&&t.size>0,n=!!s&&s.size>0;return i||n}},o);return n?e.createBean(n,s):void 0}initCol(e){const{colDef:t}=e;e.tooltipEnabled=l(t.tooltipField)||l(t.tooltipValueGetter)||l(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}}],dynamicBeans:{tooltipFeature:Fg,highlightTooltipFeature:class extends Fg{constructor(e,t,o){super(e,o),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){1===this.tooltipMode&&(e.highlighted?this.attemptToShowTooltip():this.attemptToHideTooltip())}setTooltipMode(e="focus"){this.tooltipMode="focus"===e?1:0}destroy(){this.highlightTracker.removeEventListener("itemHighlighted",this.onHighlight),super.destroy()}},tooltipStateManager:class extends Mg{createTooltipComp(e,t){(function(e,t){return e.getCompDetails(t.colDef,Ys,"agTooltipComponent",t,!0)})(this.beans.userCompFactory,e)?.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){this.onColumnMovedEventCallback?.(),this.onColumnMovedEventCallback=void 0}}},userComponents:{agTooltipComponent:class extends on{constructor(){super({tag:"div",cls:"ag-tooltip"})}init(e){const{value:t}=e,o=this.getGui();o.textContent=m(t);const s=e.location.replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase();o.classList.add(`ag-${s}-tooltip`)}}},dependsOn:[Tg],css:[".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}}"]},Ng={selector:"AG-INPUT-TEXT-FIELD",component:class extends Oa{constructor(e,t="ag-text-field",o="text"){super(e,t,o)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){const o=this.eInput;return o.value!==e&&(o.value=l(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}setCustomValidity(e){const t=this.eInput,o=e.length>0;t.setCustomValidity(e),o&&t.reportValidity(),k(t,o)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`);this.addManagedListeners(this.eInput,{keydown:t=>{Br(t)&&t.key&&!e.test(t.key)&&t.preventDefault()},paste:t=>{(t.clipboardData?.getData("text"))?.split("").some(t=>!e.test(t))&&t.preventDefault()}})}}},Bg=class extends sn{constructor(e){super(),this.cellEditorInput=e,this.eEditor=null}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:o}=this,{cellStartedEdit:s,eventKey:i,suppressPreventDefault:n}=e;let r;o.getInputElement().setAttribute("title",""),t.init(o,e);let l=!0;s?(this.focusAfterAttached=!0,i===ps||i===Rs?r="":i&&1===i.length?n?l=!1:r=i:(r=t.getStartValue(),i!==xs&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=t.getStartValue()),l&&null!=r&&o.setStartValue(r),this.addGuiEventListener("keydown",e=>{const{key:t}=e;t!==Fs&&t!==Ds||e.preventDefault()})}afterGuiAttached(){const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;Ei()||t.getFocusableElement().focus();const o=t.getInputElement();this.highlightAllOnFocus?o.select():this.cellEditorInput.setCaret?.()}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),o=e.getInputElement();t.focus(),o.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()}},Hg={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},Og=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Hg}getAgComponents(){return[Ng]}init(e,t){this.eEditor=e,this.params=t;const o=t.maxLength;null!=o&&e.setMaxLength(o)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:o}=e,s=this.getValue(),i=this.getLocaleTextFunc();let n=[];return null!=t&&"string"==typeof s&&s.length>t&&n.push(i("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),n.length||(n=null),o?o({value:s,cellEditorParams:e,internalErrors:n}):n}getValue(){const{eEditor:e,params:t}=this,o=e.getValue();return l(o)||l(t.value)?t.parseValue(o):t.value}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){Ei()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),o=l(t)&&t.length||0;o&&e.getInputElement().setSelectionRange(o,o)}},Vg=class extends Bg{constructor(){super(new Og(()=>this.getLocaleTextFunc()))}},zg={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},Wg=class extends on{constructor(e){super(zg),this.params=e}postConstruct(){Vt(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params;this.addManagedElementListeners(e,{keydown:e=>{jr(this.gos,e,t.node,t.column,!0)||t.onKeyDown(e)}})}};function Ug(e,t){return e.editModelSvc?.hasEdits(t,{withOpenEditor:!0})??!1}function $g(e,t){const o=t.column,s=t.rowNode,i=o.getColDef();if(!s)return Ug(e,t);const n=i.editable;return s.group&&null!=i.groupRowEditable?!!e.rowGroupingEditValueSvc?.isGroupCellEditable(s,o)||Ug(e,t):!!o.isColumnFunc(s,n)||Ug(e,t)}var jg=(e,t=!1)=>{if(void 0!==e)return Sh(e)||t&&"editing"===e.state};function Kg(e,t,o=!1){return jg(e.editModelSvc?.getEdit(t),o)}var _g=(e,t,o)=>{if(e)for(let s=0,i=e.length;s{const t={rowNode:s,column:e};return Kg(o,t,!0)||qg(o,t)||Yg(o,t)});return void this.applyStyle(n,e)}this.applyStyle(n)}applyStyle(e=!1,t=!1){const o=!!this.editSvc?.isBatchEditing(),s="fullRow"===this.gos.get("editType");this.rowCtrl?.forEachGui(void 0,({rowComp:i})=>{i.toggleCss("ag-row-editing",s&&t),i.toggleCss("ag-row-batch-edit",s&&t&&o),i.toggleCss("ag-row-inline-editing",t),i.toggleCss("ag-row-not-inline-editing",!t),i.toggleCss("ag-row-editing-invalid",s&&t&&e)})}},Xg=/* @__PURE__ */new Set(["undo","redo","paste","bulk","rangeSvc"]),Jg=/* @__PURE__ */new Set(["ui","api"]),ep={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},tp=new Set(Object.keys(ep)),op=/* @__PURE__ */new Set(["paste","rangeSvc","cellClear","redo","undo"]),sp={cancel:!0,source:"api"},ip={cancel:!1,source:"api"},np={checkSiblings:!0},rp={force:!0,suppressFlash:!0},lp={force:!0};function ap(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap(e=>Array.from(e.keys())))]:void 0}}function dp(e,t){return t??e.get("editType")??"singleCell"}var cp=class extends Oe{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 o=e.previousParams,{editSvc:s,beans:i}=this,n="cellFocused"===e.type?e.sourceEvent:null;o&&(t=vh(i,o));const{gos:r,editModelSvc:l}=i,a="cellFocusCleared"===e.type;if(s.isEditing(void 0,{withOpenEditor:!0})){const{column:t,rowIndex:d,rowPinned:c}=e,h={column:t,rowNode:Fn(i,{rowIndex:d,rowPinned:c})},u="block"===r.get("invalidEditValueMode");if(u)return;const g=!u,p=!!l?.getCellValidationModel().hasCellValidation(h),m=g&&p;!o&&!a||s.stopEditing(void 0,{cancel:m,source:a&&g?"api":void 0,event:n})||(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"}))}t?.refreshCell({suppressFlash:!0,force:!0})}stopCancelled(e){const t=this.editSvc.isBatchEditing()&&!e;for(const o of this.model.getEditPositions())Ah(this.beans,o,{cancel:!0},vh(this.beans,o)),this.model.stop(o,t,!0);return!0}stopCommitted(e,t){const o=this.model.getEditPositions(),s={all:[],pass:[],fail:[]};for(const r of o)s.all.push(r),(this.model.getCellValidationModel().getCellValidation(r)?.errorMessages?.length??0)>0?s.fail.push(r):s.pass.push(r);const i=this.processValidationResults(s),n=this.editSvc.isBatchEditing()&&!t;for(const r of i.destroy)Ah(this.beans,r,{event:e},vh(this.beans,r)),this.model.stop(r,n,!1);for(const r of i.keep){const e=vh(this.beans,r);!this.editSvc.cellEditingInvalidCommitBlocks()&&e&&this.editSvc.revertSingleCellEdit(e)}return!0}cleanupEditors({rowNode:e}={},t){Ph(this.beans,{persist:!1});const o=this.model.getEditPositions(),s=[];if(e)for(const i of o)i.rowNode!==e&&s.push(i);else for(const i of o)s.push(i);Ih(this.beans,s),Dh(this.beans,t)}setFocusOutOnEditor(e){e.comp?.getCellEditor()?.focusOut?.()}setFocusInOnEditor(e){const t=e.comp,o=t?.getCellEditor();if(o?.focusIn)o.focusIn();else{const o="fullRow"===this.beans.gos.get("editType");e.focusCell(o),e.onEditorAttachedFuncs.push(()=>t?.getCellEditor()?.focusIn?.())}}setupEditors(e){const{event:t,ignoreEventKey:o=!1,startedEdit:s,position:i,cells:n=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!o&&t.key||void 0;!function(e,t,o,s,i,n){0===t.length&&o?.rowNode&&o?.column&&Rh(e,o,{key:s,event:i,cellStartedEdit:n});const{valueSvc:r,editSvc:l,editModelSvc:a}=e,{rowNode:d,column:c}=o??{};for(const h of t){const{rowNode:t,column:u}=h,g=vh(e,h);if(!g){if(t&&u){const i=r.getValue(u,t,"data"),n=(o?.rowNode===t&&o?.column===u&&s||void 0)??l?.getCellDataValue(h)??r.getValueForDisplay({column:u,node:t,from:"edit"})?.value??i??yh;a?.setEdit(h,{pendingValue:Th(e,n,!1,u),sourceValue:i,state:"editing"})}continue}const p=n&&d===g.rowNode&&g.column===c;Rh(e,{rowNode:d,column:g.column},{key:p?s:null,event:p?i:null,cellStartedEdit:p&&n})}}(this.beans,n,i,r,t,s)}dispatchCellEvent(e,t,o,s){const i=vh(this.beans,e);i&&this.eventSvc.dispatchEvent({...i.createEvent(t??null,o),...s})}dispatchRowEvent(e,t,o){if(o)return;const s=Ch(this.beans,e);s&&this.eventSvc.dispatchEvent(s.createRowEvent(t))}shouldStop(e,t,o="ui"){const s=this.editSvc.isBatchEditing();return!(!s||"api"!==o)||(!s||"ui"!==o&&"edit"!==o)&&("api"===o||(t instanceof KeyboardEvent&&!s?t.key===fs:null))}shouldCancel(e,t,o="ui"){const s=this.editSvc.isBatchEditing();return t instanceof KeyboardEvent&&!s&&t.key===Cs||!(!s||"api"!==o)||"api"===o}setEditMap(e,t){t?.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const o=[];if(e.forEach((e,t)=>{e.forEach((e,s)=>{"editing"===e.state&&o.push({...e,rowNode:t,column:s})})}),t?.update&&(e=new Map([...this.model.getEditMap(),...e])),this.model?.setEditMap(e),o.length>0){const e=o.at(-1),t=e.pendingValue===yh?void 0:e.pendingValue;this.start({position:e,event:new KeyboardEvent("keydown",{key:t}),source:"api"});const s=vh(this.beans,e);s&&this.setFocusInOnEditor(s)}}destroy(){this.cleanupEditors(),super.destroy()}},hp={moduleName:"TextEditor",version:mt,userComponents:{agCellEditor:Vg,agTextCellEditor:Vg},dependsOn:[{moduleName:"EditCore",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="editModelSvc",this.edits=/* @__PURE__ */new Map,this.cellValidations=new mh,this.rowValidations=new fh,this.suspendEdits=!1}suspend(e){this.suspendEdits=e}removeEdits({rowNode:e,column:t}){if(!this.hasEdits({rowNode:e})||!e)return;const o=this.getEditRow(e);t?o.delete(t):o.clear(),0===o.size&&this.edits.delete(e)}getEditRow(e,t={}){if(this.suspendEdits)return;if(0===this.edits.size)return;const o=e&&this.edits.get(e);if(o)return o;if(t.checkSiblings){const t=e.pinnedSibling;if(t)return this.getEditRow(t)}}getEditRowDataValue(e,{checkSiblings:t}={}){if(!e||0===this.edits.size)return;const o=this.getEditRow(e),s=e.pinnedSibling,i=t&&s&&this.getEditRow(s);if(!o&&!i)return;const n={...e.data},r=(e,t)=>e.forEach(({editorValue:e,pendingValue:o},s)=>{const i=void 0===e?o:e;i!==yh&&(t[s.getColId()]=i)});return o&&r(o,n),i&&r(i,n),n}getEdit(e={},t){const{rowNode:o,column:s}=e,i=this.edits;if(this.suspendEdits||0===i.size||!o||!s)return;const n=i.get(o)?.get(s);if(n)return n;if(t?.checkSiblings){const e=o.pinnedSibling;if(e)return i.get(e)?.get(s)}}getEditMap(e=!0){if(this.suspendEdits||0===this.edits.size)/* @__PURE__ */return new Map;if(!e)return this.edits;const t=/* @__PURE__ */new Map;return this.edits.forEach((e,o)=>{const s=/* @__PURE__ */new Map;e.forEach(({editorState:e,...t},o)=>s.set(o,{...t})),t.set(o,s)}),t}setEditMap(e){this.edits.clear(),e.forEach((e,t)=>{const o=/* @__PURE__ */new Map;e.forEach((e,t)=>o.set(t,{...e})),this.edits.set(t,o)})}setEdit(e,t){const o=this.edits;0!==o.size&&o.has(e.rowNode)||o.set(e.rowNode,/* @__PURE__ */new Map);const s={editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0},...this.getEdit(e),...t};return this.getEditRow(e.rowNode).set(e.column,s),s}clearEditValue(e){const{rowNode:t,column:o}=e;if(!t)return;const s=e=>{e.editorValue=void 0,e.pendingValue=e.sourceValue,e.state="changed"};if(!o)return void this.getEditRow(t)?.forEach(s);const i=this.getEdit(e);i&&s(i)}getState(e){if(!this.suspendEdits)return this.getEdit(e)?.state}getEditPositions(e){if(this.suspendEdits||0===(e??this.edits).size)return[];const t=[];return(e??this.edits).forEach((e,o)=>{for(const s of e.keys()){const{editorState:i,...n}=e.get(s);t.push({rowNode:o,column:s,...n})}}),t}hasRowEdits(e,t){return!this.suspendEdits&&0!==this.edits.size&&!!this.getEditRow(e,t)}hasEdits(e={},t={}){if(this.suspendEdits)return!1;if(0===this.edits.size)return!1;const{rowNode:o,column:s}=e,{withOpenEditor:i}=t;if(o){const n=this.getEditRow(o,t);return!!n&&(s?i?"editing"===this.getEdit(e)?.state:n.has(s):0!==n.size&&(!i||Array.from(n.values()).some(({state:e})=>"editing"===e)))}return i?this.getEditPositions().some(({state:e})=>"editing"===e):this.edits.size>0}start(e){const t=this.getEditRow(e.rowNode)??/* @__PURE__ */new Map,{rowNode:o,column:s}=e;s&&!t.has(s)&&t.set(s,{editorValue:void 0,pendingValue:yh,sourceValue:this.beans.valueSvc.getValue(s,o,"data"),state:"editing",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}}),this.edits.set(o,t)}stop(e,t,o){if(this.hasEdits(e))if(t){const t=this.getEditRow(e.rowNode)?.get(e.column);!t||t.pendingValue!==yh&&t.pendingValue!==t.sourceValue?t&&o&&(t.editorValue=void 0):this.removeEdits(e)}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()}},class extends Oe{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:e})=>{this.stopEditing(void 0,sp),this.createStrategy(e)});const t=(e=>()=>{const t=new Set(e.colModel.getCols()),o=e.editModelSvc.getEditMap(!0);(({editModelSvc:e},t,o)=>{for(const s of t)e?.getEditRow(s)?.forEach((t,i)=>!o.has(i)&&e.removeEdits({rowNode:s,column:i}))})(e,(({rowModel:e,pinnedRowModel:t,editModelSvc:o},s)=>{const i=/* @__PURE__ */new Set;e.forEachNode(e=>s.has(e)&&i.add(e)),t?.forEachPinnedRow("top",e=>s.has(e)&&i.add(e)),t?.forEachPinnedRow("bottom",e=>s.has(e)&&i.add(e));for(const n of s)i.has(n)||o.removeEdits({rowNode:n});return i})(e,new Set(o.keys())),t)})(e),o=()=>{const t=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;return t||o?this.stopEditing(void 0,sp):this.isEditing()&&(this.batch?Ih(e,this.model.getEditPositions()):this.stopEditing(void 0,ip)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:o,filterChanged:o,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}startBatchEditing(){this.batch||(this.batch=!0,this.batchStartDispatched=!1,this.stopEditing(void 0,sp))}stopBatchEditing(e){this.batch&&(e&&this.stopEditing(void 0,e),this.batchStartDispatched&&this.dispatchBatchStopped(/* @__PURE__ */new Map,!1),this.batch=!1,this.batchStartDispatched=!1)}ensureBatchStarted(){this.batch&&!this.batchStartDispatched&&(this.batchStartDispatched=!0,this.dispatchBatchEvent("batchEditingStarted",/* @__PURE__ */new Map))}createStrategy(e){const{beans:t,gos:o,strategy:s}=this,i=dp(o,e);if(s){if(s.beanName===i)return s;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(i,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,o,s="ui"){const i=function(e,{column:t},o,s,i="ui"){if(o instanceof KeyboardEvent&&(o.key===ms||o.key===fs||o.key===xs||o.key===ps&&s))return!0;if(o?.shiftKey&&0!=e.rangeSvc?.getCellRanges().length)return!1;const n=t?.getColDef(),r=function(e,t){return!0===e.get("suppressClickEdit")?0:!0===e.get("singleClickEdit")||t?.singleClickEdit?1:2}(e.gos,n),l=o?.type;return"click"===l&&1===o?.detail&&1===r||"dblclick"===l&&2===o?.detail&&2===r||"api"===i&&!!s}(this.beans,e,t,o,s);return i&&(this.strategy??(this.strategy=this.createStrategy())),i}shouldStopEditing(e,t,o="ui"){return this.strategy?.shouldStop(e,t,o)??null}shouldCancelEditing(e,t,o="ui"){return this.strategy?.shouldCancel(e,t,o)??null}validateEdit(){return function(e){Nh(e,!0);const t=e.editModelSvc?.getCellValidationModel().getCellValidationMap();if(!t)return null;const o=[];return t.forEach((e,t)=>{e.forEach(({errorMessages:e},s)=>{o.push({column:s,rowIndex:t.rowIndex,rowPinned:t.rowPinned,messages:e??null})})}),o}(this.beans)}isEditing(e,t){return this.model.hasEdits(e??void 0,t??np)}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:o=!0,event:s=null,source:i="ui",ignoreEventKey:n=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!(t.editable??this.isCellEditable(e,"api")))return;const l=vh(this.beans,e);if(l&&!l.comp)return t.editable=void 0,void l.onCompAttachedFuncs.push(()=>this.startEditing(e,t));const a=this.shouldStartEditing(e,s,o,i);!1!==a||"api"===i?(this.batch||!this.shouldStopEditing(e,void 0,i)||t.continueEditing||this.stopEditing(void 0,{source:i}),a&&this.ensureBatchStarted(),this.strategy.start({position:e,event:s,source:i,ignoreEventKey:n,startedEdit:o,silent:r})):this.isEditing(e)&&this.stopEditing()}stopEditing(e,t){const o=this.prepareStopContext(e,t);if(!o)return!1;this.stopping=!0;let s=!1,{edits:i}=o;try{const n=this.processStopRequest(o);return s||(s=n.res),i=n.edits,this.finishStopEditing({...o,edits:i,params:t,position:e,res:s}),s}finally{this.rangeSelectionWhileEditing=0,this.stopping=!1}}prepareStopContext(e,t){const{event:o=null,cancel:s=!1,source:i="ui",forceCancel:n=!1,forceStop:r=!1,commit:l=!1}=t||{};if(tp.has(i)&&this.batch)return e?.rowNode&&e?.column&&this.bulkRefreshCell(e),null;const a=this.committing?ep[i]:i;if(!(this.committing||this.isEditing(e)||this.batch&&this.model.hasEdits(e,np))||!this.strategy||this.stopping)return null;const d=vh(this.beans,e);d&&(d.onEditorAttachedFuncs=[]);const c=!s&&(!!this.shouldStopEditing(e,o,a)||(this.committing||"paste"===i)&&!this.batch)||r,h=s&&!!this.shouldCancelEditing(e,o,a)||n;return{cancel:s,cellCtrl:d,edits:this.model.getEditMap(!0),event:o??null,forceCancel:n,forceStop:r,commit:l,position:e,source:i,treatAsSource:a,willCancel:h,willStop:c}}processStopRequest(e){const{event:t,position:o,willCancel:s,willStop:i}=e;return i||s?this.handleStopOrCancel(e):this.shouldHandleMidBatchKey(t,o)?{res:!1,edits:this.handleMidBatchKey(t,o,e)}:(Ph(this.beans,{persist:!0}),this.batch&&this.strategy?.cleanupEditors(o),{res:!1,edits:this.model.getEditMap()})}handleStopOrCancel(e){const{beans:t,model:o}=this,{cancel:s,commit:i,edits:n,event:r,source:l,willCancel:a,willStop:d}=e;Ph(t,{persist:!this.batch||!a,isCancelling:a||s,isStopping:d});const c=o.getEditMap(),h=a||this.batch&&!i?[]:this.processEdits(c,l);s?this.strategy?.stopCancelled(e.forceCancel):this.strategy?.stopCommitted(r,i),this.clearValidationIfNoOpenEditors();for(const u of h)o.clearEditValue(u);this.bulkRefreshMap(n);for(const u of o.getEditPositions(c)){const e=vh(t,u),o=Sh(u);e?.refreshCell({force:!0,suppressFlash:!o})}return{res:d,edits:c}}shouldHandleMidBatchKey(e,t){return e instanceof KeyboardEvent&&this.batch&&!!this.strategy?.midBatchInputsAllowed(t)&&this.isEditing(t,{withOpenEditor:!0})}handleMidBatchKey(e,t,o){const{beans:s,model:i}=this,{cellCtrl:n,edits:r}=o,{key:l}=e,a=l===fs,d=l===Cs,c=l===ms;if(a||c||d){if(a||c)Ph(s,{persist:!0});else if(d&&n){const{rowNode:e,column:t}=n;if(this.batch&&e&&t){const o={rowNode:e,column:t};Ih(s,[o],{silent:!0}),this.model.stop(o,!0,!0),vh(s,o)?.refreshCell(rp)}else this.revertSingleCellEdit(n)}return this.batch?this.strategy?.cleanupEditors():Ih(s,i.getEditPositions(),{event:e,cancel:d}),e.preventDefault(),this.bulkRefreshMap(r,{suppressFlash:!0}),i.getEditMap()}return r}finishStopEditing({cellCtrl:e,edits:t,params:o,position:s,res:i,commit:n,forceCancel:r,willCancel:l,willStop:a}){const d=this.beans;i&&s&&(this.batch&&!n||this.model.removeEdits(s)),this.navigateAfterEdit(o,e?.cellPosition),Dh(d),this.clearValidationIfNoOpenEditors();const{rowRenderer:c,formula:h}=d;if(l&&c.refreshRows({rowNodes:Array.from(t.keys())}),this.batch){h?h.refreshFormulas(!0):c.refreshRows({suppressFlash:!0,force:!0});const e=a&&n;(e||l&&r)&&this.dispatchBatchStopped(t,e)}}dispatchBatchStopped(e,t){let o;t&&(o=function(e){const t=/* @__PURE__ */new Map;for(const[o,s]of e){const e=/* @__PURE__ */new Map;for(const[t,o]of s)Sh(o)&&e.set(t,o);e.size>0&&t.set(o,e)}return t}(e),o.size>0&&this.ensureBatchStarted()),this.batchStartDispatched&&(this.batchStartDispatched=!1,this.dispatchBatchEvent("batchEditingStopped",o??/* @__PURE__ */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:o,suppressNavigateAfterEdit:s}=e;if(!(o instanceof KeyboardEvent)||s)return;const{key:i,shiftKey:n}=o,r=this.gos.get("enterNavigatesVerticallyAfterEdit");if(i!==fs||!r)return;const l=n?bs:Ss;this.beans.navigation?.navigateToNextCell(null,l,t,!1)}processEdits(e,t){const o=Array.from(e.keys()),s=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,i=[],{changeDetectionSvc:n}=this.beans;n?.beginDeferred();try{for(const n of o){const o=e.get(n);for(const e of o.keys()){const r=o.get(e),l={rowNode:n,column:e};if(Sh(r)&&!s){const o=vh(this.beans,l);this.setNodeDataValue(n,e,r.pendingValue,o,t)||i.push(l)}}}}finally{n?.endDeferred()}return i}setNodeDataValue(e,t,o,s,i="edit"){const n=Jg.has(i)?"edit":i;s&&(s.suppressRefreshCell=!0),this.committing=!0;try{return e.setDataValue(t,o,n)}finally{this.committing=!1,s&&(s.suppressRefreshCell=!1)}}syncEditAfterCommit(e,t){const o=this.model.getEdit(e);o&&"editing"!==o.state&&(t?this.beans.editModelSvc?.setEdit(e,{sourceValue:o.pendingValue}):this.model.clearEditValue(e))}setEditMap(e,t){this.strategy??(this.strategy=this.createStrategy()),this.strategy?.setEditMap(e,t),this.bulkRefreshMap(e);let o=rp;t?.forceRefreshOfEditCellsOnly&&(o={...ap(e),...rp}),this.beans.rowRenderer.refreshCells(o)}dispatchEditValuesChanged({rowNode:e,column:t},o={}){if(!e||!t||!o)return;const{pendingValue:s,sourceValue:i}=o,{rowIndex:n,rowPinned:r,data:l}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:n,rowPinned:r,column:t,source:"api",data:l,newValue:s,oldValue:i,value:s,colDef:t.getColDef()})}bulkRefreshCell(e,t){It(this.gos,this.beans.rowModel)&&this.refCell(e,this.model.getEdit(e),t)}bulkRefreshMap(e,t){It(this.gos,this.beans.rowModel)&&e.forEach((e,o)=>{for(const s of e.keys())this.refCell({rowNode:o,column:s},e.get(s),t)})}refCell({rowNode:e,column:t},o,s={}){const{beans:i,gos:n}=this,r=/* @__PURE__ */new Set([e]),l=/* @__PURE__ */new Set,a=e.pinnedSibling;a&&r.add(a);const d=e.sibling;d&&l.add(d);let c=e.parent;for(;c;)c.sibling?.footer&&n.get("groupTotalRow")||!c.parent&&c.sibling&&n.get("grandTotalRow")?l.add(c.sibling):l.add(c),c=c.parent;for(const h of r)this.dispatchEditValuesChanged({rowNode:h,column:t},o);for(const h of r)vh(i,{rowNode:h,column:t})?.refreshCell(s);for(const h of l){const e=vh(i,{rowNode:h,column:t});e&&(e.refreshCell(s),!s.force&&this.batch&&e.editStyleFeature?.applyCellStyles?.())}}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{gos:o,beans:s}=this,i=e.rowNode;if(i.group&&null==e.column.getColDef().groupRowEditable)if(o.get("treeData")){if(!i.data&&!o.get("enableGroupEdit"))return!1}else if(!o.get("enableGroupEdit"))return!1;const n="fullRow"===dp(o)?function(e,t,o="ui"){const s=$g(e,t);if(s||"ui"===o)return s;const{rowNode:i,column:n}=t;for(const r of e.colModel.getCols())if(r!==n&&$g(e,{rowNode:i,column:r}))return!0;return!1}(s,e,t):$g(s,e);return n&&(this.strategy??(this.strategy=this.createStrategy())),n}cellEditingInvalidCommitBlocks(){return"block"===this.gos.get("invalidEditValueMode")}checkNavWithValidation(e,t,o=!0){if(this.hasValidationErrors(e)){const s=vh(this.beans,e);return this.cellEditingInvalidCommitBlocks()?(t?.preventDefault?.(),o&&(s&&!s.hasBrowserFocus()&&s.focusCell(),s?.comp?.getCellEditor()?.focusIn?.()),"block-stop"):(s&&this.revertSingleCellEdit(s),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){const o=vh(this.beans,e);o?.comp?.getCellEditor()&&(Ih(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),Rh(this.beans,e,{silent:!0}),Nh(this.beans),o?.refreshCell(rp),t&&(o?.focusCell(),o?.comp?.getCellEditor()?.focusIn?.()))}hasValidationErrors(e){Nh(this.beans);const t=vh(this.beans,e);t&&(t.refreshCell(rp),t.rowCtrl.rowEditStyleFeature?.applyRowStyles());let o=!1;return e?.rowNode?(o||(o=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(o||(o=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(o||(o=this.model.getCellValidationModel().getCellValidationMap().size>0),o||(o=this.model.getRowValidationModel().getRowValidationMap().size>0)),o}moveToNextCell(e,t,o,s="ui"){let i;const n=this.isEditing(),r=n&&"block-stop"===this.checkNavWithValidation(void 0,o);return e instanceof $h&&n&&(i=this.strategy?.moveToNextEditingCell(e,t,o,s,r)),null===i||(i=i||!!this.beans.focusSvc.focusedHeader,!1!==i||r||this.stopEditing()),i}getPendingEditValue(e,t,o){if("data"===o)return;if("batch"===o&&!this.batch)return;const s=this.model.getEdit({rowNode:e,column:t},np);if(!s)return;if(this.stopping&&!this.batch&&!s.editorState?.cellStartedEditing)return;if("edit"===o){const e=s.editorValue;if(null!=e&&e!==yh)return e}const i=s.pendingValue;return i!==yh?i:void 0}getCellDataValue(e){const t=this.model.getEdit(e,np);if(t){const e=t.pendingValue;if(e!==yh)return e;const o=t.sourceValue;if(null!=o)return o}return this.valueSvc.getValue(e.column,e.rowNode,"data")}addStopEditingWhenGridLosesFocus(e){!function(e,t,o){const{gos:s,popupSvc:i}=t;if(!s.get("stopEditingWhenCellsLoseFocus"))return;const n=e=>{const n=e.relatedTarget;if(null===ki(n))return void wh(t);let r=o.some(e=>e.contains(n))&&s.isElementInThisInstance(n);r||(r=!!i&&(i.getActivePopups().some(e=>e.contains(n))||i.isElementWithinCustomPopup(n))),r||wh(t)};for(const r of o)e.addManagedElementListeners(r,{focusout:n})}(this,this.beans,e)}createPopupEditorWrapper(e){return new Wg(e)}batchResetToSourceValue(e){if(!this.batch)return!1;const t=this.model.getEdit(e);if(!t)return!1;const{pendingValue:o,sourceValue:s,state:i}=t;return o!==s&&"editing"!==i&&(this.dispatchEditValuesChanged(e,{...t,pendingValue:s}),this.beans.editModelSvc?.removeEdits(e),vh(this.beans,e)?.refreshCell(rp),!0)}setDataValue(e,t,o){try{const s=this.batch,i=this.isEditing(s?void 0:e);if((!i||this.committing)&&!s&&!op.has(o))return;if(!i&&!s&&"paste"===o)return;if("batch"===o&&!s)return;if("edit"===o){if(i&&this.applyEditorValue(e,t))return!0;if(!s)return}if(this.strategy??(this.strategy=this.createStrategy()),"batch"===o||"edit"===o)return this.applyDirectValue(e,t,o);const n=this.beans;let r;if(r=s?"ui":this.committing?o??"api":"api",!o||Xg.has(o))return this.applyDirectValue(e,t,o);const l=this.applyExistingEdit(e,t,o,r);return void 0!==l?l:(Eh(n,e,t,0,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0)}finally{this.committing=!1}}applyExistingEdit(e,t,o,s){const i=this.model.getEdit(e);if(i)return i.pendingValue!==t&&(i.sourceValue!==t?(Eh(this.beans,e,t,0,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(e,{source:s,suppressNavigateAfterEdit:!0}),!0):(this.beans.editModelSvc?.removeEdits(e),this.ensureBatchStarted(),this.dispatchEditValuesChanged(e,{...i,pendingValue:t}),!0))}applyEditorValue(e,t){const o=this.beans,s=vh(o,e),i=s?.comp?.getCellEditor();return!(!s||!i||(Eh(o,e,t,0,void 0,{persist:!0}),s.editStyleFeature?.applyCellStyles?.(),"agSetEditValue"in i?(i.agSetEditValue(t),0):i.refresh&&s.editCompDetails?(i.refresh({...s.editCompDetails.params,value:t}),0):(s.hasBrowserFocus()&&s.onEditorAttachedFuncs.push(()=>{const t=vh(this.beans,e);t?.focusCell(!0),t?.comp?.getCellEditor()?.focusIn?.()}),Ih(o,[e],{silent:!0,cancel:!0}),Rh(o,e,{silent:!0}),Nh(o),vh(o,e)?.refreshCell(rp),0)))}applyDirectValue(e,t,o){const s=this.beans;if(this.batch){if("batch"===o&&vh(s,e)?.comp?.getCellEditor()){const{editModelSvc:o,valueSvc:i}=s,{rowNode:n,column:r}=e;void 0===(o?.getEdit(e))?.sourceValue&&o?.setEdit(e,{sourceValue:i.getValue(r,n,"data")}),o?.setEdit(e,{pendingValue:t})}else Eh(s,e,t,0,void 0,{persist:!0}),"batch"!==o&&this.cleanupEditors();return Dh(s),this.ensureBatchStarted(),this.bulkRefreshCell(e),!0}Eh(s,e,t,0,void 0,{persist:!0});const i=vh(s,e),n=this.setNodeDataValue(e.rowNode,e.column,t,i,o);return this.syncEditAfterCommit(e,n),Dh(s),vh(s,e)?.refreshCell(n?lp:rp),n}handleColDefChanged(e){!function(e,t){const o=t.comp?.getCellEditor();if(!o?.refresh)return;const{eventKey:s,cellStartedEdit:i}=t.editCompDetails.params,{column:n}=t,r=Fh(e,t,s,i),l=n.getColDef(),a=ni(e.userCompFactory,l,r);o.refresh(Mh(a.params,s))}(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){const{model:o}=this;if(!this.batch)return;if(!o.hasRowEdits(e.rowNode,np))return;const{rowNode:s}=e,{compDetails:i,valueToDisplay:n}=t;if(i){const{params:e}=i;return e.data=o.getEditRowDataValue(s,np),{compDetails:i}}return{valueToDisplay:n}}cleanupEditors(){this.strategy?.cleanupEditors()}dispatchCellEvent(e,t,o,s){this.strategy?.dispatchCellEvent(e,t,o,s)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return Co(this.gos,{type:e,..."batchEditingStopped"===e?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(e=>({rowIndex:e.rowNode.rowIndex,rowPinned:e.rowNode.rowPinned,columnId:e.column.getColId(),newValue:e.pendingValue,oldValue:e.sourceValue}))}applyBulkEdit({rowNode:e,column:t},o){if(!o||0===o.length)return;const{beans:s,rangeSvc:i,valueSvc:n}=this,{formula:r}=s;Ph(s,{persist:!0});const l=this.model.getEditMap(!0);let a=l.get(e)?.get(t)?.pendingValue,d=!1;this.batch||(this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),d=!0);const c=r?.isFormula(a)??!1;o.forEach(e=>{const t=e.columns.some(e=>e?.isAllowFormula());if(i?.forEachRowInRange(e,o=>{const i=Fn(s,o);if(void 0===i)return;const d=l.get(i)??/* @__PURE__ */new Map;let h=a;for(const t of e.columns){if(!t)continue;const e=!!c&&t.isAllowFormula();if(this.isCellEditable({rowNode:i,column:t},"api")){const e=n.getValue(t,i,"data",!0);let o=n.parseValue(t,i??null,h,e);Number.isNaN(o)&&(o=null),d.set(t,{editorValue:void 0,pendingValue:o,sourceValue:e,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}e&&(h=r?.updateFormulaByOffset({value:h,columnDelta:1}))}d.size>0&&l.set(i,d),c&&t&&(a=r?.updateFormulaByOffset({value:a,rowDelta:1}))}),this.setEditMap(l),this.batch)return this.cleanupEditors(),Dh(s),void this.ensureBatchStarted();this.committing=!0;try{this.stopEditing(void 0,{source:"bulk"})}finally{this.committing=!1,d&&this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(l)})}});const h=vh(s,{rowNode:e,column:t});h&&h.focusCell(!0)}createCellStyleFeature(e){return new Zg(e,this.beans)}createRowStyleFeature(e){return new Qg(e,this.beans)}setEditingCells(e,t){const{beans:o}=this,{colModel:s,valueSvc:i}=o,n=/* @__PURE__ */new Map;for(let{colId:r,column:l,colKey:a,rowIndex:d,rowPinned:c,newValue:h,state:u}of e){const e=r?s.getCol(r):a?s.getCol(a):l;if(!e)continue;const g=Fn(o,{rowIndex:d,rowPinned:c});if(!g)continue;const p=i.getValue(e,g,"data",!0);if(!t?.forceRefreshOfEditCellsOnly&&!Sh({pendingValue:h,sourceValue:p})&&"editing"!==u)continue;let m=n.get(g);m||(m=/* @__PURE__ */new Map,n.set(g,m)),void 0===h&&(h=yh),m.set(e,{editorValue:void 0,pendingValue:h,sourceValue:p,state:u??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(n,t)}onCellFocused(e){const t=vh(this.beans,e);if(!t||!this.isEditing(t,np))return;const o=this.model.getEdit(t);if(!o||!Sh(o))return;const s=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");this.beans.ariaAnnounce?.announceValue(s,"pendingChange")}allowedFocusTargetOnValidation(e){return vh(this.beans,e)}}],apiFunctions:{getEditingCells:function(e){const t=e.editModelSvc?.getEditMap(),o=[];return t?.forEach((e,t)=>{const{rowIndex:s,rowPinned:i}=t;e.forEach((e,t)=>{const{editorValue:n,pendingValue:r,sourceValue:l,state:a}=e,d=Sh(e);let c=n??r;c===yh&&(c=void 0);const h={newValue:c,oldValue:l,state:a,column:t,colId:t.getColId(),colKey:t.getColId(),rowIndex:s,rowPinned:i},u="editing"===a;(u||!u&&d)&&o.push(h)})}),o},getEditRowValues:function(e,t){return e.editModelSvc?.getEditRowDataValue(t,{checkSiblings:!0})},getCellEditorInstances:(e,t={})=>{const o=e.rowRenderer.getCellCtrls(t.rowNodes,t.columns),s=new Array(o.length);let i=0;for(let n=0,r=o.length;ne.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,void 0),"ensureVisible")}(e,i),function(e,t,o="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,o),"ensureVisible")}(e,s),r?.startEditing({rowNode:d,column:a},{event:o?new KeyboardEvent("keydown",{key:o}):void 0,source:"api",editable:!0})):Dt(290,{rowIndex:i,rowPinned:n})},stopEditing:function(e,t=!1){const{editSvc:o}=e;if(o?.isBatchEditing()){if(t)for(const t of e.editModelSvc?.getEditPositions()??[])"editing"===t.state&&o.revertSingleCellEdit(t);else Ph(e,{persist:!0});Ih(e,void 0,{cancel:t})}else o?.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})},isEditing:function(e,t){const o=vh(e,t);return!!e.editSvc?.isEditing(o)},validateEdit:function(e){return e.editSvc?.validateEdit()||null}},dynamicBeans:{singleCell:class extends cp{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,o="ui"){const s=super.shouldStop(e,t,o);if(null!==s)return s;const i=e?.rowNode,n=e?.column,r=this.rowNode,l=this.column;return r&&l||!i||!n?r!==i||l!==n||!r&&!l&&this.model.hasEdits(void 0,{withOpenEditor:!0}):null}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:o,event:s,ignoreEventKey:i}=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:o,event:s,ignoreEventKey:i})}dispatchRowEvent(e,t,o){}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:o}=this.beans,{rowIndex:s,column:i,rowPinned:n}=e,r=Fn(this.beans,{rowIndex:s,rowPinned:n}),l=bh(i),a=t.getCol(l),d=e.previousParams;if(d){const e=bh(d.column);if(d?.rowIndex===s&&e===l&&d?.rowPinned===n)return}"cellFocused"==e.type&&(o?.isRangeSelectionEnabledWhileEditing()||o?.isEditing({rowNode:r,column:a},{withOpenEditor:!0}))||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,o,s="ui",i=!1){const n=this.beans.focusSvc.getFocusedCell();n&&(e=Dn(this.beans,n)??e);const r=e.cellPosition;let l;const a="fullRow"===this.beans.gos.get("editType");a&&this.model.suspend(!0),i||(e.eGui.focus(),this.editSvc?.stopEditing(e,{source:this.editSvc?.isBatchEditing()?"ui":"api",event:o}));try{l=this.beans.navigation?.findNextCellToFocusOn(r,{backwards:t,startEditing:!0})}finally{a&&this.model.suspend(!1)}if(!1===l)return null;if(null==l)return!1;const d=l.cellPosition,c=e.isCellEditable(),h=l.isCellEditable(),u=d&&r.rowIndex===d.rowIndex&&r.rowPinned===d.rowPinned;c&&!i&&this.setFocusOutOnEditor(e);const g=this.gos.get("suppressStartEditOnTab");let p=!1;if(u||i||(super.cleanupEditors(l,!0),g?l.focusCell(!0,o):(p=!0,this.editSvc.startEditing(l,{startedEdit:!0,event:o,source:s,ignoreEventKey:!0,editable:h}))),h&&!i){if(l.focusCell(!1,o),g)l.focusCell(!0,o);else if(!l.comp?.getCellEditor()){if(!p){const e=this.editSvc?.isEditing(l,{withOpenEditor:!0});Rh(this.beans,l,{event:o,cellStartedEdit:!0,silent:e})}this.setFocusInOnEditor(l),this.cleanupEditors(l)}}else h&&i&&this.setFocusInOnEditor(l),l.focusCell(!0,o);return e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},fullRow:class extends cp{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=/* @__PURE__ */new Set}shouldStop(e,t,o="ui"){const{rowNode:s,beans:i}=this,{rowNode:n}=e||{};if(!Ch(i,{rowNode:s}))return!0;const r=super.shouldStop({rowNode:s},t,o);return null!==r?r:!!s&&n!==s}midBatchInputsAllowed({rowNode:e}){return!!e&&this.model.hasEdits({rowNode:e})}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:o,startedEdit:s,event:i,ignoreEventKey:n}=e,{rowNode:r}=t,{beans:l,model:a,startedRows:d}=this;this.rowNode!==r&&super.cleanupEditors(t);const c=l.visibleCols.allCols,h=[],u=[];for(const g of c)g.isCellEditable(r)&&u.push(g);if(0!=u.length){d.has(r)||(this.dispatchRowEvent({rowNode:r},"rowEditingStarted",o),d.add(r));for(const e of u){const t={rowNode:r,column:e};h.push(t),a.start(t)}this.rowNode=r,this.setupEditors({cells:h,position:t,startedEdit:s,event:i,ignoreEventKey:n})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stopCancelled(e){const{rowNode:t,model:o}=this;return!(t&&!o.hasRowEdits(t)||(super.stopCancelled(e),this.cleanupEditors({rowNode:t},!0),this.rowNode=void 0,0))}stopCommitted(e,t){const{rowNode:o,beans:s,model:i,editSvc:n}=this;if(o&&!i.hasRowEdits(o))return!1;const r=[];if(i.getEditMap().forEach((e,t)=>{if(e&&0!==e.size)for(const o of e.values())if(Sh(o)){r.push(t);break}}),Nh(s),"block-stop"===n.checkNavWithValidation({rowNode:o}))return!1;if(super.stopCommitted(e,t),t||!n.isBatchEditing())for(const l of r)this.dispatchRowEvent({rowNode:l},"rowValueChanged");return this.cleanupEditors({rowNode:o},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,o=e.previousParams;if(o?.rowIndex===t||e.sourceEvent instanceof KeyboardEvent)return;const{beans:s,gos:i,model:n}=this;if(s.editSvc?.isRangeSelectionEnabledWhileEditing())return;const r=vh(s,o);"block"===i.get("invalidEditValueMode")&&r&&(n.getCellValidationModel().getCellValidation(r)||n.getRowValidationModel().getRowValidation(r))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);const{startedRows:o}=this;for(const s of o)this.dispatchRowEvent({rowNode:s},"rowEditingStopped"),this.destroyEditorsForRow(s);o.clear()}destroyEditorsForRow(e){const t=Ch(this.beans,{rowNode:e});if(!t)return;const o={};for(const s of t.getAllCellCtrls())s.comp?.getCellEditor()&&Ah(this.beans,s,o,s)}moveToNextEditingCell(e,t,o,s="ui",i=!1){const{beans:n,model:r,gos:l,editSvc:a}=this,d=e.cellPosition;let c;r.suspend(!0);try{c=n.navigation?.findNextCellToFocusOn(d,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{r.suspend(!1)}if(!1===c)return null;if(null==c)return!1;const h=c.cellPosition,u=e.isCellEditable(),g=c.isCellEditable(),p=h&&d.rowIndex===h.rowIndex&&d.rowPinned===h.rowPinned;u&&this.setFocusOutOnEditor(e),this.restoreEditors();const m=l.get("suppressStartEditOnTab");return g&&!i?m?c.focusCell(!0,o):(c.comp?.getCellEditor()||Rh(n,c,{event:o,cellStartedEdit:!0}),this.setFocusInOnEditor(c),c.focusCell(!1,o)):(g&&i&&this.setFocusInOnEditor(c),c.focusCell(!0,o)),p||i||(a?.stopEditing({rowNode:e.rowNode},{event:o,forceStop:!0}),a?.isRowEditing(e.rowNode,{withOpenEditor:!0})&&this.cleanupEditors(c,!0),m?c.focusCell(!0,o):a.startEditing(c,{startedEdit:!0,event:o,source:s,ignoreEventKey:!0,editable:g||void 0})),e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){const{beans:e,model:t}=this;t.getEditMap().forEach((t,o)=>t.forEach(({state:t},s)=>{if("editing"!==t)return;const i=vh(e,{rowNode:o,column:s});i&&!i.comp?.getCellEditor()&&Rh(e,i,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.clear()}}},dependsOn:[Tg,Gg],css:[".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}"]}]},up={agSetColumnFilter:"agSetColumnFilterHandler",agMultiColumnFilter:"agMultiColumnFilterHandler",agGroupColumnFilter:"agGroupColumnFilterHandler",agNumberColumnFilter:"agNumberColumnFilterHandler",agBigIntColumnFilter:"agBigIntColumnFilterHandler",agDateColumnFilter:"agDateColumnFilterHandler",agTextColumnFilter:"agTextColumnFilterHandler"},gp=new Set(Object.values(up));function pp(e,t){const o=e.filterUi;if(!o)return null;if(o.created)return o.promise;if(t)return null;const s=o.create(o.refreshed),i=o;return i.created=!0,i.promise=s,s}function mp(e,t,o,s,i,n,r){return t.refresh?.({...o,model:s,source:n,additionalEventAttributes:r}),e().then(e=>{if(e){const{filter:t,filterParams:o}=e;fp(t,o,s,i,n,r)}})}function fp(e,t,o,s,i,n){e?.refresh?.({...t,model:o,state:s,source:i,additionalEventAttributes:n})}function Cp(e,t,o,s){const i=e();i?.created&&i.promise.then(e=>{const n=t();fp(e,i.filterParams,n,o()??{model:n},"ui",s)})}function vp(e){let t,o,s=!1;const{action:i,filterParams:n,getFilterUi:r,getModel:l,getState:a,updateState:d,updateModel:c,processModelToApply:h}=e;switch(i){case"apply":{const e=a();o=e?.model??null,h&&(o=h(o)),t={state:e?.state,model:o},s=!0;break}case"clear":t={model:null},n?.buttons?.includes("apply")||(s=!0,o=null);break;case"reset":t={model:null},s=!0,o=null;break;case"cancel":t={model:l()}}d(t),s?c(o):Cp(r,l,a,{fromAction:i})}function wp(e,t){return e[t]??null}function bp(e,t,o){e.menuVisible!==t&&(e.menuVisible=t,e.dispatchColEvent("menuVisibleChanged",o))}function yp(e){const{enterpriseMenuFactory:t,filterMenuFactory:o,gos:s}=e;return t&&mo(s)?t:o}var Sp={moduleName:"SharedMenu",version:mt,beans:[class extends Oe{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(yp(this.beans),e,e.containerType,!0)}showHeaderContextMenu(e,t,o){this.activeMenuFactory?.showMenuAfterContextMenuEvent(e,t,o)}hidePopupMenu(){this.beans.contextMenuSvc?.hideActiveMenu(),this.activeMenuFactory?.hideActiveMenu()}hideFilterMenu(){yp(this.beans)?.hideActiveMenu()}isColumnMenuInHeaderEnabled(e){const{suppressHeaderMenuButton:t}=e.getColDef();return!t&&!!this.activeMenuFactory?.isMenuEnabled(e)&&(mo(this.gos)||!!this.beans.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&!!this.beans.filterManager?.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!(e&&So(e)?e.getColDef():e?.getColGroupDef())?.suppressHeaderContextMenu&&"new"===this.gos.get("columnMenu")}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(Ai()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!mo(this.gos)&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return!(!this.beans.filterManager?.isFilterAllowed(e)||mo(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 mo(e)?!!e.exists("suppressMenuHide")&&t:t}showColumnMenuCommon(e,t,o,s){const{positionBy:i,onClosedCallback:n}=t,r=t.column;if("button"===i){const{buttonElement:i}=t;e?.showMenuAfterButtonClick(r,i,o,n,s)}else if("mouse"===i){const{mouseEvent:i}=t;e?.showMenuAfterMouseEvent(r,i,o,n,s)}else if(r){const t=this.beans,i=t.ctrlsSvc;i.getScrollFeature().ensureColumnVisible(r,"auto"),be(t,()=>{const t=i.getHeaderRowContainerCtrl(r.getPinned())?.getHeaderCtrlForColumn(r);t&&e?.showMenuAfterButtonClick(r,t.getAnchorElementForMenu(s),o,n,s)})}}}],apiFunctions:{showColumnMenu:function(e,t){const o=e.colModel.getCol(t);o?e.menuSvc?.showColumnMenu({column:o,positionBy:"auto"}):Mt(12,{colKey:t})},hidePopupMenu:function(e){e.menuSvc?.hidePopupMenu()}}},Rp={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},xp=["january","february","march","april","may","june","july","august","september","october","november","december"];function Fp(e,t){return null==e?-1:null==t?1:Number.parseFloat(e)-Number.parseFloat(t)}function Dp(e,t){if(null==e)return-1;if(null==t)return 1;const o=Ka(e),s=Ka(t);return null!=o&&null!=s?o===s?0:o>s?1:-1:String(e).localeCompare(String(t))}function Mp(e){return e instanceof Date&&!isNaN(e.getTime())}var Pp={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)=>!1===t,numberOfInputs:0}]}),date:()=>({isValidDate:Mp}),dateString:({dataTypeDefinition:e})=>({comparator:(t,o)=>{const s=e.dateParser(o);return null==o||st?1:0},isValidDate:t=>"string"==typeof t&&Mp(e.dateParser(t))}),dateTime:e=>Pp.date(e),dateTimeString:e=>Pp.dateString(e),object:()=>{},text:()=>{}},Ep={number:()=>({comparator:Fp}),bigint:()=>({comparator:Dp}),boolean:({t:e})=>({valueFormatter:t=>l(t.value)?e(String(t.value),t.value?"True":"False"):e("blanks","(Blanks)")}),date:({formatValue:e,t:t})=>({valueFormatter:o=>{const s=e(o);return l(s)?s:t("blanks","(Blanks)")},treeList:!0,treeListFormatter:(e,o)=>{if("NaN"===e)return t("invalidDate","Invalid Date");if(1===o&&null!=e){const o=xp[Number(e)-1];return t(o,Rp[o])}return e??t("blanks","(Blanks)")},treeListPathGetter:e=>Qa(e,!1)}),dateString:({formatValue:e,dataTypeDefinition:t,t:o})=>({valueFormatter:t=>{const s=e(t);return l(s)?s:o("blanks","(Blanks)")},treeList:!0,treeListPathGetter:e=>Qa(t.dateParser(e??void 0),!1),treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=xp[Number(e)-1];return o(t,Rp[t])}return e??o("blanks","(Blanks)")}}),dateTime:e=>{const t=Ep.date(e);return t.treeListPathGetter=Qa,t},dateTimeString(e){const t=e.dataTypeDefinition.dateParser,o=Ep.dateString(e);return o.treeListPathGetter=e=>Qa(t(e??void 0)),o},object:({formatValue:e,t:t})=>({valueFormatter:o=>{const s=e(o);return l(s)?s:t("blanks","(Blanks)")}}),text:()=>{}};function Tp(e,t,o,s,i,n,r){let l=t,a=o;const d="agSetColumnFilter"===e;a||"object"!==s.baseDataType||d||(a=({column:e,node:t})=>i({column:e,node:t,value:n.valueSvc.getValue(e,t,"data")}));const c=(0,(d?Ep:Pp)[s.baseDataType])({dataTypeDefinition:s,formatValue:i,t:r});return l="object"==typeof t?{...c,...t}:c,{filterParams:l,filterValueGetter:a}}var Ip={boolean:"agTextColumnFilter",date:"agDateColumnFilter",dateString:"agDateColumnFilter",dateTime:"agDateColumnFilter",dateTimeString:"agDateColumnFilter",bigint:"agBigIntColumnFilter",number:"agNumberColumnFilter",object:"agTextColumnFilter",text:"agTextColumnFilter"},Ap={boolean:"agTextColumnFloatingFilter",date:"agDateColumnFloatingFilter",dateString:"agDateColumnFloatingFilter",dateTime:"agDateColumnFloatingFilter",dateTimeString:"agDateColumnFloatingFilter",bigint:"agBigIntColumnFloatingFilter",number:"agNumberColumnFloatingFilter",object:"agTextColumnFloatingFilter",text:"agTextColumnFloatingFilter"};function kp(e,t=!1){return(t?Ap:Ip)[e??"text"]}function Lp(e,t,o){if(null==t)return null;let s=null;const{compName:i,jsComp:n,fwComp:r}=ai(e,t);return i?s={agSetColumnFilter:"agSetColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",agBigIntColumnFilter:"agBigIntColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[i]:null==n&&null==r&&!0===t.filter&&(s=o()),s}var Gp={filterHandler:()=>({doesFilterPass:()=>!0})};function Np(e,t,o,s){if(!e.isPrimary())return!0;const i=!o;return!(!e.isValueActive()||!i)&&(!!t||s)}var Bp=class extends Pi{constructor(e){const{className:t="ag-filter-apply-panel"}=e??{};super(function(e){return{tag:"div",cls:e}}(t)),this.listeners=[],this.validationMessage=null,this.className=t}updateButtons(e,t){const o=this.buttons;if(this.buttons=e,o===e)return;const s=this.getGui();let i;se(s),this.destroyListeners();const n=document.createDocumentFragment(),r=this.className,l=({type:e,label:o})=>{const s=t=>{this.dispatchLocalEvent({type:e,event:t})};["apply","clear","reset","cancel"].includes(e)||Dt(75);const l="apply"===e,a=Cl({tag:"button",attrs:{type:l&&t?"submit":"button"},ref:`${e}FilterButton`,cls:`ag-button ag-standard-button ${r}-button${l?" "+r+"-apply-button":""}`,children:o});this.activateTabIndex([a]),l&&(i=a);const d=e=>{e.key===fs&&(e.preventDefault(),s(e))},c=this.listeners;a.addEventListener("click",s),c.push(()=>a.removeEventListener("click",s)),a.addEventListener("keydown",d),c.push(()=>a.removeEventListener("keydown",d)),n.append(a)};for(const d of e)l(d);this.eApply=i;const a=this.validationTooltipFeature;i&&!a?this.validationTooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eApply,getLocation:()=>"advancedFilter",getTooltipShowDelayOverride:()=>1e3})):!i&&a&&(this.validationTooltipFeature=this.destroyBean(a)),s.append(n)}getApplyButton(){return this.eApply}updateValidity(e,t=null){const o=this.eApply;o&&(_(o,!e),this.validationMessage=t,this.validationTooltipFeature?.setTooltipAndRefresh(this.validationMessage))}destroyListeners(){for(const e of this.listeners)e();this.listeners=[]}destroy(){this.destroyListeners(),super.destroy()}},Hp=class extends Pi{constructor(e,t,o,s,i,n){super(),this.column=e,this.wrapper=t,this.eventParent=o,this.updateModel=s,this.isGlobalButtons=i,this.enableGlobalButtonCheck=n,this.hidePopup=null,this.applyActive=!1}postConstruct(){const{comp:e,params:t}=this.wrapper,o=t,s=o.useForm,i=s?"form":"div";this.setTemplate({tag:i,cls:"ag-filter-wrapper"}),s&&this.addManagedElementListeners(this.getGui(),{submit:e=>{e?.preventDefault()},keydown:this.handleKeyDown.bind(this)}),this.appendChild(e.getGui()),this.params=o,this.resetButtonsPanel(o),this.addManagedListeners(this.eventParent,{filterParamsChanged:({column:e,params:t})=>{e===this.column&&this.resetButtonsPanel(t,this.params)},filterStateChanged:({column:e,state:t})=>{e===this.column&&this.eButtons?.updateValidity(!1!==t.valid)},filterAction:({column:e,action:t,event:o})=>{e===this.column&&this.afterAction(t,o)},...this.enableGlobalButtonCheck?{filterGlobalButtons:({isGlobal:e})=>{if(e!==this.isGlobalButtons){this.isGlobalButtons=e;const t=this.params;this.resetButtonsPanel(t,t,!0)}}}:void 0})}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup)}resetButtonsPanel(e,t,o){const{buttons:s,readOnly:i}=t??{},{buttons:n,readOnly:r,useForm:l}=e;if(!o&&i===r&&c(s,n))return;const a=n&&n.length>0&&!e.readOnly&&!this.isGlobalButtons;let d=this.eButtons;if(a){const e=n.map(e=>({type:e,label:Ji(this,`${e}Filter`)}));if(this.applyActive=en(this.params),!d){d=this.createBean(new Bp),this.appendChild(d.getGui());const e=this.column,t=t=>({event:o})=>{this.updateModel(e,t,{fromButtons:!0}),this.afterAction(t,o)};d?.addManagedListeners(d,{apply:t("apply"),clear:t("clear"),reset:t("reset"),cancel:t("cancel")}),this.eButtons=d}d.updateButtons(e,l)}else this.applyActive=!1,d&&(ie(d.getGui()),this.eButtons=this.destroyBean(d))}close(e){const t=this.hidePopup;if(!t)return;const o=e,s=o?.key;let i;s!==fs&&s!==vs||(i={keyboardEvent:o}),t(i),this.hidePopup=null}afterAction(e,t){const{params:o,applyActive:s}=this,i=o?.closeOnApply;switch(e){case"apply":t?.preventDefault(),i&&s&&this.close(t);break;case"reset":i&&s&&this.close();break;case"cancel":i&&this.close(t)}}handleKeyDown(e){!e.defaultPrevented&&e.key===fs&&this.applyActive&&(this.updateModel(this.column,"apply",{fromButtons:!0}),this.afterAction("apply",e))}destroy(){this.hidePopup=null,this.eButtons=this.destroyBean(this.eButtons)}},Op={tag:"div",cls:"ag-filter"},Vp=class extends Pi{constructor(e,t,o){super(Op),this.column=e,this.source=t,this.enableGlobalButtonCheck=o,this.wrapper=null}postConstruct(){this.beans.colFilter?.activeFilterComps.add(this),this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return null!=this.wrapper}getFilter(){return this.wrapper?.then(e=>e.comp)??null}afterInit(){return this.wrapper?.then(()=>{})??Ns.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:o,beans:{colFilter:s}}=this,i=s.getFilterUiForDisplay(t)??null;this.wrapper=i,i?.then(i=>{if(!i)return;const{isHandler:n,comp:r}=i;let a;if(n){const e=!!this.enableGlobalButtonCheck,o=this.createBean(new Hp(t,i,s,s.updateModel.bind(s),e&&s.isGlobalButtons,e));this.comp=o,a=o.getGui()}else this.registerCSS(":where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}"),a=r.getGui(),l(a)||Dt(69,{guiFromFilter:a});this.appendChild(a),e?this.eventSvc.dispatchEvent({type:"filterOpened",column:t,source:o,eGui:this.getGui()}):r.afterGuiAttached?.(this.afterGuiAttachedParams)})}onFilterDestroyed(e){const{source:t,column:o}=e;"api"!==t&&"paramsUpdated"!==t||o.getId()!==this.column.getId()||!this.beans.colModel.getColDefCol(this.column)||(se(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()}},zp={moduleName:"FilterCore",version:mt,beans:[class extends Oe{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:e})=>this.onAdvFilterEnabledChanged(e),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:o}=this;this.alwaysPassFilter=o.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=o.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterState(e,t,o="api"){this.isAdvFilterEnabled()||this.colFilter?.setState(e,t,o)}setFilterModel(e,t="api",o){this.isAdvFilterEnabled()?o||this.warnAdvFilters():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(){$t(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:o,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):Ns.resolve()).then(()=>{const e={source:t,type:"filterChanged",columns:s};o&&Ye(e,o),this.eventSvc.dispatchEvent(e),this.colFilter?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.colFilter?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilter?.isFilterPresent()}updateAggFiltering(){this.aggFiltering=!!$t(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)&&(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)&&(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()&&!!this.colFilter?.isFilterAllowed(e)}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){this.isAdvFilterEnabled()&&(this.beans.dataTypeSvc?.isPendingInference?this.advFilterModelUpdateQueue.push(e):(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()&&!!this.colFilter?.hasFloatingFilters()}getColumnFilterInstance(e){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):this.colFilter?.getFilterInstance(e)??Promise.resolve(void 0)}warnAdvFilters(){Dt(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()}}],apiFunctions:{isAnyFilterPresent:function(e){return!!e.filterManager?.isAnyFilterPresent()},onFilterChanged:function(e,t="api"){e.filterManager?.onFilterChanged({source:t})}},css:[".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)}"],dependsOn:[{moduleName:"ClientSideRowModelFilter",version:mt,rowModels:["clientSide"],beans:[class extends Oe{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const t=!!this.filterManager?.isChildFilterPresent();this.beans.formula?.active?this.softFilter(t,e):this.filterNodes(t,e)}filterNodes(e,t){const o=(t,o)=>{t.hasChildren()?t.childrenAfterFilter=e&&!o?t.childrenAfterGroup.filter(e=>{const t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,o=e.data&&this.filterManager.doesRowPassFilter({rowNode:e});return t||o}):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,ag(t)};if(this.doingTreeDataFiltering()){const e=(t,s)=>{if(t.childrenAfterGroup)for(let i=0;io(e,!1);eg(this.beans.rowModel.rootNode,this.beans.rowModel.hierarchical,t,e)}}softFilter(e,t){const o=this.beans.rowModel;eg(o.rootNode,o.hierarchical,t,t=>{if(t.childrenAfterFilter=t.childrenAfterGroup,t.hasChildren())for(const o of t.childrenAfterGroup)o.softFiltered=e&&!(o.data&&this.filterManager.doesRowPassFilter({rowNode:o}));ag(t)})}doingTreeDataFiltering(){const{gos:e}=this;return!!this.beans.groupStage?.treeData&&!e.get("excludeChildrenWhenTreeDataFiltering")}}]}]},Wp={moduleName:"FilterValue",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,o){if(!t)return;const s=e.getColDef(),{selectableFilter:i,valueSvc:n,formula:r}=this.beans,l=o??i?.getFilterValueGetter(e.getColId())??s.filterValueGetter;if(l)return this.executeFilterValueGetter(l,t.data,e,t,s);const a=n.getValue(e,t,"data");return e.isAllowFormula()&&r?.isFormula(a)?r.resolveValue(e,t):a}executeFilterValueGetter(e,t,o,s,i){const{expressionSvc:n,valueSvc:r}=this.beans,l=Co(this.gos,{data:t,node:s,column:o,colDef:i,getValue:r.getValueCallback.bind(r,s)});return"function"==typeof e?e(l):n?.evaluate(e,l)}}]},Up={moduleName:"ColumnFilter",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=/* @__PURE__ */new Map,this.allColumnListeners=/* @__PURE__ */new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=/* @__PURE__ */new Map,this.handlerMap={...up},this.isGlobalButtons=!1,this.activeFilterComps=/* @__PURE__ */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",o){const{colModel:s,dataTypeSvc:i,filterManager:n}=this.beans;if(i?.isPendingInference)return void this.modelUpdates.push({model:e,source:t});const r=[],l=this.getModel(!0);if(e){const t=new Set(Object.keys(e));this.allColumnFilters.forEach((o,s)=>{const i=e[s];r.push(this.setModelOnFilterWrapper(o,i)),t.delete(s)}),t.forEach(t=>{const o=s.getColDefCol(t)||s.getCol(t);if(!o)return void Dt(62,{colId:t});if(!o.isFilterAllowed())return void Dt(63,{colId:t});const i=this.getOrCreateFilterWrapper(o,!0);i?r.push(this.setModelOnFilterWrapper(i,e[t],!0)):Dt(64,{colId:t})})}else this.model={},this.allColumnFilters.forEach(e=>{r.push(this.setModelOnFilterWrapper(e,null))});Ns.all(r).then(()=>{const e=this.getModel(!0),s=[];this.allColumnFilters.forEach((t,o)=>{c(l?l[o]:null,e?e[o]:null)||s.push(t.column)}),s.length>0?n?.onFilterChanged({columns:s,source:t}):o&&this.updateActive("filterChanged")})}getModel(e){const t={},{allColumnFilters:o,initialModel:s,beans:{colModel:i}}=this;if(o.forEach((e,o)=>{const s=this.getModelFromFilterWrapper(e);l(s)&&(t[o]=s)}),!e)for(const n of Object.keys(s)){const e=s[n];l(e)&&!o.has(n)&&i.getCol(n)?.isFilterAllowed()&&(t[n]=e)}return t}setState(e,t,o="api"){if(this.state.clear(),t)for(const s of Object.keys(t)){const e=t[s];this.state.set(s,{model:wp(this.model,s),state:e})}this.setModel(e,o,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let o=!1;return e.forEach((e,s)=>{const i=e.state;null!=i&&(o=!0,t[s]=i)}),o?t:void 0}getModelFromFilterWrapper(e){const t=e.column.getColId();if(e.isHandler)return wp(this.model,t);const o=e.filter;return o?"function"!=typeof o.getModel?(Dt(66),null):o.getModel():wp(this.initialModel,t)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return!!e.size&&(e.forEach(e=>this.disposeFilterWrapper(e,"advancedFilterEnabled")),!0)}updateActiveFilters(){const{colModel:e,gos:t}=this.beans,o=!!$t(t),s=[],i=[],n=(t,n,r)=>{n&&(Np(t,e.isPivotMode(),e.isPivotActive(),o)?s.push(r):i.push(r))},r=[];return this.allColumnFilters.forEach(e=>{const t=e.column,o=t.getColId();if(e.isHandler)r.push(Ns.resolve().then(()=>{n(t,this.isHandlerActive(t),{colId:o,isHandler:!0,handler:e.handler,handlerParams:e.handlerParams})}));else{const s=pp(e);s&&r.push(s.then(e=>{n(t,(e=>!!e&&(e.isFilterActive?e.isFilterActive():(Dt(67),!1)))(e),{colId:o,isHandler:!1,comp:e})}))}}),Ns.all(r).then(()=>{this.activeAggregateFilters=s,this.activeColumnFilters=i})}updateFilterFlagInColumns(e,t){const o=[];return this.allColumnFilters.forEach(s=>{const i=s.column;if(s.isHandler)o.push(Ns.resolve().then(()=>{this.setColFilterActive(i,this.isHandlerActive(i),e,t)}));else{const n=pp(s);n&&o.push(n.then(o=>{this.setColFilterActive(i,o.isFilterActive(),e,t)}))}}),this.beans.groupFilter?.updateFilterFlags(e,t),Ns.all(o)}doFiltersPass(e,t,o){const{data:s,aggData:i}=e,n=o?this.activeAggregateFilters:this.activeColumnFilters,r=o?i:s,l=this.model;for(let a=0;a{this.isAlive()&&o?.onFilterChanged(e)};t.isRefreshInProgress()?setTimeout(s,0):s()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:o}=e,s=t?.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",o).then(()=>{this.allColumnFilters.forEach(e=>{const{column:t,isHandler:o}=e;s!==t.getColId()&&(o&&e.handler.onAnyFilterChanged?.(),pp(e,o)?.then(e=>{"function"==typeof e?.onAnyFilterChanged&&e.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!this.gos.get("allowShowChangeAfterFilter")&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(e=>{const o=e.isHandler;o&&e.handler.onNewRowsLoaded?.();const s=pp(e,o);s&&t.push(s.then(e=>{e.onNewRowsLoaded?.()}))}),Ns.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:o,colModel:s}=this.beans;return(i,n)=>{const r=n?s.getCol(n):e;return r?o.getValue(r,i,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t?.isHandler)return this.isHandlerActive(e);const o=t?.filter;return o?o.isFilterActive():null!=wp(this.initialModel,e.getColId())}isHandlerActive(e){const t=l(wp(this.model,e.getColId()));if(t)return t;const o=this.beans.groupFilter;return!!o?.isGroupFilter(e)&&o.isFilterActive(e)}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?pp(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const o=pp(t);return o?o.then(e=>({comp:e,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const o=this.getOrCreateFilterWrapper(e,t);return o?.isHandler?o.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let o=this.cachedFilter(e);return!o&&t&&(o=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,o)),o}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(o=this.gos).isModuleRegistered("SetFilter")&&!o.get("suppressSetFilterByDefault")?t?"agSetColumnFloatingFilter":"agSetColumnFilter":kp(e(),t);var o}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,o,s,i,n){const r=()=>{const r=s(this.createFilterCompParams(e,i,n),i);return ri(this.beans.userCompFactory,t,r,o)},l=r();return l?{compDetails:l,createFilterUi:e=>(e?r():l).newAgStackInstance()}:null}createFilterInstance(e,t,o,s){const i=this.beans.selectableFilter;i?.isSelectable(t)&&(t=i.getFilterDef(e,t));const{handler:n,handlerParams:r,handlerGenerator:l}=this.createHandler(e,t,o)??{},a=this.createFilterComp(e,t,o,s,!!n,"init");if(!a)return{compDetails:null,createFilterUi:null,handler:n,handlerGenerator:l,handlerParams:r};const{compDetails:d,createFilterUi:c}=a;return this.isGlobalButtons&&(d.params?.buttons?.length||Dt(281,{colId:e.getColId()})),{compDetails:d,handler:n,handlerGenerator:l,handlerParams:r,createFilterUi:c}}createBaseFilterParams(e,t){const{filterManager:o,rowModel:s}=this.beans;return Co(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:t=>o?.doesRowPassOtherFilters(e.getColId(),t)??!0,rowModel:s})}createFilterCompParams(e,t,o,s){const i=this.filterChangedCallbackFactory(e),n=this.createBaseFilterParams(e,s);if(n.filterChangedCallback=i,n.filterModifiedCallback=s?()=>{}:t=>this.filterModified(e,t),t){const t=n,s=e.getColId(),r=wp(this.model,s);t.model=r,t.state=this.state.get(s)??{model:r},t.onModelChange=(t,o)=>{this.updateStoredModel(s,t),this.refreshHandlerAndUi(e,t,"ui",!1,o).then(()=>{i({...o,source:"columnFilter"})})},t.onStateChange=t=>{this.updateState(e,t),this.updateOrRefreshFilterUi(e)},t.onAction=(t,o,s)=>{this.updateModel(e,t,o),this.dispatchLocalEvent({type:"filterAction",column:e,action:t,event:s})},t.getHandler=()=>this.getHandler(e,!0),t.onUiChange=t=>this.filterUiChanged(e,t),t.source=o}return n}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,o){const s=t(),i={created:!0,create:t,filterParams:e.params,compDetails:e,promise:s};return s.then(o),i}createFilterWrapper(e){const{compDetails:t,handler:o,handlerGenerator:s,handlerParams:i,createFilterUi:n}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),e=>e),r=e.getColId();if(o)return delete this.initialModel[r],o.init?.({...i,source:"init",model:wp(this.model,r)}),{column:e,isHandler:!0,handler:o,handlerGenerator:s,handlerParams:i,filterUi:this.createFilterUiForHandler(t,n)};if(n){const o={column:e,filterUi:null,isHandler:!1};return o.filterUi=this.createFilterUiLegacy(t,n,e=>{o.filter=e??void 0}),o}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,o){const{gos:s,frameworkOverrides:i,registry:n}=this.beans;let r;const l=s.get("enableFilterHandlers"),a=l?(e=>{const t=e.filter;if(Hs(t)){return t.handler||(r=t.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return"string"==typeof t?t:void 0})(t):void 0,d=e=>()=>this.createBean(n.createDynamicBean(e,!0));let c,h;if("string"==typeof a){const e=s.get("filterHandlers")?.[a];null!=e?c=e:gp.has(a)&&(c=d(a),h=a)}else c=a;if(!c){let e;const{compName:s,jsComp:n,fwComp:r}=ai(i,t);s?e=s:null==n&&null==r&&!0===t.filter&&(e=o),h=this.handlerMap[e],h&&(c=d(h))}if(!c){if(!l)return;return It(s)&&Dt(277,{colId:e.getColId()}),Gp}return{filterHandler:c,handlerNameOrCallback:r??h}}createHandler(e,t,o){const s=this.createHandlerFunc(e,t,o);if(!s)return;const i=di(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:n,filterHandler:r}=s,{handler:l,handlerParams:a}=this.createHandlerFromFunc(e,r,i);return{handler:l,handlerParams:a,handlerGenerator:n??r}}createHandlerFromFunc(e,t,o){const s=e.getColDef();return{handler:t(Co(this.gos,{column:e,colDef:s})),handlerParams:this.createHandlerParams(e,o)}}createHandlerParams(e,t){const o=e.getColDef(),s=e.getColId(),i=this.filterChangedCallbackFactory(e);return Co(this.gos,{colDef:o,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:e=>this.beans.filterManager?.doesRowPassOtherFilters(s,e)??!0,onModelChange:(t,o)=>{this.updateStoredModel(s,t),this.refreshHandlerAndUi(e,t,"handler",!1,o).then(()=>{i({...o,source:"columnFilter"})})},onModelAsStringChange:()=>{e.dispatchColEvent("filterChanged","filterChanged"),this.dispatchLocalEvent({type:"filterModelAsStringChanged",column:e})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:o,groupFilter:s}=this.beans;this.allColumnFilters.forEach((o,s)=>{let i;i=o.column.isPrimary()?t.getColDefCol(s):t.getCol(s),i&&i===o.column||(e.push(o.column),this.disposeFilterWrapper(o,"columnChanged"),this.disposeColumnListener(s))});const i=s&&e.every(e=>s.isGroupFilter(e));e.length>0&&!i&&o?.onFilterChanged({columns:e,source:"api"})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const t=this.beans.groupFilter;return!t?.isGroupFilter(e)||t.isFilterAllowed(e)}getFloatingFilterCompDetails(e,t){const{userCompFactory:o,frameworkOverrides:s,selectableFilter:i,gos:n}=this.beans,r=e.getColDef(),l=i?.isSelectable(r)?i.getFilterDef(e,r):r,a=Lp(s,l,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",d=n.get("enableFilterHandlers"),c=Co(n,{column:e,filterParams:di(o,l,this.createFilterCompParams(e,d,"init",!0)),currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:t=>{this.getOrCreateFilterUi(e)?.then(e=>{t(ph(e))})},showParentFilter:t});if(d){const t=c,o=e.getColId(),s=this.filterChangedCallbackFactory(e);t.onUiChange=t=>this.floatingFilterUiChanged(e,t),t.model=wp(this.model,o),t.onModelChange=(t,i)=>{this.updateStoredModel(o,t),this.refreshHandlerAndUi(e,t,"floating",!0,i).then(()=>{s({...i,source:"columnFilter"})})},t.getHandler=()=>this.getHandler(e,!0),t.source="init"}return li(o,r,c,a)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,o,s){const i="paramsUpdated";if(e.isHandler){const n=t.getColId();delete this.initialModel[n],this.state.delete(n);const r=e.filterUi;e.filterUi=this.createFilterUiForHandler(o,s);const l=this.eventSvc;r?.created?r.promise.then(e=>{this.destroyBean(e),l.dispatchEvent({type:"filterDestroyed",source:i,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:i,column:t})}else this.destroyFilter(t,i)}destroyFilter(e,t="api"){const o=e.getColId(),s=this.allColumnFilters.get(o);this.disposeColumnListener(o),delete this.initialModel[o],s&&this.disposeFilterWrapper(s,t).then(t=>{t&&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 o=!1;const{column:s,isHandler:i,filterUi:n}=e,r=s.getColId();i&&(o=this.isHandlerActive(s),this.destroyBean(e.handler),delete this.model[r],this.state.delete(r));const l=()=>{this.setColFilterActive(s,!1,"filterDestroyed"),this.allColumnFilters.delete(r),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:s})};if(n){if(n.created)return n.promise.then(e=>(o=i?o:!!e?.isFilterActive(),this.destroyBean(e),l(),o));l()}return Ns.resolve(o)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:t?.source??"columnFilter"})}}filterParamsChanged(e,t="api"){const o=this.allColumnFilters.get(e);if(!o)return;const s=this.beans,i=o.column,n=i.getColDef(),r=i.isFilterAllowed(),l=this.getDefaultFilter(i),a=s.selectableFilter,d=a?.isSelectable(n)?a.getFilterDef(i,n):n,c=r?this.createHandlerFunc(i,d,this.getDefaultFilter(i)):void 0,h=!!c,u=o.isHandler;if(u!=h)return void this.destroyFilter(i,"paramsUpdated");const{compDetails:g,createFilterUi:p}=(r?this.createFilterComp(i,d,l,e=>e,h,"colDef"):null)??{compDetails:null,createFilterUi:null},m=g?.params??di(s.userCompFactory,d,this.createFilterCompParams(i,h,"colDef"));if(u){const s=c?.handlerNameOrCallback??c?.filterHandler,n=wp(this.model,e);if(o.handlerGenerator!=s){const r=o.handler,{handler:l,handlerParams:a}=this.createHandlerFromFunc(i,c.filterHandler,m);o.handler=l,o.handlerParams=a,o.handlerGenerator=s,delete this.model[e],l.init?.({...a,source:"init",model:null}),this.destroyBean(r),null!=n&&this.beans.filterManager?.onFilterChanged({columns:[i],source:t})}else{const e=this.createHandlerParams(i,g?.params);o.handlerParams=e,o.handler.refresh?.({...e,source:"colDef",model:n})}}!this.areFilterCompsDifferent(o.filterUi?.compDetails??null,g)&&o.filterUi&&g?(o.filterUi.filterParams=m,pp(o,u)?.then(e=>{!1===(!e?.refresh||e.refresh(m))?this.destroyFilterUi(o,i,g,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:i,params:m})})):this.destroyFilterUi(o,i,g,p)}refreshHandlerAndUi(e,t,o,s,i){const n=this.cachedFilter(e);if(!n)return s&&this.getOrCreateFilterWrapper(e,!0),Ns.resolve();if(!n.isHandler)return Ns.resolve();const{filterUi:r,handler:l,handlerParams:a}=n;return mp(()=>{if(r){const{created:e,filterParams:t}=r;if(e)return r.promise.then(e=>e?{filter:e,filterParams:t}:void 0);r.refreshed=!0}return Ns.resolve(void 0)},l,a,t,this.state.get(e.getColId())??{model:t},o,i)}setColumnFilterWrapper(e,t){const o=e.getColId();this.allColumnFilters.set(o,t),this.allColumnListeners.set(o,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(o)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:o}=e,{componentClass:s}=t;return!(o===s||o?.render&&s?.render&&o.render===s.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(e=>e.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const o=this.getOrCreateFilterUi(t);return o?new Promise(e=>{o.then(t=>{e(ph(t))})}):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:o})=>{this.setModelForColumn(e,t).then(()=>o())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:t,model:o}=this,s=e.getColId(),i=t.get(s);return i?i.model??null:wp(o,s)}const o=this.cachedFilter(e);return o?this.getModelFromFilterWrapper(o):null}setModelForColumn(e,t){if(this.beans.dataTypeSvc?.isPendingInference){let o=()=>{};const s=new Promise(e=>{o=e});return this.columnModelUpdates.push({key:e,model:t,resolve:o}),s}return new Promise(o=>{this.setModelForColumnLegacy(e,t).then(e=>o(e))})}getStateForColumn(e){return this.state.get(e)??{model:wp(this.model,e)}}setModelForColumnLegacy(e,t){const o=this.beans.colModel.getColDefCol(e),s=o?this.getOrCreateFilterWrapper(o,!0):null;return s?this.setModelOnFilterWrapper(s,t):Ns.resolve()}setColDefPropsForDataType(e,t,o){const s=e.filter,i=!0===s?this.getDefaultFilterFromDataType(()=>t.baseDataType):s;if("string"!=typeof i)return;let n,r;const l=this.beans,{filterParams:a,filterValueGetter:d}=e;({filterParams:n,filterValueGetter:r}="agMultiColumnFilter"===i?l.multiFilter?.getParamsForDataType(a,d,t,o)??{}:Tp(i,a,d,t,o,l,this.getLocaleTextFunc())),e.filterParams=n,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,o,s){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",o)),e.dispatchColEvent("filterChanged",o,s)}setModelOnFilterWrapper(e,t,o){return new Ns(s=>{if(e.isHandler){const i=e.column,n=i.getColId(),r=this.model[n];return this.updateStoredModel(n,t),o&&t===r?void s():void this.refreshHandlerAndUi(i,t,"api").then(()=>s())}const i=pp(e);i?i.then(e=>{if("function"!=typeof e?.setModel)return Dt(65),void s();(e.setModel(t)||Ns.resolve()).then(()=>s())}):s()})}updateStoredModel(e,t){l(t)?this.model[e]=t:delete this.model[e];const o={model:t,state:this.state.get(e)?.state};this.state.set(e,o)}filterModified(e,t){this.getOrCreateFilterUi(e)?.then(o=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:o,...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,o){const s=e.getColId(),i=this.cachedFilter(e),n=()=>i?.filterUi;vp({action:t,filterParams:i?.filterUi?.filterParams,getFilterUi:n,getModel:()=>wp(this.model,s),getState:()=>this.state.get(s),updateState:t=>this.updateState(e,t),updateModel:e=>n()?.filterParams?.onModelChange(e,{...o,fromAction:t}),processModelToApply:i?.isHandler?i.handler.processModelToApply?.bind(i.handler):void 0})}updateAllModels(e,t){const o=[];this.allColumnFilters.forEach((t,s)=>{const i=this.beans.colModel.getColDefCol(s);i&&vp({action:e,filterParams:t.filterUi?.filterParams,getFilterUi:()=>t.filterUi,getModel:()=>wp(this.model,s),getState:()=>this.state.get(s),updateState:e=>this.updateState(i,e),updateModel:t=>{this.updateStoredModel(s,t),this.dispatchLocalEvent({type:"filterAction",column:i,action:e}),o.push(this.refreshHandlerAndUi(i,t,"ui"))},processModelToApply:t?.isHandler?t.handler.processModelToApply?.bind(t.handler):void 0})}),o.length&&Ns.all(o).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();Cp(()=>this.cachedFilter(e)?.filterUi,()=>wp(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:o}=this;for(const i of o)if("COLUMN_MENU"===i.source)return!1;let s=!1;for(const i of e.keys()){const o=e.get(i);if(!1===o.valid)return!1;(o.model??null)!==wp(t,i)&&(s=!0)}return s}hasUnappliedModel(e){const{model:t,state:o}=this;return(o.get(e)?.model??null)!==wp(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if("newFiltersToolPanel"===t)return!0;const o=this.beans.filterPanelSvc;return!!o?.isActive&&!!o.getState(e.getColId())}onPivotModeChanged(e){const{colModel:t,pivotColsSvc:o}=this.beans,s=!!$t(this.gos),n=e.currentValue,r=n?this.activeColumnFilters:this.activeAggregateFilters,l=n?this.activeAggregateFilters:this.activeColumnFilters,a=[];for(const i of r){const e=t.getColById(i.colId),r=n&&!!o?.columns.length;e&&n===Np(e,n,r,s)&&(l.push(i),a.push(i))}i(r,a)}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}},class extends Oe{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){this.hidePopup?.()}showMenuAfterMouseEvent(e,t,o,s){e&&!e.isColumn||this.showPopup(e,s=>{this.popupSvc?.positionPopupUnderMouseEvent({additionalParams:{column:e},type:o,mouseEvent:t,ePopup:s})},o,t.target,mo(this.gos),s)}showMenuAfterButtonClick(e,t,o,s){if(e&&!e.isColumn)return;let i=-1,n="left";const r=mo(this.gos);!r&&this.gos.get("enableRtl")&&(i=1,n="right");const l=r?void 0:4*i,a=r?void 0:4;this.showPopup(e,s=>{this.popupSvc?.positionPopupByComponent({type:o,eventSource:t,ePopup:s,nudgeX:l,nudgeY:a,alignSide:n,keepWithinBounds:!0,position:"under",additionalParams:{column:e}})},o,t,r,s)}showPopup(e,t,o,s,i,n){const r=e?this.createBean(new Vp(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!r?.hasFilter()||!e)return void Mt(57);const l=Cl({tag:"div",cls:"ag-menu"+(i?"":" ag-filter-menu"),role:"presentation"});let a;[this.tabListener]=this.addManagedElementListeners(l,{keydown:e=>this.trapFocusWithin(e,l)}),l.appendChild(r?.getGui());const d=fo(this.gos)?s??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,c=this.getLocaleTextFunc(),h=i&&"columnFilter"!==o?c("ariaLabelColumnMenu","Column Menu"):c("ariaLabelColumnFilter","Column Filter"),u=this.popupSvc?.addPopup({modal:!0,eChild:l,closeOnEsc:!0,closedCallback:t=>{bp(e,!1,"contextMenu");const i=t instanceof KeyboardEvent;this.tabListener&&(this.tabListener=this.tabListener()),i&&s&&re(s)&&$i(s)?.focus({preventScroll:!0}),r?.afterGuiDetached(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,o,e),n?.()},positionCallback:()=>t(l),anchorToElement:d,ariaLabel:h});u&&(this.hidePopup=a=u.hideFunc),r.afterInit().then(()=>{t(l),r.afterGuiAttached({container:o,hidePopup:a})}),bp(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,o,e)}trapFocusWithin(e,t){e.key!==ms||e.defaultPrevented||Ui(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),Wi(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,o){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:o??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}}],dynamicBeans:{headerFilterCellCtrl:class extends cr{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,o,s,i){this.comp=e;const n=or(this,this.beans.context,i);this.eButtonShowMainFilter=o,this.eFloatingFilterBody=s,this.setGui(t,n),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(n),this.setupLeft(n),this.setupHover(n),this.setupFocus(n),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(n),this.setupUi(),n.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(n);const r=()=>this.onColDefChanged(n);n.addManagedListeners(this.column,{colDefChanged:r}),n.addManagedEventListeners({filterSwitched:({column:e})=>{e===this.column&&r()}}),n.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,o=e.colDef;return Co(t.gos,{colDef:o,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,o=!!e.floatingFilter;this.active=t&&o}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=Ol("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new Qi(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();E(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){const{beans:t}=this;if(w(t)===this.eGui)return;const o=Ui(t,this.eGui,null,e.shiftKey);if(o)return t.headerNavigation?.scrollToColumn(this.column),e.preventDefault(),void o.focus();const s=this.findNextColumnWithFloatingFilter(e.shiftKey);s&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:s},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let o=this.column;do{if(o=e?t.getColBefore(o):t.getColAfter(o),!o)break}while(!o.getColDef().filter||!o.getColDef().floatingFilter);return o}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case bs:case Ss:case ws:case ys:if(t)return;qi(e);case fs:t&&Wi(this.eGui)&&e.preventDefault();break;case Cs:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const t=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),o=!!e.relatedTarget&&q(e.relatedTarget,"ag-floating-filter");if(t&&o&&e.target===this.eGui){const e=this.lastFocusEvent,t=!(!e||e.key!==ms);if(e&&t){const t=e.shiftKey;Wi(this.eGui,t)}}this.focusThis()}setupHover(e){this.beans.colHover?.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new sr(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!mo(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:o,gos:s}=this,i=e=>{if(!("filterDestroyed"!==e?.source||this.isAlive()&&t?.isAlive()))return;const i=this.comp.getFloatingFilterComp();i&&i.then(i=>{if(i){if(s.get("enableFilterHandlers")){const t=e;let o="filter";return t?.afterFloatingFilter?o="ui":t?.afterDataChange?o="dataChanged":"api"===e?.source&&(o="api"),void this.updateFloatingFilterParams(this.userCompDetails,o)}const n=t?.getCurrentFloatingFilterParentModel(o),r=e?{...e,columns:e.columns??[],source:"api"===e.source?"api":"columnFilter"}:null;i.onParentModelChanged(n,r)}})};[this.destroySyncListener]=e.addManagedListeners(o,{filterChanged:i}),t?.isFilterActive(o)&&i(null)}setupWidth(e){const t=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};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 o=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.beans.colFilter,i=this.active?s?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,n=this.comp.getFloatingFilterComp();n&&i?n.then(t=>{!t||s?.areFilterCompsDifferent(this.userCompDetails??null,i)?this.updateCompDetails(e,i,o):this.updateFloatingFilterParams(i,"colDef")}):this.updateCompDetails(e,i,o)}updateCompDetails(e,t,o){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),o&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){if(!e)return;let o=e.params;this.comp.getFloatingFilterComp()?.then(e=>{"function"==typeof e?.refresh&&(this.gos.get("enableFilterHandlers")&&(o={...o,model:wp(this.beans.colFilter?.model??{},this.column.getColId()),source:t}),e.refresh(o))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}}},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:function(e){const t=e.filterManager;return!!t?.isColumnFilterPresent()||!!t?.isAggregateFilterPresent()},getColumnFilterInstance:function(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)},destroyFilter:function(e,t){const o=e.colModel.getColDefCol(t);if(o)return e.colFilter?.destroyFilter(o,"api")},setFilterModel:function(e,t){e.frameworkOverrides.wrapIncoming(()=>e.filterManager?.setFilterModel(t))},getFilterModel:function(e){return e.filterManager?.getFilterModel()??{}},getColumnFilterModel:function(e,t,o){const{gos:s,colModel:i,colFilter:n}=e;o&&!s.get("enableFilterHandlers")&&(Dt(288),o=!1);const r=i.getColDefCol(t);return r?n?.getModelForColumn(r,o)??null:null},setColumnFilterModel:function(e,t,o){return e.filterManager?.setColumnFilterModel(t,o)??Promise.resolve()},showColumnFilter:function(e,t){const o=e.colModel.getCol(t);o?e.menuSvc?.showFilterMenu({column:o,containerType:"columnFilter",positionBy:"auto"}):Mt(12,{colKey:t})},hideColumnFilter:function(e){e.menuSvc?.hideFilterMenu()},getColumnFilterHandler:function(e,t){const o=e.colModel.getCol(t);if(o)return e.colFilter?.getHandler(o,!0);Mt(12,{colKey:t})},doFilterAction:function(e,t){const{colModel:o,colFilter:s,gos:i}=e;if(!i.get("enableFilterHandlers"))return void Dt(287);const{colId:n,action:r}=t;if(n){const e=o.getColById(n);e&&s?.updateModel(e,r)}else s?.updateAllModels(r)}},dependsOn:[zp,Tg,Wp,Sp]},$p={moduleName:"QuickFilter",version:mt,apiFunctions:{isQuickFilterPresent:function(e){return!!e.quickFilter?.isFilterPresent()},getQuickFilter:function(e){return e.quickFilter?.getText()},resetQuickFilter:function(e){e.quickFilter?.resetCache()}},dependsOn:[{moduleName:"QuickFilterCore",version:mt,rowModels:["clientSide"],beans:[class extends Oe{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",e=>this.setFilter(e.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:o,pivotResultCols:s}=this.beans,i=t.isPivotMode(),n=e?.getColumns(),r=t.getColDefCols();let l=(i&&!o.get("applyQuickFilterBeforePivotOrAgg")?s?.getPivotResultCols()?.list:r)??[];n&&(l=l.concat(n)),this.colsToUse=o.get("includeHiddenColumnsInQuickFilter")?l:l.filter(e=>e.isVisible()||e.isRowGroupActive())}isFilterPresent(){return null!==this.quickFilter}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(o=>t?this.doesRowPassCache(e,o):this.doesRowPassNoCache(e,o))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseFilter(e){return l(e)?e.toUpperCase():null}setFilter(e){if(null!=e&&"string"!=typeof e)return void Dt(70,{newFilter:e});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"),o=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,o&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(o=>{const s=this.getTextForColumn(o,e);return l(s)&&s.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let o;e?(this.checkGenerateAggText(t),o=t.quickFilterAggregateText):o=this.getAggText(t);const{quickFilterParts:s,matcher:i}=this;return i(s,o)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let o=this.beans.filterValueSvc.getValue(e,t);const s=e.getColDef();if(s.getQuickFilterText){const i=Co(this.gos,{value:o,node:t,data:t.data,column:e,colDef:s});o=s.getQuickFilterText(i)}return l(o)?o.toString().toUpperCase():null}getAggText(e){const t=[];for(const o of this.colsToUse){const s=this.getTextForColumn(o,e);l(s)&&t.push(s)}return t.join("\n")}}],dependsOn:[zp,Wp]}]},jp={moduleName:"EventApi",version:mt,apiFunctions:{addEventListener:function(e,t,o){e.apiEventSvc?.addListener(t,o)},addGlobalListener:function(e,t){e.apiEventSvc?.addGlobalListener(t)},removeEventListener:function(e,t,o){e.apiEventSvc?.removeListener(t,o)},removeGlobalListener:function(e,t){e.apiEventSvc?.removeGlobalListener(t)}},beans:[class extends Oe{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=/* @__PURE__ */new Map,this.asyncListeners=/* @__PURE__ */new Map,this.syncGlobalListeners=/* @__PURE__ */new Set,this.globalListenerPairs=/* @__PURE__ */new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(e,t){const o=this.wrapSvc?.wrap(e,t)??t,s=!zc.has(e),i=s?this.asyncListeners:this.syncListeners;i.has(e)||i.set(e,/* @__PURE__ */new Set),i.get(e).add(o),this.eventSvc.addListener(e,o,s)}removeListener(e,t){const o=this.wrapSvc?.unwrap(e,t)??t,s=!!this.asyncListeners.get(e)?.delete(o);s||this.syncListeners.get(e)?.delete(o),this.eventSvc.removeListener(e,o,s)}addGlobalListener(e){const t=this.wrapSvc?.wrapGlobal(e)??e,o=(e,o)=>{zc.has(e)&&t(e,o)},s=(e,o)=>{zc.has(e)||t(e,o)};this.globalListenerPairs.set(e,{syncListener:o,asyncListener:s});const i=this.eventSvc;i.addGlobalListener(o,!1),i.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:o,globalListenerPairs:s}=this,i=o?.unwrapGlobal(e)??e;if(s.has(i)){const{syncListener:o,asyncListener:n}=s.get(i);t.removeGlobalListener(o,!1),t.removeGlobalListener(n,!0),s.delete(e)}else this.syncGlobalListeners.delete(i),t.removeGlobalListener(i,!1)}destroyEventListeners(e,t){e.forEach((e,o)=>{e.forEach(e=>this.eventSvc.removeListener(o,e,t)),e.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const o of e)this.eventSvc.removeGlobalListener(o,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:e,asyncListener:o})=>{t.removeGlobalListener(e,!1),t.removeGlobalListener(o,!0)}),e.clear()}}]};function Kp(e,t){if("number"!=typeof e)return"";const o=t(),s=o("thousandSeparator",","),i=o("decimalSeparator",".");return e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${s}`)}var _p={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},qp={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},Yp={moduleName:"HighlightChanges",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:/* @__PURE__ */new Map,"data-changed":/* @__PURE__ */new Map}}animateCell(e,t,o=this.beans.gos.get("cellFlashDuration"),s=this.beans.gos.get("cellFadeDuration")){const i=this.animations[t];i.delete(e);const n=Date.now(),r=n+o,l={phase:"flash",flashEndTime:r,fadeEndTime:n+o+s};i.set(e,l);const a=`ag-cell-${t}`,d=`${a}-animation`,{comp:c,eGui:{style:h}}=e;c.toggleCss(a,!0),c.toggleCss(d,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+15{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),o)}),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const o of Object.keys(this.animations)){const s=this.animations[o],i=`ag-cell-${o}`,n=`${i}-animation`;for(const[o,r]of s){if(!o.isAlive()||!o.comp){s.delete(o);continue}const{phase:l,flashEndTime:a,fadeEndTime:d}=r,c="flash"===l?a:d;if(!(e+15>=c)){t=Math.min(c,t??1/0);continue}const{comp:h,eGui:{style:u}}=o;switch(l){case"flash":h.toggleCss(i,!1),h.toggleCss(n,!0),u.transition=`background-color ${d-a}ms`,u.transitionDelay=a-e+"ms",t=Math.min(d,t??1/0),r.phase="fade";break;case"fade":h.toggleCss(i,!1),h.toggleCss(n,!1),u.removeProperty("transition"),u.removeProperty("transition-delay"),s.delete(o)}}}null==t?(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 o=wn(e.cellPosition);t.cells[o]&&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()}}],userComponents:{agAnimateShowChangeCellRenderer:class extends Pi{constructor(){super(_p),this.eValue=null,this.eDelta=null,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const o=Math.abs(t),s=e.formatValue(o),i=l(s)?s:o,n=t>=0,r=this.eDelta;r.textContent=n?"↑"+i:"↓"+i,r.classList.toggle("ag-value-change-delta-up",n),r.classList.toggle("ag-value-change-delta-down",!n)}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"),se(this.eDelta)}refresh(e,t=!1){const{value:o,valueFormatted:s}=e,{eValue:i,lastValue:n,beans:r}=this;if(o===n)return!1;if(l(s)?i.textContent=s:l(o)?i.textContent=o:se(i),r.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;const a=o&&"object"==typeof o&&"toNumber"in o?o.toNumber():o,d=n&&"object"==typeof n&&"toNumber"in n?n.toNumber():n;if(a===d)return!1;if("number"==typeof a&&"number"==typeof d){const t=a-d;this.showDelta(e,t)}return n&&i.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=o,!0}},agAnimateSlideCellRenderer:class extends Pi{constructor(){super(qp),this.eCurrent=null,this.refreshCount=0,this.registerCSS(".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}")}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious?.remove();const{beans:t,eCurrent:o}=this,s=Cl({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=o.textContent,this.getGui().insertBefore(s,o),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 o=e.value;if(a(o)&&(o=""),o===this.lastValue)return!1;if(this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=o;const s=this.eCurrent;return l(e.valueFormatted)?s.textContent=e.valueFormatted:l(e.value)?s.textContent=o:se(s),!0}}},apiFunctions:{flashCells:function(e,t={}){const{cellFlashSvc:o}=e;o&&e.frameworkOverrides.wrapIncoming(()=>{for(const s of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))o.flashCell(s,t)})}}},Zp={tag:"div",cls:"ag-selection-checkbox",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},Qp=class extends Pi{constructor(){super(Zp,[za]),this.eCheckbox=null}postConstruct(){this.eCheckbox.setPassive(!0)}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.getLocaleTextFunc(),{rowNode:t,eCheckbox:o}=this,s=t.isSelected(),i=W(e,s),[n,r]=t.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],l=e(n,r);o.setValue(s,!0),o.setInputAriaLabel(`${l} (${i})`)}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getWrapperElement(),{dblclick:qi,click:e=>{qi(e),this.eCheckbox.isDisabled()||this.beans.selectionSvc?.handleSelectionEvent(e,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:e,previousValue:t})=>{("object"==typeof e?oo(e):void 0)!==("object"==typeof t?oo(t):void 0)&&this.onSelectableChanged()}),lo(this.gos)||"function"==typeof this.getIsVisible()){const e=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}showOrHideSelect(){const{column:e,rowNode:t,overrides:o,gos:s}=this,i=t.selectable,n=this.getIsVisible();let r;if("function"==typeof n){const s=o?.callbackParams;if(e){const o=e.createColumnFunctionCallbackParams(t);r=n({...s,...o})}else r=n({...s,node:t,data:t.data})}else r=n??!1;const l=i&&!r||!i&&r,a=i||r,d=s.get("rowSelection"),c=d&&"string"!=typeof d?!oo(d):!!e?.getColDef().showDisabledCheckboxes;this.setVisible(a&&(!l||c)),this.setDisplayed(a&&(!l||c)),a&&this.eCheckbox.setDisabled(l),o?.removeHidden&&this.setDisplayed(a)}getIsVisible(){const e=this.overrides;if(e)return e.isVisible;const t=this.gos.get("rowSelection");return t&&"string"!=typeof t?Jt(t):this.column?.getColDef()?.checkboxSelection}},Xp=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(0===this.cachedRange.length){const e=this.getRoot(),t=this.getEnd();if(null==e||null==t)return this.cachedRange;this.cachedRange=this.getNodesInRange(e,t)??[]}return this.cachedRange}isInRange(e){return null!==this.rootId&&this.getRange().some(t=>t.id===e.id)}getRoot(e){return this.rootId?this.getRowNode(this.rootId):e?(this.setRoot(e),e):void 0}getEnd(){if(this.endId)return this.getRowNode(this.endId)}getRowNode(e){let t;const{rowModel:o,pinnedRowModel:s}=this;return t??(t=o.getRowNode(e)),s?.isManual()&&(t??(t=s.getPinnedRowById(e,"top")),t??(t=s.getPinnedRowById(e,"bottom"))),t}truncate(e){const t=this.getRange();if(0===t.length)return{keep:[],discard:[]};const o=t[0].id===this.rootId,s=t.findIndex(t=>t.id===e.id);if(s>-1){const i=t.slice(0,s),n=t.slice(s+1);return this.setEndRange(e),o?{keep:i,discard:n}:{keep:n,discard:i}}return{keep:t,discard:[]}}extend(e,t=!1){const o=this.getRoot();if(null==o){const o=this.getRange().slice();return t&&e.depthFirstSearch(e=>!e.group&&o.push(e)),o.push(e),this.setRoot(e),{keep:o,discard:[]}}const s=this.getNodesInRange(o,e);if(!s)return this.setRoot(e),{keep:[e],discard:[]};if(s.find(e=>e.id===this.endId))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const t=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:t}}}getNodesInRange(e,t){const{pinnedRowModel:o,rowModel:s}=this;if(!o?.isManual())return s.getNodesInRangeForSelection(e,t);if("top"===e.rowPinned&&!t.rowPinned)return Oh(o,"top",e,void 0).concat(s.getNodesInRangeForSelection(s.getRow(0),t)??[]);if("bottom"===e.rowPinned&&!t.rowPinned){const i=Oh(o,"bottom",void 0,e),n=s.getRowCount(),r=s.getRow(n-1);return(s.getNodesInRangeForSelection(t,r)??[]).concat(i)}if(!e.rowPinned&&!t.rowPinned)return s.getNodesInRangeForSelection(e,t);if("top"===e.rowPinned&&"top"===t.rowPinned)return Oh(o,"top",e,t);if("bottom"===e.rowPinned&&"top"===t.rowPinned){const i=Oh(o,"top",t,void 0),n=Oh(o,"bottom",void 0,e),r=s.getRow(0),l=s.getRow(s.getRowCount()-1);return i.concat(s.getNodesInRangeForSelection(r,l)??[]).concat(n)}if(!e.rowPinned&&"top"===t.rowPinned)return Oh(o,"top",t,void 0).concat(s.getNodesInRangeForSelection(s.getRow(0),e)??[]);if("top"===e.rowPinned&&"bottom"===t.rowPinned){const i=Oh(o,"top",e,void 0),n=Oh(o,"bottom",void 0,t),r=s.getRow(0),l=s.getRow(s.getRowCount()-1);return i.concat(s.getNodesInRangeForSelection(r,l)??[]).concat(n)}if("bottom"===e.rowPinned&&"bottom"===t.rowPinned)return Oh(o,"bottom",e,t);if(!e.rowPinned&&"bottom"===t.rowPinned){const i=Oh(o,"bottom",void 0,t),n=s.getRow(s.getRowCount());return(s.getNodesInRangeForSelection(e,n)??[]).concat(i)}return null}},Jp=class extends Oe{constructor(e){super(),this.column=e,this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(w(this.beans))&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e;const t=this.createManagedBean(new Va);this.cbSelectAll=t,t.addCss("ag-header-select-all"),P(t.getGui(),"presentation"),this.showOrHideSelectAll();const o=this.updateStateOfCheckbox.bind(this);this.addManagedEventListeners({newColumnsLoaded:()=>this.showOrHideSelectAll(),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:o,paginationChanged:o,modelUpdated:o}),this.addManagedPropertyListener("rowSelection",({currentValue:e,previousValue:t})=>{const o=e=>"string"!=typeof e&&e&&"singleRow"!==e.mode?e.selectAll:void 0;o(e)!==o(t)&&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("uiColumnMoved"===e.source)}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,o=this.cbSelectAll,s=t.getSelectAllState(e);o.setValue(s);const i=t.hasNodesToSelect(e);o.setDisabled(!i),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(e=!1){const t=this.getLocaleTextFunc(),{headerCellCtrl:o,cbSelectAll:s,cbSelectAllVisible:i}=this,n=W(t,s.getValue()),r=t("ariaRowSelectAll","Press Space to toggle all rows selection");o.setAriaDescriptionProperty("selectAll",i?`${r} (${n})`:null),s.setInputAriaLabel(t("ariaHeaderSelection","Column with Header Selection")),e||o.announceAriaDescription()}checkSelectionType(e){return!!co(this.gos)||(Dt(128,{feature:e}),!1)}checkRightRowModelType(e){const{gos:t,rowModel:o}=this.beans;return!(!It(t)&&!At(t)&&(Dt(129,{feature:e,rowModel:o.getType()}),1))}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.getSelectAllMode();let o="uiSelectAll";"currentPage"===t?o="uiSelectAllCurrentPage":"filtered"===t&&(o="uiSelectAllFiltered");const s={source:o,selectAll:t},i=this.beans.selectionSvc;e?i.selectAllRowNodes(s):i.deselectAllRowNodes(s)}isCheckboxSelection(){const{column:e,gos:t,beans:o}=this,s="object"==typeof t.get("rowSelection")?"headerCheckbox":"headerCheckboxSelection";return em(o,e)&&this.checkRightRowModelType(s)&&this.checkSelectionType(s)}getSelectAllMode(){const e=uo(this.gos,!1);if(e)return e;const{headerCheckboxSelectionCurrentPageOnly:t,headerCheckboxSelectionFilteredOnly:o}=this.column.getColDef();return t?"currentPage":o?"filtered":"all"}destroy(){super.destroy(),this.cbSelectAll=void 0,this.headerCellCtrl=void 0}};function em({gos:e,selectionColSvc:t},o){const s=e.get("rowSelection"),i=o.getColDef(),{headerCheckboxSelection:n}=i;let r=!1;if("object"==typeof s){const e=ts(o),i=es(o);("autoGroupColumn"===to(s)&&i||e&&t?.isSelectionColumnEnabled())&&(r=eo(s))}else r="function"==typeof n?n(Co(e,{column:o,colDef:i})):!!n;return r}var tm=class extends Oe{postConstruct(){const{gos:e,beans:t}=this;this.selectionCtx=new Xp(t.rowModel,t.pinnedRowModel),this.addManagedPropertyListeners(["isRowSelectable","rowSelection"],()=>{const t=lo(e);t!==this.isRowSelectable&&(this.isRowSelectable=t,this.updateSelectable())}),this.isRowSelectable=lo(e),this.addManagedEventListeners({cellValueChanged:e=>this.updateRowSelectable(e.node),rowNodeDataChanged:e=>this.updateRowSelectable(e.node)})}destroy(){super.destroy(),this.selectionCtx.reset()}createCheckboxSelectionComponent(){return new Qp}createSelectAllFeature(e){if(em(this.beans,e))return new Jp(e)}isMultiSelect(){return co(this.gos)}onRowCtrlSelected(e,t,o){const s=!!e.rowNode.isSelected();e.forEachGui(o,e=>{e.rowComp.toggleCss("ag-row-selected",s);const o=e.element;V(o,s),o.contains(w(this.beans))&&t(e)})}announceAriaRowSelection(e){if(this.isRowSelectionBlocked(e))return;const t=e.isSelected(),o=this.beans.editSvc?.isEditing({rowNode:e});if(!e.selectable||o)return;const s=this.getLocaleTextFunc()(t?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${t?"deselect":"select"} this row`);this.beans.ariaAnnounce?.announceValue(s,"rowSelection")}isRowSelectionBlocked(e){return!e.selectable||e.rowPinned&&!Hh(e)||!Lt(this.gos)}updateRowSelectable(e,t){const o=e.rowPinned&&e.pinnedSibling?e.pinnedSibling.selectable:this.isRowSelectable?.(e)??!0;return this.setRowSelectable(e,o,t),o}setRowSelectable(e,t,o){if(e.selectable!==t){if(e.selectable=t,e.dispatchRowEvent("selectableChanged"),o)return;if(go(this.gos)){const t=this.calculateSelectedFromChildren(e);return void this.setNodesSelected({nodes:[e],newValue:t??!1,source:"selectableChanged"})}e.isSelected()&&!e.selectable&&this.setNodesSelected({nodes:[e],newValue:!1,source:"selectableChanged"})}}calculateSelectedFromChildren(e){let t=!1,o=!1;if(!e.childrenAfterGroup?.length)return e.selectable?e.__selected:null;for(let s=0;s0&&t>0?void 0:e>0)}function sm(e){const t=!1===e.isSelected(),o=e.childrenAfterFilter?.some(sm)??!1;return t||o}var im={moduleName:"SharedRowSelection",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,ls(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;null!=t&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),rs(e))}createColumns(e,t){const o=e.treeDepth,s=(this.columns?.treeDepth??-1)==o,i=this.generateSelectionCols();if(ns(i,this.columns?.list??[])&&s)return;(()=>{Jo(this.beans,this.columns?.tree),this.columns=null})();const{colGroupSvc:n}=this.beans,r=n?.findDepth(e.tree)??0;this.columns={list:i,tree:n?.balanceTreeForAutoCols(i,r)??[],treeDepth:r,map:{}},t(e=>{if(!e)return null;const t=e.filter(e=>!ts(e));return[...i,...t]})}updateColumns(e){const t=ls(e.source),{beans:o}=this;for(const s of this.columns?.list??[]){const i=this.createSelectionColDef(e.currentValue);s.setColDef(i,null,t),Aa(o,{state:[ds(i,s.colId)]},t)}}getColumn(e){return this.columns?.list.find(t=>as(t,e))??null}getColumns(){return this.columns?.list??null}isSelectionColumnEnabled(){const{gos:e,beans:t}=this,o=e.get("rowSelection");if("object"!=typeof o||!Lt(e))return!1;const s=(t.autoColSvc?.getColumns()?.length??0)>0;if("autoGroupColumn"===o.checkboxLocation&&s)return!1;const i=!!Jt(o),n=eo(o);return i||n}createSelectionColDef(e){const{gos:t}=this,o=e??t.get("selectionColumnDef"),s=t.get("enableRtl"),{rowSpan:i,spanRows:n,...r}=o??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:s?"right":"left",comparator(e,t,o,s){const i=o.isSelected();return i===s.isSelected()?0:i?1:-1},editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,pinned:null,...r,colId:"ag-Grid-SelectionColumn",chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const o=new Fo(e,null,t,!1);return this.createBean(o),[o]}onSelectionOptionsChanged(e,t,o){const s=(t&&"string"!=typeof t?Jt(t):void 0)!==(e&&"string"!=typeof e?Jt(e):void 0),i=(t&&"string"!=typeof t?eo(t):void 0)!==(e&&"string"!=typeof e?eo(e):void 0),n=to(e)!==to(t);(s||i||n)&&this.beans.colModel.refreshAll(o)}destroy(){Jo(this.beans,this.columns?.tree),super.destroy()}refreshVisibility(e,t,o){if(!this.columns?.list.length)return;const i=e.length+t.length+o.length;if(0===i)return;const n=this.columns.list[0];n.isVisible()&&(this.beans.rowNumbersSvc?.getColumn("ag-Grid-RowNumbersColumn")?2:1)===i&&(()=>{let i;switch(n.pinned){case"left":case!0:i=e;break;case"right":i=o;break;default:i=t}i&&s(i,n)})()}}],css:[':where(.ag-selection-checkbox) .ag-checkbox-input-wrapper:before{content:"";cursor:pointer;inset:-8px;position:absolute}'],apiFunctions:{setNodesSelected:function(e,t){if(!t.nodes.every(e=>e.rowPinned&&!Hh(e)?(Dt(59),!1):void 0!==e.id||(Dt(60),!1)))return;const{nodes:o,source:s,newValue:i}=t;e.selectionSvc?.setNodesSelected({nodes:o,source:s??"api",newValue:i})},selectAll:function(e,t,o="apiSelectAll"){e.selectionSvc?.selectAllRowNodes({source:o,selectAll:t})},deselectAll:function(e,t,o="apiSelectAll"){e.selectionSvc?.deselectAllRowNodes({source:o,selectAll:t})},selectAllFiltered:function(e,t="apiSelectAllFiltered"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"filtered"})},deselectAllFiltered:function(e,t="apiSelectAllFiltered"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"filtered"})},selectAllOnCurrentPage:function(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"currentPage"})},deselectAllOnCurrentPage:function(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"currentPage"})},getSelectedNodes:function(e){return e.selectionSvc?.getSelectedNodes()??[]},getSelectedRows:function(e){return e.selectionSvc?.getSelectedRows()??[]}}},nm={moduleName:"RowSelection",version:mt,rowModels:["clientSide","infinite","viewport"],beans:[class extends tm{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=/* @__PURE__ */new Map,this.detailSelection=/* @__PURE__ */new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=ao(e),this.groupSelectsDescendants=go(e),this.groupSelectsFiltered="filteredDescendants"===ho(e),this.masterSelectsDetail="detail"===po(e),this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=go(e),o=ao(e),s="filteredDescendants"===ho(e);this.masterSelectsDetail="detail"===po(e),t===this.groupSelectsDescendants&&s===this.groupSelectsFiltered&&o===this.mode||(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=s,this.mode=o)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,o){if(this.isRowSelectionBlocked(t))return 0;const s=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,o);if(null==s)return 0;if(this.selectionCtx.selectAll=!1,"select"in s)return s.reset?this.resetNodes():this.selectRange(s.deselect,!1,o),this.selectRange(s.select,!0,o);{const t=s.checkFilteredNodes?sm(s.node):s.newValue;return this.setNodesSelected({nodes:[s.node],newValue:t,clearSelection:s.clearSelection,keepDescendants:s.keepDescendants,event:e,source:o})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:o,nodes:s,event:i,source:n,keepDescendants:r=!1}){if(0===s.length)return 0;const{gos:l}=this;if(!Lt(l)&&e)return Dt(132),0;if(s.length>1&&!this.isMultiSelect())return Dt(130),0;let a=0;for(let d=0;d0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n))),a}selectRange(e,t,o){let s=0;return e.forEach(e=>{const i=e.primaryRow;i.group&&this.groupSelectsDescendants||this.selectRowNode(i,t,void 0,o)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(o),this.dispatchSelectionChanged(o)),s}selectChildren(e,t,o){const s=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return s?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:o,nodes:s}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=/* @__PURE__ */new Map;this.selectedNodes.forEach((o,s)=>{e(o)&&t.set(s,o)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:o,rowModel:s}=this.beans;if(!It(o))return!1;const i=s.rootNode;if(!i)return!1;let n=!1;return eg(i,this.beans.rowModel.hierarchical,t,t=>{if(t!==i){const o=this.calculateSelectedFromChildren(t);n=this.selectRowNode(t,null!==o&&o,void 0,e)||n}}),n}clearOtherNodes(e,t,o){const s=/* @__PURE__ */new Map;let i=0;return this.selectedNodes.forEach(n=>{const r=n.id==e.id;if(!(t&&function(e,t){let o=t.parent;for(;o;){if(o===e)return!0;o=o.parent}return!1}(e,n)||r)){const e=this.selectedNodes.get(n.id);i+=this.setNodesSelected({nodes:[e],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:o}),this.groupSelectsDescendants&&n.parent&&s.set(n.parent.id,n.parent)}}),s.forEach(e=>{const t=this.calculateSelectedFromChildren(e);this.selectRowNode(e,null!==t&&t,void 0,o)}),i}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 ln(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(!It(e))return;const o=t.getTopLevelNodes();if(null===o)return;const s=[];return function e(t){for(let o=0,i=t.length;o{const o=this.selectRowNode(t.primaryRow,!1,void 0,e);s||(s=o)};if("currentPage"===t||"filtered"===t){if(!o)return void Mt(102);this.getNodesToSelect(t).forEach(i)}else this.selectedNodes.forEach(i),this.reset(e);if(this.selectionCtx.selectAll=!1,o&&this.groupSelectsDescendants){const t=this.updateGroupsFromChildrenSelections(e);s||(s=t)}s&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,o=0;return this.getNodesToSelect(e).forEach(e=>{this.groupSelectsDescendants&&e.group||(e.isSelected()?t++:e.selectable&&o++)}),{selectedCount:t,notSelectedCount:o}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:o}=this.getSelectedCounts(e);return om(t,o)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(e=>e.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],o=e=>t.push(e);if("currentPage"===e)return this.forEachNodeOnPage(e=>{if(e.group){if(!e.footer&&!e.expanded){const t=e=>{o(e);const s=e.childrenAfterFilter;if(s)for(let o=0,i=s.length;o{const t=this.selectRowNode(e.primaryRow,!0,void 0,s);n||(n=t)}),o.selectAll=!0,It(t)&&this.groupSelectsDescendants){const e=this.updateGroupsFromChildrenSelections(s);n||(n=e)}n&&this.dispatchSelectionChanged(s)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,o){if(e||(e=[]),!Array.isArray(e))return void Mt(103);const s=new Set(e),i=[];this.beans.rowModel.forEachNode(e=>{s.has(e.id)&&i.push(e)}),o&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:i,source:t})}canSelectAll(){return It(this.beans.gos)}updateSelectable(e){const{gos:t,rowModel:o}=this.beans;if(!Lt(t))return;const s="selectableChanged",i=It(t)&&this.groupSelectsDescendants,n=[];if(i){const t=o.rootNode;t&&eg(t,o.hierarchical,e,e=>{let t=!1;for(const o of e.childrenAfterGroup)t||(t=o.selectable),o.group||this.updateRowSelectable(o,!0)||!o.isSelected()||n.push(o);this.setRowSelectable(e,t,!0)})}else o.forEachNode(e=>{!this.updateRowSelectable(e,!0)&&e.isSelected()&&n.push(e)});n.length&&this.setNodesSelected({nodes:n,newValue:!1,source:s}),!e&&i&&this.updateGroupsFromChildrenSelections?.(s)}updateSelectableAfterGrouping(e){this.updateSelectable(e),this.groupSelectsDescendants&&this.updateGroupsFromChildrenSelections?.("rowGroupChanged",e)&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){if(!this.masterSelectsDetail)return;const o=e.detailNode?.detailGridInfo?.api;if(!o)return;const s=function(e){let t=0,o=0;return e.forEachNode(e=>{e.isSelected()?t++:e.selectable&&o++}),om(t,o)}(o);e.isSelected()!==s&&this.selectRowNode(e,s,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),s||this.detailSelection.set(e.id,new Set(o.getSelectedNodes().map(e=>e.id)))}setDetailSelectionState(e,t,o){if(this.masterSelectsDetail)if(co(t))switch(e.isSelected()){case!0:o.selectAll();break;case!1:o.deselectAll();break;case void 0:{const t=this.detailSelection.get(e.id);if(t){const e=[];for(const s of t){const t=o.getRowNode(s);t&&e.push(t)}o.setNodesSelected({nodes:e,newValue:!0,source:"masterDetail"})}break}}else Dt(269)}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}}],dependsOn:[im]},rm=class extends Oe{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,o=e.colDef,s=o.cellClassRules,i=this.getCellClassParams(e,o);jh(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,i,e=>t.toggleCss(e,!0),e=>t.toggleCss(e,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,o=t.cellStyle;if(!o)return;let s;s="function"==typeof o?o(this.getCellClassParams(e,t)):o,s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,o=e.colDef,s=this.getCellClassParams(e,o);for(const n of this.staticClasses)t.toggleCss(n,!1);const i=this.beans.cellStyles.getStaticCellClasses(o,s);this.staticClasses=i;for(const n of i)t.toggleCss(n,!0)}getCellClassParams(e,t){const{value:o,rowNode:s}=this.cellCtrl;return Co(this.beans.gos,{value:o,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},lm={moduleName:"CellStyle",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,o,s){jh(this.beans.expressionSvc,void 0,e.cellClassRules,t,o,s),this.processStaticCellClasses(e,t,o)}getStaticCellClasses(e,t){const{cellClass:o}=e;if(!o)return[];let s;return s="function"==typeof o?o(t):o,"string"==typeof s&&(s=[s]),s||[]}createCellCustomStyleFeature(e){return new rm(e,this.beans)}processStaticCellClasses(e,t,o){this.getStaticCellClasses(e,t).forEach(e=>{o(e)})}}]},am={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},dm="clientSide",cm="serverSide",hm="infinite",um={onGroupExpandedOrCollapsed:[dm],refreshClientSideRowModel:[dm],isRowDataEmpty:[dm],forEachLeafNode:[dm],forEachNodeAfterFilter:[dm],forEachNodeAfterFilterAndSort:[dm],resetRowHeights:[dm,cm],applyTransaction:[dm],applyTransactionAsync:[dm],flushAsyncTransactions:[dm],getBestCostNodeSelection:[dm],getServerSideSelectionState:[cm],setServerSideSelectionState:[cm],applyServerSideTransaction:[cm],applyServerSideTransactionAsync:[cm],applyServerSideRowData:[cm],retryServerSideLoads:[cm],flushServerSideAsyncTransactions:[cm],refreshServerSide:[cm],getServerSideGroupLevelState:[cm],refreshInfiniteCache:[hm],purgeInfiniteCache:[hm],getInfiniteRowCount:[hm],isLastRowIndexKnown:[hm,cm],expandAll:[dm,cm],collapseAll:[dm,cm],onRowHeightChanged:[dm,cm],setRowCount:[hm,cm],getCacheBlockState:[hm,cm]},gm={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")'}},pm={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"},mm={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},fm={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"},Cm=/* @__PURE__ */new Set(["colorPicker","smallUp","checkboxChecked","checkboxIndeterminate","checkboxUnchecked","radioButtonOn","radioButtonOff","smallDown","smallLeft","smallRight"]),vm=/* @__PURE__ */new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),wm={moduleName:"Validation",version:mt,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="validation"}wireBeans(e){this.gridOptions=e.gridOptions,Ct=$u}warnOnInitialPropertyUpdate(e,t){"api"===e&&am[t]&&Dt(22,{key:t})}processGridOptions(e){this.processOptions(e,{objectName:"gridOptions",allProperties:[...Yc,...qc,..._c,...Zc,...eh,...Jc,...Xc,...Qc,...Object.values(Wc)],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:{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."}},validations:sh()})}validateApiFunction(e,t){return function(e,t,o){const s=gm[e];if(s){const{version:o,new:i,old:n,message:r}=s,l=n??e;return(...e)=>(ot(`Since ${o} api.${l} is deprecated. ${i?`Please use ${i} instead. `:""}${r??""}`),t.apply(t,e))}const i=um[e];return i?(...s)=>{const n=o.rowModel.getType();if(i.includes(n))return t.apply(t,s);st(`api.${e} can only be called when gridOptions.rowModelType is ${i.join(" or ")}`)}:t}(e,t,this.beans)}missingUserComponent(e,t,o,s){const i=Uc[t];i?this.gos.assertModuleRegistered(i,`AG Grid '${e}' component: ${t}`):Dt(101,{propertyName:e,componentName:t,agGridDefaults:o,jsComps:s})}missingDynamicBean(e){const t=pm[e];return t?Et(200,{...this.gos.getModuleErrorParams(),moduleName:t,reasonOrId:e}):void 0}checkRowEvents(e){vm.has(e)&&Dt(10,{eventType:e})}validateIcon(e){if(Cm.has(e)&&Dt(43,{iconName:e}),mm[e])return;const t=fm[e];t?Mt(200,{reasonOrId:`icon '${e}'`,moduleName:t,gridScoped:ut(),gridId:this.beans.context.getId(),rowModelType:this.gos.get("rowModelType"),additionalText:"Alternatively, use the CSS icon name directly."}):Dt(134,{iconName:e})}isProvidedUserComp(e){return!!Uc[e]}validateColDef(e){this.processOptions(e,{objectName:"colDef",allProperties:Object.keys(Kc),docsUrl:"column-properties/",deprecations:{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."}},validations:{autoHeight:{supportedRowModels:["clientSide","serverSide"],validate:(e,{paginationAutoPageSize:t})=>t?"colDef.autoHeight is not supported with paginationAutoPageSize.":null},allowFormula:{supportedRowModels:["clientSide"]},cellRendererParams:{validate:e=>null==e.rowGroup&&null==e.rowGroupIndex&&"agGroupCellRenderer"!==e.cellRenderer||!("checkbox"in e.cellRendererParams)?null:'Since v33.0, `cellRendererParams.checkbox` has been deprecated. Use `rowSelection.checkboxLocation = "autoGroupColumn"` instead.'},flex:{validate:(e,t)=>t.autoSizeStrategy?"colDef.flex is not supported with gridOptions.autoSizeStrategy":null},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],validate:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],validate:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],validate:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerValueGetter:{validate:e=>{const t=e.headerValueGetter;return"function"==typeof t||"string"==typeof t?null:"headerValueGetter must be a function or a valid string expression"}},icons:{validate:({icons:e})=>{if(e){if(e.smallDown)return Et(262);if(e.smallLeft)return Et(263);if(e.smallRight)return Et(264)}return null}},sort:{validate:e=>Eo(e.sort)||Mo(e.sort)?null:`sort must be of type (SortDirection | SortDef), currently it is ${"object"==typeof e.sort?JSON.stringify(e.sort):St(e.sort)}`},initialSort:{validate:e=>Eo(e.initialSort)||Mo(e.initialSort)?null:`initialSort must be of non-null type (SortDirection | SortDef), currently it is ${"object"==typeof e.initialSort?JSON.stringify(e.initialSort):St(e.initialSort)}`},sortingOrder:{validate:e=>{const t=e.sortingOrder;if(Array.isArray(t)&&t.length>0){const e=t.filter(e=>!(Eo(e)||Mo(e)));if(e.length>0)return`sortingOrder must be an array of type non-null (SortDirection | SortDef)[], incorrect items are: [${e.map(e=>"string"==typeof e||null==e?St(e):JSON.stringify(e)).join(", ")}]`}else if(!Array.isArray(t)||!t.length)return`sortingOrder must be an array with at least one element, currently it is [${t}]`;return null}},type:{validate:e=>{const t=e.type;return t instanceof Array?t.some(e=>"string"!=typeof e)?"if colDef.type is supplied an array it should be of type 'string[]'":null:"string"==typeof t?null:"colDef.type should be of type 'string' | 'string[]'"}},rowSpan:{validate:(e,{suppressRowTransform:t})=>t?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:(e,{rowSelection:t,cellSelection:o,suppressRowTransform:s,enableCellSpan:i,rowDragEntireRow:n,enableCellTextSelection:r})=>"object"==typeof t&&"singleRow"===t?.mode&&t?.enableClickSelection?"colDef.spanRows is not supported with rowSelection.clickSelection":o?"colDef.spanRows is not supported with cellSelection.":s?"colDef.spanRows is not supported with suppressRowTransform.":i?n?"colDef.spanRows is not supported with rowDragEntireRow.":r?"colDef.spanRows is not supported with enableCellTextSelection.":null:"colDef.spanRows requires enableCellSpan to be enabled."},groupHierarchy:{validate(e,{groupHierarchyConfig:t={}},o){const s=/* @__PURE__ */new Set(["year","quarter","month","formattedMonth","day","hour","minute","second"]),i=[];for(const n of e.groupHierarchy??[])"object"!=typeof n?s.has(n)||n in t||i.push($c(n)):o.validation?.validateColDef(n);return i.length>0?`The following parts of colDef.groupHierarchy are not recognised: ${i.join(", ")}.\nChoose one of ${[...s].map($c).join(", ")}, or define your own parts in gridOptions.groupHierarchyConfig.`:null}}}})}processOptions(e,t){const{validations:o,deprecations:s,allProperties:i,propertyExceptions:n,objectName:r,docsUrl:l}=t;i&&!0!==this.gridOptions.suppressPropertyNamesCheck&&this.checkProperties(e,[...n??[],...Object.keys(s)],i,r,l);const a=/* @__PURE__ */new Set;if(Object.keys(e).forEach(t=>{const i=s[t];if(i){const{message:e,version:o}=i;a.add(`As of v${o}, ${String(t)} is deprecated. ${e??""}`)}const n=e[t];if(null==n||!1===n)return;const r=o[t];if(!r)return;const{dependencies:l,validate:d,supportedRowModels:c,expectedType:h}=r;if(h){const e=typeof n;if(e!==h)return void a.add(`${String(t)} should be of type '${h}' but received '${e}' (${n}).`)}if(c){const e=this.gridOptions.rowModelType??"clientSide";if(!c.includes(e))return void a.add(`${String(t)} is not supported with the '${e}' row model. It is only valid with: ${c.join(", ")}.`)}if(l){const o=this.checkForRequiredDependencies(t,l,e);if(o)return void a.add(o)}if(d){const t=d(e,this.gridOptions,this.beans);if(t)return void a.add(t)}}),a.size>0)for(const d of a)ot(d)}checkForRequiredDependencies(e,t,o){const s=Object.entries(t).filter(([e,t])=>{const s=o[e];return!t.required.includes(s)});return 0===s.length?null:s.map(([t,o])=>`'${String(e)}' requires '${t}' to be one of [${o.required.map(e=>null===e?"null":void 0===e?"undefined":e).join(", ")}]. ${o.reason??""}`).join("\n ")}checkProperties(e,t,o,s,i){const n=function(e,t,o){const s={},i=e.filter(e=>!t.some(t=>t===e));if(i.length>0)for(const n of i)s[n]=ku({inputValue:n,allSuggestions:o}).values;return s}(Object.getOwnPropertyNames(e),["__ob__","__v_skip","__metadata__",...t,...o],o),r=Object.keys(n);for(const l of r){let e=`invalid ${s} property '${l}' did you mean any of these: ${n[l].slice(0,8).join(", ")}.`;o.includes("context")&&(e+=`\nIf you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),ot(e)}r.length>0&&i&&ot(`to see all the valid ${s} properties please check: ${this.beans.frameworkOverrides.getDocLink(i)}`)}}]},bm=class extends Oe{constructor(){super(...arguments),this.dispatchColumnChangedEvent=ya,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((o,s)=>t?.compareVirtualColumns(o,s)??e(o,s)),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,o,s,i,n,r){const l=this.colModel.getCols();if(!l||0===l.length)return;const a=/* @__PURE__ */new Map;t.forEach((e,t)=>a.set(e,t)),t.length=0;for(const c of e){const e=this.colModel.getColDefCol(c);e&&t.push(e)}t.forEach((e,t)=>{const o=a.get(e);void 0!==o?s&&o!==t||a.delete(e):a.set(e,0)}),this.updateIndexMap();const d=this.colModel.getColDefCols();for(const c of d??[])n(c,t.indexOf(c)>=0,r);i&&this.colModel.refreshCols(!1,r),this.visibleCols.refresh(r),this.dispatchColumnChangedEvent(this.eventSvc,o,[...a.keys()],r)}updateColList(e=[],t,o,i,n,r,l){if(!e||0===e.length)return;let a=!1;const d=/* @__PURE__ */new Set;for(const h of e){if(!h)continue;const e=this.colModel.getColDefCol(h);if(e){if(d.add(e),o){if(t.indexOf(e)>=0)continue;t.push(e)}else{const o=t.indexOf(e);if(o<0)continue;for(let e=o+1;e=0:e?void 0!==h?h:!(void 0===g)&&null!=g&&g>=0:o.indexOf(m)>=0,p&&((e?null!=u||null!=g:null!=u)?s.push(m):i.push(m))}const h=e=>{const t=e.getColDef();return r(t)??l(t)};s.sort((e,t)=>h(e)-h(t));const u=[],g=this.groupHierarchCols,p=e=>{g?g.expandColumnInto(u,e):u.push(e)};s.forEach(p);for(const m of o)i.indexOf(m)>=0&&p(m);for(const m of i)u.indexOf(m)<0&&p(m);for(const m of o)u.indexOf(m)<0&&n(m,!1,e);for(const m of u)o.indexOf(m)<0&&n(m,!0,e);return this.columns=u,this.updateIndexMap(),this.columns}restoreColumnOrder(e,t){const o=this.columns,s=this.colModel.getColDefCols();if(!o.length||!s)return e;const i=Object.keys(t),n=new Set(i),r=new Set(i),l=new Set(o.map(e=>{const t=e.getColId();return r.delete(t),t}).concat(i)),a=[],d={};let c=0;for(let w=0;w{const o=d[e];for(let s=g;s>>32-i,o)}ff(e,t,o,s,i,n,r){return this.cmn(t&o|~t&s,e,t,i,n,r)}gg(e,t,o,s,i,n,r){return this.cmn(t&s|o&~s,e,t,i,n,r)}hh(e,t,o,s,i,n,r){return this.cmn(t^o^s,e,t,i,n,r)}ii(e,t,o,s,i,n,r){return this.cmn(o^(t|~s),e,t,i,n,r)}md51(e){const t=e.length,o=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=e.length;s+=64)this.md5cycle(o,this.md5blk(e.substring(s-64,s)));e=e.substring(s-64);const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s>2]|=e.charCodeAt(s)<<(s%4<<3);if(i[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(o,i),s=0;s<16;s++)i[s]=0;return i[14]=8*t,this.md5cycle(o,i),o}md5blk(e){const t=[];for(let o=0;o<64;o+=4)t[o>>2]=e.charCodeAt(o)+(e.charCodeAt(o+1)<<8)+(e.charCodeAt(o+2)<<16)+(e.charCodeAt(o+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let o="",s=0;for(;s<4;s++)o+=t[e>>8*s+4&15]+t[e>>8*s&15];return o}hex(e){for(let t=0;t>16)+(t>>16)+(o>>16)<<16|65535&o}},xm={"01":"GRID","02":"CHARTS","0102":"BOTH"},Fm=class e{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new Rm,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(e.licenseKey),o=`AG Grid ${"BOTH"===t.currentLicenseType?"and AG Charts ":""}Enterprise`,s=void 0===t.suppliedLicenseType?"":`AG ${"BOTH"===t.suppliedLicenseType?"Grid and AG Charts":"GRID"===t.suppliedLicenseType?"Grid":"Charts"} Enterprise`;if(t.missing)this.isWebsiteUrl()&&!this.isForceWatermark()||this.outputMissingLicenseKey(o);else if(t.expired){const i=e.getGridReleaseDate(),n=e.formatDate(i);this.outputExpiredKey(t.expiry,n,o,s)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,o,s):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,o,s)}static extractExpiry(t){const o=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(e.decode(o),10))}static extractLicenseComponents(t){let o=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(o=o.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const s=o.length-32,i=o.substring(s),n=o.substring(0,s),[r,l,a]=e.extractBracketedInformation(o);return{md5:i,license:n,version:r,isTrial:l,type:a}}getLicenseDetails(t){const o=e.chartsLicenseManager?"BOTH":"GRID";if(!t?.length)return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:o};const s=e.getGridReleaseDate(),{md5:i,license:n,version:r,isTrial:l,type:a}=e.extractLicenseComponents(t);let d,c,h,u=i===this.md5.md5(n)&&!t.includes("For_Trialing_ag-Grid_Only"),g=null,p=!1;function m(){d=gg,r){case"legacy":case"2":l&&m();break;case"3":a?.length?(h=a,a!==xm["01"]&&a!==xm["0102"]||"BOTH"===o&&"BOTH"!==h?(u=!1,p=!0):l&&m()):u=!1}return u?{licenseKey:t,valid:u,expiry:e.formatDate(g),expired:c,version:r,isTrial:l,trialExpired:d,incorrectLicenseType:p,currentLicenseType:o,suppliedLicenseType:h}:{licenseKey:t,valid:u,incorrectLicenseType:p,currentLicenseType:o,suppliedLicenseType:h}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!!this.watermarkMessage?.length}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){const{hostname:e=""}=(this.document.defaultView||window).location;return e}isForceWatermark(){const{pathname:e}=(this.document.defaultView||window).location;return!!e&&e.includes("forceWatermark")}isWebsiteUrl(){return null!==this.getHostname().match(/^(?:[\w-]+\.)?(ag-grid|bryntum)\.com$/)}isLocalhost(){return null!==this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)}static formatDate(e){const t=e.getDate(),o=e.getMonth(),s=e.getFullYear();return t+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][o]+" "+s}static getGridReleaseDate(){return new Date(parseInt(e.decode(e.RELEASE_INFORMATION),10))}static decode(t){const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s,i,n,r,l,a,d,c="",h=0;const u=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;h>4,i=(15&l)<<4|a>>2,n=(3&a)<<6|d,c+=String.fromCharCode(s),64!=a&&(c+=String.fromCharCode(i)),64!=d&&(c+=String.fromCharCode(n));return c=e.utf8_decode(c),c}static utf8_decode(e){e=e.replace(/rn/g,"n");let t="";for(let o=0;o127&&s<2048?(t+=String.fromCharCode(s>>6|192),t+=String.fromCharCode(63&s|128)):(t+=String.fromCharCode(s>>12|224),t+=String.fromCharCode(s>>6&63|128),t+=String.fromCharCode(63&s|128))}return t}static setChartsLicenseManager(e){this.chartsLicenseManager=e,this.chartsLicenseManager?.setLicenseKey(this.licenseKey,!0)}static setLicenseKey(e){l(this.licenseKey)&&this.licenseKey!==e&&bt(ot,291,void 0,!0,"AG Grid: License Key being set multiple times with different values. This can result in an incorrect license key being used."),this.licenseKey=e,this.chartsLicenseManager?.setLicenseKey(e,!0)}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const t=e.match(/\[(.*?)\]/g).map(e=>e.replace("[","").replace("]",""));if(!t||0===t.length)return["legacy",!1,void 0];const o=1===t.filter(e=>"TRIAL"===e).length,s=t.filter(e=>0===e.indexOf("v"))[0];return[s?s.replace("v",""):"legacy",o,xm[t.filter(e=>xm[e])[0]]]}centerPadAndOutput(e){this.totalMessageLength,e.length}padAndOutput(e,t="*",o=""){}outputInvalidLicenseKey(e,t,o){}outputExpiredTrialKey(e,t,o){}outputMissingLicenseKey(e){}outputExpiredKey(e,t,o,s){}};Fm.RELEASE_INFORMATION="MTc3NDQyNTc0Nzc3NQ==";var Dm=Fm,Mm={tag:"div",cls:"ag-watermark",children:[{tag:"div",ref:"eLicenseTextRef",cls:"ag-watermark-text"}]},Pm={selector:"AG-WATERMARK",component:class extends Pi{constructor(){super(Mm),this.eLicenseTextRef=null,this.registerCSS('.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}')}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()}}},Em=class extends Oe{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 Dm(b(e));this.licenseManager=t,t.validateLicense()}}static getLicenseDetails(e){return new Dm(null).getLicenseDetails(e)}getWatermarkSelector(){return Pm}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){Dm.setLicenseKey(e)}static setChartsLicenseManager(e){Dm.setChartsLicenseManager(e)}},Tm={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},Im="\r\n";function Am(e,t,o){if(!t&&""!==t&&0!==t)return"";let s=t;return"boolean"==typeof t&&o&&(s=o(t)),` ${e}="${s}"`}function km(e,t){let o="";if(e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(e=>{for(const s of Object.keys(e.map))o+=Am(e.prefix+s,e.map[s],t)}),e.properties.rawMap))for(const i of Object.keys(e.properties.rawMap))o+=Am(i,e.properties.rawMap[i],t);let s="<"+e.name+o;if(!e.children&&null==e.textNode)return s+"/>"+Im;if(null!=e.textNode)return s+">"+e.textNode+""+Im;if(s+=">\r\n",e.children)for(const i of e.children)s+=km(i,t);return s+""+Im}var Lm,Gm,Nm,Bm,Hm,Om,Vm,zm,Wm,Um=e=>Math.round(96*e/72),$m=e=>Math.ceil(9525*e),jm=(e,t)=>{if(!t)return;let o;return o="number"==typeof t?t:t({rowIndex:e}),o},Km=(e,t)=>{const o=function(e={}){const t=["version"];return e.version||(e.version="1.0"),e.encoding&&t.push("encoding"),e.standalone&&t.push("standalone"),``${t}="${e[t]}"`).join(" ")} ?>`}({encoding:"UTF-8",standalone:"yes"}),s=km(e);return t?s:`${o}${s}`},_m=e=>{const t=String.fromCharCode,o=Math.floor(e/26),s=e%26;return o&&26!==e?s?o<26?t(65+o-1)+t(65+s-1):_m(o)+t(65+s-1):_m(o-1)+"Z":t(65+e-1)},qm=e=>e.replaceAll("\n","_x000a_"),Ym=e=>{if(null==e)return null;let t="";for(let o=0;o=0&&s<=31&&10!==s?`_x${s.toString(16).toUpperCase().padStart(4,"0")}_`:e[o]}return t},Zm=e=>{const t=[];for(const o of e.keys()){const e=o.toString(),s={name:"t",textNode:f(Ym(e))};e.trim().length!==e.length&&(s.properties={rawMap:{"xml:space":"preserve"}}),t.push({name:"si",children:[s]})}return t},Qm=class extends Sg{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 o of this.config.baseExcelStyles)this.stylesByIds[o.id]=o;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 e=this.rows.length+1;let o;this.config.suppressRowOutline||null==t.outlineLevel||(o=t.outlineLevel);const s={height:jm(e,t.height||this.config.rowHeight),cells:(t.cells||[]).map((t,o)=>{const s=this.addImage(e,this.columnsToExport[o],t.data?.value);let i=null;t.styleId&&(i="string"==typeof t.styleId?[t.styleId]:t.styleId);const n=this.getStyleId(i);if(s)return this.createCell(n,this.getDataTypeForValue(s.value),null==s.value?"":s.value);const r=t.data?.value??"",l=this.getDataTypeForValue(r);return t.mergeAcross?this.createMergedCell(n,l,r,t.mergeAcross):this.createCell(n,l,r)}),outlineLevel:o};null!=t.collapsed&&(s.collapsed=t.collapsed),null!=t.hidden&&(s.hidden=t.hidden),this.rows.push(s)}}onNewHeaderGroupingRow(){const e=[],{freezeRows:t,headerRowHeight:o}=this.config;return this.rows.push({cells:e,height:jm(this.rows.length+1,o)}),t&&this.frozenRowCount++,{onColumn:(t,o,s,i,n)=>{const r=this.config.styleLinker({rowType:"HEADER_GROUPING",rowIndex:1,value:`grouping-${o}`,columnGroup:t});e.push({...this.createMergedCell(this.getStyleId(r),this.getDataTypeForValue("string"),o,i),collapsibleRanges:n})}}}onNewHeaderRow(){const{freezeRows:e,headerRowHeight:t}=this.config;return e&&this.frozenRowCount++,this.onNewRow(this.onNewHeaderColumn,t)}onNewBodyRow(e){const{freezeRows:t,rowHeight:o}=this.config;this.skipFrozenRows||("headersAndPinnedRows"===t&&"top"===e?.rowPinned||"function"==typeof t&&t(Co(this.gos,{node:e}))?this.frozenRowCount++:this.skipFrozenRows=!0);const s=this.onNewRow(this.onNewBodyColumn,o);return e&&this.addRowOutlineIfNecessary(e),s}prepare(e){super.prepare(e),this.columnsToExport=[...e],this.cols=e.map((e,t)=>this.convertColumnToExcel(e,t))}parse(){const e=this.rows.reduce((e,t)=>Math.max(e,t.cells.length),0);for(;this.cols.length{const s=this.extractHeaderValue(o),i=this.config.styleLinker({rowType:"HEADER",rowIndex:e,value:s,column:o});t.push(this.createCell(this.getStyleId(i),this.getDataTypeForValue("string"),s))}}onNewBodyColumn(e,t){let o=0;const{freezeColumns:s,rightToLeft:i}=this.config;return(n,r,l)=>{if(o>0)return void(o-=1);if(!this.skipFrozenColumns){const e=n.getPinned();"pinned"===s&&e&&(!0===e||"left"===e)!==i||"function"==typeof s&&s(Co(this.gos,{column:n}))?this.frozenColumnCount++:this.skipFrozenColumns=!0}const{value:a,valueFormatted:d}=this.extractRowCellValue({column:n,node:l,currentColumnIndex:r,accumulatedRowIndex:e,type:"excel",useRawFormula:!0}),c=a,h="bigint"==typeof c?c.toString():c,u=this.config.styleLinker({rowType:"BODY",rowIndex:e,value:c,column:n,node:l}),g=this.getStyleId(u),p=n.getColSpan(l),m=this.addImage(e,n,h);if(m)t.push(this.createCell(g,this.getDataTypeForValue(m.value),null==m.value?"":m.value));else if(p>1)o=p-1,t.push(this.createMergedCell(g,this.getDataTypeForValue(c),h,p-1));else{const o=n.isAllowFormula()&&this.formulaSvc?.isFormula(h),s=this.createCell(g,o?"f":this.getDataTypeForValue(c),o?this.formulaSvc?.updateFormulaByOffset({value:h,rowDelta:e-(l.formulaRowIndex+1),useRefFormat:!1}):h,d);t.push(s)}}}onNewRow(e,t){const o=[];return this.rows.push({cells:o,height:jm(this.rows.length+1,t)}),{onColumn:e.bind(this,this.rows.length,o)()}}addWorksheetToWorkbook(e){const{excelStyles:t,config:o}=this;return this.mapSharedStrings(e),this.frozenColumnCount&&(o.frozenColumnCount=this.frozenColumnCount),this.frozenRowCount&&(o.frozenRowCount=this.frozenRowCount),this.workbook.addWorksheet(t,e,o)}mapSharedStrings(e){let t;for(const o of e.table.rows)for(const e of o.cells){const o=e.data;if(!o||"s"!==o.type)continue;const s=o.value;null!=s&&(""!==s?o.value=this.workbook.getStringPosition(String(s)).toString():(t??(t=this.workbook.getStringPosition("").toString()),o.value=t))}}getDataTypeForValue(e){if(void 0===e)return"empty";let t="s";try{this.isNumerical(e)&&(t="n")}catch(o){}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:Dt(162,{id:e.id,dataType:e.dataType})}return null}addImage(e,t,o){if(!this.config.addImageToCell)return;const s=this.config.addImageToCell(e,t,o);return s?(this.workbook.addBodyImageToMap(s.image,e,t,this.columnsToExport,this.config.rowHeight),s):void 0}createCell(e,t,o,s){const i=this.getStyleById(e);i?.dataType||"s"!==t||null==s||(o=s);const n=this.getTypeFromStyle(i,o)||t,{value:r,escaped:l}=this.getCellValue(n,o),a=[];return i&&a.push(e),l&&a.push("_quotePrefix"),{styleId:e=this.getStyleId(a)||void 0,data:{type:n,value:r}}}createMergedCell(e,t,o,s){const i=null==o?"":o;return{styleId:this.getStyleById(e)?e:void 0,data:{type:t,value:"s"===t?String(i):o},mergeAcross:s}}getCellValue(e,t){let o=!1;if(null==t||"s"===e&&""===t)return{value:"",escaped:!1};if("s"===e)"'"===(t=String(t))[0]&&(o=!0,t=t.slice(1));else if("f"===e)t=this.addXlfnPrefix(t).slice(1);else if("n"===e){const e=Number(t);isNaN(e)?t="":""!==t&&(t=e.toString())}return{value:t,escaped:o}}addXlfnPrefix(e){return e?e.replace(/(^|[^A-Z0-9._])(CONCAT)(\s*\()/gi,(e,t,o,s)=>`${t}_xlfn.${o}${s}`):e}getStyleId(e){if(!e?.length)return null;const t=e.filter(e=>null!=this.stylesByIds[e]);if(!t.length)return null;if(1===t.length)return t[0];const o=t.join("-");return this.mixedStyles[o]||this.addNewMixedStyle(t),this.mixedStyles[o].excelID}addNewMixedStyle(e){this.mixedStyleCounter+=1;const t=`mixedStyle${this.mixedStyleCounter}`,o={};for(const i of e){const e=this.stylesByIds[i];e&&Ye(o,e,!0,!0)}o.id=t;const s=e.join("-");this.mixedStyles[s]={excelID:t,key:s,result:o},this.excelStyles.push(o),this.stylesByIds[t]=o}isFormula(e){if(null==e)return!1;const t=String(e);return this.config.autoConvertFormulas&&C(t)}isNumerical(e){return"bigint"!=typeof e&&isFinite(e)&&""!==e&&!isNaN(parseFloat(e))}getStyleById(e){return null==e?null:this.stylesByIds[e]||null}},Xm={getTemplate(e){const{name:t,ContentType:o,Extension:s,PartName:i}=e;return{name:t,properties:{rawMap:{Extension:s,PartName:i,ContentType:o}}}}},Jm=e=>"jpg"===e?"jpeg":e,ef={getTemplate({sheetLen:e,hasCustomProperties:t}){const o=new Array(e).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${t+1}.xml`})),s=OC.size,i=VC.size,n={};zC.forEach(e=>{n[Jm(e.type)]=!0});const r=new Array(s).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${t+1}.xml`})),l=[];UC.forEach(({name:e})=>{l.push({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${e}.xml`})});const a=t?[{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml",PartName:"/docProps/custom.xml"}]:[],d=Object.keys(n).map(e=>({name:"Default",ContentType:`image/${e}`,Extension:e}));return i&&d.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:[...d,{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"},...o,{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"},...r,...l,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"},...a].map(e=>Xm.getTemplate(e))}}},tf={getTemplate(e){const t=/* @__PURE__ */(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:t},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:t}]}}},of=e=>Object.keys(e).filter(t=>t&&null!=e[t]).map((t,o)=>({name:"property",properties:{rawMap:{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:(o+2).toString(),name:f(t)??""}},children:[{name:"vt:lpwstr",textNode:f(Ym(String(e[t])))??""}]})),sf=e=>({name:"Properties",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}},children:of(e)}),nf=(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()}]}),rf=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}},lf=(e,t)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:t,name:e.id,descr:null!=e.altText?e.altText:void 0}},children:[rf(e)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),af=e=>{if(!e.saturation&&!e.tint)return;const t=[];return e.saturation&&t.push({name:"a:satMod",properties:{rawMap:{val:1e3*e.saturation}}}),e.tint&&t.push({name:"a:tint",properties:{rawMap:{val:1e3*e.tint}}}),t},df=(e,t)=>{let o;if(e.transparency){const t=Math.min(Math.max(e.transparency,0),100);o=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(1e3*t)}}}]}if(e.recolor)switch(o||(o=[]),e.recolor.toLocaleLowerCase()){case"grayscale":o.push({name:"a:grayscl"});break;case"sepia":o.push((i={color:"D9C3A5",tint:50,saturation:180},{name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:(s={color:"black"}).color}},children:af(s)},{name:"a:srgbClr",properties:{rawMap:{val:i.color}},children:af(i)}]}));break;case"washout":o.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}})}var s,i;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:o},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},cf=(e,t)=>{const o={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 t=e.rotation;o.properties={rawMap:{rot:6e4*Math.min(Math.max(t,0),360)}}}return{name:"xdr:spPr",children:[o,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},hf=(e,t,o,s)=>({name:"xdr:pic",children:[lf(e,t+1),df(e,o+1),cf(e,s)]}),uf={getTemplate(e){const{sheetIndex:t}=e,o=OC.get(t),s=WC.get(t);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:o.map((e,t)=>{const o=(e=>{e.fitCell=!!e.fitCell||!e.width||!e.height;const{position:t={},fitCell:o,width:s=0,height:i=0,totalHeight:n,totalWidth:r}=e,{offsetX:l=0,offsetY:a=0,row:d=1,rowSpan:c=1,column:h=1,colSpan:u=1}=t;return{from:{row:d-1,col:h-1,offsetX:$m(l),offsetY:$m(a)},to:{row:d-1+(o?1:c-1),col:h-1+(o?1:u-1),offsetX:$m(s+l),offsetY:$m(i+a)},height:$m(n||i),width:$m(r||s)}})(e);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[nf("from",o.from),nf("to",o.to),hf(e,t,s.get(e.id).index,o),{name:"xdr:clientData"}]}})}}},gf={getTemplate(e){const{Id:t,Type:o,Target:s}=e;return{name:"Relationship",properties:{rawMap:{Id:t,Type:o,Target:s}}}}},pf=e=>({name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:e.map(e=>gf.getTemplate(e))}),mf=e=>({name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:e.size,uniqueCount:e.size}},children:Zm(e)}),ff={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot",Continuous:"Continuous"},Cf=["Dashed","DashDot","DashDotDot"],vf={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"},wf={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},bf={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},yf=e=>null==e?e:("#"===e.charAt(0)&&(e=e.substring(1)),6===e.length?"FF"+e:e),Sf=(e,t)=>{if(!e)return"thin";const o=(e=>{switch(e){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}})(t);if("Continuous"===e)return o;const s=ff[e];return"medium"===o&&Cf.some(e=>e===s)?`medium${s}`:`${s.charAt(0).toLowerCase()}${s.substring(1)}`},Rf=e=>wf[e]||"general",xf=e=>bf[e]||void 0,Ff=e=>({name:"color",properties:{rawMap:{rgb:yf(e||"#000000")}}}),Df={getTemplate(e){const{left:t,right:o,top:s,bottom:i,diagonal:n}=e,r=t?[Ff(t.color)]:void 0,l=o?[Ff(o.color)]:void 0,a=s?[Ff(s.color)]:void 0,d=i?[Ff(i.color)]:void 0,c=n?[Ff(n.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:t?.style}},children:r},{name:"right",properties:{rawMap:{style:o?.style}},children:l},{name:"top",properties:{rawMap:{style:s?.style}},children:a},{name:"bottom",properties:{rawMap:{style:i?.style}},children:d},{name:"diagonal",properties:{rawMap:{style:n?.style}},children:c}]}}},Mf=e=>({name:"borders",properties:{rawMap:{count:e.length}},children:e.map(e=>Df.getTemplate(e))}),Pf=e=>{const t=["Context","LeftToRight","RightToLeft"].indexOf(e);return Math.max(t,0)},Ef={getTemplate(e){const{horizontal:t,indent:o,readingOrder:s,rotate:i,shrinkToFit:n,vertical:r,wrapText:l}=e;return{name:"alignment",properties:{rawMap:{horizontal:t&&Rf(t),indent:o,readingOrder:s&&Pf(s),textRotation:i,shrinkToFit:n,vertical:r&&xf(r),wrapText:l}}}}},Tf={getTemplate(e){const t=!1===e.protected?0:1;return{name:"protection",properties:{rawMap:{hidden:!0===e.hideFormula?1:0,locked:t}}}}},If={getTemplate(e){const{alignment:t,borderId:o,fillId:s,fontId:i,numFmtId:n,protection:r,quotePrefix:l,xfId:a}=e,d=[];return t&&d.push(Ef.getTemplate(t)),r&&d.push(Tf.getTemplate(r)),{name:"xf",properties:{rawMap:{applyAlignment:t?1:void 0,applyProtection:r?1:void 0,applyBorder:o?1:void 0,applyFill:s?1:void 0,borderId:o,fillId:s,applyFont:i?1:void 0,fontId:i,applyNumberFormat:n?1:void 0,numFmtId:n,quotePrefix:l?1:void 0,xfId:a}},children:d.length?d:void 0}}},Af=e=>({name:"cellStyleXfs",properties:{rawMap:{count:e.length}},children:e.map(e=>If.getTemplate(e))}),kf={getTemplate(e){const{builtinId:t,name:o,xfId:s}=e;return{name:"cellStyle",properties:{rawMap:{builtinId:t,name:o,xfId:s}}}}},Lf=e=>({name:"cellStyles",properties:{rawMap:{count:e.length}},children:e.map(e=>kf.getTemplate(e))}),Gf=e=>({name:"cellXfs",properties:{rawMap:{count:e.length}},children:e.map(e=>If.getTemplate(e))}),Nf={getTemplate(e){const{patternType:t,fgTheme:o,fgTint:s,fgRgb:i,bgRgb:n,bgIndexed:r}=e,l={name:"patternFill",properties:{rawMap:{patternType:t}}};return(o||s||i)&&(l.children=[{name:"fgColor",properties:{rawMap:{theme:o,tint:s,rgb:i}}}]),(r||n)&&(l.children||(l.children=[]),l.children.push({name:"bgColor",properties:{rawMap:{indexed:r,rgb:n}}})),{name:"fill",children:[l]}}},Bf=e=>({name:"fills",properties:{rawMap:{count:e.length}},children:e.map(e=>Nf.getTemplate(e))}),Hf={getTemplate(e){const{size:t,colorTheme:o,color:s="FF000000",fontName:i="Calibri",family:n,scheme:r,italic:l,bold:a,strikeThrough:d,outline:c,shadow:h,underline:u,verticalAlign:g}=e,p=[{name:"sz",properties:{rawMap:{val:t}}},{name:"color",properties:{rawMap:{theme:o,rgb:s}}},{name:"name",properties:{rawMap:{val:i}}}];return n&&p.push({name:"family",properties:{rawMap:{val:n}}}),r&&p.push({name:"scheme",properties:{rawMap:{val:r}}}),l&&p.push({name:"i"}),a&&p.push({name:"b"}),d&&p.push({name:"strike"}),c&&p.push({name:"outline"}),h&&p.push({name:"shadow"}),u&&p.push({name:"u",properties:{rawMap:{val:u}}}),g&&p.push({name:"vertAlign",properties:{rawMap:{val:g}}}),{name:"font",children:p}}},Of=e=>({name:"fonts",properties:{rawMap:{count:e.length}},children:e.map(e=>Hf.getTemplate(e))}),Vf={getTemplate(e){let{formatCode:t,numFmtId:o}=e;return t.length&&(t=function(e){const t=e.split(/(\[[^\]]*\])/);for(let o=0;o({name:"numFmts",properties:{rawMap:{count:e.length}},children:e.map(e=>Vf.getTemplate(e))}),Wf=(e,t)=>(e.includes("mixedStyle")&&t>1&&(e+=`_${t}`),e),Uf=()=>{Lm={base:0},Gm=[],Nm=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],Bm=[{patternType:"none"},{patternType:"gray125"}],Hm=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],Om=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],Vm=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],zm=[{builtinId:0,name:"Normal",xfId:0}]},$f=e=>{const{alignment:t,borders:o,font:s,interior:i,numberFormat:n,protection:r,quotePrefix:l}=e;let{id:a}=e,d=0,c=0,h=0,u=0;a&&(a=Wf(a,Wm),null==Lm[a]&&(i&&(d=(e=>{const t=(o=e.pattern)?vf[o]||o:"none";var o;const s=yf(e.color),i=yf(e.patternColor);let n=Bm.findIndex(e=>{const{patternType:o,fgRgb:n,bgRgb:r}=e;return!(o!=t||n!=s||r!=i)});return-1===n&&(n=Bm.length,Bm.push({patternType:t,fgRgb:s,bgRgb:i})),n})(i)),o&&(c=(e=>{const{borderBottom:t,borderTop:o,borderLeft:s,borderRight:i}=e;let n,r,l,a,d,c,h,u;s&&(l=Sf(s.lineStyle,s.weight),h=yf(s.color)),i&&(a=Sf(i.lineStyle,i.weight),u=yf(i.color)),t&&(n=Sf(t.lineStyle,t.weight),d=yf(t.color)),o&&(r=Sf(o.lineStyle,o.weight),c=yf(o.color));let g=Hm.findIndex(e=>{const{left:t,right:o,top:s,bottom:i}=e;if(!t&&(l||h))return!1;if(!o&&(a||u))return!1;if(!s&&(r||c))return!1;if(!i&&(n||d))return!1;const{style:g,color:p}=t||{},{style:m,color:f}=o||{},{style:C,color:v}=s||{},{style:w,color:b}=i||{};return g==l&&p==h&&m==a&&f==u&&C==r&&v==c&&w==n&&b==d});return-1===g&&(g=Hm.length,Hm.push({left:{style:l,color:h},right:{style:a,color:u},top:{style:r,color:c},bottom:{style:n,color:d},diagonal:{style:void 0,color:void 0}})),g})(o)),s&&(h=(e=>{const{fontName:t="Calibri",color:o,size:s,bold:i,italic:n,outline:r,shadow:l,strikeThrough:a,underline:d,family:c,verticalAlign:h}=e,u=yf(o),g=(e=>{if(void 0===e)return;const t=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(e||"Automatic");return Math.max(t,0)})(c),p=d?d.toLocaleLowerCase():void 0,m=h?h.toLocaleLowerCase():void 0;let f=Nm.findIndex(e=>!(e.fontName!=t||e.color!=u||e.size!=s||e.bold!=i||e.italic!=n||e.outline!=r||e.shadow!=l||e.strikeThrough!=a||e.underline!=p||e.verticalAlign!=m||e.family!=g));return-1===f&&(f=Nm.length,Nm.push({fontName:t,color:u,size:s,bold:i,italic:n,outline:r,shadow:l,strikeThrough:a,underline:p,verticalAlign:m,family:null!=g?g.toString():void 0})),f})(s)),n&&(u=(e=>{if(Tm[e])return Tm[e];let t=Gm.findIndex(t=>t.formatCode===e);return-1===t?(t=Gm.length+164,Gm.push({formatCode:e,numFmtId:t})):t=Gm[t].numFmtId,t})(n.format)),Lm[a]=Vm.length,Vm.push({alignment:t,borderId:c||0,fillId:d||0,fontId:h||0,numFmtId:u||0,protection:r,quotePrefix:l,xfId:0})))},jf=(e,t)=>Lm[Wf(e,t)]||0,Kf={getTemplate(e){const t=zf(Gm),o=Of(Nm.map(t=>({...t,size:null!=t.size?t.size:e}))),s=Bf(Bm),i=Mf(Hm),n=Af(Om),r=Gf(Vm),l=Lf(zm);return Uf(),{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,o,s,i,n,r,l,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},_f={getTemplate(e,t){const{name:o,columns:s,rowRange:i,displayName:n,showRowStripes:r,showColumnStripes:l,showFilterButtons:a,highlightFirstColumn:d,highlightLastColumn:c}=e||{},h=!i||i[0]-i[1]===0;if(!e||!o||!Array.isArray(s)||!s.length||h)return{name:"table"};const u=s.map((e,t)=>({name:"filterColumn",properties:{rawMap:{colId:t.toString(),hiddenButton:a[t]?0:1}}})),g=`A${i[0]}:${_m(s.length)}${i[1]}`,p=`${t+1}`,m=t?`${n}_${p}`:n;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:m,displayName:m,ref:g,totalsRowShown:0,id:p}},children:[{name:"autoFilter",properties:{rawMap:{ref:g}},children:u},{name:"tableColumns",properties:{rawMap:{count:s.length}},children:s.map((e,t)=>({name:"tableColumn",properties:{rawMap:{id:(t+1).toString(),name:f(qm(e)),dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:d?1:0,showLastColumn:c?1:0,showRowStripes:r?1:0,showColumnStripes:l?1:0}}}]}}},qf=e=>{const[t,o,s,i]=e;return{name:`a:${t}`,children:[{name:`a:${o}`,properties:{rawMap:{val:s,lastClr:i}}}]}},Yf=()=>({name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[qf(["dk1","sysClr","windowText","000000"]),qf(["lt1","sysClr","window","FFFFFF"]),qf(["dk2","srgbClr","44546A"]),qf(["lt2","srgbClr","E7E6E6"]),qf(["accent1","srgbClr","4472C4"]),qf(["accent2","srgbClr","ED7D31"]),qf(["accent3","srgbClr","A5A5A5"]),qf(["accent4","srgbClr","FFC000"]),qf(["accent5","srgbClr","5B9BD5"]),qf(["accent6","srgbClr","70AD47"]),qf(["hlink","srgbClr","0563C1"]),qf(["folHlink","srgbClr","954F72"])]}),Zf=e=>{const[t,o,s,i]=e;return{name:`a:${t}`,properties:{rawMap:{script:s,typeface:o,panose:i}}}},Qf=()=>({name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[Zf(["latin","Calibri Light",void 0,"020F0302020204030204"]),Zf(["ea",""]),Zf(["cs",""]),Zf(["font","游ゴシック Light","Jpan"]),Zf(["font","맑은 고딕","Hang"]),Zf(["font","等线 Light","Hans"]),Zf(["font","新細明體","Hant"]),Zf(["font","Times New Roman","Arab"]),Zf(["font","Times New Roman","Hebr"]),Zf(["font","Tahoma","Thai"]),Zf(["font","Nyala","Ethi"]),Zf(["font","Vrinda","Beng"]),Zf(["font","Shruti","Gujr"]),Zf(["font","MoolBoran","Khmr"]),Zf(["font","Tunga","Knda"]),Zf(["font","Raavi","Guru"]),Zf(["font","Euphemia","Cans"]),Zf(["font","Plantagenet Cherokee","Cher"]),Zf(["font","Microsoft Yi Baiti","Yiii"]),Zf(["font","Microsoft Himalaya","Tibt"]),Zf(["font","MV Boli","Thaa"]),Zf(["font","Mangal","Deva"]),Zf(["font","Gautami","Telu"]),Zf(["font","Latha","Taml"]),Zf(["font","Estrangelo Edessa","Syrc"]),Zf(["font","Kalinga","Orya"]),Zf(["font","Kartika","Mlym"]),Zf(["font","DokChampa","Laoo"]),Zf(["font","Iskoola Pota","Sinh"]),Zf(["font","Mongolian Baiti","Mong"]),Zf(["font","Times New Roman","Viet"]),Zf(["font","Microsoft Uighur","Uigh"]),Zf(["font","Sylfaen","Geor"]),Zf(["font","Arial","Armn"]),Zf(["font","Leelawadee UI","Bugi"]),Zf(["font","Microsoft JhengHei","Bopo"]),Zf(["font","Javanese Text","Java"]),Zf(["font","Segoe UI","Lisu"]),Zf(["font","Myanmar Text","Mymr"]),Zf(["font","Ebrima","Nkoo"]),Zf(["font","Nirmala UI","Olck"]),Zf(["font","Ebrima","Osma"]),Zf(["font","Phagspa","Phag"]),Zf(["font","Estrangelo Edessa","Syrn"]),Zf(["font","Estrangelo Edessa","Syrj"]),Zf(["font","Estrangelo Edessa","Syre"]),Zf(["font","Nirmala UI","Sora"]),Zf(["font","Microsoft Tai Le","Tale"]),Zf(["font","Microsoft New Tai Lue","Talu"]),Zf(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[Zf(["latin","Calibri",void 0,"020F0502020204030204"]),Zf(["ea",""]),Zf(["cs",""]),Zf(["font","游ゴシック","Jpan"]),Zf(["font","맑은 고딕","Hang"]),Zf(["font","等线","Hans"]),Zf(["font","新細明體","Hant"]),Zf(["font","Arial","Arab"]),Zf(["font","Arial","Hebr"]),Zf(["font","Tahoma","Thai"]),Zf(["font","Nyala","Ethi"]),Zf(["font","Vrinda","Beng"]),Zf(["font","Shruti","Gujr"]),Zf(["font","DaunPenh","Khmr"]),Zf(["font","Tunga","Knda"]),Zf(["font","Raavi","Guru"]),Zf(["font","Euphemia","Cans"]),Zf(["font","Plantagenet Cherokee","Cher"]),Zf(["font","Microsoft Yi Baiti","Yiii"]),Zf(["font","Microsoft Himalaya","Tibt"]),Zf(["font","MV Boli","Thaa"]),Zf(["font","Mangal","Deva"]),Zf(["font","Gautami","Telu"]),Zf(["font","Latha","Taml"]),Zf(["font","Estrangelo Edessa","Syrc"]),Zf(["font","Kalinga","Orya"]),Zf(["font","Kartika","Mlym"]),Zf(["font","DokChampa","Laoo"]),Zf(["font","Iskoola Pota","Sinh"]),Zf(["font","Mongolian Baiti","Mong"]),Zf(["font","Arial","Viet"]),Zf(["font","Microsoft Uighur","Uigh"]),Zf(["font","Sylfaen","Geor"]),Zf(["font","Arial","Armn"]),Zf(["font","Leelawadee UI","Bugi"]),Zf(["font","Microsoft JhengHei","Bopo"]),Zf(["font","Javanese Text","Java"]),Zf(["font","Segoe UI","Lisu"]),Zf(["font","Myanmar Text","Mymr"]),Zf(["font","Ebrima","Nkoo"]),Zf(["font","Nirmala UI","Olck"]),Zf(["font","Ebrima","Osma"]),Zf(["font","Phagspa","Phag"]),Zf(["font","Estrangelo Edessa","Syrn"]),Zf(["font","Estrangelo Edessa","Syrj"]),Zf(["font","Estrangelo Edessa","Syre"]),Zf(["font","Nirmala UI","Sora"]),Zf(["font","Microsoft Tai Le","Tale"]),Zf(["font","Microsoft New Tai Lue","Talu"]),Zf(["font","Ebrima","Tfng"])]}]}),Xf=(e,t,o)=>({name:`a:${e}`,properties:{rawMap:{val:t}},children:o}),Jf=e=>{const[t,o,s,i,n,r]=e,l=[];return l.push(Xf("satMod",s)),i&&l.push(Xf("lumMod",i)),n&&l.push(Xf("tint",n)),r&&l.push(Xf("shade",r)),{name:"a:gs",properties:{rawMap:{pos:t}},children:[{name:"a:schemeClr",properties:{rawMap:{val:o}},children:l}]}},eC=(e,t)=>({name:"a:solidFill",children:[Xf("schemeClr",e,t)]}),tC=e=>{const[t,o,s,i,n]=e,[r,l]=n;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:t}},children:[{name:"a:gsLst",children:[Jf(o),Jf(s),Jf(i)]},{name:"a:lin",properties:{rawMap:{ang:r,scaled:l}}}]}},oC=e=>{const[t,o,s,i]=e;return{name:"a:ln",properties:{rawMap:{w:t,cap:o,cmpd:s,algn:i}},children:[eC("phClr"),Xf("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},sC=e=>{const t=[];if(e){const[o,s,i,n,r]=e;t.push({name:"a:outerShdw",properties:{rawMap:{blurRad:o,dist:s,dir:i,algn:n,rotWithShape:r}},children:[Xf("srgbClr","000000",[Xf("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},t.length?{children:t}:{})]}},iC=()=>({name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:fillStyleLst",children:[eC("phClr"),tC(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),tC(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]},{name:"a:lnStyleLst",children:[oC(["6350","flat","sng","ctr"]),oC(["12700","flat","sng","ctr"]),oC(["19050","flat","sng","ctr"])]},{name:"a:effectStyleLst",children:[sC(),sC(),sC(["57150","19050","5400000","ctr","0"])]},{name:"a:bgFillStyleLst",children:[eC("phClr"),eC("phClr",[Xf("tint","95000"),Xf("satMod","170000")]),tC(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}]}),nC=()=>({name:"a:themeElements",children:[Yf(),Qf(),iC()]}),rC=()=>({name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[nC(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]}),lC=e=>{const{aspectratio:t,rotation:o}=e||{},s={};return t&&(s.aspectratio="t"),o&&(s.rotation="t"),{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:s}}},aC=(e,t)=>{let o;const{recolor:s,brightness:i,contrast:n,id:r}=e;if(s&&(o={},"Washout"!==s&&"Grayscale"!==s||(o.gain="19661f",o.blacklevel="22938f"),"Black & White"!==s&&"Grayscale"!==s||(o.grayscale="t","Black & White"===s&&(o.bilevel="t"))),!s||"Grayscale"===s){if(o||(o={}),null!=n&&50!==n){let e="1";n>=0&&(n<50?e=String(n/50):n<100?e=String(50/(100-n)):100===n&&(e="2147483647f")),o.gain=e}null!=i&&50!==i&&(o.blacklevel=(l=i,(l-0)/100*1-.5).toString())}var l;return{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${t}`,title:r}}],rawMap:o}}},dC=e=>Math.floor(.74999943307122*(e??0)),cC={getTemplate(e){const t=VC.get(e.sheetIndex)||[];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:[{name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]},{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:[{name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}},(o=["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"],{name:"v:formulas",children:o.map(e=>({name:"v:f",properties:{rawMap:{eqn:e}}}))}),{name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}},lC({aspectratio:!0})]},...t.map((e,t)=>((e,t)=>{const{width:o=0,height:s=0,altText:i}=e,n=dC(o),r=dC(s);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: ${n}pt; height: ${r}pt; z-index: ${t+1}`,type:"#_x0000_t75",alt:i}},children:[aC(e,t+1),lC({rotation:!0})]}})(e,t))]};var o}},hC={getTemplate(e,t){const o=(t+1).toString();return{name:"sheet",properties:{rawMap:{name:e,sheetId:o,"r:id":`rId${o}`}}}}},uC=e=>({name:"sheets",children:e.map((e,t)=>hC.getTemplate(e,t))}),gC=(e,t)=>({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}}}]},uC(e)]}),pC={getTemplate(e){const{min:t,max:o,outlineLevel:s,s:i,width:n,hidden:r,bestFit:l}=e;let a=1,d="0";return n>1&&(a=(e=>Math.ceil((e-12)/7+1))(n),d="1"),{name:"col",properties:{rawMap:{min:t,max:o,outlineLevel:null!=s?s:void 0,width:a,style:i,hidden:r?"1":"0",bestFit:l?"1":"0",customWidth:d}}}}},mC=e=>({name:"mergeCell",properties:{rawMap:{ref:e}}}),fC={getTemplate(e,t,o){const{ref:s,data:i,styleId:n}=e,{type:r,value:l}=i||{type:"empty",value:null};let a=r;"f"===r?a="str":r.charAt(0)===r.charAt(0).toUpperCase()&&(a=(e=>{const t=e.charAt(0).toLowerCase();return"s"===t?"inlineStr":t})(r));const d={name:"c",properties:{rawMap:{r:s,t:"empty"===a?void 0:a,s:n?jf(n,o):void 0}}};if("empty"===a)return d;let c;return c="str"===a&&"f"===r?[{name:"f",textNode:f(Ym(l))}]:"inlineStr"===a?[{name:"is",children:[{name:"t",textNode:f(Ym(l))}]}]:[{name:"v",textNode:l}],Object.assign({},d,{children:c})}},CC=e=>""!==e.data?.value||void 0!==e.styleId,vC={getTemplate(e,t,o){const{collapsed:s,hidden:i,height:n,outlineLevel:r,cells:l=[]}=e;return((e,t)=>{const o=[];let s=0;for(let i=0;i=0;i--){const s=[],n=e[o[i].pos];for(let e=1;e<=n.mergeAcross;e++)s.push({ref:`${_m(o[i].excelPos+1+e)}${t+1}`,styleId:n.styleId,data:{type:"empty",value:null}});s.length&&e.splice(o[i].pos+1,0,...s)}})(l,t),{name:"row",properties:{rawMap:{r:t+1,collapsed:s?"1":"0",hidden:i?"1":"0",ht:n,customHeight:null!=n?"1":"0",spans:"1:1",outlineLevel:r||void 0}},children:l.filter(CC).map((e,t)=>fC.getTemplate(e,t,o))}}},wC=e=>{if(null==e)return 1;const t=["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-1===t?1:t+1},bC=(e,t,o)=>e.reduce((e,s,i)=>{const n="Center"===(r=s.position)?"C":"Right"===r?"R":"L";var r;const l=(a=`${e}&${n}`,(d=s.font)?(a+="&"",a+=d.fontName||"Calibri",d.bold!==d.italic?a+=d.bold?",Bold":",Italic":d.bold?a+=",Bold Italic":a+=",Regular",a+=""",d.size&&(a+=`&${d.size}`),d.strikeThrough&&(a+="&S"),d.underline&&(a+="&"+("Double"===d.underline?"E":"U")),d.color&&(a+=`&K${d.color.replace("#","").toUpperCase()}`),a):a);var a,d;s.position||(s.position=["Left","Center","Right"][i]);const{image:c}=s;return"&[Picture]"===s.value&&c&&jC(c,`${n}${t}${o}`),`${l}${f((e=>{const t={"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"};for(const o of Object.keys(t))e=e.replace(o,t[o]);return e})(s.value))}`},""),yC=e=>{const t=[];return["all","first","even"].forEach(o=>{const s=e[o],i="all"===o?"odd":o;if(s)for(const e of Object.keys(s)){const n=s[e],r=`${e.charAt(0).toUpperCase()}${e.slice(1)}`,l=e[0].toUpperCase();if(n){const e="all"===o?"":o.toUpperCase();t.push({name:`${i}${r}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:bC(n,l,e)})}}}),t},SC=e=>t=>(e.length&&t.children.push({name:"cols",children:e.map(e=>pC.getTemplate(e))}),t),RC=(e,t)=>o=>(e.length&&o.children.push({name:"sheetData",children:e.map((e,o)=>vC.getTemplate(e,o,t))}),o),xC=e=>t=>{if(!e)return t;const o="boolean"==typeof e?{}:e,s={sheet:1},i=o.password?(e=>{const t=e.length;if(!t)return"";const o=new Array(t+1);o[0]=t;for(let i=1;i<=t;i++)o[i]=255&e.charCodeAt(i-1);let s=0;for(let i=o.length-1;i>=0;i--)s=((16384&s?1:0)|s<<1&32767)^o[i];return(52811^s).toString(16).toUpperCase().padStart(4,"0")})(o.password):"";i&&(s.password=i);const n={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(n).forEach(e=>{const t=o[e];null!=t&&t!==n[e]&&(s[e]=t?0:1)}),t.children.push({name:"sheetProtection",properties:{rawMap:s}}),t},FC=e=>t=>{const{top:o=.75,right:s=.7,bottom:i=.75,left:n=.7,header:r=.3,footer:l=.3}=e;return t.children.push({name:"pageMargins",properties:{rawMap:{bottom:i,footer:l,header:r,left:n,right:s,top:o}}}),t},DC=e=>t=>{var o;return e&&t.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:(o=e.orientation,!o||"Portrait"!==o&&"Landscape"!==o?"portrait":o.toLocaleLowerCase()),paperSize:wC(e.pageSize)}}}),t},MC=e=>t=>{if(!e)return t;const o=null!=e.first?1:0,s=null!=e.even?1:0;return t.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:o,differentOddEven:s}},children:yC(e)}),t},PC=e=>t=>(OC.get(e)?.length&&t.children.push({name:"drawing",properties:{rawMap:{"r:id":"rId"+ ++t.rIdCounter}}}),t),EC=e=>t=>(VC.get(e)&&t.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":"rId"+ ++t.rIdCounter}}}),t),TC=(e=0,t=0)=>{const o=e>0||t>0;return o?[{name:"pane",properties:{rawMap:{state:o?"frozen":void 0,topLeftCell:o?`${_m(e+1)}${t+1}`:void 0,xSplit:0===e?void 0:e,ySplit:0===t?void 0:t}}}]:void 0},IC=(e=!1,t,o)=>s=>(s.children.push({name:"sheetViews",children:[{name:"sheetView",properties:{rawMap:{rightToLeft:!0===e?"1":"0",workbookViewId:"0"}},children:TC(t,o)}]}),s),AC=e=>t=>{const o=e.reduce((e,t)=>t.outlineLevel&&t.outlineLevel>e?t.outlineLevel:e,0);return t.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:o||void 0}}}),t},kC={getTemplate(e){const{worksheet:t,currentSheet:o,config:s}=e,{margins:i={},pageSetup:n,headerFooterConfig:r,suppressColumnOutline:l,rightToLeft:a,frozenRowCount:d,frozenColumnCount:c,protectSheet:h}=s,{table:u}=t,{rows:g,columns:p}=u,m=p?.length?((e,t,o)=>{const s=[],i=[];e.forEach((e,o)=>{const n=e.cells;let r,l=0;n.forEach((e,n)=>{const a=n+l+1,d=_m(a),c=o+1;if(e.mergeAcross){l+=e.mergeAcross;const t=_m(n+l+1);s.push(`${d}${c}:${t}${c}`)}t[a-1]||(t[a-1]={});const{collapsibleRanges:h}=e;h&&h.forEach(e=>{i.push([a+e[0],a+e[1]])}),r=t[a-1],r.min=a,r.max=a,e.ref=`${d}${c}`})}),i.sort((e,t)=>e[0]!==t[0]?e[0]-t[0]:t[1]-e[1]);const n=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map;return i.filter(e=>{const t=e.toString();return!n.get(t)&&(n.set(t,!0),!0)}).forEach(e=>{const s=t.find(t=>t.min==e[0]&&t.max==e[1]),i=r.get(e[0]);t.push({min:e[0],max:e[1],outlineLevel:o?void 0:i||1,width:(s||{width:100}).width}),r.set(e[0],(i||0)+1)}),s})(g,p,!!l):[],f=UC.get(o),{children:C}=[e=>(e.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),e),IC(a,c,d),AC(g),SC(p),RC(g,o+1),xC(h),(w=m,e=>(w.length&&e.children.push({name:"mergeCells",properties:{rawMap:{count:w.length}},children:w.map(e=>mC(e))}),e)),FC(i),DC(n),MC(r),PC(o),EC(o),(v=f,e=>(v&&e.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":"rId"+ ++e.rIdCounter}}}]}),e))].reduce((e,t)=>t(e),{children:[],rIdCounter:0});var v,w;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}}},LC=/* @__PURE__ */new Map,GC=[],NC=[],BC=/* @__PURE__ */new Map,HC=/* @__PURE__ */new Map,OC=/* @__PURE__ */new Map,VC=/* @__PURE__ */new Map,zC=/* @__PURE__ */new Map,WC=/* @__PURE__ */new Map,UC=/* @__PURE__ */new Map,$C="SINGLE_SHEET";function jC(e,t){const o=GC.length-1,s=e;s.headerFooterPosition=t,KC({imageToAdd:s,idx:o});let i=VC.get(o);i||(i=[],VC.set(o,i)),i.find(t=>t.id===e.id)||i.push(e)}function KC(e){const{imageToAdd:t,idx:o}=e,s=HC.get(t.id);if(s){const e=s.find(e=>e.sheetId===o);e?e.image.push(t):s.push({sheetId:o,image:[t]})}else HC.set(t.id,[{sheetId:o,image:[t]}]),zC.set(t.id,{type:t.imageType,index:zC.size})}function _C(e,t){return Km(_f.getTemplate(e,t))}function qC({drawingIndex:e,vmlDrawingIndex:t,tableName:o}={}){if(void 0===e&&void 0===t&&void 0===o)return"";const s=[];return null!=e&&s.push({Id:`rId${s.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/drawing${e+1}.xml`}),null!=t&&s.push({Id:`rId${s.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Target:`../drawings/vmlDrawing${t+1}.vml`}),null!=o&&s.push({Id:`rId${s.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",Target:`../tables/${o}.xml`}),Km(pf(s))}var YC=(e,t)=>{if(!e.size)return;const o=/* @__PURE__ */new Map;t.forEach((t,s)=>{e.has(t)&&o.set(s,e.get(t))}),e.clear(),o.forEach((t,o)=>e.set(o,t))},ZC=e=>{const t=BC.get(e)??[];t.push(GC.length-1),BC.set(e,t),NC.push(e)},QC=class{getStringPosition(e){return function(e){return LC.has(e)?LC.get(e):(LC.set(e,LC.size),LC.size-1)}(e)}addBodyImageToMap(e,t,o,s,i){!function(e,t,o,s,i){const n=GC.length,{row:r,column:l}=e.position||{},a=e;s&&(null==t||null==o||r&&l||(e.position||(e.position={}),e.position=Object.assign({},e.position,{row:t,column:s.indexOf(o)+1})),((e,t)=>{const{colSpan:o,column:s}=e.position;if(e.width)if(o){const i=t.slice(s-1,s+o-1);let n=0;for(let t=0;t{const{rowSpan:o,row:s}=e.position;if(e.height)if(o){let i=0,n=0;for(let r=s;r{1===(Wm=t)&&Uf(),e.forEach($f)})(e,GC.length);const s=Object.assign({},o);o.exportAsExcelTable&&o.pivotModeActive&&(Dt(163,{featureName:"pivot mode"}),s.exportAsExcelTable=!1),function(e,t){const{exportAsExcelTable:o,prependContent:s,appendContent:i,headerRowCount:n=0}=t;if(!o)return;const{name:r,showColumnStripes:l,showRowStripes:a,showFilterButton:d,highlightFirstColumn:c,highlightLastColumn:h}="boolean"==typeof o?{}:o,u=function(e){return e.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}(r||"AG-GRID-TABLE"),g=GC.length-1,{table:p}=e,{rows:m,columns:f}=p,C=s?s.length:0,v=i?i.length:0,w=m.length,b=f.length,y=[],S=[];for(let R=0;R{if(e.length<=1)return;const t=(e=>{const t=new Map(BC),o=[];for(const s of e){const e=t.get(s);if(!e?.length)return null;const i=e.shift();o.push(i),t.set(s,e)}return o})(e)??(e=>{if(!e.length||0===NC.length)return null;const t=/* @__PURE__ */new Set,o=[];for(const s of e){const e=NC.findIndex((e,o)=>!t.has(o)&&e===s);if(-1===e)return null;t.add(e),o.push(e)}return o})(e);t&&(e=>{const t=/* @__PURE__ */new Map;e.forEach((e,o)=>t.set(e,o)),GC=e.map(e=>GC[e]),NC=e.map(e=>NC[e]),YC(OC,e),YC(VC,e),YC(UC,e),YC(WC,e),HC.forEach(e=>{e.forEach(e=>{const o=t.get(e.sheetId);null!=o&&(e.sheetId=o)})}),BC=/* @__PURE__ */new Map,NC.forEach((e,t)=>{const o=BC.get(e)??[];o.push(t),BC.set(e,o)})})(t)})(e)}reset(){LC.clear(),HC.clear(),OC.clear(),VC.clear(),zC.clear(),WC.clear(),UC.clear(),GC=[],NC=[],BC=/* @__PURE__ */new Map,$C="SINGLE_SHEET"}setFactoryMode(e){!function(e){$C=e}(e)}getFactoryMode(){return $C}getSheetNames(){return[...GC]}};function XC(e,t){let o="";for(let s=0;s>>=8;return o}var JC=e=>e.length?(e=>{if(!e.length)return 0;let t=-1,o=0,s=0,i=0;for(let n=0;n>>8^i;return-1^t})("string"==typeof e?(new TextEncoder).encode(e):e):0,ev=/* @__PURE__ */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]);var tv=(e,t,o,s,i,n)=>{const{content:r,path:l,created:a}=e,d=(e=>{let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t})(a),c=(e=>{let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t})(a),h=JC(i),u=void 0!==n?n:s,g=function(e){const t=String.fromCharCode;function o(e,o){return t(e>>o&63|128)}function s(e){if(!(4294967168&e))return t(e);let s="";return 4294965248&e?4294901760&e?4292870144&e||(s=t(e>>18&7|240),s+=o(e,12),s+=o(e,6)):(function(e){if(e>=55296&&e<=57343)throw new Error(Et(255,{point:e}))}(e),s=t(e>>12&15|224),s+=o(e,6)):s=t(e>>6&31|192),s+=t(63&e|128),s}const i=function(e){const t=[];if(!e)return[];const o=e.length;let s,i,n=0;for(;n=55296&&s<=56319&&ne.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(v,e=>e.charCodeAt(0))}},ov=e=>{let t;if("string"==typeof e){const o=atob(e.split(";base64,")[1]);t=Uint8Array.from(o,e=>e.charCodeAt(0))}else t=e;return{size:t.length,content:t}},sv=async e=>{const{content:t}=e,{size:o,content:s}=t?ov(t):{size:0,content:Uint8Array.from([])};let i,n,r=!1;if("file"===e.type&&s&&o>0){const e=await(async e=>{const{size:t,content:o}=await(async e=>{let t=0;const o=[],s=new WritableStream({write:e=>{o.push(e),t+=e.length}}),i=new ReadableStream({start:t=>{const o=new FileReader;o.onload=e=>{e.target?.result&&t.enqueue(e.target.result),t.close()},o.readAsArrayBuffer(e)}}),n=new window.CompressionStream("deflate-raw");return await i.pipeThrough(n).pipeTo(s),{size:t,content:new Blob(o)}})(new Blob([e]));return{size:t,content:new Uint8Array(await o.arrayBuffer())}})(s);i=e.content,n=e.size,r=!0}return{rawContent:s,rawSize:o,deflatedContent:i,deflatedSize:n,isCompressed:r}},iv=(e,t)=>{const{content:o}=e,{content:s}=o?ov(o):{content:Uint8Array.from([])};return{...tv(e,!1,t,s.length,s,void 0),content:s,isCompressed:!1}},nv=class{constructor(){this.folders=[],this.files=[]}addFolders(e){e.forEach(this.addFolder.bind(this))}addFolder(e){this.folders.push({path:e,created:/* @__PURE__ */new Date,isBase64:!1,type:"folder"})}addFile(e,t,o=!1){this.files.push({path:e,created:/* @__PURE__ */new Date,content:o?t:(new TextEncoder).encode(t),isBase64:o,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,o=0;for(const d of e){const{localFileHeader:e,centralDirectoryHeader:s,content:i}=d;t+=e.length+i.length,o+=s.length}const s=new Uint8Array(t),i=new Uint8Array(o);let n=0,r=0;for(const d of e){const{localFileHeader:e,centralDirectoryHeader:t,content:o}=d;s.set(e,n),n+=e.length,s.set(o,n),n+=o.length,i.set(t,r),r+=t.length}const l=((e,t,o)=>{const s="PK\0\0\0\0"+XC(e,2)+XC(e,2)+XC(t,4)+XC(o,4)+"\0\0";return Uint8Array.from(s,e=>e.charCodeAt(0))})(e.length,o,t),a=new Uint8Array(s.length+i.length+l.length);return a.set(s),a.set(i,s.length),a.set(l,s.length+i.length),a}async buildCompressedFileStream(){const e=[...this.folders,...this.files],t=await Promise.all(e.map(sv)),o=[];let s=0;for(let i=0;i{const s="xl/drawings",i=`${s}/drawing${o+1}.xml`,n=`${s}/_rels/drawing${o+1}.xml.rels`;e.addFile(n,function(e){const t=WC.get(e)||[],o=[];for(const[s,i]of t){const{index:e,type:t}=i;o.push({Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${zC.get(s).index+1}.${Jm(t)}`})}return Km(pf(o))}(t)),e.addFile(i,function(e){return Km(uf.getTemplate({sheetIndex:e}))}(t))},lv=(e,t,o)=>{const s="xl/drawings",i=`${s}/vmlDrawing${o+1}.vml`,n=`${s}/_rels/vmlDrawing${o+1}.vml.rels`;e.addFile(i,function(e){return Km(cC.getTemplate({sheetIndex:e}),!0)}(t)),e.addFile(n,function(e){const t=VC.get(e)||[],o=[];for(let s=0;s{if(!t||0===t.length)return Dt(159),s.reset(),!1;s.syncOrderWithSheetData(t);const{fontSize:i=11,author:n="AG Grid",activeTab:r=0,customMetadata:l}=o,a=t.length,d=Math.max(Math.min(r,a-1),0);return(e=>{if(e.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]),!HC.size)return;e.addFolders(["xl/worksheets/_rels","xl/drawings/","xl/drawings/_rels","xl/media/"]);let t=0;HC.forEach(o=>{const{base64:s,imageType:i}=o[0].image[0];e.addFile(`xl/media/image${++t}.${Jm(i)}`,s,!0)})})(e),(e=>{const t=UC,o=Array.from(t.keys());for(let s=0;s{let o=0,s=0;for(let i=0;i0&&OC.has(i),l=UC.size>0&&UC.get(i),a=HC.size&&VC.has(i);if(!r&&!l&&!a)continue;let d,c,h;r&&(rv(e,i,o),c=o,o++),a&&(lv(e,i,s),h=s,s++),l&&(d=l.name);const u=`xl/worksheets/_rels/sheet${i+1}.xml.rels`;e.addFile(u,qC({tableName:d,drawingIndex:c,vmlDrawingIndex:h}))}})(e,t),((e,t,o,s,i,n)=>{const r=!!n&&Object.keys(n).some(e=>null!=n[e]);var l;e.addFile("xl/workbook.xml",Km(gC(GC,i))),e.addFile("xl/styles.xml",(l=t,Km(Kf.getTemplate(l)))),e.addFile("xl/sharedStrings.xml",Km(mf(LC))),e.addFile("xl/theme/theme1.xml",Km(rC())),e.addFile("xl/_rels/workbook.xml.rels",function(e){const t=new Array(e).fill(void 0).map((e,t)=>({Id:`rId${t+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${t+1}.xml`}));return Km(pf([...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"}]))}(s)),e.addFile("docProps/core.xml",function(e){return Km(tf.getTemplate(e))}(o)),r&&e.addFile("docProps/custom.xml",Km(sf(n))),e.addFile("[Content_Types].xml",function(e,t){return Km(ef.getTemplate({sheetLen:e,hasCustomProperties:t}))}(s,r)),e.addFile("_rels/.rels",function(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"}];return e&&t.push({Id:"rId3",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",Target:"docProps/custom.xml"}),Km(pf(t))}(r))})(e,i,n,a,d,l),s.reset(),!0},dv=(e,t=new QC)=>{const{data:o,fontSize:s,author:i,activeSheetIndex:n,customMetadata:r}=e,l=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",a=new nv;return av(a,o,{author:i,fontSize:s,activeTab:n,customMetadata:r},t)?a.getZipFile(l):Promise.resolve(void 0)},cv=(e,t=new QC)=>{const{data:o,fontSize:s,author:i,activeSheetIndex:n,customMetadata:r}=e,l=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",a=new nv;if(av(a,o,{author:i,fontSize:s,activeTab:n,customMetadata:r},t))return a.getUncompressedZipFile(l)},hv=class extends Dl{constructor(e,t){super(function(e){return{tag:"div",cls:`ag-virtual-list-viewport ag-${e}-virtual-list-viewport`,role:"presentation",children:[{tag:"div",ref:"eContainer",cls:`ag-virtual-list-container ag-${e}-virtual-list-container`}]}}(t?.cssIdentifier||"default")),this.stopPropagationCallbacks=e,this.renderedRows=/* @__PURE__ */new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0,this.eContainer=null,this.awaitStableCallbacks=[],this.registerCSS(":where(.ag-virtual-list-viewport) .ag-tab-guard{position:sticky}.ag-virtual-list-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:auto;position:relative;width:100%}.ag-virtual-list-container{overflow:hidden;position:relative}.ag-virtual-list-item{height:var(--ag-list-item-height);position:absolute;width:100%}");const{cssIdentifier:o="default",ariaRole:s="listbox",listName:i,moveItemCallback:n}=t||{};this.cssIdentifier=o,this.ariaRole=s,this.listName=i,this.moveItemCallback=n}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)},this.stopPropagationCallbacks),this.refreshAriaProperties(),this.addManagedEventListeners({stylesChanged:this.onStylesChanged.bind(this)})}onStylesChanged(e){e.listItemHeightChanged&&(this.rowHeight=this.getItemHeight(),this.refresh())}refreshAriaProperties(){const e=this.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),t=this.eContainer;P(t,this.model?.getRowCount()>0?this.ariaRole:"presentation"),E(t,e)}addResizeObserver(){const e=we(this.beans,this.getGui(),()=>be(this.beans,()=>this.drawVirtualRows()));this.addDestroyFunc(e)}focusInnerElement(e){return this.focusRow(e?this.model.getRowCount()-1:0),!0}onFocusIn(e){const t=e.target;var o;t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=(o=t,Number.parseInt(o.getAttribute("aria-posinset"),10)-1))}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){const{key:t,shiftKey:o}=e;switch(t){case bs:case Ss:{const s=t===bs;e.preventDefault(),o?this.moveItem(s):this.navigate(s)}break;case Ms:case Ps:case Fs:case Ds:null!==this.navigateToPage(t)&&e.preventDefault()}}onTabKeyDown(e){this.stopPropagationCallbacks?.stopPropagation(e),this.forceFocusOutOfContainer(e.shiftKey)}getNextRow(e){if(null==this.lastFocusedRowIndex)return;const t=this.lastFocusedRowIndex+(e?-1:1);return t<0||t>=this.model.getRowCount()?void 0: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);void 0!==t&&this.focusRow(t)}navigateToPage(e,t="focused"){let o=!1;"focused"===t&&(t=this.getLastFocusedRow(),o=!0);const s=this.model.getRowCount()-1;let i=-1;return e===Ms?i=0:e===Ps?i=s:e===Ds?i=Math.min(t+this.pageSize,s):e===Fs&&(i=Math.max(t-this.pageSize,0)),-1===i?null:(o?this.focusRow(i):this.ensureIndexVisible(i),i)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),be(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,o)=>e(t.rowComponent,o))}getItemHeight(){return this.isHeightFromTheme?this.beans.environment.getDefaultListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const o=this.model.getRowCount();if("number"!=typeof e||e<0||e>=o)return!1;const s=e*this.rowHeight,i=s+this.rowHeight,n=this.getGui(),r=n.scrollTop,l=n.offsetHeight,a=r+l,d=t?0:this.rowHeight,c=as+d?(n.scrollTop=s,!0):!!c&&(n.scrollTop=i-l,!0)}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.isHeightFromTheme=!1,this.rowHeight=e,this.refresh()}refresh(e){if(null==this.model||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=t*this.rowHeight+"px",this.refreshAriaProperties(),this.awaitStable(()=>{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();_e(this,()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{if(!this.isAlive())return;const e=this.awaitStableCallbacks;this.awaitStableCallbacks=[];for(const t of e)t()})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&"function"==typeof this.model.areRowsEqual&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),o=t.scrollTop,s=o+t.offsetHeight;if(o===s)this.clearVirtualRows();else{const t=Math.floor(o/this.rowHeight),i=Math.floor(s/this.rowHeight);this.pageSize=Math.floor((s-o)/this.rowHeight),this.ensureRowsRendered(t,i,e)}}ensureRowsRendered(e,t,o){this.renderedRows.forEach((o,s)=>{(st)&&s!==this.lastFocusedRowIndex&&this.removeRow(s)}),o&&this.refreshRows();for(let s=e;s<=t;s++)this.renderedRows.has(s)||s=t.getRowCount())return;const{cssIdentifier:o,ariaRole:s,renderedRows:i,eContainer:n}=this,r=t.getRow(e),l=xe({tag:"div",cls:`ag-virtual-list-item ag-${o}-virtual-list-item`,role:"tree"===s?"treeitem":"option",attrs:{tabindex:"-1"}});N(l,t.getRowCount()),B(l,e+1);const a=this.rowHeight;l.style.height=`${a}px`,l.style.top=a*e+"px";const d=this.componentCreator(r,l);d.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),l.appendChild(d.getGui()),i.has(e-1)?i.get(e-1).eDiv.insertAdjacentElement("afterend",l):i.has(e+1)?i.get(e+1).eDiv.insertAdjacentElement("beforebegin",l):n.appendChild(l),i.set(e,{rowComponent:d,eDiv:l,value:r})}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,o)=>{if(o>=e)this.removeRow(o);else{const e=this.model.getRow(o);this.model.areRowsEqual?.(t.value,e)?this.componentUpdater(e,t.rowComponent):this.removeRow(o)}})}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())}},uv="ag-list-item-hovered",gv=class extends He{constructor(e,t,o){super(),this.comp=e,this.virtualList=t,this.params=o,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.beans.environment.addGlobalCSS('.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}',"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(){this.beans.dragAndDrop?.addDropTarget({isInterestedIn:e=>e===this.params.dragSourceType,getIconName:()=>this.moveBlocked?"pinned":"move",getContainer:()=>this.comp.getGui(),onDragging:e=>this.onDragging(e),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave(),onDragCancel:()=>this.onDragCancel()})}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new Xl({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),o=this.virtualList.getComponentAt(t.rowIndex);if(!o)return;const s=o.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,U(s,uv),U(s,`ag-item-highlight-${t.position}`))}getListDragItem(e){const t=this.virtualList.getGui(),o=Number.parseFloat(window.getComputedStyle(t).paddingTop),s=this.virtualList.getRowHeight(),i=this.virtualList.getScrollTop(),n=Math.max(0,(e.y-o+i)/s),r=this.params.getNumRows(this.comp)-1,l=0|Math.min(r,n);return{rowIndex:l,position:Math.round(n)>n||n>r?"bottom":"top",component:this.virtualList.getComponentAt(l)}}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(`.${uv}`))for(const e of[uv,"ag-item-highlight-top","ag-item-highlight-bottom"])t.classList.remove(e);this.lastHoveredListItem=null}},pv=class extends Di{constructor(e){var t;super(((t=e.cssIdentifier)??(t=t||"default"),{tag:"div",cls:`ag-panel ag-${t}-panel`,attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eTitleBar",cls:`ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable`,children:[{tag:"span",ref:"eTitle",cls:`ag-panel-title-bar-title ag-${t}-panel-title-bar-title`},{tag:"div",ref:"eTitleBarButtons",cls:`ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons`}]},{tag:"div",ref:"eContentWrapper",cls:`ag-panel-content-wrapper ag-${t}-panel-content-wrapper`}]})),this.config=e,this.closable=!0,this.eContentWrapper=null,this.eTitleBar=null,this.eTitleBarButtons=null,this.eTitle=null,this.registerCSS(".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}")}postConstruct(){const{component:e,closable:t,hideTitleBar:o,title:s,minWidth:i=250,width:n,minHeight:r=250,height:l,centered:a,popup:d,x:c,y:h,postProcessPopupParams:u}=this.config,g=this.beans,p=this.createManagedBean(new pi(this.getGui(),{minWidth:i,width:n,minHeight:r,height:l,centered:a,x:c,y:h,popup:d,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}));this.positionableFeature=p;const m=this.getGui();if(e&&this.setBodyComponent(e),o?K(this.eTitleBar,!1):(s&&this.setTitle(s),this.setClosable(null!=t?t:this.closable)),this.addManagedElementListeners(this.eTitleBar,{mousedown:e=>{if(m.contains(e.relatedTarget)||m.contains(w(g))||this.eTitleBarButtons.contains(e.target))return void e.preventDefault();const t=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");t&&t.focus()}}),d&&p.isPositioned())return;let f;if(this.renderComponent&&this.renderComponent(),u){const{type:e,eventSource:t,mouseEvent:o}=u;f=()=>g.popupSvc?.callPostProcessPopup(u,e,m,t,o)}p.initialisePosition(f),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 e=this.closeButtonComp=new Di({tag:"div",cls:"ag-button"});this.createBean(e);const t=e.getGui(),o=this.beans.iconSvc.createIconNoSpan("close",this.beans);o.classList.add("ag-panel-title-bar-button-icon"),t.appendChild(o),this.addTitleBarButton(e),e.addManagedElementListeners(t,{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 o=this.eTitleBarButtons,s=o.children,i=s.length;null==t&&(t=i),t=Math.max(0,Math.min(t,i)),e.addCss("ag-panel-title-bar-button");const n=e.getGui();0===t?o.prepend(n):t===i?o.append(n):s[t-1].after(n),e.setParentComponent(this)}getBodyHeight(){return Z(this.eContentWrapper)}getBodyWidth(){return Q(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&&re(e)&&this.close(),super.destroy()}},mv=class extends pv{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:o,maximizable:s,modal:i}=this.config;this.addCss("ag-dialog"),super.postConstruct(),this.tabGuardFeature=this.createManagedBean(new Fl(this,this.callbacks?.stopPropagationCallbacks)),this.tabGuardFeature.initialiseTabGuard({isFocusableContainer:!0,onFocusIn:()=>{this.popupSvc?.bringPopupToFront(e)},onTabKeyDown:t=>{if(i)return;const o=t.shiftKey,s=Ui(this.beans,e,!1,o);s&&!this.tabGuardFeature.getTabGuardCtrl().isTabGuard(s)||this.callbacks?.focusNextContainer(this.beans,o)&&t.preventDefault()}}),t&&this.setMovable(t),s&&this.setMaximizable(s),o&&this.setResizable(o),this.config.modal||this.callbacks?.configureFocusableContainer(this.beans,this)}setAllowFocus(e){this.tabGuardFeature.getTabGuardCtrl().setAllowFocus(e)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:o,title:s,afterGuiAttached:i}=this.config,n=this.getLocaleTextFunc(),r=this.popupSvc?.addPopup({modal:o,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:s||n("ariaLabelDialog","Dialog"),afterGuiAttached:i});r&&(this.close=r.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:e,y:t,width:o,height:s}=this.lastPosition;this.setWidth(o),this.setHeight(s),this.positionableFeature.offsetElement(e,t)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){K(this.maximizeIcon,!this.isMaximized),K(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)return this.clearMaximizebleListeners(),void(this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0));const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;this.isMaximizable=e;const o=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),o.addManagedElementListeners(o.getGui(),{click:this.toggleMaximize.bind(this)}),this.addTitleBarButton(o,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 Di({tag:"div",cls:"ag-dialog-button"})),t=e.getGui(),o=this.beans.iconSvc;return this.maximizeIcon=o.createIconNoSpan("maximize"),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=o.createIconNoSpan("minimize"),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}},fv=class extends Dl{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===Cs&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}},Cv=class extends He{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:o,level:s,childComponent:i,contextParams:n}=e;return this.params=e.menuItemDef,this.level=s,this.isAnotherSubMenuOpen=o,this.childComponent=i,this.contextParams=n,this.cssClassPrefix=this.params.menuItemParams?.cssClassPrefix??"ag-menu-option",this.callbacks.getMenuItemComp(this.beans,this.params,{...t,level:s,isAnotherSubMenuOpen:o,openSubMenu:e=>this.openSubMenu(e),closeSubMenu:()=>this.closeSubMenu(),closeMenu:e=>this.closeMenu(e),updateTooltip:(e,t)=>this.refreshTooltip(e,t),onItemActivated:()=>this.onItemActivated()}).then(e=>{if(!e)return;this.menuItemComp=e;const t=e.configureDefaults?.();t&&this.configureDefaults(!0===t?void 0:t)})}addListeners(e,t){t?.suppressClick||this.addManagedElementListeners(e,{click:e=>this.onItemSelected(e)}),t?.suppressKeyboardSelect||this.addManagedElementListeners(e,{keydown:e=>{e.key!==fs&&e.key!==vs||(e.preventDefault(),this.onItemSelected(e))}}),t?.suppressMouseDown||this.addManagedElementListeners(e,{mousedown:e=>{e.stopPropagation(),e.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 o=Cl({tag:"div",cls:"ag-menu",role:"presentation"});let s;this.eSubMenuGui=o;let i=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const e=this.createBean(new fv(this.childComponent));e.setParentComponent(this);const t=e.getGui(),n="mouseenter",r=()=>this.cancelDeactivate();t.addEventListener(n,r),s=()=>{t.removeEventListener(n,r),this.destroyBean(e)},o.appendChild(t),this.childComponent.afterGuiAttached&&(i=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const t=this.createBean(new vv(this.level+1,this.contextParams,this.callbacks));t.setParentComponent(this),t.addMenuItems(this.params.subMenu),o.appendChild(t.getGui()),this.addManagedListeners(t,{closeMenu:e=>this.dispatchLocalEvent(e)}),t.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),s=()=>this.destroyBean(t),e&&(i=()=>{t.activateFirstItem(),this.subMenuIsOpening=!1})}const n=this.beans.popupSvc,r=this.getLocaleTextFunc(),l=n?.addPopup({modal:!0,eChild:o,positionCallback:()=>{const e=this.eGui;n?.positionPopupForMenu({eventSource:e,ePopup:o,event:t instanceof MouseEvent?t:void 0,additionalParams:this.callbacks.getPostProcessPopupParams(this.contextParams)})},anchorToElement:this.eGui,ariaLabel:r("ariaLabelSubMenu","SubMenu"),afterGuiAttached:i});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{l&&l.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),s(),this.menuItemComp.setExpanded?.(!1),this.eSubMenuGui=void 0},this.menuItemComp.setExpanded?.(!0)}setAriaExpanded(e){this.suppressAria||G(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&&"keydown"===e.type,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:o,params:{cssClasses:s,disabled:i}}=this,n=this.menuItemComp.getRootElement?.();if(n&&(e||t.classList.add("ag-menu-option-custom"),t=n),this.suppressRootStyles=!!e,!this.suppressRootStyles){t.classList.add(o);for(const e of s??[])t.classList.add(e);i&&t.classList.add(`${o}-disabled`)}return t}applyAriaProperties(e){const{params:{checked:t,subMenu:o,subMenuRole:s,disabled:i}}=this;var n;P(e,null!=t?"menuitemcheckbox":"menuitem"),o&&x(e,"haspopup",!1===(n=s??"menu")?null:n),i&&x(e,"disabled",!0)}configureDefaults(e){if(!this.menuItemComp)return void setTimeout(()=>this.configureDefaults(e));const{suppressRootStyles:t,suppressTooltip:o,suppressAria:s,suppressTabIndex:i,suppressFocus:n}=e||{},{params:{tooltip:r,disabled:l}}=this,a=this.eGui=this.refreshRootElementGui(!!t);this.suppressAria=!!s,s||this.applyAriaProperties(a),i||a.setAttribute("tabindex","-1"),o||this.refreshTooltip(r),l||this.addListeners(a,e),this.suppressFocus=!!n}refreshTooltip(e,t){if(this.tooltip=e,this.tooltipFeature=this.destroyBean(this.tooltipFeature),!e||!this.menuItemComp)return;const o=this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:t});o&&(this.tooltipFeature=this.createBean(o))}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),this.menuItemComp?.destroy?.(),super.destroy()}},vv=class extends Dl{constructor(e=0,t,o){super({tag:"div",cls:"ag-menu-list",role:"menu"}),this.level=e,this.menuActionParams=t,this.callbacks=o,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 bs:case ys:case Ss:case ws:e.preventDefault(),this.handleNavKey(e.key);break;case Cs:this.closeIfIsChild()&&this.callbacks.stopPropagationCallbacks.stopPropagation(e)}}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){null!=e&&Ns.all(e.map(e=>"separator"===e?Ns.resolve({eGui:this.createSeparator()}):"string"==typeof e?(this.callbacks.warnNoItem?.(e),Ns.resolve({eGui:null})):this.addItem(e))).then(e=>{for(const t of e??[])t?.eGui&&(this.appendChild(t.eGui),t.comp&&this.menuItems.push(t.comp))})}addItem(e){const t=this.createManagedBean(new Cv(this.callbacks));return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some(e=>e.isSubMenuOpen()),level:this.level,contextParams:this.menuActionParams}).then(()=>(t.setParentComponent(this),this.addManagedListeners(t,{closeMenu:e=>{this.dispatchLocalEvent(e)},menuItemActivated:e=>{this.activeMenuItem&&this.activeMenuItem!==e.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=e.menuItem}}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){const e=this.menuItems.filter(e=>!e.isDisabled())[0];e&&e.activate()}createSeparator(){const e={tag:"div",cls:"ag-menu-separator-part"};return xe({tag:"div",cls:"ag-menu-separator",attrs:{"aria-hidden":"true"},children:[e,e,e,e]})}handleNavKey(e){switch(e){case bs:case Ss:{const t=this.findNextItem(e===bs);return void(t&&t!==this.activeMenuItem&&t.activate(!1,!0))}}e===(this.gos.get("enableRtl")?ys:ws)?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();return!!(t&&t instanceof Cv)&&(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0)}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(t){const o=[...this.menuItems];if(!o.length)return;if(!this.activeMenuItem)return t?e(o):o[0];let s;t&&o.reverse();let i=!1;for(const e of o){if(i){s=e;break}e===this.activeMenuItem&&(i=!0)}return i&&!s?o[0]:s||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}},wv=class extends Di{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,o=this.getGui();e&&function(e,t){F(e,"checked",void 0===t?"mixed":t)}(o,e),t&&G(o,!1)}addIcon(){if(this.params.isCompact)return;const e=xe({tag:"span",ref:"eIcon",cls:`${this.getClassName("part")} ${this.getClassName("icon")}`,role:"presentation"}),{checked:t,icon:o}=this.params;t?e.appendChild(this.beans.iconSvc.createIconNoSpan("check")):o&&(Ce(o)?e.appendChild(o):"string"==typeof o?e.innerHTML=o:this.callbacks?.warnNoIcon?.()),this.getGui().appendChild(e)}addName(){const e=xe({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=xe({tag:"span",ref:"eShortcut",cls:`${this.getClassName("part")} ${this.getClassName("shortcut")}`,children:this.params.shortcut||""});this.getGui().appendChild(e)}addSubMenu(){const e=xe({tag:"span",ref:"ePopupPointer",cls:`${this.getClassName("part")} ${this.getClassName("popup-pointer")}`}),t=this.getGui();if(this.params.subMenu){const t=this.gos.get("enableRtl")?"subMenuOpenRtl":"subMenuOpen";e.appendChild(this.beans.iconSvc.createIconNoSpan(t))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}};function bv(e,t){if(!t)return null;const o=zi(e),s=o.indexOf(t);if(-1===s)return null;let i=-1;for(let n=s-1;n>=0;n--)if(o[n].classList.contains(Rl)){i=n;break}return i<=0?null:o[i-1]}function yv(e,t){if(!t)return!1;const o=e.querySelectorAll(`.${ji}`);if(!o.length)return!1;for(let s=0;sthis.activeItem?.tabbedItem?.afterDetachedCallback?.())}setupHeader(){const{enableCloseButton:e,cssClass:t}=this.params,o=(e,o)=>{e.classList.add(`ag-tabs-${o}`),t&&e.classList.add(`${t}-${o}`)};e?(this.setupCloseButton(o),this.eTabHeader=xe({tag:"div",role:"presentation"}),o(this.eHeader,"header-wrapper"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,P(this.eTabHeader,"tablist"),o(this.eTabHeader,"header")}setupCloseButton(e){const t=xe({tag:"button"});e(t,"close-button");const o=this.beans.iconSvc.createIconNoSpan("close");E(t,this.params.closeButtonAriaLabel),t.appendChild(o),this.addManagedElementListeners(t,{click:()=>this.params.onCloseClicked?.()});const s=xe({tag:"div",role:"presentation"});e(s,"close-button-wrapper"),s.appendChild(t),this.eHeader.appendChild(s),this.eCloseButton=t}handleKeyDown(e){switch(e.key){case ys:case ws:{if(!this.eTabHeader.contains(w(this.beans)))return;const t=e.key===ys,o=this.gos.get("enableRtl"),s=this.items.indexOf(this.activeItem),i=t!==o?Math.min(s+1,this.items.length-1):Math.max(s-1,0);if(s===i)return;e.preventDefault();const n=this.items[i];this.showItemWrapper(n),n.eHeaderButton.focus();break}case bs:case Ss:e.stopPropagation()}}onTabKeyDown(e){if(e.defaultPrevented)return;const{beans:t,eHeader:o,eBody:s,activeItem:i,params:n}=this,{suppressTrapFocus:r,enableCloseButton:l}=n,a=w(t),d=e.target,c=e.shiftKey;if(o.contains(a))return e.preventDefault(),void(l&&c&&!this.eCloseButton?.contains(a)?this.eCloseButton?.focus():r&&c?bv(b(t).body,d)?.focus():this.focusBody(e.shiftKey));let h=null;yv(s,d)&&(c&&(h=bv(s,d)),h||r||(h=i.eHeaderButton)),h||!s.contains(a)||(h=Ui(t,s,!1,c),h)?h&&(e.preventDefault(),h.focus()):r&&!c?this.forceFocusOutOfContainer(c):l&&!c?(e.preventDefault(),this.eCloseButton?.focus()):(e.preventDefault(),this.focusHeader())}focusInnerElement(e){return e?this.focusBody(!0):(this.focusHeader(),!0)}focusHeader(e){this.activeItem.eHeaderButton.focus({preventScroll:e})}focusBody(e){return Wi(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const t=xe({tag:"span",cls:"ag-tab",role:"tab",attrs:{tabindex:"-1"}});t.appendChild(e.title),this.eTabHeader.appendChild(t),E(t,e.titleLabel);const o={tabbedItem:e,eHeaderButton:t};this.items.push(o),t.addEventListener("click",this.showItemWrapper.bind(this,o))}showItem(e){const t=this.items.find(t=>t.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){const{tabbedItem:t,eHeaderButton:o}=e;this.params.onItemClicked?.({item:t}),this.activeItem!==e?(this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),se(this.eBody),t.bodyPromise.then(e=>{this.eBody.appendChild(e);const o=!Vi();if(this.params.suppressFocusBodyOnOpen||Wi(this.eBody,!1,o),t.afterAttachedCallback&&t.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const o=t.getScrollableContainer?.()||e;[this.lastScrollListener]=this.addManagedElementListeners(o,{scroll:()=>{this.tabbedItemScrollMap.set(t.name,o.scrollTop)}});const s=this.tabbedItemScrollMap.get(t.name);void 0!==s&&setTimeout(()=>{o.scrollTop=s},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),this.activeItem.tabbedItem.afterDetachedCallback?.()),o.classList.add("ag-tab-selected"),this.activeItem=e):this.params.onActiveItemClicked?.()}},Rv=class extends Di{constructor(e={}){super(function(e){const t=e.cssIdentifier||"default";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-${e.direction||"vertical"} ag-${t}-group-container`}]}}(e),[za]),this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=null,this.cbGroupEnabled=null,this.eContainer=null,this.registerCSS(".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}");const{enabled:t,items:o,suppressEnabledCheckbox:s,expanded:i,suppressToggleExpandOnEnableChange:n,useToggle:r}=e;this.cssIdentifier=e.cssIdentifier||"default",this.enabled=null==t||t,this.items=o||[],this.useToggle=r??!1,this.alignItems=e.alignItems||"center",this.expanded=null==i||i,null!=s&&(this.suppressEnabledCheckbox=s),null!=n&&(this.suppressToggleExpandOnEnableChange=n)}postConstruct(){if(this.setupTitleBar(),this.items.length){const e=this.items;this.items=[],this.addItems(e)}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:o,suppressOpenCloseIcons:s}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(s??!1),this.refreshChildDisplay(),K(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(e=>{this.setEnabled(e,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(e)}),null!=t&&this.onEnableChange(t),null!=o&&this.onExpandedChange(o)}refreshChildDisplay(){K(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=null!=e?e:!this.expanded,this.expanded===e)return this;return this.expanded=e,this.refreshChildDisplay(),K(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 o=0;for(let s=0;se(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 Fv(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListeners(e,{expandedChanged:e=>this.toggleGroupExpand(e.expanded)}),e}createToggleTitleBar(){const e=this.createManagedBean(new ym({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:e=>{this.setEnabled(e,!0),this.dispatchEnableChangeEvent(e)}}));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}},xv="ag-disabled-group-title-bar",Fv=class extends Di{constructor(e={}){super(function(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`}]}}(e)),this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=null,this.eGroupClosedIcon=null,this.eTitle=null;const{title:t,suppressOpenCloseIcons:o,suppressKeyboardNavigation:s}=e;t&&t.length>0&&(this.title=t),null!=o&&(this.suppressOpenCloseIcons=o),this.suppressKeyboardNavigation=s??!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:e=>{switch(e.key){case fs:case vs:e.preventDefault(),this.dispatchExpandChanged();break;case ys:case ws:e.preventDefault(),this.dispatchExpandChanged(e.key===ys)}}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||G(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;K(this.eGroupOpenedIcon,t&&e),K(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(),o=!!e&&e.length>0;e=o?e:void 0,this.eTitle.textContent=e??"",K(t,o),e!==this.title&&(this.title=e);const s=t.classList.contains(xv);return this.refreshDisabledStyles(s),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(xv),t.removeAttribute("tabindex"),P(t,"presentation")):(t.classList.remove(xv),"string"!=typeof this.title||this.suppressKeyboardNavigation?(t.removeAttribute("tabindex"),P(t,"presentation")):(this.activateTabIndex([t]),P(t,"group")))}},Dv="35.2.0",Mv={moduleName:"EnterpriseCore",version:Dv,beans:[Em],icons:{accordionOpen:"tree-open",accordionClosed:"tree-closed",accordionIndeterminate:"tree-indeterminate",close:"cross",cancel:"cancel",maximize:"maximize",minimize:"minimize",columnDrag:"grip"},dependsOn:[],setLicenseKey:Em.setLicenseKey},Pv={stopPropagationCallbacks:Zi,focusNextContainer:(e,t)=>Ln(e,t),configureFocusableContainer:(e,t)=>{const o=e.ctrlsSvc.get("gridCtrl");o.addFocusableContainer(t),t.addDestroyFunc(()=>o.removeFocusableContainer(t))}},Ev=class extends mv{constructor(e){super(e,Pv)}getFocusableContainerName(){return"dialog"}},Tv=class extends hv{constructor(e){super(Zi,e)}},Iv=class extends gv{},Av={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"}]}]},kv=class extends Pi{constructor(e){super(),this.toolPanelDef=e,this.eToggleButton=null,this.eIconWrapper=null,this.eLabel=null}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){this.setTemplate(Av,[]),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",Ol(this.toolPanelDef.iconKey,this.beans))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(e){this.toggleCss("ag-selected",e),G(this.eToggleButton,e)}},Lv={tag:"div",cls:"ag-side-buttons",role:"tablist"},Gv={selector:"AG-SIDE-BAR-BUTTONS",component:class extends Pi{constructor(){super(Lv),this.buttonComps=[]}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){e.key===ms&&e.shiftKey&&(Ln(this.beans,!0)?e.preventDefault():qi(e))}setActiveButton(e){for(const t of this.buttonComps)t.setSelected(e===t.getToolPanelId())}addButtonComp(e){const t=this.createBean(new kv(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),se(this.getGui())}destroy(){this.clearButtons(),super.destroy()}}},Nv={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columnsToolPanel",toolPanel:"agColumnsToolPanel"},Bv={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agFiltersToolPanel"},Hv={columns:Nv,filters:Bv,"filters-new":{id:"filters-new",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agNewFiltersToolPanel"}};function Ov(e){if(e){if(!0===e)return{toolPanels:[Nv,Bv],defaultToolPanel:"columns"};if("string"==typeof e)return Ov([e]);if(Array.isArray(e)){const t=[];for(const o of e){const e=Hv[o];e?t.push(e):Dt(215,{key:o,defaultByKey:Hv})}if(0===t.length)return;return{toolPanels:t,defaultToolPanel:t[0].id}}return{toolPanels:Vv(e.toolPanels),defaultToolPanel:e.defaultToolPanel,hiddenByDefault:e.hiddenByDefault,position:e.position,hideButtons:e.hideButtons}}}function Vv(e){const t=[];return e?(e.forEach(e=>{const o=function(e){return"string"!=typeof e?e:Hv[e]?Hv[e]:(Dt(215,{key:e,defaultByKey:Hv}),null)}(e);o&&t.push(o)}),t):t}var zv=class extends Pi{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,o){this.eventSvc.dispatchEvent({type:"toolPanelSizeChanged",width:o,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 o=this.inverted?-1:1;let s=Math.max(this.minWidth,Math.floor(this.startingWidth-e*o));null!=this.maxWidth&&(s=Math.min(this.maxWidth,s)),this.elementToResize.style.setProperty("--ag-horizontal-size",`${s}px`),this.dispatchResizeEvent(!1,t,s)}},Wv={name:"toolPanel",optionalMethods:["refresh","getState"]},Uv={tag:"div",cls:"ag-tool-panel-wrapper",role:"tabpanel",children:[{tag:"div",cls:"ag-tool-panel-content",ref:"eContent"}]},$v=class extends Pi{constructor(){super(Uv),this.eContent=null,this.animationId=0,this.defParent=null}postConstruct(){const e=this.getGui(),t=this.resizeBar=this.createManagedBean(new zv);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:o,minWidth:s,maxWidth:i,width:n,parent:r}=e;this.toolPanelId=o,this.defParent=r??null,n&&this.getGui().style.setProperty("--ag-side-bar-panel-width",`${n}px`);const l=function(e,t,o){return e.getCompDetails(t,Wv,void 0,o,!0)}(this.beans.userCompFactory,e,t);if(null==l)return!1;const a=l.newAgStackInstance();this.params=l.params,a.then(this.setToolPanelComponent.bind(this));const d=this.resizeBar;return null!=s&&(d.minWidth=s),null!=i&&(d.maxWidth=i),!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="left"===e,o=this.gos.get("enableRtl")?t:!t;this.resizeBar.inverted=o}refresh(){this.toolPanelCompInstance?.refresh(this.params)}animateDisplayed(e){if(this.isDisplayed()===e)return;const t=++this.animationId,{eContent:o}=this,s=()=>{this.animationId===t&&(i.classList.remove("ag-tool-panel-animating"),o.style.width="",i.style.width="")},i=this.getGui(),n=i.offsetWidth;this.setDisplayed(e),i.classList.add("ag-tool-panel-animating");const r=getComputedStyle(i).transitionDuration;if(!parseFloat(r))return void s();i.style.transition="none",i.style.width="",o.style.width=`${o.offsetWidth}px`,i.style.width=`${n}px`,i.offsetWidth,i.style.transition="",i.style.width=e?"":"0";const l=setTimeout(s,100);i.addEventListener("transitionstart",()=>clearTimeout(l),{once:!0}),i.addEventListener("transitionend",s,{once:!0})}},jv={tag:"div",cls:"ag-side-bar ag-unselectable",children:[{tag:"ag-side-bar-buttons",ref:"sideBarButtons"}]};function Kv(e){return"agFiltersToolPanel"===e||"agNewFiltersToolPanel"===e}var _v={selector:"AG-SIDE-BAR",component:class extends Pi{constructor(){super(jv,[Gv]),this.sideBarButtons=null,this.toolPanelWrappers=[],this.registerCSS('.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{\n /* !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)}}')}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));const{beans:e,gos:t}=this,{sideBar:o}=t.get("initialState")??{};this.setSideBarDef({sideBarDef:Ov(t.get("sideBar")),sideBarState:o}),this.addManagedPropertyListener("sideBar",()=>this.setState()),e.sideBar.comp=this;const s=this.getFocusableElement();this.createManagedBean(new Qi(s,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),In(e,this,s),this.addManagedPropertyListener("enableAdvancedFilter",this.onAdvancedFilterChanged.bind(this))}getFocusableContainerName(){return"sideBar"}onTabKeyDown(e){if(e.defaultPrevented)return;const{beans:t,sideBarButtons:o}=this,s=this.getGui(),i=o.getGui(),n=w(t),r=s.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),l=e.target,a=e.shiftKey;if(!r)return Ln(t,a,!0)?(e.preventDefault(),!0):(e[Bn]=!0,!1);if(i.contains(n))return void(Wi(r,a)&&e.preventDefault());if(!a)return;let d=null;r.contains(n)?d=Ui(t,r,void 0,!0):yv(r,l)&&(d=bv(r,l)),d||(d=i.querySelector(".ag-selected button"),d=re(d)?d:null),d&&d!==e.target&&(e.preventDefault(),d.focus())}handleKeyDown(e){const t=w(this.beans),o=this.sideBarButtons;if(!o.getGui().contains(t))return;const s=o.getGui(),i=Array.prototype.slice.call(s.querySelectorAll(".ag-side-button")),n=i.findIndex(e=>e.contains(t));let r=null;switch(e.key){case ws:case bs:r=Math.max(0,n-1);break;case ys:case Ss:r=Math.min(n+1,i.length-1)}if(null===r)return;const l=i[r].querySelector("button");l&&(l.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:o}){if(this.setDisplayed(!1),this.sideBar=e,e&&this.sideBarButtons.setDisplayed(!e.hideButtons),e?.toolPanels){const s=e.toolPanels;if(this.createToolPanelsAndSideButtons(s,t,o),!this.toolPanelWrappers.length)return;const i=t?t.visible:!e.hiddenByDefault;if(this.setDisplayed(i),this.setSideBarPosition(t?t.position:e.position),i)if(t){const{openToolPanel:e}=t;e&&this.openToolPanel(e,"sideBarInitializing")}else this.openToolPanel(e.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(e){e||(e="right"),this.position=e;const t="left"===e,o=t?"right":"left";this.toggleCss("ag-side-bar-left",t),this.toggleCss("ag-side-bar-right",!t);for(const s of this.toolPanelWrappers)s.setResizerSizerSide(o);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,o){for(const s of e)this.createToolPanelAndSideButton(s,t?.toolPanels?.[s.id],o?.[s.id])}validateDef(e){const{id:t,toolPanel:o}=e;return null==t?(Dt(212),!1):!Kv(o)||!this.beans.filterManager?.isAdvFilterEnabled()||(Dt(213),!1)}createToolPanelAndSideButton(e,t,o){if(!this.validateDef(e))return void this.destroyBean(o);let s;if(o)s=o,s.setDefParent(e.parent??null);else if(s=this.createBean(new $v),!s.setToolPanelDef(e,Co(this.gos,{initialState:t,onStateUpdated:()=>this.dispatchSideBarUpdated()})))return;var i,n;s.setDisplayed(!1),this.renderToolPanelUnderParent(s,e.parent),this.toolPanelWrappers.push(s),i=this.sideBarButtons.addButtonComp(e).eToggleButton,n=s.getGui(),function(e,t){x(e,"controls",t)}(i,n.id),T(n,i.id)}refresh(){for(const e of this.toolPanelWrappers)e.refresh()}renderToolPanelUnderParent(e,t){const o=e.getGui();t&&(this.beans.environment.applyThemeClasses(t,["ag-external","ag-tool-panel-external"]),o.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"));const s=t??e.getDefParent()??this.getGui();o.parentElement!==s&&s.appendChild(o)}getWrapper(e){return this.toolPanelWrappers.find(t=>t.getToolPanelId()===e)}openToolPanel(e,t="api",o){const s=this.openedItem(),i=!!e&&!!s||"sideBarInitializing"===t;for(const n of this.toolPanelWrappers){const t=e===n.getToolPanelId();t&&this.renderToolPanelUnderParent(n,o??null),i?n.setDisplayed(t):n.animateDisplayed(t)}s!==this.openedItem()&&(this.sideBarButtons.setActiveButton(e),this.raiseToolPanelVisibleEvent(e,s??void 0,t))}getToolPanelInstance(e){const t=this.getWrapper(e);if(t)return t.getToolPanelInstance();Dt(214,{key:e})}raiseToolPanelVisibleEvent(e,t,o){const s=!!e&&!!t,i=this.eventSvc;t&&i.dispatchEvent({type:"toolPanelVisibleChanged",source:o,key:t,visible:!1,switchingToolPanel:s}),e&&i.dispatchEvent({type:"toolPanelVisibleChanged",source:o,key:e,visible:!0,switchingToolPanel:s})}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=Ov(this.gos.get("sideBar")),o={};t&&this.sideBar&&t.toolPanels?.forEach(t=>{const{id:s}=t;if(!s)return;const i=this.sideBar.toolPanels?.find(e=>e.id===s);if(!i||t.toolPanel!==i.toolPanel)return;const n=this.getWrapper(s);if(!n)return;const r=Co(this.gos,{...t.toolPanelParams??{},initialState:e?.toolPanels?.[s],onStateUpdated:()=>this.dispatchSideBarUpdated()});!0===n.getToolPanelInstance()?.refresh(r)&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(e=>e!==n),ie(n.getGui()),o[s]=n)}),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,sideBarState:e,existingToolPanelWrappers:o})}dispatchSideBarUpdated(){this.eventSvc.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){for(const e of this.toolPanelWrappers)ie(e.getGui()),this.destroyBean(e);this.toolPanelWrappers.length=0}onAdvancedFilterChanged(){this.sideBar?.toolPanels?.some(e=>Kv("string"==typeof e?e:e.toolPanel))&&this.setState()}destroy(){this.destroyToolPanelWrappers(),super.destroy()}}},qv={moduleName:"SideBar",version:Dv,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="sideBar"}getSelector(){return _v}}],apiFunctions:{isSideBarVisible:function(e){return e.sideBar?.comp.isDisplayed()??!1},setSideBarVisible:function(e,t){e.sideBar?.comp.setDisplayed(t)},setSideBarPosition:function(e,t){e.sideBar?.comp.setSideBarPosition(t)},openToolPanel:function(e,t,o){e.sideBar?.comp.openToolPanel(t,"api",o)},closeToolPanel:function(e){e.sideBar?.comp.close("api")},getOpenedToolPanel:function(e){return e.sideBar?.comp.openedItem()??null},refreshToolPanel:function(e){e.sideBar?.comp.refresh()},isToolPanelShowing:function(e){return e.sideBar?.comp.isToolPanelShowing()??!1},getToolPanelInstance:function(e,t){const o=e.sideBar?.comp.getToolPanelInstance(t);return ph(o)},getSideBar:function(e){return e.sideBar?.comp.getDef()}},dependsOn:[Mv,na]},Yv=class extends wv{constructor(){super({warnNoIcon:()=>Dt(227)})}},Zv={moduleName:"MenuItem",version:Dv,userComponents:{agMenuItem:Yv},icons:{check:"tick",subMenuOpen:"small-right",subMenuOpenRtl:"small-left"},css:['.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}']},Qv={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"}]},Xv={selector:"AG-PRIMARY-COLS-HEADER",component:class extends Pi{constructor(){super(Qv,[za,Ng]),this.eExpand=null,this.eSelect=null,this.eFilterTextField=null}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===vs&&(e.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=Ol("columnSelectOpen",e)),this.eExpand.appendChild(this.eExpandUnchecked=Ol("columnSelectClosed",e)),this.eExpand.appendChild(this.eExpandIndeterminate=Ol("columnSelectIndeterminate",e)),this.setExpandState(0)}showOrHideOptions(){const e=this.params,t=!e.suppressColumnFilter,o=!e.suppressColumnSelectAll,s=!e.suppressColumnExpandAll,i=!!this.beans.colModel.colDefCols?.treeDepth,n=this.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(n("searchOoo","Search...")),K(this.eFilterTextField.getGui(),t),K(this.eSelect.getGui(),o),K(this.eExpand,s&&i)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=je(this,()=>{const e=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:e})},300)),this.onFilterTextChangedDebounced()}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:0===this.expandState?"collapseAll":"expandAll"})}setExpandState(e){this.expandState=e,K(this.eExpandChecked,0===e),K(this.eExpandUnchecked,1===e),K(this.eExpandIndeterminate,2===e)}setSelectionState(e){this.selectState=e,this.eSelect.setValue(this.selectState)}}};function Jv(e){return!!e&&void 0!==e.children}function ew(e){return Jv(e)?e.groupId:e.colId}function tw(t,o,s){if(!Jv(t))return!0;const i=t,n=s;if(((t,o)=>{const s=t.children.map(ew).includes(ew(o)),i=e(t.children),n=i&&ew(i)!==ew(o);return s&&n})(i,n))return i.children.push(n),!0;if(i.groupId===o&&!i.children.map(ew).includes(ew(n)))return i.children.push(n),!0;for(let e=i.children.length-1;e>=0&&!tw(i.children[e],o,s);e--);return!1}function ow(e){const t=(e,t)=>Jv(e)&&Jv(t)&&ew(e)===ew(t),o=(e,t)=>{if(!Jv(t))return e;const s=e,i=t;if(i.children&&i.groupId&&tw(s,i.groupId,i.children[0]))return s;for(const n of i.children)o(s,n);return s},s=[];for(let i=1;i<=e.length;i++){const n=e[i-1],r=e[i];t(n,r)?e[i]=o(n,r):s.push(n)}return s}function sw(e){const t=(e,o)=>{let s;if(Lo(e))if(e.isPadding())s=o;else{const t=Object.assign({},e.getColGroupDef());t.groupId=e.getGroupId(),t.children=[o],s=t}else{const t=Object.assign({},e.getColDef());t.colId=e.getColId(),s=t}const i=e.getOriginalParent();return i?t(i,s):s};return e.map(e=>t(e,e.getColDef()))}var iw=class{constructor(e,t,o,s=!1,i){this.displayName=e,this.depth=o,this.group=s,this.localEventService=new u,s?(this.columnGroup=t,this._expanded=i,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 nw(e){return!!e?.buttons?.includes("apply")}function rw(e,t){if(!nw(t))return;const o=e.sideBar?.comp.openedItem();o&&(e.sideBar?.comp.getToolPanelInstance(o))?.refreshDeferredUi()}function lw(e,t,o,s,i){aw(e,function(e){const t=[],o=e=>{for(const s of e)s.passesFilter&&(s.group?o(s.children):t.push(s.column))};return o(e),t}(t),o,s,i)}function aw(e,t,o,s,i){e.columnStateUpdateStrategy.getPivotMode(nw(i))?function(e,t,o,s,i){!function(e,t,o,s,i){const n=e.columnStateUpdateStrategy,r=[],l=o?t=>{if(!n.isColumnSelectedInPivotModeToolPanel(nw(i),t))if(t.isAllowValue()){const o="string"==typeof t.getAggFunc()?t.getAggFunc():e.aggFuncSvc?.getDefaultAggFunc(t);r.push({colId:t.getId(),aggFunc:o})}else t.isAllowRowGroup()?r.push({colId:t.getId(),rowGroup:!0}):t.isAllowPivot()&&r.push({colId:t.getId(),pivot:!0})}:e=>{n.isColumnSelectedInPivotModeToolPanel(nw(i),e)&&r.push({colId:e.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(l),n.applyColumnState(nw(i),r,s),rw(e,i)}(e,t,o,s,i)}(e,t,o,s,i):function(e,t,o,s,i){const n=e.columnStateUpdateStrategy,r=[];for(const l of t)l.getColDef().lockVisible||n.isColumnVisibleInToolPanel(nw(i),l)!==o&&r.push({colId:l.getId(),hide:!o});n.applyColumnState(nw(i),r,s),rw(e,i)}(e,t,o,s,i)}function dw(e,t){const{columns:o,visibleState:s,pivotState:i,eventType:n}=t,r=e.columnStateUpdateStrategy,l=r.getPivotMode(nw(t)),a=o.map(e=>{const t=e.getColId();if(l){const e=i?.[t];return{colId:t,pivot:e?.pivot,rowGroup:e?.rowGroup,aggFunc:e?.aggFunc}}return{colId:t,hide:!s?.[t]}});r.applyColumnState(nw(t),a,n),rw(e,t)}function cw(e,t,o){if(!o)return function(e){return{pivot:e.isPivotActive(),rowGroup:e.isRowGroupActive(),aggFunc:e.isValueActive()?e.getAggFunc():void 0}}(e);const s=t.getRowGroupColumns(o).includes(e);return{pivot:t.getPivotColumns(o).includes(e),rowGroup:s,aggFunc:t.getValueColumns(o).includes(e)?t.getColumnAggFunc(o,e):void 0}}var hw=(e,t)=>{if(!t)return[];let o=e;for(let s=0,i=t.length;s{const s=e.aggData;s!==t&&(e.aggData=t,e.__localEventService&&pw(e,s,t,o))},gw=(e,t,o)=>{uw(e,t,o);const s=e.pinnedSibling;s&&uw(s,t,o);const i=e.sibling;if(i){uw(i,t,o);const e=i.pinnedSibling;e&&uw(e,t,o)}},pw=(e,t,o,s)=>{if(!o){if(!t)return;const o=Object.keys(t);for(let i=0,n=o.length;i{if(!e)return;const s=e.group;s!==o&&(e.group=o,e.updateHasChildren(),s&&!o&&(uw(e,null,t.colModel),e.setAllChildrenCount(null)),t.selectionSvc?.updateRowSelectable(e),e.dispatchRowEvent("groupChanged"))},fw=(e,t,o)=>{mw(e,t,o),mw(e.pinnedSibling,t,o)},Cw=(e,t)=>{const{gos:o,rowGroupColsSvc:s}=t;if(!s||!e)return!1;const i=o.get("groupLockGroupColumns");return!(!e.isRowGroupActive()||0===i)&&(-1===i||i>s.columns.findIndex(t=>t.getColId()===e.getColId()))},vw=(e,t,o)=>{const s=e(t,`${"groupBy"===t?"Group by":"Un-Group by"} ${o}`,[o]);return s.indexOf(o)>=0?s:`${s} ${o}`},ww={name:"menuItem",optionalMethods:["setActive","select","setExpanded","configureDefaults"]},bw={getMenuItemComp:(e,t,o)=>e.userCompFactory.getCompDetails(t,ww,"agMenuItem",Co(e.gos,o),!0)?.newAgStackInstance()??Ns.resolve(),getPostProcessPopupParams:({column:e,node:t})=>({column:e,rowNode:t}),preserveRangesWhile:function(e,t){if(!e.gos.get("enableCellTextSelection"))return t();if(!Ti()&&!Ei())return t();const{selection:o,ranges:s}=function(e){const t=v(e),o="getSelection"in t?t.getSelection():null,s=[];for(let i=0;i<(o?.rangeCount??0);i++){const e=o?.getRangeAt(i);e&&s.push(e)}return{selection:o,ranges:s}}(e);t(),o?.removeAllRanges();for(const i of s)o?.addRange(i)},stopPropagationCallbacks:Zi,warnNoItem:e=>{Dt(228,{menuItemOrString:e})}},yw=class extends Cv{constructor(){super(bw)}},Sw=class extends vv{constructor(e,t={column:null,node:null,value:null}){super(e,t,bw)}},Rw=class extends Pi{constructor(e,t,o,s={}){super({tag:"div",cls:"ag-menu"}),this.column=e,this.mouseEventOrTouch=t,this.parentEl=o,this.params=s,this.displayName=null}postConstruct(){const{column:e,beans:{colNames:t}}=this;let o;if(this.initializeProperties(e),o=So(e)?t.getDisplayNameForColumn(e,"columnToolPanel"):t.getDisplayNameForProvidedColumnGroup(null,e,"columnToolPanel"),this.displayName=o,this.buildMenuItemMap(),this.isActive()){const e=this.mouseEventOrTouch;"preventDefault"in e&&e.preventDefault();const t=this.getMappedMenuItems();if(0===t.length)return;this.displayContextMenu(t)}}initializeProperties(e){const t=this.beans.columnStateUpdateStrategy;let o;o=Lo(e)?e.getLeafColumns():[e],this.columns=o;const s=t.getPivotMode(nw(this.params));this.allowScrollIntoView=!s&&o.some(this.isColumnValidForScrollIntoView),this.allowGrouping=o.some(e=>e.isPrimary()&&e.isAllowRowGroup()),this.allowValues=o.some(e=>e.isPrimary()&&e.isAllowValue()),this.allowPivoting=s&&o.some(e=>e.isPrimary()&&e.isAllowPivot())}buildMenuItemMap(){const e=this.getLocaleTextFunc(),{beans:t,displayName:o}=this,s=this.beans.columnStateUpdateStrategy,i=/* @__PURE__ */new Map;this.menuItemMap=i;const n=nw(this.params),r=s.getPivotMode(n),l=new Set(s.getRowGroupColumns(n).map(e=>e.getColId())),a=new Set(s.getValueColumns(n).map(e=>e.getColId())),d=new Set(s.getPivotColumns(n).map(e=>e.getColId()));i.set("scrollIntoView",{allowedFunction:e=>!e.isPinned()&&!r&&this.isColumnValidForScrollIntoView(e),activeFunction:()=>!1,activateLabel:()=>e("scrollColumnIntoView",`Scroll ${o} into View`,[o]),activateFunction:()=>{const e=this.columns.find(this.isColumnValidForScrollIntoView);e&&this.beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(e)},deActivateFunction:()=>{},addIcon:"ensureColumnVisible"});const c=e=>e.isPrimary()&&e.isAllowRowGroup()&&!Cw(e,t);i.set("rowGroup",{allowedFunction:c,activeFunction:e=>l.has(e.getColId()),activateLabel:()=>vw(e,"groupBy",o),deactivateLabel:()=>vw(e,"ungroupBy",o),activateFunction:()=>{const e=this.addColumnsToList(s.getRowGroupColumns(n),c);s.setRowGroupColumns(n,e,"toolPanelUi"),rw(this.beans,this.params)},deActivateFunction:()=>{const e=this.removeColumnsFromList(s.getRowGroupColumns(n),c);s.setRowGroupColumns(n,e,"toolPanelUi"),rw(this.beans,this.params)},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"});const h=e=>e.isPrimary()&&e.isAllowValue();i.set("value",{allowedFunction:h,activeFunction:e=>a.has(e.getColId()),activateLabel:()=>e("addToValues",`Add ${o} to values`,[o]),deactivateLabel:()=>e("removeFromValues",`Remove ${o} from values`,[o]),activateFunction:()=>{const e=this.addColumnsToList(s.getValueColumns(n),h);s.setValueColumns(n,e,"toolPanelUi"),rw(this.beans,this.params)},deActivateFunction:()=>{const e=this.removeColumnsFromList(s.getValueColumns(n),h);s.setValueColumns(n,e,"toolPanelUi"),rw(this.beans,this.params)},addIcon:"valuePanel",removeIcon:"valuePanel"});const u=e=>r&&e.isPrimary()&&e.isAllowPivot();i.set("pivot",{allowedFunction:u,activeFunction:e=>d.has(e.getColId()),activateLabel:()=>e("addToLabels",`Add ${o} to labels`,[o]),deactivateLabel:()=>e("removeFromLabels",`Remove ${o} from labels`,[o]),activateFunction:()=>{const e=this.addColumnsToList(s.getPivotColumns(n),u);s.setPivotColumns(n,e,"toolPanelUi"),rw(this.beans,this.params)},deActivateFunction:()=>{const e=this.removeColumnsFromList(s.getPivotColumns(n),u);s.setPivotColumns(n,e,"toolPanelUi"),rw(this.beans,this.params)},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}isColumnValidForScrollIntoView(e){if(!e.isVisible())return!1;const t=e.getParent();return!t||(t.getDisplayedChildren()?.includes(e)??!0)}addColumnsToList(e,t){return[...e].concat(this.columns.filter(o=>t(o)&&!e.includes(o)))}removeColumnsFromList(e,t){return e.filter(e=>!t(e)||!this.columns.includes(e))}displayContextMenu(e){const t=this.getGui(),o=this.createBean(new Sw),s=this.getLocaleTextFunc();let i=()=>{};t.appendChild(o.getGui()),o.addMenuItems(e),o.addManagedListeners(o,{closeMenu:()=>{this.parentEl.focus(),i()}});const n=this.beans.popupSvc,r=n.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:()=>Wi(o.getGui()),ariaLabel:s("ariaLabelContextMenu","Context Menu"),closedCallback:e=>{e instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(o)}});r&&(i=r.hideFunc),n.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEventOrTouch,ePopup:t})}isActive(){return this.allowScrollIntoView||this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const e=[],{menuItemMap:t,columns:o,displayName:s,beans:i}=this;for(const n of t.values()){const t=o.some(e=>n.allowedFunction(e)&&!n.activeFunction(e)),r=o.some(e=>n.allowedFunction(e)&&n.activeFunction(e));t&&e.push({name:n.activateLabel(s),icon:Ol(n.addIcon,i,null),action:()=>n.activateFunction()}),r&&n.removeIcon&&n.deactivateLabel&&e.push({name:n.deactivateLabel(s),icon:Ol(n.removeIcon,i,null),action:()=>n.deActivateFunction?.()})}return e}},xw={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"}]},Fw=class extends Pi{constructor(e,t,o,s,i){super(),this.modelItem=e,this.allowDragging=t,this.eventType=o,this.focusWrapper=s,this.params=i,this.cbSelect=null,this.eLabel=null,this.eGroupOpenedIcon=null,this.eGroupClosedIcon=null,this.eColumnGroupIcons=null,this.processingColumnStateChange=!1;const{columnGroup:n,depth:r,displayName:l}=e;this.columnGroup=n,this.columnDepth=r,this.displayName=l}postConstruct(){this.setTemplate(xw,[za]);const{beans:e,cbSelect:t,eLabel:o,displayName:s,columnDepth:i,modelItem:n,focusWrapper:r,columnGroup:l}=this,{registry:a,gos:d}=e,c=Ol("columnDrag",e);this.eDragHandle=c,c.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const h=t.getGui(),u=t.getInputElement();h.after(c),u.setAttribute("tabindex","-1"),o.textContent=s??"",this.setupExpandContract(),this.addCss("ag-column-select-indent-"+i),this.getGui().style.setProperty("--ag-indentation-level",String(i)),this.tooltipFeature=this.createOptionalManagedBean(a.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumnGroup",shouldDisplayTooltip:Ag(d,()=>o)})),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(o,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(n,{expandedChanged:this.onExpandChanged.bind(this)});const g=new hn(this.getGui(),!1);this.addManagedListeners(g,{longTap:e=>this.onContextMenu(e.touchStart)}),this.addDestroyFunc(g.destroy.bind(g)),this.addManagedListeners(r,{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=nr(l.getColGroupDef(),d,null,l);for(const m of p)this.toggleCss(m,!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 ws:e.preventDefault(),this.modelItem.expanded=!1;break;case ys:e.preventDefault(),this.modelItem.expanded=!0;break;case vs:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected())}}onContextMenu(e){const{columnGroup:t,gos:o}=this;if(o.get("functionsReadOnly"))return;const s=this.createBean(new Rw(t,e,this.focusWrapper,this.params));this.addDestroyFunc(()=>{s.isAlive()&&this.destroyBean(s)})}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)return void K(this.eDragHandle,!1);const e=this.beans,{gos:t,eventSvc:o,dragAndDrop:s}=e;let i=!t.get("suppressDragLeaveHidesColumns");const n={type:ci.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>i?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{i=!t.get("suppressDragLeaveHidesColumns"),o.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{o.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:t=>{i&&dw(e,{columns:this.columnGroup.getLeafColumns(),visibleState:t?.visibleState,pivotState:t?.pivotState,eventType:this.eventType,buttons:this.params.buttons})},onGridExit:()=>{i&&this.onChangeCommon(!1)}};s.addDragSource(n,!0),this.addDestroyFunc(()=>s.removeDragSource(n))}createDragItem(){const e=this.columnGroup.getLeafColumns(),t={},o={},s=this.beans.columnStateUpdateStrategy,i=nw(this.params);for(const n of e){const e=n.getId();t[e]=n.isVisible(),o[e]=cw(n,s,i)}return{columns:e,visibleState:t,pivotState:o}}setupExpandContract(){const{beans:e,eGroupClosedIcon:t,eGroupOpenedIcon:o,eColumnGroupIcons:s}=this;t.appendChild(Hl("columnSelectClosed",e,null)),o.appendChild(Hl("columnSelectOpen",e,null));const i=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(t,{click:i}),this.addManagedElementListeners(o,{click:i});const n=new hn(s,!0);this.addManagedListeners(n,{tap:i}),this.addDestroyFunc(n.destroy.bind(n))}onLabelClicked(){const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}getVisibleLeafColumns(){const e=[],t=o=>{for(const s of o)s.passesFilter&&(s.group?t(s.children):e.push(s.column))};return t(this.modelItem.children),e}onChangeCommon(e){this.refreshAriaLabel(),this.processingColumnStateChange||lw(this.beans,this.modelItem.children,e,this.eventType,this.params)}refreshAriaLabel(){const{cbSelect:e,focusWrapper:t,displayName:o}=this,s=this.getLocaleTextFunc(),i=s("ariaColumnGroup","Column Group"),n=e.getValue(),r=void 0===n?s("ariaIndeterminate","indeterminate"):n?s("ariaVisible","visible"):s("ariaHidden","hidden"),l=s("ariaToggleVisibility","Press SPACE to toggle visibility");E(t,`${o} ${i}`),e.setInputAriaLabel(`${l} (${r})`),I(t,e.getInputElement().id)}onColumnStateChanged(){const e=this.workOutSelectedValue(),t=this.workOutReadOnlyValue();this.processingColumnStateChange=!0;const o=this.cbSelect;o.setValue(e),o.setReadOnly(t),this.toggleCss("ag-column-select-column-group-readonly",t),this.processingColumnStateChange=!1}workOutSelectedValue(){const e=this.beans.columnStateUpdateStrategy.getPivotMode(nw(this.params)),t=this.getVisibleLeafColumns();let o=0,s=0;for(const i of t)!e&&i.getColDef().lockVisible||(this.isColumnChecked(i)?o++:s++);if(!(o>0&&s>0))return o>0}workOutReadOnlyValue(){const e=this.beans.columnStateUpdateStrategy.getPivotMode(nw(this.params));let t=0;for(const o of this.columnGroup.getLeafColumns())e?o.isAnyFunctionAllowed()&&t++:o.getColDef().lockVisible||t++;return 0===t}isColumnChecked(e){const t=this.beans.columnStateUpdateStrategy;return t.getPivotMode(nw(this.params))?t.isColumnSelectedInPivotModeToolPanel(nw(this.params),e):t.isColumnVisibleInToolPanel(nw(this.params),e)}onExpandOrContractClicked(){const e=this.modelItem;e.expanded=!e.expanded}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const e=this.modelItem.expanded;K(this.eGroupClosedIcon,!e),K(this.eGroupOpenedIcon,e)}refreshAriaExpanded(){G(this.focusWrapper,this.modelItem.expanded)}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect,o=t.getValue();!t.isReadOnly()&&(e&&!o||!e&&o)&&t.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(e){this.cbSelect.setValue(e,!0)}},Dw=e=>Lo(e)?e.getLeafColumns():e?[e]:[],Mw=(e,t,o,s)=>{const i=nw(s);return!(!e.get("suppressMovableColumns")&&!t.columnStateUpdateStrategy.getPivotMode(i)&&!o.find(({colDef:e})=>!!e.suppressMovable||!!e.lockPosition))},Pw=(e,t,o,s)=>{if(!o)return;const{component:i}=o;let n=null,r="top"===o.position;if(i instanceof Fw?(n=i.getColumns()[0],r=!0):i&&(n=i.column),!n)return;const l=nw(s),a=((e,t,o,s)=>{if(!t||!e)return null;const i=s.indexOf(t),n=o?i:i+1;return n-((e,t,o)=>{if(!t)return 0;const s=t[0],i=t.length;return e.indexOf(s)this.focusWrapper,getLocation:()=>"columnToolPanelColumn",shouldDisplayTooltip:Ag(l,()=>s),getAdditionalParams:()=>({colDef:r.getColDef()})})),this.setupDragging();const u=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:u}),this.addManagedListeners(r,{columnValueChanged:u,columnPivotChanged:u,columnRowGroupChanged:u,visibleChanged:u}),this.addManagedListeners(a,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)});const g=new hn(a);this.addManagedListeners(g,{longTap:e=>this.onContextMenu(e.touchStart)}),this.addDestroyFunc(g.destroy.bind(g)),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(s,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip();const p=nr(r.getColDef(),l,r,null);for(const m of p)this.toggleCss(m,!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:o}=this;if(o.get("functionsReadOnly"))return;const s=this.createBean(new Rw(t,e,this.focusWrapper,this.params));this.addDestroyFunc(()=>{s.isAlive()&&this.destroyBean(s)})}handleKeyDown(e){e.key===vs&&(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||aw(this.beans,[this.column],e,"toolPanelUi",this.params))}refreshAriaLabel(){const{cbSelect:e,focusWrapper:t,displayName:o}=this,s=this.getLocaleTextFunc(),i=s("ariaColumn","Column"),n=e.getValue()?s("ariaVisible","visible"):s("ariaHidden","hidden"),r=s("ariaToggleVisibility","Press SPACE to toggle visibility");E(t,`${o} ${i}`),this.cbSelect.setInputAriaLabel(`${r} (${n})`),I(t,e.getInputElement().id)}setupDragging(){const e=this.eDragHandle;if(!this.allowDragging)return void K(e,!1);const t=this.beans,{gos:o,eventSvc:s,dragAndDrop:i}=t;nw(this.params)&&e.setAttribute("data-column-tool-panel-deferred","");let n=!o.get("suppressDragLeaveHidesColumns");const r={type:ci.ToolPanel,eElement:e,dragItemName:this.displayName,getDefaultIconName:()=>n&&!nw(this.params)?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{n=!o.get("suppressDragLeaveHidesColumns"),s.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{s.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:e=>{n&&!nw(this.params)&&dw(t,{columns:[this.column],visibleState:e?.visibleState,pivotState:e?.pivotState,eventType:"toolPanelUi",buttons:this.params.buttons})},onGridExit:()=>{n&&!nw(this.params)&&this.onChangeCommon(!1)}};i.addDragSource(r,!0),this.addDestroyFunc(()=>i.removeDragSource(r))}createDragItem(){const e=this.column.getColId(),t={[e]:this.column.isVisible()},o=this.beans.columnStateUpdateStrategy,s={[e]:cw(this.column,o,nw(this.params))};return{columns:[this.column],visibleState:t,pivotState:s}}onColumnStateChanged(){this.processingColumnStateChange=!0;const e=this.beans.columnStateUpdateStrategy,t=e.getPivotMode(nw(this.params));if(t){const t=e.isColumnSelectedInPivotModeToolPanel(nw(this.params),this.column);this.cbSelect.setValue(t)}else this.cbSelect.setValue(e.isColumnVisibleInToolPanel(nw(this.params),this.column));let o=!0,s=!0;if(t){const e=this.gos.get("functionsReadOnly"),t=!this.column.isAnyFunctionAllowed();o=!e&&!t,s=o}else{const{enableRowGroup:e,enableValue:t,lockPosition:i,suppressMovable:n,lockVisible:r}=this.column.getColDef();o=!r,s=!!e||!!t||!(i||n)}this.cbSelect.setReadOnly(!o),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!s),this.toggleCss("ag-column-select-column-readonly",!s&&!o),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){Dt(158)}},Iw=class{constructor(e){this.items=e}getRowCount(){return this.items.length}getRow(e){return this.items[e]}},Aw={selector:"AG-PRIMARY-COLS-LIST",component:class extends Pi{constructor(){super({tag:"div",cls:"ag-column-select-list",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,o){this.params=e;const{suppressSyncLayoutWithGrid:s,contractColumnSelection:i,suppressColumnMove:n}=e;this.allowDragging=t,this.eventType=o,s||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const r=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:r,columnPivotModeChanged:r,columnRowGroupChanged:r,columnValueChanged:r,columnVisible:r,newColumnsLoaded:r}),this.expandGroupsByDefault=!i;const l=n||s,a=this.createManagedBean(new Tv({cssIdentifier:"column-select",ariaRole:"tree",moveItemCallback:(e,t)=>{l||this.moveItems(e,t)}}));this.virtualList=a,this.appendChild(a.getGui()),a.setComponentCreator((e,t)=>(x(t,"level",e.depth+1),this.createComponentFromItem(e,t))),this.colModel.ready&&this.onColumnsChanged(),l||this.createItemDragFeature()}createItemDragFeature(){const{gos:e,beans:t,virtualList:o}=this;this.createManagedBean(new Iv(this,o,{dragSourceType:ci.ToolPanel,addListeners:(e,t,o)=>{e.addManagedEventListeners({columnPanelItemDragStart:t,columnPanelItemDragEnd:o})},getCurrentDragValue:e=>(e=>e.column)(e),isMoveBlocked:o=>Mw(e,t,Dw(o),this.params),getNumRows:e=>e.getDisplayedColsList().length,moveItem:(e,o)=>Pw(t,Dw(e),o,this.params)}))}moveItems(e,t){const{gos:o,beans:s}=this,{modelItem:i}=e,{group:n,columnGroup:r,column:l,expanded:a}=i,d=Dw(n?r:l);if(Mw(o,s,d,this.params))return;const c=this.displayedColsList.indexOf(i),h=t?-1:1;let u=0;if(t){const t=e.columnDepth>0?l.getParent()?.getChildren():null;t?.length&&l===t[0]&&(u=-1)}else n&&(u=a?i.children.length:0);const g=Math.min(Math.max(c+u+h,0),this.displayedColsList.length-1);this.skipRefocus=!0,Pw(s,d,{rowIndex:g,position:t?"top":"bottom",component:this.virtualList.getComponentAt(g)},this.params),this.focusRowIfAlive(g-u).then(()=>{this.skipRefocus=!1})}createComponentFromItem(e,t){const o=this.allowDragging;if(e.group){const s=new Fw(e,o,this.eventType,t,this.params);return this.createBean(s),s}const s=new Tw(e,o,this.groupsExist,t,this.params);return this.createBean(s),s}onColumnsChanged(){const e=this.params;this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!e.initialState);const t=this.getExpandedStates(),o=this.colModel.isPivotMode(),s=nw(e),i=s&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(s);(!e.suppressSyncLayoutWithGrid||s)&&!o||i?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 o of t)e[o]=!0;return e}return this.allColsTree?(this.forEachItem(t=>{if(!t.group)return;const o=t.columnGroup;o&&(e[o.getId()]=t.expanded)}),e):{}}setExpandedStates(e){if(!this.allColsTree)return;const{isInitialState:t}=this;this.forEachItem(o=>{if(!o.group)return;const s=o.columnGroup;if(s){const i=e[s.getId()];(null!=i||t)&&(o.expanded=!!i)}})}buildTreeFromWhatGridIsDisplaying(){const e=nw(this.params);if(e&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(e)){const o=this.beans.columnStateUpdateStrategy.getPrimaryColumns(e);if(o.length>0)return t=o,void this.setColumnLayout.bind(this)(ow(sw(t)))}var t,o;this.params.suppressSyncLayoutWithGrid?this.buildTreeFromProvidedColumnDefs():(o=this.colModel,this.setColumnLayout.bind(this)(ow(sw(function(e){return e.getCols().filter(e=>{const t=e.getColDef();return e.isPrimary()&&!t.showRowGroup})}(o)))))}setColumnLayout(e){const t=function(e,t){const o=[],s=(t,i)=>{if(Jv(t)){const e=t,o=new Go(e,void 0!==e.groupId?e.groupId:e.headerName,!1,i),n=[];for(const t of e.children){const e=s(t,i+1);e&&n.push(e)}return o.setChildren(n),o}{const s=t,i=s.colId?s.colId:s.field,n=e.getColDefCol(i);return n||o.push(s),n}},i=[];for(const n of t){const e=s(n,0);e&&i.push(e)}return o.length>0&&Dt(217,{invalidColIds:o}),i}(this.colModel,e);this.buildListModel(t),this.groupsExist=e.some(e=>e&&void 0!==e.children),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),o=e=>{e.addEventListener("expandedChanged",t);const o=e.removeEventListener.bind(e,"expandedChanged",t);this.destroyColumnItemFuncs.push(o)},s=this.beans.colNames,i=(e,t,o)=>{for(const s of e)Lo(s)?n(s,t,o):r(s,t,o)},n=(e,t,n)=>{if(e.getColGroupDef()?.suppressColumnsToolPanel)return;if(e.isPadding())return void i(e.getChildren(),t,n);const r=new iw(s.getDisplayNameForProvidedColumnGroup(null,e,"columnToolPanel"),e,t,!0,this.expandGroupsByDefault);n.push(r),o(r),i(e.getChildren(),t+1,r.children)},r=(e,t,o)=>{if(e.getColDef()?.suppressColumnsToolPanel)return;const i=s.getDisplayNameForColumn(e,"columnToolPanel");o.push(new iw(i,e,t))};this.destroyColumnTree(),i(e,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const e=t=>{t.passesFilter&&(this.displayedColsList.push(t),t.group&&t.expanded&&t.children.forEach(e))},t=this.virtualList;this.allColsTree.forEach(e),t.setModel(new Iw(this.displayedColsList));let o=null;this.skipRefocus||(o=t.getLastFocusedRow()),t.refresh(),null!=o&&this.focusRowIfAlive(o),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const e=this.getLocaleTextFunc(),t=e("ariaColumnPanelList","Column List"),o=e("columns","Columns"),s=this.displayedColsList.length;E(this.virtualList.getAriaElement(),`${t} ${s} ${o}`)}focusRowIfAlive(e){return-1===e?Promise.resolve():new Promise(t=>{window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e),t()},0)})}forEachItem(e){const t=o=>{for(const s of o)e(s),s.group&&t(s.children)},o=this.allColsTree;o&&t(o)}doSetExpandedAll(e){this.forEachItem(t=>{t.group&&(t.expanded=e)})}setGroupsExpanded(e,t){if(!t)return void this.doSetExpandedAll(e);const o=[];this.forEachItem(s=>{if(!s.group)return;const i=s.columnGroup.getId();t.indexOf(i)>=0&&(s.expanded=e,o.push(i))});const s=t.filter(e=>!o.includes(e));s.length>0&&Dt(157,{unrecognisedGroupIds:s})}getExpandState(){let e=0,t=0;return this.forEachItem(o=>{o.group&&(o.expanded?e++:t++)}),e>0&&t>0?2:t>0?1:0}doSetSelectedAll(e){lw(this.beans,this.allColsTree,e,this.eventType,this.params),this.syncVisibleSelectionState(),this.fireSelectionChangedEvent()}syncVisibleSelectionState(){for(let e=0;e{if(i.group)return;if(!i.passesFilter)return;const n=i.column,r=n.getColDef();let l;if(s){if(!n.isAllowPivot()&&!n.isAllowRowGroup()&&!n.isAllowValue())return;l=o.isColumnSelectedInPivotModeToolPanel(nw(this.params),n)??!1}else{if(r.lockVisible)return;l=o.isColumnVisibleInToolPanel(nw(this.params),n)??!1}l?e++:t++}),!(e>0&&t>0))return!(0===e||t>0)}setFilterText(e){this.filterText=l(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const e=e=>{if(!l(this.filterText))return!0;const t=e.displayName;return null==t||-1!==t.toLowerCase().indexOf(this.filterText)},t=(o,s)=>{let i=!1;if(o.group){const n=e(o);for(const e of o.children){const o=t(e,n||s);o&&(i=o)}}const n=!(!s&&!i)||e(o);return o.passesFilter=n,n};for(const o of this.allColsTree)t(o,!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):e}}},kw={tag:"div",cls:"ag-column-select",children:[{tag:"ag-primary-cols-header",ref:"primaryColsHeaderPanel"},{tag:"ag-primary-cols-list",ref:"primaryColsListPanel"}]},Lw=class extends Pi{constructor(){super(kw,[Xv,Aw]),this.primaryColsHeaderPanel=null,this.primaryColsListPanel=null,this.registerCSS(".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}")}init(e,t,o){const{primaryColsHeaderPanel:s,primaryColsListPanel:i}=this;s.init(t);const n=t.suppressColumnFilter,r=t.suppressColumnSelectAll;t.suppressColumnExpandAll&&n&&r&&s.setDisplayed(!1),this.addManagedListeners(i,{groupExpanded:e=>{s.setExpandState(e.state),t.onStateUpdated()},selectionChanged:e=>s.setSelectionState(e.state)}),i.init(t,e,o),this.addManagedListeners(s,{expandAll:i.doSetExpandedAll.bind(i,!0),collapseAll:i.doSetExpandedAll.bind(i,!1),selectAll:i.doSetSelectedAll.bind(i,!0),unselectAll:i.doSetSelectedAll.bind(i,!1),filterChanged:e=>i.setFilterText(e.filterText)}),this.positionableFeature=this.createManagedBean(new mi(this.getGui(),{minHeight:100}))}toggleResizable(e){this.positionableFeature.setResizable(!!e&&{bottom:!0})}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()}};function Gw(e,t,o){null!=e&&null!=t&&e.splice(o,0,...t)}var Nw={tag:"div",cls:"ag-unselectable",role:"presentation"},Bw=class extends Pi{constructor(e){super(Nw),this.horizontal=e,this.state="notDragging",this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=Cl({tag:"div"}),this.addElementClasses(this.ePillDropList,"list"),this.registerCSS(".ag-column-drop{align-items:center;display:inline-flex;overflow:auto;position:relative;width:100%}.ag-column-drop-list{align-items:center;display:flex}.ag-column-drop-cell{align-items:center;background-color:var(--ag-column-drop-cell-background-color);border:var(--ag-column-drop-cell-border);border-radius:500px;color:var(--ag-column-drop-cell-text-color);display:flex;padding:calc(var(--ag-spacing)*.25);position:relative;&:focus-visible{box-shadow:var(--ag-focus-shadow)}:where(.ag-drag-handle){color:var(--ag-column-drop-cell-drag-handle-color)}}:where(.ag-ltr) .ag-column-drop-cell{padding-left:calc(var(--ag-spacing)*.75)}:where(.ag-rtl) .ag-column-drop-cell{padding-right:calc(var(--ag-spacing)*.75)}.ag-column-drop-cell-text{flex:1 1 auto;margin:0 var(--ag-spacing);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-drop-vertical{align-items:stretch;display:flex;flex-direction:column;min-height:75px;overflow:hidden}.ag-column-drop-vertical-title-bar{align-items:center;display:flex;flex:none;padding:var(--ag-widget-container-vertical-padding) calc(var(--ag-spacing)*2) 0}.ag-column-drop-vertical-list{align-items:stretch;flex-direction:column;flex-grow:1;overflow-x:auto;padding-bottom:var(--ag-spacing);padding-left:var(--ag-spacing);padding-right:var(--ag-spacing);position:relative}:where(.ag-column-drop-empty) .ag-column-drop-vertical-list{overflow:hidden}.ag-column-drop-cell-button{cursor:pointer;min-width:0;opacity:.75}:where(.ag-ltr) .ag-column-drop-cell-button{margin-right:calc(var(--ag-spacing)/4)}:where(.ag-rtl) .ag-column-drop-cell-button{margin-left:calc(var(--ag-spacing)/4)}.ag-column-drop-cell-button:hover{opacity:1}:where(.ag-ltr) .ag-column-drop-cell-drag-handle{margin-left:calc(var(--ag-spacing)/4)}:where(.ag-rtl) .ag-column-drop-cell-drag-handle{margin-right:calc(var(--ag-spacing)/4)}.ag-column-drop-wrapper{display:flex}.ag-column-drop-horizontal-half-width{width:50%!important}.ag-column-drop-cell-ghost{opacity:.5}.ag-column-drop-horizontal{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;white-space:nowrap}:where(.ag-ltr) .ag-column-drop-horizontal{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-column-drop-horizontal{padding-right:var(--ag-cell-horizontal-padding)}.ag-column-drop-horizontal-list{gap:var(--ag-cell-widget-spacing)}.ag-column-drop-vertical-cell{margin-top:var(--ag-spacing)}:where(.ag-ltr) .ag-column-drop-vertical-icon{margin-right:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-column-drop-vertical-icon{margin-left:var(--ag-widget-horizontal-spacing)}.ag-select-agg-func-popup{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-dropdown-shadow);height:calc(var(--ag-spacing)*5*3.5);padding:0;position:absolute}.ag-select-agg-func-virtual-list-item{cursor:default}:where(.ag-ltr) .ag-select-agg-func-virtual-list-item{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-select-agg-func-virtual-list-item{padding-right:calc(var(--ag-spacing)*2)}.ag-select-agg-func-virtual-list-item:hover{background-color:var(--ag-selected-row-background-color)}:where(.ag-ltr) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-left:solid var(--ag-border-width) var(--ag-border-color)}")}toggleResizable(e){this.positionableFeature.setResizable(!!e&&{bottom:!0}),this.resizeEnabled=e}isSourceEventFromTarget(e){const{dropZoneTarget:t,dragSource:o}=e;return t.contains(o.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){for(const e of this.guiDestroyFunctions)e();this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,se(this.getGui()),se(this.ePillDropList)}init(e){this.params=e??{},this.createManagedBean(new Qi(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.onKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new mi(this.getGui()),this.createManagedBean(this.positionableFeature),this.refreshGui(),E(this.ePillDropList,this.getAriaLabel())}onTabKeyDown(t){const o=zi(this.getFocusableElement(),null,!0),s=o.length;if(0===s)return;const{shiftKey:i}=t,n=w(this.beans),r=n===o[0],l=n===e(o);1===s||r&&i||l&&!i||o[i?0:s-1].focus()}onKeyDown(e){const{key:t}=e,o=!this.horizontal;let s=t===Ss,i=t===bs;if(!o){const e=this.gos.get("enableRtl");s=!e&&t===ys||e&&t===ws,i=!e&&t===ws||e&&t===ys}if(s||i)if(e.preventDefault(),e.shiftKey)this.moveFocusedItem(i);else{const e=Ui(this.beans,this.getFocusableElement(),!1,i);e&&e.focus()}}moveFocusedItem(e){const t=this.getFocusedItem();if(-1===t)return;const o=e?-1:1;if(!this.normalizeAndUpdateInsertIndex(t,t+o))return;const s=this.childPillComponents[t];if(!s.isMovable())return;const i=s.getItem();this.focusItemAtIndex(this.insertIndex),this.rearrangeItems([i],!0)}addElementClasses(e,t){t=t?`-${t}`:"";const o=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop${t}`,`ag-column-drop-${o}${t}`)}setupDropTarget(){this.dropTarget={getContainer:this.getGui.bind(this),getIconName:this.getIconName.bind(this),onDragging:this.onDragging.bind(this),onDragEnter:this.onDragEnter.bind(this),onDragLeave:this.onDragLeave.bind(this),onDragStop:this.onDragStop.bind(this),onDragCancel:this.onDragCancel.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.beans.dragAndDrop?.addDropTarget(this.dropTarget)}minimumAllowedNewInsertIndex(){return 0}checkInsertIndex(e){const t=this.getNewInsertIndex(e);return!(t<0)&&this.normalizeAndUpdateInsertIndex(this.insertIndex,t)}normalizeAndUpdateInsertIndex(e,t){const o=this.minimumAllowedNewInsertIndex(),s=Math.max(o,t),i=s!==e;return i&&(this.insertIndex=s),i}getNewInsertIndex(e){const t=e.event,o=this.horizontal?t.clientX:t.clientY,s=this.childPillComponents.map(e=>e.getGui().getBoundingClientRect()),i=s.findIndex(e=>this.horizontal?e.right>o&&e.lefto);if(-1===i){const e=this.gos.get("enableRtl");return s.every(e=>o>(this.horizontal?e.right:e.bottom))?e&&this.horizontal?0:this.childPillComponents.length:s.every(e=>o<(this.horizontal?e.left:e.top))?e&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=i?i+1:i}checkDragStartedBySelf(e){"notDragging"===this.state&&(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 o=t.filter(t=>this.isItemDroppable(t,e)),s=o.every(e=>-1!==this.childPillComponents.map(e=>e.getItem()).indexOf(e));0!==o.length&&(this.potentialDndItems=o,s?this.state="notDragging":(this.handleDragEnterEnd(e),this.checkInsertIndex(e),this.refreshGui()))}isPotentialDndItems(){return!!this.potentialDndItems?.length}handleDragLeaveEnd(e){}onDragLeave(e){if("rearrangeItems"===this.state){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()&&("newItemsIn"===this.state&&this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}onDragStop(){this.isPotentialDndItems()&&("newItemsIn"===this.state?this.addItems(this.potentialDndItems):this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}removeItems(e){const t=this.getExistingItems().filter(t=>!e.includes(t));this.updateItems(t),this.refreshGui()}addItems(e){if(!e)return;const t=this.getExistingItems().slice();Gw(t,e.filter(e=>t.indexOf(e)<0),this.insertIndex),this.updateItems(t),this.refreshGui()}addItem(e){this.insertIndex=this.getExistingItems().length,this.addItems([e])}rearrangeItems(e,o){let s;return s=o?this.getExistingItems().filter(t=>-1===e.indexOf(t)):this.getNonGhostItems().slice(),Gw(s,e,this.insertIndex),!t(s,this.getExistingItems())&&(this.updateItems(s),this.refreshGui(),!0)}refreshGui(){let e=0;this.horizontal||(e=this.ePillDropList.scrollTop);const t=this.resizeEnabled,o=this.getFocusedItem(),{eGridDiv:s}=this.beans,i=Vi();let n=null;i&&(n=Ui(this.beans,s)??Ui(this.beans,s,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),0!==e&&(this.ePillDropList.scrollTop=e),t&&this.toggleResizable(t),i&&this.restoreFocus(o,n)}getFocusedItem(){const e=this.getGui(),t=w(this.beans);return e.contains(t)?Array.from(e.querySelectorAll(".ag-column-drop-cell")).indexOf(t):-1}focusItemAtIndex(e){const t=this.getGui(),o=Array.from(t.querySelectorAll(".ag-column-drop-cell"))[e];o&&o.focus({preventScroll:!0})}restoreFocus(e,t){const o=this.getGui(),s=Array.from(o.querySelectorAll(".ag-column-drop-cell"));if(-1===e)return;0===s.length&&t.focus();const i=s[Math.min(s.length-1,e)];i&&i.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(e=>!this.potentialDndItems.includes(e)):e}addItemsToGui(){const e=this.getNonGhostItems().map(e=>this.createItemComponent(e,!1));if(this.isPotentialDndItems()){const t=this.potentialDndItems.map(e=>this.createItemComponent(e,!0));this.insertIndex>=e.length?e.push(...t):e.splice(this.insertIndex,0,...t)}this.appendChild(this.ePillDropList),e.forEach((e,t)=>{t>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(e.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){const{childPillComponents:e,ePillDropList:t}=this,o=e.length;P(t,0===o?"presentation":"listbox");for(let s=0;sthis.destroyBean(o)),t||this.childPillComponents.push(o),o}addIconAndTitleToGui(){const{title:e,icon:t}=this.params;if(!e||!t)return;const o=Cl({tag:"div"});if(L(o,!0),this.addElementClasses(o,"title-bar"),this.addElementClasses(t,"icon"),this.toggleCss("ag-column-drop-empty",this.isExistingItemsEmpty()),o.appendChild(t),!this.horizontal){const t=Cl({tag:"span"});this.addElementClasses(t,"title"),t.textContent=e,o.appendChild(t)}this.appendChild(o)}isExistingItemsEmpty(){return 0===this.getExistingItems().length}addEmptyMessageToGui(){const{emptyMessage:e}=this.params;if(!e||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;const t=Cl({tag:"span"});t.textContent=e,this.addElementClasses(t,"empty-message"),this.ePillDropList.appendChild(t)}addArrow(e){if(this.horizontal){const t=Ol(this.gos.get("enableRtl")?"panelDelimiterRtl":"panelDelimiter",this.beans);this.addElementClasses(t,"cell-separator"),e.appendChild(t)}}},Hw={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"}]},Ow=class extends Pi{constructor(e,t,o,s,i){super(),this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=o,this.template=s,this.agComponents=i,this.eText=null,this.eDragHandle=null,this.eButton=null}postConstruct(){this.setTemplate(this.template??Hw,this.agComponents);const e=this.getGui(),{beans:t,eDragHandle:o,eText:s,eButton:i}=this;this.addElementClasses(e),this.addElementClasses(o,"drag-handle"),this.addElementClasses(s,"text"),this.addElementClasses(i,"button"),o.appendChild(Ol("columnDrag",t)),i.appendChild(Ol("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),E(this.getGui(),t.join(". "))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){const o=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(o)}}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,o=this.createGetDragItem(),s=this.getDefaultIconName(),i={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>s,getDragItem:o,dragItemName:this.getDisplayName()};e?.addDragSource(i,!0),this.addDestroyFunc(()=>e?.removeDragSource(i))}setupComponents(){this.eText.textContent=this.getDisplayValue(),this.setupRemove(),this.ghost&&this.addCss("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){K(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const e={type:"columnRemove"};this.addGuiEventListener("keydown",e=>this.onKeyDown(e)),this.addManagedElementListeners(this.eButton,{click:t=>{this.dispatchLocalEvent(e),t.stopPropagation()}});const t=new hn(this.eButton);this.addManagedListeners(t,{tap:()=>this.dispatchLocalEvent(e)}),this.addDestroyFunc(t.destroy.bind(t))}onKeyDown(e){e.key===Rs&&this.isRemovable()&&(e.preventDefault(),this.dispatchLocalEvent({type:"columnRemove"}))}getDisplayValue(){return this.getDisplayName()}addElementClasses(e,t){t=t?`-${t}`:"";const o=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${o}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}},Vw=class extends Ow{constructor(e,t,o,s,i,n){super(t,o,i),this.column=e,this.dropZonePurpose=s,this.updateParams=n,this.eSortIndicator=null,this.popupShowing=!1,this.deferApply=nw(n)}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 o=this.gos.get("rowGroupPanelSuppressSort"),s=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!s){const o=t("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");e.push(o)}if(this.isGroupingZone()&&this.column.isSortable()&&!o){const o=t("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");e.push(o)}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:o}=this.getColumnAndAggFuncName(),s=e("ariaDropZoneColumnComponentAggFuncSeparator"," of "),i={asc:e("ariaDropZoneColumnComponentSortAscending","ascending"),desc:e("ariaDropZoneColumnComponentSortDescending","descending")},n=this.getCurrentSortDirection(this.column),r=this.gos.get("rowGroupPanelSuppressSort");return[o&&`${o}${s}`,t,this.isGroupingZone()&&!r&&n&&`, ${i[n]}`].filter(e=>!!e).join("")}getColumnAndAggFuncName(){const e=this.displayName;let t="";if(this.isAggregationZone()){const e=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column),o="string"==typeof e?e:"agg";t=this.getLocaleTextFunc()(o,o)}return{name:e,aggFuncName:t}}setupSort(){if(!this.column.isSortable()||!this.isGroupingZone())return;const{gos:e,column:t,eSortIndicator:o}=this;if(!e.get("rowGroupPanelSuppressSort")){o.setupSort(t,!0,this.getSortDefOverride.bind(this));const e=e=>{e.preventDefault(),this.beans.columnStateUpdateStrategy.progressSortFromEvent(this.deferApply,t,e),o.refresh(),this.setupAria(),rw(this.beans,this.updateParams)};this.addGuiEventListener("click",e),this.addGuiEventListener("keydown",t=>{t.key===fs&&this.isGroupingZone()&&e(t)})}}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===fs&&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,o=new Tv({cssIdentifier:"select-agg-func"}),s=e.getFuncNames(this.column),i=this.getGui(),n=o.getGui();o.setModel({getRow:function(e){return s[e]},getRowCount:function(){return s.length}}),this.createBean(o);const r=Cl({tag:"div",cls:"ag-select-agg-func-popup"});r.style.top="0px",r.style.left="0px",r.appendChild(n),r.style.width=`${i.clientWidth}px`;const[l]=this.addManagedElementListeners(r,{focusout:e=>{!r.contains(e.relatedTarget)&&d&&d.hideFunc()}}),a=this.getLocaleTextFunc(),d=t.addPopup({modal:!0,eChild:r,closeOnEsc:!0,closedCallback:e=>{this.destroyBean(o),this.popupShowing=!1,"Escape"===e?.key&&i.focus(),l&&l()},ariaLabel:a("ariaLabelAggregationFunction","Aggregation Function")});d&&o.setComponentCreator(this.createAggSelect.bind(this,d.hideFunc)),o.addGuiEventListener("keydown",e=>{if(e.key===fs||e.key===vs){const e=o.getLastFocusedRow();if(null==e)return;const t=o.getComponentAt(e);t&&t.selectItem()}}),t.positionPopupByComponent({type:"aggFuncSelect",eventSource:i,ePopup:r,keepWithinBounds:!0,additionalParams:{column:this.column},position:"under"}),o.refresh();const c=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column);let h=s.findIndex(e=>e===c);-1===h&&(h=0),o.focusRow(h)}createAggSelect(e,t){const o=this.getLocaleTextFunc(),s=(t||"").toString();return new zw(()=>{if(e(),this.getGui().focus(),this.beans.columnStateUpdateStrategy.setColumnAggFunc(this.deferApply,this.column,t,"toolPanelDragAndDrop"),this.column){const e=this.getGui().querySelector(".ag-column-drop-cell-text");e&&(e.textContent=this.getDisplayValue()),this.setupAria()}rw(this.beans,this.updateParams)},o(s,s))}isGroupingAndLocked(){return this.isGroupingZone()&&Cw(this.column,this.beans)}isAggregationZone(){return"aggregation"===this.dropZonePurpose}isGroupingZone(){return"rowGroup"===this.dropZonePurpose}getDragSourceType(){return ci.ToolPanel}destroy(){super.destroy(),this.column=null}},zw=class extends Pi{constructor(e,t){super({tag:"div",cls:"ag-select-agg-func-item",children:t}),this.selectItem=e,this.addGuiEventListener("click",this.selectItem)}},Ww=class extends Bw{constructor(e,t,o){super(e),this.dropZonePurpose=t,this.updateParams=o,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===ci.HeaderCell||e===ci.ToolPanel&&(!this.horizontal||!t.hasAttribute("data-column-tool-panel-deferred"))}minimumAllowedNewInsertIndex(){const{gos:e,rowGroupColsSvc:t}=this.beans,o=e.get("groupLockGroupColumns"),s=t?.columns.length??0;return-1===o?s:Math.min(o,s)}showOrHideColumnOnExit(e){return this.isRowGroupPanel()&&Xt(this.gos,!0)&&!e.fromNudge}handleDragEnterEnd(e){if(this.showOrHideColumnOnExit(e)){const t=e.dragSource.getDragItem().columns;this.setColumnsVisible(t,!1,"uiColumnDragged")}}handleDragLeaveEnd(e){if(this.showOrHideColumnOnExit(e)){const t=e.dragSource.getDragItem();this.setColumnsVisible(t.columns,!0,"uiColumnDragged")}}setColumnsVisible(e,t,o){if(!e)return;if(nw(this.updateParams))return;const s=e.filter(e=>!e.getColDef().lockVisible);this.beans.columnStateUpdateStrategy.setColumnsVisible(!1,s,t,o)}isRowGroupPanel(){return"rowGroup"===this.dropZonePurpose}createPillComponent(e,t,o,s){return new Vw(e,t,o,this.dropZonePurpose,s,this.updateParams)}},Uw=class extends Ww{constructor(e,t){super(e,"pivot",t)}postConstruct(){const e=this.getLocaleTextFunc(),t=e("pivotColumnsEmptyMessage","Drag here to set column labels"),o=e("pivots","Column Labels");super.init({icon:Ol("pivotPanel",this.beans,null),emptyMessage:t,title:o}),this.horizontal&&In(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 o=e.isPivotActive();this.setDisplayed(t&&o);break}default:this.setDisplayed(!1)}else this.setDisplayed(this.beans.columnStateUpdateStrategy.getPivotMode(nw(this.updateParams)))}isItemDroppable(e,t){if(this.gos.get("functionsReadOnly")||!e.isPrimary())return!1;const o=this.beans.columnStateUpdateStrategy.getPivotColumns(nw(this.updateParams)).includes(e);return e.isAllowPivot()&&(!o||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.columnStateUpdateStrategy.setPivotColumns(nw(this.updateParams),e,"toolPanelUi"),rw(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getPivotColumns(nw(this.updateParams))}getFocusableContainerName(){return"pivotToolbar"}},$w=class extends Ww{constructor(e,t){super(e,"rowGroup",t)}postConstruct(){const e=this.getLocaleTextFunc(),t=e("rowGroupColumnsEmptyMessage","Drag here to set row groups"),o=e("groups","Row Groups");super.init({icon:Ol("rowGroupPanel",this.beans,null),emptyMessage:t,title:o}),this.horizontal&&In(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 o=this.beans.columnStateUpdateStrategy.getRowGroupColumns(nw(this.updateParams)).includes(e);return e.isAllowRowGroup()&&(!o||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.columnStateUpdateStrategy.setRowGroupColumns(nw(this.updateParams),e,"toolPanelUi"),rw(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getRowGroupColumns(nw(this.updateParams))}getFocusableContainerName(){return"rowGroupToolbar"}},jw=class extends Ww{constructor(e,t){super(e,"aggregation",t)}postConstruct(){const e=this.getLocaleTextFunc(),t=e("valueColumnsEmptyMessage","Drag here to aggregate"),o=e("values","Values");super.init({icon:Ol("valuePanel",this.beans,null),emptyMessage:t,title:o}),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 o=this.beans.columnStateUpdateStrategy.getValueColumns(nw(this.updateParams)).includes(e);return e.isAllowValue()&&(!o||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.columnStateUpdateStrategy.setValueColumns(nw(this.updateParams),e,"toolPanelUi"),rw(this.beans,this.updateParams)}getExistingItems(){return this.beans.columnStateUpdateStrategy.getValueColumns(nw(this.updateParams))}},Kw={tag:"div",cls:"ag-pivot-mode-panel",children:[{tag:"ag-toggle-button",ref:"cbPivotMode",cls:"ag-pivot-mode-select"}]},_w=class extends Pi{constructor(e,t){super(),this.params=e,this.onPivotModeValueChanged=t,this.cbPivotMode=null}getCurrentPivotMode(){return this.beans.columnStateUpdateStrategy.getPivotMode(nw(this.params))}syncFromGrid(){this.cbPivotMode.setValue(this.getCurrentPivotMode())}refreshEditStrategy(){this.syncFromGrid()}postConstruct(){this.setTemplate(Kw,[Sm]);const e=this.cbPivotMode;e.setValue(this.getCurrentPivotMode());const t=this.getLocaleTextFunc();e.setLabel(t("pivotMode","Pivot Mode"));const o=()=>{e.setValue(this.getCurrentPivotMode())};this.addManagedListeners(e,{fieldValueChanged:()=>{const t=!!e.getValue();this.beans.columnStateUpdateStrategy.setPivotMode(nw(this.params),t,"toolPanelUi"),this.onPivotModeValueChanged?.()}}),this.addManagedEventListeners({newColumnsLoaded:o,columnPivotModeChanged:o})}},qw=()=>{},Yw=class extends Oe{constructor(){super(...arguments),this.beanName="columnStateUpdateExecutionStrategy"}applyColumnState(e,t,o){this.getUpdateStrategy(e).applyColumnState(t,o)}commit(e){this.getUpdateStrategy(e).commit()}hasPendingChanges(e){return this.getUpdateStrategy(e).hasPendingChanges()}moveColumns(e,t,o,s){this.getUpdateStrategy(e).moveColumns(t,o,s)}reset(e){this.getUpdateStrategy(e).reset()}setColumnsVisible(e,t,o,s){this.getUpdateStrategy(e).setColumnsVisible(t,o,s)}isColumnVisibleInToolPanel(e,t){return this.getUpdateStrategy(e).isColumnVisibleInToolPanel(t)}setRowGroupColumns(e,t,o){this.getUpdateStrategy(e).setRowGroupColumns(t,o)}getRowGroupColumns(e){return this.getUpdateStrategy(e).getRowGroupColumns()}getPrimaryColumns(e){return this.getUpdateStrategy(e).getPrimaryColumns()}hasDeferredColumnOrder(e){return this.getUpdateStrategy(e).hasDeferredColumnOrder()}setValueColumns(e,t,o){this.getUpdateStrategy(e).setValueColumns(t,o)}getValueColumns(e){return this.getUpdateStrategy(e).getValueColumns()}setColumnAggFunc(e,t,o,s){this.getUpdateStrategy(e).setColumnAggFunc(t,o,s)}getColumnAggFunc(e,t){return this.getUpdateStrategy(e).getColumnAggFunc(t)}setPivotColumns(e,t,o){this.getUpdateStrategy(e).setPivotColumns(t,o)}getPivotColumns(e){return this.getUpdateStrategy(e).getPivotColumns()}setPivotMode(e,t,o){this.getUpdateStrategy(e).setPivotMode(t,o)}getPivotMode(e){return this.getUpdateStrategy(e).getPivotMode()}isColumnSelectedInPivotModeToolPanel(e,t){return this.getUpdateStrategy(e).isColumnSelectedInPivotModeToolPanel(t)}progressSortFromEvent(e,t,o){this.getUpdateStrategy(e).progressSortFromEvent(t,o)}getSortDef(e,t){return this.getUpdateStrategy(e).getSortDef(t)}getUpdateStrategy(e){return e?this.getDeferredUpdateStrategy():this.getSyncUpdateStrategy()}getSyncUpdateStrategy(){return this.syncUpdateStrategy??(this.syncUpdateStrategy=new Zw(this.beans))}getDeferredUpdateStrategy(){return this.deferredUpdateStrategy??(this.deferredUpdateStrategy=new Qw(this.beans))}},Zw=class{constructor(e){this.beans=e,this.lastPivotColIds=[],this.reset=qw,this.commit=qw,this.hasPendingChanges=()=>!1,this.hasDeferredColumnOrder=()=>!1}applyColumnState(e,t){0!==e.length&&Aa(this.beans,{state:e},t)}moveColumns(e,t,o){var s;this.beans.colMoves?.moveColumns(e,t,o),eb(s=this.beans,s.colModel.getCols().filter(e=>sb(e)).map(e=>s.colModel.getColDefCol(e.getColId())).filter(e=>!!e))}setColumnsVisible(e,t,o){const s=e.filter(e=>!e.getColDef().lockVisible);this.beans.colModel.setColsVisible(s,t,o)}setRowGroupColumns(e,t){this.beans.rowGroupColsSvc?.setColumns(e,t)}getRowGroupColumns(){return this.beans.rowGroupColsSvc?.columns??[]}getPrimaryColumns(){return ob(this.beans)}setValueColumns(e,t){this.beans.valueColsSvc?.setColumns(e,t)}getValueColumns(){return this.beans.valueColsSvc?.columns??[]}setColumnAggFunc(e,t,o){this.beans.valueColsSvc?.setColumnAggFunc?.(e,t,o)}getColumnAggFunc(e){return e.getAggFunc()}setPivotColumns(e,t){this.lastPivotColIds=e.map(e=>e.getColId()),this.beans.pivotColsSvc?.setColumns(e,t)}getPivotColumns(){return this.beans.pivotColsSvc?.columns??[]}setPivotMode(e,t){const{colModel:o,gos:s,ctrlsSvc:i}=this.beans;if(e===o.isPivotMode())return;const n=this.beans.pivotColsSvc?.columns.map(e=>e.getColId())??[];if(n.length>0&&(this.lastPivotColIds=n),!e){const e=this.beans.colModel.getColDefCols()??[];Aa(this.beans,{state:e.map(e=>({colId:e.getColId(),pivot:!1,pivotIndex:null}))},t)}s.updateGridOptions({options:{pivotMode:e},source:t}),e&&this.lastPivotColIds.length>0&&this.beans.pivotColsSvc?.setColumns(this.lastPivotColIds,t);for(const r of i.getHeaderRowContainerCtrls())r.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()}},Qw=class{constructor(e){this.beans=e,this.state={},this.sequence=0,this.lastPivotColIds=[]}reset(){this.sequence=0,this.state={}}hasPendingChanges(){const{state:e,beans:o}=this,{columnState:s,columnOrder:i,rowGroup:n,aggregation:r,pivot:l,pivotMode:a,sort:d,aggFuncs:c}=e,h=e=>(e??[]).map(e=>e.getColId());if(s)for(const[t,u]of s.patches){const e=o.colModel.getColDefCol(t);if(e&&(void 0!==u.hide&&u.hide!==!e.isVisible()||void 0!==u.rowGroup&&!!u.rowGroup!==e.isRowGroupActive()||void 0!==u.pivot&&!!u.pivot!==e.isPivotActive()||void 0!==u.aggFunc&&(u.aggFunc??null)!==(e.getAggFunc()??null)))return!0}if(i&&!t(i.colIds,tb(o)))return!0;if(n&&!t(n.colIds,h(o.rowGroupColsSvc?.columns)))return!0;if(r&&!t(r.colIds,h(o.valueColsSvc?.columns)))return!0;if(l&&!t(l.colIds,h(o.pivotColsSvc?.columns)))return!0;if(a&&a.pivotMode!==o.colModel.isPivotMode())return!0;if(d){for(const[e,t]of d.sortDefsByColId){const s=o.colModel.getColDefCol(e);if(s&&(t?.direction??null)!==(s.getSortDef()?.direction??null))return!0}if(d.baselineCleared){const e=ob(o);for(const t of e)if(!d.sortDefsByColId.has(t.getColId())&&null!==t.getSortDef())return!0}}if(c)for(const[t,u]of c.values){const e=o.colModel.getColDefCol(t);if(e&&u!==e.getAggFunc())return!0}return!1}commit(){const{beans:e,state:t}=this,o=[];for(const i of Object.keys(t)){const e=t[i];e&&o.push({type:i,...e})}const s=o.sort((e,t)=>e.seq-t.seq);for(const i of s)switch(i.type){case"columnState":Aa(e,{state:[...i.patches.values()]},i.eventType);break;case"columnOrder":{const t=i.colIds.map(t=>e.colModel.getColDefCol(t)).filter(e=>!!e&&sb(e));if(!e.colModel.isPivotMode())for(let o=0;osb(e)),l=(r>=0?r:0)+o;n[l]!==s&&e.colMoves?.moveColumns([s],l,i.eventType,!0)}eb(e,t);break}case"rowGroup":e.rowGroupColsSvc?.setColumns(i.colIds,i.eventType);break;case"aggregation":e.valueColsSvc?.setColumns(i.colIds,i.eventType);break;case"pivot":this.lastPivotColIds=i.colIds,e.pivotColsSvc?.setColumns(i.colIds,i.eventType);break;case"pivotMode":{const{colModel:t,ctrlsSvc:o,gos:s,stateSvc:n}=e;if(i.pivotMode!==t.isPivotMode()){const t=e.pivotColsSvc?.columns.map(e=>e.getColId())??[];t.length>0&&(this.lastPivotColIds=t);const r=n?.getState().pivot?.pivotColIds??t,l=i.pivotMode?this.state.pivot?.colIds??this.lastPivotColIds:r;n?.setState({...n.getState(),pivot:{pivotMode:i.pivotMode,pivotColIds:l}},["pivot"]),i.pivotMode||Aa(e,{state:(e.colModel.getColDefCols()??[]).map(e=>({colId:e.getColId(),pivot:!1,pivotIndex:null}))},i.eventType),s.updateGridOptions({options:{pivotMode:i.pivotMode},source:i.eventType}),i.pivotMode&&l.length>0&&e.pivotColsSvc?.setColumns(l,i.eventType);for(const e of o.getHeaderRowContainerCtrls())e.refresh()}break}case"sort":{const t=[];let o=0;for(const[e,s]of i.sortDefsByColId)t.push({colId:e,sort:s?.direction??null,sortIndex:s?.direction?o++:null,sortType:s?.type??void 0});Aa(e,{state:t,defaultState:i.baselineCleared?{sort:null,sortIndex:null,sortType:void 0}:void 0},i.eventType);break}case"aggFuncs":for(const[t,o]of i.values){const s=e.colModel.getColDefCol(t);s&&e.valueColsSvc?.setColumnAggFunc?.(s,o,i.eventType)}}this.reset()}applyColumnState(e,t){for(const s of e)nb(this.state,s);const o=lb(this.state);o.seq=ib(this.sequence),this.sequence=o.seq,o.eventType=t}moveColumns(e,t,o){const s=new Set(e.map(e=>e.getColId())),i=(this.state.columnOrder?.colIds??tb(this.beans)).filter(e=>!s.has(e)),n=e.map(e=>e.getColId()),r=ib(this.sequence);this.sequence=r,this.state.columnOrder={colIds:[...i.slice(0,t),...n,...i.slice(t)],eventType:o,seq:r}}setColumnsVisible(e,t,o){for(const i of e)i.getColDef().lockVisible||nb(this.state,{colId:i.getColId(),hide:!t});const s=lb(this.state);s.seq=ib(this.sequence),this.sequence=s.seq,s.eventType=o}setRowGroupColumns(e,t){rb(this.state,"rowGroup");const o=ib(this.sequence);this.sequence=o,this.state.rowGroup={colIds:e.map(e=>e.getColId()),eventType:t,seq:o}}setValueColumns(e,t){rb(this.state,"aggFunc");const o=new Set((this.beans.valueColsSvc?.columns??[]).map(e=>e.getColId())),s=ab(this.state);for(const n of e)if(!o.has(n.getColId())&&!s.values.has(n.getColId())){const e=n.getAggFunc(),t=null!=e?e:this.beans.aggFuncSvc?.getDefaultAggFunc(n);null!=t&&s.values.set(n.getColId(),t)}const i=ib(this.sequence);this.sequence=i,s.seq=i,s.eventType=t,this.state.aggregation={colIds:e.map(e=>e.getColId()),eventType:t,seq:i}}setColumnAggFunc(e,t,o){nb(this.state,{colId:e.getColId(),aggFunc:t});const s=lb(this.state);s.seq=ib(this.sequence),this.sequence=s.seq,s.eventType=o;const i=ab(this.state);i.seq=s.seq,i.eventType=o,i.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 void 0!==t?.hide?!t.hide:e.isVisible()}isColumnSelectedInPivotModeToolPanel(e){const t=e.getColId(),o=this.state.columnState?.patches.get(t);let s,i,n;return s=void 0!==o?.rowGroup?!!o.rowGroup:this.state.rowGroup?this.state.rowGroup.colIds.includes(t):e.isRowGroupActive(),i=void 0!==o?.pivot?!!o.pivot:this.state.pivot?this.state.pivot.colIds.includes(t):e.isPivotActive(),n=void 0!==o?.aggFunc?null!=o.aggFunc:this.state.aggregation?this.state.aggregation.colIds.includes(t):e.isValueActive(),s||i||n}setPivotColumns(e,t){rb(this.state,"pivot");const o=ib(this.sequence);this.sequence=o,this.state.pivot={colIds:e.map(e=>e.getColId()),eventType:t,seq:o}}setPivotMode(e,t){const o=ib(this.sequence);this.sequence=o,this.state.pivotMode={pivotMode:e,eventType:t,seq:o}}getRowGroupColumns(){return Xw(this.beans,Jw(this.state.rowGroup?.colIds,this.beans.rowGroupColsSvc?.columns,this.state.columnState?.patches,e=>null==e.rowGroup?void 0:!!e.rowGroup))}getPrimaryColumns(){return Xw(this.beans,this.state.columnOrder?.colIds??tb(this.beans))}hasDeferredColumnOrder(){return!!this.state.columnOrder}getValueColumns(){return Xw(this.beans,Jw(this.state.aggregation?.colIds,this.beans.valueColsSvc?.columns,this.state.columnState?.patches,e=>void 0===e.aggFunc?void 0:null!=e.aggFunc))}getPivotColumns(){if(!this.getPivotMode())return[];const e=this.beans.pivotColsSvc?.columns,t=e?.length?e:Xw(this.beans,this.lastPivotColIds);return Xw(this.beans,Jw(this.state.pivot?.colIds,t,this.state.columnState?.patches,e=>null==e.pivot?void 0:!!e.pivot))}getPivotMode(){return this.state.pivotMode?.pivotMode??this.beans.colModel.isPivotMode()}getSortDef(e){const t=this.state.sort,o=e.getColId(),s=t?.sortDefsByColId;return s?.has(o)?s.get(o)??null:t?.baselineCleared?null:e.getSortDef()}progressSortFromEvent(e,t){const o=this.state.sort??{sortDefsByColId:/* @__PURE__ */new Map,baselineCleared:!1,seq:0,eventType:"toolPanelUi"},{sortSvc:s}=this.beans,i=e.getColId();let n;n=o.sortDefsByColId.has(i)?o.sortDefsByColId.get(i):o.baselineCleared?null:e.getSortDef();const r=s?.getNextSortDirection(e,n);if(!r)return;const{gos:l}=this.beans;(!("ctrl"===l.get("multiSortKey")?t.ctrlKey||t.metaKey:t.shiftKey)&&!l.get("alwaysMultiSort")||l.get("suppressMultiSort"))&&(o.sortDefsByColId.clear(),o.baselineCleared=!0),o.sortDefsByColId.set(i,r.direction?r:null),o.seq=ib(this.sequence),this.sequence=o.seq,this.state.sort=o}};function Xw(e,t){return t?t.map(t=>e.colModel.getColDefCol(t)).filter(e=>!!e):[]}function Jw(e,t,o,s){const i=[...e??t?.map(e=>e.getColId())??[]];if(!o?.size)return i;const n=new Set(i);for(const[r,l]of o){const e=s(l);if(void 0===e)continue;if(e){n.has(r)||(i.push(r),n.add(r));continue}if(!n.has(r))continue;n.delete(r);const t=i.indexOf(r);t>=0&&i.splice(t,1)}return i}function eb(e,t){const o=function(e){const t=e.colModel.colDefCols,o=t?.list;if(Array.isArray(o))return t}(e);if(!o)return;const s=new Set(t);o.list=[...t,...o.list.filter(e=>sb(e)&&!s.has(e))]}function tb(e){return ob(e).map(e=>e.getColId())}function ob(e){return(e.colModel.getColDefCols()??e.colModel.getCols()).filter(e=>sb(e))}function sb(e){return!!e.isPrimary()&&!es(e)&&!ss(e)}function ib(e){return e+1}function nb(e,t){const o=lb(e),s=o.patches.get(t.colId);o.patches.set(t.colId,s?{...s,...t}:t)}function rb(e,t){const o=e.columnState?.patches;if(o?.size)for(const[s,i]of o){if(!(t in i))continue;const e={...i};delete e[t],1!==Object.keys(e).length?o.set(s,e):o.delete(s)}}function lb(e){let{columnState:t}=e;return t||(t={patches:/* @__PURE__ */new Map,seq:0,eventType:"toolPanelUi"},e.columnState=t),t}function ab(e){let{aggFuncs:t}=e;return t||(t={values:/* @__PURE__ */new Map,seq:0,eventType:"toolPanelUi"},e.aggFuncs=t),t}var db={moduleName:"SharedColumnStateUpdateStrategy",version:Dv,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="columnStateUpdateStrategy"}applyColumnState(e,t,o){this.delegate("applyColumnState",e,t,o)}commit(e){this.delegate("commit",e)}hasPendingChanges(e){return this.delegate("hasPendingChanges",e)}moveColumns(e,t,o,s){this.delegate("moveColumns",e,t,o,s)}reset(e){this.delegate("reset",e)}setColumnsVisible(e,t,o,s){this.delegate("setColumnsVisible",e,t,o,s)}isColumnVisibleInToolPanel(e,t){return this.delegate("isColumnVisibleInToolPanel",e,t)}setRowGroupColumns(e,t,o){this.delegate("setRowGroupColumns",e,t,o)}getRowGroupColumns(e){return this.delegate("getRowGroupColumns",e)}getPrimaryColumns(e){return this.delegate("getPrimaryColumns",e)}hasDeferredColumnOrder(e){return this.delegate("hasDeferredColumnOrder",e)}setValueColumns(e,t,o){this.delegate("setValueColumns",e,t,o)}getValueColumns(e){return this.delegate("getValueColumns",e)}setColumnAggFunc(e,t,o,s){this.delegate("setColumnAggFunc",e,t,o,s)}getColumnAggFunc(e,t){return this.delegate("getColumnAggFunc",e,t)}setPivotColumns(e,t,o){this.delegate("setPivotColumns",e,t,o)}getPivotColumns(e){return this.delegate("getPivotColumns",e)}setPivotMode(e,t,o){this.delegate("setPivotMode",e,t,o)}getPivotMode(e){return this.delegate("getPivotMode",e)}isColumnSelectedInPivotModeToolPanel(e,t){return this.delegate("isColumnSelectedInPivotModeToolPanel",e,t)}progressSortFromEvent(e,t,o){this.delegate("progressSortFromEvent",e,t,o)}getSortDef(e,t){return this.delegate("getSortDef",e,t)}getUpdateStrategy(){return this.executionStrategy??(this.executionStrategy=this.createManagedBean(new Yw))}delegate(e,...t){const o=this.getUpdateStrategy();return o[e].bind(o)(...t)}}],dependsOn:[Mv]},cb={moduleName:"ColumnsToolPanel",version:Dv,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="colToolPanelFactory"}setPanelVisible(e,t,o){return e?e.setDisplayed(t):t&&(e=o()),e}createRowGroupPanel(e,t,o){return this.createPanel(e,t,new $w(!1,o))}createValuesPanel(e,t,o){return this.createPanel(e,t,new jw(!1,o))}createPivotPanel(e,t,o){return this.createPanel(e,t,new Uw(!1,o))}createPivotModePanel(e,t,o,s,i){return this.createPanel(e,t,new _w(o,s),i)}createPanel(e,t,o,s){return o=e.createBean(o),t.push(()=>e.destroyBean(o)),s?e.prependChild(o):e.appendChild(o),o}}],userComponents:{agColumnsToolPanel:class extends Pi{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))return void(this.lastKnownGridState=e);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(".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)}")}wireBeans(e){this.colToolPanelFactory=e.colToolPanelFactory}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}init(e){const t={...Co(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=t;const{childDestroyFuncs:o,colToolPanelFactory:s,gos:i}=this,n=i.isModuleRegistered("SharedPivot"),r=n||i.isModuleRegistered("SharedRowGrouping");this.isDeferModeEnabled=nw(t),this.toggleCss("ag-column-panel-deferred",this.isDeferModeEnabled),!t.suppressPivotMode&&s&&n&&(this.pivotModePanel=s.createPivotModePanel(this,o,t,this.onPivotModePanelValueChanged));const l=this.createBean(new Lw);if(this.primaryColsPanel=l,o.push(()=>this.destroyBean(this.primaryColsPanel)),l.init(!0,t,"toolPanelUi"),l.addCss("ag-column-panel-column-select"),this.appendChild(l),s){!t.suppressRowGroups&&r&&(this.rowGroupDropZonePanel=s.createRowGroupPanel(this,o,t)),!t.suppressValues&&r&&(this.valuesDropZonePanel=s.createValuesPanel(this,o,t)),!t.suppressPivots&&n&&(this.pivotDropZonePanel=s.createPivotPanel(this,o,t)),this.setLastVisible();const[e]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});o.push(()=>e())}if(this.isDeferModeEnabled){const e=this.onExternalGridChange;o.push(...this.addManagedEventListeners({columnEverythingChanged:this.onColumnEverythingChanged,sortChanged:e,columnVisible:e,columnRowGroupChanged:e,columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:e,...t.suppressSyncLayoutWithGrid?{}:{columnMoved:e}}))}t.buttons&&(t.buttons.includes("apply")||Dt(298),t.buttons.length&&this.initDeferredButtons(t.buttons)),this.initialised=!0}initDeferredButtons(e){const t=this.createBean(new Bp({className:"ag-column-panel-buttons"}));this.deferredButtonsComp=t,this.childDestroyFuncs.push(()=>{this.deferredButtonsComp=this.destroyBean(this.deferredButtonsComp)});const o=this.getLocaleTextFunc(),s=e.map(e=>({type:e,label:o("apply"===e?"applyColumnToolPanel":"cancelColumnToolPanel","apply"===e?"Apply":"Cancel")}));t.updateButtons(s),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=e=>(e??[]).map(e=>e.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(e=>e.getColId()),visibleColIds:e.colModel.getCols().filter(e=>e.isVisible()).map(e=>e.getColId()),sortState:e.colModel.getCols().filter(e=>e.getSort()).map(e=>`${e.getColId()}:${e.getSort()}:${e.getSortIndex()}`),aggFuncState:(e.valueColsSvc?.columns??[]).map(e=>e.getAggFunc()),widthState:e.colModel.getCols().map(e=>`${e.getColId()}:${e.getActualWidth()}`)}}isGridStateEqual(e,o){return t(e.rowGroupColIds,o.rowGroupColIds)&&t(e.valueColIds,o.valueColIds)&&t(e.pivotColIds,o.pivotColIds)&&e.pivotMode===o.pivotMode&&t(e.columnOrder,o.columnOrder)&&t(e.visibleColIds,o.visibleColIds)&&t(e.sortState,o.sortState)&&t(e.aggFuncState,o.aggFuncState)&&t(e.widthState,o.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 t=this.getGui(),o=Array.prototype.slice.call(t.querySelectorAll(".ag-column-drop"));for(const e of o)e.classList.remove("ag-last-column-drop");const s=e(t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"));s&&s.classList.add("ag-last-column-drop"),this.primaryColsPanel.getGui().classList.toggle("ag-last-visible-child",!s),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let t=0;t({name:e(t,o+"‎"),action:()=>this.chartSvc.createPivotChart({chartType:s}),_key:i,_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:Ol("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}}},ub=class{constructor(e,t,o){this.beans=e,this.chartSvc=t,this.getLocaleTextFunc=o}getMenuItem(){const e=this.getLocaleTextFunc(),t=(t,o,s,i,n=!1)=>({name:e(t,o),action:()=>this.chartSvc.createChartFromCurrentRange(s),_key:i,_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:Ol("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}}}},gb={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"},pb="separator";function mb(e,t){if(e)for(let o=e.length-2;o>=0;o--){const s=e[o]===t,i=e[o+1]===t;s&&i&&e.splice(o+1,1)}}var fb={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:Ao(e.getSortDef()?.type),direction:null})}};function Cb(e,t,o,s){let i;if(e.isPrimary())i=e;else{const t=e.getColDef().pivotValueColumn;i=l(t)?t:void 0}const n=[];if(i){const e=i.isValueActive(),r=t.getFuncNames(i);n.push({name:s("noAggregation","None"),action:()=>{o.removeColumns([i],"contextMenu"),o.setColumnAggFunc(i,void 0,"contextMenu")},checked:!e});for(const l of r)n.push({name:s(l,t.getDefaultFuncLabel(l)),action:()=>{o.setColumnAggFunc(i,l,"contextMenu"),o.addColumns([i],"contextMenu")},checked:e&&i.getAggFunc()===l})}return n}var vb="filterMenuTab",wb="generalMenuTab",bb="columnsMenuTab",yb=[wb,vb,bb],Sb=class extends Oe{constructor(e,t,o,s,i){super(),this.column=e,this.restoreFocusParams=t,this.initialSelection=o,this.restrictTo=s,this.sourceElement=i,this.tabFactories={},this.includeChecks={};const{tabFactories:n,includeChecks:r}=this;n[wb]=this.createMainPanel.bind(this),n[vb]=this.createFilterPanel.bind(this),n[bb]=this.createColumnsPanel.bind(this),r[wb]=()=>!0,r[vb]=()=>!!e&&!!this.beans.filterManager?.isFilterAllowed(e),r[bb]=()=>!0}postConstruct(){const e=new Sv({items:this.getTabsToCreate().map(e=>this.createTab(e)),cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)});this.tabbedLayout=this.createBean(e),this.mainMenuList?.setParentComponent(e),this.addDestroyFunc(()=>this.destroyBean(e))}getTabsToCreate(){return this.restrictTo?this.restrictTo:(this.column?.getColDef().menuTabs??yb).filter(e=>this.isValidMenuTabItem(e)&&this.isNotSuppressed(e))}isValidMenuTabItem(e){let t=!0,o=yb;return null!=this.restrictTo&&(t=this.restrictTo.indexOf(e)>-1,o=this.restrictTo),t=t&&yb.indexOf(e)>-1,t||Dt(175,{menuTabName:e,itemsToConsider:o}),t}isNotSuppressed(e){return this.includeChecks[e]()}createTab(e){return this.tabFactories[e]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(e){const{tabItemColumns:t,tabbedLayout:o,tabItemFilter:s,tabItemGeneral:i}=this;t&&e===bb?o.showItem(t):s&&e===vb?o.showItem(s):i&&e===wb?o.showItem(i):o.showFirstItem()}onTabItemClicked(e){let t=null;switch(e.item){case this.tabItemColumns:t=bb;break;case this.tabItemFilter:t=vb;break;case this.tabItemGeneral:t=wb}t&&this.activateTab(t)}activateTab(e){const t={type:"tabSelected",key:e};this.dispatchLocalEvent(t)}createMainPanel(){const{beans:e,column:t}=this,o=e.colMenuFactory,s=o.createMenu(this,o.getMenuItems(t),this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=s,s.addEventListener("closeMenu",this.onHidePopup.bind(this));const i={title:Ol("legacyMenu",e,t),titleLabel:wb.replace("MenuTab",""),bodyPromise:Ns.resolve(s.getGui()),name:wb};return this.tabItemGeneral=i,i}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}createFilterPanel(){const e=this.column?this.createBean(new Vp(this.column,"COLUMN_MENU")):null;return this.filterComp=e,e?.hasFilter()||Mt(119),this.tabItemFilter={title:Ol("filterTab",this.beans,this.column),titleLabel:vb.replace("MenuTab",""),bodyPromise:Ns.resolve(e?.getGui()),afterAttachedCallback:t=>e?.afterGuiAttached(t),afterDetachedCallback:()=>e?.afterGuiDetached(),name:vb},this.tabItemFilter}createColumnsPanel(){const e=Cl({tag:"div",cls:"ag-menu-column-select-wrapper"}),{beans:t,column:o}=this,s=t.colChooserFactory.createColumnSelectPanel(this,o).getGui();s.classList.add("ag-menu-column-select"),e.appendChild(s);const i={title:Ol("columns",t,o),titleLabel:bb.replace("MenuTab",""),bodyPromise:Ns.resolve(e),name:bb};return this.tabItemColumns=i,i}afterGuiAttached(e){const{container:t,hidePopup:o}=e;this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:o}),o&&(this.hidePopupFunc=o,this.addDestroyFunc(o))}getGui(){return this.tabbedLayout.getGui()}destroy(){super.destroy(),this.destroyBean(this.filterComp)}},Rb=class extends Pi{constructor(e,t,o,s){super({tag:"div",ref:"eColumnMenu",cls:"ag-menu ag-column-menu",role:"presentation"}),this.menuItems=e,this.column=t,this.restoreFocusParams=o,this.sourceElement=s,this.eColumnMenu=null}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)),Wi(this.mainMenuList.getGui())}},xb={moduleName:"MenuCore",version:Dv,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="menuItemMapper"}mapWithStockItems(e,t,o,s,i){if(!e)return[];const n=[],r=this.getLocaleTextFunc(),{beans:l,gos:d}=this,{pinnedCols:c,colAutosize:h,aggFuncSvc:u,rowGroupColsSvc:g,colNames:p,colModel:m,clipboardSvc:f,expansionSvc:C,focusSvc:v,csvCreator:w,excelCreator:b,menuSvc:y,colChooserFactory:S,sortSvc:R,chartMenuItemMapper:x,valueColsSvc:F,pinnedRowModel:D}=l,M=(e,t,s,i)=>{switch(function(e,t){const o=gb[t];o&&e.assertModuleRegistered(o,`menu item '${t}'`)}(d,e),e){case"pinSubMenu":return c&&t?{name:r("pinColumn","Pin Column"),icon:Ol("menuPin",l,null),subMenu:["clearPinned","pinLeft","pinRight"]}:null;case"pinLeft":return c&&t?{name:r("pinLeft","Pin Left"),action:()=>c.setColsPinned([t],"left",i),checked:!!t&&t.isPinnedLeft()}:null;case"pinRight":return c&&t?{name:r("pinRight","Pin Right"),action:()=>c.setColsPinned([t],"right",i),checked:!!t&&t.isPinnedRight()}:null;case"clearPinned":return c&&t?{name:r("noPin","No Pin"),action:()=>c.setColsPinned([t],null,i),checked:!!t&&!t.isPinned()}:null;case"pinRowSubMenu":{const e=d.get("enableRowPinning"),s=[],i=o?.rowPinned??o?.pinnedSibling?.rowPinned;return i&&s.push("unpinRow"),e&&"bottom"!==e&&"top"!=i&&s.push("pinTop"),e&&"top"!==e&&"bottom"!=i&&s.push("pinBottom"),D?.isManual()?{name:r("pinRow","Pin Row"),icon:Ol("rowPin",l,t),subMenu:s}:null}case"pinTop":return D?.isManual()?{name:r("pinTop","Pin to Top"),icon:Ol("rowPinTop",l,t),action:({node:e,column:t})=>e&&D.pinRow(e,"top",t)}:null;case"pinBottom":return D?.isManual()?{name:r("pinBottom","Pin to Bottom"),icon:Ol("rowPinBottom",l,t),action:({node:e,column:t})=>e&&D.pinRow(e,"bottom",t)}:null;case"unpinRow":return D?.isManual()?{name:r("unpinRow","Unpin Row"),icon:Ol("rowUnpin",l,t),action:({node:e,column:t})=>e&&D.pinRow(e,null,t)}:null;case"valueAggSubMenu":return u&&F&&(t?.isPrimary()||t?.getColDef().pivotValueColumn)?{name:r("valueAggregation","Value Aggregation"),icon:Ol("menuValue",l,null),subMenu:Cb(t,u,F,r),disabled:d.get("functionsReadOnly")}:null;case"autoSizeThis":return h?{name:r("autosizeThisColumn","Autosize This Column"),action:()=>t&&h.autoSizeColumn(t,i,d.get("skipHeaderOnAutoSize"))}:null;case"autoSizeAll":return h?{name:r("autosizeAllColumns","Autosize All Columns"),action:()=>h.autoSizeAllColumns({source:i,skipHeader:d.get("skipHeaderOnAutoSize")})}:null;case"rowGroup":return g?{name:vw(r,"groupBy",p.getDisplayNameForColumn(t,"header")),disabled:d.get("functionsReadOnly")||t?.isRowGroupActive()||!t?.getColDef().enableRowGroup,action:()=>g.addColumns([t],i),icon:Ol("menuAddRowGroup",l,null)}:null;case"rowUnGroup":if(g&&d.isModuleRegistered("SharedRowGrouping")){const e=t?.getColDef().showRowGroup,o=d.get("groupLockGroupColumns");let s,n,a;if(!0===e)s=r("ungroupAll","Un-Group All"),n=d.get("functionsReadOnly")||-1===o||o>=(g.columns.length??0),a=()=>g.setColumns(g.columns.slice(0,o),i);else if("string"==typeof e){const t=m.getColDefCol(e);s=vw(r,"ungroupBy",null!=t?p.getDisplayNameForColumn(t,"header"):e),n=d.get("functionsReadOnly")||Cw(t,l),a=()=>{g.removeColumns([e],i)}}else s=vw(r,"ungroupBy",p.getDisplayNameForColumn(t,"header")),n=d.get("functionsReadOnly")||!t?.isRowGroupActive()||!t?.getColDef().enableRowGroup||Cw(t,l),a=()=>g.removeColumns([t],i);return{name:s,disabled:n,action:a,icon:Ol("menuRemoveRowGroup",l,null)}}return null;case"resetColumns":return{name:r("resetColumns","Reset Columns"),action:()=>function(e,t){const{colModel:o,autoColSvc:s,selectionColSvc:i,eventSvc:n,gos:r}=e,l=o.getColDefCols();if(!l?.length)return;const d=Qo(o.getColDefColTree()),c=[];let h=1e3,u=1e3;const g=e=>{const t=Ga(e);a(t.rowGroupIndex)&&t.rowGroup&&(t.rowGroupIndex=h++),a(t.pivotIndex)&&t.pivot&&(t.pivotIndex=u++),c.push(t)};s?.getColumns()?.forEach(g),i?.getColumns()?.forEach(g),d?.forEach(g),Aa(e,{state:c},t);const p=s?.getColumns()??[];Aa(e,{state:[...i?.getColumns()??[],...p,...l].map(e=>({colId:e.colId})),applyOrder:!0},t),n.dispatchEvent(Co(r,{type:"columnsReset",source:t}))}(l,i)};case"expandAll":return C?{name:r("expandAll","Expand All Row Groups"),action:()=>C.expandAll(!0)}:null;case"contractAll":return C?{name:r("collapseAll","Collapse All Row Groups"),action:()=>C.expandAll(!1)}:null;case"copy":return f?{name:r("copy","Copy"),shortcut:r("ctrlC","Ctrl+C"),icon:Ol("clipboardCopy",l,null),action:()=>f.copyToClipboard()}:null;case"copyWithHeaders":return f?{name:r("copyWithHeaders","Copy with Headers"),icon:Ol("clipboardCopy",l,null),action:()=>f.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return f?{name:r("copyWithGroupHeaders","Copy with Group Headers"),icon:Ol("clipboardCopy",l,null),action:()=>f.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(f){const e=v.getFocusedCell(),t=e?Fn(l,e):null,o=!!t&&e?.column.isCellEditable(t);return{name:r("cut","Cut"),shortcut:r("ctrlX","Ctrl+X"),icon:Ol("clipboardCut",l,null),disabled:!o||d.get("suppressCutToClipboard"),action:()=>f.cutToClipboard(void 0,"contextMenu")}}return null;case"paste":if(f){const e=d.get("suppressClipboardApi")||d.get("suppressClipboardPaste")||!t||!o||!t.isCellEditable(o)||t.isSuppressPaste(o);return{name:r("paste","Paste"),shortcut:r("ctrlV","Ctrl+V"),icon:Ol("clipboardPaste",l,null),disabled:e,action:()=>f.pasteFromClipboard()}}return null;case"export":{const e=[];return!d.get("suppressCsvExport")&&w&&e.push("csvExport"),!d.get("suppressExcelExport")&&b&&e.push("excelExport"),e.length?{name:r("export","Export"),subMenu:e,icon:Ol("save",l,null)}:null}case"csvExport":return w?{name:r("csvExport","CSV Export"),icon:Ol("csvExport",l,null),action:()=>w.exportDataAsCsv()}:null;case"excelExport":return b?{name:r("excelExport","Excel Export"),icon:Ol("excelExport",l,null),action:()=>b.exportDataAsExcel()}:null;case"separator":return e;case"pivotChart":case"chartRange":return x.getChartItems(e);case"columnFilter":return y&&t?{name:r("columnFilter","Column Filter"),icon:Ol("filter",l,null),action:()=>y.showFilterMenu({column:t,buttonElement:s(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":{const e=v.focusedHeader;return S?{name:r("columnChooser","Choose Columns"),icon:Ol("columns",l,null),action:()=>S.showColumnChooser({column:t,eventSource:s(),headerPosition:e})}:null}case"sortUnSort":case"sortAscending":case"sortDescending":case"sortAbsoluteAscending":case"sortAbsoluteDescending":{if(!R||!t)return null;const{fallback:o,getSortDef:s}=fb[e];return{name:r(e,o),icon:Ol(e,l,null),action:()=>R.setSortForColumn(t,s(t),!1,i)}}default:return Dt(176,{key:e}),null}};for(const a of e){let e;if(e="string"==typeof a?M(a,t,s,i):{...a},!e)continue;const r=e,{subMenu:l}=r;l&&l instanceof Array&&(r.subMenu=this.mapWithStockItems(l,t,o,s,i)),null!=e&&n.push(e)}return mb(n,pb),n}},class extends Oe{constructor(){super(...arguments),this.beanName="chartMenuItemMapper"}getChartItems(e){const t=this.beans,o=t.chartSvc,s="pivotChart"===e;if(!o)return null;const i=this.getLocaleTextFunc.bind(this),n=s?new hb(t,o,i):new ub(t,o,i),r=o.isEnterprise();let l=n.getMenuItem();if(l?.subMenu&&!r){const e=t=>({...t,subMenu:t.subMenu?.filter(e=>!e._enterprise).map(t=>e(t))});l=e(l)}const a=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;return a&&(l=this.filterAndOrderChartMenu(l,a,n.getConfigLookup())),this.cleanInternals(l)}cleanInternals(e){if(!e)return e;const t=e=>{delete e?._key,delete e?._enterprise;for(const o of e?.subMenu??[])t(o);return e};return t(e)}buildLookup(e){const t={},o=e=>{if(t[e._key]=e,e.subMenu)for(const t of e.subMenu)o(t)};return o(e),t}filterAndOrderChartMenu(e,t,o){const s=this.buildLookup(e),i={...e,subMenu:[]};for(const n of Object.keys(t)){const e=t[n],r=o[n];if(null===r)continue;if(null==r){Dt(173,{group:n});continue}const l=s[r._key];if(l)if(l.subMenu){const t=e.map(e=>{const t=r[e];if(null!=t)return s[t];Dt(174,{group:n,chartType:e})}).filter(e=>void 0!==e);t.length>0&&(l.subMenu=t,i.subMenu?.push(l))}else i.subMenu?.push(l)}return 0==i.subMenu?.length?null:i}},class extends Oe{constructor(){super(...arguments),this.beanName="menuUtils"}restoreFocusOnClose(e,t,o,s){const{eventSource:i}=e,n=o instanceof KeyboardEvent;if(!s&&!n||!i)return;const r=w(this.beans);(t.contains(r)||y(this.beans))&&this.focusHeaderCell(e)}closePopupAndRestoreFocusOnSelect(e,t,o){let s;o?.keyboardEvent&&(s=o.keyboardEvent),e(s&&{keyboardEvent:s});const i=this.beans,n=i.focusSvc,r=n.getFocusedCell();if(y(i))if(r){const{rowIndex:e,rowPinned:t,column:o}=r;n.setFocusedCell({rowIndex:e,column:o,rowPinned:t,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(t)}onContextMenu(e){const{mouseEvent:t,touchEvent:o,showMenuCallback:s,source:i}=e;if((this.gos.get("allowContextMenuWithControlKey")||!t||!t.ctrlKey&&!t.metaKey)&&(t&&this.blockMiddleClickScrollsIfNeeded(t),("ui"!==i||!this.gos.get("suppressContextMenu"))&&s(t??o.touches[0]))){const e=t??o;e?.cancelable&&e.preventDefault()}}async focusHeaderCell(t){const{column:o,columnIndex:s,headerPosition:i,eventSource:n}=t,{visibleCols:r,headerNavigation:l,focusSvc:a}=this.beans,d=await r.allCols.some(e=>e===o);if(this.isAlive())if(o?.isAlive()&&d&&n&&re(n)){const e=$i(n);e&&(l?.scrollToColumn(o),e.focus())}else if(i&&-1!==s){const t=r.allCols,o=t[s]||e(t);o&&a.focusHeaderPosition({headerPosition:{headerRowIndex:i.headerRowIndex,column:o}})}}blockMiddleClickScrollsIfNeeded(e){this.gos.get("suppressMiddleClickScrolls")&&2===e.which&&e.preventDefault()}}],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:[Mv,Tg,Sp,Zv]},Fb={moduleName:"ColumnMenu",version:Dv,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="enterpriseMenuFactory"}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(e,t,o,s,i){const{column:n,columnGroup:r}=this.splitColumnOrGroup(e),l=i?"filterMenuTab":void 0;this.showMenu(n,r,e=>{const s=e.getGui();this.beans.popupSvc.positionPopupUnderMouseEvent({type:o,additionalParams:{column:n},mouseEvent:t,ePopup:s}),l&&e.showTab?.(l),this.dispatchVisibleChangedEvent(!0,!1,n,r,l)},o,l,void 0,t.target,s)}splitColumnOrGroup(e){const t=e&&So(e);return{column:t?e:void 0,columnGroup:t?void 0:e}}showMenuAfterButtonClick(e,t,o,s,i){let n=-1,r="left";this.gos.get("enableRtl")&&(n=1,r="right");const l=i?"filterMenuTab":void 0,a=l?[l]:void 0,d=mo(this.gos),c=(d?9:4)*n,h=d?-23:4,{column:u,columnGroup:g}=this.splitColumnOrGroup(e);this.showMenu(u,g,e=>{const s=e.getGui();this.beans.popupSvc.positionPopupByComponent({type:o,additionalParams:{column:u},eventSource:t,ePopup:s,alignSide:r,nudgeX:c,nudgeY:h,position:"under",keepWithinBounds:!0}),l&&e.showTab?.(l),this.dispatchVisibleChangedEvent(!0,!1,u,g,l)},o,l,a,t,s)}showMenu(e,t,o,s,i,n,r,l){const a=this.getMenuParams(e,t,n,r);if(!a)return;const{menu:d,eMenuGui:c,anchorToElement:h,restoreFocusParams:u}=a,g=[],{menuUtils:p,popupSvc:m}=this.beans;g.push(t=>{const o=d.getGui();this.destroyBean(d),e&&(bp(e,!1,"contextMenu"),p.restoreFocusOnClose(u,o,t)),l?.()});const f=this.getLocaleTextFunc();if(m.addPopup({modal:!0,eChild:c,closeOnEsc:!0,closedCallback:o=>{for(const e of g)e(o);this.dispatchVisibleChangedEvent(!1,!1,e,t,i)},afterGuiAttached:e=>d.afterGuiAttached(Object.assign({},{container:s},e)),positionCallback:i?()=>o(d):void 0,ariaLabel:f("ariaLabelColumnMenu","Column Menu")}),i||(d.showTabBasedOnPreviousSelection?.(),o(d)),fo(this.gos)){const t=m.setPopupPositionRelatedToElement(c,h);t&&e&&this.addStopAnchoring(t,e,g)}d.addEventListener("tabSelected",t=>{this.dispatchVisibleChangedEvent(!1,!0,e),this.lastSelectedTab=t.key,this.dispatchVisibleChangedEvent(!0,!0,e)}),e&&bp(e,!0,"contextMenu"),this.activeMenu=d,d.addEventListener("destroyed",()=>{this.activeMenu===d&&(this.activeMenu=null)})}addStopAnchoring(e,t,o){e.then(e=>{t.__addEventListener("leftChanged",e),t.__addEventListener("visibleChanged",e),o.push(()=>{t.__removeEventListener("leftChanged",e),t.__removeEventListener("visibleChanged",e)})})}getMenuParams(e,t,o,s){const{focusSvc:i,visibleCols:n,ctrlsSvc:r}=this.beans,l={column:e,headerPosition:i.focusedHeader,columnIndex:n.allCols.indexOf(e),eventSource:s},a=this.createMenu(e,t,l,o,s);return a?{menu:a,eMenuGui:a.getGui(),anchorToElement:s||r.getGridBodyCtrl().eGridBody,restoreFocusParams:l}:void 0}createMenu(e,t,o,s,i){if(mo(this.gos))return this.createBean(new Sb(e,o,this.lastSelectedTab,s,i));{const s=this.beans.colMenuFactory.getMenuItems(e,t);return s.length?this.createBean(new Rb(s,e,o,i)):void 0}}dispatchVisibleChangedEvent(e,t,o,s,i){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:t,key:this.lastSelectedTab??i??(mo(this.gos)?wb:"columnMenu"),column:o??null,columnGroup:s??null})}isMenuEnabled(e){if(!mo(this.gos))return!0;const t=!this.beans.filterManager?.isFilterAllowed(e),o=e.getColDef().menuTabs??yb;return(t&&o.includes(vb)?o.length-1:o.length)>0}showMenuAfterContextMenuEvent(e,t,o){this.beans.menuUtils.onContextMenu({mouseEvent:t,touchEvent:o,source:"ui",showMenuCallback:t=>(this.showMenuAfterMouseEvent(e,t,"columnMenu"),!0)})}},class extends Oe{constructor(){super(...arguments),this.beanName="colMenuFactory"}createMenu(e,t,o,s){const i=e.createManagedBean(new Sw(0,{column:o??null,node:null,value:null})),n=this.beans.menuItemMapper.mapWithStockItems(t,o??null,null,s,"columnMenu");return i.addMenuItems(n),i}getMenuItems(e=null,t=null){const o=this.getDefaultMenuOptions(e);let s;const i=(e?.getColDef()??t?.getColGroupDef())?.mainMenuItems;if(Array.isArray(i))s=i;else if("function"==typeof i)s=i(Co(this.gos,{column:e,columnGroup:t,defaultItems:o}));else{const i=this.gos.getCallback("getMainMenuItems");s=i?i({column:e,columnGroup:t,defaultItems:o}):o}return mb(s,pb),s}getDefaultMenuOptions(e){const t=[],{beans:o,gos:s}=this,{colChooserFactory:i,rowGroupColsSvc:n,colModel:r,expansionSvc:l,sortSvc:a,menuSvc:d,pinnedCols:c,aggFuncSvc:h,colAutosize:u}=o,g=mo(s),p=()=>{!g&&i&&t.push("columnChooser"),t.push("resetColumns")};if(!e)return p(),t;const{colDef:m}=e,f=c&&!m.lockPinned,C=n?.columns.length??0,v=C>0,w=jt(s),b=s.get("treeData"),y=e.isPrimary(),S=!y||h&&e.isAllowValue()&&(v||w||b);if(a&&!g&&e.isSortable()){const{isDefaultSortAllowed:s,isAbsoluteSortAllowed:i,isAbsoluteSort:n,isDefaultSort:r,isAscending:l,isDescending:a,direction:d}=ko(e,o);!s||l&&r||t.push("sortAscending"),!s||a&&r||t.push("sortDescending"),!i||l&&n||t.push("sortAbsoluteAscending"),!i||a&&n||t.push("sortAbsoluteDescending"),d&&t.push("sortUnSort"),t.push(pb)}if(d?.isFilterMenuItemEnabled(e)&&(t.push("columnFilter"),t.push(pb)),f&&t.push("pinSubMenu"),S&&t.push("valueAggSubMenu"),(f||S)&&t.push(pb),u&&(m.suppressAutoSize||t.push("autoSizeThis"),t.push("autoSizeAll"),t.push(pb)),n&&s.isModuleRegistered("SharedRowGrouping")){const s=t.length;m.showRowGroup?t.push("rowUnGroup"):e.isAllowRowGroup()&&y&&(e.isRowGroupActive()?Cw(e,o)||t.push("rowUnGroup"):t.push("rowGroup")),t.length>s&&t.push(pb)}return p(),l&&(It(s)||s.get("ssrmExpandAllAffectsAllRows"))&&(b||C>(r.isPivotMode()?1:0))&&(t.push("expandAll"),t.push("contractAll")),t}},class extends Oe{constructor(){super(...arguments),this.beanName="colChooserFactory"}createColumnSelectPanel(e,t,o,s){const i=e.createManagedBean(new Lw),{contractColumnSelection:n,suppressColumnExpandAll:r,suppressColumnFilter:l,suppressColumnSelectAll:a,suppressSyncLayoutWithGrid:d,columnLayout:c}=s??t?.getColDef().columnChooserParams??{};return i.init(!!o,Co(this.gos,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!n,suppressColumnExpandAll:!!r,suppressColumnFilter:!!l,suppressColumnSelectAll:!!a,suppressSyncLayoutWithGrid:!!c||!!d,onStateUpdated:()=>{}}),"columnMenu"),c&&i.setColumnLayout(c),i}showColumnChooser({column:e,chooserParams:t,eventSource:o,headerPosition:s}){this.hideActiveColumnChooser();const i=this.createColumnSelectPanel(this,e,!0,t),n=this.getLocaleTextFunc(),r=this.beans,{visibleCols:l,focusSvc:a,menuUtils:d}=r,c=l.allCols.indexOf(e),h=e?a.focusedHeader??s??null:null;this.activeColumnChooserDialog=this.createBean(new Ev({title:n("chooseColumns","Choose Columns"),component:i,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{Ui(r,i.getGui())?.focus({preventScroll:!0}),this.dispatchVisibleChangedEvent(!0,e)},closedCallback:t=>{const s=this.activeColumnChooser.getGui();this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,e),e&&d.restoreFocusOnClose({column:e,headerPosition:h,columnIndex:c,eventSource:o},s,t,!0)},postProcessPopupParams:{type:"columnChooser",column:e,eventSource:o}})),this.activeColumnChooser=i}hideActiveColumnChooser(){this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:"columnChooser",column:t??null})}}],icons:{ensureColumnVisible:"column-arrow",legacyMenu:"menu",filterTab:"filter",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},apiFunctions:{showColumnChooser:function(e,t){e.colChooserFactory?.showColumnChooser({chooserParams:t})},hideColumnChooser:function(e){e.colChooserFactory?.hideActiveColumnChooser()}},dependsOn:[xb,ia,Ca]};function Db(e,t,o){return e.getCompDetails(t,Mb,void 0,o,!0)}var Mb={name:"statusPanel",optionalMethods:["refresh"]},Pb={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]}},Eb={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"}]},Tb={selector:"AG-STATUS-BAR",component:class extends Pi{constructor(){super(Eb),this.updateQueued=!1,this.panelsPromise=Ns.resolve(),this.eStatusBarLeft=null,this.eStatusBarCenter=null,this.eStatusBarRight=null,this.compDestroyFunctions={},this.registerCSS(".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}")}wireBeans(e){this.userCompFactory=e.userCompFactory,this.statusBarSvc=e.statusBarSvc}postConstruct(){this.processStatusPanels(/* @__PURE__ */new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this)),In(this.beans,this,this.getGui())}getFocusableContainerName(){return"statusBar"}getValidPanels(){const e=this.gos,t=e.get("statusBar")?.statusPanels;return t?t.filter(t=>{const{rowModels:o,warnArgs:s}=Pb[t.statusPanel]??{};return!o||!!o.includes(e.get("rowModelType"))||(Dt(...s),!1)}):t}processStatusPanels(e){const t=this.getValidPanels();if(t){const o=t.filter(e=>"left"===e.align),s=t.filter(e=>"center"===e.align),i=t.filter(e=>!e.align||"right"===e.align);this.panelsPromise=Ns.all([this.createAndRenderComponents(o,this.eStatusBarLeft,e),this.createAndRenderComponents(s,this.eStatusBarCenter,e),this.createAndRenderComponents(i,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 o=/* @__PURE__ */new Map;if(t)for(const s of e){const e=s.key??s.statusPanel,t=this.statusBarSvc.getStatusPanel(e);if(t?.refresh){const i=Co(this.gos,{...s.statusPanelParams??{},key:e});t.refresh(i)&&(o.set(e,t),delete this.compDestroyFunctions[e],ie(t.getGui()))}}this.resetStatusBar(),t&&this.processStatusPanels(o)}resetStatusBar(){se(this.eStatusBarLeft),se(this.eStatusBarCenter),se(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,o){const s=[];for(const i of e){const e=i.key||i.statusPanel,t=o.get(e);let n;if(t)n=Ns.resolve(t);else{const t=Db(this.userCompFactory,i,Co(this.gos,{key:e}));if(null==t)continue;n=t.newAgStackInstance()}s.push({key:e,promise:n})}return Ns.all(s.map(e=>e.promise)).then(()=>{for(const e of s)e.promise.then(o=>{const s=()=>{this.destroyBean(o)};this.isAlive()?(this.statusBarSvc.registerStatusPanel(e.key,o),t.appendChild(o.getGui()),this.compDestroyFunctions[e.key]=s):s()})})}}},Ib={tag:"div",cls:"ag-status-name-value",children:[{tag:"span",ref:"eLabel"},": ",{tag:"span",ref:"eValue",cls:"ag-status-name-value-value"}]},Ab=BigInt(Number.MIN_SAFE_INTEGER),kb=BigInt(Number.MAX_SAFE_INTEGER),Lb=class extends Pi{constructor(){super(Ib),this.eLabel=null,this.eValue=null}setLabel(e,t){this.setDisplayed(!1),this.eLabel.textContent=this.getLocaleTextFunc()(e,t)}setValue(e,t){let o,s=null;"bigint"==typeof e?(o=e,e>=Ab&&e<=kb&&(s=Number(e))):s=e,this.eValue.textContent=this.valueFormatter(Co(this.gos,{value:s,bigintValue:o,totalRows:t,key:this.key}))}},Gb={selector:"AG-NAME-VALUE",component:Lb},Nb=e=>{let t=0;return e.forEachNodeAfterFilter(e=>{e.data&&t++}),t},Bb=e=>{let t=0;return e.forEachNode(e=>{e.data&&t++}),t},Hb={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"}]},Ob={moduleName:"StatusBar",version:Dv,beans:[class extends Oe{constructor(){super(),this.beanName="statusBarSvc",this.comps=/* @__PURE__ */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()}}],userComponents:{agAggregationComponent:class extends Pi{constructor(){super(Hb,[Gb]),this.sumAggregationComp=null,this.countAggregationComp=null,this.minAggregationComp=null,this.maxAggregationComp=null,this.avgAggregationComp=null}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??(e=>{const{value:t,bigintValue:o}=e;return null!=o?o.toString():function(e,t){return"number"!=typeof e?"":Kp(Math.round(100*e)/100,t)}(t,this.getLocaleTextFunc.bind(this))});for(const o of["avg","count","min","max","sum"]){const e=this.getAllowedAggregationValueComponent(o);e&&(e.key=o,e.valueFormatter=t.bind(this))}return this.onCellSelectionChanged(),!0}setAggregationComponentValue(e,t,o){const s=this.getAllowedAggregationValueComponent(e),i=Bb(this.beans.rowModel);l(s)&&s?(s.setValue(t,i),s.setDisplayed(o)):this.getAggregationValueComponent(e)?.setDisplayed(!1)}getAllowedAggregationValueComponent(e){const{aggFuncs:t}=this.params;return!t||t.includes(e)?this.getAggregationValueComponent(e):null}getAggregationValueComponent(e){return this[`${e}AggregationComp`]}onCellSelectionChanged(){const e=this.beans,{rangeSvc:t,valueSvc:o}=e,s=t?.getCellRanges();let i=0,n=0n,r=!1,l=!1,d=0,c=0,h=null,u=null,g=null,p=null;const m=e=>{if("number"==typeof e)if(i+=e,(null===h||eu)&&(u=e),Number.isInteger(e)&&Number.isSafeInteger(e)){const t=BigInt(e);n+=t,(null===g||tp)&&(p=t)}else l=!0;else{r=!0,n+=e,(null===g||ep)&&(p=e);const t=Number(e);i+=t,(null===h||tu)&&(u=t)}c++},f={};if(s?.length&&t)for(let D=0;D{if(null===r)return;const s=wn({rowPinned:r.rowPinned,column:t,rowIndex:r.rowIndex});if(f[s])return;f[s]=!0;const n=Fn(e,r);if(a(n))return;let l=o.getValue(t,n,"data");if(!a(l)&&""!==l&&(d++,"object"!=typeof l||!("value"in l)||(l=l.value,""!==l))){if("string"==typeof l){const e=l.trim();if(""===e)return;const t=Number(e);if(!Number.isFinite(t))return;i+t>=Number.MAX_SAFE_INTEGER||i+t<=Number.MIN_SAFE_INTEGER||t>=Number.MAX_SAFE_INTEGER||t<=Number.MIN_SAFE_INTEGER?(l=Ka(e),null===l&&(l=t)):l=t}("number"==typeof l&&!isNaN(l)||"bigint"==typeof l)&&m(l)}}),r=En(e,r)}const C=d>1,v=c>1,w=r&&!l;let b;b=w?n/BigInt(c):i/c;const y=v?w?n:i:null,S=v?w?g:h:null,R=v?w?p:u:null,x=v?b:null,F=v;this.setAggregationComponentValue("count",d,C),this.setAggregationComponentValue("sum",y,v),this.setAggregationComponentValue("min",S,v),this.setAggregationComponentValue("max",R,v),this.setAggregationComponentValue("avg",x,F)}},agTotalRowCountComponent:class extends Lb{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=Bb(this.beans.rowModel);this.setValue(e,e)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:e})=>Kp(e,this.getLocaleTextFunc.bind(this)))}refresh(e){const{key:t,valueFormatter:o}=e;return this.key=t,this.updateValueFormatter(o),!0}},agFilteredRowCountComponent:class extends Lb{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=Bb(e),o=Nb(e);this.setValue(o,t),this.setDisplayed(t!==o)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:e})=>Kp(e,this.getLocaleTextFunc.bind(this)))}refresh(e){const{key:t,valueFormatter:o}=e;return this.key=t,this.updateValueFormatter(o),!0}},agTotalAndFilteredRowCountComponent:class extends Lb{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=Nb(e),o=Bb(e);this.setValue(t,o)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:e,totalRows:t})=>{const o=this.getLocaleTextFunc.bind(this),s=Kp(e,o),i=Kp(t??e,o);return e===t?s:`${s} ${o()("of","of")} ${i}`})}refresh(e){const{key:t,valueFormatter:o}=e;return this.key=t,this.updateValueFormatter(o),!0}},agSelectedRowCountComponent:class extends Lb{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,o=e?.getSelectionCount()??0,s=Bb(t);this.setValue(o,s),o<0?this.setDisplayed(!0):this.setDisplayed(o>0)}init(e){this.refresh(e),this.onRowSelectionChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:e})=>null==e||e>=0?Kp(e,this.getLocaleTextFunc.bind(this)):this.getLocaleTextFunc()("statusBarLastRowUnknown","?"))}refresh(e){const{key:t,valueFormatter:o}=e;return this.key=t,this.updateValueFormatter(o),!0}}},selectors:[Tb],apiFunctions:{getStatusPanel:function(e,t){const o=e.statusBarSvc?.getStatusPanel(t);return ph(o)}},dependsOn:[Mv,Zh]};function Vb(e){return"MULTI_SHEET"!==e.excelCreator?.getFactoryMode()||(Dt(161),!1)}var zb={moduleName:"ExcelExport",version:Dv,beans:[class extends wg{constructor(){super(...arguments),this.beanName="excelCreator",this.workbook=new QC}getMergedParams(e){const t=this.gos.get("defaultExcelExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void Dt(160);const t=()=>{const t=this.getMergedParams(e),o=this.getData(t),{fontSize:s,author:i,mimeType:n,customMetadata:r}=t,l={data:[o],fontSize:s,author:i,mimeType:n,customMetadata:r};this.packageCompressedFile(l).then(e=>{if(e){const{fileName:o}=t,s="function"==typeof o?o(Co(this.gos,{})):o;bg(this.getFileName(s),e)}})},{overlays:o}=this.beans;o?o.showExportOverlay(t):t()}exportDataAsExcel(e){this.export(e)}getDataAsExcel(e){const t=this.getMergedParams(e),o=this.getData(t),{fontSize:s,author:i,mimeType:n,customMetadata:r}=t,l={data:[o],fontSize:s,author:i,mimeType:n,customMetadata:r};return this.packageFile(l)}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 cv(e,this.workbook)}exportMultipleSheetsAsExcel(e){dv(e,this.workbook).then(t=>{const{fileName:o="export.xlsx"}=e;t&&bg("function"==typeof o?o():o,t)})}getDefaultFileExtension(){return"xlsx"}createSerializingSession(e){const{colModel:t,colNames:o,rowGroupColsSvc:s,valueSvc:i,formula:n,gos:r}=this.beans,l=r.get("excelStyles")||[],a=this.createStyleLinker(l);return new Qm({...e,colModel:t,colNames:o,rowGroupColsSvc:s,valueSvc:i,formulaSvc:n,gos:r,suppressRowOutline:e.suppressRowOutline||e.skipRowGroups,headerRowHeight:e.headerRowHeight||e.rowHeight,baseExcelStyles:l,rightToLeft:e.rightToLeft??r.get("enableRtl"),styleLinker:a,headerRowCount:Hn(t),pivotModeActive:t.isPivotActive(),workbook:this.workbook})}createStyleLinker(e){const t=[],o=/* @__PURE__ */new Set,s=/* @__PURE__ */new Map;e.forEach((e,i)=>{t.push(e.id),o.add(e.id),s.set(e.id,i)});const{gos:i,cellStyles:n}=this.beans;return e=>{const{rowType:r,rowIndex:l,value:a,column:d,columnGroup:c,node:h}=e,u="HEADER"===r,g="HEADER_GROUPING"===r,p=u?d:c;let m=[];if(u||g)return m.push("header"),g&&m.push("headerGroup"),p&&(m=m.concat(ir(p.getDefinition(),i,d||null,c||null))),m;const f=["cell"];if(!t.length)return f;const C=d.getDefinition();return n?.processAllCellClasses(C,Co(i,{value:a,data:h.data,node:h,colDef:C,column:d,rowIndex:l}),e=>{o.has(e)&&f.push(e)}),f.sort((e,t)=>{const o=s.get(e)??-1,i=s.get(t)??-1;return o===i?0:o0?t:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}function Ub(e,t){if(null!=e)for(let o=e.length-1;o>=0;o--)t(e[o],o)}function $b(e,t,o,s){const i=[],n=e?.filterModels;for(let r=0;rnull==e)?null:{filterType:"multi",filterModels:i}}function jb(e,t){return e?.filterModels?.[t]??null}function Kb(e,t,o,s){const i=o.filterValueGetter;return i?e.colFilter.createGetValue(t,i):s}var _b=class extends Ml{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?Ns.resolve():(this.tabGuardFeature.removeAllChildrenExceptTabGuards(),this.destroyChildren(),Ns.all(this.getFilterWrappers().map((t,o)=>{if(!t)return Ns.resolve(null);const s=this.getFilterFromWrapper(t),i=this.getCompFromWrapper(t),n=this.filterDefs[o],r=function(e,t){return null!=t.title?t.title:e instanceof tn?e.getFilterTitle():"Filter"}(s,n);let l;if("subMenu"===n.display&&"toolPanel"!==e)l=this.insertFilterMenu(i,s,r).then(e=>e.getGui());else if("subMenu"===n.display||"accordion"===n.display){const e=this.insertFilterGroup(s,i,r);l=Ns.resolve(e.getGui())}else l=Ns.resolve(i.getGui());return l})).then(t=>{t.forEach((e,t)=>{e&&(t>0&&this.appendChild(Cl({tag:"div",cls:"ag-filter-separator"})),this.appendChild(e))}),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,o){P(e.getGui(),"dialog");const s=this.createBean(new yw);return s.init({menuItemDef:{name:o,subMenu:[],subMenuRole:"dialog",cssClasses:["ag-multi-filter-menu-item"],menuItem:Yv,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:{getGui:()=>e.getGui(),afterGuiAttached:o=>{e.afterGuiAttached?.(o),e!==t&&t.afterGuiAttached?.(o)}},contextParams:{column:null,node:null,value:null}}).then(()=>{s.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(s)),this.addManagedListeners(s,{menuItemActivated:e=>{this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==e.menuItem&&this.lastActivatedMenuItem.deactivate(),this.lastActivatedMenuItem=e.menuItem}});const e=s.getGui();return s.addManagedElementListeners(e,{keydown:e=>{const{key:t}=e;switch(t){case bs:case ys:case Ss:case ws:e.preventDefault(),t===ys&&s.openSubMenu(!0)}},focusin:()=>s.activate(),focusout:()=>{s.isSubMenuOpen()||s.isSubMenuOpening()||s.deactivate()}}),s})}insertFilterGroup(e,t,o){const s=this.createBean(new Rv({title:o,cssIdentifier:"multi-filter"}));return this.guiDestroyFuncs.push(()=>this.destroyBean(s)),s.addItem(t.getGui()),s.toggleGroupExpand(!1),e.afterGuiAttached&&s.addManagedListeners(s,{expanded:()=>e.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})}),s}afterGuiAttached(e){let t;e?(this.hidePopup=e.hidePopup,t=this.refreshGui(e.container)):(this.hidePopup=void 0,t=Ns.resolve());const o=e?.suppressFocus;t.then(()=>{const{filterDefs:t,filterGuis:s,beans:i}=this,n=this.getFilterWrappers();let r=!!o;t&&Ub(t,(t,i)=>{const l=0===i,a=t.display&&"inline"!==t.display,d=o||!l||a,c={...e??{},suppressFocus:d},h=n[i],u=h?this.getFilterFromWrapper(h):void 0;if(h){const e=this.getCompFromWrapper(h);e!==u&&e.afterGuiAttached(c)}if(u&&(this.executeFunctionIfExistsOnFilter(u,"afterGuiAttached",c),l&&!d&&(r=!0)),!o&&l&&a){const e=s[i];e&&(Wi(e)||e.focus({preventScroll:!0}),r=!0)}});const l=w(i);r||!y(i)&&!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){Ub(this.getFilterWrappers(),o=>{o&&(t?.(o),this.executeFunctionIfExistsOnFilter(this.getFilterFromWrapper(o),e))})}executeFunctionIfExistsOnFilter(e,t,...o){const s=e[t];"function"==typeof s&&s.apply(e,o)}onFocusIn(e){const t=this.lastActivatedMenuItem;null==t||t.getGui().contains(e.target)||(t.deactivate(),this.lastActivatedMenuItem=null)}},qb=class extends _b{constructor(){super(...arguments),this.filterType="multi",this.wrappers=[],this.activeFilterIndices=[],this.afterFiltersReadyFuncs=[]}init(e){this.params=e,this.filterDefs=Wb(e);const t=wp(this.beans.colFilter.model,e.column.getColId()),{filterChangedCallback:o}=e;this.filterChangedCallback=o;const s=this.filterDefs.map((e,o)=>this.createFilter(e,o,t));return new Ns(e=>{Ns.all(s).then(t=>{this.wrappers=t,this.refreshGui("columnMenu").then(()=>{e()})})}).then(()=>{for(const e of this.afterFiltersReadyFuncs)e();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:o,model:s}=e;return o?null!=s:t.isFilterActive()})}getLastActiveFilterIndex(){const e=this.activeFilterIndices;return e.length>0?e[e.length-1]:null}doesFilterPass(e,t){return this.wrappers.every((o,s)=>{if(!o||null!=t&&s===t)return!0;const{handler:i,filter:n,model:r}=o;return i?null==r||i.doesFilterPass({...e,model:r,handlerParams:o.handlerParams}):!n.isFilterActive()||n.doesFilterPass(e)})}getModelFromUi(){return{filterType:this.filterType,filterModels:this.wrappers.map(e=>{if(!e)return null;const t=e.filter;return"function"==typeof t.getModelFromUi?t.getModelFromUi():null})}}getModel(){return this.isFilterActive()?{filterType:this.filterType,filterModels:this.wrappers.map(e=>{if(!e)return null;const{filter:t,handler:o,model:s}=e;return o?s:t.isFilterActive()?t.getModel():null})}:null}setModel(e){const t=[];return this.wrappers.forEach((o,s)=>{if(!o)return;const i=jb(e,s),{filter:n,filterParams:r,handler:l,handlerParams:a,state:d}=o;if(l){const e={model:i,state:d?.state};o.state=e,o.model=i,t.push(mp(()=>Ns.resolve({filter:n,filterParams:r}),l,a,i,e,"api").then(()=>{this.updateActiveListForHandler(s,o.model)}))}else t.push(((e,t)=>new Ns(o=>{const s=e.setModel(t);s?s.then(o):o()}))(n,i).then(()=>{this.updateActiveListForFilter(s,n)}))}),Ns.all(t).then(()=>{})}applyModel(e="api"){let t=!1;for(const o of this.wrappers)if(o){const s=o.filter;s instanceof tn&&(t=s.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,o){const s=this.params.column;let i,n=null;const r=this.beans,l=(e,o)=>{const s=this.wrappers[t];if(!s)return;const i={model:e,state:s.state?.state};s.state=i,s.model=e,mp(()=>Ns.resolve({filter:s.filter,filterParams:s.filterParams}),s.handler,s.handlerParams,e,i,"ui").then(()=>{this.onHandlerModelChanged(t,s.model,o)})},{compDetails:a,handler:d,handlerParams:c,createFilterUi:h}=r.colFilter.createFilterInstance(s,e,"agTextColumnFilter",(c,h)=>{const u={...c,filterChangedCallback:h?()=>{}:e=>{this.executeWhenAllFiltersReady(()=>this.onFilterModelChanged(t,e))},doesRowPassOtherFilter:e=>c.doesRowPassOtherFilter(e)&&this.doesFilterPass({node:e,data:e.data},t),getValue:Kb(r,s,e,c.getValue)};return h&&(n=jb(o,t),i=this.updateDisplayParams(u,t,n,()=>a,()=>d,l)),u});if(!h)return Ns.resolve(null);let u;if(d){const{doesRowPassOtherFilter:o,getValue:i}=c;u={...c,onModelChange:l,doesRowPassOtherFilter:e=>o(e)&&this.doesFilterPass({node:e,data:e.data},t),getValue:Kb(r,s,e,i)},d.init?.({...u,model:n,source:"init"})}return h().then(e=>{if(!d)return{filter:e,comp:e};const t=a?.params;return{filter:e,comp:i(e),filterParams:t,handler:d,handlerParams:u,model:n}})}updateDisplayParams(e,t,o,s,i,n){const r=this.params.column,l=new u;e.model=o,e.state={model:o},e.onModelChange=n,e.getHandler=i;const a=(e,t)=>{e.state=t,l.dispatchEvent({type:"filterStateChanged",column:r,state:t})};e.onStateChange=e=>{const o=this.wrappers[t];o&&(a(o,e),fp(o.filter,o.filterParams,o.model??null,e,"ui"))};const d=(e,o,i)=>{const n=this.wrappers[t];if(!n)return;const r=()=>n?.model??null;vp({action:o,filterParams:n.filterParams,getFilterUi:()=>{const e=Ns.resolve(n.filter);return{created:!0,filterParams:n.filterParams,compDetails:s(),create:()=>e,promise:e}},getModel:r,getState:()=>n?.state??{model:r()},updateState:e=>a(n,e),updateModel:e=>n.filterParams?.onModelChange(e,i),processModelToApply:n.handler?.processModelToApply?.bind(n.handler)})};return e.onAction=(e,t,o)=>{d(0,e,t),l.dispatchEvent({type:"filterAction",column:r,action:e,event:o})},e=>{const t=s()?.params;return this.createManagedBean(new Hp(r,{comp:e,params:t,isHandler:!0},l,d,!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,()=>null!=t)}updateActiveList(e,t){const o=this.activeFilterIndices;s(this.activeFilterIndices,e),t()&&o.push(e)}onFilterModelChanged(e,t){this.updateActiveListForFilter(e,this.wrappers[e]?.filter),this.filterChanged(e,t)}onHandlerModelChanged(e,t,o){this.updateActiveListForHandler(e,t),this.filterChanged(e,o)}filterChanged(e,t){this.filterChangedCallback(t),this.wrappers.forEach((t,o)=>{if(e===o||!t)return;const{filter:s,handler:i}=t;i?.onAnyFilterChanged?.(),"function"==typeof s.onAnyFilterChanged&&s.onAnyFilterChanged()})}getModelAsString(e){if(!e?.filterModels?.length)return"";const t=this.getLastActiveFilterIndex()??0;return(this.wrappers[t]?.filter)?.getModelAsString?.(e.filterModels[t])??""}},Yb=class extends _b{constructor(){super(...arguments),this.filterType="multi",this.filters=[],this.filterParams=[],this.validity=[]}init(e){this.params=e,this.filterDefs=Wb(e).map(t=>{if(t.filterParams?.buttons){Dt(292,{colId:e.column.getColId()});const o={...t.filterParams};return delete o.buttons,{...t,filterParams:o}}return t}),this.allState=e.state;const t=this.filterDefs.map((e,t)=>this.createFilter(e,t));return new Ns(e=>{Ns.all(t).then(t=>{this.filters=t,this.refreshGui("columnMenu").then(()=>{e()})})})}refresh(e){const{model:t,state:o,source:s}=e;if("colDef"===s)return!1;this.params=e;const i=this.filterParams;if(o===this.allState)return!0;this.allState=o;const n=o.state;return this.filters.forEach((e,r)=>{const l=jb(t,r),a={state:n?.[r],model:jb(o.model,r)};fp(e,i[r],l,a,s)}),!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 o=ri(this.beans.userCompFactory,e,this.updateParams(e,this.params,t),"agTextColumnFilter");return o?(this.filterParams[t]=o.params,o.newAgStackInstance()):Ns.resolve(null)}updateParams(e,t,o){const{doesRowPassOtherFilter:s,model:i,onModelChange:n,state:r,onStateChange:l,column:a,source:d,onAction:c,onUiChange:h,getValue:u}=t,g=jb(i,o),p=r?{model:jb(r.model,o),state:r.state?.[o]}:{model:g},m=()=>{const e=this.getHandler();this.filters.forEach((t,s)=>{o!==s&&(e.getHandler(s)?.onAnyFilterChanged?.(),t?.onAnyFilterChanged?.())})},f=this.beans.colFilter;return{...f.createBaseFilterParams(a),...e,doesRowPassOtherFilter:e=>s(e)&&this.getHandler().doesFilterPass({node:e,data:e.data,model:this.params.model,handlerParams:f.getHandlerParams(a)},o),model:g,state:p,onModelChange:(e,t)=>{const{filters:s,params:i}=this,r=$b(i.model,s.length,e,o);this.updateActiveList(o,e),n(r,t),m()},onStateChange:e=>this.onStateChange(l,o,e),getHandler:()=>this.getHandler().getHandler(o),onAction:(e,s,i)=>{if(en(t))return;const n="apply"===e||"reset"===e;n&&this.updateActiveList(o,jb(this.params.state.model,o)),c(e,s,i),n&&m()},onUiChange:h,source:d,getValue:Kb(this.beans,a,e,u)}}updateActiveList(e,t){this.getHandler().updateActiveList?.(e,t)}getHandler(){return this.params.getHandler()}onStateChange(e,t,o){const{model:s,state:i,valid:n}=o,r=this.validity;r[t]=n;const l=this.allState,a=$b(l.model,this.filters.length,s,t),d=r.every(e=>!1!==e),c=[...l.state??[]];c[t]=i;const h={state:c,model:a,valid:d};this.allState=h,e(h)}getModelAsString(e){return this.getHandler().getModelAsString?.(e)??""}},Zb={tag:"div",cls:"ag-multi-floating-filter ag-floating-filter-input"},Qb={moduleName:"MultiFilter",version:Dv,userComponents:{agMultiColumnFilter:{getComp:e=>e.gos.get("enableFilterHandlers")?{classImp:Yb,params:{useForm:!0}}:qb},agMultiColumnFloatingFilter:class extends Pi{constructor(){super(Zb),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(e=>{const o=e?.newAgStackInstance();null!=o&&(this.compDetailsList.push(e),t.push(o))}),Ns.all(t).then(e=>{e.forEach((e,t)=>{this.floatingFilters.push(e);const o=e.getGui();this.appendChild(o),t>0&&K(o,!1)})})}refresh(e){this.params=e;const{compDetailsList:t,floatingFilterParamsList:o}=this.getCompDetailsList(e);if(t.length===this.compDetailsList.length&&t.every((e,t)=>!this.beans.colFilter?.areFilterCompsDifferent(this.compDetailsList[t],e))){if(o.forEach((e,t)=>{this.floatingFilters[t].refresh?.(e)}),this.gos.get("enableFilterHandlers")){const t=e;if(null==t.model)this.floatingFilters.forEach((e,t)=>{K(e.getGui(),0===t)});else{const e=t.getHandler()?.getLastActiveFilterIndex?.();this.floatingFilters.forEach((t,o)=>{const s=null==e?0===o:o===e;K(t.getGui(),s)})}}}else se(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(t)}getCompDetailsList(e){const t=[],o=[],s=e.filterParams,i=e.currentParentModel,n=Wb(s);return n.forEach((s,r)=>{const l={...e,parentFilterInstance:e=>{this.parentMultiFilterInstance(t=>{const o=t.getChildFilterInstance(r);null!=o&&e(o)})},currentParentModel:()=>i()?.filterModels?.[r]??null};if(this.gos.get("enableFilterHandlers")){const e=l;e.model=e.model?.filterModels?.[r]??null;const{onModelChange:t,getHandler:o}=e;e.onModelChange=(e,o)=>t($b(this.params.model,n.length,e,r),o),e.getHandler=()=>o().getHandler(r)}Ye(l.filterParams,s.filterParams);const a=this.getCompDetails(s,l);a&&(t.push(a),o.push(l))}),{compDetailsList:t,floatingFilterParamsList:o}}onParentModelChanged(e,t){t?.afterFloatingFilter||this.parentMultiFilterInstance(o=>{if(null==e)this.floatingFilters.forEach((e,o)=>{e.onParentModelChanged(null,t),K(e.getGui(),0===o)});else{const s=o.getLastActiveFilterIndex();this.floatingFilters.forEach((o,i)=>{const n=e.filterModels.length>i?e.filterModels[i]:null;o.onParentModelChanged(n,t);const r=null==s?0===i:i===s;K(o.getGui(),r)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(e,t){const{colFilter:o,frameworkOverrides:s,userCompFactory:i}=this.beans;return li(i,e,t,Lp(s,e,()=>o.getDefaultFloatingFilter(this.params.column))??"agReadOnlyFloatingFilter")}parentMultiFilterInstance(e){this.params.parentFilterInstance(t=>{t instanceof qb||t instanceof Yb||Mt(120),e(t)})}}},beans:[class extends Oe{constructor(){super(...arguments),this.beanName="multiFilter"}getParamsForDataType(e,t,o,s){let i=e?.filters;const n=this.beans;i||(i=[{filter:kp(o.baseDataType)},{filter:"agSetColumnFilter"}]);const r=this.getLocaleTextFunc();return i=i.map(e=>{const{filter:i,filterParams:l,filterValueGetter:a}=e;if("string"!=typeof i)return e;const{filterParams:d,filterValueGetter:c}=Tp(i,l,a??t,o,s,n,r);return{...e,filterParams:d,filterValueGetter:c}}),{filterParams:{...e,filters:i}}}}],dynamicBeans:{agMultiColumnFilterHandler:class extends Oe{constructor(){super(...arguments),this.filterType="multi",this.handlerWrappers=[],this.activeFilterIndices=[],this.filterDefs=[]}init(e){this.params=e;const t=Wb(e.filterParams);this.filterDefs=t,t.forEach((t,o)=>{const s=this.beans.colFilter.createHandler(e.column,t,"agTextColumnFilter");if(this.handlerWrappers.push(s),!s)return void Dt(278,{colId:e.column.getColId()});const{handler:i,handlerParams:n}=s;i.init?.({...this.updateHandlerParams(n,o,!0),model:jb(e.model,o),source:"init"})}),this.resetActiveList(e.model)}refresh(e){this.params=e;const{model:t,source:o,filterParams:s}=e,i=s?.filters;this.handlerWrappers.forEach((s,n)=>{if(s){const r=this.updateHandlerParams(e,n,!1,i?.[n].filterParams);s.handlerParams=r,s.handler.refresh?.({...r,model:jb(t,n),source:o})}}),"floating"!==e.source&&"ui"!==e.source&&this.resetActiveList(e.model),e.additionalEventAttributes?.fromButtons&&this.onAnyFilterChanged()}updateHandlerParams(e,t,o,s){const{onModelChange:i,doesRowPassOtherFilter:n,getValue:r}=e,l={...e,onModelChange:(e,o)=>i($b(this.params.model,this.handlerWrappers.length,e,t),o),doesRowPassOtherFilter:e=>n(e)&&this.doesFilterPass({node:e,data:e.data,model:this.params.model,handlerParams:l},t),getValue:Kb(this.beans,e.column,this.filterDefs[t],r),filterParams:this.updateFilterParams(e,o,s)};return l}updateFilterParams(e,t,o){const s=e.filterParams;o?.buttons&&t&&Dt(292,{colId:e.column.getColId()});const i=o?{...s,...o}:s;if(!i.buttons)return i;if(o)return delete i.buttons,i;const{buttons:n,...r}=i;return r}doesFilterPass(e,t){const o=e.model?.filterModels;return null==o||this.handlerWrappers.every((s,i)=>{const n=o[i];if(null==n||null!=t&&i===t)return!0;const r=s?.handler;return!r||r.doesFilterPass({...e,model:n,handlerParams:s.handlerParams})})}resetActiveList(e){this.activeFilterIndices=[];const t=e?.filterModels;if(null!=t)for(let o=0;o0?e[e.length-1]:null}getModelAsString(e,t){const o="filterToolPanel"===t,s=()=>o?this.getLocaleTextFunc()("filterSummaryInactive","is (All)"):"";if(!e?.filterModels?.length)return s();const i=this.getLastActiveFilterIndex()??0;return this.handlerWrappers[i]?.handler.getModelAsString?.(e.filterModels[i],t)??s()}getHandler(e){return this.handlerWrappers[e]?.handler}onAnyFilterChanged(){Ub(this.handlerWrappers,e=>e?.handler?.onAnyFilterChanged?.())}onNewRowsLoaded(){Ub(this.handlerWrappers,e=>e?.handler?.onNewRowsLoaded?.())}destroy(){for(const e of this.handlerWrappers)this.destroyBean(e?.handler);this.handlerWrappers.length=0,super.destroy()}}},dependsOn:[Mv,Up,Zv]},Xb={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"};function Jb(e){const{values:t}=e;let o=null;for(let s=0;s0?e.values[0]:null}function ty(t){return t.values.length>0?e(t.values):null}function oy(e){const{values:t}=e;let o=null;for(let s=0;se)||(o=e)}return o}function sy(e){const{values:t}=e;let o=null;for(let s=0;s0&&(i=o/("number"==typeof o?s:BigInt(s)));const n=e.rowNode?.aggData?.[e.column?.getColId()];if(n&&n.count===s&&n.value===i)return n;const r=Object.create(ry);return r.count=s,r.value=i,r}var ay=(e,t,o)=>{const s=t?.colDef,i=s?.pivotKeys;return i?e.leafGroup&&i.length&&!s.pivotTotalColumnIds?hw(e.childrenMapped,i):e.childrenAfterFilter??e.childrenAfterGroup??[]:$t(o)||o.get("suppressAggFilteredOnly")?e.childrenAfterGroup??[]:e.childrenAfterFilter??e.childrenAfterGroup??[]},dy=(e,t,o,s)=>{for(let i=0,n=e.length;i{if("function"==typeof e)return e;if(null==e)return null;const s=t.getAggFunc(e);return"function"!=typeof s?(Dt(109,{inputValue:e.toString(),allSuggestions:t.getFuncNames(o)}),null):s};function hy(e,t){if(e.sibling)return;const o=((e,t)=>{const o=new ln(t);for(const s of Object.keys(e))cn.has(s)||(o[s]=e[s]);return o.oldRowTop=null,o})(e,t);o.footer=!0,o.setRowTop(null),o.setRowIndex(null),o.oldRowTop=null,o.id="rowGroupFooter_"+e.id,o.sibling=e,e.sibling=o}function uy(e){const t=e.sibling;t&&(t._destroy(!1),e.sibling=void 0,t.sibling=void 0)}var gy=class extends bm{constructor(){super(...arguments),this.beanName="valueColsSvc",this.eventName="columnValueChanged",this.columnProcessors={set:(e,t,o)=>this.setValueActive(t,e,o),add:(e,t,o)=>this.setValueActive(!0,e,o),remove:(e,t,o)=>this.setValueActive(!1,e,o)},this.columnExtractors={setFlagFunc:(e,t,o)=>this.setColValueActive(e,t,o),getIndexFunc:()=>{},getInitialIndexFunc:()=>{},getValueFunc:e=>{const t=e.aggFunc;return null===t||""===t?null:void 0!==t?!!t:void 0},getInitialValueFunc:e=>null!=e.initialAggFunc&&""!=e.initialAggFunc},this.modifyColumnsNoEventsCallbacks={addCol:e=>this.columns.push(e),removeCol:e=>s(this.columns,e)}}extractCols(e,t){this.columns=super.extractCols(e,t);for(const o of this.columns){const e=o.getColDef();null!=e.aggFunc&&""!=e.aggFunc?this.setColAggFunc(o,e.aggFunc):o.getAggFunc()||this.setColAggFunc(o,e.initialAggFunc)}return this.columns}setColumnAggFunc(e,t,o){if(!e)return;const s=this.colModel.getColDefCol(e);s&&(this.setColAggFunc(s,t),this.dispatchColumnChangedEvent(this.eventSvc,this.eventName,[s],o))}syncColumnWithState(e,t,o){const s=o("aggFunc").value1;void 0!==s&&("string"==typeof s?(this.setColAggFunc(e,s),e.isValueActive()||(this.setColValueActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e))):(l(s)&&Dt(33),e.isValueActive()&&(this.setColValueActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e))))}setValueActive(e,t,o){if(e!==t.isValueActive()&&(this.setColValueActive(t,e,o),e&&!t.getAggFunc()&&this.aggFuncSvc)){const e=this.aggFuncSvc.getDefaultAggFunc(t);this.setColAggFunc(t,e)}}setColAggFunc(e,t){e.aggFunc=t,e.dispatchStateUpdatedEvent("aggFunc")}setColValueActive(e,t,o){e.aggregationActive!==t&&(e.aggregationActive=t,e.dispatchColEvent("columnValueChanged",o))}},py={moduleName:"SharedAggregation",version:Dv,beans:[class extends Oe{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=Jb,e.first=ey,e.last=ty,e.min=oy,e.max=sy,e.count=ny,e.avg=ly,this.initialised=!0}isAggFuncPossible(e,t){const o=this.getFuncNames(e).includes(t),s=l(this.aggFuncsMap[t]);return o&&s}getDefaultFuncLabel(e){return Xb[e]??e}getDefaultAggFunc(e){const t=e.getColDef().defaultAggFunc;if(l(t)&&this.isAggFuncPossible(e,t))return t;if(this.isAggFuncPossible(e,"sum"))return"sum";const o=this.getFuncNames(e);return o?.length?o[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 null==t?Object.keys(this.aggFuncsMap).sort():t}clear(){this.aggFuncsMap={}}},class extends Oe{constructor(){super(...arguments),this.beanName="aggColNameSvc"}getHeaderName(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const{valueColsSvc:o,colModel:s,rowGroupColsSvc:i}=this.beans,n=e.getColDef().pivotValueColumn;let r,a=null;if(l(n)){const s=o?.columns??[],i=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===s.length,l=void 0!==e.getColDef().pivotTotalColumnIds;if(i&&!l)return t;a=n?n.getAggFunc():null,r=!0}else{const t=e.isValueActive(),o=0!==i?.columns.length,n=s.isPivotMode()||o||this.gos.get("treeData");t&&n?(a=e.getAggFunc(),r=!0):r=!1}if(r){const e="string"==typeof a?a:"func";return`${this.getLocaleTextFunc()(e,e)}(${t})`}return t}},class extends Oe{constructor(){super(...arguments),this.beanName="footerSvc"}addTotalRows(e,t,o,s,i,n){let r=e;if(i)return function(e,t){switch(t){case"top":case"pinnedTop":return"top"===e;case"bottom":case"pinnedBottom":return"bottom"===e;default:return!1}}(n,s&&jt(this.gos))&&(hy(t,this.beans),o(t.sibling,r++)),r;const l=Kt(this.gos);return(s&&l({node:t}))===n&&(hy(t,this.beans),o(t.sibling,r++)),r}getTopDisplayIndex(e,t,o,s){let i=t;if(e[0].footer){if(0===t)return 0;i-=1}const n=e[e.length-1],r=i>=o.length;return n.footer&&r?n.rowIndex:s(i)}doesCellShowTotalPrefix(e,t){return!(!e.footer||!t?.getColDef().showRowGroup)&&(!!this.gos.get("treeData")||(-1===e.level?this.beans.showRowGroupCols?.columns[0]===t:!!e.rowGroupColumn&&t?.isRowGroupDisplayed(e.rowGroupColumn.getId())))}applyTotalPrefix(e,t,o,s){const i=s.getColDef().cellRendererParams?.totalValueGetter;if(i){const n=Co(this.gos,{column:s,node:o,value:e,formattedValue:t});if("function"==typeof i)return i(n);if("string"==typeof i)return this.beans.expressionSvc?.evaluate(i,n);Dt(179)}return-1===o.level?this.getLocaleTextFunc()("footerTotal","Total")+" ":this.getTotalValue(t??e)??""}getTotalValue(e){return this.getLocaleTextFunc()("footerTotal","Total")+" "+(e??"")}},gy],apiFunctions:{addAggFuncs:function(e,t){e.aggFuncSvc&&e.aggFuncSvc.addAggFuncs(t)},clearAggFuncs:function(e){e.aggFuncSvc&&e.aggFuncSvc.clear()},setColumnAggFunc:function(e,t,o){e.valueColsSvc?.setColumnAggFunc?.(t,o,"api")}},dependsOn:[Mv]},my={moduleName:"Aggregation",version:Dv,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="aggStage",this.step="aggregate",this.refreshProps=["getGroupRowAgg","alwaysAggregateAtRootLevel","suppressAggFilteredOnly","grandTotalRow"],this.hadAgg=!1}execute(e){const{gos:t,beans:o}=this,s=t.getCallback("getGroupRowAgg"),i=o.valueColsSvc?.columns;if(!i?.length&&!s){if(this.hadAgg&&!e){this.hadAgg=!1;const e=o.colModel,t=o.rowModel;eg(t.rootNode,t.hierarchical,void 0,t=>{gw(t,null,e)})}return}this.hadAgg=!0;const n=o.colModel,r=o.aggFuncSvc,l=t.get("alwaysAggregateAtRootLevel")||!!jt(t)||n.isPivotMode(),a=!$t(t)&&!t.get("suppressAggFilteredOnly"),d=o.valueSvc,c=o.gridApi,h=o.gridOptions.context,u=i??[],g=u.length,p="cells"===e?.kind?e:void 0;let m;const f=new Array(g);for(let b=0;b=0&&(m=p),f[b]={column:e,colId:e.colId,colDef:e.colDef,aggFunc:cy(e.getAggFunc(),r,e),colSlot:t}}const C=((e,t,o)=>{if(!e.isPivotActive())return null;const s=t?.getAggregationOrderedList();if(!s||0===s.length)return null;const i=s.length,n=new Array(i);let r=0;for(let l=0;l0?new Array(g):null,w=o.rowModel;eg(w.rootNode,w.hierarchical,e,e=>{if(-1===e.level&&!l)return void uw(e,null,n);let t;t=s?s({nodes:e.childrenAfterFilter}):v?C?((e,t,o,s,i)=>{const n=t.length,r=e.leafGroup,l=e.data,a=e.childrenMapped,d=e.childrenAfterFilter??[],c=/* @__PURE__ */Object.create(null);let h,u;for(let g=0;g{const d=(n?e.childrenAfterFilter:e.childrenAfterGroup)??[],c=d.length,h=e.data,u=/* @__PURE__ */Object.create(null),g=i?i.getSlot(e):-1,p=g>=0?e.aggData:void 0;let m=0;for(let f=0;f=0&&!i.hasCellBySlot(g,e.colSlot)?(s[f]=null,p&&(u[e.colId]=p[e.colId])):(s[f]=new Array(c),++m)}if(0===m)return u;for(let f=0;f{const t=e.childrenAfterAggFilter;let o=0;if(t){const e=t.length;o=e;for(let s=0;s=0?null:o;e.setAllChildrenCount(s),e.pinnedSibling?.setAllChildrenCount(s)},this.setAllChildrenCountGridGrouping=e=>{const t=e.childrenAfterAggFilter;let o=0;for(let s=0,i=t.length;se.node.leafGroup:e=>!e.node.group),d=l?this.setAllChildrenCountTreeData:this.setAllChildrenCountGridGrouping,c=(e,t=!1)=>{if(e.childrenAfterFilter){if(e.childrenAfterAggFilter=e.childrenAfterFilter,t){const o=e.childrenAfterAggFilter;for(let e=0,s=o.length;e{e.childrenAfterAggFilter=e.childrenAfterFilter?.filter(e=>a({node:e})&&i.doesRowPassAggregateFilters({rowNode:e})?(c(e,!0),!0):e.childrenAfterAggFilter?.length)||null,e.hasChildren()?d(e):(e.setAllChildrenCount(null),e.pinnedSibling?.setAllChildrenCount(null)),e.sibling&&(e.sibling.childrenAfterAggFilter=e.childrenAfterAggFilter)}:c)}},class extends Oe{constructor(){super(...arguments),this.beanName="aggChildrenSvc"}getAggregatedChildren(e,t,o){if(!e?.group)return[];if(e.rowPinned&&!(e=e.pinnedSibling))return[];const s=this.gos,i=ay(e,t,s);if(!o)return i;const n=[];return dy(i,t,s,n),n}}],rowModels:["clientSide"],dependsOn:[py]},fy=class extends bm{constructor(){super(...arguments),this.beanName="pivotColsSvc",this.eventName="columnPivotChanged",this.columnProcessors={set:(e,t,o)=>this.setColPivotActive(e,t,o),add:(e,t,o)=>this.setColPivotActive(e,!0,o),remove:(e,t,o)=>this.setColPivotActive(e,!1,o)},this.columnOrdering={enableProp:"pivot",initialEnableProp:"initialPivot",indexProp:"pivotIndex",initialIndexProp:"initialPivotIndex"},this.columnExtractors={setFlagFunc:(e,t,o)=>this.setColPivotActive(e,t,o),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=>s(this.columns,e)}}syncColumnWithState(e,t,o,s){const{value1:i,value2:n}=o("pivot","pivotIndex");void 0===i&&void 0===n||("number"==typeof n||i?(e.isPivotActive()||(this.setColPivotActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)),s&&"number"==typeof n&&(s[e.getId()]=n)):e.isPivotActive()&&(this.setColPivotActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)))}setColPivotActive(e,t,o){e.pivotActive!==t&&(e.pivotActive=t,t&&(this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,e))?.forEach(e=>this.setColPivotActive(e,t,o)),e.dispatchColEvent("columnPivotChanged",o)),e.dispatchStateUpdatedEvent("pivot")}},Cy=null,vy=e=>{const t=Cy,o=new Uint32Array(1<<32-Math.clz32(63|e));return t&&o.set(t),Cy=o,o},wy=(e,t=e.length)=>{if(2===t){if(e[0].level16)return((e,t)=>{let o=e[0].level+1,s=o,i=0,n=o,r=Cy;(!r||o>=r.length)&&(r=vy(o)),++r[o];for(let h=1;ho?(o=t,o>=r.length&&(r=vy(o))):t=0)return r.fill(0,s,o+1),e;const l=r[s],a=r[o];if(l+a===t)return r[s]=0,r[o]=0,((e,t,o,s)=>{const i=t-s,n=o-1;if(1===i){let o=0;for(;e[o].level===n;)++o;if(o0){const o=e[t];e.copyWithin(1,0,t),e[0]=o}return e}const r=new Array(i);let l=0,a=0;for(let d=0;d=s;--h){const e=r[h];r[h]=d,d+=e}const c=new Array(t);for(let h=0;h=0&&e[i].level=0;)o.set(t,-1),t=t.parent;return}const s=this.rows;do{o.set(t,-1),s.push(t),t=t.parent}while(null!=t&&!o.has(t));this.unsorted=!0}addCell(e,t){if(null==t)return void this.addRow(e);if(null==e)return;const o=this.slots,s=this.bits,i=o.get(t)??this.ensureCol(t);let n=o.get(e);if(void 0===n)n=this.ensureRow(e);else if(n<0)return;const r=i<32?s:this.extraBits[(i>>>5)-1],l=1<<(31&i),a=r[n];if(0!==(a&l))return;r[n]=a|l;let d=e.parent;for(;null!=d;){const e=o.get(d);if(e<0)break;const t=r[e];if(0!==(t&l))break;r[e]=t|l,d=d.parent}}hasRow(e){return this.slots.has(e)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;const e=wy(this.rows);return this.rows=e,e}getSlot(e){return this.slots.get(e)??-1}hasCellBySlot(e,t){return e<0||(t<32?t>=0&&!!(this.bits[e]&1<>>5)-1][e]&1<<(31&t)))}ensureRow(e){const t=this.slots,o=this.rows,s=this.bits,i=this.extraBits;let n=s.push(0);const r=n-1;if(null!==i)for(let a=0,d=i.length;a=32){const e=(t>>>5)-1;let o=this.extraBits;null===o&&(o=[],this.extraBits=o),e>=o.length&&o.push(new Array(this.bits.length).fill(0))}return t}},yy=class{constructor(){this.kind="rows",this.rows=[],this.unsorted=!1,this.rowSet=/* @__PURE__ */new Set}addRow(e){let t=e;if(null==t)return;const o=this.rowSet;if(o.has(t))return;const s=this.rows;do{o.add(t),s.push(t),t=t.parent}while(null!=t&&!o.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=wy(this.rows);return this.rows=e,e}},Sy=class extends Oe{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,o=this.updateExpandedCss.bind(this,e,t);return{expandedChanged:o,hasChildrenChanged:o}}setExpanded(e,t,o,s){if(e.expanded===t)return;e._expanded=t,e.dispatchRowEvent("expandedChanged");const i={...an(e,this.gos,"rowGroupOpened"),expanded:t,event:o||null};this.dispatchExpandedEvent(i,s)}defaultExpanded(e){const t=this.beans.gos,o=e.level??0,s=e.group&&t.get("isGroupOpenByDefault");if(!s){const e=t.get("groupDefaultExpanded");return-1===e||o{const t=e.rowComp;t.toggleCss("ag-row-group",o),t.toggleCss("ag-row-group-expanded",o&&s),t.toggleCss("ag-row-group-contracted",o&&!s),G(e.element,o&&s)})}dispatchStateUpdatedEvent(){this.eventSvc.dispatchEvent({type:"rowExpansionStateChanged"})}};function Ry(e,t,o){return!0===e.groupHideParentOfSingleChild&&o&&1===t.childrenAfterGroup.length}function xy(e,t,o){return"leafGroupsOnly"===e.groupHideParentOfSingleChild&&o&&t.leafGroup&&1===t.childrenAfterGroup.length}function Fy(e,t,o,s,i,n){return!(s&&!o||i||n||e.hideOpenParents&&!t.master&&-1!==t.level&&!(s&&t.leafGroup||!t.expanded))}var Dy=()=>{const e=new Jl;return e.reordered=!0,e},My=(e,t)=>{if(!e||!t)return!1;let o=t;for(;o;){if(o===e)return!0;o=o.parent}return!1},Py=e=>{const t=e.childrenAfterGroup,o=t?.length;if(e._leafs=null,!o)return null;let s;const i=1===o?t[0]:null;if(i?.group&&i.sourceRowIndex<0)s=i._leafs,void 0===s&&(s=Py(i));else if(e.leafGroup)s=t;else{s=[];for(let e=0;e=0&&s.push(o),!o.group)continue;let i=o._leafs;if(void 0===i&&(i=Py(o)),i)for(let e=0,t=i.length;e{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 Ty(e,t,o){let s=e;const i=s.level-t.level;if(i<=0)return!1;if(!o.get("groupHideOpenParents"))return!1;for(let n=0;n{const{rowDragSvc:e}=this.beans;if(!this.params.rowDrag||!e)return;const t=e.createRowDragComp(()=>this.params.value,this.params.node);this.createManagedBean(t),this.eGui.insertAdjacentElement("afterbegin",t.getGui())})(),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="left"===this.params.pinned,o="right"===this.params.pinned,s=!t&&!o;return this.gos.get("enableRtl")?e.isPinningLeft()?!o:!s:e.isPinningLeft()?!t:!s}addGroupValue(){const{params:{value:e,valueFormatted:t}}=this,o=this.getInnerCompDetails();this.comp.setInnerRenderer(o,t??e??null)}setupExpand(){const{colModel:e}=this.beans,{eGridCell:t,suppressDoubleClickExpand:o}=this.params,s=(e,t)=>{const o=Ol(e,this.beans,null);o&&(t.appendChild(o),this.addDestroyFunc(()=>o.remove()))};s("groupExpanded",this.eExpanded),s("groupContracted",this.eContracted);const i=this.comp,n=()=>{if(!this.isExpandable())return;const e=!!this.displayedNode.expanded;i.setExpandedDisplayed(e),i.setContractedDisplayed(!e),G(t,e)},r=()=>{const o=this.isExpandable();i.toggleCss("ag-cell-expandable",o),i.toggleCss("ag-row-group",o);const s=!o&&e.isPivotMode();i.toggleCss("ag-pivot-leaf-group",s);const r=!(e.isPivotMode()||this.displayedNode.footer&&-1===this.displayedNode.level);i.toggleCss("ag-row-group-leaf-indent",!o&&r);const l=this.getChildCount(),a=l>0?`(${l})`:"";i.setChildCount(a),o?n():(i.setExpandedDisplayed(!1),i.setContractedDisplayed(!1),D(t,"expanded"))};(()=>{o||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:r,masterChanged:r,groupChanged:r,hasChildrenChanged:r,expandedChanged:n})})(),r()}getInnerCompDetails(){const{userCompFactory:e,findSvc:t}=this.beans,o=this.params;if(o.fullWidth){const s=this.gos.get("groupRowRendererParams");return oi(e,s,o)||(t?.isMatch(o.node,null)?oi(e,{...s,innerRenderer:"agFindCellRenderer"},o):void 0)}const s=e=>e&&e.componentClass==this.compClass,i=oi(e,o,o);if(i&&!s(i))return i;const{displayedNode:{rowGroupColumn:n}}=this,r=n?.colDef,l=n&&o.column?.isRowGroupDisplayed(n.getId());if(r&&l){const t=si(e,r,o);if(t){if(!s(t))return t;if(r?.cellRendererParams?.innerRenderer)return oi(e,r.cellRendererParams,o)}}return t?.isMatch(o.node,o.column)?si(e,{...r??o.colDef,cellRenderer:"agFindCellRenderer"},o):void 0}getChildCount(){const{column:e,suppressCount:t}=this.params;if(t)return 0;const{allChildrenCount:o,rowGroupColumn:s}=this.displayedNode;return!((o??0)>0)||s&&e&&!e?.isRowGroupDisplayed(s.getId())||this.gos.get("showOpenedGroup")&&this.displayedNode!==this.node&&!Ty(this.node,this.displayedNode,this.gos)?0:o??0}isExpandable(){const{node:e,column:t,colDef:o}=this.params;if(!this.displayedNode.isExpandable())return!1;if(e.rowPinned)return!1;if(!t)return!0;if(e.hasChildren()&&o){const{showRowGroup:e}=o;if(!e)return!1;if(!0===e)return!0}return e===this.displayedNode?!(!e.rowGroupColumn||!t?.isRowGroupDisplayed(e.rowGroupColumn.getId()))||!!e.master&&(!0===o?.showRowGroup||null==o?.showRowGroup):Ty(this.node,this.displayedNode,this.gos)}setupIndent(){const{suppressPadding:e,node:t,colDef:o}=this.params;if(e)return;const s=()=>{let e=t.uiLevel;o&&!0!==o.showRowGroup&&(e=0);const s="ag-row-group-indent-"+e;s!==this.indentClass&&(this.indentClass&&this.comp.toggleCss(this.indentClass,!1),this.indentClass=s,this.comp.toggleCss(s,!0),this.eGui.style.setProperty("--ag-indentation-level",String(e)))};this.addManagedListeners(t,{uiLevelChanged:s.bind(this)}),s()}setupCheckbox(){const{node:e}=this.params;e.footer||e.rowPinned||e.detail||(this.addManagedPropertyListener("rowSelection",({currentValue:e,previousValue:t})=>{const o="object"==typeof e?e:void 0,s="object"==typeof t?t:void 0;o?.checkboxLocation!==s?.checkboxLocation&&(this.destroyCheckbox(),this.addCheckbox())}),this.addCheckbox())}addCheckbox(){const{selectionSvc:e}=this.beans;if(!e||!Lt(this.gos))return;const{node:t,column:o}=this.params,s=this.gos.get("rowSelection"),i=to(s);if("selectionColumn"===i)return;if("autoGroupColumn"===i){const e=null!=o?.getColDef().showRowGroup,s=!o&&t.group;if(!e&&!s)return}const n="object"==typeof s?Jt(s):this.params.checkbox;if("function"!=typeof n&&!0!==n)return;if("string"==typeof o?.getColDef().showRowGroup&&!this.isExpandable())return void this.comp.setCheckboxSpacing(!0);const r=e.createCheckboxSelectionComponent();this.cbComp=r,this.createBean(r),r.init({rowNode:t,column:o,overrides:{isVisible:n,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(r.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){Yi(e)||(qi(e),this.onExpandOrContract(e))}onKeyDown(e){e.key!==fs||this.params.suppressEnterExpand||this.isGroupCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){Yi(e)||Ee(this.eExpanded,e)||Ee(this.eContracted,e)||this.onExpandOrContract(e)}onExpandOrContract(e){if(!this.isExpandable())return;const t=this.displayedNode,o=!t.expanded;!o&&t.sticky&&this.beans.ctrlsSvc.getScrollFeature().setVerticalScrollPosition(t.rowTop-t.stickyRowTop),t.setExpanded(o,e)}destroy(){super.destroy(),this.destroyCheckbox()}},Ay={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"}]},ky=class extends Pi{constructor(){super(Ay),this.eExpanded=null,this.eContracted=null,this.eCheckbox=null,this.eValue=null,this.eChildCount=null}init(e){const t={setInnerRenderer:(e,t)=>this.setRenderDetails(e,t),setChildCount:e=>this.eChildCount.textContent=e,toggleCss:(e,t)=>this.toggleCss(e,t),setContractedDisplayed:e=>K(this.eContracted,e),setExpandedDisplayed:e=>K(this.eExpanded,e),setCheckboxVisible:e=>this.eCheckbox.classList.toggle("ag-invisible",!e),setCheckboxSpacing:e=>this.eCheckbox.classList.toggle("ag-group-checkbox-spacing",e)},o=this.createManagedBean(new Iy),s=!e.colDef,i=this.getGui();o.init(t,i,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),s&&P(i,o.getCellAriaRole())}setRenderDetails(e,t){e?e.newAgStackInstance().then(e=>{if(!e)return;const t=()=>this.destroyBean(e);this.isAlive()?(this.eValue.appendChild(e.getGui()),this.addDestroyFunc(t)):t()}):this.eValue.innerText=t}destroy(){this.destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}},Ly=class extends Oe{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.extraTopHeight=0,this.extraBottomHeight=0}postConstruct(){this.isClientSide=It(this.gos),this.beans.ctrlsSvc.whenReady(this,e=>{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(t){return this.isClientSide?function(t){if(t.isExpandable()||t.footer){if(t.footer&&0===t.rowIndex)return Number.MAX_SAFE_INTEGER;if(!t.sibling||1===Math.abs(t.sibling.rowIndex-t.rowIndex)){let o=t.footer?t.sibling:t;for(;o.isExpandable()&&o.expanded;)if(o.master&&o.detailNode)o=o.detailNode;else if(o.childrenAfterSort){if(0===o.childrenAfterSort.length)break;o=e(o.childrenAfterSort)}return o.rowTop+o.rowHeight}return t.footer?t.rowTop+t.rowHeight:t.sibling.rowTop+t.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}(t):function(e){if(e.isExpandable()||e.footer){if(e.master&&e.detailNode)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let t=e.childStore?.getStoreBounds();return e.footer&&(t=e.sibling.childStore?.getStoreBounds()),(t?.heightPx??0)+(t?.topPx??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}(t)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}updateStickyRows(e){const t="top"===e;let o=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,/* @__PURE__ */new Set,o);const s=/* @__PURE__ */new Set,{rowModel:i,rowRenderer:n,pinnedRowModel:r,pageBounds:l,rowContainerHeight:a}=this.beans,{pageFirstPixel:d,pageLastPixel:c}=l.getCurrentPagePixelRange(),h=t?n.firstVisibleVPixel-this.extraTopHeight:n.lastVisibleVPixel-this.extraTopHeight,u=a.divStretchOffset??0,g=d+u,p=c+u,m=e=>{if(s.add(e),t){const t=this.getLastPixelOfGroup(e),s=h+o+e.rowHeight;e.stickyRowTop=ts?o-(t-s):o}o=0,s.forEach(e=>{const t=e.stickyRowTop+e.rowHeight;o{if(!t.displayed)return!1;if(t.footer){if(!0===f)return!1;if("grand"===f&&-1===t.level)return!1;if("group"===f&&t.level>-1)return!1;const o=!!t.sibling.rowIndex&&t.sibling.rowIndex+1===t.rowIndex;return!("bottom"===e&&o||-1===t.level&&r?.getGrandTotalPinned()||s.has(t))}return!!t.isExpandable()&&!0!==C&&"bottom"!==e&&!s.has(t)&&!!t.expanded};for(let w=0;w<100;w++){let e=h+o;t||(e=h-o),t&&ep&&(e=p);const s=i.getRowIndexAtPixel(e),n=i.getRow(s);if(null==n)break;const r=this.getStickyAncestors(n).find(e=>(t?e.rowIndexs)&&v(e));if(r)m(r);else{if(!(t?n.rowTope)||!v(n))break;m(n)}}return t||s.forEach(e=>{e.stickyRowTop=o-(e.stickyRowTop+e.rowHeight)}),this.refreshNodesAndContainerHeight(e,s,o)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(!0===e)return!0;const t="group"===e,o="grand"===e;return!(!t||!o)||(o?"grand":!!t&&"group")}canRowsBeSticky(){const e=Wt(this.gos),t=this.areFooterRowsStickySuppressed(),o=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!o)}getStickyAncestors(e){const t=[];let o=e.footer?e.sibling:e.parent;for(;o;)o.sibling&&t.push(o.sibling),t.push(o),o=o.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",/* @__PURE__ */new Set,0),this.refreshNodesAndContainerHeight("bottom",/* @__PURE__ */new Set,0)}refreshStickyNode(e){const t=/* @__PURE__ */new Set;if(this.stickyTopRowCtrls.some(t=>t.rowNode===e)){for(let o=0;o{l.has(e)||(e.sticky=!0,a.push(this.createRowCon(e,!1,!1)))});let d=!!a.length||r.length!==i.length;s?this.topContainerHeight!==o&&(this.topContainerHeight=o,this.gridBodyCtrl.setStickyTopHeight(o),d=!0):this.bottomContainerHeight!==o&&(this.bottomContainerHeight=o,this.gridBodyCtrl.setStickyBottomHeight(o),d=!0),this.destroyRowCtrls(n,!1);const c=[...r,...a];c.sort((e,t)=>t.rowNode.rowIndex-e.rowNode.rowIndex),s||c.reverse();for(const g of c)g.setRowTop(g.rowNode.stickyRowTop);const h=this.beans.pageBounds;let u=0;if(s){for(const e of t)e.rowIndexthis.topContainerHeight&&(u=this.topContainerHeight),this.setOffsetTop(u)}else{for(const e of t)e.rowIndex>h.getLastRow()&&(u+=e.rowHeight);u>this.bottomContainerHeight&&(u=this.bottomContainerHeight),this.setOffsetBottom(u)}return!!d&&(s?this.stickyTopRowCtrls=c:this.stickyBottomRowCtrls=c,!0)}ensureRowHeightsValid(){let e=!1;const t=t=>{const o=t.rowNode;if(o.rowHeightEstimated){const t=Nt(this.beans,o);o.setRowHeight(t.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}},Gy={moduleName:"GroupCellRenderer",version:Dv,userComponents:{agGroupRowRenderer:ky,agGroupCellRenderer:ky},dynamicBeans:{groupCellRendererCtrl:Iy},icons:{groupContracted:"tree-closed",groupExpanded:"tree-open"},css:[".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)}"],dependsOn:[Mv]},Ny={moduleName:"GroupColumn",version:Dv,beans:[class extends Oe{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;null!=t&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),rs(e))}createColumns(e,t,o){const s=this.beans,{colModel:i,gos:n,rowGroupColsSvc:r,colGroupSvc:l}=s,a=i.isPivotMode(),d=Yt(n,a),c=a?n.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),h=r?.columns,u=()=>{this.columns&&(Jo(s,this.columns.tree),this.columns=null)};if(!(h&&h.length>0||n.get("treeData"))||c||d)return void u();const g=this.generateAutoCols(h),p=ns(g,this.columns?.list||null),m=e.treeDepth,f=(this.columns?this.columns.treeDepth:-1)==m;if(p&&f){const e=new Map(g.map(e=>[e.getId(),e]));for(const t of this.columns?.list??[]){const s=e.get(t.getId());s&&t.setColDef(s.getColDef(),null,o)}return}u();const C=l?.findDepth(e.tree)??0;this.columns={list:g,tree:l?.balanceTreeForAutoCols(g,C)??[],treeDepth:C,map:{}},t(e=>{if(!e)return null;const t=e.filter(e=>!es(e));return[...g,...t]})}updateColumns(e){const t=ls(e.source);this.columns?.list.forEach((e,o)=>this.updateOneAutoCol(e,o,t))}getColumn(e){return this.columns?.list.find(t=>as(t,e))??null}getColumns(){return this.columns?.list??null}generateAutoCols(e=[]){const t=[],{gos:o}=this,s=o.get("treeData");let i=_t(o);return s&&i&&(Dt(182),i=!1),i?e.forEach((e,o)=>{t.push(this.createOneAutoCol(e,o))}):t.push(this.createOneAutoCol()),t}isSuppressAutoCol(){const e=this.gos;return"custom"===e.get("groupDisplayType")||"custom"===e.get("treeDataDisplayType")}createOneAutoCol(e,t){let o;o=e?`${Zo}-${e.getId()}`:Zo;const s=this.createAutoColDef(o,e,t);s.colId=o;const i=new Fo(s,null,o,!0);return this.createBean(i),i}updateOneAutoCol(e,t,o){const s=e.getColDef(),i="string"==typeof s.showRowGroup?s.showRowGroup:void 0,n=this.beans,r=null!=i?n.colModel.getColDefCol(i):void 0,l=e.getId(),a=this.createAutoColDef(l,r??void 0,t);e.setColDef(a,null,o),Aa(n,{state:[ds(a,l)]},o)}createAutoColDef(e,t,o){let s=this.createBaseColDef(t);const i=this.gos.get("autoGroupColumnDef");Ye(s,i),s=_o(this.beans,s,e,!0),null==i?.groupRowEditable&&(s.groupRowEditable=void 0),null==i?.groupRowValueSetter&&(s.groupRowValueSetter=void 0),this.gos.get("treeData")||a(s.field)&&a(s.valueGetter)&&a(s.filterValueGetter)&&"agGroupColumnFilter"!==s.filter&&(s.filter=!1),o&&o>0&&(s.headerCheckboxSelection=!1);const n=Ut(this.gos),r=s.valueGetter||null!=s.field;return n&&!r&&(s.sortIndex=void 0,s.initialSort=void 0),s}createBaseColDef(e){const t=this.gos.get("autoGroupColumnDef"),o={headerName:this.getLocaleTextFunc()("group","Group"),showRowGroup:e?.getColId()??!0};return t&&(t.cellRenderer||t.cellRendererSelector)||(o.cellRenderer="agGroupCellRenderer"),e&&(o.headerName=this.beans.colNames.getDisplayNameForColumn(e,"header")??void 0,o.headerValueGetter=e.colDef.headerValueGetter),o}getDeepestExpandedLevel(e,t){let o=-1;if(!e)return o;for(const s of e){if(!s.group||!s.expanded)continue;if(s.level>o&&(o=s.level),o>=t)return o;const e=this.getDeepestExpandedLevel(s.childrenAfterGroup,t);if(e>o&&(o=e),o>=t)return o}return o}updateGroupColumnVisibility(){const e=this.columns?.list;if(!e||0===e.length)return;const{gos:t,visibleCols:o,rowModel:s}=this.beans,i=qt(t);let n=!1;const r=(e,t)=>{t!==e.isVisible()&&(e.setVisible(t,"api"),n=!0)},l=()=>{for(const t of e)r(t,!0)};if(i){if(e.length>1){const t=e.length-2,o=s?.rootNode?.childrenAfterGroup,i=this.getDeepestExpandedLevel(o,t);if(i>=t)l();else for(let s=0;s=s)}}else l();n&&o.refresh("api")}destroy(){Jo(this.beans,this.columns?.tree),super.destroy()}},class extends Oe{constructor(){super(...arguments),this.beanName="showRowGroupCols",this.columns=[],this.colsSet=/* @__PURE__ */new Set,this.colsMap=/* @__PURE__ */new Map}destroy(){super.destroy(),this.columns.length=0,this.colsSet.clear(),this.colsMap.clear()}refresh(){const{colModel:e,rowGroupColsSvc:t}=this.beans,o=this.columns,s=this.colsSet,i=this.colsMap;i.clear();const n=o.length;let r=0,l=!1;const a=e.getCols();for(let d=0,c=a.length;d=n||!s.has(e)),o[r++]=e}if(l||(l=r!==n),l){o.length=r,s.clear();for(let e=0;ee.level)return null;const n=this.getDisplayedNode(e,t,!0);if(n)return{displayedNode:n,value:s.getValue(t,n,"data",o)}}const n=s.getValue(t,e,"data",o);if(null==n){const i=this.getDisplayedNode(e,t);if(i)return{displayedNode:i,value:s.getValue(t,i,"data",o)}}return{displayedNode:e,value:n}}formatAndPrefixGroupColValue(e,t,o=!1){const s=this.formatGroupColValue(e,t,o),{value:i,displayedNode:n}=e,r=this.beans.footerSvc;return r?.doesCellShowTotalPrefix(n,t)?r.applyTotalPrefix(i,s,n,t):n.footer&&-1===n.level?null:s}formatGroupColValue(e,t,o=!1){const s=this.beans.valueSvc,{displayedNode:i,value:n}=e,r=i.rowGroupColumn,l=i.group&&!t;if(r&&(l||t?.isRowGroupDisplayed(r.colId))){if(o&&!1===r.colDef.useValueFormatterForExport)return null;const e=s.formatValue(r,i,n);return null==e&&""===i.key?this.getLocaleTextFunc()("blanks","(Blanks)"):e}return!t||i.group||o&&!1===t.colDef.useValueFormatterForExport?null:s.formatValue(t,i,n)}getDisplayedNode(e,t,o=!1){const s=this.gos,i=s.get("groupHideOpenParents"),n=s.get("showOpenedGroup")&&!o;if(!i&&!n)return;const r=t.colDef.showRowGroup;if(!0===r){if(e.group)return;return e.parent??void 0}let l=e;for(;l&&l.rowGroupColumn?.getId()!=r;){const e=l===l.parent?.getFirstChild();if(!n&&!e)return;l=l.parent}return l!==e?l??void 0:void 0}},class extends bm{constructor(){super(...arguments),this.beanName="rowGroupColsSvc",this.eventName="columnRowGroupChanged",this.columnProcessors={set:(e,t,o)=>this.setActive(t,e,o),add:(e,t,o)=>this.setActive(!0,e,o),remove:(e,t,o)=>this.setActive(!1,e,o)},this.columnOrdering={enableProp:"rowGroup",initialEnableProp:"initialRowGroup",indexProp:"rowGroupIndex",initialIndexProp:"initialRowGroupIndex"},this.columnExtractors={setFlagFunc:(e,t,o)=>this.setColRowGroupActive(e,t,o),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=>s(this.columns,e)}}moveColumn(e,t,o){if(0===this.columns.length)return;const s=this.columns[e],i=this.columns.slice(e,t);this.columns.splice(e,1),this.columns.splice(t,0,s),this.updateIndexMap(),this.eventSvc.dispatchEvent({type:this.eventName,columns:i,column:1===i.length?i[0]:null,source:o})}syncColumnWithState(e,t,o,s){const{value1:i,value2:n}=o("rowGroup","rowGroupIndex");void 0===i&&void 0===n||("number"==typeof n||i?(e.isRowGroupActive()||(this.setColRowGroupActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)),s&&"number"==typeof n&&(s[e.getId()]=n)):e.isRowGroupActive()&&(this.setColRowGroupActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)))}setActive(e,t,o){if(e===t.isRowGroupActive())return;this.setColRowGroupActive(t,e,o);const s=this.beans.groupHierarchyColSvc?.getColumn(t);Xt(this.gos,e)&&!s&&this.colModel.setColsVisible([t],!e,o)}setColRowGroupActive(e,t,o){e.rowGroupActive!==t&&(e.rowGroupActive=t,t&&(this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,e))?.forEach(e=>this.setColRowGroupActive(e,t,o)),e.dispatchColEvent("columnRowGroupChanged",o)),e.dispatchStateUpdatedEvent("rowGroup")}},fy,gy],dependsOn:[Mv,Gy]},By={moduleName:"ChangedPath",version:Dv,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="changedPathFactory"}newPath(e){return e?new by:new yy}ensureRowsPath(e){let t=e.changedPath;if(!t&&e.changedRowNodes&&!e.newData){const o=this.beans.rowModel;o.hierarchical&&(t=new yy,e.changedPath=t,t.addRow(o.rootNode))}return t}}],dependsOn:[Mv]},Hy={moduleName:"ClientSideRowModelHierarchy",version:Dv,rowModels:["clientSide"],beans:[class extends Oe{constructor(){super(...arguments),this.beanName="groupStage",this.step="group",this.refreshProps=["groupAllowUnbalanced","groupDefaultExpanded","groupDisplayType","groupHideOpenParents","initialGroupOrderComparator","treeData","treeDataChildrenField","treeDataParentIdField"],this.treeData=!1,this.grouping=!1,this.gosTreeData=!1,this.pivotMode=!1,this.hasTreeData=!1,this.hasRowGrouping=!1,this.needReset=!1,this.nested=!1,this.strategy=void 0,this.strategyType=void 0,this.columnsInvalidated=!1}postConstruct(){const e=this.gos;this.hasRowGrouping=e.isModuleRegistered("RowGrouping"),e.isModuleRegistered("TreeData")&&(this.hasTreeData=!0,this.gosTreeData=e.get("treeData")),this.addManagedEventListeners({showRowGroupColsSetChanged:()=>this.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,o=this.strategy?.nestedDataGetter;return e.has("treeData")&&(this.gosTreeData=t.get("treeData")&&this.hasTreeData,this.columnsInvalidated=!0),this.strategy?.onPropChange?.(e),this.getNestedDataGetter()!==o}extractData(){const e=this.beans.rowModel.rootNode,t=this.nested?e?.childrenAfterGroup:e?._leafs;if(!t)return this.gos.get("rowData")??[];const o=t.length,s=new Array(o);let i=0;for(let n=0;n{const s=e._leafs,i=e.sibling;e.treeNodeFlags=0,e.childrenAfterGroup=s,e.childrenMapped=null,e._groupData=void 0,e.aggData=null,i&&(i.childrenAfterGroup=e.childrenAfterGroup,i.childrenAfterAggFilter=e.childrenAfterAggFilter,i.childrenAfterFilter=e.childrenAfterFilter,i.childrenAfterSort=e.childrenAfterSort,i.childrenMapped=null,i._groupData=void 0,i.aggData=null);for(let n=0,r=s.length??0;n{const t=e.sibling;if(!t)return null;const o=t._leafs;return void 0!==o?o:Py(t)})(e):Py(e)}loadGroupData(e){const t=this.getStrategy();return t?t.loadGroupData(e):(e._groupData=null,null)}clearNonLeafs(){this.strategy?.clearNonLeafs()}getWantedStrategyType(){if(this.isAlive()){if(this.gosTreeData)return"tree";if(this.hasRowGrouping&&(this.beans.rowGroupColsSvc?.columns?.length||this.pivotMode))return"group"}return"none"}getStrategy(){let e=this.strategy;const t=this.beans.colModel.isPivotMode();if(t!==this.pivotMode&&(this.pivotMode=t,this.columnsInvalidated=!0),void 0!==e&&!this.columnsInvalidated&&this.isAlive())return e;this.columnsInvalidated=!1;const o=this.getWantedStrategyType();if(o===this.strategyType)return void 0!==e?e:(this.strategy=null,null);if(e&&(this.strategy=this.destroyBean(e),this.needReset=!0),this.strategyType=o,this.treeData="tree"===o,this.grouping="group"===o,"none"===o)return this.strategy=null,null;const s="tree"===o?"treeGroupStrategy":"groupStrategy";return e=this.beans.registry.createDynamicBean(s,!1)??null,this.strategy=e&&this.createBean(e),e}},class extends Oe{constructor(){super(...arguments),this.beanName="flattenStage",this.step="map",this.refreshProps=["groupHideParentOfSingleChild","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupTotalRow","masterDetail"]}execute(){const{beans:e,gos:t}=this,o=[],s=e.rowModel.rootNode;if(!s)return o;const i=e.colModel.isPivotMode(),n=i&&s.leafGroup&&s.aggData,r=n?[s]:s.childrenAfterSort,l=function(e){let t=e.get("groupHideParentOfSingleChild");return t||(t=e.get("groupRemoveSingleChildren"),!t&&e.get("groupRemoveLowestSingleChildren")&&(t="leafGroupsOnly")),{groupHideParentOfSingleChild:t,isGroupMultiAutoColumn:_t(e),hideOpenParents:e.get("groupHideOpenParents"),grandTotalRow:jt(e),groupTotalRow:Kt(e)}}(t);this.recursivelyAddToRowsToDisplay(l,r,o,i,0);const a=o.length>0,d=l.grandTotalRow;if(!n&&a&&d)if(hy(s,e),"pinnedBottom"===d||"pinnedTop"===d)this.beans.pinnedRowModel?.setGrandTotalPinned("pinnedBottom"===d?"bottom":"top");else{const e="top"===d;this.addRowNodeToRowsToDisplay(l,s.sibling,o,0,e)}return o}recursivelyAddToRowsToDisplay(e,t,o,s,i){if(!t?.length)return;const n=this.beans.masterDetailSvc;for(let r=0;r{const o=e.id;o&&(e._expanded=t.has(o))}),this.onGroupExpandedOrCollapsed()}getInternalExpansionState(e=!1){const t=[],o=[];return this.beans.rowModel.forEachNode(s=>{const i=s.id;i&&(s.expanded?t.push(i):e&&s.isExpandable()&&o.push(i))}),{expandedRowGroupIds:t,collapsedRowGroupIds:o}}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 null===t&&(t=this.defaultExpanded(e)??!1,e._expanded=t),!!t}resetExpansion(){const{rowModel:e}=this.beans;e.forEachNode(e=>{(e.group||e.master)&&(e._expanded=null)}),this.onGroupExpandedOrCollapsed()}expandAll(e){const{gos:t,rowModel:o,colModel:s,eventSvc:i}=this.beans,n=t.get("treeData"),r=s.isPivotActive(),a=t=>{if(t)for(const o of t){const t=()=>{o._expanded=e,a(o.childrenAfterGroup)};o.master?t():n?l(o.childrenAfterGroup)&&t():r?o.leafGroup||t():o.group&&t()}},d=o.rootNode;d&&a(d.childrenAfterGroup),this.onGroupExpandedOrCollapsed(),i.dispatchEvent({type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"})}onGroupExpandedOrCollapsed(){this.dispatchStateUpdatedEvent(),this.beans.rowModel.reMapRows()}setDetailsExpansionState(e){const t=this.getInternalExpansionState(!0),o=0===t.collapsedRowGroupIds.length;if(0===t.expandedRowGroupIds.length!==o)return o?e.expandAll():e.collapseAll()}dispatchExpandedEvent(e,t){if((this.events??(this.events=[])).push(e),t)return void this.dispatchExpandedEvents();let o=this.dispatchExpandedDebounced;if(!o){if(!this.isAlive())return;o=this.debounce(()=>this.dispatchExpandedEvents()),this.dispatchExpandedDebounced=o}o()}dispatchExpandedEvents(){const{eventSvc:e,rowRenderer:t}=this.beans,o=this.events,s=o?.length;if(!s)return;this.events=null;const i=new Array(s);for(let n=0;nwindow.setTimeout(e,0);let o=!1;return()=>{t.active?o||(o=!0,t.addDestroyTask(()=>{o=!1,e()})):window.setTimeout(e,0)}}}],dependsOn:[Mv,By]},Oy={moduleName:"StickyRow",version:Dv,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="stickyRowSvc"}createStickyRowFeature(e,t,o){const s=this.gos;if(Wt(s)&&It(s)||At(s))return e.createManagedBean(new Ly(t,o))}}]},Vy={moduleName:"GroupEdit",version:Dv,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="groupEditSvc",this.pendingEditRefresh=null,this.dropGroupTarget=null,this.dropGroupTimer=null,this.dropGroupThrottled=!1,this.draggingGroups=null}postConstruct(){It(this.gos)&&this.addManagedListeners(this.eventSvc,{cellValueChanged:e=>this.onCsrmCellChange(e),batchEditingStopped:()=>this.flushGroupEdits()})}destroy(){this.stopDragging(!0),super.destroy()}isGroupingDrop(e){return!(!e.rowDragManaged||!e.sameGrid||!this.gos.get("refreshAfterGroupEdit")||!this.beans.rowGroupColsSvc?.columns?.length||this.beans.colModel.isPivotMode())}initDraggingGroups(e){const t=/* @__PURE__ */new Map,o=e=>{const s=e.childrenAfterGroup;if(s){if(t.has(e))return;const i=s.slice();t.set(e,i);for(const e of i)o(e)}};for(const s of e.rows)s.group&&o(s);this.draggingGroups=t}canSetParent(e){return!(!e.sameGrid||!this.beans.groupStage?.treeData&&(e.rowDragManaged&&!this.gos.get("refreshAfterGroupEdit")||!this.beans.rowGroupColsSvc?.columns?.length))}canDropRow(e,t){if(this.beans.groupStage?.treeData)return!((e,t)=>{if(!t||e.parent===t)return!1;let o=t;const s=e.id;for(;o;){if(o===e)return!0;if(null!=s&&o.id===s)return!0;o=o.parent}return!1})(e,t.newParent);const{position:o,target:s,newParent:i,rootNode:n}=t,r=e.parent;if(e.group&&(My(e,s)||My(e,i)))return!1;if("inside"===o)return!0;if(i&&i!==r)return i!==n||r===n;const l=i??s?.parent??n;if(l!==r)return!1;const a=e.group?e.level:r.level??-1;let d=-1;return s?d=s.group?s.level:s.parent?.level??-1:l&&(d=l.level),!(a>=0&&d>=0&&d!==a)}fixRowsDrop(e,t,o,s){const i=!!this.beans.groupStage?.treeData;if(e.treeData=i,!this.beans.rowGroupColsSvc?.columns?.length&&!this.gos.get("pivotMode")&&!i)return;this.draggingGroups||!this.isGroupingDrop(e)||e.suppressMoveWhenRowDragging||this.initDraggingGroups(e);let n=e.target,r=null,l=!1;const a=e.rootNode,d=this.beans.rowModel,c=this.canStartGroup(n,i);this.updateDropTarget(e,o,c);const h=this.beans.pageBounds?.getLastRow?.()??d.getRowCount()-1;if(t&&(!n||s>=.5&&n.rowIndex===h?r=a:e.moved&&n&&this.dropGroupThrottled&&this.shouldDropTargetBeParent(e)&&(r=n),r||(r=n?.parent??a)),o||!n||!c||n.group&&n.expanded||this.startDropGroupDelay(n),r){if(n&&r===n&&r!==a){const e=r.expanded?((e,t,o)=>{if(!o)return;let s=o.rowIndex;if(null==s)return;s+=1;const i=e.getRowCount();for(;s>=0&&s{for(let o=0,s=e.length;o{this.dropGroupTimer=null,this.dropGroupThrottled=!0,this.beans.dragAndDrop?.nudge()},t)}resetDragGroup(){null!==this.dropGroupTimer&&(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:o,treeData:s}){if(!e||"none"===o)return!1;if("inside"===o)return!0;if(!s&&e.group&&!e.expanded)return!0;if("above"===o)return!1;const i=this.beans.rowModel;let n,r=e.rowIndex+1;do{n=i.getRow(r++)}while(n?.footer);const l=this.draggingGroups?.get(e)??e.childrenAfterGroup;if(n&&n.parent===e&&l?.length){const e=new Set(t);for(let t=0,o=l.length;t{d.has(e)||(d.add(e),u??(u=this.newGroupValues(n)),this.setRowGroup(e,u)&&h.add(e))},p=e=>{const t=this.draggingGroups?.get(e)??e.childrenAfterGroup,o=t?.length;if(o)for(let s=0;s=0?g(e):p(e)}};for(const v of e.rows)if(v.group)p(v);else{const e=v.sourceRowIndex>=0&&!v.destroyed?v:this.csrmFirstLeaf(v);e&&g(e)}const m="inside"===o?"above":o,f="inside"===o?this.findFirstLeafForParent(n,d)??s:s;let C=!1;if(d.size&&"none"!==m&&(C=((e,t,o,s)=>{if(!t.size||!e)return!1;let i=!1;const n=e.length??0;let r=-1;o&&(r=o.sourceRowIndex,(o=r<0?ea(o):null)&&(r=o.sourceRowIndex)),r<0||r>=n?r=n:s||++r;let l=r,a=Math.min(r,n-1);for(const h of t){const e=h.sourceRowIndex;ea&&(a=e)}let d=l;for(let h=l;h=r;--h){const o=e[h];t.has(o)||(o.sourceRowIndex!==c&&(o.sourceRowIndex=c,e[c]=o,i=!0),--c)}for(const h of t)h.sourceRowIndex!==d&&(h.sourceRowIndex=d,e[d]=h,i=!0),++d;return i})(i._leafs,d,f,"above"===m)),!h.size&&!C)return!1;c.reordered=C;for(const v of d)c.updates.add(v);return this.csrmRefresh(c),a?a.focusCell():r.clearFocusedCell(),!0}canStartGroup(e,t){return!(!e||e.level<0||e.footer||e.detail)&&(!!e.group||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??[],o=new Array(t.length);let s=-1,i=e;for(;i&&i.level>=0;){const e=t[i.level];if(e){const t=e.getColId(),n=i.level;o[n]=i.groupData?.[t]??i.key??void 0,n>s&&(s=n)}i=i.parent}return{values:o,columns:t,maxLevel:s}}setRowGroup(e,{values:t,columns:o,maxLevel:s}){if(s<0)return!1;const{valueSvc:i,changeDetectionSvc:n}=this.beans;let r=!1;n?.beginDeferred();try{for(let n=0;ns)continue;const a=t[n],d=i.getValue(l,e,"data");if(d===a||null==d&&null==a)continue;let c=a;const h=i.parseValue(l,e,a,d);void 0!==h&&(c=h),e.setDataValue(l,c,"rowDrag")&&(r=!0)}}finally{n?.endDeferred()}return r}onCsrmCellChange(e){const{column:t,node:o,source:s}=e;if(this.gos.get("refreshAfterGroupEdit")&&"rowDrag"!==s&&t?.isRowGroupActive()&&!o.group&&o.data)if(this.beans.editSvc?.isBatchEditing()){let e=this.pendingEditRefresh;e||(e=Dy(),this.pendingEditRefresh=e),e.updates.add(o)}else{const e=Dy();e.updates.add(o),this.csrmRefresh(e)}}csrmFirstLeaf(e){if(!e)return null;const t=this.draggingGroups;let o=t?.get(e)??e.childrenAfterGroup;for(;o?.length;){const e=o[0];if(e.sourceRowIndex>=0)return e.destroyed?this.firstAliveChildLeaf(e):e;o=t?.get(e)??e.childrenAfterGroup}return ea(e)}firstAliveChildLeaf(e){const t=this.draggingGroups?.get(e)??e.childrenAfterGroup;if(t)for(const o of t)if(o.sourceRowIndex>=0&&!o.destroyed)return o;return null}findFirstLeafForParent(e,t){if(!e)return null;const o=this.draggingGroups?.get(e)??e?.childrenAfterGroup;if(!o)return null;for(let s=0,i=o.length;s=0&&!t.has(e))return e;const i=this.findFirstLeafForParent(e,t);if(null!==i)return i}return null}}],dependsOn:[Mv,Hy]},zy=(e,t,o,s)=>i=>{const n=Qa((({valueSvc:e,dataTypeSvc:t},o,s)=>{const i=e.getValue(o,s,"data");let n=null;return i instanceof Date?n=i:"string"==typeof i&&(n=(t?.getDateParserFunction(o)??ed)(i)??null),n})(e,t,i.node));return n?s?.(n[o])??n[o]:null},Wy=({colNames:e},t,o)=>s=>{const i=e.getDisplayNameForColumn(t,s.location);return i?`${i} (${o})`:""},Uy=Object.fromEntries(Xa.map(e=>[e,e.toLowerCase()]));function $y(e){return e.groupHierarchy??e.rowGroupingHierarchy}function jy(e,t,o){const s=e.get(t);e.set(t,(s??[]).concat(o))}function Ky(e,t){const o=e.sourceRowIndex,s=t.sourceRowIndex,i=o>=0,n=s>=0;return i&&n?o-s:i||n?i?1:-1:e.__objectId-t.__objectId}var _y=e=>{for(const t of e){const e=t?.childrenAfterGroup;if(!e)continue;const o=e.length;let s=0;for(let i=0;i{for(;void 0!==e._leafs;){const t=e.parent;if(!t)break;e._leafs=void 0,e=t}},Yy={moduleName:"SharedRowGrouping",version:Dv,apiFunctions:{setRowGroupColumns:function(e,t){e.rowGroupColsSvc?.setColumns(t,"api")},removeRowGroupColumns:function(e,t){e.rowGroupColsSvc?.removeColumns(t,"api")},addRowGroupColumns:function(e,t){e.rowGroupColsSvc?.addColumns(t,"api")},getRowGroupColumns:function(e){return e.rowGroupColsSvc?.columns??[]},moveRowGroupColumn:function(e,t,o){e.rowGroupColsSvc?.moveColumn?.(t,o,"api")}},dependsOn:[Mv,py,Ny,Oy,{moduleName:"GroupHierarchy",version:Dv,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="groupHierarchyColSvc",this.columns=null,this.sourceColumnMap=/* @__PURE__ */new WeakMap,this.inverseColumnMap=/* @__PURE__ */new WeakMap}addColumns(e){const t=this.columns;null!=t&&(e.list=t.list.filter(t=>!e.list.some(e=>e.getColId()===t.getColId())).concat(e.list),e.tree=t.tree.filter(t=>!e.tree.some(e=>e.getId()===t.getId())).concat(e.tree),rs(e))}createColumns(e){const t=/* @__PURE__ */new WeakMap,o=/* @__PURE__ */new WeakMap,s=this.createGroupHierarchyColumns(e,t,o);if(ns(s,this.columns?.list??[]))return;Jo(this.beans,this.columns?.tree),this.columns=null;const{colGroupSvc:i}=this.beans,n=i?.findDepth(e.tree)??0;this.columns={list:s,tree:i?.balanceTreeForAutoCols(s,n)??[],treeDepth:n,map:{}},this.sourceColumnMap=t,this.inverseColumnMap=o}updateColumns(e){}getColumn(e){return this.columns?.list.find(t=>as(t,e))??null}getColumns(){return this.columns?.list??null}expandColumnInto(e,t){const o=this.getVirtualColumnsForColumn(t).concat(t);for(const s of o)e.some(e=>as(e,s)||e.getColId()===s.getColId())||e.push(s)}compareVirtualColumns(e,t){const o=this.inverseColumnMap.get(e),s=this.inverseColumnMap.get(t);if(o&&o===s){const s=this.sourceColumnMap.get(o)??[];return s?.indexOf(e)-s?.indexOf(t)}return this.sourceColumnMap.get(e)?.includes(t)?1:this.sourceColumnMap.get(t)?.includes(e)?-1:null}insertVirtualColumnsForCol(e,t){const o=this.getVirtualColumnsForColumn(t);if(!o)return[];let s=e.indexOf(t);return s<0&&(s=e.length-1),i(e,o),e.splice(s,0,...o),o}getVirtualColumnsForColumn(e){return this.isGroupHierarchyColsEnabledForCol(e)?this.sourceColumnMap.get(e)??[]:[]}isGroupHierarchyColsEnabled(e){return e.list.some(e=>this.isGroupHierarchyColsEnabledForCol(e))}isGroupHierarchyColsEnabledForCol(e){const t=e.getColDef();return!(!$y(t)||!(t.rowGroup||t.enableRowGroup||null!=t.rowGroupIndex||t.pivot||t.enablePivot||null!=t.pivotIndex))}createGroupHierarchyColDefs(e){const t=[],o=e.getColDef(),s=$y(o);if(!s)return t;if(!this.isGroupHierarchyColsEnabledForCol(e))return t;for(const i of s){let s=null;s="string"==typeof i?this.createColDefForPart(i,e,o):i,s&&t.push(s)}return t}createGroupHierarchyColumns(e,t,o){if(!this.isGroupHierarchyColsEnabled(e))return[];const s=[];for(const i of e.list)for(const e of this.createGroupHierarchyColDefs(i)){const n=e.colId;this.gos.validateColDef(e,n,!0);const r=new Fo(e,null,n,!0);this.createBean(r),s.push(r),jy(t,i,r),o.set(r,i)}return s}createColDefForPart(e,t,o){const{beans:s,gos:i}=this,n=`ag-Grid-HierarchyColumn-${t.getColId()}-${e}`,r={enableRowGroup:o.enableRowGroup,rowGroup:o.rowGroup,enablePivot:o.enablePivot,hide:!0,editable:!1},l=i.get("groupHierarchyConfig")??{};if(e in l){const t={...r,...l[e]};return t.colId??(t.colId=n),_o(s,t,t.colId,!0)}const a=_o(s,{colId:n,...r},n,!0),d=this.getLocaleTextFunc(),c=(e,t)=>d?.(e,t)??t;switch(e){case"year":return{...a,headerValueGetter:Wy(s,t,c(e,"Year")),valueGetter:zy(s,t,0)};case"quarter":return{...a,headerValueGetter:Wy(s,t,c(e,"Quarter")),valueGetter:zy(s,t,1,e=>(Math.floor(Number(e)/4)+1).toString())};case"month":return{...a,headerValueGetter:Wy(s,t,c(e,"Month")),valueGetter:zy(s,t,1)};case"formattedMonth":return{...a,headerValueGetter:Wy(s,t,c("month","Month")),valueGetter:zy(s,t,1,e=>{const t=(e=>{const t=Xa[Number.parseInt(e,10)-1]??e;return{month:t,localeKey:Uy[t]??e}})(e);return c(t.localeKey,t.month)})};case"day":return{...a,headerValueGetter:Wy(s,t,c(e,"Day")),valueGetter:zy(s,t,2)};case"hour":return{...a,headerValueGetter:Wy(s,t,c(e,"Hour")),valueGetter:zy(s,t,3)};case"minute":return{...a,headerValueGetter:Wy(s,t,c(e,"Minute")),valueGetter:zy(s,t,4)};case"second":return{...a,headerValueGetter:Wy(s,t,c(e,"Second")),valueGetter:zy(s,t,5)};default:return null}}}],dependsOn:[By]}]},Zy={moduleName:"RowGrouping",version:Dv,dynamicBeans:{groupStrategy:class extends Oe{constructor(){super(...arguments),this.groupCols=[],this.nonLeafsById=/* @__PURE__ */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:o,showRowGroupCols:s}=this.beans,i={};if(e._groupData=i,!t)return i;const n=ea(e),r=t.getId();if(!s)return i;const l=s.columns;for(let a=0,d=l.length;a{const t=e.childrenAfterGroup,o=t?.length;if(!o)return;const s=new Array(o);let i,n=0,r=!1;for(let l=0;l{const o=e.length;if(o!==t?.length)return!0;for(let s=0;s{if(!e)return void(t.length=0);const o=e.length;t.length=o;for(let s=0;s1)}}if(i.size)for(const a of i){this.insertOneNode(e,a);const o=a.parent;t?.addRow(o),n||(n=(o?.childrenAfterGroup?.length??0)>1)}l.size&&(_y(l),this.removeEmptyGroups(l,r)),n&&this.sortChildren(e,t)}sortChildren(e,t){eg(e,!0,void 0,e=>{(function(e){if(!e)return!1;const t=e.length;if(t<2)return!1;let o=!1;for(let s=1;s0){o=!0;break}return!!o&&(e.sort(Ky),!0)})(e.childrenAfterGroup)&&t?.addRow(e)})}orderGroups(e){const t=this.gos.getCallback("initialGroupOrderComparator");if(!t)return;const o=this.beans,s=o.gridApi,i=o.gridOptions.context,n=(e,o)=>t({api:s,context:i,nodeA:e,nodeB:o}),r=e=>{const t=e.childrenAfterGroup,o=t?.length;if(o&&!e.leafGroup){o>1&&t.sort(n);for(let e=0,s=o;e=0;--l){const{col:e}=r[l];let a=o.getKeyForNode(e,t);if(null==a||""===a){if(!s)continue;a=""}if(!i?.parent||i.key!==a){n=!0;break}i=i.parent}return n||(n=!!i?.parent),!!n&&(this.removeFromParent(t),this.insertOneNode(e,t),t.setData(t.data),!0)}groupShouldBeRemoved(e){const t=this.getChildrenMappedKey(e.key,e.rowGroupColumn),o=e.parent?.childrenMapped;return!(!o||!o[t]||!e.group||0!==(e.childrenAfterGroup?.length??0))}removeEmptyGroups(e,t){const o=this.beans.selectionSvc;let s;const i=Array.from(e),n=this.nonLeafsById;do{e.clear();for(let r=0;r=l-1,g=this.createGroup(o,e,d,h,u,t);this.addToParent(g,o),o=g}o.group||Dt(184,{parentGroupData:o.data,childNodeData:t.data}),t.parent=o,t.level=o.level+1,o.childrenAfterGroup.push(t),o.updateHasChildren(),qy(o)}createGroup(e,t,o,s,i,n){const r=t.col,l=(e.level>=0?e.id+"-":"row-group-")+r.getColId()+"-"+o,a=this.nonLeafsById;let d=a.get(l),c=!0;if(d){if(null!==d.childrenAfterGroup)return d._expanded??(d._expanded=null),d;c=!1,qy(d)}else d=new ln(this.beans),d.group=!0,d.key=o,d.id=l,d.aggData=null,a.set(l,d);const h=t=>{t.childrenAfterGroup=u,t.childrenMapped=g,t.parent=e,t.level=s,t.rowGroupIndex=s,t.leafGroup=i},u=[],g={};if(h(d),d.field=t.field??null,d.rowGroupColumn=r,d.groupValue=this.beans.valueSvc.getValue(r,n,"data"),d._expanded??(d._expanded=null),c)return d.setAllChildrenCount(0),d.updateHasChildren(),d;const p=d.sibling;return p&&h(p),d.dispatchRowEvent("hasChildrenChanged"),d}getChildrenMappedKey(e,t){return t?t.getId()+"-"+e:e}onShowRowGroupColsSetChanged(){const{rowModel:e,valueSvc:t}=this.beans;for(const s of this.nonLeafsById.values()){s._groupData=void 0;const e=s.rowGroupColumn,o=e&&ea(s);s.groupValue=o&&t.getValue(e,o,"data")}const o=e.rootNode?._leafs;if(o)for(let s=0,i=o.length;s{this.gridCtrl=e.gridCtrl})}destroy(){super.destroy(),this.clientSideRowModel=null,this.gridCtrl=null}pasteFromClipboard(){this.gos.get("suppressClipboardApi")||this.navigatorApiFailed||!navigator.clipboard?.readText?this.pasteFromClipboardLegacy():navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(e=>{Dt(40,{e:e,method:"readText"}),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()})}pasteFromClipboardLegacy(){let e=!1;const t=t=>{const o=Date.now();o-this.lastPasteOperationTime<50&&(e=!0,t.preventDefault()),this.lastPasteOperationTime=o};this.executeOnTempElement(e=>{e.addEventListener("paste",t),e.focus({preventScroll:!0})},o=>{const s=o.value;e?this.refocusLastFocusedCell():this.processClipboardData(s),o.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 l(e)?e:"\t"}processClipboardData(e){if(null==e)return;let t=function(e,t=","){const o=[],s=e=>"\r"===e||"\n"===e;let i=!1;if(""===e)return[[""]];for(let n=0,r=0,l=0;l{o[n]||(o[n]=[]),o[n][r]||(o[n][r]="")};if(h(),'"'===d&&(i?'"'===c?(o[n][r]+='"',l++):i=!1:(void 0===a||a===t||s(a))&&(i=!0)),!i&&'"'!==d){if(d===t){r++,h();continue}if(s(d)){r=0,n++,h(),"\r"===d&&"\n"===c&&l++;continue}}o[n][r]+=d}return o}(e,this.getClipboardDelimiter());const o=this.gos.getCallback("processDataFromClipboard");if(o&&(t=o({data:t})),null==t)return;this.gos.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(t);const{rangeSvc:s,editSvc:i}=this.beans;this.doPasteOperation((e,o,n,r)=>{s?.isMoreThanOneCell()&&!this.hasOnlyOneValueToPaste(t)?this.pasteIntoActiveRange(t,e,o,r):this.pasteStartingFromFocusedCell(t,e,o,n,r),i?.stopEditing(void 0,{source:Qy})})}doPasteOperation(e){const t="clipboard",{eventSvc:o,focusSvc:s,rowRenderer:i,gos:n}=this.beans;o.dispatchEvent({type:"pasteStart",source:t});const{clientSideRowModel:r}=this,l=r?.rootNode,a=l&&this.beans.changedPathFactory?.newPath(n.get("aggregateOnlyChangedColumns")),d={},c=[];e(d,c,s.getFocusedCell(),a);const h=c.slice();a&&(r.doAggregate(a),eg(l,r.hierarchical,a,e=>{h.push(e)})),i.refreshCells({rowNodes:h}),this.dispatchFlashCells(d),this.fireRowChanged(c),this.refocusLastFocusedCell(),o.dispatchEvent({type:"pasteEnd",source:t})}getPreProcessRangeCallback(e){return t=>{const{rangeSvc:o}=this.beans;if(!o)return;const{rowDiff:s,colDiff:i}=this.getAdjustedRangeDimensionForPaste(t,e);0!==s&&o.extendRangeRowCountBy(t,s),0!==i&&o.extendRangeColumnCountBy(t,i)}}getAdjustedRangeDimensionForPaste(e,t){const o=this.beans.rangeSvc,s=t.length,i=o.getRangeRowCount(e),n=i>=s&&i%s===0,r=t[0].length,l=e.columns.length;return{rowDiff:n?0:s-i,colDiff:l>=r&&l%r===0?0:r-l}}pasteIntoActiveRange(e,t,o,s){let i=0,n=0;this.iterateActiveRanges((r,l,a,d)=>{if(d-i>=e.length){if(d%e.length!==0)return;i+=n,n=0}const c=e[d-i];o.push(l);const h=this.gos.getCallback("processCellFromClipboard"),u=a.columns,g=u.findIndex(ts);-1!==g&&u.splice(g,1);for(let e=0;e=c.length&&(i=e%c.length);const n=this.processCell(l,o,c[i],Xy,h,!0);l.setDataValue(o,n,Qy),s?.addCell(l.parent,o.getId());const{rowIndex:a,rowPinned:d}=r,g=wn({rowIndex:a,column:o,rowPinned:d});t[g]=!0}n++},!1,this.getPreProcessRangeCallback(e))}getDisplayedColumnsStartingAt(e){let t=e;const o=[],{visibleCols:s}=this.beans;for(;t&&ss(t);)t=s.getColAfter(t);for(;null!=t;)o.push(t),t=s.getColAfter(t);return o}pasteStartingFromFocusedCell(e,t,o,s,i){if(!s)return;const n={rowIndex:s.rowIndex,rowPinned:s.rowPinned},r=this.getDisplayedColumnsStartingAt(s.column);this.isPasteSingleValueIntoRange(e)?this.pasteSingleValueIntoRange(e,o,t,i):this.pasteMultipleValues(e,n,o,r,t,Jy,i)}isPasteSingleValueIntoRange(e){const t=this.beans.rangeSvc;return this.hasOnlyOneValueToPaste(e)&&!!t&&!t.isEmpty()}pasteSingleValueIntoRange(e,t,o,s){const i=e[0][0];this.iterateActiveRanges((e,n,r)=>{t.push(n),r.columns.forEach(e=>this.updateCellValue(n,e,i,o,Jy,s))})}hasOnlyOneValueToPaste(e){return 1===e.length&&1===e[0].length}copyRangeDown(){const{rangeSvc:e,gos:t,formula:o,valueSvc:s}=this.beans;if(!e||e.isEmpty())return;const i=[];this.doPasteOperation((e,n,r,l)=>{const a=t.getCallback("processCellForClipboard"),d=t.getCallback("processCellFromClipboard");this.iterateActiveRanges((t,r,c)=>{const{columns:h}=c;i.length?(n.push(r),h.forEach((s,n)=>{if(!s.isCellEditable(r)||s.isSuppressPaste(r))return;s.isAllowFormula()&&o?.isFormula(i[n])&&(i[n]=o?.updateFormulaByOffset({value:i[n],rowDelta:1}));const a=this.processCell(r,s,i[n],Xy,d,!0);r.setDataValue(s,a,Qy),l?.addCell(r.parent,s.getId());const{rowIndex:c,rowPinned:h}=t,u=wn({rowIndex:c,column:s,rowPinned:h});e[u]=!0})):h.forEach(e=>{const t=this.processCell(r,e,s.getValue(e,r,"batch"),Xy,a,!1,!0);i.push(t)})},!0)})}removeLastLineIfBlank(t){const o=e(t);if(o&&1===o.length&&""===o[0]){if(1===t.length)return;s(t,o)}}fireRowChanged(e){if("fullRow"===this.gos.get("editType"))for(const t of e)this.eventSvc.dispatchEvent({type:"rowValueChanged",node:t,data:t.data,rowIndex:t.rowIndex,rowPinned:t.rowPinned})}shouldSkipPasteRow(e,t,o){if(e.detail||e.footer)return!0;if(o&&e.group){for(const o of t)if(o.isCellEditable(e))return!1;return!0}return!1}pasteMultipleValues(e,t,o,s,i,n,r){let l=t;const a=this.beans,{gos:d}=a,c=null!=this.clientSideRowModel&&!d.get("enableGroupEdit")&&!d.get("treeData"),h=()=>{for(;l;){const e=Fn(a,l);if(l=En(a,{rowPinned:l.rowPinned,rowIndex:l.rowIndex}),null!=e&&!this.shouldSkipPasteRow(e,s,c))return e}return null};for(const u of e){const e=h();e&&(u.forEach((t,o)=>this.updateCellValue(e,s[o],t,i,n,r)),o.push(e))}}updateCellValue(e,t,o,s,i,n){if(!e||!t?.isCellEditable(e)||t?.isSuppressPaste(e))return;const r=this.processCell(e,t,o,i,this.gos.getCallback("processCellFromClipboard"),!0);e.setDataValue(t,r,Qy);const{rowIndex:l,rowPinned:a}=e;s[wn({rowIndex:l,column:t,rowPinned:a})]=!0,n?.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:o,includeGroupHeaders:s}=e;const{gos:i,focusSvc:n}=this.beans;null==o&&(o=i.get("copyHeadersToClipboard")),null==s&&(s=i.get("copyGroupHeadersToClipboard"));const r={includeHeaders:o,includeGroupHeaders:s},l=i.get("rowSelection"),a=i.get("cellSelection");let d=null;this.shouldCopyCells(a,l)?(this.copySelectedRangeToClipboard(r),d=0):this.shouldCopyRows(l)?(this.copySelectedRowsToClipboard(r),d=1):n.isAnyCellFocused()&&(this.copyFocusedCellToClipboard(r),d=2),t&&null!==d&&this.clearCellsAfterCopy(d)}shouldCopyCells(e,t){const{rangeSvc:o,selectionSvc:s,gos:i}=this.beans;if(!o||o.isEmpty())return!1;if(e)return!("object"==typeof t&&t.copySelectedRows&&!s?.isEmpty());{const e=i.get("suppressCopySingleCellRanges");return!(!o.isMoreThanOneCell()&&e)}}shouldCopyRows(e){const{selectionSvc:t,gos:o}=this.beans;return!(t?.isEmpty()??1)&&(e&&"string"!=typeof e?e.copySelectedRows??!1:!o.get("suppressCopyRowsToClipboard"))}clearCellsAfterCopy(e){const t=this.beans,{rangeSvc:o,focusSvc:s,eventSvc:i}=t;if(i.dispatchEvent({type:"keyShortcutChangedCellStart"}),0===e)o.clearCellRangeCellValues({cellEventSource:"clipboardSvc"});else if(1===e)this.clearSelectedRows();else{const e=s.getFocusedCell();if(null==e)return;const o=Fn(t,e);o&&this.clearCellValue(o,e.column)}i.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){const{selectionSvc:e,visibleCols:t}=this.beans,o=e?.getSelectedNodes()??[],s=t.allCols;for(const i of o)for(const e of s)this.clearCellValue(i,e)}clearCellValue(e,t){if(!t.isCellEditable(e))return;const o=this.beans.valueSvc.getDeleteValue(t,e);e.setDataValue(t,o,"clipboardSvc")}iterateActiveRanges(e,t,o){const s=this.beans.rangeSvc;if(!s||s.isEmpty())return;const i=s.getCellRanges(),n=t?[i[0]]:i;for(const r of n)this.iterateActiveRange({cellRange:r,rowCallback:e,preProcessRange:o})}iterateActiveRange(e){const{cellRange:t,preProcessRange:o,rowCallback:s}=e,{beans:i}=this,{rangeSvc:n}=i;if(!n)return;o&&o(t);let r=n.getRangeStartRow(t);const l=n.getRangeEndRow(t);let a=0,d=!1;for(;!d&&null!=r;){const e=Fn(i,r);d=Sn(r,l),s(r,e,t,a++),r=En(i,r)}}copySelectedRangeToClipboard(e={}){const t=this.beans.rangeSvc;if(!t||t.isEmpty())return;const{data:o,cellsToFlash:s}=t.areAllRangesAbleToMerge()?this.buildDataFromMergedRanges(t,e):this.buildDataFromRanges(t,e);this.copyDataToClipboard(o),this.dispatchFlashCells(s)}buildDataFromMergedRanges(e,t){const o=/* @__PURE__ */new Set,s=e.getCellRanges(),i=/* @__PURE__ */new Map,n=[],r={},l=It(this.gos,this.beans.rowModel),a=/* @__PURE__ */new Set;l||this.beans.rowModel.forEachNode(e=>{a.add(e.rowIndex)});for(const h of s){h.columns.forEach(e=>o.add(e));const{rowPositions:t,cellsToFlash:s}=this.getRangeRowPositionsAndCellsToFlash(e,h);for(const e of t){const t=a.has(e.rowIndex);if(!l&&!t)continue;const o=`${e.rowIndex}-${e.rowPinned||"null"}`;i.get(o)||(i.set(o,!0),n.push(e))}Object.assign(r,s)}const d=this.beans.visibleCols.allCols,c=Array.from(o);return c.sort((e,t)=>d.indexOf(e)-d.indexOf(t)),{data:this.buildExportParams({columns:c,rowPositions:n,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:r}}buildDataFromRanges(e,t){const o=e.getCellRanges(),s=[],i={};for(const n of o){const{rowPositions:o,cellsToFlash:r}=this.getRangeRowPositionsAndCellsToFlash(e,n);Object.assign(i,r),s.push(this.buildExportParams({columns:n.columns,rowPositions:o,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))}return{data:s.join("\n"),cellsToFlash:i}}getRangeRowPositionsAndCellsToFlash(e,t){const o=[],s={},i=e.getRangeStartRow(t),n=e.getRangeEndRow(t);let r=i;for(;r;){o.push(r);for(const e of t.columns){const{rowIndex:t,rowPinned:o}=r;s[wn({rowIndex:t,column:e,rowPinned:o})]=!0}if(Sn(r,n))break;r=En(this.beans,r)}return{rowPositions:o,cellsToFlash:s}}getCellsToFlashFromRowNodes(e){const t=this.beans.visibleCols.allCols,o={};for(let s=0;s{const{value:o,valueFormatted:s}=this.beans.valueSvc.getValueForDisplay({column:t,node:e,includeValueFormatted:!0,from:"batch"}),i=s??o??"",r=n.getCallback("processCellForClipboard");return r?r({column:t,node:e,value:i,type:Jy,formatValue:o=>this.beans.valueSvc.formatValue(t,e,o)??o,parseValue:s=>this.beans.valueSvc.parseValue(t,e,s,o)??s}):i},processHeaderCallback:n.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:n.getCallback("processGroupHeaderForClipboard")};return r.getDataAsCsv(l,!0)}dispatchFlashCells(e){window.setTimeout(()=>{this.eventSvc.dispatchEvent({type:"flashCells",cells:e})},0)}processCell(e,t,o,s,i,n,r){const{valueSvc:l,formula:a}=this.beans;return i?i({column:t,node:e,value:o,type:s,formatValue:o=>l.formatValue(t,e??null,o)??o,parseValue:o=>l.parseValue(t,e??null,o,l.getValue(t,e,"edit"))}):n&&!1!==t.getColDef().useValueParserForImport?l.parseValue(t,e??null,o,l.getValue(t,e,"edit")):r&&!1!==t.getColDef().useValueFormatterForExport?a?.isFormula(o)?o:l.formatValue(t,e??null,o)??o:o}copyDataToClipboard(e){const t=this.gos.getCallback("sendToClipboard");t?t({data:e}):this.gos.get("suppressClipboardApi")||!navigator.clipboard?this.copyDataToClipboardLegacy(e):navigator.clipboard.writeText(e).catch(t=>{Dt(40,{e:t,method:"writeText"}),this.copyDataToClipboardLegacy(e)})}copyDataToClipboardLegacy(e){this.executeOnTempElement(t=>{const o=b(this.beans),s=w(this.beans);t.value=e||" ",t.select(),t.focus({preventScroll:!0}),o.execCommand("copy")||Dt(41),null!=s?.focus&&s.focus({preventScroll:!0})})}executeOnTempElement(e,t){if(!this.gridCtrl)return;const o=b(this.beans),s=o.createElement("textarea"),i=s.style;i.width="1px",i.height="1px";const n=o.documentElement;i.top=n.scrollTop+"px",i.left=n.scrollLeft+"px",i.position="absolute",i.opacity="0",this.gridCtrl.getGui().appendChild(s);try{e(s)}catch(r){Dt(42)}t?window.setTimeout(()=>{t(s),s.remove()},100):s.remove()}}],apiFunctions:{copyToClipboard:function(e,t){e.clipboardSvc?.copyToClipboard(t)},cutToClipboard:function(e,t){e.clipboardSvc?.cutToClipboard(t)},copySelectedRowsToClipboard:function(e,t){e.clipboardSvc?.copySelectedRowsToClipboard(t)},copySelectedRangeToClipboard:function(e,t){e.clipboardSvc?.copySelectedRangeToClipboard(t)},copySelectedRangeDown:function(e){e.clipboardSvc?.copyRangeDown()},pasteFromClipboard:function(e){e.clipboardSvc?.pasteFromClipboard()}},dependsOn:[Mv,xg,Zh,Yp]},tS=class extends Oe{constructor(){super(...arguments),this.loadRowDataVersion=0}wireBeans(e){this.environment=e.environment}init(e,t){this.params=t,this.comp=e,null==t.pinned&&(this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.createDetailGrid(),this.loadRowData(),this.addManagedEventListeners({fullWidthRowFocused:this.onFullWidthRowFocused.bind(this)}))}onFullWidthRowFocused(e){const t=this.params;Sn({rowIndex:t.node.rowIndex,rowPinned:t.node.rowPinned},{rowIndex:e.rowIndex,rowPinned:e.rowPinned})&&Wi(this.comp.getGui(),e.fromBelow)}setAutoHeightClasses(){const e=this.gos.get("detailRowAutoHeight"),t=e?"ag-details-row-auto-height":"ag-details-row-fixed-height",o=e?"ag-details-grid-auto-height":"ag-details-grid-fixed-height",s=this.comp;s.toggleCss(t,!0),s.toggleDetailGridCss(o,!0)}setupRefreshStrategy(){const e=this.params.refreshStrategy;"everything"!=e&&"nothing"!=e&&"rows"!=e?(null!=e&&Dt(170,{providedStrategy:e}),this.refreshStrategy="rows"):this.refreshStrategy=e}createDetailGrid(){const{params:e,gos:t}=this;if(a(e.detailGridOptions))return void Dt(171);const o=t.get("theme"),s=e.detailGridOptions.theme;s&&s!==o&&Dt(267);const i={themeStyleContainer:this.environment.eStyleContainer,...e.detailGridOptions,theme:o};t.get("detailRowAutoHeight")&&(i.domLayout="autoHeight"),this.comp.setDetailGrid(i)}registerDetailWithMaster(e){const{params:t,beans:{selectionSvc:o,findSvc:s,expansionSvc:i}}=this,n=t.node.id,r=t.api,l={id:n,api:e},a=t.node;if(r.isDestroyed())return;r.addDetailGridInfo(n,l),a.detailGridInfo=l;const d=a.parent;function c(){d&&o?.refreshMasterNodeState(d)}function h({source:t}){return"expandAll"===t?e.expandAll():"collapseAll"===t?e.collapseAll():void 0}function u({node:s,source:i}){s!==d||"masterDetail"===i||e.isDestroyed()||o?.setDetailSelectionState(d,t.detailGridOptions,e)}s?.registerDetailGrid(a,e),e.addEventListener("firstDataRendered",()=>{e.isDestroyed()||r.isDestroyed()||(o?.setDetailSelectionState(d,t.detailGridOptions,e),e.addEventListener("selectionChanged",c),r.addEventListener("rowSelected",u),e.isModuleRegistered("CsrmSsrmSharedApiModule")&&(r.addEventListener("expandOrCollapseAll",h),i?.setDetailsExpansionState(e)))}),this.addManagedListeners(d,{masterChanged:e=>{e.node.master||this.onDestroy(l)}}),this.addDestroyFunc(()=>this.onDestroy(l))}onDestroy(e){const{params:t}=this,o=t.node,s=t.api;o.detailGridInfo===e&&(s.isDestroyed()||s.removeDetailGridInfo(o.id),o.detailGridInfo=null)}loadRowData(){this.loadRowDataVersion++;const e=this.loadRowDataVersion,t=this.params;if("serverSide"===t.detailGridOptions?.rowModelType)return void t.node.detailGridInfo?.api?.refreshServerSide({purge:!0});const o=t.getDetailRowData;o?o({node:t.node,data:t.node.data,successCallback:t=>{this.loadRowDataVersion===e&&this.comp.setRowData(t)},context:Co(this.gos,{}).context}):Dt(172)}refresh(){const e=!0;switch(this.refreshStrategy){case"nothing":return e;case"everything":return!1}return this.loadRowData(),e}},oS=class{constructor(e){this.parentWrapper=e}wrap(e,t,o,s){return this.parentWrapper.wrap(e,t,o,s)}},sS={tag:"div",cls:"ag-details-row"},iS={tag:"div",cls:"ag-details-row",role:"gridcell",children:[{tag:"div",ref:"eDetailGrid",cls:"ag-details-grid",role:"presentation"}]};function nS(e,t){const o=e.masterDetailSvc?.store;return o?t(o):void 0}var rS={moduleName:"MasterDetail",version:Dv,dependsOn:[{moduleName:"SharedMasterDetail",version:Dv,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="masterDetailSvc",this.store={}}isEnabled(){return this.gos.get("masterDetail")}postConstruct(){const e=this.gos;It(e)&&(this.enabled=this.isEnabled()),At(e)&&this.addEventListeners()}addEventListeners(){const e=e=>{this.setMaster(e.node,!1,!0)};let t;const o=()=>{if(t){for(const e of t)e();t=void 0}this.isEnabled()&&(t=this.addManagedListeners(this.beans.eventSvc,{rowNodeDataChanged:e}))};o(),this.gos.addPropertyEventListener("masterDetail",o)}refreshModel(e){if(e.changedProps){const e=this.isEnabled();if(this.enabled!==e)return void this.setMasters(null)}e.rowDataUpdated&&this.setMasters(e.changedRowNodes)}setMaster(e,t,o){const s=e.master,i=this.isEnabled();let n=i;const r=this.gos,l=r.get("isRowMaster"),a=r.get("treeData");if(i)if(t||o){if(l){const t=e.data;n=!!t&&!!l(t)}}else n=s;a||(n&&t||!n&&s)&&(e._expanded??(e._expanded=null)),n!==s&&(e.master=n,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 e=nn(this.beans)?.rootNode?._leafs;if(e)for(let t=0,o=e.length;t{const s=t.clientHeight;if(null!=s&&s>0){const t=()=>{const{rowModel:t}=this.beans,{rowNode:i}=e;i.setRowHeight(s),(It(o)||At(o))&&t.onRowHeightChanged()};window.setTimeout(t,0)}},n=we(s,t,i);e.addDestroyFunc(n),i()}destroy(){this.store={},super.destroy()}}],userComponents:{agDetailCellRenderer:class extends Pi{constructor(){super(...arguments),this.eDetailGrid=null}wireBeans(e){this.context=e.context}init(e){this.params=e,this.selectAndSetTemplate();const t={toggleCss:(e,t)=>this.toggleCss(e,t),toggleDetailGridCss:(e,t)=>this.eDetailGrid.classList.toggle(e,t),setDetailGrid:e=>this.setDetailGrid(e),setRowData:e=>this.setRowData(e),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new tS),this.ctrl.init(t,e)}refresh(){return this.ctrl?.refresh()??!1}selectAndSetTemplate(){const e=this.params;if(e.pinned)return void this.setTemplate(sS);const t=()=>{this.setTemplate(iS)};if(a(e.template))t();else if("string"==typeof e.template)this.setTemplate(e.template,[]);else if("function"==typeof e.template){const t=(0,e.template)(e);this.setTemplate(t,[])}else Dt(168),t();null==this.eDetailGrid&&Dt(169)}setDetailGrid(e){if(!this.eDetailGrid)return;const t=new oS(this.context.getBean("frameworkCompWrapper")),{frameworkOverrides:o}=this.beans,s=Yu(this.eDetailGrid,e,{frameworkOverrides:o,providedBeanInstances:{frameworkCompWrapper:t},modules:gt(this.params.api.getGridId(),e.rowModelType??"clientSide")});this.detailApi=s,this.ctrl?.registerDetailWithMaster(s),this.addDestroyFunc(()=>{s.destroy()})}setRowData(e){this.detailApi?.setGridOption("rowData",e)}}},dynamicBeans:{detailCellRendererCtrl:tS},apiFunctions:{addDetailGridInfo:function(e,t,o){nS(e,e=>{e[t]=o})},removeDetailGridInfo:function(e,t){nS(e,e=>{delete e[t]})},getDetailGridInfo:function(e,t){return nS(e,e=>e[t])},forEachDetailGridInfo:function(e,t){nS(e,e=>{let o=0;Object.values(e).forEach(e=>{e&&t(e,o++)})})}},dependsOn:[Mv,Gy,Oy],css:[".ag-details-row{width:100%}.ag-details-row-fixed-height{height:100%}.ag-details-grid{width:100%}.ag-details-grid-fixed-height{height:100%}"]},Hy,jp]},lS=class extends Pi{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;this.dragging||(t=!0,this.dragging=!0,R(this.beans).classList?.add(this.getDraggingCssClass())),this.updateValuesOnMove(e),t?this.changedCalculatedValues=!1:(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:aS,mousedown:aS})}getLastCellHovered(){return this.lastCellHovered}getDraggingCssClass(){return`ag-dragging-${0===this.type?"fill":"range"}-handle`}updateValuesOnMove(e){const t=ta(this.gos,e);!t||this.shouldSkipCell(t)||this.lastCellHovered&&bn(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}clearDragProperties(){this.clearValues(),this.beans.rangeSvc.autoScrollService.ensureCleared(),R(this.beans).classList?.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging&&this.destroy()}getType(){return this.type}refresh(t,o){const s=this.cellCtrl,i=this.getGui(),n=o??e(this.beans.rangeSvc.getCellRanges()),r=n.startRow,l=n.endRow;if(r&&l&&(yn(l,r)?(this.rangeStartRow=l,this.rangeEndRow=r):(this.rangeStartRow=r,this.rangeEndRow=l)),s!==t||!re(i)){this.cellCtrl=t;const e=t.comp.getParentOfValue();e&&e.appendChild(i)}this.cellRange=n}clearValues(){this.lastCellHovered=void 0}destroy(){if(!this.shouldDestroyOnEndDragging&&this.dragging)return K(this.getGui(),!1),void(this.shouldDestroyOnEndDragging=!0);this.shouldDestroyOnEndDragging=!1,super.destroy(),this.getGui()?.remove()}updateLocalRangeIfNeeded(e){if(!this.cellRange)return;const{id:t,type:o}=this.cellRange;if(!t||t!==e.id)return;const s=this.beans.rangeSvc?.getCellRanges().find(e=>e.id===t&&e.type===o);s&&s!==this.cellRange&&(this.cellRange=s)}},aS=e=>{e.stopPropagation()};function dS(e){const t=e.length;let o=0;if(t<=1)return e;for(let h=0;h1?o=Math.max(o,parseInt(s[1],10)):Math.floor(t)!==t&&(o=Math.max(o,t.toString().split(".")[1].length))}let s=0,i=0,n=0,r=0,l=0;for(let h=0;h=4),e.toggleCss("ag-cell-range-chart",n),V(s,i>0||void 0),e.toggleCss("ag-cell-range-single-cell",this.isSingleCell()),this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),o=!t&&e.top,s=!t&&e.right,i=!t&&e.bottom,n=!t&&e.left,r=this.cellComp;r.toggleCss("ag-cell-range-top",o),r.toggleCss("ag-cell-range-right",s),r.toggleCss("ag-cell-range-bottom",i),r.toggleCss("ag-cell-range-left",n)}isSingleCell(){const{rangeSvc:e}=this;return 1===this.rangeCount&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeSvc:e}=this;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(e=>[un.DIMENSION,un.VALUE].includes(e.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshRangeStyleAndHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,o=!1,s=!1,i=!1;const{rangeSvc:n,beans:{visibleCols:r},cellCtrl:{cellPosition:l}}=this,a=l.column,d=n.getCellRanges().filter(e=>n.isCellInSpecificRange(l,e));if(!d.length)return{top:t,right:o,bottom:s,left:i};let c,h;e?(c=r.getColAfter(a),h=r.getColBefore(a)):(c=r.getColBefore(a),h=r.getColAfter(a)),c||(i=!0),h||(o=!0);for(let u=0;u=0;s--){const t=o[s],i=t.colorClass;if(i&&e.isCellInSpecificRange(this.cellCtrl.cellPosition,t))return i}return null}refreshHandleColor(e){const t=this.selectionHandle?.getGui?.(),o=e?.colorClass??null;t?(this.handleColorClass&&this.handleColorClass!==o&&t.classList.remove(this.handleColorClass),o?t.classList.add(o):this.handleColorClass&&t.classList.remove(this.handleColorClass),this.handleColorClass=o??null):this.handleColorClass=null}getRangeForHandle(){const{gos:t,editSvc:o}=this.beans,s=this.rangeSvc,i=s.getCellRanges(),n=i.length;if(this.rangeCount<1||n<1)return null;const r=o?.isRangeSelectionEnabledWhileEditing(),l=r?i:[e(i)];for(const e of l){const{cellPosition:i,column:l}=this.cellCtrl,a=mS(t)&&!l.isSuppressFillHandle(),d=pS(t);let c=!o?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&(r||1===n&&(a||d));if(this.hasChartRange&&(c=e.type===un.VALUE),c&&null!=e.endRow&&s.isContiguousRange(e)&&s.isBottomRightCell(e,i))return e}return null}addSelectionHandle(e){const{beans:t}=this,o=t.editSvc?.isRangeSelectionEnabledWhileEditing(),s=e.type,i=!o&&mS(t.gos)&&a(s)?0:1;if(this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=t.context.destroyBean(this.selectionHandle)),!this.selectionHandle){const e=t.registry.createDynamicBean(0===i?"fillHandle":"rangeHandle",!1);e&&(this.selectionHandle=t.context.createBean(e))}this.selectionHandle?.refresh(this.cellCtrl,e)}destroy(){this.unsetComp()}},CS=class extends Oe{constructor(e){super(),this.eContainer=e}postConstruct(){const{beans:e,gos:t,eContainer:o}=this,s=e.rangeSvc,i={eElement:o,onDragStart:s.onDragStart.bind(s),onDragStop:s.onDragStop.bind(s),onDragging:s.onDragging.bind(s)},n=e.dragSvc,r=n.addDragSource.bind(n,i),l=n.removeDragSource.bind(n,i);this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{so(t)?r():l()}),this.addDestroyFunc(l),so(t)&&r()}},vS=class extends Oe{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)}},wS=class extends Oe{constructor(e,t){super(),this.column=e,this.comp=t,this.columnMap=/* @__PURE__ */new Map,this.isActive=!1,this.resetColumnMap()}postConstruct(){this.addManagedPropertyListener("cellSelection",()=>{this.refreshActive()}),this.refreshActive(),this.setupRangeHeaderHighlight()}resetColumnMap(){let e;this.columnMap.clear(),e=this.column.isColumn?[this.column]:this.column.getDisplayedLeafColumns();for(const t of e)this.columnMap.set(t,!1)}refreshActive(){const{gos:e,rangeSvc:t}=this.beans,o=e.get("cellSelection");this.isActive=!!(o&&t&&"object"==typeof o&&o.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,o=!0;for(const s of e){if(t)break;for(const e of s.columns)this.columnMap.has(e)&&(this.columnMap.set(e,!0),t||(t=!0))}for(const s of Array.from(this.columnMap.values()))if(!1===s){o=!1;break}this.comp.toggleCss("ag-header-range-highlight",t&&o)}destroy(){super.destroy(),this.comp=null,this.column=null}};function bS(e,t){return null!=e?{rowIndex:e,rowPinned:t}:void 0}function yS(e){let t;for(const o of e)(void 0===t||yn(t,o))&&(t=o);return t}function SS(e){let t;for(const o of e)(void 0===t||yn(o,t))&&(t=o);return t}function RS(e,t,o){let s;s="top"===o?e.startRow&&e.endRow&&!yn(e.startRow,e.endRow)?"endRow":"startRow":e.startRow&&e.endRow&&!yn(e.startRow,e.endRow)?"startRow":"endRow",e[s]=t??void 0}var xS={moduleName:"CellSelection",version:Dv,beans:[class extends Oe{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(),o=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnVisible:e,columnValueChanged:e,columnPivotModeChanged:t,columnRowGroupChanged:t,columnPivotChanged:t,columnGroupOpened:o,columnMoved:o,columnPinned:o}),this.ctrlsSvc.whenReady(this,e=>{const t=e.gridBodyCtrl;this.autoScrollService=new Xl({scrollContainer:t.eBodyViewport,scrollAxis:"xy",getVerticalPosition:()=>t.scrollFeature.getVScrollPosition().top,setVerticalPosition:e=>t.scrollFeature.setVerticalScrollPosition(e),getHorizontalPosition:()=>t.scrollFeature.getHScrollPosition().left,setHorizontalPosition:e=>t.scrollFeature.setHorizontalScrollPosition(e),shouldSkipVerticalScroll:()=>!kt(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!t.scrollFeature.isHorizontalScrollShowing()})})}registerRangeSelectionExtension(e){this.rangeSelectionExtensions.includes(e)||this.rangeSelectionExtensions.push(e)}unregisterRangeSelectionExtension(e){s(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(o=>o.isAllColumnsRange?.(e,t))}updateSelectionModeForCell(e){this.setSelectionMode(this.isAllColumnsSelectionCell(e))}onDragStart(t){const o=this.gos,s=t.target;if(!so(o)||$r(o,s)?.isSuppressMouseEvent(t))return;if(this.shouldSuppressRangeSelection(s))return;const{shiftKey:i}=t,n=this.isMultiRange(t),r=i&&!!this.cellRanges?.length;n||r&&!l(e(this.cellRanges).type)||this.removeAllCellRanges(!0);const a=this.dragSvc.startTarget;if(a&&this.updateValuesOnMove(a),this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=t,this.intersectionRange=n&&this.getCellRangeCount(this.lastCellHovered)>1,r||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=e(this.cellRanges);else{const e={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned},t=this.getColumnsFromModel([this.lastCellHovered.column]);if(!t?.length)return;this.draggingRange={startRow:e,endRow:e,columns:t,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:o,newestRangeStartCell:s,autoScrollService:i,cellHasChanged:n}=this;if(!t||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const r=e=>o&&o.rowPinned===e&&s.rowPinned===e,l=r("top")||r("bottom");if(i.check(e,l),!n||!o)return;const a=s?.column,d=o?.column,c=this.calculateColumnsBetween(a,d);if(!c)return;const{rowIndex:h,rowPinned:u}=o;this.draggingRange.endRow={rowIndex:h,rowPinned:u},this.draggingRange.columns=c,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 o=s.columns;s.columns=s.columns.filter(t=>t.isVisible()&&-1!==e.indexOf(t)),t(o,s.columns)||this.dispatchChangedEvent(!1,!0,s.id)}const o=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(e=>e.columns.length>0),o>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const t=e(this.cellRanges);t&&this.refreshRangeStart(t)}isContiguousRange(t){const o=t.columns;if(!o.length)return!1;const s=this.visibleCols.allCols,i=o.map(e=>s.indexOf(e)).sort((e,t)=>e-t);return e(i)-i[0]+1===o.length}getRangeStartRow(e){return e.startRow&&e.endRow?yn(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 yn(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,o=this.getRangeStartRow(e),s=this.getRangeEndRow(e),i=Pn(t,o);return Pn(t,s)-i+1}handleCellMouseDown(e,t){const o=e.ctrlKey||e.metaKey;this.handleCellSelectionInput(t,{target:e.target,shiftKey:e.shiftKey,isRightClick:vo(this.beans,e),isMultiRange:this.isMultiRange(e),isMultiKey:o,preventDefault:()=>e.preventDefault()})}handleCellKeyboardSelect(e,t){const o=e.ctrlKey||e.metaKey;this.handleCellSelectionInput(t,{target:e.target,shiftKey:e.shiftKey,isRightClick:!1,isMultiRange:this.isMultiRangeForKeyState(o),isMultiKey:o,preventDefault:()=>e.preventDefault()})}handleCellSelectionInput(e,t){const{target:o,shiftKey:s,isRightClick:i,isMultiRange:n,isMultiKey:r,preventDefault:l}=t;if(this.shouldSuppressRangeSelection(o))return;const a=this.isAllColumnsSelectionCell(e);if(a&&l(),s)return this.extendLatestRangeToCell(e);if(a&&i)return;this.updateSelectionModeForCell(e);const d=this.calculateColumnsBetween(e.column,e.column);if(!d)return;const c=a?this.findContainingRange({columns:d,startRow:e,endRow:e}):void 0;a&&c&&n&&r&&c?this.removeRowFromAllColumnsRange(e,c):this.setRangeToCell(e,n)}isMultiRange(e){return this.isMultiRangeForKeyState(e.ctrlKey||e.metaKey)}isMultiRangeForKeyState(e){const{editingWithRanges:t,allowMulti:o}=this.getMultiRangeContext();return t||!!o&&e}getMultiRangeContext(){const{gos:e,editSvc:t}=this.beans,o=!!t?.isEditing()&&!!t?.isRangeSelectionEnabledWhileEditing(),s=function(e){const t=e.get("cellSelection");return void 0===t?e.get("suppressMultiRangeSelection"):"boolean"!=typeof t&&(t?.suppressMultiRanges??!1)}(e)&&!o;return{editingWithRanges:o,suppressMultiRanges:s,allowMulti:!s}}removeRowFromAllColumnsRange(e,t){const{beans:o,cellRanges:i}=this,n=Rn(o),r=xn(o),l=this.getRangeStartRow(t),a=this.getRangeEndRow(t);if(!l&&Sn(n,e))RS(t,En(o,n),"top");else if(!a&&Sn(r,e))RS(t,Mn(o,r),"bottom");else if(Sn(l,a))s(i,t);else if(Sn(l,e))RS(t,En(o,e),"top");else if(Sn(a,e))RS(t,Mn(o,e),"bottom");else{const s=Mn(o,e),n=En(o,e);t.startRow=l,t.endRow=s??void 0,i.push({...t,startRow:n??void 0,endRow:a})}this.dispatchChangedEvent(!0,!0)}setRangeToCell(e,t=!1){const{gos:o}=this;if(!so(o))return;this.updateSelectionModeForCell(e);const s=this.calculateColumnsBetween(e.column,e.column);if(!s)return;const{suppressMultiRanges:i}=this.getMultiRangeContext();(i||!t||a(this.cellRanges))&&this.removeAllCellRanges(!0);const n={rowIndex:e.rowIndex,rowPinned:e.rowPinned},r={startRow:n,endRow:n,columns:s,startColumn:e.column},l=this.ensureRangeStartColumn(r);l&&(this.cellRanges.push(r),this.setNewestRangeStartCell({...e,column:l}),this.onDragStop(),this.dispatchChangedEvent(!0,!0))}getRangeLastColumn(t){const o=t.columns[0],s=e(t.columns);return this.newestRangeStartCell?.column===o?s:o}extendRangeRowCountBy(e,t){const{beans:o}=this,{startRow:s,endRow:i}=e;if(!s||!i)return;let n,r=0;const l=yn(i,s);n=l?s:i;const a=t>0?En:Mn,d=Math.abs(t);for(;ro.indexOf(e)).filter(e=>e>-1).sort((e,t)=>e-t);return{left:o[s[0]],right:o[e(s)]}}extendLatestRangeInDirection(t){if(this.isEmpty()||!this.newestRangeStartCell)return;const o=t.key,s=t.ctrlKey||t.metaKey,i=e(this.cellRanges),n=this.newestRangeStartCell,r=i.endRow.rowIndex,l=i.endRow.rowPinned,a={column:this.getRangeLastColumn(i),rowIndex:r,rowPinned:l},d=this.cellNavigation.getNextCellToFocus(o,a,s);return d&&!this.shouldSkipColumn(d.column)?(this.setCellRange({rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:d.rowIndex,rowEndPinned:d.rowPinned,columnStart:n.column,columnEnd:d.column}),d):void 0}setCellRange(e){so(this.gos)&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){if(t(this.cellRanges,e))return;if(!this.verifyCellRanges(this.gos))return;this.setSelectionMode(!1),this.removeAllCellRanges(!0);const o=this.getColumnsFromModel(this.visibleCols.allCols)??[];let s=!1;for(const t of e){if(t.columns&&t.startRow){const e=this.getColumnsFromModel(t.columns);if(!e||0===e.length)continue;t.columns=e;const{startRow:o}=t;this.setNewestRangeStartCell({rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:t.columns[0]})}!s&&o.length>0&&this.isAllColumnsRange(t,o)&&(s=!0),this.cellRanges.push(t)}this.setSelectionMode(s),this.dispatchChangedEvent(!1,!0)}clearCellRangeCellValues(e){const{beans:t,eventSvc:o}=this,{cellEventSource:s="rangeSvc",dispatchWrapperEvents:i,wrapperEventSource:n="deleteKey",restoreSourceInBatch:r}=e;let{cellRanges:l}=e;i&&(o.dispatchEvent({type:"cellSelectionDeleteStart",source:n}),o.dispatchEvent({type:"rangeDeleteStart",source:n})),l||(l=this.cellRanges);const{valueSvc:a,editSvc:d}=t,c=!!d?.isBatchEditing(),{changeDetectionSvc:h}=t;h?.beginDeferred();try{this.forEachEditableCellInRanges(l,(e,t)=>{if(r&&c)return void d?.batchResetToSourceValue({rowNode:e,column:t});const o=a.getDeleteValue(t,e);e.setDataValue(t,o,s)})}finally{h?.endDeferred()}i&&(o.dispatchEvent({type:"cellSelectionDeleteEnd",source:n}),o.dispatchEvent({type:"rangeDeleteEnd",source:n}))}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(t,o){const{columns:s,columnStart:i,columnEnd:n,rowStartIndex:r,rowStartPinned:l,rowEndIndex:a,rowEndPinned:d}=t,c=this.getColumnsFromParams(s,i,n);if(!c||!o&&0===c.columns.length)return;const{columns:h,startsOnTheRight:u}=c;return{startRow:bS(r,l),endRow:bS(a,d),columns:h,startColumn:this.getColumnFromModel(i)??(u?e(h):h[0])}}addCellRange(e){const t=this.gos;if(!so(t)||!this.verifyCellRanges(t))return;this.setSelectionMode(!1);const o=this.createCellRangeFromCellRangeParams(e);return o?(o.startRow&&this.setNewestRangeStartCell({rowIndex:o.startRow.rowIndex,rowPinned:o.startRow.rowPinned,column:o.startColumn}),this.cellRanges.push(o),this.dispatchChangedEvent(!1,!0,o.id),o):void 0}getCellRanges(){return this.cellRanges}isEmpty(){return 0===this.cellRanges.length}isMoreThanOneCell(){const e=this.cellRanges.length;if(0===e)return!1;if(e>1)return!0;const t=this.cellRanges[0],o=this.getRangeStartRow(t),s=this.getRangeEndRow(t);return o.rowPinned!==s.rowPinned||o.rowIndex!==s.rowIndex||1!==t.columns.length}areAllRangesAbleToMerge(){const e=/* @__PURE__ */new Map;if(this.cellRanges.length<=1)return!0;for(const o of this.cellRanges)this.forEachRowInRange(o,t=>{const s=`${t.rowPinned||"normal"}_${t.rowIndex}`,i=e.get(s),n=o.columns.map(e=>e.getId());if(i){const e=n.filter(e=>-1===i.indexOf(e));i.push(...e)}else e.set(s,n)});let t;for(const o of e.values()){const e=o.sort().join();if(void 0!==t){if(t!==e)return!1}else t=e}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 o=t.columns?.includes(e.column),s=this.isRowInRange(e,t);return o&&s}isColumnInAnyRange(e){const{beans:t}=this,o=Rn(t),s=xn(t);if(!o||!s)return!1;const i=e.isColumn?[e]:e.getDisplayedLeafColumns();return null!=this.findContainingRange({columns:i,startRow:o,endRow:s},!0)}findContainingRange({columns:e,startRow:t,endRow:o},s=!1){const i=this.cellRanges;for(let n=i.length-1;n>=0;n--){const r=i[n],l=e.every(e=>r.columns.includes(e));let a=!1;if(s)a=Sn(r.startRow,t)&&Sn(r.endRow,o);else{const e=t&&this.isRowInRange(t,r),s=o&&this.isRowInRange(o,r);a=!!e&&!!s}if(l&&a)return r}}isBottomRightCell(t,o){const s=this.visibleCols.allCols,i=t.columns.map(e=>s.indexOf(e)).sort((e,t)=>e-t),{startRow:n,endRow:l}=t,a=yn(n,l)?l:n,d=s.indexOf(o.column)===e(i),c=o.rowIndex===a.rowIndex&&r(o.rowPinned)===r(a.rowPinned);return d&&c}getCellRangeCount(e){return this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t){const o=this.getRangeStartRow(t),s=this.getRangeEndRow(t),i=Sn(e,o),n=Sn(e,s);if(i||n)return!0;const r=!yn(e,o),l=yn(e,s);return r&&l}intersectLastRange(t){const{editingWithRanges:o,suppressMultiRanges:s}=this.getMultiRangeContext();if(o||s||t&&this.dragging||this.isEmpty())return;const i=e(this.cellRanges),n=this.getRangeStartRow(i),r=this.getRangeEndRow(i),l=[];for(const e of this.cellRanges.slice(0,-1)){const t=this.getRangeStartRow(e),o=this.getRangeEndRow(e),s=e.columns,a=s.filter(e=>-1===i.columns.indexOf(e));if(a.length===s.length){l.push(e);continue}if(yn(r,t)||yn(o,n)){l.push(e);continue}const d=l.length;if(yn(t,n)){const e={columns:[...s],startColumn:i.startColumn,startRow:{...t},endRow:Mn(this.beans,n)};l.push(e)}if(a.length>0){const e={columns:a,startColumn:a.includes(i.startColumn)?i.startColumn:a[0],startRow:yS([{...n},{...t}]),endRow:SS([{...r},{...o}])};l.push(e)}yn(r,o)&&l.push({columns:[...s],startColumn:i.startColumn,startRow:En(this.beans,r),endRow:{...o}}),l.length-d===1&&(l[l.length-1].id=e.id)}this.cellRanges=l,t&&this.dispatchChangedEvent(!1,!0)}createRangeHighlightFeature(e,t,o){e.createManagedBean(new wS(t,o))}setSelectionMode(e){this.selectionMode=e?1:0}refreshRangeStart(t){const{columns:o}=t,s=this.ensureRangeStartColumn(t);if(!s)return;const i=(e,o)=>{const s=t.columns.filter(t=>t!==e);e?(t.startColumn=e,t.columns=o?[e,...s]:[...s,e]):t.columns=s},{left:n,right:r}=this.getRangeEdgeColumns(t);s!==o[0]||s===n?s===e(o)&&s===r&&i(r,!1):i(n,!0)}setNewestRangeStartCell(e){this.newestRangeStartCell=e}getColumnsFromParams(e,t,o){const s=!e&&!t&&!o;let i,n=!1;return s||e?i=this.getColumnsFromModel(s?void 0:e):t&&o&&(i=this.calculateColumnsBetween(t,o),i?.length&&(n=i[0]!==this.getColumnFromModel(t))),i?{columns:i,startsOnTheRight:n}:void 0}verifyCellRanges(e){const{suppressMultiRanges:t}=this.getMultiRangeContext(),o=function(e){return void 0!==e.get("cellSelection")}(e)&&t&&this.cellRanges.length>1;return o&&Dt(93),!o}forEachRowInRange(e,t){const o=this.getRangeStartRow(e),s=this.getRangeEndRow(e);let i=o;for(;i&&(t(i),!Sn(i,s));)i=En(this.beans,i)}forEachEditableCellInRanges(e,t){const{beans:o}=this;for(const s of e)this.forEachRowInRange(s,e=>{const i=Fn(o,e);if(i)for(let o=0;o0,h=o.ctrlKey||o.metaKey,u=!d||h,g=Rn(n),p=xn(n);if(!g||!p)return;if(o.key===fs&&o.preventDefault(),o.shiftKey){const o=r.root;if(!o)return;const i=t.isColumn?t:e(t.getLeafColumns()),n=this.findContainingRange({columns:[o],startRow:g,endRow:p},!0);return n?void this.updateRangeRowBoundary({cellRange:n,boundary:"end",cellPosition:{column:i,...p}}):(s(l,r.lastCellRange),void this.selectColumns(this.calculateColumnsBetween(o,i),g,p))}c&&(a||!h&&!d)&&this.removeAllCellRanges(!0);const m=(e,t)=>{const o=this.findContainingRange({columns:e,startRow:g,endRow:p},!0);if(o&&u)this.deselectColumnsFromRange(o,e);else{const t=this.selectColumns(e,g,p);t&&(r.lastCellRange=t)}r.root=t};if(t.isColumn)m([t],t);else{const e=t.getDisplayedLeafColumns();m(e,e[0])}}deselectColumnsFromRange(e,t){i(e.columns,t),t.includes(e.startColumn)&&(e.startColumn=e.columns[0]),0===e.columns.length&&s(this.cellRanges,e),this.dispatchChangedEvent(!0,!0)}selectColumns(t,o,s){return this.addCellRange({columns:t,columnStart:t[0],columnEnd:e(t),rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,rowEndIndex:s.rowIndex,rowEndPinned:s.rowPinned})}}],dynamicBeans:{fillHandle:class extends lS{constructor(){super(cS),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=0}postConstruct(){super.postConstruct(),this.addManagedElementListeners(this.getGui(),{dblclick:this.onDblClick.bind(this)})}onDblClick(t){qi(t);const{cellRange:o,rangeStartRow:s,beans:i}=this,{rangeSvc:n,visibleCols:r}=i,l=xn(i);if(!l)return;const a=this.getFillHandleDirection();this.dragAxis="xy"===a?"y":a;const d=n?.createCellRangeFromCellRangeParams({rowStartIndex:s.rowIndex,rowStartPinned:s.rowPinned,columnStart:o.columns[0],rowEndIndex:"x"===this.dragAxis?o.endRow?.rowIndex??null:l.rowIndex,rowEndPinned:"x"===this.dragAxis?o.endRow?.rowPinned:l.rowPinned,columnEnd:"x"===this.dragAxis?e(r.allCols):e(o.columns)});this.isUp=!1,this.isLeft=!1,d&&this.performFill({event:t,initialRange:o,finalRange:d}),this.dragAxis=void 0}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=oa(this.beans,e));const{x:t,y:o}=this.initialXY,{x:s,y:i}=oa(this.beans,e),n=Math.abs(t-s),r=Math.abs(o-i),l=this.getFillHandleDirection();let a;a="xy"===l?n>r?"x":"y":l,a!==this.dragAxis&&(this.dragAxis=a,this.changedCalculatedValues=!0)}shouldSkipCell(e){return os(e.column)}onDrag(e){if(!this.initialPosition){const e=this.cellCtrl;if(!e)return;this.initialPosition=e.cellPosition}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t="x"===this.dragAxis,{cellRange:o,rangeStartRow:s,rangeEndRow:i,beans:{rangeSvc:n}}=this,r=o.columns.length;let l;if(this.isUp||this.isLeft){const e=t?s:this.lastCellMarked;l=n.createCellRangeFromCellRangeParams({rowStartIndex:e.rowIndex,rowStartPinned:e.rowPinned,columnStart:t?this.lastCellMarked.column:o.columns[0],rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnEnd:o.columns[r-1]})}else l=n.createCellRangeFromCellRangeParams({rowStartIndex:s.rowIndex,rowStartPinned:s.rowPinned,columnStart:o.columns[0],rowEndIndex:t?i.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?i.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:o.columns[r-1]});l&&this.performFill({event:e,initialRange:o,finalRange:l,shouldUpdateRange:!0})}onDragCancel(){this.initialXY=null,this.markedCells.length&&this.clearMarkedPath()}performFill({event:e,initialRange:t,finalRange:o,shouldUpdateRange:s}){const{eventSvc:i,rangeSvc:n}=this.beans;i.dispatchEvent({type:"fillStart"}),this.handleValueChanged(t,o,e),s&&n.setCellRanges([o]),i.dispatchEvent({type:"fillEnd",initialRange:t,finalRange:o})}getFillHandleDirection(){const e=io(this.gos)?.direction;return e?"x"!==e&&"y"!==e&&"xy"!==e?(Dt(177),"xy"):e:"xy"}handleValueChanged(t,o,s){const{beans:i}=this,{rangeSvc:n,gos:r,valueSvc:l}=i,a=n.getRangeEndRow(t),c=n.getRangeStartRow(t),h=n.getRangeEndRow(o),u=n.getRangeStartRow(o),g="y"===this.dragAxis;if(this.isReduce&&!io(r)?.suppressClearOnFillReduction){const e=g?t.columns:t.columns.filter(e=>o.columns.indexOf(e)<0),s=g?En(i,h):u;return void(s&&this.clearCellsInRange(s,a,e))}const p=[],m=[],f=[],C=[];let v=!0,w=0;const b=()=>{p.length=0,m.length=0,f.length=0,C.length=0,w=0},y=(o,s)=>{let n=this.isUp?a:c,r=!1;for(g&&(v=!0,b());!r&&n;){const l=Fn(i,n);if(!l)break;if(g&&o)S(p,o,l,()=>!Sn(n,this.isUp?c:a));else if(s){v=!0,b();for(const o of s)S(p,o,l,()=>o!==(this.isLeft?t.columns[0]:e(t.columns)))}r=Sn(n,this.isUp?u:h),n=this.isUp?Mn(this.beans,n):En(i,n)}},S=(e,t,o,i)=>{let n,r=!1;if(v)n=l.getValue(t,o,"edit"),m.push(n),f.push(l.getValue(t,o,"edit",!0)),C.push(l.getValueForDisplay({column:t,node:o,from:"edit"}).valueFormatted),v=i();else{const{value:i,fromUserFunction:a,sourceCol:c,sourceRowNode:h}=this.processValues({event:s,values:e,initialValues:m,initialNonAggregatedValues:f,initialFormattedValues:C,col:t,rowNode:o,idx:w++});if(n=i,t.isCellEditable(o)){const e=l.getValue(t,o,"edit");if(!a){if(c){const e=c.getColDef();if(!1!==e.useValueFormatterForExport&&e.valueFormatter){const e=l.getValueForDisplay({column:c,node:h,includeValueFormatted:!0,from:"edit"}).valueFormatted;null!=e&&(n=e)}}!1!==t.getColDef().useValueParserForImport&&(n=l.parseValue(t,o,c?n:d(n),e))}a&&e===n?r=!0:o.setDataValue(t,n,"rangeSvc")}}r||e.push({value:n,column:t,rowNode:o})},{changeDetectionSvc:R}=this.beans;R?.beginDeferred();try{g?t.columns.forEach(e=>{y(e)}):y(void 0,this.isLeft?[...o.columns].reverse():o.columns),this.beans.editSvc?.stopEditing(void 0,{source:"fillHandle"})}finally{R?.endDeferred()}}clearCellsInRange(e,t,o){const s={startRow:e,endRow:t,columns:o,startColumn:o[0]};this.beans.rangeSvc.clearCellRangeCellValues({cellRanges:[s],restoreSourceInBatch:!0})}processValues(t){const{formula:o,valueSvc:s}=this.beans,{event:i,values:n,initialValues:r,initialNonAggregatedValues:l,initialFormattedValues:a,col:d,rowNode:c,idx:h}=t,u=io(this.gos)?.setFillValue;let g;if(g="y"===this.dragAxis?this.isUp?"up":"down":this.isLeft?"left":"right",u){const e=u(Co(this.gos,{event:i,values:n.map(({value:e})=>e),initialValues:r,initialNonAggregatedValues:l,initialFormattedValues:a,currentIndex:h,currentCellValue:s.getValue(d,c,"edit"),direction:g,column:d,rowNode:c}));if(!1!==e)return{value:e,fromUserFunction:!0}}const p=n.every(({value:e})=>{return"number"==typeof(t=e)&&Number.isFinite(t)||"string"==typeof t&&/^[+-]?\d+(?:\.\d+)?$/.test(t.trim());var t});if(i.altKey||!p){const t=String(e(n)?.value??"");if(p&&1===r.length){const e=this.isUp||this.isLeft?-1:1;return{value:parseFloat(t)+1*e,fromUserFunction:!1}}const{value:s,column:i,rowNode:l}=n[h%n.length];let a;const d=i.isAllowFormula()&&o?.isFormula(t);if(d){const e="up"===g?-1:"down"===g?1:0,s="left"===g?-1:"right"===g?1:0;a=o.updateFormulaByOffset({value:t,rowDelta:e,columnDelta:s})}else a=s;return{value:a,fromUserFunction:!1,sourceCol:d?void 0:i,sourceRowNode:l}}return{value:e(dS(n.map(({value:e})=>Number(e)))),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(),"y"===this.dragAxis){if(Sn(t,e))return;const o=yn(t,e),{rangeStartRow:s,rangeEndRow:i}=this;o&&(t.rowPinned==s.rowPinned&&t.rowIndex>=s.rowIndex||s.rowPinned!=i.rowPinned&&t.rowPinned==i.rowPinned&&t.rowIndex<=i.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,o),this.isReduce=!1)}else{const o=e.column,s=t.column;if(o===s)return;const i=this.beans.visibleCols.allCols,n=i.indexOf(o),r=i.indexOf(s);r<=n&&r>=i.indexOf(this.cellRange.columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,re&&!t?1:!e&&t?-1:e||t?et?1:0:0,MS="Exceeded maximum allowed pivot column count.",PS=e=>{const t={};return e.forEach((e,o)=>t[o]=e instanceof Map?PS(e):e),t},ES={moduleName:"SharedPivot",version:Dv,beans:[class extends Oe{constructor(){super(...arguments),this.beanName="pivotResultCols"}wireBeans(e){this.colModel=e.colModel,this.visibleCols=e.visibleCols}destroy(){Jo(this.beans,this.pivotResultCols?.tree),super.destroy()}isPivotResultColsPresent(){return null!=this.pivotResultCols}lookupPivotResultCol(e,o){if(null==this.pivotResultCols)return null;const s=this.colModel.getColDefCol(o);let i=null;for(const n of this.pivotResultCols.list){const o=n.getColDef().pivotKeys,r=n.getColDef().pivotValueColumn;t(o,e)&&r===s&&(i=n)}return i}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.colModel.getColFromCollection(e,this.pivotResultCols):null}getAggregationOrderedList(){let e=this.aggOrderedList;if(void 0!==e)return e;const t=this.pivotResultCols?.list;if(!t||0===t.length)return this.aggOrderedList=null,null;let o=!1;for(let s=0;s{e.forEach(e=>{if(l(e.children)){const t=e;o&&o(t),s(t.children)}else t&&t(e)})};e&&s(e)}},class extends Oe{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),o=function e(t,o=[]){return t.forEach(t=>{void 0!==t.children?e(t.children,o):o.push(t)}),o}(t);return this.addRowGroupTotals(t,o),this.addExpandablePivotGroups(t,o),this.addPivotTotalsToGroups(t,o),t}createPivotColumnsFromUniqueValues(e){const t=this.pivotColsSvc?.columns??[],o=t.length;return this.recursivelyBuildGroup(0,e,[],o,t)}recursivelyBuildGroup(e,t,o,s,i){if(e>=s)return this.buildMeasureCols(o);const{pivotComparator:n}=i[e].getColDef(),r=n?(e=>(t,o)=>e(t.headerName,o.headerName))(n):DS,l=this.valueColsSvc?.columns;if(1===l?.length&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&e===s-1){const e=[];for(const s of t.keys()){const t=[...o,s],i=this.createColDef(l[0],s,t);i.columnGroupShow="open",e.push(i)}return e.sort(r),e}const a=[];for(const d of t.keys()){const n=-1===this.pivotDefaultExpanded||e{const o=this.colNames.getDisplayNameForColumn(t,"header"),s=this.createColDef(t,o,e);return s.columnGroupShow="open",s})}addExpandablePivotGroups(e,t){const o=this.gos.get("suppressExpandablePivotGroups");if(o||this.gos.get("pivotColumnGroupTotals"))return;const s=(e,t,i)=>{if("children"in e){const{valueColsSvc:n}=this,{columns:r=[]}=n??{},l=/* @__PURE__ */new Map;e.children.forEach(e=>{s(e,t,l)});const a=!e.children.some(e=>e.children),d=a&&1===r.length&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(const s of r){const i=this.colNames.getDisplayNameForColumn(s,"header"),n=this.createColDef(s,i,e.pivotKeys);n.pivotTotalColumnIds=l.get(s.getColId()),n.columnGroupShow=o?"open":"closed",n.aggFunc=s.getAggFunc(),a&&!d||(e.children.push(n),t.push(n))}return void this.merge(i,l)}if(!e.pivotValueColumn)return;const n=e.pivotValueColumn.getColId();i.has(n)?i.get(n).push(e.colId):i.set(n,[e.colId])};e.forEach(e=>{s(e,t,/* @__PURE__ */new Map)})}addPivotTotalsToGroups(e,t){if(!this.gos.get("pivotColumnGroupTotals"))return;const o="after"===this.gos.get("pivotColumnGroupTotals"),s=this.valueColsSvc?.columns,i=s?.map(e=>e.getAggFunc());if(i&&!(i.length<1)&&this.sameAggFuncs(i)&&s){const i=s[0];e.forEach(e=>{this.recursivelyAddPivotTotal(e,t,i,o)})}}recursivelyAddPivotTotal(e,t,o,s){const i=e;if(!i.children){const t=e;return t.colId?[t.colId]:null}let n=[];if(i.children.forEach(e=>{const i=this.recursivelyAddPivotTotal(e,t,o,s);i&&(n=n.concat(i))}),i.children.length>1){const i=this.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),r=this.createColDef(o,i,e.pivotKeys,!0);r.pivotTotalColumnIds=n,r.aggFunc=o.getAggFunc(),r.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const l=e.children;s?l.push(r):l.unshift(r),t.push(r)}return n}addRowGroupTotals(e,t){if(!this.gos.get("pivotRowTotals"))return;const o="after"===this.gos.get("pivotRowTotals"),s=(this.valueColsSvc?.columns??[]).slice();o||s.reverse();const i=s.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let n=0;ne.data?.[e.colDef.field],i.pivotKeys=o,i.pivotValueColumn=e,!0===i.filter&&(i.filter="agNumberColumnFilter"),i}sameAggFuncs(e){if(1==e.length)return!0;for(let t=1;t{const s=[...e.has(o)?e.get(o):[],...t];e.set(o,s)})}generateColumnGroupId(e){return`pivotGroup_${(this.pivotColsSvc?.columns??[]).map(e=>e.getColId()).join("-")}_${e.join("-")}`}generateColumnId(e,t){return`pivot_${(this.pivotColsSvc?.columns??[]).map(e=>e.getColId()).join("-")}_${e.join("-")}_${t}`}createColDefsFromFields(e){const t=/* @__PURE__ */new Map;for(let i=0;i{const n=[];for(const[r,l]of s){const t=o(`${e}${this.fieldSeparator}${r}`,r,l,i+1);n.push(t)}if(0===n.length){const o=this.colModel.getColDefCol(t);if(o){const s=this.colNames.getDisplayNameForColumn(o,"header")??t,i=this.createColDef(o,s,void 0,!1);return i.colId=e,i.aggFunc=o.getAggFunc(),i.valueGetter=t=>t.data?.[e],i}return{colId:e,headerName:t,valueGetter:t=>t.data?.[e]}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===n.length&&"colId"in n[0]?(n[0].headerName=t,n[0]):{openByDefault:-1===this.pivotDefaultExpanded||i`${e.getId()}-${e.getColDef().headerName}`).join("#"),l=n.map(e=>e.getAggFunc().toString()).join("#"),a=this.aggregationColumnsHashLastTime!==r,d=this.aggregationFuncsHashLastTime!==l;this.aggregationColumnsHashLastTime=r,this.aggregationFuncsHashLastTime=l;const c=(this.rowGroupColsSvc?.columns??[]).map(e=>e.getId()).join("#"),h=c!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=c;const u=this.gos.get("pivotRowTotals"),g=this.gos.get("pivotColumnGroupTotals"),p=this.gos.get("suppressExpandablePivotGroups"),m=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),f=u!==this.pivotRowTotalsLastTime||g!==this.pivotColumnGroupTotalsLastTime||p!==this.suppressExpandablePivotGroupsLastTime||m!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=u,this.pivotColumnGroupTotalsLastTime=g,this.suppressExpandablePivotGroupsLastTime=p,this.removePivotHeaderRowWhenSingleValueColumnLastTime=m,this.lastTimeFailed||i||a||h||d||f){const e=this.pivotColDefSvc.createPivotColumnDefs(this.uniqueValues);return this.pivotResultCols.setPivotResultCols(e,"rowModelUpdated"),this.lastTimeFailed=!1,!0}return this.lastTimeFailed=!1,!1}setUniqueValues(e){return!c(PS(this.uniqueValues),PS(e))&&(this.uniqueValues=e,!0)}bucketUpRowNodes(e){this.currentUniqueCount=0;const t=/* @__PURE__ */new Map;eg(this.beans.rowModel.rootNode,this.beans.rowModel.hierarchical,e,e=>{e.leafGroup&&(e.childrenMapped=null)});const o=e=>{if(e.leafGroup)this.bucketRowNode(e,t);else{const t=e.childrenAfterFilter;if(t)for(let e=0,s=t.length;ethis.maxUniqueValues;if(r&&e)throw new Error(MS)}i.has(o)||i.set(o,[]),i.get(o).push(t)}if(o===t.length-1)return i;const l=/* @__PURE__ */new Map;for(const a of i.keys())l.set(a,this.bucketChildren(i.get(a),t,o+1,s.get(a)));return l}}],dependsOn:[ES,Zy,Hy]},IS=[{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"}],AS=/* @__PURE__ */new Map;for(const VS of IS){const e=AS.get(VS.symbol)??[];e.push(VS),AS.set(VS.symbol,e)}[...new Set(IS.map(e=>e.symbol))].sort((e,t)=>t.length-e.length);var kS={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",stackedLine:"line",normalizedLine:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall",funnel:"funnel",coneFunnel:"cone-funnel",pyramid:"pyramid"},LS=/* @__PURE__ */new Set(["columnLineCombo","areaColumnCombo","customCombo"]);["number","category","grouped-category","log","time"].reduce((e,t)=>({...e,[t]:{title:{_enabledFromTheme:!0}}}),{});var GS=e=>t=>null==t||e(t),NS=["doughnut"];function BS(e){return e.map((e,t,o)=>e.map((e,s)=>o.slice(0,t+1).reduce((e,t)=>e+t[s],0)))}function HS(e){const t=e.map((t,o)=>e.reduce((e,t)=>Math.max(e,t[o]),0));return e.map(e=>e.map((e,o)=>e/t[o]*19))}GS(e=>{if(function(e){return!!kS[e]||(t=e,LS.has(t));var t}(e))return!0;if(t=e,NS.includes(t)){const t=function(e){return"doughnut"===e?"donut":e}(e);return ot(`The chart type '${e}' has been deprecated. Please use '${t}' instead.`),t}var t;return!1}),GS(e=>"object"==typeof e),GS(e=>"object"==typeof e),GS(e=>"string"==typeof e||"function"==typeof e);var OS=[[1,3,5],[2,6,4],[5,3,1]];HS(BS(OS)),HS(BS(OS)),pt.registerModules([wm,Cg,lm,$p,nm,hp,hg,Qb,xS,TS,rS,qv,cb,Fb,Ob,zb,eS]);export{pt as ModuleRegistry,Yu as createGrid,Rc as iconSetQuartzLight,Ec as themeQuartz}; \ No newline at end of file diff --git a/main.js b/main.js index c0170d5..e3df29c 100644 --- a/main.js +++ b/main.js @@ -9,7 +9,7 @@ import { ClientSideRowModelModule, themeQuartz, iconSetQuartzLight, - createGrid // La exportamos por si la necesitas fuera + createGrid } from "ag-grid-community"; import { @@ -25,7 +25,6 @@ import { ClipboardModule, } from "ag-grid-enterprise"; -// ✅ Registro de módulos automático al importar este archivo ModuleRegistry.registerModules([ ValidationModule, ColumnAutoSizeModule, @@ -46,7 +45,6 @@ ModuleRegistry.registerModules([ ClipboardModule, ]); -// ✅ Exportamos lo básico para que el bundle sea útil export { createGrid, themeQuartz, diff --git a/package.json b/package.json index 33736d8..f0c0c61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aggrid", - "version": "1.0.0", + "version": "35.2.0", "type": "module", "main": "./grid/index.js", "module": "./grid/index.js",