@epam/ai-dial-ui-kit 0.15.0-dev.37 → 0.15.0-dev.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,4 +60,4 @@ See ${tu(e,t)}`;return Array.isArray(i)?i.concat(n):[i,n]}var T1={1:"Charting Ag
60
60
  `,jF=class extends qF{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&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,_c),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((o,i)=>{i!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(o.data.value||""),o.mergeAcross&&this.appendEmptyCells(o.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,o,i){o!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(i)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,o){t!=0&&(this.result+=this.columnSeparator);const i=this.extractRowCellValue({column:e,node:o,currentColumnIndex:t,accumulatedRowIndex:t,type:"csv",useRawFormula:!1});this.result+=this.putInQuotes(i.valueFormatted??i.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(D(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=_c),this.isFirstLine=!1}},YF=class extends $F{constructor(){super(...arguments),this.beanName="csvCreator"}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){D(51);return}const t=()=>{const i=this.getMergedParams(e),s=this.getData(i),n=new Blob(["\uFEFF",s],{type:"text/plain"}),r=i.fileName,a=typeof r=="function"?r(K(this.gos,{})):r;KF(this.getFileName(a),n)},{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:i,valueSvc:s,gos:n}=this.beans,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:d,columnSeparator:u,valueFrom:h}=e;return new jF({colModel:t,colNames:o,valueSvc:s,gos:n,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:d||!1,columnSeparator:u||",",rowGroupColsSvc:i,valueFrom:h})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function QF(e,t){return e.csvCreator?.getDataAsCsv(t)}function ZF(e,t){e.csvCreator?.exportDataAsCsv(t)}var JF={moduleName:"CsvExport",version:L,beans:[YF],apiFunctions:{getDataAsCsv:QF,exportDataAsCsv:ZF},dependsOn:[UF]},lg=class extends qe{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}postConstruct(){this.refreshTooltip()}setBrowserTooltip(e,t){const o="title",i=this.ctrl.getGui();i&&(e!=null&&(e!=""||t)?i.setAttribute(o,e):i.removeAttribute(o))}updateTooltipText(){const{getTooltipValue:e}=this.ctrl;e&&(this.tooltip=e())}createTooltipFeatureIfNeeded(){if(this.tooltipManager==null){const e=this.beans.registry.createDynamicBean("tooltipStateManager",!0,this.ctrl,()=>this.tooltip);e&&(this.tooltipManager=this.createBean(e,this.beans.context))}}attemptToShowTooltip(){this.tooltipManager?.prepareToShowTooltip()}attemptToHideTooltip(){this.tooltipManager?.hideTooltip()}setTooltipAndRefresh(e){this.tooltip=e,this.refreshTooltip()}refreshTooltip(e){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)):(this.setBrowserTooltip(e?"":null,e),this.createTooltipFeatureIfNeeded())}destroy(){this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context),super.destroy()}},XF=1e3,eE=1e3,Uc=100,$c,Fs=!1,tE=class extends qe{constructor(e,t){super(),this.tooltipCtrl=e,this.getTooltipValue=t,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(e){this.popupSvc=e.popupSvc}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const e=this.tooltipCtrl.getGui();this.tooltipTrigger===0&&this.addManagedListeners(e,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),this.tooltipTrigger===1&&this.addManagedListeners(e,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.addManagedListeners(e,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(e,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(e){const t=this.gos.get(e);return Math.max(200,t)}getTooltipDelay(e){return this.tooltipCtrl[`getTooltip${e}DelayOverride`]?.()??this.getGridOptionsTooltipDelay(`tooltip${e}Delay`)}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return!e||e==="hover"?0:1}onMouseEnter(e){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),!Mo()&&(Fs?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(e)},Uc):this.prepareToShowTooltip(e))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&this.state===2&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){const t=e.relatedTarget,o=this.tooltipCtrl.getGui(),i=this.tooltipComp?.getGui();this.isInteractingWithTooltip||o.contains(t)||this.interactionEnabled&&i?.contains(t)||this.setToDoNothing()}onKeyDown(){this.isInteractingWithTooltip&&(this.isInteractingWithTooltip=!1),this.setToDoNothing()}prepareToShowTooltip(e){if(this.state!=0||Fs)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()-$c<XF}setToDoNothing(e){!e&&this.state===2&&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(!O(e)||t.shouldDisplayTooltip&&!t.shouldDisplayTooltip()){this.setToDoNothing();return}const o=this.gos.addCommon({location:t.getLocation?.()??"UNKNOWN",value:e,hideTooltipCallback:()=>this.hideTooltip(!0),...t.getAdditionalParams?.()});this.state=2,this.tooltipInstanceCount++;const i=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.createTooltipComp(o,i)}hideTooltip(e){!e&&this.isInteractingWithTooltip||(this.tooltipComp&&(this.destroyTooltipComp(),$c=Date.now()),this.eventSvc.dispatchEvent({type:"tooltipHide",parentGui:this.tooltipCtrl.getGui()}),e&&(this.isInteractingWithTooltip=!1),this.setToDoNothing(!0))}newTooltipComponentCallback(e,t){if(this.state!==2||this.tooltipInstanceCount!==e){this.destroyBean(t);return}const i=t.getGui();this.tooltipComp=t,i.classList.contains("ag-tooltip")||i.classList.add("ag-tooltip-custom"),this.tooltipTrigger===0&&i.classList.add("ag-tooltip-animate"),this.interactionEnabled&&i.classList.add("ag-tooltip-interactive");const s=this.getLocaleTextFunc(),n=this.popupSvc?.addPopup({eChild:i,ariaLabel:s("ariaLabelTooltip","Tooltip")});if(n&&(this.tooltipPopupDestroyFunc=n.hideFunc),this.positionTooltip(),this.tooltipTrigger===1){const r=()=>this.setToDoNothing();[this.onBodyScrollEventCallback]=this.addManagedEventListeners({bodyScroll:r}),this.setEventHandlers(r)}this.interactionEnabled&&([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(i,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),[this.onDocumentKeyDownCallback]=this.addManagedElementListeners(Pe(this.beans),{keydown:r=>{i.contains(r?.target)||this.onKeyDown()}}),this.tooltipTrigger===1&&([this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(i,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}))),this.eventSvc.dispatchEvent({type:"tooltipShow",tooltipGui:i,parentGui:this.tooltipCtrl.getGui()}),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,this.lockService())}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){const e=this.tooltipComp?.getGui(),t=ve(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=this.tooltipTrigger===0?eE: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(){Fs=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},Uc)}unlockService(){Fs=!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()}},oE=class extends lg{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){this.tooltipMode===1&&(e.highlighted?this.attemptToShowTooltip():this.attemptToHideTooltip())}setTooltipMode(e="focus"){this.tooltipMode=e==="focus"?1:0}destroy(){this.highlightTracker.removeEventListener("itemHighlighted",this.onHighlight),super.destroy()}},iE=class extends Ha{constructor(){super({tag:"div",cls:"ag-tooltip"})}init(e){const{value:t}=e,o=this.getGui();o.textContent=Ei(t);const i=e.location.replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase();o.classList.add(`ag-${i}-tooltip`)}},sE=".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}}",Es=0,nE=200,rE=class extends qe{constructor(){super(...arguments),this.beanName="popupSvc",this.popupList=[]}postConstruct(){this.addManagedEventListeners({stylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){const e=this.gos.get("popupParent");return e||this.getDefaultPopupParent()}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:o,nudgeY:i,skipObserver:s}=e;this.positionPopup({ePopup:t,nudgeX:o,nudgeY:i,keepWithinBounds:!0,skipObserver:s,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:i,keepWithinBounds:s,eventSource:n,alignSide:r="left",position:a="over",type:l}=e,c=n.getBoundingClientRect(),d=this.getParentRect();this.setAlignedTo(n,t);const u=()=>{let h=c.left-d.left;r==="right"&&(h-=t.offsetWidth-c.width);let g;return a==="over"?(g=c.top-d.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),this.shouldRenderUnderOrAbove(t,c,d,e.nudgeY||0)==="under"?g=c.top-d.top+c.height:g=c.top-t.offsetHeight-(i||0)*2-d.top),{x:h,y:g}};this.positionPopup({ePopup:t,nudgeX:o,nudgeY:i,keepWithinBounds:s,updatePosition:u,postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,l,t,n,null)})}positionPopupForMenu(e){const{eventSource:t,ePopup:o,event:i}=e,s=t.getBoundingClientRect(),n=this.getParentRect();this.setAlignedTo(t,o);let r=!1;const a=()=>{const l=this.keepXYWithinBounds(o,s.top-n.top,0),c=o.clientWidth>0?o.clientWidth:200;r||(o.style.minWidth=`${c}px`,r=!0);const u=n.right-n.left-c;let h;return this.gos.get("enableRtl")?(h=f(),h<0&&(h=g(),this.setAlignedStyles(o,"left")),h>u&&(h=0,this.setAlignedStyles(o,"right"))):(h=g(),h>u&&(h=f(),this.setAlignedStyles(o,"right")),h<0&&(h=0,this.setAlignedStyles(o,"left"))),{x:h,y:l};function g(){return s.right-n.left-2}function f(){return s.left-n.left-c}};this.positionPopup({ePopup:o,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,"subMenu",o,t,i instanceof MouseEvent?i:void 0)})}shouldRenderUnderOrAbove(e,t,o,i){const s=o.bottom-t.bottom,n=t.top-o.top,r=e.offsetHeight+i;return s>r?"under":n>r||n>s?"above":"under"}setAlignedStyles(e,t){const o=this.getPopupIndex(e);if(o===-1)return;const i=this.popupList[o],{alignedToElement:s}=i;if(!s)return;const n=["right","left","over","above","under"];for(const r of n)s.classList.remove(`ag-has-popup-positioned-${r}`),e.classList.remove(`ag-popup-positioned-${r}`);t&&(s.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}setAlignedTo(e,t){const o=this.getPopupIndex(t);if(o!==-1){const i=this.popupList[o];i.alignedToElement=e}}positionPopup(e){const{ePopup:t,keepWithinBounds:o,nudgeX:i,nudgeY:s,skipObserver:n,updatePosition:r}=e,a={width:0,height:0},l=(c=!1)=>{let{x:d,y:u}=r();c&&t.clientWidth===a.width&&t.clientHeight===a.height||(a.width=t.clientWidth,a.height=t.clientHeight,i&&(d+=i),s&&(u+=s),o&&(d=this.keepXYWithinBounds(t,d,1),u=this.keepXYWithinBounds(t,u,0)),t.style.left=`${d}px`,t.style.top=`${u}px`,e.postProcessCallback&&e.postProcessCallback())};if(l(),!n){const c=Kt(this.beans,t,()=>l(!0));setTimeout(()=>c(),nE)}}getParentRect(){const e=Pe(this.beans);let t=this.getPopupParent();return t===e.body?t=e.documentElement:getComputedStyle(t).position==="static"&&(t=t.offsetParent),Od(t)}keepXYWithinBounds(e,t,o){const i=o===0,s=i?"clientHeight":"clientWidth",n=i?"top":"left",r=i?"height":"width",a=i?"scrollTop":"scrollLeft",l=Pe(this.beans),c=l.documentElement,d=this.getPopupParent(),u=e.getBoundingClientRect(),h=d.getBoundingClientRect(),g=l.documentElement.getBoundingClientRect(),f=d===l.body,m=Math.ceil(u[r]);let v=f?(i?Ld:_s)(c)+c[a]:d[s];f&&(v-=Math.abs(g[n]-h[n]));const w=v-m;return Math.min(Math.max(t,0),Math.max(w,0))}addPopup(e){const{eChild:t,ariaLabel:o,ariaOwns:i,alwaysOnTop:s,positionCallback:n,anchorToElement:r}=e,a=this.getPopupIndex(t);if(a!==-1)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(t);const l=this.createPopupWrapper(t,!!s,o,i),c=this.addEventListenersToPopup({...e,wrapperEl:l});return n&&n(),this.addPopupToPopupList(t,l,c,r),{hideFunc:c}}initialisePopupPosition(e){const o=this.getPopupParent().getBoundingClientRect();O(e.style.top)||(e.style.top=`${o.top*-1}px`),O(e.style.left)||(e.style.left=`${o.left*-1}px`)}createPopupWrapper(e,t,o,i){const s=this.getPopupParent(),{environment:n,gos:r}=this.beans,a=Lo({tag:"div"});return n.applyThemeClasses(a),a.classList.add("ag-popup"),e.classList.add(r.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||ko(e,"dialog"),o?Ci(e,o):i&&(e.id||(e.id=`popup-component-${Es}`),Tl(i,e.id)),a.appendChild(e),s.appendChild(a),t?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),a}addEventListenersToPopup(e){const t=this.beans,o=Pe(t),{wrapperEl:i,eChild:s,closedCallback:n,afterGuiAttached:r,closeOnEsc:a,modal:l,ariaOwns:c}=e;let d=!1;const u=m=>{if(!i.contains(ve(t)))return;m.key===R.ESCAPE&&!this.isStopPropagation(m)&&f({keyboardEvent:m})},h=m=>f({mouseEvent:m}),g=m=>f({touchEvent:m}),f=(m={})=>{const{mouseEvent:C,touchEvent:v,keyboardEvent:w,forceHide:b}=m;!b&&(this.isEventFromCurrentPopup({mouseEvent:C,touchEvent:v},s)||d)||(d=!0,i.remove(),o.removeEventListener("keydown",u),o.removeEventListener("mousedown",h),o.removeEventListener("touchstart",g),o.removeEventListener("contextmenu",h),this.eventSvc.removeListener("dragStarted",h),n&&n(C||v||w),this.removePopupFromPopupList(s,c))};return r&&r({hidePopup:f}),window.setTimeout(()=>{a&&o.addEventListener("keydown",u),l&&(o.addEventListener("mousedown",h),this.eventSvc.addListener("dragStarted",h),o.addEventListener("touchstart",g),o.addEventListener("contextmenu",h))},0),f}addPopupToPopupList(e,t,o,i){this.popupList.push({element:e,wrapper:t,hideFunc:o,instanceId:Es,isAnchored:!!i}),i&&this.setPopupPositionRelatedToElement(e,i),Es=Es+1}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const o=this.getPopupIndex(e);if(o===-1)return;const i=this.popupList[o];if(i.stopAnchoringPromise&&i.stopAnchoringPromise.then(n=>n&&n()),i.stopAnchoringPromise=void 0,i.isAnchored=!1,!t)return;const s=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:i.hideFunc});return i.stopAnchoringPromise=s,i.isAnchored=!0,s}removePopupFromPopupList(e,t){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),t&&Tl(t,null),this.popupList=this.popupList.filter(o=>o.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),o=t.getBoundingClientRect(),{element:i,ePopup:s}=e,n=i.getBoundingClientRect(),r=u=>Number.parseInt(u.substring(0,u.length-1),10),a=(u,h)=>{const g=o[u]-n[u],f=r(s.style[u]);return{initialDiff:g,lastDiff:g,initial:f,last:f,direction:h}},l=a("top",0),c=a("left",1),d=this.beans.frameworkOverrides;return new se(u=>{d.wrapIncoming(()=>{Rm(()=>{const h=t.getBoundingClientRect(),g=i.getBoundingClientRect();if(g.top==0&&g.left==0&&g.height==0&&g.width==0){e.hidePopup();return}const m=(C,v)=>{const w=r(s.style[v]);C.last!==w&&(C.initial=w,C.last=w);const b=h[v]-g[v];if(b!=C.lastDiff){const y=this.keepXYWithinBounds(s,C.initial+C.initialDiff-b,C.direction);s.style[v]=`${y}px`,C.last=y}C.lastDiff=b};m(l,"top"),m(c,"left")},200).then(h=>{u(()=>{h!=null&&window.clearInterval(h)})})},"popupPositioning")})}isEventFromCurrentPopup(e,t){const{mouseEvent:o,touchEvent:i}=e,s=o||i;if(!s)return!1;const n=this.getPopupIndex(t);if(n===-1)return!1;for(let r=n;r<this.popupList.length;r++){const a=this.popupList[r];if(Xp(a.element,s))return!0}return this.isElementWithinCustomPopup(s.target)}isElementWithinCustomPopup(e){const t=Pe(this.beans);for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||e.parentElement===null)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const o=this.getWrapper(e);o&&(o.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(o))}bringPopupToFront(e){const t=this.getPopupParent(),o=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),i=o.length,s=this.getWrapper(e);if(!s||i<=1||!t.contains(e))return;const n=[],r=[];for(const h of o)h!==s&&(h.classList.contains("ag-always-on-top")?r.push(h):n.push(h));const a=[],l=r.length,u=s.classList.contains("ag-always-on-top")||!l?[...n,...r,s]:[...n,s,...r];for(let h=0;h<=i;h++){const g=u[h];if(o[h]===u[h]||g===s)continue;const f=g.querySelectorAll("div");for(const m of f)m.scrollTop!==0&&a.push([m,m.scrollTop]);h===0?t.prepend(g):u[h-1].after(g)}for(;a.length;){const h=a.pop();h[0].scrollTop=h[1]}}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const o of this.popupList)t.applyThemeClasses(o.wrapper)}}},aE=class extends rE{getDefaultPopupParent(){return this.beans.ctrlsSvc.get("gridCtrl").getGui()}callPostProcessPopup(e,t,o,i,s){const n=this.gos.getCallback("postProcessPopup");if(n){const{column:r,rowNode:a}=e??{};n({column:r,rowNode:a,ePopup:o,type:t,eventSource:i,mouseEvent:s})}}getActivePopups(){return this.popupList.map(e=>e.element)}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return zt(e)}},Tn={moduleName:"Popup",version:L,beans:[aE]};function Jr(e){return e.get("tooltipShowMode")==="whenTruncated"}var lE=(e,t)=>{const o=e;return typeof o.getTranslatedMessage=="function"?o.getTranslatedMessage(t):e.message},Xr=(e,t,o)=>{const{editModelSvc:i}=e,s=i?.getCellValidationModel()?.getCellValidation(t)?.errorMessages,n=i?.getRowValidationModel().getRowValidation(t)?.errorMessages,r=s||n;return r?.length?r.join(o("tooltipValidationErrorSeparator",". ")):void 0},cE=(e,t)=>{if(Jr(e.gos)){if(t.isCellRenderer()){const i=t.column.getColDef();return!!i.showRowGroup||i.cellRenderer==="agGroupCellRenderer"?Ji(()=>{const n=t.eGui;return n.querySelector(".ag-group-value")||n.querySelector(".ag-cell-value")||n}):void 0}return Ji(()=>{const i=t.eGui;return i.children.length===0?i:i.querySelector(".ag-cell-value")})}},dE=(e,t,o)=>{const{editSvc:i}=e,{column:s}=t,n=cE(e,t),r=()=>i?.isEditing(t)?!1:n?s.isTooltipEnabled()?n():!1:!0;return{shouldDisplayDefault:r,shouldDisplayColumnTooltip:r,shouldDisplayCustomTooltip:o??r}},uE=({beans:e,ctrl:t,value:o,displayFunctions:i,translate:s})=>{const{editSvc:n,formula:r,gos:a}=e,{column:l,rowNode:c}=t;if(r?.active&&l.isAllowFormula()){const C=r.getFormulaError(l,c);if(C)return{value:lE(C,s),location:"cellFormula",shouldDisplay:()=>!!r?.getFormulaError(l,c)}}if(!!!n?.isEditing(t)){const C=Xr(e,t,s);if(C)return{value:C,location:"cellEditor",shouldDisplay:()=>!n?.isEditing(t)&&!!Xr(e,t,s)}}const{shouldDisplayCustomTooltip:u,shouldDisplayColumnTooltip:h}=i;if(o!=null)return{value:o,location:"cell",shouldDisplay:u};const g=l.getColDef(),f=c.data;if(g.tooltipField&&O(f))return{value:_i(f,g.tooltipField,l.isTooltipFieldContainsDots()),location:"cell",shouldDisplay:h};const m=g.tooltipValueGetter;return m?{value:m(K(a,{location:"cell",colDef:l.getColDef(),column:l,rowIndex:t.cellPosition.rowIndex,node:c,data:c.data,value:t.value,valueFormatted:t.valueFormatted})),location:"cell",shouldDisplay:h}:null},hE=class extends x{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,o,i){e&&t.destroyBean(e);const s=this.gos,n=Jr(s),{column:r,eGui:a}=t,l=r.getColDef();!i&&n&&!l.headerComponent&&(i=Ji(()=>a.querySelector(".ag-header-cell-text")));const c="header",u=this.beans.colNames.getDisplayNameForColumn(r,"header",!0),h=o??u,g={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>o??l?.headerTooltipValueGetter?.(K(s,{location:c,colDef:l,column:r,value:h,valueFormatted:u}))??l?.headerTooltip,shouldDisplayTooltip:i,getAdditionalParams:()=>({column:r,colDef:r.getColDef()})};let f=this.createTooltipFeature(g);return f&&(f=t.createBean(f),t.setRefreshFunction("tooltip",()=>f.refreshTooltip())),f}setupHeaderGroupTooltip(e,t,o,i){e&&t.destroyBean(e);const s=this.gos,n=Jr(s),{column:r,eGui:a}=t,l=r.getColGroupDef();!i&&n&&!l?.headerGroupComponent&&(i=Ji(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",u=this.beans.colNames.getDisplayNameForColumnGroup(r,"header"),h=o??u,g={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>o??l?.headerTooltipValueGetter?.(K(s,{location:c,colDef:l,column:r,value:h,valueFormatted:u}))??l?.headerTooltip,shouldDisplayTooltip:i,getAdditionalParams:()=>{const m={column:r};return l&&(m.colDef=l),m}},f=this.createTooltipFeature(g);return f&&t.createBean(f)}enableCellTooltipFeature(e,t,o){const{beans:i}=this,{column:s,rowNode:n}=e,r=dE(i,e,o),a=this.getLocaleTextFunc();let l=null;const c=()=>(l=uE({beans:i,ctrl:e,value:t,displayFunctions:r,translate:a}),l),u={getGui:()=>e.eGui,getLocation:()=>l?.location??"cell",getTooltipValue:()=>c()?.value,shouldDisplayTooltip:()=>{const h=l??c();return h?h.shouldDisplay?h.shouldDisplay():!0:!1},getAdditionalParams:()=>({column:s,colDef:s.getColDef(),rowIndex:e.cellPosition.rowIndex,node:n,data:n.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(u,i)}setupFullWidthRowTooltip(e,t,o,i){const s={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>o,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:i},n=this.beans,r=n.context;e&&t.destroyBean(e,r);const a=this.createTooltipFeature(s,n);if(a)return t.createBean(a,r)}setupCellEditorTooltip(e,t){const{beans:o}=this,{context:i}=o,s=t.getValidationElement?.(!0)||!t.isPopup?.()&&e.eGui;if(!s)return;const n={getGui:()=>s,getTooltipValue:()=>Xr(o,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{const{editModelSvc:a}=o,l=a?.getRowValidationModel()?.getRowValidationMap(),c=a?.getCellValidationModel()?.getCellValidationMap(),d=!!l&&l.size>0,u=!!c&&c.size>0;return d||u}},r=this.createTooltipFeature(n,o);if(r)return e.createBean(r,i)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=O(t.tooltipField)||O(t.tooltipValueGetter)||O(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},gE=class extends tE{createTooltipComp(e,t){Xm(this.beans.userCompFactory,e)?.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){this.onColumnMovedEventCallback?.(),this.onColumnMovedEventCallback=void 0}},cg={moduleName:"Tooltip",version:L,beans:[hE],dynamicBeans:{tooltipFeature:lg,highlightTooltipFeature:oE,tooltipStateManager:gE},userComponents:{agTooltipComponent:iE},dependsOn:[Tn],css:[sE]},Qo=class{constructor(e){this.cellValueChanges=e}},mr=class extends Qo{constructor(e,t,o,i){super(e),this.initialRange=t,this.finalRange=o,this.ranges=i}},pE=10,Kc=class{constructor(e){this.actionStack=[],this.maxStackSize=e||pE,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},fE=class extends x{constructor(){super(...arguments),this.beanName="undoRedo",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.batchEditing=!1,this.bulkEditing=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},o=this.activeCellEdit!==null&&Na(this.activeCellEdit,t),i=this.activeRowEdit!==null&&GC(this.activeRowEdit,t);if(!(o||i||this.isPasting||this.isRangeInAction))return;const{rowPinned:n,rowIndex:r,column:a,oldValue:l,value:c}=e,d={rowPinned:n,rowIndex:r,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(d)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const o=e.get("undoRedoCellEditingLimit");if(o<=0)return;this.undoStack=new Kc(o),this.redoStack=new Kc(o),this.addListeners();const i=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:s=>{s.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:i,newColumnsLoaded:i,columnGroupOpened:i,columnRowGroupChanged:i,columnMoved:i,columnPinned:i,columnVisible:i,rowDragEnd:i}),t.whenReady(this,s=>{this.gridBodyCtrl=s.gridBodyCtrl})}getCurrentUndoStackSize(){return this.undoStack?.getCurrentStackSize()??0}getCurrentRedoStackSize(){return this.redoStack?.getCurrentStackSize()??0}undo(e){const{eventSvc:t,undoStack:o,redoStack:i}=this;t.dispatchEvent({type:"undoStarted",source:e});const s=this.undoRedo(o,i,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:s})}redo(e){const{eventSvc:t,undoStack:o,redoStack:i}=this;t.dispatchEvent({type:"redoStarted",source:e});const s=this.undoRedo(i,o,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:s})}undoRedo(e,t,o,i,s){if(!e)return!1;const n=e.pop();return n?.cellValueChanges?(this.processAction(n,r=>r[i],s),n instanceof mr?this.processRange(n.ranges||[n[o]]):this.processCell(n.cellValueChanges),t.push(n),!0):!1}processAction(e,t,o){const{changeDetectionSvc:i}=this.beans;i?.beginDeferred();try{for(const s of e.cellValueChanges){const{rowIndex:n,rowPinned:r,columnId:a}=s,l={rowIndex:n,rowPinned:r},c=kt(this.beans,l);c?.displayed&&c.setDataValue(a,t(s),o)}}finally{i?.endDeferred()}}processRange(e){let t;const o=this.beans.rangeSvc;o.removeAllCellRanges(!0),e.forEach((i,s)=>{if(!i)return;const n=i.startRow,r=i.endRow;s===e.length-1&&(t={rowPinned:n.rowPinned,rowIndex:n.rowIndex,columnId:i.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:i.startColumn,columns:i.columns};o.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:o,rowPinned:i}=t,s={rowIndex:o,rowPinned:i},n=kt(this.beans,s),r={rowPinned:t.rowPinned,rowIndex:n.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r)}setLastFocusedCell(e){const{rowIndex:t,columnId:o,rowPinned:i}=e,{colModel:s,focusSvc:n,rangeSvc:r}=this.beans,a=s.getCol(o);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:i};n.setFocusedCell({...c,forceBrowserFocus:!0}),r?.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Qo(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const o=new Qo(this.cellValueChanges);this.pushActionsToUndoStack(o)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Qo(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new mr(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:o}=this.beans;t&&ao(o)?e=new mr(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Qo(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1},batchEditingStarted:()=>this.startBigChange("batchEditing"),batchEditingStopped:({changes:e})=>this.stopBigChange("batchEditing",e),bulkEditingStarted:()=>this.startBigChange("bulkEditing"),bulkEditingStopped:({changes:e})=>this.stopBigChange("bulkEditing",e)})}startBigChange(e){this.updateBigChange(e,!0)}updateBigChange(e,t){e==="bulkEditing"?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if(e==="bulkEditing"&&!this.bulkEditing||e==="batchEditing"&&!this.batchEditing||(this.updateBigChange(e,!1),t?.length===0))return;const o=new Qo(t??[]);this.pushActionsToUndoStack(o),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},mE=".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}",CE={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},vE=class extends En{constructor(){super(CE,[Ya]),this.eEditor=W}initialiseEditor(e){this.agSetEditValue(e.value),this.eEditor.getInputElement().setAttribute("tabindex","-1"),this.addManagedListeners(this.eEditor,{fieldValueChanged:o=>this.setAriaLabel(o.selected)})}agSetEditValue(e){this.params.value=e;const t=e??void 0;this.eEditor.setValue(t,!0),this.setAriaLabel(t)}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),o=Sn(t,e),i=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${i} (${o})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,o=this.getValue();return t?t({value:o,internalErrors:null,cellEditorParams:e}):null}},$t=class extends Fo{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=O(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(),va(t,o)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=o=>{_u(o)&&o.key&&!e.test(o.key)&&o.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:o=>{o.clipboardData?.getData("text")?.split("").some(s=>!e.test(s))&&o.preventDefault()}})}},In={selector:"AG-INPUT-TEXT-FIELD",component:$t},wE=class extends $t{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=po();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){ve(this.beans)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?$e(e??null,!!this.includeTime)??void 0:e;return this.min===t?this:(this.min=t,Qe(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?$e(e??null,!!this.includeTime)??void 0:e;return this.max===t?this:(this.max=t,Qe(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,Qe(this.eInput,"step",e),this)}setIncludeTime(e){return this.includeTime===e?this:(this.includeTime=e,super.setInputType(e?"datetime-local":"date"),e&&this.setStep(1),this)}getDate(){if(this.eInput.validity.valid)return Ke(this.getValue())??void 0}setDate(e,t){this.setValue($e(e??null,this.includeTime),t)}},dg={selector:"AG-INPUT-DATE-FIELD",component:wE},An=class extends En{constructor(e){super(),this.cellEditorInput=e,this.eEditor=W}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:i,eventKey:s,suppressPreventDefault:n}=e;o.getInputElement().setAttribute("title",""),t.init(o,e);let r,a=!0;i?(this.focusAfterAttached=!0,s===R.BACKSPACE||s===R.DELETE?r="":s&&s.length===1?n?a=!1:r=s:(r=t.getStartValue(),s!==R.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=t.getStartValue()),a&&r!=null&&o.setStartValue(r),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===R.PAGE_UP||c===R.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;po()||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()}},bE={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},SE=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return bE}getAgComponents(){return[dg]}init(e,t){this.eEditor=e,this.params=t;const{min:o,max:i,step:s,colDef:n}=t;o!=null&&e.setMin(o),i!=null&&e.setMax(i),s!=null&&e.setStep(s),this.includeTime=t.includeTime??this.getDataTypeService()?.getDateIncludesTimeFlag?.(n.cellDataType),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:o}=this,{min:i,max:s,getValidationErrors:n}=o;let r=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(i){const l=i instanceof Date?i:new Date(i);if(t<l){const c=l.toLocaleDateString();r.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(s){const l=s instanceof Date?s:new Date(s);if(t>l){const c=l.toLocaleDateString();r.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return r.length||(r=null),n?n({value:t,cellEditorParams:o,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,o=e.getDate();return!O(o)&&!O(t.value)?t.value:o??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return $e(e,this.includeTime??!1)}},yE=class extends An{constructor(){super(new SE(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},RE={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},FE=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return RE}getAgComponents(){return[dg]}init(e,t){this.eEditor=e,this.params=t;const{min:o,max:i,step:s,colDef:n}=t;o!=null&&e.setMin(o),i!=null&&e.setMax(i),s!=null&&e.setStep(s),this.includeTime=t.includeTime??this.getDataTypeService()?.getDateIncludesTimeFlag?.(n.cellDataType),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,o=e.getInputElement().value,i=this.formatDate(this.parseDate(o??void 0)),{min:s,max:n,getValidationErrors:r}=t;let a=[];if(i){const l=new Date(i),c=this.getLocaleTextFunc();if(s){const d=new Date(s);if(l<d){const u=d.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${u}`,[u]))}}if(n){const d=new Date(n);if(l>d){const u=d.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${u}`,[u]))}}}return a.length||(a=null),r?r({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,o=this.formatDate(t.getDate());return!O(o)&&!O(e.value)?e.value:e.parseValue(o??"")}getStartValue(){return $e(this.parseDate(this.params.value??void 0)??null,this.includeTime??!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):Ke(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):$e(e??null,this.includeTime??!1)??void 0}},EE=class extends An{constructor(){super(new FE(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},xE=class extends Fo{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const o=super.setValue(e,t);return this.eInput.value=e,o}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},PE={selector:"AG-INPUT-TEXT-AREA",component:xE},DE={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},ME=class extends En{constructor(){super(DE,[PE]),this.eEditor=W}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:o,eventKey:i,maxLength:s,cols:n,rows:r}=e;this.focusAfterAttached=o,t.getInputElement().setAttribute("title",""),t.setMaxLength(s||200).setCols(n||60).setRows(r||10);let a;o?(this.focusAfterAttached=!0,i===R.BACKSPACE||i===R.DELETE?a="":i&&i.length===1?a=i:(a=this.getStartValue(e),i!==R.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return t?.toString()??t}agSetEditValue(e){this.params.value=e;const t=this.getStartValue(this.params);this.eEditor.setValue(t??"",!0)}onKeyDown(e){const t=e.key;(t===R.LEFT||t===R.UP||t===R.RIGHT||t===R.DOWN||e.shiftKey&&t===R.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:o}=this,i=this.getLocaleTextFunc();e.setInputAriaLabel(i("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),o&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:o}=t,i=e.getValue();return!O(i)&&!O(o)?o:t.parseValue(i)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:o}=e,i=this.getLocaleTextFunc(),s=this.getValue();let n=[];return typeof s=="string"&&t!=null&&s.length>t&&n.push(i("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),n.length||(n=null),o?o({value:s,internalErrors:n,cellEditorParams:e}):n}},nl=class extends $t{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct();const e=this.eInput;this.addManagedListeners(e,{blur:()=>{const n=Number.parseFloat(e.value),r=isNaN(n)?"":this.normalizeValue(n.toString());this.value!==r&&this.setValue(r)},wheel:this.onWheel.bind(this)}),e.step="any";const{precision:t,min:o,max:i,step:s}=this.config;typeof t=="number"&&this.setPrecision(t),typeof o=="number"&&this.setMin(o),typeof i=="number"&&this.setMax(i),typeof s=="number"&&this.setStep(s)}onWheel(e){ve(this.beans)===this.eInput&&e.preventDefault()}normalizeValue(e){return e===""?"":(this.precision!=null&&(e=this.adjustPrecision(e)),e)}adjustPrecision(e,t){const o=this.precision;if(o==null)return e;if(t){const s=Number.parseFloat(e).toFixed(o);return Number.parseFloat(s).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=o)return e;if(o>0)return`${i[0]}.${i[1].slice(0,o)}`}return i[0]}setMin(e){return this.min===e?this:(this.min=e,Qe(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,Qe(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,Qe(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(o=>super.setValue(o,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,o){if(O(o)){let i=this.isScientificNotation(o);if(i&&this.eInput.validity.valid)return e(o);if(!i){o=this.adjustPrecision(o);const s=this.normalizeValue(o);i=o!=s}if(i)return t(o)}return e(o)}getValue(e=!1){const t=this.eInput;if(!t.validity.valid&&!e)return;const o=t.value;return this.isScientificNotation(o)?this.adjustPrecision(o,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},TE={selector:"AG-INPUT-NUMBER-FIELD",component:nl},IE={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},AE=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return IE}getAgComponents(){return[TE]}init(e,t){this.eEditor=e,this.params=t;const{max:o,min:i,precision:s,step:n}=t;o!=null&&e.setMax(o),i!=null&&e.setMin(i),s!=null&&e.setPrecision(s),n!=null&&e.setStep(n);const r=e.getInputElement();t.preventStepping?e.addManagedElementListeners(r,{keydown:this.preventStepping}):t.showStepperButtons&&r.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:o,getValidationErrors:i}=e,n=this.eEditor.getInputElement().valueAsNumber,r=this.getLocaleTextFunc();let a=[];return typeof n=="number"&&(t!=null&&n<t&&a.push(r("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),o!=null&&n>o&&a.push(r("maxValueValidation",`Must be less than or equal to ${o}.`,[String(o)]))),a.length||(a=null),i?i({value:n,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===R.UP||e.key===R.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,o=e.getValue();if(!O(o)&&!O(t.value))return t.value;let i=t.parseValue(o);if(i==null)return i;if(typeof i=="string"){if(i==="")return null;i=Number(i)}return isNaN(i)?null:i}getStartValue(){return this.params.value}setCaret(){po()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},kE=class extends An{constructor(){super(new AE(()=>this.getLocaleTextFunc()))}},LE=".ag-list-item{align-items:center;display:flex;height:var(--ag-list-item-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}",OE="ag-active-item",GE=(e,t)=>({tag:"div",cls:`ag-list-item ag-${e}-list-item`,attrs:{role:"option"},children:[{tag:"span",cls:`ag-list-item-text ag-${e}-list-item-text`,ref:"eText",children:t}]}),HE=class extends Pi{constructor(e,t,o){super(GE(e,t)),this.label=t,this.value=o,this.eText=W}postConstruct(){this.createTooltip(),this.addEventListeners()}setHighlighted(e){const t=this.getGui();t.classList.toggle(OE,e),Ad(t,e),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:e})}getHeight(){return this.getGui().clientHeight}setIndex(e,t){const o=this.getGui();Bp(o,e),Hp(o,t)}createTooltip(){const e={getTooltipValue:()=>this.label,getGui:()=>this.getGui(),getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>Hd(this.eText)},t=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("highlightTooltipFeature",!1,e,this));t&&(this.tooltipFeature=t)}addEventListeners(){const e=this.getParentComponent();e&&(this.addGuiEventListener("mouseover",()=>{e.highlightItem(this)}),this.addGuiEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),e.setValue(this.value)}))}},BE=class extends Pi{constructor(e="default"){super({tag:"div",cls:`ag-list ag-${e}-list`}),this.cssIdentifier=e,this.options=[],this.listItems=[],this.highlightedItem=null,this.registerCSS(LE)}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()})}handleKeyDown(e){const t=e.key;switch(t){case R.ENTER:if(!this.highlightedItem)this.setValue(this.getValue());else{const o=this.listItems.indexOf(this.highlightedItem);this.setValueByIndex(o)}break;case R.DOWN:case R.UP:e.preventDefault(),this.navigate(t);break;case R.PAGE_DOWN:case R.PAGE_UP:case R.PAGE_HOME:case R.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){const{value:t,text:o}=e,i=o??t;return this.options.push({value:t,text:i}),this.renderOption(t,i),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0);for(const e of this.listItems)e.destroy();Xe(this.getGui()),this.listItems=[],this.refreshAriaRole()}updateOptions(e){const t=this.options!==e;return t&&(this.clearOptions(),this.addOptions(e)),t}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;const o=this.options.findIndex(i=>i.value===e);if(o!==-1){const i=this.options[o];this.value=i.value,this.displayValue=i.text,this.highlightItem(this.listItems[o]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(t=>t.value===this.value);e!==-1&&this.highlightItem(this.listItems[e])}highlightItem(e){const t=e.getGui();if(!vt(t))return;this.clearHighlighted(),e.setHighlighted(!0),this.highlightedItem=e;const o=this.getGui(),{scrollTop:i,clientHeight:s}=o,{offsetTop:n,offsetHeight:r}=t;(n+r>i+s||n<i)&&t.scrollIntoView({block:"nearest"})}hideItemTooltip(){this.highlightedItem?.tooltipFeature?.attemptToHideTooltip()}destroy(){this.hideItemTooltip(),super.destroy()}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}clearHighlighted(){this.highlightedItem?.setHighlighted(!1),this.highlightedItem=null}renderOption(e,t){const o=new HE(this.cssIdentifier,t,e);o.setParentComponent(this);const i=this.createManagedBean(o);this.listItems.push(i),this.getGui().appendChild(i.getGui())}navigate(e){const t=e===R.DOWN;let o;const{listItems:i,highlightedItem:s}=this;if(!s)o=t?i[0]:he(i);else{let r=i.indexOf(s)+(t?1:-1);r=Math.min(Math.max(r,0),i.length-1),o=i[r]}this.highlightItem(o)}navigateToPage(e){const{listItems:t,highlightedItem:o}=this;if(!o||t.length===0)return;const i=t.indexOf(o),s=this.options.length-1,n=t[0].getHeight(),r=Math.floor(this.getGui().clientHeight/n);let a=-1;e===R.PAGE_HOME?a=0:e===R.PAGE_END?a=s:e===R.PAGE_DOWN?a=Math.min(i+r,s):e===R.PAGE_UP&&(a=Math.max(i-r,0)),a!==-1&&this.highlightItem(t[a])}refreshAriaRole(){ko(this.getGui(),this.options.length===0?"presentation":"listbox")}updateIndices(){this.refreshAriaRole();const e=this.listItems,t=e.length;e.forEach((o,i)=>{o.setIndex(i+1,t)})}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},VE=".ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-picker-button-background-color);border:var(--ag-picker-button-border);border-radius:5px;min-height:max(var(--ag-list-item-height),calc(var(--ag-spacing)*4));overflow:hidden;&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}}.ag-picker-field-wrapper:where(.ag-picker-has-focus),.ag-picker-field-wrapper:where(:focus-within){background-color:var(--ag-picker-button-focus-background-color);border:var(--ag-picker-button-focus-border);box-shadow:var(--ag-focus-shadow);&:where(.invalid){box-shadow:var(--ag-focus-error-shadow)}}.ag-picker-field-wrapper:disabled{opacity:.5}",NE={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-field-wrapper ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},WE=class extends ph{constructor(e){if(super(e,e?.template||NE,e?.agComponents||[],e?.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=W,this.eWrapper=W,this.eDisplayField=W,this.eIcon=W,this.registerCSS(VE),this.ariaRole=e?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:o,variableWidth:i,minPickerWidth:s,maxPickerWidth:n}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!i,o!=null&&this.setPickerMaxHeight(o),s!=null&&this.setPickerMinWidth(s),n!=null&&this.setPickerMaxWidth(n)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:o,inputWidth:i}=this.config;if(o){const s=this.beans.iconSvc.createIconNoSpan(o);s&&this.eIcon.appendChild(s)}i!=null&&this.setInputWidth(i)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),Er(e,!1),this.ariaRole&&ko(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&e?.target===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case R.UP:case R.DOWN:case R.ENTER:case R.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case R.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const t=this.getLocaleTextFunc(),{config:{pickerAriaLabelKey:o,pickerAriaLabelValue:i,modalPicker:s=!0},maxPickerHeight:n,minPickerWidth:r,maxPickerWidth:a,variableWidth:l,beans:c,eWrapper:d}=this,u={modal:s,eChild:e,closeOnEsc:!0,closedCallback:()=>{const m=fa(c);this.beforeHidePicker(),m&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(o,i),anchorToElement:d};e.style.position="absolute";const h=c.popupSvc,g=h.addPopup(u);l?(r&&(e.style.minWidth=r),e.style.width=ya(_s(d)),a&&(e.style.maxWidth=a)):Ks(e,a??_s(d));const f=n??`${ba(h.getPopupParent())}px`;return e.style.setProperty("max-height",f),this.alignPickerToComponent(),g.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerGap:e,config:{pickerType:t},beans:{popupSvc:o,gos:i},eWrapper:s,pickerComponent:n}=this,r=i.get("enableRtl")?"right":"left";o.positionPopupByComponent({type:t,eventSource:s,ePopup:n.getGui(),position:"under",alignSide:r,keepWithinBounds:!0,nudgeY:e})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();Er(t,e);const o=this.eWrapper.classList;o.toggle("ag-picker-expanded",e),o.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){this.pickerComponent?.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&(this.hideCurrentPicker(),this.dispatchLocalEvent({type:"pickerHidden"}))}setInputWidth(e){return Ks(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}},zE=".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}.ag-select:where(:not(.ag-cell-editor,.ag-label-align-top)){min-height:var(--ag-list-item-height)}:where(.ag-select){.ag-picker-field-wrapper{cursor:default;padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}.ag-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}:where(.ag-ltr) .ag-select-list-item{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-select-list-item{padding-right:var(--ag-spacing)}.ag-select-list-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",rl=class extends WE{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"selectOpen",ariaRole:"combobox",...e}),this.registerCSS(zE)}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{shouldDisplayTooltip:Ji(()=>this.eDisplayField),getGui:()=>this.getGui()})),super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:o}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),o&&t==null&&(this.eDisplayField.textContent=o),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){const e=this.createBean(new BE("select"));this.listComponent=e,e.setParentComponent(this);const t=e.getAriaElement(),o=`ag-select-list-${e.getCompId()}`;t.setAttribute("id",o),Kp(this.getAriaElement(),t),e.addManagedElementListeners(e.getGui(),{mousedown:i=>{i?.preventDefault()}}),e.addManagedListeners(e,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})},fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}beforeHidePicker(){this.listComponent?.hideItemTooltip(),super.beforeHidePicker()}onKeyDown(e){const{key:t}=e;switch(t===R.TAB&&this.hidePicker(),t){case R.ENTER:case R.UP:case R.DOWN:case R.PAGE_UP:case R.PAGE_DOWN:case R.PAGE_HOME:case R.PAGE_END:e.preventDefault(),this.isPickerDisplayed?this.listComponent?.handleKeyDown(e):super.onKeyDown(e);break;case R.ESCAPE:super.onKeyDown(e);break;case R.SPACE:this.isPickerDisplayed?e.preventDefault():super.onKeyDown(e);break}}showPicker(){const e=this.listComponent;e&&(super.showPicker(),e.refreshHighlighted())}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){return this.listComponent?.clearOptions(),this.setValue(void 0,!0),this}updateOptions(e){return this.listComponent?.updateOptions(e)&&this.setValue(void 0,!0),this}setValue(e,t,o){const{listComponent:i,config:{placeholder:s},eDisplayField:n,tooltipFeature:r}=this;if(this.value===e||!i)return this;if(o||i.setValue(e,!0),i.getValue()===this.getValue())return this;let l=i.getDisplayValue();return l==null&&s&&(l=s),n.textContent=l,r?.setTooltipAndRefresh(l??null),super.setValue(e,t)}destroy(){this.listComponent=this.destroyBean(this.listComponent),super.destroy()}},_E={selector:"AG-SELECT",component:rl},UE={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},$E=class extends En{constructor(){super(UE,[_E]),this.eEditor=W,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:o,gos:i}=this,{values:s,value:n,eventKey:r}=e;if(we(s)){D(58);return}this.startedByEnter=r!=null?r===R.ENTER:!1;let a=!1;s.forEach(u=>{const h={value:u},g=o.formatValue(e.column,null,u),f=g!=null;h.text=f?g:u,t.addOption(h),a=a||n===u}),a?t.setValue(e.value??void 0,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:d}=e;l!=null&&t.setPickerGap(l),d!=null&&t.setPickerMaxHeight(d),c!=null&&t.setPickerMaxWidth(c),i.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}agSetEditValue(e){this.params.value=e,this.eEditor.setValue(e??void 0,!0)}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:o}=e,i=this.getValue();let s=[];if(t&&i!=null&&!t.includes(i)){const n=this.getLocaleTextFunc();s.push(n("invalidSelectionValidation","Invalid selection."))}else s=null;return o?o({value:i,internalErrors:s,cellEditorParams:e}):s}},KE={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},qE=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return KE}getAgComponents(){return[In]}init(e,t){this.eEditor=e,this.params=t;const o=t.maxLength;o!=null&&e.setMaxLength(o)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:o}=e,i=this.getValue(),s=this.getLocaleTextFunc();let n=[];return t!=null&&typeof i=="string"&&i.length>t&&n.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),n.length||(n=null),o?o({value:i,cellEditorParams:e,internalErrors:n}):n}getValue(){const{eEditor:e,params:t}=this,o=e.getValue();return!O(o)&&!O(t.value)?t.value:t.parseValue(o)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){po()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),o=O(t)&&t.length||0;o&&e.getInputElement().setSelectionRange(o,o)}},qc=class extends An{constructor(){super(new qE(()=>this.getLocaleTextFunc()))}};function jE(e){e.undoRedo?.undo("api")}function YE(e){e.undoRedo?.redo("api")}function QE(e,t){return e.editModelSvc?.getEditRowDataValue(t,{checkSiblings:!0})}function ZE(e){const t=e.editModelSvc?.getEditMap(),o=[];return t?.forEach((i,s)=>{const{rowIndex:n,rowPinned:r}=s;i.forEach((a,l)=>{const{editorValue:c,pendingValue:d,sourceValue:u,state:h}=a,g=mt(a);let f=c??d;f===Ie&&(f=void 0);const m={newValue:f,oldValue:u,state:h,column:l,colId:l.getColId(),colKey:l.getColId(),rowIndex:n,rowPinned:r},C=h==="editing";(C||!C&&g)&&o.push(m)})}),o}function JE(e,t=!1){const{editSvc:o}=e;if(o?.isBatchEditing()){if(t)for(const i of e.editModelSvc?.getEditPositions()??[])i.state==="editing"&&o.revertSingleCellEdit(i);else io(e,{persist:!0});eo(e,void 0,{cancel:t})}else o?.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function XE(e,t){const o=re(e,t);return!!e.editSvc?.isEditing(o)}function ex(e,t){const{key:o,colKey:i,rowIndex:s,rowPinned:n}=t,{editSvc:r,colModel:a}=e,l=a.getCol(i);if(!l){D(12,{colKey:i});return}const d=kt(e,{rowIndex:s,rowPinned:n||null});if(!d){D(290,{rowIndex:s,rowPinned:n});return}if(!r?.isCellEditable({rowNode:d,column:l},"api"))return;n==null&&tg(e,s),eg(e,i),r?.startEditing({rowNode:d,column:l},{event:o?new KeyboardEvent("keydown",{key:o}):void 0,source:"api",editable:!0})}function tx(e){return e.editSvc?.validateEdit()||null}function ox(e){return e.undoRedo?.getCurrentUndoStackSize()??0}function ix(e){return e.undoRedo?.getCurrentRedoStackSize()??0}var sx={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},nx=class extends Ha{constructor(e){super(sx),this.params=e}postConstruct(){Go(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,o=i=>{Nr(this.gos,i,t.node,t.column,!0)||t.onKeyDown(i)};this.addManagedElementListeners(e,{keydown:o})}};function rx(e,{column:t},o,i,s="ui"){if(o instanceof KeyboardEvent&&(o.key===R.TAB||o.key===R.ENTER||o.key===R.F2||o.key===R.BACKSPACE&&i))return!0;if(o?.shiftKey&&e.rangeSvc?.getCellRanges().length!=0)return!1;const r=t?.getColDef(),a=ax(e.gos,r),l=o?.type;return l==="click"&&o?.detail===1&&a===1||l==="dblclick"&&o?.detail===2&&a===2?!0:s==="api"?!!i:!1}function ax(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t?.singleClickEdit?1:2}function Cr(e,t){return e.editModelSvc?.hasEdits(t,{withOpenEditor:!0})??!1}function ea(e,t){const o=t.column,i=t.rowNode,s=o.getColDef();if(!i)return Cr(e,t);const n=s.editable;return i.group&&s.groupRowEditable!=null?e.rowGroupingEditValueSvc?.isGroupCellEditable(i,o)?!0:Cr(e,t):o.isColumnFunc(i,n)?!0:Cr(e,t)}function lx(e,t,o="ui"){const i=ea(e,t);if(i||o==="ui")return i;const{rowNode:s,column:n}=t;for(const r of e.colModel.getCols())if(r!==n&&ea(e,{rowNode:s,column:r}))return!0;return!1}var gn=(e,t=!1)=>{if(e!==void 0)return mt(e)||t&&e.state==="editing"};function ug(e,t,o=!1){return gn(e.editModelSvc?.getEdit(t),o)}var hg=(e,t,o)=>{if(e)for(let i=0,s=e.length;i<s;++i){const n=e[i];if(n.data&&(gn(t?.getEdit({rowNode:n,column:o}))||gn(t?.getEdit({rowNode:n.pinnedSibling,column:o})))||hg(n.childrenAfterGroup,t,o))return!0}};function gg(e,t){const{column:o,rowNode:i}=t;return e.gos.get("groupTotalRow")&&!i?.footer?!1:hg(i?.childrenAfterGroup,e.editModelSvc,o)}function pg(e,{rowNode:t,column:o}){if(t=t.pinnedSibling,!!t)return gn(e.editModelSvc?.getEdit({rowNode:t,column:o}))}var cx=class extends x{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){const{cellCtrl:e,editSvc:t,beans:o}=this;if(t?.isBatchEditing()&&t.isEditing()){const s=ug(o,e)||gg(o,e)||pg(o,e);this.applyBatchingStyle(s)}else this.applyBatchingStyle(!1);const i=!!this.editModelSvc?.getCellValidationModel().hasCellValidation(this.cellCtrl);this.cellComp.toggleCss("ag-cell-editing-error",i)}applyBatchingStyle(e){this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&this.editSvc?.isBatchEditing())??!1)}},dx=class extends x{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){const{rowCtrl:e,editModelSvc:t,beans:o}=this;let i=e.rowNode,s=t?.getEditRow(i);const n=this.editModelSvc?.getRowValidationModel().hasRowValidation({rowNode:i});if(!s&&i.pinnedSibling&&(i=i.pinnedSibling,s=t?.getEditRow(i)),s){const r=Array.from(s.keys()).some(a=>{const l={rowNode:i,column:a};return ug(o,l,!0)||gg(o,l)||pg(o,l)});this.applyStyle(n,r);return}this.applyStyle(n)}applyStyle(e=!1,t=!1){const o=!!this.editSvc?.isBatchEditing(),i=this.gos.get("editType")==="fullRow";this.rowCtrl?.forEachGui(void 0,({rowComp:s})=>{s.toggleCss("ag-row-editing",i&&t),s.toggleCss("ag-row-batch-edit",i&&t&&o),s.toggleCss("ag-row-inline-editing",t),s.toggleCss("ag-row-not-inline-editing",!t),s.toggleCss("ag-row-editing-invalid",i&&t&&e)})}},ux=({rowModel:e,pinnedRowModel:t,editModelSvc:o},i)=>{const s=new Set;e.forEachNode(n=>i.has(n)&&s.add(n)),t?.forEachPinnedRow("top",n=>i.has(n)&&s.add(n)),t?.forEachPinnedRow("bottom",n=>i.has(n)&&s.add(n));for(const n of i)s.has(n)||o.removeEdits({rowNode:n});return s},hx=({editModelSvc:e},t,o)=>{for(const i of t)e?.getEditRow(i)?.forEach((s,n)=>!o.has(n)&&e.removeEdits({rowNode:i,column:n}))},gx=e=>()=>{const t=new Set(e.colModel.getCols()),o=e.editModelSvc.getEditMap(!0),i=new Set(o.keys());hx(e,ux(e,i),t)},px=new Set(["undo","redo","paste","bulk","rangeSvc"]),fx=new Set(["ui","api"]),fg={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},mx=new Set(Object.keys(fg)),Cx=new Set(["paste","rangeSvc","cellClear","redo","undo"]),vr={cancel:!0,source:"api"},vx={cancel:!1,source:"api"},wo={checkSiblings:!0},Zt={force:!0,suppressFlash:!0},wx={force:!0},bx=class extends x{constructor(){super(...arguments),this.beanName="editSvc",this.committing=!1,this.batch=!1,this.batchStartDispatched=!1,this.stopping=!1,this.rangeSelectionWhileEditing=0}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:i})=>{this.stopEditing(void 0,vr),this.createStrategy(i)});const t=gx(e),o=()=>{const i=this.model.getCellValidationModel().getCellValidationMap().size>0,s=this.model.getRowValidationModel().getRowValidationMap().size>0;return i||s?this.stopEditing(void 0,vr):this.isEditing()&&(this.batch?eo(e,this.model.getEditPositions()):this.stopEditing(void 0,vx)),!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,vr))}stopBatchEditing(e){this.batch&&(e&&this.stopEditing(void 0,e),this.batchStartDispatched&&this.dispatchBatchStopped(new Map,!1),this.batch=!1,this.batchStartDispatched=!1)}ensureBatchStarted(){!this.batch||this.batchStartDispatched||(this.batchStartDispatched=!0,this.dispatchBatchEvent("batchEditingStarted",new Map))}createStrategy(e){const{beans:t,gos:o,strategy:i}=this,s=jc(o,e);if(i){if(i.beanName===s)return i;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(s,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,o,i="ui"){const s=rx(this.beans,e,t,o,i);return s&&(this.strategy??(this.strategy=this.createStrategy())),s}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 oR(this.beans)}isEditing(e,t){return this.model.hasEdits(e??void 0,t??wo)}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:i=null,source:s="ui",ignoreEventKey:n=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!(t.editable??this.isCellEditable(e,"api")))return;const l=re(this.beans,e);if(l&&!l.comp){t.editable=void 0,l.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const c=this.shouldStartEditing(e,i,o,s);if(c===!1&&s!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,s)&&!t.continueEditing&&this.stopEditing(void 0,{source:s}),c&&this.ensureBatchStarted(),this.strategy.start({position:e,event:i,source:s,ignoreEventKey:n,startedEdit:o,silent:r})}stopEditing(e,t){const o=this.prepareStopContext(e,t);if(!o)return!1;this.stopping=!0;let i=!1,{edits:s}=o;try{const n=this.processStopRequest(o);return i||(i=n.res),s=n.edits,this.finishStopEditing({...o,edits:s,params:t,position:e,res:i}),i}finally{this.rangeSelectionWhileEditing=0,this.stopping=!1}}prepareStopContext(e,t){const{event:o=null,cancel:i=!1,source:s="ui",forceCancel:n=!1,forceStop:r=!1,commit:a=!1}=t||{};if(mx.has(s)&&this.batch)return e?.rowNode&&e?.column&&this.bulkRefreshCell(e),null;const l=this.committing?fg[s]:s;if(!(this.committing||this.isEditing(e)||this.batch&&this.model.hasEdits(e,wo))||!this.strategy||this.stopping)return null;const d=re(this.beans,e);d&&(d.onEditorAttachedFuncs=[]);const u=!i&&(!!this.shouldStopEditing(e,o,l)||(this.committing||s==="paste")&&!this.batch)||r,h=i&&!!this.shouldCancelEditing(e,o,l)||n;return{cancel:i,cellCtrl:d,edits:this.model.getEditMap(!0),event:o??null,forceCancel:n,forceStop:r,commit:a,position:e,source:s,treatAsSource:l,willCancel:h,willStop:u}}processStopRequest(e){const{event:t,position:o,willCancel:i,willStop:s}=e;return s||i?this.handleStopOrCancel(e):this.shouldHandleMidBatchKey(t,o)?{res:!1,edits:this.handleMidBatchKey(t,o,e)}:(io(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:i,commit:s,edits:n,event:r,source:a,willCancel:l,willStop:c}=e,d=!this.batch||!l;io(t,{persist:d,isCancelling:l||i,isStopping:c});const u=o.getEditMap(),g=!l&&(!this.batch||s)?this.processEdits(u,a):[];i?this.strategy?.stopCancelled(e.forceCancel):this.strategy?.stopCommitted(r,s),this.clearValidationIfNoOpenEditors();for(const f of g)o.clearEditValue(f);this.bulkRefreshMap(n);for(const f of o.getEditPositions(u)){const m=re(t,f),C=mt(f);m?.refreshCell({force:!0,suppressFlash:!C})}return{res:c,edits:u}}shouldHandleMidBatchKey(e,t){return e instanceof KeyboardEvent&&this.batch&&!!this.strategy?.midBatchInputsAllowed(t)&&this.isEditing(t,{withOpenEditor:!0})}handleMidBatchKey(e,t,o){const{beans:i,model:s}=this,{cellCtrl:n,edits:r}=o,{key:a}=e,l=a===R.ENTER,c=a===R.ESCAPE,d=a===R.TAB;if(l||d||c){if(l||d)io(i,{persist:!0});else if(c&&n){const{rowNode:u,column:h}=n;if(this.batch&&u&&h){const g={rowNode:u,column:h};eo(i,[g],{silent:!0}),this.model.stop(g,!0,!0),re(i,g)?.refreshCell(Zt)}else this.revertSingleCellEdit(n)}return this.batch?this.strategy?.cleanupEditors():eo(i,s.getEditPositions(),{event:e,cancel:c}),e.preventDefault(),this.bulkRefreshMap(r,{suppressFlash:!0}),s.getEditMap()}return r}finishStopEditing({cellCtrl:e,edits:t,params:o,position:i,res:s,commit:n,forceCancel:r,willCancel:a,willStop:l}){const c=this.beans;s&&i&&(!this.batch||n)&&this.model.removeEdits(i),this.navigateAfterEdit(o,e?.cellPosition),Gi(c),this.clearValidationIfNoOpenEditors();const{rowRenderer:d,formula:u}=c;if(a&&d.refreshRows({rowNodes:Array.from(t.keys())}),this.batch){u?u.refreshFormulas(!0):d.refreshRows({suppressFlash:!0,force:!0});const h=l&&n;(h||a&&r)&&this.dispatchBatchStopped(t,h)}}dispatchBatchStopped(e,t){let o;t&&(o=j0(e),o.size>0&&this.ensureBatchStarted()),this.batchStartDispatched&&(this.batchStartDispatched=!1,this.dispatchBatchEvent("batchEditingStopped",o??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:i}=e;if(!(o instanceof KeyboardEvent)||i)return;const{key:n,shiftKey:r}=o,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(n!==R.ENTER||!a)return;const l=r?R.UP:R.DOWN;this.beans.navigation?.navigateToNextCell(null,l,t,!1)}processEdits(e,t){const o=Array.from(e.keys()),i=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,s=[],{changeDetectionSvc:n}=this.beans;n?.beginDeferred();try{for(const r of o){const a=e.get(r);for(const l of a.keys()){const c=a.get(l),d={rowNode:r,column:l};if(mt(c)&&!i){const u=re(this.beans,d);this.setNodeDataValue(r,l,c.pendingValue,u,t)||s.push(d)}}}}finally{n?.endDeferred()}return s}setNodeDataValue(e,t,o,i,s="edit"){const n=fx.has(s)?"edit":s;i&&(i.suppressRefreshCell=!0),this.committing=!0;try{return e.setDataValue(t,o,n)}finally{this.committing=!1,i&&(i.suppressRefreshCell=!1)}}syncEditAfterCommit(e,t){const o=this.model.getEdit(e);o&&o.state!=="editing"&&(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=Zt;t?.forceRefreshOfEditCellsOnly&&(o={...Sx(e),...Zt}),this.beans.rowRenderer.refreshCells(o)}dispatchEditValuesChanged({rowNode:e,column:t},o={}){if(!e||!t||!o)return;const{pendingValue:i,sourceValue:s}=o,{rowIndex:n,rowPinned:r,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:n,rowPinned:r,column:t,source:"api",data:a,newValue:i,oldValue:s,value:i,colDef:t.getColDef()})}bulkRefreshCell(e,t){Se(this.gos,this.beans.rowModel)&&this.refCell(e,this.model.getEdit(e),t)}bulkRefreshMap(e,t){Se(this.gos,this.beans.rowModel)&&e.forEach((o,i)=>{for(const s of o.keys())this.refCell({rowNode:i,column:s},o.get(s),t)})}refCell({rowNode:e,column:t},o,i={}){const{beans:s,gos:n}=this,r=new Set([e]),a=new Set,l=e.pinnedSibling;l&&r.add(l);const c=e.sibling;c&&a.add(c);let d=e.parent;for(;d;)d.sibling?.footer&&n.get("groupTotalRow")||!d.parent&&d.sibling&&n.get("grandTotalRow")?a.add(d.sibling):a.add(d),d=d.parent;for(const u of r)this.dispatchEditValuesChanged({rowNode:u,column:t},o);for(const u of r)re(s,{rowNode:u,column:t})?.refreshCell(i);for(const u of a){const h=re(s,{rowNode:u,column:t});h&&(h.refreshCell(i),!i.force&&this.batch&&h.editStyleFeature?.applyCellStyles?.())}}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{gos:o,beans:i}=this,s=e.rowNode;if(s.group&&e.column.getColDef().groupRowEditable==null){if(o.get("treeData")){if(!s.data&&!o.get("enableGroupEdit"))return!1}else if(!o.get("enableGroupEdit"))return!1}const n=jc(o)==="fullRow"?lx(i,e,t):ea(i,e);return n&&(this.strategy??(this.strategy=this.createStrategy())),n}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,o=!0){if(this.hasValidationErrors(e)){const i=re(this.beans,e);return this.cellEditingInvalidCommitBlocks()?(t?.preventDefault?.(),o&&(i&&!i.hasBrowserFocus()&&i.focusCell(),i?.comp?.getCellEditor()?.focusIn?.()),"block-stop"):(i&&this.revertSingleCellEdit(i),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){const o=re(this.beans,e);o?.comp?.getCellEditor()&&(eo(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),Wo(this.beans,e,{silent:!0}),no(this.beans),o?.refreshCell(Zt),t&&(o?.focusCell(),o?.comp?.getCellEditor()?.focusIn?.()))}hasValidationErrors(e){no(this.beans);const t=re(this.beans,e);t&&(t.refreshCell(Zt),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,i="ui"){let s;const n=this.isEditing(),r=n&&this.checkNavWithValidation(void 0,o)==="block-stop";return e instanceof mi&&n&&(s=this.strategy?.moveToNextEditingCell(e,t,o,i,r)),s===null||(s=s||!!this.beans.focusSvc.focusedHeader,s===!1&&!r&&this.stopEditing()),s}getPendingEditValue(e,t,o){if(o==="data"||o==="batch"&&!this.batch)return;const i=this.model.getEdit({rowNode:e,column:t},wo);if(!i||this.stopping&&!this.batch&&!i.editorState?.cellStartedEditing)return;if(o==="edit"){const n=i.editorValue;if(n!=null&&n!==Ie)return n}const s=i.pendingValue;if(s!==Ie)return s}getCellDataValue(e){const t=this.model.getEdit(e,wo);if(t){const o=t.pendingValue;if(o!==Ie)return o;const i=t.sourceValue;if(i!=null)return i}return this.valueSvc.getValue(e.column,e.rowNode,"data")}addStopEditingWhenGridLosesFocus(e){$0(this,this.beans,e)}createPopupEditorWrapper(e){return new nx(e)}batchResetToSourceValue(e){if(!this.batch)return!1;const t=this.model.getEdit(e);if(!t)return!1;const{pendingValue:o,sourceValue:i,state:s}=t;return o===i||s==="editing"?!1:(this.dispatchEditValuesChanged(e,{...t,pendingValue:i}),this.beans.editModelSvc?.removeEdits(e),re(this.beans,e)?.refreshCell(Zt),!0)}setDataValue(e,t,o){try{const i=this.batch,s=this.isEditing(i?void 0:e);if((!s||this.committing)&&!i&&!Cx.has(o)||!s&&!i&&o==="paste"||o==="batch"&&!i)return;if(o==="edit"){if(s&&this.applyEditorValue(e,t))return!0;if(!i)return}if(this.strategy??(this.strategy=this.createStrategy()),o==="batch"||o==="edit")return this.applyDirectValue(e,t,o);const n=this.beans;let r;if(i?r="ui":this.committing?r=o??"api":r="api",!o||px.has(o))return this.applyDirectValue(e,t,o);const a=this.applyExistingEdit(e,t,o,r);return a!==void 0?a:(Yo(n,e,t,o,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0)}finally{this.committing=!1}}applyExistingEdit(e,t,o,i){const s=this.model.getEdit(e);if(s)return s.pendingValue===t?!1:s.sourceValue!==t?(Yo(this.beans,e,t,o,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0):(this.beans.editModelSvc?.removeEdits(e),this.ensureBatchStarted(),this.dispatchEditValuesChanged(e,{...s,pendingValue:t}),!0)}applyEditorValue(e,t){const o=this.beans,i=re(o,e),s=i?.comp?.getCellEditor();return!i||!s?!1:(Yo(o,e,t,"edit",void 0,{persist:!0}),i.editStyleFeature?.applyCellStyles?.(),"agSetEditValue"in s?(s.agSetEditValue(t),!0):s.refresh&&i.editCompDetails?(s.refresh({...i.editCompDetails.params,value:t}),!0):(i.hasBrowserFocus()&&i.onEditorAttachedFuncs.push(()=>{const r=re(this.beans,e);r?.focusCell(!0),r?.comp?.getCellEditor()?.focusIn?.()}),eo(o,[e],{silent:!0,cancel:!0}),Wo(o,e,{silent:!0}),no(o),re(o,e)?.refreshCell(Zt),!0))}applyDirectValue(e,t,o){const i=this.beans;if(this.batch){if(o==="batch"&&re(i,e)?.comp?.getCellEditor()){const{editModelSvc:r,valueSvc:a}=i,{rowNode:l,column:c}=e;r?.getEdit(e)?.sourceValue===void 0&&r?.setEdit(e,{sourceValue:a.getValue(c,l,"data")}),r?.setEdit(e,{pendingValue:t})}else Yo(i,e,t,o,void 0,{persist:!0}),o!=="batch"&&this.cleanupEditors();return Gi(i),this.ensureBatchStarted(),this.bulkRefreshCell(e),!0}Yo(i,e,t,o,void 0,{persist:!0});const s=re(i,e),n=this.setNodeDataValue(e.rowNode,e.column,t,s,o);return this.syncEditAfterCommit(e,n),Gi(i),re(i,e)?.refreshCell(n?wx:Zt),n}handleColDefChanged(e){Q0(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){const{model:o}=this;if(!this.batch||!o.hasRowEdits(e.rowNode,wo))return;const{rowNode:s}=e,{compDetails:n,valueToDisplay:r}=t;if(n){const{params:a}=n;return a.data=o.getEditRowDataValue(s,wo),{compDetails:n}}return{valueToDisplay:r}}cleanupEditors(){this.strategy?.cleanupEditors()}dispatchCellEvent(e,t,o,i){this.strategy?.dispatchCellEvent(e,t,o,i)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return K(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(t=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},o){if(!o||o.length===0)return;const{beans:i,rangeSvc:s,valueSvc:n}=this,{formula:r}=i;io(i,{persist:!0});const a=this.model.getEditMap(!0);let l=a.get(e)?.get(t)?.pendingValue,c=!1;this.batch||(this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),c=!0);const d=r?.isFormula(l)??!1;o.forEach(h=>{const g=h.columns.some(f=>f?.isAllowFormula());if(s?.forEachRowInRange(h,f=>{const m=kt(i,f);if(m===void 0)return;const C=a.get(m)??new Map;let v=l;for(const w of h.columns){if(!w)continue;const b=!!d&&w.isAllowFormula();if(this.isCellEditable({rowNode:m,column:w},"api")){const y=n.getValue(w,m,"data",!0);let S=n.parseValue(w,m??null,v,y);Number.isNaN(S)&&(S=null),C.set(w,{editorValue:void 0,pendingValue:S,sourceValue:y,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}b&&(v=r?.updateFormulaByOffset({value:v,columnDelta:1}))}C.size>0&&a.set(m,C),d&&g&&(l=r?.updateFormulaByOffset({value:l,rowDelta:1}))}),this.setEditMap(a),this.batch){this.cleanupEditors(),Gi(i),this.ensureBatchStarted();return}this.committing=!0;try{this.stopEditing(void 0,{source:"bulk"})}finally{this.committing=!1,c&&this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(a)})}});const u=re(i,{rowNode:e,column:t});u&&u.focusCell(!0)}createCellStyleFeature(e){return new cx(e,this.beans)}createRowStyleFeature(e){return new dx(e,this.beans)}setEditingCells(e,t){const{beans:o}=this,{colModel:i,valueSvc:s}=o,n=new Map;for(let{colId:r,column:a,colKey:l,rowIndex:c,rowPinned:d,newValue:u,state:h}of e){const g=r?i.getCol(r):l?i.getCol(l):a;if(!g)continue;const f=kt(o,{rowIndex:c,rowPinned:d});if(!f)continue;const m=s.getValue(g,f,"data",!0);if(!t?.forceRefreshOfEditCellsOnly&&!mt({pendingValue:u,sourceValue:m})&&h!=="editing")continue;let C=n.get(f);C||(C=new Map,n.set(f,C)),u===void 0&&(u=Ie),C.set(g,{editorValue:void 0,pendingValue:u,sourceValue:m,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(n,t)}onCellFocused(e){const t=re(this.beans,e);if(!t||!this.isEditing(t,wo))return;const o=this.model.getEdit(t);if(!o||!mt(o))return;const s=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");this.beans.ariaAnnounce?.announceValue(s,"pendingChange")}allowedFocusTargetOnValidation(e){return re(this.beans,e)}};function Sx(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap(t=>Array.from(t.keys())))]:void 0}}function jc(e,t){return t??e.get("editType")??"singleCell"}var mg=class extends x{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:i,beans:s}=this,n=e.type==="cellFocused"?e.sourceEvent:null;o&&(t=re(s,o));const{gos:r,editModelSvc:a}=s,l=e.type==="cellFocusCleared";if(i.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:d,rowPinned:u}=e,h={column:c,rowNode:kt(s,{rowIndex:d,rowPinned:u})},g=r.get("invalidEditValueMode")==="block";if(g)return;const f=!g,m=!!a?.getCellValidationModel().hasCellValidation(h),C=f&&m;!(o||l)||i.stopEditing(void 0,{cancel:C,source:l&&f?"api":void 0,event:n})||(i.isBatchEditing()?i.cleanupEditors():i.stopEditing(void 0,{source:"api"}))}t?.refreshCell({suppressFlash:!0,force:!0})}stopCancelled(e){const t=this.editSvc.isBatchEditing()&&!e;for(const o of this.model.getEditPositions())ns(this.beans,o,{cancel:!0},re(this.beans,o)),this.model.stop(o,t,!0);return!0}stopCommitted(e,t){const o=this.model.getEditPositions(),i={all:[],pass:[],fail:[]};for(const r of o)i.all.push(r),(this.model.getCellValidationModel().getCellValidation(r)?.errorMessages?.length??0)>0?i.fail.push(r):i.pass.push(r);const s=this.processValidationResults(i),n=this.editSvc.isBatchEditing()&&!t;for(const r of s.destroy)ns(this.beans,r,{event:e},re(this.beans,r)),this.model.stop(r,n,!1);for(const r of s.keep){const a=re(this.beans,r);!this.editSvc.cellEditingInvalidCommitBlocks()&&a&&this.editSvc.revertSingleCellEdit(a)}return!0}cleanupEditors({rowNode:e}={},t){io(this.beans,{persist:!1});const o=this.model.getEditPositions(),i=[];if(e)for(const s of o)s.rowNode!==e&&i.push(s);else for(const s of o)i.push(s);eo(this.beans,i),Gi(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 i=this.beans.gos.get("editType")==="fullRow";e.focusCell(i),e.onEditorAttachedFuncs.push(()=>t?.getCellEditor()?.focusIn?.())}}setupEditors(e){const{event:t,ignoreEventKey:o=!1,startedEdit:i,position:s,cells:n=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!o&&t.key||void 0;q0(this.beans,n,s,r,t,i)}dispatchCellEvent(e,t,o,i){const s=re(this.beans,e);s&&this.eventSvc.dispatchEvent({...s.createEvent(t??null,o),...i})}dispatchRowEvent(e,t,o){if(o)return;const i=dn(this.beans,e);i&&this.eventSvc.dispatchEvent(i.createRowEvent(t))}shouldStop(e,t,o="ui"){const i=this.editSvc.isBatchEditing();return i&&o==="api"?!0:i&&(o==="ui"||o==="edit")?!1:o==="api"?!0:t instanceof KeyboardEvent&&!i?t.key===R.ENTER:null}shouldCancel(e,t,o="ui"){const i=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!i&&t.key===R.ESCAPE||i&&o==="api"||o==="api")}setEditMap(e,t){t?.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const o=[];if(e.forEach((i,s)=>{i.forEach((n,r)=>{n.state==="editing"&&o.push({...n,rowNode:s,column:r})})}),t?.update&&(e=new Map([...this.model.getEditMap(),...e])),this.model?.setEditMap(e),o.length>0){const i=o.at(-1),s=i.pendingValue===Ie?void 0:i.pendingValue;this.start({position:i,event:new KeyboardEvent("keydown",{key:s}),source:"api"});const n=re(this.beans,i);n&&this.setFocusInOnEditor(n)}}destroy(){this.cleanupEditors(),super.destroy()}},yx=class extends mg{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=new Set}shouldStop(e,t,o="ui"){const{rowNode:i,beans:s}=this,{rowNode:n}=e||{};if(!dn(s,{rowNode:i}))return!0;const a=super.shouldStop({rowNode:i},t,o);return a!==null?a:i?n!==i:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:o,startedEdit:i,event:s,ignoreEventKey:n}=e,{rowNode:r}=t,{beans:a,model:l,startedRows:c}=this;this.rowNode!==r&&super.cleanupEditors(t);const d=a.visibleCols.allCols,u=[],h=[];for(const g of d)g.isCellEditable(r)&&h.push(g);if(h.length!=0){c.has(r)||(this.dispatchRowEvent({rowNode:r},"rowEditingStarted",o),c.add(r));for(const g of h){const f={rowNode:r,column:g};u.push(f),l.start(f)}this.rowNode=r,this.setupEditors({cells:u,position:t,startedEdit:i,event:s,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)?!1:(super.stopCancelled(e),this.cleanupEditors({rowNode:t},!0),this.rowNode=void 0,!0)}stopCommitted(e,t){const{rowNode:o,beans:i,model:s,editSvc:n}=this;if(o&&!s.hasRowEdits(o))return!1;const r=[];if(s.getEditMap().forEach((a,l)=>{if(!(!a||a.size===0)){for(const c of a.values())if(mt(c)){r.push(l);break}}}),no(i),n.checkNavWithValidation({rowNode:o})==="block-stop")return!1;if(super.stopCommitted(e,t),t||!n.isBatchEditing())for(const a of r)this.dispatchRowEvent({rowNode:a},"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:i,gos:s,model:n}=this;if(i.editSvc?.isRangeSelectionEnabledWhileEditing())return;const r=re(i,o);s.get("invalidEditValueMode")==="block"&&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 i of o)this.dispatchRowEvent({rowNode:i},"rowEditingStopped"),this.destroyEditorsForRow(i);o.clear()}destroyEditorsForRow(e){const t=dn(this.beans,{rowNode:e});if(!t)return;const o={};for(const i of t.getAllCellCtrls())i.comp?.getCellEditor()&&ns(this.beans,i,o,i)}moveToNextEditingCell(e,t,o,i="ui",s=!1){const{beans:n,model:r,gos:a,editSvc:l}=this,c=e.cellPosition;let d;r.suspend(!0);try{d=n.navigation?.findNextCellToFocusOn(c,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{r.suspend(!1)}if(d===!1)return null;if(d==null)return!1;const u=d.cellPosition,h=e.isCellEditable(),g=d.isCellEditable(),f=u&&c.rowIndex===u.rowIndex&&c.rowPinned===u.rowPinned;h&&this.setFocusOutOnEditor(e),this.restoreEditors();const m=a.get("suppressStartEditOnTab");return g&&!s?m?d.focusCell(!0,o):(d.comp?.getCellEditor()||Wo(n,d,{event:o,cellStartedEdit:!0}),this.setFocusInOnEditor(d),d.focusCell(!1,o)):(g&&s&&this.setFocusInOnEditor(d),d.focusCell(!0,o)),!f&&!s&&(l?.stopEditing({rowNode:e.rowNode},{event:o,forceStop:!0}),l?.isRowEditing(e.rowNode,{withOpenEditor:!0})&&this.cleanupEditors(d,!0),m?d.focusCell(!0,o):l.startEditing(d,{startedEdit:!0,event:o,source:i,ignoreEventKey:!0,editable:g||void 0})),e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){const{beans:e,model:t}=this;t.getEditMap().forEach((o,i)=>o.forEach(({state:s},n)=>{if(s!=="editing")return;const r=re(e,{rowNode:i,column:n});r&&!r.comp?.getCellEditor()&&Wo(e,r,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.clear()}},Rx=class extends mg{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,o="ui"){const i=super.shouldStop(e,t,o);if(i!==null)return i;const s=e?.rowNode,n=e?.column,r=this.rowNode,a=this.column;return(!r||!a)&&s&&n?null:r!==s||a!==n?!0:!r&&!a?this.model.hasEdits(void 0,{withOpenEditor:!0}):!1}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:o,event:i,ignoreEventKey:s}=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:i,ignoreEventKey:s})}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:i,column:s,rowPinned:n}=e,r=kt(this.beans,{rowIndex:i,rowPinned:n}),a=qr(s),l=t.getCol(a),c=e.previousParams;if(c){const d=qr(c.column);if(c?.rowIndex===i&&d===a&&c?.rowPinned===n)return}e.type=="cellFocused"&&(o?.isRangeSelectionEnabledWhileEditing()||o?.isEditing({rowNode:r,column:l},{withOpenEditor:!0}))||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,o,i="ui",s=!1){const n=this.beans.focusSvc.getFocusedCell();n&&(e=ei(this.beans,n)??e);const r=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),s||(e.eGui.focus(),this.editSvc?.stopEditing(e,{source:this.editSvc?.isBatchEditing()?"ui":"api",event:o}));try{a=this.beans.navigation?.findNextCellToFocusOn(r,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,d=e.isCellEditable(),u=a.isCellEditable(),h=c&&r.rowIndex===c.rowIndex&&r.rowPinned===c.rowPinned;d&&!s&&this.setFocusOutOnEditor(e);const g=this.gos.get("suppressStartEditOnTab");let f=!1;if(!h&&!s&&(super.cleanupEditors(a,!0),g?a.focusCell(!0,o):(f=!0,this.editSvc.startEditing(a,{startedEdit:!0,event:o,source:i,ignoreEventKey:!0,editable:u}))),u&&!s){if(a.focusCell(!1,o),g)a.focusCell(!0,o);else if(!a.comp?.getCellEditor()){if(!f){const m=this.editSvc?.isEditing(a,{withOpenEditor:!0});Wo(this.beans,a,{event:o,cellStartedEdit:!0,silent:m})}this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else u&&s&&this.setFocusInOnEditor(a),a.focusCell(!0,o);return e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},mo={moduleName:"EditCore",version:L,beans:[U0,bx],apiFunctions:{getEditingCells:ZE,getEditRowValues:QE,getCellEditorInstances:K0,startEditingCell:ex,stopEditing:JE,isEditing:XE,validateEdit:tx},dynamicBeans:{singleCell:Rx,fullRow:yx},dependsOn:[Tn,cg],css:[mE]},Fx={moduleName:"UndoRedoEdit",version:L,beans:[fE],apiFunctions:{undoCellEditing:jE,redoCellEditing:YE,getCurrentUndoSize:ox,getCurrentRedoSize:ix},dependsOn:[mo]},Ex={moduleName:"TextEditor",version:L,userComponents:{agCellEditor:qc,agTextCellEditor:qc},dependsOn:[mo]},xx={moduleName:"NumberEditor",version:L,userComponents:{agNumberCellEditor:{classImp:kE}},dependsOn:[mo]},Px={moduleName:"DateEditor",version:L,userComponents:{agDateCellEditor:yE,agDateStringCellEditor:EE},dependsOn:[mo]},Dx={moduleName:"CheckboxEditor",version:L,userComponents:{agCheckboxCellEditor:vE},dependsOn:[mo]},Mx={moduleName:"SelectEditor",version:L,userComponents:{agSelectCellEditor:$E},dependsOn:[mo]},Tx={moduleName:"LargeTextEditor",version:L,userComponents:{agLargeTextCellEditor:ME},dependsOn:[mo]},Ix={moduleName:"CustomEditor",version:L,dependsOn:[mo]},Cg={agSetColumnFilter:"agSetColumnFilterHandler",agMultiColumnFilter:"agMultiColumnFilterHandler",agGroupColumnFilter:"agGroupColumnFilterHandler",agNumberColumnFilter:"agNumberColumnFilterHandler",agBigIntColumnFilter:"agBigIntColumnFilterHandler",agDateColumnFilter:"agDateColumnFilterHandler",agTextColumnFilter:"agTextColumnFilterHandler"},Ax=new Set(Object.values(Cg));function Jt(e,t){const o=e.filterUi;if(!o)return null;if(o.created)return o.promise;if(t)return null;const i=o.create(o.refreshed),s=o;return s.created=!0,s.promise=i,i}function kx(e,t,o,i,s,n,r){return t.refresh?.({...o,model:i,source:n,additionalEventAttributes:r}),e().then(a=>{if(a){const{filter:l,filterParams:c}=a;vg(l,c,i,s,n,r)}})}function vg(e,t,o,i,s,n){e?.refresh?.({...t,model:o,state:i,source:s,additionalEventAttributes:n})}function wg(e,t,o,i){const s=e();s?.created&&s.promise.then(n=>{const r=t();vg(n,s.filterParams,r,o()??{model:r},"ui",i)})}function Yc(e){let t,o=!1,i;const{action:s,filterParams:n,getFilterUi:r,getModel:a,getState:l,updateState:c,updateModel:d,processModelToApply:u}=e;switch(s){case"apply":{const h=l();i=h?.model??null,u&&(i=u(i)),t={state:h?.state,model:i},o=!0;break}case"clear":{t={model:null},n?.buttons?.includes("apply")||(o=!0,i=null);break}case"reset":{t={model:null},o=!0,i=null;break}case"cancel":{t={model:a()};break}}c(t),o?d(i):wg(r,a,l,{fromAction:s})}function Te(e,t){return e[t]??null}var Lx=class extends $a{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,o,i,s){this.comp=e;const n=ds(this,this.beans.context,s);this.eButtonShowMainFilter=o,this.eFloatingFilterBody=i,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:a})=>{a===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 K(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=Je("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new ls(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();Ci(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){const{beans:t}=this;if(ve(t)===this.eGui)return;const s=$o(t,this.eGui,null,e.shiftKey);if(s){t.headerNavigation?.scrollToColumn(this.column),e.preventDefault(),s.focus();return}const n=this.findNextColumnWithFloatingFilter(e.shiftKey);n&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:n},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 R.UP:case R.DOWN:case R.LEFT:case R.RIGHT:if(t)return;Bo(e);case R.ENTER:t&&Ho(this.eGui)&&e.preventDefault();break;case R.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const o=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),i=!!e.relatedTarget&&Eo(e.relatedTarget,"ag-floating-filter");if(o&&i&&e.target===this.eGui){const s=this.lastFocusEvent,n=!!(s&&s.key===R.TAB);if(s&&n){const r=s.shiftKey;Ho(this.eGui,r)}}this.focusThis()}setupHover(e){this.beans.colHover?.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new Ua(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!Ze(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:i}=this,s=n=>{if(n?.source==="filterDestroyed"&&(!this.isAlive()||!t?.isAlive()))return;const r=this.comp.getFloatingFilterComp();r&&r.then(a=>{if(a){if(i.get("enableFilterHandlers")){const d=n;let u="filter";d?.afterFloatingFilter?u="ui":d?.afterDataChange?u="dataChanged":n?.source==="api"&&(u="api"),this.updateFloatingFilterParams(this.userCompDetails,u);return}const l=t?.getCurrentFloatingFilterParentModel(o),c=n?{...n,columns:n.columns??[],source:n.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(o,{filterChanged:s}),t?.isFilterActive(o)&&s(null)}setupWidth(e){const t=()=>{const o=`${this.column.getActualWidth()}px`;this.comp.setWidth(o)};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 i=this.beans.colFilter,s=this.active?i?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,n=this.comp.getFloatingFilterComp();!n||!s?this.updateCompDetails(e,s,o):n.then(r=>{!r||i?.areFilterCompsDifferent(this.userCompDetails??null,s)?this.updateCompDetails(e,s,o):this.updateFloatingFilterParams(s,"colDef")})}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(i=>{typeof i?.refresh=="function"&&(this.gos.get("enableFilterHandlers")&&(o={...o,model:Te(this.beans.colFilter?.model??{},this.column.getColId()),source:t}),i.refresh(o))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function Ox(e,t){const o=e.colModel.getCol(t);if(!o){ce(12,{colKey:t});return}e.menuSvc?.showColumnMenu({column:o,positionBy:"auto"})}function Gx(e){e.menuSvc?.hidePopupMenu()}var Hx=class extends x{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(Zc(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(){Zc(this.beans)?.hideActiveMenu()}isColumnMenuInHeaderEnabled(e){const{suppressHeaderMenuButton:t}=e.getColDef();return!t&&!!this.activeMenuFactory?.isMenuEnabled(e)&&(Ze(this.gos)||!!this.beans.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&!!this.beans.filterManager?.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!(e&&lo(e)?e.getColDef():e?.getColGroupDef())?.suppressHeaderContextMenu&&this.gos.get("columnMenu")==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(Mo()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!Ze(this.gos)&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return!!this.beans.filterManager?.isFilterAllowed(e)&&!Ze(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 Ze(e)?e.exists("suppressMenuHide")?t:!1:t}showColumnMenuCommon(e,t,o,i){const{positionBy:s,onClosedCallback:n}=t,r=t.column;if(s==="button"){const{buttonElement:a}=t;e?.showMenuAfterButtonClick(r,a,o,n,i)}else if(s==="mouse"){const{mouseEvent:a}=t;e?.showMenuAfterMouseEvent(r,a,o,n,i)}else if(r){const a=this.beans,l=a.ctrlsSvc;l.getScrollFeature().ensureColumnVisible(r,"auto"),qt(a,()=>{const c=l.getHeaderRowContainerCtrl(r.getPinned())?.getHeaderCtrlForColumn(r);c&&e?.showMenuAfterButtonClick(r,c.getAnchorElementForMenu(i),o,n,i)})}}};function Qc(e,t,o){e.menuVisible!==t&&(e.menuVisible=t,e.dispatchColEvent("menuVisibleChanged",o))}function Zc(e){const{enterpriseMenuFactory:t,filterMenuFactory:o,gos:i}=e;return t&&Ze(i)?t:o}var Bx={moduleName:"SharedMenu",version:L,beans:[Hx],apiFunctions:{showColumnMenu:Ox,hidePopupMenu:Gx}},Vx=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;:where(.ag-set-filter-group-closed-icon),:where(.ag-set-filter-group-indeterminate-icon),:where(.ag-set-filter-group-opened-icon){cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper{min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>:where(.ag-date-floating-filter-wrapper),>:where(.ag-floating-filter-input),>:where(.ag-input-field){flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(.ag-input-field-input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:var(--ag-widget-container-vertical-padding);:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function Nx(e){const t=e.filterManager;return!!t?.isColumnFilterPresent()||!!t?.isAggregateFilterPresent()}function Wx(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)}function zx(e,t){const o=e.colModel.getColDefCol(t);if(o)return e.colFilter?.destroyFilter(o,"api")}function _x(e,t){e.frameworkOverrides.wrapIncoming(()=>e.filterManager?.setFilterModel(t))}function Ux(e){return e.filterManager?.getFilterModel()??{}}function $x(e,t,o){const{gos:i,colModel:s,colFilter:n}=e;o&&!i.get("enableFilterHandlers")&&(D(288),o=!1);const r=s.getColDefCol(t);return r?n?.getModelForColumn(r,o)??null:null}function Kx(e,t,o){return e.filterManager?.setColumnFilterModel(t,o)??Promise.resolve()}function qx(e,t){const o=e.colModel.getCol(t);if(!o){ce(12,{colKey:t});return}e.menuSvc?.showFilterMenu({column:o,containerType:"columnFilter",positionBy:"auto"})}function jx(e){e.menuSvc?.hideFilterMenu()}function Yx(e,t){const o=e.colModel.getCol(t);if(!o){ce(12,{colKey:t});return}return e.colFilter?.getHandler(o,!0)}function Qx(e,t){const{colModel:o,colFilter:i,gos:s}=e;if(!s.get("enableFilterHandlers")){D(287);return}const{colId:n,action:r}=t;if(n){const a=o.getColById(n);a&&i?.updateModel(a,r)}else i?.updateAllModels(r)}var Jc={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},Xc=["january","february","march","april","may","june","july","august","september","october","november","december"];function Zx(e,t){return e==null?-1:t==null?1:Number.parseFloat(e)-Number.parseFloat(t)}function Jx(e,t){if(e==null)return-1;if(t==null)return 1;const o=et(e),i=et(t);return o!=null&&i!=null?o===i?0:o>i?1:-1:String(e).localeCompare(String(t))}function ed(e){return e instanceof Date&&!isNaN(e.getTime())}var ta={number:()=>{},bigint:()=>{},boolean:()=>({maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>t===!1,numberOfInputs:0}]}),date:()=>({isValidDate:ed}),dateString:({dataTypeDefinition:e})=>({comparator:(t,o)=>{const i=e.dateParser(o);return o==null||i<t?-1:i>t?1:0},isValidDate:t=>typeof t=="string"&&ed(e.dateParser(t))}),dateTime:e=>ta.date(e),dateTimeString:e=>ta.dateString(e),object:()=>{},text:()=>{}},oa={number:()=>({comparator:Zx}),bigint:()=>({comparator:Jx}),boolean:({t:e})=>({valueFormatter:t=>O(t.value)?e(String(t.value),t.value?"True":"False"):e("blanks","(Blanks)")}),date:({formatValue:e,t})=>({valueFormatter:o=>{const i=e(o);return O(i)?i:t("blanks","(Blanks)")},treeList:!0,treeListFormatter:(o,i)=>{if(o==="NaN")return t("invalidDate","Invalid Date");if(i===1&&o!=null){const s=Xc[Number(o)-1];return t(s,Jc[s])}return o??t("blanks","(Blanks)")},treeListPathGetter:o=>Rs(o,!1)}),dateString:({formatValue:e,dataTypeDefinition:t,t:o})=>({valueFormatter:i=>{const s=e(i);return O(s)?s:o("blanks","(Blanks)")},treeList:!0,treeListPathGetter:i=>Rs(t.dateParser(i??void 0),!1),treeListFormatter:(i,s)=>{if(s===1&&i!=null){const n=Xc[Number(i)-1];return o(n,Jc[n])}return i??o("blanks","(Blanks)")}}),dateTime:e=>{const t=oa.date(e);return t.treeListPathGetter=Rs,t},dateTimeString(e){const t=e.dataTypeDefinition.dateParser,o=oa.dateString(e);return o.treeListPathGetter=i=>Rs(t(i??void 0)),o},object:({formatValue:e,t})=>({valueFormatter:o=>{const i=e(o);return O(i)?i:t("blanks","(Blanks)")}}),text:()=>{}};function Xx(e,t,o,i,s,n,r){let a=t,l=o;const c=e==="agSetColumnFilter";!l&&i.baseDataType==="object"&&!c&&(l=({column:g,node:f})=>s({column:g,node:f,value:n.valueSvc.getValue(g,f,"data")}));const u=(c?oa:ta)[i.baseDataType],h=u({dataTypeDefinition:i,formatValue:s,t:r});return a=typeof t=="object"?{...h,...t}:h,{filterParams:a,filterValueGetter:l}}var eP={boolean:"agTextColumnFilter",date:"agDateColumnFilter",dateString:"agDateColumnFilter",dateTime:"agDateColumnFilter",dateTimeString:"agDateColumnFilter",bigint:"agBigIntColumnFilter",number:"agNumberColumnFilter",object:"agTextColumnFilter",text:"agTextColumnFilter"},tP={boolean:"agTextColumnFloatingFilter",date:"agDateColumnFloatingFilter",dateString:"agDateColumnFloatingFilter",dateTime:"agDateColumnFloatingFilter",dateTimeString:"agDateColumnFloatingFilter",bigint:"agBigIntColumnFloatingFilter",number:"agNumberColumnFloatingFilter",object:"agTextColumnFloatingFilter",text:"agTextColumnFloatingFilter"};function oP(e,t=!1){return(t?tP:eP)[e??"text"]}function iP(e,t,o){if(t==null)return null;let i=null;const{compName:s,jsComp:n,fwComp:r}=Su(e,t);return s?i={agSetColumnFilter:"agSetColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",agBigIntColumnFilter:"agBigIntColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[s]:n==null&&r==null&&t.filter===!0&&(i=o()),i}var sP={filterHandler:()=>({doesFilterPass:()=>!0})};function td(e,t,o,i){if(!e.isPrimary())return!0;const n=!o;return!e.isValueActive()||!n?!1:t?!0:i}var nP=class extends x{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...Cg},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.addManagedPropertyListener("pivotMode",this.onPivotModeChanged.bind(this));const e=this.gos,t={...e.get("initialState")?.filter?.filterModel??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",o){const{colModel:i,dataTypeSvc:s,filterManager:n}=this.beans;if(s?.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const r=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,d)=>{const u=e[d];r.push(this.setModelOnFilterWrapper(c,u)),l.delete(d)}),l.forEach(c=>{const d=i.getColDefCol(c)||i.getCol(c);if(!d){D(62,{colId:c});return}if(!d.isFilterAllowed()){D(63,{colId:c});return}const u=this.getOrCreateFilterWrapper(d,!0);if(!u){D(64,{colId:c});return}r.push(this.setModelOnFilterWrapper(u,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{r.push(this.setModelOnFilterWrapper(l,null))});se.all(r).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((d,u)=>{const h=a?a[u]:null,g=l?l[u]:null;ji(h,g)||c.push(d.column)}),c.length>0?n?.onFilterChanged({columns:c,source:t}):o&&this.updateActive("filterChanged")})}getModel(e){const t={},{allColumnFilters:o,initialModel:i,beans:{colModel:s}}=this;if(o.forEach((n,r)=>{const a=this.getModelFromFilterWrapper(n);O(a)&&(t[r]=a)}),!e)for(const n of Object.keys(i)){const r=i[n];O(r)&&!o.has(n)&&s.getCol(n)?.isFilterAllowed()&&(t[n]=r)}return t}setState(e,t,o="api"){if(this.state.clear(),t)for(const i of Object.keys(t)){const s=t[i];this.state.set(i,{model:Te(this.model,i),state:s})}this.setModel(e,o,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let o=!1;return e.forEach((i,s)=>{const n=i.state;n!=null&&(o=!0,t[s]=n)}),o?t:void 0}getModelFromFilterWrapper(e){const o=e.column.getColId();if(e.isHandler)return Te(this.model,o);const i=e.filter;return i?typeof i.getModel!="function"?(D(66),null):i.getModel():Te(this.initialModel,o)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=l=>l?l.isFilterActive?l.isFilterActive():(D(67),!1):!1,{colModel:t,gos:o}=this.beans,i=!!Ys(o),s=[],n=[],r=(l,c,d)=>{c&&(td(l,t.isPivotMode(),t.isPivotActive(),i)?s.push(d):n.push(d))},a=[];return this.allColumnFilters.forEach(l=>{const c=l.column,d=c.getColId();if(l.isHandler)a.push(se.resolve().then(()=>{r(c,this.isHandlerActive(c),{colId:d,isHandler:!0,handler:l.handler,handlerParams:l.handlerParams})}));else{const u=Jt(l);u&&a.push(u.then(h=>{r(c,e(h),{colId:d,isHandler:!1,comp:h})}))}}),se.all(a).then(()=>{this.activeAggregateFilters=s,this.activeColumnFilters=n})}updateFilterFlagInColumns(e,t){const o=[];return this.allColumnFilters.forEach(i=>{const s=i.column;if(i.isHandler)o.push(se.resolve().then(()=>{this.setColFilterActive(s,this.isHandlerActive(s),e,t)}));else{const n=Jt(i);n&&o.push(n.then(r=>{this.setColFilterActive(s,r.isFilterActive(),e,t)}))}}),this.beans.groupFilter?.updateFilterFlags(e,t),se.all(o)}doFiltersPass(e,t,o){const{data:i,aggData:s}=e,n=o?this.activeAggregateFilters:this.activeColumnFilters,r=o?s:i,a=this.model;for(let l=0;l<n.length;l++){const c=n[l],{colId:d,isHandler:u}=c;if(d!==t)if(u){const{handler:h,handlerParams:g}=c;if(!h.doesFilterPass({node:e,data:r,model:Te(a,d),handlerParams:g}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){ce(91);continue}if(!h.doesFilterPass({node:e,data:r}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t?.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:o}=this.beans,i=()=>{this.isAlive()&&o?.onFilterChanged(e)};t.isRefreshInProgress()?setTimeout(i,0):i()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:o}=e,i=t?.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",o).then(()=>{this.allColumnFilters.forEach(s=>{const{column:n,isHandler:r}=s;i!==n.getColId()&&(r&&s.handler.onAnyFilterChanged?.(),Jt(s,r)?.then(a=>{typeof a?.onAnyFilterChanged=="function"&&a.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(o=>{const i=o.isHandler;i&&o.handler.onNewRowsLoaded?.();const s=Jt(o,i);s&&t.push(s.then(n=>{n.onNewRowsLoaded?.()}))}),se.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:i}=this.beans;return(s,n)=>{const r=n?i.getCol(n):e;return r?o.getValue(r,s,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():Te(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=O(Te(this.model,e.getColId()));if(t)return t;const o=this.beans.groupFilter;return o?.isGroupFilter(e)?o.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?Jt(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const o=Jt(t);return o?o.then(i=>({comp:i,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 Uf(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":oP(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,o,i,s,n){const r=()=>{const c=this.createFilterCompParams(e,s,n),d=i(c,s);return Zm(this.beans.userCompFactory,t,d,o)},a=r();return a?{compDetails:a,createFilterUi:c=>(c?r():a).newAgStackInstance()}:null}createFilterInstance(e,t,o,i){const s=this.beans.selectableFilter;s?.isSelectable(t)&&(t=s.getFilterDef(e,t));const{handler:n,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,o)??{},l=this.createFilterComp(e,t,o,i,!!n,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:n,handlerGenerator:a,handlerParams:r};const{compDetails:c,createFilterUi:d}=l;return this.isGlobalButtons&&(c.params?.buttons?.length||D(281,{colId:e.getColId()})),{compDetails:c,handler:n,handlerGenerator:a,handlerParams:r,createFilterUi:d}}createBaseFilterParams(e,t){const{filterManager:o,rowModel:i}=this.beans;return K(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:s=>o?.doesRowPassOtherFilters(e.getColId(),s)??!0,rowModel:i})}createFilterCompParams(e,t,o,i){const s=this.filterChangedCallbackFactory(e),n=this.createBaseFilterParams(e,i);if(n.filterChangedCallback=s,n.filterModifiedCallback=i?()=>{}:r=>this.filterModified(e,r),t){const r=n,a=e.getColId(),l=Te(this.model,a);r.model=l,r.state=this.state.get(a)??{model:l},r.onModelChange=(c,d)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,d).then(()=>{s({...d,source:"columnFilter"})})},r.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},r.onAction=(c,d,u)=>{this.updateModel(e,c,d),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:u})},r.getHandler=()=>this.getHandler(e,!0),r.onUiChange=c=>this.filterUiChanged(e,c),r.source=o}return n}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,o){const i=t(),s={created:!0,create:t,filterParams:e.params,compDetails:e,promise:i};return i.then(o),s}createFilterWrapper(e){const{compDetails:t,handler:o,handlerGenerator:i,handlerParams:s,createFilterUi:n}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),a=>a),r=e.getColId();if(o)return delete this.initialModel[r],o.init?.({...s,source:"init",model:Te(this.model,r)}),{column:e,isHandler:!0,handler:o,handlerGenerator:i,handlerParams:s,filterUi:this.createFilterUiForHandler(t,n)};if(n){const a={column:e,filterUi:null,isHandler:!1};return a.filterUi=this.createFilterUiLegacy(t,n,l=>{a.filter=l??void 0}),a}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,o){const{gos:i,frameworkOverrides:s,registry:n}=this.beans;let r;const a=g=>{const f=g.filter;if(vu(f)){const m=f.handler;return m||(r=f.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return typeof f=="string"?f:void 0},l=i.get("enableFilterHandlers"),c=l?a(t):void 0,d=g=>()=>this.createBean(n.createDynamicBean(g,!0));let u,h;if(typeof c=="string"){const g=i.get("filterHandlers")?.[c];g!=null?u=g:Ax.has(c)&&(u=d(c),h=c)}else u=c;if(!u){let g;const{compName:f,jsComp:m,fwComp:C}=Su(s,t);f?g=f:m==null&&C==null&&t.filter===!0&&(g=o),h=this.handlerMap[g],h&&(u=d(h))}return u?{filterHandler:u,handlerNameOrCallback:r??h}:l?(Se(i)&&D(277,{colId:e.getColId()}),sP):void 0}createHandler(e,t,o){const i=this.createHandlerFunc(e,t,o);if(!i)return;const s=zn(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:n,filterHandler:r}=i,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,s);return{handler:a,handlerParams:l,handlerGenerator:n??r}}createHandlerFromFunc(e,t,o){const i=e.getColDef(),s=t(K(this.gos,{column:e,colDef:i})),n=this.createHandlerParams(e,o);return{handler:s,handlerParams:n}}createHandlerParams(e,t){const o=e.getColDef(),i=e.getColId(),s=this.filterChangedCallbackFactory(e);return K(this.gos,{colDef:o,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:n=>this.beans.filterManager?.doesRowPassOtherFilters(i,n)??!0,onModelChange:(n,r)=>{this.updateStoredModel(i,n),this.refreshHandlerAndUi(e,n,"handler",!1,r).then(()=>{s({...r,source:"columnFilter"})})},onModelAsStringChange:()=>{e.dispatchColEvent("filterChanged","filterChanged"),this.dispatchLocalEvent({type:"filterModelAsStringChanged",column:e})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:o,groupFilter:i}=this.beans;this.allColumnFilters.forEach((n,r)=>{let a;n.column.isPrimary()?a=t.getColDefCol(r):a=t.getCol(r),!(a&&a===n.column)&&(e.push(n.column),this.disposeFilterWrapper(n,"columnChanged"),this.disposeColumnListener(r))});const s=i&&e.every(n=>i.isGroupFilter(n));e.length>0&&!s&&o?.onFilterChanged({columns:e,source:"api"})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const o=this.beans.groupFilter;return o?.isGroupFilter(e)?o.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:o,frameworkOverrides:i,selectableFilter:s,gos:n}=this.beans,r=g=>{this.getOrCreateFilterUi(e)?.then(m=>{g(No(m))})},a=e.getColDef(),l=s?.isSelectable(a)?s.getFilterDef(e,a):a,c=iP(i,l,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",d=n.get("enableFilterHandlers"),u=zn(o,l,this.createFilterCompParams(e,d,"init",!0)),h=K(n,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:r,showParentFilter:t});if(d){const g=h,f=e.getColId(),m=this.filterChangedCallbackFactory(e);g.onUiChange=C=>this.floatingFilterUiChanged(e,C),g.model=Te(this.model,f),g.onModelChange=(C,v)=>{this.updateStoredModel(f,C),this.refreshHandlerAndUi(e,C,"floating",!0,v).then(()=>{m({...v,source:"columnFilter"})})},g.getHandler=()=>this.getHandler(e,!0),g.source="init"}return eC(o,a,h,c)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,o,i){const s="paramsUpdated";if(e.isHandler){const n=t.getColId();delete this.initialModel[n],this.state.delete(n);const r=e.filterUi,a=this.createFilterUiForHandler(o,i);e.filterUi=a;const l=this.eventSvc;r?.created?r.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:s,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:s,column:t})}else this.destroyFilter(t,s)}destroyFilter(e,t="api"){const o=e.getColId(),i=this.allColumnFilters.get(o);this.disposeColumnListener(o),delete this.initialModel[o],i&&this.disposeFilterWrapper(i,t).then(s=>{s&&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:i,isHandler:s,filterUi:n}=e,r=i.getColId();s&&(o=this.isHandlerActive(i),this.destroyBean(e.handler),delete this.model[r],this.state.delete(r));const a=()=>{this.setColFilterActive(i,!1,"filterDestroyed"),this.allColumnFilters.delete(r),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:i})};if(n){if(n.created)return n.promise.then(l=>(o=s?o:!!l?.isFilterActive(),this.destroyBean(l),a(),o));a()}return se.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 i=this.beans,s=o.column,n=s.getColDef(),r=s.isFilterAllowed(),a=this.getDefaultFilter(s),l=i.selectableFilter,c=l?.isSelectable(n)?l.getFilterDef(s,n):n,d=r?this.createHandlerFunc(s,c,this.getDefaultFilter(s)):void 0,u=!!d,h=o.isHandler;if(h!=u){this.destroyFilter(s,"paramsUpdated");return}const{compDetails:g,createFilterUi:f}=(r?this.createFilterComp(s,c,a,C=>C,u,"colDef"):null)??{compDetails:null,createFilterUi:null},m=g?.params??zn(i.userCompFactory,c,this.createFilterCompParams(s,u,"colDef"));if(h){const C=d?.handlerNameOrCallback??d?.filterHandler,v=Te(this.model,e);if(o.handlerGenerator!=C){const w=o.handler,{handler:b,handlerParams:y}=this.createHandlerFromFunc(s,d.filterHandler,m);o.handler=b,o.handlerParams=y,o.handlerGenerator=C,delete this.model[e],b.init?.({...y,source:"init",model:null}),this.destroyBean(w),v!=null&&this.beans.filterManager?.onFilterChanged({columns:[s],source:t})}else{const w=this.createHandlerParams(s,g?.params);o.handlerParams=w,o.handler.refresh?.({...w,source:"colDef",model:v})}}if(this.areFilterCompsDifferent(o.filterUi?.compDetails??null,g)||!o.filterUi||!g){this.destroyFilterUi(o,s,g,f);return}o.filterUi.filterParams=m,Jt(o,h)?.then(C=>{(C?.refresh?C.refresh(m):!0)===!1?this.destroyFilterUi(o,s,g,f):this.dispatchLocalEvent({type:"filterParamsChanged",column:s,params:m})})}refreshHandlerAndUi(e,t,o,i,s){const n=this.cachedFilter(e);if(!n)return i&&this.getOrCreateFilterWrapper(e,!0),se.resolve();if(!n.isHandler)return se.resolve();const{filterUi:r,handler:a,handlerParams:l}=n;return kx(()=>{if(r){const{created:c,filterParams:d}=r;if(c)return r.promise.then(u=>u?{filter:u,filterParams:d}:void 0);r.refreshed=!0}return se.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},o,s)}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:i}=t;return!(o===i||o?.render&&i?.render&&o.render===i.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const o=this.getOrCreateFilterUi(t);return o?new Promise(i=>{o.then(s=>{i(No(s))})}):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:i,model:s}=this,n=e.getColId(),r=i.get(n);return r?r.model??null:Te(s,n)}const o=this.cachedFilter(e);return o?this.getModelFromFilterWrapper(o):null}setModelForColumn(e,t){if(this.beans.dataTypeSvc?.isPendingInference){let o=()=>{};const i=new Promise(s=>{o=s});return this.columnModelUpdates.push({key:e,model:t,resolve:o}),i}return new Promise(o=>{this.setModelForColumnLegacy(e,t).then(i=>o(i))})}getStateForColumn(e){return this.state.get(e)??{model:Te(this.model,e)}}setModelForColumnLegacy(e,t){const o=this.beans.colModel.getColDefCol(e),i=o?this.getOrCreateFilterWrapper(o,!0):null;return i?this.setModelOnFilterWrapper(i,t):se.resolve()}setColDefPropsForDataType(e,t,o){const i=e.filter,s=i===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):i;if(typeof s!="string")return;let n,r;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;s==="agMultiColumnFilter"?{filterParams:n,filterValueGetter:r}=a.multiFilter?.getParamsForDataType(l,c,t,o)??{}:{filterParams:n,filterValueGetter:r}=Xx(s,l,c,t,o,a,this.getLocaleTextFunc()),e.filterParams=n,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,o,i){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",o)),e.dispatchColEvent("filterChanged",o,i)}setModelOnFilterWrapper(e,t,o){return new se(i=>{if(e.isHandler){const n=e.column,r=n.getColId(),a=this.model[r];if(this.updateStoredModel(r,t),o&&t===a){i();return}this.refreshHandlerAndUi(n,t,"api").then(()=>i());return}const s=Jt(e);if(s){s.then(n=>{if(typeof n?.setModel!="function"){D(65),i();return}(n.setModel(t)||se.resolve()).then(()=>i())});return}i()})}updateStoredModel(e,t){O(t)?this.model[e]=t:delete this.model[e];const o=this.state.get(e),i={model:t,state:o?.state};this.state.set(e,i)}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 i=e.getColId(),s=this.cachedFilter(e),n=()=>s?.filterUi;Yc({action:t,filterParams:s?.filterUi?.filterParams,getFilterUi:n,getModel:()=>Te(this.model,i),getState:()=>this.state.get(i),updateState:r=>this.updateState(e,r),updateModel:r=>n()?.filterParams?.onModelChange(r,{...o,fromAction:t}),processModelToApply:s?.isHandler?s.handler.processModelToApply?.bind(s.handler):void 0})}updateAllModels(e,t){const o=[];this.allColumnFilters.forEach((i,s)=>{const n=this.beans.colModel.getColDefCol(s);n&&Yc({action:e,filterParams:i.filterUi?.filterParams,getFilterUi:()=>i.filterUi,getModel:()=>Te(this.model,s),getState:()=>this.state.get(s),updateState:r=>this.updateState(n,r),updateModel:r=>{this.updateStoredModel(s,r),this.dispatchLocalEvent({type:"filterAction",column:n,action:e}),o.push(this.refreshHandlerAndUi(n,r,"ui"))},processModelToApply:i?.isHandler?i.handler.processModelToApply?.bind(i.handler):void 0})}),o.length&&se.all(o).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();wg(()=>this.cachedFilter(e)?.filterUi,()=>Te(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 s of o)if(s.source==="COLUMN_MENU")return!1;let i=!1;for(const s of e.keys()){const n=e.get(s);if(n.valid===!1)return!1;(n.model??null)!==Te(t,s)&&(i=!0)}return i}hasUnappliedModel(e){const{model:t,state:o}=this;return(o.get(e)?.model??null)!==Te(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const o=this.beans.filterPanelSvc;return o?.isActive?!!o.getState(e.getColId()):!1}onPivotModeChanged(e){const{colModel:t,pivotColsSvc:o}=this.beans,i=!!Ys(this.gos),s=e.currentValue,n=s?this.activeColumnFilters:this.activeAggregateFilters,r=s?this.activeAggregateFilters:this.activeColumnFilters,a=[];for(const l of n){const c=t.getColById(l.colId),d=s&&!!o?.columns.length;c&&s===td(c,s,d,i)&&(r.push(l),a.push(l))}Ep(n,a)}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function rP(e){return!!e.filterManager?.isAnyFilterPresent()}function aP(e,t="api"){e.filterManager?.onFilterChanged({source:t})}var lP=class extends x{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:i})=>this.onAdvFilterEnabledChanged(i),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos: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 typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,o="api"){this.isAdvFilterEnabled()||this.colFilter?.setState(e,t,o)}setFilterModel(e,t="api",o){if(this.isAdvFilterEnabled()){o||this.warnAdvFilters();return}this.colFilter?.setModel(e,t)}getFilterModel(){return this.colFilter?.getModel()??{}}getFilterState(){return this.colFilter?.getState()}isColumnFilterPresent(){return!!this.colFilter?.isFilterPresent()}isAggregateFilterPresent(){return!!this.colFilter?.isAggFilterPresent()}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){e?this.colFilter?.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):this.advancedFilter?.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){return!!this.advancedFilter?.isEnabled()}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){Ys(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:o,columns:i=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):se.resolve()).then(()=>{const s={source:t,type:"filterChanged",columns:i};o&&_e(s,o),this.eventSvc.dispatchEvent(s),this.colFilter?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.colFilter?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilter?.isFilterPresent()}updateAggFiltering(){this.aggFiltering=!!Ys(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){const{rowNode:t}=e;return this.alwaysPassFilter?.(t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){const{rowNode:t}=e;return this.alwaysPassFilter?.(t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){return this.isAdvFilterEnabled()?!1:!!this.colFilter?.isFilterAllowed(e)}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){if(this.isAdvFilterEnabled()){if(this.beans.dataTypeSvc?.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return this.isAdvFilterEnabled()?!1:!!this.colFilter?.hasFloatingFilters()}getColumnFilterInstance(e){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):this.colFilter?.getFilterInstance(e)??Promise.resolve(void 0)}warnAdvFilters(){D(68)}setupAdvFilterHeaderComp(e){this.advancedFilter?.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):this.colFilter?.setModelForColumn(e,t)??Promise.resolve()}};function cP(e){return{tag:"div",cls:e}}var dP=class extends ye{constructor(e){const{className:t="ag-filter-apply-panel"}=e??{};super(cP(t)),this.listeners=[],this.validationMessage=null,this.className=t}updateButtons(e,t){const o=this.buttons;if(this.buttons=e,o===e)return;const i=this.getGui();Xe(i);let s;this.destroyListeners();const n=document.createDocumentFragment(),r=this.className,a=({type:c,label:d})=>{const u=v=>{this.dispatchLocalEvent({type:c,event:v})};["apply","clear","reset","cancel"].includes(c)||D(75);const h=c==="apply",f=st({tag:"button",attrs:{type:h&&t?"submit":"button"},ref:`${c}FilterButton`,cls:`ag-button ag-standard-button ${r}-button${h?" "+r+"-apply-button":""}`,children:d});this.activateTabIndex([f]),h&&(s=f);const m=v=>{v.key===R.ENTER&&(v.preventDefault(),u(v))},C=this.listeners;f.addEventListener("click",u),C.push(()=>f.removeEventListener("click",u)),f.addEventListener("keydown",m),C.push(()=>f.removeEventListener("keydown",m)),n.append(f)};for(const c of e)a(c);this.eApply=s;const l=this.validationTooltipFeature;s&&!l?this.validationTooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eApply,getLocation:()=>"advancedFilter",getTooltipShowDelayOverride:()=>1e3})):!s&&l&&(this.validationTooltipFeature=this.destroyBean(l)),i.append(n)}getApplyButton(){return this.eApply}updateValidity(e,t=null){const o=this.eApply;o&&(Qi(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()}},uP=class extends ye{constructor(e,t,o,i,s,n){super(),this.column=e,this.wrapper=t,this.eventParent=o,this.updateModel=i,this.isGlobalButtons=s,this.enableGlobalButtonCheck=n,this.hidePopup=null,this.applyActive=!1}postConstruct(){const{comp:e,params:t}=this.wrapper,o=t,i=o.useForm,s=i?"form":"div";this.setTemplate({tag:s,cls:"ag-filter-wrapper"}),i&&this.addManagedElementListeners(this.getGui(),{submit:n=>{n?.preventDefault()},keydown:this.handleKeyDown.bind(this)}),this.appendChild(e.getGui()),this.params=o,this.resetButtonsPanel(o),this.addManagedListeners(this.eventParent,{filterParamsChanged:({column:n,params:r})=>{n===this.column&&this.resetButtonsPanel(r,this.params)},filterStateChanged:({column:n,state:r})=>{n===this.column&&this.eButtons?.updateValidity(r.valid!==!1)},filterAction:({column:n,action:r,event:a})=>{n===this.column&&this.afterAction(r,a)},...this.enableGlobalButtonCheck?{filterGlobalButtons:({isGlobal:n})=>{if(n!==this.isGlobalButtons){this.isGlobalButtons=n;const r=this.params;this.resetButtonsPanel(r,r,!0)}}}:void 0})}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup)}resetButtonsPanel(e,t,o){const{buttons:i,readOnly:s}=t??{},{buttons:n,readOnly:r,useForm:a}=e;if(!o&&s===r&&ji(i,n))return;const l=n&&n.length>0&&!e.readOnly&&!this.isGlobalButtons;let c=this.eButtons;if(l){const d=n.map(u=>{const h=`${u}Filter`;return{type:u,label:ft(this,h)}});if(this.applyActive=Fn(this.params),!c){c=this.createBean(new dP),this.appendChild(c.getGui());const u=this.column,h=g=>({event:f})=>{this.updateModel(u,g,{fromButtons:!0}),this.afterAction(g,f)};c?.addManagedListeners(c,{apply:h("apply"),clear:h("clear"),reset:h("reset"),cancel:h("cancel")}),this.eButtons=c}c.updateButtons(d,a)}else this.applyActive=!1,c&&(_t(c.getGui()),this.eButtons=this.destroyBean(c))}close(e){const t=this.hidePopup;if(!t)return;const o=e,i=o?.key;let s;(i===R.ENTER||i===R.SPACE)&&(s={keyboardEvent:o}),t(s),this.hidePopup=null}afterAction(e,t){const{params:o,applyActive:i}=this,s=o?.closeOnApply;switch(e){case"apply":{t?.preventDefault(),s&&i&&this.close(t);break}case"reset":{s&&i&&this.close();break}case"cancel":{s&&this.close(t);break}}}handleKeyDown(e){!e.defaultPrevented&&e.key===R.ENTER&&this.applyActive&&(this.updateModel(this.column,"apply",{fromButtons:!0}),this.afterAction("apply",e))}destroy(){this.hidePopup=null,this.eButtons=this.destroyBean(this.eButtons)}},hP=":where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}",gP={tag:"div",cls:"ag-filter"},pP=class extends ye{constructor(e,t,o){super(gP),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 this.wrapper!=null}getFilter(){return this.wrapper?.then(e=>e.comp)??null}afterInit(){return this.wrapper?.then(()=>{})??se.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:i}}=this,s=i.getFilterUiForDisplay(t)??null;this.wrapper=s,s?.then(n=>{if(!n)return;const{isHandler:r,comp:a}=n;let l;if(r){const c=!!this.enableGlobalButtonCheck,d=this.createBean(new uP(t,n,i,i.updateModel.bind(i),c&&i.isGlobalButtons,c));this.comp=d,l=d.getGui()}else this.registerCSS(hP),l=a.getGui(),O(l)||D(69,{guiFromFilter:l});this.appendChild(l),e?this.eventSvc.dispatchEvent({type:"filterOpened",column:t,source:o,eGui:this.getGui()}):a.afterGuiAttached?.(this.afterGuiAttachedParams)})}onFilterDestroyed(e){const{source:t,column:o}=e;(t==="api"||t==="paramsUpdated")&&o.getId()===this.column.getId()&&this.beans.colModel.getColDefCol(this.column)&&(Xe(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()}},fP=class extends x{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){this.hidePopup?.()}showMenuAfterMouseEvent(e,t,o,i){e&&!e.isColumn||this.showPopup(e,s=>{this.popupSvc?.positionPopupUnderMouseEvent({additionalParams:{column:e},type:o,mouseEvent:t,ePopup:s})},o,t.target,Ze(this.gos),i)}showMenuAfterButtonClick(e,t,o,i){if(e&&!e.isColumn)return;let s=-1,n="left";const r=Ze(this.gos);!r&&this.gos.get("enableRtl")&&(s=1,n="right");const a=r?void 0:4*s,l=r?void 0:4;this.showPopup(e,c=>{this.popupSvc?.positionPopupByComponent({type:o,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:n,keepWithinBounds:!0,position:"under",additionalParams:{column:e}})},o,t,r,i)}showPopup(e,t,o,i,s,n){const r=e?this.createBean(new pP(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!r?.hasFilter()||!e){ce(57);return}const a=st({tag:"div",cls:`ag-menu${s?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:m=>this.trapFocusWithin(m,a)}),a.appendChild(r?.getGui());let l;const c=()=>r?.afterGuiDetached(),d=$f(this.gos)?i??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,u=m=>{Qc(e,!1,"contextMenu");const C=m instanceof KeyboardEvent;this.tabListener&&(this.tabListener=this.tabListener()),C&&i&&vt(i)&&Du(i)?.focus({preventScroll:!0}),c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,o,e),n?.()},h=this.getLocaleTextFunc(),g=s&&o!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),f=this.popupSvc?.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:u,positionCallback:()=>t(a),anchorToElement:d,ariaLabel:g});f&&(this.hidePopup=l=f.hideFunc),r.afterInit().then(()=>{t(a),r.afterGuiAttached({container:o,hidePopup:l})}),Qc(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,o,e)}trapFocusWithin(e,t){e.key!==R.TAB||e.defaultPrevented||$o(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),Ho(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()}},mP=class extends x{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,o){if(!t)return;const i=e.getColDef(),{selectableFilter:s,valueSvc:n,formula:r}=this.beans,a=o??s?.getFilterValueGetter(e.getColId())??i.filterValueGetter;if(a)return this.executeFilterValueGetter(a,t.data,e,t,i);const l=n.getValue(e,t,"data");return e.isAllowFormula()&&r?.isFormula(l)?r.resolveValue(e,t):l}executeFilterValueGetter(e,t,o,i,s){const{expressionSvc:n,valueSvc:r}=this.beans,a=K(this.gos,{data:t,node:i,column:o,colDef:s,getValue:r.getValueCallback.bind(r,i)});return typeof e=="function"?e(a):n?.evaluate(e,a)}},CP={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},vP=class extends ye{constructor(){super(CP,[In]),this.eFloatingFilterText=W}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const o=e,i=o.getHandler();if(i.getModelAsString){const s=i.getModelAsString(o.model);this.eFloatingFilterText.setValue(s)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const o=t.getModelAsString(e);this.eFloatingFilterText.setValue(o)}})}refresh(e){this.init(e)}},wP=class extends ja{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){const t=this.eInput;e.selected&&e.name&&t.name&&t.name===e.name&&e.id&&t.id!==e.id&&this.setValue(!1,!0)}},al=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const o=e.filterOptions??t;this.filterOptions!==o&&(this.filterOptions=o,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const o=[["displayKey"],["displayName"],["predicate","test"]],i=s=>s.some(n=>t[n]!=null)?!0:(D(72,{keys:s}),!1);if(!o.every(i)){this.filterOptions=e.filter(s=>s===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const o=t[0];if(typeof o=="string")return o;if(o.displayKey)return o.displayKey;D(73)}else D(74)}getCustomOption(e){return this.customFilterOptions[e]}};function $i(e,t,o){return o==null?e.splice(t):e.splice(t,o)}function pn(e){return e==null||typeof e=="string"&&e.trim().length===0}function bP(e){return e==="AND"||e==="OR"?e:"AND"}function SP(e,t,o){if(e==null)return;const{predicate:i}=e;if(i!=null&&!t.some(s=>s==null))return i(t,o)}function yP(e,t){let o=e.length;return o>t&&(e.splice(t),D(78),o=t),o}var RP=new Set(["empty","notBlank","blank","today","yesterday","tomorrow","thisWeek","lastWeek","nextWeek","thisMonth","lastMonth","nextMonth","thisQuarter","lastQuarter","nextQuarter","thisYear","lastYear","nextYear","yearToDate","last7Days","last30Days","last90Days","last6Months","last12Months","last24Months"]);function uo(e,t){const o=t.getCustomOption(e);if(o){const{numberOfInputs:i}=o;return i??1}return e&&RP.has(e)?0:e==="inRange"?2:1}var kn=class extends hC{constructor(e,t,o){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=o,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}setParams(e){super.setParams(e);const t=new al;this.optionsFactory=t,t.init(e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e)}commonUpdateSimpleParams(e){this.setNumConditions(e),this.defaultJoinOperator=bP(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions(),Qe(this.getGui(),"tabindex",this.isReadOnly()?"-1":null)}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,o)=>{const i=o===0?e:this.optionsFactory.defaultOption;t.setValue(i,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const o=!e.operator,i=!t.operator;if(!o&&i||o&&!i)return!1;let n;if(o){const r=e,a=t;n=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;n=r.operator===a.operator&&ho(r.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return n}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),se.resolve();if(e.operator){const i=e;let s=i.conditions;s==null&&(s=[],D(77));const n=yP(s,this.maxNumConditions),r=this.getNumConditions();if(n<r)this.removeConditionsAndOperators(n);else if(n>r)for(let l=r;l<n;l++)this.createJoinOperatorPanel(),this.createOption();const a=i.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),s.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const i=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(i.type,!0),this.setConditionIntoUi(i,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),se.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(D(79),t=1),this.maxNumConditions=t;let o=e.numAlwaysVisibleConditions??1;o<1&&(D(80),o=1),o>t&&(D(81),o=t),this.numAlwaysVisibleConditions=o}createOption(){const e=this.getGui(),t=this.createManagedBean(new rl);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const o=this.createEValue();this.eConditionBodies.push(o),e.appendChild(o),this.putOptionsIntoDropdown(t),this.resetType(t);const i=this.getNumConditions()-1;this.forEachPositionInput(i,s=>this.resetInput(s)),this.addChangedListeners(t,i)}createJoinOperatorPanel(){const e=st({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),o=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const i=this.eJoinPanels.length-1,s=this.joinOperatorId++;this.resetJoinOperatorAnd(t,i,s),this.resetJoinOperatorOr(o,i,s),this.isReadOnly()||(t.onValueChange(this.listener),o.onValueChange(this.listener))}createJoinOperator(e,t,o){const i=this.createManagedBean(new wP);e.push(i);const s="ag-filter-condition-operator";return i.addCss(s),i.addCss(`${s}-${o}`),t.appendChild(i.getGui()),i}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const o of t)e.addOption(o);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,o=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:o?this.getLocaleTextFunc()(o.displayKey,o.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let o=0;o<this.getNumConditions();o++)this.isConditionUiComplete(o)?e=o:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const o=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<o){this.removeConditionsAndOperators(o+1);const i=e+1,s=o-i;s>0&&this.removeConditionsAndOperators(i,s),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((i,s)=>{const n=this.isConditionDisabled(s,e);i.setDisabled(n||this.filterListOptions.length<=1),s===1&&(Qi(this.eJoinPanels[0],n),this.eJoinAnds[0].setDisabled(n),this.eJoinOrs[0].setDisabled(n))}),this.eConditionBodies.forEach((i,s)=>{me(i,this.isConditionBodyVisible(s))});const o=(t??this.getJoinOperator())==="OR";for(const i of this.eJoinAnds)i.setValue(!o,!0);for(const i of this.eJoinOrs)i.setValue(o,!0);this.forEachInput((i,s,n,r)=>{this.setElementDisplayed(i,s<r),this.setElementDisabled(i,this.isConditionDisabled(n,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:o,eConditionBodies:i,eJoinPanels:s,eJoinAnds:n,eJoinOrs:r}=this;this.removeComponents(o,e,t),this.removeElements(i,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(s,a,t),this.removeComponents(n,a,t),this.removeComponents(r,a,t)}removeElements(e,t,o){const i=$i(e,t,o);for(const s of i)_t(s)}removeComponents(e,t,o){const i=$i(e,t,o);for(const s of i)_t(s.getGui()),this.destroyBean(s)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus){let t;if(!this.isReadOnly()){const o=this.getInputs(0)[0];o instanceof Fo&&this.isConditionBodyVisible(0)?t=o.getInputElement():t=this.eTypes[0]?.getFocusableElement()}(t??this.getGui()).focus({preventScroll:!0})}}shouldKeepInvalidInputState(){return!1}afterGuiDetached(){super.afterGuiDetached();const e=this.params;if(this.beans.colFilter?.shouldKeepStateOnDetach(e.column)||this.shouldKeepInvalidInputState())return;e.onStateChange({model:e.model});let t=-1,o=-1,i=!1;const s=this.getJoinOperator();for(let r=this.getNumConditions()-1;r>=0;r--)if(this.isConditionUiComplete(r))t===-1&&(t=r,o=r);else{const a=r>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(r-1),l=r<t;(a||l)&&(this.removeConditionsAndOperators(r,1),i=!0,l&&o--)}let n=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),n=!0),this.shouldAddNewConditionAtEnd(o===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),n=!0),n&&this.updateConditionStatusesAndValues(o,s),i&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=o}getModelAsString(e){return this.params.getHandler()?.getModelAsString?.(e)??""}resetPlaceholder(){const e=this.getLocaleTextFunc(),{filterPlaceholder:t,eTypes:o}=this;this.forEachInput((i,s,n,r)=>{if(!(i instanceof Fo))return;const a=s===0&&r>1?"inRangeStart":s===0?"filterOoo":"inRangeEnd",l=s===0&&r>1?e("ariaFilterFromValue","Filter from value"):s===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value"),c=o[n].getValue(),d=Iu(this,t,a,c);i.setInputPlaceholder(d),i.setInputAriaLabel(l)})}setElementValue(e,t,o){e instanceof Fo&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){Nl(e)&&me(e.getGui(),t)}setElementDisabled(e,t){Nl(e)&&Qi(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Fo&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,o)=>{this.forEachPositionTypeInput(o,t,e)})}forEachPositionInput(e,t){const o=this.getConditionType(e);this.forEachPositionTypeInput(e,o,t)}forEachPositionTypeInput(e,t,o){const i=uo(t,this.optionsFactory),s=this.getInputs(e);for(let n=0;n<s.length;n++){const r=s[n];r!=null&&o(r,n,e,i)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return uo(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(o=>o==null)||this.positionHasInvalidInputs(e))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,o)=>this.resetJoinOperatorAnd(t,o,this.joinOperatorId+o)),this.eJoinOrs.forEach((t,o)=>this.resetJoinOperatorOr(t,o,this.joinOperatorId+o)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const o=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(o).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,o){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),o)}resetJoinOperatorOr(e,t,o){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),o)}resetJoinOperator(e,t,o,i,s){this.updateJoinOperatorDisabled(e.setValue(o,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${s}`).setLabel(i),t)}updateJoinOperatorsDisabled(){const e=(t,o)=>this.updateJoinOperatorDisabled(t,o);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const o=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((i,s,n)=>{n===t&&this.setElementValue(i,o[s]!=null?o[s]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,o,i)=>{this.setElementValue(t,o===0&&i===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,o=>{this.attachElementOnChange(o,this.listener)}))}hasInvalidInputs(){return!1}positionHasInvalidInputs(e){return!1}isReadOnly(){return!!this.params.readOnly}},ll=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function ia(e){return e?.allowedCharPattern??null}function bg(e,t){const{filter:o,filterTo:i,type:s}=e||{};return[et(o),et(i)].slice(0,uo(s,t))}var FP=class extends kn{constructor(){super("bigintFilter",bg,ll),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="bigint",this.defaultDebounceMs=500}afterGuiAttached(e){super.afterGuiAttached(e),this.refreshInputValidation()}shouldKeepInvalidInputState(){return!wi()&&this.hasInvalidInputs()&&this.getConditionTypes().includes("inRange")}refreshInputValidation(){for(let e=0;e<this.eValuesFrom.length;e++){const t=this.eValuesFrom[e],o=this.eValuesTo[e];this.refreshInputPairValidation(t,o)}}refreshInputPairValidation(e,t,o=!1){const{bigintParser:i}=this.params,s=this.getParsedValue(e,i),n=this.getParsedValue(t,i),r=this.isInvalidValue(e,s),a=this.isInvalidValue(t,n),l=o?e:t,c=o?t:e,d=o?r:a,u=o?a:r;let h="";if(d)h=this.getLocaleTextFunc()("invalidBigInt","Invalid BigInt");else if(!r&&!a){const g=EP(s,n,o);g&&(h=this.translate(g,[String(o?t.getValue():e.getValue())]))}l.setCustomValidity(h),u||c.setCustomValidity(""),h.length>0&&this.beans.ariaAnnounce.announceValue(h,"dateFilter")}getState(){return{isInvalid:this.hasInvalidInputs()}}areStatesEqual(e,t){return(e?.isInvalid??!1)===(t?.isInvalid??!1)}refresh(e){const t=super.refresh(e),{state:o,additionalEventAttributes:i}=e,s=this.state,n=i?.fromAction;return(n&&n!="apply"||o.model!==s.model||!this.areStatesEqual(o.state,s.state))&&this.refreshInputValidation(),t}setElementValue(e,t,o){super.setElementValue(e,t,o),t===null&&e.setCustomValidity("")}createEValue(){const{params:e,eValuesFrom:t,eValuesTo:o}=this,i=ia(e),s=st({tag:"div",cls:"ag-filter-body",role:"presentation"}),n=this.createFromToElement(s,t,"from",i),r=this.createFromToElement(s,o,"to",i),a=(d,u,h)=>()=>this.refreshInputPairValidation(d,u,h),l=a(n,r,!0);n.onValueChange(l),n.addGuiEventListener("focusin",l);const c=a(n,r,!1);return r.onValueChange(c),r.addGuiEventListener("focusin",c),s}createFromToElement(e,t,o,i){const s=this.createManagedBean(i?new $t({allowedCharPattern:i}):new $t);return s.addCss(`ag-filter-${o}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui()),s}removeEValues(e,t){const o=i=>this.removeComponents(i,e,t);o(this.eValuesFrom),o(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(o,i,s,n)=>{i<n&&t.push(et(o.getValue()??null))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),o={filterType:this.filterType,type:t},i=this.getValues(e);return i.length>0&&(o.filter=String(i[0])),i.length>1&&(o.filterTo=String(i[1])),o}removeConditionsAndOperators(e,t){if(!this.hasInvalidInputs())return super.removeConditionsAndOperators(e,t)}getInputs(e){const{eValuesFrom:t,eValuesTo:o}=this;return e>=t.length?[null,null]:[t[e],o[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>e||(e=!t.getInputElement().validity.valid)),e}positionHasInvalidInputs(e){let t=!1;return this.forEachPositionInput(e,o=>t||(t=!o.getInputElement().validity.valid)),t}canApply(e){return!this.hasInvalidInputs()}getParsedValue(e,t){const o=e.getValue();return o==null||typeof o=="string"&&o.trim()===""?null:t?t(o):et(o)}isInvalidValue(e,t){const o=e.getValue();return o!=null&&String(o).trim()!==""&&t===null}};function EP(e,t,o){return e!=null&&t!=null&&e>=t?`strict${o?"Max":"Min"}ValueValidation`:null}var Sg=class extends x{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,o=new al;this.optionsFactory=o,o.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(o,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,o=this.optionsFactory;o.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:o,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:o}=t,i=[];if(o){const r=t;i.push(...r.conditions??[])}else i.push(t);const s=o&&o==="OR"?"some":"every",n=this.params.getValue(e.node);return i[s](r=>this.individualConditionPasses(e,r,n))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:o,maxNumConditions:i}}=e;if(t==null)return;let n=yu(t)?t.conditions:[t];const r=o?.map(d=>typeof d=="string"?d:d.displayKey)??this.defaultOptions;if(!(!n||n.every(d=>r.find(u=>u===d.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((n&&!n.every(d=>d.filterType===c)||t.filterType!==c)&&(n=n.map(d=>({...d,filterType:c})),l=!0),typeof i=="number"&&n&&n.length>i&&(n=n.slice(0,i),l=!0),l){const d=n.length>1?{...t,filterType:c,conditions:n}:{...n[0],filterType:c};this.params={...e,model:d},e.onModelChange(d)}}individualConditionPasses(e,t,o){const i=this.optionsFactory,s=this.mapValuesFromModel(t,i),n=i.getCustomOption(t.type),r=SP(n,s,o);return r??(o==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,o,t,e))}},cl=class extends Sg{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:o,includeBlanksInGreaterThan:i,includeBlanksInLessThan:s,includeBlanksInRange:n}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(o)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(i)return!0;break;case"lessThan":case"lessThanOrEqual":if(s)return!0;break;case"inRange":if(n)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,o){const i=o.type;if(!this.isValid(t))return i==="notEqual"||i==="notBlank";const s=this.comparator(),n=e[0]!=null?s(e[0],t):0;switch(i){case"equals":return n===0;case"notEqual":return n!==0;case"greaterThan":return n>0;case"greaterThanOrEqual":return n>=0;case"lessThan":return n<0;case"lessThanOrEqual":return n<=0;case"inRange":{const r=s(e[1],t);return this.params.filterParams.inRangeInclusive?n>=0&&r<=0:n>0&&r<0}case"blank":return pn(t);case"notBlank":return!pn(t);default:return D(76,{filterModelType:i}),!0}}},dl={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},xP={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},Ln=class extends x{constructor(e,t,o){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=o}getModelAsString(e,t){const o=this.getLocaleTextFunc(),i=t==="filterToolPanel";if(!e)return i?ft(this,"filterSummaryInactive"):null;if(e.operator!=null){const n=e,a=(n.conditions??[]).map(c=>this.getModelAsString(c,t)),l=n.operator==="AND"?"andCondition":"orCondition";return a.join(` ${ft(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return i?ft(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):o(e.type,e.type);{const n=e,r=this.optionsFactory.getCustomOption(n.type),{displayKey:a,displayName:l,numberOfInputs:c}=r||{};return a&&l&&c===0?o(a,l):this.conditionToString(n,i,n.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:o}=e;this.optionsFactory=t,this.filterParams=o}conditionForToolPanel(e,t,o,i,s,n){let r;const a=this.getTypeKey(e);return a&&(r=ft(this,a)),s&&n&&(r=this.getLocaleTextFunc()(s,n)),r!=null?t?`${r} ${ft(this,"filterSummaryInRangeValues",[o(),i()])}`:`${r} ${o()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},yg=class extends Ln{constructor(e,t){super(e,t,t.bigintFormatter),this.filterTypeKeys=dl}conditionToString(e,t,o,i,s){const{filter:n,filterTo:r,type:a}=e,l=this.formatValue.bind(this),c=et(n),d=et(r);if(t){const u=this.conditionForToolPanel(a,o,()=>l(c),()=>l(d),i,s);if(u!=null)return u}return o?`${l(c)}-${l(d)}`:n!=null?l(c):`${a}`}},PP=class extends cl{constructor(){super(bg,ll),this.filterType="bigint",this.FilterModelFormatterClass=yg}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return et(e)!==null}},ul=class extends x{constructor(e){super(),this.params=e,this.eInput=W,this.onValueChanged=()=>{}}setupGui(e){this.eInput=this.createManagedBean(new $t(this.params?.config));const t=this.eInput.getGui();e.appendChild(t);const o=i=>this.onValueChanged(i);this.addManagedListeners(t,{input:o,keydown:o})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t,placeholder:o}){const{eInput:i}=this;i.setInputAriaLabel(e),t!==void 0&&i.setAutoComplete(t),i.toggleCss("ag-floating-filter-search-icon",!!o),i.setInputPlaceholder(o)}};function sa(e){const t=e?.trim();return t===""?e:t}function Rg(e,t){const{filter:o,filterTo:i,type:s}=e||{};return[o||null,i||null].slice(0,uo(s,t))}var Fg=class extends ye{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let o;t?o=e.conditions[0]:o=e,this.lastType=o.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const o=e;return this.isTypeEditable(o.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const o=e;this.onModelUpdated(o.model)}}setParams(e){const t=new al;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const o=this.optionsFactory.defaultOption;t||(this.lastType=o),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(o);this.setEditable(i)}refresh(e){this.params=e;const t=e,o=this.reactive;if((!o||t.source==="colDef")&&this.updateParams(e),o){const{source:i,model:s}=t;if(i==="dataChanged"||i==="ui")return;this.onModelUpdated(s)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t?.afterFloatingFilter||t?.afterDataChange||this.onModelUpdated(e)}isTypeEditable(e){return!!e&&!this.readOnly&&uo(e,this.optionsFactory)===1}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},DP={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},hl=class extends Fg{constructor(){super(...arguments),this.eFloatingFilterInputContainer=W,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(DP)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const{inputSvc:t,defaultDebounceMs:o,readOnly:i}=this,{filterPlaceholder:s,column:n,browserAutoComplete:r,filterParams:a}=e,l=this.lastType??this.optionsFactory.defaultOption,c=e.filterParams.filterPlaceholder,d=s===!0?Iu(this,c,"filterOoo",l):s||void 0;if(t.setParams({ariaLabel:this.getAriaLabel(n),autoComplete:r??!1,placeholder:d}),this.applyActive=Fn(a),!i){const u=Ga(a,o);t.setValueChangedListener(xe(this,this.syncUpWithParentFilter.bind(this),u))}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,o=t.getValue();Xe(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(o,!0)}syncUpWithParentFilter(e){const t=e.key===R.ENTER,o=this.reactive;if(o&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:i,params:s,lastType:n}=this;let r=i.getValue();if(s.filterParams.trimInput&&(r=sa(r),i.setValue(r,!0)),o){const a=s,l=a.model,c=this.convertValue(r),d=c==null?null:{...l??{filterType:this.filterType,type:n??this.optionsFactory.defaultOption},filter:c};a.onModelChange(d,{afterFloatingFilter:!0})}else s.parentFilterInstance(a=>{a?.onFloatingFilterChanged(n||null,r||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},MP=class extends hl{constructor(){super(...arguments),this.FilterModelFormatterClass=yg,this.filterType="bigint",this.defaultOptions=ll}updateParams(e){const t=e.filterParams;ia(t)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),this.bigintParser=t?.bigintParser,super.updateParams(e)}createFloatingFilterInputService(e){const t=e.filterParams;this.allowedCharPattern=ia(t),this.bigintParser=t?.bigintParser;const o=this.allowedCharPattern?{allowedCharPattern:this.allowedCharPattern}:void 0;return this.createManagedBean(new ul({config:o}))}convertValue(e){return e==null||e===""?null:this.bigintParser?this.bigintParser(e):et(e)}},od=".ag-input-field-input",Eg=class{constructor(e,t,o,i,s,n){this.context=e,this.eParent=s,this.alive=!0,this.debouncedReport=xe({isAlive:()=>this.alive},id,500),this.timeoutHandle=null,Jm(t,o,i)?.newAgStackInstance().then(a=>{if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;s.appendChild(a.getGui()),a?.afterGuiAttached?.();const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&a.setDisabled?.(c),n?.(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){const t=this.dateComp;t?t.setDisabled?.(e):this.disabled=e}setDisplayed(e){me(this.eParent,e)}setInputPlaceholder(e){this.dateComp?.setInputPlaceholder?.(e)}setInputAriaLabel(e){this.dateComp?.setInputAriaLabel?.(e)}afterGuiAttached(e){this.dateComp?.afterGuiAttached?.(e)}updateParams(e){this.dateComp?.refresh?.(e)}setCustomValidity(e,t=!1){const o=this.dateComp?.getGui().querySelector(od);if(o&&"setCustomValidity"in o){const i=e.length>0;o.setCustomValidity(e),i?t?this.timeoutHandle=this.debouncedReport(o):id(o):this.timeoutHandle&&window.clearTimeout(this.timeoutHandle),va(o,i)}}getValidity(){return this.dateComp?.getGui().querySelector(od)?.validity}};function id(e){e.reportValidity()}var gl=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function xg(e,t){const{dateFrom:o,dateTo:i,type:s}=e||{};return[o&&Ke(o,void 0,!0)||null,i&&Ke(i,void 0,!0)||null].slice(0,uo(s,t))}var sd=1e3,nd=1/0,TP=class extends kn{constructor(){super("dateFilter",xg,gl),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=sd,this.maxValidYear=nd,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e),this.refreshInputValidation()}shouldKeepInvalidInputState(){return!wi()&&this.hasInvalidInputs()&&this.getConditionTypes().includes("inRange")}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,c)=>{const d=e[l];if(d!=null)if(isNaN(d))D(82,{param:l});else return d==null?c:Number(d);return c},o=t("minValidYear",sd),i=t("maxValidYear",nd);this.minValidYear=o,this.maxValidYear=i,o>i&&D(83);const{minValidDate:s,maxValidDate:n}=e,r=s instanceof Date?s:Ke(s);this.minValidDate=r;const a=n instanceof Date?n:Ke(n);this.maxValidDate=a,r&&a&&r>a&&D(84)}refreshInputValidation(){for(let e=0;e<this.dateConditionFromComps.length;e++)this.refreshInputPairValidation(e,!1,!0)}refreshInputPairValidation(e,t=!1,o=!1){const{dateConditionFromComps:i,dateConditionToComps:s,beans:n}=this,r=i[e],a=s[e],l=uo(this.getConditionType(e),this.optionsFactory),c=r.getDate(),d=a.getDate(),u=l>=2?IP(c,d,t):null,h=u?this.translate(u,[String(t?d:c)]):"",g=!wi()&&!o;(t?r:a).setCustomValidity(h,g),(t?a:r).setCustomValidity("",g),h.length>0&&n.ariaAnnounce.announceValue(h,"dateFilter")}createDateCompWrapper(e,t,o){const{beans:{userCompFactory:i,context:s,gos:n},params:r}=this,a=o==="from",l=new Eg(s,i,r.colDef,K(n,{onDateChanged:()=>{this.refreshInputPairValidation(t,a),this.onUiChanged()},onFocusIn:()=>this.refreshInputPairValidation(t,a),filterParams:r,location:"filter"}),e);return this.addDestroyFunc(()=>l.destroy()),l}getState(){return{isInvalid:this.hasInvalidInputs()}}areStatesEqual(e,t){return(e?.isInvalid??!1)===(t?.isInvalid??!1)}setElementValue(e,t){e.setDate(t),t||e.setCustomValidity("")}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=st({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,o,i){const s=st({tag:"div",cls:`ag-filter-${i} ag-filter-date-${i}`});t.push(s),e.appendChild(s),o.push(this.createDateCompWrapper(s,t.length-1,i))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),$i(this.eConditionPanelsFrom,e,t),$i(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,o){const i=$i(e,t,o);for(const s of i)s.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:o,minValidYear:i,maxValidYear:s}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<i)return!1;if(o){if(e>o)return!1}else if(e.getUTCFullYear()>s)return!1;return!0}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>e||(e=t.getDate()!=null&&!(t.getValidity()?.valid??!0))),e}positionHasInvalidInputs(e){let t=!1;return this.forEachPositionInput(e,o=>t||(t=!(o.getValidity()?.valid??!0))),t}canApply(e){return!this.hasInvalidInputs()}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachPositionInput(e,(o,i,s,n)=>{!t||i>=n||t&&(t=this.isValidDateValue(o.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),o={},{params:i,filterType:s}=this,n=this.getValues(e),r=i.useIsoSeparator?"T":" ";return n.length>0&&(o.dateFrom=$e(n[0],!0,r)),n.length>1&&(o.dateTo=$e(n[1],!0,r)),{dateFrom:null,dateTo:null,filterType:s,type:t,...o}}removeConditionsAndOperators(e,t){if(!this.hasInvalidInputs())return super.removeConditionsAndOperators(e,t)}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),o=e("ariaFilterValue","Filter Value");this.forEachInput(i=>{i.setInputPlaceholder(t),i.setInputAriaLabel(o)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:o}=this;return e>=t.length?[null,null]:[t[e],o[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(o,i,s,n)=>{i<n&&t.push(o.getDate())}),t}translate(e,t){let o=e;return e==="lessThan"?o="before":e==="greaterThan"&&(o="after"),super.translate(o,t)}};function IP(e,t,o){return e!=null&&t!=null&&e>=t?`${o?"max":"min"}DateValidation`:null}var Pg=class extends Ln{constructor(e,t){super(e,t,o=>{const{dataTypeSvc:i,valueSvc:s}=this.beans,n=t.column,r=i?.getDateFormatterFunction(n),a=r?r(o??void 0):o;return s.formatValue(n,null,a)}),this.filterTypeKeys=dl}conditionToString(e,t,o,i,s){const{type:n}=e,r=Ke(e.dateFrom),a=Ke(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>sS(h,l),d=()=>r!==null?c(r):"null",u=()=>a!==null?c(a):"null";if(r==null&&a==null)return ft(this,n);if(t){const h=this.conditionForToolPanel(n,o,d,u,i,s);if(h!=null)return h}return o?`${d()}-${u()}`:r!=null?c(r):`${n}`}};function AP(e,t){const o=t;return o<e?-1:o>e?1:0}var kP=class extends cl{constructor(){super(xg,gl),this.filterType="date",this.FilterModelFormatterClass=Pg,this.filterTypeToRangeCache=new Map}getOrRefreshRangeCacheItem(e,t){const{filterTypeToRangeCache:o}=this,i=Date.now();let s=o.get(e);if(s&&s.expires<i&&(s=void 0),!s){const[n,r]=t(new Date(i),new Date(i));s={from:n,to:r,expires:ut(new Date(i)).getTime()-i},o.set(e,s)}return s}comparator(){return this.params.filterParams.comparator??AP}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}evaluateNonNullValue(e,t,o){const i=o.type,s=this.comparator();if(!this.isValid(t))return i==="notEqual"||i==="notBlank";const n=i,r=XP[n];if(r){const{from:a,to:l}=this.getOrRefreshRangeCacheItem(n,r);return s(a,t)>=0&&s(l,t)<0}return super.evaluateNonNullValue(e,t,o)}},LP=1,xs=null,OP=()=>{if(xs!=null)return xs;let e;const t=typeof navigator>"u"?void 0:navigator.languages?.[0]??navigator.language;if(t&&typeof Intl<"u"&&typeof Intl.Locale=="function")try{e=new Intl.Locale(t).getWeekInfo?.()?.firstDay}catch{e=void 0}return xs=e==null?LP:e%7,xs},nt=e=>(e.setHours(0,0,0,0),e),On=e=>{const t=e.getDay(),o=OP(),i=(t-o+7)%7;return e.setDate(e.getDate()-i),nt(e)},Gn=(e,t=1)=>(e.setDate(e.getDate()-t),e),ut=e=>(e.setDate(e.getDate()+1),nt(e)),Dg=e=>(On(e),e.setDate(e.getDate()+6),ut(e)),Hn=e=>(e.setDate(1),nt(e)),pl=e=>(e.setDate(1),e.setMonth(e.getMonth()+1),nt(e)),fl=e=>{const t=Math.floor(e.getMonth()/3);return e.setMonth(t*3),Hn(e)},Mg=e=>{const t=Math.floor(e.getMonth()/3);return e.setMonth(t*3+2),pl(e)},ml=e=>(e.setMonth(0,1),nt(e)),Tg=e=>(e.setMonth(12,0),ut(e)),Ri=e=>Gn(e),na=e=>Ri(On(e)),ra=e=>Ri(Hn(e)),aa=e=>Ri(fl(e)),Cl=(e,t)=>[nt(e),ut(t)],GP=(e,t)=>Cl(Ri(e),Ri(t)),vl=(e,t)=>[On(e),Dg(t)],HP=(e,t)=>vl(na(e),na(t)),wl=(e,t)=>[Hn(e),pl(t)],BP=(e,t)=>wl(ra(e),ra(t)),bl=(e,t)=>[fl(e),Mg(t)],VP=(e,t)=>bl(aa(e),aa(t)),Sl=(e,t)=>[ml(e),Tg(t)],NP=(e,t)=>[ml(e),ut(t)],WP=(e,t)=>[nt(Gn(e,7)),ut(t)],zP=(e,t)=>[nt(Gn(e,30)),ut(t)],_P=(e,t)=>[nt(Gn(e,90)),ut(t)],UP=(e,t)=>(e.setFullYear(e.getFullYear()-1),e.setMonth(e.getMonth()+6),[nt(e),ut(t)]),$P=(e,t)=>(e.setFullYear(e.getFullYear()-1),[nt(e),ut(t)]),KP=(e,t)=>(e.setFullYear(e.getFullYear()-2),[nt(e),ut(t)]),qP=(e,t)=>(e.setFullYear(e.getFullYear()-1),t.setFullYear(t.getFullYear()-1),Sl(e,t)),jP=(e,t)=>(e.setFullYear(e.getFullYear()+1),t.setFullYear(t.getFullYear()+1),Sl(e,t)),YP=(e,t)=>(e.setMonth(e.getMonth()+3),t.setMonth(t.getMonth()+3),bl(e,t)),QP=(e,t)=>(e.setMonth(e.getMonth()+1),t.setMonth(t.getMonth()+1),wl(e,t)),ZP=(e,t)=>(e.setDate(e.getDate()+7),t.setDate(t.getDate()+7),vl(e,t)),JP=(e,t)=>(e.setDate(e.getDate()+1),t.setDate(t.getDate()+1),Cl(e,t)),XP={today:Cl,yesterday:GP,tomorrow:JP,thisWeek:vl,lastWeek:HP,nextWeek:ZP,thisMonth:wl,lastMonth:BP,nextMonth:QP,thisQuarter:bl,lastQuarter:VP,nextQuarter:YP,thisYear:Sl,lastYear:qP,nextYear:jP,yearToDate:NP,last7Days:WP,last30Days:zP,last90Days:_P,last6Months:UP,last12Months:$P,last24Months:KP,setStartOfDay:nt,setStartOfWeek:On,setStartOfNextDay:ut,setStartOfNextWeek:Dg,setStartOfMonth:Hn,setStartOfNextMonth:pl,setStartOfQuarter:fl,setStartOfNextQuarter:Mg,setStartOfYear:ml,setStartOfNextYear:Tg,setPreviousDay:Ri,setPreviousWeek:na,setPreviousMonth:ra,setPreviousQuarter:aa},eD={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eReadOnlyText"},{tag:"div",ref:"eDateWrapper",cls:"ag-date-floating-filter-wrapper"}]},tD=class extends Fg{constructor(){super(eD,[In]),this.eReadOnlyText=W,this.eDateWrapper=W,this.FilterModelFormatterClass=Pg,this.filterType="date",this.defaultOptions=gl}setParams(e){super.setParams(e),this.createDateComponent();const t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const o=e?Ke(e.dateFrom):null;this.dateComp.setDate(o),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){me(this.eDateWrapper,e),me(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const o=t.model,i=$e(e),s=i==null?null:{...o??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:i};t.onModelChange(s,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t?.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=Ga(e,this.defaultDebounceMs);return K(this.gos,{onDateChanged:xe(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:o,params:{column:i}}=this;this.dateComp=new Eg(e,t,i.getColDef(),this.getDateComponentParams(),o,s=>{s.setInputAriaLabel(this.getAriaLabel(i))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},oD={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},iD=class extends ye{constructor(){super(oD,[In]),this.eDateInput=W,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this),focusin:this.handleFocusIn.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}handleFocusIn(){this.params.onFocusIn?.()}setParams(e){const t=this.eDateInput.getInputElement(),o=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=o&&po();const{minValidYear:i,maxValidYear:s,minValidDate:n,maxValidDate:r,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},d=this.beans.dataTypeSvc,u=l??d?.getDateIncludesTimeFlag?.(c.cellDataType)??!1;o?u?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text";const h=rd(n,i,!0),g=rd(r,s,!1);h&&g&&h.getTime()>g.getTime()&&D(87),h&&(t.min=$e(h,u)),g&&(t.max=$e(g,u)),this.isApply=e.location==="floatingFilter"&&!!a?.includes("apply")}refresh(e){this.params=e,this.setParams(e)}getDate(){return Ke(this.eDateInput.getValue())}setDate(e){const t=this.params.filterParams.colDef.cellDataType,o=this.beans.dataTypeSvc?.getDateIncludesTimeFlag(t)??!1;this.eDateInput.setValue($e(e,o))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e?.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){return e?.filterParams?.browserDatePicker??!0}};function rd(e,t,o){return e&&t&&D(o?85:86),e instanceof Date?e:e?Ke(e):t?Ke(`${t}-${o?"01-01":"12-31"}`):null}var yl=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function la(e){return e?.allowedCharPattern??null}function fn(e){return e==null||isNaN(e)?null:e}function Ig(e,t){const{filter:o,filterTo:i,type:s}=e||{};return[fn(o),fn(i)].slice(0,uo(s,t))}var sD=class extends kn{constructor(){super("numberFilter",Ig,yl),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}afterGuiAttached(e){super.afterGuiAttached(e),this.refreshInputValidation()}shouldKeepInvalidInputState(){return!wi()&&this.hasInvalidInputs()&&this.getConditionTypes().includes("inRange")}refreshInputValidation(){for(let e=0;e<this.eValuesFrom.length;e++){const t=this.eValuesFrom[e],o=this.eValuesTo[e];this.refreshInputPairValidation(t,o)}}refreshInputPairValidation(e,t,o=!1){const i=this.params.numberParser,s=ad(i,e),n=ad(i,t),r=nD(s,n,o),a=r?this.translate(r,[String(o?n:s)]):"";(o?e:t).setCustomValidity(a),(o?t:e).setCustomValidity(""),a.length>0&&this.beans.ariaAnnounce.announceValue(a,"dateFilter")}getState(){return{isInvalid:this.hasInvalidInputs()}}areStatesEqual(e,t){return(e?.isInvalid??!1)===(t?.isInvalid??!1)}refresh(e){const t=super.refresh(e),{state:o,additionalEventAttributes:i}=e,s=this.state,n=i?.fromAction;return(n&&n!="apply"||o.model!==s.model||!this.areStatesEqual(o.state,s.state))&&this.refreshInputValidation(),t}setElementValue(e,t,o){const{numberFormatter:i}=this.params,s=!o&&i?i(t??null):t;super.setElementValue(e,s),s===null&&e.setCustomValidity("")}createEValue(){const{params:e,eValuesFrom:t,eValuesTo:o}=this,i=la(e),s=st({tag:"div",cls:"ag-filter-body",role:"presentation"}),n=this.createFromToElement(s,t,"from",i),r=this.createFromToElement(s,o,"to",i),a=(d,u,h)=>()=>this.refreshInputPairValidation(d,u,h),l=a(n,r,!0);n.onValueChange(l),n.addGuiEventListener("focusin",l);const c=a(n,r,!1);return r.onValueChange(c),r.addGuiEventListener("focusin",c),s}createFromToElement(e,t,o,i){const s=this.createManagedBean(i?new $t({allowedCharPattern:i}):new nl);return s.addCss(`ag-filter-${o}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui()),s}removeEValues(e,t){const o=i=>this.removeComponents(i,e,t);o(this.eValuesFrom),o(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(o,i,s,n)=>{i<n&&t.push(fn(Ag(this.params.numberParser,o.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),o={filterType:this.filterType,type:t},i=this.getValues(e);return i.length>0&&(o.filter=i[0]),i.length>1&&(o.filterTo=i[1]),o}removeConditionsAndOperators(e,t){if(!this.hasInvalidInputs())return super.removeConditionsAndOperators(e,t)}getInputs(e){const{eValuesFrom:t,eValuesTo:o}=this;return e>=t.length?[null,null]:[t[e],o[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>e||(e=!t.getInputElement().validity.valid)),e}positionHasInvalidInputs(e){let t=!1;return this.forEachPositionInput(e,o=>t||(t=!o.getInputElement().validity.valid)),t}canApply(e){return!this.hasInvalidInputs()}};function Ag(e,t){if(typeof t=="number")return t;let o=Nt(t);return o!=null&&o.trim()===""&&(o=null),e?e(o):o==null||o.trim()==="-"?null:Number.parseFloat(o)}function ad(e,t){return fn(Ag(e,t.getValue(!0)))}function nD(e,t,o){return e!=null&&t!=null&&e>=t?`strict${o?"Max":"Min"}ValueValidation`:null}var kg=class extends Ln{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=dl}conditionToString(e,t,o,i,s){const{filter:n,filterTo:r,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,o,()=>l(n),()=>l(r),i,s);if(c!=null)return c}return o?`${l(n)}-${l(r)}`:n!=null?l(n):`${a}`}},rD=class extends cl{constructor(){super(Ig,yl),this.filterType="number",this.FilterModelFormatterClass=kg}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},aD=class extends x{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new nl),this.eTextInput=this.createManagedBean(new $t),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),o=this.eTextInput.getGui();e.appendChild(t),e.appendChild(o),this.setupListeners(t,i=>this.onValueChanged(i)),this.setupListeners(o,i=>this.onValueChanged(i))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams({ariaLabel:e,autoComplete:t,placeholder:o}){this.setAriaLabel(e),t!==void 0&&this.setAutoComplete(t),this.setPlaceholder(this.eNumberInput,o),this.setPlaceholder(this.eTextInput,o)}setPlaceholder(e,t){e.toggleCss("ag-floating-filter-search-icon",!!t),e.setInputPlaceholder(t)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},lD=class extends hl{constructor(){super(...arguments),this.FilterModelFormatterClass=kg,this.filterType="number",this.defaultOptions=yl}updateParams(e){la(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=la(e.filterParams),this.allowedCharPattern?this.createManagedBean(new ul({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new aD)}convertValue(e){return e?Number(e):null}},Rl=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],cD=class extends kn{constructor(){super("textFilter",Rg,Rl),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),o={filterType:this.filterType,type:t},i=this.getValues(e);return i.length>0&&(o.filter=i[0]),i.length>1&&(o.filterTo=i[1]),o}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:o}=this;return e>=t.length?[null,null]:[t[e],o[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(o,i,s,n)=>{i<n&&t.push(Nt(o.getValue()))}),t}createEValue(){const e=st({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:o}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,o,"to"),e}createFromToElement(e,t,o){const i=this.createManagedBean(new $t);i.addCss(`ag-filter-${o}`),i.addCss("ag-filter-filter"),t.push(i),e.appendChild(i.getGui())}removeEValues(e,t){const o=n=>this.removeComponents(n,e,t),{eValuesFrom:i,eValuesTo:s}=this;o(i),o(s)}},Lg=class extends Ln{constructor(){super(...arguments),this.filterTypeKeys=xP}conditionToString(e,t,o,i,s){const{filter:n,filterTo:r,type:a}=e;if(t){const l=d=>()=>ft(this,"filterSummaryTextQuote",[d]),c=this.conditionForToolPanel(a,o,l(n),l(r),i,s);if(c!=null)return c}return o?`${n}-${r}`:n!=null?`${n}`:`${a}`}},dD=({filterOption:e,value:t,filterText:o})=>{if(o==null)return!1;switch(e){case"contains":return t.includes(o);case"notContains":return!t.includes(o);case"equals":return t===o;case"notEqual":return t!=o;case"startsWith":return t.indexOf(o)===0;case"endsWith":{const i=t.lastIndexOf(o);return i>=0&&i===t.length-o.length}default:return!1}},uD=e=>e,hD=e=>e==null?null:e.toString().toLowerCase(),gD=class extends Sg{constructor(){super(Rg,Rl),this.filterType="text",this.FilterModelFormatterClass=Lg}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??dD,this.formatter=t.textFormatter??(t.caseSensitive?uD:hD)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,o,i){const s=e.map(h=>this.formatter(h))||[],n=this.formatter(t),{api:r,colDef:a,column:l,context:c,filterParams:{textFormatter:d}}=this.params;if(o.type==="blank")return pn(t);if(o.type==="notBlank")return!pn(t);const u={api:r,colDef:a,column:l,context:c,node:i.node,data:i.data,filterOption:o.type,value:n,textFormatter:d};return s.some(h=>this.matcher({...u,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=o=>{const i={...o},{filter:s,filterTo:n}=o;return s&&(i.filter=sa(s)??null),n&&(i.filterTo=sa(n)??null),i};return yu(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},pD=class extends hl{constructor(){super(...arguments),this.FilterModelFormatterClass=Lg,this.filterType="text",this.defaultOptions=Rl}createFloatingFilterInputService(){return this.createManagedBean(new ul)}};function fD(e){return!!e.quickFilter?.isFilterPresent()}function mD(e){return e.quickFilter?.getText()}function CD(e){e.quickFilter?.resetCache()}var vD=class extends x{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",o=>this.setFilter(o.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:i}=this.beans,s=t.isPivotMode(),n=e?.getColumns(),r=t.getColDefCols();let a=(s&&!o.get("applyQuickFilterBeforePivotOrAgg")?i?.getPivotResultCols()?.list:r)??[];n&&(a=a.concat(n)),this.colsToUse=o.get("includeHiddenColumnsInQuickFilter")?a:a.filter(l=>l.isVisible()||l.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(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;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return O(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){D(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),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 i=this.getTextForColumn(o,e);return O(i)&&i.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:i,matcher:s}=this;return s(i,o)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let o=this.beans.filterValueSvc.getValue(e,t);const i=e.getColDef();if(i.getQuickFilterText){const s=K(this.gos,{value:o,node:t,data:t.data,column:e,colDef:i});o=i.getQuickFilterText(s)}return O(o)?o.toString().toUpperCase():null}getAggText(e){const t=[];for(const o of this.colsToUse){const i=this.getTextForColumn(o,e);O(i)&&t.push(i)}return t.join(`
61
61
  `)}},wD={moduleName:"ClientSideRowModelFilter",version:L,rowModels:["clientSide"],beans:[hF]},Fl={moduleName:"FilterCore",version:L,beans:[lP],apiFunctions:{isAnyFilterPresent:rP,onFilterChanged:aP},css:[Vx],dependsOn:[wD]},Og={moduleName:"FilterValue",version:L,beans:[mP]},gs={moduleName:"ColumnFilter",version:L,beans:[nP,fP],dynamicBeans:{headerFilterCellCtrl:Lx},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:Nx,getColumnFilterInstance:Wx,destroyFilter:zx,setFilterModel:_x,getFilterModel:Ux,getColumnFilterModel:$x,setColumnFilterModel:Kx,showColumnFilter:qx,hideColumnFilter:jx,getColumnFilterHandler:Yx,doFilterAction:Qx},dependsOn:[Fl,Tn,Og,Bx]},bD={moduleName:"CustomFilter",version:L,userComponents:{agReadOnlyFloatingFilter:vP},dependsOn:[gs]},SD={moduleName:"TextFilter",version:L,dependsOn:[gs],userComponents:{agTextColumnFilter:{classImp:cD,params:{useForm:!0}},agTextColumnFloatingFilter:pD},dynamicBeans:{agTextColumnFilterHandler:gD}},yD={moduleName:"NumberFilter",version:L,dependsOn:[gs],userComponents:{agNumberColumnFilter:{classImp:sD,params:{useForm:!0}},agNumberColumnFloatingFilter:lD},dynamicBeans:{agNumberColumnFilterHandler:rD}},RD={moduleName:"BigIntFilter",version:L,dependsOn:[gs],userComponents:{agBigIntColumnFilter:{classImp:FP,params:{useForm:!0}},agBigIntColumnFloatingFilter:MP},dynamicBeans:{agBigIntColumnFilterHandler:PP}},FD={moduleName:"DateFilter",version:L,dependsOn:[gs],userComponents:{agDateColumnFilter:{classImp:TP,params:{useForm:!0}},agDateInput:iD,agDateColumnFloatingFilter:tD},dynamicBeans:{agDateColumnFilterHandler:kP}},ED={moduleName:"QuickFilterCore",version:L,rowModels:["clientSide"],beans:[vD],dependsOn:[Fl,Og]},xD={moduleName:"QuickFilter",version:L,apiFunctions:{isQuickFilterPresent:fD,getQuickFilter:mD,resetQuickFilter:CD},dependsOn:[ED]},PD={moduleName:"ExternalFilter",version:L,dependsOn:[Fl]},DD=class extends x{constructor(e,t,o){super(),this.id=e,this.parentCache=t,this.params=o,this.state="needsLoading",this.version=0,this.startRow=e*o.blockSize,this.endRow=this.startRow+o.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,o){this.successCommon(e,{rowData:t,rowCount:o})}isRequestMostRecentAndLive(e){const t=e===this.version,o=this.isAlive();return t&&o}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:o,beans:i,rowNodes:s}=this;for(let n=0;n<e;n++){const r=o+n,a=new co(i);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:o,state:i}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:o,pageStatus:i}}}setDataAndId(e,t,o){O(t)?e.setDataAndId(t,o.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(we(this.params.datasource.getRows)){D(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:o,params:{sortModel:i,filterModel:s},gos:n}=this;return K(n,{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,o),failCallback:this.pageLoadFailed.bind(this,o),sortModel:i,filterModel:s})}forEachNode(e,t,o){this.rowNodes.forEach((i,s)=>{this.startRow+s<o&&e(i,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const o=e-this.startRow;return this.rowNodes[o]}processServerResult(e){const{rowNodes:t,beans:o}=this;t.forEach((s,n)=>{const r=e.rowData?e.rowData[n]:void 0;!s.id&&s.alreadyRendered&&r&&(t[n]=new co(o),t[n].setRowIndex(s.rowIndex),t[n].setRowTop(s.rowTop),t[n].setRowHeight(s.rowHeight),s._destroy(!0)),this.setDataAndId(t[n],r,this.startRow+n)});const i=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,i)}destroy(){const e=this.rowNodes;for(let t=0,o=e.length;t<o;t++)e[t]._destroy(!1);e.length=0,super.destroy()}},MD=2,TD=class extends x{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const o=Math.floor(e/this.params.blockSize);let i=this.blocks[o];if(!i){if(t)return;i=this.createBlock(o)}return i.getRow(e)}createBlock(e){const t=this.params,o=this.createBean(new DD(e,this,t));return this.blocks[o.id]=o,this.blockCount++,this.purgeBlocksIfNeeded(o),t.rowNodeBlockLoader.addBlock(o),o}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(Oo(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),o=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(o);const i=this.params.maxBlocksInCache>0,s=i?this.params.maxBlocksInCache-1:null,n=MD-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=n,c=i?a>=s:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:o,endRow:i}=e;return t.rowIndex>=o&&t.rowIndex<i}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:o}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,o-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:o,overflowSize:i}=this.params,n=(e.id+1)*o+i;this.rowCount<n&&(this.rowCount=n)}}setRowCount(e,t){this.rowCount=e,O(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const o of this.getBlocksInOrder())o.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(o,i)=>o.id-i.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const o=[];let i=-1,s=!1;const n={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(s&&i+1!==l.id){r=!0;continue}i=l.id,l.forEachNode(c=>{const d=c===e||c===t;(s||d)&&o.push(c),d&&(s=!s)},n,this.rowCount)}return r||s?[]:o}},ID=class extends x{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.hierarchical=!1}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new co(e);this.rootNode=t,t.level=-1,this.rowHeight=Do(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=Do(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){let e;this.cacheParams?e=!ji(this.cacheParams.sortModel,this.beans.sortSvc?.getSortModel()??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getOverlayType(){return this.infiniteCache?.getRowCount()===0?this.beans.filterManager?.isAnyFilterPresent()?"noMatchingRows":"noRows":null}getNodesInRangeForSelection(e,t){return this.infiniteCache?.getRowNodesInRange(e,t)??[]}reset(){if(!this.datasource)return;vi(this.gos)!=null||this.beans.selectionSvc?.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:o,rowNodeBlockLoader:i,eventSvc:s,gos:n}=e;this.cacheParams={datasource:this.datasource,filterModel:t?.getFilterModel()??{},sortModel:o?.getSortModel()??[],rowNodeBlockLoader:i,initialRowCount:n.get("infiniteInitialRowCount"),maxBlocksInCache:n.get("maxBlocksInCache"),rowHeight:Do(e),overflowSize:n.get("cacheOverflowSize"),blockSize:n.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new TD(this.cacheParams)),s.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(o=>{o.id===e&&(t=o)}),t}forEachNode(e){this.infiniteCache?.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),o=this.getRowCount()-1;return t>o?o:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache?.refreshCache()}purgeCache(){this.infiniteCache?.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?.isLastRowIndexKnown()??!1}setRowCount(e,t){this.infiniteCache?.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function AD(e){xn(e)?.refreshCache()}function kD(e){xn(e)?.purgeCache()}function LD(e){return xn(e)?.getRowCount()}var OD=class extends x{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=Bf(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=xe(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){At(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){Oo(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(o=>o.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const o of t)o.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:o,state:i}=t.getBlockStateJson();e[o]=i}),e}printCacheStatus(){Oo(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},GD={moduleName:"InfiniteRowModelCore",version:L,rowModels:["infinite"],beans:[ID,OD]},HD={moduleName:"InfiniteRowModel",version:L,apiFunctions:{refreshInfiniteCache:AD,purgeInfiniteCache:kD,getInfiniteRowCount:LD},dependsOn:[GD,nF]},BD=class extends x{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(e,t){const o=this.wrapSvc?.wrap(e,t)??t,i=!Vs.has(e),s=i?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(o),this.eventSvc.addListener(e,o,i)}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=(n,r)=>{Vs.has(n)&&t(n,r)},i=(n,r)=>{Vs.has(n)||t(n,r)};this.globalListenerPairs.set(e,{syncListener:o,asyncListener:i});const s=this.eventSvc;s.addGlobalListener(o,!1),s.addGlobalListener(i,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:o,globalListenerPairs:i}=this,s=o?.unwrapGlobal(e)??e;if(i.has(s)){const{syncListener:r,asyncListener:a}=i.get(s);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),i.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((o,i)=>{o.forEach(s=>this.eventSvc.removeListener(i,s,t)),o.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:o,asyncListener:i})=>{t.removeGlobalListener(o,!1),t.removeGlobalListener(i,!0)}),e.clear()}};function VD(e,t,o){e.apiEventSvc?.addListener(t,o)}function ND(e,t,o){e.apiEventSvc?.removeListener(t,o)}function WD(e,t){e.apiEventSvc?.addGlobalListener(t)}function zD(e,t){e.apiEventSvc?.removeGlobalListener(t)}var _D={moduleName:"EventApi",version:L,apiFunctions:{addEventListener:VD,addGlobalListener:WD,removeEventListener:ND,removeGlobalListener:zD},beans:[BD]},UD=class extends x{constructor(){super(...arguments),this.beanName="localeSvc"}getLocaleTextFunc(){const e=this.gos,t=e.getCallback("getLocaleText");return t?lf(t):cf(e.get("localeText"))}},$D={moduleName:"Locale",version:L,beans:[UD]};function KD(e){return e.stateSvc?.getState()??{}}function qD(e,t,o){return e.stateSvc?.setState(t,o)}function ld(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=jD(e)),e.version=L,e}function jD(e){return e.cellSelection=YD(e,"rangeSelection"),e}function YD(e,t){if(e&&typeof e=="object")return e[t]}var QD=class extends x{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=xe(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=xe(this,()=>this.updateGroupExpansionState(),0),this.onRowSelectedDebounced=xe(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:o}=this.beans;this.isClientSideRowModel=Se(e);const i=ld(e.get("initialState")??{}),s=i.partialColumnState;delete i.partialColumnState,this.cachedState=i;const n=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>n(()=>this.setupStateOnGridReady(i))),(i.columnOrder||i.columnVisibility||i.columnSizing||i.columnPinning||i.columnGroup)&&o?.hideColumns("columnState");const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),n(()=>{this.setupStateOnColumnsInitialised(i,!!s),o?.revealColumns("columnState")}))},rowCountReady:()=>{a?.(),n(()=>this.setupStateOnRowCountReady(i))},firstDataRendered:()=>{l?.(),n(()=>this.setupStateOnFirstDataRendered(i))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const o=ld(e);delete o.partialColumnState,this.cachedState=o,this.startSuppressEvents();const i="api",s=t?new Set(t):void 0;this.setGridReadyState(o,i,s),this.setColumnsInitialisedState(o,i,!!s,s),this.setRowCountState(o,i,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(o,i,s),this.stopSuppressEvents(i)})}setGridReadyState(e,t,o){t==="api"&&!o?.has("sideBar")&&this.beans.sideBar?.comp?.setState(e.sideBar),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,o,i){this.setColumnState(e,t,o,i),this.setColumnGroupState(e,t,i),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const o=i=>()=>this.updateColumnState([i]);this.addManagedEventListeners({columnValueChanged:o("aggregation"),columnMoved:o("columnOrder"),columnPinned:o("columnPinning"),columnResized:o("columnSizing"),columnVisible:o("columnVisibility"),columnPivotChanged:o("pivot"),columnPivotModeChanged:o("pivot"),columnRowGroupChanged:o("rowGroup"),sortChanged:o("sort"),newColumnsLoaded:({source:i})=>{this.updateColumnAndGroupState(),i!=="gridInitializing"&&this.isClientSideRowModel&&this.onRowGroupOpenedDebounced()},columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,o){const{filter:i,rowGroupExpansion:s,ssrmRowGroupExpansion:n,rowSelection:r,pagination:a,rowPinning:l}=e,c=(u,h)=>!o?.has(u)&&(h||t==="api");c("filter",i)&&this.setFilterState(i),(c("rowGroupExpansion",s)||c("ssrmRowGroupExpansion",n))&&this.setRowGroupExpansionState(n,s,t),c("rowSelection",r)&&this.setRowSelectionState(r,t),c("pagination",a)&&this.setPaginationState(a,t),c("rowPinning",l)&&this.setRowPinningState(l);const d=this.updateCachedState.bind(this);d("filter",this.getFilterState()),this.updateGroupExpansionState(),d("rowSelection",this.getRowSelectionState()),d("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),o=()=>{this.updateRowGroupExpansionStateTimer=0,this.updateGroupExpansionState()},i=()=>t("filter",this.getFilterState()),{gos:s,colFilter:n,selectableFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:i,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:o,columnRowGroupChanged:o,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(o)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:a=>{(a.newPage||a.newPageSize)&&t("pagination",this.getPaginationState())},pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())}),n&&this.addManagedListeners(n,{filterStateChanged:i}),r&&this.addManagedListeners(r,{selectedFilterChanged:i})}setFirstDataRenderedState(e,t,o){const{scroll:i,cellSelection:s,focusedCell:n,columnOrder:r}=e,a=(d,u)=>!o?.has(d)&&(u||t==="api");a("focusedCell",n)&&this.setFocusedCellState(n),a("cellSelection",s)&&this.setCellSelectionState(s),a("scroll",i)&&this.setScrollState(i),this.setColumnPivotState(!!r?.orderedColIds,t);const l=this.updateCachedState.bind(this);l("sideBar",this.getSideBarState()),l("focusedCell",this.getFocusedCellState());const c=this.getRangeSelectionState();l("rangeSelection",c),l("cellSelection",c),l("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),o=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:o,cellFocusCleared:o,cellSelectionChanged:i=>{if(i.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState())})}getColumnState(){const e=this.beans;return k1(cn(e),e.colModel.isPivotMode())}setColumnState(e,t,o,i){const{sort:s,rowGroup:n,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:d,columnOrder:u}=e;let h=!1;const g=(P,I)=>{const A=!i?.has(P)&&!!(I||t==="api");return h||(h=A),A},f={},m=P=>{let I=f[P];return I||(I={colId:P},f[P]=I,I)},C={},v=g("sort",s);v&&s?.sortModel.forEach(({colId:P,sort:I,type:A},J)=>{const k=m(P);k.sort=I,k.sortIndex=J,k.sortType=A}),(v||!o)&&(C.sort=null,C.sortIndex=null);const w=g("rowGroup",n);w&&n?.groupColIds.forEach((P,I)=>{const A=m(P);A.rowGroup=!0,A.rowGroupIndex=I}),(w||!o)&&(C.rowGroup=null,C.rowGroupIndex=null);const b=g("aggregation",r);b&&r?.aggregationModel.forEach(({colId:P,aggFunc:I})=>{m(P).aggFunc=I}),(b||!o)&&(C.aggFunc=null);const y=g("pivot",a);y&&(a?.pivotColIds.forEach((P,I)=>{const A=m(P);A.pivot=!0,A.pivotIndex=I}),this.gos.updateGridOptions({options:{pivotMode:!!a?.pivotMode},source:t})),(y||!o)&&(C.pivot=null,C.pivotIndex=null);const S=g("columnPinning",l);if(S){for(const P of l?.leftColIds??[])m(P).pinned="left";for(const P of l?.rightColIds??[])m(P).pinned="right"}(S||!o)&&(C.pinned=null);const F=g("columnVisibility",c);if(F)for(const P of c?.hiddenColIds??[])m(P).hide=!0;(F||!o)&&(C.hide=null);const E=g("columnSizing",d);if(E)for(const{colId:P,flex:I,width:A}of d?.columnSizingModel??[]){const J=m(P);J.flex=I??null,J.width=A}(E||!o)&&(C.flex=null);const M=u?.orderedColIds,T=!!M?.length&&!i?.has("columnOrder"),G=T?M.map(P=>m(P)):Object.values(f);(G.length||h)&&(this.columnStates=G,Ct(this.beans,{state:G,applyOrder:T,defaultState:C},t))}setColumnPivotState(e,t){const o=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:n,colGroupSvc:r}=s;if(n?.isPivotResultColsPresent()){if(o){const a=[];for(const l of o)n.getPivotResultCol(l.colId)&&a.push(l);Ct(s,{state:a,applyOrder:e},t)}i&&r?.setColumnGroupState(i,t)}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return L1(t)}setColumnGroupState(e,t,o){const i=this.beans.colGroupSvc;if(!i||o?.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set(e.columnGroup?.openColumnGroupIds),r=i.getColumnGroupState().map(({groupId:a})=>{const l=s.has(a);return l&&s.delete(a),{groupId:a,open:l}});for(const a of s)r.push({groupId:a,open:!0});r.length&&(this.columnGroupStates=r),i.setColumnGroupState(r,t)}getFilterState(){const{filterManager:e,selectableFilter:t}=this.beans;let o=e?.getFilterModel();o&&Object.keys(o).length===0&&(o=void 0);const i=e?.getFilterState(),s=e?.getAdvFilterModel()??void 0,n=t?.getState();return o||s||i||n?{filterModel:o,columnFilterState:i,advancedFilterModel:s,selectableFilters:n}:void 0}setFilterState(e){const{filterManager:t,selectableFilter:o}=this.beans,{filterModel:i,columnFilterState:s,advancedFilterModel:n,selectableFilters:r}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};r!==void 0&&o?.setState(r??{}),(i!==void 0||s!==void 0)&&t?.setFilterState(i??null,s??null,"columnFilter"),n!==void 0&&t?.setAdvFilterModel(n??null,"advancedFilter")}getRangeSelectionState(){const e=this.beans.rangeSvc?.getCellRanges().map(t=>{const{id:o,type:i,startRow:s,endRow:n,columns:r,startColumn:a}=t;return{id:o,type:i,startRow:s,endRow:n,colIds:r.map(l=>l.getColId()),startColId:a.getColId()}});return e?.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:o,colModel:i,visibleCols:s}=this.beans;if(!ao(t)||!o)return;const n=[];for(const r of e?.cellRanges??[]){const a=[];for(const c of r.colIds){const d=i.getCol(c);d&&a.push(d)}if(!a.length)continue;let l=i.getCol(r.startColId);if(!l){const c=s.allCols,d=new Set(a);l=c.find(u=>d.has(u))}n.push({...r,columns:a,startColumn:l})}o.setCellRanges(n)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:o}=e?.getVScrollPosition()??{top:0};return o||t?{top:o,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:o}=e??{top:0,left:0},{frameworkOverrides:i,rowRenderer:s,animationFrameSvc:n,ctrlsSvc:r}=this.beans;i.wrapIncoming(()=>{r.get("center").setCenterViewportScrollLeft(o),r.getScrollFeature()?.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),n?.flushAllFrames()})}getSideBarState(){return this.beans.sideBar?.comp?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:o,rowPinned:i}=e;return{colId:t.getColId(),rowIndex:o,rowPinned:i}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:o}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:i,rowIndex:s,rowPinned:n}=e;t.setFocusedCell({column:o.getCol(i),rowIndex:s,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const o=e.getCurrentPage(),i=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!o&&!i))return{page:o,pageSize:i}}setPaginationState(e,t){const{pagination:o,gos:i}=this.beans;if(!o)return;const{pageSize:s,page:n}=e??{page:0,pageSize:i.get("paginationPageSize")},r=t==="gridInitializing";s&&!i.get("paginationAutoPageSize")&&o.setPageSize(s,r?"initialState":"pageSizeSelector"),typeof n=="number"&&(r?o.setPage(n):o.goToPage(n))}getRowSelectionState(){const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!t?.toggledNodes?.length?void 0:t}setRowSelectionState(e,t){this.beans.selectionSvc?.setSelectionState(e,t,t==="api")}updateGroupExpansionState(){const{expansionSvc:e,gos:t}=this.beans,o=e?.getExpansionState(),i=t.get("ssrmExpandAllAffectsAllRows");this.updateCachedState("ssrmRowGroupExpansion",i?o:void 0),this.updateCachedState("rowGroupExpansion",i?void 0:o)}getRowPinningState(){return this.beans.pinnedRowModel?.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t?.setPinnedState(e):t?.reset()}setRowGroupExpansionState(e,t,o){const i=e??t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};this.beans.expansionSvc?.setExpansionState(i,o)}updateColumnState(e){const t=this.getColumnState();let o=!1;const i=this.cachedState;for(const s of Object.keys(t)){const n=t[s];ji(n,i[s])||(o=!0)}this.cachedState={...i,...t},o&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const o=this.cachedState[e];this.setCachedStateValue(e,t),ji(t,o)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){this.suppressEvents=!0,this.beans.colAnimation?.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.beans.colAnimation?.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},ZD={moduleName:"GridState",version:L,beans:[QD],apiFunctions:{getState:KD,setState:qD}};function JD(e){return e.rowModel.isLastRowIndexKnown()}function XD(e){return e.pagination?.getPageSize()??100}function eM(e){return e.pagination?.getCurrentPage()??0}function tM(e){return e.pagination?.getTotalPages()??1}function oM(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function iM(e){e.pagination?.goToNextPage()}function sM(e){e.pagination?.goToPreviousPage()}function nM(e){e.pagination?.goToFirstPage()}function rM(e){e.pagination?.goToLastPage()}function aM(e,t){e.pagination?.goToPage(t)}var lM=class extends x{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,o=()=>{const i=Math.max(Do(t),1),s=Math.floor(e/i);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?xe(this,o,50)():(o(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};function cM(e,t){if(typeof e!="number")return"";const o=t(),i=o("thousandSeparator",","),s=o("decimalSeparator",".");return e.toString().replace(".",s).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${i}`)}var ki="paginationPageSizeSelector",dM={tag:"span",cls:"ag-paging-page-size"},uM=class extends ye{constructor(){super(dM),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(ki,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!e?.newPageSize)return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){Xe(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(ki)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),o=!t||!e.includes(t);if(o){const s=this.gos.exists("paginationPageSize"),n=this.gos.get(ki)!==!0;D(94,{pageSizeSet:s,pageSizesSet:n,pageSizeOptions:e,paginationPageSizeOption:t}),n||D(95,{paginationPageSizeOption:t,paginationPageSizeSelector:ki}),e.unshift("")}const i=String(o?"":t);this.selectPageSizeComp?(ho(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(i,!0)):this.createPageSizeSelectorComp(e,i),this.hasEmptyOption=o}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const o=this.getLocaleTextFunc(),i=o("pageSizeSelectorLabel","Page Size:"),s=o("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new rl).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(i).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(ki);return!Array.isArray(t)||!t?.length?e:[...t].sort((o,i)=>o-i)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},hM={selector:"AG-PAGE-SIZE-SELECTOR",component:uM},gM=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;flex-wrap:wrap-reverse;gap:calc(var(--ag-spacing)*4);justify-content:flex-end;min-height:var(--ag-pagination-panel-height);padding:calc(var(--ag-spacing)*.5) var(--ag-cell-horizontal-padding);row-gap:calc(var(--ag-spacing)*.5);@container (width < 600px){justify-content:center}}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel,.ag-paging-row-summary-panel{margin:calc(var(--ag-spacing)*.5)}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}.ag-paging-description{line-height:0}",pM=class extends Gv{constructor(){super(),this.btFirst=W,this.btPrevious=W,this.btNext=W,this.btLast=W,this.lbRecordCount=W,this.lbFirstRowOnPage=W,this.lbLastRowOnPage=W,this.lbCurrent=W,this.lbTotal=W,this.pageSizeComp=W,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(gM)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[hM]);const{btFirst:t,btPrevious:o,btNext:i,btLast:s}=this;this.activateTabIndex([t,o,i,s]),t.insertAdjacentElement("afterbegin",Je(e?"last":"first",this.beans)),o.insertAdjacentElement("afterbegin",Je(e?"next":"previous",this.beans)),i.insertAdjacentElement("afterbegin",Je(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",Je(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:n=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(n):NC(this.beans,n),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}getFocusableContainerName(){return"pagination"}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:o}=e;this.addManagedListeners(t,{click:o,keydown:i=>{(i.key===R.ENTER||i.key===R.SPACE)&&(i.preventDefault(),o())}})}VC(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):cM(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),o=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const i=this.isZeroPagesToDisplay(),s=e===o-1;this.nextButtonDisabled=s||i,this.lastButtonDisabled=!t||i||e===o-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Gp(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),o=this.pagination.getMasterRowCount(),i=e?o:null,s=this.pagination.getCurrentPage(),n=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=n*s+1,a=r+n-1,e&&a>i&&(a=i));const l=r+n-1,c=!e&&o<l,d=this.formatNumber(r);this.lbFirstRowOnPage.textContent=d;let u;const h=this.getLocaleTextFunc();c?u=h("pageLastRowUnknown","?"):u=this.formatNumber(a),this.lbLastRowOnPage.textContent=u;const f=t>0?s+1:0,m=this.formatNumber(f);this.lbCurrent.textContent=m;let C,v;if(e)C=this.formatNumber(t),v=this.formatNumber(i);else{const w=h("more","more");C=w,v=w}this.lbTotal.textContent=C,this.lbRecordCount.textContent=v,this.announceAriaStatus(d,u,v,m,C)}announceAriaStatus(e,t,o,i,s){const n=this.getLocaleTextFunc(),r=n("page","Page"),a=n("to","to"),l=n("of","of"),c=`${e} ${a} ${t} ${l} ${o}`,d=`${r} ${i} ${l} ${s}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,this.ariaAnnounce?.announceValue(c,"paginationRow")),d!==this.ariaPageStatus&&(this.ariaPageStatus=d,this.ariaAnnounce?.announceValue(d,"paginationPage"))}},fM={selector:"AG-PAGINATION",component:pM},mM=100,CM=class extends x{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return fM}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:o}=this.beans;o?.isEditing()&&(o.isBatchEditing()?o.cleanupEditors():o.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){if(!this.active)return;let t=e;this.paginateChildRows||(t=this.beans.rowModel.getTopLevelIndexFromDisplayedIndex?.(e)??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return O(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:O(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:O(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:O(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:mM}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const o=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}o!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const o=this.pageSize,i=t-1;this.totalPages=Math.floor(i/o)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,n=o*s;let r=o*(s+1)-1;if(r>i&&(r=i),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(n),r===i)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:o}=this,i=e-1;this.totalPages=Math.floor(i/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*o,this.bottomDisplayedRowIndex=t*(o+1)-1,this.bottomDisplayedRowIndex>i&&(this.bottomDisplayedRowIndex=i)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:o=!1,newPageSize:i=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:o,newPageSize:i,keepRenderedRows:t})}},vM={moduleName:"Pagination",version:L,beans:[CM,lM],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:JD,paginationGetPageSize:XD,paginationGetCurrentPage:eM,paginationGetTotalPages:tM,paginationGetRowCount:oM,paginationGoToNextPage:iM,paginationGoToPreviousPage:sM,paginationGoToFirstPage:nM,paginationGoToLastPage:rM,paginationGoToPage:aM},dependsOn:[Tn]},wM=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function bM(e){return e.pinnedRowModel?.getPinnedTopRowCount()??0}function SM(e){return e.pinnedRowModel?.getPinnedBottomRowCount()??0}function yM(e,t){return e.pinnedRowModel?.getPinnedTopRow(t)}function RM(e,t){return e.pinnedRowModel?.getPinnedBottomRow(t)}function FM(e,t,o){return e.pinnedRowModel?.forEachPinnedRow(t,o)}var EM={moduleName:"PinnedRow",version:L,beans:[FC],css:[wM],apiFunctions:{getPinnedTopRowCount:bM,getPinnedBottomRowCount:SM,getPinnedTopRow:yM,getPinnedBottomRow:RM,forEachPinnedRow:FM},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},xM="↑",PM="↓",DM={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},MM=class extends ye{constructor(){super(DM),this.eValue=W,this.eDelta=W,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const o=Math.abs(t),i=e.formatValue(o),s=O(i)?i:o,n=t>=0,r=this.eDelta;n?r.textContent=xM+s:r.textContent=PM+s,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"),Xe(this.eDelta)}refresh(e,t=!1){const{value:o,valueFormatted:i}=e,{eValue:s,lastValue:n,beans:r}=this;if(o===n||(O(i)?s.textContent=i:O(o)?s.textContent=o:Xe(s),r.filterManager?.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=o&&typeof o=="object"&&"toNumber"in o?o.toNumber():o,l=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const c=a-l;this.showDelta(e,c)}return n&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=o,!0}},TM=".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}",IM={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},AM=class extends ye{constructor(){super(IM),this.eCurrent=W,this.refreshCount=0,this.registerCSS(TM)}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious?.remove();const{beans:t,eCurrent:o}=this,i=st({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=i,i.textContent=o.textContent,this.getGui().insertBefore(i,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(we(o)&&(o=""),o===this.lastValue||this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=o;const i=this.eCurrent;return O(e.valueFormatted)?i.textContent=e.valueFormatted:O(e.value)?i.textContent=o:Xe(i),!0}},kM=class extends x{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,o=this.beans.gos.get("cellFlashDuration"),i=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const n=Date.now(),r=n+o,a=n+o+i,l={phase:"flash",flashEndTime:r,fadeEndTime:a};s.set(e,l);const c=`ag-cell-${t}`,d=`${c}-animation`,{comp:u,eGui:{style:h}}=e;u.toggleCss(c,!0),u.toggleCss(d,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),o)}),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const o of Object.keys(this.animations)){const i=this.animations[o],s=`ag-cell-${o}`,n=`${s}-animation`;for(const[r,a]of i){if(!r.isAlive()||!r.comp){i.delete(r);continue}const{phase:l,flashEndTime:c,fadeEndTime:d}=a,u=l==="flash"?c:d;if(!(e+15>=u)){t=Math.min(u,t??1/0);continue}const{comp:g,eGui:{style:f}}=r;switch(l){case"flash":g.toggleCss(s,!1),g.toggleCss(n,!0),f.transition=`background-color ${d-c}ms`,f.transitionDelay=`${c-e}ms`,t=Math.min(d,t??1/0),a.phase="fade";break;case"fade":g.toggleCss(s,!1),g.toggleCss(n,!1),f.removeProperty("transition"),f.removeProperty("transition-delay"),i.delete(r);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const o=LC(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()}};function LM(e,t={}){const{cellFlashSvc:o}=e;o&&e.frameworkOverrides.wrapIncoming(()=>{for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))o.flashCell(i,t)})}var OM={moduleName:"HighlightChanges",version:L,beans:[kM],userComponents:{agAnimateShowChangeCellRenderer:MM,agAnimateSlideCellRenderer:AM},apiFunctions:{flashCells:LM}};function GM(e,t,o){if(!t)return;const i=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;o===null?i.removeAttribute(s):i.setAttribute(s,o)}function HM(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function BM(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function VM(e){return e.animationFrameSvc?.isQueueEmpty()??!0}function NM(e){e.animationFrameSvc?.flushAllFrames()}function WM(e){return{rowHeight:Do(e),headerHeight:cs(e)}}function zM(e,t={}){const o=[];for(const n of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const r=n.getCellRenderer();r!=null&&o.push(No(r))}if(t.columns?.length)return o;const i=[],s=jr(t.rowNodes);for(const n of e.rowRenderer.getAllRowCtrls()){if(s&&!Yr(n.rowNode,s)||!n.isFullWidth())continue;const r=n.getFullWidthCellRenderers();for(let a=0;a<r.length;a++){const l=r[a];l!=null&&i.push(No(l))}}return[...i,...o]}var _M={moduleName:"RenderApi",version:L,apiFunctions:{setGridAriaProperty:GM,refreshCells:HM,refreshHeader:BM,isAnimationFrameQueueEmpty:VM,flushAllAnimationFrames:NM,getSizesForCurrentTheme:WM,getCellRendererInstances:zM}},UM=class extends x{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=xe(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){const{visibleCols:e,rowModel:t,rowSpanSvc:o,pinnedRowModel:i}=this.beans,s=e.autoHeightCols;let n=!1;const r=a=>{const l=a.__autoHeights;let c=ro(this.beans,a).height;for(const d of s){let u=l?.[d.getColId()];const h=o?.getCellSpan(d,a);if(h){if(h.getLastNode()!==a)continue;if(u=o?.getCellSpan(d,a)?.getLastNodeAutoHeight(),!u)return}if(u==null){if(this.colSpanSkipCell(d,a))continue;return}c=Math.max(u,c)}c!==a.rowHeight&&(a.setRowHeight(c),n=!0)};i?.forEachPinnedRow?.("top",r),i?.forEachPinnedRow?.("bottom",r),t.forEachDisplayedNode?.(r),n&&t.onRowHeightChanged?.()}setRowAutoHeight(e,t,o){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[o.getId()];return}const i=e.__autoHeights[o.getId()];e.__autoHeights[o.getId()]=t,i!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:o,colViewport:i,visibleCols:s}=this.beans;if(!o.colSpanActive)return!1;let n=[];switch(e.getPinned()){case"left":n=s.getLeftColsForRow(t);break;case"right":n=s.getRightColsForRow(t);break;case null:n=i.getColsWithinViewport(t);break}return!n.includes(e)}setupCellAutoHeight(e,t,o){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const i=t.parentElement,{rowNode:s,column:n}=e,r=this.beans,a=d=>{if(this.beans.editSvc?.isEditing(e)||!e.isAlive()||!o.isAlive())return;const{paddingTop:u,paddingBottom:h,borderBottomWidth:g,borderTopWidth:f}=_o(i),m=u+h+g+f,v=t.offsetHeight+m;if(d<5){const b=!Pe(r)?.contains(t),y=v==0;if(b||y){window.setTimeout(()=>a(d+1),0);return}}this.setRowAutoHeight(s,v,n)},l=()=>a(0);l();const c=Kt(r,t,l);return o.addDestroyFunc(()=>{c(),this.setRowAutoHeight(s,void 0,n)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:o}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(o).filter(s=>s.isAutoHeight())),t.length!==0){if(!o.__autoHeights)return!1;for(const i of t){const s=o.__autoHeights[i.getColId()];if(!s||o.rowHeight<s)return!1}}return!0}},$M={moduleName:"RowAutoHeight",version:L,beans:[UM]},KM=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){const e=this.firstNode.__autoHeights?.[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},qM=class extends x{constructor(e){super(),this.column=e}buildCache(e){const{column:t,beans:{gos:o,pinnedRowModel:i,rowModel:s,valueSvc:n,pagination:r}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,d=o.getCallback("isFullWidthRow"),u=a.equals,h=a.spanRows,g=typeof h=="function";let f=null,m=null,C;const v=(b,y)=>{f=b,m=null,C=y},w=b=>{const y=!b.isExpandable()&&!b.group&&!b.detail&&(d?!d({rowNode:b}):!0);if(b.rowIndex==null||!y){v(null,null);return}if(f==null||b.level!==f.level||b.footer||m&&b.rowIndex-1!==m?.getLastNode().rowIndex){v(b,n.getValue(t,b,"data"));return}const S=n.getValue(t,b,"data");if(g){const F=K(o,{valueA:C,nodeA:f,valueB:S,nodeB:b,column:t,colDef:a});if(!h(F)){v(b,S);return}}else if(u?!u(C,S):C!==S){v(b,S);return}if(!m){const F=l?.get(f);F?.firstNode===f?(F.reset(),m=F):m=new KM(t,f),c.set(f,m)}m.addSpannedNode(b),c.set(b,m)};switch(e){case"center":s.forEachDisplayedNode?.(b=>{(!r||r.isRowInPage(b.rowIndex))&&w(b)}),this.centerValueNodeMap=c;break;case"top":i?.forEachPinnedRow("top",w),this.topValueNodeMap=c;break;case"bottom":i?.forEachPinnedRow("bottom",w),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},jM=class extends x{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=xe(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=xe(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const o=this.createManagedBean(new qM(e));this.spanningColumns.set(e,o),o.buildCache("top"),o.buildCache("bottom"),o.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t?.createCtrls("top"),t?.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t?.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const o=this.spanningColumns.get(e);return o?o.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:o}=this.beans,i=e.column,s=e.rowIndex,n=this.spanningColumns.get(i);if(!n)return;let r;switch(e.rowPinned){case"top":r=t?.getPinnedTopRow(s);break;case"bottom":r=t?.getPinnedBottomRow(s);break;default:r=o.getRow(s)}if(r)return n.getCellSpan(r)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const o=this.spanningColumns.get(e);if(o)return o.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[o,i]of this.spanningColumns)if(i.isCellSpanning(e)){const s=i.getCellSpan(e);t(o,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},YM=class extends mi{constructor(e,t,o){super(e.col,e.firstNode,o,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,o,i,s,n,r){this.eWrapper=o,super.setComp(e,t,o,i,s,n,r),this.setAriaRowSpan()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||wa(e,t.rowIndex)}setAriaRowSpan(){Np(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(is(t)){this.focusedCellPosition=void 0;return}const o=this.isCellFocused();o||(this.focusedCellPosition=void 0),e&&o&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},QM=class extends un{getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){const t=this.beans.rowSpanSvc?.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new YM(t,this,this.beans)}isCorrectCtrlForSpan(e){const t=this.beans.rowSpanSvc?.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},ZM=class extends x{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,o=this.getCtrlsMap(e),i=o.size,s=this.getAllRelevantRowControls(e),n=new Map;let r=!1;for(const l of s)l.isAlive()&&t?.forEachSpannedColumn(l.rowNode,(c,d)=>{if(n.has(d.firstNode))return;const u=o.get(d.firstNode);if(u){n.set(d.firstNode,u),o.delete(d.firstNode);return}r=!0;const h=new QM(d.firstNode,this.beans,!1,!1,!1);n.set(d.firstNode,h)});this.setCtrlsMap(e,n);const a=n.size===i;if(!(!r&&a)){for(const l of o.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,o=t?.getCellSpanByPosition(e);if(!o)return;const i=this.getCtrlsMap(e.rowPinned).get(o.firstNode);if(i)return i.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},JM={moduleName:"CellSpan",version:L,beans:[jM,ZM]},XM=class extends x{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,gi(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),pm(e))}createColumns(e,t){const o=()=>{en(this.beans,this.columns?.tree),this.columns=null},i=e.treeDepth,n=(this.columns?.treeDepth??-1)==i,r=this.generateSelectionCols();if(gm(r,this.columns?.list??[])&&n)return;o();const{colGroupSvc:l}=this.beans,c=l?.findDepth(e.tree)??0,d=l?.balanceTreeForAutoCols(r,c)??[];this.columns={list:r,tree:d,treeDepth:c,map:{}},t(h=>{if(!h)return null;const g=h.filter(f=>!go(f));return[...r,...g]})}updateColumns(e){const t=gi(e.source),{beans:o}=this;for(const i of this.columns?.list??[]){const s=this.createSelectionColDef(e.currentValue);i.setColDef(s,null,t),Ct(o,{state:[mm(s,i.colId)]},t)}}getColumn(e){return this.columns?.list.find(t=>Wi(t,e))??null}getColumns(){return this.columns?.list??null}isSelectionColumnEnabled(){const{gos:e,beans:t}=this,o=e.get("rowSelection");if(typeof o!="object"||!Po(e))return!1;const i=(t.autoColSvc?.getColumns()?.length??0)>0;if(o.checkboxLocation==="autoGroupColumn"&&i)return!1;const s=!!di(o),n=Is(o);return s||n}createSelectionColDef(e){const{gos:t}=this,o=e??t.get("selectionColumnDef"),i=t.get("enableRtl"),{rowSpan:s,spanRows:n,...r}=o??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:i?"right":"left",comparator(a,l,c,d){const u=c.isSelected(),h=d.isSelected();return u===h?0:u?1:-1},editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,pinned:null,...r,colId:Ta,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const o=new Uo(e,null,t,!1);return this.createBean(o),[o]}onSelectionOptionsChanged(e,t,o){const i=t&&typeof t!="string"?di(t):void 0,s=e&&typeof e!="string"?di(e):void 0,n=i!==s,r=t&&typeof t!="string"?Is(t):void 0,a=e&&typeof e!="string"?Is(e):void 0,l=r!==a,c=Qs(e),d=Qs(t);(n||l||c!==d)&&this.beans.colModel.refreshAll(o)}destroy(){en(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(i===0)return;const s=this.columns.list[0];if(!s.isVisible())return;const n=()=>{let l;switch(s.pinned){case"left":case!0:l=e;break;case"right":l=o;break;default:l=t}l&&At(l,s)};(this.beans.rowNumbersSvc?.getColumn(Ia)?2:1)===i&&n()}},eT=':where(.ag-selection-checkbox) .ag-checkbox-input-wrapper:before{content:"";cursor:pointer;inset:-8px;position:absolute}';function tT(e,t){if(!t.nodes.every(r=>r.rowPinned&&!Dn(r)?(D(59),!1):r.id===void 0?(D(60),!1):!0))return;const{nodes:i,source:s,newValue:n}=t;e.selectionSvc?.setNodesSelected({nodes:i,source:s??"api",newValue:n})}function oT(e,t,o="apiSelectAll"){e.selectionSvc?.selectAllRowNodes({source:o,selectAll:t})}function iT(e,t,o="apiSelectAll"){e.selectionSvc?.deselectAllRowNodes({source:o,selectAll:t})}function sT(e,t="apiSelectAllFiltered"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"filtered"})}function nT(e,t="apiSelectAllFiltered"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"filtered"})}function rT(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"currentPage"})}function aT(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function lT(e){return e.selectionSvc?.getSelectedNodes()??[]}function cT(e){return e.selectionSvc?.getSelectedRows()??[]}var dT={tag:"div",cls:"ag-selection-checkbox",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},uT=class extends ye{constructor(){super(dT,[Ya]),this.eCheckbox=W}postConstruct(){this.eCheckbox.setPassive(!0)}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.getLocaleTextFunc(),{rowNode:t,eCheckbox:o}=this,i=t.isSelected(),s=Sn(e,i),[n,r]=t.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],a=e(n,r);o.setValue(i,!0),o.setInputAriaLabel(`${a} (${s})`)}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getWrapperElement(),{dblclick:Bo,click:i=>{Bo(i),!this.eCheckbox.isDisabled()&&this.beans.selectionSvc?.handleSelectionEvent(i,this.rowNode,"checkboxSelected")}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),this.addManagedPropertyListener("rowSelection",({currentValue:i,previousValue:s})=>{const n=typeof i=="object"?Wn(i):void 0,r=typeof s=="object"?Wn(s):void 0;n!==r&&this.onSelectableChanged()}),Ir(this.gos)||typeof this.getIsVisible()=="function"){const i=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:i}),this.addManagedListeners(this.rowNode,{dataChanged:i,cellChanged:i}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}showOrHideSelect(){const{column:e,rowNode:t,overrides:o,gos:i}=this,s=t.selectable,n=this.getIsVisible();let r;if(typeof n=="function"){const u=o?.callbackParams;if(!e)r=n({...u,node:t,data:t.data});else{const h=e.createColumnFunctionCallbackParams(t);r=n({...u,...h})}}else r=n??!1;const a=s&&!r||!s&&r,l=s||r,c=i.get("rowSelection"),d=c&&typeof c!="string"?!Wn(c):!!e?.getColDef().showDisabledCheckboxes;this.setVisible(l&&(a?d:!0)),this.setDisplayed(l&&(a?d:!0)),l&&this.eCheckbox.setDisabled(a),o?.removeHidden&&this.setDisplayed(l)}getIsVisible(){const e=this.overrides;if(e)return e.isVisible;const t=this.gos.get("rowSelection");return t&&typeof t!="string"?di(t):this.column?.getColDef()?.checkboxSelection}},hT=class{constructor(e,t){this.rowModel=e,this.pinnedRowModel=t,this.selectAll=!1,this.rootId=null,this.endId=null,this.cachedRange=[]}reset(){this.rootId=null,this.endId=null,this.cachedRange.length=0}setRoot(e){this.rootId=e.id,this.endId=null,this.cachedRange.length=0}setEndRange(e){this.endId=e.id,this.cachedRange.length=0}getRange(){if(this.cachedRange.length===0){const e=this.getRoot(),t=this.getEnd();if(e==null||t==null)return this.cachedRange;this.cachedRange=this.getNodesInRange(e,t)??[]}return this.cachedRange}isInRange(e){return this.rootId===null?!1:this.getRange().some(t=>t.id===e.id)}getRoot(e){if(this.rootId)return this.getRowNode(this.rootId);if(e)return this.setRoot(e),e}getEnd(){if(this.endId)return this.getRowNode(this.endId)}getRowNode(e){let t;const{rowModel:o,pinnedRowModel:i}=this;return t??(t=o.getRowNode(e)),i?.isManual()&&(t??(t=i.getPinnedRowById(e,"top")),t??(t=i.getPinnedRowById(e,"bottom"))),t}truncate(e){const t=this.getRange();if(t.length===0)return{keep:[],discard:[]};const o=t[0].id===this.rootId,i=t.findIndex(s=>s.id===e.id);if(i>-1){const s=t.slice(0,i),n=t.slice(i+1);return this.setEndRange(e),o?{keep:s,discard:n}:{keep:n,discard:s}}else return{keep:t,discard:[]}}extend(e,t=!1){const o=this.getRoot();if(o==null){const s=this.getRange().slice();return t&&e.depthFirstSearch(n=>!n.group&&s.push(n)),s.push(e),this.setRoot(e),{keep:s,discard:[]}}const i=this.getNodesInRange(o,e);if(!i)return this.setRoot(e),{keep:[e],discard:[]};if(i.find(s=>s.id===this.endId))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const s=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:s}}}getNodesInRange(e,t){const{pinnedRowModel:o,rowModel:i}=this;if(!o?.isManual())return i.getNodesInRangeForSelection(e,t);if(e.rowPinned==="top"&&!t.rowPinned)return rt(o,"top",e,void 0).concat(i.getNodesInRangeForSelection(i.getRow(0),t)??[]);if(e.rowPinned==="bottom"&&!t.rowPinned){const s=rt(o,"bottom",void 0,e),n=i.getRowCount(),r=i.getRow(n-1);return(i.getNodesInRangeForSelection(t,r)??[]).concat(s)}if(!e.rowPinned&&!t.rowPinned)return i.getNodesInRangeForSelection(e,t);if(e.rowPinned==="top"&&t.rowPinned==="top")return rt(o,"top",e,t);if(e.rowPinned==="bottom"&&t.rowPinned==="top"){const s=rt(o,"top",t,void 0),n=rt(o,"bottom",void 0,e),r=i.getRow(0),a=i.getRow(i.getRowCount()-1);return s.concat(i.getNodesInRangeForSelection(r,a)??[]).concat(n)}if(!e.rowPinned&&t.rowPinned==="top")return rt(o,"top",t,void 0).concat(i.getNodesInRangeForSelection(i.getRow(0),e)??[]);if(e.rowPinned==="top"&&t.rowPinned==="bottom"){const s=rt(o,"top",e,void 0),n=rt(o,"bottom",void 0,t),r=i.getRow(0),a=i.getRow(i.getRowCount()-1);return s.concat(i.getNodesInRangeForSelection(r,a)??[]).concat(n)}if(e.rowPinned==="bottom"&&t.rowPinned==="bottom")return rt(o,"bottom",e,t);if(!e.rowPinned&&t.rowPinned==="bottom"){const s=rt(o,"bottom",void 0,t),n=i.getRow(i.getRowCount());return(i.getNodesInRangeForSelection(e,n)??[]).concat(s)}return null}},gT=class extends x{constructor(e){super(),this.column=e,this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(ve(this.beans))&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e;const t=this.createManagedBean(new ja);this.cbSelectAll=t,t.addCss("ag-header-select-all"),ko(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:i,previousValue:s})=>{const n=r=>typeof r=="string"||!r||r.mode==="singleRow"?void 0:r.selectAll;n(i)!==n(s)&&this.showOrHideSelectAll(),this.updateStateOfCheckbox()}),this.addManagedListeners(t,{fieldValueChanged:this.onCbSelectAll.bind(this)}),t.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onDisplayedColumnsChanged(e){this.isAlive()&&this.showOrHideSelectAll(e.source==="uiColumnMoved")}showOrHideSelectAll(e=!1){const t=this.isCheckboxSelection();this.cbSelectAllVisible=t,this.cbSelectAll.setDisplayed(t),t&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel(e)}updateStateOfCheckbox(){if(!this.cbSelectAllVisible||this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.getSelectAllMode(),t=this.beans.selectionSvc,o=this.cbSelectAll,i=t.getSelectAllState(e);o.setValue(i);const s=t.hasNodesToSelect(e);o.setDisabled(!s),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(e=!1){const t=this.getLocaleTextFunc(),{headerCellCtrl:o,cbSelectAll:i,cbSelectAllVisible:s}=this,n=i.getValue(),r=Sn(t,n),a=t("ariaRowSelectAll","Press Space to toggle all rows selection");o.setAriaDescriptionProperty("selectAll",s?`${a} (${r})`:null),i.setInputAriaLabel(t("ariaHeaderSelection","Column with Header Selection")),e||o.announceAriaDescription()}checkSelectionType(e){return Js(this.gos)?!0:(D(128,{feature:e}),!1)}checkRightRowModelType(e){const{gos:t,rowModel:o}=this.beans;return Se(t)||xi(t)?!0:(D(129,{feature:e,rowModel:o.getType()}),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.getSelectAllMode();let o="uiSelectAll";t==="currentPage"?o="uiSelectAllCurrentPage":t==="filtered"&&(o="uiSelectAllFiltered");const i={source:o,selectAll:t},s=this.beans.selectionSvc;e?s.selectAllRowNodes(i):s.deselectAllRowNodes(i)}isCheckboxSelection(){const{column:e,gos:t,beans:o}=this,n=typeof t.get("rowSelection")=="object"?"headerCheckbox":"headerCheckboxSelection";return Gg(o,e)&&this.checkRightRowModelType(n)&&this.checkSelectionType(n)}getSelectAllMode(){const e=du(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 Gg({gos:e,selectionColSvc:t},o){const i=e.get("rowSelection"),s=o.getColDef(),{headerCheckboxSelection:n}=s;let r=!1;if(typeof i=="object"){const l=go(o),c=Aa(o);(Qs(i)==="autoGroupColumn"&&c||l&&t?.isSelectionColumnEnabled())&&(r=Is(i))}else typeof n=="function"?r=n(K(e,{column:o,colDef:s})):r=!!n;return r}var pT=class extends x{postConstruct(){const{gos:e,beans:t}=this;this.selectionCtx=new hT(t.rowModel,t.pinnedRowModel),this.addManagedPropertyListeners(["isRowSelectable","rowSelection"],()=>{const o=Ir(e);o!==this.isRowSelectable&&(this.isRowSelectable=o,this.updateSelectable())}),this.isRowSelectable=Ir(e),this.addManagedEventListeners({cellValueChanged:o=>this.updateRowSelectable(o.node),rowNodeDataChanged:o=>this.updateRowSelectable(o.node)})}destroy(){super.destroy(),this.selectionCtx.reset()}createCheckboxSelectionComponent(){return new uT}createSelectAllFeature(e){if(Gg(this.beans,e))return new gT(e)}isMultiSelect(){return Js(this.gos)}onRowCtrlSelected(e,t,o){const i=!!e.rowNode.isSelected();e.forEachGui(o,s=>{s.rowComp.toggleCss("ag-row-selected",i);const n=s.element;Ad(n,i),n.contains(ve(this.beans))&&t(s)})}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&&!Dn(e)||!Po(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(ts(this.gos)){const s=this.calculateSelectedFromChildren(e);this.setNodesSelected({nodes:[e],newValue:s??!1,source:"selectableChanged"});return}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 i=0;i<e.childrenAfterGroup.length;i++){const s=e.childrenAfterGroup[i];let n=s.isSelected();if(!s.selectable){const r=this.calculateSelectedFromChildren(s);if(r===null)continue;n=r}switch(n){case!0:t=!0;break;case!1:o=!0;break;default:return}}if(!(t&&o))return t?!0:o?!1:e.selectable?e.__selected:null}selectRowNode(e,t,o,i="api"){if(t&&e.destroyed)return!1;const s=!e.selectable&&t,n=e.__selected===t;if(s||n)return!1;e.__selected=t,e.dispatchRowEvent("rowSelected");const r=e.sibling;r&&r.footer&&r.__localEventService&&r.dispatchRowEvent("rowSelected");const a=e.pinnedSibling;return a?.rowPinned&&a.__localEventService&&a.dispatchRowEvent("rowSelected"),this.eventSvc.dispatchEvent({...fC(e,this.gos,"rowSelected"),event:o||null,source:i}),!0}isCellCheckboxSelection(e,t){const o=this.gos.get("rowSelection");if(o&&typeof o!="string"){const i=go(e)&&di(o);return e.isColumnFunc(t,i)}else return e.isColumnFunc(t,e.colDef.checkboxSelection)}inferNodeSelections(e,t,o,i){const{gos:s,selectionCtx:n}=this,r=e.isSelected(),a=ts(s),l=Nf(s),c=Wf(s),d=this.isMultiSelect(),u=i==="rowClicked";if(u&&!(l||c))return null;if(t&&o&&d){const h=n.getRoot();if(h)if(h.isSelected()){const g=n.isInRange(e)?n.truncate(e):n.extend(e,a);return{deselect:g.discard,select:g.keep,reset:!1}}else{const g=n.extend(e,a);return{select:[],deselect:g.keep,reset:!1}}else return null}else if(t&&d){const h=n.selectAll?this.beans.rowModel.getRow(0):void 0,g=n.getRoot(h),f=n.isInRange(e)?n.truncate(e):n.extend(e,a);return{select:f.keep,deselect:f.discard,reset:n.selectAll||!!(g&&!g.isSelected())}}else if(o){if(u){const h=!r;return h&&!l||!h&&!c?null:(n.setRoot(e),{node:e,newValue:h,clearSelection:!1})}return n.setRoot(e),{node:e,newValue:!r,clearSelection:!d}}else{n.setRoot(e);const h=zf(s),g=Xs(s)==="filteredDescendants",f=u&&(!h||!l);if(g&&r===void 0&&Se(s))return{node:e,newValue:!1,checkFilteredNodes:!0,clearSelection:!d||f};if(u){const m=r?!h:l;return m===r&&!f||m&&!l||!m&&!c?null:{node:e,newValue:m,clearSelection:!d||f,keepDescendants:e.group&&a}}return{node:e,newValue:!r,clearSelection:!d||f}}}},fT=class extends pT{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=Zs(e),this.groupSelectsDescendants=ts(e),this.groupSelectsFiltered=Xs(e)==="filteredDescendants",this.masterSelectsDetail=Gl(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=ts(e),o=Zs(e),i=Xs(e)==="filteredDescendants";this.masterSelectsDetail=Gl(e)==="detail",(t!==this.groupSelectsDescendants||i!==this.groupSelectsFiltered||o!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=i,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 i=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,o);if(i==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in i)return i.reset?this.resetNodes():this.selectRange(i.deselect,!1,o),this.selectRange(i.select,!0,o);{const s=i.checkFilteredNodes?Bg(i.node):i.newValue;return this.setNodesSelected({nodes:[i.node],newValue:s,clearSelection:i.clearSelection,keepDescendants:i.keepDescendants,event:e,source:o})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:o,nodes:i,event:s,source:n,keepDescendants:r=!1}){if(i.length===0)return 0;const{gos:a}=this;if(!Po(a)&&e)return D(132),0;if(i.length>1&&!this.isMultiSelect())return D(130),0;let l=0;for(let c=0;c<i.length;c++){const d=i[c],u=d.primaryRow;if(u.rowPinned&&!Dn(u)){D(59);continue}if(u.id===void 0){D(60);continue}if(e&&d.destroyed)continue;this.groupSelectsFiltered&&u.group&&!a.get("treeData")||this.selectRowNode(u,e,s,n)&&(this.detailSelection.delete(u.id),l++),this.groupSelectsDescendants&&u.childrenAfterGroup?.length&&(l+=this.selectChildren(u,e,n))}return o||(i.length===1&&n==="api"&&this.selectionCtx.setRoot(i[0].primaryRow),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(i[0].primaryRow,r,n)),l>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n))),l}selectRange(e,t,o){let i=0;return e.forEach(s=>{const n=s.primaryRow;if(n.group&&this.groupSelectsDescendants)return;this.selectRowNode(n,t,void 0,o)&&i++}),i>0&&(this.updateGroupsFromChildrenSelections(o),this.dispatchSelectionChanged(o)),i}selectChildren(e,t,o){const i=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return i?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:o,nodes:i}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((o,i)=>{e(o)&&t.set(i,o)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:o,rowModel:i}=this.beans;if(!Se(o))return!1;const s=i.rootNode;if(!s)return!1;let n=!1;const r=a=>{if(a!==s){const l=this.calculateSelectedFromChildren(a);n=this.selectRowNode(a,l===null?!1:l,void 0,e)||n}};return zo(s,this.beans.rowModel.hierarchical,t,r),n}clearOtherNodes(e,t,o){const i=new Map;let s=0;return this.selectedNodes.forEach(n=>{const r=n.id==e.id;if((t?!CT(e,n):!0)&&!r){const l=this.selectedNodes.get(n.id);s+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:o}),this.groupSelectsDescendants&&n.parent&&i.set(n.parent.id,n.parent)}}),i.forEach(n=>{const r=this.calculateSelectedFromChildren(n);this.selectRowNode(n,r===null?!1:r,void 0,o)}),s}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 co(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(!Se(e))return;const o=t.getTopLevelNodes();if(o===null)return;const i=[];function s(n){for(let r=0,a=n.length;r<a;r++){const l=n[r];l.isSelected()?i.push(l):l.group&&l.childrenAfterGroup&&s(l.childrenAfterGroup)}}return s(o),i}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const o=Se(this.gos);let i=!1;const s=n=>{const r=this.selectRowNode(n.primaryRow,!1,void 0,e);i||(i=r)};if(t==="currentPage"||t==="filtered"){if(!o){ce(102);return}this.getNodesToSelect(t).forEach(s)}else this.selectedNodes.forEach(s),this.reset(e);if(this.selectionCtx.selectAll=!1,o&&this.groupSelectsDescendants){const n=this.updateGroupsFromChildrenSelections(e);i||(i=n)}i&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,o=0;return this.getNodesToSelect(e).forEach(i=>{this.groupSelectsDescendants&&i.group||(i.isSelected()?t++:i.selectable&&o++)}),{selectedCount:t,notSelectedCount:o}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:o}=this.getSelectedCounts(e);return Hg(t,o)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],o=s=>t.push(s);if(e==="currentPage")return this.forEachNodeOnPage(s=>{if(!s.group){o(s);return}if(!s.footer&&!s.expanded){const n=r=>{o(r);const a=r.childrenAfterFilter;if(a)for(let l=0,c=a.length;l<c;++l)n(a[l])};n(s);return}this.groupSelectsDescendants||o(s)}),t;const i=this.beans.rowModel;return e==="filtered"?(i.forEachNodeAfterFilter(o),t):(i.forEachNode(o),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:o}=this.beans,i=t.getFirstRow(),s=t.getLastRow();for(let n=i;n<=s;n++){const r=o.getRow(n);r&&e(r)}}selectAllRowNodes(e){const{gos:t,selectionCtx:o}=this;if(!Po(t)){D(132);return}if(Vf(t)&&!Js(t)){D(130);return}if(!this.canSelectAll())return;const{source:i,selectAll:s}=e;let n=!1;if(this.getNodesToSelect(s).forEach(r=>{const a=this.selectRowNode(r.primaryRow,!0,void 0,i);n||(n=a)}),o.selectAll=!0,Se(t)&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(i);n||(n=r)}n&&this.dispatchSelectionChanged(i)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,o){if(e||(e=[]),!Array.isArray(e)){ce(103);return}const i=new Set(e),s=[];this.beans.rowModel.forEachNode(n=>{i.has(n.id)&&s.push(n)}),o&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:s,source:t})}canSelectAll(){return Se(this.beans.gos)}updateSelectable(e){const{gos:t,rowModel:o}=this.beans;if(!Po(t))return;const i="selectableChanged",s=Se(t)&&this.groupSelectsDescendants,n=[];if(s){const r=o.rootNode;r&&zo(r,o.hierarchical,e,a=>{let l=!1;for(const c of a.childrenAfterGroup)l||(l=c.selectable),!c.group&&!this.updateRowSelectable(c,!0)&&c.isSelected()&&n.push(c);this.setRowSelectable(a,l,!0)})}else o.forEachNode(r=>{!this.updateRowSelectable(r,!0)&&r.isSelected()&&n.push(r)});n.length&&this.setNodesSelected({nodes:n,newValue:!1,source:i}),!e&&s&&this.updateGroupsFromChildrenSelections?.(i)}updateSelectableAfterGrouping(e){this.updateSelectable(e),this.groupSelectsDescendants&&this.updateGroupsFromChildrenSelections?.("rowGroupChanged",e)&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){if(!this.masterSelectsDetail)return;const o=e.detailNode?.detailGridInfo?.api;if(!o)return;const i=mT(o);e.isSelected()!==i&&this.selectRowNode(e,i,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),i||this.detailSelection.set(e.id,new Set(o.getSelectedNodes().map(n=>n.id)))}setDetailSelectionState(e,t,o){if(this.masterSelectsDetail){if(!Js(t)){D(269);return}switch(e.isSelected()){case!0:{o.selectAll();break}case!1:{o.deselectAll();break}case void 0:{const i=this.detailSelection.get(e.id);if(i){const s=[];for(const n of i){const r=o.getRowNode(n);r&&s.push(r)}o.setNodesSelected({nodes:s,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function mT(e){let t=0,o=0;return e.forEachNode(i=>{i.isSelected()?t++:i.selectable&&o++}),Hg(t,o)}function Hg(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function CT(e,t){let o=t.parent;for(;o;){if(o===e)return!0;o=o.parent}return!1}function Bg(e){const t=e.isSelected()===!1,o=e.childrenAfterFilter?.some(Bg)??!1;return t||o}var vT={moduleName:"SharedRowSelection",version:L,beans:[XM],css:[eT],apiFunctions:{setNodesSelected:tT,selectAll:oT,deselectAll:iT,selectAllFiltered:sT,deselectAllFiltered:nT,selectAllOnCurrentPage:rT,deselectAllOnCurrentPage:aT,getSelectedNodes:lT,getSelectedRows:cT}},wT={moduleName:"RowSelection",version:L,rowModels:["clientSide","infinite","viewport"],beans:[fT],dependsOn:[vT]},bT=class extends x{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,i=o.cellClassRules,s=this.getCellClassParams(e,o);ol(this.beans.expressionSvc,i===this.cellClassRules?void 0:this.cellClassRules,i,s,n=>t.toggleCss(n,!0),n=>t.toggleCss(n,!1)),this.cellClassRules=i}applyUserStyles(){const e=this.column,t=e.colDef,o=t.cellStyle;if(!o)return;let i;if(typeof o=="function"){const s=this.getCellClassParams(e,t);i=o(s)}else i=o;i&&this.cellComp.setUserStyles(i)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,o=e.colDef,i=this.getCellClassParams(e,o);for(const n of this.staticClasses)t.toggleCss(n,!1);const s=this.beans.cellStyles.getStaticCellClasses(o,i);this.staticClasses=s;for(const n of s)t.toggleCss(n,!0)}getCellClassParams(e,t){const{value:o,rowNode:i}=this.cellCtrl;return K(this.beans.gos,{value:o,data:i.data,node:i,colDef:t,column:e,rowIndex:i.rowIndex})}},ST=class extends x{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,o,i){ol(this.beans.expressionSvc,void 0,e.cellClassRules,t,o,i),this.processStaticCellClasses(e,t,o)}getStaticCellClasses(e,t){const{cellClass:o}=e;if(!o)return[];let i;return typeof o=="function"?i=o(t):i=o,typeof i=="string"&&(i=[i]),i||[]}createCellCustomStyleFeature(e){return new bT(e,this.beans)}processStaticCellClasses(e,t,o){this.getStaticCellClasses(e,t).forEach(s=>{o(s)})}},yT={moduleName:"CellStyle",version:L,beans:[ST]},RT={moduleName:"RowStyle",version:L,beans:[CR]},FT={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},Ye="clientSide",Be="serverSide",jo="infinite",ET={onGroupExpandedOrCollapsed:[Ye],refreshClientSideRowModel:[Ye],isRowDataEmpty:[Ye],forEachLeafNode:[Ye],forEachNodeAfterFilter:[Ye],forEachNodeAfterFilterAndSort:[Ye],resetRowHeights:[Ye,Be],applyTransaction:[Ye],applyTransactionAsync:[Ye],flushAsyncTransactions:[Ye],getBestCostNodeSelection:[Ye],getServerSideSelectionState:[Be],setServerSideSelectionState:[Be],applyServerSideTransaction:[Be],applyServerSideTransactionAsync:[Be],applyServerSideRowData:[Be],retryServerSideLoads:[Be],flushServerSideAsyncTransactions:[Be],refreshServerSide:[Be],getServerSideGroupLevelState:[Be],refreshInfiniteCache:[jo],purgeInfiniteCache:[jo],getInfiniteRowCount:[jo],isLastRowIndexKnown:[jo,Be],expandAll:[Ye,Be],collapseAll:[Ye,Be],onRowHeightChanged:[Ye,Be],setRowCount:[jo,Be],getCacheBlockState:[jo,Be]},xT={showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'},clearRangeSelection:{version:"v32.2",message:"Use `clearCellSelection` instead."},getInfiniteRowCount:{version:"v32.2",old:"getInfiniteRowCount()",new:"getDisplayedRowCount()"},selectAllFiltered:{version:"v33",old:"selectAllFiltered()",new:'selectAll("filtered")'},deselectAllFiltered:{version:"v33",old:"deselectAllFiltered()",new:'deselectAll("filtered")'},selectAllOnCurrentPage:{version:"v33",old:"selectAllOnCurrentPage()",new:'selectAll("currentPage")'},deselectAllOnCurrentPage:{version:"v33",old:"deselectAllOnCurrentPage()",new:'deselectAll("currentPage")'}};function PT(e,t,o){const i=xT[e];if(i){const{version:n,new:r,old:a,message:l}=i,c=a??e;return(...d)=>{const u=r?`Please use ${r} instead. `:"";return Ni(`Since ${n} api.${c} is deprecated. ${u}${l??""}`),t.apply(t,d)}}const s=ET[e];return s?(...n)=>{const r=o.rowModel.getType();if(!s.includes(r)){ai(`api.${e} can only be called when gridOptions.rowModelType is ${s.join(" or ")}`);return}return t.apply(t,n)}:t}var DT={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"},MT={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},TT={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"},IT=new Set(["colorPicker","smallUp","checkboxChecked","checkboxIndeterminate","checkboxUnchecked","radioButtonOn","radioButtonOff","smallDown","smallLeft","smallRight"]),AT=class extends x{constructor(){super(...arguments),this.beanName="validation"}wireBeans(e){this.gridOptions=e.gridOptions,Ef(M1)}warnOnInitialPropertyUpdate(e,t){e==="api"&&FT[t]&&D(22,{key:t})}processGridOptions(e){this.processOptions(e,v0())}validateApiFunction(e,t){return PT(e,t,this.beans)}missingUserComponent(e,t,o,i){const s=fi[t];s?this.gos.assertModuleRegistered(s,`AG Grid '${e}' component: ${t}`):D(101,{propertyName:e,componentName:t,agGridDefaults:o,jsComps:i})}missingDynamicBean(e){const t=DT[e];return t?It(200,{...this.gos.getModuleErrorParams(),moduleName:t,reasonOrId:e}):void 0}checkRowEvents(e){LT.has(e)&&D(10,{eventType:e})}validateIcon(e){if(IT.has(e)&&D(43,{iconName:e}),MT[e])return;const t=TT[e];if(t){ce(200,{reasonOrId:`icon '${e}'`,moduleName:t,gridScoped:Pa(),gridId:this.beans.context.getId(),rowModelType:this.gos.get("rowModelType"),additionalText:"Alternatively, use the CSS icon name directly."});return}D(134,{iconName:e})}isProvidedUserComp(e){return!!fi[e]}validateColDef(e){this.processOptions(e,a0())}processOptions(e,t){const{validations:o,deprecations:i,allProperties:s,propertyExceptions:n,objectName:r,docsUrl:a}=t;s&&this.gridOptions.suppressPropertyNamesCheck!==!0&&this.checkProperties(e,[...n??[],...Object.keys(i)],s,r,a);const l=new Set;if(Object.keys(e).forEach(d=>{const u=i[d];if(u){const{message:w,version:b}=u;l.add(`As of v${b}, ${String(d)} is deprecated. ${w??""}`)}const h=e[d];if(h==null||h===!1)return;const g=o[d];if(!g)return;const{dependencies:f,validate:m,supportedRowModels:C,expectedType:v}=g;if(v){const w=typeof h;if(w!==v){l.add(`${String(d)} should be of type '${v}' but received '${w}' (${h}).`);return}}if(C){const w=this.gridOptions.rowModelType??"clientSide";if(!C.includes(w)){l.add(`${String(d)} is not supported with the '${w}' row model. It is only valid with: ${C.join(", ")}.`);return}}if(f){const w=this.checkForRequiredDependencies(d,f,e);if(w){l.add(w);return}}if(m){const w=m(e,this.gridOptions,this.beans);if(w){l.add(w);return}}}),l.size>0)for(const d of l)Ni(d)}checkForRequiredDependencies(e,t,o){const s=Object.entries(t).filter(([n,r])=>{const a=o[n];return!r.required.includes(a)});return s.length===0?null:s.map(([n,r])=>`'${String(e)}' requires '${n}' to be one of [${r.required.map(a=>a===null?"null":a===void 0?"undefined":a).join(", ")}]. ${r.reason??""}`).join(`
62
62
  `)}checkProperties(e,t,o,i,s){const n=["__ob__","__v_skip","__metadata__"],r=kT(Object.getOwnPropertyNames(e),[...n,...t,...o],o),a=Object.keys(r);for(const l of a){const c=r[l];let d=`invalid ${i} property '${l}' did you mean any of these: ${c.slice(0,8).join(", ")}.`;o.includes("context")&&(d+=`
63
- If you are trying to annotate ${i} with application data, use the '${i}.context' property instead.`),Ni(d)}if(a.length>0&&s){const l=this.beans.frameworkOverrides.getDocLink(s);Ni(`to see all the valid ${i} properties please check: ${l}`)}}};function kT(e,t,o){const i={},s=e.filter(n=>!t.some(r=>r===n));if(s.length>0)for(const n of s)i[n]=Qr({inputValue:n,allSuggestions:o}).values;return i}var LT=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),OT={moduleName:"Validation",version:L,beans:[AT]},GT={moduleName:"AllCommunity",version:L,dependsOn:[TF,JF,HD,OT,Ex,xx,Px,Dx,Mx,Tx,Ix,Fx,SD,yD,RD,FD,bD,xD,PD,ZD,G1,vM,fh,Y1,Q1,_M,HF,yw,EM,wT,f1,yT,zF,RT,_D,v1,OM,cg,$D,$M,Sw,IF,JM]};function N(e,t={}){const o=Object.keys(t).map(i=>{const s=t[i];return s!=null?`${i}=${s}`:null}).filter(Boolean).join(";");return[e,o].filter(i=>i.length>0).join(":")}var B={grid(e){return N("ag-grid-root",{gridId:e})},headerGroupCell(e){return N("ag-header-group-cell",{colId:e})},headerCell(e){return N("ag-header-cell",{colId:e})},headerCheckbox(e){return N("ag-header-selection-checkbox",{colId:e})},headerFilterButton(e){return N("ag-header-cell-filter-button",{colId:e})},floatingFilter(e){return N("ag-floating-filter",{colId:e})},floatingFilterButton(e){return N("ag-floating-filter-button",{colId:e})},headerCellMenuButton(e){return N("ag-header-cell-menu-button",{colId:e})},headerResizeHandle(e){return N("ag-header-cell-resize",{colId:e})},filterInstancePickerDisplay(e){return N(`ag-${e.source}-picker-display`,Ps(e))},numberFilterInstanceInput(e){return N(`ag-${e.source}-number-input`,Ps(e))},textFilterInstanceInput(e){return N(`ag-${e.source}-text-input`,Ps(e))},dateFilterInstanceInput(e){return N(`ag-${e.source}-date-input`,Ps(e))},setFilterInstanceMiniFilterInput(e){return N(`ag-${e.source}-set-filter-mini-filter-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},setFilterInstanceItem(e,t){return N(`ag-${e.source}-set-filter-item`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,itemLabel:t}:{colId:e.colId,itemLabel:t})},setFilterApplyPanelButton(e,t){return N(`ag-${e.source}-set-filter-apply-panel-button`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,buttonLabel:t}:{colId:e.colId,buttonLabel:t})},filterConditionRadioButton(e,t){return N(`ag-${e.source}-filter-condition-radio-button`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,buttonLabel:t}:{colId:e.colId,buttonLabel:t})},advancedFilterInput(){return N("ag-advanced-filter-input")},advancedFilterButton(e){return N("ag-advanced-filter-button",{label:e})},advancedFilterBuilderButton(){return N("ag-advanced-filter-builder-button")},advancedFilterPanelMaximiseButton(){return N("ag-advanced-filter-builder-panel-maximise")},advancedFilterPanelCloseButton(){return N("ag-advanced-filter-builder-panel-close")},advancedFilterPill(e){return N("ag-advanced-filter-builder-pill",{label:e})},advancedFilterBuilderAddItemButton(){return N("ag-advanced-filter-builder-add-item-button")},rowNode(e){return N("ag-row",{"row-id":e})},cell(e,t){return N("ag-cell",{"row-id":e,colId:t})},autoGroupCell(e){return B.cell(e,oo)},checkbox(e,t){return N("ag-selection-checkbox",{"row-id":e,colId:t})},selectionColumnCheckbox(e){return B.checkbox(e,Ta)},autoGroupColumnCheckbox(e){return B.checkbox(e,oo)},dragHandle(e,t){return N("ag-drag-handle",{"row-id":e,colId:t})},groupContracted(e,t){return N("ag-group-contracted",{"row-id":e,colId:t})},groupExpanded(e,t){return N("ag-group-expanded",{"row-id":e,colId:t})},autoGroupContracted(e){return B.groupContracted(e,oo)},autoGroupExpanded(e){return B.groupExpanded(e,oo)},rowNumber(e){return B.cell(e,Ia)},menu(){return N("ag-menu")},menuOption(e){return N("ag-menu-option",{option:e})},sideBar(){return N("ag-side-bar")},sideBarButton(e){return N("ag-side-button",{label:e})},columnToolPanel(){return N("ag-column-panel")},pivotModeSelect(){return N("ag-pivot-mode-select")},columnPanelSelectHeaderCheckbox(){return N("ag-column-panel-select-header-checkbox")},columnPanelSelectHeaderFilter(){return N("ag-column-panel-select-header-filter")},columnSelectListItemGroupClosedIcon(e){return N("ag-column-select-list-item-group-closed-icon",{label:e})},columnSelectListItemCheckbox(e){return N("ag-column-select-list-item-checkbox",{label:e})},columnSelectListItemDragHandle(e){return N("ag-column-select-list-item-drag-handle",{label:e})},columnDropCellDragHandle(e,t,o){return N("ag-column-drop-cell-drag-handle",{source:e,area:t,label:o})},columnDropCellCancelButton(e,t,o){return N("ag-column-drop-cell-cancel",{source:e,area:t,label:o})},columnDropArea(e,t){return N("ag-column-drop-area",{source:e,name:t})},filterToolPanel(){return N("ag-filter-panel")},filterToolPanelAddFilterButton(){return N("ag-filter-panel-add-filter-button")},filterToolPanelFilterTypeSelector(e){return N("ag-filter-panel-filter-type-selector",{colLabel:e})},filterToolPanelSearchInput(){return N("ag-filter-toolpanel-search-input")},filterToolPanelGroup(e){return N("ag-filter-toolpanel-group",{title:e})},filterToolPanelGroupCollapsedIcon(e){return N("ag-filter-toolpanel-group-collapsed-icon",{title:e})},statusBarTotalAndFilteredRowCount(){return N("ag-status-bar-total-and-filtered-row-count")},statusBarTotalRowCount(){return N("ag-status-bar-total-row-count")},statusBarFilteredRowCount(){return N("ag-status-bar-filtered-row-count")},statusBarSelectedRowCount(){return N("ag-status-bar-selected-row-count")},statusBarAggregations(){return N("ag-status-bar-aggregations")},paginationPanelSizePickerDisplay(e){return N("ag-pagination-page-size-picker-field-display",{value:e})},paginationPanelFirstRowOnPage(e){return N("ag-paging-row-summary-panel-first-row-on-page",{value:e})},paginationPanelLastRowOnPage(e){return N("ag-paging-row-summary-panel-last-row-on-page",{value:e})},paginationPanelRecordCount(e){return N("ag-paging-row-summary-panel-record-count",{value:e})},paginationSummaryPanelButton(e){return N("ag-paging-page-summary-panel-btn",{label:e})},paginationSummaryPanelCurrentPage(e){return N("ag-paging-page-summary-panel-current-page",{value:e})},paginationSummaryPanelTotalPage(e){return N("ag-paging-page-summary-panel-total-page",{value:e})},fillHandle(){return N("ag-fill-handle")},columnChooserCloseButton(){return N("ag-column-chooser-close-button")},columnChooserSearchBarCheckbox(){return N("ag-column-chooser-header-checkbox")},columnChooserSearchBarFilter(){return N("ag-column-chooser-searchbar-filter")},columnChooserListItemGroupClosedIcon(e){return N("ag-column-chooser-list-item-group-closed-icon",{label:e})},columnChooserListItemCheckbox(e){return N("ag-column-chooser-list-item-checkbox",{label:e})},columnChooserListItemDragHandle(e){return N("ag-column-chooser-list-item-drag-handle",{label:e})},overlay(){return N("ag-overlay")}};function HT(e,t){const o={};for(const i of Object.keys(e))t[i]!==null&&(o[t[i]??i]=e[i]);return o}function BT(e){return e.source!=="floating-filter"?{index:0,...e}:e}function Ps(e){return HT(BT(e),{colLabel:"label"})}var Vg="data-testid";function _(e,t){e?.setAttribute(Vg,t)}function VT(e){Vg=e}var NT=class extends x{constructor(){super(...arguments),this.beanName="testIdSvc"}postConstruct(){const e=xe(this,()=>this.setupAllTestIds(),500),t=xe(this,()=>{this.setupAllTestIds(),e()},0);this.addManagedEventListeners({firstDataRendered:t,displayedRowsChanged:t,displayedColumnsChanged:t,displayedColumnsWidthChanged:t,virtualColumnsChanged:t,columnMenuVisibleChanged:t,contextMenuVisibleChanged:t,advancedFilterBuilderVisibleChanged:t,fieldPickerValueSelected:t,modelUpdated:t,sideBarUpdated:t,pinnedHeightChanged:t,gridReady:t,overlayExclusiveChanged:t,rowGroupOpened:t,scrollVisibilityChanged:t,gridSizeChanged:t,filterOpened:t,filterChanged:t,cellSelectionChanged:t})}setupAllTestIds(){const e=gt(this.beans),t=Ju(this.beans),o=e.querySelector(`[grid-id="${t}"]`);_(o,B.grid(t)),e.querySelectorAll(".ag-header-group-cell").forEach(n=>{_(n,B.headerGroupCell(n.getAttribute("col-id")))}),e.querySelectorAll(".ag-header-cell").forEach(n=>{const r=n.getAttribute("col-id"),l=n.classList.contains("ag-floating-filter")?B.floatingFilter(r):B.headerCell(r);_(n,l),_(n.querySelector(".ag-header-cell-filter-button"),B.headerFilterButton(r)),_(n.querySelector(".ag-header-cell-menu-button"),B.headerCellMenuButton(r)),_(n.querySelector(".ag-header-cell-resize"),B.headerResizeHandle(r)),_(n.querySelector(".ag-checkbox input[type=checkbox]"),B.headerCheckbox(r)),_(n.querySelector(".ag-floating-filter-button button"),B.floatingFilterButton(r)),this.setupFilterInstance(n.querySelector(".ag-floating-filter-body"),{source:"floating-filter",colId:r})});const i=e.querySelector(".ag-filter-menu");this.setupFilterInstance(i,{source:"column-filter"}),_(e.querySelector(".ag-advanced-filter input[type=text]"),B.advancedFilterInput()),e.querySelectorAll(".ag-advanced-filter-buttons button").forEach(n=>{_(n,B.advancedFilterButton(n.textContent))}),_(e.querySelector("button.ag-advanced-filter-builder-button"),B.advancedFilterBuilderButton()),e.querySelectorAll('.ag-panel[aria-label="Advanced Filter"] .ag-panel-title-bar-button').forEach((n,r)=>{_(n,r===0?B.advancedFilterPanelMaximiseButton():B.advancedFilterPanelCloseButton())}),e.querySelectorAll('.ag-panel[aria-lable="Advanced Filter"] .ag-advanced-filter-builder-pill').forEach(n=>{_(n,B.advancedFilterPill(n.querySelector(".ag-picker-field-display")?.textContent))}),_(e.querySelector('.ag-panel[aria-label="Advanced Filter"] .ag-advanced-filter-builder-item-button'),B.advancedFilterBuilderAddItemButton()),e.querySelectorAll(".ag-row").forEach(n=>{const r=n.getAttribute("row-id");_(n,B.rowNode(r)),n.querySelectorAll(".ag-cell").forEach(a=>{const l=a.getAttribute("col-id");_(a,B.cell(r,l)),_(a.querySelector(".ag-selection-checkbox input[type=checkbox]"),B.checkbox(r,l)),_(a.querySelector(".ag-drag-handle"),B.dragHandle(r,l)),_(a.querySelector(".ag-group-contracted"),B.groupContracted(r,l)),_(a.querySelector(".ag-group-expanded"),B.groupExpanded(r,l))})}),e.querySelectorAll(".ag-menu-list").forEach(n=>{_(n,B.menu()),n.querySelectorAll(".ag-menu-option").forEach(r=>{_(r,B.menuOption(r.querySelector(".ag-menu-option-text")?.textContent))})}),e.querySelectorAll(".ag-side-bar").forEach(n=>{_(n,B.sideBar()),n.querySelectorAll(".ag-side-button button").forEach(r=>{_(r,B.sideBarButton(r.querySelector(".ag-side-button-label")?.textContent))}),n.querySelectorAll(".ag-column-panel").forEach(r=>{_(r,B.columnToolPanel()),_(r.querySelector(".ag-pivot-mode-select input[type=checkbox]"),B.pivotModeSelect()),_(r.querySelector(".ag-column-select-header-checkbox input[type=checkbox]"),B.columnPanelSelectHeaderCheckbox()),_(r.querySelector(".ag-column-select-header-filter-wrapper input[type=text]"),B.columnPanelSelectHeaderFilter()),r.querySelectorAll(".ag-column-select-list").forEach(a=>{a.querySelectorAll(".ag-column-select-virtual-list-item").forEach(l=>{const c=l.getAttribute("aria-label");_(l.querySelector(".ag-column-group-closed-icon"),B.columnSelectListItemGroupClosedIcon(c)),_(l.querySelector(".ag-column-select-checkbox input[type=checkbox]"),B.columnSelectListItemCheckbox(c)),_(l.querySelector(".ag-drag-handle"),B.columnSelectListItemDragHandle(c))})}),this.setupColumnDropArea(r,"toolbar")}),n.querySelectorAll(".ag-filter-panel").forEach(r=>{_(r,B.filterToolPanel()),_(r.querySelector("button.ag-filter-add-button"),B.filterToolPanelAddFilterButton()),r.querySelectorAll(".ag-filter-card").forEach(a=>{const l=a.querySelector(".ag-filter-card-title")?.textContent,c=a.querySelector(".ag-filter-type-select");_(c,B.filterToolPanelFilterTypeSelector(l)),a.querySelectorAll(".ag-filter").forEach(d=>this.setupFilterInstance(d,{source:"filter-toolpanel",colLabel:l}))})}),n.querySelectorAll(".ag-filter-toolpanel").forEach(r=>{_(r.querySelector(".ag-filter-toolpanel-search-input input[type=text]"),B.filterToolPanelSearchInput()),r.querySelectorAll(".ag-filter-toolpanel-group").forEach(a=>{const l=a.querySelector(".ag-filter-toolpanel-group-title")?.textContent;_(a,B.filterToolPanelGroup(l)),_(a.querySelector(".ag-filter-toolpanel-group-title-bar-icon .ag-icon-tree-closed"),B.filterToolPanelGroupCollapsedIcon(l));const c=a.querySelector(".ag-filter-toolpanel-instance-filter");c&&this.setupFilterInstance(c,{source:"filter-toolpanel",colLabel:l})})})}),_(e.querySelector(".ag-status-bar .ag-status-panel-total-and-filtered-row-count"),B.statusBarTotalAndFilteredRowCount()),_(e.querySelector(".ag-status-bar .ag-status-panel-total-row-count"),B.statusBarTotalRowCount()),_(e.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"),B.statusBarFilteredRowCount()),_(e.querySelector(".ag-status-bar .ag-status-panel-selected-row-count"),B.statusBarSelectedRowCount()),_(e.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"),B.statusBarAggregations()),e.querySelectorAll(".ag-paging-panel").forEach(n=>{_(n.querySelector(".ag-paging-page-size .ag-picker-field-display"),B.paginationPanelSizePickerDisplay(n.querySelector(".ag-paging-page-size .ag-picker-field-display")?.textContent)),n.querySelectorAll(".ag-paging-row-summary-panel-number").forEach(r=>{switch(r.getAttribute("data-ref")){case"lbFirstRowOnPage":_(r,B.paginationPanelFirstRowOnPage(r.textContent));break;case"lbLastRowOnPage":_(r,B.paginationPanelLastRowOnPage(r.textContent));break;case"lbRecordCount":_(r,B.paginationPanelRecordCount(r.textContent));break}}),n.querySelectorAll(".ag-paging-page-summary-panel .ag-button").forEach(r=>{_(r,B.paginationSummaryPanelButton(r.getAttribute("aria-label")?.toLowerCase()))}),n.querySelectorAll(".ag-paging-page-summary-panel .ag-paging-number").forEach(r=>{switch(r.getAttribute("data-ref")){case"lbCurrent":_(r,B.paginationSummaryPanelCurrentPage(r.textContent));break;case"lbTotal":_(r,B.paginationSummaryPanelTotalPage(r.textContent));break}})}),_(e.querySelector(".ag-fill-handle"),B.fillHandle()),e.querySelectorAll('.ag-panel[aria-label="Choose Columns"]').forEach(n=>{_(n.querySelector(".ag-panel-title-bar-button-icon"),B.columnChooserCloseButton()),_(n.querySelector('.ag-column-select-header-checkbox input[type="checkbox"]'),B.columnChooserSearchBarCheckbox()),_(n.querySelector('.ag-column-select-header-filter-wrapper input[type="text"]'),B.columnChooserSearchBarFilter()),n.querySelectorAll(".ag-column-select-list").forEach(r=>{r.querySelectorAll(".ag-column-select-virtual-list-item").forEach(a=>{const l=a.getAttribute("aria-label");_(a.querySelector(".ag-column-group-closed-icon"),B.columnChooserListItemGroupClosedIcon(l)),_(a.querySelector(".ag-column-select-checkbox input[type=checkbox]"),B.columnChooserListItemCheckbox(l)),_(a.querySelector(".ag-drag-handle"),B.columnChooserListItemDragHandle(l))})})}),_(e.querySelector(".ag-overlay-wrapper"),B.overlay());const s=e.querySelector(".ag-column-drop-wrapper");s&&this.setupColumnDropArea(s,"panel")}setupFilterInstance(e,t){if(!e)return;e.querySelectorAll(".ag-filter-select .ag-picker-field-display").forEach(s=>{_(s,B.filterInstancePickerDisplay(t))});const o=t.source==="floating-filter"?".ag-floating-filter-body":".ag-filter-body";e.querySelectorAll(`${o} .ag-input-field:not(.ag-hidden) input[type="number"]`).forEach((s,n,r)=>{const l=r.length>1?{...t,index:n}:t;_(s,B.numberFilterInstanceInput(l))}),e.querySelectorAll(`${o} .ag-input-field:not(.ag-hidden) input[type="text"]`).forEach((s,n,r)=>{const l=r.length>1?{...t,index:n}:t;_(s,B.textFilterInstanceInput(l))}),e.querySelectorAll(`${o} .ag-input-field:not(.ag-hidden) input[type="date"]`).forEach((s,n,r)=>{const l=r.length>1?{...t,index:n}:t;_(s,B.dateFilterInstanceInput(l))});const i=e.querySelector('.ag-mini-filter input[type="text"]');_(i,B.setFilterInstanceMiniFilterInput(t)),e.querySelectorAll(".ag-set-filter-list .ag-set-filter-item").forEach(s=>{const n=s.querySelector(".ag-checkbox-label")?.textContent,r=s.querySelector('input[type="checkbox"]');_(r,B.setFilterInstanceItem(t,n))}),e.querySelectorAll(".ag-filter-apply-panel button").forEach(s=>{_(s,B.setFilterApplyPanelButton(t,s.textContent))}),e.querySelectorAll(".ag-filter-condition .ag-radio-button").forEach(s=>{const n=s.querySelector(".ag-radio-button-label")?.textContent;_(s.querySelector("input[type=radio]"),B.filterConditionRadioButton(t,n))})}setupColumnDropArea(e,t){e.querySelectorAll(".ag-column-drop").forEach(o=>{const i=o.querySelector(".ag-column-drop-list")?.getAttribute("aria-label");_(o,B.columnDropArea(t,i)),o.querySelectorAll(".ag-column-drop-cell").forEach(s=>{const n=s.querySelector(".ag-column-drop-cell-text")?.textContent;_(s.querySelector(".ag-drag-handle"),B.columnDropCellDragHandle(t,i,n)),_(s.querySelector(".ag-column-drop-cell-button .ag-icon-cancel"),B.columnDropCellCancelButton(t,i,n))})})}},WT={moduleName:"Testing",version:L,beans:[NT]};function zT({testIdAttribute:e}={}){e&&VT(e),Qd.registerModules([WT])}var _T=class{wrap(e,t,o,i){const s=this.createWrapper(e,i);for(const n of t??[])this.createMethod(s,n,!0);for(const n of o??[])this.createMethod(s,n,!1);return s}createMethod(e,t,o){e.addMethod(t,this.createMethodProxy(e,t,o))}createMethodProxy(e,t,o){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(o&&D(49,{methodName:t}),null)}}},UT=class extends Qu{constructor(e){super(e,Oa)}},We=p.createContext({}),Ng=p.createContext("default"),ps=(e,t,o,i)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const n=e.newAgStackInstance();let r,a,l=!1;return n.then(c=>{if(l){t.destroyBean(c);return}r=c,a=r.getGui(),o.appendChild(a),cd(i,r)}),()=>{l=!0,r&&(a?.remove(),t.destroyBean(r),i&&cd(i,void 0))}},cd=(e,t)=>{if(e)if(e instanceof Function)e(t);else{const o=e;o.current=t}},at=(...e)=>e.filter(o=>o!=null&&o!=="").join(" "),dt=class Wg{constructor(...t){this.classesMap={};for(const o of t)this.classesMap[o]=!0}setClass(t,o){if(!!this.classesMap[t]==o)return this;const s=new Wg;return s.classesMap={...this.classesMap},s.classesMap[t]=o,s}toString(){return Object.keys(this.classesMap).filter(o=>this.classesMap[o]).join(" ")}},Mi=e=>{const t=()=>typeof Symbol=="function"&&Symbol.for,o=()=>t()?Symbol.for("react.memo"):60115;return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===o()},ca=p.version?.split(".")[0],zg=ca==="16"||ca==="17";function $T(){return ca==="19"}var Ws=!1;function KT(e){return Ws||setTimeout(()=>Ws=!1,0),Ws=!0,e()}var rs=(e,t)=>{!zg&&e&&!Ws?ga.flushSync(t):t()},qT=e=>{zg?e():p.startTransition(e)};function jT(e,t,o){return p.useSyncExternalStore?p.useSyncExternalStore(e,t):o}function mn(e,t,o){if(t==null||e==null)return t;if(e===t||t.length===0&&e.length===0)return e;if(o||e.length===0&&t.length>0||e.length>0&&t.length===0)return t;const i=[],s=[],n=new Map,r=new Map;for(let a=0;a<t.length;a++){const l=t[a];r.set(l.instanceId,l)}for(let a=0;a<e.length;a++){const l=e[a];n.set(l.instanceId,l),r.has(l.instanceId)&&i.push(l)}for(let a=0;a<t.length;a++){const l=t[a],c=l.instanceId;n.has(c)||s.push(l)}return i.length===e.length&&s.length===0?e:i.length===0&&s.length===t.length?t:i.length===0?s:s.length===0?i:[...i,...s]}var _g=p.forwardRef((e,t)=>{const{registry:o,context:i}=p.useContext(We),s=p.useRef(null),n=p.useRef(null),r=p.useRef(null),a=p.useRef(null),l=p.useRef(null),c=p.useRef(),[d,u]=p.useState(),[h,g]=p.useState(),[f,m]=p.useState(),[C,v]=p.useState(()=>new dt),[w,b]=p.useState(()=>new dt("ag-hidden")),[y,S]=p.useState(()=>new dt("ag-hidden")),[F,E]=p.useState(()=>new dt("ag-invisible"));p.useImperativeHandle(t,()=>({refresh(){return!1}})),p.useLayoutEffect(()=>ps(d,i,n.current),[d]);const M=p.useCallback(ie=>{if(s.current=ie,!ie||i.isDestroyed()){c.current=i.destroyBean(c.current);return}const $={setInnerRenderer:(z,te)=>{u(z),m(te)},setChildCount:z=>g(z),toggleCss:(z,te)=>v(q=>q.setClass(z,te)),setContractedDisplayed:z=>S(te=>te.setClass("ag-hidden",!z)),setExpandedDisplayed:z=>b(te=>te.setClass("ag-hidden",!z)),setCheckboxVisible:z=>E(te=>te.setClass("ag-invisible",!z)),setCheckboxSpacing:z=>E(te=>te.setClass("ag-group-checkbox-spacing",z))},Z=o.createDynamicBean("groupCellRendererCtrl",!0);Z&&(c.current=i.createBean(Z),c.current.init($,ie,r.current,a.current,l.current,_g,e))},[]),T=p.useMemo(()=>`ag-cell-wrapper ${C.toString()}`,[C]),G=p.useMemo(()=>`ag-group-expanded ${w.toString()}`,[w]),P=p.useMemo(()=>`ag-group-contracted ${y.toString()}`,[y]),I=p.useMemo(()=>`ag-group-checkbox ${F.toString()}`,[F]),A=d?.componentFromFramework,J=A?d.componentClass:void 0,k=d==null&&f!=null,j=Ei(f);return p.createElement("span",{className:T,ref:M,...e.colDef?{}:{role:c.current?.getCellAriaRole()}},p.createElement("span",{className:G,ref:a}),p.createElement("span",{className:P,ref:l}),p.createElement("span",{className:I,ref:r}),p.createElement("span",{className:"ag-group-value",ref:n},k?j:A?p.createElement(J,{...d.params}):null),p.createElement("span",{className:"ag-group-child-count"},h))}),dd=_g,El=p.createContext({setMethods:()=>{}}),YT=e=>{const{initialProps:t,addUpdateCallback:o,CustomComponentClass:i,setMethods:s}=e,[{key:n,...r},a]=p.useState(t);return p.useEffect(()=>{o(l=>a(l))},[]),p.createElement(El.Provider,{value:{setMethods:s}},p.createElement(i,{key:n,...r}))},QT=p.memo(YT),ZT=0;function ud(){return`agPortalKey_${++ZT}`}var Ug=class{constructor(e,t,o,i){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=o,this.suppressFallbackMethods=!!i,this.statelessComponent=this.isStateless(this.reactComponent),this.key=ud(),this.portalKey=ud(),this.instanceCreated=this.isStatelessComponent()?se.resolve(!1):new se(s=>{this.resolveInstanceCreated=s})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){this.componentInstance&&typeof this.componentInstance.destroy=="function"&&this.componentInstance.destroy();const e=this.portal;e&&this.portalManager.destroyPortal(e)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),o=document.createElement(t||"div");return o.classList.add("ag-react-container"),e.reactContainer=o,o}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return typeof Symbol=="function"&&Symbol.for}isStateless(e){return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&t[e]!=null||this.fallbackMethodAvailable(e)}callMethod(e,t){const o=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!o){setTimeout(()=>this.callMethod(e,t));return}const i=o[e];if(i)return i.apply(o,t);if(this.fallbackMethodAvailable(e))return this.fallbackMethod(e,t&&t[0]?t[0]:{})}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.createOrUpdatePortal(e),new se(t=>this.createReactComponent(t))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=t=>{this.componentInstance=t,this.resolveInstanceCreated?.(!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,{...e,key:this.key}),this.portal=ga.createPortal(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return p.createElement(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,e)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!!(!this.isStatelessComponent()&&this.getFrameworkComponentInstance())}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const o=this[`${e}Component`];if(!this.suppressFallbackMethods&&o)return o.bind(this)(t)}fallbackMethodAvailable(e){return this.suppressFallbackMethods?!1:!!this[`${e}Component`]}};function Bn(e,t,o){for(const i of e){const s=t[i];s&&(o[i]=s)}}var ht=class extends Ug{constructor(){super(...arguments),this.awaitUpdateCallback=new se(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=QT}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:o=>this.setMethods(o),addUpdateCallback:o=>{this.updateCallback=()=>(o(this.getProps()),new se(i=>{setTimeout(()=>{i()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,Bn(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return{...this.sourceParams,key:this.key,ref:this.ref}}refreshProps(){return this.updateCallback?this.updateCallback():new se(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},JT=class extends ht{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},XT=class extends ht{refresh(e){this.sourceParams=e,this.refreshProps()}},e2=class extends ht{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},t2=class extends ht{constructor(){super(...arguments),this.label="",this.icon=null,this.shake=!1}setIcon(e,t){this.icon=e,this.shake=t,this.refreshProps()}setLabel(e){this.label=e,this.refreshProps()}getProps(){const e=super.getProps(),{label:t,icon:o,shake:i}=this;return e.label=t,e.icon=o,e.shake=i,e}},o2=class extends ht{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterModifiedCallback(),this.expectingNewMethods=!0,this.hasBeenActive=!1,this.awaitSetMethodsCallback=new se(e=>{this.resolveSetMethodsCallback=e})}isFilterActive(){return this.model!=null}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.expectingNewMethods=!0,this.model=e,this.hasBeenActive||(this.hasBeenActive=this.isFilterActive()),this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}setMethods(e){this.expectingNewMethods===!1&&this.hasBeenActive&&this.providedMethods?.doesFilterPass!==e?.doesFilterPass&&setTimeout(()=>{this.sourceParams.filterChangedCallback()}),this.expectingNewMethods=!1,super.setMethods(e),this.resolveSetMethodsCallback(),this.resolveFilterPassCallback?.(),this.resolveFilterPassCallback=void 0}updateModel(e){this.resolveFilterPassCallback?.();const t=new se(o=>{this.resolveFilterPassCallback=o});this.setModel(e).then(()=>{t.then(()=>{this.sourceParams.filterChangedCallback()})})}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,e}},i2=class extends ht{constructor(){super(...arguments),this.awaitSetMethodsCallback=new se(e=>{this.resolveSetMethodsCallback=e})}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","onAnyFilterChanged"]}setMethods(e){super.setMethods(e),this.resolveSetMethodsCallback()}};function $g(e,t){e.parentFilterInstance(o=>{(o.setModel(t)||se.resolve()).then(()=>{e.filterParams.filterChangedCallback()})})}var s2=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=o=>this.updateModel(o)}getProps(){return{...this.floatingFilterParams,model:this.model,onModelChange:this.onModelChange}}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){Bn(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),$g(this.floatingFilterParams,e)}},n2=class extends ht{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),$g(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},r2=class extends ht{refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}},a2=class extends ht{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},l2=class extends ht{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then(()=>this.sourceParams.onItemActivated())}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},c2=class extends ht{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},d2=class extends ht{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}};function xl(){D(231)}var u2=1e3,h2=class{constructor(e,t,o){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=t||"div",this.refresher=e,this.maxComponentCreationTimeMs=o||u2}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter(t=>t!==e),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,t,o){this.portals=[...this.portals,e],this.waitForInstance(t,o),this.batchUpdate()}updateReactPortal(e,t){this.portals[this.portals.indexOf(e)]=t,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout(()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)}),this.hasPendingPortalUpdate=!0)}waitForInstance(e,t,o=Date.now()){if(this.destroyed){t(null);return}if(e.rendered())t(e);else{if(Date.now()-o>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate){rs(!0,()=>this.refresher()),e.rendered()&&t(e);return}window.setTimeout(()=>{this.waitForInstance(e,t,o)})}}},g2=p.createContext([]),p2=p.createContext(void 0),f2=({ctrl:e})=>{const t=e.isAlive(),{context:o}=p.useContext(We),[i,s]=p.useState(),[n,r]=p.useState(),a=p.useRef(),l=p.useRef(null),c=p.useRef(null),d=p.useRef(null),u=p.useRef(),h=p.useRef();t&&!h.current&&(h.current=new as(()=>l.current));const g=p.useCallback(v=>{if(l.current=v,!v||!e.isAlive()||o.isDestroyed()){a.current=o.destroyBean(a.current);return}a.current=o.createBean(new Di);const w=()=>{const y=e.getSelectAllGui();y&&(c.current?.insertAdjacentElement("afterend",y),a.current.addDestroyFunc(()=>y.remove()))},b={setWidth:y=>{l.current&&(l.current.style.width=y)},toggleCss:(y,S)=>h.current.toggleCss(y,S),setUserStyles:y=>r(y),setAriaSort:y=>{l.current&&(y?_p(l.current,y):Up(l.current))},setUserCompDetails:y=>s(y),getUserCompInstance:()=>u.current||void 0,refreshSelectAllGui:w,removeSelectAllGui:()=>e.getSelectAllGui()?.remove()};e.setComp(b,v,c.current,d.current,a.current),w()},[]);p.useLayoutEffect(()=>ps(i,o,d.current,u),[i]),p.useEffect(()=>{e.setDragSource(l.current)},[i]);const f=p.useMemo(()=>!!(i?.componentFromFramework&&Mi(i.componentClass)),[i]),m=i?.componentFromFramework,C=i?.componentClass;return p.createElement("div",{ref:g,style:n,className:"ag-header-cell",role:"columnheader"},p.createElement("div",{ref:c,className:"ag-header-cell-resize",role:"presentation"}),p.createElement("div",{ref:d,className:"ag-header-cell-comp-wrapper",role:"presentation"},m?f?p.createElement(C,{...i.params}):p.createElement(C,{...i.params,ref:u}):null))},m2=p.memo(f2),C2=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t}getProps(){return this.floatingFilterParams}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){Bn(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}},v2=({ctrl:e})=>{const{context:t,gos:o}=p.useContext(We),[i,s]=p.useState(),[n,r]=p.useState(()=>new dt("ag-header-cell","ag-floating-filter")),[a,l]=p.useState(()=>new dt),[c,d]=p.useState(()=>new dt("ag-floating-filter-button","ag-hidden")),[u,h]=p.useState("false"),[g,f]=p.useState(),[,m]=p.useState(1),C=p.useRef(),v=p.useRef(null),w=p.useRef(null),b=p.useRef(null),y=p.useRef(null),S=p.useRef(),F=p.useRef(),E=z=>{z!=null&&S.current?.(z)},M=p.useCallback(z=>{if(v.current=z,!z||!e.isAlive()||t.isDestroyed()){C.current=t.destroyBean(C.current);return}C.current=t.createBean(new Di),F.current=new se(q=>{S.current=q});const te={toggleCss:(q,oe)=>r(de=>de.setClass(q,oe)),setUserStyles:q=>s(q),addOrRemoveBodyCssClass:(q,oe)=>l(de=>de.setClass(q,oe)),setButtonWrapperDisplayed:q=>{d(oe=>oe.setClass("ag-hidden",!q)),h(q?"false":"true")},setWidth:q=>{v.current&&(v.current.style.width=q)},setCompDetails:q=>f(q),getFloatingFilterComp:()=>F.current?F.current:null,setMenuIcon:q=>y.current?.appendChild(q)};e.setComp(te,z,y.current,w.current,C.current)},[]);p.useLayoutEffect(()=>ps(g,t,w.current,E),[g]);const T=p.useMemo(()=>n.toString(),[n]),G=p.useMemo(()=>a.toString(),[a]),P=p.useMemo(()=>c.toString(),[c]),I=p.useMemo(()=>!!(g&&g.componentFromFramework&&Mi(g.componentClass)),[g]),A=p.useMemo(()=>o.get("reactiveCustomComponents"),[]),J=p.useMemo(()=>o.get("enableFilterHandlers"),[]),[k,j]=p.useState();p.useEffect(()=>{if(g?.componentFromFramework)if(A){const z=J?C2:s2,te=new z(g.params,()=>m(q=>q+1));E(te),j(te)}else xl()},[g]);const ie=k?.getProps(),$=g?.componentFromFramework,Z=g?.componentClass;return p.createElement("div",{ref:M,style:i,className:T,role:"gridcell"},p.createElement("div",{ref:w,className:G,role:"presentation"},$?A?ie&&p.createElement(El.Provider,{value:{setMethods:z=>k.setMethods(z)}},p.createElement(Z,{...ie})):p.createElement(Z,{...g.params,ref:I?()=>{}:E}):null),p.createElement("div",{ref:b,"aria-hidden":u,className:P,role:"presentation"},p.createElement("button",{ref:y,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))},w2=p.memo(v2),b2=({ctrl:e})=>{const{context:t}=p.useContext(We),[o,i]=p.useState(),[s,n]=p.useState(()=>new dt),[r,a]=p.useState(()=>new dt),[l,c]=p.useState("false"),[d,u]=p.useState(),[h,g]=p.useState(),f=p.useRef(),m=p.useRef(null),C=p.useRef(null),v=p.useRef(null),w=p.useRef(),b=p.useCallback(T=>{if(m.current=T,!T||!e.isAlive()||t.isDestroyed()){f.current=t.destroyBean(f.current);return}f.current=t.createBean(new Di);const G={setWidth:P=>{m.current&&(m.current.style.width=P)},toggleCss:(P,I)=>n(A=>A.setClass(P,I)),setUserStyles:P=>i(P),setHeaderWrapperHidden:P=>{const I=v.current;I&&(P?I.style.setProperty("display","none"):I.style.removeProperty("display"))},setHeaderWrapperMaxHeight:P=>{const I=v.current;I&&(P!=null?I.style.setProperty("max-height",`${P}px`):I.style.removeProperty("max-height"),I.classList.toggle("ag-header-cell-comp-wrapper-limited-height",P!=null))},setUserCompDetails:P=>g(P),setResizableDisplayed:P=>{a(I=>I.setClass("ag-hidden",!P)),c(P?"false":"true")},setAriaExpanded:P=>u(P),getUserCompInstance:()=>w.current||void 0};e.setComp(G,T,C.current,v.current,f.current)},[]);p.useLayoutEffect(()=>ps(h,t,v.current),[h]),p.useEffect(()=>{m.current&&e.setDragSource(m.current)},[h]);const y=p.useMemo(()=>!!(h?.componentFromFramework&&Mi(h.componentClass)),[h]),S=p.useMemo(()=>"ag-header-group-cell "+s.toString(),[s]),F=p.useMemo(()=>"ag-header-cell-resize "+r.toString(),[r]),E=h?.componentFromFramework,M=h?.componentClass;return p.createElement("div",{ref:b,style:o,className:S,role:"columnheader","aria-expanded":d},p.createElement("div",{ref:v,className:"ag-header-cell-comp-wrapper",role:"presentation"},E?y?p.createElement(M,{...h.params}):p.createElement(M,{...h.params,ref:w}):null),p.createElement("div",{ref:C,"aria-hidden":l,className:F}))},S2=p.memo(b2),y2=({ctrl:e})=>{const{gos:t,context:o}=p.useContext(We),{topOffset:i,rowHeight:s}=p.useMemo(()=>e.getTopAndHeight(),[]),n=p.useMemo(()=>t.get("tabIndex"),[]),[r,a]=p.useState(()=>e.getAriaRowIndex()),l=e.headerRowClass,[c,d]=p.useState(()=>s+"px"),[u,h]=p.useState(()=>i+"px"),g=p.useRef(null),[f,m]=p.useState(()=>e.getUpdatedHeaderCtrls()),C=p.useRef(),v=p.useRef(null),w=p.useCallback(S=>{if(v.current=S,!S||!e.isAlive()||o.isDestroyed()){C.current=o.destroyBean(C.current);return}C.current=o.createBean(new Di);const F={setHeight:E=>d(E),setTop:E=>h(E),setHeaderCtrls:(E,M,T)=>{const G=g.current,P=mn(G,E,M);P!==G&&(g.current=P,rs(T,()=>m(P)))},setWidth:E=>{v.current&&(v.current.style.width=E)},setRowIndex:E=>{a(E)}};e.setComp(F,C.current,!1)},[]),b=p.useMemo(()=>({height:c,top:u}),[c,u]),y=p.useCallback(S=>{switch(e.type){case"group":return p.createElement(S2,{ctrl:S,key:S.instanceId});case"filter":return p.createElement(w2,{ctrl:S,key:S.instanceId});default:return p.createElement(m2,{ctrl:S,key:S.instanceId})}},[]);return p.createElement("div",{ref:w,className:l,role:"row",style:b,tabIndex:n,"aria-rowindex":r},f.map(y))},R2=p.memo(y2),F2=({pinned:e})=>{const[t,o]=p.useState(!0),[i,s]=p.useState([]),{context:n}=p.useContext(We),r=p.useRef(null),a=p.useRef(null),l=p.useRef(),c=e==="left",d=e==="right",u=!c&&!d,h=p.useCallback(m=>{if(r.current=m,!m||n.isDestroyed()){l.current=n.destroyBean(l.current);return}l.current=n.createBean(new sv(e));const C={setDisplayed:o,setCtrls:v=>s(v),setCenterWidth:v=>{a.current&&(a.current.style.width=v)},setViewportScrollLeft:v=>{r.current&&(r.current.scrollLeft=v)},setPinnedContainerWidth:v=>{r.current&&(r.current.style.width=v,r.current.style.minWidth=v,r.current.style.maxWidth=v)}};l.current.setComp(C,r.current)},[]),g=t?"":"ag-hidden",f=()=>i.map(m=>p.createElement(R2,{ctrl:m,key:m.instanceId}));return c?p.createElement("div",{ref:h,className:"ag-pinned-left-header "+g,"aria-hidden":!t,role:"rowgroup"},f()):d?p.createElement("div",{ref:h,className:"ag-pinned-right-header "+g,"aria-hidden":!t,role:"rowgroup"},f()):u?p.createElement("div",{ref:h,className:"ag-header-viewport "+g,role:"rowgroup",tabIndex:-1},p.createElement("div",{ref:a,className:"ag-header-container",role:"presentation"},f())):null},wr=p.memo(F2),E2=()=>{const[e,t]=p.useState(()=>new dt),[o,i]=p.useState(),{context:s}=p.useContext(We),n=p.useRef(null),r=p.useRef(),a=p.useCallback(d=>{if(n.current=d,!d||s.isDestroyed()){r.current=s.destroyBean(r.current);return}r.current=s.createBean(new QC);const u={toggleCss:(h,g)=>t(f=>f.setClass(h,g)),setHeightAndMinHeight:h=>i(h)};r.current.setComp(u,d,d)},[]),l=p.useMemo(()=>"ag-header "+e.toString(),[e]),c=p.useMemo(()=>({height:o,minHeight:o}),[o]);return p.createElement("div",{ref:a,className:l,style:c,role:"presentation"},p.createElement(wr,{pinned:"left"}),p.createElement(wr,{pinned:null}),p.createElement(wr,{pinned:"right"}))},x2=p.memo(E2),P2=(e,t)=>{p.useEffect(()=>{const o=t.current;if(o){const i=o.parentElement;if(i){const s=document.createComment(e);return i.insertBefore(s,o),()=>{s.remove()}}}},[e])},Ro=P2,D2=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new se(o=>{this.resolveInstanceCreated=o}),this.onValueChange=o=>this.updateValue(o),this.value=e.value}getProps(){return{...this.cellEditorParams,initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange}}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){Bn(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(e){this.componentInstance=e,this.resolveInstanceCreated?.(),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isCancelBeforeStart","isCancelAfterEnd","focusIn","focusOut","afterGuiAttached","getValidationErrors","getValidationElement"]}updateValue(e){this.value=e,this.refreshProps()}},M2=e=>{const t=p.useRef(e),o=p.useRef(),i=p.useRef(!1),s=p.useRef(!1),[,n]=p.useState(0);i.current&&(s.current=!0),p.useEffect(()=>(i.current||(o.current=t.current(),i.current=!0),n(r=>r+1),()=>{s.current&&o.current?.()}),[])},T2=e=>{const[t,o]=p.useState(),i=p.useContext(We),{context:s,popupSvc:n,gos:r,editSvc:a}=i,{editDetails:l,cellCtrl:c,eParentCell:d}=e;return M2(()=>{const{compDetails:u}=l,h=r.get("stopEditingWhenCellsLoseFocus");let g,f;if(!s.isDestroyed()){f=s.createBean(a.createPopupEditorWrapper(u.params));const m=f.getGui();if(e.jsChildComp){const S=e.jsChildComp.getGui();S&&m.appendChild(S)}const{column:C,rowNode:v}=c,w={column:C,rowNode:v,type:"popupCellEditor",eventSource:d,ePopup:m,position:l.popupPosition,keepWithinBounds:!0},b=n?.positionPopupByComponent.bind(n,w),y=n?.addPopup({modal:h,eChild:m,closeOnEsc:!0,closedCallback:S=>{c.onPopupEditorClosed(S)},anchorToElement:d,positionCallback:b,ariaOwns:d});g=y?y.hideFunc:void 0,o(f),e.jsChildComp?.afterGuiAttached?.()}return()=>{g?.(),s.destroyBean(f)}}),p.useLayoutEffect(()=>()=>{c.isCellFocused()&&t?.getGui().contains(ve(i))&&d.focus({preventScroll:!0})},[t]),t&&e.wrappedContent?ga.createPortal(e.wrappedContent,t.getGui()):null},hd=p.memo(T2),I2=(e,t,o)=>{const{compProxy:i}=e;o(i);const s=i.getProps(),n=Mi(t);return p.createElement(El.Provider,{value:{setMethods:r=>i.setMethods(r)}},n?p.createElement(t,{...s}):p.createElement(t,{...s,ref:r=>i.setRef(r)}))},gd=(e,t,o)=>e.compProxy?I2(e,t,o):p.createElement(t,{...e.compDetails.params,ref:o}),A2=(e,t,o,i,s)=>{const n=e.compDetails,r=n.componentClass,a=n.componentFromFramework&&!e.popup,l=n.componentFromFramework&&e.popup,c=!n.componentFromFramework&&e.popup;return a?gd(e,r,t):l?p.createElement(hd,{editDetails:e,cellCtrl:i,eParentCell:o,wrappedContent:gd(e,r,t)}):c&&s?p.createElement(hd,{editDetails:e,cellCtrl:i,eParentCell:o,jsChildComp:s}):null},k2=(e,t,o,i,s,n,r=!1)=>{const{context:a}=p.useContext(We),l=p.useCallback(()=>{const c=s.current;if(!c)return;const d=c.getGui();d&&d.parentElement&&d.remove(),a.destroyBean(c),s.current=void 0},[]);p.useEffect(()=>{const c=e!=null&&!r,d=e?.compDetails&&!e.compDetails.componentFromFramework,u=t&&o==null;if(!(c&&d&&!u)){l();return}const g=e.compDetails;if(s.current){const m=s.current,v=m.refresh!=null&&e.force==!1?m.refresh(g.params):!1;if(v===!0||v===void 0)return;l()}g.newAgStackInstance().then(m=>{if(!m)return;const C=m.getGui();if(!C)return;(t?o:n.current).appendChild(C),s.current=m})},[e,t,i,r]),p.useEffect(()=>l,[])},Kg=k2,L2=({cellCtrl:e,parent:t})=>{const o=p.useRef(),i=p.useMemo(()=>{const{loadingComp:s}=e.getDeferLoadingCellRenderer();return s?{value:void 0,compDetails:s,force:!1}:void 0},[e]);if(Kg(i,!1,void 0,1,o,t),i?.compDetails?.componentFromFramework){const s=i.compDetails.componentClass;return p.createElement(s,{...i.compDetails.params})}return p.createElement(p.Fragment,null)},O2=({cellCtrl:e,printLayout:t,editingCell:o})=>{const i=p.useContext(We),{context:s}=i,{column:{colIdSanitised:n},instanceId:r}=e,a=p.useRef(),[l,c]=p.useState(()=>e.isCellRenderer()?void 0:{compDetails:void 0,value:e.getValueToDisplay(),force:!1}),[d,u]=p.useState(),[h,g]=p.useState(1),[f,m]=p.useState(),[C,v]=p.useState(!1),[w,b]=p.useState(!1),[y,S]=p.useState(!1),F=p.useRef(null),[E,M]=p.useState(),T=p.useMemo(()=>e.isForceWrapper(),[e]),G=p.useMemo(()=>e.getCellAriaRole(),[e]),P=p.useRef(null),I=p.useRef(null),A=p.useRef(null),J=p.useRef(),k=p.useRef(),j=p.useRef(),ie=p.useRef([]),$=p.useRef(),Z=p.useRef(),[z,te]=p.useState(0),q=p.useCallback(ee=>{Z.current=ee,te(ae=>ae+1)},[]),oe=l!=null&&(C||y||w)&&(d==null||!!d.popup),de=T||oe,Oe=p.useMemo(()=>e.getCellValueClass(),[e]),Ge=p.useCallback(ee=>{if(k.current=ee,ee){const ae=ee.isCancelBeforeStart&&ee.isCancelBeforeStart();setTimeout(()=>{ae?(e.stopEditing(!0),e.focusCell(!0)):(e.cellEditorAttached(),e.enableEditorTooltipFeature(ee))})}},[e]),je=p.useRef();je.current||(je.current=new as(()=>P.current));const St=!!d&&!d.popup;Kg(l,de,Z.current,z,J,P,St);const yt=p.useRef();p.useLayoutEffect(()=>{const ee=yt.current,ae=l;if(yt.current=l,ee==null||ee.compDetails==null||ae==null||ae.compDetails==null)return;$.current?.refreshVisibility();const Ce=ee.compDetails,ue=ae.compDetails;if(Ce.componentClass!=ue.componentClass||A.current?.refresh==null)return;A.current.refresh(ue.params)!=!0&&g(Re=>Re+1)},[l]),p.useLayoutEffect(()=>{if(!(d&&!d.compDetails.componentFromFramework)||s.isDestroyed())return;const ae=d.compDetails,Ce=d.popup===!0,ue=ae.newAgStackInstance();return ue.then(X=>{if(!X)return;const Re=X.getGui();Ge(X),Ce||((T?j:P).current?.appendChild(Re),X.afterGuiAttached?.()),M(X)}),()=>{ue.then(X=>{const Re=X.getGui();e.disableEditorTooltipFeature(),s.destroyBean(X),Ge(void 0),M(void 0),Re?.remove()})}},[d]);const ge=p.useCallback(ee=>{if(j.current=ee,!ee||s.isDestroyed()||!e.isAlive()){const ue=ie.current;ie.current=[];for(const X of ue)X();return}let ae;const Ce=ue=>{ue&&(ee.insertAdjacentElement("afterbegin",ue.getGui()),ie.current.push(()=>{_t(ue.getGui()),s.destroyBean(ue),$.current===ae&&($.current=void 0)}))};C&&Ce(e.createSelectionCheckbox()),y&&Ce(e.createDndSource()),w&&(ae=e.createRowDragComp(),$.current=ae,ae&&(Ce(ae),ae.refreshVisibility()))},[e,s,y,w,C]),U=p.useCallback(()=>{const ee=!e.isCellSpanning()||I.current,ae=P.current;if(!ae||!ee||!e||!e.isAlive()||s.isDestroyed()){a.current=s.destroyBean(a.current);return}a.current=s.createBean(new Di);const Ce={toggleCss:(X,Re)=>je.current.toggleCss(X,Re),setUserStyles:X=>m(X),getFocusableElement:()=>P.current,setIncludeSelection:X=>v(X),setIncludeRowDrag:X=>b(X),setIncludeDndSource:X=>S(X),setRowResizerElement:X=>{F.current&&_t(F.current),F.current=X,X&&P.current&&P.current.appendChild(X)},getCellEditor:()=>k.current??null,getCellRenderer:()=>A.current??J.current,getParentOfValue:()=>Z.current??j.current??P.current,setRenderDetails:(X,Re,He)=>{const Co=()=>{c(tt=>tt?.compDetails!==X||tt?.value!==Re||tt?.force!==He?{value:Re,compDetails:X,force:He}:tt)};if(X?.params?.deferRender&&!e.rowNode.group){const{loadingComp:tt,onReady:Ko}=e.getDeferLoadingCellRenderer();if(tt){c({value:void 0,compDetails:tt,force:!1}),Ko.then(()=>qT(Co));return}}Co()},setEditDetails:(X,Re,He,Co)=>{if(X){let tt;X.componentFromFramework&&(Co?tt=new D2(X.params,()=>g(Ko=>Ko+1)):xl()),u({compDetails:X,popup:Re,popupPosition:He,compProxy:tt}),Re||c(void 0)}else e.hasBrowserFocus()&&Ce.getFocusableElement().focus({preventScroll:!0}),k.current=void 0,u(void 0)},refreshEditStyles:(X,Re)=>{if(!P.current)return;const{current:He}=je;He.toggleCss("ag-cell-value",!de),He.toggleCss("ag-cell-inline-editing",!!X&&!Re),He.toggleCss("ag-cell-popup-editing",!!X&&!!Re),He.toggleCss("ag-cell-not-inline-editing",!X||!!Re)}},ue=j.current||void 0;e.setComp(Ce,ae,I.current??void 0,ue,t,o,a.current)},[]),ne=p.useCallback(ee=>{P.current=ee,U()},[]),V=p.useCallback(ee=>{I.current=ee,U()},[]),Q=p.useMemo(()=>!!(l?.compDetails?.componentFromFramework&&Mi(l.compDetails.componentClass)),[l]);p.useLayoutEffect(()=>{if(!P.current)return;const{current:ee}=je;ee.toggleCss("ag-cell-value",!de),ee.toggleCss("ag-cell-inline-editing",!!d&&!d.popup),ee.toggleCss("ag-cell-popup-editing",!!d&&!!d.popup),ee.toggleCss("ag-cell-not-inline-editing",!d||!!d.popup)});const le=()=>{const{compDetails:ee,value:ae}=l;if(!ee)return ae?.toString?.()??ae;if(ee.componentFromFramework){const Ce=ee.componentClass;return p.createElement(p.Suspense,{fallback:p.createElement(L2,{cellCtrl:e,parent:P})},Q?p.createElement(Ce,{...ee.params,key:h}):p.createElement(Ce,{...ee.params,key:h,ref:A}))}},Me=()=>{const ee=()=>l==null?null:de?p.createElement("span",{role:"presentation",id:`cell-${r}`,className:Oe,ref:q},le()):le(),ae=Ce=>A2(Ce,Ge,P.current,e,E);return d!=null?d.popup?p.createElement(p.Fragment,null,ee(),ae(d)):ae(d):ee()},Ae=()=>p.createElement("div",{ref:ne,style:f,role:G,"col-id":n},de?p.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:ge},Me()):Me());return e.isCellSpanning()?p.createElement("div",{ref:V,className:"ag-spanned-cell-wrapper",role:"presentation"},Ae()):Ae()},G2=p.memo(O2),H2=({rowCtrl:e,containerType:t})=>{const{context:o,gos:i,editSvc:s}=p.useContext(We),n=p.useContext(Ng)==="default",r=p.useRef(),a=p.useRef(e.getDomOrder()),l=e.isFullWidth(),c=e.rowNode.displayed,[d,u]=p.useState(()=>c?e.rowNode.getRowIndexString():null),[h,g]=p.useState(()=>e.rowId),[f,m]=p.useState(()=>e.businessKey),[C,v]=p.useState(()=>e.rowStyles),w=p.useRef(null),[b,y]=p.useState(()=>null),[S,F]=p.useState(),[E,M]=p.useState(()=>c?e.getInitialRowTop(t):void 0),[T,G]=p.useState(()=>c?e.getInitialTransform(t):void 0),P=p.useRef(null),I=p.useRef(),A=p.useRef(),J=p.useRef(!1),[k,j]=p.useState(0);p.useEffect(()=>{if(J.current||!S||k>10)return;const ge=P.current?.firstChild;ge?(e.setupDetailRowAutoHeight(ge),J.current=!0):j(U=>U+1)},[S,k]);const ie=p.useRef();ie.current||(ie.current=new as(()=>P.current));const $=p.useRef(()=>{}),Z=p.useCallback(ge=>($.current=ge,()=>{$.current=()=>{}}),[]),z=jT(Z,()=>w.current,[]),te=n?z:b,q=p.useCallback(ge=>{if(P.current=ge,r.current=ge?o.createBean(new Di):o.destroyBean(r.current),!ge){e.unsetComp(t);return}if(!e.isAlive()||o.isDestroyed())return;const U={setTop:M,setTransform:G,toggleCss:(ne,V)=>ie.current.toggleCss(ne,V),setDomOrder:ne=>a.current=ne,setRowIndex:u,setRowId:g,setRowBusinessKey:m,setUserStyles:v,setCellCtrls:(ne,V)=>{const Q=w.current,le=mn(Q,ne,a.current);le!==Q&&(w.current=le,n?$.current():rs(V,()=>y(le)))},showFullWidth:ne=>{A.current=ne.params,F(ne)},getFullWidthCellRenderer:()=>I.current,getFullWidthCellRendererParams:()=>A.current,refreshFullWidth:ne=>{const V=ne();return A.current=V,je.current?(F(Q=>({...Q,params:V})),!0):!I.current||!I.current.refresh?!1:I.current.refresh(V)}};e.setComp(U,ge,t,r.current)},[]);p.useLayoutEffect(()=>ps(S,o,P.current,I),[S]);const oe=p.useMemo(()=>{const ge={top:E,transform:T};return Object.assign(ge,C),ge},[E,T,C]),de=l&&S?.componentFromFramework,Oe=!l&&te!=null,Ge=p.useMemo(()=>!!(S?.componentFromFramework&&Mi(S.componentClass)),[S]),je=p.useRef(!1);p.useEffect(()=>{je.current=Ge&&!!S&&!!i.get("reactiveCustomComponents")},[Ge,S]);const St=()=>te?.map(ge=>p.createElement(G2,{cellCtrl:ge,editingCell:s?.isEditing(ge,{withOpenEditor:!0})??!1,printLayout:e.printLayout,key:ge.instanceId})),yt=()=>{const ge=S.componentClass;return Ge?p.createElement(ge,{...S.params}):p.createElement(ge,{...S.params,ref:I})};return p.createElement("div",{ref:q,role:"row",style:oe,"row-index":d,"row-id":h,"row-business-key":f},Oe?St():de?yt():null)},pd=p.memo(H2),B2=({name:e})=>{const{context:t,gos:o}=p.useContext(We),i=p.useMemo(()=>us(e),[e]),s=p.useRef(null),n=p.useRef(null),r=p.useRef(null),a=p.useRef([]),l=p.useRef([]),[c,d]=p.useState(()=>[]),u=!!o.get("enableCellSpan")&&!!i.getSpannedRowCtrls,h=p.useRef([]),g=p.useRef([]),[f,m]=p.useState(()=>[]),C=p.useRef(!1),v=p.useRef(),w=p.useMemo(()=>at("ag-viewport",Ku(e)),[e]),b=p.useMemo(()=>at(qu(e)),[e]),y=p.useMemo(()=>at("ag-spanning-container",wv(e)),[e]),S=i.type==="center"||u,F=S?s:n;Ro(" AG Row Container "+e+" ",F);const E=p.useCallback(()=>{const k=!S||s.current!=null,j=n.current!=null,ie=!u||r.current!=null;return k&&j&&ie},[]),M=p.useCallback(()=>s.current==null&&n.current==null&&r.current==null,[]),T=p.useCallback(()=>{if(M()&&(v.current=t.destroyBean(v.current)),!t.isDestroyed()&&E()){const k=$=>{const Z=mn(l.current,a.current,C.current);Z!==l.current&&(l.current=Z,rs($,()=>d(Z)))},j=$=>{const Z=mn(g.current,h.current,C.current);Z!==g.current&&(g.current=Z,rs($,()=>m(Z)))},ie={setHorizontalScroll:$=>{s.current&&(s.current.scrollLeft=$)},setViewportHeight:$=>{s.current&&(s.current.style.height=$)},setRowCtrls:({rowCtrls:$,useFlushSync:Z})=>{const z=!!Z&&a.current.length>0&&$.length>0;a.current=$,k(z)},setSpannedRowCtrls:($,Z)=>{const z=!!Z&&h.current.length>0&&$.length>0;h.current=$,j(z)},setDomOrder:$=>{C.current!=$&&(C.current=$,k(!1))},setContainerWidth:$=>{n.current&&(n.current.style.width=$)},setOffsetTop:$=>{n.current&&(n.current.style.transform=`translateY(${$})`)}};v.current=t.createBean(new Mv(e)),v.current.setComp(ie,n.current,r.current??void 0,s.current)}},[E,M]),G=p.useCallback(k=>{n.current=k,T()},[T]),P=p.useCallback(k=>{r.current=k,T()},[T]),I=p.useCallback(k=>{s.current=k,T()},[T]),A=()=>p.createElement("div",{className:b,ref:G,role:S?"presentation":"rowgroup"},c.map(k=>p.createElement(pd,{rowCtrl:k,containerType:i.type,key:k.instanceId})));if(!S)return A();const J=()=>p.createElement("div",{className:y,ref:P,role:"presentation"},f.map(k=>p.createElement(pd,{rowCtrl:k,containerType:i.type,key:k.instanceId})));return p.createElement("div",{className:w,ref:I,role:"rowgroup"},A(),u?J():null)},V2=p.memo(B2),N2=()=>{const e=p.useContext(We),{context:t,overlays:o}=e,[i,s]=p.useState(""),[n,r]=p.useState(0),[a,l]=p.useState(0),[c,d]=p.useState("0px"),[u,h]=p.useState("0px"),[g,f]=p.useState("100%"),[m,C]=p.useState("0px"),[v,w]=p.useState("0px"),[b,y]=p.useState("100%"),[S,F]=p.useState(!0),[E,M]=p.useState(!0),[T,G]=p.useState(null),[P,I]=p.useState(""),[A,J]=p.useState(null),[k,j]=p.useState("ag-layout-normal"),ie=p.useRef();ie.current||(ie.current=new as(()=>$.current));const $=p.useRef(null),Z=p.useRef(null),z=p.useRef(null),te=p.useRef(null),q=p.useRef(null),oe=p.useRef(null),de=p.useRef(null),Oe=p.useRef([]),Ge=p.useRef([]);Ro(" AG Grid Body ",$),Ro(" AG Pinned Top ",Z),Ro(" AG Sticky Top ",z),Ro(" AG Middle ",oe),Ro(" AG Pinned Bottom ",de);const je=p.useCallback(ue=>{if($.current=ue,!ue||t.isDestroyed()){Oe.current=t.destroyBeans(Oe.current);for(const be of Ge.current)be();Ge.current=[];return}const X=(be,ot)=>{be.appendChild(ot),Ge.current.push(()=>ot.remove())},Re=be=>{const ot=t.createBean(new be);return Oe.current.push(ot),ot},He=(be,ot,hp)=>{X(be,document.createComment(hp)),X(be,Re(ot).getGui())};He(ue,rv," AG Fake Horizontal Scroll ");const Co=o?.getOverlayWrapperCompClass();Co&&He(ue,Co," AG Overlay Wrapper "),q.current&&He(q.current,lv," AG Fake Vertical Scroll ");const tt={setRowAnimationCssOnBodyViewport:s,setColumnCount:be=>{$.current&&Wp($.current,be)},setRowCount:be=>{$.current&&Vp($.current,be)},setTopHeight:r,setBottomHeight:l,setStickyTopHeight:d,setStickyTopTop:h,setStickyTopWidth:f,setTopInvisible:F,setBottomInvisible:M,setColumnMovingCss:(be,ot)=>ie.current.toggleCss(be,ot),updateLayoutClasses:j,setAlwaysVerticalScrollClass:G,setPinnedTopBottomOverflowY:I,setCellSelectableCss:(be,ot)=>J(ot?be:null),setBodyViewportWidth:be=>{oe.current&&(oe.current.style.width=be)},registerBodyViewportResizeListener:be=>{if(oe.current){const ot=Kt(e,oe.current,be);Ge.current.push(()=>ot())}},setStickyBottomHeight:C,setStickyBottomBottom:w,setStickyBottomWidth:y,setGridRootRole:be=>ue.setAttribute("role",be)},Ko=t.createBean(new kv);Oe.current.push(Ko),Ko.setComp(tt,ue,oe.current,Z.current,de.current,z.current,te.current)},[]),St=p.useMemo(()=>at("ag-root","ag-unselectable",k),[k]),yt=p.useMemo(()=>at("ag-body-viewport",i,k,T,A),[i,k,T,A]),ge=p.useMemo(()=>at("ag-body",k),[k]),U=p.useMemo(()=>at("ag-floating-top",S?"ag-invisible":null,A),[A,S]),ne=p.useMemo(()=>at("ag-sticky-top",A),[A]),V=p.useMemo(()=>at("ag-sticky-bottom",m==="0px"?"ag-invisible":null,A),[A,m]),Q=p.useMemo(()=>at("ag-floating-bottom",E?"ag-invisible":null,A),[A,E]),le=p.useMemo(()=>({height:n,minHeight:n,overflowY:P}),[n,P]),Me=p.useMemo(()=>({height:c,top:u,width:g}),[c,u,g]),Ae=p.useMemo(()=>({height:m,bottom:v,width:b}),[m,v,b]),ee=p.useMemo(()=>({height:a,minHeight:a,overflowY:P}),[a,P]),ae=ue=>p.createElement(V2,{name:ue,key:`${ue}-container`}),Ce=({section:ue,children:X,className:Re,style:He})=>p.createElement("div",{ref:ue,className:Re,role:"presentation",style:He},X.map(ae));return p.createElement("div",{ref:je,className:St},p.createElement(x2,null),Ce({section:Z,className:U,style:le,children:["topLeft","topCenter","topRight","topFullWidth"]}),p.createElement("div",{className:ge,ref:q,role:"presentation"},Ce({section:oe,className:yt,children:["left","center","right","fullWidth"]})),Ce({section:z,className:ne,style:Me,children:["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"]}),Ce({section:te,className:V,style:Ae,children:["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"]}),Ce({section:de,className:Q,style:ee,children:["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"]}))},W2=p.memo(N2),z2=(e,t)=>{const{children:o,eFocusableElement:i,onTabKeyDown:s,gridCtrl:n,forceFocusOutWhenTabGuardsAreEmpty:r,isEmpty:a}=e,{context:l}=p.useContext(We),c=p.useRef(null),d=p.useRef(null),u=p.useRef(),h=v=>{const w=v==null?void 0:parseInt(v,10).toString();for(const b of[c,d])w===void 0?b.current?.removeAttribute("tabindex"):b.current?.setAttribute("tabindex",w)};p.useImperativeHandle(t,()=>({forceFocusOutOfContainer(v){u.current?.forceFocusOutOfContainer(v)}}));const g=p.useCallback(()=>{const v=c.current,w=d.current;if(!v&&!w||l.isDestroyed()){u.current=l.destroyBean(u.current);return}if(v&&w){const b={setTabIndex:h};u.current=l.createBean(new UT({comp:b,eTopGuard:v,eBottomGuard:w,eFocusableElement:i,onTabKeyDown:s,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:y=>n.focusInnerElement(y),isEmpty:a}))}},[]),f=p.useCallback(v=>{c.current=v,g()},[g]),m=p.useCallback(v=>{d.current=v,g()},[g]),C=v=>{const w=v==="top"?pi.TAB_GUARD_TOP:pi.TAB_GUARD_BOTTOM;return p.createElement("div",{className:`${pi.TAB_GUARD} ${w}`,role:"presentation",ref:v==="top"?f:m})};return p.createElement(p.Fragment,null,C("top"),o,C("bottom"))},_2=p.forwardRef(z2),U2=p.memo(_2),$2=({context:e})=>{const[t,o]=p.useState(""),[i,s]=p.useState(""),[n,r]=p.useState(null),[a,l]=p.useState(null),[c,d]=p.useState(!1),[u,h]=p.useState(),g=p.useRef(),f=p.useRef(null),m=p.useRef(),[C,v]=p.useState(null),w=p.useRef(()=>{}),b=p.useRef(),y=p.useRef([]),S=p.useCallback(()=>{},[]);Ro(" AG Grid ",f);const F=p.useCallback(I=>{if(f.current=I,g.current=I?e.createBean(new Bv):e.destroyBean(g.current),!I||e.isDestroyed())return;const A=g.current;w.current=A.focusInnerElement.bind(A);const J={destroyGridUi:()=>{},setRtlClass:o,forceFocusOutOfContainer:k=>{if(!k&&b.current?.isDisplayed()){b.current.forceFocusOutOfContainer(k);return}m.current?.forceFocusOutOfContainer(k)},updateLayoutClasses:s,getFocusableContainers:()=>{const k=[],j=[],ie=f.current?.querySelector(".ag-root");for(const Z of y.current){if(!Z.isDisplayed())continue;const z=Z.getFocusableContainerName();if(z==="rowGroupToolbar"||z==="pivotToolbar"){k.push(Z);continue}j.push(Z)}const $=[...k];return ie&&$.push({getGui:()=>ie,getFocusableContainerName:()=>"gridBody"}),$.push(...j),$},setCursor:r,setUserSelect:l};A.setComp(J,I,I),d(!0)},[]);p.useEffect(()=>{const I=g.current,A=f.current;if(!u||!I||!C||!A||e.isDestroyed())return;const J=[];y.current=[],b.current=void 0;const{watermarkSelector:k,paginationSelector:j,sideBarSelector:ie,statusBarSelector:$,gridHeaderDropZonesSelector:Z}=I.getOptionalSelectors(),z=[];if(Z){const q=e.createBean(new Z.component),oe=q.getGui();A.insertAdjacentElement("afterbegin",oe),z.push(oe),J.push(q),y.current.push(...q.getFocusableContainers?.()??[])}if(ie){const q=e.createBean(new ie.component),oe=q.getGui(),de=C.querySelector(".ag-tab-guard-bottom");de&&(de.insertAdjacentElement("beforebegin",oe),z.push(oe)),J.push(q),y.current.push(q)}const te=q=>{const oe=e.createBean(new q),de=oe.getGui();return A.insertAdjacentElement("beforeend",de),z.push(de),J.push(oe),oe};if($){const q=te($.component);y.current.push(q)}if(j){const q=te(j.component);b.current=q,y.current.push(q)}return k&&te(k.component),()=>{e.destroyBeans(J),y.current=[],b.current=void 0;for(const q of z)q.remove()}},[u,C,e]);const E=p.useMemo(()=>at("ag-root-wrapper",t,i),[t,i]),M=p.useMemo(()=>at("ag-root-wrapper-body","ag-focus-managed",i),[i]),T=p.useMemo(()=>({userSelect:a??"",WebkitUserSelect:a??"",cursor:n??""}),[a,n]),G=p.useCallback(I=>{m.current=I,h(I!==null)},[]),P=p.useCallback(()=>!g.current?.isFocusable(),[]);return p.createElement("div",{ref:F,className:E,style:T,role:"presentation"},p.createElement("div",{className:M,ref:v,role:"presentation"},c&&C&&!e.isDestroyed()&&p.createElement(We.Provider,{value:e.getBeans()},p.createElement(U2,{ref:G,eFocusableElement:C,onTabKeyDown:S,gridCtrl:g.current,forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:P},p.createElement(W2,null)))))},K2=p.memo($2),q2=class extends x{postConstruct(){if(this.beans.colAutosize){const e=this.queueResizeOperationsForTick.bind(this);this.addManagedEventListeners({rowExpansionStateChanged:e,expandOrCollapseAll:e,cellValueChanged:e,rowNodeDataChanged:e,rowDataUpdated:e})}}queueResizeOperationsForTick(){const e=this.beans.colAutosize;e.shouldQueueResizeOperations=!0,setTimeout(()=>{e.processResizeOperations()},0)}areHeaderCellsRendered(){return this.beans.ctrlsSvc.getHeaderRowContainerCtrls().every(e=>e.getAllCtrls().every(t=>t.areCellsRendered()))}areCellsRendered(){return this.beans.rowRenderer.getAllRowCtrls().every(e=>e.isRowRendered()&&e.getAllCellCtrls().every(t=>!!t.eGui))}},j2=typeof window>"u"?p.useEffect:p.useLayoutEffect,qg={setGridApi:void 0,maxComponentCreationTimeMs:void 0,children:void 0},Y2={gridOptions:void 0,modules:void 0,containerStyle:void 0,className:void 0,passGridApi:void 0,componentWrappingElement:void 0,...qg},jg=new Set(Object.keys(Y2)),Q2=new Set(Object.keys(qg)),Yg=e=>{const t=p.useContext(g2),o=p.useContext(p2),i=p.useRef(),s=p.useRef(null),n=p.useRef(null),r=p.useRef([]),a=p.useRef([]),l=p.useRef(e),c=p.useRef(),d=p.useRef(),u=p.useRef(!1),[h,g]=p.useState(void 0),[,f]=p.useState(0),m=p.useRef(),C=S=>{const F=s.current?.classList,E=(M="")=>M.trim().split(/\s+/g).filter(Boolean);if(m.current!==S){for(const M of E(m.current))F?.contains(M)&&F.remove(M);for(const M of E(S))F?.contains(M)||F?.add(M);m.current=S}};j2(()=>{C(e.className)},[e.className]);const v=p.useCallback(S=>{if(s.current=S,C(e.className),!S){for(const k of r.current)k();r.current.length=0;return}const F=[...e.modules??[],...t??[]];o&&Zd(F)?.setLicenseKey(o),n.current||(n.current=new h2(()=>f(k=>k+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),r.current.push(()=>{n.current?.destroy(),n.current=null}));const E=qf(e.gridOptions,e,Object.keys(e).filter(k=>!jg.has(k))),M=()=>{if(u.current){const k=()=>c.current?.shouldQueueUpdates()?void 0:a.current.shift();let j=k();for(;j;)j(),j=k()}},T=new eI(M);c.current=T;const G=new q2,P={providedBeanInstances:{frameworkCompWrapper:new J2(n.current,E),renderStatus:G},modules:F,frameworkOverrides:T,setThemeOnGridDiv:!0},I=k=>{g(k),k.createBean(G),r.current.push(()=>{k.destroy()}),k.getBean("ctrlsSvc").whenReady({addDestroyFunc:j=>{r.current.push(j)}},()=>{if(k.isDestroyed())return;const j=i.current;j&&e.passGridApi?.(j)})},A=k=>{k.getBean("ctrlsSvc").whenReady({addDestroyFunc:j=>{r.current.push(j)}},()=>{for(const j of a.current)j();a.current.length=0,u.current=!0})},J=new A1;E.gridId??(E.gridId=d.current),i.current=J.create(S,E,I,A,P),r.current.push(()=>{i.current=void 0}),i.current&&(d.current=i.current.getGridId())},[]),w=p.useMemo(()=>({height:"100%",...e.containerStyle||{}}),[e.containerStyle]),b=p.useCallback(S=>{u.current&&!c.current?.shouldQueueUpdates()?S():a.current.push(S)},[]);p.useEffect(()=>{const S=Z2(l.current,e);l.current=e,b(()=>{i.current&&jf(S,i.current)})},[e]);const y=!p.useSyncExternalStore||As(e,"renderingMode")==="legacy"?"legacy":"default";return p.createElement("div",{style:w,ref:v},p.createElement(Ng.Provider,{value:y},h&&!h.isDestroyed()?p.createElement(K2,{key:h.instanceId,context:h}):null,n.current?.getPortals()??null))};function Z2(e,t){const o={};for(const i of Object.keys(t)){if(jg.has(i)){Q2.has(i)&&D(274,{prop:i});continue}const s=t[i];e[i]!==s&&(o[i]=s)}return o}var J2=class extends _T{constructor(e,t){super(),this.parent=e,this.gridOptions=t}createWrapper(e,t){const o=this.gridOptions;if(As(o,"reactiveCustomComponents")){const r=(a=>{switch(a){case"filter":return As(o,"enableFilterHandlers")?i2:o2;case"floatingFilterComponent":return As(o,"enableFilterHandlers")?r2:n2;case"dateComponent":return e2;case"dragAndDropImageComponent":return t2;case"loadingOverlayComponent":case"noRowsOverlayComponent":case"activeOverlay":return XT;case"statusPanel":return c2;case"toolPanel":return d2;case"menuItem":return l2;case"cellRenderer":return JT;case"innerHeaderComponent":return a2}})(t.name);if(r)return new r(e,this.parent,t)}else switch(t.name){case"filter":case"floatingFilterComponent":case"dateComponent":case"dragAndDropImageComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"activeOverlay":case"statusPanel":case"toolPanel":case"menuItem":case"cellRenderer":xl();break}const s=!t.cellRenderer&&t.name!=="toolPanel";return new Ug(e,this.parent,t,s)}},X2=p.forwardRef((e,t)=>{const o=p.useContext(We),{registry:i,context:s,gos:n,rowModel:r}=o,[a,l]=p.useState(()=>new dt),[c,d]=p.useState(()=>new dt),[u,h]=p.useState(),[g,f]=p.useState(),m=p.useRef(),C=p.useRef(null),v=p.useRef(),w=p.useMemo(()=>Rf(e.api.getGridId(),u?.rowModelType??"clientSide"),[e]),b=p.useMemo(()=>a.toString()+" ag-details-row",[a]),y=p.useMemo(()=>c.toString()+" ag-details-grid",[c]);t&&p.useImperativeHandle(t,()=>({refresh(){return m.current?.refresh()??!1}})),e.template&&D(230);const S=p.useCallback(E=>{if(C.current=E,!E||s.isDestroyed()){m.current=s.destroyBean(m.current),v.current?.();return}const M={toggleCss:(G,P)=>l(I=>I.setClass(G,P)),toggleDetailGridCss:(G,P)=>d(I=>I.setClass(G,P)),setDetailGrid:G=>h(G),setRowData:G=>f(G),getGui:()=>C.current},T=i.createDynamicBean("detailCellRendererCtrl",!0);if(T&&(s.createBean(T),T.init(M,e),m.current=T,n.get("detailRowAutoHeight"))){const G=()=>{if(C.current==null)return;const P=C.current.clientHeight;P!=null&&P>0&&setTimeout(()=>{e.node.setRowHeight(P),(Se(n)||xi(n))&&r.onRowHeightChanged()},0)};v.current=Kt(o,E,G),G()}},[]),F=p.useCallback(E=>{m.current?.registerDetailWithMaster(E)},[]);return p.createElement("div",{className:b,ref:S},u&&p.createElement(Yg,{className:y,...u,modules:w,rowData:g,passGridApi:F}))}),eI=class extends Jh{constructor(e){super("react"),this.processQueuedUpdates=e,this.queueUpdates=!1,this.renderingEngine="react",this.frameworkComponents={agGroupCellRenderer:dd,agGroupRowRenderer:dd,agDetailCellRenderer:X2},this.wrapIncoming=(t,o)=>o==="ensureVisible"?KT(t):t()}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}getLockOnRefresh(){this.queueUpdates=!0}releaseLockOnRefresh(){this.queueUpdates=!1,this.processQueuedUpdates()}shouldQueueUpdates(){return this.queueUpdates}runWhenReadyAsync(){return $T()}},Qg=class extends p.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=e=>{this.api=e;for(const t of this.apiListeners)t(e)}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return p.createElement(Yg,{...this.props,passGridApi:this.setGridApi})}},Zg=(e=>(e.Dropdown="dropdown",e.Menu="menu",e))(Zg||{}),Vt=(e=>(e.Click="click",e.Hover="hover",e.ContextMenu="contextMenu",e))(Vt||{}),Cn=(e=>(e.Item="item",e.Divider="divider",e.PlainText="plainText",e))(Cn||{});const tI=fe("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),oI=fe("z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none"),da=fe("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small-text h-[34px] rounded text-primary",bn.menuItem),ua="opacity-75 !cursor-not-allowed",Jg="text-error",iI="my-1 border-t border-hover border-secondary",Zo=4,sI=H.jsx(vn.IconChevronRight,{size:14}),Xg=({ariaLabel:e,className:t,size:o=24,onClose:i,...s})=>H.jsx(Rd,{"aria-label":e,className:Mt.mergeClasses(t,"w-auto h-auto"),onClick:i,icon:H.jsx(vn.IconX,{size:o}),...s}),nI='[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"]',rI=["ArrowDown","ArrowUp","Home","End"],fd=e=>Array.from(e.querySelectorAll(nI)).filter(t=>!t.hasAttribute("disabled")&&t.getAttribute("aria-disabled")!=="true"),ep=e=>e.ownerDocument.defaultView?.getComputedStyle(e).direction==="rtl",aI=e=>ep(e)?"ArrowLeft":"ArrowRight",lI=e=>ep(e)?"ArrowRight":"ArrowLeft",cI=e=>e instanceof HTMLElement&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable),dI=(e,t,o)=>{if(e==="Home")return 0;if(e==="End")return o-1;const i=e==="ArrowDown"?1:-1;return t===-1?i===1?0:o-1:(t+i+o)%o};function tp(e,t="menu",o=!1,i){const[s,n]=p.useState(!1),r=pe.useFloatingNodeId(),{refs:a,elements:l,floatingStyles:c,context:d}=pe.useFloating({nodeId:r,placement:"right-start",open:s,onOpenChange:n,whileElementsMounted:pe.autoUpdate,middleware:[pe.offset({mainAxis:0,crossAxis:-4}),pe.flip({padding:e}),pe.shift({padding:e})]}),u=pe.useHover(d,{enabled:!o,move:!1,handleClose:pe.safePolygon(),delay:{open:80,close:80}}),h=pe.useClick(d,{enabled:!o}),g=pe.useDismiss(d,{bubbles:{escapeKey:!1,outsidePress:!0}}),f=pe.useRole(d,{role:t}),{getReferenceProps:m,getFloatingProps:C}=pe.useInteractions([u,h,g,f]),[v,w]=p.useState(!1),b=l.floating;p.useEffect(()=>{!s||!v||b==null||(fd(b)[0]?.focus(),w(!1))},[s,v,b]);const y=p.useCallback(M=>{o||!(M.key===aI(M.currentTarget)||M.key==="Enter"||M.key===" ")||(M.preventDefault(),M.stopPropagation(),n(!0),w(!0))},[o]),S=p.useCallback(M=>{if(M.defaultPrevented||cI(M.target))return;if(M.key===lI(M.currentTarget)){M.preventDefault(),M.stopPropagation(),n(!1),a.domReference.current?.focus();return}if(!rI.includes(M.key))return;M.preventDefault(),M.stopPropagation();const T=fd(M.currentTarget);if(T.length===0)return;const G=M.currentTarget.ownerDocument.activeElement,P=T.findIndex(I=>I===G);T[dI(M.key,P,T.length)]?.focus()},[a.domReference]),F=p.useCallback(M=>m({...M,onKeyDown:y}),[m,y]),E=p.useCallback(M=>C({...M,onKeyDown:S}),[C,S]);return{isOpen:s,nodeId:r,refs:a,floatingStyles:c,context:d,getReferenceProps:F,getFloatingProps:E}}const uI="rounded bg-layer-0 shadow",op=({refs:e,floatingStyles:t,context:o,getFloatingProps:i,role:s,surfaceClassName:n,className:r,children:a})=>{const l=Fd();return H.jsx(pe.FloatingPortal,{children:H.jsx(pe.FloatingFocusManager,{context:o,modal:!1,initialFocus:-1,returnFocus:!0,children:H.jsx("div",{ref:e.setFloating,style:t,role:s,className:fe("z-floating overflow-auto text-primary focus-visible:outline-none",n??uI,l,r),...i(),children:a})})})},hI=({item:e,onRootClose:t})=>{const{isOpen:o,refs:i,floatingStyles:s,context:n,getReferenceProps:r,getFloatingProps:a}=tp(Zo,"menu",!!e.disabled),l=p.useCallback(c=>d=>{c.disabled||(c.onClick?.({key:c.key,domEvent:d}),t())},[t]);return H.jsxs(H.Fragment,{children:[H.jsxs("button",{ref:i.setReference,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":o,"aria-disabled":!!e.disabled,disabled:e.disabled,className:fe(da,e.disabled&&ua,e.className),...r(),children:[e.icon&&H.jsx("span",{className:fe(e.disabled&&"text-secondary"),children:H.jsx(zs,{icon:e.icon})}),H.jsx("span",{className:fe("flex-1 truncate text-start",e.disabled&&"text-secondary"),children:e.label}),H.jsx("span",{className:fe("ml-auto shrink-0",e.disabled&&"text-secondary"),children:sI})]}),o&&H.jsx(op,{refs:i,floatingStyles:s,context:n,getFloatingProps:a,role:"menu",className:"w-max",children:H.jsx("div",{role:"none",className:fe("py-1",bn.dropdownList),children:e.children.map(c=>H.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!c.disabled,disabled:c.disabled,className:fe(da,c.disabled&&ua,c.danger&&Jg,c.className),onClick:l(c),children:[c.icon&&H.jsx("span",{className:fe(c.danger&&"text-error",c.disabled&&"text-secondary"),children:H.jsx(zs,{icon:c.icon})}),H.jsx("span",{className:fe("flex-1 truncate text-start",c.danger&&"text-error",c.disabled&&"text-secondary"),children:c.label})]},c.key))})})]})},gI=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,ha=({children:e,items:t,onItemClick:o,menuHeader:i,menuFooter:s,renderOverlay:n,trigger:r=[Vt.Click],placement:a,disabled:l=!1,open:c,defaultOpen:d=!1,onOpenChange:u,closable:h=!1,onClose:g,className:f,overlayContentClassName:m,separatorClassName:C,listClassName:v,outsidePressIgnoreRef:w,outsideClosable:b=!0,allowedPlacements:y,anchorToMouse:S=!1,matchReferenceWidth:F=!0,maxDropdownHeight:E})=>{const[M,T]=p.useState(d),G=c!==void 0,P=G?!!c:M,I=p.useRef(null),A=p.useCallback(U=>{G||T(U),u?.(U)},[G,u]),J=p.useId(),k=a===void 0,{refs:j,floatingStyles:ie,context:$}=pe.useFloating({placement:a,open:P,onOpenChange:A,whileElementsMounted:pe.autoUpdate,middleware:[pe.offset({mainAxis:Zo,crossAxis:0}),k?pe.autoPlacement({alignment:"start",crossAxis:!0,padding:Zo,allowedPlacements:y}):pe.flip({padding:Zo}),pe.shift({padding:Zo}),pe.size({padding:Zo,apply({availableWidth:U,availableHeight:ne,elements:V}){const Q=V.floating,le=gI(V.reference);Q.style.setProperty("--fui-available-height",`${Math.floor(ne)}px`),Q.style.setProperty("--reference-width",F?`${Math.round(le)}px`:"0px"),F?Q.style.minWidth=`${Math.round(le)}px`:Q.style.removeProperty("min-width"),Q.style.maxWidth=`${Math.floor(U)}px`;const Me=Math.floor(ne);Q.style.maxHeight=`${E?Math.min(Me,E):Me}px`}})]}),Z=pe.useClick($,{enabled:r.includes(Vt.Click)&&!l}),z=pe.useHover($,{enabled:r.includes(Vt.Hover)&&!l,move:!1,restMs:40,delay:{open:80,close:80}}),te=pe.useDismiss($,{bubbles:!0,referencePress:!1,outsidePress:U=>{if(!b)return!1;const ne=U.target;return!(w?.current&&ne instanceof Node&&w.current.contains(ne))}}),q=pe.useRole($,{role:"menu"}),{getReferenceProps:oe,getFloatingProps:de}=pe.useInteractions([Z,z,te,q]),Oe=p.useCallback((U,ne)=>{j.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:U,y:ne,top:ne,left:U,right:U,bottom:ne})})},[j]),Ge=p.useCallback(U=>{!r.includes(Vt.ContextMenu)||l||(U.preventDefault(),S&&(Oe(U.clientX,U.clientY),I.current=document.elementFromPoint(U.clientX,U.clientY)),A(!0))},[S,l,A,Oe,r]),je=p.useCallback(U=>{!S||l||(r.includes(Vt.ContextMenu)&&P&&A(!1),Oe(U.clientX,U.clientY),I.current=document.elementFromPoint(U.clientX,U.clientY))},[S,l,Oe,P,r,A]);p.useEffect(()=>{l&&P&&A(!1)},[l,P,A]);const St=p.useCallback(U=>ne=>{U.disabled||(U.onClick?.({key:U.key,domEvent:ne}),o?.({key:U.key,domEvent:ne}),A(!1))},[o,A]),yt=p.useMemo(()=>n?n():t?H.jsxs(H.Fragment,{children:[i&&H.jsx(H.Fragment,{children:typeof i=="function"?i():i}),H.jsx("div",{role:"none",className:Mt.mergeClasses("py-1",m,bn.dropdownList),"aria-label":"dropdown",children:t.map(U=>U.type===Cn.Divider?H.jsx("div",{role:"separator",className:Mt.mergeClasses(iI,C)},U.key):U.type===Cn.PlainText?H.jsx("div",{className:Mt.mergeClasses("px-3 py-2 text-secondary dial-caption-text",U.className),children:U.label},U.key):U.children?.length?H.jsx(hI,{item:U,onRootClose:()=>A(!1)},U.key):H.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!U.disabled,className:fe(da,U.disabled&&ua,U.danger&&Jg,U.className),disabled:U.disabled,onClick:St(U),children:[U.icon&&H.jsx("span",{className:fe(U.danger&&"text-error",U.disabled&&"text-secondary"),children:H.jsx(zs,{icon:U.icon})}),H.jsx("span",{className:fe("flex-1 truncate text-start",U.danger&&"text-error",U.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:U.label})]},U.key))}),s&&H.jsx(H.Fragment,{children:typeof s=="function"?s():s})]}):null,[St,t,s,i,n,A,m,C]),ge=oe({onContextMenu:Ge,onMouseDown:je});return p.useEffect(()=>{if(!P)return;const U=j.reference.current;let ne=null;if(U instanceof Element?ne=U:I.current instanceof Element&&(ne=I.current),!ne)return;const V=new IntersectionObserver(([Q])=>{Q.isIntersecting||A(!1)},{root:null,threshold:0});return V.observe(ne),()=>V.disconnect()},[P,j.reference,A]),H.jsxs(H.Fragment,{children:[H.jsx("span",{ref:j.setReference,className:fe(tI,l&&"!cursor-not-allowed opacity-75",f),"aria-haspopup":"menu","aria-expanded":P,"aria-controls":J,...ge,children:e}),P&&H.jsx(pe.FloatingPortal,{children:H.jsx(pe.FloatingFocusManager,{context:$,modal:!1,initialFocus:-1,returnFocus:!0,children:H.jsxs("div",{id:J,ref:j.setFloating,style:ie,className:fe(oI,!F&&"w-max",v),...de(),children:[h&&H.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:H.jsx(Xg,{ariaLabel:"Close dropdown",onClose:U=>{g?.(U),A(!1)}})}),yt]})})})]})},ip="en-US",sp={year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},pI="text-primary",br=40,np={minWidth:br,width:br,maxWidth:br},fI={cellClass:"ag-grid-no-checkbox",...np},mI={...np};var Ki=(e=>(e.MULTIPLE="MULTIPLE",e.SINGLE="SINGLE",e))(Ki||{});const CI=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0}),rp=(e,t,o,i,s)=>{if(typeof e=="string"&&typeof t=="string"&&e&&t){const n=CI.compare(e,t);return n===0?0:n>0?1:-1}return e===t?0:e?t?e>t?1:-1:s?1:-1:s?-1:1},ap=e=>e?Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)):{},vI=(e,t)=>e.some((o,i)=>o.field!==t[i].field?!0:o.hide!==t[i].hide),wI="h-full w-full",md=".ag-checkbox-input",Sr={accentColor:"var(--bg-control-accent, var(--bg-accent-primary, #3664E2))",backgroundColor:"var(--bg-layer-raised, var(--bg-layer-3, #1D2439))",oddRowBackgroundColor:"var(--bg-layer-sunken, var(--bg-layer-2, #161B2D))",selectedRowBackgroundColor:"var(--bg-accent-primary-alpha, #7DA4FF26)",borderColor:"var(--bg-layer-4, #242C42)",rowBorder:"1px solid var(--stroke-tertiary, var(--stroke-primary, #696E7C))",rowHoverColor:"var(--bg-accent-primary-alpha, #7DA4FF26)",borderRadius:3,browserColorScheme:"dark",chromeBackgroundColor:"var(--bg-layer-1, #0C101D)",foregroundColor:"var(--text-primary, #EEF1F7)",headerFontSize:14,headerFontWeight:600,headerTextColor:"var(--text-secondary, #9FA6BD)",spacing:4,wrapperBorderRadius:3,fontSize:14,fontFamily:"var(--theme-font, var(--font-inter))"},Cd=40;var So=(e=>(e.API="api",e.ROW_DATA_CHANGED="rowDataChanged",e.CHECKBOX_SELECTED="checkboxSelected",e))(So||{}),si=(e=>(e.Undefined="undefined",e.Mobile="mobile",e.Tablet="tablet",e.Desktop="desktop",e))(si||{});const vd=()=>typeof window<"u"&&window.innerWidth<1279,wd=()=>typeof window<"u"&&window.innerWidth<640,bI=()=>{if(typeof window>"u")return si.Undefined;const e=window.innerWidth;return e>=1024?si.Desktop:e<640?si.Mobile:si.Tablet},lp=()=>{const[e,t]=p.useState(wd());return p.useEffect(()=>{const o=()=>t(wd());return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),e},cp=()=>{const[e,t]=p.useState(vd());return p.useEffect(()=>{const o=()=>t(vd());return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),e};function dp(e,t){let o=null;return(...i)=>{o&&clearTimeout(o),o=setTimeout(()=>e(...i),t)}}let bd=!1;const up=()=>{bd||(bd=!0,zT({testIdAttribute:"dataQA"}),Qd.registerModules([GT]))},SI=({columnDefs:e,rowData:t,additionalGridOptions:o,getContextMenuItems:i,className:s,ariaLabel:n="Data grid",wrapCustomCellRenderers:r=!0,disabledRowIds:a,selectedRowIds:l,onSelectionChange:c,onGridApiChange:d,getRowId:u=F=>String(F.id??JSON.stringify(F)),alternateOddRowColors:h=!1,filterPlaceholder:g="Enter value",emptyStateIcon:f,emptyStateTitle:m="No results found",emptyStateDescription:C="Sorry, we couldn't find any results for your search.",loading:v=!1,wrapperBorder:w=!0,withoutHeaderBorders:b=!1,allowDisabledContextMenu:y=!1,selectionMode:S})=>{up();const[F,E]=p.useState(),M=p.useId(),T=lp(),G=cp(),P=p.useRef(new Set),I=p.useRef(void 0),A=p.useMemo(()=>({...Sr,oddRowBackgroundColor:h?Sr.oddRowBackgroundColor:Sr.backgroundColor,wrapperBorder:w}),[h,w]),J=p.useCallback(V=>{V.api.sizeColumnsToFit()},[]),k=p.useCallback(V=>{if(V.data){const Q=u(V.data),le=a?.has(Q)??!1,Me=le&&!y,Ae=V.value==null?"":String(V.value),ee=i?.(V.data)??[];return H.jsx(ha,{trigger:[Vt.ContextMenu],items:ee,anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full",disabled:Me,children:H.jsx("span",{className:"block min-w-0 h-full max-w-full",children:H.jsx(pa,{text:Ae,className:"max-w-full h-full",hideTooltip:le})})})}},[i,a,u,y]),j=p.useCallback(V=>V===So.API||V===So.ROW_DATA_CHANGED,[]),ie=p.useCallback(V=>{if(!F)return;const le=(V.selectedNodes||[]).map(Ae=>Ae.data),Me=new Set(le.map(u));P.current=Me,I.current=V.source,j(V.source)||c?.(Me,le)},[F,u,j,c]),$=p.useMemo(()=>dp(V=>ie?.(V),100),[ie]),Z=p.useCallback(V=>{if(!V.data)return null;const Q=u(V.data),le=V.node.isSelected(),Me=a?.has(Q),Ae=`row-select-${Q}`;return H.jsx("div",{className:"size-6 flex items-center justify-center",children:H.jsx(Ed,{className:"size-[18px]",inputId:Ae,checked:le,disabled:Me,name:"gridradiobutton",value:"selected",onChange:()=>{Me||(V.node.setSelected(!0,!0,So.CHECKBOX_SELECTED),V.api.refreshCells({columns:[V.column?.getColId()]}))}})})},[u,a]),z=p.useCallback(()=>{const V="dial-row-select",Q="dial-row-select-visible";return T||G||l&&l.size>0?`${V} ${Q}`:!l||l.size===0?V:`${V} ${Q}`},[T,G,l]),te=p.useCallback(()=>T||G?z():!l||l.size===0?"dial-row-not-select-header":z(),[z,T,G,l]),q=p.useMemo(()=>{if(S===Ki.SINGLE)return{...fI,cellRenderer:Z};if(S===Ki.MULTIPLE)return{...mI,headerClass:()=>te(),cellClass:V=>{const Q=V.data?u(V.data):null;let le=z();return Q&&a?.has(Q)&&(le+=" opacity-50 pointer-events-none"),le}}},[S,Z,te,u,z,a]),oe=p.useCallback(V=>{const Q=typeof r=="function"?r(V):!!r;if(!V.cellRenderer)return{...V,cellRenderer:k};if(!Q)return V;const le=V.cellRenderer;return{...V,cellRenderer:Ae=>{const ee=Ae.data?i?.(Ae.data)??[]:[];let ae=null;if(typeof le=="function"){const X=le;ae=H.jsx(X,{...Ae})}else ae=k(Ae);const Ce=Ae.data?u(Ae.data):null,ue=Ce?a?.has(Ce):!1;return H.jsx(ha,{trigger:[Vt.ContextMenu],items:ee,anchorToMouse:!0,matchReferenceWidth:!0,className:fe("w-full h-full",ue&&"!cursor-not-allowed opacity-75"),disabled:ue&&!y,children:H.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:ae})})}}},[a,i,u,k,r,y]),de=p.useMemo(()=>r?(e??[]).map(oe):e??[],[e,r,r?oe:null]),{defaultColDef:Oe,...Ge}=o??{},je=p.useMemo(()=>({minWidth:150,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:g,buttons:["reset"]},comparator:rp,...ap(Oe)}),[g,Oe]),St=V=>{const Q=document.querySelector(md);Q&&Q.setAttribute("aria-description",Rr);const le=de.map(Me=>({...Me,sort:void 0}));V.api.updateGridOptions({columnDefs:le,rowData:t}),V.api.sizeColumnsToFit(),E(V.api),o?.onGridReady?.(V),d?.(V.api)};p.useEffect(()=>{F&&t&&F.setGridOption("rowData",t)},[F,t]);const yt=p.useCallback(()=>H.jsx(xd,{title:m,description:C,containerClassName:"gap-3",titleClassName:"mt-2 !text-lg",icon:f||H.jsx(vn.IconZoomCancel,{size:100,stroke:.5,className:"text-secondary"})}),[m,C,f]),ge=p.useMemo(()=>{if(S)return{mode:S===Ki.SINGLE?"singleRow":"multiRow",isRowSelectable:V=>{const Q=V.data?u(V.data):null;return Q?!a?.has(Q):!0}}},[a,u,S]);p.useEffect(()=>{F&&t&&P.current.size&&P.current.forEach(V=>{const Q=F.getRowNode(V);Q&&!Q.isSelected()&&Q.setSelected(!0,!1,So.API)})},[F,t]),p.useEffect(()=>{F&&l&&(F.deselectAll("all",So.API),l.forEach(V=>{const Q=F.getRowNode(V);Q&&!Q.isSelected()&&Q.setSelected(!0,!1,So.API)}))},[F,l]);const U=p.useCallback(V=>V.data?u(V.data):"",[u]),ne=p.useCallback(()=>{document.querySelectorAll(`.ag-row ${md}`).forEach(V=>{V.setAttribute("aria-description",Rr)})},[]);return p.useEffect(()=>{const V=j(I.current);if(F&&l?.size&&V){const Q=Array.from(l)[0];if(Q){const le=F.getRowNode(Q);le&&F.ensureNodeVisible(le)}}},[F,j,l]),H.jsx("div",{className:fe(wI,s,S&&"with-selection-column",b&&"dial-without-header-borders"),"aria-label":n,role:"region","aria-busy":v,children:H.jsx("div",{className:"h-full overflow-x-auto",role:"table","aria-describedby":M,children:H.jsx(Qg,{rowModelType:"clientSide",headerHeight:Cd,rowHeight:Cd,cellSelection:!1,theme:Vh.withPart(Ih).withParams({...A}),autoSizeStrategy:{type:"fitGridWidth"},columnDefs:de,defaultColDef:je,selectionColumnDef:q,onGridSizeChanged:J,onGridReady:St,loading:v,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:yt,rowData:t,rowSelection:ge,onSelectionChanged:$,getRowId:U,onRowDataUpdated:ne,onBodyScroll:ne,onFirstDataRendered:ne,...Ge})})})},Pl=e=>{if(!e)return null;if(e instanceof Date)return isFinite(e.getTime())?e:null;if(typeof e=="number"){const t=new Date(e);return isFinite(t.getTime())?t:null}if(typeof e=="string"){const t=e.trim();if(/^-?\d+$/.test(t))return Pl(Number(t));const o=new Date(t);return isFinite(o.getTime())?o:null}return null},yI=({value:e,locale:t=ip,options:o=sp,emptyPlaceholder:i,className:s,hideTooltip:n=!1})=>{const r=Pl(e),a=p.useMemo(()=>r?new Intl.DateTimeFormat(t,o).format(r):i,[r,i,t,o]),l=r?r.toISOString():void 0;return H.jsx(pa,{text:l?H.jsx("time",{dateTime:l,children:a}):H.jsx("span",{children:a}),className:fe(pI,s),hideTooltip:n})};exports.AgGridReact=Qg;exports.DEFAULT_DATE_FORMAT_OPTIONS=sp;exports.DEFAULT_LOCALE=ip;exports.DIAL_KIT_CLASS=bn;exports.DialCloseButton=Xg;exports.DialDangerIconButton=bp;exports.DialDateCellRenderer=yI;exports.DialDropdown=ha;exports.DialEllipsisTooltip=pa;exports.DialGhostIconButton=Rd;exports.DialGrid=SI;exports.DialIcon=zs;exports.DialNeutralIconButton=wp;exports.DialNoDataContent=xd;exports.DialPrimaryIconButton=vp;exports.DialRadioButton=Ed;exports.DialSecondaryIconButton=Sp;exports.DialSuccessIconButton=Rp;exports.DialTertiaryIconButton=yp;exports.DropdownItemType=Cn;exports.DropdownTrigger=Vt;exports.DropdownType=Zg;exports.GridSelectionMode=Ki;exports.ScreenType=si;exports.SubMenuPanel=op;exports.ThemeScope=Fp;exports.ariaDescription=Rr;exports.baseColumnComparator=rp;exports.checkColDefsChanges=vI;exports.colorSchemeLight=Ih;exports.convertToDate=Pl;exports.debounceFn=dp;exports.getScreenType=bI;exports.observeElementSize=yd;exports.omitUndefined=ap;exports.registerAgGridModulesOnce=up;exports.scheduleMeasure=wn;exports.themeBalham=Vh;exports.useIsMobileScreen=lp;exports.useIsTabletScreen=cp;exports.useSubMenuFloating=tp;exports.useThemeScope=Fd;
63
+ If you are trying to annotate ${i} with application data, use the '${i}.context' property instead.`),Ni(d)}if(a.length>0&&s){const l=this.beans.frameworkOverrides.getDocLink(s);Ni(`to see all the valid ${i} properties please check: ${l}`)}}};function kT(e,t,o){const i={},s=e.filter(n=>!t.some(r=>r===n));if(s.length>0)for(const n of s)i[n]=Qr({inputValue:n,allSuggestions:o}).values;return i}var LT=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),OT={moduleName:"Validation",version:L,beans:[AT]},GT={moduleName:"AllCommunity",version:L,dependsOn:[TF,JF,HD,OT,Ex,xx,Px,Dx,Mx,Tx,Ix,Fx,SD,yD,RD,FD,bD,xD,PD,ZD,G1,vM,fh,Y1,Q1,_M,HF,yw,EM,wT,f1,yT,zF,RT,_D,v1,OM,cg,$D,$M,Sw,IF,JM]};function N(e,t={}){const o=Object.keys(t).map(i=>{const s=t[i];return s!=null?`${i}=${s}`:null}).filter(Boolean).join(";");return[e,o].filter(i=>i.length>0).join(":")}var B={grid(e){return N("ag-grid-root",{gridId:e})},headerGroupCell(e){return N("ag-header-group-cell",{colId:e})},headerCell(e){return N("ag-header-cell",{colId:e})},headerCheckbox(e){return N("ag-header-selection-checkbox",{colId:e})},headerFilterButton(e){return N("ag-header-cell-filter-button",{colId:e})},floatingFilter(e){return N("ag-floating-filter",{colId:e})},floatingFilterButton(e){return N("ag-floating-filter-button",{colId:e})},headerCellMenuButton(e){return N("ag-header-cell-menu-button",{colId:e})},headerResizeHandle(e){return N("ag-header-cell-resize",{colId:e})},filterInstancePickerDisplay(e){return N(`ag-${e.source}-picker-display`,Ps(e))},numberFilterInstanceInput(e){return N(`ag-${e.source}-number-input`,Ps(e))},textFilterInstanceInput(e){return N(`ag-${e.source}-text-input`,Ps(e))},dateFilterInstanceInput(e){return N(`ag-${e.source}-date-input`,Ps(e))},setFilterInstanceMiniFilterInput(e){return N(`ag-${e.source}-set-filter-mini-filter-input`,e.source==="filter-toolpanel"?{label:e.colLabel}:{colId:e.colId})},setFilterInstanceItem(e,t){return N(`ag-${e.source}-set-filter-item`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,itemLabel:t}:{colId:e.colId,itemLabel:t})},setFilterApplyPanelButton(e,t){return N(`ag-${e.source}-set-filter-apply-panel-button`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,buttonLabel:t}:{colId:e.colId,buttonLabel:t})},filterConditionRadioButton(e,t){return N(`ag-${e.source}-filter-condition-radio-button`,e.source==="filter-toolpanel"?{colLabel:e.colLabel,buttonLabel:t}:{colId:e.colId,buttonLabel:t})},advancedFilterInput(){return N("ag-advanced-filter-input")},advancedFilterButton(e){return N("ag-advanced-filter-button",{label:e})},advancedFilterBuilderButton(){return N("ag-advanced-filter-builder-button")},advancedFilterPanelMaximiseButton(){return N("ag-advanced-filter-builder-panel-maximise")},advancedFilterPanelCloseButton(){return N("ag-advanced-filter-builder-panel-close")},advancedFilterPill(e){return N("ag-advanced-filter-builder-pill",{label:e})},advancedFilterBuilderAddItemButton(){return N("ag-advanced-filter-builder-add-item-button")},rowNode(e){return N("ag-row",{"row-id":e})},cell(e,t){return N("ag-cell",{"row-id":e,colId:t})},autoGroupCell(e){return B.cell(e,oo)},checkbox(e,t){return N("ag-selection-checkbox",{"row-id":e,colId:t})},selectionColumnCheckbox(e){return B.checkbox(e,Ta)},autoGroupColumnCheckbox(e){return B.checkbox(e,oo)},dragHandle(e,t){return N("ag-drag-handle",{"row-id":e,colId:t})},groupContracted(e,t){return N("ag-group-contracted",{"row-id":e,colId:t})},groupExpanded(e,t){return N("ag-group-expanded",{"row-id":e,colId:t})},autoGroupContracted(e){return B.groupContracted(e,oo)},autoGroupExpanded(e){return B.groupExpanded(e,oo)},rowNumber(e){return B.cell(e,Ia)},menu(){return N("ag-menu")},menuOption(e){return N("ag-menu-option",{option:e})},sideBar(){return N("ag-side-bar")},sideBarButton(e){return N("ag-side-button",{label:e})},columnToolPanel(){return N("ag-column-panel")},pivotModeSelect(){return N("ag-pivot-mode-select")},columnPanelSelectHeaderCheckbox(){return N("ag-column-panel-select-header-checkbox")},columnPanelSelectHeaderFilter(){return N("ag-column-panel-select-header-filter")},columnSelectListItemGroupClosedIcon(e){return N("ag-column-select-list-item-group-closed-icon",{label:e})},columnSelectListItemCheckbox(e){return N("ag-column-select-list-item-checkbox",{label:e})},columnSelectListItemDragHandle(e){return N("ag-column-select-list-item-drag-handle",{label:e})},columnDropCellDragHandle(e,t,o){return N("ag-column-drop-cell-drag-handle",{source:e,area:t,label:o})},columnDropCellCancelButton(e,t,o){return N("ag-column-drop-cell-cancel",{source:e,area:t,label:o})},columnDropArea(e,t){return N("ag-column-drop-area",{source:e,name:t})},filterToolPanel(){return N("ag-filter-panel")},filterToolPanelAddFilterButton(){return N("ag-filter-panel-add-filter-button")},filterToolPanelFilterTypeSelector(e){return N("ag-filter-panel-filter-type-selector",{colLabel:e})},filterToolPanelSearchInput(){return N("ag-filter-toolpanel-search-input")},filterToolPanelGroup(e){return N("ag-filter-toolpanel-group",{title:e})},filterToolPanelGroupCollapsedIcon(e){return N("ag-filter-toolpanel-group-collapsed-icon",{title:e})},statusBarTotalAndFilteredRowCount(){return N("ag-status-bar-total-and-filtered-row-count")},statusBarTotalRowCount(){return N("ag-status-bar-total-row-count")},statusBarFilteredRowCount(){return N("ag-status-bar-filtered-row-count")},statusBarSelectedRowCount(){return N("ag-status-bar-selected-row-count")},statusBarAggregations(){return N("ag-status-bar-aggregations")},paginationPanelSizePickerDisplay(e){return N("ag-pagination-page-size-picker-field-display",{value:e})},paginationPanelFirstRowOnPage(e){return N("ag-paging-row-summary-panel-first-row-on-page",{value:e})},paginationPanelLastRowOnPage(e){return N("ag-paging-row-summary-panel-last-row-on-page",{value:e})},paginationPanelRecordCount(e){return N("ag-paging-row-summary-panel-record-count",{value:e})},paginationSummaryPanelButton(e){return N("ag-paging-page-summary-panel-btn",{label:e})},paginationSummaryPanelCurrentPage(e){return N("ag-paging-page-summary-panel-current-page",{value:e})},paginationSummaryPanelTotalPage(e){return N("ag-paging-page-summary-panel-total-page",{value:e})},fillHandle(){return N("ag-fill-handle")},columnChooserCloseButton(){return N("ag-column-chooser-close-button")},columnChooserSearchBarCheckbox(){return N("ag-column-chooser-header-checkbox")},columnChooserSearchBarFilter(){return N("ag-column-chooser-searchbar-filter")},columnChooserListItemGroupClosedIcon(e){return N("ag-column-chooser-list-item-group-closed-icon",{label:e})},columnChooserListItemCheckbox(e){return N("ag-column-chooser-list-item-checkbox",{label:e})},columnChooserListItemDragHandle(e){return N("ag-column-chooser-list-item-drag-handle",{label:e})},overlay(){return N("ag-overlay")}};function HT(e,t){const o={};for(const i of Object.keys(e))t[i]!==null&&(o[t[i]??i]=e[i]);return o}function BT(e){return e.source!=="floating-filter"?{index:0,...e}:e}function Ps(e){return HT(BT(e),{colLabel:"label"})}var Vg="data-testid";function _(e,t){e?.setAttribute(Vg,t)}function VT(e){Vg=e}var NT=class extends x{constructor(){super(...arguments),this.beanName="testIdSvc"}postConstruct(){const e=xe(this,()=>this.setupAllTestIds(),500),t=xe(this,()=>{this.setupAllTestIds(),e()},0);this.addManagedEventListeners({firstDataRendered:t,displayedRowsChanged:t,displayedColumnsChanged:t,displayedColumnsWidthChanged:t,virtualColumnsChanged:t,columnMenuVisibleChanged:t,contextMenuVisibleChanged:t,advancedFilterBuilderVisibleChanged:t,fieldPickerValueSelected:t,modelUpdated:t,sideBarUpdated:t,pinnedHeightChanged:t,gridReady:t,overlayExclusiveChanged:t,rowGroupOpened:t,scrollVisibilityChanged:t,gridSizeChanged:t,filterOpened:t,filterChanged:t,cellSelectionChanged:t})}setupAllTestIds(){const e=gt(this.beans),t=Ju(this.beans),o=e.querySelector(`[grid-id="${t}"]`);_(o,B.grid(t)),e.querySelectorAll(".ag-header-group-cell").forEach(n=>{_(n,B.headerGroupCell(n.getAttribute("col-id")))}),e.querySelectorAll(".ag-header-cell").forEach(n=>{const r=n.getAttribute("col-id"),l=n.classList.contains("ag-floating-filter")?B.floatingFilter(r):B.headerCell(r);_(n,l),_(n.querySelector(".ag-header-cell-filter-button"),B.headerFilterButton(r)),_(n.querySelector(".ag-header-cell-menu-button"),B.headerCellMenuButton(r)),_(n.querySelector(".ag-header-cell-resize"),B.headerResizeHandle(r)),_(n.querySelector(".ag-checkbox input[type=checkbox]"),B.headerCheckbox(r)),_(n.querySelector(".ag-floating-filter-button button"),B.floatingFilterButton(r)),this.setupFilterInstance(n.querySelector(".ag-floating-filter-body"),{source:"floating-filter",colId:r})});const i=e.querySelector(".ag-filter-menu");this.setupFilterInstance(i,{source:"column-filter"}),_(e.querySelector(".ag-advanced-filter input[type=text]"),B.advancedFilterInput()),e.querySelectorAll(".ag-advanced-filter-buttons button").forEach(n=>{_(n,B.advancedFilterButton(n.textContent))}),_(e.querySelector("button.ag-advanced-filter-builder-button"),B.advancedFilterBuilderButton()),e.querySelectorAll('.ag-panel[aria-label="Advanced Filter"] .ag-panel-title-bar-button').forEach((n,r)=>{_(n,r===0?B.advancedFilterPanelMaximiseButton():B.advancedFilterPanelCloseButton())}),e.querySelectorAll('.ag-panel[aria-lable="Advanced Filter"] .ag-advanced-filter-builder-pill').forEach(n=>{_(n,B.advancedFilterPill(n.querySelector(".ag-picker-field-display")?.textContent))}),_(e.querySelector('.ag-panel[aria-label="Advanced Filter"] .ag-advanced-filter-builder-item-button'),B.advancedFilterBuilderAddItemButton()),e.querySelectorAll(".ag-row").forEach(n=>{const r=n.getAttribute("row-id");_(n,B.rowNode(r)),n.querySelectorAll(".ag-cell").forEach(a=>{const l=a.getAttribute("col-id");_(a,B.cell(r,l)),_(a.querySelector(".ag-selection-checkbox input[type=checkbox]"),B.checkbox(r,l)),_(a.querySelector(".ag-drag-handle"),B.dragHandle(r,l)),_(a.querySelector(".ag-group-contracted"),B.groupContracted(r,l)),_(a.querySelector(".ag-group-expanded"),B.groupExpanded(r,l))})}),e.querySelectorAll(".ag-menu-list").forEach(n=>{_(n,B.menu()),n.querySelectorAll(".ag-menu-option").forEach(r=>{_(r,B.menuOption(r.querySelector(".ag-menu-option-text")?.textContent))})}),e.querySelectorAll(".ag-side-bar").forEach(n=>{_(n,B.sideBar()),n.querySelectorAll(".ag-side-button button").forEach(r=>{_(r,B.sideBarButton(r.querySelector(".ag-side-button-label")?.textContent))}),n.querySelectorAll(".ag-column-panel").forEach(r=>{_(r,B.columnToolPanel()),_(r.querySelector(".ag-pivot-mode-select input[type=checkbox]"),B.pivotModeSelect()),_(r.querySelector(".ag-column-select-header-checkbox input[type=checkbox]"),B.columnPanelSelectHeaderCheckbox()),_(r.querySelector(".ag-column-select-header-filter-wrapper input[type=text]"),B.columnPanelSelectHeaderFilter()),r.querySelectorAll(".ag-column-select-list").forEach(a=>{a.querySelectorAll(".ag-column-select-virtual-list-item").forEach(l=>{const c=l.getAttribute("aria-label");_(l.querySelector(".ag-column-group-closed-icon"),B.columnSelectListItemGroupClosedIcon(c)),_(l.querySelector(".ag-column-select-checkbox input[type=checkbox]"),B.columnSelectListItemCheckbox(c)),_(l.querySelector(".ag-drag-handle"),B.columnSelectListItemDragHandle(c))})}),this.setupColumnDropArea(r,"toolbar")}),n.querySelectorAll(".ag-filter-panel").forEach(r=>{_(r,B.filterToolPanel()),_(r.querySelector("button.ag-filter-add-button"),B.filterToolPanelAddFilterButton()),r.querySelectorAll(".ag-filter-card").forEach(a=>{const l=a.querySelector(".ag-filter-card-title")?.textContent,c=a.querySelector(".ag-filter-type-select");_(c,B.filterToolPanelFilterTypeSelector(l)),a.querySelectorAll(".ag-filter").forEach(d=>this.setupFilterInstance(d,{source:"filter-toolpanel",colLabel:l}))})}),n.querySelectorAll(".ag-filter-toolpanel").forEach(r=>{_(r.querySelector(".ag-filter-toolpanel-search-input input[type=text]"),B.filterToolPanelSearchInput()),r.querySelectorAll(".ag-filter-toolpanel-group").forEach(a=>{const l=a.querySelector(".ag-filter-toolpanel-group-title")?.textContent;_(a,B.filterToolPanelGroup(l)),_(a.querySelector(".ag-filter-toolpanel-group-title-bar-icon .ag-icon-tree-closed"),B.filterToolPanelGroupCollapsedIcon(l));const c=a.querySelector(".ag-filter-toolpanel-instance-filter");c&&this.setupFilterInstance(c,{source:"filter-toolpanel",colLabel:l})})})}),_(e.querySelector(".ag-status-bar .ag-status-panel-total-and-filtered-row-count"),B.statusBarTotalAndFilteredRowCount()),_(e.querySelector(".ag-status-bar .ag-status-panel-total-row-count"),B.statusBarTotalRowCount()),_(e.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"),B.statusBarFilteredRowCount()),_(e.querySelector(".ag-status-bar .ag-status-panel-selected-row-count"),B.statusBarSelectedRowCount()),_(e.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"),B.statusBarAggregations()),e.querySelectorAll(".ag-paging-panel").forEach(n=>{_(n.querySelector(".ag-paging-page-size .ag-picker-field-display"),B.paginationPanelSizePickerDisplay(n.querySelector(".ag-paging-page-size .ag-picker-field-display")?.textContent)),n.querySelectorAll(".ag-paging-row-summary-panel-number").forEach(r=>{switch(r.getAttribute("data-ref")){case"lbFirstRowOnPage":_(r,B.paginationPanelFirstRowOnPage(r.textContent));break;case"lbLastRowOnPage":_(r,B.paginationPanelLastRowOnPage(r.textContent));break;case"lbRecordCount":_(r,B.paginationPanelRecordCount(r.textContent));break}}),n.querySelectorAll(".ag-paging-page-summary-panel .ag-button").forEach(r=>{_(r,B.paginationSummaryPanelButton(r.getAttribute("aria-label")?.toLowerCase()))}),n.querySelectorAll(".ag-paging-page-summary-panel .ag-paging-number").forEach(r=>{switch(r.getAttribute("data-ref")){case"lbCurrent":_(r,B.paginationSummaryPanelCurrentPage(r.textContent));break;case"lbTotal":_(r,B.paginationSummaryPanelTotalPage(r.textContent));break}})}),_(e.querySelector(".ag-fill-handle"),B.fillHandle()),e.querySelectorAll('.ag-panel[aria-label="Choose Columns"]').forEach(n=>{_(n.querySelector(".ag-panel-title-bar-button-icon"),B.columnChooserCloseButton()),_(n.querySelector('.ag-column-select-header-checkbox input[type="checkbox"]'),B.columnChooserSearchBarCheckbox()),_(n.querySelector('.ag-column-select-header-filter-wrapper input[type="text"]'),B.columnChooserSearchBarFilter()),n.querySelectorAll(".ag-column-select-list").forEach(r=>{r.querySelectorAll(".ag-column-select-virtual-list-item").forEach(a=>{const l=a.getAttribute("aria-label");_(a.querySelector(".ag-column-group-closed-icon"),B.columnChooserListItemGroupClosedIcon(l)),_(a.querySelector(".ag-column-select-checkbox input[type=checkbox]"),B.columnChooserListItemCheckbox(l)),_(a.querySelector(".ag-drag-handle"),B.columnChooserListItemDragHandle(l))})})}),_(e.querySelector(".ag-overlay-wrapper"),B.overlay());const s=e.querySelector(".ag-column-drop-wrapper");s&&this.setupColumnDropArea(s,"panel")}setupFilterInstance(e,t){if(!e)return;e.querySelectorAll(".ag-filter-select .ag-picker-field-display").forEach(s=>{_(s,B.filterInstancePickerDisplay(t))});const o=t.source==="floating-filter"?".ag-floating-filter-body":".ag-filter-body";e.querySelectorAll(`${o} .ag-input-field:not(.ag-hidden) input[type="number"]`).forEach((s,n,r)=>{const l=r.length>1?{...t,index:n}:t;_(s,B.numberFilterInstanceInput(l))}),e.querySelectorAll(`${o} .ag-input-field:not(.ag-hidden) input[type="text"]`).forEach((s,n,r)=>{const l=r.length>1?{...t,index:n}:t;_(s,B.textFilterInstanceInput(l))}),e.querySelectorAll(`${o} .ag-input-field:not(.ag-hidden) input[type="date"]`).forEach((s,n,r)=>{const l=r.length>1?{...t,index:n}:t;_(s,B.dateFilterInstanceInput(l))});const i=e.querySelector('.ag-mini-filter input[type="text"]');_(i,B.setFilterInstanceMiniFilterInput(t)),e.querySelectorAll(".ag-set-filter-list .ag-set-filter-item").forEach(s=>{const n=s.querySelector(".ag-checkbox-label")?.textContent,r=s.querySelector('input[type="checkbox"]');_(r,B.setFilterInstanceItem(t,n))}),e.querySelectorAll(".ag-filter-apply-panel button").forEach(s=>{_(s,B.setFilterApplyPanelButton(t,s.textContent))}),e.querySelectorAll(".ag-filter-condition .ag-radio-button").forEach(s=>{const n=s.querySelector(".ag-radio-button-label")?.textContent;_(s.querySelector("input[type=radio]"),B.filterConditionRadioButton(t,n))})}setupColumnDropArea(e,t){e.querySelectorAll(".ag-column-drop").forEach(o=>{const i=o.querySelector(".ag-column-drop-list")?.getAttribute("aria-label");_(o,B.columnDropArea(t,i)),o.querySelectorAll(".ag-column-drop-cell").forEach(s=>{const n=s.querySelector(".ag-column-drop-cell-text")?.textContent;_(s.querySelector(".ag-drag-handle"),B.columnDropCellDragHandle(t,i,n)),_(s.querySelector(".ag-column-drop-cell-button .ag-icon-cancel"),B.columnDropCellCancelButton(t,i,n))})})}},WT={moduleName:"Testing",version:L,beans:[NT]};function zT({testIdAttribute:e}={}){e&&VT(e),Qd.registerModules([WT])}var _T=class{wrap(e,t,o,i){const s=this.createWrapper(e,i);for(const n of t??[])this.createMethod(s,n,!0);for(const n of o??[])this.createMethod(s,n,!1);return s}createMethod(e,t,o){e.addMethod(t,this.createMethodProxy(e,t,o))}createMethodProxy(e,t,o){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(o&&D(49,{methodName:t}),null)}}},UT=class extends Qu{constructor(e){super(e,Oa)}},We=p.createContext({}),Ng=p.createContext("default"),ps=(e,t,o,i)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const n=e.newAgStackInstance();let r,a,l=!1;return n.then(c=>{if(l){t.destroyBean(c);return}r=c,a=r.getGui(),o.appendChild(a),cd(i,r)}),()=>{l=!0,r&&(a?.remove(),t.destroyBean(r),i&&cd(i,void 0))}},cd=(e,t)=>{if(e)if(e instanceof Function)e(t);else{const o=e;o.current=t}},at=(...e)=>e.filter(o=>o!=null&&o!=="").join(" "),dt=class Wg{constructor(...t){this.classesMap={};for(const o of t)this.classesMap[o]=!0}setClass(t,o){if(!!this.classesMap[t]==o)return this;const s=new Wg;return s.classesMap={...this.classesMap},s.classesMap[t]=o,s}toString(){return Object.keys(this.classesMap).filter(o=>this.classesMap[o]).join(" ")}},Mi=e=>{const t=()=>typeof Symbol=="function"&&Symbol.for,o=()=>t()?Symbol.for("react.memo"):60115;return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===o()},ca=p.version?.split(".")[0],zg=ca==="16"||ca==="17";function $T(){return ca==="19"}var Ws=!1;function KT(e){return Ws||setTimeout(()=>Ws=!1,0),Ws=!0,e()}var rs=(e,t)=>{!zg&&e&&!Ws?ga.flushSync(t):t()},qT=e=>{zg?e():p.startTransition(e)};function jT(e,t,o){return p.useSyncExternalStore?p.useSyncExternalStore(e,t):o}function mn(e,t,o){if(t==null||e==null)return t;if(e===t||t.length===0&&e.length===0)return e;if(o||e.length===0&&t.length>0||e.length>0&&t.length===0)return t;const i=[],s=[],n=new Map,r=new Map;for(let a=0;a<t.length;a++){const l=t[a];r.set(l.instanceId,l)}for(let a=0;a<e.length;a++){const l=e[a];n.set(l.instanceId,l),r.has(l.instanceId)&&i.push(l)}for(let a=0;a<t.length;a++){const l=t[a],c=l.instanceId;n.has(c)||s.push(l)}return i.length===e.length&&s.length===0?e:i.length===0&&s.length===t.length?t:i.length===0?s:s.length===0?i:[...i,...s]}var _g=p.forwardRef((e,t)=>{const{registry:o,context:i}=p.useContext(We),s=p.useRef(null),n=p.useRef(null),r=p.useRef(null),a=p.useRef(null),l=p.useRef(null),c=p.useRef(),[d,u]=p.useState(),[h,g]=p.useState(),[f,m]=p.useState(),[C,v]=p.useState(()=>new dt),[w,b]=p.useState(()=>new dt("ag-hidden")),[y,S]=p.useState(()=>new dt("ag-hidden")),[F,E]=p.useState(()=>new dt("ag-invisible"));p.useImperativeHandle(t,()=>({refresh(){return!1}})),p.useLayoutEffect(()=>ps(d,i,n.current),[d]);const M=p.useCallback(ie=>{if(s.current=ie,!ie||i.isDestroyed()){c.current=i.destroyBean(c.current);return}const $={setInnerRenderer:(z,te)=>{u(z),m(te)},setChildCount:z=>g(z),toggleCss:(z,te)=>v(q=>q.setClass(z,te)),setContractedDisplayed:z=>S(te=>te.setClass("ag-hidden",!z)),setExpandedDisplayed:z=>b(te=>te.setClass("ag-hidden",!z)),setCheckboxVisible:z=>E(te=>te.setClass("ag-invisible",!z)),setCheckboxSpacing:z=>E(te=>te.setClass("ag-group-checkbox-spacing",z))},Z=o.createDynamicBean("groupCellRendererCtrl",!0);Z&&(c.current=i.createBean(Z),c.current.init($,ie,r.current,a.current,l.current,_g,e))},[]),T=p.useMemo(()=>`ag-cell-wrapper ${C.toString()}`,[C]),G=p.useMemo(()=>`ag-group-expanded ${w.toString()}`,[w]),P=p.useMemo(()=>`ag-group-contracted ${y.toString()}`,[y]),I=p.useMemo(()=>`ag-group-checkbox ${F.toString()}`,[F]),A=d?.componentFromFramework,J=A?d.componentClass:void 0,k=d==null&&f!=null,j=Ei(f);return p.createElement("span",{className:T,ref:M,...e.colDef?{}:{role:c.current?.getCellAriaRole()}},p.createElement("span",{className:G,ref:a}),p.createElement("span",{className:P,ref:l}),p.createElement("span",{className:I,ref:r}),p.createElement("span",{className:"ag-group-value",ref:n},k?j:A?p.createElement(J,{...d.params}):null),p.createElement("span",{className:"ag-group-child-count"},h))}),dd=_g,El=p.createContext({setMethods:()=>{}}),YT=e=>{const{initialProps:t,addUpdateCallback:o,CustomComponentClass:i,setMethods:s}=e,[{key:n,...r},a]=p.useState(t);return p.useEffect(()=>{o(l=>a(l))},[]),p.createElement(El.Provider,{value:{setMethods:s}},p.createElement(i,{key:n,...r}))},QT=p.memo(YT),ZT=0;function ud(){return`agPortalKey_${++ZT}`}var Ug=class{constructor(e,t,o,i){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=o,this.suppressFallbackMethods=!!i,this.statelessComponent=this.isStateless(this.reactComponent),this.key=ud(),this.portalKey=ud(),this.instanceCreated=this.isStatelessComponent()?se.resolve(!1):new se(s=>{this.resolveInstanceCreated=s})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){this.componentInstance&&typeof this.componentInstance.destroy=="function"&&this.componentInstance.destroy();const e=this.portal;e&&this.portalManager.destroyPortal(e)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),o=document.createElement(t||"div");return o.classList.add("ag-react-container"),e.reactContainer=o,o}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return typeof Symbol=="function"&&Symbol.for}isStateless(e){return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&t[e]!=null||this.fallbackMethodAvailable(e)}callMethod(e,t){const o=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!o){setTimeout(()=>this.callMethod(e,t));return}const i=o[e];if(i)return i.apply(o,t);if(this.fallbackMethodAvailable(e))return this.fallbackMethod(e,t&&t[0]?t[0]:{})}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.createOrUpdatePortal(e),new se(t=>this.createReactComponent(t))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=t=>{this.componentInstance=t,this.resolveInstanceCreated?.(!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,{...e,key:this.key}),this.portal=ga.createPortal(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return p.createElement(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,e)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!!(!this.isStatelessComponent()&&this.getFrameworkComponentInstance())}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const o=this[`${e}Component`];if(!this.suppressFallbackMethods&&o)return o.bind(this)(t)}fallbackMethodAvailable(e){return this.suppressFallbackMethods?!1:!!this[`${e}Component`]}};function Bn(e,t,o){for(const i of e){const s=t[i];s&&(o[i]=s)}}var ht=class extends Ug{constructor(){super(...arguments),this.awaitUpdateCallback=new se(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=QT}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:o=>this.setMethods(o),addUpdateCallback:o=>{this.updateCallback=()=>(o(this.getProps()),new se(i=>{setTimeout(()=>{i()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,Bn(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return{...this.sourceParams,key:this.key,ref:this.ref}}refreshProps(){return this.updateCallback?this.updateCallback():new se(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},JT=class extends ht{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},XT=class extends ht{refresh(e){this.sourceParams=e,this.refreshProps()}},e2=class extends ht{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},t2=class extends ht{constructor(){super(...arguments),this.label="",this.icon=null,this.shake=!1}setIcon(e,t){this.icon=e,this.shake=t,this.refreshProps()}setLabel(e){this.label=e,this.refreshProps()}getProps(){const e=super.getProps(),{label:t,icon:o,shake:i}=this;return e.label=t,e.icon=o,e.shake=i,e}},o2=class extends ht{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterModifiedCallback(),this.expectingNewMethods=!0,this.hasBeenActive=!1,this.awaitSetMethodsCallback=new se(e=>{this.resolveSetMethodsCallback=e})}isFilterActive(){return this.model!=null}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.expectingNewMethods=!0,this.model=e,this.hasBeenActive||(this.hasBeenActive=this.isFilterActive()),this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}setMethods(e){this.expectingNewMethods===!1&&this.hasBeenActive&&this.providedMethods?.doesFilterPass!==e?.doesFilterPass&&setTimeout(()=>{this.sourceParams.filterChangedCallback()}),this.expectingNewMethods=!1,super.setMethods(e),this.resolveSetMethodsCallback(),this.resolveFilterPassCallback?.(),this.resolveFilterPassCallback=void 0}updateModel(e){this.resolveFilterPassCallback?.();const t=new se(o=>{this.resolveFilterPassCallback=o});this.setModel(e).then(()=>{t.then(()=>{this.sourceParams.filterChangedCallback()})})}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,e}},i2=class extends ht{constructor(){super(...arguments),this.awaitSetMethodsCallback=new se(e=>{this.resolveSetMethodsCallback=e})}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","onAnyFilterChanged"]}setMethods(e){super.setMethods(e),this.resolveSetMethodsCallback()}};function $g(e,t){e.parentFilterInstance(o=>{(o.setModel(t)||se.resolve()).then(()=>{e.filterParams.filterChangedCallback()})})}var s2=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=o=>this.updateModel(o)}getProps(){return{...this.floatingFilterParams,model:this.model,onModelChange:this.onModelChange}}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){Bn(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),$g(this.floatingFilterParams,e)}},n2=class extends ht{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),$g(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},r2=class extends ht{refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}},a2=class extends ht{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},l2=class extends ht{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then(()=>this.sourceParams.onItemActivated())}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},c2=class extends ht{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},d2=class extends ht{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}};function xl(){D(231)}var u2=1e3,h2=class{constructor(e,t,o){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=t||"div",this.refresher=e,this.maxComponentCreationTimeMs=o||u2}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter(t=>t!==e),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,t,o){this.portals=[...this.portals,e],this.waitForInstance(t,o),this.batchUpdate()}updateReactPortal(e,t){this.portals[this.portals.indexOf(e)]=t,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout(()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)}),this.hasPendingPortalUpdate=!0)}waitForInstance(e,t,o=Date.now()){if(this.destroyed){t(null);return}if(e.rendered())t(e);else{if(Date.now()-o>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate){rs(!0,()=>this.refresher()),e.rendered()&&t(e);return}window.setTimeout(()=>{this.waitForInstance(e,t,o)})}}},g2=p.createContext([]),p2=p.createContext(void 0),f2=({ctrl:e})=>{const t=e.isAlive(),{context:o}=p.useContext(We),[i,s]=p.useState(),[n,r]=p.useState(),a=p.useRef(),l=p.useRef(null),c=p.useRef(null),d=p.useRef(null),u=p.useRef(),h=p.useRef();t&&!h.current&&(h.current=new as(()=>l.current));const g=p.useCallback(v=>{if(l.current=v,!v||!e.isAlive()||o.isDestroyed()){a.current=o.destroyBean(a.current);return}a.current=o.createBean(new Di);const w=()=>{const y=e.getSelectAllGui();y&&(c.current?.insertAdjacentElement("afterend",y),a.current.addDestroyFunc(()=>y.remove()))},b={setWidth:y=>{l.current&&(l.current.style.width=y)},toggleCss:(y,S)=>h.current.toggleCss(y,S),setUserStyles:y=>r(y),setAriaSort:y=>{l.current&&(y?_p(l.current,y):Up(l.current))},setUserCompDetails:y=>s(y),getUserCompInstance:()=>u.current||void 0,refreshSelectAllGui:w,removeSelectAllGui:()=>e.getSelectAllGui()?.remove()};e.setComp(b,v,c.current,d.current,a.current),w()},[]);p.useLayoutEffect(()=>ps(i,o,d.current,u),[i]),p.useEffect(()=>{e.setDragSource(l.current)},[i]);const f=p.useMemo(()=>!!(i?.componentFromFramework&&Mi(i.componentClass)),[i]),m=i?.componentFromFramework,C=i?.componentClass;return p.createElement("div",{ref:g,style:n,className:"ag-header-cell",role:"columnheader"},p.createElement("div",{ref:c,className:"ag-header-cell-resize",role:"presentation"}),p.createElement("div",{ref:d,className:"ag-header-cell-comp-wrapper",role:"presentation"},m?f?p.createElement(C,{...i.params}):p.createElement(C,{...i.params,ref:u}):null))},m2=p.memo(f2),C2=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t}getProps(){return this.floatingFilterParams}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){Bn(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}},v2=({ctrl:e})=>{const{context:t,gos:o}=p.useContext(We),[i,s]=p.useState(),[n,r]=p.useState(()=>new dt("ag-header-cell","ag-floating-filter")),[a,l]=p.useState(()=>new dt),[c,d]=p.useState(()=>new dt("ag-floating-filter-button","ag-hidden")),[u,h]=p.useState("false"),[g,f]=p.useState(),[,m]=p.useState(1),C=p.useRef(),v=p.useRef(null),w=p.useRef(null),b=p.useRef(null),y=p.useRef(null),S=p.useRef(),F=p.useRef(),E=z=>{z!=null&&S.current?.(z)},M=p.useCallback(z=>{if(v.current=z,!z||!e.isAlive()||t.isDestroyed()){C.current=t.destroyBean(C.current);return}C.current=t.createBean(new Di),F.current=new se(q=>{S.current=q});const te={toggleCss:(q,oe)=>r(de=>de.setClass(q,oe)),setUserStyles:q=>s(q),addOrRemoveBodyCssClass:(q,oe)=>l(de=>de.setClass(q,oe)),setButtonWrapperDisplayed:q=>{d(oe=>oe.setClass("ag-hidden",!q)),h(q?"false":"true")},setWidth:q=>{v.current&&(v.current.style.width=q)},setCompDetails:q=>f(q),getFloatingFilterComp:()=>F.current?F.current:null,setMenuIcon:q=>y.current?.appendChild(q)};e.setComp(te,z,y.current,w.current,C.current)},[]);p.useLayoutEffect(()=>ps(g,t,w.current,E),[g]);const T=p.useMemo(()=>n.toString(),[n]),G=p.useMemo(()=>a.toString(),[a]),P=p.useMemo(()=>c.toString(),[c]),I=p.useMemo(()=>!!(g&&g.componentFromFramework&&Mi(g.componentClass)),[g]),A=p.useMemo(()=>o.get("reactiveCustomComponents"),[]),J=p.useMemo(()=>o.get("enableFilterHandlers"),[]),[k,j]=p.useState();p.useEffect(()=>{if(g?.componentFromFramework)if(A){const z=J?C2:s2,te=new z(g.params,()=>m(q=>q+1));E(te),j(te)}else xl()},[g]);const ie=k?.getProps(),$=g?.componentFromFramework,Z=g?.componentClass;return p.createElement("div",{ref:M,style:i,className:T,role:"gridcell"},p.createElement("div",{ref:w,className:G,role:"presentation"},$?A?ie&&p.createElement(El.Provider,{value:{setMethods:z=>k.setMethods(z)}},p.createElement(Z,{...ie})):p.createElement(Z,{...g.params,ref:I?()=>{}:E}):null),p.createElement("div",{ref:b,"aria-hidden":u,className:P,role:"presentation"},p.createElement("button",{ref:y,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))},w2=p.memo(v2),b2=({ctrl:e})=>{const{context:t}=p.useContext(We),[o,i]=p.useState(),[s,n]=p.useState(()=>new dt),[r,a]=p.useState(()=>new dt),[l,c]=p.useState("false"),[d,u]=p.useState(),[h,g]=p.useState(),f=p.useRef(),m=p.useRef(null),C=p.useRef(null),v=p.useRef(null),w=p.useRef(),b=p.useCallback(T=>{if(m.current=T,!T||!e.isAlive()||t.isDestroyed()){f.current=t.destroyBean(f.current);return}f.current=t.createBean(new Di);const G={setWidth:P=>{m.current&&(m.current.style.width=P)},toggleCss:(P,I)=>n(A=>A.setClass(P,I)),setUserStyles:P=>i(P),setHeaderWrapperHidden:P=>{const I=v.current;I&&(P?I.style.setProperty("display","none"):I.style.removeProperty("display"))},setHeaderWrapperMaxHeight:P=>{const I=v.current;I&&(P!=null?I.style.setProperty("max-height",`${P}px`):I.style.removeProperty("max-height"),I.classList.toggle("ag-header-cell-comp-wrapper-limited-height",P!=null))},setUserCompDetails:P=>g(P),setResizableDisplayed:P=>{a(I=>I.setClass("ag-hidden",!P)),c(P?"false":"true")},setAriaExpanded:P=>u(P),getUserCompInstance:()=>w.current||void 0};e.setComp(G,T,C.current,v.current,f.current)},[]);p.useLayoutEffect(()=>ps(h,t,v.current),[h]),p.useEffect(()=>{m.current&&e.setDragSource(m.current)},[h]);const y=p.useMemo(()=>!!(h?.componentFromFramework&&Mi(h.componentClass)),[h]),S=p.useMemo(()=>"ag-header-group-cell "+s.toString(),[s]),F=p.useMemo(()=>"ag-header-cell-resize "+r.toString(),[r]),E=h?.componentFromFramework,M=h?.componentClass;return p.createElement("div",{ref:b,style:o,className:S,role:"columnheader","aria-expanded":d},p.createElement("div",{ref:v,className:"ag-header-cell-comp-wrapper",role:"presentation"},E?y?p.createElement(M,{...h.params}):p.createElement(M,{...h.params,ref:w}):null),p.createElement("div",{ref:C,"aria-hidden":l,className:F}))},S2=p.memo(b2),y2=({ctrl:e})=>{const{gos:t,context:o}=p.useContext(We),{topOffset:i,rowHeight:s}=p.useMemo(()=>e.getTopAndHeight(),[]),n=p.useMemo(()=>t.get("tabIndex"),[]),[r,a]=p.useState(()=>e.getAriaRowIndex()),l=e.headerRowClass,[c,d]=p.useState(()=>s+"px"),[u,h]=p.useState(()=>i+"px"),g=p.useRef(null),[f,m]=p.useState(()=>e.getUpdatedHeaderCtrls()),C=p.useRef(),v=p.useRef(null),w=p.useCallback(S=>{if(v.current=S,!S||!e.isAlive()||o.isDestroyed()){C.current=o.destroyBean(C.current);return}C.current=o.createBean(new Di);const F={setHeight:E=>d(E),setTop:E=>h(E),setHeaderCtrls:(E,M,T)=>{const G=g.current,P=mn(G,E,M);P!==G&&(g.current=P,rs(T,()=>m(P)))},setWidth:E=>{v.current&&(v.current.style.width=E)},setRowIndex:E=>{a(E)}};e.setComp(F,C.current,!1)},[]),b=p.useMemo(()=>({height:c,top:u}),[c,u]),y=p.useCallback(S=>{switch(e.type){case"group":return p.createElement(S2,{ctrl:S,key:S.instanceId});case"filter":return p.createElement(w2,{ctrl:S,key:S.instanceId});default:return p.createElement(m2,{ctrl:S,key:S.instanceId})}},[]);return p.createElement("div",{ref:w,className:l,role:"row",style:b,tabIndex:n,"aria-rowindex":r},f.map(y))},R2=p.memo(y2),F2=({pinned:e})=>{const[t,o]=p.useState(!0),[i,s]=p.useState([]),{context:n}=p.useContext(We),r=p.useRef(null),a=p.useRef(null),l=p.useRef(),c=e==="left",d=e==="right",u=!c&&!d,h=p.useCallback(m=>{if(r.current=m,!m||n.isDestroyed()){l.current=n.destroyBean(l.current);return}l.current=n.createBean(new sv(e));const C={setDisplayed:o,setCtrls:v=>s(v),setCenterWidth:v=>{a.current&&(a.current.style.width=v)},setViewportScrollLeft:v=>{r.current&&(r.current.scrollLeft=v)},setPinnedContainerWidth:v=>{r.current&&(r.current.style.width=v,r.current.style.minWidth=v,r.current.style.maxWidth=v)}};l.current.setComp(C,r.current)},[]),g=t?"":"ag-hidden",f=()=>i.map(m=>p.createElement(R2,{ctrl:m,key:m.instanceId}));return c?p.createElement("div",{ref:h,className:"ag-pinned-left-header "+g,"aria-hidden":!t,role:"rowgroup"},f()):d?p.createElement("div",{ref:h,className:"ag-pinned-right-header "+g,"aria-hidden":!t,role:"rowgroup"},f()):u?p.createElement("div",{ref:h,className:"ag-header-viewport "+g,role:"rowgroup",tabIndex:-1},p.createElement("div",{ref:a,className:"ag-header-container",role:"presentation"},f())):null},wr=p.memo(F2),E2=()=>{const[e,t]=p.useState(()=>new dt),[o,i]=p.useState(),{context:s}=p.useContext(We),n=p.useRef(null),r=p.useRef(),a=p.useCallback(d=>{if(n.current=d,!d||s.isDestroyed()){r.current=s.destroyBean(r.current);return}r.current=s.createBean(new QC);const u={toggleCss:(h,g)=>t(f=>f.setClass(h,g)),setHeightAndMinHeight:h=>i(h)};r.current.setComp(u,d,d)},[]),l=p.useMemo(()=>"ag-header "+e.toString(),[e]),c=p.useMemo(()=>({height:o,minHeight:o}),[o]);return p.createElement("div",{ref:a,className:l,style:c,role:"presentation"},p.createElement(wr,{pinned:"left"}),p.createElement(wr,{pinned:null}),p.createElement(wr,{pinned:"right"}))},x2=p.memo(E2),P2=(e,t)=>{p.useEffect(()=>{const o=t.current;if(o){const i=o.parentElement;if(i){const s=document.createComment(e);return i.insertBefore(s,o),()=>{s.remove()}}}},[e])},Ro=P2,D2=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new se(o=>{this.resolveInstanceCreated=o}),this.onValueChange=o=>this.updateValue(o),this.value=e.value}getProps(){return{...this.cellEditorParams,initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange}}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){Bn(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(e){this.componentInstance=e,this.resolveInstanceCreated?.(),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isCancelBeforeStart","isCancelAfterEnd","focusIn","focusOut","afterGuiAttached","getValidationErrors","getValidationElement"]}updateValue(e){this.value=e,this.refreshProps()}},M2=e=>{const t=p.useRef(e),o=p.useRef(),i=p.useRef(!1),s=p.useRef(!1),[,n]=p.useState(0);i.current&&(s.current=!0),p.useEffect(()=>(i.current||(o.current=t.current(),i.current=!0),n(r=>r+1),()=>{s.current&&o.current?.()}),[])},T2=e=>{const[t,o]=p.useState(),i=p.useContext(We),{context:s,popupSvc:n,gos:r,editSvc:a}=i,{editDetails:l,cellCtrl:c,eParentCell:d}=e;return M2(()=>{const{compDetails:u}=l,h=r.get("stopEditingWhenCellsLoseFocus");let g,f;if(!s.isDestroyed()){f=s.createBean(a.createPopupEditorWrapper(u.params));const m=f.getGui();if(e.jsChildComp){const S=e.jsChildComp.getGui();S&&m.appendChild(S)}const{column:C,rowNode:v}=c,w={column:C,rowNode:v,type:"popupCellEditor",eventSource:d,ePopup:m,position:l.popupPosition,keepWithinBounds:!0},b=n?.positionPopupByComponent.bind(n,w),y=n?.addPopup({modal:h,eChild:m,closeOnEsc:!0,closedCallback:S=>{c.onPopupEditorClosed(S)},anchorToElement:d,positionCallback:b,ariaOwns:d});g=y?y.hideFunc:void 0,o(f),e.jsChildComp?.afterGuiAttached?.()}return()=>{g?.(),s.destroyBean(f)}}),p.useLayoutEffect(()=>()=>{c.isCellFocused()&&t?.getGui().contains(ve(i))&&d.focus({preventScroll:!0})},[t]),t&&e.wrappedContent?ga.createPortal(e.wrappedContent,t.getGui()):null},hd=p.memo(T2),I2=(e,t,o)=>{const{compProxy:i}=e;o(i);const s=i.getProps(),n=Mi(t);return p.createElement(El.Provider,{value:{setMethods:r=>i.setMethods(r)}},n?p.createElement(t,{...s}):p.createElement(t,{...s,ref:r=>i.setRef(r)}))},gd=(e,t,o)=>e.compProxy?I2(e,t,o):p.createElement(t,{...e.compDetails.params,ref:o}),A2=(e,t,o,i,s)=>{const n=e.compDetails,r=n.componentClass,a=n.componentFromFramework&&!e.popup,l=n.componentFromFramework&&e.popup,c=!n.componentFromFramework&&e.popup;return a?gd(e,r,t):l?p.createElement(hd,{editDetails:e,cellCtrl:i,eParentCell:o,wrappedContent:gd(e,r,t)}):c&&s?p.createElement(hd,{editDetails:e,cellCtrl:i,eParentCell:o,jsChildComp:s}):null},k2=(e,t,o,i,s,n,r=!1)=>{const{context:a}=p.useContext(We),l=p.useCallback(()=>{const c=s.current;if(!c)return;const d=c.getGui();d&&d.parentElement&&d.remove(),a.destroyBean(c),s.current=void 0},[]);p.useEffect(()=>{const c=e!=null&&!r,d=e?.compDetails&&!e.compDetails.componentFromFramework,u=t&&o==null;if(!(c&&d&&!u)){l();return}const g=e.compDetails;if(s.current){const m=s.current,v=m.refresh!=null&&e.force==!1?m.refresh(g.params):!1;if(v===!0||v===void 0)return;l()}g.newAgStackInstance().then(m=>{if(!m)return;const C=m.getGui();if(!C)return;(t?o:n.current).appendChild(C),s.current=m})},[e,t,i,r]),p.useEffect(()=>l,[])},Kg=k2,L2=({cellCtrl:e,parent:t})=>{const o=p.useRef(),i=p.useMemo(()=>{const{loadingComp:s}=e.getDeferLoadingCellRenderer();return s?{value:void 0,compDetails:s,force:!1}:void 0},[e]);if(Kg(i,!1,void 0,1,o,t),i?.compDetails?.componentFromFramework){const s=i.compDetails.componentClass;return p.createElement(s,{...i.compDetails.params})}return p.createElement(p.Fragment,null)},O2=({cellCtrl:e,printLayout:t,editingCell:o})=>{const i=p.useContext(We),{context:s}=i,{column:{colIdSanitised:n},instanceId:r}=e,a=p.useRef(),[l,c]=p.useState(()=>e.isCellRenderer()?void 0:{compDetails:void 0,value:e.getValueToDisplay(),force:!1}),[d,u]=p.useState(),[h,g]=p.useState(1),[f,m]=p.useState(),[C,v]=p.useState(!1),[w,b]=p.useState(!1),[y,S]=p.useState(!1),F=p.useRef(null),[E,M]=p.useState(),T=p.useMemo(()=>e.isForceWrapper(),[e]),G=p.useMemo(()=>e.getCellAriaRole(),[e]),P=p.useRef(null),I=p.useRef(null),A=p.useRef(null),J=p.useRef(),k=p.useRef(),j=p.useRef(),ie=p.useRef([]),$=p.useRef(),Z=p.useRef(),[z,te]=p.useState(0),q=p.useCallback(ee=>{Z.current=ee,te(ae=>ae+1)},[]),oe=l!=null&&(C||y||w)&&(d==null||!!d.popup),de=T||oe,Oe=p.useMemo(()=>e.getCellValueClass(),[e]),Ge=p.useCallback(ee=>{if(k.current=ee,ee){const ae=ee.isCancelBeforeStart&&ee.isCancelBeforeStart();setTimeout(()=>{ae?(e.stopEditing(!0),e.focusCell(!0)):(e.cellEditorAttached(),e.enableEditorTooltipFeature(ee))})}},[e]),je=p.useRef();je.current||(je.current=new as(()=>P.current));const St=!!d&&!d.popup;Kg(l,de,Z.current,z,J,P,St);const yt=p.useRef();p.useLayoutEffect(()=>{const ee=yt.current,ae=l;if(yt.current=l,ee==null||ee.compDetails==null||ae==null||ae.compDetails==null)return;$.current?.refreshVisibility();const Ce=ee.compDetails,ue=ae.compDetails;if(Ce.componentClass!=ue.componentClass||A.current?.refresh==null)return;A.current.refresh(ue.params)!=!0&&g(Re=>Re+1)},[l]),p.useLayoutEffect(()=>{if(!(d&&!d.compDetails.componentFromFramework)||s.isDestroyed())return;const ae=d.compDetails,Ce=d.popup===!0,ue=ae.newAgStackInstance();return ue.then(X=>{if(!X)return;const Re=X.getGui();Ge(X),Ce||((T?j:P).current?.appendChild(Re),X.afterGuiAttached?.()),M(X)}),()=>{ue.then(X=>{const Re=X.getGui();e.disableEditorTooltipFeature(),s.destroyBean(X),Ge(void 0),M(void 0),Re?.remove()})}},[d]);const ge=p.useCallback(ee=>{if(j.current=ee,!ee||s.isDestroyed()||!e.isAlive()){const ue=ie.current;ie.current=[];for(const X of ue)X();return}let ae;const Ce=ue=>{ue&&(ee.insertAdjacentElement("afterbegin",ue.getGui()),ie.current.push(()=>{_t(ue.getGui()),s.destroyBean(ue),$.current===ae&&($.current=void 0)}))};C&&Ce(e.createSelectionCheckbox()),y&&Ce(e.createDndSource()),w&&(ae=e.createRowDragComp(),$.current=ae,ae&&(Ce(ae),ae.refreshVisibility()))},[e,s,y,w,C]),U=p.useCallback(()=>{const ee=!e.isCellSpanning()||I.current,ae=P.current;if(!ae||!ee||!e||!e.isAlive()||s.isDestroyed()){a.current=s.destroyBean(a.current);return}a.current=s.createBean(new Di);const Ce={toggleCss:(X,Re)=>je.current.toggleCss(X,Re),setUserStyles:X=>m(X),getFocusableElement:()=>P.current,setIncludeSelection:X=>v(X),setIncludeRowDrag:X=>b(X),setIncludeDndSource:X=>S(X),setRowResizerElement:X=>{F.current&&_t(F.current),F.current=X,X&&P.current&&P.current.appendChild(X)},getCellEditor:()=>k.current??null,getCellRenderer:()=>A.current??J.current,getParentOfValue:()=>Z.current??j.current??P.current,setRenderDetails:(X,Re,He)=>{const Co=()=>{c(tt=>tt?.compDetails!==X||tt?.value!==Re||tt?.force!==He?{value:Re,compDetails:X,force:He}:tt)};if(X?.params?.deferRender&&!e.rowNode.group){const{loadingComp:tt,onReady:Ko}=e.getDeferLoadingCellRenderer();if(tt){c({value:void 0,compDetails:tt,force:!1}),Ko.then(()=>qT(Co));return}}Co()},setEditDetails:(X,Re,He,Co)=>{if(X){let tt;X.componentFromFramework&&(Co?tt=new D2(X.params,()=>g(Ko=>Ko+1)):xl()),u({compDetails:X,popup:Re,popupPosition:He,compProxy:tt}),Re||c(void 0)}else e.hasBrowserFocus()&&Ce.getFocusableElement().focus({preventScroll:!0}),k.current=void 0,u(void 0)},refreshEditStyles:(X,Re)=>{if(!P.current)return;const{current:He}=je;He.toggleCss("ag-cell-value",!de),He.toggleCss("ag-cell-inline-editing",!!X&&!Re),He.toggleCss("ag-cell-popup-editing",!!X&&!!Re),He.toggleCss("ag-cell-not-inline-editing",!X||!!Re)}},ue=j.current||void 0;e.setComp(Ce,ae,I.current??void 0,ue,t,o,a.current)},[]),ne=p.useCallback(ee=>{P.current=ee,U()},[]),V=p.useCallback(ee=>{I.current=ee,U()},[]),Q=p.useMemo(()=>!!(l?.compDetails?.componentFromFramework&&Mi(l.compDetails.componentClass)),[l]);p.useLayoutEffect(()=>{if(!P.current)return;const{current:ee}=je;ee.toggleCss("ag-cell-value",!de),ee.toggleCss("ag-cell-inline-editing",!!d&&!d.popup),ee.toggleCss("ag-cell-popup-editing",!!d&&!!d.popup),ee.toggleCss("ag-cell-not-inline-editing",!d||!!d.popup)});const le=()=>{const{compDetails:ee,value:ae}=l;if(!ee)return ae?.toString?.()??ae;if(ee.componentFromFramework){const Ce=ee.componentClass;return p.createElement(p.Suspense,{fallback:p.createElement(L2,{cellCtrl:e,parent:P})},Q?p.createElement(Ce,{...ee.params,key:h}):p.createElement(Ce,{...ee.params,key:h,ref:A}))}},Me=()=>{const ee=()=>l==null?null:de?p.createElement("span",{role:"presentation",id:`cell-${r}`,className:Oe,ref:q},le()):le(),ae=Ce=>A2(Ce,Ge,P.current,e,E);return d!=null?d.popup?p.createElement(p.Fragment,null,ee(),ae(d)):ae(d):ee()},Ae=()=>p.createElement("div",{ref:ne,style:f,role:G,"col-id":n},de?p.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:ge},Me()):Me());return e.isCellSpanning()?p.createElement("div",{ref:V,className:"ag-spanned-cell-wrapper",role:"presentation"},Ae()):Ae()},G2=p.memo(O2),H2=({rowCtrl:e,containerType:t})=>{const{context:o,gos:i,editSvc:s}=p.useContext(We),n=p.useContext(Ng)==="default",r=p.useRef(),a=p.useRef(e.getDomOrder()),l=e.isFullWidth(),c=e.rowNode.displayed,[d,u]=p.useState(()=>c?e.rowNode.getRowIndexString():null),[h,g]=p.useState(()=>e.rowId),[f,m]=p.useState(()=>e.businessKey),[C,v]=p.useState(()=>e.rowStyles),w=p.useRef(null),[b,y]=p.useState(()=>null),[S,F]=p.useState(),[E,M]=p.useState(()=>c?e.getInitialRowTop(t):void 0),[T,G]=p.useState(()=>c?e.getInitialTransform(t):void 0),P=p.useRef(null),I=p.useRef(),A=p.useRef(),J=p.useRef(!1),[k,j]=p.useState(0);p.useEffect(()=>{if(J.current||!S||k>10)return;const ge=P.current?.firstChild;ge?(e.setupDetailRowAutoHeight(ge),J.current=!0):j(U=>U+1)},[S,k]);const ie=p.useRef();ie.current||(ie.current=new as(()=>P.current));const $=p.useRef(()=>{}),Z=p.useCallback(ge=>($.current=ge,()=>{$.current=()=>{}}),[]),z=jT(Z,()=>w.current,[]),te=n?z:b,q=p.useCallback(ge=>{if(P.current=ge,r.current=ge?o.createBean(new Di):o.destroyBean(r.current),!ge){e.unsetComp(t);return}if(!e.isAlive()||o.isDestroyed())return;const U={setTop:M,setTransform:G,toggleCss:(ne,V)=>ie.current.toggleCss(ne,V),setDomOrder:ne=>a.current=ne,setRowIndex:u,setRowId:g,setRowBusinessKey:m,setUserStyles:v,setCellCtrls:(ne,V)=>{const Q=w.current,le=mn(Q,ne,a.current);le!==Q&&(w.current=le,n?$.current():rs(V,()=>y(le)))},showFullWidth:ne=>{A.current=ne.params,F(ne)},getFullWidthCellRenderer:()=>I.current,getFullWidthCellRendererParams:()=>A.current,refreshFullWidth:ne=>{const V=ne();return A.current=V,je.current?(F(Q=>({...Q,params:V})),!0):!I.current||!I.current.refresh?!1:I.current.refresh(V)}};e.setComp(U,ge,t,r.current)},[]);p.useLayoutEffect(()=>ps(S,o,P.current,I),[S]);const oe=p.useMemo(()=>{const ge={top:E,transform:T};return Object.assign(ge,C),ge},[E,T,C]),de=l&&S?.componentFromFramework,Oe=!l&&te!=null,Ge=p.useMemo(()=>!!(S?.componentFromFramework&&Mi(S.componentClass)),[S]),je=p.useRef(!1);p.useEffect(()=>{je.current=Ge&&!!S&&!!i.get("reactiveCustomComponents")},[Ge,S]);const St=()=>te?.map(ge=>p.createElement(G2,{cellCtrl:ge,editingCell:s?.isEditing(ge,{withOpenEditor:!0})??!1,printLayout:e.printLayout,key:ge.instanceId})),yt=()=>{const ge=S.componentClass;return Ge?p.createElement(ge,{...S.params}):p.createElement(ge,{...S.params,ref:I})};return p.createElement("div",{ref:q,role:"row",style:oe,"row-index":d,"row-id":h,"row-business-key":f},Oe?St():de?yt():null)},pd=p.memo(H2),B2=({name:e})=>{const{context:t,gos:o}=p.useContext(We),i=p.useMemo(()=>us(e),[e]),s=p.useRef(null),n=p.useRef(null),r=p.useRef(null),a=p.useRef([]),l=p.useRef([]),[c,d]=p.useState(()=>[]),u=!!o.get("enableCellSpan")&&!!i.getSpannedRowCtrls,h=p.useRef([]),g=p.useRef([]),[f,m]=p.useState(()=>[]),C=p.useRef(!1),v=p.useRef(),w=p.useMemo(()=>at("ag-viewport",Ku(e)),[e]),b=p.useMemo(()=>at(qu(e)),[e]),y=p.useMemo(()=>at("ag-spanning-container",wv(e)),[e]),S=i.type==="center"||u,F=S?s:n;Ro(" AG Row Container "+e+" ",F);const E=p.useCallback(()=>{const k=!S||s.current!=null,j=n.current!=null,ie=!u||r.current!=null;return k&&j&&ie},[]),M=p.useCallback(()=>s.current==null&&n.current==null&&r.current==null,[]),T=p.useCallback(()=>{if(M()&&(v.current=t.destroyBean(v.current)),!t.isDestroyed()&&E()){const k=$=>{const Z=mn(l.current,a.current,C.current);Z!==l.current&&(l.current=Z,rs($,()=>d(Z)))},j=$=>{const Z=mn(g.current,h.current,C.current);Z!==g.current&&(g.current=Z,rs($,()=>m(Z)))},ie={setHorizontalScroll:$=>{s.current&&(s.current.scrollLeft=$)},setViewportHeight:$=>{s.current&&(s.current.style.height=$)},setRowCtrls:({rowCtrls:$,useFlushSync:Z})=>{const z=!!Z&&a.current.length>0&&$.length>0;a.current=$,k(z)},setSpannedRowCtrls:($,Z)=>{const z=!!Z&&h.current.length>0&&$.length>0;h.current=$,j(z)},setDomOrder:$=>{C.current!=$&&(C.current=$,k(!1))},setContainerWidth:$=>{n.current&&(n.current.style.width=$)},setOffsetTop:$=>{n.current&&(n.current.style.transform=`translateY(${$})`)}};v.current=t.createBean(new Mv(e)),v.current.setComp(ie,n.current,r.current??void 0,s.current)}},[E,M]),G=p.useCallback(k=>{n.current=k,T()},[T]),P=p.useCallback(k=>{r.current=k,T()},[T]),I=p.useCallback(k=>{s.current=k,T()},[T]),A=()=>p.createElement("div",{className:b,ref:G,role:S?"presentation":"rowgroup"},c.map(k=>p.createElement(pd,{rowCtrl:k,containerType:i.type,key:k.instanceId})));if(!S)return A();const J=()=>p.createElement("div",{className:y,ref:P,role:"presentation"},f.map(k=>p.createElement(pd,{rowCtrl:k,containerType:i.type,key:k.instanceId})));return p.createElement("div",{className:w,ref:I,role:"rowgroup"},A(),u?J():null)},V2=p.memo(B2),N2=()=>{const e=p.useContext(We),{context:t,overlays:o}=e,[i,s]=p.useState(""),[n,r]=p.useState(0),[a,l]=p.useState(0),[c,d]=p.useState("0px"),[u,h]=p.useState("0px"),[g,f]=p.useState("100%"),[m,C]=p.useState("0px"),[v,w]=p.useState("0px"),[b,y]=p.useState("100%"),[S,F]=p.useState(!0),[E,M]=p.useState(!0),[T,G]=p.useState(null),[P,I]=p.useState(""),[A,J]=p.useState(null),[k,j]=p.useState("ag-layout-normal"),ie=p.useRef();ie.current||(ie.current=new as(()=>$.current));const $=p.useRef(null),Z=p.useRef(null),z=p.useRef(null),te=p.useRef(null),q=p.useRef(null),oe=p.useRef(null),de=p.useRef(null),Oe=p.useRef([]),Ge=p.useRef([]);Ro(" AG Grid Body ",$),Ro(" AG Pinned Top ",Z),Ro(" AG Sticky Top ",z),Ro(" AG Middle ",oe),Ro(" AG Pinned Bottom ",de);const je=p.useCallback(ue=>{if($.current=ue,!ue||t.isDestroyed()){Oe.current=t.destroyBeans(Oe.current);for(const be of Ge.current)be();Ge.current=[];return}const X=(be,ot)=>{be.appendChild(ot),Ge.current.push(()=>ot.remove())},Re=be=>{const ot=t.createBean(new be);return Oe.current.push(ot),ot},He=(be,ot,hp)=>{X(be,document.createComment(hp)),X(be,Re(ot).getGui())};He(ue,rv," AG Fake Horizontal Scroll ");const Co=o?.getOverlayWrapperCompClass();Co&&He(ue,Co," AG Overlay Wrapper "),q.current&&He(q.current,lv," AG Fake Vertical Scroll ");const tt={setRowAnimationCssOnBodyViewport:s,setColumnCount:be=>{$.current&&Wp($.current,be)},setRowCount:be=>{$.current&&Vp($.current,be)},setTopHeight:r,setBottomHeight:l,setStickyTopHeight:d,setStickyTopTop:h,setStickyTopWidth:f,setTopInvisible:F,setBottomInvisible:M,setColumnMovingCss:(be,ot)=>ie.current.toggleCss(be,ot),updateLayoutClasses:j,setAlwaysVerticalScrollClass:G,setPinnedTopBottomOverflowY:I,setCellSelectableCss:(be,ot)=>J(ot?be:null),setBodyViewportWidth:be=>{oe.current&&(oe.current.style.width=be)},registerBodyViewportResizeListener:be=>{if(oe.current){const ot=Kt(e,oe.current,be);Ge.current.push(()=>ot())}},setStickyBottomHeight:C,setStickyBottomBottom:w,setStickyBottomWidth:y,setGridRootRole:be=>ue.setAttribute("role",be)},Ko=t.createBean(new kv);Oe.current.push(Ko),Ko.setComp(tt,ue,oe.current,Z.current,de.current,z.current,te.current)},[]),St=p.useMemo(()=>at("ag-root","ag-unselectable",k),[k]),yt=p.useMemo(()=>at("ag-body-viewport",i,k,T,A),[i,k,T,A]),ge=p.useMemo(()=>at("ag-body",k),[k]),U=p.useMemo(()=>at("ag-floating-top",S?"ag-invisible":null,A),[A,S]),ne=p.useMemo(()=>at("ag-sticky-top",A),[A]),V=p.useMemo(()=>at("ag-sticky-bottom",m==="0px"?"ag-invisible":null,A),[A,m]),Q=p.useMemo(()=>at("ag-floating-bottom",E?"ag-invisible":null,A),[A,E]),le=p.useMemo(()=>({height:n,minHeight:n,overflowY:P}),[n,P]),Me=p.useMemo(()=>({height:c,top:u,width:g}),[c,u,g]),Ae=p.useMemo(()=>({height:m,bottom:v,width:b}),[m,v,b]),ee=p.useMemo(()=>({height:a,minHeight:a,overflowY:P}),[a,P]),ae=ue=>p.createElement(V2,{name:ue,key:`${ue}-container`}),Ce=({section:ue,children:X,className:Re,style:He})=>p.createElement("div",{ref:ue,className:Re,role:"presentation",style:He},X.map(ae));return p.createElement("div",{ref:je,className:St},p.createElement(x2,null),Ce({section:Z,className:U,style:le,children:["topLeft","topCenter","topRight","topFullWidth"]}),p.createElement("div",{className:ge,ref:q,role:"presentation"},Ce({section:oe,className:yt,children:["left","center","right","fullWidth"]})),Ce({section:z,className:ne,style:Me,children:["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"]}),Ce({section:te,className:V,style:Ae,children:["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"]}),Ce({section:de,className:Q,style:ee,children:["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"]}))},W2=p.memo(N2),z2=(e,t)=>{const{children:o,eFocusableElement:i,onTabKeyDown:s,gridCtrl:n,forceFocusOutWhenTabGuardsAreEmpty:r,isEmpty:a}=e,{context:l}=p.useContext(We),c=p.useRef(null),d=p.useRef(null),u=p.useRef(),h=v=>{const w=v==null?void 0:parseInt(v,10).toString();for(const b of[c,d])w===void 0?b.current?.removeAttribute("tabindex"):b.current?.setAttribute("tabindex",w)};p.useImperativeHandle(t,()=>({forceFocusOutOfContainer(v){u.current?.forceFocusOutOfContainer(v)}}));const g=p.useCallback(()=>{const v=c.current,w=d.current;if(!v&&!w||l.isDestroyed()){u.current=l.destroyBean(u.current);return}if(v&&w){const b={setTabIndex:h};u.current=l.createBean(new UT({comp:b,eTopGuard:v,eBottomGuard:w,eFocusableElement:i,onTabKeyDown:s,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:y=>n.focusInnerElement(y),isEmpty:a}))}},[]),f=p.useCallback(v=>{c.current=v,g()},[g]),m=p.useCallback(v=>{d.current=v,g()},[g]),C=v=>{const w=v==="top"?pi.TAB_GUARD_TOP:pi.TAB_GUARD_BOTTOM;return p.createElement("div",{className:`${pi.TAB_GUARD} ${w}`,role:"presentation",ref:v==="top"?f:m})};return p.createElement(p.Fragment,null,C("top"),o,C("bottom"))},_2=p.forwardRef(z2),U2=p.memo(_2),$2=({context:e})=>{const[t,o]=p.useState(""),[i,s]=p.useState(""),[n,r]=p.useState(null),[a,l]=p.useState(null),[c,d]=p.useState(!1),[u,h]=p.useState(),g=p.useRef(),f=p.useRef(null),m=p.useRef(),[C,v]=p.useState(null),w=p.useRef(()=>{}),b=p.useRef(),y=p.useRef([]),S=p.useCallback(()=>{},[]);Ro(" AG Grid ",f);const F=p.useCallback(I=>{if(f.current=I,g.current=I?e.createBean(new Bv):e.destroyBean(g.current),!I||e.isDestroyed())return;const A=g.current;w.current=A.focusInnerElement.bind(A);const J={destroyGridUi:()=>{},setRtlClass:o,forceFocusOutOfContainer:k=>{if(!k&&b.current?.isDisplayed()){b.current.forceFocusOutOfContainer(k);return}m.current?.forceFocusOutOfContainer(k)},updateLayoutClasses:s,getFocusableContainers:()=>{const k=[],j=[],ie=f.current?.querySelector(".ag-root");for(const Z of y.current){if(!Z.isDisplayed())continue;const z=Z.getFocusableContainerName();if(z==="rowGroupToolbar"||z==="pivotToolbar"){k.push(Z);continue}j.push(Z)}const $=[...k];return ie&&$.push({getGui:()=>ie,getFocusableContainerName:()=>"gridBody"}),$.push(...j),$},setCursor:r,setUserSelect:l};A.setComp(J,I,I),d(!0)},[]);p.useEffect(()=>{const I=g.current,A=f.current;if(!u||!I||!C||!A||e.isDestroyed())return;const J=[];y.current=[],b.current=void 0;const{watermarkSelector:k,paginationSelector:j,sideBarSelector:ie,statusBarSelector:$,gridHeaderDropZonesSelector:Z}=I.getOptionalSelectors(),z=[];if(Z){const q=e.createBean(new Z.component),oe=q.getGui();A.insertAdjacentElement("afterbegin",oe),z.push(oe),J.push(q),y.current.push(...q.getFocusableContainers?.()??[])}if(ie){const q=e.createBean(new ie.component),oe=q.getGui(),de=C.querySelector(".ag-tab-guard-bottom");de&&(de.insertAdjacentElement("beforebegin",oe),z.push(oe)),J.push(q),y.current.push(q)}const te=q=>{const oe=e.createBean(new q),de=oe.getGui();return A.insertAdjacentElement("beforeend",de),z.push(de),J.push(oe),oe};if($){const q=te($.component);y.current.push(q)}if(j){const q=te(j.component);b.current=q,y.current.push(q)}return k&&te(k.component),()=>{e.destroyBeans(J),y.current=[],b.current=void 0;for(const q of z)q.remove()}},[u,C,e]);const E=p.useMemo(()=>at("ag-root-wrapper",t,i),[t,i]),M=p.useMemo(()=>at("ag-root-wrapper-body","ag-focus-managed",i),[i]),T=p.useMemo(()=>({userSelect:a??"",WebkitUserSelect:a??"",cursor:n??""}),[a,n]),G=p.useCallback(I=>{m.current=I,h(I!==null)},[]),P=p.useCallback(()=>!g.current?.isFocusable(),[]);return p.createElement("div",{ref:F,className:E,style:T,role:"presentation"},p.createElement("div",{className:M,ref:v,role:"presentation"},c&&C&&!e.isDestroyed()&&p.createElement(We.Provider,{value:e.getBeans()},p.createElement(U2,{ref:G,eFocusableElement:C,onTabKeyDown:S,gridCtrl:g.current,forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:P},p.createElement(W2,null)))))},K2=p.memo($2),q2=class extends x{postConstruct(){if(this.beans.colAutosize){const e=this.queueResizeOperationsForTick.bind(this);this.addManagedEventListeners({rowExpansionStateChanged:e,expandOrCollapseAll:e,cellValueChanged:e,rowNodeDataChanged:e,rowDataUpdated:e})}}queueResizeOperationsForTick(){const e=this.beans.colAutosize;e.shouldQueueResizeOperations=!0,setTimeout(()=>{e.processResizeOperations()},0)}areHeaderCellsRendered(){return this.beans.ctrlsSvc.getHeaderRowContainerCtrls().every(e=>e.getAllCtrls().every(t=>t.areCellsRendered()))}areCellsRendered(){return this.beans.rowRenderer.getAllRowCtrls().every(e=>e.isRowRendered()&&e.getAllCellCtrls().every(t=>!!t.eGui))}},j2=typeof window>"u"?p.useEffect:p.useLayoutEffect,qg={setGridApi:void 0,maxComponentCreationTimeMs:void 0,children:void 0},Y2={gridOptions:void 0,modules:void 0,containerStyle:void 0,className:void 0,passGridApi:void 0,componentWrappingElement:void 0,...qg},jg=new Set(Object.keys(Y2)),Q2=new Set(Object.keys(qg)),Yg=e=>{const t=p.useContext(g2),o=p.useContext(p2),i=p.useRef(),s=p.useRef(null),n=p.useRef(null),r=p.useRef([]),a=p.useRef([]),l=p.useRef(e),c=p.useRef(),d=p.useRef(),u=p.useRef(!1),[h,g]=p.useState(void 0),[,f]=p.useState(0),m=p.useRef(),C=S=>{const F=s.current?.classList,E=(M="")=>M.trim().split(/\s+/g).filter(Boolean);if(m.current!==S){for(const M of E(m.current))F?.contains(M)&&F.remove(M);for(const M of E(S))F?.contains(M)||F?.add(M);m.current=S}};j2(()=>{C(e.className)},[e.className]);const v=p.useCallback(S=>{if(s.current=S,C(e.className),!S){for(const k of r.current)k();r.current.length=0;return}const F=[...e.modules??[],...t??[]];o&&Zd(F)?.setLicenseKey(o),n.current||(n.current=new h2(()=>f(k=>k+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),r.current.push(()=>{n.current?.destroy(),n.current=null}));const E=qf(e.gridOptions,e,Object.keys(e).filter(k=>!jg.has(k))),M=()=>{if(u.current){const k=()=>c.current?.shouldQueueUpdates()?void 0:a.current.shift();let j=k();for(;j;)j(),j=k()}},T=new eI(M);c.current=T;const G=new q2,P={providedBeanInstances:{frameworkCompWrapper:new J2(n.current,E),renderStatus:G},modules:F,frameworkOverrides:T,setThemeOnGridDiv:!0},I=k=>{g(k),k.createBean(G),r.current.push(()=>{k.destroy()}),k.getBean("ctrlsSvc").whenReady({addDestroyFunc:j=>{r.current.push(j)}},()=>{if(k.isDestroyed())return;const j=i.current;j&&e.passGridApi?.(j)})},A=k=>{k.getBean("ctrlsSvc").whenReady({addDestroyFunc:j=>{r.current.push(j)}},()=>{for(const j of a.current)j();a.current.length=0,u.current=!0})},J=new A1;E.gridId??(E.gridId=d.current),i.current=J.create(S,E,I,A,P),r.current.push(()=>{i.current=void 0}),i.current&&(d.current=i.current.getGridId())},[]),w=p.useMemo(()=>({height:"100%",...e.containerStyle||{}}),[e.containerStyle]),b=p.useCallback(S=>{u.current&&!c.current?.shouldQueueUpdates()?S():a.current.push(S)},[]);p.useEffect(()=>{const S=Z2(l.current,e);l.current=e,b(()=>{i.current&&jf(S,i.current)})},[e]);const y=!p.useSyncExternalStore||As(e,"renderingMode")==="legacy"?"legacy":"default";return p.createElement("div",{style:w,ref:v},p.createElement(Ng.Provider,{value:y},h&&!h.isDestroyed()?p.createElement(K2,{key:h.instanceId,context:h}):null,n.current?.getPortals()??null))};function Z2(e,t){const o={};for(const i of Object.keys(t)){if(jg.has(i)){Q2.has(i)&&D(274,{prop:i});continue}const s=t[i];e[i]!==s&&(o[i]=s)}return o}var J2=class extends _T{constructor(e,t){super(),this.parent=e,this.gridOptions=t}createWrapper(e,t){const o=this.gridOptions;if(As(o,"reactiveCustomComponents")){const r=(a=>{switch(a){case"filter":return As(o,"enableFilterHandlers")?i2:o2;case"floatingFilterComponent":return As(o,"enableFilterHandlers")?r2:n2;case"dateComponent":return e2;case"dragAndDropImageComponent":return t2;case"loadingOverlayComponent":case"noRowsOverlayComponent":case"activeOverlay":return XT;case"statusPanel":return c2;case"toolPanel":return d2;case"menuItem":return l2;case"cellRenderer":return JT;case"innerHeaderComponent":return a2}})(t.name);if(r)return new r(e,this.parent,t)}else switch(t.name){case"filter":case"floatingFilterComponent":case"dateComponent":case"dragAndDropImageComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"activeOverlay":case"statusPanel":case"toolPanel":case"menuItem":case"cellRenderer":xl();break}const s=!t.cellRenderer&&t.name!=="toolPanel";return new Ug(e,this.parent,t,s)}},X2=p.forwardRef((e,t)=>{const o=p.useContext(We),{registry:i,context:s,gos:n,rowModel:r}=o,[a,l]=p.useState(()=>new dt),[c,d]=p.useState(()=>new dt),[u,h]=p.useState(),[g,f]=p.useState(),m=p.useRef(),C=p.useRef(null),v=p.useRef(),w=p.useMemo(()=>Rf(e.api.getGridId(),u?.rowModelType??"clientSide"),[e]),b=p.useMemo(()=>a.toString()+" ag-details-row",[a]),y=p.useMemo(()=>c.toString()+" ag-details-grid",[c]);t&&p.useImperativeHandle(t,()=>({refresh(){return m.current?.refresh()??!1}})),e.template&&D(230);const S=p.useCallback(E=>{if(C.current=E,!E||s.isDestroyed()){m.current=s.destroyBean(m.current),v.current?.();return}const M={toggleCss:(G,P)=>l(I=>I.setClass(G,P)),toggleDetailGridCss:(G,P)=>d(I=>I.setClass(G,P)),setDetailGrid:G=>h(G),setRowData:G=>f(G),getGui:()=>C.current},T=i.createDynamicBean("detailCellRendererCtrl",!0);if(T&&(s.createBean(T),T.init(M,e),m.current=T,n.get("detailRowAutoHeight"))){const G=()=>{if(C.current==null)return;const P=C.current.clientHeight;P!=null&&P>0&&setTimeout(()=>{e.node.setRowHeight(P),(Se(n)||xi(n))&&r.onRowHeightChanged()},0)};v.current=Kt(o,E,G),G()}},[]),F=p.useCallback(E=>{m.current?.registerDetailWithMaster(E)},[]);return p.createElement("div",{className:b,ref:S},u&&p.createElement(Yg,{className:y,...u,modules:w,rowData:g,passGridApi:F}))}),eI=class extends Jh{constructor(e){super("react"),this.processQueuedUpdates=e,this.queueUpdates=!1,this.renderingEngine="react",this.frameworkComponents={agGroupCellRenderer:dd,agGroupRowRenderer:dd,agDetailCellRenderer:X2},this.wrapIncoming=(t,o)=>o==="ensureVisible"?KT(t):t()}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}getLockOnRefresh(){this.queueUpdates=!0}releaseLockOnRefresh(){this.queueUpdates=!1,this.processQueuedUpdates()}shouldQueueUpdates(){return this.queueUpdates}runWhenReadyAsync(){return $T()}},Qg=class extends p.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=e=>{this.api=e;for(const t of this.apiListeners)t(e)}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return p.createElement(Yg,{...this.props,passGridApi:this.setGridApi})}},Zg=(e=>(e.Dropdown="dropdown",e.Menu="menu",e))(Zg||{}),Vt=(e=>(e.Click="click",e.Hover="hover",e.ContextMenu="contextMenu",e))(Vt||{}),Cn=(e=>(e.Item="item",e.Divider="divider",e.PlainText="plainText",e))(Cn||{});const tI=fe("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),oI=fe("z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none"),da=fe("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small-text h-[34px] rounded text-primary",bn.menuItem),ua="opacity-75 !cursor-not-allowed",Jg="text-error",iI="my-1 border-t border-hover border-secondary",Zo=4,sI=H.jsx(vn.IconChevronRight,{size:14}),Xg=({ariaLabel:e,className:t,size:o=24,onClose:i,...s})=>H.jsx(Rd,{"aria-label":e,className:Mt.mergeClasses(t,"w-auto h-auto"),onClick:i,icon:H.jsx(vn.IconX,{size:o}),...s}),nI='[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"]',rI=["ArrowDown","ArrowUp","Home","End"],fd=e=>Array.from(e.querySelectorAll(nI)).filter(t=>!t.hasAttribute("disabled")&&t.getAttribute("aria-disabled")!=="true"),ep=e=>e.ownerDocument.defaultView?.getComputedStyle(e).direction==="rtl",aI=e=>ep(e)?"ArrowLeft":"ArrowRight",lI=e=>ep(e)?"ArrowRight":"ArrowLeft",cI=e=>e instanceof HTMLElement&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable),dI=(e,t,o)=>{if(e==="Home")return 0;if(e==="End")return o-1;const i=e==="ArrowDown"?1:-1;return t===-1?i===1?0:o-1:(t+i+o)%o};function tp(e,t="menu",o=!1,i){const[s,n]=p.useState(!1),r=pe.useFloatingNodeId(),{refs:a,elements:l,floatingStyles:c,context:d}=pe.useFloating({nodeId:r,placement:"right-start",open:s,onOpenChange:n,whileElementsMounted:pe.autoUpdate,middleware:[pe.offset({mainAxis:0,crossAxis:-4}),pe.flip({padding:e}),pe.shift({padding:e})]}),u=pe.useHover(d,{enabled:!o,move:!1,handleClose:pe.safePolygon(),delay:{open:80,close:80}}),h=pe.useClick(d,{enabled:!o}),g=pe.useDismiss(d,{ancestorScroll:!0,bubbles:{escapeKey:!1,outsidePress:!0}}),f=pe.useRole(d,{role:t}),{getReferenceProps:m,getFloatingProps:C}=pe.useInteractions([u,h,g,f]),[v,w]=p.useState(!1),b=l.floating;p.useEffect(()=>{!s||!v||b==null||(fd(b)[0]?.focus(),w(!1))},[s,v,b]);const y=p.useCallback(M=>{o||!(M.key===aI(M.currentTarget)||M.key==="Enter"||M.key===" ")||(M.preventDefault(),M.stopPropagation(),n(!0),w(!0))},[o]),S=p.useCallback(M=>{if(M.defaultPrevented||cI(M.target))return;if(M.key===lI(M.currentTarget)){M.preventDefault(),M.stopPropagation(),n(!1),a.domReference.current?.focus();return}if(!rI.includes(M.key))return;M.preventDefault(),M.stopPropagation();const T=fd(M.currentTarget);if(T.length===0)return;const G=M.currentTarget.ownerDocument.activeElement,P=T.findIndex(I=>I===G);T[dI(M.key,P,T.length)]?.focus()},[a.domReference]),F=p.useCallback(M=>m({...M,onKeyDown:y}),[m,y]),E=p.useCallback(M=>C({...M,onKeyDown:S}),[C,S]);return{isOpen:s,nodeId:r,refs:a,floatingStyles:c,context:d,getReferenceProps:F,getFloatingProps:E}}const uI="rounded bg-layer-0 shadow",op=({refs:e,floatingStyles:t,context:o,getFloatingProps:i,role:s,surfaceClassName:n,className:r,children:a})=>{const l=Fd();return H.jsx(pe.FloatingPortal,{children:H.jsx(pe.FloatingFocusManager,{context:o,modal:!1,initialFocus:-1,returnFocus:!0,children:H.jsx("div",{ref:e.setFloating,style:t,role:s,className:fe("z-floating overflow-auto text-primary focus-visible:outline-none",n??uI,l,r),...i(),children:a})})})},hI=({item:e,onRootClose:t})=>{const{isOpen:o,refs:i,floatingStyles:s,context:n,getReferenceProps:r,getFloatingProps:a}=tp(Zo,"menu",!!e.disabled),l=p.useCallback(c=>d=>{c.disabled||(c.onClick?.({key:c.key,domEvent:d}),t())},[t]);return H.jsxs(H.Fragment,{children:[H.jsxs("button",{ref:i.setReference,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":o,"aria-disabled":!!e.disabled,disabled:e.disabled,className:fe(da,e.disabled&&ua,e.className),...r(),children:[e.icon&&H.jsx("span",{className:fe(e.disabled&&"text-secondary"),children:H.jsx(zs,{icon:e.icon})}),H.jsx("span",{className:fe("flex-1 truncate text-start",e.disabled&&"text-secondary"),children:e.label}),H.jsx("span",{className:fe("ml-auto shrink-0",e.disabled&&"text-secondary"),children:sI})]}),o&&H.jsx(op,{refs:i,floatingStyles:s,context:n,getFloatingProps:a,role:"menu",className:"w-max",children:H.jsx("div",{role:"none",className:fe("py-1",bn.dropdownList),children:e.children.map(c=>H.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!c.disabled,disabled:c.disabled,className:fe(da,c.disabled&&ua,c.danger&&Jg,c.className),onClick:l(c),children:[c.icon&&H.jsx("span",{className:fe(c.danger&&"text-error",c.disabled&&"text-secondary"),children:H.jsx(zs,{icon:c.icon})}),H.jsx("span",{className:fe("flex-1 truncate text-start",c.danger&&"text-error",c.disabled&&"text-secondary"),children:c.label})]},c.key))})})]})},gI=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,ha=({children:e,items:t,onItemClick:o,menuHeader:i,menuFooter:s,renderOverlay:n,trigger:r=[Vt.Click],placement:a,disabled:l=!1,open:c,defaultOpen:d=!1,onOpenChange:u,closable:h=!1,onClose:g,className:f,overlayContentClassName:m,separatorClassName:C,listClassName:v,outsidePressIgnoreRef:w,outsideClosable:b=!0,allowedPlacements:y,anchorToMouse:S=!1,matchReferenceWidth:F=!0,maxDropdownHeight:E})=>{const[M,T]=p.useState(d),G=c!==void 0,P=G?!!c:M,I=p.useRef(null),A=p.useCallback(U=>{G||T(U),u?.(U)},[G,u]),J=p.useId(),k=a===void 0,{refs:j,floatingStyles:ie,context:$}=pe.useFloating({placement:a,open:P,onOpenChange:A,whileElementsMounted:pe.autoUpdate,middleware:[pe.offset({mainAxis:Zo,crossAxis:0}),k?pe.autoPlacement({alignment:"start",crossAxis:!0,padding:Zo,allowedPlacements:y}):pe.flip({padding:Zo}),pe.shift({padding:Zo}),pe.size({padding:Zo,apply({availableWidth:U,availableHeight:ne,elements:V}){const Q=V.floating,le=gI(V.reference);Q.style.setProperty("--fui-available-height",`${Math.floor(ne)}px`),Q.style.setProperty("--reference-width",F?`${Math.round(le)}px`:"0px"),F?Q.style.minWidth=`${Math.round(le)}px`:Q.style.removeProperty("min-width"),Q.style.maxWidth=`${Math.floor(U)}px`;const Me=Math.floor(ne);Q.style.maxHeight=`${E?Math.min(Me,E):Me}px`}})]}),Z=pe.useClick($,{enabled:r.includes(Vt.Click)&&!l}),z=pe.useHover($,{enabled:r.includes(Vt.Hover)&&!l,move:!1,restMs:40,delay:{open:80,close:80}}),te=pe.useDismiss($,{bubbles:!0,referencePress:!1,outsidePress:U=>{if(!b)return!1;const ne=U.target;return!(w?.current&&ne instanceof Node&&w.current.contains(ne))}}),q=pe.useRole($,{role:"menu"}),{getReferenceProps:oe,getFloatingProps:de}=pe.useInteractions([Z,z,te,q]),Oe=p.useCallback((U,ne)=>{j.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:U,y:ne,top:ne,left:U,right:U,bottom:ne})})},[j]),Ge=p.useCallback(U=>{!r.includes(Vt.ContextMenu)||l||(U.preventDefault(),S&&(Oe(U.clientX,U.clientY),I.current=document.elementFromPoint(U.clientX,U.clientY)),A(!0))},[S,l,A,Oe,r]),je=p.useCallback(U=>{!S||l||(r.includes(Vt.ContextMenu)&&P&&A(!1),Oe(U.clientX,U.clientY),I.current=document.elementFromPoint(U.clientX,U.clientY))},[S,l,Oe,P,r,A]);p.useEffect(()=>{l&&P&&A(!1)},[l,P,A]);const St=p.useCallback(U=>ne=>{U.disabled||(U.onClick?.({key:U.key,domEvent:ne}),o?.({key:U.key,domEvent:ne}),A(!1))},[o,A]),yt=p.useMemo(()=>n?n():t?H.jsxs(H.Fragment,{children:[i&&H.jsx(H.Fragment,{children:typeof i=="function"?i():i}),H.jsx("div",{role:"none",className:Mt.mergeClasses("py-1",m,bn.dropdownList),"aria-label":"dropdown",children:t.map(U=>U.type===Cn.Divider?H.jsx("div",{role:"separator",className:Mt.mergeClasses(iI,C)},U.key):U.type===Cn.PlainText?H.jsx("div",{className:Mt.mergeClasses("px-3 py-2 text-secondary dial-caption-text",U.className),children:U.label},U.key):U.children?.length?H.jsx(hI,{item:U,onRootClose:()=>A(!1)},U.key):H.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!U.disabled,className:fe(da,U.disabled&&ua,U.danger&&Jg,U.className),disabled:U.disabled,onClick:St(U),children:[U.icon&&H.jsx("span",{className:fe(U.danger&&"text-error",U.disabled&&"text-secondary"),children:H.jsx(zs,{icon:U.icon})}),H.jsx("span",{className:fe("flex-1 truncate text-start",U.danger&&"text-error",U.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:U.label})]},U.key))}),s&&H.jsx(H.Fragment,{children:typeof s=="function"?s():s})]}):null,[St,t,s,i,n,A,m,C]),ge=oe({onContextMenu:Ge,onMouseDown:je});return p.useEffect(()=>{if(!P)return;const U=j.reference.current;let ne=null;if(U instanceof Element?ne=U:I.current instanceof Element&&(ne=I.current),!ne)return;const V=new IntersectionObserver(([Q])=>{Q.isIntersecting||A(!1)},{root:null,threshold:0});return V.observe(ne),()=>V.disconnect()},[P,j.reference,A]),H.jsxs(H.Fragment,{children:[H.jsx("span",{ref:j.setReference,className:fe(tI,l&&"!cursor-not-allowed opacity-75",f),"aria-haspopup":"menu","aria-expanded":P,"aria-controls":J,...ge,children:e}),P&&H.jsx(pe.FloatingPortal,{children:H.jsx(pe.FloatingFocusManager,{context:$,modal:!1,initialFocus:-1,returnFocus:!0,children:H.jsxs("div",{id:J,ref:j.setFloating,style:ie,className:fe(oI,!F&&"w-max",v),...de(),children:[h&&H.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:H.jsx(Xg,{ariaLabel:"Close dropdown",onClose:U=>{g?.(U),A(!1)}})}),yt]})})})]})},ip="en-US",sp={year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},pI="text-primary",br=40,np={minWidth:br,width:br,maxWidth:br},fI={cellClass:"ag-grid-no-checkbox",...np},mI={...np};var Ki=(e=>(e.MULTIPLE="MULTIPLE",e.SINGLE="SINGLE",e))(Ki||{});const CI=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0}),rp=(e,t,o,i,s)=>{if(typeof e=="string"&&typeof t=="string"&&e&&t){const n=CI.compare(e,t);return n===0?0:n>0?1:-1}return e===t?0:e?t?e>t?1:-1:s?1:-1:s?-1:1},ap=e=>e?Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)):{},vI=(e,t)=>e.some((o,i)=>o.field!==t[i].field?!0:o.hide!==t[i].hide),wI="h-full w-full",md=".ag-checkbox-input",Sr={accentColor:"var(--bg-control-accent, var(--bg-accent-primary, #3664E2))",backgroundColor:"var(--bg-layer-raised, var(--bg-layer-3, #1D2439))",oddRowBackgroundColor:"var(--bg-layer-sunken, var(--bg-layer-2, #161B2D))",selectedRowBackgroundColor:"var(--bg-accent-primary-alpha, #7DA4FF26)",borderColor:"var(--bg-layer-4, #242C42)",rowBorder:"1px solid var(--stroke-tertiary, var(--stroke-primary, #696E7C))",rowHoverColor:"var(--bg-accent-primary-alpha, #7DA4FF26)",borderRadius:3,browserColorScheme:"dark",chromeBackgroundColor:"var(--bg-layer-1, #0C101D)",foregroundColor:"var(--text-primary, #EEF1F7)",headerFontSize:14,headerFontWeight:600,headerTextColor:"var(--text-secondary, #9FA6BD)",spacing:4,wrapperBorderRadius:3,fontSize:14,fontFamily:"var(--theme-font, var(--font-inter))"},Cd=40;var So=(e=>(e.API="api",e.ROW_DATA_CHANGED="rowDataChanged",e.CHECKBOX_SELECTED="checkboxSelected",e))(So||{}),si=(e=>(e.Undefined="undefined",e.Mobile="mobile",e.Tablet="tablet",e.Desktop="desktop",e))(si||{});const vd=()=>typeof window<"u"&&window.innerWidth<1279,wd=()=>typeof window<"u"&&window.innerWidth<640,bI=()=>{if(typeof window>"u")return si.Undefined;const e=window.innerWidth;return e>=1024?si.Desktop:e<640?si.Mobile:si.Tablet},lp=()=>{const[e,t]=p.useState(wd());return p.useEffect(()=>{const o=()=>t(wd());return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),e},cp=()=>{const[e,t]=p.useState(vd());return p.useEffect(()=>{const o=()=>t(vd());return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),e};function dp(e,t){let o=null;return(...i)=>{o&&clearTimeout(o),o=setTimeout(()=>e(...i),t)}}let bd=!1;const up=()=>{bd||(bd=!0,zT({testIdAttribute:"dataQA"}),Qd.registerModules([GT]))},SI=({columnDefs:e,rowData:t,additionalGridOptions:o,getContextMenuItems:i,className:s,ariaLabel:n="Data grid",wrapCustomCellRenderers:r=!0,disabledRowIds:a,selectedRowIds:l,onSelectionChange:c,onGridApiChange:d,getRowId:u=F=>String(F.id??JSON.stringify(F)),alternateOddRowColors:h=!1,filterPlaceholder:g="Enter value",emptyStateIcon:f,emptyStateTitle:m="No results found",emptyStateDescription:C="Sorry, we couldn't find any results for your search.",loading:v=!1,wrapperBorder:w=!0,withoutHeaderBorders:b=!1,allowDisabledContextMenu:y=!1,selectionMode:S})=>{up();const[F,E]=p.useState(),M=p.useId(),T=lp(),G=cp(),P=p.useRef(new Set),I=p.useRef(void 0),A=p.useMemo(()=>({...Sr,oddRowBackgroundColor:h?Sr.oddRowBackgroundColor:Sr.backgroundColor,wrapperBorder:w}),[h,w]),J=p.useCallback(V=>{V.api.sizeColumnsToFit()},[]),k=p.useCallback(V=>{if(V.data){const Q=u(V.data),le=a?.has(Q)??!1,Me=le&&!y,Ae=V.value==null?"":String(V.value),ee=i?.(V.data)??[];return H.jsx(ha,{trigger:[Vt.ContextMenu],items:ee,anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full",disabled:Me,children:H.jsx("span",{className:"block min-w-0 h-full max-w-full",children:H.jsx(pa,{text:Ae,className:"max-w-full h-full",hideTooltip:le})})})}},[i,a,u,y]),j=p.useCallback(V=>V===So.API||V===So.ROW_DATA_CHANGED,[]),ie=p.useCallback(V=>{if(!F)return;const le=(V.selectedNodes||[]).map(Ae=>Ae.data),Me=new Set(le.map(u));P.current=Me,I.current=V.source,j(V.source)||c?.(Me,le)},[F,u,j,c]),$=p.useMemo(()=>dp(V=>ie?.(V),100),[ie]),Z=p.useCallback(V=>{if(!V.data)return null;const Q=u(V.data),le=V.node.isSelected(),Me=a?.has(Q),Ae=`row-select-${Q}`;return H.jsx("div",{className:"size-6 flex items-center justify-center",children:H.jsx(Ed,{className:"size-[18px]",inputId:Ae,checked:le,disabled:Me,name:"gridradiobutton",value:"selected",onChange:()=>{Me||(V.node.setSelected(!0,!0,So.CHECKBOX_SELECTED),V.api.refreshCells({columns:[V.column?.getColId()]}))}})})},[u,a]),z=p.useCallback(()=>{const V="dial-row-select",Q="dial-row-select-visible";return T||G||l&&l.size>0?`${V} ${Q}`:!l||l.size===0?V:`${V} ${Q}`},[T,G,l]),te=p.useCallback(()=>T||G?z():!l||l.size===0?"dial-row-not-select-header":z(),[z,T,G,l]),q=p.useMemo(()=>{if(S===Ki.SINGLE)return{...fI,cellRenderer:Z};if(S===Ki.MULTIPLE)return{...mI,headerClass:()=>te(),cellClass:V=>{const Q=V.data?u(V.data):null;let le=z();return Q&&a?.has(Q)&&(le+=" opacity-50 pointer-events-none"),le}}},[S,Z,te,u,z,a]),oe=p.useCallback(V=>{const Q=typeof r=="function"?r(V):!!r;if(!V.cellRenderer)return{...V,cellRenderer:k};if(!Q)return V;const le=V.cellRenderer;return{...V,cellRenderer:Ae=>{const ee=Ae.data?i?.(Ae.data)??[]:[];let ae=null;if(typeof le=="function"){const X=le;ae=H.jsx(X,{...Ae})}else ae=k(Ae);const Ce=Ae.data?u(Ae.data):null,ue=Ce?a?.has(Ce):!1;return H.jsx(ha,{trigger:[Vt.ContextMenu],items:ee,anchorToMouse:!0,matchReferenceWidth:!0,className:fe("w-full h-full",ue&&"!cursor-not-allowed opacity-75"),disabled:ue&&!y,children:H.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:ae})})}}},[a,i,u,k,r,y]),de=p.useMemo(()=>r?(e??[]).map(oe):e??[],[e,r,r?oe:null]),{defaultColDef:Oe,...Ge}=o??{},je=p.useMemo(()=>({minWidth:150,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:g,buttons:["reset"]},comparator:rp,...ap(Oe)}),[g,Oe]),St=V=>{const Q=document.querySelector(md);Q&&Q.setAttribute("aria-description",Rr);const le=de.map(Me=>({...Me,sort:void 0}));V.api.updateGridOptions({columnDefs:le,rowData:t}),V.api.sizeColumnsToFit(),E(V.api),o?.onGridReady?.(V),d?.(V.api)};p.useEffect(()=>{F&&t&&F.setGridOption("rowData",t)},[F,t]);const yt=p.useCallback(()=>H.jsx(xd,{title:m,description:C,containerClassName:"gap-3",titleClassName:"mt-2 !text-lg",icon:f||H.jsx(vn.IconZoomCancel,{size:100,stroke:.5,className:"text-secondary"})}),[m,C,f]),ge=p.useMemo(()=>{if(S)return{mode:S===Ki.SINGLE?"singleRow":"multiRow",isRowSelectable:V=>{const Q=V.data?u(V.data):null;return Q?!a?.has(Q):!0}}},[a,u,S]);p.useEffect(()=>{F&&t&&P.current.size&&P.current.forEach(V=>{const Q=F.getRowNode(V);Q&&!Q.isSelected()&&Q.setSelected(!0,!1,So.API)})},[F,t]),p.useEffect(()=>{F&&l&&(F.deselectAll("all",So.API),l.forEach(V=>{const Q=F.getRowNode(V);Q&&!Q.isSelected()&&Q.setSelected(!0,!1,So.API)}))},[F,l]);const U=p.useCallback(V=>V.data?u(V.data):"",[u]),ne=p.useCallback(()=>{document.querySelectorAll(`.ag-row ${md}`).forEach(V=>{V.setAttribute("aria-description",Rr)})},[]);return p.useEffect(()=>{const V=j(I.current);if(F&&l?.size&&V){const Q=Array.from(l)[0];if(Q){const le=F.getRowNode(Q);le&&F.ensureNodeVisible(le)}}},[F,j,l]),H.jsx("div",{className:fe(wI,s,S&&"with-selection-column",b&&"dial-without-header-borders"),"aria-label":n,role:"region","aria-busy":v,children:H.jsx("div",{className:"h-full overflow-x-auto",role:"table","aria-describedby":M,children:H.jsx(Qg,{rowModelType:"clientSide",headerHeight:Cd,rowHeight:Cd,cellSelection:!1,theme:Vh.withPart(Ih).withParams({...A}),autoSizeStrategy:{type:"fitGridWidth"},columnDefs:de,defaultColDef:je,selectionColumnDef:q,onGridSizeChanged:J,onGridReady:St,loading:v,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:yt,rowData:t,rowSelection:ge,onSelectionChanged:$,getRowId:U,onRowDataUpdated:ne,onBodyScroll:ne,onFirstDataRendered:ne,...Ge})})})},Pl=e=>{if(!e)return null;if(e instanceof Date)return isFinite(e.getTime())?e:null;if(typeof e=="number"){const t=new Date(e);return isFinite(t.getTime())?t:null}if(typeof e=="string"){const t=e.trim();if(/^-?\d+$/.test(t))return Pl(Number(t));const o=new Date(t);return isFinite(o.getTime())?o:null}return null},yI=({value:e,locale:t=ip,options:o=sp,emptyPlaceholder:i,className:s,hideTooltip:n=!1})=>{const r=Pl(e),a=p.useMemo(()=>r?new Intl.DateTimeFormat(t,o).format(r):i,[r,i,t,o]),l=r?r.toISOString():void 0;return H.jsx(pa,{text:l?H.jsx("time",{dateTime:l,children:a}):H.jsx("span",{children:a}),className:fe(pI,s),hideTooltip:n})};exports.AgGridReact=Qg;exports.DEFAULT_DATE_FORMAT_OPTIONS=sp;exports.DEFAULT_LOCALE=ip;exports.DIAL_KIT_CLASS=bn;exports.DialCloseButton=Xg;exports.DialDangerIconButton=bp;exports.DialDateCellRenderer=yI;exports.DialDropdown=ha;exports.DialEllipsisTooltip=pa;exports.DialGhostIconButton=Rd;exports.DialGrid=SI;exports.DialIcon=zs;exports.DialNeutralIconButton=wp;exports.DialNoDataContent=xd;exports.DialPrimaryIconButton=vp;exports.DialRadioButton=Ed;exports.DialSecondaryIconButton=Sp;exports.DialSuccessIconButton=Rp;exports.DialTertiaryIconButton=yp;exports.DropdownItemType=Cn;exports.DropdownTrigger=Vt;exports.DropdownType=Zg;exports.GridSelectionMode=Ki;exports.ScreenType=si;exports.SubMenuPanel=op;exports.ThemeScope=Fp;exports.ariaDescription=Rr;exports.baseColumnComparator=rp;exports.checkColDefsChanges=vI;exports.colorSchemeLight=Ih;exports.convertToDate=Pl;exports.debounceFn=dp;exports.getScreenType=bI;exports.observeElementSize=yd;exports.omitUndefined=ap;exports.registerAgGridModulesOnce=up;exports.scheduleMeasure=wn;exports.themeBalham=Vh;exports.useIsMobileScreen=lp;exports.useIsTabletScreen=cp;exports.useSubMenuFloating=tp;exports.useThemeScope=Fd;