ag-grid-community 35.3.0 → 35.3.1

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.
@@ -13948,10 +13948,10 @@ button.ag-side-button-button:focus {
13948
13948
  font-weight: normal;
13949
13949
  font-style: normal;
13950
13950
  }
13951
- `,document.head.appendChild(e)}})();function j(e){if(e?.length)return e[e.length-1]}function rt(e,t,a){if(e===t)return!0;if(!e||!t)return e==null&&t==null;const o=e.length;if(o!==t.length)return!1;if(a){for(let r=0;r<o;++r)if(e[r]!==t[r]&&!a(e[r],t[r]))return!1;return!0}for(let r=0;r<o;++r)if(e[r]!==t[r])return!1;return!0}function Ks(e,t){if(!t)return[];const a=t.length;if(e&&e!==t&&e.length===a){for(let o=0;o<a;++o)if(e[o]!==t[o])return t.slice();return e}return t.slice()}function Xa(e,t){if(e){for(const a of e)if(t(a))return!0}}function Pe(e,t){const a=e.indexOf(t);a>=0&&e.splice(a,1)}function _s(e,t){let a=0,o=0;for(;a<e.length;a++)t.includes(e[a])||(e[o]=e[a],o++);for(;o<e.length;)e.pop()}function Qs(e,t,a){for(let o=0;o<t.length;o++)Pe(e,t[o]);for(let o=t.length-1;o>=0;o--)e.splice(a,0,t[o])}function Om(e){return[].concat.apply([],e)}var Ke=e=>e==null||e===""?null:e;function z(e){return e!=null&&e!==""}function _(e){return!z(e)}var $o=e=>e!=null&&typeof e.toString=="function"?e.toString():null,ma=(e,t)=>{const a=e?JSON.stringify(e):null,o=t?JSON.stringify(t):null;return a===o},Ys=(e,t,a=!1)=>(typeof e=="object"&&e!==null&&typeof e.toNumber=="function"&&(e=e.toNumber()),typeof t=="object"&&t!==null&&typeof t.toNumber=="function"&&(t=t.toNumber()),e==null?t==null?0:-1:t==null?1:!a||typeof e!="string"?e>t?1:e<t?-1:0:e.localeCompare(t)),Ct=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,a){const o=t?this.allAsyncListeners:this.allSyncListeners;let r=o.get(e);return!r&&a&&(r=new Set,o.set(e,r)),r}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,a=!1){this.getListeners(e,a,!0).add(t)}removeEventListener(e,t,a=!1){const o=this.getListeners(e,a,!1);o&&(o.delete(t),o.size===0&&(a?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const a=e.type;if(t&&"event"in e){const l=e.event;l instanceof Event&&(e.eventPath=l.composedPath())}const{frameworkOverrides:o}=this,r=l=>{const s=o?()=>o.wrapIncoming(l):l;t?this.dispatchAsync(s):s()},i=this.getListeners(a,t,!1);if((i?.size??0)>0){const l=new Set(i);for(const s of l)i?.has(s)&&r(()=>s(e))}const n=this.getGlobalListeners(t);if(n.size>0){const l=new Set(n);for(const s of l)r(()=>s(a,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)},a=this.frameworkOverrides;a?a.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}},Nm=/[&<>"']/g,Hm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function _t(e){return e?.toString().toString()??null}function va(e){return _t(e)?.replace(Nm,t=>Hm[t])??null}function Zs(e){return typeof e=="string"&&e.length>1&&e.codePointAt(0)===61}function Js(e){if(!e||e==null)return null;const t=/([a-z])([A-Z])/g,a=/([A-Z]+)([A-Z])([a-z])/g;return e.replace(t,"$1 $2").replace(a,"$1 $2$3").replace(/\./g," ").split(" ").map(r=>r.substring(0,1).toUpperCase()+(r.length>1?r.substring(1,r.length):"")).join(" ")}function Ie(e){return e.eRootDiv.getRootNode()}function Q(e){return Ie(e).activeElement}function oe(e){const{gos:t,eRootDiv:a}=e;let o=null;const r=t.get("getDocument");return r&&z(r)?o=r():a&&(o=a.ownerDocument),o&&z(o)?o:document}function er(e){const t=Q(e);return t===null||t===oe(e).body}function tr(e){return oe(e).defaultView||window}function ar(e){let t=null,a;try{t=oe(e).fullscreenElement}catch{}finally{t||(t=Ie(e));const o=t.querySelector("body");o?a=o:t instanceof ShadowRoot?a=t:t instanceof Document?a=t?.documentElement:a=t}return a}function Gm(e){return ar(e)?.clientWidth??(window.innerWidth||-1)}function Vm(e){return ar(e)?.clientHeight??(window.innerHeight||-1)}function be(e,t,a){a==null||typeof a=="string"&&a==""?or(e,t):Re(e,t,a)}function Re(e,t,a){e.setAttribute(Xs(t),a.toString())}function or(e,t){e.removeAttribute(Xs(t))}function Xs(e){return`aria-${e}`}function _e(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function qm(e){const t=e?.direction;return t==="asc"?"ascending":t==="desc"?"descending":t==="mixed"?"other":"none"}function Wm(e){return Number.parseInt(e.getAttribute("aria-posinset"),10)}function Um(e){return e.getAttribute("aria-label")}function Qt(e,t){be(e,"label",t)}function ba(e,t){be(e,"labelledby",t)}function jm(e,t){be(e,"describedby",t)}function $s(e,t){be(e,"live",t)}function Km(e,t){be(e,"atomic",t)}function _m(e,t){be(e,"relevant",t)}function rr(e,t){be(e,"invalid",t)}function Qm(e,t){be(e,"level",t)}function ec(e,t){be(e,"disabled",t)}function Ai(e,t){be(e,"hidden",t)}function Ym(e,t){be(e,"activedescendant",t)}function ir(e,t){Re(e,"expanded",t)}function Zm(e){or(e,"expanded")}function tc(e,t){Re(e,"setsize",t)}function ac(e,t){Re(e,"posinset",t)}function Jm(e,t){Re(e,"multiselectable",t)}function oc(e,t){Re(e,"rowcount",t)}function wa(e,t){Re(e,"rowindex",t)}function Xm(e,t){Re(e,"rowspan",t)}function rc(e,t){Re(e,"colcount",t)}function Pi(e,t){Re(e,"colindex",t)}function ic(e,t){Re(e,"colspan",t)}function nc(e,t){Re(e,"sort",t)}function lc(e){or(e,"sort")}function Ii(e,t){be(e,"selected",t)}function $m(e,t){Re(e,"checked",t===void 0?"mixed":t)}function sc(e,t){be(e,"controls",t)}function cc(e,t){sc(e,t.id),ba(t,e.id)}function dc(e,t){be(e,"owns",t)}function ev(e,t){be(e,"haspopup",t===!1?null:t)}function nr(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}function tv(e,t){t?Re(e,"orientation",t):or(e,"orientation")}function av(e,t,a){const o=e.parentElement;let r=o&&o.firstChild;for(;r;)t&&r.classList.toggle(t,r===e),a&&r.classList.toggle(a,r!==e),r=r.nextSibling}var ov="[tabindex], input, select, button, textarea, [href]",gc="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Ca(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(gc)?!1:Me(e)}function U(e,t,a={}){const{skipAriaHidden:o}=a;e.classList.toggle("ag-hidden",!t),o||Ai(e,!t)}function uc(e,t,a={}){const{skipAriaHidden:o}=a;e.classList.toggle("ag-invisible",!t),o||Ai(e,!t)}function ya(e,t){const a="disabled",o=t?i=>i.setAttribute(a,""):i=>i.removeAttribute(a);o(e);const r=e.querySelectorAll("input")??[];for(const i of r)o(i)}function Yt(e,t,a){let o=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof a=="number"){if(++o>a)break}else if(e===a)break}return!1}function Zt(e){const{height:t,width:a,borderTopWidth:o,borderRightWidth:r,borderBottomWidth:i,borderLeftWidth:n,paddingTop:l,paddingRight:s,paddingBottom:c,paddingLeft:d,marginTop:g,marginRight:u,marginBottom:h,marginLeft:p,boxSizing:f}=window.getComputedStyle(e),m=Number.parseFloat;return{height:m(t||"0"),width:m(a||"0"),borderTopWidth:m(o||"0"),borderRightWidth:m(r||"0"),borderBottomWidth:m(i||"0"),borderLeftWidth:m(n||"0"),paddingTop:m(l||"0"),paddingRight:m(s||"0"),paddingBottom:m(c||"0"),paddingLeft:m(d||"0"),marginTop:m(g||"0"),marginRight:m(u||"0"),marginBottom:m(h||"0"),marginLeft:m(p||"0"),boxSizing:f}}function lr(e){const t=Zt(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function ka(e){const t=Zt(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function Ti(e){const{height:t,marginBottom:a,marginTop:o}=Zt(e);return Math.floor(t+a+o)}function $a(e){const{width:t,marginLeft:a,marginRight:o}=Zt(e);return Math.floor(t+a+o)}function hc(e){const t=e.getBoundingClientRect(),{borderTopWidth:a,borderLeftWidth:o,borderRightWidth:r,borderBottomWidth:i}=Zt(e);return{top:t.top+(a||0),left:t.left+(o||0),right:t.right+(r||0),bottom:t.bottom+(i||0)}}function sr(e,t){let a=e.scrollLeft;return t&&(a=Math.abs(a)),a}function eo(e,t,a){a&&(t*=-1),e.scrollLeft=t}function le(e){for(;e?.firstChild;)e.firstChild.remove()}function Ee(e){e?.parentNode&&e.remove()}function pc(e){return!!e.offsetParent}function Me(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!pc(e)||window.getComputedStyle(e).visibility!=="visible")}function cr(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function fc(e,t,a){a?.nextSibling!==t&&(e.firstChild?a?a.nextSibling?e.insertBefore(t,a.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.prepend(t):e.appendChild(t))}function mc(e,t){for(let a=0;a<t.length;a++){const o=t[a],r=e.children[a];r!==o&&e.insertBefore(o,r)}}function rv(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function to(e,t){if(t)for(const a of Object.keys(t)){const o=t[a];if(!a?.length||o==null)continue;const r=rv(a),i=o.toString(),n=i.replace(/\s*!important/g,""),l=n.length!=i.length?"important":void 0;e.style.setProperty(r,n,l)}}function Jt(e){return()=>{const t=e();return t?vc(t)||iv(t):!0}}function vc(e){return e.clientWidth<e.scrollWidth}function iv(e){return e.clientHeight<e.scrollHeight}function dr(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):He(e,t)}function He(e,t){t=Li(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function ao(e,t){t=Li(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function Li(e){return typeof e=="number"?`${e}px`:e}function gr(e){return e instanceof Node||e instanceof HTMLElement}function we(e,t,a){a==null||a===""?e.removeAttribute(t):e.setAttribute(t,a.toString())}function bc(e,t){if(!t.isContentEditable)return;const a=tr(e).getSelection();if(!a)return;const o=oe(e).createRange();o.selectNodeContents(t),o.collapse(!1),a.removeAllRanges(),a.addRange(o)}function it(e,t,a){const r=tr(e).ResizeObserver,i=r?new r(a):null;return i?.observe(t),()=>i?.disconnect()}function nt(e,t){const a=tr(e);a.requestAnimationFrame?a.requestAnimationFrame(t):a.webkitRequestAnimationFrame?a.webkitRequestAnimationFrame(t):a.setTimeout(t,0)}var wc="data-ref",Bi;function Cc(){return Bi??(Bi=document.createTextNode(" ")),Bi.cloneNode()}function yt(e){const{attrs:t,children:a,cls:o,ref:r,role:i,tag:n}=e,l=document.createElement(n);if(o&&(l.className=o),r&&l.setAttribute(wc,r),i&&l.setAttribute("role",i),t)for(const s of Object.keys(t))l.setAttribute(s,t[s]);if(a)if(typeof a=="string")l.textContent=a;else{let s=!0;for(const c of a)c&&(typeof c=="string"?(l.appendChild(document.createTextNode(c)),s=!1):typeof c=="function"?l.appendChild(c()):(s&&(l.appendChild(Cc()),s=!1),l.append(yt(c)),l.appendChild(Cc())))}return l}var nv=["touchstart","touchend","touchmove","touchcancel","scroll"],lv=["wheel"],Oi={},ur=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return a=>{if(typeof Oi[a]=="boolean")return Oi[a];const o=document.createElement(e[a]||"div");return a="on"+a,Oi[a]=a in o}})();function yc(e,t){return!t||!e?!1:cv(t).indexOf(e)>=0}function sv(e){const t=[];let a=e.target;for(;a;)t.push(a),a=a.parentElement;return t}function cv(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():sv(t)}function dv(e,t,a){const o=gv(t);let r;o!=null&&(r={passive:o}),e.addEventListener(t,a,r)}var gv=e=>{const t=nv.includes(e),a=lv.includes(e);if(t)return!0;if(a)return!1};function kc(e,t,a){if(a===0)return!1;const o=Math.abs(e.clientX-t.clientX),r=Math.abs(e.clientY-t.clientY);return Math.max(o,r)<=a}var Sa=(e,t)=>{const a=e.identifier;for(let o=0,r=t.length;o<r;++o){const i=t[o];if(i.identifier===a)return i}return null};function oo(e,t){return e.gos.isElementInThisInstance(t.target)}function Sc(e,t,a){const r=e.getBoundingClientRect().height,i=Gm(a)-2,n=Vm(a)-2;if(!e.offsetParent)return;const s=hc(e.offsetParent),{clientY:c,clientX:d}=t;let g=c-s.top-r/2,u=d-s.left-10;const h=oe(a),p=h.defaultView||window,f=p.pageYOffset||h.documentElement.scrollTop,m=p.pageXOffset||h.documentElement.scrollLeft;i>0&&u+e.clientWidth>i+m&&(u=i+m-e.clientWidth),u<0&&(u=0),n>0&&g+e.clientHeight>n+f&&(g=n+f-e.clientHeight),g<0&&(g=0),e.style.left=`${u}px`,e.style.top=`${g}px`}var hr=(e,...t)=>{for(const a of t){const[o,r,i,n]=a;o.addEventListener(r,i,n),e.push(a)}},Ni=e=>{if(e){for(const[t,a,o,r]of e)t.removeEventListener(a,o,r);e.length=0}},kt=e=>{e.cancelable&&e.preventDefault()};function uv(e,t){return t}function Hi(e){return e?.getLocaleTextFunc()??uv}function xc(e,t,a,o){const r=t[a];return e.getLocaleTextFunc()(a,typeof r=="function"?r(o):r,o)}function Rc(e){return(t,a,o)=>e({key:t,defaultValue:a,variableValues:o})}function Ec(e){return(t,a,o)=>{let r=e?.[t];if(r&&o?.length){let i=0;for(;!(i>=o.length||r.indexOf("${variable}")===-1);)r=r.replace("${variable}",o[i++])}return r??a}}var ue=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,a){this.localEventService||(this.localEventService=new Ct),this.localEventService.addEventListener(e,t,a)}removeEventListener(e,t,a){this.localEventService?.removeEventListener(e,t,a)}dispatchLocalEvent(e){this.localEventService?.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const a=[];for(const o of Object.keys(t)){const r=t[o];r&&a.push(this._setupListener(e,o,r))}return a}_setupListener(e,t,a){if(this.destroyed)return()=>null;let o;if(hv(e))e.__addEventListener(t,a),o=()=>(e.__removeEventListener(t,a),null);else{const r=pv(e);e instanceof HTMLElement?dv(e,t,a):r?e.addListener(t,a):e.addEventListener(t,a),o=r?()=>(e.removeListener(t,a),null):()=>(e.removeEventListener(t,a),null)}return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(r=>r!==o),null)}setupPropertyListener(e,t){const{gos:a}=this;a.addPropertyEventListener(e,t);const o=()=>(a.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(r=>r!==o),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const a=e.join("-")+this.propertyListenerId++,o=r=>{if(r.changeSet){if(r.changeSet?.id===this.lastChangeSetIdLookup[a])return;this.lastChangeSetIdLookup[a]=r.changeSet.id}const i={type:"propertyChanged",changeSet:r.changeSet,source:r.source};t(i)};for(const r of e)this.setupPropertyListener(r,o)}getLocaleTextFunc(){return Hi(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const a=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),a}createBean(e,t,a){return(t||this.stubContext).createBean(e,a)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function hv(e){return e.__addEventListener!==void 0}function pv(e){return e.eventServiceType==="global"}var y=class extends ue{},Gi=new Set,ro=(e,t)=>{Gi.has(t)||(Gi.add(t),e())};ro._set=Gi;var fv={pending:!1,funcs:[]},mv={pending:!1,funcs:[]};function pr(e,t="setTimeout",a){const o=t==="raf"?mv:fv;if(o.funcs.push(e),o.pending)return;o.pending=!0;const r=()=>{const i=o.funcs.slice();o.funcs.length=0,o.pending=!1;for(const n of i)n()};t==="raf"?nt(a,r):window.setTimeout(r,0)}function te(e,t,a){let o;return function(...r){const i=this;return window.clearTimeout(o),o=window.setTimeout(function(){e.isAlive()&&t.apply(i,r)},a),o}}function Fc(e,t){let a=0;return function(...o){const r=this,i=Date.now();i-a<t||(a=i,e.apply(r,o))}}function Mc(e,t,a,o=100){const r=Date.now();let i=null,n=!1;const l=()=>{i!=null&&(window.clearInterval(i),i=null)};e.addDestroyFunc(l);const s=()=>{const c=Date.now()-r>o;(t()||c)&&(a(),n=!0,l())};s(),n||(i=window.setInterval(s,10))}var zc=new Set(["__proto__","constructor","prototype"]);function vv(e,t){if(e!=null){if(Array.isArray(e)){for(let a=0;a<e.length;a++)t(a.toString(),e[a]);return}for(const a of Object.keys(e).filter(o=>!zc.has(o)))t(a,e[a])}}function he(e,t,a=!0,o=!1){z(t)&&vv(t,(r,i)=>{let n=e[r];n!==i&&(o&&n==null&&i!=null&&typeof i=="object"&&i.constructor===Object&&(n={},e[r]=n),Dc(i)&&Dc(n)&&!Array.isArray(n)?he(n,i,a,o):(a||i!==void 0)&&(e[r]=i))})}function Dc(e){return typeof e=="object"&&e!==null}var Vi=class wt{static applyGlobalGridOptions(t){if(!wt.gridOptions)return{...t};let a={};return he(a,wt.gridOptions,!0,!0),wt.mergeStrategy==="deep"?he(a,t,!0,!0):a={...a,...t},wt.gridOptions.context&&(a.context=wt.gridOptions.context),t.context&&(wt.mergeStrategy==="deep"&&a.context&&he(t.context,a.context,!0,!0),a.context=t.context),a}static applyGlobalGridOption(t,a){if(wt.mergeStrategy==="deep"){const o=qi(t);if(o&&typeof o=="object"&&typeof a=="object")return wt.applyGlobalGridOptions({[t]:a})[t]}return a}};Vi.gridOptions=void 0,Vi.mergeStrategy="shallow";var io=Vi;function bv(e,t="shallow"){io.gridOptions=e,io.mergeStrategy=t}function qi(e){return io.gridOptions?.[e]}var Ac={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,noteTrigger:"hover",noteShowDelay:180,noteHideDelay:220,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,refreshAfterGroupEdit:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupHideColumnsUntilExpanded:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,enableFilterHandlers:!1},Pc="https://www.ag-grid.com";function St(e,t,...a){e.get("debug")&&console.log("AG Grid: "+t,...a)}function lt(e,...t){ro(()=>Tc(e,...t),e+t?.join(""))}function xa(e,...t){ro(()=>Ic(e,...t),e+t?.join(""))}function Ic(e,...t){console.error("AG Grid: "+e,...t)}function Tc(e,...t){console.warn("AG Grid: "+e,...t)}var Lc=new Set,fr={},Xt={},mr,Bc=!1,Oc=!1,Nc=!1;function wv(e){const[t,a]=e.version.split(".")||[],[o,r]=mr.split(".")||[];return t===o&&a===r}function Cv(e){mr||(mr=e.version);const t=o=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${o} Please update all modules to the same version.`;e.version?wv(e)||xa(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${mr}.`)):xa(t(`'${e.moduleName}' is incompatible.`));const a=e.validate?.();a&&!a.isValid&&xa(`${a.message}`)}function Ra(e,t,a=!1){a||(Bc=!0),Cv(e);const o=e.rowModels??["all"];Lc.add(e);let r;t!==void 0?(Oc=!0,Xt[t]===void 0&&(Xt[t]={}),r=Xt[t]):r=fr;for(const i of o)r[i]===void 0&&(r[i]={}),r[i][e.moduleName]=e;if(e.dependsOn)for(const i of e.dependsOn)Ra(i,t,a)}function yv(e){delete Xt[e]}function Wi(e,t,a){const o=r=>!!fr[r]?.[e]||!!Xt[t]?.[r]?.[e];return o(a)||o("all")}function Ui(){return Oc}function kv(e,t){const a=Xt[e]??{};return[...Object.values(fr.all??{}),...Object.values(a.all??{}),...Object.values(fr[t]??{}),...Object.values(a[t]??{})]}function Sv(){return new Set(Lc)}function xv(e,t){const a=Xt[e]??{};return[...Object.values(a.all??{}),...Object.values(a[t]??{})]}function Rv(){return Bc}function ji(){return Nc}function Hc(){Nc=!0}var Ki=class{static register(e){Ra(e,void 0)}static registerModules(e){for(const t of e)Ra(t,void 0)}};function Gc(e){for(const t of e){if("setLicenseKey"in t)return t;if(t.dependsOn){const a=Gc(t.dependsOn);if(a)return a}}}var F="35.3.0",Vc=2e3,qc=100,Wc="_version_",Uc=null,Ea=`${Pc}/javascript-data-grid`;function Ev(e){Uc=e}function Fv(e){Ea=e}function jc(e,t,a){return Uc?.(e,t)??[Av(e,t,a)]}function vr(e,t,a,o,r){e(`${o?"warning":"error"} #${t}`,...jc(t,a,r))}function Mv(e){if(!e)return String(e);const t={};for(const a of Object.keys(e))typeof e[a]!="object"&&typeof e[a]!="function"&&(t[a]=e[a]);return JSON.stringify(t)}function zv(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=Mv(e)),t}function br(e){return e===void 0?"undefined":e===null?"null":e}function _i(e,t){return`${e}?${t.toString()}`}function Dv(e,t,a){const o=Array.from(t.entries()).sort((i,n)=>n[1].length-i[1].length);let r=_i(e,t);for(const[i,n]of o){if(i===Wc)continue;const l=r.length-a;if(l<=0)break;const s="...",c=l+s.length,d=n.length-c>qc?n.slice(0,n.length-c)+s:n.slice(0,qc)+s;t.set(i,d),r=_i(e,t)}return r}function Kc(e,t){const a=new URLSearchParams;if(a.append(Wc,F),t)for(const i of Object.keys(t))a.append(i,zv(t[i]));const o=`${Ea}/errors/${e}`,r=_i(o,a);return r.length<=Vc?r:Dv(o,a,Vc)}var Av=(e,t,a)=>{const o=Kc(e,t),r=`${a?a+`
13951
+ `,document.head.appendChild(e)}})();function j(e){if(e?.length)return e[e.length-1]}function rt(e,t,a){if(e===t)return!0;if(!e||!t)return e==null&&t==null;const o=e.length;if(o!==t.length)return!1;if(a){for(let r=0;r<o;++r)if(e[r]!==t[r]&&!a(e[r],t[r]))return!1;return!0}for(let r=0;r<o;++r)if(e[r]!==t[r])return!1;return!0}function Ks(e,t){if(!t)return[];const a=t.length;if(e&&e!==t&&e.length===a){for(let o=0;o<a;++o)if(e[o]!==t[o])return t.slice();return e}return t.slice()}function Xa(e,t){if(e){for(const a of e)if(t(a))return!0}}function Pe(e,t){const a=e.indexOf(t);a>=0&&e.splice(a,1)}function _s(e,t){let a=0,o=0;for(;a<e.length;a++)t.includes(e[a])||(e[o]=e[a],o++);for(;o<e.length;)e.pop()}function Qs(e,t,a){for(let o=0;o<t.length;o++)Pe(e,t[o]);for(let o=t.length-1;o>=0;o--)e.splice(a,0,t[o])}function Om(e){return[].concat.apply([],e)}var Ke=e=>e==null||e===""?null:e;function z(e){return e!=null&&e!==""}function _(e){return!z(e)}var $o=e=>e!=null&&typeof e.toString=="function"?e.toString():null,ma=(e,t)=>{const a=e?JSON.stringify(e):null,o=t?JSON.stringify(t):null;return a===o},Ys=(e,t,a=!1)=>(typeof e=="object"&&e!==null&&typeof e.toNumber=="function"&&(e=e.toNumber()),typeof t=="object"&&t!==null&&typeof t.toNumber=="function"&&(t=t.toNumber()),e==null?t==null?0:-1:t==null?1:!a||typeof e!="string"?e>t?1:e<t?-1:0:e.localeCompare(t)),Ct=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,a){const o=t?this.allAsyncListeners:this.allSyncListeners;let r=o.get(e);return!r&&a&&(r=new Set,o.set(e,r)),r}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,a=!1){this.getListeners(e,a,!0).add(t)}removeEventListener(e,t,a=!1){const o=this.getListeners(e,a,!1);o&&(o.delete(t),o.size===0&&(a?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const a=e.type;if(t&&"event"in e){const l=e.event;l instanceof Event&&(e.eventPath=l.composedPath())}const{frameworkOverrides:o}=this,r=l=>{const s=o?()=>o.wrapIncoming(l):l;t?this.dispatchAsync(s):s()},i=this.getListeners(a,t,!1);if((i?.size??0)>0){const l=new Set(i);for(const s of l)i?.has(s)&&r(()=>s(e))}const n=this.getGlobalListeners(t);if(n.size>0){const l=new Set(n);for(const s of l)r(()=>s(a,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)},a=this.frameworkOverrides;a?a.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}},Nm=/[&<>"']/g,Hm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function _t(e){return e?.toString().toString()??null}function va(e){return _t(e)?.replace(Nm,t=>Hm[t])??null}function Zs(e){return typeof e=="string"&&e.length>1&&e.codePointAt(0)===61}function Js(e){if(!e||e==null)return null;const t=/([a-z])([A-Z])/g,a=/([A-Z]+)([A-Z])([a-z])/g;return e.replace(t,"$1 $2").replace(a,"$1 $2$3").replace(/\./g," ").split(" ").map(r=>r.substring(0,1).toUpperCase()+(r.length>1?r.substring(1,r.length):"")).join(" ")}function Ie(e){return e.eRootDiv.getRootNode()}function Q(e){return Ie(e).activeElement}function oe(e){const{gos:t,eRootDiv:a}=e;let o=null;const r=t.get("getDocument");return r&&z(r)?o=r():a&&(o=a.ownerDocument),o&&z(o)?o:document}function er(e){const t=Q(e);return t===null||t===oe(e).body}function tr(e){return oe(e).defaultView||window}function ar(e){let t=null,a;try{t=oe(e).fullscreenElement}catch{}finally{t||(t=Ie(e));const o=t.querySelector("body");o?a=o:t instanceof ShadowRoot?a=t:t instanceof Document?a=t?.documentElement:a=t}return a}function Gm(e){return ar(e)?.clientWidth??(window.innerWidth||-1)}function Vm(e){return ar(e)?.clientHeight??(window.innerHeight||-1)}function be(e,t,a){a==null||typeof a=="string"&&a==""?or(e,t):Re(e,t,a)}function Re(e,t,a){e.setAttribute(Xs(t),a.toString())}function or(e,t){e.removeAttribute(Xs(t))}function Xs(e){return`aria-${e}`}function _e(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function qm(e){const t=e?.direction;return t==="asc"?"ascending":t==="desc"?"descending":t==="mixed"?"other":"none"}function Wm(e){return Number.parseInt(e.getAttribute("aria-posinset"),10)}function Um(e){return e.getAttribute("aria-label")}function Qt(e,t){be(e,"label",t)}function ba(e,t){be(e,"labelledby",t)}function jm(e,t){be(e,"describedby",t)}function $s(e,t){be(e,"live",t)}function Km(e,t){be(e,"atomic",t)}function _m(e,t){be(e,"relevant",t)}function rr(e,t){be(e,"invalid",t)}function Qm(e,t){be(e,"level",t)}function ec(e,t){be(e,"disabled",t)}function Ai(e,t){be(e,"hidden",t)}function Ym(e,t){be(e,"activedescendant",t)}function ir(e,t){Re(e,"expanded",t)}function Zm(e){or(e,"expanded")}function tc(e,t){Re(e,"setsize",t)}function ac(e,t){Re(e,"posinset",t)}function Jm(e,t){Re(e,"multiselectable",t)}function oc(e,t){Re(e,"rowcount",t)}function wa(e,t){Re(e,"rowindex",t)}function Xm(e,t){Re(e,"rowspan",t)}function rc(e,t){Re(e,"colcount",t)}function Pi(e,t){Re(e,"colindex",t)}function ic(e,t){Re(e,"colspan",t)}function nc(e,t){Re(e,"sort",t)}function lc(e){or(e,"sort")}function Ii(e,t){be(e,"selected",t)}function $m(e,t){Re(e,"checked",t===void 0?"mixed":t)}function sc(e,t){be(e,"controls",t)}function cc(e,t){sc(e,t.id),ba(t,e.id)}function dc(e,t){be(e,"owns",t)}function ev(e,t){be(e,"haspopup",t===!1?null:t)}function nr(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}function tv(e,t){t?Re(e,"orientation",t):or(e,"orientation")}function av(e,t,a){const o=e.parentElement;let r=o&&o.firstChild;for(;r;)t&&r.classList.toggle(t,r===e),a&&r.classList.toggle(a,r!==e),r=r.nextSibling}var ov="[tabindex], input, select, button, textarea, [href]",gc="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Ca(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(gc)?!1:Me(e)}function U(e,t,a={}){const{skipAriaHidden:o}=a;e.classList.toggle("ag-hidden",!t),o||Ai(e,!t)}function uc(e,t,a={}){const{skipAriaHidden:o}=a;e.classList.toggle("ag-invisible",!t),o||Ai(e,!t)}function ya(e,t){const a="disabled",o=t?i=>i.setAttribute(a,""):i=>i.removeAttribute(a);o(e);const r=e.querySelectorAll("input")??[];for(const i of r)o(i)}function Yt(e,t,a){let o=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof a=="number"){if(++o>a)break}else if(e===a)break}return!1}function Zt(e){const{height:t,width:a,borderTopWidth:o,borderRightWidth:r,borderBottomWidth:i,borderLeftWidth:n,paddingTop:l,paddingRight:s,paddingBottom:c,paddingLeft:d,marginTop:g,marginRight:u,marginBottom:h,marginLeft:p,boxSizing:f}=window.getComputedStyle(e),m=Number.parseFloat;return{height:m(t||"0"),width:m(a||"0"),borderTopWidth:m(o||"0"),borderRightWidth:m(r||"0"),borderBottomWidth:m(i||"0"),borderLeftWidth:m(n||"0"),paddingTop:m(l||"0"),paddingRight:m(s||"0"),paddingBottom:m(c||"0"),paddingLeft:m(d||"0"),marginTop:m(g||"0"),marginRight:m(u||"0"),marginBottom:m(h||"0"),marginLeft:m(p||"0"),boxSizing:f}}function lr(e){const t=Zt(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function ka(e){const t=Zt(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function Ti(e){const{height:t,marginBottom:a,marginTop:o}=Zt(e);return Math.floor(t+a+o)}function $a(e){const{width:t,marginLeft:a,marginRight:o}=Zt(e);return Math.floor(t+a+o)}function hc(e){const t=e.getBoundingClientRect(),{borderTopWidth:a,borderLeftWidth:o,borderRightWidth:r,borderBottomWidth:i}=Zt(e);return{top:t.top+(a||0),left:t.left+(o||0),right:t.right+(r||0),bottom:t.bottom+(i||0)}}function sr(e,t){let a=e.scrollLeft;return t&&(a=Math.abs(a)),a}function eo(e,t,a){a&&(t*=-1),e.scrollLeft=t}function le(e){for(;e?.firstChild;)e.firstChild.remove()}function Ee(e){e?.parentNode&&e.remove()}function pc(e){return!!e.offsetParent}function Me(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!pc(e)||window.getComputedStyle(e).visibility!=="visible")}function cr(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function fc(e,t,a){a?.nextSibling!==t&&(e.firstChild?a?a.nextSibling?e.insertBefore(t,a.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.prepend(t):e.appendChild(t))}function mc(e,t){for(let a=0;a<t.length;a++){const o=t[a],r=e.children[a];r!==o&&e.insertBefore(o,r)}}function rv(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function to(e,t){if(t)for(const a of Object.keys(t)){const o=t[a];if(!a?.length||o==null)continue;const r=rv(a),i=o.toString(),n=i.replace(/\s*!important/g,""),l=n.length!=i.length?"important":void 0;e.style.setProperty(r,n,l)}}function Jt(e){return()=>{const t=e();return t?vc(t)||iv(t):!0}}function vc(e){return e.clientWidth<e.scrollWidth}function iv(e){return e.clientHeight<e.scrollHeight}function dr(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):He(e,t)}function He(e,t){t=Li(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function ao(e,t){t=Li(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function Li(e){return typeof e=="number"?`${e}px`:e}function gr(e){return e instanceof Node||e instanceof HTMLElement}function we(e,t,a){a==null||a===""?e.removeAttribute(t):e.setAttribute(t,a.toString())}function bc(e,t){if(!t.isContentEditable)return;const a=tr(e).getSelection();if(!a)return;const o=oe(e).createRange();o.selectNodeContents(t),o.collapse(!1),a.removeAllRanges(),a.addRange(o)}function it(e,t,a){const r=tr(e).ResizeObserver,i=r?new r(a):null;return i?.observe(t),()=>i?.disconnect()}function nt(e,t){const a=tr(e);a.requestAnimationFrame?a.requestAnimationFrame(t):a.webkitRequestAnimationFrame?a.webkitRequestAnimationFrame(t):a.setTimeout(t,0)}var wc="data-ref",Bi;function Cc(){return Bi??(Bi=document.createTextNode(" ")),Bi.cloneNode()}function yt(e){const{attrs:t,children:a,cls:o,ref:r,role:i,tag:n}=e,l=document.createElement(n);if(o&&(l.className=o),r&&l.setAttribute(wc,r),i&&l.setAttribute("role",i),t)for(const s of Object.keys(t))l.setAttribute(s,t[s]);if(a)if(typeof a=="string")l.textContent=a;else{let s=!0;for(const c of a)c&&(typeof c=="string"?(l.appendChild(document.createTextNode(c)),s=!1):typeof c=="function"?l.appendChild(c()):(s&&(l.appendChild(Cc()),s=!1),l.append(yt(c)),l.appendChild(Cc())))}return l}var nv=["touchstart","touchend","touchmove","touchcancel","scroll"],lv=["wheel"],Oi={},ur=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return a=>{if(typeof Oi[a]=="boolean")return Oi[a];const o=document.createElement(e[a]||"div");return a="on"+a,Oi[a]=a in o}})();function yc(e,t){return!t||!e?!1:cv(t).indexOf(e)>=0}function sv(e){const t=[];let a=e.target;for(;a;)t.push(a),a=a.parentElement;return t}function cv(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():sv(t)}function dv(e,t,a){const o=gv(t);let r;o!=null&&(r={passive:o}),e.addEventListener(t,a,r)}var gv=e=>{const t=nv.includes(e),a=lv.includes(e);if(t)return!0;if(a)return!1};function kc(e,t,a){if(a===0)return!1;const o=Math.abs(e.clientX-t.clientX),r=Math.abs(e.clientY-t.clientY);return Math.max(o,r)<=a}var Sa=(e,t)=>{const a=e.identifier;for(let o=0,r=t.length;o<r;++o){const i=t[o];if(i.identifier===a)return i}return null};function oo(e,t){return e.gos.isElementInThisInstance(t.target)}function Sc(e,t,a){const r=e.getBoundingClientRect().height,i=Gm(a)-2,n=Vm(a)-2;if(!e.offsetParent)return;const s=hc(e.offsetParent),{clientY:c,clientX:d}=t;let g=c-s.top-r/2,u=d-s.left-10;const h=oe(a),p=h.defaultView||window,f=p.pageYOffset||h.documentElement.scrollTop,m=p.pageXOffset||h.documentElement.scrollLeft;i>0&&u+e.clientWidth>i+m&&(u=i+m-e.clientWidth),u<0&&(u=0),n>0&&g+e.clientHeight>n+f&&(g=n+f-e.clientHeight),g<0&&(g=0),e.style.left=`${u}px`,e.style.top=`${g}px`}var hr=(e,...t)=>{for(const a of t){const[o,r,i,n]=a;o.addEventListener(r,i,n),e.push(a)}},Ni=e=>{if(e){for(const[t,a,o,r]of e)t.removeEventListener(a,o,r);e.length=0}},kt=e=>{e.cancelable&&e.preventDefault()};function uv(e,t){return t}function Hi(e){return e?.getLocaleTextFunc()??uv}function xc(e,t,a,o){const r=t[a];return e.getLocaleTextFunc()(a,typeof r=="function"?r(o):r,o)}function Rc(e){return(t,a,o)=>e({key:t,defaultValue:a,variableValues:o})}function Ec(e){return(t,a,o)=>{let r=e?.[t];if(r&&o?.length){let i=0;for(;!(i>=o.length||r.indexOf("${variable}")===-1);)r=r.replace("${variable}",o[i++])}return r??a}}var ue=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,a){this.localEventService||(this.localEventService=new Ct),this.localEventService.addEventListener(e,t,a)}removeEventListener(e,t,a){this.localEventService?.removeEventListener(e,t,a)}dispatchLocalEvent(e){this.localEventService?.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const a=[];for(const o of Object.keys(t)){const r=t[o];r&&a.push(this._setupListener(e,o,r))}return a}_setupListener(e,t,a){if(this.destroyed)return()=>null;let o;if(hv(e))e.__addEventListener(t,a),o=()=>(e.__removeEventListener(t,a),null);else{const r=pv(e);e instanceof HTMLElement?dv(e,t,a):r?e.addListener(t,a):e.addEventListener(t,a),o=r?()=>(e.removeListener(t,a),null):()=>(e.removeEventListener(t,a),null)}return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(r=>r!==o),null)}setupPropertyListener(e,t){const{gos:a}=this;a.addPropertyEventListener(e,t);const o=()=>(a.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(r=>r!==o),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const a=e.join("-")+this.propertyListenerId++,o=r=>{if(r.changeSet){if(r.changeSet?.id===this.lastChangeSetIdLookup[a])return;this.lastChangeSetIdLookup[a]=r.changeSet.id}const i={type:"propertyChanged",changeSet:r.changeSet,source:r.source};t(i)};for(const r of e)this.setupPropertyListener(r,o)}getLocaleTextFunc(){return Hi(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const a=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),a}createBean(e,t,a){return(t||this.stubContext).createBean(e,a)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function hv(e){return e.__addEventListener!==void 0}function pv(e){return e.eventServiceType==="global"}var y=class extends ue{},Gi=new Set,ro=(e,t)=>{Gi.has(t)||(Gi.add(t),e())};ro._set=Gi;var fv={pending:!1,funcs:[]},mv={pending:!1,funcs:[]};function pr(e,t="setTimeout",a){const o=t==="raf"?mv:fv;if(o.funcs.push(e),o.pending)return;o.pending=!0;const r=()=>{const i=o.funcs.slice();o.funcs.length=0,o.pending=!1;for(const n of i)n()};t==="raf"?nt(a,r):window.setTimeout(r,0)}function te(e,t,a){let o;return function(...r){const i=this;return window.clearTimeout(o),o=window.setTimeout(function(){e.isAlive()&&t.apply(i,r)},a),o}}function Fc(e,t){let a=0;return function(...o){const r=this,i=Date.now();i-a<t||(a=i,e.apply(r,o))}}function Mc(e,t,a,o=100){const r=Date.now();let i=null,n=!1;const l=()=>{i!=null&&(window.clearInterval(i),i=null)};e.addDestroyFunc(l);const s=()=>{const c=Date.now()-r>o;(t()||c)&&(a(),n=!0,l())};s(),n||(i=window.setInterval(s,10))}var zc=new Set(["__proto__","constructor","prototype"]);function vv(e,t){if(e!=null){if(Array.isArray(e)){for(let a=0;a<e.length;a++)t(a.toString(),e[a]);return}for(const a of Object.keys(e).filter(o=>!zc.has(o)))t(a,e[a])}}function he(e,t,a=!0,o=!1){z(t)&&vv(t,(r,i)=>{let n=e[r];n!==i&&(o&&n==null&&i!=null&&typeof i=="object"&&i.constructor===Object&&(n={},e[r]=n),Dc(i)&&Dc(n)&&!Array.isArray(n)?he(n,i,a,o):(a||i!==void 0)&&(e[r]=i))})}function Dc(e){return typeof e=="object"&&e!==null}var Vi=class wt{static applyGlobalGridOptions(t){if(!wt.gridOptions)return{...t};let a={};return he(a,wt.gridOptions,!0,!0),wt.mergeStrategy==="deep"?he(a,t,!0,!0):a={...a,...t},wt.gridOptions.context&&(a.context=wt.gridOptions.context),t.context&&(wt.mergeStrategy==="deep"&&a.context&&he(t.context,a.context,!0,!0),a.context=t.context),a}static applyGlobalGridOption(t,a){if(wt.mergeStrategy==="deep"){const o=qi(t);if(o&&typeof o=="object"&&typeof a=="object")return wt.applyGlobalGridOptions({[t]:a})[t]}return a}};Vi.gridOptions=void 0,Vi.mergeStrategy="shallow";var io=Vi;function bv(e,t="shallow"){io.gridOptions=e,io.mergeStrategy=t}function qi(e){return io.gridOptions?.[e]}var Ac={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,noteTrigger:"hover",noteShowDelay:180,noteHideDelay:220,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,refreshAfterGroupEdit:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupHideColumnsUntilExpanded:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,enableFilterHandlers:!1},Pc="https://www.ag-grid.com";function St(e,t,...a){e.get("debug")&&console.log("AG Grid: "+t,...a)}function lt(e,...t){ro(()=>Tc(e,...t),e+t?.join(""))}function xa(e,...t){ro(()=>Ic(e,...t),e+t?.join(""))}function Ic(e,...t){console.error("AG Grid: "+e,...t)}function Tc(e,...t){console.warn("AG Grid: "+e,...t)}var Lc=new Set,fr={},Xt={},mr,Bc=!1,Oc=!1,Nc=!1;function wv(e){const[t,a]=e.version.split(".")||[],[o,r]=mr.split(".")||[];return t===o&&a===r}function Cv(e){mr||(mr=e.version);const t=o=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${o} Please update all modules to the same version.`;e.version?wv(e)||xa(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${mr}.`)):xa(t(`'${e.moduleName}' is incompatible.`));const a=e.validate?.();a&&!a.isValid&&xa(`${a.message}`)}function Ra(e,t,a=!1){a||(Bc=!0),Cv(e);const o=e.rowModels??["all"];Lc.add(e);let r;t!==void 0?(Oc=!0,Xt[t]===void 0&&(Xt[t]={}),r=Xt[t]):r=fr;for(const i of o)r[i]===void 0&&(r[i]={}),r[i][e.moduleName]=e;if(e.dependsOn)for(const i of e.dependsOn)Ra(i,t,a)}function yv(e){delete Xt[e]}function Wi(e,t,a){const o=r=>!!fr[r]?.[e]||!!Xt[t]?.[r]?.[e];return o(a)||o("all")}function Ui(){return Oc}function kv(e,t){const a=Xt[e]??{};return[...Object.values(fr.all??{}),...Object.values(a.all??{}),...Object.values(fr[t]??{}),...Object.values(a[t]??{})]}function Sv(){return new Set(Lc)}function xv(e,t){const a=Xt[e]??{};return[...Object.values(a.all??{}),...Object.values(a[t]??{})]}function Rv(){return Bc}function ji(){return Nc}function Hc(){Nc=!0}var Ki=class{static register(e){Ra(e,void 0)}static registerModules(e){for(const t of e)Ra(t,void 0)}};function Gc(e){for(const t of e){if("setLicenseKey"in t)return t;if(t.dependsOn){const a=Gc(t.dependsOn);if(a)return a}}}var F="35.3.1",Vc=2e3,qc=100,Wc="_version_",Uc=null,Ea=`${Pc}/javascript-data-grid`;function Ev(e){Uc=e}function Fv(e){Ea=e}function jc(e,t,a){return Uc?.(e,t)??[Av(e,t,a)]}function vr(e,t,a,o,r){e(`${o?"warning":"error"} #${t}`,...jc(t,a,r))}function Mv(e){if(!e)return String(e);const t={};for(const a of Object.keys(e))typeof e[a]!="object"&&typeof e[a]!="function"&&(t[a]=e[a]);return JSON.stringify(t)}function zv(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=Mv(e)),t}function br(e){return e===void 0?"undefined":e===null?"null":e}function _i(e,t){return`${e}?${t.toString()}`}function Dv(e,t,a){const o=Array.from(t.entries()).sort((i,n)=>n[1].length-i[1].length);let r=_i(e,t);for(const[i,n]of o){if(i===Wc)continue;const l=r.length-a;if(l<=0)break;const s="...",c=l+s.length,d=n.length-c>qc?n.slice(0,n.length-c)+s:n.slice(0,qc)+s;t.set(i,d),r=_i(e,t)}return r}function Kc(e,t){const a=new URLSearchParams;if(a.append(Wc,F),t)for(const i of Object.keys(t))a.append(i,zv(t[i]));const o=`${Ea}/errors/${e}`,r=_i(o,a);return r.length<=Vc?r:Dv(o,a,Vc)}var Av=(e,t,a)=>{const o=Kc(e,t),r=`${a?a+`
13952
13952
  `:""}Visit ${o}`;return ji()?r:`${r}${a?"":`
13953
13953
  Alternatively register the ValidationModule to see the full message in the console.`}`};function x(...e){vr(lt,e[0],e[1],!0)}function q(...e){vr(xa,e[0],e[1],!1)}function no(e,t,a){vr(xa,e,t,!1,a)}function Pv(e,t,a){vr(lt,e,t,!0,a)}function _c(e,t){const a=t[0];return`error #${a} `+jc(a,t[1],e).join(" ")}function Ge(...e){return _c(void 0,e)}function Iv(...e){return _c(`
13954
- `,e)}function Qc(e,t){return e.get("rowModelType")===t}function $(e,t){return Qc(e,"clientSide")}function Fa(e,t){return Qc(e,"serverSide")}function se(e,t){return e.get("domLayout")===t}function xt(e){return go(e)!==void 0}function Qi(e){return typeof e.get("getRowHeight")=="function"}function Tv(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function Yc({gos:e,formula:t}){const a=e.get("rowNumbers");return a||!!t?.active&&a!==!1}function st(e,t,a=!1,o){const{gos:r,environment:i}=e;if(o==null&&(o=i.getDefaultRowHeight()),Qi(r)){if(a)return{height:o,estimated:!0};const s={node:t,data:t.data},c=r.getCallback("getRowHeight")(s);if(Yi(c))return c===0&&x(23),{height:Math.max(1,c),estimated:!1}}if(t.detail&&r.get("masterDetail"))return Lv(r);const n=r.get("rowHeight");return{height:n&&Yi(n)?n:o,estimated:!1}}function Lv(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return Yi(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function Rt(e){const{environment:t,gos:a}=e,o=a.get("rowHeight");if(!o||_(o))return t.getDefaultRowHeight();const r=t.refreshRowHeightVariable();return r!==-1?r:(x(24),t.getDefaultRowHeight())}function Yi(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function Zc(e,t,a){const o=t[e.getDomDataKey()];return o?o[a]:void 0}function $t(e,t,a,o){const r=e.getDomDataKey();let i=t[r];_(i)&&(i={},t[r]=i),i[a]=o}function ea(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function Zi(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||se(e,"print"))}function ct(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function lo(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function Ji(e){return e.get("grandTotalRow")}function Jc(e){switch(e){case"pinnedTop":return"top";case"pinnedBottom":return"bottom";default:return null}}function Bv(e){const t=e.get("groupTotalRow");return typeof t=="function"?e.getCallback("groupTotalRow"):()=>t??void 0}function Xc(e){return e.get("groupHideOpenParents")?!0:e.get("groupDisplayType")==="multipleColumns"}function $c(e){return Xc(e)&&e.get("groupHideColumnsUntilExpanded")&&$(e)}function Xi(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function $i(e,t,a){return!!t.group&&!t.footer&&Xi(e,a)}function ta(e){const t=e.getCallback("getRowId");return t===void 0?t:a=>{let o=t(a);return typeof o!="string"&&(ro(()=>x(25,{id:o}),"getRowIdString"),o=String(o)),o}}function ed(e,t){const a=e.get("groupHideParentOfSingleChild");return!!(a===!0||a==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function td(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function Ov(e,t){const a=e.get("suppressGroupChangesColumnVisibility");if(a===!0||t&&a==="suppressHideOnGroup"||!t&&a==="suppressShowOnUngroup")return!1;const o=e.get("suppressRowGroupHidesColumns");if(t&&o===!0)return!1;const r=e.get("suppressMakeColumnVisibleAfterUnGroup");return!(!t&&r===!0)}function aa(e){return e?.checkboxes??!0}function so(e){return e?.mode==="multiRow"&&(e.headerCheckbox??!0)}function co(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function en(e){return e?.hideDisabledCheckboxes??!1}function ad(e){return typeof e.get("rowSelection")!="string"}function Nv(e){return e.get("cellSelection")!==void 0}function Hv(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t?.suppressMultiRanges??!1:!1:e.get("suppressMultiRangeSelection")}function Qe(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function Gv(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"&&t.handle?.mode==="fill"?t.handle:void 0:{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}}function Et(e){const t=e.get("cellSelection")??!1;return(typeof t=="object"&&t.enableColumnSelection)??!1}function od(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const a=e.get("suppressRowClickSelection"),o=e.get("suppressRowDeselection");return a&&o?!1:a?"enableDeselection":o?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function Vv(e){const t=od(e);return t===!0||t==="enableSelection"}function qv(e){const t=od(e);return t===!0||t==="enableDeselection"}function wr(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t?.isRowSelectable}function go(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t?.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function Ma(e){return go(e)==="multiRow"}function Wv(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):t?.enableSelectionWithoutKeys??!1}function uo(e){const t=e.get("rowSelection");if(typeof t=="string"){const a=e.get("groupSelectsChildren"),o=e.get("groupSelectsFiltered");return a&&o?"filteredDescendants":a?"descendants":"self"}return t?.mode==="multiRow"?t.groupSelects:void 0}function rd(e,t=!0){const a=e.get("rowSelection");return typeof a!="object"?t?"all":void 0:a.mode==="multiRow"?a.selectAll:"all"}function Uv(e){const t=e.get("rowSelection");return typeof t=="string"?!1:t?.mode==="multiRow"?t.ctrlASelectsRows??!1:!1}function za(e){const t=uo(e);return t==="descendants"||t==="filteredDescendants"}function id(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function nd(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function Ce(e){return e.get("columnMenu")==="legacy"}function ld(e){return!Ce(e)}function sd(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function jv(e,t,a){typeof e!="object"&&(e={});const o={...e};for(const r of a){const i=t[r];typeof i<"u"&&(o[r]=i)}return o}function Kv(e,t){if(!e)return;const a={};let o=!1;for(const n of Object.keys(e))a[n]=e[n],o=!0;if(!o)return;const r={type:"gridOptionsChanged",options:a};t.dispatchEvent(r);const i={type:"componentStateChanged",...a};t.dispatchEvent(i)}function I(e,t){return e.addCommon(t)}function _v(e,t){return e[t]??e.gridOptions?.[t]??qi(t)??Ac[t]}function cd({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var Qv={resizable:!0,sortable:!0},Yv=0;function dd(){return Yv++}function dt(e){return e instanceof gt}var Zv=["asc","desc",null],Jv=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],gt=class extends y{constructor(e,t,a,o){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=a,this.primary=o,this.isColumn=!0,this.instanceId=dd(),this.autoHeaderHeight=null,this.sortDef=ze(),this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.formulaRef=null,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new Ct,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=va(a)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:a,colFlex:o}}=this;t?.initCol(this);const r=e.hide;r!==void 0?this.visible=!r:this.visible=!e.initialHide,a?.initCol(this),o?.initCol(this)}setColDef(e,t,a){const o=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),o&&(this.beans.rowSpanSvc?.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",a)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.initState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){const{gos:e,colDef:{field:t,tooltipField:a}}=this,o=e.get("suppressFieldDotNotation");this.fieldContainsDots=z(t)&&t.includes(".")&&!o,this.tooltipFieldContainsDots=z(a)&&a.includes(".")&&!o}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}initRowSpan(){this.colDef.spanRows&&this.beans.rowSpanSvc?.register(this)}addPivotListener(){const e=this.beans.pivotColDefSvc,t=this.colDef.pivotValueColumn;!e||!t||this.addManagedListeners(t,{colDefChanged:a=>{const o=e.recreateColDef(this.colDef);this.setColDef(o,o,a.source)}})}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){const t=e.width??e.initialWidth??200;return Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,e)??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}__addEventListener(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.colEventSvc);const a=this.frameworkEventListenerService?.wrap(e,t)??t;this.colEventSvc.addEventListener(e,a)}removeEventListener(e,t){const a=this.frameworkEventListenerService?.unwrap(e,t)??t;this.colEventSvc.removeEventListener(e,a)}createColumnFunctionCallbackParams(e){return I(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){return this.beans.cellNavigation?.isSuppressNavigable(this,e)??!1}isCellEditable(e){return this.beans.editSvc?.isCellEditable({rowNode:e,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.beans.selectionSvc?.isCellCheckboxSelection(this,e)??!1}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?.suppressPaste??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??Qv[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const a=this.createColumnFunctionCallbackParams(e);return t(a)}return!1}createColumnEvent(e,t){return I(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sortDef.direction}getSortDef(){return this.sortDef.direction?this.sortDef:null}getColDefAllowedSortTypes(){const e=[],{sort:t,initialSort:a}=this.colDef,o=t===null?t:Ye(t?.type),r=a===null?a:Ye(a?.type);return o&&e.push(o),r&&e.push(r),e}getSortingOrder(){const e=this.getColDefAllowedSortTypes().includes("absolute")?Jv:Zv;return(this.colDef.sortingOrder??this.gos.get("sortingOrder")??e).map(t=>ze(t))}getAvailableSortTypes(){const e=this.getSortingOrder().reduce((t,a)=>(a.direction&&t.push(a.type),t),this.getColDefAllowedSortTypes());return new Set(e)}setSortDef(e){this.sortDef=e}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.getSort()==="asc"}isSortDescending(){return this.getSort()==="desc"}isSortNone(){return _(this.getSort())}isSorting(){return z(this.getSort())}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){return x(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const a=e===!0;this.visible!==a&&(this.visible=a,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.colDef.suppressSpanHeaderHeight}getFirstRealParent(){let e=this.getOriginalParent();for(;e?.isPadding();)e=e.getOriginalParent();return e}getColumnGroupPaddingInfo(){let e=this.parent;if(!e?.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let a=!0;for(;e;){if(!e.isPadding()){a=!1;break}e=e.parent}return{numberOfParents:t,isSpanningTotal:a}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return I(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(_(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),a=this.colDef.colSpan(t);return Math.max(a,1)}getRowSpan(e){if(_(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),a=this.colDef.rowSpan(t);return Math.max(a,1)}setActualWidth(e,t,a=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),a||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}isAllowFormula(){return this.colDef.allowFormula===!0}dispatchColEvent(e,t,a){const o=this.createColumnEvent(e,t);a&&he(o,a),this.colEventSvc.dispatchEvent(o)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function ze(e){return Da(e)?{direction:e.direction,type:e.type}:{direction:po(e),type:Ye(e)}}function ut(e){return e==="asc"||e==="desc"||e===null}function Cr(e){return e==="default"||e==="absolute"}function Da(e){if(!e||typeof e!="object")return!1;const t=e;return Cr(t.type)&&ut(t.direction)}function ho(e,t){return e?t?e.type===t.type&&e.direction===t.direction:e?e.direction===null:!0:t?t.direction===null:!0}function po(e){return ut(e)?e:null}function Ye(e){return Cr(e)?e:"default"}function gd(e,t,a){const r=a?.()??t.sortSvc.getDisplaySortForColumn(e),i=Ye(r?.type),n=po(r?.direction),l=e.getAvailableSortTypes(),s=l.has("default"),c=l.has("absolute");return{isDefaultSortAllowed:s,isAbsoluteSortAllowed:c,isAbsoluteSort:i==="absolute",isDefaultSort:i==="default",isAscending:n==="asc",isDescending:n==="desc",direction:n}}function de(e){return e instanceof Aa}var Aa=class extends y{constructor(e,t,a,o){super(),this.colGroupDef=e,this.groupId=t,this.padding=a,this.level=o,this.isColumn=!1,this.expandable=!1,this.instanceId=dd(),this.expandableListenerRemoveCallback=null,this.expanded=!!e?.openByDefault}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}forEachLeafColumn(e){if(this.children)for(const t of this.children)dt(t)?e(t):de(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)dt(t)?e.push(t):de(t)&&t.addLeafColumns(e)}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);for(const t of this.getLeafColumns())t.__addEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=()=>{for(const t of this.getLeafColumns())t.__removeEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,a=!1;const o=this.findChildrenRemovingPadding();for(let i=0,n=o.length;i<n;i++){const l=o[i];if(!l.isVisible())continue;const s=l.getColumnGroupShow();s==="open"?(e=!0,a=!0):s==="closed"?(t=!0,a=!0):(e=!0,t=!0)}const r=e&&t&&a;this.expandable!==r&&(this.expandable=r,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=a=>{for(const o of a)de(o)&&o.isPadding()?t(o.children):e.push(o)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},Xv={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function tn(e,t,a){const o={},r=e.gos;return Object.assign(o,r.get("defaultColGroupDef")),Object.assign(o,t),r.validateColDef(o,a),o}var ud=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=$o(e);let a=0;for(;;){let o=e??t;if(o?a!==0&&(o+="_"+a):o=a,!this.existingKeys[o]){const r=String(o);return e&&a>0&&x(273,{providedId:e,usedId:r}),this.existingKeys[r]=!0,r}a++}}},hd=(e,t)=>{de(e)&&e.setupExpandable(),e.originalParent=t};function $v(e,t=null,a,o,r){const{existingCols:i,existingGroups:n}=fd(o),l=new Map(i.map(f=>[f.getId(),f])),s=new Map(n.map(f=>[f.getId(),f]));let c=0;const d=(f,m)=>{if(c=Math.max(c,m),bd(f)){if(!e.colGroupSvc)return null;const k=f.groupId,S=s.get(k),R=tn(e,f,k),M=new Aa(R,k,!1,m);return e.context.createBean(M),S&&M.setExpanded(S.isExpanded()),M.setChildren(f.children.map(L=>d(L,m+1))),M}const v=f.colId;let w=l.get(v);const b=fo(e,f,w?.colId??v);return w?(w.setColDef(b,f,r),an(e,w,b,r)):(w=new gt(b,f,v,a),e.context.createBean(w)),e.dataTypeSvc?.addColumnListeners(w),w},g=t?.map(f=>d(f,0))??[];let u=0;const h={getUniqueKey:(f,m)=>String(++u)},p=e.colGroupSvc?e.colGroupSvc.balanceColumnTree(g,0,c,h):g;return Ze(null,p,hd),{columnTree:p,treeDepth:c}}function pd(e,t=null,a,o,r){const i=new ud,{existingCols:n,existingGroups:l,existingColKeys:s}=fd(o);i.addExistingKeys(s);const c=md(e,t,0,a,n,i,l,r),{colGroupSvc:d}=e,g=d?.findMaxDepth(c,0)??0,u=d?d.balanceColumnTree(c,0,g,i):c;return Ze(null,u,hd),{columnTree:u,treeDepth:g}}function fd(e){const t=[],a=[],o=[];return e&&Ze(null,e,r=>{if(de(r)){const i=r;a.push(i)}else{const i=r;o.push(i.getId()),t.push(i)}}),{existingCols:t,existingGroups:a,existingColKeys:o}}function md(e,t,a,o,r,i,n,l){if(!t)return[];const{colGroupSvc:s}=e,c=new Array(t.length);for(let d=0;d<c.length;d++){const g=t[d];s&&bd(g)?c[d]=s.createProvidedColumnGroup(o,g,a,r,i,n,l):c[d]=eb(e,o,g,r,i,l)}return c}function eb(e,t,a,o,r,i){const n=tb(a,o);n&&o?.splice(n.idx,1);let l=n?.column;if(l){const s=fo(e,a,l.colId);l.setColDef(s,a,i),an(e,l,s,i)}else{const s=r.getUniqueKey(a.colId,a.field),c=fo(e,a,s);l=new gt(c,a,s,t),e.context.createBean(l)}return e.dataTypeSvc?.addColumnListeners(l),l}function vd(e,t,a,o,r,i,n,l){const{sortSvc:s,pinnedCols:c,colFlex:d}=e;a!==void 0&&t.setVisible(!a,l),s&&(s.updateColSort(t,o,l),r!==void 0&&s.setColSortIndex(t,r)),i!==void 0&&c?.setColPinned(t,i),n!==void 0&&d?.setColFlex(t,n)}function an(e,t,a,o){vd(e,t,a.hide,a.sort,a.sortIndex,a.pinned,a.flex,o);const r=t.getFlex();if(!(r!=null&&r>0))if(a.width!=null)t.setActualWidth(a.width,o);else{const i=t.getActualWidth();t.setActualWidth(i,o)}}function tb(e,t){if(t)for(let a=0;a<t.length;a++){const o=t[a].getUserProvidedColDef();if(!o)continue;if(e.colId!=null){if(t[a].getId()===e.colId)return{idx:a,column:t[a]};continue}if(e.field!=null){if(o.field===e.field)return{idx:a,column:t[a]};continue}if(o===e)return{idx:a,column:t[a]}}}function fo(e,t,a,o){const{gos:r,dataTypeSvc:i}=e,n={},l=r.get("defaultColDef");he(n,l,!1,!0);const s=ab(e,n,t,a);s&&ob(e,s,n);const c=n.cellDataType;he(n,t,!1,!0),c!==void 0&&(n.cellDataType=c);const d=r.get("autoGroupColumnDef"),g=ct(r);return t.rowGroup&&d&&g&&he(n,{sort:d.sort,initialSort:d.initialSort},!1,!0),i?.postProcess(n),i?.validateColDef(n,t,l,a),r.validateColDef(n,a,o),n}function ab(e,t,a,o){const r=e.dataTypeSvc?.updateColDefAndGetColumnType(t,a,o),i=a.type??r??t.type;return t.type=i,i?xr(i):void 0}function ob(e,t,a){if(!t.length)return;const o=Object.assign({},Xv),r=e.gos.get("columnTypes")||{};for(const i of Object.keys(r)){const n=r[i];i in o?x(34,{key:i}):(n.type&&x(35),o[i]=n)}for(const i of t){const n=o[i.trim()];n?he(a,n,!1,!0):x(36,{t:i})}}function bd(e){return e.children!==void 0}function Ze(e,t,a){if(t)for(let o=0;o<t.length;o++){const r=t[o];de(r)&&Ze(r,r.getChildren(),a),a(r,e)}}var ht="ag-Grid-AutoColumn",yr="ag-Grid-SelectionColumn",kr="ag-Grid-RowNumbersColumn",rb="ag-Grid-HierarchyColumn";function on(e){const t=[],a=o=>{for(let r=0;r<o.length;r++){const i=o[r];dt(i)?t.push(i):de(i)&&a(i.getChildren())}};return a(e),t}function pt(e){return e.reduce((t,a)=>t+a.getActualWidth(),0)}function mo(e,t,a){const o={};if(!t)return;Ze(null,t,i=>{o[i.getInstanceId()]=i}),a&&Ze(null,a,i=>{o[i.getInstanceId()]=null});const r=Object.values(o).filter(i=>i!=null);e.context.destroyBeans(r)}function Sr(e){return e.getId().startsWith(ht)}function ft(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(yr)??!1}function pe(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(kr)??!1}function wd(e){return ft(e)||pe(e)}function xr(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function Cd(e,t){return rt(e,t,(a,o)=>a.colId===o.colId)}function yd(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function oa(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function Pa(e,t){return e===t||e.colId==t||e.colDef===t}var ib=(e,t)=>(a,o)=>{const r={value1:void 0,value2:void 0};let i=!1;return e&&(e[a]!==void 0&&(r.value1=e[a],i=!0),z(o)&&e[o]!==void 0&&(r.value2=e[o],i=!0)),!i&&t&&(t[a]!==void 0&&(r.value1=t[a]),z(o)&&t[o]!==void 0&&(r.value2=t[o])),r};function kd(e,t){const a={...e,sort:void 0,colId:t},o=rn(e);return o&&(a.sort=o.direction,a.sortType=o.type),a}function rn(e){const{sort:t,initialSort:a}=e,o=Da(t)||ut(t),r=Da(a)||ut(a);return o?ze(t):r?ze(a):null}function Sd(e,t){return e+"_"+t}function ee(e){return e instanceof Ia}var Ia=class extends y{constructor(e,t,a,o){super(),this.providedColumnGroup=e,this.groupId=t,this.partId=a,this.pinned=o,this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.colIdSanitised=va(this.getUniqueId())}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}getUniqueId(){return Sd(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){for(const e of this.displayedChildren)ee(e)&&e.checkLeft();if(this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=j(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;for(const t of this.displayedChildren??[])e+=t.getActualWidth();return e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;for(const t of this.displayedChildren)t.isResizable()&&(e=!0);return e}getMinWidth(){let e=0;for(const t of this.displayedChildren)e+=t.getMinWidth();return e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}isAutoHeaderHeight(){return!!this.getColGroupDef()?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}addDisplayedLeafColumns(e){for(const t of this.displayedChildren??[])dt(t)?e.push(t):ee(t)&&t.addDisplayedLeafColumns(e)}addLeafColumns(e){for(const t of this.children??[])dt(t)?e.push(t):ee(t)&&t.addLeafColumns(e)}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.parent;return!this.isPadding()||!e?.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e?.isPadding();)e=e.parent;if(!(e?e.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}for(const a of this.children??[]){if(ee(a)&&!a.displayedChildren?.length)continue;switch(a.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(a);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(a);break;default:this.displayedChildren.push(a);break}}this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},Rr="ROOT_NODE_ID",Er="rowGroupFooter_",nn="detail_",xd=Er+Rr,C={BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:" ",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",DELETE:"Delete",F2:"F2",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",PAGE_HOME:"Home",PAGE_END:"End",A:"KeyA",C:"KeyC",D:"KeyD",V:"KeyV",X:"KeyX",Y:"KeyY",Z:"KeyZ"},nb=65,lb=67,sb=86,cb=68,db=90,gb=89;function Rd(e){const{keyCode:t}=e;let a;switch(t){case nb:a=C.A;break;case lb:a=C.C;break;case sb:a=C.V;break;case cb:a=C.D;break;case db:a=C.Z;break;case gb:a=C.Y;break;default:a=e.code}return a}function ub(e){return typeof e.then=="function"}function hb(e,t){return new Y(a=>{a(window.setInterval(e,t))})}var Y=class Xo{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(a=>this.onDone(a),a=>this.onReject(a))}static all(t){return t.length?new Xo(a=>{let o=t.length;const r=new Array(o);t.forEach((i,n)=>{i.then(l=>{r[n]=l,o--,o===0&&a(r)})})}):Xo.resolve()}static resolve(t=null){return new Xo(a=>a(t))}then(t){return new Xo(a=>{this.status===1?a(t(this.resolution)):this.waiters.push(o=>a(t(o)))})}onDone(t){this.status=1,this.resolution=t;for(const a of this.waiters)a(t)}onReject(t){}},Ed=class extends ue{constructor(){super(...arguments),this.beanName="dragAndDrop",this.dragSourceAndParamsList=[],this.dragItem=null,this.dragInitialSourcePointerOffsetX=0,this.dragInitialSourcePointerOffsetY=0,this.lastMouseEvent=null,this.lastDraggingEvent=null,this.dragSource=null,this.dragImageCompPromise=null,this.dragImageComp=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0,this.dropTargets=[],this.externalDropZoneCount=0,this.lastDropTarget=null}addDragSource(e,t=!1){const a={capturePointer:!0,dragSource:e,eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:o=>this.onDragStart(e,o),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push(a),this.beans.dragSvc.addDragSource(a)}setDragImageCompIcon(e,t=!1){const a=this.dragImageComp;a&&(t||this.dragImageLastIcon!==e)&&(this.dragImageLastIcon=e,a.setIcon(e,t))}removeDragSource(e){const{dragSourceAndParamsList:t,beans:a}=this;for(let o=0,r=t.length;o<r;o++)if(t[o].dragSource===e){const i=t[o];a.dragSvc?.removeDragSource(i),t.splice(o,1);break}}destroy(){const{dragSourceAndParamsList:e,dropTargets:t,beans:a}=this,o=a.dragSvc;for(const r of e)o?.removeDragSource(r);e.length=0,t.length=0,this.externalDropZoneCount=0,this.clearDragAndDropProperties(),super.destroy()}nudge(){const e=this.lastMouseEvent;e&&this.onDragging(e,!0)}onDragStart(e,t){this.lastMouseEvent=t,this.dragSource=e,this.dragItem=e.getDragItem();const a=e.eElement.getBoundingClientRect();this.dragInitialSourcePointerOffsetX=t.clientX-a.left,this.dragInitialSourcePointerOffsetY=t.clientY-a.top,e.onDragStarted?.(),this.createAndUpdateDragImageComp(e)}onDragStop(e){const{dragSource:t,lastDropTarget:a}=this;if(t?.onDragStopped?.(),a){const o=this.dropTargetEvent(a,e,!1);a.onDragStop?.(o)}this.clearDragAndDropProperties()}onDragCancel(){const{dragSource:e,lastDropTarget:t,lastMouseEvent:a}=this;if(e?.onDragCancelled?.(),t&&a){const o=this.dropTargetEvent(t,a,!1);t.onDragCancel?.(o)}this.clearDragAndDropProperties()}onDragging(e,t=!1){this.positionDragImageComp(e);const a=this.findCurrentDropTarget(e),{lastDropTarget:o,dragSource:r,dragItem:i}=this;let n=!1;if(a!==o){if(n=!0,o){const l=this.dropTargetEvent(o,e,t);o.onDragLeave?.(l)}if(o!==null&&!a?this.handleExit(r,i):o===null&&a&&this.handleEnter(r,i),a){const l=this.dropTargetEvent(a,e,t);a.onDragEnter?.(l)}this.lastDropTarget=a}else if(a){const l=this.dropTargetEvent(a,e,t);a.onDragging?.(l),l?.changed&&(n=!0)}this.lastMouseEvent=e,n&&this.updateDragImageComp()}clearDragAndDropProperties(){this.removeDragImageComp(this.dragImageComp),this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0,this.lastMouseEvent=null,this.lastDraggingEvent=null,this.lastDropTarget=null,this.dragItem=null,this.dragInitialSourcePointerOffsetX=0,this.dragInitialSourcePointerOffsetY=0,this.dragSource=null}getAllContainersFromDropTarget(e){const t=e.getContainer(),a=e.getSecondaryContainers?.(),o=a?.length;if(!o)return[[t]];const r=new Array(o+1);r[0]=[t];for(let i=0;i<o;++i)r[i+1]=a[i];return r}isMouseOnDropTarget(e,t){const a=this.getAllContainersFromDropTarget(t);let o=!1;const r=(l,s)=>{for(const c of s){const{width:d,height:g,left:u,right:h,top:p,bottom:f}=c.getBoundingClientRect();if(d===0||g===0)return!1;const m=l.clientX>=u&&l.clientX<h,v=l.clientY>=p&&l.clientY<f;if(!m||!v)return!1}return!0};for(const l of a)if(r(e,l)){o=!0;break}const{eElement:i,type:n}=this.dragSource;return t.targetContainsSource&&!t.getContainer().contains(i)?!1:o&&t.isInterestedIn(n,i)}findCurrentDropTarget(e){const t=[],a=this.dropTargets;for(let n=0,l=a.length;n<l;++n){const s=a[n];this.isMouseOnDropTarget(e,s)&&t.push(s)}const o=t.length;if(o===0)return null;if(o===1)return t[0];const i=Ie(this.beans).elementsFromPoint(e.clientX,e.clientY);for(let n=0,l=i.length;n<l;++n){const s=i[n];for(let c=0,d=t.length;c<d;c++){const g=t[c],u=this.getAllContainersFromDropTarget(g);let h=!1;for(let p=0,f=u.length;p<f&&!h;p++){const m=u[p];for(let v=0,w=m.length;v<w;v++)if(m[v]===s){h=!0;break}}if(h)return g}}return null}addDropTarget(e){this.dropTargets.push(e),e.external&&this.externalDropZoneCount++}removeDropTarget(e){const t=e.getContainer(),a=this.dropTargets;let o=0;for(let r=0,i=a.length;r<i;++r){const n=a[r];if(n.getContainer()===t){n.external&&--this.externalDropZoneCount;continue}o!==r&&(a[o]=n),++o}a.length=o}hasExternalDropZones(){return this.externalDropZoneCount>0}findExternalZone(e){const t=this.dropTargets;for(let a=0,o=t.length;a<o;++a){const r=t[a];if(r.external&&r.getContainer()===e)return r}return null}dropTargetEvent(e,t,a){const{dragSource:o,dragItem:r,lastDraggingEvent:i,lastMouseEvent:n,dragInitialSourcePointerOffsetX:l,dragInitialSourcePointerOffsetY:s}=this,c=e.getContainer(),d=c.getBoundingClientRect(),{clientX:g,clientY:u}=t,h=g-(n?.clientX||0),p=u-(n?.clientY||0),f=this.createEvent({event:t,x:g-d.left,y:u-d.top,vDirection:p>0?"down":p<0?"up":null,hDirection:h<0?"left":h>0?"right":null,initialSourcePointerOffsetX:l,initialSourcePointerOffsetY:s,dragSource:o,fromNudge:a,dragItem:r,dropZoneTarget:c,dropTarget:i?.dropTarget??null,changed:!!i?.changed});return this.lastDraggingEvent=f,f}positionDragImageComp(e){const t=this.dragImageComp?.getGui();t&&Sc(t,e,this.beans)}removeDragImageComp(e){this.dragImageComp===e&&(this.dragImageComp=null),e&&(e.getGui()?.remove(),this.destroyBean(e))}createAndUpdateDragImageComp(e){const t=this.createDragImageComp(e)??null;this.dragImageCompPromise=t,t?.then(a=>{const o=this.lastMouseEvent;if(t!==this.dragImageCompPromise||!o||!this.isAlive()){this.destroyBean(a);return}this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0;const r=this.dragImageComp;r!==a&&(this.dragImageComp=a,this.removeDragImageComp(r)),a&&(this.appendDragImageComp(a),this.updateDragImageComp(),this.positionDragImageComp(o))})}appendDragImageComp(e){const t=e.getGui(),a=t.style;a.position="absolute",a.zIndex="9999",this.beans.dragSvc?.hasPointerCapture()&&(a.pointerEvents="none"),this.gos.setInstanceDomData(t),this.beans.environment.applyThemeClasses(t),a.top="20px",a.left="20px";const o=ar(this.beans);o?o.appendChild(t):this.warnNoBody()}updateDragImageComp(){const{dragImageComp:e,dragSource:t,lastDropTarget:a,lastDraggingEvent:o,dragImageLastLabel:r}=this;if(!e)return;this.setDragImageCompIcon(a?.getIconName?.(o)??null);let i=t?.dragItemName;typeof i=="function"&&(i=i(o)),i||(i=""),r!==i&&(this.dragImageLastLabel=i,e.setLabel(i))}};function Fd(e){return typeof e=="object"&&!!e.component}function pb(e){return e?e.prototype&&"getGui"in e.prototype:!1}function Md(e,t,a,o){const{name:r}=a;let i,n,l,s,c,d;if(t){const g=t,u=g[r+"Selector"],h=u?u(o):null,p=f=>{typeof f=="string"?i=f:f!=null&&f!==!0&&(e.isFrameworkComponent(f)?l=f:n=f)};h?(p(h.component),s=h.params,c=h.popup,d=h.popupPosition):p(g[r])}return{compName:i,jsComp:n,fwComp:l,paramsFromSelector:s,popupFromSelector:c,popupPositionFromSelector:d}}var fb=class extends y{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,a,o=!1){return this.getCompDetails(this.gridOptions,e,t,a,o)}getCompDetails(e,t,a,o,r=!1){const{name:i,cellRenderer:n}=t;let{compName:l,jsComp:s,fwComp:c,paramsFromSelector:d,popupFromSelector:g,popupPositionFromSelector:u}=Md(this.beans.frameworkOverrides,e,t,o),h,p;const f=b=>{const k=this.registry.getUserComponent(i,b);k&&(s=k.componentFromFramework?void 0:k.component,c=k.componentFromFramework?k.component:void 0,h=k.params,p=k.processParams)};if(l!=null&&f(l),s==null&&c==null&&a!=null&&f(a),s&&n&&!pb(s)&&(s=this.agCompUtils?.adaptFunction(t,s)),!s&&!c){const{validation:b}=this.beans;r&&(l!==a||!a)?l?b?.isProvidedUserComp(l)||q(50,{compName:l}):a?b||q(260,{...this.gos.getModuleErrorParams(),propName:i,compName:a}):q(216,{name:i}):a&&!b&&q(146,{comp:a});return}const m=this.mergeParams(e,t,o,d,h,p),v=s==null,w=s??c;return{componentFromFramework:v,componentClass:w,params:m,type:t,popupFromSelector:g,popupPositionFromSelector:u,newAgStackInstance:()=>this.newAgStackInstance(w,v,m,t)}}newAgStackInstance(e,t,a,o){const r=!t;let i;r?i=new e:i=this.frameworkCompWrapper.wrap(e,o.mandatoryMethods,o.optionalMethods,o),this.createBean(i);const n=i.init?.(a);return n==null?Y.resolve(i):n.then(()=>i)}mergeParams(e,t,a,o=null,r,i){const n={...a,...r},s=e?.[t.name+"Params"];if(typeof s=="function"){const c=s(a);he(n,c)}else typeof s=="object"&&he(n,s);return he(n,o),i?i(n):n}},mb={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},vb={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},bb={name:"headerComponent",optionalMethods:["refresh"]},wb={name:"innerHeaderComponent"},Cb={name:"innerHeaderGroupComponent"},yb={name:"headerGroupComponent"},kb={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},Sb={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},xb={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},Rb={name:"loadingCellRenderer",cellRenderer:!0},Eb={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},Fb={name:"tooltipComponent"},ln={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},Mb={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},zb={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},Db={name:"loadingCellRenderer",cellRenderer:!0},Ab={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},Pb={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function Ib(e,t){return e.getCompDetailsFromGridOptions(vb,"agDragAndDropImage",t,!0)}function Tb(e,t,a){return e.getCompDetails(t,kb,void 0,a)}function Lb(e,t,a){return e.getCompDetails(t,bb,"agColumnHeader",a)}function Bb(e,t,a){return e.getCompDetails(t,wb,void 0,a)}function Ob(e,t){const a=t.columnGroup.getColGroupDef();return e.getCompDetails(a,yb,"agColumnGroupHeader",t)}function Nb(e,t,a){return e.getCompDetails(t,Cb,void 0,a)}function Hb(e,t){return e.getCompDetailsFromGridOptions(zb,void 0,t,!0)}function Gb(e,t){return e.getCompDetailsFromGridOptions(Db,"agLoadingCellRenderer",t,!0)}function Vb(e,t){return e.getCompDetailsFromGridOptions(Ab,"agGroupRowRenderer",t,!0)}function qb(e,t){return e.getCompDetailsFromGridOptions(Pb,"agDetailCellRenderer",t,!0)}function sn(e,t,a){return e.getCompDetails(t,Sb,void 0,a)}function Wb(e,t,a){return e.getCompDetails(t,xb,void 0,a)}function zd(e,t,a){return e.getCompDetails(t,Rb,"agSkeletonCellRenderer",a,!0)}function Dd(e,t,a){return e.getCompDetails(t,Eb,"agCellEditor",a,!0)}function Ad(e,t,a,o){const r=t.filter;return Fd(r)&&(t={filter:r.component,filterParams:t.filterParams}),e.getCompDetails(t,ln,o,a,!0)}function Ub(e,t,a){return e.getCompDetails(t,mb,"agDateInput",a,!0)}function jb(e,t){return e.getCompDetails(t.colDef,Fb,"agTooltipComponent",t,!0)}function Pd(e,t,a,o){return e.getCompDetails(t,Mb,o,a)}function Id(e,t){return Md(e,t,ln)}function cn(e,t,a){return e.mergeParams(t,ln,a)}var Td=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(Td||{}),Kb=class extends Ed{createEvent(e){return I(this.gos,e)}createDragImageComp(e){const{gos:t,beans:a}=this;return Ib(a.userCompFactory,I(t,{dragSource:e}))?.newAgStackInstance()}handleEnter(e,t){e?.onGridEnter?.(t)}handleExit(e,t){e?.onGridExit?.(t)}warnNoBody(){x(54)}isDropZoneWithinThisGrid(e){return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(e.dropZoneTarget)}registerGridDropTarget(e,t){const a={getContainer:e,isInterestedIn:o=>o===1||o===0,getIconName:()=>"notAllowed"};this.addDropTarget(a),t.addDestroyFunc(()=>this.removeDropTarget(a))}};function dn(e){return!!e.operator}var Ld="ag-resizer-wrapper",Ft=(e,t)=>({tag:"div",ref:`${e}Resizer`,cls:`ag-resizer ag-resizer-${t}`}),_b={tag:"div",cls:Ld,children:[Ft("eTopLeft","topLeft"),Ft("eTop","top"),Ft("eTopRight","topRight"),Ft("eRight","right"),Ft("eBottomRight","bottomRight"),Ft("eBottom","bottom"),Ft("eBottomLeft","bottomLeft"),Ft("eLeft","left")]},Bd=class extends ue{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config={popup:!1,...t}}wireBeans(e){this.popupSvc=e.popupSvc,this.dragSvc=e.dragSvc}center(e){const{clientHeight:t,clientWidth:a}=this.offsetParent,o=a/2-this.getWidth()/2,r=t/2-this.getHeight()/2;this.offsetElement(o,r,e)}initialisePosition(e){if(this.positioned)return;const{centered:t,forcePopupParentAsOffsetParent:a,minWidth:o,width:r,minHeight:i,height:n,x:l,y:s}=this.config;this.offsetParent||this.setOffsetParent();let c=0,d=0;const g=Me(this.element);if(g){const u=this.findBoundaryElement(),h=window.getComputedStyle(u);if(h.minWidth!=null){const p=u.offsetWidth-this.element.offsetWidth;d=Number.parseInt(h.minWidth,10)-p}if(h.minHeight!=null){const p=u.offsetHeight-this.element.offsetHeight;c=Number.parseInt(h.minHeight,10)-p}}if(this.minHeight=i||c,this.minWidth=o||d,r&&this.setWidth(r),n&&this.setHeight(n),(!r||!n)&&this.refreshSize(),t)this.center(e);else if(l||s)this.offsetElement(l,s,e);else if(g&&a){let u=this.boundaryEl,h=!0;if(u||(u=this.findBoundaryElement(),h=!1),u){const p=Number.parseFloat(u.style.top),f=Number.parseFloat(u.style.left);h?this.offsetElement(Number.isNaN(f)?0:f,Number.isNaN(p)?0:p,e):this.setPosition(f,p)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const a=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragSvc?.addDragSource(a),this.moveElementDragListener=a):(this.dragSvc?.removeDragSource(a),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),typeof e=="boolean"){if(e===!1)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}for(const t of Object.keys(e)){const a=!!e[t],o=this.getResizerElement(t),r={dragStartPixels:0,eElement:o,onDragStart:i=>this.onResizeStart(i,t),onDragging:this.onResize.bind(this),onDragStop:i=>this.onResizeEnd(i,t)};(a||!this.isAlive()&&!a)&&(a?(this.dragSvc?.addDragSource(r),this.resizeListeners.push(r),o.style.pointerEvents="all"):o.style.pointerEvents="none",this.resizable[t]=a)}}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;t!==-1&&(this.element.style.width=`${t}px`),e!==-1&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,a=this.element;let o=!1;if(typeof e=="string"&&e.includes("%"))ao(a,e),e=Ti(a),o=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const r=this.getAvailableHeight();r&&e>r&&(e=r)}this.getHeight()!==e&&(o?(a.style.maxHeight="unset",a.style.minHeight="unset"):t?ao(a,e):(a.style.height=`${e}px`,a.style.flex="0 0 auto",this.lastSize.height=typeof e=="number"?e:Number.parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:a}=this.offsetParent;if(!a)return null;const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),i=e?this.position.y:o.top,n=e?0:r.top;let l=0;if(t){const c=this.element.parentElement;if(c){const{bottom:d}=c.getBoundingClientRect();l=d-o.bottom}}return a+n-i-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:a}=this.config;let o=!1;if(typeof e=="string"&&e.includes("%"))He(t,e),e=$a(t),o=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:r}=this.offsetParent,i=a?this.position.x:this.element.getBoundingClientRect().left;r&&e+i>r&&(e=r-i)}this.getWidth()!==e&&(o?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?He(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width=typeof e=="number"?e:Number.parseFloat(e)))}offsetElement(e=0,t=0,a){const{forcePopupParentAsOffsetParent:o}=this.config,r=o?this.boundaryEl:this.element;r&&(this.popupSvc?.positionPopup({ePopup:r,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t}),postProcessCallback:a}),this.setPosition(Number.parseFloat(r.style.left),Number.parseFloat(r.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const a=this.getAvailableHeight();this.element.style.setProperty("max-height",`${a}px`)};e&&this.popupSvc?(this.resizeObserverSubscriber?.(),this.resizeObserverSubscriber=it(this.beans,this.popupSvc?.getPopupParent(),t)):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:a,isTop:o,anywhereWithin:r,topBuffer:i}=e,n=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y,s=this.shouldSkipX(t,!!a,!!r,n)?0:n,c=this.shouldSkipY(t,!!o,i,l)?0:l;return{movementX:s,movementY:c}}shouldSkipX(e,t,a,o){const r=this.element.getBoundingClientRect(),i=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:r.left;let s=l<=0&&i.left>=e.clientX||i.right<=e.clientX&&i.right<=n.right;return s?!0:(t?s=o<0&&e.clientX>l+i.left||o>0&&e.clientX<l+i.left:a?s=o<0&&e.clientX>n.right||o>0&&e.clientX<l+i.left:s=o<0&&e.clientX>n.right||o>0&&e.clientX<n.right,s)}shouldSkipY(e,t,a=0,o){const r=this.element.getBoundingClientRect(),i=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:r.top;let s=l<=0&&i.top>=e.clientY||i.bottom<=e.clientY&&i.bottom<=n.bottom;return s?!0:(t?s=o<0&&e.clientY>l+i.top+a||o>0&&e.clientY<l+i.top:s=o<0&&e.clientY>n.bottom||o>0&&e.clientY<n.bottom,s)}createResizeMap(){const e=t=>({element:this.element.querySelector(`[data-ref=${t}Resizer]`)});this.resizerMap={topLeft:e("eTopLeft"),top:e("eTop"),topRight:e("eTopRight"),right:e("eRight"),bottomRight:e("eBottomRight"),bottom:e("eBottom"),bottomLeft:e("eBottomLeft"),left:e("eLeft")}}addResizers(){if(this.resizersAdded)return;const e=this.element;e&&(e.appendChild(yt(_b)),this.createResizeMap(),this.resizersAdded=!0)}removeResizers(){this.resizerMap=void 0,this.element.querySelector(`.${Ld}`)?.remove(),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:a,forcePopupParentAsOffsetParent:o}=this.config;!a&&!o&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const t=this.element.parentElement;return t?Array.prototype.slice.call(t.children).filter(a=>!a.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,a=0;for(const o of e){const r=!!o.style.flex&&o.style.flex!=="0 0 auto";if(o===this.element)continue;let i=this.minHeight||0,n=this.minWidth||0;if(r){const l=window.getComputedStyle(o);l.minHeight&&(i=Number.parseInt(l.minHeight,10)),l.minWidth&&(n=Number.parseInt(l.minWidth,10))}else i=o.offsetHeight,n=o.offsetWidth;t+=i,a+=n}return{height:t,width:a}}applySizeToSiblings(e){let t=null;const a=this.getSiblings();if(a){for(let o=0;o<a.length;o++){const r=a[o];r!==t&&(e?r.style.height=`${r.offsetHeight}px`:r.style.width=`${r.offsetWidth}px`,r.style.flex="0 0 auto",r===this.element&&(t=a[o+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:a}=this.config,{isTop:o,isRight:r,isBottom:i,isLeft:n}=this.currentResizer,l=r||n,s=i||o,{movementX:c,movementY:d}=this.calculateMouseMovement({e,isLeft:n,isTop:o}),g=this.position.x,u=this.position.y;let h=0,p=0;if(l&&c){const f=n?-1:1,m=this.getWidth(),v=m+c*f;let w=!1;n&&(h=m-v,(g+h<=0||v<=this.minWidth)&&(w=!0,h=0)),w||this.setWidth(v)}if(s&&d){const f=o?-1:1,m=this.getHeight(),v=m+d*f;let w=!1;o?(p=m-v,(u+p<=0||v<=this.minHeight)&&(w=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&m<v&&this.getMinSizeOfSiblings().height+v>this.element.parentElement.offsetHeight&&(w=!0),w||this.setHeight(v)}this.updateDragStartPosition(e.clientX,e.clientY),((t||a)&&h||p)&&this.offsetElement(g+h,u+p)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:a}=this.position;let o;this.config.calculateTopBuffer&&(o=this.config.calculateTopBuffer());const{movementX:r,movementY:i}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:o});this.offsetElement(t+r,a+i),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent&&this.popupSvc?this.offsetParent=this.popupSvc.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragSvc?.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragSvc?.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},Od=class extends Bd{},E=null;function gn(e){return typeof e?.getGui=="function"}var un=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){if(!e)return;if(e.includes(" ")){const o=(e||"").split(" ");if(o.length>1){for(const r of o)this.toggleCss(r,t);return}}this.cssClassStates[e]!==t&&e.length&&(this.getGui()?.classList.toggle(e,t),this.cssClassStates[e]=t)}},Qb=0,ra=class extends ue{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=Qb++,this.cssManager=new un(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(a=>[a.selector,a])),e&&this.setTemplate(e)}preConstruct(){this.wireTemplate(this.getGui()),this.addGlobalCss()}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute(wc):null}applyElementsToComponent(e,t,a,o=null){if(t===void 0&&(t=this.getDataRefAttribute(e)),t){const r=this[t];if(r===E)this[t]=o??e;else{const i=a?.[t];if(!this.suppressDataRefValidation&&!i)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${r}`)}}}createChildComponentsFromTags(e,t){const a=[];for(const o of e.childNodes??[])a.push(o);for(const o of a){if(!(o instanceof HTMLElement))continue;const r=this.createComponentFromElement(o,i=>{const n=i.getGui();if(n)for(const l of o.attributes??[])n.setAttribute(l.name,l.value)},t);if(r){if(r.addItems&&o.children.length){this.createChildComponentsFromTags(o,t);const i=Array.prototype.slice.call(o.children);r.addItems(i)}this.swapComponentForNode(r,e,o)}else o.childNodes&&this.createChildComponentsFromTags(o,t)}}createComponentFromElement(e,t,a){const o=e.nodeName,r=this.getDataRefAttribute(e),i=o.indexOf("AG-")===0,n=i?this.componentSelectors.get(o):null;let l=null;if(n){const s=a&&r?a[r]:void 0;l=new n.component(s),l.setParentComponent(this),this.createBean(l,null,t)}else if(i)throw new Error(`selector: ${o}`);return this.applyElementsToComponent(e,r,a,l),l}swapComponentForNode(e,t,a){const o=e.getGui();t.replaceChild(o,a),t.insertBefore(document.createComment(a.nodeName),o),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e,t){const a=t??this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const o of e)o.setAttribute("tabindex",a.toString())}setTemplate(e,t,a){let o;typeof e=="string"||e==null?o=cr(e):o=yt(e),this.setTemplateFromElement(o,t,a)}setTemplateFromElement(e,t,a,o=!1){if(this.eGui=e,this.suppressDataRefValidation=o,t)for(let r=0;r<t.length;r++){const i=t[r];this.componentSelectors.set(i.selector,i)}this.wireTemplate(e,a)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let a=t;return e==null?null:(a||(a=this.eGui),gr(e)?{element:e,parent:a}:{element:e.getGui(),parent:a})}prependChild(e,t){const{element:a,parent:o}=this.getContainerAndElement(e,t)||{};!a||!o||o.prepend(a)}appendChild(e,t){const{element:a,parent:o}=this.getContainerAndElement(e,t)||{};!a||!o||o.appendChild(a)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:a}=t;uc(this.eGui,e,{skipAriaHidden:a})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:a}=t;U(this.eGui,e,{skipAriaHidden:a});const o={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(o)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),super.destroy()}addGuiEventListener(e,t,a){this.eGui.addEventListener(e,t,a),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCss(e){this.cssManager.toggleCss(e,!0)}removeCss(e){this.cssManager.toggleCss(e,!1)}toggleCss(e,t){this.cssManager.toggleCss(e,t)}registerCSS(e){this.css===Nd?(this.css=[e],this.addGlobalCss()):(this.css||(this.css=[]),this.css.push(e))}addGlobalCss(){if(Array.isArray(this.css)){const e="component-"+Object.getPrototypeOf(this)?.constructor?.name;for(const t of this.css??[])this.beans.environment.addGlobalCSS(t,e)}this.css=Nd}},Nd=Symbol(),V=class extends ra{},hn,pn,fn,mn,vn,bn,wn;function mt(){return hn===void 0&&(hn=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),hn}function ia(){return pn===void 0&&(pn=/(firefox)/i.test(navigator.userAgent)),pn}function Hd(){return fn===void 0&&(fn=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),fn}function Mt(){return mn===void 0&&(mn=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),mn}function Cn(e){if(!e)return null;const t=e.tabIndex,a=e.getAttribute("tabIndex");return t===-1&&(a===null||a===""&&!ia())?null:t.toString()}function Yb(){if(wn!==void 0)return wn;if(!document.body)return-1;let e=1e6;const t=ia()?6e6:1e9,a=document.createElement("div");for(document.body.appendChild(a);;){const o=e*2;if(a.style.height=o+"px",o>t||a.clientHeight!==o)break;e=o}return a.remove(),wn=e,e}function yn(){return bn==null&&Gd(),bn}function Gd(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let a=t.offsetWidth-t.clientWidth;a===0&&t.clientWidth===0&&(a=null),t.parentNode&&t.remove(),a!=null&&(bn=a,vn=a===0)}function Vd(){return vn==null&&Gd(),vn}var kn=!1,Fr=0;function Zb(e){Fr>0||(e.addEventListener("keydown",Mr),e.addEventListener("mousedown",Mr))}function Jb(e){Fr>0||(e.removeEventListener("keydown",Mr),e.removeEventListener("mousedown",Mr))}function Mr(e){const t=kn,a=e.type==="keydown";a&&(e.ctrlKey||e.metaKey||e.altKey)||t!==a&&(kn=a)}function Xb(e){const t=oe(e);return Zb(t),Fr++,()=>{Fr--,Jb(t)}}function Sn(){return kn}function zt(e,t,a=!1){const o=ov;let r=gc;t&&(r+=", "+t),a&&(r+=', [tabindex="-1"]');const i=Array.prototype.slice.apply(e.querySelectorAll(o)).filter(s=>Me(s)),n=Array.prototype.slice.apply(e.querySelectorAll(r));return n.length?((s,c)=>s.filter(d=>c.indexOf(d)===-1))(i,n):i}function Dt(e,t=!1,a=!1,o=!1){const r=zt(e,o?".ag-tab-guard":null,a),i=t?j(r):r[0];return i?(i.focus({preventScroll:!0}),!0):!1}function At(e,t,a,o){const r=zt(t,a?':not([tabindex="-1"])':null),i=Q(e);let n;a?n=r.findIndex(s=>s.contains(i)):n=r.indexOf(i);const l=n+(o?-1:1);return l<0||l>=r.length?null:r[l]}function xn(e,t=5){let a=0;for(;e&&Cn(e)===null&&++a<=t;)e=e.parentElement;return Cn(e)===null?null:e}var qd="ag-focus-managed",Wd=class extends ue{constructor(e,t={isStopPropagation:()=>!1,stopPropagation:()=>{}},a={}){super(),this.eFocusable=e,this.stopPropagationCallbacks=t,this.callbacks=a,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:o=>{if(o.defaultPrevented)return;const r=At(this.beans,this.eFocusable,!1,o.shiftKey);r&&(r.focus(),o.preventDefault())},...a}}postConstruct(){const{eFocusable:e,callbacks:{onFocusIn:t,onFocusOut:a}}=this;e.classList.add(qd),this.addKeyDownListeners(e),t&&this.addManagedElementListeners(e,{focusin:t}),a&&this.addManagedElementListeners(e,{focusout:a})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:t=>{if(t.defaultPrevented||this.stopPropagationCallbacks.isStopPropagation(t))return;const{callbacks:a}=this;if(a.shouldStopEventPropagation(t)){this.stopPropagationCallbacks.stopPropagation(t);return}t.key===C.TAB?a.onTabKeyDown(t):a.handleKeyDown&&a.handleKeyDown(t)}})}},Ud="__ag_Grid_Stop_Propagation";function Pt(e){e[Ud]=!0}function Je(e){return e[Ud]===!0}var vo={isStopPropagation:Je,stopPropagation:Pt},Ta=class extends Wd{constructor(e,t){super(e,vo,t)}},$b={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",bigintFilter:"BigInt Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd",filterSummaryInactive:"is (All)",filterSummaryContains:"contains",filterSummaryNotContains:"does not contain",filterSummaryTextEquals:"equals",filterSummaryTextNotEqual:"does not equal",filterSummaryStartsWith:"begins with",filterSummaryEndsWith:"ends with",filterSummaryBlank:"is blank",filterSummaryNotBlank:"is not blank",filterSummaryEquals:"=",filterSummaryNotEqual:"!=",filterSummaryGreaterThan:">",filterSummaryGreaterThanOrEqual:">=",filterSummaryLessThan:"<",filterSummaryLessThanOrEqual:"<=",filterSummaryInRange:"between",yesterday:"Yesterday",today:"Today",tomorrow:"Tomorrow",last7Days:"Last 7 Days",lastWeek:"Last Week",thisWeek:"This Week",nextWeek:"Next Week",last30Days:"Last 30 Days",lastMonth:"Last Month",thisMonth:"This Month",nextMonth:"Next Month",last90Days:"Last 90 Days",lastQuarter:"Last Quarter",thisQuarter:"This Quarter",nextQuarter:"Next Quarter",lastYear:"Last Year",thisYear:"This Year",yearToDate:"Year To Date",nextYear:"Next Year",last6Months:"Last 6 Months",last12Months:"Last 12 Months",last24Months:"Last 24 Months",filterSummaryInRangeValues:e=>`(${e[0]}, ${e[1]})`,filterSummaryTextQuote:e=>`"${e[0]}"`,minDateValidation:e=>`Date must be after ${e[0]}`,maxDateValidation:e=>`Date must be before ${e[0]}`,strictMinValueValidation:e=>`Must be greater than ${e[0]}`,strictMaxValueValidation:e=>`Must be less than ${e[0]}`};function Te(e,t,a){return xc(e,$b,t,a)}function Rn(e,t){const{debounceMs:a}=e;return bo(e)?(a!=null&&x(71),0):a??t}function bo(e){return(e.buttons?.indexOf("apply")??-1)>=0}function jd(e,t,a,o){let r=Te(e,a);if(typeof t=="function"){const i=Te(e,o);r=t({filterOptionKey:o,filterOption:i,placeholder:r})}else typeof t=="string"&&(r=t);return r}var Kd=class extends V{constructor(e,t){super(),this.filterNameKey=e,this.cssIdentifier=t,this.applyActive=!1,this.debouncePending=!1,this.defaultDebounceMs=0}postConstruct(){const e={tag:"div",cls:`ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,children:[this.createBodyTemplate()]};this.setTemplate(e,this.getAgComponents()),this.createManagedBean(new Ta(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=this.createBean(new Od(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}))}handleKeyDown(e){}init(e){const t=e;this.setParams(t),this.setModelIntoUi(t.state.model,!0).then(()=>this.updateUiVisibility())}areStatesEqual(e,t){return e===t}refresh(e){const t=e,a=this.params;this.params=t;const{source:o,state:r,additionalEventAttributes:i}=t;o==="colDef"&&this.updateParams(t,a);const n=this.state;this.state=r;const l=i?.fromAction;return(l&&l!=="apply"||r.model!==n.model||!this.areStatesEqual(r.state,n.state))&&this.setModelIntoUi(r.model),!0}setParams(e){this.params=e,this.state=e.state,this.commonUpdateParams(e)}updateParams(e,t){this.commonUpdateParams(e,t)}commonUpdateParams(e,t){this.applyActive=bo(e),this.setupApplyDebounced()}doesFilterPass(e){x(283);const{getHandler:t,model:a,column:o}=this.params;return t().doesFilterPass({...e,model:a,handlerParams:this.beans.colFilter.getHandlerParams(o)})}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return x(284),this.params.model!=null}setupApplyDebounced(){const e=Rn(this.params,this.defaultDebounceMs),t=te(this,this.checkApplyDebounce.bind(this),e);this.applyDebounced=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.doApplyModel())}getModel(){return x(285),this.params.model}setModel(e){x(286);const{beans:t,params:a}=this;return t.colFilter.setModelForColumnLegacy(a.column,e)}applyModel(e="api"){return this.doApplyModel()}canApply(e){return!0}doApplyModel(e){const{params:t,state:{valid:a=!0,model:o}}=this;if(!a)return!1;const r=!this.areModelsEqual(t.model,o);return r&&t.onAction("apply",e),r}onNewRowsLoaded(){}onUiChanged(e,t=!1){this.updateUiVisibility();const a=this.getModelFromUi(),o={model:a,state:this.getState(),valid:this.canApply(a)};this.state=o;const{params:r,gos:i,eventSvc:n,applyActive:l}=this;r.onStateChange(o),r.onUiChange(this.getUiChangeEventParams()),i.get("enableFilterHandlers")||n.dispatchEvent({type:"filterModified",column:r.column,filterInstance:this}),o.valid&&(e??(e=l?void 0:"debounce"),e==="immediately"?this.doApplyModel({afterFloatingFilter:t,afterDataChange:!1}):e==="debounce"&&this.applyDebounced())}getState(){}getUiChangeEventParams(){}afterGuiAttached(e){this.lastContainerType=e?.container,this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){const{positionableFeature:t,gos:a}=this;if(!t)return;const o=e==="floatingFilter"||e==="columnFilter";o?(t.restoreLastSize(),t.setResizable(a.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(t.removeSizeFromEl(),t.setResizable(!1)),t.constrainSizeToAvailableHeight(o)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}destroy(){this.positionableFeature=this.destroyBean(this.positionableFeature),super.destroy()}translate(e,t){return Te(this,e,t)}getPositionableElement(){return this.getGui()}areModelsEqual(e,t){return e===t||e==null&&t==null?!0:e==null||t==null?!1:this.areNonNullModelsEqual(e,t)}},ew=["aggregation","filter","sort","pivot","columnVisibility","columnSizing","rowGroup"],zr=class extends ra{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e?.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},wo=class extends zr{constructor(){super(...arguments),this.errorMessages=null}init(e){this.params=e,this.initialiseEditor(e),this.eEditor.onValueChange(()=>e.validate())}destroy(){this.eEditor.destroy(),this.errorMessages=null,super.destroy()}};function Ve(e){const t=e.rowModel;return t.getType()==="clientSide"?t:void 0}function Dr(e){const t=e.rowModel;return t.getType()==="infinite"?t:void 0}function _d(e){const t=e.rowModel;return t.getType()==="serverSide"?t:void 0}function tw(e){const t=e.rowModel;return t.getType()==="viewport"?t:void 0}var En="row-group-",Ar="t-",Pr="b-",aw=0,vt=class{constructor(e){this.id=void 0,this.destroyed=!1,this._groupData=void 0,this.master=!1,this.detail=void 0,this.rowIndex=null,this.field=null,this.rowGroupColumn=null,this.key=null,this.sourceRowIndex=-1,this._leafs=void 0,this.childrenAfterGroup=null,this.childrenAfterFilter=null,this.childrenAfterAggFilter=null,this.childrenAfterSort=null,this.allChildrenCount=null,this.childrenMapped=null,this.treeParent=null,this.treeNodeFlags=0,this._expanded=void 0,this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=aw++,this.alreadyRendered=!1,this.formulaRowIndex=null,this.hovered=!1,this.__selected=!1,this.beans=e}get groupData(){const e=this._groupData;return e!==void 0?e:this.footer?this.sibling?.groupData:this.beans.groupStage?.loadGroupData(this)??null}set groupData(e){this._groupData=e}get primaryRow(){let e=this.footer&&this.sibling||this;if(e.rowPinned){const t=e.pinnedSibling;t&&(e=t,e.footer&&(e=e.sibling??e))}return e}get allLeafChildren(){const e=this._leafs;return e===void 0?this.beans.groupStage?.loadLeafs?.(this)??null:e}set allLeafChildren(e){this._leafs=e}get expanded(){const e=this.beans.expansionSvc;return e?e.isExpanded(this):this.level===-1?!0:!!this._expanded}set expanded(e){this._expanded=e}setData(e){this.setDataCommon(e,"set")}updateData(e){this.setDataCommon(e,"update")}_updateDataNoSibling(e){this.setDataCommon(e,"updateNoSibling")}setDataCommon(e,t){const{valueCache:a,eventSvc:o}=this.beans,r=this.data,i=t!=="set";this.data=e,a?.onDataChanged(),this.updateDataOnDetailNode(),this.resetQuickFilterAggregateText();const n=this.createDataChangedEvent(e,r,i);if(this.__localEventService?.dispatchEvent(n),t!=="updateNoSibling"){const s=this.sibling;if(s){s.data=e;const c=s.createDataChangedEvent(e,r,i);s.__localEventService?.dispatchEvent(c)}}o.dispatchEvent({type:"rowNodeDataChanged",node:this});const l=this.pinnedSibling;l&&(l.data=e,l.__localEventService?.dispatchEvent(l.createDataChangedEvent(e,r,i)),o.dispatchEvent({type:"rowNodeDataChanged",node:l}))}updateDataOnDetailNode(){const e=this.detailNode;e&&(e.data=this.data)}createDataChangedEvent(e,t,a){return{type:"dataChanged",node:this,oldData:t,newData:e,update:a}}getRowIndexString(){return this.rowIndex==null?(q(13),null):this.rowPinned==="top"?Ar+this.rowIndex:this.rowPinned==="bottom"?Pr+this.rowIndex:this.rowIndex.toString()}setDataAndId(e,t){const{selectionSvc:a}=this.beans,o=a?.createDaemonNode?.(this),r=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),a&&(a.updateRowSelectable(this),a.syncInRowNode(this,o));const i=this.createDataChangedEvent(e,r,!1);this.__localEventService?.dispatchEvent(i)}setId(e){const t=ta(this.beans.gos);if(t)if(this.data){const a=this.parent?.getRoute()??[];this.id=t({data:this.data,parentKeys:a.length>0?a:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(En)&&q(14,{groupPrefix:En})}else this.id=void 0;else this.id=e}setRowTop(e){if(this.oldRowTop=this.rowTop,this.rowTop===e)return;this.rowTop=e,this.dispatchRowEvent("topChanged");const t=e!==null;this.displayed!==t&&(this.displayed=t,this.dispatchRowEvent("displayedChanged"))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(e){this.hovered=e}isHovered(){return this.hovered}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.dispatchRowEvent("heightChanged")}setExpanded(e,t,a){this.beans.expansionSvc?.setExpanded(this,e,t,a)}setDataValue(e,t,a){const{colModel:o,valueSvc:r,gos:i,editSvc:n}=this.beans;if(e==null)return!1;let l=o.getColOrColDefCol(e);if(!l)return!1;const s=l.colDef.pivotValueColumn;!this.group&&!this.rowPinned&&s&&(l=s);const c=r.getValueForDisplay({column:l,node:this,from:"data"}).value;if(i.get("readOnlyEdit")){const{beans:{eventSvc:g},data:u,rowIndex:h,rowPinned:p}=this;return g.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:h,rowPinned:p,column:l,colDef:l.colDef,data:u,node:this,oldValue:c,newValue:t,value:t,source:a}),!1}if(a!=="data"&&n&&!n.committing){const g=n.setDataValue({rowNode:this,column:l},t,a);if(g!=null)return g}const d=r.setValue(this,l,t,a);return this.dispatchCellChangedEvent(l,t,c),d&&this.pinnedSibling?.dispatchCellChangedEvent(l,t,c),d}getDataValue(e,t){const a=this.beans,o=a.colModel.getColOrColDefCol(e);if(!o)return;let r;if(t==="data"||!t){if(r=a.valueSvc.getValue(o,this,"data",!1),r==null)return r}else{const i=t==="data-raw",n=i||t==="value"?"data":t;if(r=a.valueSvc.getValue(o,this,n,i),i||r==null)return r;if(typeof r=="object"&&o.aggFunc){if(typeof r.toNumber=="function")return r.toNumber();if("value"in r)return r.value}if(t!=="value")return r}if(o.colDef.allowFormula){const i=a.formula;i?.isFormula(r)&&o.isAllowFormula()&&(r=i.resolveValue(o,this))}return r}updateHasChildren(){let e=this.group&&!this.footer||!!this.childrenAfterGroup?.length;const{rowChildrenSvc:t}=this.beans;t&&(e=t.getHasChildrenValue(this)),e!==this.__hasChildren&&(this.__hasChildren=!!e,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}dispatchCellChangedEvent(e,t,a){const o={type:"cellChanged",node:this,column:e,newValue:t,oldValue:a};this.__localEventService?.dispatchEvent(o)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.beans.expansionSvc?.isExpandable(this)??!1}isSelected(){if(this.footer)return this.sibling.isSelected();const e=this.rowPinned&&this.pinnedSibling;return e?e.isSelected():this.__selected}depthFirstSearch(e){const t=this.childrenAfterGroup;if(t)for(let a=0,o=t.length;a<o;++a)t[a].depthFirstSearch(e);e(this)}getAggregatedChildren(e,t){const a=this.beans;return a.aggChildrenSvc?.getAggregatedChildren(this,a.colModel.getCol(e),t)??[]}dispatchRowEvent(e){this.__localEventService?.dispatchEvent({type:e,node:this})}setSelected(e,t=!1,a="api"){this.beans.selectionSvc?.setNodesSelected({nodes:[this],newValue:e,clearSelection:t,source:a})}isRowPinned(){return!!this.rowPinned}__addEventListener(e,t){(this.__localEventService??(this.__localEventService=new Ct)).addEventListener(e,t)}__removeEventListener(e,t){this.removeLocalListener(e,t)}addEventListener(e,t){this.beans.validation?.checkRowEvents(e);const a=this.__localEventService??(this.__localEventService=new Ct);this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,a);const o=this.frameworkEventListenerService?.wrap(e,t)??t;a.addEventListener(e,o)}removeEventListener(e,t){const a=this.frameworkEventListenerService?.unwrap(e,t)??t;this.removeLocalListener(e,a)}removeLocalListener(e,t){const a=this.__localEventService;a&&(a.removeEventListener(e,t),a.noRegisteredListenersExist()&&(this.__localEventService=null))}isFullWidthCell(){if(x(61),this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return e?e({rowNode:this}):!1}getRoute(){if(this.level===-1)return[];if(this.key==null)return;const e=[];let t=this;for(;t?.key!=null;)e.push(t.key),t=t.parent;return e.reverse()}setRowIndex(e){this.rowIndex!==e&&(this.rowIndex=e,this.dispatchRowEvent("rowIndexChanged"))}setAllChildrenCount(e){this.allChildrenCount!==e&&(this.allChildrenCount=e,this.dispatchRowEvent("allChildrenCountChanged"))}setUiLevel(e){this.uiLevel!==e&&(this.uiLevel=e,this.dispatchRowEvent("uiLevelChanged"))}getFirstChild(){const e=this.childStore;return e?e.getFirstNode():this.childrenAfterSort?.[0]??null}_destroy(e){if(this.destroyed)return!1;this.destroyed=!0;const t=this.pinnedSibling;if(t?.rowPinned&&!this.rowPinned&&this.beans.pinnedRowModel?.pinRow(t,null),e===!0?this.clearRowTopAndRowIndex():e===!1?(this.setRowTop(null),this.setRowIndex(null)):(this.oldRowTop=null,this.rowTop=null,this.rowIndex=null,this.displayed=!1),!this.footer){const a=this.detailNode;a&&a._destroy(e);const o=this.sibling;o&&o._destroy(e)}return!0}};function Qd(e,t,a){return I(t,{type:a,node:e,data:e.data,rowIndex:e.rowIndex,rowPinned:e.rowPinned})}var ow=new Set(["__autoHeights","__checkAutoHeightsDebounced","__localEventService","__objectId","_groupData","_leafs","childStore","groupValue","oldRowTop","sticky","treeNodeFlags","treeParent"]),Yd=(e,t)=>{const a=new vt(t);for(const o of Object.keys(e))ow.has(o)||(a[o]=e[o]);return a.oldRowTop=null,a},Ir=(e,t,a)=>{if(!a)return;let o=a.rowIndex;if(o==null)return;o+=t;const r=e.getRowCount();for(;o>=0&&o<r;){const i=e.getRow(o);if(!i||!i.footer&&!i.detail)return i;o+=t}},Zd=class{constructor(e,t){this.beans=e,this.floating=t,this.all=new Set,this.visible=new Set,this.order=[],this.queued=new Set}size(){return this.visible.size}add(e){const{all:t,visible:a,order:o}=this;t.has(e)||(t.add(e),a.add(e),o.push(e),this.sort())}delete(e){this.all.delete(e),this.visible.delete(e),this.queued.delete(e.id),Pe(this.order,e)}has(e){return this.visible.has(e)}forEach(e){this.order.forEach(e)}getByIndex(e){return this.order[e]}getById(e){for(const t of this.visible)if(t.id==e)return t}clear(){const{all:e,visible:t,order:a,queued:o}=this;e.clear(),o.clear(),t.clear(),a.length=0}sort(){const{sortSvc:e,rowNodeSorter:t,gos:a}=this.beans,o=e?.getSortOptions()??[],r=this.order,i=nw(r);if(r.sort((l,s)=>t?.compareRowNodes(o,l,s)||(l.pinnedSibling?.rowIndex??0)-(s.pinnedSibling?.rowIndex??0)),!i)return;const n=Ji(a);n==="bottom"||n==="pinnedBottom"?this.order.push(i):this.order.unshift(i)}hide(e){const{all:t,visible:a}=this,o=a.size;return t.forEach(r=>e(r)?a.delete(r):a.add(r)),this.order=Array.from(a),this.sort(),o!=a.size}queue(e){this.queued.add(e)}unqueue(e){this.queued.delete(e)}forEachQueued(e){this.queued.forEach(e)}};function Jd(e){if(e.level===-1)return!0;const t=e.parent;return t?.childrenAfterSort?.some(a=>a==e)?Jd(t):!1}function Fn(e,t){const{gos:a,rowModel:o,filterManager:r}=e;return Fa(a,o)?!o.getRowNode(t.id):r?.isAnyFilterPresent()?!Jd(t):a.get("pivotMode")?!t.group:!1}function rw(e){return!!e.footer&&e.level===-1}function iw(e){return!!e.pinnedSibling&&rw(e.pinnedSibling)}function nw(e){const t=e.findIndex(iw);if(t>-1)return e.splice(t,1)?.[0]}var Xd=class extends y{constructor(){super(...arguments),this.csrm=null,this.ssrm=!1}postConstruct(){const{gos:e,beans:t}=this;this.top=new Zd(t,"top"),this.bottom=new Zd(t,"bottom"),this.csrm=Ve(t)??null,this.ssrm=t.rowModel.getType()==="serverSide";const a=r=>Fn(t,r.pinnedSibling),o=()=>{const r=e.get("isRowPinned");r&&e.get("enableRowPinning")&&t.rowModel.forEachNode(i=>this.pinRow(i,r(i)),!0),this.refreshRowPositions(),this.dispatchRowPinnedEvents()};this.addManagedEventListeners({stylesChanged:this.onGridStylesChanges.bind(this),modelUpdated:({keepRenderedRows:r})=>{this.tryToEmptyQueues(),this.pinGrandTotalRow();let i=!1;this.forContainers(l=>{i||(i=l.hide(a))});const n=this.refreshRowPositions();(!r||n||i)&&this.dispatchRowPinnedEvents()},columnRowGroupChanged:()=>{this.forContainers(sw),this.refreshRowPositions()},rowNodeDataChanged:({node:r})=>{(e.get("isRowPinnable")?.(r)??!0)||this.pinRow(r,null)},firstDataRendered:o}),this.addManagedPropertyListener("pivotMode",()=>{this.forContainers(r=>r.hide(a)),this.dispatchRowPinnedEvents()}),this.addManagedPropertyListener("grandTotalRow",({currentValue:r})=>{this._grandTotalPinned=Jc(r)}),this.addManagedPropertyListener("isRowPinned",o)}destroy(){this.reset(!1),super.destroy()}reset(e=!0){this.forContainers(t=>{const a=[];t.forEach(o=>a.push(o)),a.forEach(o=>this.pinRow(o,null)),t.clear()}),e&&this.dispatchRowPinnedEvents()}pinRow(e,t,a){if(t!=null&&e.destroyed)return;if(e.footer){const n=e.level;if(n>-1)return;if(n===-1){this._grandTotalPinned=t;const l=this.csrm;l?l.reMapRows():this.ssrm&&this.pinGrandTotalRow();return}}const o=e.rowPinned??e.pinnedSibling?.rowPinned;if(o!=null&&t!=null&&t!=o){const n=e.rowPinned?e:e.pinnedSibling,l=e.rowPinned?e.pinnedSibling:e;this.pinRow(n,null,a),this.pinRow(l,t,a);return}const i=a&&cw(this.beans,e,a);if(i){i.forEach(n=>this.pinRow(n,t));return}if(t==null){const n=e.rowPinned?e:e.pinnedSibling,l=this.findPinnedRowNode(n);if(!l)return;l.delete(n);const s=n.pinnedSibling;Mn(n),this.refreshRowPositions(t),this.dispatchRowPinnedEvents(s)}else{const n=$d(this.beans,e,t),l=this.getContainer(t);l.add(n),Fn(this.beans,e)&&l.hide(s=>Fn(this.beans,s.pinnedSibling)),this.refreshRowPositions(t),this.dispatchRowPinnedEvents(e)}}isManual(){return!0}isEmpty(e){return this.getContainer(e).size()===0}isRowsToRender(e){return!this.isEmpty(e)}ensureRowHeightsValid(){let e=!1,t=0;const a=o=>{if(o.rowHeightEstimated){const r=st(this.beans,o);o.setRowTop(t),o.setRowHeight(r.height),t+=r.height,e=!0}};return this.bottom.forEach(a),t=0,this.top.forEach(a),this.eventSvc.dispatchEvent({type:"pinnedHeightChanged"}),e}getPinnedTopTotalHeight(){return eg(this.top)}getPinnedBottomTotalHeight(){return eg(this.bottom)}getPinnedTopRowCount(){return this.top.size()}getPinnedBottomRowCount(){return this.bottom.size()}getPinnedTopRow(e){return this.top.getByIndex(e)}getPinnedBottomRow(e){return this.bottom.getByIndex(e)}getPinnedRowById(e,t){return this.getContainer(t).getById(e)}forEachPinnedRow(e,t){this.getContainer(e).forEach(t)}getPinnedState(){const e=t=>{const a=[];return this.forEachPinnedRow(t,o=>{const r=o.pinnedSibling?.id;r!=null&&a.push(r)}),a};return{top:e("top"),bottom:e("bottom")}}setPinnedState(e){this.forContainers((t,a)=>{for(const o of e[a]){const r=this.beans.rowModel.getRowNode(o);r?this.pinRow(r,a):t.queue(o)}})}getGrandTotalPinned(){return this._grandTotalPinned}setGrandTotalPinned(e){this._grandTotalPinned=e}tryToEmptyQueues(){this.forContainers((e,t)=>{const a=new Set;e.forEachQueued(o=>{const r=this.beans.rowModel.getRowNode(o);r&&a.add(r)});for(const o of a)e.unqueue(o.id),this.pinRow(o,t)})}pinGrandTotalRow(){const{beans:e,_grandTotalPinned:t}=this,a=this.csrm||this.ssrm?e.rowModel.rootNode?.sibling:void 0;if(!a)return;const o=a.pinnedSibling,r=o&&this.findPinnedRowNode(o);if(t){if(r&&r.floating!==t&&(Mn(o),r.delete(o)),r?.floating!==t){const i=$d(e,a,t);this.getContainer(t).add(i)}}else{if(!r)return;Mn(o),r.delete(o)}}onGridStylesChanges(e){e.rowHeightChanged&&this.forContainers(t=>t.forEach(a=>a.setRowHeight(a.rowHeight,!0)))}getContainer(e){return e==="top"?this.top:this.bottom}findPinnedRowNode(e){if(this.top.has(e))return this.top;if(this.bottom.has(e))return this.bottom}refreshRowPositions(e){const t=o=>lw(this.beans,o);if(e)return t(this.getContainer(e));let a=!1;return this.forContainers(o=>{const r=t(o);a||(a=r)}),a}forContainers(e){e(this.top,"top"),e(this.bottom,"bottom")}dispatchRowPinnedEvents(e){this.eventSvc.dispatchEvent({type:"pinnedRowsChanged"}),e?.dispatchRowEvent("rowPinned")}};function lw(e,t){let a=0,o=!1;return t.forEach((r,i)=>{if(o||(o=r.rowTop!==a),r.setRowTop(a),r.rowHeightEstimated||r.rowHeight==null){const n=st(e,r).height;o||(o=r.rowHeight!==n),r.setRowHeight(n)}r.setRowIndex(i),a+=r.rowHeight}),o}function $d(e,t,a){if(t.pinnedSibling)return t.pinnedSibling;const o=Yd(t,e);o.setRowTop(null),o.setRowIndex(null),o.rowPinned=a;const r=a==="top"?Ar:Pr;return o.id=`${r}${a}-${t.id}`,o.pinnedSibling=t,t.pinnedSibling=o,o}function Mn(e){if(!e.pinnedSibling)return;e.rowPinned=null,e._destroy(!1);const t=e.pinnedSibling;e.pinnedSibling=void 0,t&&(t.pinnedSibling=void 0,t.rowPinned=null)}function sw(e){const t=new Set;e.forEach(a=>{a.group&&t.add(a)}),t.forEach(a=>e.delete(a))}function cw(e,t,a){const{rowSpanSvc:o}=e,r=(a&&o?.isCellSpanning(a,t))??!1;if(a&&r)return o?.getCellSpan(a,t)?.spannedNodes}function eg(e){const t=e.size();if(t===0)return 0;const a=e.getByIndex(t-1);return a===void 0?0:a.rowTop+a.rowHeight}var tg=class extends y{constructor(){super(...arguments),this.nextId=0,this.pinnedTopRows={cache:{},order:[]},this.pinnedBottomRows={cache:{},order:[]}}postConstruct(){const e=this.gos;this.setPinnedRowData(e.get("pinnedTopRowData"),"top"),this.setPinnedRowData(e.get("pinnedBottomRowData"),"bottom"),this.addManagedPropertyListener("pinnedTopRowData",t=>this.setPinnedRowData(t.currentValue,"top")),this.addManagedPropertyListener("pinnedBottomRowData",t=>this.setPinnedRowData(t.currentValue,"bottom")),this.addManagedEventListeners({stylesChanged:this.onGridStylesChanges.bind(this)})}reset(){}isEmpty(e){return this.getCache(e).order.length===0}isRowsToRender(e){return!this.isEmpty(e)}isManual(){return!1}pinRow(e,t){}onGridStylesChanges(e){if(e.rowHeightChanged){const t=a=>{a.setRowHeight(a.rowHeight,!0)};yo(this.pinnedBottomRows,t),yo(this.pinnedTopRows,t)}}ensureRowHeightsValid(){let e=!1,t=0;const a=o=>{o.rowHeightEstimated&&(o.setRowHeight(st(this.beans,o).height),e=!0),o.rowTop!==t&&(o.setRowTop(t),e=!0),t+=o.rowHeight};return yo(this.pinnedBottomRows,a),t=0,yo(this.pinnedTopRows,a),this.eventSvc.dispatchEvent({type:"pinnedHeightChanged"}),e}setPinnedRowData(e,t){this.updateNodesFromRowData(e,t),this.eventSvc.dispatchEvent({type:"pinnedRowDataChanged"})}updateNodesFromRowData(e,t){const a=this.getCache(t);if(e===void 0){a.order.length=0,a.cache={};return}const o=ta(this.gos),r=t==="top"?Ar:Pr,i=new Set(a.order),n=[],l=new Set;let s=0,c=-1;for(const d of e){const g=o?.({data:d,level:0,rowPinned:t})??r+this.nextId++;if(l.has(g)){x(96,{id:g,data:d});continue}c++,l.add(g),n.push(g);const u=Co(a,g);if(u!==void 0)u.data!==d&&u.updateData(d),s+=this.setRowTopAndRowIndex(u,s,c),i.delete(g);else{const h=new vt(this.beans);h.id=g,h.data=d,h.rowPinned=t,s+=this.setRowTopAndRowIndex(h,s,c),a.cache[g]=h,a.order.push(g)}}for(const d of i)Co(a,d)?.clearRowTopAndRowIndex(),delete a.cache[d];a.order=n}setRowTopAndRowIndex(e,t,a){return e.setRowTop(t),e.setRowHeight(st(this.beans,e).height),e.setRowIndex(a),e.rowHeight}getPinnedTopTotalHeight(){return ag(this.pinnedTopRows)}getPinnedBottomTotalHeight(){return ag(this.pinnedBottomRows)}getPinnedTopRowCount(){return Dn(this.pinnedTopRows)}getPinnedBottomRowCount(){return Dn(this.pinnedBottomRows)}getPinnedTopRow(e){return zn(this.pinnedTopRows,e)}getPinnedBottomRow(e){return zn(this.pinnedBottomRows,e)}getPinnedRowById(e,t){return Co(this.getCache(t),e)}forEachPinnedRow(e,t){return yo(this.getCache(e),t)}getCache(e){return e==="top"?this.pinnedTopRows:this.pinnedBottomRows}getPinnedState(){return{top:[],bottom:[]}}setPinnedState(){}getGrandTotalPinned(){}setGrandTotalPinned(){}};function ag(e){const t=Dn(e);if(t===0)return 0;const a=zn(e,t-1);return a===void 0?0:a.rowTop+a.rowHeight}function Co(e,t){return e.cache[t]}function zn(e,t){return Co(e,e.order[t])}function yo(e,t){e.order.forEach((a,o)=>{const r=Co(e,a);r&&t(r,o)})}function Dn(e){return e.order.length}var og=class extends y{constructor(){super(...arguments),this.beanName="pinnedRowModel"}postConstruct(){const{gos:e}=this,t=()=>{const a=e.get("enableRowPinning"),o=Ji(e),i=!!a||(o==="pinnedBottom"||o==="pinnedTop"),n=i?this.inner instanceof tg:this.inner instanceof Xd;this.inner&&n&&this.destroyBean(this.inner),(n||!this.inner)&&(this.inner=this.createManagedBean(i?new Xd:new tg))};this.addManagedPropertyListeners(["enableRowPinning","grandTotalRow"],t),t()}reset(){return this.inner.reset()}isEmpty(e){return this.inner.isEmpty(e)}isManual(){return this.inner.isManual()}isRowsToRender(e){return this.inner.isRowsToRender(e)}pinRow(e,t,a){return this.inner.pinRow(e,t,a)}ensureRowHeightsValid(){return this.inner.ensureRowHeightsValid()}getPinnedRowById(e,t){return this.inner.getPinnedRowById(e,t)}getPinnedTopTotalHeight(){return this.inner.getPinnedTopTotalHeight()}getPinnedBottomTotalHeight(){return this.inner.getPinnedBottomTotalHeight()}getPinnedTopRowCount(){return this.inner.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.inner.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.inner.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.inner.getPinnedBottomRow(e)}forEachPinnedRow(e,t){return this.inner.forEachPinnedRow(e,t)}getPinnedState(){return this.inner.getPinnedState()}setPinnedState(e){return this.inner.setPinnedState(e)}setGrandTotalPinned(e){return this.inner.setGrandTotalPinned(e)}getGrandTotalPinned(){return this.inner.getGrandTotalPinned()}},rg=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(rg||{}),dw=500,gw=550,Tr,uw=e=>{if(!Tr)Tr=new WeakSet;else if(Tr.has(e))return!1;return Tr.add(e),!0},It=class{constructor(e,t=!1){this.eElement=e,this.preventClick=t,this.startListener=null,this.handlers=[],this.eventSvc=void 0,this.touchStart=null,this.lastTapTime=null,this.longPressTimer=0,this.moved=!1}addEventListener(e,t){let a=this.eventSvc;if(!a){if(a===null)return;this.eventSvc=a=new Ct;const o=this.onTouchStart.bind(this);this.startListener=o,this.eElement.addEventListener("touchstart",o,{passive:!0})}a.addEventListener(e,t)}removeEventListener(e,t){this.eventSvc?.removeEventListener(e,t)}onTouchStart(e){if(this.touchStart||!uw(e))return;const t=e.touches[0];this.touchStart=t;const a=this.handlers;if(!a.length){const o=this.eElement,r=o.ownerDocument,i=this.onTouchMove.bind(this),n=this.onTouchEnd.bind(this),l=this.onTouchCancel.bind(this),s={passive:!0},c={passive:!1};hr(a,[o,"touchmove",i,s],[r,"touchcancel",l,s],[r,"touchend",n,c],[r,"contextmenu",kt,c])}this.clearLongPress(),this.longPressTimer=window.setTimeout(()=>{this.longPressTimer=0,this.touchStart===t&&!this.moved&&(this.moved=!0,this.eventSvc?.dispatchEvent({type:"longTap",touchStart:t,touchEvent:e}))},gw)}onTouchMove(e){const{moved:t,touchStart:a}=this;if(!t&&a){const o=Sa(a,e.touches);o&&!kc(o,a,4)&&(this.clearLongPress(),this.moved=!0)}}onTouchEnd(e){const t=this.touchStart;!t||!Sa(t,e.changedTouches)||(this.moved||(this.eventSvc?.dispatchEvent({type:"tap",touchStart:t}),this.checkDoubleTap(t)),this.preventClick&&kt(e),this.cancel())}onTouchCancel(e){const t=this.touchStart;!t||!Sa(t,e.changedTouches)||(this.lastTapTime=null,this.cancel())}checkDoubleTap(e){let t=Date.now();const a=this.lastTapTime;a&&t-a>dw&&(this.eventSvc?.dispatchEvent({type:"doubleTap",touchStart:e}),t=null),this.lastTapTime=t}cancel(){this.clearLongPress(),Ni(this.handlers),this.touchStart=null}clearLongPress(){this.longPressTimer!==0&&(window.clearTimeout(this.longPressTimer),this.longPressTimer=0),this.moved=!1}destroy(){const e=this.startListener;e&&(this.startListener=null,this.eElement.removeEventListener("touchstart",e)),this.cancel(),this.eElement=null,this.eventSvc=null}},ig=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(ig||{}),hw=1,ng=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,this.instanceId=hw++,e?.beanClasses&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){this.id=e.id,this.beans.context=this,this.destroyCallback=e.destroyCallback;for(const t of Object.keys(e.providedBeanInstances))this.beans[t]=e.providedBeanInstances[t];for(const t of e.beanClasses){const a=new t;a.beanName?this.beans[a.beanName]=a:console.error(`Bean ${t.name} is missing beanName`),this.createdBeans.push(a)}for(const t of e.derivedBeans??[]){const{beanName:a,bean:o}=t(this);this.beans[a]=o,this.createdBeans.push(o)}e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){return this.initBeans([e],t),e}initBeans(e,t){const a=this.beans;for(const o of e)o.preWireBeans?.(a),o.wireBeans?.(a);for(const o of e)o.preConstruct?.();t&&e.forEach(t);for(const o of e)o.postConstruct?.()}getBeans(){return this.beans}getBean(e){return this.beans[e]}getId(){return this.id}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[],this.destroyCallback?.()}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}};function pw(e){return{beanName:"gridApi",bean:e.getBean("apiFunctionSvc").api}}var fw=["licenseManager","environment","eventSvc","gos","paginationAutoPageSizeSvc","apiFunctionSvc","gridApi","registry","agCompUtils","userCompFactory","rowContainerHeight","horizontalResizeSvc","localeSvc","pinnedRowModel","dragSvc","colGroupSvc","visibleCols","popupSvc","selectionSvc","colFilter","quickFilter","filterManager","colModel","headerNavigation","pageBounds","pagination","pageBoundsListener","rowSpanSvc","stickyRowSvc","rowRenderer","expressionSvc","alignedGridsSvc","navigation","valueCache","valueSvc","autoWidthCalc","filterMenuFactory","dragAndDrop","focusSvc","cellNavigation","cellStyles","scrollVisibleSvc","sortSvc","colHover","colAnimation","autoColSvc","selectionColSvc","changeDetectionSvc","animationFrameSvc","undoRedo","colDefFactory","rowStyleSvc","rowNodeBlockLoader","rowNodeSorter","ctrlsSvc","pinnedCols","dataTypeSvc","syncSvc","overlays","stateSvc","expansionSvc","apiEventSvc","ariaAnnounce","menuSvc","colMoves","colAutosize","colFlex","colResize","pivotColsSvc","valueColsSvc","rowGroupColsSvc","colNames","colViewport","pivotResultCols","showRowGroupCols","validation"],lg=Object.fromEntries(fw.map((e,t)=>[e,t]));function mw(e,t){const a=(e.beanName?lg[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER,o=(t.beanName?lg[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return a-o}function vw(e,t){return e?.beanName==="gridDestroySvc"?-1:t?.beanName==="gridDestroySvc"?1:0}function sg(e){const{rowIndex:t,rowPinned:a,column:o}=e;return`${t}.${a??"null"}.${o.getId()}`}function Lr(e,t){const a=e.column===t.column,o=e.rowPinned===t.rowPinned,r=e.rowIndex===t.rowIndex;return a&&o&&r}function cg(e,t){switch(e.rowPinned){case"top":if(t.rowPinned!=="top")return!0;break;case"bottom":if(t.rowPinned!=="bottom")return!1;break;default:if(z(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex<t.rowIndex}function dg(e,t){return!e&&!t?!0:!e||!t?!1:e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}function An(e){let t=0,a;const{pinnedRowModel:o,rowModel:r,pageBounds:i}=e;return o?.getPinnedTopRowCount()?a="top":r.getRowCount()?(a=null,t=i.getFirstRow()):o?.getPinnedBottomRowCount()&&(a="bottom"),a===void 0?null:{rowIndex:t,rowPinned:a}}function Pn(e){let t,a=null;const{pinnedRowModel:o,pageBounds:r}=e,i=o?.getPinnedBottomRowCount(),n=o?.getPinnedTopRowCount();return i?(a="bottom",t=i-1):e.rowModel.getRowCount()?t=r.getLastRow():n&&(a="top",t=n-1),t===void 0?null:{rowIndex:t,rowPinned:a}}function qe(e,t){switch(t.rowPinned){case"top":return e.pinnedRowModel?.getPinnedTopRow(t.rowIndex);case"bottom":return e.pinnedRowModel?.getPinnedBottomRow(t.rowIndex);default:return e.rowModel.getRow(t.rowIndex)}}function na(e,t){const a=e.spannedRowRenderer?.getCellByPosition(t);if(a)return a;const o=e.rowRenderer.getRowByPosition(t);return o?o.getCellCtrl(t.column):null}function bw(e,t,a){const{rowModel:o,pinnedRowModel:r}=e;let i;return i??(i=o?.getRowNode(t)),a?i??(i=r?.getPinnedRowById(t,a)):(i??(i=r?.getPinnedRowById(t,"top")),i??(i=r?.getPinnedRowById(t,"bottom"))),i}function ko(e,t,a=!1){const{rowIndex:o,rowPinned:r}=t,{pageBounds:i,pinnedRowModel:n,rowModel:l}=e;if(o===0)return r==="top"?null:r==="bottom"&&l.isRowsToRender()?{rowIndex:i.getLastRow(),rowPinned:null}:n?.isRowsToRender("top")?{rowIndex:n.getPinnedTopRowCount()-1,rowPinned:"top"}:null;if(a){const s=r?void 0:l.getRow(o);return gg(e,s,!0)??{rowIndex:o-1,rowPinned:r}}return{rowIndex:o-1,rowPinned:r}}function ww(e,t){const{pinnedRowModel:a,rowModel:o}=e,r=a?.getPinnedTopRowCount()??0,i=o.getRowCount(),{rowPinned:n,rowIndex:l}=t;return n==="top"?l:n==="bottom"?r+i+l:r+l}function In(e,t,a=!1){const{rowIndex:o,rowPinned:r}=t,{pageBounds:i,pinnedRowModel:n,rowModel:l}=e;if(Cw(e,t))return r==="bottom"?null:r==="top"&&l.isRowsToRender()?{rowIndex:i.getFirstRow(),rowPinned:null}:n?.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;if(a){const s=r?void 0:l.getRow(o);return gg(e,s)??{rowIndex:o+1,rowPinned:r}}return{rowIndex:o+1,rowPinned:r}}function gg(e,t,a=!1){const{gos:o,rowRenderer:r}=e;if(!t?.sticky||!Zi(o))return;const i=r.getStickyTopRowCtrls(),n=r.getStickyBottomRowCtrls(),l=!n.some(g=>g.rowNode.rowIndex===t.rowIndex),s=l?i:n,c=(a?-1:1)*(l?-1:1);let d;for(let g=0;g<s.length;g++)if(s[g].rowNode.rowIndex===t.rowIndex){d=s[g+c];break}return d?{rowIndex:d.rowNode.rowIndex,rowPinned:null}:void 0}function Cw(e,t){const{rowPinned:a,rowIndex:o}=t,{pinnedRowModel:r,pageBounds:i}=e;return a==="top"?(r?.getPinnedTopRowCount()??0)-1<=o:a==="bottom"?(r?.getPinnedBottomRowCount()??0)-1<=o:i.getLastRow()<=o}function ug(e,t,a){t.addManagedElementListeners(a,{keydown:o=>{if(!o.defaultPrevented&&!Sw(o)&&o.key===C.TAB){const r=o.shiftKey;At(e,a,!1,r)||la(e,r)&&o.preventDefault()}}})}function hg(e,t){return e.ctrlsSvc.get("gridCtrl").focusInnerElement(t)}function We(e){return e.gos.get("suppressHeaderFocus")||!!e.overlays?.exclusive}function So(e){return e.gos.get("suppressCellFocus")||!!e.overlays?.exclusive}function la(e,t,a=!1){const o=e.ctrlsSvc.get("gridCtrl"),r=o.focusNextInnerContainer(t);return r===!0?!0:r===!1?r:((a||!t&&!o.isDetailGrid()&&o.isFocusInsideGridBody())&&o.forceFocusOutOfContainer(t),!1)}function pg(e,t){const a=e.focusSvc,o=a.getFocusedCell();if(o&&t&&Lr(o,t)){const{rowIndex:r,rowPinned:i,column:n}=t;er(e)&&a.setFocusedCell({rowIndex:r,column:n,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!Sn()})}}function yw(e,t){const a=e.getFocusableContainerName();return a==="gridBody"?t():fg(e,()=>zt(e.getGui(),".ag-tab-guard").length>0)?a:null}function fg(e,t){e.setAllowFocus?.(!0);try{return t()}finally{e.setAllowFocus?.(!1)}}var mg="__ag_Grid_Skip_Focusable_Container";function kw(e){e[mg]=!0}function Sw(e){return e[mg]===!0}function xw(e){return e.cols?e.cols.treeDepth+1:-1}function Le(e){return e.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0}function Tn(e){const t=[],a=e.ctrlsSvc.getHeaderRowContainerCtrls();for(const o of a){if(!o)continue;const r=o.getGroupRowCount()||0;for(let i=0;i<r;i++){const n=o.getGroupRowCtrlAtIndex(i),l=t[i];if(n){const s=Rw(e,n);(l==null||s>l)&&(t[i]=s)}}}return t}function Rw(e,t){let o=e.colModel.pivotMode?Fw(e):vg(e);const r=t.getHeaderCellCtrls();for(const i of r){const{column:n}=i,l=n.getAutoHeaderHeight();l!=null&&l>o&&n.isAutoHeaderHeight()&&(o=l)}return o}function Ln(e){let a=e.colModel.pivotMode?Ew(e):xo(e);return e.colModel.forAllCols(o=>{const r=o.getAutoHeaderHeight();r!=null&&r>a&&o.isAutoHeaderHeight()&&(a=r)}),a}function xo(e){return e.gos.get("headerHeight")??e.environment.getDefaultHeaderHeight()}function Bn(e){return e.gos.get("floatingFiltersHeight")??xo(e)}function vg(e){return e.gos.get("groupHeaderHeight")??xo(e)}function Ew(e){return e.gos.get("pivotHeaderHeight")??xo(e)}function Fw(e){return e.gos.get("pivotGroupHeaderHeight")??vg(e)}function Mw(e,t){return e.headerRowIndex===t.headerRowIndex&&e.column===t.column}function zw(e){return e?.headerRowIndex!=null}var bg=class extends y{setComp(e,t,a){this.comp=e,this.eGui=t;const{beans:o}=this,{headerNavigation:r,touchSvc:i,ctrlsSvc:n}=o;r&&this.createManagedBean(new Ta(a,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,o),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,o)}),this.onPivotModeChanged(o),this.setupHeaderHeight();const l=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:l}),i?.mockHeaderContextMenu(this,l),n.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e),this.addManagedEventListeners({headerRowsChanged:e,columnHeaderHeightChanged:e,columnGroupHeaderHeightChanged:()=>nt(this.beans,()=>e()),stylesChanged:e,advancedFilterEnabledChanged:e})}setHeaderHeight(){const{beans:e}=this;let t=0;const a=Tn(e).reduce((n,l)=>n+l,0),o=Ln(e);e.filterManager?.hasFloatingFilters()&&(t+=Bn(e)),t+=a,t+=o;const r=e.environment.getHeaderRowBorderWidth(),i=t+r;if(this.headerHeightWithBorder!==i){this.headerHeightWithBorder=i;const n=`${i}px`;this.comp.setHeightAndMinHeight(n)}this.headerHeight!==t&&(this.headerHeight=t,this.eventSvc.dispatchEvent({type:"headerHeightChanged"}))}onPivotModeChanged(e){const t=e.colModel.pivotMode;this.comp.toggleCss("ag-pivot-on",t),this.comp.toggleCss("ag-pivot-off",!t)}onDisplayedColumnsChanged(e){const a=e.visibleCols.allCols.some(o=>o.isSpanHeaderHeight());this.comp.toggleCss("ag-header-allow-overflow",a)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),a=e.shiftKey,o=a!==t?"LEFT":"RIGHT",{beans:r}=this,{headerNavigation:i,focusSvc:n}=r;(i.navigateHorizontally(o,!0,e)||!a&&n.focusOverlay(!1)||la(r,a,!0))&&e.preventDefault()}handleKeyDown(e){let t=null;const{headerNavigation:a}=this.beans;switch(e.key){case C.LEFT:t="LEFT";case C.RIGHT:{z(t)||(t="RIGHT"),a.navigateHorizontally(t,!1,e)&&e.preventDefault();break}case C.UP:t="UP";case C.DOWN:{z(t)||(t="DOWN"),a.navigateVertically(t,e)&&e.preventDefault();break}default:return}}onFocusOut(e){const{relatedTarget:t}=e,{eGui:a,beans:o}=this;!t&&a.contains(Q(o))||a.contains(t)||(o.focusSvc.focusedHeader=null)}onHeaderContextMenu(e,t,a){const{menuSvc:o,ctrlsSvc:r}=this.beans;if(!e&&!a||!o?.isHeaderContextMenuEnabled())return;const{target:i}=e??t;(i===this.eGui||i===r.getHeaderRowContainerCtrl()?.eViewport)&&o.showHeaderContextMenu(void 0,e,a)}},On=class extends V{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},Dw={tag:"div",cls:"ag-header-cell",role:"columnheader",children:[{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"},{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"}]},Aw=class extends On{constructor(e){super(Dw,e),this.eResize=E,this.eHeaderCompWrapper=E,this.headerCompVersion=0}postConstruct(){const e=this.getGui(),t=()=>{const o=this.ctrl.getSelectAllGui();o&&(this.eResize.insertAdjacentElement("afterend",o),this.addDestroyFunc(()=>o.remove()))},a={setWidth:o=>e.style.width=o,toggleCss:(o,r)=>this.toggleCss(o,r),setUserStyles:o=>to(e,o),setAriaSort:o=>o?nc(e,o):lc(e),setUserCompDetails:o=>this.setUserCompDetails(o),getUserCompInstance:()=>this.headerComp,refreshSelectAllGui:t,removeSelectAllGui:()=>this.ctrl.getSelectAllGui()?.remove()};this.ctrl.setComp(a,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0),t()}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){this.headerComp&&(this.headerCompGui?.remove(),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(a=>this.afterCompCreated(t,a))}afterCompCreated(e,t){if(e!=this.headerCompVersion||!this.isAlive()){this.destroyBean(t);return}this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}},Pw={tag:"div",cls:"ag-header-group-cell",role:"columnheader",children:[{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"},{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"}]},Iw=class extends On{constructor(e){super(Pw,e),this.eResize=E,this.eHeaderCompWrapper=E}postConstruct(){const e=this.getGui(),t=(o,r)=>r!=null?e.setAttribute(o,r):e.removeAttribute(o),a={toggleCss:(o,r)=>this.toggleCss(o,r),setUserStyles:o=>to(e,o),setHeaderWrapperHidden:o=>{o?this.eHeaderCompWrapper.style.setProperty("display","none"):this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:o=>{o!=null?this.eHeaderCompWrapper.style.setProperty("max-height",`${o}px`):this.eHeaderCompWrapper.style.removeProperty("max-height"),this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",o!=null)},setResizableDisplayed:o=>U(this.eResize,o),setWidth:o=>e.style.width=o,setAriaExpanded:o=>t("aria-expanded",o),setUserCompDetails:o=>this.setUserCompDetails(o),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(a,e,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(e){e.newAgStackInstance().then(t=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}const a=this.getGui(),o=e.getGui();this.eHeaderCompWrapper.appendChild(o),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(a)}},Tw={tag:"div",cls:"ag-header-cell ag-floating-filter",role:"gridcell",children:[{tag:"div",ref:"eFloatingFilterBody",role:"presentation"},{tag:"div",ref:"eButtonWrapper",cls:"ag-floating-filter-button ag-hidden",role:"presentation",children:[{tag:"button",ref:"eButtonShowMainFilter",cls:"ag-button ag-floating-filter-button-button",attrs:{type:"button",tabindex:"-1"}}]}]},Lw=class extends On{constructor(e){super(Tw,e),this.eFloatingFilterBody=E,this.eButtonWrapper=E,this.eButtonShowMainFilter=E}postConstruct(){const e=this.getGui(),t={toggleCss:(a,o)=>this.toggleCss(a,o),setUserStyles:a=>to(e,a),addOrRemoveBodyCssClass:(a,o)=>this.eFloatingFilterBody.classList.toggle(a,o),setButtonWrapperDisplayed:a=>U(this.eButtonWrapper,a),setCompDetails:a=>this.setCompDetails(a),getFloatingFilterComp:()=>this.compPromise,setWidth:a=>e.style.width=a,setMenuIcon:a=>this.eButtonShowMainFilter.appendChild(a)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(e){if(!e){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=e.newAgStackInstance(),this.compPromise.then(t=>this.afterCompCreated(t))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp?.getGui().remove(),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp)}afterCompCreated(e){if(e){if(!this.isAlive()){this.destroyBean(e);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached?.()}}},Bw=class extends V{constructor(e){super({tag:"div",cls:e.headerRowClass,role:"row"}),this.ctrl=e,this.headerComps={}}postConstruct(){this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),wa(this.getGui(),this.ctrl.getAriaRowIndex());const t={setHeight:a=>this.getGui().style.height=a,setTop:a=>this.getGui().style.top=a,setHeaderCtrls:(a,o)=>this.setHeaderCtrls(a,o),setWidth:a=>this.getGui().style.width=a,setRowIndex:a=>wa(this.getGui(),a)};this.ctrl.setComp(t,void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const a=this.headerComps;this.headerComps={};for(const o of e){const r=o.instanceId;let i=a[r];delete a[r],i==null&&(i=this.createHeaderComp(o),this.getGui().appendChild(i.getGui())),this.headerComps[r]=i}if(Object.values(a).forEach(o=>{o.getGui().remove(),this.destroyBean(o)}),t){const o=Object.values(this.headerComps);o.sort((i,n)=>{const l=i.getCtrl().column.getLeft(),s=n.getCtrl().column.getLeft();return l-s});const r=o.map(i=>i.getGui());mc(this.getGui(),r)}}createHeaderComp(e){let t;switch(this.ctrl.type){case"group":t=new Iw(e);break;case"filter":t=new Lw(e);break;default:t=new Aw(e);break}return this.createBean(t),t.setParentComponent(this),t}},Nn=class extends y{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=se(this.gos,"print"),{visibleCols:t,scrollVisibleSvc:a}=this.beans,o=t.bodyWidth,r=t.getColsLeftWidth(),i=t.getDisplayedColumnsRightWidth();let n;e?n=o+r+i:(n=o,this.addSpacer&&(this.gos.get("enableRtl")?r:i)===0&&a.verticalScrollShowing&&(n+=a.getScrollbarWidth())),this.callback(n)}},Ow=class extends y{};function Ro(e,t,a){return a&&e.addDestroyFunc(()=>t.destroyBean(a)),a??e}var Hn=class extends y{constructor(e,t,a,o){super(),this.columnOrGroup=e,this.eCell=t,this.colsSpanning=o,this.columnOrGroup=e,this.ariaEl=t.querySelector("[role=columnheader]")||t,this.beans=a}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){const{beans:e,colsSpanning:t}=this;return e.gos.get("enableRtl")&&t?j(t):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const{gos:e,colAnimation:t}=this.beans,a=e.get("suppressColumnMoveAnimation"),o=z(this.columnOrGroup.getOldLeft());t?.isActive()&&o&&!a?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=this.modifyLeftForPrintLayout(e,e.getOldLeft()),a=this.modifyLeftForPrintLayout(e,e.getLeft());this.setLeft(t),this.actualLeft=a,this.beans.colAnimation.executeNextVMTurn(()=>{this.actualLeft===a&&this.setLeft(a)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){const{gos:a,visibleCols:o}=this.beans;if(!se(a,"print")||e.getPinned()==="left")return t;const i=o.getColsLeftWidth();if(e.getPinned()==="right"){const n=o.bodyWidth;return i+n+t}return i+t}setLeft(e){if(z(e)&&(this.eCell.style.left=`${e}px`),ee(this.columnOrGroup)){const t=this.columnOrGroup.getLeafColumns();if(!t.length)return;t.length>1&&ic(this.ariaEl,t.length)}}},Nw="ag-column-first",Hw="ag-column-last";function Gn(e,t,a,o){return _(e)?[]:Cg(e.headerClass,e,t,a,o)}function Gw(e,t,a,o){return _(e)?[]:Cg(e.toolPanelClass,e,t,a,o)}function wg(e,t,a){e.toggleCss(Nw,a.isColAtEdge(t,"first")),e.toggleCss(Hw,a.isColAtEdge(t,"last"))}function Vw(e,t,a,o){return I(t,{colDef:e,column:a,columnGroup:o})}function Cg(e,t,a,o,r){if(_(e))return[];let i;if(typeof e=="function"){const n=Vw(t,a,o,r);i=e(n)}else i=e;return typeof i=="string"?[i]:Array.isArray(i)?[...i]:[]}var qw=0,yg="headerCtrl",Vn=class extends y{constructor(e,t){super(),this.column=e,this.rowCtrl=t,this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.reAttemptToFocus=!1,this.instanceId=e.getUniqueId()+"-"+qw++}postConstruct(){const e=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],e),this.addManagedEventListeners({overlayExclusiveChanged:e})}setComp(e,t,a,o,r){t.setAttribute("col-id",this.column.colIdSanitised),this.wireComp(e,t,a,o,r),this.reAttemptToFocus&&(this.reAttemptToFocus=!1,this.focus(this.lastFocusEvent??void 0))}shouldStopEventPropagation(e){const{headerRowIndex:t,column:a}=this.beans.focusSvc.focusedHeader,o=a.getDefinition(),r=o?.suppressHeaderKeyboardEvent;if(!z(r))return!1;const i=I(this.gos,{colDef:o,column:a,headerRowIndex:t,event:e});return!!r(i)}getWrapperHasFocus(){return Q(this.beans)===this.eGui}setGui(e,t){this.eGui=e,this.addDomData(t),t.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),t.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}refreshHeaderStyles(){const e=this.column.getDefinition();if(!e)return;const{headerStyle:t}=e;let a;if(typeof t=="function"){const o=this.getHeaderClassParams();a=t(o)}else a=t;a&&this.comp.setUserStyles(a)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(e){const{wrapperElement:t,checkMeasuringCallback:a,compBean:o}=e,{beans:r}=this,i=g=>{if(!this.isAlive()||!o.isAlive())return;const{paddingTop:u,paddingBottom:h,borderBottomWidth:p,borderTopWidth:f}=Zt(this.eGui),m=u+h+p+f,w=t.offsetHeight+m;if(g<5){const k=!oe(r)?.contains(t),S=w==0;if(k||S){pr(()=>i(g+1),"raf",r);return}}this.setColHeaderHeight(this.column,w)};let n=!1,l;const s=()=>{const g=this.column.isAutoHeaderHeight();g&&!n&&c(),!g&&n&&d()},c=()=>{n=!0,this.comp.toggleCss("ag-header-cell-auto-height",!0),i(0),l=it(this.beans,t,()=>i(0))},d=()=>{n=!1,l&&l(),this.comp.toggleCss("ag-header-cell-auto-height",!1),l=void 0};s(),o.addDestroyFunc(()=>d()),o.addManagedListeners(this.column,{widthChanged:()=>n&&i(0)}),o.addManagedEventListeners({sortChanged:()=>{n&&window.setTimeout(()=>i(0))}}),a&&a(s)}onDisplayedColumnsChanged(){const{comp:e,column:t,beans:a,eGui:o}=this;!e||!t||!o||(wg(e,t,a.visibleCols),Pi(o,a.visibleCols.getAriaColIndex(t)))}addResizeAndMoveKeyboardListeners(e){e.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){const e=We(this.beans);this.eGui&&we(this.eGui,"tabindex",e?null:"-1")}onGuiKeyDown(e){const t=Q(this.beans),a=e.key===C.LEFT||e.key===C.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),t!==this.eGui||!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey)return;if((this.isResizing||a)&&(e.preventDefault(),e.stopImmediatePropagation()),(e.ctrlKey||e.metaKey)&&Rd(e)===C.C)return this.beans.clipboardSvc?.copyToClipboard();if(!a)return;const i=e.key===C.LEFT!==this.gos.get("enableRtl")?"left":"right";if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const n=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(n,e.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(i)}moveHeader(e){this.beans.colMoves?.moveHeader(e,this.eGui,this.column,this.rowCtrl.pinned,this)}getViewportAdjustedResizeDiff(e){const t=this.getResizeDiff(e),{pinnedCols:a}=this.beans;return a?a.getHeaderResizeDiff(t,this.column):t}getResizeDiff(e){const{gos:t,column:a}=this;let o=e.key===C.LEFT!==t.get("enableRtl");const r=a.getPinned(),i=t.get("enableRtl");return r&&i!==(r==="right")&&(o=!o),(o?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case C.PAGE_DOWN:case C.PAGE_UP:case C.PAGE_HOME:case C.PAGE_END:t&&e.preventDefault()}}addDomData(e){const t=yg,{eGui:a,gos:o}=this;$t(o,a,t,this),e.addDestroyFunc(()=>$t(o,a,t,null))}focus(e){if(!this.isAlive())return!1;const{eGui:t}=this;return t?(this.lastFocusEvent=e||null,t.focus()):this.reAttemptToFocus=!0,!0}focusThis(){this.beans.focusSvc.focusedHeader={headerRowIndex:this.rowCtrl.rowIndex,column:this.column}}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop?.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,a){const o=e??t,{menuSvc:r,gos:i}=this.beans;i.get("preventDefaultOnContextMenu")&&o.preventDefault(),r?.isHeaderContextMenuEnabled(a)&&r.showHeaderContextMenu(a,e,t),this.dispatchColumnMouseEvent("columnHeaderContextMenu",a)}dispatchColumnMouseEvent(e,t){this.eventSvc.dispatchEvent({type:e,column:t})}setColHeaderHeight(e,t){if(!e.setAutoHeaderHeight(t))return;const{eventSvc:a}=this;e.isColumn?a.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"}):a.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:e,source:"autosizeColumnGroupHeaderHeight"})}clearComponent(){this.removeDragSource(),this.resizeFeature=null,this.comp=null,this.eGui=null}destroy(){super.destroy(),this.column=null,this.lastFocusEvent=null,this.rowCtrl=null}},Ww=class extends Vn{constructor(){super(...arguments),this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map}wireComp(e,t,a,o,r){this.comp=e;const{rowCtrl:i,column:n,beans:l}=this,{colResize:s,context:c,colHover:d,rangeSvc:g}=l,u=Ro(this,c,r);this.setGui(t,u),this.updateState(),this.setupWidth(u),this.setupMovingCss(u),this.setupMenuClass(u),this.setupSortableClass(u),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:o,checkMeasuringCallback:p=>this.setRefreshFunction("measuring",p),compBean:u}),this.addColumnHoverListener(u),this.setupFilterClass(u),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(u),this.setupSelectAll(u),this.setupUserComp(),this.refreshAria(),s?this.resizeFeature=u.createManagedBean(s.createResizeFeature(i.pinned,n,a,e,this)):U(a,!1),d?.createHoverFeature(u,[n],t),g?.createRangeHighlightFeature(u,n,e),u.createManagedBean(new Hn(n,t,l)),u.createManagedBean(new Ta(t,{shouldStopEventPropagation:p=>this.shouldStopEventPropagation(p),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(u),u.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader","enableAdvancedFilter"],()=>this.refresh()),u.addManagedPropertyListener("cellSelection",()=>this.refreshAria()),u.addManagedListeners(n,{colDefChanged:()=>this.refresh(),formulaRefChanged:()=>this.refresh(),headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});const h=()=>this.checkDisplayName();u.addManagedEventListeners({columnValueChanged:h,columnRowGroupChanged:h,columnPivotChanged:h,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),u.addDestroyFunc(()=>{this.refreshFunctions={},this.selectAllFeature=null,this.dragSourceElement=void 0,this.userCompDetails=null,this.userHeaderClasses.clear(),this.ariaDescriptionProperties.clear(),this.clearComponent()})}resizeHeader(e,t){this.beans.colResize?.resizeHeader(this.column,e,t)}getHeaderClassParams(){const{column:e,beans:t}=this,a=e.colDef;return I(t.gos,{colDef:a,column:e,floatingFilter:!1})}setupUserComp(){const e=this.lookupUserCompDetails();e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return Lb(this.beans.userCompFactory,t,e)}createParams(){const{menuSvc:e,sortSvc:t,colFilter:a,gos:o}=this.beans;return I(o,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!e?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!a&&(!this.openFilterEnabled||Ce(this.gos)),showColumnMenu:(i,n)=>{e?.showColumnMenu({column:this.column,buttonElement:i,positionBy:"button",onClosedCallback:n})},showColumnMenuAfterMouseClick:(i,n)=>{e?.showColumnMenu({column:this.column,mouseEvent:i,positionBy:"mouse",onClosedCallback:n})},showFilter:i=>{e?.showFilterMenu({column:this.column,buttonElement:i,containerType:"columnFilter",positionBy:"button"})},progressSort:i=>{t?.progressSort(this.column,!!i,"uiColumnSorted")},setSort:(i,n)=>{t?.setSortForColumn(this.column,ze(i),!!n,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(i,n)=>{o.assertModuleRegistered("Tooltip",3),this.setupTooltip(i,n)}})}setupSelectAll(e){const{selectionSvc:t}=this.beans;t&&(this.selectAllFeature=e.createOptionalManagedBean(t.createSelectAllFeature(this.column)),this.selectAllFeature?.setComp(this),e.addManagedPropertyListener("rowSelection",()=>{const a=t.createSelectAllFeature(this.column);a&&!this.selectAllFeature?(this.selectAllFeature=e.createManagedBean(a),this.selectAllFeature?.setComp(this),this.comp.refreshSelectAllGui()):this.selectAllFeature&&!a&&(this.comp.removeSelectAllGui(),this.selectAllFeature=this.destroyBean(this.selectAllFeature))}))}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===C.SPACE?this.selectAllFeature?.onSpaceKeyDown(e):e.key===C.ENTER?this.onEnterKeyDown(e):e.key===C.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){const{column:t,gos:a,sortable:o,beans:r}=this;let i=!1;(e.ctrlKey||e.metaKey)&&(i=this.showMenuOnKeyPress(e,!0)),i||(!e.altKey&&Et(a)?r.rangeSvc?.handleColumnSelection(t,e):o&&r.sortSvc?.progressSort(t,e.shiftKey,"uiColumnSorted"))}showMenuOnKeyPress(e,t){const a=this.comp.getUserCompInstance();return kg(a)&&a.onMenuKeyboardShortcut(t)?(e.preventDefault(),!0):!1}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription()),Sn()&&this.setActiveHeader(!0)}onFocusOut(e){this.eGui.contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderTooltip(this.tooltipFeature,this,e,t)}setupStylesFromColDef(){this.setRefreshFunction("headerStyles",this.refreshHeaderStyles.bind(this)),this.refreshHeaderStyles()}setupClassesFromColDef(){const e=()=>{const t=this.column.colDef,a=Gn(t,this.gos,this.column,null),o=this.userHeaderClasses;this.userHeaderClasses=new Set(a);for(const r of a)o.has(r)?o.delete(r):this.comp.toggleCss(r,!0);for(const r of o)this.comp.toggleCss(r,!1)};this.setRefreshFunction("headerClasses",e),e()}setDragSource(e){this.dragSourceElement=e,this.removeDragSource(),!(!e||!this.draggable)&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null)}updateState(){const{menuSvc:e}=this.beans;this.menuEnabled=!!e?.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=!!e?.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(e,t){this.refreshFunctions[e]=t}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria();for(const e of Object.values(this.refreshFunctions))e()}refreshHeaderComp(){const e=this.lookupUserCompDetails();if(!e)return;(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==e.componentClass?this.attemptHeaderCompRefresh(e.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.colDef;return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}setupWidth(e){const t=()=>{const a=this.column.getActualWidth();this.comp.setWidth(`${a}px`)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupMovingCss(e){const t=()=>{this.comp.toggleCss("ag-header-cell-moving",this.column.isMoving())};e.addManagedListeners(this.column,{movingChanged:t}),t()}setupMenuClass(e){const t=()=>{this.comp?.toggleCss("ag-column-menu-visible",this.column.isMenuVisible())};e.addManagedListeners(this.column,{menuVisibleChanged:t}),t()}setupSortableClass(e){const t=()=>{this.comp.toggleCss("ag-header-cell-sortable",!!this.sortable)};t(),this.setRefreshFunction("updateSortable",t),e.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(e){const t=()=>{const a=this.column.isFilterActive();this.comp.toggleCss("ag-header-cell-filtered",a),this.refreshAria()};e.addManagedListeners(this.column,{filterActiveChanged:t}),t()}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.toggleCss("ag-header-cell-wrap-text",t)};e(),this.setRefreshFunction("wrapText",e)}onHeaderHighlightChanged(){const e=this.column.getHighlighted(),t=e===0,a=e===1;this.comp.toggleCss("ag-header-highlight-before",t),this.comp.toggleCss("ag-header-highlight-after",a)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:a,beans:o}=this,r=Tn(this.beans),i=r.reduce((u,h)=>u+h,0)===0;if(a.toggleCss("ag-header-parent-hidden",i),!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),a.toggleCss("ag-header-span-height",!1),a.toggleCss("ag-header-span-total",!1);return}const{numberOfParents:n,isSpanningTotal:l}=this.column.getColumnGroupPaddingInfo();a.toggleCss("ag-header-span-height",n>0);const s=Ln(o);if(n===0){a.toggleCss("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${s}px`);return}a.toggleCss("ag-header-span-total",l);const c=(this.column.getFirstRealParent()?.getLevel()??-1)+1,d=r.length-c;let g=0;for(let u=0;u<d;u++)g+=r[r.length-1-u];e.style.setProperty("top",`${-g}px`),e.style.setProperty("height",`${s+g}px`)}refreshAriaSort(){let e=null;const{beans:t,column:a,comp:o,sortable:r,gos:i}=this;if(r){const n=this.getLocaleTextFunc(),l=t.sortSvc?.getDisplaySortForColumn(a)??null;o.setAriaSort(qm(l)),e=Et(i)?n("ariaSortableColumnWithCellSelection","Press ALT ENTER to sort"):n("ariaSortableColumn","Press ENTER to sort")}else o.setAriaSort();this.setAriaDescriptionProperty("sort",e)}refreshAriaMenu(){let e=null;this.menuEnabled&&(e=this.getLocaleTextFunc()("ariaMenuColumn","Press ALT DOWN to open column menu")),this.setAriaDescriptionProperty("menu",e)}refreshAriaFilterButton(){let e=null;const{openFilterEnabled:t,gos:a}=this;t&&!Ce(a)&&(e=this.getLocaleTextFunc()("ariaFilterColumn","Press CTRL ENTER to open filter")),this.setAriaDescriptionProperty("filterButton",e)}refreshAriaFiltered(){let e=null;this.column.isFilterActive()&&(e=this.getLocaleTextFunc()("ariaColumnFiltered","Column Filtered")),this.setAriaDescriptionProperty("filter",e)}refreshAriaCellSelection(){let e=null;const{gos:t,column:a}=this;Et(t)&&!pe(a)&&(e=this.getLocaleTextFunc()("ariaColumnCellSelection","Press Enter to toggle selection for all visible cells in this column")),this.setAriaDescriptionProperty("cellSelection",e)}setAriaDescriptionProperty(e,t){const a=this.ariaDescriptionProperties;t!=null?a.set(e,t):a.delete(e)}announceAriaDescription(){const{beans:e,eGui:t,ariaDescriptionProperties:a}=this;if(!t.contains(Q(e)))return;const o=Array.from(a.keys()).sort((r,i)=>r==="filter"?-1:i.charCodeAt(0)-r.charCodeAt(0)).map(r=>a.get(r)).join(". ");e.ariaAnnounce?.announceValue(o,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered(),this.refreshAriaCellSelection()}addColumnHoverListener(e){this.beans.colHover?.addHeaderColumnHoverListener(e,this.comp,this.column)}addActiveHeaderMouseListeners(e){const t=r=>this.handleMouseOverChange(r.type==="mouseenter"),a=()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},o=r=>this.handleContextMenuMouseEvent(r,void 0,this.column);e.addManagedListeners(this.eGui,{mouseenter:t,mouseleave:t,click:a,contextmenu:o})}handleMouseOverChange(e){this.setActiveHeader(e),this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(e){this.comp.toggleCss("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return kg(t)?t.getAnchorElementForMenu(e):this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function kg(e){return typeof e?.getAnchorElementForMenu=="function"&&typeof e.onMenuKeyboardShortcut=="function"}var Uw=0,qn=class extends y{constructor(e,t,a){super(),this.rowIndex=e,this.pinned=t,this.type=a,this.instanceId=Uw++,this.comp=null,this.allCtrls=[];let o="ag-header-row-column";a==="group"?o="ag-header-row-group":a==="filter"&&(o="ag-header-row-filter"),this.headerRowClass=`ag-header-row ${o}`}setRowIndex(e){this.rowIndex=e,this.comp?.setRowIndex(this.getAriaRowIndex()),this.onRowHeightChanged()}postConstruct(){this.isPrintLayout=se(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){return this.comp?this.allCtrls.every(e=>e.eGui!=null):!1}setComp(e,t,a=!0){this.comp=e,t=Ro(this,this.beans.context,t),a&&(this.setRowIndex(this.rowIndex),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners(t)}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){const t=this.onRowHeightChanged.bind(this),a=this.onDisplayedColumnsChanged.bind(this);e.addManagedEventListeners({columnResized:this.setWidth.bind(this),displayedColumnsChanged:a,virtualColumnsChanged:o=>this.onVirtualColumnsChanged(o.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,stylesChanged:t,advancedFilterEnabledChanged:t}),e.addManagedPropertyListener("domLayout",a),e.addManagedPropertyListener("ensureDomOrder",o=>this.isEnsureDomOrder=o.currentValue),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}onDisplayedColumnsChanged(){this.isPrintLayout=se(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}setWidth(){if(!this.comp)return;const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleCols:e}=this.beans;return this.isPrintLayout?this.pinned!=null?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){if(!this.comp)return;const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){let e=0;const t=Tn(this.beans);for(let r=0;r<t.length;r++){if(r===this.rowIndex&&this.type==="group")return{topOffset:e,rowHeight:t[r]};e+=t[r]}const a=Ln(this.beans);if(this.type==="column")return{topOffset:e,rowHeight:a};e+=a;const o=Bn(this.beans);return{topOffset:e,rowHeight:o}}onVirtualColumnsChanged(e=!1){if(!this.comp)return;const t=this.getUpdatedHeaderCtrls(),a=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,a,e)}getUpdatedHeaderCtrls(){const e=this.ctrlsById;this.ctrlsById=new Map;const t=this.getColumnsInViewport();for(const o of t)this.recycleAndCreateHeaderCtrls(o,this.ctrlsById,e);const a=o=>{const{focusSvc:r,visibleCols:i}=this.beans;return r.isHeaderWrapperFocused(o)?i.isVisible(o.column):!1};if(e)for(const[o,r]of e)a(r)?this.ctrlsById.set(o,r):this.destroyBean(r);return this.allCtrls=Array.from(this.ctrlsById.values()),this.allCtrls}getHeaderCellCtrls(){return this.allCtrls}recycleAndCreateHeaderCtrls(e,t,a){if(e.isEmptyGroup())return;const o=e.getUniqueId();let r;if(a&&(r=a.get(o),a.delete(o)),r&&r.column!=e&&(this.destroyBean(r),r=void 0),r==null)switch(this.type){case"filter":{r=this.createBean(this.beans.registry.createDynamicBean("headerFilterCellCtrl",!0,e,this));break}case"group":r=this.createBean(this.beans.registry.createDynamicBean("headerGroupCellCtrl",!0,e,this));break;default:r=this.createBean(new Ww(e,this));break}t.set(o,r)}getColumnsInViewport(){if(!this.isPrintLayout)return this.getComponentsToRender();if(this.pinned)return[];const e=[];for(const t of["left",null,"right"])e.push(...this.getComponentsToRender(t));return e}getComponentsToRender(e=this.pinned){return this.type==="group"?this.beans.colViewport.getHeadersToRender(e,this.rowIndex):this.beans.colViewport.getColumnHeadersToRender(e)}focusHeader(e,t){const a=this.allCtrls.find(r=>r.column==e);return a?a.focus(t):!1}destroy(){this.allCtrls=this.destroyBeans(this.allCtrls),this.ctrlsById=void 0,this.comp=null,super.destroy()}},Sg=class extends y{constructor(e){super(),this.pinned=e,this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[]}setComp(e,t){this.comp=e,this.eViewport=t;const{pinnedCols:a,ctrlsSvc:o,colModel:r,colMoves:i}=this.beans;this.setupCenterWidth(),a?.setupHeaderPinnedWidth(this),this.setupDragAndDrop(i,this.eViewport);const n=this.refresh.bind(this,!0);this.addManagedEventListeners({displayedColumnsChanged:n,advancedFilterEnabledChanged:n});const l=`${typeof this.pinned=="string"?this.pinned:"center"}Header`;o.register(l,this),r.ready&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const{focusSvc:t,filterManager:a,visibleCols:o}=this.beans;let r=0;const i=t.getFocusHeaderToUseAfterRefresh(),n=()=>{const g=o.headerGroupRowCount;r=g,e||(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls));const u=this.groupsRowCtrls.length;if(u!==g){if(u>g){for(let h=g;h<u;h++)this.destroyBean(this.groupsRowCtrls[h]);this.groupsRowCtrls.length=g;return}for(let h=u;h<g;h++){const p=this.createBean(new qn(h,this.pinned,"group"));this.groupsRowCtrls.push(p)}}},l=()=>{const g=r++;if(this.hidden){this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl);return}this.columnsRowCtrl==null||!e?(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.columnsRowCtrl=this.createBean(new qn(g,this.pinned,"column"))):this.columnsRowCtrl.rowIndex!==g&&this.columnsRowCtrl.setRowIndex(g)},s=()=>{this.includeFloatingFilter=!!a?.hasFloatingFilters()&&!this.hidden;const g=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){g();return}e||g();const u=r++;this.filtersRowCtrl?this.filtersRowCtrl.rowIndex!==u&&this.filtersRowCtrl.setRowIndex(u):this.filtersRowCtrl=this.createBean(new qn(u,this.pinned,"filter"))},c=this.getAllCtrls();n(),l(),s();const d=this.getAllCtrls();this.comp.setCtrls(d),this.restoreFocusOnHeader(t,i),c.length!==d.length&&this.beans.eventSvc.dispatchEvent({type:"headerRowsChanged"})}getHeaderCtrlForColumn(e){const t=a=>a?.getHeaderCellCtrls().find(o=>o.column===e);if(dt(e))return t(this.columnsRowCtrl);if(this.groupsRowCtrls.length!==0)for(let a=0;a<this.groupsRowCtrls.length;a++){const o=t(this.groupsRowCtrls[a]);if(o)return o}}getHtmlElementForColumnHeader(e){return this.getHeaderCtrlForColumn(e)?.eGui??null}getRowType(e){return this.getAllCtrls()[e]?.type}focusHeader(e,t,a){const r=this.getAllCtrls()[e];return r?r.focusHeader(t,a):!1}getGroupRowCount(){return this.groupsRowCtrls.length}getGroupRowCtrlAtIndex(e){return this.groupsRowCtrls[e]}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}destroy(){this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl),this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls),super.destroy()}setupDragAndDrop(e,t){const a=e?.createBodyDropTarget(this.pinned,t);a&&this.createManagedBean(a)}restoreFocusOnHeader(e,t){if(!t)return;const{column:a}=t;a.getPinned()==this.pinned&&e.focusHeaderPosition({headerPosition:t,scroll:!1})}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new Nn(e=>this.comp.setCenterWidth(`${e}px`),!0))}},jw={tag:"div",cls:"ag-pinned-left-header",role:"rowgroup"},Kw={tag:"div",cls:"ag-pinned-right-header",role:"rowgroup"},_w={tag:"div",cls:"ag-header-viewport",role:"rowgroup",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eCenterContainer",cls:"ag-header-container",role:"presentation"}]},Wn=class extends V{constructor(e){super(),this.eCenterContainer=E,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:a=>this.setDisplayed(a),setCtrls:a=>this.setCtrls(a),setCenterWidth:a=>this.eCenterContainer.style.width=a,setViewportScrollLeft:a=>this.getGui().scrollLeft=a,setPinnedContainerWidth:a=>{const o=this.getGui();o.style.width=a,o.style.maxWidth=a,o.style.minWidth=a}};this.createManagedBean(new Sg(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",a=e?jw:t?Kw:_w;this.setTemplate(a),this.eRowContainer=this.eCenterContainer!==E?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),e.getGui().remove()}setCtrls(e){const t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let a;const o=r=>{const i=r.getGui();i.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(i),a&&fc(this.eRowContainer,i,a),a=i};for(const r of e){const i=r.instanceId,n=t[i];delete t[i];const l=n||this.createBean(new Bw(r));this.headerRowComps[i]=l,this.rowCompsList.push(l),o(l)}for(const r of Object.values(t))this.destroyRowComp(r)}},Qw={tag:"div",cls:"ag-header",role:"presentation"},Yw=class extends V{constructor(){super(Qw)}postConstruct(){const e={toggleCss:(o,r)=>this.toggleCss(o,r),setHeightAndMinHeight:o=>{this.getGui().style.height=o,this.getGui().style.minHeight=o}};this.createManagedBean(new bg).setComp(e,this.getGui(),this.getFocusableElement());const a=o=>{this.createManagedBean(o),this.appendChild(o)};a(new Wn("left")),a(new Wn(null)),a(new Wn("right"))}},Zw={selector:"AG-HEADER-ROOT",component:Yw},Ue={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},Un=class extends y{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.gos.get("domLayout"),t={autoHeight:e==="autoHeight",normal:e==="normal",print:e==="print"},a=t.autoHeight?Ue.AUTO_HEIGHT:t.print?Ue.PRINT:Ue.NORMAL;this.view.updateLayoutClasses(a,t)}},xg=class extends V{constructor(e,t){super(),this.direction=t,this.eViewport=E,this.eContainer=E,this.hideTimeout=0,this.setTemplate(e)}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.toggleCss("ag-apple-scrollbar",Hd()||Mt())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=Vd(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.toggleCss("ag-scrollbar-active",!0),a=()=>this.toggleCss("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:a,touchend:a})}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),nt(this.beans,()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=0),this.toggleCss("ag-scrollbar-scrolling",!0))},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout(()=>{this.toggleCss("ag-scrollbar-scrolling",!1),this.hideTimeout=0},400)}})}attemptSettingScrollPosition(e){const t=this.eViewport;Mc(this,()=>Me(t),()=>this.setScrollPosition(e),100)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}},Jw={tag:"div",cls:"ag-body-horizontal-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eLeftSpacer",cls:"ag-horizontal-left-spacer"},{tag:"div",ref:"eViewport",cls:"ag-body-horizontal-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-horizontal-scroll-container"}]},{tag:"div",ref:"eRightSpacer",cls:"ag-horizontal-right-spacer"}]},Rg=class extends xg{constructor(){super(Jw,"horizontal"),this.eLeftSpacer=E,this.eRightSpacer=E,this.setScrollVisibleDebounce=0}wireBeans(e){this.visibleCols=e.visibleCols,this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.refreshCompBottom.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.beans.ctrlsSvc.register("fakeHScrollComp",this),this.createManagedBean(new Nn(t=>this.eContainer.style.width=`${t}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.beans.pinnedRowModel?.getPinnedBottomTotalHeight()??0;this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleSvc.verticalScrollShowing;let t=this.visibleCols.getDisplayedColumnsRightWidth();const a=!this.enableRtl&&e,o=this.scrollVisibleSvc.getScrollbarWidth();a&&(t+=o),He(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=o);let r=this.visibleCols.getColsLeftWidth();this.enableRtl&&e&&(r+=o),He(this.eLeftSpacer,r),this.eLeftSpacer.classList.toggle("ag-scroller-corner",r<=o)}setScrollVisible(){const e=this.scrollVisibleSvc.horizontalScrollShowing,t=this.invisibleScrollbar,a=this.gos.get("suppressHorizontalScroll"),o=e&&this.scrollVisibleSvc.getScrollbarWidth()||0,i=a?0:o===0&&t?16:o,n=()=>{this.setScrollVisibleDebounce=0,this.toggleCss("ag-scrollbar-invisible",t),ao(this.getGui(),i),ao(this.eViewport,i),ao(this.eContainer,i),i||this.eContainer.style.setProperty("min-height","1px"),this.setVisible(e,{skipAriaHidden:!0})};window.clearTimeout(this.setScrollVisibleDebounce),e?this.setScrollVisibleDebounce=window.setTimeout(n,100):n()}getScrollPosition(){return sr(this.eViewport,this.enableRtl)}setScrollPosition(e){Me(this.eViewport)||this.attemptSettingScrollPosition(e),eo(this.eViewport,e,this.enableRtl)}},Xw={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:Rg},Eg=class extends y{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this,this.beans.rowContainerHeight)})}onHeightChanged(e){const t=e.uiContainerHeight,a=t!=null?`${t}px`:"";this.eContainer.style.height=a,this.eViewport&&(this.eViewport.style.height=a)}},$w={tag:"div",cls:"ag-body-vertical-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eViewport",cls:"ag-body-vertical-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-vertical-scroll-container"}]}]},Fg=class extends xg{constructor(){super($w,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new Eg(this.eContainer));const{ctrlsSvc:e}=this.beans;e.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this,e)})}setScrollVisible(){const{scrollVisibleSvc:e}=this.beans,t=e.verticalScrollShowing,a=this.invisibleScrollbar,o=t&&e.getScrollbarWidth()||0,r=o===0&&a?16:o;this.toggleCss("ag-scrollbar-invisible",a),He(this.getGui(),r),He(this.eViewport,r),He(this.eContainer,r),this.setDisplayed(t,{skipAriaHidden:!0})}onRowContainerHeightChanged(e){const a=e.getGridBodyCtrl().eBodyViewport,o=this.getScrollPosition(),r=a.scrollTop;o!=r&&this.setScrollPosition(r,!0)}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(e,t){!t&&!Me(this.eViewport)&&this.attemptSettingScrollPosition(e),this.eViewport.scrollTop=e}},eC={selector:"AG-FAKE-VERTICAL-SCROLL",component:Fg},Mg=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(Mg||{}),Tt="Viewport",zg="fakeVScrollComp",jn=["fakeHScrollComp","centerHeader","topCenter","bottomCenter","stickyTopCenter","stickyBottomCenter"],Dg=100,Kn=150,tC=class extends y{constructor(e){super(),this.clearRetryListenerFncs=[],this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.lastIsHorizontalScrollShowing=!1,this.scrollTimer=0,this.isScrollActive=!1,this.isVerticalPositionInvalidated=!0,this.isHorizontalPositionInvalidated=!0,this.eBodyViewport=e,this.resetLastHScrollDebounced=te(this,()=>this.lastScrollSource[1]=null,Kn),this.resetLastVScrollDebounced=te(this,()=>this.lastScrollSource[0]=null,Kn)}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.animationFrameSvc=e.animationFrameSvc,this.visibleCols=e.visibleCols}destroy(){super.destroy(),this.clearRetryListenerFncs=[],window.clearTimeout(this.scrollTimer)}postConstruct(){this.enableRtl=this.gos.get("enableRtl");const e=this.invalidateVerticalScroll.bind(this),t=this.invalidateHorizontalScroll.bind(this);this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),bodyHeightChanged:e,scrollGapChanged:t}),this.addManagedElementListeners(this.eBodyViewport,{scroll:e}),this.ctrlsSvc.whenReady(this,a=>{this.centerRowsCtrl=a.center,this.fakeVScrollComp=a.fakeVScrollComp,this.fakeHScrollComp=a.fakeHScrollComp,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}invalidateHorizontalScroll(){this.isHorizontalPositionInvalidated=!0}invalidateVerticalScroll(){this.isVerticalPositionInvalidated=!0}addScrollListener(){this.addHorizontalScrollListeners(),this.addVerticalScrollListeners()}addHorizontalScrollListeners(){this.addManagedElementListeners(this.centerRowsCtrl.eViewport,{scroll:this.onHScroll.bind(this,Tt)});for(const e of jn){const t=this.ctrlsSvc.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){const e=this.gos.get("debounceVerticalScrollbar"),t=e?te(this,this.onVScroll.bind(this,Tt),Dg):this.onVScroll.bind(this,Tt),a=e?te(this,this.onVScroll.bind(this,zg),Dg):this.onVScroll.bind(this,zg);this.addManagedElementListeners(this.eBodyViewport,{scroll:t}),this.registerScrollPartner(this.fakeVScrollComp,a)}registerScrollPartner(e,t){e.onScrollCallback(t)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){this.centerRowsCtrl!=null&&(e===void 0&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft()),this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e)))}setScrollLeftForAllContainersExceptCurrent(e){for(const t of[...jn,Tt]){if(this.lastScrollSource[1]===t)continue;const a=this.getViewportForSource(t);eo(a,e,this.enableRtl)}}getViewportForSource(e){return e===Tt?this.centerRowsCtrl.eViewport:this.ctrlsSvc.get(e).eViewport}isControllingScroll(e,t){return this.lastScrollSource[t]==null?(t===0?this.lastScrollSource[0]=e:this.lastScrollSource[1]=e,!0):this.lastScrollSource[t]===e}onHScroll(e){if(!this.isControllingScroll(e,1))return;const t=this.centerRowsCtrl.eViewport,{scrollLeft:a}=t;if(this.shouldBlockScrollUpdate(1,a,!0))return;const o=sr(this.getViewportForSource(e),this.enableRtl);this.doHorizontalScroll(o),this.resetLastHScrollDebounced()}onVScroll(e){if(!this.isControllingScroll(e,0))return;const t=e===Tt?this.eBodyViewport.scrollTop:this.fakeVScrollComp.getScrollPosition();let a=t;if(this.shouldBlockScrollUpdate(0,a,!0))return;e===Tt?this.fakeVScrollComp.setScrollPosition(a):(this.eBodyViewport.scrollTop=t,a=this.eBodyViewport.scrollTop,this.invalidateVerticalScroll(),a!==t&&this.fakeVScrollComp.setScrollPosition(a,!0));const{animationFrameSvc:o}=this;o?.setScrollTop(a),this.nextScrollTop=a,o?.active?o.schedule():this.scrollGridIfNeeded(!0),this.resetLastVScrollDebounced()}doHorizontalScroll(e){const t=this.fakeHScrollComp.getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}isScrolling(){return this.isScrollActive}fireScrollEvent(e){const t={type:"bodyScroll",direction:e===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.isScrollActive=!0,this.eventSvc.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=window.setTimeout(()=>{this.scrollTimer=0,this.isScrollActive=!1,this.eventSvc.dispatchEvent({...t,type:"bodyScrollEnd"})},Kn)}shouldBlockScrollUpdate(e,t,a=!1){return a&&!Mt()?!1:e===0?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=lr(this.eBodyViewport),{scrollHeight:a}=this.eBodyViewport;return e<0||e+t>a}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:a}=this.centerRowsCtrl.eViewport;if(this.enableRtl){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>a}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){const e=this.scrollLeft;let t=!1;for(const a of jn)if(this.getViewportForSource(a).scrollLeft!==e){t=!0;break}t&&this.onHScroll(Tt)}scrollGridIfNeeded(e=!1){const t=this.scrollTop!=this.nextScrollTop;return t&&(this.scrollTop=this.nextScrollTop,e&&this.invalidateVerticalScroll(),this.redrawRowsAfterScroll()),t}setHorizontalScrollPosition(e,t=!1){const o=this.centerRowsCtrl.eViewport.scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(this.enableRtl?e=e>0?0:o:e=Math.min(Math.max(e,0),o)),eo(this.centerRowsCtrl.eViewport,Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.invalidateVerticalScroll(),this.eBodyViewport.scrollTop=e}getVScrollPosition(){if(!this.isVerticalPositionInvalidated){const{lastOffsetHeight:a,lastScrollTop:o}=this;return{top:o,bottom:o+a}}this.isVerticalPositionInvalidated=!1;const{scrollTop:e,offsetHeight:t}=this.eBodyViewport;return this.lastScrollTop=e,this.lastOffsetHeight=t,{top:e,bottom:e+t}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.isHorizontalPositionInvalidated&&(this.lastIsHorizontalScrollShowing=this.centerRowsCtrl.isHorizontalScrollShowing(),this.isHorizontalPositionInvalidated=!1),this.lastIsHorizontalScrollShowing}scrollHorizontally(e){const t=this.centerRowsCtrl.eViewport.scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.eViewport.scrollLeft-t}scrollToTop(){this.setVerticalScrollPosition(0)}ensureNodeVisible(e,t=null){const{rowModel:a}=this.beans,o=a.getRowCount();let r=-1;for(let i=0;i<o;i++){const n=a.getRow(i);if(typeof e=="function"){if(n&&e(n)){r=i;break}}else if(e===n||e===n.data){r=i;break}}r>=0&&this.ensureIndexVisible(r,t)}ensureIndexVisible(e,t,a=0){if(se(this.gos,"print"))return;const{rowModel:o}=this.beans,r=o.getRowCount();if(typeof e!="number"||e<0||e>=r){x(88,{index:e});return}this.clearRetryListeners();const{frameworkOverrides:i,pageBounds:n,rowContainerHeight:l,rowRenderer:s}=this.beans;i.wrapIncoming(()=>{const c=this.ctrlsSvc.getGridBodyCtrl(),d=o.getRow(e);let g,u,h=0;this.invalidateVerticalScroll();do{const{stickyTopHeight:p,stickyBottomHeight:f}=c,m=d.rowTop,v=d.rowHeight,w=n.getPixelOffset(),b=d.rowTop-w,k=b+d.rowHeight,S=this.getVScrollPosition(),R=l.divStretchOffset,M=S.top+R,L=S.bottom+R,O=L-M,N=l.getScrollPositionForPixel(b),B=l.getScrollPositionForPixel(k-O),K=Math.min((N+B)/2,b),W=M+p>b,ge=L-f<k;let ie=null;t==="top"?ie=N-p:t==="bottom"?ie=B+f:t==="middle"?ie=K:W?ie=N-p:ge&&(B-N>O?ie=N-p:ie=B+f),ie!==null&&(this.setVerticalScrollPosition(ie),s.redraw({afterScroll:!0})),g=m!==d.rowTop||v!==d.rowHeight,u=p!==c.stickyTopHeight||f!==c.stickyBottomHeight,h++}while((g||u)&&h<10);if(this.animationFrameSvc?.flushAllFrames(),a<10&&(d?.stub||!this.beans.rowAutoHeight?.areRowsMeasured())){const p=this.getVScrollPosition().top;this.clearRetryListenerFncs=this.addManagedEventListeners({bodyScroll:()=>{const f=this.getVScrollPosition().top;p!==f&&this.clearRetryListeners()},modelUpdated:()=>{this.clearRetryListeners(),!(e>=o.getRowCount())&&this.ensureIndexVisible(e,t,a+1)}})}})}clearRetryListeners(){for(const e of this.clearRetryListenerFncs)e();this.clearRetryListenerFncs=[]}ensureColumnVisible(e,t="auto"){const{colModel:a,frameworkOverrides:o}=this.beans,r=a.getCol(e);if(!r||r.isPinned()||!this.visibleCols.isColDisplayed(r))return;const i=this.getPositionedHorizontalScroll(r,t);o.wrapIncoming(()=>{i!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(i),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameSvc?.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:a,columnAfterEnd:o}=this.isColumnOutsideViewport(e),r=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),i=this.centerRowsCtrl.getCenterWidth(),n=this.enableRtl;let l=(n?a:o)||r,s=n?o:a;t!=="auto"&&(l=t==="start",s=t==="end");const c=t==="middle";if(l||s||c){const{colLeft:d,colMiddle:g,colRight:u}=this.getColumnBounds(e);return c?g-i/2:l?n?u:d:n?d-i:u-i}return null}isColumnOutsideViewport(e){const{start:t,end:a}=this.getViewportBounds(),{colLeft:o,colRight:r}=this.getColumnBounds(e),i=this.enableRtl,n=i?t>r:a<r,l=i?a<o:t>o;return{columnBeforeStart:n,columnAfterEnd:l}}getColumnBounds(e){const t=this.enableRtl,a=this.visibleCols.bodyWidth,o=e.getActualWidth(),r=e.getLeft(),i=t?-1:1,n=t?a-r:r,l=n+o*i,s=n+o/2*i;return{colLeft:n,colMiddle:s,colRight:l}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft(),a=t,o=e+t;return{start:a,end:o,width:e}}},Ag={horizontal:{overflow:e=>e.scrollWidth-e.clientWidth,scrollSize:e=>e.scrollWidth,clientSize:e=>e.clientWidth,opposite:"vertical"},vertical:{overflow:e=>e.scrollHeight-e.clientHeight,scrollSize:e=>e.scrollHeight,clientSize:e=>e.clientHeight,opposite:"horizontal"}};function aC(e,t,a=yn()||0,o,r){return Pg(e,t,"horizontal",a,o,r)}function oC(e,t,a=yn()||0,o,r){return Pg(e,t,"vertical",a,o,r)}function Pg(e,t,a,o,r,i){const n=Ag[a],l=Ag[n.opposite],s=r?Me(r):!0,c=i?Me(i):!0,d=n.overflow(e);if(d<=0)return!1;if(!t||o===0)return!0;const g=l.overflow(t);if(g<=0)return!0;if(d<=o){if(s&&c&&rC({candidateOverflow:g,candidateScrollSize:l.scrollSize(t),candidateClientSize:l.clientSize(t),scrollbarWidth:o}))return!1;const u=n.clientSize(e)+o;return n.scrollSize(e)<=u}return!0}function rC({candidateOverflow:e,candidateScrollSize:t,candidateClientSize:a,scrollbarWidth:o}){if(e<=0||e>o)return!1;const r=a+o;return t>a&&t<=r}var iC=class extends y{constructor(e){super(),this.centerContainerCtrl=e}wireBeans(e){this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const{beans:e,centerContainerCtrl:t,gridBodyCtrl:a}=this,o=()=>{nt(e,()=>{this.onCenterViewportResized()})};t.registerViewportResizeListener(o),a.registerBodyViewportResizeListener(o)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleSvc.updateScrollGap(),this.centerContainerCtrl.isViewportInTheDOMTree()){const{pinnedCols:e,colFlex:t}=this.beans;e?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const a=this.centerContainerCtrl.getCenterWidth();a!==this.centerWidth&&(this.centerWidth=a,t?.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.scrollFeature.checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=this.gridBodyCtrl.eBodyViewport,t=lr(e);this.bodyHeight!==t&&(this.bodyHeight=t,this.eventSvc.dispatchEvent({type:"bodyHeightChanged"}))}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){if(!this.isAlive())return;const e={horizontalScrollShowing:this.centerContainerCtrl.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleSvc.setScrollsVisible(e)}onHorizontalViewportChanged(){const{centerContainerCtrl:e,beans:t}=this,a=e.getCenterWidth(),o=e.getViewportScrollLeft();t.colViewport.setScrollPosition(a,o)}};function _n(e){return e.altKey||e.ctrlKey||e.metaKey?!1:e.key?.length===1}function Eo(e,t,a,o){const r=t.getColDef().cellRendererParams?.suppressMouseEventHandling;return Ig(e,t,a,o,r)}function nC(e,t,a,o){const r=t?.suppressMouseEventHandling;return Ig(e,void 0,a,o,r)}function Ig(e,t,a,o,r){return r?r(I(e,{column:t,node:a,event:o})):!1}function Tg(e,t,a){let o=t;for(;o;){const r=Zc(e,o,a);if(r)return r;o=o.parentElement}return null}var Br="cellCtrl";function Or(e,t){return Tg(e,t,Br)}var Nr="renderedRow";function Lg(e,t){return Tg(e,t,Nr)}function Qn(e,t,a,o,r){const i=o?o.colDef.suppressKeyboardEvent:void 0;if(!i)return!1;const n=I(e,{event:t,editing:r,column:o,node:a,data:a.data,colDef:o.colDef});return!!(i&&i(n))}function Bg(e){const{pinnedRowModel:t,rowModel:a,rangeSvc:o,visibleCols:r}=e;if(!o||r.allCols.length===0)return;const i=t?.isEmpty("top")??!0,n=t?.isEmpty("bottom")??!0,l=i?null:"top";let s,c;n?(s=null,c=a.getRowCount()-1):(s="bottom",c=t?.getPinnedBottomRowCount()??-1),o.setCellRange({rowStartIndex:0,rowStartPinned:l,rowEndIndex:c,rowEndPinned:s})}var lC=class extends y{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.beans.touchSvc?.mockRowContextMenu(this),this.editSvc=this.beans.editSvc}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){let e="mousedown";ur("pointerdown")?e="pointerdown":ur("touchstart")&&(e="touchstart");const t=["dblclick","contextmenu","mouseover","mouseout","click",e];for(const a of t){const o=this.processMouseEvent.bind(this,a);this.addManagedElementListeners(this.element,{[a]:o})}}processMouseEvent(e,t){if(!oo(this.beans,t)||Je(t))return;const{cellCtrl:a,rowCtrl:o}=this.getControlsForEventTarget(t.target);e==="contextmenu"?(a?.column&&a.dispatchCellContextMenuEvent(t),this.beans.contextMenuSvc?.handleContextMenuMouseEvent(t,void 0,o,a)):(a&&a.onMouseEvent(e,t),o&&o.onMouseEvent(e,t))}getControlsForEventTarget(e){const{gos:t}=this;return{cellCtrl:Or(t,e),rowCtrl:Lg(t,e)}}processKeyboardEvent(e,t){const{cellCtrl:a,rowCtrl:o}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(a?this.processCellKeyboardEvent(a,e,t):o?.isFullWidth()&&this.processFullWidthRowKeyboardEvent(o,e,t))}processCellKeyboardEvent(e,t,a){const o=this.editSvc?.isEditing(e,{withOpenEditor:!0})??!1;!Qn(this.gos,a,e.rowNode,e.column,o)&&t==="keydown"&&(!o&&this.beans.navigation?.handlePageScrollingKey(a)||e.onKeyDown(a),this.doGridOperations(a,o),_n(a)&&e.processCharacter(a)),t==="keydown"&&this.eventSvc.dispatchEvent(e.createEvent(a,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,a){const{rowNode:o}=e,{focusSvc:r,navigation:i,notesSvc:n}=this.beans,s=r.getFocusedCell()?.column;!Qn(this.gos,a,o,s,!1)&&t==="keydown"&&this.processFullWidthRowKeyDown(e,a,s,i,n),t==="keydown"&&this.eventSvc.dispatchEvent(e.createRowEvent("cellKeyDown",a))}processFullWidthRowKeyDown(e,t,a,o=this.beans.navigation,r=this.beans.notesSvc){switch(t.key){case C.PAGE_HOME:case C.PAGE_END:case C.PAGE_UP:case C.PAGE_DOWN:o?.handlePageScrollingKey(t,!0);return;case C.LEFT:case C.RIGHT:if(!this.gos.get("embedFullWidthRows"))return;case C.UP:case C.DOWN:e.onKeyboardNavigate(t);return;case C.F2:this.processFullWidthRowNoteShortcut(e,t,a,r);return;case C.TAB:e.onTabKeyDown(t);return;default:}}processFullWidthRowNoteShortcut(e,t,a,o=this.beans.notesSvc){if(!t.shiftKey||!o?.hasDataSource())return;const r=e.rowNode,i=e.findFullWidthInfoForEvent(t);let n;if(i){const{pinned:s}=i;n={rowNode:r,location:"fullWidthRow",pinned:s==="left"||s==="right"?s:void 0}}else a&&(n={rowNode:r,column:a});if(!n)return;const l=o.getNoteAccess(n);l&&(!l.isSuppressed||l.canView)&&(o.showNote(l.params,!0),t.preventDefault())}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!oo(this.beans,e))return;const a=Rd(e),{clipboardSvc:o,undoRedo:r}=this.beans;if(a===C.A)return this.onCtrlAndA(e);if(a===C.C)return this.onCtrlAndC(o,e);if(a===C.D)return this.onCtrlAndD(o,e);if(a===C.V)return this.onCtrlAndV(o,e);if(a===C.X)return this.onCtrlAndX(o,e);if(a===C.Y)return this.onCtrlAndY(r);if(a===C.Z)return this.onCtrlAndZ(r,e)}onCtrlAndA(e){const{beans:{rowModel:t,rangeSvc:a,selectionSvc:o},gos:r}=this;a&&Qe(r)&&!Uv(r)&&t.isRowsToRender()?Bg(this.beans):o&&o.selectAllRowNodes({source:"keyboardSelectAll",selectAll:rd(r)}),e.preventDefault()}onCtrlAndC(e,t){if(!e||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:a}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(a,{withOpenEditor:!0})||(t.preventDefault(),e.copyToClipboard())}onCtrlAndX(e,t){if(!e||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:a}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(a,{withOpenEditor:!0})||(t.preventDefault(),e.cutToClipboard(void 0,"ui"))}onCtrlAndV(e,t){const{cellCtrl:a}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(a,{withOpenEditor:!0})||e&&!this.gos.get("suppressClipboardPaste")&&e.pasteFromClipboard()}onCtrlAndD(e,t){e&&!this.gos.get("suppressClipboardPaste")&&e.copyRangeDown(),t.preventDefault()}onCtrlAndZ(e,t){!this.gos.get("undoRedoCellEditing")||!e||(t.preventDefault(),t.shiftKey?e.redo("ui"):e.undo("ui"))}onCtrlAndY(e){e?.redo("ui")}},Hr=e=>e.topRowCtrls,Gr=e=>e.getStickyTopRowCtrls(),Vr=e=>e.getStickyBottomRowCtrls(),qr=e=>e.bottomRowCtrls,Wr=e=>e.allRowCtrls,Yn=e=>e.getCtrls("top"),Zn=e=>e.getCtrls("center"),Jn=e=>e.getCtrls("bottom"),sC={center:{type:"center",name:"center-cols",getRowCtrls:Wr,getSpannedRowCtrls:Zn},left:{type:"left",name:"pinned-left-cols",pinnedType:"left",getRowCtrls:Wr,getSpannedRowCtrls:Zn},right:{type:"right",name:"pinned-right-cols",pinnedType:"right",getRowCtrls:Wr,getSpannedRowCtrls:Zn},fullWidth:{type:"fullWidth",name:"full-width",fullWidth:!0,getRowCtrls:Wr},topCenter:{type:"center",name:"floating-top",getRowCtrls:Hr,getSpannedRowCtrls:Yn},topLeft:{type:"left",name:"pinned-left-floating",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:Hr,getSpannedRowCtrls:Yn},topRight:{type:"right",name:"pinned-right-floating",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:Hr,getSpannedRowCtrls:Yn},topFullWidth:{type:"fullWidth",name:"floating-top-full-width",fullWidth:!0,getRowCtrls:Hr},stickyTopCenter:{type:"center",name:"sticky-top",getRowCtrls:Gr},stickyTopLeft:{type:"left",name:"pinned-left-sticky-top",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:Gr},stickyTopRight:{type:"right",name:"pinned-right-sticky-top",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:Gr},stickyTopFullWidth:{type:"fullWidth",name:"sticky-top-full-width",fullWidth:!0,getRowCtrls:Gr},stickyBottomCenter:{type:"center",name:"sticky-bottom",getRowCtrls:Vr},stickyBottomLeft:{type:"left",name:"pinned-left-sticky-bottom",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:Vr},stickyBottomRight:{type:"right",name:"pinned-right-sticky-bottom",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:Vr},stickyBottomFullWidth:{type:"fullWidth",name:"sticky-bottom-full-width",fullWidth:!0,getRowCtrls:Vr},bottomCenter:{type:"center",name:"floating-bottom",getRowCtrls:qr,getSpannedRowCtrls:Jn},bottomLeft:{type:"left",name:"pinned-left-floating-bottom",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:qr,getSpannedRowCtrls:Jn},bottomRight:{type:"right",name:"pinned-right-floating-bottom",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:qr,getSpannedRowCtrls:Jn},bottomFullWidth:{type:"fullWidth",name:"floating-bottom-full-width",fullWidth:!0,getRowCtrls:qr}};function Xn(e){return`ag-${La(e).name}-viewport`}function $n(e){const t=La(e);return t.container??`ag-${t.name}-container`}function Og(e){return`ag-${La(e).name}-spanned-cells-container`}function La(e){return sC[e]}var cC=["topCenter","topLeft","topRight"],dC=["bottomCenter","bottomLeft","bottomRight"],gC=["center","left","right"],uC=["center","left","right","fullWidth"],hC=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],pC=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],fC=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],Ng=["stickyTopCenter","stickyTopLeft","stickyTopRight"],Hg=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],mC=[...Ng,"stickyTopFullWidth",...Hg,"stickyBottomFullWidth"],vC=[...cC,...dC,...gC,...Ng,...Hg],Gg=class extends y{constructor(e){super(),this.name=e,this.visible=!0,this.EMPTY_CTRLS=[],this.options=La(e)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new iC(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.beans.ctrlsSvc.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}setComp(e,t,a,o){this.comp=e,this.eContainer=t,this.eSpannedContainer=a,this.eViewport=o,this.createManagedBean(new lC(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();const{pinnedCols:r,rangeSvc:i}=this.beans,n=()=>this.onPinnedWidthChanged();this.forContainers(pC,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(r?.createPinnedWidthFeature(!0,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:n})}),this.forContainers(fC,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(r?.createPinnedWidthFeature(!1,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:n})}),this.forContainers(uC,()=>this.createManagedBean(new Eg(this.eContainer,this.name==="center"?o:void 0))),i&&this.forContainers(vC,()=>this.createManagedBean(i.createDragListenerFeature(this.eContainer))),this.forContainers(hC,()=>this.createManagedBean(new Nn(l=>this.comp.setContainerWidth(`${l}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}addListeners(){const{spannedRowRenderer:e,gos:t}=this.beans,a=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({displayedColumnsChanged:a,displayedColumnsWidthChanged:a,displayedRowsChanged:o=>this.onDisplayedRowsChanged(o.afterScroll)}),a(),this.onDisplayedRowsChanged(),e&&this.options.getSpannedRowCtrls&&t.get("enableCellSpan")&&this.addManagedListeners(e,{spannedRowsUpdated:()=>{const o=this.options.getSpannedRowCtrls(e);o&&this.comp.setSpannedRowCtrls(o,!1)}})}listenOnDomOrder(){if(mC.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const t=()=>{const a=this.gos.get("ensureDomOrder"),o=se(this.gos,"print");this.comp.setDomOrder(a||o)};this.addManagedPropertyListener("domLayout",t),t()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const{dragSvc:e}=this.beans;if(!e)return;const t=a=>{e.dragging&&a.cancelable&&a.preventDefault()};this.eContainer.addEventListener("touchmove",t,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",t))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),a=this.getCenterViewportScrollLeft();this.beans.colViewport.setScrollPosition(t,a,e)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return ka(this.eViewport)}getCenterViewportScrollLeft(){return sr(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=it(this.beans,this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return pc(this.eViewport)}getViewportScrollLeft(){return sr(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){const{beans:e,gos:t,eViewport:a}=this,o=t.get("alwaysShowHorizontalScroll"),{ctrlsSvc:r}=e,i=r.getGridBodyCtrl()?.eBodyViewport,n=r.get("fakeHScrollComp")?.getGui(),l=r.get("fakeVScrollComp")?.getGui();return o||aC(a,i,void 0,n,l)}setHorizontalScroll(e){this.comp.setHorizontalScroll(e)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){eo(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(this.options.pinnedType!=null)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.beans.rowRenderer);if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const a=se(this.gos,"print"),r=this.gos.get("embedFullWidthRows")||a,i=t.filter(n=>{const l=n.isFullWidth();return this.options.fullWidth?!r&&l:r||!l});this.comp.setRowCtrls({rowCtrls:i,useFlushSync:e})}},Vg="ag-force-vertical-scroll",bC="ag-selectable",wC="ag-column-moving",qg=class extends y{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.colModel=e.colModel,this.scrollVisibleSvc=e.scrollVisibleSvc,this.pinnedRowModel=e.pinnedRowModel,this.filterManager=e.filterManager,this.rowGroupColsSvc=e.rowGroupColsSvc}setComp(e,t,a,o,r,i,n){this.comp=e,this.eGridBody=t,this.eBodyViewport=a,this.eTop=o,this.eBottom=r,this.eStickyTop=i,this.eStickyBottom=n,this.eCenterColsViewport=a.querySelector(`.${Xn("center")}`),this.eFullWidthContainer=a.querySelector(`.${$n("fullWidth")}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",l=>this.setCellTextSelection(l.currentValue)),this.createManagedBean(new Un(this.comp)),this.scrollFeature=this.createManagedBean(new tC(a)),this.beans.rowDragSvc?.setupRowDrag(a,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([o,a,r,i,n]),this.setGridRootRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),this.filterManager?.setupAdvFilterHeaderComp(o),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){const e=this.setFloatingHeights.bind(this),t=this.setGridRootRole.bind(this),a=this.toggleRowResizeStyles.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.updateScrollingClasses.bind(this),pinnedRowDataChanged:e,pinnedHeightChanged:e,pinnedRowsChanged:e,headerHeightChanged:this.setStickyTopOffsetTop.bind(this),columnRowGroupChanged:t,columnPivotChanged:t,rowResizeStarted:a,rowResizeEnded:a}),this.addManagedPropertyListener("treeData",t)}toggleRowResizeStyles(e){const t=e.type==="rowResizeStarted";this.eBodyViewport.classList.toggle("ag-prevent-animation",t)}onGridColumnsChanged(){const e=this.beans.colModel.getCols();this.comp.setColumnCount(e.length)}onScrollVisibilityChanged(){const{scrollVisibleSvc:e}=this,t=e.verticalScrollShowing;this.setVerticalScrollPaddingVisible(t),this.setStickyWidth(t),this.setStickyBottomOffsetBottom();const a=t&&e.getScrollbarWidth()||0,o=Vd()?16:0,r=`calc(100% + ${a+o}px)`;nt(this.beans,()=>this.comp.setBodyViewportWidth(r)),this.updateScrollingClasses()}setGridRootRole(){const{rowGroupColsSvc:e,colModel:t,gos:a}=this;let o=a.get("treeData");if(!o){const r=t.pivotMode;o=(e?e.columns.length:0)>=(r?2:1)}this.comp.setGridRootRole(o?"treegrid":"grid")}addFocusListeners(e){for(const t of e)this.addManagedElementListeners(t,{focusin:a=>{const{target:o}=a,r=Yt(o,"ag-root",t);t.classList.toggle("ag-has-focus",!r)},focusout:a=>{const{target:o,relatedTarget:r}=a,i=t.contains(r),n=Yt(r,"ag-root",t);Yt(o,"ag-root",t)||(!i||n)&&t.classList.remove("ag-has-focus")}})}setColumnMovingCss(e){this.comp.setColumnMovingCss(wC,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(bC,e)}updateScrollingClasses(){const{eGridBody:{classList:e},scrollVisibleSvc:t}=this;e.toggle("ag-body-vertical-content-no-gap",!t.verticalScrollGap),e.toggle("ag-body-horizontal-content-no-gap",!t.horizontalScrollGap)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){this.beans.editSvc?.addStopEditingWhenGridLosesFocus([this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom])}updateRowCount(){const e=(this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.filterManager?.getHeaderRowCount()??0),{rowModel:t}=this.beans,a=t.isLastRowIndexKnown()?t.getRowCount():-1,o=a===-1?-1:e+a;this.comp.setRowCount(o)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const{gos:e,comp:t,ctrlsSvc:a}=this,o=e.get("alwaysShowVerticalScroll"),r=o?Vg:null,i=se(e,"normal");t.setAlwaysVerticalScrollClass(r,o);const n=a.get("center")?.eViewport,l=a.get("fakeHScrollComp")?.getGui(),s=a.get("fakeVScrollComp")?.getGui();return o||i&&oC(this.eBodyViewport,n,void 0,s,l)}setupRowAnimationCssClass(){const{rowContainerHeight:e,environment:t}=this.beans;let a=t.sizesMeasured;const o=()=>{const r=a&&ea(this.gos)&&!e.stretching,i=r?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(i,r)};o(),this.addManagedEventListeners({heightScaleChanged:o}),this.addManagedPropertyListener("animateRows",o),this.addManagedEventListeners({stylesChanged:()=>{!a&&t.sizesMeasured&&(a=!0,o())}})}addBodyViewportListener(){const{eBodyViewport:e,eStickyTop:t,eStickyBottom:a,eTop:o,eBottom:r,beans:{popupSvc:i,touchSvc:n}}=this,l=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(e,{contextmenu:l}),n?.mockBodyContextMenu(this,l),this.addManagedElementListeners(e,{wheel:this.onBodyViewportWheel.bind(this,i)});const s=this.onStickyWheel.bind(this);for(const d of[t,a,o,r])this.addManagedElementListeners(d,{wheel:s});const c=this.onHorizontalWheel.bind(this);for(const d of["left","right","topLeft","topRight","bottomLeft","bottomRight"])this.addManagedElementListeners(this.ctrlsSvc.get(d).eContainer,{wheel:c});this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:e=>this.onFullWidthContainerWheel(e)})}onFullWidthContainerWheel(e){const{deltaX:t,deltaY:a,shiftKey:o}=e;(o||Math.abs(t)>Math.abs(a))&&oo(this.beans,e)&&this.scrollGridBodyToMatchEvent(e)}onStickyWheel(e){const{deltaY:t}=e;this.scrollVertically(t)>0&&e.preventDefault()}onHorizontalWheel(e){const{deltaX:t,deltaY:a,shiftKey:o}=e;(o||Math.abs(t)>Math.abs(a))&&this.scrollGridBodyToMatchEvent(e)}scrollGridBodyToMatchEvent(e){const{deltaX:t,deltaY:a}=e;e.preventDefault(),this.eCenterColsViewport.scrollBy({left:t||a})}onBodyViewportContextMenu(e,t,a){if(!e&&!a)return;this.gos.get("preventDefaultOnContextMenu")&&(e||a).preventDefault();const{target:o}=e||t;(o===this.eBodyViewport||o===this.ctrlsSvc.get("center").eViewport)&&this.beans.contextMenuSvc?.showContextMenu({mouseEvent:e,touchEvent:a,value:null,anchorToElement:this.eGridBody,source:"ui"})}onBodyViewportWheel(e,t){this.gos.get("suppressScrollWhenPopupsAreOpen")&&e?.hasAnchoredPopup()&&t.preventDefault()}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.scrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}setFloatingHeights(){const{pinnedRowModel:e,beans:{environment:t}}=this,a=e?.getPinnedTopTotalHeight(),o=e?.getPinnedBottomTotalHeight(),r=t.getPinnedRowBorderWidth(),i=t.getRowBorderWidth(),n=r-i,l=a?n+a:0,s=o?n+o:0;this.comp.setTopHeight(l),this.comp.setBottomHeight(s),this.comp.setTopInvisible(l<=0),this.comp.setBottomInvisible(s<=0),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}setStickyWidth(e){if(!e)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const t=this.scrollVisibleSvc.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`)}}setStickyTopOffsetTop(){const t=this.ctrlsSvc.get("gridHeaderCtrl").headerHeight+(this.filterManager?.getHeaderHeight()??0),a=this.pinnedRowModel?.getPinnedTopTotalHeight()??0;let o=0;t>0&&(o+=t),a>0&&(o+=a),o>0&&(o+=1),this.comp.setStickyTopTop(`${o}px`)}setStickyBottomOffsetBottom(){const{pinnedRowModel:e,scrollVisibleSvc:t,comp:a}=this,o=e?.getPinnedBottomTotalHeight()??0,i=t.horizontalScrollShowing&&t.getScrollbarWidth()||0,n=o+i;a.setStickyBottomBottom(`${n}px`)}};function re(e){return yt(e)}var CC=class extends V{constructor(e,t,a,o,r){super(),this.cellCtrl=t,this.rowResizerElement=null,this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.gos=e.gos,this.column=t.column,this.rowNode=t.rowNode,this.eRow=o;const i=re({tag:"div",role:t.getCellAriaRole(),attrs:{"comp-id":`${this.getCompId()}`,"col-id":t.column.colIdSanitised}});this.eCell=i;let n;t.isCellSpanning()?(n=re({tag:"div",cls:"ag-spanned-cell-wrapper",role:"presentation"}),n.appendChild(i),this.setTemplateFromElement(n)):this.setTemplateFromElement(i),this.cellCssManager=new un(()=>i),this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const l={toggleCss:(s,c)=>this.cellCssManager.toggleCss(s,c),setUserStyles:s=>to(i,s),getFocusableElement:()=>i,setIncludeSelection:s=>this.includeSelection=s,setIncludeRowDrag:s=>this.includeRowDrag=s,setIncludeDndSource:s=>this.includeDndSource=s,setRowResizerElement:s=>this.setRowResizerElement(s),setRenderDetails:(s,c,d)=>this.setRenderDetails(s,c,d),setEditDetails:(s,c,d)=>this.setEditDetails(s,c,d),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue(),refreshEditStyles:(s,c)=>this.refreshEditStyles(s,c)};t.setComp(l,i,n,this.eCellWrapper,a,r,void 0)}getParentOfValue(){return this.eCellValue??this.eCellWrapper??this.eCell}setRowResizerElement(e){this.rowResizerElement&&Ee(this.rowResizerElement),this.rowResizerElement=e,e&&this.eCell.appendChild(e)}setRenderDetails(e,t,a){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const r=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(a||r)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t)),this.rowDraggingComp?.refreshVisibility(),this.rowResizerElement&&!this.rowResizerElement.parentElement&&this.eCell.appendChild(this.rowResizerElement)}setEditDetails(e,t,a){e?this.createCellEditorInstance(e,t,a):this.destroyEditor()}removeControls(){const e=this.beans.context;this.checkboxSelectionComp=e.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=e.destroyBean(this.dndSourceComp),this.rowDraggingComp=e.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,a=t||this.forceWrapper,o=a&&this.eCellWrapper==null;o&&(this.eCellWrapper=re({tag:"div",cls:"ag-cell-wrapper",role:"presentation"}),this.eCell.appendChild(this.eCellWrapper));const r=!a&&this.eCellWrapper!=null;r&&(Ee(this.eCellWrapper),this.eCellWrapper=void 0),this.cellCssManager.toggleCss("ag-cell-value",!a);const i=!e&&a,n=i&&this.eCellValue==null;if(n){const c=this.cellCtrl.getCellValueClass();this.eCellValue=re({tag:"span",cls:c,role:"presentation"}),this.eCellWrapper.appendChild(this.eCellValue)}const l=!i&&this.eCellValue!=null;l&&(Ee(this.eCellValue),this.eCellValue=void 0);const s=o||r||n||l;return s&&this.removeControls(),!e&&t&&this.addControls(),s}addControls(){const{cellCtrl:e,eCellWrapper:t,eCellValue:a,includeRowDrag:o,includeDndSource:r,includeSelection:i}=this,n=l=>{l&&t.insertBefore(l.getGui(),a)};o&&this.rowDraggingComp==null&&(this.rowDraggingComp=e.createRowDragComp(),n(this.rowDraggingComp)),r&&this.dndSourceComp==null&&(this.dndSourceComp=e.createDndSource(),n(this.dndSourceComp)),i&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=e.createSelectionCheckbox(),n(this.checkboxSelectionComp))}createCellEditorInstance(e,t,a){const o=this.editorVersion,r=e.newAgStackInstance(),{params:i}=e;r.then(l=>this.afterCellEditorCreated(o,l,i,t,a)),_(this.cellEditor)&&i.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();le(t);const a=_t(e);a!=null&&(t.textContent=a)}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),Ee(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;(this.cellEditorPopupWrapper?.getGui().contains(Q(this.beans))||this.cellCtrl.hasBrowserFocus())&&this.eCell.focus({preventScroll:!0}),this.hideEditorPopup?.(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),Ee(this.cellEditorGui),this.cellCtrl.disableEditorTooltipFeature(),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer?.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){const t=this.rendererVersion,a=i=>n=>{if(this.rendererVersion!==t||!this.isAlive())return;const s=i.newAgStackInstance(),c=this.afterCellRendererCreated.bind(this,t,i.componentClass);s?.then(c)},{animationFrameSvc:o}=this.beans;let r;if(o?.active&&this.firstRender?r=(i,n=!1)=>{o.createTask(a(i),this.rowNode.rowIndex,"p2",i.componentFromFramework,n)}:r=i=>a(i)(),e.params?.deferRender&&!this.cellCtrl.rowNode.group){const{loadingComp:i,onReady:n}=this.cellCtrl.getDeferLoadingCellRenderer();i&&(r(i),n.then(()=>r(e,!0)))}else r(e)}afterCellRendererCreated(e,t,a){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(a);return}this.cellRenderer=a,this.cellRendererClass=t;const r=a.getGui();if(this.cellRendererGui=r,r!=null){const i=this.getParentOfValue();le(i),i.appendChild(r)}}afterCellEditorCreated(e,t,a,o,r){const i=e!==this.editorVersion,{context:n}=this.beans;if(i){n.destroyBean(t);return}if(t.isCancelBeforeStart?.()){n.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){x(97,{colId:this.column.getId()}),n.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const s=o||t.isPopup?.();s?this.addPopupCellEditor(a,r):this.addInCellEditor(),this.refreshEditStyles(!0,s),t.afterGuiAttached?.(),this.cellCtrl.enableEditorTooltipFeature(t),this.cellCtrl.cellEditorAttached()}refreshEditStyles(e,t){const{cellCssManager:a}=this;a.toggleCss("ag-cell-inline-editing",e&&!t),a.toggleCss("ag-cell-popup-editing",e&&!!t),a.toggleCss("ag-cell-not-inline-editing",!e||!!t)}addInCellEditor(){const{eCell:e}=this;e.contains(Q(this.beans))&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),le(this.getParentOfValue()),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){const{gos:a,context:o,popupSvc:r,editSvc:i}=this.beans;a.get("editType")==="fullRow"&&x(98);const n=this.cellEditorPopupWrapper=o.createBean(i.createPopupEditorWrapper(e)),{cellEditor:l,cellEditorGui:s,eCell:c,rowNode:d,column:g,cellCtrl:u}=this,h=n.getGui();s&&h.appendChild(s);const p=a.get("stopEditingWhenCellsLoseFocus"),f=t??l.getPopupPosition?.()??"over",m=a.get("enableRtl"),v={ePopup:h,additionalParams:{column:g,rowNode:d},type:"popupCellEditor",eventSource:c,position:f,alignSide:m?"right":"left",keepWithinBounds:!0},w=r.positionPopupByComponent.bind(r,v),b=r.addPopup({modal:p,eChild:h,closeOnEsc:!0,closedCallback:k=>{u.onPopupEditorClosed(k)},anchorToElement:c,positionCallback:w,ariaOwns:c});b&&(this.hideEditorPopup=b.hideFunc)}detach(){this.getGui().remove()}destroy(){this.destroyRenderer(),this.destroyEditor(),this.removeControls(),super.destroy()}},yC=class extends V{constructor(e,t,a){super(),this.cellComps=new Map,this.beans=t,this.rowCtrl=e;const o=re({tag:"div",role:"row",attrs:{"comp-id":`${this.getCompId()}`}});this.setInitialStyle(o,a),this.setTemplateFromElement(o);const r=o.style;this.domOrder=this.rowCtrl.getDomOrder();const i={setDomOrder:n=>this.domOrder=n,setCellCtrls:n=>this.setCellCtrls(n),showFullWidth:n=>this.showFullWidth(n),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,getFullWidthCellRendererParams:()=>this.fullWidthCellRendererParams,toggleCss:(n,l)=>this.toggleCss(n,l),setUserStyles:n=>to(o,n),setTop:n=>r.top=n,setTransform:n=>r.transform=n,setRowIndex:n=>o.setAttribute("row-index",n),setRowId:n=>o.setAttribute("row-id",n),setRowBusinessKey:n=>o.setAttribute("row-business-key",n),refreshFullWidth:n=>{const l=n();return this.fullWidthCellRendererParams=l,this.fullWidthCellRenderer?.refresh?.(l)??!1}};e.setComp(i,this.getGui(),a,void 0),this.addDestroyFunc(()=>{e.unsetComp(a)})}setInitialStyle(e,t){const a=this.rowCtrl.getInitialTransform(t);if(a)e.style.setProperty("transform",a);else{const o=this.rowCtrl.getInitialRowTop(t);o&&e.style.setProperty("top",o)}}showFullWidth(e){const t=o=>{if(this.isAlive()){const r=o.getGui();this.getGui().appendChild(r),this.rowCtrl.setupDetailRowAutoHeight(r),this.setFullWidthRowComp(o,e.params)}else this.beans.context.destroyBean(o)};e.newAgStackInstance().then(t)}setCellCtrls(e){const t=new Map(this.cellComps);for(const a of e){const o=a.instanceId;this.cellComps.has(o)?t.delete(o):this.newCellComp(a)}this.destroyCells(t),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];for(const a of e){const o=this.cellComps.get(a.instanceId);o&&t.push(o.getGui())}mc(this.getGui(),t)}newCellComp(e){const t=this.beans.editSvc?.isEditing(e,{withOpenEditor:!0})??!1,a=new CC(this.beans,e,this.rowCtrl.printLayout,this.getGui(),t);this.cellComps.set(e.instanceId,a),this.getGui().appendChild(a.getGui())}destroy(){super.destroy(),this.destroyCells(this.cellComps)}setFullWidthRowComp(e,t){this.fullWidthCellRenderer=e,this.fullWidthCellRendererParams=t,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer),this.fullWidthCellRendererParams=void 0})}destroyCells(e){for(const t of e.values()){if(!t)continue;const a=t.cellCtrl.instanceId;this.cellComps.get(a)===t&&(t.detach(),t.destroy(),this.cellComps.delete(a))}}};function kC(e,t,a){const o=!!a.gos.get("enableCellSpan")&&!!t.getSpannedRowCtrls,r={tag:"div",ref:"eContainer",cls:$n(e),role:"rowgroup"};if(t.type==="center"||o){const i={tag:"div",ref:"eSpannedContainer",cls:`ag-spanning-container ${Og(e)}`,role:"presentation"};return r.role="presentation",{tag:"div",ref:"eViewport",cls:`ag-viewport ${Xn(e)}`,role:"rowgroup",children:[r,o?i:null]}}return r}var SC=class extends V{constructor(e){super(),this.eViewport=E,this.eContainer=E,this.eSpannedContainer=E,this.rowCompsNoSpan={},this.rowCompsWithSpan={},this.name=e?.name,this.options=La(this.name)}postConstruct(){this.setTemplate(kC(this.name,this.options,this.beans));const e={setHorizontalScroll:a=>this.eViewport.scrollLeft=a,setViewportHeight:a=>this.eViewport.style.height=a,setRowCtrls:({rowCtrls:a})=>this.setRowCtrls(a),setSpannedRowCtrls:a=>this.setRowCtrls(a,!0),setDomOrder:a=>{this.domOrder=a},setContainerWidth:a=>{this.eContainer.style.width=a,this.eSpannedContainer&&(this.eSpannedContainer.style.width=a)},setOffsetTop:a=>{const o=`translateY(${a})`;this.eContainer.style.transform=o,this.eSpannedContainer&&(this.eSpannedContainer.style.transform=o)}};this.createManagedBean(new Gg(this.name)).setComp(e,this.eContainer,this.eSpannedContainer,this.eViewport)}destroy(){this.setRowCtrls([]),this.setRowCtrls([],!0),super.destroy(),this.lastPlacedElement=null}setRowCtrls(e,t){const{beans:a,options:o}=this,r=t?this.eSpannedContainer:this.eContainer,i=t?{...this.rowCompsWithSpan}:{...this.rowCompsNoSpan},n={};t?this.rowCompsWithSpan=n:this.rowCompsNoSpan=n,this.lastPlacedElement=null;const l=[];for(const s of e){const c=s.instanceId,d=i[c];let g;if(d)g=d,delete i[c];else{if(!s.rowNode.displayed)continue;g=new yC(s,a,o.type)}n[c]=g,l.push([g,!d])}this.removeOldRows(Object.values(i)),this.addRowNodes(l,r)}addRowNodes(e,t){const{domOrder:a}=this;for(const[o,r]of e){const i=o.getGui();a?this.ensureDomOrder(i,t):r&&t.appendChild(i)}}removeOldRows(e){for(const t of e)t.getGui().remove(),t.destroy()}ensureDomOrder(e,t){fc(t,e,this.lastPlacedElement),this.lastPlacedElement=e}},xC={selector:"AG-ROW-CONTAINER",component:SC};function Fo(e,t){return t.map(a=>{const o=`e${a[0].toUpperCase()+a.substring(1)}RowContainer`;return e[o]={name:a},{tag:"ag-row-container",ref:o,attrs:{name:a}}})}function RC(e){const t={},a={tag:"div",ref:"eGridRoot",cls:"ag-root ag-unselectable",children:[{tag:"ag-header-root"},{tag:"div",ref:"eTop",cls:"ag-floating-top",role:"presentation",children:Fo(t,["topLeft","topCenter","topRight","topFullWidth"])},{tag:"div",ref:"eBody",cls:"ag-body",role:"presentation",children:[{tag:"div",ref:"eBodyViewport",cls:"ag-body-viewport",role:"presentation",children:Fo(t,["left","center","right","fullWidth"])},{tag:"ag-fake-vertical-scroll"}]},{tag:"div",ref:"eStickyTop",cls:"ag-sticky-top",role:"presentation",children:Fo(t,["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])},{tag:"div",ref:"eStickyBottom",cls:"ag-sticky-bottom",role:"presentation",children:Fo(t,["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])},{tag:"div",ref:"eBottom",cls:"ag-floating-bottom",role:"presentation",children:Fo(t,["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])},{tag:"ag-fake-horizontal-scroll"},e?{tag:"ag-overlay-wrapper"}:null]};return{paramsMap:t,elementParams:a}}var EC=class extends V{constructor(){super(...arguments),this.eGridRoot=E,this.eBodyViewport=E,this.eStickyTop=E,this.eStickyBottom=E,this.eTop=E,this.eBottom=E,this.eBody=E}postConstruct(){const{overlays:e,rangeSvc:t}=this.beans,a=e?.getOverlayWrapperSelector(),{paramsMap:o,elementParams:r}=RC(!!a);this.setTemplate(r,[...a?[a]:[],Xw,eC,Zw,xC],o);const i=(l,s)=>{const c=`${l}px`;s.style.minHeight=c,s.style.height=c},n={setRowAnimationCssOnBodyViewport:(l,s)=>this.setRowAnimationCssOnBodyViewport(l,s),setColumnCount:l=>rc(this.getGui(),l),setRowCount:l=>oc(this.getGui(),l),setTopHeight:l=>i(l,this.eTop),setBottomHeight:l=>i(l,this.eBottom),setTopInvisible:l=>this.eTop.classList.toggle("ag-invisible",l),setBottomInvisible:l=>this.eBottom.classList.toggle("ag-invisible",l),setStickyTopHeight:l=>this.eStickyTop.style.height=l,setStickyTopTop:l=>this.eStickyTop.style.top=l,setStickyTopWidth:l=>this.eStickyTop.style.width=l,setStickyBottomHeight:l=>{this.eStickyBottom.style.height=l,this.eStickyBottom.classList.toggle("ag-invisible",l==="0px")},setStickyBottomBottom:l=>this.eStickyBottom.style.bottom=l,setStickyBottomWidth:l=>this.eStickyBottom.style.width=l,setColumnMovingCss:(l,s)=>this.toggleCss(l,s),updateLayoutClasses:(l,s)=>{const c=[this.eBodyViewport.classList,this.eBody.classList];for(const d of c)d.toggle(Ue.AUTO_HEIGHT,s.autoHeight),d.toggle(Ue.NORMAL,s.normal),d.toggle(Ue.PRINT,s.print);this.toggleCss(Ue.AUTO_HEIGHT,s.autoHeight),this.toggleCss(Ue.NORMAL,s.normal),this.toggleCss(Ue.PRINT,s.print)},setAlwaysVerticalScrollClass:(l,s)=>this.eBodyViewport.classList.toggle(Vg,s),registerBodyViewportResizeListener:l=>{const s=it(this.beans,this.eBodyViewport,l);this.addDestroyFunc(()=>s())},setPinnedTopBottomOverflowY:l=>this.eTop.style.overflowY=this.eBottom.style.overflowY=l,setCellSelectableCss:(l,s)=>{for(const c of[this.eTop,this.eBodyViewport,this.eBottom])c.classList.toggle(l,s)},setBodyViewportWidth:l=>this.eBodyViewport.style.width=l,setGridRootRole:l=>_e(this.eGridRoot,l)};this.ctrl=this.createManagedBean(new qg),this.ctrl.setComp(n,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(t&&Qe(this.gos)||Ma(this.gos))&&Jm(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const a=this.eBodyViewport.classList;a.toggle("ag-row-animation",t),a.toggle("ag-row-no-animation",!t)}getFocusableContainerName(){return"gridBody"}},FC={selector:"AG-GRID-BODY",component:EC},Ur={TAB_GUARD:"ag-tab-guard",TAB_GUARD_TOP:"ag-tab-guard-top",TAB_GUARD_BOTTOM:"ag-tab-guard-bottom"},Wg=class extends ue{constructor(e,t){super(),this.stopPropagationCallbacks=t,this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:a,eTopGuard:o,eBottomGuard:r,focusTrapActive:i,forceFocusOutWhenTabGuardsAreEmpty:n,isFocusableContainer:l,focusInnerElement:s,onFocusIn:c,onFocusOut:d,shouldStopEventPropagation:g,onTabKeyDown:u,handleKeyDown:h,isEmpty:p,eFocusableElement:f}=e;this.comp=a,this.eTopGuard=o,this.eBottomGuard=r,this.providedFocusInnerElement=s,this.eFocusableElement=f,this.focusTrapActive=!!i,this.forceFocusOutWhenTabGuardsAreEmpty=!!n,this.isFocusableContainer=!!l,this.providedFocusIn=c,this.providedFocusOut=d,this.providedShouldStopEventPropagation=g,this.providedOnTabKeyDown=u,this.providedHandleKeyDown=h,this.providedIsEmpty=p}postConstruct(){this.createManagedBean(new Wd(this.eFocusableElement,this.stopPropagationCallbacks,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards();for(const e of[this.eTopGuard,this.eBottomGuard])this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)})}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&(this.providedIsEmpty?this.providedIsEmpty():zt(this.eFocusableElement,".ag-tab-guard").length===0)){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;!(this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t))&&this.forceFocusOutWhenTabGuardsAreEmpty&&this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard)}findNextElementOutsideAndFocus(e){const t=oe(this.beans),a=zt(t.body,null,!0),o=a.indexOf(e?this.eTopGuard:this.eBottomGuard);if(o===-1)return;let r,i;e?(r=0,i=o):(r=o+1,i=a.length);const n=a.slice(r,i),l=this.gos.get("tabIndex");n.sort((s,c)=>{const d=Number.parseInt(s.getAttribute("tabindex")||"0"),g=Number.parseInt(c.getAttribute("tabindex")||"0");return g===l?1:d===l?-1:d===0?1:g===0?-1:d-g}),n[e?n.length-1:0]?.focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(this.focusTrapActive||e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const a=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),a&&(a.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=zt(this.eFocusableElement);return this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(-1,1)),t.length?(t[e?t.length-1:0].focus({preventScroll:!0}),!0):!1}getNextFocusableElement(e){return At(this.beans,this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},el=class extends ue{constructor(e,t){super(),this.comp=e,this.stopPropagationCallbacks=t}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:a,eFocusableElement:o,stopPropagationCallbacks:r}=this,i=[t,a],n={setTabIndex:v=>{for(const w of i)v==null?w.removeAttribute("tabindex"):w.setAttribute("tabindex",v)}};this.addTabGuards(t,a);const{focusTrapActive:l=!1,onFocusIn:s,onFocusOut:c,focusInnerElement:d,handleKeyDown:g,onTabKeyDown:u,shouldStopEventPropagation:h,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:f,isFocusableContainer:m}=e;this.tabGuardCtrl=this.createManagedBean(new Wg({comp:n,focusTrapActive:l,eTopGuard:t,eBottomGuard:a,eFocusableElement:o,onFocusIn:s,onFocusOut:c,focusInnerElement:d,handleKeyDown:g,onTabKeyDown:u,shouldStopEventPropagation:h,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:f,isFocusableContainer:m},r))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=oe(this.beans).createElement("div"),a=e==="top"?Ur.TAB_GUARD_TOP:Ur.TAB_GUARD_BOTTOM;return t.classList.add(Ur.TAB_GUARD,a),_e(t,"presentation"),t}addTabGuards(e,t){const a=this.eFocusableElement;a.prepend(e),a.append(t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];le(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,a){gr(t)||(t=t.getGui());const{eBottomGuard:o}=this;o?o.before(t):e(t,a)}destroy(){const{eTopGuard:e,eBottomGuard:t}=this;Ee(e),Ee(t),super.destroy()}},Ug=class extends ra{initialiseTabGuard(e,t){this.tabGuardFeature=this.createManagedBean(new el(this,t)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},tl=class extends Ug{initialiseTabGuard(e){super.initialiseTabGuard(e,vo)}},jg=(e,t)=>fg(e,()=>Dt(e.getGui(),t,!1,!0)),Kg=e=>e?.getFocusableContainerName()??"external",MC=e=>e==null?"external":typeof e=="string"?e:"gridBody",_g=class extends y{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}setComp(e,t,a){this.view=e,this.eGridHostDiv=t,this.eGui=a,this.eGui.setAttribute("grid-id",this.beans.context.getId());const{dragAndDrop:o,ctrlsSvc:r}=this.beans;o?.registerGridDropTarget(()=>this.eGui,this),this.createManagedBean(new Un(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),this.gos.get("suppressContentVisibilityAuto")&&this.eGui.style.setProperty("content-visibility","visible");const i=it(this.beans,this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>i()),r.register("gridCtrl",this)}isDetailGrid(){return xn(this.getGui())?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){const e=this.beans;return{paginationSelector:e.pagination?.getPaginationSelector(),gridHeaderDropZonesSelector:e.registry?.getSelector("AG-GRID-HEADER-DROP-ZONES"),sideBarSelector:e.sideBar?.getSelector(),statusBarSelector:e.registry?.getSelector("AG-STATUS-BAR"),toolbarSelector:e.registry?.getSelector("AG-TOOLBAR"),watermarkSelector:e.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){this.eventSvc.dispatchEvent({type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight})}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){const{view:t}=this;e===!1?t.setCursor(null):t.setCursor(e===1?"ew-resize":"ns-resize")}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),{indexWithFocus:a,nextIndex:o}=this.getNextFocusableIndex(t,e),r=a===-1?e?t.length-1:0:o,{gos:i,beans:{focusSvc:n,navigation:l}}=this,s=i.getCallback("tabToNextGridContainer");if(s){const c=n.getDefaultTabToNextGridContainerTarget({backwards:e,focusableContainers:t,nextIndex:r}),d=Kg(t[r]),g=c==null&&d==="gridBody"?"gridBody":MC(c),u=s({backwards:e,previousContainer:Kg(t[a]),nextContainer:g,defaultTarget:c});if(u!==void 0){if(typeof u=="boolean")return u;if(typeof u=="string"){if(u==="gridBody")return this.focusGridBodyDefault(e)||void 0;const h=t.find(p=>p.getFocusableContainerName()===u);if(!h){Tc(`tabToNextGridContainer - ${u} container not found`);return}return jg(h,e)?!0:void 0}return zw(u)?n.focusHeaderPosition({headerPosition:u})||void 0:(l?.ensureCellVisible(u),n.setFocusedCell({...u,forceBrowserFocus:!0}),n.isCellFocused(u)||void 0)}}return this.focusNextInnerContainerDefault({backwards:e,focusableContainers:t,indexWithFocus:a,nextIndex:r})||void 0}focusInnerElement(e){const{gos:t,beans:a,beans:{focusSvc:o,visibleCols:r}}=this;if(t.getCallback("focusGridInnerElement")?.({fromBottom:!!e}))return!0;const n=this.getFocusableContainers();if(e)return this.focusNextInnerContainerDefault({backwards:!0,focusableContainers:n,indexWithFocus:n.length,nextIndex:n.length-1})?!0:o.focusGridView({column:j(r.allCols),backwards:!0});const l=r.allCols;if(t.get("headerHeight")===0||We(a)){if(o.focusGridView({column:l[0],backwards:e}))return!0;for(let s=1;s<n.length;s++)if(Dt(n[s].getGui(),e))return!0;return!1}return o.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}isFocusInsideGridBody(){const e=this.getFocusableContainers(),{indexWithFocus:t}=this.getNextFocusableIndex(e);return e[t]?.getFocusableContainerName()==="gridBody"}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}allowFocusForNextCoreContainer(e){const t=this.view.getFocusableContainers(),{indexWithFocus:a,nextIndex:o}=this.getNextFocusableIndex(t,e);this.focusNextInnerContainerDefault({backwards:!!e,focusableContainers:t,indexWithFocus:a,nextIndex:o})||this.forceFocusOutOfContainer(e)}isFocusable(){const e=this.beans;return!So(e)||!We(e)||!!e.sideBar?.comp?.isDisplayed()}getNextFocusableIndex(e,t){const a=Q(this.beans),o=e.findIndex(r=>r.getGui().contains(a));return{indexWithFocus:o,nextIndex:o+(t?-1:1)}}focusGridBodyDefault(e){const{gos:t,beans:a,beans:{focusSvc:o,visibleCols:{allCols:r}}}=this;return e?o.focusGridView({column:j(r),backwards:!0}):t.get("headerHeight")===0||We(a)?o.focusGridView({column:r[0]}):o.focusFirstHeader()}focusNextInnerContainerDefault(e){const{backwards:t,focusableContainers:a,indexWithFocus:o}=e,r=t?-1:1;for(let i=e.nextIndex;i>=0&&i<a.length;i+=r){const n=a[i];if(n.getFocusableContainerName()==="gridBody"&&(o===-1||(t?o>i:o<i))){if(this.focusGridBodyDefault(t))return!0;continue}if(jg(n,t))return!0}return!1}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers]}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},zC=class extends tl{constructor(e){super(),this.gridBody=E,this.toolbar=E,this.gridHeaderDropZones=E,this.sideBar=E,this.statusBar=E,this.pagination=E,this.rootWrapperBody=E,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:i=>this.addCss(i),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:i=>{this.getGui().style.userSelect=i??"",this.getGui().style.webkitUserSelect=i??""},setCursor:i=>{this.getGui().style.cursor=i??""}},t=this.createManagedBean(new _g),a=t.getOptionalSelectors(),o=this.createTemplate(a),r=[FC,...Object.values(a).filter(i=>!!i)];this.setTemplate(o,r),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:i=>t.focusInnerElement(i),forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:()=>!t.isFocusable()})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{e.remove(),St(this.gos,"Grid removed from DOM")})}updateLayoutClasses(e,t){const a=this.rootWrapperBody.classList,{AUTO_HEIGHT:o,NORMAL:r,PRINT:i}=Ue,{autoHeight:n,normal:l,print:s}=t;a.toggle(o,n),a.toggle(r,l),a.toggle(i,s),this.toggleCss(o,n),this.toggleCss(r,l),this.toggleCss(i,s)}createTemplate(e){const t=e.toolbarSelector?{tag:"ag-toolbar",ref:"toolbar"}:null,a=e.gridHeaderDropZonesSelector?{tag:"ag-grid-header-drop-zones",ref:"gridHeaderDropZones"}:null,o=e.sideBarSelector?{tag:"ag-side-bar",ref:"sideBar"}:null,r=e.statusBarSelector?{tag:"ag-status-bar",ref:"statusBar"}:null,i=e.watermarkSelector?{tag:"ag-watermark"}:null,n=e.paginationSelector?{tag:"ag-pagination",ref:"pagination"}:null;return{tag:"div",cls:"ag-root-wrapper",role:"presentation",children:[t,a,{tag:"div",ref:"rootWrapperBody",cls:"ag-root-wrapper-body",role:"presentation",children:[{tag:"ag-grid-body",ref:"gridBody"},o]},r,n,i]}}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){if(!e&&this.pagination?.isDisplayed()){this.pagination.forceFocusOutOfContainer(e);return}super.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[];this.toolbar&&e.push(this.toolbar),e.push(...this.gridHeaderDropZones?.getFocusableContainers?.()??[],this.gridBody);for(const t of[this.sideBar,this.statusBar,this.pagination])t&&e.push(t);return e.filter(t=>Me(t.getGui()))}},T=(e,t)=>{for(const a of Object.keys(t))t[a]=e;return t},Qg={dispatchEvent:"CommunityCore",...T("CommunityCore",{destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,isModuleRegistered:0}),...T("GridState",{getState:0,setState:0}),...T("SharedRowSelection",{setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0}),...T("RowApi",{redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRowIndex:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0}),...T("ScrollApi",{getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0}),...T("KeyboardNavigation",{getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0}),...T("EventApi",{addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0}),...T("ValueCache",{expireValueCache:0}),...T("CellApi",{getCellValue:0}),...T("SharedMenu",{showColumnMenu:0,hidePopupMenu:0}),...T("Sort",{onSortChanged:0}),...T("PinnedRow",{getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,forEachPinnedRow:0}),...T("Overlay",{showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0}),...T("RenderApi",{setGridAriaProperty:0,refreshCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0}),...T("HighlightChanges",{flashCells:0}),...T("RowDrag",{addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getRowDropPositionIndicator:0,setRowDropPositionIndicator:0}),...T("ColumnApi",{getColumnDefs:0,getColumnDef:0,getDisplayNameForColumn:0,getColumn:0,getColumns:0,applyColumnState:0,getColumnState:0,resetColumnState:0,isPinning:0,isPinningLeft:0,isPinningRight:0,getDisplayedColAfter:0,getDisplayedColBefore:0,setColumnsVisible:0,setColumnsPinned:0,getAllGridColumns:0,getDisplayedLeftColumns:0,getDisplayedCenterColumns:0,getDisplayedRightColumns:0,getAllDisplayedColumns:0,getAllDisplayedVirtualColumns:0}),...T("ColumnAutoSize",{sizeColumnsToFit:0,autoSizeColumns:0,autoSizeAllColumns:0}),...T("ColumnGroup",{setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumnGroup:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0}),...T("ColumnMove",{moveColumnByIndex:0,moveColumns:0}),...T("ColumnResize",{setColumnWidths:0}),...T("ColumnHover",{isColumnHovered:0}),...T("EditCore",{getCellEditorInstances:0,getEditingCells:0,getEditRowValues:0,stopEditing:0,startEditingCell:0,isEditing:0,validateEdit:0}),...T("BatchEdit",{startBatchEdit:0,cancelBatchEdit:0,commitBatchEdit:0,isBatchEditing:0}),...T("UndoRedoEdit",{undoCellEditing:0,redoCellEditing:0,getCurrentUndoSize:0,getCurrentRedoSize:0}),...T("FilterCore",{isAnyFilterPresent:0,onFilterChanged:0}),...T("ColumnFilter",{isColumnFilterPresent:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,hideColumnFilter:0,getColumnFilterHandler:0,doFilterAction:0}),...T("QuickFilter",{isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0}),...T("Notes",{getNote:0,setNote:0,refreshNotes:0}),...T("Find",{findGetActiveMatch:0,findGetTotalMatches:0,findGoTo:0,findNext:0,findPrevious:0,findGetNumMatches:0,findGetParts:0,findClearActive:0,findRefresh:0}),...T("Pagination",{paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0}),...T("CsrmSsrmSharedApi",{expandAll:0,collapseAll:0,resetRowGroupExpansion:0}),...T("SsrmInfiniteSharedApi",{setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...T("ClientSideRowModelApi",{onGroupExpandedOrCollapsed:0,refreshClientSideRowModel:0,isRowDataEmpty:0,forEachLeafNode:0,forEachNodeAfterFilter:0,forEachNodeAfterFilterAndSort:0,applyTransaction:0,applyTransactionAsync:0,flushAsyncTransactions:0,getBestCostNodeSelection:0,onRowHeightChanged:0,resetRowHeights:0}),...T("CsvExport",{getDataAsCsv:0,exportDataAsCsv:0}),...T("InfiniteRowModel",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...T("AdvancedFilter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...T("IntegratedCharts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...T("Clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...T("ExcelExport",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...T("SharedMasterDetail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...T("Formula",{refreshFormulas:0}),...T("ContextMenu",{showContextMenu:0}),...T("ColumnMenu",{showColumnChooser:0,hideColumnChooser:0}),...T("CellSelection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...T("SharedRowGrouping",{setRowGroupColumns:0,removeRowGroupColumns:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0}),...T("SharedAggregation",{addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0}),...T("SharedPivot",{isPivotMode:0,getPivotResultColumn:0,setValueColumns:0,getValueColumns:0,removeValueColumns:0,addValueColumns:0,setPivotColumns:0,removePivotColumns:0,addPivotColumns:0,getPivotColumns:0,setPivotResultColumns:0,getPivotResultColumns:0}),...T("ServerSideRowModelApi",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0,onRowHeightChanged:0,resetRowHeights:0}),...T("SideBar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...T("Toolbar",{getToolbarItemInstance:0}),...T("StatusBar",{getStatusPanel:0}),...T("AiToolkit",{getStructuredSchema:0})},al={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},DC=(e,t)=>e.eventSvc.dispatchEvent(t),Yg=class{};Reflect.defineProperty(Yg,"name",{value:"GridApi"});var AC=class extends y{constructor(){super(),this.beanName="apiFunctionSvc",this.api=new Yg,this.fns={...al,dispatchEvent:DC},this.preDestroyLink="";const{api:e}=this;for(const t of Object.keys(Qg))e[t]=this.makeApi(t)[t]}postConstruct(){this.preDestroyLink=this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(e,t){const{fns:a,beans:o}=this;a!==al&&(a[e]=o?.validation?.validateApiFunction(e,t)??t)}makeApi(e){return{[e]:(...t)=>{const{beans:a,fns:{[e]:o}}=this;return o?o(a,...t):this.apiNotFound(e)}}}apiNotFound(e){const{beans:t,gos:a,preDestroyLink:o}=this;if(!t)x(26,{fnName:e,preDestroyLink:o});else{const r=Qg[e];a.assertModuleRegistered(r,`api.${e}`)&&x(27,{fnName:e,module:r})}}destroy(){super.destroy(),this.fns=al,this.beans=null}};function Zg(e){return e.context.getId()}function PC(e){e.gridDestroySvc.destroy()}function IC(e){return e.gridDestroySvc.destroyCalled}function TC(e,t){return e.gos.get(t)}function LC(e,t,a){Jg(e,{[t]:a})}function Jg(e,t){e.gos.updateGridOptions({options:t})}function BC(e,t){const a=t.replace(/Module$/,"");return e.gos.isModuleRegistered(a)}function Xg(e,t,a){const o=ye(e,t,a);if(o){const{className:i}=o;if(typeof i=="string"&&i.includes("ag-icon")||typeof i=="object"&&i["ag-icon"])return o}const r=re({tag:"span"});return r.appendChild(o),r}function ye(e,t,a){let o=null;e==="smallDown"?x(262):e==="smallLeft"?x(263):e==="smallRight"&&x(264);const r=a?.colDef.icons;if(r&&(o=r[e]),t.gos&&!o){const i=t.gos.get("icons");i&&(o=i[e])}if(o){let i;if(typeof o=="function")i=o();else if(typeof o=="string")i=o;else{x(38,{iconName:e});return}if(typeof i=="string")return cr(i);if(gr(i))return i;x(133,{iconName:e});return}else{const i=t.registry.getIcon(e);return i||t.validation?.validateIcon(e),re({tag:"span",cls:`ag-icon ag-icon-${i??e}`,role:"presentation",attrs:{unselectable:"on"}})}}var OC={tag:"div",cls:"ag-drag-handle ag-row-drag",attrs:{draggable:"true"}},NC=class extends V{constructor(e,t,a){super(OC),this.rowNode=e,this.column=t,this.eCell=a}postConstruct(){this.getGui().appendChild(ye("rowDrag",this.beans,null)),this.addGuiEventListener("mousedown",t=>{t.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const{rowNode:t,column:a,eCell:o,gos:r}=this,i=a.colDef.dndSourceOnRowDrag,n=e.dataTransfer;if(n.setDragImage(o,0,0),i){const l=I(r,{rowNode:t,dragEvent:e});i(l)}else try{const l=JSON.stringify(t.data);n.setData("application/json",l),n.setData("text/plain",l)}catch{}}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},HC=".ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}.ag-dnd-ghost-not-allowed{border:var(--ag-drag-and-drop-image-not-allowed-border)}",GC={tag:"div",children:[{tag:"div",ref:"eGhost",cls:"ag-dnd-ghost ag-unselectable",children:[{tag:"span",ref:"eIcon",cls:"ag-dnd-ghost-icon ag-shake-left-to-right"},{tag:"div",ref:"eLabel",cls:"ag-dnd-ghost-label"}]}]},VC=class extends V{constructor(){super(),this.dragSource=null,this.eIcon=E,this.eLabel=E,this.eGhost=E,this.registerCSS(HC)}postConstruct(){const e=t=>Xg(t,this.beans,null);this.dropIconMap={pinned:e("columnMovePin"),hide:e("columnMoveHide"),move:e("columnMoveMove"),left:e("columnMoveLeft"),right:e("columnMoveRight"),group:e("columnMoveGroup"),aggregate:e("columnMoveValue"),pivot:e("columnMovePivot"),notAllowed:e("dropNotAllowed")}}init(e){this.dragSource=e.dragSource,this.setTemplate(GC),this.beans.environment.applyThemeClasses(this.eGhost)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t){const{eGhost:a,eIcon:o,dragSource:r,dropIconMap:i,gos:n}=this;le(o),e||(e=r?.getDefaultIconName?r.getDefaultIconName():"notAllowed");const l=i[e];a.classList.toggle("ag-dnd-ghost-not-allowed",e==="notAllowed"),o.classList.toggle("ag-shake-left-to-right",t),!(l===i.hide&&n.get("suppressDragLeaveHidesColumns"))&&l&&o.appendChild(l)}setLabel(e){this.eLabel.textContent=e}};function qC(e,t){e.rowDragSvc?.rowDragFeature?.addRowDropZone(t)}function WC(e,t){const a=e.dragAndDrop?.findExternalZone(t.getContainer());a&&e.dragAndDrop?.removeDropTarget(a)}function UC(e,t){return e.rowDragSvc?.rowDragFeature?.getRowDropZone(t)}function jC(e){const t=e.rowDropHighlightSvc;return t?{row:t.row,dropIndicatorPosition:t.position}:{row:null,dropIndicatorPosition:"none"}}function KC(e,t){const a=e.rowDropHighlightSvc;if(!a)return;const o=t?.row;let r=t?.dropIndicatorPosition;r!=="above"&&r!=="below"&&r!=="inside"&&(r="none");const i=o?.rowIndex;i==null||r==="none"?a.clear():a.set(o,r)}var $g=(e,t)=>{if(t!=null&&e?.setPointerCapture)try{return e.setPointerCapture(t),e.hasPointerCapture(t)}catch{}return!1},_C=(e,t)=>{if(typeof PointerEvent>"u"||!(t instanceof PointerEvent))return null;const a=t.pointerId;if(!$g(e,a))return null;const o={eElement:e,pointerId:a,onLost(r){YC(o,r)}};return e.addEventListener("lostpointercapture",o.onLost),o},QC=e=>{if(!e)return;eu(e);const{eElement:t,pointerId:a}=e;if(t){try{t.releasePointerCapture(a)}catch{}e.eElement=null}},eu=e=>{const{eElement:t,onLost:a}=e;t&&a&&(t.removeEventListener("lostpointercapture",a),e.onLost=null)},YC=(e,t)=>{eu(e);const{eElement:a,pointerId:o}=e;a&&t.pointerId===o&&$g(a,o)},Ba,Oa,ol={passive:!0},Lt={passive:!1},Xe=e=>{if(!Oa)Oa=new WeakSet;else if(Oa.has(e))return!1;return Oa.add(e),!0},tu=class extends ue{constructor(){super(...arguments),this.beanName="dragSvc",this.dragging=!1,this.drag=null,this.dragSources=[]}get startTarget(){return this.drag?.start.target??null}isPointer(){return!!Ba?.has(Ie(this.beans))}hasPointerCapture(){const e=this.drag?.pointerCapture;return!!(e&&this.beans.eRootDiv.hasPointerCapture?.(e.pointerId))}destroy(){this.drag&&this.cancelDrag();const e=this.dragSources;for(const t of e)au(t);e.length=0,super.destroy()}removeDragSource(e){const t=this.dragSources;for(let a=0,o=t.length;a<o;++a){const r=t[a];if(r.params===e){t.splice(a,1),au(r);break}}}addDragSource(e){if(!this.isAlive())return;const{eElement:t,includeTouch:a}=e,o=[];let r;if(a){const c=t.style;c&&(r=c.touchAction,c.touchAction="none")}const i={handlers:o,params:e,oldTouchAction:r};this.dragSources.push(i),hr(o,[t,"pointerdown",c=>this.onPointerDown(e,c),Lt],[t,"mousedown",c=>this.onMouseDown(e,c)]);const s=this.gos.get("suppressTouch");a&&!s&&hr(o,[t,"touchstart",d=>this.onTouchStart(e,d),Lt])}cancelDrag(e){const t=this.drag;e??(e=t?.eElement),e&&this.eventSvc.dispatchEvent({type:"dragCancelled",target:e}),t?.params.onDragCancel?.(),this.destroyDrag()}shouldPreventMouseEvent(e){const t=e.type;return(t==="mousemove"||t==="pointermove")&&e.cancelable&&oo(this.beans,e)&&!Ca(il(e))}initDrag(e,...t){this.drag=e;const a=this.beans,o=l=>this.onScroll(l),r=l=>this.onKeyDown(l),i=Ie(a),n=oe(a);hr(e.handlers,[i,"contextmenu",kt],[i,"keydown",r],[n,"scroll",o,{capture:!0}],[n.defaultView||window,"scroll",o],...t)}destroyDrag(){this.dragging=!1;const e=this.drag;if(e){const t=e.rootEl;Ba?.get(t)===e&&Ba.delete(t),this.drag=null,QC(e.pointerCapture),Ni(e.handlers)}}onPointerDown(e,t){if(this.isPointer())return;const a=this.beans;if(Oa?.has(t))return;const o=t.pointerType;if(o==="touch"&&(a.gos.get("suppressTouch")||!e.includeTouch||(e.stopPropagationForTouch&&t.stopPropagation(),Ca(il(t))))||!t.isPrimary||o==="mouse"&&t.button!==0)return;this.destroyDrag();const r=Ie(a),i=e.eElement,n=t.pointerId,l=new rl(r,e,t,n);Ba??(Ba=new WeakMap),Ba.set(r,l);const s=u=>{u.pointerId===n&&this.onMouseOrPointerMove(u)},c=u=>{u.pointerId===n&&this.onMouseOrPointerUp(u)},d=u=>{u.pointerId===n&&Xe(u)&&this.cancelDrag()},g=u=>this.draggingPreventDefault(u);this.initDrag(l,[r,"pointerup",c],[r,"pointercancel",d],[r,"pointermove",s,Lt],[r,"touchmove",g,Lt],[i,"mousemove",g,Lt]),e.dragStartPixels===0?this.onMouseOrPointerMove(t):Xe(t)}onTouchStart(e,t){if(this.gos.get("suppressTouch")||!e.includeTouch||!Xe(t)||Ca(il(t)))return;if(e.stopPropagationForTouch&&t.stopPropagation(),this.isPointer()){this.dragging&&kt(t);return}this.destroyDrag();const o=this.beans,r=Ie(o),i=new rl(r,e,t.touches[0]),n=u=>this.onTouchMove(u),l=u=>this.onTouchUp(u),s=u=>this.onTouchCancel(u),c=u=>this.draggingPreventDefault(u),d=Ie(o),g=t.target??e.eElement;this.initDrag(i,[g,"touchmove",n,ol],[g,"touchend",l,ol],[g,"touchcancel",s,ol],[d,"touchmove",c,Lt],[d,"touchend",l,Lt],[d,"touchcancel",s,Lt]),e.dragStartPixels===0&&this.onMove(i.start)}draggingPreventDefault(e){this.dragging&&kt(e)}onMouseDown(e,t){if(t.button!==0||Oa?.has(t)||this.isPointer())return;const a=this.beans;this.destroyDrag();const o=new rl(Ie(a),e,t),r=l=>this.onMouseOrPointerMove(l),i=l=>this.onMouseOrPointerUp(l),n=Ie(a);this.initDrag(o,[n,"mousemove",r],[n,"mouseup",i]),e.dragStartPixels===0?this.onMouseOrPointerMove(t):Xe(t)}onScroll(e){if(!Xe(e))return;const t=this.drag,a=t?.lastDrag;a&&this.dragging&&t.params?.onDragging?.(a)}onMouseOrPointerMove(e){Xe(e)&&(mt()&&oe(this.beans).getSelection()?.removeAllRanges(),this.shouldPreventMouseEvent(e)&&kt(e),this.onMove(e))}onTouchCancel(e){const t=this.drag;!t||!Xe(e)||Sa(t.start,e.changedTouches)&&this.cancelDrag()}onTouchMove(e){const t=this.drag;if(!t||!Xe(e))return;const a=Sa(t.start,e.touches);a&&(this.onMove(a),this.draggingPreventDefault(e))}onMove(e){const t=this.drag;if(!t)return;t.lastDrag=e;const a=t.params;if(!this.dragging){const o=t.start,i=a.dragStartPixels??4;if(kc(e,o,i)||(this.dragging=!0,a.capturePointer&&(t.pointerCapture=_C(this.beans.eRootDiv,e)),this.eventSvc.dispatchEvent({type:"dragStarted",target:a.eElement}),a.onDragStart?.(o),this.drag!==t)||(a.onDragging?.(o),this.drag!==t))return}a.onDragging?.(e)}onTouchUp(e){const t=this.drag;t&&Xe(e)&&this.onUp(Sa(t.start,e.changedTouches))}onMouseOrPointerUp(e){Xe(e)&&this.onUp(e)}onUp(e){const t=this.drag;t&&(e||(e=t.lastDrag),e&&this.dragging&&(this.dragging=!1,t.params.onDragStop?.(e),this.eventSvc.dispatchEvent({type:"dragStopped",target:t.params.eElement})),this.destroyDrag())}onKeyDown(e){e.key===C.ESCAPE&&this.cancelDrag()}},au=e=>{Ni(e.handlers);const t=e.oldTouchAction;if(t!=null){const a=e.params.eElement.style;a&&(a.touchAction=t)}},rl=class{constructor(e,t,a,o=null){this.rootEl=e,this.params=t,this.start=a,this.pointerId=o,this.handlers=[],this.lastDrag=null,this.pointerCapture=null,this.eElement=t.eElement}},il=e=>{const t=e.target;return t instanceof Element?t:null},ZC=class extends tu{shouldPreventMouseEvent(e){return this.gos.get("enableCellTextSelection")&&super.shouldPreventMouseEvent(e)}},JC=class extends y{constructor(){super(...arguments),this.beanName="horizontalResizeSvc"}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),onDragCancel:this.onDragStop.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0},{dragSvc:a}=this.beans;return a.addDragSource(t),()=>a.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const a=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(a)}setResizeIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(1),e.disableUserSelect(!0)}onDragStop(e){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},XC={tag:"div",cls:"ag-drag-handle ag-row-drag",attrs:{"aria-hidden":"true"}},jr={skipAriaHidden:!0},$C=class extends V{constructor(e,t,a,o,r,i=!1){super(),this.cellValueFn=e,this.rowNode=t,this.column=a,this.customGui=o,this.dragStartPixels=r,this.alwaysVisible=i,this.dragSource=null,this.disabled=!1}isCustomGui(){return this.customGui!=null}postConstruct(){const{beans:e,customGui:t}=this;t?this.setDragElement(t,this.dragStartPixels):(this.setTemplate(XC),this.getGui().appendChild(ye("rowDrag",e,null)),this.addDragSource()),this.alwaysVisible||this.initCellDrag()}initCellDrag(){const{beans:e,rowNode:t}=this,a=this.refreshVisibility.bind(this);this.addManagedListeners(e.eventSvc,{rowDragVisibilityChanged:a}),this.addManagedListeners(t,{dataChanged:a,cellChanged:a}),this.refreshVisibility()}setDragElement(e,t){this.setTemplateFromElement(e,void 0,void 0,!0),this.addDragSource(t)}refreshVisibility(){if(this.alwaysVisible)return;const{beans:e,column:t,rowNode:a}=this,{gos:o,dragAndDrop:r,rowDragSvc:i}=e,n=i?.visibility;let s=!(n==="suppress"||n==="hidden"&&!r?.hasExternalDropZones()),c=s;if(s&&!this.isCustomGui()&&t){const d=t.getColDef().rowDrag;if(d===!1)s=!1;else{const g=typeof d=="function";c=t.isRowDrag(a),s=g||c}}s&&c&&a.footer&&o.get("rowDragManaged")&&(c=!1,s=!0),c&&(c=s),s||this.setDisplayed(s,jr),c||this.setVisible(c,jr),this.setDisabled(!c||n==="disabled"&&!r?.hasExternalDropZones()),s&&this.setDisplayed(s,jr),c&&this.setVisible(c,jr)}setDisabled(e){e!==this.disabled&&(this.disabled=e,this.getGui()?.classList?.toggle("ag-drag-handle-disabled",e))}getSelectedNodes(){const e=this.rowNode;if(!this.gos.get("rowDragMultiRow"))return[e];const a=this.beans.selectionSvc?.getSelectedNodes()??[];return a.indexOf(e)!==-1?a:[e]}getDragItem(){const{column:e,rowNode:t}=this;return{rowNode:t,rowNodes:this.getSelectedNodes(),columns:e?[e]:void 0,defaultTextValue:this.cellValueFn()}}addDragSource(e=4){if(this.dragSource&&this.removeDragSource(),this.gos.get("rowDragManaged")&&this.rowNode.footer)return;const t=this.getGui();if(this.gos.get("enableCellTextSelection")){this.removeMouseDownListener();const o=ur("pointerdown")?{pointerdown:kt}:{mousedown:kt};this.mouseDownListener=this.addManagedElementListeners(t,o)[0]}const a=this.getLocaleTextFunc();this.dragSource={type:2,eElement:t,dragItemName:o=>this.getDragItemName(o,a),getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDrop.addDragSource(this.dragSource,!0)}getDragItemName(e,t){const a=e?.dragItem||this.getDragItem(),o=(e?.dropTarget?.rows.length??a.rowNodes?.length)||1,r=this.column?.getColDef()?.rowDragText??this.gos.get("rowDragText");if(r)return r(a,o);if(o!==1)return`${o} ${t("rowDragRows","rows")}`;const i=this.cellValueFn();return i||`1 ${t("rowDragRow","rows")}`}destroy(){this.removeDragSource(),this.removeMouseDownListener(),super.destroy()}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop.removeDragSource(this.dragSource),this.dragSource=null)}removeMouseDownListener(){this.mouseDownListener&&(this.mouseDownListener(),this.mouseDownListener=void 0)}},ou=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.includes("x"),this.scrollVertically=e.scrollAxis.includes("y"),this.scrollByTick=e.scrollByTick??20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}get scrolling(){return this.tickingInterval!==null}check(e,t=!1){const a=!this.scrollVertically||t||this.shouldSkipVerticalScroll(),o=!this.scrollHorizontally||this.shouldSkipHorizontalScroll();if(a&&o)return;const r=this.scrollContainer.getBoundingClientRect(),i=this.scrollByTick;this.tickLeft=!o&&e.clientX<r.left+i,this.tickRight=!o&&e.clientX>r.right-i,this.tickUp=!a&&e.clientY<r.top+i,this.tickDown=!a&&e.clientY>r.bottom-i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Mo=class{constructor(){this.reordered=!1,this.removals=[],this.updates=new Set,this.adds=new Set}},zo=e=>{let t=e.childrenAfterGroup;for(;t?.length;){const a=t[0];if(a.sourceRowIndex>=0)return a;t=a.childrenAfterGroup}},ru=(e,t,a,o)=>{if(!t.size||!e)return!1;let r=!1;const i=e.length??0;let n=-1;a&&(n=a.sourceRowIndex,a=n<0?zo(a):null,a&&(n=a.sourceRowIndex)),n<0||n>=i?n=i:o||++n;let l=n,s=Math.min(n,i-1);for(const g of t){const u=g.sourceRowIndex;u<l&&(l=u),u>s&&(s=u)}let c=l;for(let g=l;g<n;++g){const u=e[g];t.has(u)||(u.sourceRowIndex!==c&&(u.sourceRowIndex=c,e[c]=u,r=!0),++c)}let d=s;for(let g=s;g>=n;--g){const u=e[g];t.has(u)||(u.sourceRowIndex!==d&&(u.sourceRowIndex=d,e[d]=u,r=!0),--d)}for(const g of t)g.sourceRowIndex!==c&&(g.sourceRowIndex=c,e[c]=g,r=!0),++c;return r};function iu(e,t){return Or(e,t.target)?.getFocusedCellPosition()??null}function nl(e,t){const a=se(e.gos,"normal"),o=t;let r,i;o.clientX!=null||o.clientY!=null?(r=o.clientX,i=o.clientY):(r=o.x,i=o.y);const{pageFirstPixel:n}=e.pageBounds.getCurrentPagePixelRange();if(i+=n,a){const l=e.ctrlsSvc.getScrollFeature(),s=l.getVScrollPosition(),c=l.getHScrollPosition();r+=c.left,i+=s.top}return{x:r,y:i}}var e0=.25,t0=class extends y{constructor(e){super(),this.eContainer=e,this.lastDraggingEvent=null,this.autoScroll=null,this.autoScrollChanged=!1,this.autoScrollChanging=!1,this.autoScrollOldV=null}postConstruct(){const e=this.beans;e.ctrlsSvc.whenReady(this,t=>{const a=()=>t.gridBodyCtrl.scrollFeature.getVScrollPosition().top,o=new ou({scrollContainer:t.gridBodyCtrl.eBodyViewport,scrollAxis:"y",getVerticalPosition:a,setVerticalPosition:r=>t.gridBodyCtrl.scrollFeature.setVerticalScrollPosition(r),onScrollCallback:()=>{const r=a();if(this.autoScrollOldV!==r){this.autoScrollOldV=r,this.autoScrollChanging=!0;return}const i=this.autoScrollChanging;this.autoScrollChanged=i,this.autoScrollChanging=!1,i&&(e.dragAndDrop?.nudge(),this.autoScrollChanged=!1)}});this.autoScroll=o,this.clearAutoScroll()})}destroy(){super.destroy(),this.clearAutoScroll(),this.autoScroll=null,this.lastDraggingEvent=null,this.eContainer=null}getContainer(){return this.eContainer}isInterestedIn(e){return e===2}getIconName(e){return e?.dropTarget?.allowed===!1||this.beans.rowDragSvc.visibility!=="visible"?"notAllowed":"move"}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const a=this.beans.selectionSvc?.getSelectedNodes();if(a&&a.indexOf(t)>=0)return a.slice().sort(a0)}return[t]}onDragEnter(e){this.dragging(e,!0)}onDragging(e){this.dragging(e,!1)}dragging(e,t){const{lastDraggingEvent:a,beans:o}=this;if(t){const l=this.getRowNodes(e);e.dragItem.rowNodes=l,lu(l,!0)}this.lastDraggingEvent=e;const r=e.fromNudge,i=this.makeRowsDrop(a,e,r,!1);o.rowDropHighlightSvc?.fromDrag(e),t&&this.dispatchGridEvent("rowDragEnter",e),this.dispatchGridEvent("rowDragMove",e);const n=this.autoScroll;i?.rowDragManaged&&i.moved&&i.allowed&&i.sameGrid&&!i.suppressMoveWhenRowDragging&&(!r&&!n?.scrolling||this.autoScrollChanged)&&this.dropRows(i),n?.check(e.event)}isFromThisGrid(e){return e.dragSource.dragSourceDomDataKey===this.gos.getDomDataKey()}makeRowsDrop(e,t,a,o){const{beans:r,gos:i}=this,n=this.newRowsDrop(t,o),l=r.rowModel;if(t.dropTarget=n,t.changed=!1,!n)return null;let{sameGrid:s,rootNode:c,source:d,target:g}=n;g??(g=l.getRow(l.getRowCount()-1)??null);const u=this.beans.groupEditSvc,h=!!u?.canSetParent(n);let p=null;if(g?.footer){const m=Ir(l,-1,g)??Ir(l,1,g);h&&(p=g.sibling??c),g=m??null}g?.detail&&(g=g.parent),n.moved&&(n.moved=d!==g);let f=.5;if(g&&(s&&n.moved&&(p||!h)?f=d.rowIndex>g.rowIndex?-.5:.5:f=(n.y-g.rowTop-g.rowHeight/2)/g.rowHeight||0),!h&&s&&g&&n.moved&&$(i)){const m=o0(l,n);m&&(f=d.rowIndex>m.rowIndex?-.5:.5,g=m,n.moved&&(n.moved=d!==g))}return n.target=g,n.newParent=p,n.pointerPos=r0(g,n.y),n.yDelta=f,u?.fixRowsDrop(n,h,a,f),this.validateRowsDrop(n,h,o),t.changed||(t.changed=nu(e?.dropTarget,n)),n}newRowsDrop(e,t){const{beans:a,gos:o}=this,r=a.rowModel.rootNode,i=$(o)?o.get("rowDragManaged"):!1,n=o.get("suppressMoveWhenRowDragging"),l=this.isFromThisGrid(e);let{rowNode:s,rowNodes:c}=e.dragItem;if(c||(c=s?[s]:[]),s||(s=c[0]),!s||!r)return null;const d=this.beans.dragAndDrop.isDropZoneWithinThisGrid(e);let g=!0;i&&(!c.length||a.rowDragSvc.visibility!=="visible"||(n||!l)&&!d)&&(g=!1);const u=nl(a,e).y,h=this.getOverNode(u);return{api:a.gridApi,context:a.gridOptions.context,draggingEvent:e,rowDragManaged:i,suppressMoveWhenRowDragging:n,sameGrid:l,withinGrid:d,treeData:!1,rootNode:r,moved:s!==h,y:u,overNode:h,overIndex:h?.rowIndex??-1,pointerPos:"none",position:"none",source:s,target:h??null,newParent:null,rows:c,allowed:g,highlight:!t&&i&&n&&(d||!l),yDelta:0,inside:!1,droppedManaged:!1}}validateRowsDrop(e,t,a){const{source:o,target:r,yDelta:i,inside:n,moved:l,rowDragManaged:s,suppressMoveWhenRowDragging:c}=e;e.moved&&(e.moved=o!==r);const{position:d,fallbackPosition:g}=this.computeDropPosition(l,n,i);e.position=d,t||(e.newParent=null),this.enforceSuppressMoveWhenRowDragging(e,c,"initial");const u=(!s||e.allowed)&&this.gos.get("isRowValidDropPosition");u&&this.applyDropValidator(e,t,a,s,u),s&&(e.rows=this.filterRows(e)),this.beans.groupEditSvc?.clearNewSameParent(e,t),this.enforceSuppressMoveWhenRowDragging(e,c,"final"),e.position==="inside"&&(!e.allowed||!e.newParent)&&(e.position=g)}computeDropPosition(e,t,a){const o=a<0?"above":"below";return e?{position:t?"inside":o,fallbackPosition:o}:{position:"none",fallbackPosition:o}}enforceSuppressMoveWhenRowDragging(e,t,a){if(t){if(a==="initial"){e.moved||(e.allowed=!1);return}(!e.rows.length||e.position==="none")&&(e.allowed=!1)}}applyDropValidator(e,t,a,o,r){this.beans.groupEditSvc?.clearNewSameParent(e,t);const i=r(e);if(!i){e.allowed=!1;return}if(typeof i!="object")return;i.rows!==void 0&&(e.rows=i.rows??[]),t&&i.newParent!==void 0&&(e.newParent=i.newParent),i.target!==void 0&&(e.target=i.target),i.position&&(e.position=i.position),i.allowed!==void 0?e.allowed=i.allowed:o||(e.allowed=!0);const n=e.draggingEvent;i.changed&&n&&(n.changed=!0),!a&&i.highlight!==void 0&&(e.highlight=i.highlight)}addRowDropZone(e){if(!e.getContainer()){x(55);return}const t=this.beans.dragAndDrop;if(t.findExternalZone(e.getContainer())){x(56);return}const a=e.fromGrid?e:{getContainer:e.getContainer,onDragEnter:e.onDragEnter&&(r=>e.onDragEnter(this.rowDragEvent("rowDragEnter",r))),onDragLeave:e.onDragLeave&&(r=>e.onDragLeave(this.rowDragEvent("rowDragLeave",r))),onDragging:e.onDragging&&(r=>e.onDragging(this.rowDragEvent("rowDragMove",r))),onDragStop:e.onDragStop&&(r=>e.onDragStop(this.rowDragEvent("rowDragEnd",r))),onDragCancel:e.onDragCancel&&(r=>e.onDragCancel(this.rowDragEvent("rowDragCancel",r)))},o={isInterestedIn:r=>r===2,getIconName:()=>"move",external:!0,...a};t.addDropTarget(o),this.addDestroyFunc(()=>t.removeDropTarget(o))}getRowDropZone(e){return{getContainer:this.getContainer.bind(this),onDragEnter:a=>{this.onDragEnter(a),e?.onDragEnter?.(this.rowDragEvent("rowDragEnter",a))},onDragLeave:a=>{this.onDragLeave(a),e?.onDragLeave?.(this.rowDragEvent("rowDragLeave",a))},onDragging:a=>{this.onDragging(a),e?.onDragging?.(this.rowDragEvent("rowDragMove",a))},onDragStop:a=>{this.onDragStop(a),e?.onDragStop?.(this.rowDragEvent("rowDragEnd",a))},onDragCancel:a=>{this.onDragCancel(a),e?.onDragCancel?.(this.rowDragEvent("rowDragCancel",a))},fromGrid:!0}}getOverNode(e){const{pageBounds:t,rowModel:a}=this.beans,r=e>t.getCurrentPagePixelRange().pageLastPixel?-1:a.getRowIndexAtPixel(e);return r>=0?a.getRow(r):void 0}rowDragEvent(e,t){const a=this.beans,{dragItem:o,dropTarget:r,event:i,vDirection:n}=t,l=r?.rootNode===a.rowModel.rootNode,s=l?r.y:nl(a,t).y,c=l?r.overNode:this.getOverNode(s),d=l?r.overIndex:c?.rowIndex??-1;return{api:a.gridApi,context:a.gridOptions.context,type:e,event:i,node:o.rowNode,nodes:o.rowNodes,overIndex:d,overNode:c,y:s,vDirection:n,rowsDrop:r}}dispatchGridEvent(e,t){const a=this.rowDragEvent(e,t);this.eventSvc.dispatchEvent(a)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e,!1)}onDragStop(e){const t=this.lastDraggingEvent?.dropTarget??null,a=this.makeRowsDrop(this.lastDraggingEvent,e,!1,!0);this.dispatchGridEvent("rowDragEnd",e),a?.allowed&&a.rowDragManaged&&(!t?.droppedManaged||nu(t,a))&&this.dropRows(a),this.stopDragging(e,!0)}onDragCancel(e){this.dispatchGridEvent("rowDragCancel",e),this.stopDragging(e,!0)}stopDragging(e,t){this.clearAutoScroll(),this.beans.groupEditSvc?.stopDragging(t),this.beans.rowDropHighlightSvc?.fromDrag(null),lu(e.dragItem.rowNodes,!1),this.lastDraggingEvent=null}clearAutoScroll(){this.autoScroll?.ensureCleared(),this.autoScrollChanged=!1,this.autoScrollChanging=!1,this.autoScrollOldV=null}dropRows(e){return e.droppedManaged=!0,e.sameGrid?this.csrmMoveRows(e):this.csrmAddRows(e)}csrmAddRows({position:e,target:t,rows:a}){const o=ta(this.gos),r=this.beans.rowModel,i=a.filter(({data:l,rowPinned:s})=>!r.getRowNode(o?.({data:l,level:0,rowPinned:s})??l.id)).map(({data:l})=>l);if(i.length===0)return!1;let n;if(t){const l=t.sourceRowIndex>=0?t:zo(t);l&&(n=l.sourceRowIndex+(e==="above"?0:1))}return r.updateRowData({add:i,addIndex:n}),!0}filterRows(e){const{groupEditSvc:t}=this.beans,{rows:a,sameGrid:o}=e;let r;for(let i=0,n=a.length;i<n;++i){let l=!0;const s=a[i];(!s||s.footer||o&&s.destroyed&&!s.group||!this.csrmGetLeaf(s))&&(l=!1),l&&t&&!t.canDropRow(s,e)&&(l=!1),l?r?.push(s):r??(r=a.slice(0,i))}return r??a}csrmMoveRows(e){const t=this.beans.groupEditSvc;return t?.isGroupingDrop(e)?t.dropGroupEdit(e):this.csrmMoveRowsReorder(e)}csrmMoveRowsReorder({position:e,target:t,rows:a,newParent:o,rootNode:r}){let i=!1;const n=new Set;for(const u of a){o&&u.parent!==o&&(u.treeParent=o,i=!0);const h=this.csrmGetLeaf(u);h&&n.add(h)}if(!i&&n.size===0)return!1;const l=this.beans.focusSvc,s=l.getFocusedCell(),c=s&&na(this.beans,s);if(n.size&&ru(r._leafs,n,t,e==="above")&&(i=!0),!i)return!1;const d=this.beans.rowModel,g=new Mo;return g.reordered=!0,d.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:g}),c?c.focusCell():l.clearFocusedCell(),!0}csrmGetLeaf(e){if(e.sourceRowIndex>=0)return e.destroyed?void 0:e;const t=this.beans.groupEditSvc;return t?t.csrmFirstLeaf(e):zo(e)}},nu=(e,t)=>e!==t&&(e?.sameGrid!==t.sameGrid||e?.allowed!==t.allowed||e?.position!==t.position||e?.target!==t.target||e?.source!==t.source||e?.newParent!==t.newParent||!rt(e?.rows,t.rows)),a0=({rowIndex:e},{rowIndex:t})=>e!==null&&t!==null?e-t:0,lu=(e,t)=>{for(let a=0,o=e?.length||0;a<o;++a){const r=e[a];r.dragging!==t&&(r.dragging=t,r.dispatchRowEvent("draggingChanged"))}},o0=(e,t)=>{let a=null,o=t.target;if(o&&t.rows.indexOf(o)<0)return null;const r=t.source;if(!o||!r)return null;let i=o.rowIndex-r.rowIndex;const n=i<0?-1:1;i=t.suppressMoveWhenRowDragging?Math.abs(i):1;const l=new Set(t.rows);do{const s=Ir(e,n,o);if(!s)break;l.has(s)||(a=s,--i),o=s}while(i>0);return a},r0=(e,t)=>{const a=e?.rowTop,o=e?.rowHeight??0;if(a==null||!o||o<=0)return"none";const r=t-a,i=o*e0;return r<=i?"above":r>=o-i?"below":"inside"},i0=class extends y{constructor(){super(...arguments),this.beanName="rowDragSvc",this.rowDragFeature=null,this.visibility="suppress"}setupRowDrag(e,t){const a=t.createManagedBean(new t0(e)),o=this.beans.dragAndDrop;o.addDropTarget(a),t.addDestroyFunc(()=>o.removeDropTarget(a)),this.rowDragFeature=a;const r=()=>this.refreshVisibility();this.addManagedPropertyListeners(["rowDragManaged","suppressRowDrag","refreshAfterGroupEdit"],r),this.addManagedEventListeners({newColumnsLoaded:r,columnRowGroupChanged:r,columnPivotModeChanged:r,sortChanged:r,filterChanged:r}),this.visibility=this.computeVisibility()}createRowDragComp(e,t,a,o,r,i){return new $C(e,t,a,o,r,i)}createRowDragCompForRow(e,t){if(Qe(this.gos))return;const a=this.getLocaleTextFunc();return this.createRowDragComp(()=>`1 ${a("rowDragRow","row")}`,e,void 0,t,void 0,!0)}createRowDragCompForCell(e,t,a,o,r,i){const n=this.gos;return n.get("rowDragManaged")&&(!$(n)||n.get("pagination"))?void 0:this.createRowDragComp(a,e,t,o,r,i)}cancelRowDrag(){this.rowDragFeature?.lastDraggingEvent&&this.beans.dragSvc?.cancelDrag()}computeVisibility(){const e=this.beans,t=e.gos;if(t.get("suppressRowDrag"))return"suppress";if(!t.get("rowDragManaged"))return"visible";const o=e.colModel.pivotMode;return(o||e.rowGroupColsSvc?.columns?.length)&&!t.get("refreshAfterGroupEdit")?"hidden":o||e.filterManager?.isAnyFilterPresent()||e.sortSvc?.isSortActive()?"disabled":"visible"}refreshVisibility(){const e=this.visibility,t=this.computeVisibility();e!==t&&(this.visibility=t,this.eventSvc?.dispatchEvent({type:"rowDragVisibilityChanged"}))}},n0=class extends y{constructor(){super(...arguments),this.beanName="rowDropHighlightSvc",this.uiLevel=0,this.dragging=!1,this.row=null,this.position="none"}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this)})}onModelUpdated(){const e=this.row,t=this.dragging;!e||e?.rowIndex===null||this.position==="none"?this.clear():this.set(e,this.position),this.dragging=t}destroy(){this.clear(),super.destroy()}clear(){const e=this.row;this.dragging=!1,e&&(this.uiLevel=0,this.position="none",this.row=null,e.dispatchRowEvent("rowHighlightChanged"))}set(e,t){const a=e!==this.row,o=e.uiLevel,r=t!==this.position,i=o!==this.uiLevel;this.dragging=!1,(a||r||i)&&(a&&this.clear(),this.uiLevel=o,this.position=t,this.row=e,e.dispatchRowEvent("rowHighlightChanged"))}fromDrag(e){const t=e?.dropTarget;if(t){const{highlight:a,target:o,position:r}=t;if(a&&o&&r!=="none"){this.set(o,r),this.dragging=!0;return}}this.dragging&&this.clear()}},ll={moduleName:"Drag",version:F,beans:[ZC]},su={moduleName:"DragAndDrop",version:F,dynamicBeans:{dndSourceComp:NC},icons:{rowDrag:"grip"}},sl={moduleName:"SharedDragAndDrop",version:F,beans:[Kb],dependsOn:[ll],userComponents:{agDragAndDropImage:VC},icons:{columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",rowDrag:"grip"}},cu={moduleName:"RowDrag",version:F,beans:[n0,i0],apiFunctions:{addRowDropZone:qC,removeRowDropZone:WC,getRowDropZoneParams:UC,getRowDropPositionIndicator:jC,setRowDropPositionIndicator:KC},dependsOn:[sl]},du={moduleName:"HorizontalResize",version:F,beans:[JC],dependsOn:[ll]},l0=":where(.ag-ltr) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:left .2s}.ag-header-group-cell{transition:left .2s,width .2s}}:where(.ag-rtl) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:right .2s}.ag-header-group-cell{transition:right .2s,width .2s}}",s0=class extends y{constructor(){super(...arguments),this.beanName="colAnimation",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.activeNext=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){if(this.active)return;const{gos:e}=this;e.get("suppressColumnMoveAnimation")||e.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0,this.activeNext=!0)}finish(){this.active&&this.flush(()=>this.activeNext=!1,()=>this.active=!1)}executeNextVMTurn(e){this.activeNext?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount,{gridBodyCtrl:t}=this;t.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&t.setColumnMovingCss(!1)})}flush(e,t){const{executeNextFuncs:a,executeLaterFuncs:o}=this;if(a.length===0&&o.length===0){e(),t();return}const r=i=>{for(;i.length;){const n=i.pop();n&&n()}};this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e(),r(a)},0),window.setTimeout(()=>{t(),r(o)},200)})}};function c0(e,t,a){e.colMoves?.moveColumnByIndex(t,a,"api")}function d0(e,t,a){e.colMoves?.moveColumns(t,a,"api")}var g0=class extends y{constructor(e){super(),this.pinned=e,this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[]}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;if(t)for(const a of t)a.primary&&(a.isAnyFunctionActive()||(a.isAllowValue()?this.columnsToAggregate.push(a):a.isAllowRowGroup()?this.columnsToGroup.push(a):a.isAllowPivot()&&this.columnsToPivot.push(a)))}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){const{valueColsSvc:t,rowGroupColsSvc:a,pivotColsSvc:o}=this.beans;this.columnsToAggregate.length>0&&t?.addColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&a?.addColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&o?.addColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function u0(e,t){!t||t.length<=1||t.filter(o=>e.indexOf(o)<0).length>0||t.sort((o,r)=>{const i=e.indexOf(o),n=e.indexOf(r);return i-n})}function h0(e){const t=[...e];for(const a of e){let o=null,r=a.parent;for(;r?.getDisplayedLeafColumns().length===1;)o=r,r=r.parent;if(o!=null){const n=!!o.getColGroupDef()?.marryChildren?o.getProvidedColumnGroup().getLeafColumns():o.getLeafColumns();for(const l of n)t.includes(l)||t.push(l)}}return t}function p0(e,t,a,o){const r=o.allCols;let i=null,n=null;for(let l=0;l<e.length;l++){const s=e[l],c=a.getProposedColumnOrder(t,s);if(!a.doesOrderPassRules(c))continue;const d=c.filter(u=>r.includes(u));if(n===null)n=d;else if(!rt(d,n))break;const g=m0(c);(i===null||g<i.fragCount)&&(i={move:s,fragCount:g})}return i}function gu(e){const{isFromHeader:t,fromLeft:a,xPosition:o,fromEnter:r,fakeEvent:i,pinned:n,gos:l,colModel:s,colMoves:c,visibleCols:d}=e;let{allMovingColumns:g}=e;t&&(g=h0(g));const u=g.slice();u0(s.getCols(),u);const h=b0({movingCols:u,draggingRight:a,xPosition:o,pinned:n,gos:l,colModel:s,visibleCols:d}),p=f0(u,s);if(h.length===0)return;const f=h[0];if(p!==null&&(t||!r)&&!i&&(!a&&f>=p||a&&f<=p))return;const v=p0(h,u,c,d);if(!v)return;const w=v.move;if(!(w>s.getCols().length-u.length))return{columns:u,toIndex:w}}function uu(e){const{columns:t,toIndex:a}=gu(e)||{},{finished:o,colMoves:r}=e;return!t||a==null?null:(r.moveColumns(t,a,"uiColumnMoved",o),o?null:{columns:t,toIndex:a})}function f0(e,t){const a=t.getCols(),o=e.map(s=>a.indexOf(s)).sort((s,c)=>s-c),r=o[0];return j(o)-r!==o.length-1?null:r}function m0(e){function t(o){const r=[];let i=o.getOriginalParent();for(;i!=null;)r.push(i),i=i.getOriginalParent();return r}let a=0;for(let o=0;o<e.length-1;o++){let r=t(e[o]),i=t(e[o+1]);[r,i]=r.length>i.length?[r,i]:[i,r];for(const n of r)i.indexOf(n)===-1&&a++}return a}function v0(e,t){switch(t){case"left":return e.leftCols;case"right":return e.rightCols;default:return e.centerCols}}function b0(e){const{movingCols:t,draggingRight:a,xPosition:o,pinned:r,gos:i,colModel:n,visibleCols:l}=e;if(i.get("suppressMovableColumns")||t.some(b=>b.colDef.suppressMovable))return[];const c=v0(l,r),d=n.getCols(),g=c.filter(b=>t.includes(b)),u=c.filter(b=>!t.includes(b)),h=d.filter(b=>!t.includes(b));let p=0,f=o;if(a){let b=0;for(const k of g)b+=k.getActualWidth();f-=b}if(f>0){for(let b=0;b<u.length;b++){const k=u[b];if(f-=k.getActualWidth(),f<0)break;p++}a&&p++}let m;if(p>0){const b=u[p-1];m=h.indexOf(b)+1}else m=h.indexOf(u[0]),m===-1&&(m=0);const v=[m],w=(b,k)=>b-k;if(a){let b=m+1;const k=d.length-1;for(;b<=k;)v.push(b),b++;v.sort(w)}else{let b=m;const k=d.length-1;let S=d[b];for(;b<=k&&c.indexOf(S)<0;)b++,v.push(b),S=d[b];b=m-1;const R=0;for(;b>=R;)v.push(b),b--;v.sort(w).reverse()}return v}function cl(e){const{pinned:t,fromKeyboard:a,gos:o,ctrlsSvc:r,useHeaderRow:i,skipScrollPadding:n}=e;let l=r.getHeaderRowContainerCtrl(t)?.eViewport,{x:s}=e;return l?(a&&(s-=l.getBoundingClientRect().left),o.get("enableRtl")&&(i&&(l=l.querySelector(".ag-header-row")),s=l.clientWidth-s),t==null&&!n&&(s+=r.get("center").getCenterViewportScrollLeft()),s):0}function dl(e,t){for(const a of e)a.moving=t,a.dispatchColEvent("movingChanged","uiColumnMoved")}var hu=7,gl=100,Kr=gl/2,w0=5,C0=100,y0=class extends y{constructor(e){super(),this.pinned=e,this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.isCenterContainer=!z(e)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){const{pinned:e,lastDraggingEvent:t}=this,{dragItem:a}=t||{},o=a?.columns??[];for(const r of o){const i=r.getPinned();if(r.getColDef().lockPinned){if(i==e)return"move";continue}const n=a?.containerType;if(n===e||!e)return"move";if(e&&(!i||n!==e))return"pinned"}return"notAllowed"}onDragEnter(e){const t=e.dragItem,a=t.columns;if(e.dragSource.type===0)this.setColumnsVisible(a,!0,"uiColumnDragged");else{const r=t.visibleState,i=(a||[]).filter(n=>r[n.getId()]&&!n.isVisible());this.setColumnsVisible(i,!0,"uiColumnDragged")}this.gos.get("suppressMoveWhenColumnDragging")||this.attemptToPinColumns(a,this.pinned),this.onDragging(e,!0,!0)}onDragging(e=this.lastDraggingEvent,t=!1,a=!1,o=!1){const{gos:r,ctrlsSvc:i}=this.beans,n=r.get("suppressMoveWhenColumnDragging");if(o&&!n){this.finishColumnMoving();return}if(this.lastDraggingEvent=e,!e||!o&&_(e.hDirection))return;const l=cl({x:e.x,pinned:this.pinned,gos:r,ctrlsSvc:i});t||this.checkCenterForScrolling(l),n?this.handleColumnDragWhileSuppressingMovement(e,t,a,l,o):this.handleColumnDragWhileAllowingMovement(e,t,a,l,o)}onDragLeave(){this.ensureIntervalCleared(),this.clearHighlighted(),this.updateDragItemContainerType(),this.lastMovedInfo=null}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}onDragCancel(){this.clearHighlighted(),this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,a){if(!e?.length)return;const o=e.filter(r=>!r.getColDef().lockVisible);o.length&&this.beans.colModel.setColsVisible(o,t,a)}finishColumnMoving(){this.clearHighlighted();const e=this.lastMovedInfo;if(!e)return;const{columns:t,toIndex:a}=e;this.beans.colMoves.moveColumns(t,a,"uiColumnMoved",!0)}updateDragItemContainerType(){const{lastDraggingEvent:e}=this;if(this.gos.get("suppressMoveWhenColumnDragging")||!e)return;const t=e.dragItem;t&&(t.containerType=this.pinned)}handleColumnDragWhileSuppressingMovement(e,t,a,o,r){const i=this.getAllMovingColumns(e,!0);if(r){const n=this.isAttemptingToPin(i);n&&this.attemptToPinColumns(i,void 0,!0);const{fromLeft:l,xPosition:s}=this.getNormalisedXPositionInfo(i,n)||{};if(l==null||s==null){this.finishColumnMoving();return}this.moveColumnsAfterHighlight({allMovingColumns:i,xPosition:s,fromEnter:t,fakeEvent:a,fromLeft:l})}else{if(!this.beans.dragAndDrop.isDropZoneWithinThisGrid(e))return;this.highlightHoveredColumn(i,o)}}handleColumnDragWhileAllowingMovement(e,t,a,o,r){const i=this.getAllMovingColumns(e),n=this.normaliseDirection(e.hDirection)==="right",l=e.dragSource.type===1,s=this.getMoveColumnParams({allMovingColumns:i,isFromHeader:l,xPosition:o,fromLeft:n,fromEnter:t,fakeEvent:a}),c=uu({...s,finished:r});c&&(this.lastMovedInfo=c)}getAllMovingColumns(e,t=!1){const a=e.dragSource.getDragItem();let o;t?(o=a.columnsInSplit,o||(o=a.columns)):o=a.columns;const r=i=>i.colDef.lockPinned?i.getPinned()==this.pinned:!0;return o?o.filter(r):[]}getMoveColumnParams(e){const{allMovingColumns:t,isFromHeader:a,xPosition:o,fromLeft:r,fromEnter:i,fakeEvent:n}=e,{gos:l,colModel:s,colMoves:c,visibleCols:d}=this.beans;return{allMovingColumns:t,isFromHeader:a,fromLeft:r,xPosition:o,pinned:this.pinned,fromEnter:i,fakeEvent:n,gos:l,colModel:s,colMoves:c,visibleCols:d}}highlightHoveredColumn(e,t){const{gos:a,colModel:o}=this.beans,r=a.get("enableRtl"),i=o.getCols().filter(d=>d.isVisible()&&d.getPinned()===this.pinned);let n=null,l=null,s=null;for(const d of i){if(l=d.getActualWidth(),n=this.getNormalisedColumnLeft(d,0,r),n!=null){const g=n+l;if(n<=t&&g>=t){s=d;break}}n=null,l=null}if(s)e.indexOf(s)!==-1&&(s=null);else{for(let d=i.length-1;d>=0;d--){const g=i[d],u=i[d].parent;if(!u){s=g;break}const h=u?.getDisplayedLeafColumns();if(h.length){s=j(h);break}}if(!s)return;n=this.getNormalisedColumnLeft(s,0,r),l=s.getActualWidth()}if(s==null||n==null||l==null){this.lastHighlightedColumn?.column!==s&&this.clearHighlighted();return}let c;if(t-n<l/2){const d=i.indexOf(s);d===0?c=0:(c=1,s=i[d-1])}else c=1;(this.lastHighlightedColumn?.column!==s||this.lastHighlightedColumn?.position!==c)&&this.clearHighlighted(),pu(s,c),this.lastHighlightedColumn={column:s,position:c}}getNormalisedXPositionInfo(e,t){const{gos:a,visibleCols:o}=this.beans,r=a.get("enableRtl"),{firstMovingCol:i,column:n,position:l}=this.getColumnMoveAndTargetInfo(e,t,r);if(!i||!n||l==null)return;const s=o.allCols,c=s.indexOf(i),d=s.indexOf(n),g=l===0,u=c<d||c===d&&!g;let h=0;if(g?u&&(h-=1):u||(h+=1),d+h===c)return;const p=s[d+h];if(!p)return;const f=this.getNormalisedColumnLeft(p,20,r);return{fromLeft:u,xPosition:f}}getColumnMoveAndTargetInfo(e,t,a){const o=this.lastHighlightedColumn||{},{firstMovingCol:r,lastMovingCol:i}=k0(e);if(!r||!i||o.column||!t)return{firstMovingCol:r,...o};const l=this.getPinDirection()==="left";return{firstMovingCol:r,position:l?1:0,column:l!==a?r:i}}normaliseDirection(e){if(this.gos.get("enableRtl"))switch(e){case"left":return"right";case"right":return"left"}return e}getNormalisedColumnLeft(e,t,a){const{gos:o,ctrlsSvc:r}=this.beans,i=e.getLeft();if(i==null)return null;const n=e.getActualWidth();return cl({x:a?i+n-t:i+t,pinned:e.getPinned(),useHeaderRow:a,skipScrollPadding:!0,gos:o,ctrlsSvc:r})}isAttemptingToPin(e){const t=this.needToMoveLeft||this.needToMoveRight,a=this.failedMoveAttempts>hu;return t&&a||e.some(o=>o.getPinned()!==this.pinned)}moveColumnsAfterHighlight(e){const{allMovingColumns:t,xPosition:a,fromEnter:o,fakeEvent:r,fromLeft:i}=e,n=this.getMoveColumnParams({allMovingColumns:t,isFromHeader:!0,xPosition:a,fromLeft:i,fromEnter:o,fakeEvent:r}),{columns:l,toIndex:s}=gu(n)||{};l&&s!=null&&(this.lastMovedInfo={columns:l,toIndex:s}),this.finishColumnMoving()}clearHighlighted(){const{lastHighlightedColumn:e}=this;e&&(pu(e.column,null),this.lastHighlightedColumn=null)}checkCenterForScrolling(e){if(!this.isCenterContainer)return;const t=this.beans.ctrlsSvc.get("center"),a=t.getCenterViewportScrollLeft(),o=a+t.getCenterWidth();let r,i;this.gos.get("enableRtl")?(r=e<a+Kr,i=e>o-Kr):(i=e<a+Kr,r=e>o-Kr),this.needToMoveRight=r,this.needToMoveLeft=i,i||r?this.ensureIntervalStarted():this.ensureIntervalCleared()}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),C0),this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName()))}moveInterval(){let e;this.intervalCount++,e=10+this.intervalCount*w0,e>gl&&(e=gl);let t=null;const a=this.gridBodyCon.scrollFeature;if(this.needToMoveLeft?t=a.scrollHorizontally(-e):this.needToMoveRight&&(t=a.scrollHorizontally(e)),t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const{pinnedCols:o,dragAndDrop:r,gos:i}=this.beans;if(this.failedMoveAttempts<=hu+1||!o)return;if(r.setDragImageCompIcon("pinned"),!i.get("suppressMoveWhenColumnDragging")){const n=this.lastDraggingEvent?.dragItem.columns;this.attemptToPinColumns(n,void 0,!0)}}}getPinDirection(){if(this.needToMoveLeft||this.pinned==="left")return"left";if(this.needToMoveRight||this.pinned==="right")return"right"}attemptToPinColumns(e,t,a=!1){const o=(e||[]).filter(n=>!n.colDef.lockPinned);if(!o.length)return 0;a&&(t=this.getPinDirection());const{pinnedCols:r,dragAndDrop:i}=this.beans;return r?.setColsPinned(o,t,"uiColumnDragged"),a&&i.nudge(),o.length}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}};function pu(e,t){e.highlighted!==t&&(e.highlighted=t,e.dispatchColEvent("headerHighlightChanged","uiColumnMoved"))}function k0(e){const t=e.length;let a,o;for(let r=0;r<t;r++){if(!a){const i=e[r];i.getLeft()!=null&&(a=i)}if(!o){const i=e[t-1-r];i.getLeft()!=null&&(o=i)}if(a&&o)break}return{firstMovingCol:a,lastMovingCol:o}}var S0=class extends y{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){const{ctrlsSvc:e,dragAndDrop:t}=this.beans,a=this.pinned;e.whenReady(this,o=>{let r;const i=o.gridBodyCtrl.eBodyViewport;switch(a){case"left":r=[[i,o.left.eContainer],[o.bottomLeft.eContainer],[o.topLeft.eContainer]];break;case"right":r=[[i,o.right.eContainer],[o.bottomRight.eContainer],[o.topRight.eContainer]];break;default:r=[[i,o.center.eViewport],[o.bottomCenter.eViewport],[o.topCenter.eViewport]];break}this.eSecondaryContainers=r}),this.moveColumnFeature=this.createManagedBean(new y0(a)),this.bodyDropPivotTarget=this.createManagedBean(new g0(a)),t.addDropTarget(this),this.addDestroyFunc(()=>t.removeDropTarget(this))}isInterestedIn(e){return e===1||e===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.beans.colModel.pivotMode&&e.dragSource.type===0}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}onDragCancel(){this.currentDropListener.onDragCancel()}};function fu(e,t){const a=[],o=[],r=[];return e.forEach(n=>{const l=n.colDef.lockPosition;l==="right"?r.push(n):l==="left"||l===!0?a.push(n):o.push(n)}),t.get("enableRtl")?[...r,...o,...a]:[...a,...o,...r]}function mu(e,t){let a=!0;return Ze(null,t,o=>{if(!de(o))return;const r=o;if(!r.getColGroupDef()?.marryChildren)return;const l=[];for(const u of r.getLeafColumns()){const h=e.indexOf(u);l.push(h)}const s=Math.max.apply(Math,l),c=Math.min.apply(Math,l),d=s-c,g=r.getLeafColumns().length-1;d>g&&(a=!1)}),a}var x0=class extends y{constructor(){super(...arguments),this.beanName="colMoves"}moveColumnByIndex(e,t,a){const o=this.beans.colModel.getCols();if(!o)return;const r=o[e];this.moveColumns([r],t,a)}moveColumns(e,t,a,o=!0){const{colModel:r,colAnimation:i,visibleCols:n,eventSvc:l}=this.beans,s=r.getCols();if(!s)return;if(t>s.length-e.length){x(30,{toIndex:t});return}i?.start();const c=r.getColsForKeys(e);this.doesMovePassRules(c,t)&&(Qs(r.getCols(),c,t),n.refresh(a),l.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,toIndex:t,finished:o,source:a})),i?.finish()}doesMovePassRules(e,t){const a=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(a)}doesOrderPassRules(e){const{colModel:t,gos:a}=this.beans;return!(!mu(e,t.getColTree())||!(r=>{const i=c=>c?c==="left"||c===!0?-1:1:0,n=a.get("enableRtl");let l=n?1:-1,s=!0;for(const c of r){const d=i(c.colDef.lockPosition);n?d>l&&(s=!1):d<l&&(s=!1),l=d}return s})(e))}getProposedColumnOrder(e,t){const o=this.beans.colModel.getCols().slice();return Qs(o,e,t),o}createBodyDropTarget(e,t){return new S0(e,t)}moveHeader(e,t,a,o,r){const{ctrlsSvc:i,gos:n,colModel:l,visibleCols:s,focusSvc:c}=this.beans,d=t.getBoundingClientRect(),g=d.left,u=ee(a),h=u?d.width:a.getActualWidth(),p=e==="left"!==n.get("enableRtl"),f=cl({x:p?g-20:g+h+20,pinned:o,fromKeyboard:!0,gos:n,ctrlsSvc:i}),m=c.focusedHeader;uu({allMovingColumns:u?a.getLeafColumns():[a],isFromHeader:!0,fromLeft:e==="right",xPosition:f,pinned:o,fromEnter:!1,fakeEvent:!1,gos:n,colModel:l,colMoves:this,visibleCols:s,finished:!0});let v;if(u){const w=a.getDisplayedLeafColumns();v=p?w[0]:j(w)}else v=a;if(i.getScrollFeature().ensureColumnVisible(v,"auto"),(!r.isAlive()||n.get("ensureDomOrder"))&&m){let w;if(u){const b=a.getGroupId(),k=a.getLeafColumns();if(!k.length)return;const S=k[0].parent;if(!S)return;w=R0(S,b)}else w=a;w&&c.focusHeaderPosition({headerPosition:{...m,column:w}})}}setDragSourceForHeader(e,t,a){const{gos:o,colModel:r,dragAndDrop:i,visibleCols:n}=this.beans;let l=!o.get("suppressDragLeaveHidesColumns");const s=ee(t),c=s?t.getProvidedColumnGroup().getLeafColumns():[t],g={type:1,eElement:e,getDefaultIconName:()=>l?"hide":"notAllowed",getDragItem:s?()=>F0(t,n.allCols):()=>E0(t),dragItemName:a,onDragStarted:()=>{l=!o.get("suppressDragLeaveHidesColumns"),dl(c,!0)},onDragStopped:()=>dl(c,!1),onDragCancelled:()=>dl(c,!1),onGridEnter:u=>{if(l){const{columns:h=[],visibleState:p}=u??{},f=s?v=>!p||p[v.getColId()]:()=>!0,m=h.filter(v=>!v.getColDef().lockVisible&&f(v));r.setColsVisible(m,!0,"uiColumnMoved")}},onGridExit:u=>{if(l){const h=u?.columns?.filter(p=>!p.getColDef().lockVisible)||[];r.setColsVisible(h,!1,"uiColumnMoved")}}};return i.addDragSource(g,!0),g}};function R0(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.parent}}function E0(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t,containerType:e.pinned}}function F0(e,t){const a=e.getProvidedColumnGroup().getLeafColumns(),o={};for(const l of a)o[l.getId()]=l.isVisible();const r=[];for(const l of t)a.indexOf(l)>=0&&(r.push(l),Pe(a,l));for(const l of a)r.push(l);const i=[],n=e.getLeafColumns();for(const l of r)n.indexOf(l)!==-1&&i.push(l);return{columns:r,columnsInSplit:i,visibleState:o,containerType:i[0]?.pinned}}var vu={moduleName:"ColumnMove",version:F,beans:[x0,s0],apiFunctions:{moveColumnByIndex:c0,moveColumns:d0},dependsOn:[sl],css:[l0]},M0=class extends y{constructor(){super(...arguments),this.beanName="autoWidthCalc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const a=this.getHeaderCellForColumn(e);if(!a)return-1;const o=this.beans.rowRenderer.getAllCellsNotSpanningForColumn(e);return t||o.push(a),this.getPreferredWidthForElements(o)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.getPreferredWidthForElements([t]):-1}getPreferredWidthForElements(e,t){const a=document.createElement("form");a.style.position="fixed";const o=this.centerRowContainerCtrl.eContainer;for(const i of e)this.cloneItemIntoDummy(i,a);o.appendChild(a);const r=Math.ceil(a.getBoundingClientRect().width);return a.remove(),t=t??this.gos.get("autoSizePadding"),r+t}getHeaderCellForColumn(e){let t=null;for(const a of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()){const o=a.getHtmlElementForColumnHeader(e);o!=null&&(t=o)}return t}cloneItemIntoDummy(e,t){const a=e.cloneNode(!0);a.style.width="",a.style.position="static",a.style.left="";const o=document.createElement("div"),r=o.classList;["ag-header-cell","ag-header-group-cell"].some(l=>a.classList.contains(l))?(r.add("ag-header","ag-header-row"),o.style.position="static"):r.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(s=>n.classList.contains(s))){for(let s=0;s<n.classList.length;s++){const c=n.classList[s];c!="ag-row-position-absolute"&&r.add(c)}break}n=n.parentElement}o.appendChild(a),t.appendChild(o)}},bu={moduleName:"AutoWidth",version:F,beans:[M0]};function z0(e,t,a=!0,o="api"){e.colResize?.setColumnWidths(t,!1,a,o)}function wu(e,t){if(!e||e.length==0)return;const a=t(e[0]);for(let o=1;o<e.length;o++)if(a!==t(e[o]))return;return a}function Cu(e,t,a){if(!t.length)return;const o=t.length===1?t[0]:null,r=wu(t,i=>i.getPinned());e.dispatchEvent({type:"columnPinned",pinned:r??null,columns:t,column:o,source:a})}function D0(e,t,a){if(!t.length)return;const o=t.length===1?t[0]:null,r=wu(t,i=>i.isVisible());e.dispatchEvent({type:"columnVisible",visible:r,columns:t,column:o,source:a})}function yu(e,t,a,o){e.dispatchEvent({type:t,columns:a,column:a?.length==1?a[0]:null,source:o})}function Na(e,t,a,o,r=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:r,finished:a,source:o})}var A0=class extends y{constructor(e,t,a,o){super(),this.comp=e,this.eResize=t,this.pinned=a,this.columnGroup=o}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const{horizontalResizeSvc:e,gos:t,colAutosize:a}=this.beans,o=e.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});this.addDestroyFunc(o),!t.get("suppressAutoSize")&&a&&this.addDestroyFunc(a.addColumnGroupResize(this.eResize,this.columnGroup,()=>this.resizeLeafColumnsToFit("uiColumnResized")))}onResizeStart(e){const{columnsToResize:t,resizeStartWidth:a,resizeRatios:o,groupAfterColumns:r,groupAfterStartWidth:i,groupAfterRatios:n}=this.getInitialValues(e);this.resizeCols=t,this.resizeStartWidth=a,this.resizeRatios=o,this.resizeTakeFromCols=r,this.resizeTakeFromStartWidth=i,this.resizeTakeFromRatios=n,this.toggleColumnResizing(!0)}onResizing(e,t,a="uiColumnResized"){const o=this.normaliseDragChange(t),r=this.resizeStartWidth+o;this.resizeColumnsFromLocalValues(r,a,e)}getInitialValues(e){const t=s=>s.reduce((c,d)=>c+d.getActualWidth(),0),a=(s,c)=>s.map(d=>d.getActualWidth()/c),o=this.getColumnsToResize(),r=t(o),i=a(o,r),n={columnsToResize:o,resizeStartWidth:r,resizeRatios:i};let l=null;if(e&&(l=this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup,"After")??null),l){const s=l.getDisplayedLeafColumns(),c=n.groupAfterColumns=s.filter(g=>g.isResizable()),d=n.groupAfterStartWidth=t(c);n.groupAfterRatios=a(c,d)}else n.groupAfterColumns=void 0,n.groupAfterStartWidth=void 0,n.groupAfterRatios=void 0;return n}resizeLeafColumnsToFit(e){const t=this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup),a=this.getInitialValues();t>a.resizeStartWidth&&this.resizeColumns(a,t,e,!0)}resizeColumnsFromLocalValues(e,t,a=!0){if(!this.resizeCols||!this.resizeRatios)return;const o={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols,groupAfterStartWidth:this.resizeTakeFromStartWidth,groupAfterRatios:this.resizeTakeFromRatios};this.resizeColumns(o,e,t,a)}resizeColumns(e,t,a,o=!0){const{columnsToResize:r,resizeStartWidth:i,resizeRatios:n,groupAfterColumns:l,groupAfterStartWidth:s,groupAfterRatios:c}=e,d=[];if(d.push({columns:r,ratios:n,width:t}),l){const g=t-i;d.push({columns:l,ratios:c,width:s-g})}this.beans.colResize?.resizeColumnSets({resizeSets:d,finished:o,source:a}),o&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.toggleCss("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(t=>t.isResizable())}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?this.pinned!=="left"&&(t*=-1):this.pinned==="right"&&(t*=-1),t}destroy(){super.destroy(),this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}},P0=class extends y{constructor(e,t,a,o,r){super(),this.pinned=e,this.column=t,this.eResize=a,this.comp=o,this.ctrl=r}postConstruct(){const e=[];let t,a;const o=()=>{if(U(this.eResize,t),!t)return;const{horizontalResizeSvc:n,colAutosize:l}=this.beans,s=n.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});e.push(s),a&&l&&e.push(l.addColumnAutosizeListeners(this.eResize,this.column))},r=()=>{for(const n of e)n();e.length=0},i=()=>{const n=this.column.isResizable(),l=!this.gos.get("suppressAutoSize")&&!this.column.colDef.suppressAutoSize;(n!==t||l!==a)&&(t=n,a=l,r(),o())};i(),this.addDestroyFunc(r),this.ctrl.setRefreshFunction("resize",i)}onResizing(e,t){const{column:a,lastResizeAmount:o,resizeStartWidth:r,beans:i}=this,n=this.normaliseResizeAmount(t),l=r+n,s=[{key:a,newWidth:l}],{pinnedCols:c,ctrlsSvc:d,colResize:g}=i;if(this.column.getPinned()){const u=c?.leftWidth??0,h=c?.rightWidth??0,p=ka(d.getGridBodyCtrl().eBodyViewport)-50;if(u+h+(n-o)>p)return}this.lastResizeAmount=n,g?.setColumnWidths(s,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.column.resizing=e,this.comp.toggleCss("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const a=this.pinned!=="left",o=this.pinned==="right";return this.gos.get("enableRtl")?a&&(t*=-1):o&&(t*=-1),t}},I0=class extends y{constructor(){super(...arguments),this.beanName="colResize"}setColumnWidths(e,t,a,o){const r=[],{colModel:i,gos:n,visibleCols:l}=this.beans;for(const s of e){const c=i.getColDefColOrCol(s.key);if(!c)continue;if(r.push({width:s.newWidth,ratios:[1],columns:[c]}),n.get("colResizeDefault")==="shift"&&(t=!t),t){const g=l.getColAfter(c);if(!g)continue;const u=c.getActualWidth()-s.newWidth,h=g.getActualWidth()+u;r.push({width:h,ratios:[1],columns:[g]})}}r.length!==0&&this.resizeColumnSets({resizeSets:r,finished:a,source:o})}resizeColumnSets(e){const{resizeSets:t,finished:a,source:o}=e;if(!(!t||t.every(d=>T0(d)))){if(a){const d=t&&t.length>0?t[0].columns:null;Na(this.eventSvc,d,a,o)}return}const i=[],n=[];for(const d of t){const{width:g,columns:u,ratios:h}=d,p={},f={};for(const w of u)n.push(w);let m=!0,v=0;for(;m;){if(v++,v>1e3){q(31);break}m=!1;const w=[];let b=0,k=g;u.forEach((R,M)=>{if(f[R.getId()])k-=p[R.getId()];else{w.push(R);const O=h[M];b+=O}});const S=1/b;w.forEach((R,M)=>{const L=M===w.length-1;let O;L?O=k:(O=Math.round(h[M]*g*S),k-=O);const N=R.getMinWidth(),B=R.getMaxWidth();O<N?(O=N,f[R.getId()]=!0,m=!0):B>0&&O>B&&(O=B,f[R.getId()]=!0,m=!0),p[R.getId()]=O})}for(const w of u){const b=p[w.getId()];w.getActualWidth()!==b&&(w.setActualWidth(b,o),i.push(w))}}const l=i.length>0;let s=[];if(l){const{colFlex:d,visibleCols:g,colViewport:u}=this.beans;s=d?.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0})??[],g.setLeftValues(o),g.updateBodyWidths(),u.checkViewportColumns()}const c=n.concat(s);(l||a)&&Na(this.eventSvc,c,a,o,s)}resizeHeader(e,t,a){if(!e.isResizable())return;const o=e.getActualWidth(),r=e.getMinWidth(),i=e.getMaxWidth(),n=Math.min(Math.max(o+t,r),i);this.setColumnWidths([{key:e,newWidth:n}],a,!0,"uiColumnResized")}createResizeFeature(e,t,a,o,r){return new P0(e,t,a,o,r)}createGroupResizeFeature(e,t,a,o){return new A0(e,t,a,o)}};function T0(e){const{columns:t,width:a}=e;let o=0,r=0,i=!0;for(const s of t){const c=s.getMinWidth();o+=c||0;const d=s.getMaxWidth();d>0?r+=d:i=!1}const n=a>=o,l=!i||a<=r;return n&&l}var L0={moduleName:"ColumnResize",version:F,beans:[I0],apiFunctions:{setColumnWidths:z0},dependsOn:[du,bu]},B0=class extends y{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);for(const t of this.columnGroup.getLeafColumns())t.__addEventListener("widthChanged",e),t.__addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.__removeEventListener("widthChanged",e),t.__removeEventListener("visibleChanged",e)})}removeListenersOnChildrenColumns(){for(const e of this.removeChildListenersFuncs)e();this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.toggleCss("ag-hidden",e===0)}},O0=class extends Vn{constructor(){super(...arguments),this.onSuppressColMoveChange=()=>{!this.isAlive()||this.isSuppressMoving()?this.removeDragSource():this.dragSource||this.setDragSource(this.eGui)}}wireComp(e,t,a,o,r){const{column:i,beans:n}=this,{context:l,colNames:s,colHover:c,rangeSvc:d,colResize:g}=n;this.comp=e,r=Ro(this,l,r),this.setGui(t,r),this.displayName=s.getDisplayNameForColumnGroup(i,"header"),this.refreshHeaderStyles(),this.addClasses(),this.setupMovingCss(r),this.setupExpandable(r),this.setupTooltip(),this.refreshAnnouncement(),this.setupAutoHeight({wrapperElement:o,compBean:r}),this.setupUserComp(),this.addHeaderMouseListeners(r,o),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();const u=this.rowCtrl.pinned,h=i.getProvidedColumnGroup().getLeafColumns();c?.createHoverFeature(r,h,t),d?.createRangeHighlightFeature(r,i,e),r.createManagedBean(new Hn(i,t,n)),r.createManagedBean(new B0(e,i)),g?this.resizeFeature=r.createManagedBean(g.createGroupResizeFeature(e,a,u,i)):e.setResizableDisplayed(!1),r.createManagedBean(new Ta(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(r,h),this.addManagedEventListeners({cellSelectionChanged:()=>this.refreshAnnouncement()}),r.addManagedPropertyListener("cellSelection",()=>this.refreshAnnouncement()),r.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(r),r.addDestroyFunc(()=>this.clearComponent())}getHeaderClassParams(){const{column:e,beans:t}=this,a=e.getDefinition();return I(t.gos,{colDef:a,columnGroup:e,floatingFilter:!1})}refreshMaxHeaderHeight(){const{gos:e,comp:t}=this,a=e.get("groupHeaderHeight");a!=null?a===0?t.setHeaderWrapperHidden(!0):t.setHeaderWrapperMaxHeight(a):(t.setHeaderWrapperHidden(!1),t.setHeaderWrapperMaxHeight(null))}addHighlightListeners(e,t){if(this.beans.gos.get("suppressMoveWhenColumnDragging"))for(const a of t)e.addManagedListeners(a,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,a)})}onLeafColumnHighlightChanged(e){const t=this.column.getDisplayedLeafColumns(),a=t[0]===e,o=j(t)===e;if(!a&&!o)return;const r=e.getHighlighted(),i=!!this.rowCtrl.getHeaderCellCtrls().find(s=>s.column.isMoving());let n=!1,l=!1;if(i){const s=this.beans.gos.get("enableRtl"),c=r===1,d=r===0;a&&(s?l=c:n=d),o&&(s?n=d:l=c)}this.comp.toggleCss("ag-header-highlight-before",n),this.comp.toggleCss("ag-header-highlight-after",l)}resizeHeader(e,t){const{resizeFeature:a}=this;if(!a)return;const o=a.getInitialValues(t);a.resizeColumns(o,o.resizeStartWidth+e,"uiColumnResized",!0)}resizeLeafColumnsToFit(e){this.resizeFeature?.resizeLeafColumnsToFit(e)}setupUserComp(){const{colGroupSvc:e,userCompFactory:t,gos:a,enterpriseMenuFactory:o}=this.beans,r=this.column,i=r.getProvidedColumnGroup(),n=I(a,{displayName:this.displayName,columnGroup:r,setExpanded:s=>{e.setColumnGroupOpened(i,s,"gridInitializing")},setTooltip:(s,c)=>{a.assertModuleRegistered("Tooltip",3),this.setupTooltip(s,c)},showColumnMenu:(s,c)=>o?.showMenuAfterButtonClick(i,s,"columnMenu",c),showColumnMenuAfterMouseClick:(s,c)=>o?.showMenuAfterMouseEvent(i,s,"columnMenu",c),eGridHeader:this.eGui}),l=Ob(t,n);l&&this.comp.setUserCompDetails(l)}addHeaderMouseListeners(e,t){const{column:a,comp:o,beans:{rangeSvc:r},gos:i}=this,n=d=>this.handleMouseOverChange(d.type==="mouseenter"),l=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",a.getProvidedColumnGroup()),s=d=>this.handleContextMenuMouseEvent(d,void 0,a.getProvidedColumnGroup());e.addManagedListeners(this.eGui,{mouseenter:n,mouseleave:n,click:l,contextmenu:s}),o.toggleCss("ag-header-group-cell-selectable",Et(i));const c=r?.createHeaderGroupCellMouseListenerFeature(this.column,t);c&&this.createManagedBean(c)}handleMouseOverChange(e){this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderGroupTooltip(this.tooltipFeature,this,e,t)}setupExpandable(e){const t=this.column.getProvidedColumnGroup();this.refreshExpanded();const a=this.refreshExpanded.bind(this);e.addManagedListeners(t,{expandedChanged:a,expandableChanged:a})}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0),this.refreshHeaderStyles(),this.refreshAnnouncement()}addClasses(){const{column:e}=this,t=e.getColGroupDef(),a=Gn(t,this.gos,null,e);e.isPadding()?(a.push("ag-header-group-cell-no-group"),e.getLeafColumns().every(r=>r.isSpanHeaderHeight())&&a.push("ag-header-span-height")):(a.push("ag-header-group-cell-with-group"),t?.wrapHeaderText&&a.push("ag-header-cell-wrap-text"));for(const o of a)this.comp.toggleCss(o,!0)}setupMovingCss(e){const{column:t}=this,o=t.getProvidedColumnGroup().getLeafColumns(),r=()=>this.comp.toggleCss("ag-header-cell-moving",t.isMoving());for(const i of o)e.addManagedListeners(i,{movingChanged:r});r()}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription())}handleKeyDown(e){if(super.handleKeyDown(e),!this.getWrapperHasFocus())return;const{column:a,expandable:o,gos:r,beans:i}=this,n=Et(r);if(e.key==C.ENTER){if(n&&!e.altKey)i.rangeSvc?.handleColumnSelection(a,e);else if(o){const l=!a.isExpanded();i.colGroupSvc.setColumnGroupOpened(a.getProvidedColumnGroup(),l,"uiColumnExpanded")}}}refreshAnnouncement(){let e;const{gos:t,expandable:a}=this,o=Et(t),r=this.getLocaleTextFunc();o&&a?e=r("ariaColumnGroupCellSelectionAndExpansion","Press Enter to toggle selection for all visible cells in this column group. Press ALT ENTER to expand or collapse this column group"):o?e=r("ariaColumnGroupCellSelection","Press Enter to toggle selection for all visible cells in this column group"):a&&(e=r("ariaColumnGroupExpansion","Press ENTER to expand or collapse this column group")),this.ariaAnnouncement=e}announceAriaDescription(){const{beans:e,eGui:t,ariaAnnouncement:a}=this;!a||!t.contains(Q(e))||e.ariaAnnounce?.announceValue(a,"columnHeader")}setDragSource(e){!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),e&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null))}isSuppressMoving(){return this.gos.get("suppressMovableColumns")||this.column.getLeafColumns().some(e=>e.colDef.suppressMovable||e.colDef.lockPosition)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function N0(e,t,a){e.colGroupSvc?.setColumnGroupOpened(t,a,"api")}function H0(e,t,a){return e.colGroupSvc?.getColumnGroup(t,a)??null}function G0(e,t){return e.colGroupSvc?.getProvidedColGroup(t)??null}function V0(e,t,a){return e.colNames.getDisplayNameForColumnGroup(t,a)||""}function q0(e){return e.colGroupSvc?.getColumnGroupState()??[]}function W0(e,t){e.colGroupSvc?.setColumnGroupState(t,"api")}function U0(e){e.colGroupSvc?.resetColumnGroupState("api")}function j0(e){return e.visibleCols.treeLeft}function K0(e){return e.visibleCols.treeCenter}function _0(e){return e.visibleCols.treeRight}function Q0(e){return e.visibleCols.getAllTrees()}var ul=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let a;return typeof t!="number"?a=0:a=t+1,this.existingIds[e]=a,a}};function Y0(e,t){for(let a=0;a<t.length;a++){const o=e.indexOf(t[a]);o>=0&&(e[o]=e[e.length-1],e.pop())}}var Z0=class extends y{constructor(){super(...arguments),this.beanName="visibleCols",this.colsAndGroupsMap={},this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.headerGroupRowCount=0,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.isBodyWidthDirty=!0}refresh(e,t=!1){const{colFlex:a,colModel:o,colGroupSvc:r,colViewport:i,selectionColSvc:n}=this.beans;t||this.buildTrees(o,r),r?.updateOpenClosedVisibility(),this.leftCols=hl(this.treeLeft),this.centerCols=hl(this.treeCenter),this.rightCols=hl(this.treeRight),n?.refreshVisibility(this.leftCols,this.centerCols,this.rightCols),this.joinColsAriaOrder(o),this.joinCols(),this.headerGroupRowCount=this.getHeaderRowCount(),this.setLeftValues(e),this.autoHeightCols=this.allCols.filter(l=>l.isAutoHeight()),a?.refreshFlexedColumns(),this.updateBodyWidths(),this.setFirstRightAndLastLeftPinned(o,this.leftCols,this.rightCols,e),i.checkViewportColumns(!1),this.eventSvc.dispatchEvent({type:"displayedColumnsChanged",source:e})}getHeaderRowCount(){if(!this.gos.get("hidePaddedHeaderRows"))return this.beans.colModel.cols.treeDepth;let e=0;for(const t of this.allCols){let a=t.parent;for(;a;){if(!a.isPadding()){const o=a.getProvidedColumnGroup().getLevel()+1;o>e&&(e=o);break}a=a.parent}}return e}updateBodyWidths(){const e=pt(this.centerCols),t=pt(this.leftCols),a=pt(this.rightCols);this.isBodyWidthDirty=this.bodyWidth!==e,(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==a)&&(this.bodyWidth=e,this.leftWidth=t,this.rightWidth=a,this.eventSvc.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventSvc.dispatchEvent({type:"displayedColumnsWidthChanged"}))}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e,t,a,o){let r,i;this.gos.get("enableRtl")?(r=t?t[0]:null,i=a?j(a):null):(r=t?j(t):null,i=a?a[0]:null);for(const n of e.getCols())n.setLastLeftPinned(n===r,o),n.setFirstRightPinned(n===i,o)}buildTrees(e,t){const a=e.getColsToShow(),o=a.filter(s=>s.getPinned()=="left"),r=a.filter(s=>s.getPinned()=="right"),i=a.filter(s=>s.getPinned()!="left"&&s.getPinned()!="right"),n=new ul,l=s=>t?t.createColumnGroups(s):s.columns;this.treeLeft=l({columns:o,idCreator:n,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=l({columns:r,idCreator:n,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=l({columns:i,idCreator:n,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.ariaOrderColumns=[]}joinColsAriaOrder(e){const t=e.getCols(),a=[],o=[],r=[];for(const i of t){const n=i.getPinned();n?n===!0||n==="left"?a.push(i):r.push(i):o.push(i)}this.ariaOrderColumns=a.concat(o).concat(r)}getAriaColIndex(e){let t;return ee(e)?t=e.getLeafColumns()[0]:t=e,this.ariaOrderColumns.indexOf(t)+1}setLeftValuesOfGroups(){for(const e of[this.treeLeft,this.treeRight,this.treeCenter])for(const t of e)ee(t)&&t.checkLeft()}setLeftValuesOfCols(e){const{colModel:t}=this.beans;if(!t.getColDefCols())return;const o=t.getCols().slice(0),r=this.gos.get("enableRtl");for(const i of[this.leftCols,this.rightCols,this.centerCols]){if(r){let n=pt(i);for(const l of i)n-=l.getActualWidth(),l.setLeft(n,e)}else{let n=0;for(const l of i)l.setLeft(n,e),n+=l.getActualWidth()}Y0(o,i)}for(const i of o)i.setLeft(null,e)}joinCols(){this.gos.get("enableRtl")?this.allCols=this.rightCols.concat(this.centerCols).concat(this.leftCols):this.allCols=this.leftCols.concat(this.centerCols).concat(this.rightCols)}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}isColDisplayed(e){return this.allCols.indexOf(e)>=0}getLeftColsForRow(e){const{leftCols:t,beans:{colModel:a}}=this;return a.colSpanActive?this.getColsForRow(e,t):t}getRightColsForRow(e){const{rightCols:t,beans:{colModel:a}}=this;return a.colSpanActive?this.getColsForRow(e,t):t}getColsForRow(e,t,a,o){const r=[];let i=null;for(let n=0;n<t.length;n++){const l=t[n],s=t.length-n,c=Math.min(l.getColSpan(e),s),d=[l];if(c>1){const u=c-1;for(let h=1;h<=u;h++)d.push(t[n+h]);n+=u}let g;if(a){g=!1;for(const u of d)a(u)&&(g=!0)}else g=!0;g&&(r.length===0&&i&&o&&o(l)&&r.push(i),r.push(l)),i=l}return r}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getColBefore(e){const t=this.allCols,a=t.indexOf(e);return a>0?t[a-1]:null}isPinningLeft(){return this.leftCols.length>0}isPinningRight(){return this.rightCols.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=t=>{this.colsAndGroupsMap[t.getUniqueId()]=t};sa(this.treeCenter,!1,e),sa(this.treeLeft,!1,e),sa(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["leftCols","centerCols","rightCols"];e&&t.reverse();for(let a=0;a<t.length;a++){const o=this[t[a]];if(o.length)return e?j(o):o[0]}return null}getColAfter(e){const t=this.allCols,a=t.indexOf(e);return a<t.length-1?t[a+1]:null}getColsLeftWidth(){return pt(this.leftCols)}getDisplayedColumnsRightWidth(){return pt(this.rightCols)}isColAtEdge(e,t){const a=this.allCols;if(!a.length)return!1;const o=t==="first";let r;if(ee(e)){const i=e.getDisplayedLeafColumns();if(!i.length)return!1;r=o?i[0]:j(i)}else r=e;return(o?a[0]:j(a))===r}};function sa(e,t,a){if(e)for(let o=0;o<e.length;o++){const r=e[o];if(ee(r)){const i=t?r.getDisplayedChildren():r.getChildren();sa(i,t,a)}a(r)}}function hl(e){const t=[];return sa(e,!0,a=>{dt(a)&&t.push(a)}),t}var J0=class extends y{constructor(){super(...arguments),this.beanName="colGroupSvc"}getColumnGroupState(){const e=[],t=this.beans.colModel.getColTree();return Ze(null,t,a=>{de(a)&&e.push({groupId:a.getGroupId(),open:a.isExpanded()})}),e}resetColumnGroupState(e){const t=this.beans.colModel.getColDefColTree();if(!t)return;const a=[];Ze(null,t,o=>{if(de(o)){const r=o.getColGroupDef(),i={groupId:o.getGroupId(),open:r?r.openByDefault:void 0};a.push(i)}}),this.setColumnGroupState(a,e)}setColumnGroupState(e,t){const{colModel:a,colAnimation:o,visibleCols:r,eventSvc:i}=this.beans;if(!a.getColTree().length)return;o?.start();const l=[];for(const s of e){const c=s.groupId,d=s.open,g=this.getProvidedColGroup(c);g&&g.isExpanded()!==d&&(g.setExpanded(d),l.push(g))}r.refresh(t,!0),l.length&&i.dispatchEvent({type:"columnGroupOpened",columnGroup:l.length===1?l[0]:void 0,columnGroups:l}),o?.finish()}setColumnGroupOpened(e,t,a){let o;de(e)?o=e.getId():o=e||"",this.setColumnGroupState([{groupId:o,open:t}],a)}getProvidedColGroup(e){let t=null;return Ze(null,this.beans.colModel.getColTree(),a=>{de(a)&&a.getId()===e&&(t=a)}),t}getGroupAtDirection(e,t){const a=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),o=e.getDisplayedLeafColumns(),r=t==="After"?j(o):o[0],i=`getCol${t}`;for(;;){const n=this.beans.visibleCols[i](r);if(!n)return null;const l=this.getColGroupAtLevel(n,a);if(l!==e)return l}}getColGroupAtLevel(e,t){let a=e.parent,o,r;for(;o=a.getProvidedColumnGroup().getLevel(),r=a.getPaddingLevel(),!(o+r<=t);)a=a.parent;return a}updateOpenClosedVisibility(){const e=this.beans.visibleCols.getAllTrees();sa(e,!1,t=>{ee(t)&&t.calculateDisplayedColumns()})}getColumnGroup(e,t){if(!e)return null;if(ee(e))return e;const a=this.beans.visibleCols.getAllTrees(),o=typeof t=="number";let r=null;return sa(a,!1,i=>{if(ee(i)){const n=i;let l;o?l=e===n.getGroupId()&&t===n.getPartId():l=e===n.getGroupId(),l&&(r=n)}}),r}createColumnGroups(e){const{columns:t,idCreator:a,pinned:o,oldDisplayedGroups:r,isStandaloneStructure:i}=e,n=this.mapOldGroupsById(r),l=[];let s=t;for(;s.length;){const c=s;s=[];let d=0;const g=u=>{const h=d;d=u;const p=c[h],m=(ee(p)?p.getProvidedColumnGroup():p).getOriginalParent();if(m==null){for(let w=h;w<u;w++)l.push(c[w]);return}const v=this.createColumnGroup(m,a,n,o,i);for(let w=h;w<u;w++)v.addChild(c[w]);s.push(v)};for(let u=1;u<c.length;u++){const h=c[u],f=(ee(h)?h.getProvidedColumnGroup():h).getOriginalParent(),m=c[d],w=(ee(m)?m.getProvidedColumnGroup():m).getOriginalParent();f!==w&&g(u)}d<c.length&&g(c.length)}return i||this.setupParentsIntoCols(l,null),l}createProvidedColumnGroup(e,t,a,o,r,i,n){const l=r.getUniqueKey(t.groupId||null,null),s=tn(this.beans,t,l),c=new Aa(s,l,!1,a);this.createBean(c);const d=this.findExistingGroup(t,i);d&&i.splice(d.idx,1);const g=d?.group;g&&c.setExpanded(g.isExpanded());const u=md(this.beans,s.children,a+1,e,o,r,i,n);return c.setChildren(u),c}balanceColumnTree(e,t,a,o){const r=[];for(let i=0;i<e.length;i++){const n=e[i];if(de(n)){const l=n,s=this.balanceColumnTree(l.getChildren(),t+1,a,o);l.setChildren(s),r.push(l)}else{let l,s;for(let c=t;c<a;c++){const d=o.getUniqueKey(null,null),g=tn(this.beans,null,d),u=new Aa(g,d,!0,c);this.createBean(u),s&&s.setChildren([u]),s=u,l||(l=s)}if(l&&s)if(r.push(l),e.some(d=>de(d))){s.setChildren([n]);continue}else{s.setChildren(e);break}r.push(n)}}return r}findDepth(e){let t=0,a=e;for(;a?.[0]&&de(a[0]);)t++,a=a[0].getChildren();return t}findMaxDepth(e,t){let a=t;for(let o=0;o<e.length;o++){const r=e[o];if(de(r)){const i=r,n=this.findMaxDepth(i.getChildren(),t+1);a<n&&(a=n)}}return a}balanceTreeForAutoCols(e,t){const a=[];for(const o of e){let r=o;for(let i=t-1;i>=0;i--){const n=new Aa(null,`FAKE_PATH_${o.getId()}_${i}`,!0,i);this.createBean(n),n.setChildren([r]),r.originalParent=n,r=n}t===0&&(o.originalParent=null),a.push(r)}return a}findExistingGroup(e,t){if(e.groupId!=null)for(let o=0;o<t.length;o++){const r=t[o];if(r.getColGroupDef()&&r.getId()===e.groupId)return{idx:o,group:r}}}createColumnGroup(e,t,a,o,r){const i=e.getGroupId(),n=t.getInstanceIdForKey(i),l=Sd(i,n);let s=a[l];return s&&s.getProvidedColumnGroup()!==e&&(s=null),z(s)?s.reset():(s=new Ia(e,i,n,o),r||this.createBean(s)),s}mapOldGroupsById(e){const t={},a=o=>{for(const r of o)if(ee(r)){const i=r;t[r.getUniqueId()]=i,a(i.getChildren())}};return e&&a(e),t}setupParentsIntoCols(e,t){for(const a of e??[])if(a.parent!==t&&(this.beans.colViewport.colsWithinViewportHash=""),a.parent=t,ee(a)){const o=a;this.setupParentsIntoCols(o.getChildren(),o)}}},ku={moduleName:"ColumnGroup",version:F,dynamicBeans:{headerGroupCellCtrl:O0},beans:[J0],apiFunctions:{getAllDisplayedColumnGroups:Q0,getCenterDisplayedColumnGroups:K0,getColumnGroup:H0,getColumnGroupState:q0,getDisplayNameForColumnGroup:V0,getLeftDisplayedColumnGroups:j0,getProvidedColumnGroup:G0,getRightDisplayedColumnGroups:_0,resetColumnGroupState:U0,setColumnGroupOpened:N0,setColumnGroupState:W0}};function Be(e,t,a){const{colModel:o,rowGroupColsSvc:r,pivotColsSvc:i,autoColSvc:n,selectionColSvc:l,colAnimation:s,visibleCols:c,pivotResultCols:d,environment:g,valueColsSvc:u,eventSvc:h,gos:p}=e,f=o.getColDefCols()??[],m=l?.getColumns();if(!f.length&&!m?.length)return!1;if(t?.state&&!t.state.forEach)return x(32),!1;const v=(S,R,M,L,O)=>{if(!S)return;const N=ib(R,t.defaultState),B=N("flex").value1,K=N("sort").value1,W=N("sortType").value1,ge=ut(K)||Cr(W),ie=Ye(W),qs=po(K),Ws=ge?{type:ie,direction:qs}:void 0;if(vd(e,S,N("hide").value1,Ws,N("sortIndex").value1,N("pinned").value1,B,a),B==null){const Ya=N("width").value1;if(Ya!=null){const Zo=S.getColDef().minWidth??g.getDefaultColumnMinWidth();Zo!=null&&Ya>=Zo&&S.setActualWidth(Ya,a)}}O||!S.primary||(u?.syncColumnWithState(S,a,N),r?.syncColumnWithState(S,a,N,M),i?.syncColumnWithState(S,a,N,L))},w=(S,R,M)=>{const L=xu(e,a),O=R.slice(),N={},B={},K=[],W=[],ge=[];let ie=0;const qs=r?.columns.slice()??[],Ws=i?.columns.slice()??[];for(const xe of S){const Jo=xe.colId;if(Jo.startsWith(ht)){K.push(xe),ge.push(xe);continue}if(ft(Jo)){W.push(xe),ge.push(xe);continue}const Za=M(Jo);Za?(v(Za,xe,N,B,!1),Pe(O,Za)):(ge.push(xe),ie+=1)}const Ya=xe=>v(xe,null,N,B,!1);O.forEach(Ya),r?.sortColumns(Eu.bind(r,N,qs)),i?.sortColumns(Eu.bind(i,B,Ws)),o.refreshCols(!1,a);const Zo=(xe,Jo,Us=[])=>{for(const Za of Jo){const zm=xe(Za.colId);Pe(Us,zm),v(zm,Za,null,null,!0)}Us.forEach(Ya)};return Zo(xe=>n?.getColumn(xe)??null,K,n?.getColumns()?.slice()),Zo(xe=>l?.getColumn(xe)??null,W,l?.getColumns()?.slice()),X0(t,o,p),c.refresh(a),h.dispatchEvent({type:"columnEverythingChanged",source:a}),L(),{unmatchedAndAutoStates:ge,unmatchedCount:ie}};s?.start();let{unmatchedAndAutoStates:b,unmatchedCount:k}=w(t.state||[],f,S=>o.getColDefCol(S));if(b.length>0||z(t.defaultState)){const S=d?.getPivotResultCols()?.list??[];k=w(b,S,R=>d?.getPivotResultCol(R)??null).unmatchedCount}return s?.finish(),k===0}function Su(e,t){const{colModel:a,autoColSvc:o,selectionColSvc:r,eventSvc:i,gos:n}=e;if(!a.getColDefCols()?.length)return;const s=a.getColDefColTree(),c=on(s),d=[];let g=1e3,u=1e3;const h=w=>{const b=Ru(w);_(b.rowGroupIndex)&&b.rowGroup&&(b.rowGroupIndex=g++),_(b.pivotIndex)&&b.pivot&&(b.pivotIndex=u++),d.push(b)};o?.getColumns()?.forEach(h),r?.getColumns()?.forEach(h),c?.forEach(h),Be(e,{state:d},t);const p=o?.getColumns()??[],v=[...r?.getColumns()??[],...p,...c].map(w=>({colId:w.colId}));Be(e,{state:v,applyOrder:!0},t),i.dispatchEvent(I(n,{type:"columnsReset",source:t}))}function xu(e,t){const{rowGroupColsSvc:a,pivotColsSvc:o,valueColsSvc:r,colModel:i,sortSvc:n,eventSvc:l}=e,s={rowGroupColumns:a?.columns.slice()??[],pivotColumns:o?.columns.slice()??[],valueColumns:r?.columns.slice()??[]},c=Do(e),d={};for(const g of c)d[g.colId]=g;return()=>{const g=(R,M,L,O)=>{const N=M.map(O),B=L.map(O);if(rt(N,B))return;const W=new Set(M);for(const ie of L)W.delete(ie)||W.add(ie);const ge=[...W];l.dispatchEvent({type:R,columns:ge,column:ge.length===1?ge[0]:null,source:t})},u=R=>{const M=[];return i.forAllCols(L=>{const O=d[L.colId];O&&R(O,L)&&M.push(L)}),M},h=R=>R.colId;g("columnRowGroupChanged",s.rowGroupColumns,a?.columns??[],h),g("columnPivotChanged",s.pivotColumns,o?.columns??[],h);const f=u((R,M)=>{const L=R.aggFunc!=null,O=L!=M.isValueActive(),N=L&&R.aggFunc!=M.getAggFunc();return O||N});f.length>0&&yu(l,"columnValueChanged",f,t),Na(l,u((R,M)=>R.width!=M.getActualWidth()),!0,t),Cu(l,u((R,M)=>R.pinned!=M.getPinned()),t),D0(l,u((R,M)=>R.hide==M.isVisible()),t);const k=u((R,M)=>!ho(M.getSortDef(),{type:Ye(R.sortType),direction:po(R.sort)})||R.sortIndex!=M.getSortIndex());k.length>0&&n?.dispatchSortChangedEvents(t,k);const S=Do(e);ey(c,S,t,i,l)}}function Do(e){const{colModel:t,rowGroupColsSvc:a,pivotColsSvc:o}=e,r=t.getColDefCols();if(_(r)||!t.isAlive())return[];const i=a?.columns,n=o?.columns,l=[],s=d=>{const g=d.isRowGroupActive()&&i?i.indexOf(d):null,u=d.isPivotActive()&&n?n.indexOf(d):null,h=d.isValueActive()?d.getAggFunc():null,p=d.getSortIndex()!=null?d.getSortIndex():null;l.push({colId:d.colId,width:d.getActualWidth(),hide:!d.isVisible(),pinned:d.getPinned(),sort:d.getSort(),sortType:d.getSortDef()?.type,sortIndex:p,aggFunc:h,rowGroup:d.isRowGroupActive(),rowGroupIndex:g,pivot:d.isPivotActive(),pivotIndex:u,flex:d.getFlex()??null})};t.forAllCols(d=>s(d));const c=new Map(t.getCols().map((d,g)=>[d.colId,g]));return l.sort((d,g)=>{const u=c.has(d.colId)?c.get(d.colId):-1,h=c.has(g.colId)?c.get(g.colId):-1;return u-h}),l}function Ru(e){const t=(m,v)=>m??v??null,a=e.colDef,o=ze(t(a.sort,a.initialSort)),r=o.direction,i=o.type,n=t(a.sortIndex,a.initialSortIndex),l=t(a.hide,a.initialHide),s=t(a.pinned,a.initialPinned),c=t(a.width,a.initialWidth),d=t(a.flex,a.initialFlex);let g=t(a.rowGroupIndex,a.initialRowGroupIndex),u=t(a.rowGroup,a.initialRowGroup);g==null&&!u&&(g=null,u=null);let h=t(a.pivotIndex,a.initialPivotIndex),p=t(a.pivot,a.initialPivot);h==null&&!p&&(h=null,p=null);const f=t(a.aggFunc,a.initialAggFunc);return{colId:e.colId,sort:r,sortType:i,sortIndex:n,hide:l,pinned:s,width:c,flex:d,rowGroup:u,rowGroupIndex:g,pivot:p,pivotIndex:h,aggFunc:f}}function X0(e,t,a){if(!e.applyOrder||!e.state)return;const o=[];for(const r of e.state)r.colId!=null&&o.push(r.colId);$0(t.cols,o,t,a)}function $0(e,t,a,o){if(e==null)return;let r=[];const i={};for(const l of t){if(i[l])continue;const s=e.map[l];s&&(r.push(s),i[l]=!0)}let n=0;for(const l of e.list){const s=l.colId;if(i[s]!=null)continue;s.startsWith(ht)?r.splice(n++,0,l):r.push(l)}if(r=fu(r,o),!mu(r,a.getColTree())){x(39);return}e.list=r}function ey(e,t,a,o,r){const i={};for(const d of t)i[d.colId]=d;const n={};for(const d of e)i[d.colId]&&(n[d.colId]=!0);const l=e.filter(d=>n[d.colId]),s=t.filter(d=>n[d.colId]),c=[];s.forEach((d,g)=>{const u=l?.[g];if(u&&u.colId!==d.colId){const h=o.getCol(u.colId);h&&c.push(h)}}),c.length&&r.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,finished:!0,source:a})}var Eu=(e,t,a,o)=>{const r=e[a.getId()],i=e[o.getId()],n=r!=null,l=i!=null;if(n&&l)return r-i;if(n)return-1;if(l)return 1;const s=t.indexOf(a),c=t.indexOf(o),d=s>=0,g=c>=0;return d&&g?s-c:d?-1:1},ty=class extends y{constructor(){super(...arguments),this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","groupHideColumnsUntilExpanded","rowNumbers","hidePaddedHeaderRows"],e=>this.refreshAll(oa(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),oa(e.source)))}createColsFromColDefs(e){const{beans:t}=this,{valueCache:a,colAutosize:o,rowGroupColsSvc:r,pivotColsSvc:i,valueColsSvc:n,visibleCols:l,eventSvc:s,groupHierarchyColSvc:c}=t,d=this.colDefs?xu(t,e):void 0;a?.expire();const g=this.colDefCols?.list,u=this.colDefCols?.tree,h=pd(t,this.colDefs,!0,u,e);mo(t,this.colDefCols?.tree,h.columnTree);const p=h.columnTree,f=h.treeDepth,m=on(p),v={};for(const w of m)v[w.getId()]=w;this.colDefCols={tree:p,treeDepth:f,list:m,map:v},this.createColumnsForService([c],this.colDefCols,e),r?.extractCols(e,g),i?.extractCols(e,g),n?.extractCols(e,g),this.ready=!0,this.changeEventsDispatching=!0,this.refreshCols(!0,e),this.changeEventsDispatching=!1,l.refresh(e),s.dispatchEvent({type:"columnEverythingChanged",source:e}),d&&(this.changeEventsDispatching=!0,d(),this.changeEventsDispatching=!1),s.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing"&&o?.applyAutosizeStrategy()}refreshCols(e,t){if(!this.colDefCols)return;const a=this.cols?.tree;this.saveColOrder();const{autoColSvc:o,selectionColSvc:r,rowNumbersSvc:i,quickFilter:n,pivotResultCols:l,showRowGroupCols:s,rowAutoHeight:c,visibleCols:d,colViewport:g,eventSvc:u,formula:h}=this.beans,p=this.selectCols(l,this.colDefCols);h?.setFormulasActive(p),this.createColumnsForService([o,r,i],p,t);const f=Tv(this.gos,this.showingPivotResult);(!e||f)&&this.restoreColOrder(p),this.positionLockedCols(p),s?.refresh(),n?.refreshCols(),this.setColSpanActive(),c?.setAutoHeightActive(p),d.clear(),g.clear(),rt(a,this.cols.tree)||u.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,a){for(const o of e)o&&(o.createColumns(t,r=>{this.lastOrder=r(this.lastOrder),this.lastPivotOrder=r(this.lastPivotOrder)},a),o.addColumns(t))}selectCols(e,t){const a=e?.getPivotResultCols()??null;this.showingPivotResult=a!=null;const{map:o,list:r,tree:i,treeDepth:n}=a??t;return this.cols={list:r.slice(),map:{...o},tree:i.slice(),treeDepth:n},a&&(a.list.some(s=>this.cols?.map[s.colId]!==void 0)||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const{beans:e,showingPivotResult:t,cols:a}=this,{valueColsSvc:o,selectionColSvc:r,gos:i}=e,n=this.pivotMode&&!t,l=r?.isSelectionColumnEnabled(),s=Yc(e),c=o?.columns,d=$c(i);return a.list.filter(u=>{const h=Sr(u);return n?c?.includes(u)||h&&(!d||u.isVisible())||l&&ft(u)||s&&pe(u):h&&!d||u.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,a){Be(this.beans,{state:e.map(o=>({colId:typeof o=="string"?o:o.colId,hide:!t}))},a)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const a=t.filter(g=>e.map[g.getId()]!=null);if(a.length===0)return;if(a.length===e.list.length){e.list=a;return}const o=g=>{const u=g.getOriginalParent();return u?u.getChildren().length>1?!0:o(u):!1};if(!a.some(g=>o(g))){const g=new Set(a);for(const u of e.list)g.has(u)||a.push(u);e.list=a;return}const r=new Map;for(let g=0;g<a.length;g++){const u=a[g];r.set(u,g)}const i=e.list.filter(g=>!r.has(g));if(i.length===0){e.list=a;return}const n=(g,u)=>{const h=u?u.getOriginalParent():g.getOriginalParent();if(!h)return null;let p=null,f=null;for(const m of h.getChildren())if(!(m===u||m===g)){if(m instanceof gt){const v=r.get(m);if(v==null)continue;(p==null||p<v)&&(p=v,f=m);continue}m.forEachLeafColumn(v=>{const w=r.get(v);w!=null&&(p==null||p<w)&&(p=w,f=v)})}return f??n(g,h)},l=[],s=new Map;for(const g of i){const u=n(g,null);if(u==null){l.push(g);continue}const h=s.get(u);h===void 0?s.set(u,g):Array.isArray(h)?h.push(g):s.set(u,[h,g])}const c=new Array(e.list.length);let d=c.length-1;for(let g=l.length-1;g>=0;g--)c[d--]=l[g];for(let g=a.length-1;g>=0;g--){const u=a[g],h=s.get(u);if(h)if(Array.isArray(h))for(let p=h.length-1;p>=0;p--){const f=h[p];c[d--]=f}else c[d--]=h;c[d--]=u}e.list=c}positionLockedCols(e){e.list=fu(e.list,this.gos)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list??null:this.lastOrder=this.cols?.list??null}getColumnDefs(e){return this.colDefCols&&this.beans.colDefFactory?.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,this.cols?.list??[],e)}setColSpanActive(){this.colSpanActive=!!this.cols?.list.some(e=>e.getColDef().colSpan!=null)}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode||(this.pivotMode=e,!this.ready))return;this.refreshCols(!1,t);const{visibleCols:a,eventSvc:o}=this.beans;a.refresh(t),o.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){const e=this.beans.pivotColsSvc?.columns;return this.pivotMode&&!!e?.length}recreateColumnDefs(e){if(!this.cols)return;this.beans.autoColSvc?.updateColumns(e);const t=oa(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){mo(this.beans,this.colDefCols?.tree),super.destroy()}getColTree(){return this.cols?.tree??[]}getColDefColTree(){return this.colDefCols?.tree??[]}getColDefCols(){return this.colDefCols?.list??null}getCols(){return this.cols?.list??[]}forAllCols(e){const{pivotResultCols:t,autoColSvc:a,selectionColSvc:o,groupHierarchyColSvc:r}=this.beans;Xa(this.colDefCols?.list,e)||Xa(a?.columns?.list,e)||Xa(o?.columns?.list,e)||Xa(r?.columns?.list,e)||Xa(t?.getPivotResultCols()?.list,e)}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){return this.getColFromCollection(e,this.colDefCols)??this.getColFromServiceCols(e)}getColDefColOrCol(e){return e==null?null:this.getColFromCollection(e,this.colDefCols)??this.getColFromCollection(e,this.cols)??this.getColFromServiceCols(e)}getColOrColDefCol(e){return e==null?null:this.getColFromCollection(e,this.cols)??this.getColFromCollection(e,this.colDefCols)??this.getColFromServiceCols(e)}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)??this.getColFromServiceCols(e)}getColById(e){return this.cols?.map[e]??null}getColFromCollection(e,t){if(t==null)return null;const a=t.map;if(typeof e=="string"&&a[e])return a[e];const o=t.list;for(let r=0,i=o.length;r<i;++r)if(Pa(o[r],e))return o[r];return null}getColFromServiceCols(e){const t=this.beans;return t.autoColSvc?.getColumn(e)??t.selectionColSvc?.getColumn(e)??t.groupHierarchyColSvc?.getColumn(e)??null}},ay=".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-label-align-right){.ag-label,.ag-wrapper{flex:none}}.ag-label-align-top{align-items:flex-start;flex-direction:column}:where(.ag-label-align-top){.ag-label,.ag-wrapper{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}",Fu=class extends ra{constructor(e,t,a){super(t,a),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(ay)}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:a,labelAlignment:o,disabled:r,labelEllipsis:i}=this.config;r!=null&&this.setDisabled(r),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),a!=null&&this.setLabelWidth(a),i!=null&&this.setLabelEllipsis(i),this.setLabelAlignment(o||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;le(t),typeof e=="string"?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),e===""?(U(t,!1),_e(t,"presentation")):(U(t,!0),_e(t,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const a=this.getGui().classList;return a.toggle("ag-label-align-left",e==="left"),a.toggle("ag-label-align-right",e==="right"),a.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(dr(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return ya(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},pl=class extends Fu{constructor(e,t,a,o){super(e,t,a),this.className=o}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:a,ariaLabel:o}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),a!=null&&this.onValueChange(a),o!=null&&this.setAriaLabel(o),this.className&&this.addCss(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),a=this.getLabel();a==null||a==""||Um(e)!==null?ba(e,""):ba(e,t??"")}setAriaLabel(e){return Qt(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return He(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}};function oy(e){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:e,ref:"eInput",cls:"ag-input-field-input"}]}]}}var Bt=class extends pl{constructor(e,t,a="text",o="input"){super(e,e?.template??oy(o),[],t),this.inputType=a,this.displayFieldTag=o,this.eLabel=E,this.eWrapper=E,this.eInput=E}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:a,className:o}=this;e.classList.add(`${o}-label`),t.classList.add(`${o}-input-wrapper`),a.classList.add(`${o}-input`),this.addCss("ag-input-field"),a.id=a.id||`ag-${this.getCompId()}-input`;const{inputName:r,inputWidth:i,inputPlaceholder:n,autoComplete:l,tabIndex:s}=this.config;r!=null&&this.setInputName(r),i!=null&&this.setInputWidth(i),n!=null&&this.setInputPlaceholder(n),l!=null&&this.setAutoComplete(l),this.addInputListeners(),this.activateTabIndex([a],s)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){this.displayFieldTag==="input"&&(this.inputType=e,we(this.eInput,"type",e))}getInputElement(){return this.eInput}getWrapperElement(){return this.eWrapper}setInputWidth(e){return dr(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return we(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Qt(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return ya(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)we(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";we(this.eInput,"autocomplete",t)}return this}},Ao=class extends Bt{constructor(e,t="ag-checkbox",a="checkbox"){super(e,t,a),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t,name:a}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t),a!=null&&this.setName(a)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0;const a=this.eInput;a.checked=e,a.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,a){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:a});const o=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:o.id,name:o.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),a=this.selected=e.target.checked;this.refreshSelectedClass(a),this.dispatchChange(a,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",e===!0),t.toggle("ag-indeterminate",e==null)}},_r={selector:"AG-CHECKBOX",component:Ao},ry=".ag-checkbox-cell{height:100%}",iy={tag:"div",cls:"ag-cell-wrapper ag-checkbox-cell",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},ny=class extends V{constructor(){super(iy,[_r]),this.eCheckbox=E,this.registerCSS(ry)}init(e){this.refresh(e);const{eCheckbox:t,beans:a}=this,o=t.getInputElement();o.setAttribute("tabindex","-1"),$s(o,"polite"),this.addManagedListeners(o,{click:r=>{if(Pt(r),t.isDisabled())return;const i=t.getValue();this.onCheckboxChanged(i)},dblclick:r=>{Pt(r)}}),this.addManagedElementListeners(e.eGridCell,{keydown:r=>{if(r.key===C.SPACE&&!t.isDisabled()){e.eGridCell===Q(a)&&t.toggle();const i=t.getValue();this.onCheckboxChanged(i),r.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,a=!0;const{value:o,column:r,node:i}=e;if(i.group&&r)if(typeof o=="boolean")t=o;else{const g=r.getColId();g.startsWith(ht)?t=o==null||o===""?void 0:o==="true":i.aggData?.[g]!==void 0||i.sourceRowIndex>=0?t=o??void 0:a=!1}else t=o??void 0;const{eCheckbox:n}=this;if(!a){n.setDisplayed(!1);return}n.setValue(t);const l=e.disabled??!r?.isCellEditable(i);n.setDisabled(l);const s=this.getLocaleTextFunc(),c=nr(s,t),d=l?c:`${s("ariaToggleCellValue","Press SPACE to toggle cell value")} (${c})`;n.setInputAriaLabel(d)}onCheckboxChanged(e){const{params:t}=this,{column:a,node:o,value:r}=t,{editSvc:i}=this.beans;if(!a)return;const n={rowNode:o,column:a};i?.dispatchCellEvent(n,null,"cellEditingStarted",{value:r});const l=o.setDataValue(a,e,"ui");i?.dispatchCellEvent(n,null,"cellEditingStopped",{oldValue:r,newValue:e,valueChanged:l}),l||this.updateCheckbox(t)}},ly={tag:"div",cls:"ag-skeleton-container"},sy=class extends V{constructor(){super(ly)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>ba(e.eParentOfValue)),ba(e.eParentOfValue,t),e.deferRender?this.setupLoading(e):e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.getLocaleTextFunc();this.getGui().textContent=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");Qt(this.getGui(),t)}setupLoading(e){const t=re({tag:"div",cls:"ag-skeleton-effect"}),a=e.node.rowIndex;if(a!=null){const i=75+25*(a%2===0?Math.sin(a):Math.cos(a));t.style.width=`${i}%`}this.getGui().appendChild(t);const o=this.getLocaleTextFunc(),r=e.deferRender?o("ariaDeferSkeletonCellLoading","Cell is loading"):o("ariaSkeletonCellLoading","Row data is loading");Qt(this.getGui(),r)}refresh(e){return!1}},cy={moduleName:"CheckboxCellRenderer",version:F,userComponents:{agCheckboxCellRenderer:ny}},dy={moduleName:"SkeletonCellRenderer",version:F,userComponents:{agSkeletonCellRenderer:sy}};function gy(e,t){const a=e.colModel.getColDefColOrCol(t);return a?a.colDef:null}function uy(e){return e.colModel.getColumnDefs(!0)}function hy(e,t,a){return e.colNames.getDisplayNameForColumn(t,a)||""}function py(e,t){return e.colModel.getColDefColOrCol(t)}function fy(e){return e.colModel.getColDefCols()}function my(e,t){return Be(e,t,"api")}function vy(e){return Do(e)}function by(e){Su(e,"api")}function wy(e){return e.visibleCols.isPinningLeft()||e.visibleCols.isPinningRight()}function Cy(e){return e.visibleCols.isPinningLeft()}function yy(e){return e.visibleCols.isPinningRight()}function ky(e,t){return e.visibleCols.getColAfter(t)}function Sy(e,t){return e.visibleCols.getColBefore(t)}function xy(e,t,a){e.colModel.setColsVisible(t,a,"api")}function Ry(e,t,a){e.pinnedCols?.setColsPinned(t,a,"api")}function Ey(e){return e.colModel.getCols()}function Fy(e){return e.visibleCols.leftCols}function My(e){return e.visibleCols.centerCols}function zy(e){return e.visibleCols.rightCols}function Dy(e){return e.visibleCols.allCols}function Ay(e){return e.colViewport.getViewportColumns()}function fl(e,t){if(!e)return;const a=e,o={};for(const r of Object.keys(a)){if(t&&t.indexOf(r)>=0||zc.has(r))continue;const i=a[r];typeof i=="object"&&i!==null&&i.constructor===Object?o[r]=fl(i):o[r]=i}return o}var Py=class extends y{constructor(){super(...arguments),this.beanName="colDefFactory"}wireBeans(e){this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc}getColumnDefs(e,t,a,o,r=!1){const i=e.slice();t?i.sort((s,c)=>a.indexOf(s)-a.indexOf(c)):(a||r)&&i.sort((s,c)=>o.indexOf(s)-o.indexOf(c));const n=this.rowGroupColsSvc?.columns,l=this.pivotColsSvc?.columns;return this.buildColumnDefs(i,n,l)}buildColumnDefs(e,t=[],a=[]){const o=[],r={};for(const i of e){const n=this.createDefFromColumn(i,t,a);let l=!0,s=n,c=i.getOriginalParent(),d=null;for(;c;){if(c.isPadding()){c=c.getOriginalParent();continue}const g=r[c.getGroupId()];if(g){g.children.push(s),l=!1;break}const u=this.createDefFromGroup(c);if(u&&(u.children=[s],r[u.groupId]=u,s=u,c=c.getOriginalParent()),c!=null&&d===c){l=!1;break}d=c}l&&o.push(s)}return o}createDefFromGroup(e){const t=fl(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,a){const o=fl(e.colDef);return o.colId=e.colId,o.width=e.getActualWidth(),o.rowGroup=e.isRowGroupActive(),o.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,o.pivot=e.isPivotActive(),o.pivotIndex=e.isPivotActive()?a.indexOf(e):null,o.aggFunc=e.isValueActive()?e.getAggFunc():null,o.hide=e.isVisible()?void 0:!0,o.pinned=e.isPinned()?e.getPinned():null,o.sort=e.getSortDef(),o.sortIndex=e.getSortIndex()!=null?e.getSortIndex():null,o}},Iy=class extends y{constructor(){super(...arguments),this.beanName="colFlex",this.columnsHidden=!1}refreshFlexedColumns(e={}){const t=e.source??"flex";e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth);const a=this.flexViewportWidth,{visibleCols:o,colDelayRenderSvc:r}=this.beans,i=o.centerCols;let n=-1;if(e.resizingCols){const f=new Set(e.resizingCols);for(let m=i.length-1;m>=0;m--)if(f.has(i[m])){n=m;break}}let l=!1;const s=i.map((f,m)=>{const v=f.getFlex(),w=v!=null&&v>0&&m>n;return l||(l=w),{col:f,isFlex:w,flex:Math.max(0,v??0),initialSize:f.getActualWidth(),min:f.getMinWidth(),max:f.getMaxWidth(),targetSize:0}});if(l?(r?.hideColumns("colFlex"),this.columnsHidden=!0):this.columnsHidden&&this.revealColumns(r),!a||!l)return[];let c=s.length,d=s.reduce((f,m)=>f+m.flex,0),g=a;const u=(f,m)=>{f.frozenSize=m,f.col.setActualWidth(m,t),g-=m,d-=f.flex,c-=1},h=f=>f.frozenSize!=null;for(const f of s)f.isFlex||u(f,f.initialSize);for(;c>0;){const f=Math.round(d<1?g*d:g);let m,v=0,w=0;for(const S of s){if(h(S))continue;m=S,w+=f*(S.flex/d);const R=w-v,M=Math.round(R);S.targetSize=M,v+=M}m&&(m.targetSize+=f-v);let b=0;for(const S of s){if(h(S))continue;const R=S.targetSize,M=Math.min(Math.max(R,S.min),S.max);b+=M-R,S.violationType=M===R?void 0:M<R?"max":"min",S.targetSize=M}const k=b===0?"all":b>0?"min":"max";for(const S of s)h(S)||(k==="all"||S.violationType===k)&&u(S,S.targetSize)}e.skipSetLeft||o.setLeftValues(t),e.updateBodyWidths&&o.updateBodyWidths();const p=s.filter(f=>f.isFlex&&!f.violationType).map(f=>f.col);if(e.fireResizedEvent){const f=s.filter(v=>v.initialSize!==v.frozenSize).map(v=>v.col),m=s.filter(v=>v.flex).map(v=>v.col);Na(this.eventSvc,f,!0,t,m)}return this.revealColumns(r),p}revealColumns(e){this.columnsHidden&&(e?.revealColumns("colFlex"),this.columnsHidden=!1)}initCol(e){const{flex:t,initialFlex:a}=e.colDef;t!==void 0?e.flex=t:a!==void 0&&(e.flex=a)}setColFlex(e,t){e.flex=t??null,e.dispatchStateUpdatedEvent("flex")}},ke=e=>{if(typeof e=="bigint")return e;let t;if(typeof e=="number")t=e;else if(typeof e=="string"&&(t=e.trim(),t===""||(t.endsWith("n")&&(t=t.slice(0,-1)),!/^[+-]?\d+$/.test(t))))return null;if(t==null)return null;try{return BigInt(t)}catch{return null}},ml="T",Ty=new RegExp(`[${ml} ]`),Ly=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${ml}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function $e(e,t){return e.toString().padStart(t,"0")}function fe(e,t=!0,a=ml){if(!e)return null;let o=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(r=>$e(r,2)).join("-");return t&&(o+=a+[e.getHours(),e.getMinutes(),e.getSeconds()].map(r=>$e(r,2)).join(":")),o}function Po(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),$e(e.getDate(),2),$e(e.getHours(),2),`:${$e(e.getMinutes(),2)}`,`:${$e(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,$e(e.getDate(),2)].map(String):null}var vl=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"},bl=["January","February","March","April","May","June","July","August","September","October","November","December"],wl=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function By(e,t){if(t==null)return fe(e,!1);const a=$e(e.getFullYear(),4),o={YYYY:()=>a.slice(a.length-4,a.length),YY:()=>a.slice(a.length-2,a.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>bl[e.getMonth()],MMM:()=>bl[e.getMonth()].slice(0,3),MM:()=>$e(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${vl(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${vl(e.getDate())}`,DD:()=>$e(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>wl[e.getDay()],ddd:()=>wl[e.getDay()].slice(0,3),dd:()=>wl[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${vl(e.getDay())}`,d:()=>`${e.getDay()}`},r=new RegExp(Object.keys(o).join("|"),"g");return t.replace(r,i=>i in o?o[i]():i)}function Qr(e,t=!1){return!!me(e,t)}function Oy(e){return Qr(e,!0)}function me(e,t=!1,a){if(!e||!a&&!Ly.test(e))return null;const[o,r]=e.split(Ty);if(!o)return null;const i=o.split("-").map(h=>Number.parseInt(h,10));if(i.filter(h=>!isNaN(h)).length!==3)return null;const[n,l,s]=i,c=new Date(n,l-1,s);if(c.getFullYear()!==n||c.getMonth()!==l-1||c.getDate()!==s||!r&&t)return null;if(!r||r==="00:00:00")return c;const[d,g,u]=r.split(":").map(h=>Number.parseInt(h,10));if(d>=0&&d<24)c.setHours(d);else if(t)return null;if(g>=0&&g<60)c.setMinutes(g);else if(t)return null;if(u>=0&&u<60)c.setSeconds(u);else if(t)return null;return c}function Io(e,t){const a=t.split(".");let o=e;for(let r=0;r<a.length;r++){if(o==null)return;o=o[a[r]]}return o}var Ny=["dateTimeString","dateString","text","number","bigint","boolean","date"],Hy=class extends y{constructor(){super(...arguments),this.beanName="dataTypeSvc",this.dataTypeDefinitions={},this.isPendingInference=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[],this.columnDefinitionPropsPerDataType={number(){return{cellEditor:"agNumberCellEditor"}},bigint({filterModuleBean:e}){return e?{cellEditor:"agTextCellEditor"}:{cellEditor:"agTextCellEditor",comparator:{default:Wy,absolute:Uy}}},boolean(){return{cellEditor:"agCheckboxCellEditor",cellRenderer:"agCheckboxCellRenderer",getFindText:()=>null,suppressKeyboardEvent:({node:e,event:t,column:a})=>t.key===C.SPACE&&a.isCellEditable(e)}},date({formatValue:e}){return{cellEditor:"agDateCellEditor",keyCreator:e}},dateString({formatValue:e}){return{cellEditor:"agDateStringCellEditor",keyCreator:e}},dateTime(e){return this.date(e)},dateTimeString(e){return this.dateString(e)},object({formatValue:e,colModel:t,colId:a}){return{cellEditorParams:{useFormatter:!0},comparator:(o,r)=>{const i=t.getColDefCol(a),n=i?.colDef;if(!i||!n)return 0;const l=o==null?"":e({column:i,node:null,value:o}),s=r==null?"":e({column:i,node:null,value:r});return l===s?0:l>s?1:-1},keyCreator:e}},text(){return{}}}}wireBeans(e){this.colModel=e.colModel}postConstruct(){this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.colModel.recreateColumnDefs(e)})}processDataTypeDefinitions(){const e=this.getDefaultDataTypes(),t={},a={},o=d=>g=>{const{column:u,node:h,value:p}=g;let f=u.getColDef().valueFormatter;return f===d.groupSafeValueFormatter&&(f=d.valueFormatter),this.beans.valueSvc.formatValue(u,h,p,f)};for(const d of Object.keys(e)){const g=e[d],u={...g,groupSafeValueFormatter:Du(g,this.gos)};t[d]=u,a[d]=o(u)}const r=this.gos.get("dataTypeDefinitions")??{},i={};for(const d of Object.keys(r)){const g=r[d],u=this.processDataTypeDefinition(g,r,[d],e);u&&(t[d]=u,g.dataTypeMatcher&&(i[d]=g.dataTypeMatcher),a[d]=o(u))}const{valueParser:n,valueFormatter:l}=e.object,{valueParser:s,valueFormatter:c}=t.object;this.hasObjectValueParser=s!==n,this.hasObjectValueFormatter=c!==l,this.formatValueFuncs=a,this.dataTypeDefinitions=t,this.dataTypeMatchers=this.sortKeysInMatchers(i,e)}sortKeysInMatchers(e,t){const a={...e};for(const o of Ny)delete a[o],a[o]=e[o]??t[o].dataTypeMatcher;return a}processDataTypeDefinition(e,t,a,o){let r;const i=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let n=o[i];const l=t[i];if(n&&l&&(n=l),!zu(e,n,i))return;r=Mu(n,e)}else{if(a.includes(i)){x(44);return}const n=t[i];if(!zu(e,n,i))return;const l=this.processDataTypeDefinition(n,t,[...a,i],o);if(!l)return;r=Mu(l,e)}return{...r,groupSafeValueFormatter:Du(r,this.gos)}}updateColDefAndGetColumnType(e,t,a){let{cellDataType:o}=t;o===void 0&&(o=e.cellDataType);const{field:r}=t;if((o==null||o===!0)&&(o=this.canInferCellDataType(e,t)?this.inferCellDataType(r,a):!1),this.addFormulaCellEditorToColDef(e,t),!o){e.cellDataType=!1;return}const i=this.dataTypeDefinitions[o];if(!i){x(47,{cellDataType:o});return}return e.cellDataType=o,i.groupSafeValueFormatter&&(e.valueFormatter=i.groupSafeValueFormatter),i.valueParser&&(e.valueParser=i.valueParser),i.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,o,i,a),i.columnTypes}addFormulaCellEditorToColDef(e,t){!(t.allowFormula??e.allowFormula)||t.cellEditor||(e.cellEditor="agFormulaCellEditor")}addColumnListeners(e){if(!this.isPendingInference)return;const t=this.columnStateUpdatesPendingInference[e.colId];if(!t)return;const a=o=>{t.add(o.key)};e.__addEventListener("columnStateUpdated",a),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.__removeEventListener("columnStateUpdated",a))}canInferCellDataType(e,t){const{gos:a}=this;if(!$(a))return!1;const o={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(Cl(t,o))return!1;const r=t.type===null?e.type:t.type;if(r){const i=a.get("columnTypes")??{};if(xr(r).some(l=>{const s=i[l.trim()];return s&&Cl(s,o)}))return!1}return!Cl(e,o)}inferCellDataType(e,t){if(!e)return;let a;const o=this.getInitialData();return o?a=e.includes(".")&&!this.gos.get("suppressFieldDotNotation")?Io(o,e):o[e]:this.initWaitForRowData(t),a==null?void 0:Object.keys(this.dataTypeMatchers).find(i=>this.dataTypeMatchers[i](a))??"object"}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const t=this.beans.rowModel.rootNode?._leafs;if(t?.length)return t[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isPendingInference)return;this.isPendingInference=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions,{colAutosize:a,eventSvc:o}=this.beans;t&&a&&(a.shouldQueueResizeOperations=!0);const[r]=this.addManagedEventListeners({rowDataUpdateStarted:i=>{const{firstRowData:n}=i;n&&(r?.(),this.isPendingInference=!1,this.processColumnsPendingInference(n,t),this.columnStateUpdatesPendingInference={},t&&a?.processResizeOperations(),o.dispatchEvent({type:"dataTypesInferred"}))}})}processColumnsPendingInference(e,t){this.initialData=e;const a=[];this.destroyColumnStateUpdateListeners();const o={},r={};for(const i of Object.keys(this.columnStateUpdatesPendingInference)){const n=this.columnStateUpdatesPendingInference[i],l=this.colModel.getCol(i);if(!l)continue;const s=l.colDef;if(!this.resetColDefIntoCol(l,"cellDataTypeInferred"))continue;const c=l.colDef;if(t&&c.type&&c.type!==s.type){const d=jy(l,n);d.rowGroup&&d.rowGroupIndex==null&&(o[i]=d),d.pivot&&d.pivotIndex==null&&(r[i]=d),a.push(d)}}t&&a.push(...this.generateColumnStateForRowGroupAndPivotIndexes(o,r)),a.length&&Be(this.beans,{state:a},"cellDataTypeInferred"),this.initialData=null}generateColumnStateForRowGroupAndPivotIndexes(e,t){const a={},{rowGroupColsSvc:o,pivotColsSvc:r}=this.beans;return o?.restoreColumnOrder(a,e),r?.restoreColumnOrder(a,t),Object.values(a)}resetColDefIntoCol(e,t){const a=e.getUserProvidedColDef();if(!a)return!1;const o=fo(this.beans,a,e.colId);return e.setColDef(o,a,t),!0}getDateStringTypeDefinition(e){const{dateString:t}=this.dataTypeDefinitions;return e?this.getDataTypeDefinition(e)??t:t}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDateIncludesTimeFlag(e){return e==="dateTime"||e==="dateTimeString"}getDataTypeDefinition(e){const t=e.colDef;if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,t){if(t==null)return!0;const a=this.getDataTypeDefinition(e)?.dataTypeMatcher;return!a||e.colDef.allowFormula&&this.beans.formula?.isFormula(t)?!0:a(t)}validateColDef(e,t,a,o){if(e.cellDataType==="object"){const r=s=>s?.cellDataType==null||s?.cellDataType===!0,i=r(t)&&r(a),n=s=>x(48,{property:s,inferred:i,colId:o}),{object:l}=this.dataTypeDefinitions;e.valueFormatter===l.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&n("Formatter"),e.editable&&e.valueParser===l.valueParser&&!this.hasObjectValueParser&&n("Parser")}}postProcess(e){const t=e.cellDataType;if(!t||typeof t!="string")return;const{dataTypeDefinitions:a,beans:o,formatValueFuncs:r}=this,i=a[t];i&&o.colFilter?.setColDefPropsForDataType(e,i,r[t])}getFormatValue(e){return this.formatValueFuncs[e]}isColPendingInference(e){return this.isPendingInference&&!!this.columnStateUpdatesPendingInference[e]}setColDefPropertiesForBaseDataType(e,t,a,o){const r=this.formatValueFuncs[t],i=this.columnDefinitionPropsPerDataType[a.baseDataType]({colDef:e,cellDataType:t,colModel:this.colModel,dataTypeDefinition:a,colId:o,formatValue:r,filterModuleBean:this.beans.filterManager});e.cellEditor==="agFormulaCellEditor"&&i.cellEditor!==e.cellEditor&&(i.cellEditor=e.cellEditor),Object.assign(e,i)}getDateObjectTypeDef(e){const t=this.getLocaleTextFunc(),a=this.getDateIncludesTimeFlag(e);return{baseDataType:e,valueParser:o=>me(o.newValue&&String(o.newValue)),valueFormatter:o=>o.value==null?"":!(o.value instanceof Date)||isNaN(o.value.getTime())?t("invalidDate","Invalid Date"):fe(o.value,a)??"",dataTypeMatcher:o=>o instanceof Date}}getDateStringTypeDef(e){const t=this.getDateIncludesTimeFlag(e);return{baseDataType:e,dateParser:a=>me(a)??void 0,dateFormatter:a=>fe(a??null,t)??void 0,valueParser:a=>Qr(String(a.newValue))?a.newValue:null,valueFormatter:a=>Qr(String(a.value))?String(a.value):"",dataTypeMatcher:a=>typeof a=="string"&&Qr(a)}}getDefaultDataTypes(){const e=this.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:t=>t.newValue?.trim?.()===""?null:Number(t.newValue),valueFormatter:t=>t.value==null?"":typeof t.value!="number"||isNaN(t.value)?e("invalidNumber","Invalid Number"):String(t.value),dataTypeMatcher:t=>typeof t=="number"},bigint:{baseDataType:"bigint",valueParser:t=>{const{newValue:a}=t;return a==null||typeof a=="string"&&a.trim()===""?null:ke(a)},valueFormatter:t=>t.value==null?"":typeof t.value!="bigint"?e("invalidBigInt","Invalid BigInt"):String(t.value),dataTypeMatcher:t=>typeof t=="bigint"},text:{baseDataType:"text",valueParser:t=>t.newValue===""?null:$o(t.newValue),dataTypeMatcher:t=>typeof t=="string"},boolean:{baseDataType:"boolean",valueParser:t=>t.newValue==null?t.newValue:t.newValue?.trim?.()===""?null:String(t.newValue).toLowerCase()==="true",valueFormatter:t=>t.value==null?"":String(t.value),dataTypeMatcher:t=>typeof t=="boolean"},date:this.getDateObjectTypeDef("date"),dateString:this.getDateStringTypeDef("dateString"),dateTime:this.getDateObjectTypeDef("dateTime"),dateTimeString:{...this.getDateStringTypeDef("dateTimeString"),dataTypeMatcher:t=>typeof t=="string"&&Oy(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:t=>$o(t.value)??""}}}destroyColumnStateUpdateListeners(){for(const e of this.columnStateUpdateListenerDestroyFuncs)e();this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}};function Mu(e,t){const a={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(a.columnTypes=[...xr(e.columnTypes),...xr(t.columnTypes)]),a}function zu(e,t,a){return t?t.baseDataType!==e.baseDataType?(x(46),!1):!0:(x(45,{parentCellDataType:a}),!1)}var Gy=e=>typeof e=="bigint"||typeof e=="number",Vy=e=>e==="number"||e==="bigint";function Du(e,t){if(e.valueFormatter)return a=>{const{node:o,colDef:r,column:i,value:n}=a;if(o?.group){const l=(r.pivotValueColumn??i).getAggFunc();if(l){if(l==="first"||l==="last")return e.valueFormatter(a);const{baseDataType:s}=e;if(Vy(s)&&l!=="count"){if(Gy(n))return e.valueFormatter(a);if(n==null)return;if(typeof n=="object"){if(typeof n.toNumber=="function")return e.valueFormatter({...a,value:n.toNumber()});if("value"in n)return e.valueFormatter({...a,value:n.value})}}return}}else if(t.get("groupHideOpenParents")&&a.column.isRowGroupActive()&&typeof a.value=="string"&&!e.dataTypeMatcher?.(a.value))return;return e.valueFormatter(a)}}function qy(e,t,a,o){if(!t[a])return!1;const r=e[a];return r===null?(t[a]=!1,!1):o===void 0?!!r:r===o}function Wy(e,t){if(e==null)return t==null?0:-1;if(t==null)return 1;const a=ke(e),o=ke(t);return a!=null&&o!=null?a===o?0:a>o?1:-1:0}function Uy(e,t){if(e==null)return t==null?0:-1;if(t==null)return 1;const a=Au(e),o=Au(t);return a!=null&&o!=null?a===o?0:a>o?1:-1:0}function Au(e){const t=ke(e);return t==null?null:t<0n?-t:t}function Cl(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([a,o])=>qy(e,t,a,o))}function jy(e,t){const a=Ru(e);for(const o of t)delete a[o],o==="rowGroup"?delete a.rowGroupIndex:o==="pivot"&&delete a.pivotIndex;return a}var Ky={moduleName:"DataType",version:F,beans:[Hy],dependsOn:[cy]},_y={moduleName:"ColumnFlex",version:F,beans:[Iy]},yl={moduleName:"ColumnApi",version:F,beans:[Py],apiFunctions:{getColumnDef:gy,getDisplayNameForColumn:hy,getColumn:py,getColumns:fy,applyColumnState:my,getColumnState:vy,resetColumnState:by,isPinning:wy,isPinningLeft:Cy,isPinningRight:yy,getDisplayedColAfter:ky,getDisplayedColBefore:Sy,setColumnsVisible:xy,setColumnsPinned:Ry,getAllGridColumns:Ey,getDisplayedLeftColumns:Fy,getDisplayedCenterColumns:My,getDisplayedRightColumns:zy,getAllDisplayedColumns:Dy,getAllDisplayedVirtualColumns:Ay,getColumnDefs:uy}},Qy=class extends y{constructor(){super(...arguments),this.beanName="colNames"}getDisplayNameForColumn(e,t,a=!1){if(!e)return null;const o=this.getHeaderName(e.getColDef(),e,null,null,t),{aggColNameSvc:r}=this.beans;return a&&r?r.getHeaderName(e,o):o}getDisplayNameForProvidedColumnGroup(e,t,a){const o=t?.getColGroupDef();return o?this.getHeaderName(o,null,e,t,a):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,a,o,r){const i=e.headerValueGetter;if(i){const n=I(this.gos,{colDef:e,column:t,columnGroup:a,providedColumnGroup:o,location:r});return typeof i=="function"?i(n):typeof i=="string"?this.beans.expressionSvc?.evaluate(i,n)??null:""}else{if(e.headerName!=null)return e.headerName;if(e.field)return Js(e.field)}return""}},Yy=class extends y{constructor(){super(...arguments),this.beanName="colViewport",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.columnsToRenderLeft=[],this.columnsToRenderRight=[],this.columnsToRenderCenter=[]}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}getScrollPosition(){return this.scrollPosition}setScrollPosition(e,t,a=!1){const{visibleCols:o}=this,r=o.isBodyWidthDirty;if(!(e===this.scrollWidth&&t===this.scrollPosition&&!r)){if(this.scrollWidth=e,this.scrollPosition=t,o.isBodyWidthDirty=!0,this.gos.get("enableRtl")){const n=o.bodyWidth;this.viewportLeft=n-t-e,this.viewportRight=n-t}else this.viewportLeft=t,this.viewportRight=e+t;this.colModel.ready&&this.checkViewportColumns(a)}}getColumnHeadersToRender(e){switch(e){case"left":return this.columnsToRenderLeft;case"right":return this.columnsToRenderRight;default:return this.columnsToRenderCenter}}getHeadersToRender(e,t){let a;switch(e){case"left":a=this.rowsOfHeadersToRenderLeft[t];break;case"right":a=this.rowsOfHeadersToRenderRight[t];break;default:a=this.rowsOfHeadersToRenderCenter[t];break}return a??[]}extractViewportColumns(){const e=this.visibleCols.centerCols;this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return e.isAutoHeaderHeight()||Zy(e)?!0:this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,a=t+e.getActualWidth(),o=this.viewportLeft-200,r=this.viewportRight+200,i=t<o&&a<o,n=t>r&&a>r;return!i&&!n}getViewportColumns(){const{leftCols:e,rightCols:t}=this.visibleCols;return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.colModel.colSpanActive)return this.colsWithinViewport;const t=i=>{const n=i.getLeft();return z(n)&&n>this.viewportLeft},a=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),{visibleCols:o}=this,r=o.centerCols;return o.getColsForRow(e,r,a,t)}checkViewportColumns(e=!1){this.extractViewport()&&this.eventSvc.dispatchEvent({type:"virtualColumnsChanged",afterScroll:e})}calculateHeaderRows(){const{leftCols:e,rightCols:t}=this.visibleCols;this.columnsToRenderLeft=e,this.columnsToRenderRight=t,this.columnsToRenderCenter=this.colsWithinViewport;const a=o=>{const r=new Set,i={};for(const n of o){let l=n.parent;const s=n.isSpanHeaderHeight();for(;l&&!r.has(l);){if(s&&l.isPadding()){l=l.parent;continue}const d=l.getProvidedColumnGroup().getLevel();i[d]??(i[d]=[]),i[d].push(l),r.add(l),l=l.parent}}return i};this.rowsOfHeadersToRenderLeft=a(e),this.rowsOfHeadersToRenderRight=a(t),this.rowsOfHeadersToRenderCenter=a(this.headerColsWithinViewport)}extractViewport(){const e=o=>`${o.getId()}-${o.getPinned()||"normal"}`;this.extractViewportColumns();const t=this.getViewportColumns().map(e).join("#"),a=this.colsWithinViewportHash!==t;return a&&(this.colsWithinViewportHash=t,this.calculateHeaderRows()),a}};function Zy(e){for(;e;){if(e.isAutoHeaderHeight())return!0;e=e.parent}return!1}var Jy=class extends y{constructor(){super(...arguments),this.beanName="agCompUtils"}adaptFunction(e,t){if(!e.cellRenderer)return null;class a{refresh(){return!1}getGui(){return this.eGui}init(r){const i=t(r),n=typeof i;if(n==="string"||n==="number"||n==="boolean"){this.eGui=cr("<span>"+i+"</span>");return}if(i==null){this.eGui=re({tag:"span"});return}this.eGui=i}}return a}},Xy={moduleName:"CellRendererFunction",version:F,beans:[Jy]},Pu=class extends ue{constructor(){super(...arguments),this.beanName="registry"}registerDynamicBeans(e){if(e){this.dynamicBeans??(this.dynamicBeans={});for(const t of Object.keys(e))this.dynamicBeans[t]=e[t]}}createDynamicBean(e,t,...a){if(!this.dynamicBeans)throw new Error(this.getDynamicError(e,!0));const o=this.dynamicBeans[e];if(o==null){if(t)throw new Error(this.getDynamicError(e,!1));return}return new o(...a)}};function $y(e){return typeof e=="object"&&!!e.getComp}var e1=class extends Pu{constructor(){super(...arguments),this.agGridDefaults={},this.agGridDefaultOverrides={},this.jsComps={},this.selectors={},this.icons={}}postConstruct(){const e=this.gos.get("components");if(e!=null)for(const t of Object.keys(e))this.jsComps[t]=e[t]}registerModule(e){const{icons:t,userComponents:a,dynamicBeans:o,selectors:r}=e;if(a){const i=(n,l,s,c)=>{this.agGridDefaults[n]=l,(s||c)&&(this.agGridDefaultOverrides[n]={params:s,processParams:c})};for(const n of Object.keys(a)){let l=a[n];if($y(l)&&(l=l.getComp(this.beans)),typeof l=="object"){const{classImp:s,params:c,processParams:d}=l;i(n,s,c,d)}else i(n,l)}}this.registerDynamicBeans(o);for(const i of r??[])this.selectors[i.selector]=i;if(t)for(const i of Object.keys(t))this.icons[i]=t[i]}getUserComponent(e,t){const a=(l,s,c,d)=>({componentFromFramework:s,component:l,params:c,processParams:d}),{frameworkOverrides:o}=this.beans,r=o.frameworkComponent(t,this.gos.get("components"));if(r!=null)return a(r,!0);const i=this.jsComps[t];if(i){const l=o.isFrameworkComponent(i);return a(i,l)}const n=this.agGridDefaults[t];if(n){const l=this.agGridDefaultOverrides[t];return a(n,!1,l?.params,l?.processParams)}return this.beans.validation?.missingUserComponent(e,t,this.agGridDefaults,this.jsComps),null}getSelector(e){return this.selectors[e]}getIcon(e){return this.icons[e]}getDynamicError(e,t){return t?Ge(279,{name:e}):this.beans.validation?.missingDynamicBean(e)??Ge(256)}},t1=23,a1=class extends y{constructor(){super(...arguments),this.beanName="ctrlsSvc",this.params={},this.ready=!1,this.readyCallbacks=[]}postConstruct(){this.addEventListener("ready",()=>{if(this.updateReady(),this.ready){for(const e of this.readyCallbacks)e(this.params);this.readyCallbacks.length=0}},this.beans.frameworkOverrides.runWhenReadyAsync?.()??!1)}updateReady(){const e=Object.values(this.params);this.ready=e.length===t1&&e.every(t=>t?.isAlive()??!1)}whenReady(e,t){this.ready?t(this.params):this.readyCallbacks.push(t),e.addDestroyFunc(()=>{const a=this.readyCallbacks.indexOf(t);a>=0&&this.readyCallbacks.splice(a,1)})}register(e,t){this.params[e]=t,this.updateReady(),this.ready&&this.dispatchLocalEvent({type:"ready"}),t.addDestroyFunc(()=>{this.updateReady()})}get(e){return this.params[e]}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:a}=this.params;return[e,a,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}getScrollFeature(){return this.getGridBodyCtrl().scrollFeature}},o1=':where([class^=ag-]),:where([class^=ag-]):after,:where([class^=ag-]):before{box-sizing:border-box}:where([class^=ag-]):where(button){color:inherit}:where([class^=ag-]):where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}:where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-tab-guard{display:block;height:0;position:absolute;width:0}.ag-tab-guard-top{top:1px}.ag-tab-guard-bottom{bottom:1px}.ag-measurement-container{height:0;overflow:hidden;visibility:hidden;width:0}.ag-measurement-element-border{display:inline-block}.ag-measurement-element-border:before{border-left:var(--ag-internal-measurement-border);content:"";display:block}.ag-popup-child{top:0;z-index:5}.ag-popup-child:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-wrapper-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);font-weight:var(--ag-font-weight);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled .ag-icon,[disabled] .ag-icon{opacity:.5}.ag-icon-grip.ag-disabled,.ag-icon-grip[disabled]{opacity:.35}.ag-icon-loading{animation-duration:1s;animation-iteration-count:infinite;animation-name:spin;animation-timing-function:linear}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}.ag-menu{background-color:var(--ag-menu-background-color);border:var(--ag-menu-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-menu-shadow);color:var(--ag-menu-text-color);max-height:100%;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}',kl=typeof window!="object"||!window?.document?.fonts?.forEach,Yr=!1,ca=(e,t,a,o,r,i,n=!1)=>{if(kl||Yr)return;let l=e;o&&(l=`@layer ${CSS.escape(o).replaceAll("\\.",".")} { ${e} }`);let s=et.map.get(t);if(s||(s=[],et.map.set(t,s)),s.some(u=>u.injectedCss===l))return;const c=document.createElement("style");i&&c.setAttribute("nonce",i),c.dataset.agCss=a,c.dataset.agCssVersion=F,c.textContent=l;const d={rawCss:e,injectedCss:l,el:c,priority:r,isParams:n};let g;for(const u of s){if(u.priority>r)break;g=u}if(g){g.el.after(c);const u=s.indexOf(g);s.splice(u+1,0,d)}else t.nodeName==="STYLE"?t.after(c):t.insertBefore(c,t.querySelector(":not(title, meta)")),s.push(d)},Iu=(e,t,a,o)=>{ca(o1,e,"shared",t,0,a),o?.forEach((r,i)=>r.forEach(n=>ca(n,e,i,t,0,a)))},r1=(e,t,a,o,r,i)=>{if(kl||Yr)return;const n=et.grids.get(e);n?n.paramsCss=t:et.grids.set(e,{styleContainer:o,paramsCss:t}),Sl(o),t&&a&&ca(t,o,a,r,2,i,!0)},i1=e=>{const t=et.grids.get(e)?.styleContainer;if(!t)return;et.grids.delete(e),Array.from(et.grids.values()).some(o=>o.styleContainer===t)?Sl(t):(Sl(t,!0),et.map.delete(t))},Sl=(e,t=!1)=>{const a=new Set;for(const r of et.grids.values())r.styleContainer===e&&a.add(r.paramsCss);const o=et.map.get(e)??[];for(let r=o.length-1;r>=0;r--)(t||o[r].isParams&&!a.has(o[r].rawCss))&&(o[r].el.remove(),o.splice(r,1))},Tu=()=>{const e=globalThis.agStyleInjectionVersions??(globalThis.agStyleInjectionVersions=new Map);let t=e.get(F);return t||(t={map:new WeakMap,grids:new Map,paramsId:0},e.set(F,t)),t},et=Tu(),H=e=>new Lu(e),Ot="$default",n1=0,Lu=class{constructor({feature:e,params:t,modeParams:a={},css:o,cssImports:r}){this.feature=e,this.css=o,this.cssImports=r,this.modeParams={[Ot]:{...a[Ot]??{},...t??{}},...a}}use(e,t,a){let o=this._inject;if(o==null){let{css:r}=this;if(r){const i=`ag-theme-${this.feature??"part"}-${++n1}`;typeof r=="function"&&(r=r()),r=`:where(.${i}) {
13954
+ `,e)}function Qc(e,t){return e.get("rowModelType")===t}function $(e,t){return Qc(e,"clientSide")}function Fa(e,t){return Qc(e,"serverSide")}function se(e,t){return e.get("domLayout")===t}function xt(e){return go(e)!==void 0}function Qi(e){return typeof e.get("getRowHeight")=="function"}function Tv(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function Yc({gos:e,formula:t}){const a=e.get("rowNumbers");return a||!!t?.active&&a!==!1}function st(e,t,a=!1,o){const{gos:r,environment:i}=e;if(o==null&&(o=i.getDefaultRowHeight()),Qi(r)){if(a)return{height:o,estimated:!0};const s={node:t,data:t.data},c=r.getCallback("getRowHeight")(s);if(Yi(c))return c===0&&x(23),{height:Math.max(1,c),estimated:!1}}if(t.detail&&r.get("masterDetail"))return Lv(r);const n=r.get("rowHeight");return{height:n&&Yi(n)?n:o,estimated:!1}}function Lv(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return Yi(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function Rt(e){const{environment:t,gos:a}=e,o=a.get("rowHeight");if(!o||_(o))return t.getDefaultRowHeight();const r=t.refreshRowHeightVariable();return r!==-1?r:(x(24),t.getDefaultRowHeight())}function Yi(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function Zc(e,t,a){const o=t[e.getDomDataKey()];return o?o[a]:void 0}function $t(e,t,a,o){const r=e.getDomDataKey();let i=t[r];_(i)&&(i={},t[r]=i),i[a]=o}function ea(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function Zi(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||se(e,"print"))}function ct(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function lo(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function Ji(e){return e.get("grandTotalRow")}function Jc(e){switch(e){case"pinnedTop":return"top";case"pinnedBottom":return"bottom";default:return null}}function Bv(e){const t=e.get("groupTotalRow");return typeof t=="function"?e.getCallback("groupTotalRow"):()=>t??void 0}function Xc(e){return e.get("groupHideOpenParents")?!0:e.get("groupDisplayType")==="multipleColumns"}function $c(e){return Xc(e)&&e.get("groupHideColumnsUntilExpanded")&&$(e)}function Xi(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function $i(e,t,a){return!!t.group&&!t.footer&&Xi(e,a)}function ta(e){const t=e.getCallback("getRowId");return t===void 0?t:a=>{let o=t(a);return typeof o!="string"&&(ro(()=>x(25,{id:o}),"getRowIdString"),o=String(o)),o}}function ed(e,t){const a=e.get("groupHideParentOfSingleChild");return!!(a===!0||a==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function td(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function Ov(e,t){const a=e.get("suppressGroupChangesColumnVisibility");if(a===!0||t&&a==="suppressHideOnGroup"||!t&&a==="suppressShowOnUngroup")return!1;const o=e.get("suppressRowGroupHidesColumns");if(t&&o===!0)return!1;const r=e.get("suppressMakeColumnVisibleAfterUnGroup");return!(!t&&r===!0)}function aa(e){return e?.checkboxes??!0}function so(e){return e?.mode==="multiRow"&&(e.headerCheckbox??!0)}function co(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function en(e){return e?.hideDisabledCheckboxes??!1}function ad(e){return typeof e.get("rowSelection")!="string"}function Nv(e){return e.get("cellSelection")!==void 0}function Hv(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t?.suppressMultiRanges??!1:!1:e.get("suppressMultiRangeSelection")}function Qe(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function Gv(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"&&t.handle?.mode==="fill"?t.handle:void 0:{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}}function Et(e){const t=e.get("cellSelection")??!1;return(typeof t=="object"&&t.enableColumnSelection)??!1}function od(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const a=e.get("suppressRowClickSelection"),o=e.get("suppressRowDeselection");return a&&o?!1:a?"enableDeselection":o?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function Vv(e){const t=od(e);return t===!0||t==="enableSelection"}function qv(e){const t=od(e);return t===!0||t==="enableDeselection"}function wr(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t?.isRowSelectable}function go(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t?.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function Ma(e){return go(e)==="multiRow"}function Wv(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):t?.enableSelectionWithoutKeys??!1}function uo(e){const t=e.get("rowSelection");if(typeof t=="string"){const a=e.get("groupSelectsChildren"),o=e.get("groupSelectsFiltered");return a&&o?"filteredDescendants":a?"descendants":"self"}return t?.mode==="multiRow"?t.groupSelects:void 0}function rd(e,t=!0){const a=e.get("rowSelection");return typeof a!="object"?t?"all":void 0:a.mode==="multiRow"?a.selectAll:"all"}function Uv(e){const t=e.get("rowSelection");return typeof t=="string"?!1:t?.mode==="multiRow"?t.ctrlASelectsRows??!1:!1}function za(e){const t=uo(e);return t==="descendants"||t==="filteredDescendants"}function id(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function nd(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function Ce(e){return e.get("columnMenu")==="legacy"}function ld(e){return!Ce(e)}function sd(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function jv(e,t,a){typeof e!="object"&&(e={});const o={...e};for(const r of a){const i=t[r];typeof i<"u"&&(o[r]=i)}return o}function Kv(e,t){if(!e)return;const a={};let o=!1;for(const n of Object.keys(e))a[n]=e[n],o=!0;if(!o)return;const r={type:"gridOptionsChanged",options:a};t.dispatchEvent(r);const i={type:"componentStateChanged",...a};t.dispatchEvent(i)}function I(e,t){return e.addCommon(t)}function _v(e,t){return e[t]??e.gridOptions?.[t]??qi(t)??Ac[t]}function cd({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var Qv={resizable:!0,sortable:!0},Yv=0;function dd(){return Yv++}function dt(e){return e instanceof gt}var Zv=["asc","desc",null],Jv=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],gt=class extends y{constructor(e,t,a,o){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=a,this.primary=o,this.isColumn=!0,this.instanceId=dd(),this.autoHeaderHeight=null,this.sortDef=ze(),this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.formulaRef=null,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new Ct,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=va(a)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:a,colFlex:o}}=this;t?.initCol(this);const r=e.hide;r!==void 0?this.visible=!r:this.visible=!e.initialHide,a?.initCol(this),o?.initCol(this)}setColDef(e,t,a){const o=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),o&&(this.beans.rowSpanSvc?.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",a)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.initState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){const{gos:e,colDef:{field:t,tooltipField:a}}=this,o=e.get("suppressFieldDotNotation");this.fieldContainsDots=z(t)&&t.includes(".")&&!o,this.tooltipFieldContainsDots=z(a)&&a.includes(".")&&!o}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}initRowSpan(){this.colDef.spanRows&&this.beans.rowSpanSvc?.register(this)}addPivotListener(){const e=this.beans.pivotColDefSvc,t=this.colDef.pivotValueColumn;!e||!t||this.addManagedListeners(t,{colDefChanged:a=>{const o=e.recreateColDef(this.colDef);this.setColDef(o,o,a.source)}})}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){const t=e.width??e.initialWidth??200;return Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,e)??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}__addEventListener(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.colEventSvc);const a=this.frameworkEventListenerService?.wrap(e,t)??t;this.colEventSvc.addEventListener(e,a)}removeEventListener(e,t){const a=this.frameworkEventListenerService?.unwrap(e,t)??t;this.colEventSvc.removeEventListener(e,a)}createColumnFunctionCallbackParams(e){return I(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){return this.beans.cellNavigation?.isSuppressNavigable(this,e)??!1}isCellEditable(e){return this.beans.editSvc?.isCellEditable({rowNode:e,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.beans.selectionSvc?.isCellCheckboxSelection(this,e)??!1}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?.suppressPaste??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??Qv[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const a=this.createColumnFunctionCallbackParams(e);return t(a)}return!1}createColumnEvent(e,t){return I(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sortDef.direction}getSortDef(){return this.sortDef.direction?this.sortDef:null}getColDefAllowedSortTypes(){const e=[],{sort:t,initialSort:a}=this.colDef,o=t===null?t:Ye(t?.type),r=a===null?a:Ye(a?.type);return o&&e.push(o),r&&e.push(r),e}getSortingOrder(){const e=this.getColDefAllowedSortTypes().includes("absolute")?Jv:Zv;return(this.colDef.sortingOrder??this.gos.get("sortingOrder")??e).map(t=>ze(t))}getAvailableSortTypes(){const e=this.getSortingOrder().reduce((t,a)=>(a.direction&&t.push(a.type),t),this.getColDefAllowedSortTypes());return new Set(e)}setSortDef(e){this.sortDef=e}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.getSort()==="asc"}isSortDescending(){return this.getSort()==="desc"}isSortNone(){return _(this.getSort())}isSorting(){return z(this.getSort())}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){return x(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const a=e===!0;this.visible!==a&&(this.visible=a,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.colDef.suppressSpanHeaderHeight}getFirstRealParent(){let e=this.getOriginalParent();for(;e?.isPadding();)e=e.getOriginalParent();return e}getColumnGroupPaddingInfo(){let e=this.parent;if(!e?.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let a=!0;for(;e;){if(!e.isPadding()){a=!1;break}e=e.parent}return{numberOfParents:t,isSpanningTotal:a}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return I(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(_(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),a=this.colDef.colSpan(t);return Math.max(a,1)}getRowSpan(e){if(_(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),a=this.colDef.rowSpan(t);return Math.max(a,1)}setActualWidth(e,t,a=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),a||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}isAllowFormula(){return this.colDef.allowFormula===!0}dispatchColEvent(e,t,a){const o=this.createColumnEvent(e,t);a&&he(o,a),this.colEventSvc.dispatchEvent(o)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function ze(e){return Da(e)?{direction:e.direction,type:e.type}:{direction:po(e),type:Ye(e)}}function ut(e){return e==="asc"||e==="desc"||e===null}function Cr(e){return e==="default"||e==="absolute"}function Da(e){if(!e||typeof e!="object")return!1;const t=e;return Cr(t.type)&&ut(t.direction)}function ho(e,t){return e?t?e.type===t.type&&e.direction===t.direction:e?e.direction===null:!0:t?t.direction===null:!0}function po(e){return ut(e)?e:null}function Ye(e){return Cr(e)?e:"default"}function gd(e,t,a){const r=a?.()??t.sortSvc.getDisplaySortForColumn(e),i=Ye(r?.type),n=po(r?.direction),l=e.getAvailableSortTypes(),s=l.has("default"),c=l.has("absolute");return{isDefaultSortAllowed:s,isAbsoluteSortAllowed:c,isAbsoluteSort:i==="absolute",isDefaultSort:i==="default",isAscending:n==="asc",isDescending:n==="desc",direction:n}}function de(e){return e instanceof Aa}var Aa=class extends y{constructor(e,t,a,o){super(),this.colGroupDef=e,this.groupId=t,this.padding=a,this.level=o,this.isColumn=!1,this.expandable=!1,this.instanceId=dd(),this.expandableListenerRemoveCallback=null,this.expanded=!!e?.openByDefault}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}forEachLeafColumn(e){if(this.children)for(const t of this.children)dt(t)?e(t):de(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)dt(t)?e.push(t):de(t)&&t.addLeafColumns(e)}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);for(const t of this.getLeafColumns())t.__addEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=()=>{for(const t of this.getLeafColumns())t.__removeEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,a=!1;const o=this.findChildrenRemovingPadding();for(let i=0,n=o.length;i<n;i++){const l=o[i];if(!l.isVisible())continue;const s=l.getColumnGroupShow();s==="open"?(e=!0,a=!0):s==="closed"?(t=!0,a=!0):(e=!0,t=!0)}const r=e&&t&&a;this.expandable!==r&&(this.expandable=r,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=a=>{for(const o of a)de(o)&&o.isPadding()?t(o.children):e.push(o)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},Xv={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function tn(e,t,a){const o={},r=e.gos;return Object.assign(o,r.get("defaultColGroupDef")),Object.assign(o,t),r.validateColDef(o,a),o}var ud=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=$o(e);let a=0;for(;;){let o=e??t;if(o?a!==0&&(o+="_"+a):o=a,!this.existingKeys[o]){const r=String(o);return e&&a>0&&x(273,{providedId:e,usedId:r}),this.existingKeys[r]=!0,r}a++}}},hd=(e,t)=>{de(e)&&e.setupExpandable(),e.originalParent=t};function $v(e,t=null,a,o,r){const{existingCols:i,existingGroups:n}=fd(o),l=new Map(i.map(f=>[f.getId(),f])),s=new Map(n.map(f=>[f.getId(),f]));let c=0;const d=(f,m)=>{if(c=Math.max(c,m),bd(f)){if(!e.colGroupSvc)return null;const k=f.groupId,S=s.get(k),R=tn(e,f,k),M=new Aa(R,k,!1,m);return e.context.createBean(M),S&&M.setExpanded(S.isExpanded()),M.setChildren(f.children.map(L=>d(L,m+1))),M}const v=f.colId;let w=l.get(v);const b=fo(e,f,w?.colId??v);return w?(w.setColDef(b,f,r),an(e,w,b,r)):(w=new gt(b,f,v,a),e.context.createBean(w)),e.dataTypeSvc?.addColumnListeners(w),w},g=t?.map(f=>d(f,0))??[];let u=0;const h={getUniqueKey:(f,m)=>String(++u)},p=e.colGroupSvc?e.colGroupSvc.balanceColumnTree(g,0,c,h):g;return Ze(null,p,hd),{columnTree:p,treeDepth:c}}function pd(e,t=null,a,o,r){const i=new ud,{existingCols:n,existingGroups:l,existingColKeys:s}=fd(o);i.addExistingKeys(s);const c=md(e,t,0,a,n,i,l,r),{colGroupSvc:d}=e,g=d?.findMaxDepth(c,0)??0,u=d?d.balanceColumnTree(c,0,g,i):c;return Ze(null,u,hd),{columnTree:u,treeDepth:g}}function fd(e){const t=[],a=[],o=[];return e&&Ze(null,e,r=>{if(de(r)){const i=r;a.push(i)}else{const i=r;o.push(i.getId()),t.push(i)}}),{existingCols:t,existingGroups:a,existingColKeys:o}}function md(e,t,a,o,r,i,n,l){if(!t)return[];const{colGroupSvc:s}=e,c=new Array(t.length);for(let d=0;d<c.length;d++){const g=t[d];s&&bd(g)?c[d]=s.createProvidedColumnGroup(o,g,a,r,i,n,l):c[d]=eb(e,o,g,r,i,l)}return c}function eb(e,t,a,o,r,i){const n=tb(a,o);n&&o?.splice(n.idx,1);let l=n?.column;if(l){const s=fo(e,a,l.colId);l.setColDef(s,a,i),an(e,l,s,i)}else{const s=r.getUniqueKey(a.colId,a.field),c=fo(e,a,s);l=new gt(c,a,s,t),e.context.createBean(l)}return e.dataTypeSvc?.addColumnListeners(l),l}function vd(e,t,a,o,r,i,n,l){const{sortSvc:s,pinnedCols:c,colFlex:d}=e;a!==void 0&&t.setVisible(!a,l),s&&(s.updateColSort(t,o,l),r!==void 0&&s.setColSortIndex(t,r)),i!==void 0&&c?.setColPinned(t,i),n!==void 0&&d?.setColFlex(t,n)}function an(e,t,a,o){vd(e,t,a.hide,a.sort,a.sortIndex,a.pinned,a.flex,o);const r=t.getFlex();if(!(r!=null&&r>0))if(a.width!=null)t.setActualWidth(a.width,o);else{const i=t.getActualWidth();t.setActualWidth(i,o)}}function tb(e,t){if(t)for(let a=0;a<t.length;a++){const o=t[a].getUserProvidedColDef();if(!o)continue;if(e.colId!=null){if(t[a].getId()===e.colId)return{idx:a,column:t[a]};continue}if(e.field!=null){if(o.field===e.field)return{idx:a,column:t[a]};continue}if(o===e)return{idx:a,column:t[a]}}}function fo(e,t,a,o){const{gos:r,dataTypeSvc:i}=e,n={},l=r.get("defaultColDef");he(n,l,!1,!0);const s=ab(e,n,t,a);s&&ob(e,s,n);const c=n.cellDataType;he(n,t,!1,!0),c!==void 0&&(n.cellDataType=c);const d=r.get("autoGroupColumnDef"),g=ct(r);return t.rowGroup&&d&&g&&he(n,{sort:d.sort,initialSort:d.initialSort},!1,!0),i?.postProcess(n),i?.validateColDef(n,t,l,a),r.validateColDef(n,a,o),n}function ab(e,t,a,o){const r=e.dataTypeSvc?.updateColDefAndGetColumnType(t,a,o),i=a.type??r??t.type;return t.type=i,i?xr(i):void 0}function ob(e,t,a){if(!t.length)return;const o=Object.assign({},Xv),r=e.gos.get("columnTypes")||{};for(const i of Object.keys(r)){const n=r[i];i in o?x(34,{key:i}):(n.type&&x(35),o[i]=n)}for(const i of t){const n=o[i.trim()];n?he(a,n,!1,!0):x(36,{t:i})}}function bd(e){return e.children!==void 0}function Ze(e,t,a){if(t)for(let o=0;o<t.length;o++){const r=t[o];de(r)&&Ze(r,r.getChildren(),a),a(r,e)}}var ht="ag-Grid-AutoColumn",yr="ag-Grid-SelectionColumn",kr="ag-Grid-RowNumbersColumn",rb="ag-Grid-HierarchyColumn";function on(e){const t=[],a=o=>{for(let r=0;r<o.length;r++){const i=o[r];dt(i)?t.push(i):de(i)&&a(i.getChildren())}};return a(e),t}function pt(e){return e.reduce((t,a)=>t+a.getActualWidth(),0)}function mo(e,t,a){const o={};if(!t)return;Ze(null,t,i=>{o[i.getInstanceId()]=i}),a&&Ze(null,a,i=>{o[i.getInstanceId()]=null});const r=Object.values(o).filter(i=>i!=null);e.context.destroyBeans(r)}function Sr(e){return e.getId().startsWith(ht)}function ft(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(yr)??!1}function pe(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(kr)??!1}function wd(e){return ft(e)||pe(e)}function xr(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function Cd(e,t){return rt(e,t,(a,o)=>a.colId===o.colId)}function yd(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function oa(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function Pa(e,t){return e===t||e.colId==t||e.colDef===t}var ib=(e,t)=>(a,o)=>{const r={value1:void 0,value2:void 0};let i=!1;return e&&(e[a]!==void 0&&(r.value1=e[a],i=!0),z(o)&&e[o]!==void 0&&(r.value2=e[o],i=!0)),!i&&t&&(t[a]!==void 0&&(r.value1=t[a]),z(o)&&t[o]!==void 0&&(r.value2=t[o])),r};function kd(e,t){const a={...e,sort:void 0,colId:t},o=rn(e);return o&&(a.sort=o.direction,a.sortType=o.type),a}function rn(e){const{sort:t,initialSort:a}=e,o=Da(t)||ut(t),r=Da(a)||ut(a);return o?ze(t):r?ze(a):null}function Sd(e,t){return e+"_"+t}function ee(e){return e instanceof Ia}var Ia=class extends y{constructor(e,t,a,o){super(),this.providedColumnGroup=e,this.groupId=t,this.partId=a,this.pinned=o,this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.colIdSanitised=va(this.getUniqueId())}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}getUniqueId(){return Sd(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){for(const e of this.displayedChildren)ee(e)&&e.checkLeft();if(this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=j(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;for(const t of this.displayedChildren??[])e+=t.getActualWidth();return e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;for(const t of this.displayedChildren)t.isResizable()&&(e=!0);return e}getMinWidth(){let e=0;for(const t of this.displayedChildren)e+=t.getMinWidth();return e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}isAutoHeaderHeight(){return!!this.getColGroupDef()?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}addDisplayedLeafColumns(e){for(const t of this.displayedChildren??[])dt(t)?e.push(t):ee(t)&&t.addDisplayedLeafColumns(e)}addLeafColumns(e){for(const t of this.children??[])dt(t)?e.push(t):ee(t)&&t.addLeafColumns(e)}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.parent;return!this.isPadding()||!e?.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e?.isPadding();)e=e.parent;if(!(e?e.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}for(const a of this.children??[]){if(ee(a)&&!a.displayedChildren?.length)continue;switch(a.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(a);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(a);break;default:this.displayedChildren.push(a);break}}this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},Rr="ROOT_NODE_ID",Er="rowGroupFooter_",nn="detail_",xd=Er+Rr,C={BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:" ",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",DELETE:"Delete",F2:"F2",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",PAGE_HOME:"Home",PAGE_END:"End",A:"KeyA",C:"KeyC",D:"KeyD",V:"KeyV",X:"KeyX",Y:"KeyY",Z:"KeyZ"},nb=65,lb=67,sb=86,cb=68,db=90,gb=89;function Rd(e){const{keyCode:t}=e;let a;switch(t){case nb:a=C.A;break;case lb:a=C.C;break;case sb:a=C.V;break;case cb:a=C.D;break;case db:a=C.Z;break;case gb:a=C.Y;break;default:a=e.code}return a}function ub(e){return typeof e.then=="function"}function hb(e,t){return new Y(a=>{a(window.setInterval(e,t))})}var Y=class Xo{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(a=>this.onDone(a),a=>this.onReject(a))}static all(t){return t.length?new Xo(a=>{let o=t.length;const r=new Array(o);t.forEach((i,n)=>{i.then(l=>{r[n]=l,o--,o===0&&a(r)})})}):Xo.resolve()}static resolve(t=null){return new Xo(a=>a(t))}then(t){return new Xo(a=>{this.status===1?a(t(this.resolution)):this.waiters.push(o=>a(t(o)))})}onDone(t){this.status=1,this.resolution=t;for(const a of this.waiters)a(t)}onReject(t){}},Ed=class extends ue{constructor(){super(...arguments),this.beanName="dragAndDrop",this.dragSourceAndParamsList=[],this.dragItem=null,this.dragInitialSourcePointerOffsetX=0,this.dragInitialSourcePointerOffsetY=0,this.lastMouseEvent=null,this.lastDraggingEvent=null,this.dragSource=null,this.dragImageCompPromise=null,this.dragImageComp=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0,this.dropTargets=[],this.externalDropZoneCount=0,this.lastDropTarget=null}addDragSource(e,t=!1){const a={capturePointer:!0,dragSource:e,eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:o=>this.onDragStart(e,o),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push(a),this.beans.dragSvc.addDragSource(a)}setDragImageCompIcon(e,t=!1){const a=this.dragImageComp;a&&(t||this.dragImageLastIcon!==e)&&(this.dragImageLastIcon=e,a.setIcon(e,t))}removeDragSource(e){const{dragSourceAndParamsList:t,beans:a}=this;for(let o=0,r=t.length;o<r;o++)if(t[o].dragSource===e){const i=t[o];a.dragSvc?.removeDragSource(i),t.splice(o,1);break}}destroy(){const{dragSourceAndParamsList:e,dropTargets:t,beans:a}=this,o=a.dragSvc;for(const r of e)o?.removeDragSource(r);e.length=0,t.length=0,this.externalDropZoneCount=0,this.clearDragAndDropProperties(),super.destroy()}nudge(){const e=this.lastMouseEvent;e&&this.onDragging(e,!0)}onDragStart(e,t){this.lastMouseEvent=t,this.dragSource=e,this.dragItem=e.getDragItem();const a=e.eElement.getBoundingClientRect();this.dragInitialSourcePointerOffsetX=t.clientX-a.left,this.dragInitialSourcePointerOffsetY=t.clientY-a.top,e.onDragStarted?.(),this.createAndUpdateDragImageComp(e)}onDragStop(e){const{dragSource:t,lastDropTarget:a}=this;if(t?.onDragStopped?.(),a){const o=this.dropTargetEvent(a,e,!1);a.onDragStop?.(o)}this.clearDragAndDropProperties()}onDragCancel(){const{dragSource:e,lastDropTarget:t,lastMouseEvent:a}=this;if(e?.onDragCancelled?.(),t&&a){const o=this.dropTargetEvent(t,a,!1);t.onDragCancel?.(o)}this.clearDragAndDropProperties()}onDragging(e,t=!1){this.positionDragImageComp(e);const a=this.findCurrentDropTarget(e),{lastDropTarget:o,dragSource:r,dragItem:i}=this;let n=!1;if(a!==o){if(n=!0,o){const l=this.dropTargetEvent(o,e,t);o.onDragLeave?.(l)}if(o!==null&&!a?this.handleExit(r,i):o===null&&a&&this.handleEnter(r,i),a){const l=this.dropTargetEvent(a,e,t);a.onDragEnter?.(l)}this.lastDropTarget=a}else if(a){const l=this.dropTargetEvent(a,e,t);a.onDragging?.(l),l?.changed&&(n=!0)}this.lastMouseEvent=e,n&&this.updateDragImageComp()}clearDragAndDropProperties(){this.removeDragImageComp(this.dragImageComp),this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0,this.lastMouseEvent=null,this.lastDraggingEvent=null,this.lastDropTarget=null,this.dragItem=null,this.dragInitialSourcePointerOffsetX=0,this.dragInitialSourcePointerOffsetY=0,this.dragSource=null}getAllContainersFromDropTarget(e){const t=e.getContainer(),a=e.getSecondaryContainers?.(),o=a?.length;if(!o)return[[t]];const r=new Array(o+1);r[0]=[t];for(let i=0;i<o;++i)r[i+1]=a[i];return r}isMouseOnDropTarget(e,t){const a=this.getAllContainersFromDropTarget(t);let o=!1;const r=(l,s)=>{for(const c of s){const{width:d,height:g,left:u,right:h,top:p,bottom:f}=c.getBoundingClientRect();if(d===0||g===0)return!1;const m=l.clientX>=u&&l.clientX<h,v=l.clientY>=p&&l.clientY<f;if(!m||!v)return!1}return!0};for(const l of a)if(r(e,l)){o=!0;break}const{eElement:i,type:n}=this.dragSource;return t.targetContainsSource&&!t.getContainer().contains(i)?!1:o&&t.isInterestedIn(n,i)}findCurrentDropTarget(e){const t=[],a=this.dropTargets;for(let n=0,l=a.length;n<l;++n){const s=a[n];this.isMouseOnDropTarget(e,s)&&t.push(s)}const o=t.length;if(o===0)return null;if(o===1)return t[0];const i=Ie(this.beans).elementsFromPoint(e.clientX,e.clientY);for(let n=0,l=i.length;n<l;++n){const s=i[n];for(let c=0,d=t.length;c<d;c++){const g=t[c],u=this.getAllContainersFromDropTarget(g);let h=!1;for(let p=0,f=u.length;p<f&&!h;p++){const m=u[p];for(let v=0,w=m.length;v<w;v++)if(m[v]===s){h=!0;break}}if(h)return g}}return null}addDropTarget(e){this.dropTargets.push(e),e.external&&this.externalDropZoneCount++}removeDropTarget(e){const t=e.getContainer(),a=this.dropTargets;let o=0;for(let r=0,i=a.length;r<i;++r){const n=a[r];if(n.getContainer()===t){n.external&&--this.externalDropZoneCount;continue}o!==r&&(a[o]=n),++o}a.length=o}hasExternalDropZones(){return this.externalDropZoneCount>0}findExternalZone(e){const t=this.dropTargets;for(let a=0,o=t.length;a<o;++a){const r=t[a];if(r.external&&r.getContainer()===e)return r}return null}dropTargetEvent(e,t,a){const{dragSource:o,dragItem:r,lastDraggingEvent:i,lastMouseEvent:n,dragInitialSourcePointerOffsetX:l,dragInitialSourcePointerOffsetY:s}=this,c=e.getContainer(),d=c.getBoundingClientRect(),{clientX:g,clientY:u}=t,h=g-(n?.clientX||0),p=u-(n?.clientY||0),f=this.createEvent({event:t,x:g-d.left,y:u-d.top,vDirection:p>0?"down":p<0?"up":null,hDirection:h<0?"left":h>0?"right":null,initialSourcePointerOffsetX:l,initialSourcePointerOffsetY:s,dragSource:o,fromNudge:a,dragItem:r,dropZoneTarget:c,dropTarget:i?.dropTarget??null,changed:!!i?.changed});return this.lastDraggingEvent=f,f}positionDragImageComp(e){const t=this.dragImageComp?.getGui();t&&Sc(t,e,this.beans)}removeDragImageComp(e){this.dragImageComp===e&&(this.dragImageComp=null),e&&(e.getGui()?.remove(),this.destroyBean(e))}createAndUpdateDragImageComp(e){const t=this.createDragImageComp(e)??null;this.dragImageCompPromise=t,t?.then(a=>{const o=this.lastMouseEvent;if(t!==this.dragImageCompPromise||!o||!this.isAlive()){this.destroyBean(a);return}this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0;const r=this.dragImageComp;r!==a&&(this.dragImageComp=a,this.removeDragImageComp(r)),a&&(this.appendDragImageComp(a),this.updateDragImageComp(),this.positionDragImageComp(o))})}appendDragImageComp(e){const t=e.getGui(),a=t.style;a.position="absolute",a.zIndex="9999",this.beans.dragSvc?.hasPointerCapture()&&(a.pointerEvents="none"),this.gos.setInstanceDomData(t),this.beans.environment.applyThemeClasses(t),a.top="20px",a.left="20px";const o=ar(this.beans);o?o.appendChild(t):this.warnNoBody()}updateDragImageComp(){const{dragImageComp:e,dragSource:t,lastDropTarget:a,lastDraggingEvent:o,dragImageLastLabel:r}=this;if(!e)return;this.setDragImageCompIcon(a?.getIconName?.(o)??null);let i=t?.dragItemName;typeof i=="function"&&(i=i(o)),i||(i=""),r!==i&&(this.dragImageLastLabel=i,e.setLabel(i))}};function Fd(e){return typeof e=="object"&&!!e.component}function pb(e){return e?e.prototype&&"getGui"in e.prototype:!1}function Md(e,t,a,o){const{name:r}=a;let i,n,l,s,c,d;if(t){const g=t,u=g[r+"Selector"],h=u?u(o):null,p=f=>{typeof f=="string"?i=f:f!=null&&f!==!0&&(e.isFrameworkComponent(f)?l=f:n=f)};h?(p(h.component),s=h.params,c=h.popup,d=h.popupPosition):p(g[r])}return{compName:i,jsComp:n,fwComp:l,paramsFromSelector:s,popupFromSelector:c,popupPositionFromSelector:d}}var fb=class extends y{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,a,o=!1){return this.getCompDetails(this.gridOptions,e,t,a,o)}getCompDetails(e,t,a,o,r=!1){const{name:i,cellRenderer:n}=t;let{compName:l,jsComp:s,fwComp:c,paramsFromSelector:d,popupFromSelector:g,popupPositionFromSelector:u}=Md(this.beans.frameworkOverrides,e,t,o),h,p;const f=b=>{const k=this.registry.getUserComponent(i,b);k&&(s=k.componentFromFramework?void 0:k.component,c=k.componentFromFramework?k.component:void 0,h=k.params,p=k.processParams)};if(l!=null&&f(l),s==null&&c==null&&a!=null&&f(a),s&&n&&!pb(s)&&(s=this.agCompUtils?.adaptFunction(t,s)),!s&&!c){const{validation:b}=this.beans;r&&(l!==a||!a)?l?b?.isProvidedUserComp(l)||q(50,{compName:l}):a?b||q(260,{...this.gos.getModuleErrorParams(),propName:i,compName:a}):q(216,{name:i}):a&&!b&&q(146,{comp:a});return}const m=this.mergeParams(e,t,o,d,h,p),v=s==null,w=s??c;return{componentFromFramework:v,componentClass:w,params:m,type:t,popupFromSelector:g,popupPositionFromSelector:u,newAgStackInstance:()=>this.newAgStackInstance(w,v,m,t)}}newAgStackInstance(e,t,a,o){const r=!t;let i;r?i=new e:i=this.frameworkCompWrapper.wrap(e,o.mandatoryMethods,o.optionalMethods,o),this.createBean(i);const n=i.init?.(a);return n==null?Y.resolve(i):n.then(()=>i)}mergeParams(e,t,a,o=null,r,i){const n={...a,...r},s=e?.[t.name+"Params"];if(typeof s=="function"){const c=s(a);he(n,c)}else typeof s=="object"&&he(n,s);return he(n,o),i?i(n):n}},mb={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},vb={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},bb={name:"headerComponent",optionalMethods:["refresh"]},wb={name:"innerHeaderComponent"},Cb={name:"innerHeaderGroupComponent"},yb={name:"headerGroupComponent"},kb={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},Sb={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},xb={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},Rb={name:"loadingCellRenderer",cellRenderer:!0},Eb={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},Fb={name:"tooltipComponent"},ln={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},Mb={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},zb={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},Db={name:"loadingCellRenderer",cellRenderer:!0},Ab={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},Pb={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function Ib(e,t){return e.getCompDetailsFromGridOptions(vb,"agDragAndDropImage",t,!0)}function Tb(e,t,a){return e.getCompDetails(t,kb,void 0,a)}function Lb(e,t,a){return e.getCompDetails(t,bb,"agColumnHeader",a)}function Bb(e,t,a){return e.getCompDetails(t,wb,void 0,a)}function Ob(e,t){const a=t.columnGroup.getColGroupDef();return e.getCompDetails(a,yb,"agColumnGroupHeader",t)}function Nb(e,t,a){return e.getCompDetails(t,Cb,void 0,a)}function Hb(e,t){return e.getCompDetailsFromGridOptions(zb,void 0,t,!0)}function Gb(e,t){return e.getCompDetailsFromGridOptions(Db,"agLoadingCellRenderer",t,!0)}function Vb(e,t){return e.getCompDetailsFromGridOptions(Ab,"agGroupRowRenderer",t,!0)}function qb(e,t){return e.getCompDetailsFromGridOptions(Pb,"agDetailCellRenderer",t,!0)}function sn(e,t,a){return e.getCompDetails(t,Sb,void 0,a)}function Wb(e,t,a){return e.getCompDetails(t,xb,void 0,a)}function zd(e,t,a){return e.getCompDetails(t,Rb,"agSkeletonCellRenderer",a,!0)}function Dd(e,t,a){return e.getCompDetails(t,Eb,"agCellEditor",a,!0)}function Ad(e,t,a,o){const r=t.filter;return Fd(r)&&(t={filter:r.component,filterParams:t.filterParams}),e.getCompDetails(t,ln,o,a,!0)}function Ub(e,t,a){return e.getCompDetails(t,mb,"agDateInput",a,!0)}function jb(e,t){return e.getCompDetails(t.colDef,Fb,"agTooltipComponent",t,!0)}function Pd(e,t,a,o){return e.getCompDetails(t,Mb,o,a)}function Id(e,t){return Md(e,t,ln)}function cn(e,t,a){return e.mergeParams(t,ln,a)}var Td=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(Td||{}),Kb=class extends Ed{createEvent(e){return I(this.gos,e)}createDragImageComp(e){const{gos:t,beans:a}=this;return Ib(a.userCompFactory,I(t,{dragSource:e}))?.newAgStackInstance()}handleEnter(e,t){e?.onGridEnter?.(t)}handleExit(e,t){e?.onGridExit?.(t)}warnNoBody(){x(54)}isDropZoneWithinThisGrid(e){return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(e.dropZoneTarget)}registerGridDropTarget(e,t){const a={getContainer:e,isInterestedIn:o=>o===1||o===0,getIconName:()=>"notAllowed"};this.addDropTarget(a),t.addDestroyFunc(()=>this.removeDropTarget(a))}};function dn(e){return!!e.operator}var Ld="ag-resizer-wrapper",Ft=(e,t)=>({tag:"div",ref:`${e}Resizer`,cls:`ag-resizer ag-resizer-${t}`}),_b={tag:"div",cls:Ld,children:[Ft("eTopLeft","topLeft"),Ft("eTop","top"),Ft("eTopRight","topRight"),Ft("eRight","right"),Ft("eBottomRight","bottomRight"),Ft("eBottom","bottom"),Ft("eBottomLeft","bottomLeft"),Ft("eLeft","left")]},Bd=class extends ue{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config={popup:!1,...t}}wireBeans(e){this.popupSvc=e.popupSvc,this.dragSvc=e.dragSvc}center(e){const{clientHeight:t,clientWidth:a}=this.offsetParent,o=a/2-this.getWidth()/2,r=t/2-this.getHeight()/2;this.offsetElement(o,r,e)}initialisePosition(e){if(this.positioned)return;const{centered:t,forcePopupParentAsOffsetParent:a,minWidth:o,width:r,minHeight:i,height:n,x:l,y:s}=this.config;this.offsetParent||this.setOffsetParent();let c=0,d=0;const g=Me(this.element);if(g){const u=this.findBoundaryElement(),h=window.getComputedStyle(u);if(h.minWidth!=null){const p=u.offsetWidth-this.element.offsetWidth;d=Number.parseInt(h.minWidth,10)-p}if(h.minHeight!=null){const p=u.offsetHeight-this.element.offsetHeight;c=Number.parseInt(h.minHeight,10)-p}}if(this.minHeight=i||c,this.minWidth=o||d,r&&this.setWidth(r),n&&this.setHeight(n),(!r||!n)&&this.refreshSize(),t)this.center(e);else if(l||s)this.offsetElement(l,s,e);else if(g&&a){let u=this.boundaryEl,h=!0;if(u||(u=this.findBoundaryElement(),h=!1),u){const p=Number.parseFloat(u.style.top),f=Number.parseFloat(u.style.left);h?this.offsetElement(Number.isNaN(f)?0:f,Number.isNaN(p)?0:p,e):this.setPosition(f,p)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const a=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragSvc?.addDragSource(a),this.moveElementDragListener=a):(this.dragSvc?.removeDragSource(a),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),typeof e=="boolean"){if(e===!1)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}for(const t of Object.keys(e)){const a=!!e[t],o=this.getResizerElement(t),r={dragStartPixels:0,eElement:o,onDragStart:i=>this.onResizeStart(i,t),onDragging:this.onResize.bind(this),onDragStop:i=>this.onResizeEnd(i,t)};(a||!this.isAlive()&&!a)&&(a?(this.dragSvc?.addDragSource(r),this.resizeListeners.push(r),o.style.pointerEvents="all"):o.style.pointerEvents="none",this.resizable[t]=a)}}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;t!==-1&&(this.element.style.width=`${t}px`),e!==-1&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,a=this.element;let o=!1;if(typeof e=="string"&&e.includes("%"))ao(a,e),e=Ti(a),o=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const r=this.getAvailableHeight();r&&e>r&&(e=r)}this.getHeight()!==e&&(o?(a.style.maxHeight="unset",a.style.minHeight="unset"):t?ao(a,e):(a.style.height=`${e}px`,a.style.flex="0 0 auto",this.lastSize.height=typeof e=="number"?e:Number.parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:a}=this.offsetParent;if(!a)return null;const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),i=e?this.position.y:o.top,n=e?0:r.top;let l=0;if(t){const c=this.element.parentElement;if(c){const{bottom:d}=c.getBoundingClientRect();l=d-o.bottom}}return a+n-i-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:a}=this.config;let o=!1;if(typeof e=="string"&&e.includes("%"))He(t,e),e=$a(t),o=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:r}=this.offsetParent,i=a?this.position.x:this.element.getBoundingClientRect().left;r&&e+i>r&&(e=r-i)}this.getWidth()!==e&&(o?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?He(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width=typeof e=="number"?e:Number.parseFloat(e)))}offsetElement(e=0,t=0,a){const{forcePopupParentAsOffsetParent:o}=this.config,r=o?this.boundaryEl:this.element;r&&(this.popupSvc?.positionPopup({ePopup:r,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t}),postProcessCallback:a}),this.setPosition(Number.parseFloat(r.style.left),Number.parseFloat(r.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const a=this.getAvailableHeight();this.element.style.setProperty("max-height",`${a}px`)};e&&this.popupSvc?(this.resizeObserverSubscriber?.(),this.resizeObserverSubscriber=it(this.beans,this.popupSvc?.getPopupParent(),t)):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:a,isTop:o,anywhereWithin:r,topBuffer:i}=e,n=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y,s=this.shouldSkipX(t,!!a,!!r,n)?0:n,c=this.shouldSkipY(t,!!o,i,l)?0:l;return{movementX:s,movementY:c}}shouldSkipX(e,t,a,o){const r=this.element.getBoundingClientRect(),i=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:r.left;let s=l<=0&&i.left>=e.clientX||i.right<=e.clientX&&i.right<=n.right;return s?!0:(t?s=o<0&&e.clientX>l+i.left||o>0&&e.clientX<l+i.left:a?s=o<0&&e.clientX>n.right||o>0&&e.clientX<l+i.left:s=o<0&&e.clientX>n.right||o>0&&e.clientX<n.right,s)}shouldSkipY(e,t,a=0,o){const r=this.element.getBoundingClientRect(),i=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:r.top;let s=l<=0&&i.top>=e.clientY||i.bottom<=e.clientY&&i.bottom<=n.bottom;return s?!0:(t?s=o<0&&e.clientY>l+i.top+a||o>0&&e.clientY<l+i.top:s=o<0&&e.clientY>n.bottom||o>0&&e.clientY<n.bottom,s)}createResizeMap(){const e=t=>({element:this.element.querySelector(`[data-ref=${t}Resizer]`)});this.resizerMap={topLeft:e("eTopLeft"),top:e("eTop"),topRight:e("eTopRight"),right:e("eRight"),bottomRight:e("eBottomRight"),bottom:e("eBottom"),bottomLeft:e("eBottomLeft"),left:e("eLeft")}}addResizers(){if(this.resizersAdded)return;const e=this.element;e&&(e.appendChild(yt(_b)),this.createResizeMap(),this.resizersAdded=!0)}removeResizers(){this.resizerMap=void 0,this.element.querySelector(`.${Ld}`)?.remove(),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:a,forcePopupParentAsOffsetParent:o}=this.config;!a&&!o&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const t=this.element.parentElement;return t?Array.prototype.slice.call(t.children).filter(a=>!a.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,a=0;for(const o of e){const r=!!o.style.flex&&o.style.flex!=="0 0 auto";if(o===this.element)continue;let i=this.minHeight||0,n=this.minWidth||0;if(r){const l=window.getComputedStyle(o);l.minHeight&&(i=Number.parseInt(l.minHeight,10)),l.minWidth&&(n=Number.parseInt(l.minWidth,10))}else i=o.offsetHeight,n=o.offsetWidth;t+=i,a+=n}return{height:t,width:a}}applySizeToSiblings(e){let t=null;const a=this.getSiblings();if(a){for(let o=0;o<a.length;o++){const r=a[o];r!==t&&(e?r.style.height=`${r.offsetHeight}px`:r.style.width=`${r.offsetWidth}px`,r.style.flex="0 0 auto",r===this.element&&(t=a[o+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:a}=this.config,{isTop:o,isRight:r,isBottom:i,isLeft:n}=this.currentResizer,l=r||n,s=i||o,{movementX:c,movementY:d}=this.calculateMouseMovement({e,isLeft:n,isTop:o}),g=this.position.x,u=this.position.y;let h=0,p=0;if(l&&c){const f=n?-1:1,m=this.getWidth(),v=m+c*f;let w=!1;n&&(h=m-v,(g+h<=0||v<=this.minWidth)&&(w=!0,h=0)),w||this.setWidth(v)}if(s&&d){const f=o?-1:1,m=this.getHeight(),v=m+d*f;let w=!1;o?(p=m-v,(u+p<=0||v<=this.minHeight)&&(w=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&m<v&&this.getMinSizeOfSiblings().height+v>this.element.parentElement.offsetHeight&&(w=!0),w||this.setHeight(v)}this.updateDragStartPosition(e.clientX,e.clientY),((t||a)&&h||p)&&this.offsetElement(g+h,u+p)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:a}=this.position;let o;this.config.calculateTopBuffer&&(o=this.config.calculateTopBuffer());const{movementX:r,movementY:i}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:o});this.offsetElement(t+r,a+i),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent&&this.popupSvc?this.offsetParent=this.popupSvc.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragSvc?.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragSvc?.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},Od=class extends Bd{},E=null;function gn(e){return typeof e?.getGui=="function"}var un=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){if(!e)return;if(e.includes(" ")){const o=(e||"").split(" ");if(o.length>1){for(const r of o)this.toggleCss(r,t);return}}this.cssClassStates[e]!==t&&e.length&&(this.getGui()?.classList.toggle(e,t),this.cssClassStates[e]=t)}},Qb=0,ra=class extends ue{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=Qb++,this.cssManager=new un(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(a=>[a.selector,a])),e&&this.setTemplate(e)}preConstruct(){this.wireTemplate(this.getGui()),this.addGlobalCss()}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute(wc):null}applyElementsToComponent(e,t,a,o=null){if(t===void 0&&(t=this.getDataRefAttribute(e)),t){const r=this[t];if(r===E)this[t]=o??e;else{const i=a?.[t];if(!this.suppressDataRefValidation&&!i)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${r}`)}}}createChildComponentsFromTags(e,t){const a=[];for(const o of e.childNodes??[])a.push(o);for(const o of a){if(!(o instanceof HTMLElement))continue;const r=this.createComponentFromElement(o,i=>{const n=i.getGui();if(n)for(const l of o.attributes??[])n.setAttribute(l.name,l.value)},t);if(r){if(r.addItems&&o.children.length){this.createChildComponentsFromTags(o,t);const i=Array.prototype.slice.call(o.children);r.addItems(i)}this.swapComponentForNode(r,e,o)}else o.childNodes&&this.createChildComponentsFromTags(o,t)}}createComponentFromElement(e,t,a){const o=e.nodeName,r=this.getDataRefAttribute(e),i=o.indexOf("AG-")===0,n=i?this.componentSelectors.get(o):null;let l=null;if(n){const s=a&&r?a[r]:void 0;l=new n.component(s),l.setParentComponent(this),this.createBean(l,null,t)}else if(i)throw new Error(`selector: ${o}`);return this.applyElementsToComponent(e,r,a,l),l}swapComponentForNode(e,t,a){const o=e.getGui();t.replaceChild(o,a),t.insertBefore(document.createComment(a.nodeName),o),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e,t){const a=t??this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const o of e)o.setAttribute("tabindex",a.toString())}setTemplate(e,t,a){let o;typeof e=="string"||e==null?o=cr(e):o=yt(e),this.setTemplateFromElement(o,t,a)}setTemplateFromElement(e,t,a,o=!1){if(this.eGui=e,this.suppressDataRefValidation=o,t)for(let r=0;r<t.length;r++){const i=t[r];this.componentSelectors.set(i.selector,i)}this.wireTemplate(e,a)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let a=t;return e==null?null:(a||(a=this.eGui),gr(e)?{element:e,parent:a}:{element:e.getGui(),parent:a})}prependChild(e,t){const{element:a,parent:o}=this.getContainerAndElement(e,t)||{};!a||!o||o.prepend(a)}appendChild(e,t){const{element:a,parent:o}=this.getContainerAndElement(e,t)||{};!a||!o||o.appendChild(a)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:a}=t;uc(this.eGui,e,{skipAriaHidden:a})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:a}=t;U(this.eGui,e,{skipAriaHidden:a});const o={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(o)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),super.destroy()}addGuiEventListener(e,t,a){this.eGui.addEventListener(e,t,a),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCss(e){this.cssManager.toggleCss(e,!0)}removeCss(e){this.cssManager.toggleCss(e,!1)}toggleCss(e,t){this.cssManager.toggleCss(e,t)}registerCSS(e){this.css===Nd?(this.css=[e],this.addGlobalCss()):(this.css||(this.css=[]),this.css.push(e))}addGlobalCss(){if(Array.isArray(this.css)){const e="component-"+Object.getPrototypeOf(this)?.constructor?.name;for(const t of this.css??[])this.beans.environment.addGlobalCSS(t,e)}this.css=Nd}},Nd=Symbol(),V=class extends ra{},hn,pn,fn,mn,vn,bn,wn;function mt(){return hn===void 0&&(hn=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),hn}function ia(){return pn===void 0&&(pn=/(firefox)/i.test(navigator.userAgent)),pn}function Hd(){return fn===void 0&&(fn=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),fn}function Mt(){return mn===void 0&&(mn=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),mn}function Cn(e){if(!e)return null;const t=e.tabIndex,a=e.getAttribute("tabIndex");return t===-1&&(a===null||a===""&&!ia())?null:t.toString()}function Yb(){if(wn!==void 0)return wn;if(!document.body)return-1;let e=1e6;const t=ia()?6e6:1e9,a=document.createElement("div");for(document.body.appendChild(a);;){const o=e*2;if(a.style.height=o+"px",o>t||a.clientHeight!==o)break;e=o}return a.remove(),wn=e,e}function yn(){return bn==null&&Gd(),bn}function Gd(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let a=t.offsetWidth-t.clientWidth;a===0&&t.clientWidth===0&&(a=null),t.parentNode&&t.remove(),a!=null&&(bn=a,vn=a===0)}function Vd(){return vn==null&&Gd(),vn}var kn=!1,Fr=0;function Zb(e){Fr>0||(e.addEventListener("keydown",Mr),e.addEventListener("mousedown",Mr))}function Jb(e){Fr>0||(e.removeEventListener("keydown",Mr),e.removeEventListener("mousedown",Mr))}function Mr(e){const t=kn,a=e.type==="keydown";a&&(e.ctrlKey||e.metaKey||e.altKey)||t!==a&&(kn=a)}function Xb(e){const t=oe(e);return Zb(t),Fr++,()=>{Fr--,Jb(t)}}function Sn(){return kn}function zt(e,t,a=!1){const o=ov;let r=gc;t&&(r+=", "+t),a&&(r+=', [tabindex="-1"]');const i=Array.prototype.slice.apply(e.querySelectorAll(o)).filter(s=>Me(s)),n=Array.prototype.slice.apply(e.querySelectorAll(r));return n.length?((s,c)=>s.filter(d=>c.indexOf(d)===-1))(i,n):i}function Dt(e,t=!1,a=!1,o=!1){const r=zt(e,o?".ag-tab-guard":null,a),i=t?j(r):r[0];return i?(i.focus({preventScroll:!0}),!0):!1}function At(e,t,a,o){const r=zt(t,a?':not([tabindex="-1"])':null),i=Q(e);let n;a?n=r.findIndex(s=>s.contains(i)):n=r.indexOf(i);const l=n+(o?-1:1);return l<0||l>=r.length?null:r[l]}function xn(e,t=5){let a=0;for(;e&&Cn(e)===null&&++a<=t;)e=e.parentElement;return Cn(e)===null?null:e}var qd="ag-focus-managed",Wd=class extends ue{constructor(e,t={isStopPropagation:()=>!1,stopPropagation:()=>{}},a={}){super(),this.eFocusable=e,this.stopPropagationCallbacks=t,this.callbacks=a,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:o=>{if(o.defaultPrevented)return;const r=At(this.beans,this.eFocusable,!1,o.shiftKey);r&&(r.focus(),o.preventDefault())},...a}}postConstruct(){const{eFocusable:e,callbacks:{onFocusIn:t,onFocusOut:a}}=this;e.classList.add(qd),this.addKeyDownListeners(e),t&&this.addManagedElementListeners(e,{focusin:t}),a&&this.addManagedElementListeners(e,{focusout:a})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:t=>{if(t.defaultPrevented||this.stopPropagationCallbacks.isStopPropagation(t))return;const{callbacks:a}=this;if(a.shouldStopEventPropagation(t)){this.stopPropagationCallbacks.stopPropagation(t);return}t.key===C.TAB?a.onTabKeyDown(t):a.handleKeyDown&&a.handleKeyDown(t)}})}},Ud="__ag_Grid_Stop_Propagation";function Pt(e){e[Ud]=!0}function Je(e){return e[Ud]===!0}var vo={isStopPropagation:Je,stopPropagation:Pt},Ta=class extends Wd{constructor(e,t){super(e,vo,t)}},$b={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",bigintFilter:"BigInt Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd",filterSummaryInactive:"is (All)",filterSummaryContains:"contains",filterSummaryNotContains:"does not contain",filterSummaryTextEquals:"equals",filterSummaryTextNotEqual:"does not equal",filterSummaryStartsWith:"begins with",filterSummaryEndsWith:"ends with",filterSummaryBlank:"is blank",filterSummaryNotBlank:"is not blank",filterSummaryEquals:"=",filterSummaryNotEqual:"!=",filterSummaryGreaterThan:">",filterSummaryGreaterThanOrEqual:">=",filterSummaryLessThan:"<",filterSummaryLessThanOrEqual:"<=",filterSummaryInRange:"between",yesterday:"Yesterday",today:"Today",tomorrow:"Tomorrow",last7Days:"Last 7 Days",lastWeek:"Last Week",thisWeek:"This Week",nextWeek:"Next Week",last30Days:"Last 30 Days",lastMonth:"Last Month",thisMonth:"This Month",nextMonth:"Next Month",last90Days:"Last 90 Days",lastQuarter:"Last Quarter",thisQuarter:"This Quarter",nextQuarter:"Next Quarter",lastYear:"Last Year",thisYear:"This Year",yearToDate:"Year To Date",nextYear:"Next Year",last6Months:"Last 6 Months",last12Months:"Last 12 Months",last24Months:"Last 24 Months",filterSummaryInRangeValues:e=>`(${e[0]}, ${e[1]})`,filterSummaryTextQuote:e=>`"${e[0]}"`,minDateValidation:e=>`Date must be after ${e[0]}`,maxDateValidation:e=>`Date must be before ${e[0]}`,strictMinValueValidation:e=>`Must be greater than ${e[0]}`,strictMaxValueValidation:e=>`Must be less than ${e[0]}`};function Te(e,t,a){return xc(e,$b,t,a)}function Rn(e,t){const{debounceMs:a}=e;return bo(e)?(a!=null&&x(71),0):a??t}function bo(e){return(e.buttons?.indexOf("apply")??-1)>=0}function jd(e,t,a,o){let r=Te(e,a);if(typeof t=="function"){const i=Te(e,o);r=t({filterOptionKey:o,filterOption:i,placeholder:r})}else typeof t=="string"&&(r=t);return r}var Kd=class extends V{constructor(e,t){super(),this.filterNameKey=e,this.cssIdentifier=t,this.applyActive=!1,this.debouncePending=!1,this.defaultDebounceMs=0}postConstruct(){const e={tag:"div",cls:`ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,children:[this.createBodyTemplate()]};this.setTemplate(e,this.getAgComponents()),this.createManagedBean(new Ta(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=this.createBean(new Od(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}))}handleKeyDown(e){}init(e){const t=e;this.setParams(t),this.setModelIntoUi(t.state.model,!0).then(()=>this.updateUiVisibility())}areStatesEqual(e,t){return e===t}refresh(e){const t=e,a=this.params;this.params=t;const{source:o,state:r,additionalEventAttributes:i}=t;o==="colDef"&&this.updateParams(t,a);const n=this.state;this.state=r;const l=i?.fromAction;return(l&&l!=="apply"||r.model!==n.model||!this.areStatesEqual(r.state,n.state))&&this.setModelIntoUi(r.model),!0}setParams(e){this.params=e,this.state=e.state,this.commonUpdateParams(e)}updateParams(e,t){this.commonUpdateParams(e,t)}commonUpdateParams(e,t){this.applyActive=bo(e),this.setupApplyDebounced()}doesFilterPass(e){x(283);const{getHandler:t,model:a,column:o}=this.params;return t().doesFilterPass({...e,model:a,handlerParams:this.beans.colFilter.getHandlerParams(o)})}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return x(284),this.params.model!=null}setupApplyDebounced(){const e=Rn(this.params,this.defaultDebounceMs),t=te(this,this.checkApplyDebounce.bind(this),e);this.applyDebounced=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.doApplyModel())}getModel(){return x(285),this.params.model}setModel(e){x(286);const{beans:t,params:a}=this;return t.colFilter.setModelForColumnLegacy(a.column,e)}applyModel(e="api"){return this.doApplyModel()}canApply(e){return!0}doApplyModel(e){const{params:t,state:{valid:a=!0,model:o}}=this;if(!a)return!1;const r=!this.areModelsEqual(t.model,o);return r&&t.onAction("apply",e),r}onNewRowsLoaded(){}onUiChanged(e,t=!1){this.updateUiVisibility();const a=this.getModelFromUi(),o={model:a,state:this.getState(),valid:this.canApply(a)};this.state=o;const{params:r,gos:i,eventSvc:n,applyActive:l}=this;r.onStateChange(o),r.onUiChange(this.getUiChangeEventParams()),i.get("enableFilterHandlers")||n.dispatchEvent({type:"filterModified",column:r.column,filterInstance:this}),o.valid&&(e??(e=l?void 0:"debounce"),e==="immediately"?this.doApplyModel({afterFloatingFilter:t,afterDataChange:!1}):e==="debounce"&&this.applyDebounced())}getState(){}getUiChangeEventParams(){}afterGuiAttached(e){this.lastContainerType=e?.container,this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){const{positionableFeature:t,gos:a}=this;if(!t)return;const o=e==="floatingFilter"||e==="columnFilter";o?(t.restoreLastSize(),t.setResizable(a.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(t.removeSizeFromEl(),t.setResizable(!1)),t.constrainSizeToAvailableHeight(o)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}destroy(){this.positionableFeature=this.destroyBean(this.positionableFeature),super.destroy()}translate(e,t){return Te(this,e,t)}getPositionableElement(){return this.getGui()}areModelsEqual(e,t){return e===t||e==null&&t==null?!0:e==null||t==null?!1:this.areNonNullModelsEqual(e,t)}},ew=["aggregation","filter","sort","pivot","columnVisibility","columnSizing","rowGroup"],zr=class extends ra{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e?.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},wo=class extends zr{constructor(){super(...arguments),this.errorMessages=null}init(e){this.params=e,this.initialiseEditor(e),this.eEditor.onValueChange(()=>e.validate())}destroy(){this.eEditor.destroy(),this.errorMessages=null,super.destroy()}};function Ve(e){const t=e.rowModel;return t.getType()==="clientSide"?t:void 0}function Dr(e){const t=e.rowModel;return t.getType()==="infinite"?t:void 0}function _d(e){const t=e.rowModel;return t.getType()==="serverSide"?t:void 0}function tw(e){const t=e.rowModel;return t.getType()==="viewport"?t:void 0}var En="row-group-",Ar="t-",Pr="b-",aw=0,vt=class{constructor(e){this.id=void 0,this.destroyed=!1,this._groupData=void 0,this.master=!1,this.detail=void 0,this.rowIndex=null,this.field=null,this.rowGroupColumn=null,this.key=null,this.sourceRowIndex=-1,this._leafs=void 0,this.childrenAfterGroup=null,this.childrenAfterFilter=null,this.childrenAfterAggFilter=null,this.childrenAfterSort=null,this.allChildrenCount=null,this.childrenMapped=null,this.treeParent=null,this.treeNodeFlags=0,this._expanded=void 0,this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=aw++,this.alreadyRendered=!1,this.formulaRowIndex=null,this.hovered=!1,this.__selected=!1,this.beans=e}get groupData(){const e=this._groupData;return e!==void 0?e:this.footer?this.sibling?.groupData:this.beans.groupStage?.loadGroupData(this)??null}set groupData(e){this._groupData=e}get primaryRow(){let e=this.footer&&this.sibling||this;if(e.rowPinned){const t=e.pinnedSibling;t&&(e=t,e.footer&&(e=e.sibling??e))}return e}get allLeafChildren(){const e=this._leafs;return e===void 0?this.beans.groupStage?.loadLeafs?.(this)??null:e}set allLeafChildren(e){this._leafs=e}get expanded(){const e=this.beans.expansionSvc;return e?e.isExpanded(this):this.level===-1?!0:!!this._expanded}set expanded(e){this._expanded=e}setData(e){this.setDataCommon(e,"set")}updateData(e){this.setDataCommon(e,"update")}_updateDataNoSibling(e){this.setDataCommon(e,"updateNoSibling")}setDataCommon(e,t){const{valueCache:a,eventSvc:o}=this.beans,r=this.data,i=t!=="set";this.data=e,a?.onDataChanged(),this.updateDataOnDetailNode(),this.resetQuickFilterAggregateText();const n=this.createDataChangedEvent(e,r,i);if(this.__localEventService?.dispatchEvent(n),t!=="updateNoSibling"){const s=this.sibling;if(s){s.data=e;const c=s.createDataChangedEvent(e,r,i);s.__localEventService?.dispatchEvent(c)}}o.dispatchEvent({type:"rowNodeDataChanged",node:this});const l=this.pinnedSibling;l&&(l.data=e,l.__localEventService?.dispatchEvent(l.createDataChangedEvent(e,r,i)),o.dispatchEvent({type:"rowNodeDataChanged",node:l}))}updateDataOnDetailNode(){const e=this.detailNode;e&&(e.data=this.data)}createDataChangedEvent(e,t,a){return{type:"dataChanged",node:this,oldData:t,newData:e,update:a}}getRowIndexString(){return this.rowIndex==null?(q(13),null):this.rowPinned==="top"?Ar+this.rowIndex:this.rowPinned==="bottom"?Pr+this.rowIndex:this.rowIndex.toString()}setDataAndId(e,t){const{selectionSvc:a}=this.beans,o=a?.createDaemonNode?.(this),r=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),a&&(a.updateRowSelectable(this),a.syncInRowNode(this,o));const i=this.createDataChangedEvent(e,r,!1);this.__localEventService?.dispatchEvent(i)}setId(e){const t=ta(this.beans.gos);if(t)if(this.data){const a=this.parent?.getRoute()??[];this.id=t({data:this.data,parentKeys:a.length>0?a:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(En)&&q(14,{groupPrefix:En})}else this.id=void 0;else this.id=e}setRowTop(e){if(this.oldRowTop=this.rowTop,this.rowTop===e)return;this.rowTop=e,this.dispatchRowEvent("topChanged");const t=e!==null;this.displayed!==t&&(this.displayed=t,this.dispatchRowEvent("displayedChanged"))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(e){this.hovered=e}isHovered(){return this.hovered}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.dispatchRowEvent("heightChanged")}setExpanded(e,t,a){this.beans.expansionSvc?.setExpanded(this,e,t,a)}setDataValue(e,t,a){const{colModel:o,valueSvc:r,gos:i,editSvc:n}=this.beans;if(e==null)return!1;let l=o.getColOrColDefCol(e);if(!l)return!1;const s=l.colDef.pivotValueColumn;!this.group&&!this.rowPinned&&s&&(l=s);const c=r.getValueForDisplay({column:l,node:this,from:"data"}).value;if(i.get("readOnlyEdit")){const{beans:{eventSvc:g},data:u,rowIndex:h,rowPinned:p}=this;return g.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:h,rowPinned:p,column:l,colDef:l.colDef,data:u,node:this,oldValue:c,newValue:t,value:t,source:a}),!1}if(a!=="data"&&n&&!n.committing){const g=n.setDataValue({rowNode:this,column:l},t,a);if(g!=null)return g}const d=r.setValue(this,l,t,a);return this.dispatchCellChangedEvent(l,t,c),d&&this.pinnedSibling?.dispatchCellChangedEvent(l,t,c),d}getDataValue(e,t){const a=this.beans,o=a.colModel.getColOrColDefCol(e);if(!o)return;let r;if(t==="data"||!t){if(r=a.valueSvc.getValue(o,this,"data",!1),r==null)return r}else{const i=t==="data-raw",n=i||t==="value"?"data":t;if(r=a.valueSvc.getValue(o,this,n,i),i||r==null)return r;if(typeof r=="object"&&o.aggFunc){if(typeof r.toNumber=="function")return r.toNumber();if("value"in r)return r.value}if(t!=="value")return r}if(o.colDef.allowFormula){const i=a.formula;i?.isFormula(r)&&o.isAllowFormula()&&(r=i.resolveValue(o,this))}return r}updateHasChildren(){let e=this.group&&!this.footer||!!this.childrenAfterGroup?.length;const{rowChildrenSvc:t}=this.beans;t&&(e=t.getHasChildrenValue(this)),e!==this.__hasChildren&&(this.__hasChildren=!!e,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}dispatchCellChangedEvent(e,t,a){const o={type:"cellChanged",node:this,column:e,newValue:t,oldValue:a};this.__localEventService?.dispatchEvent(o)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.beans.expansionSvc?.isExpandable(this)??!1}isSelected(){if(this.footer)return this.sibling.isSelected();const e=this.rowPinned&&this.pinnedSibling;return e?e.isSelected():this.__selected}depthFirstSearch(e){const t=this.childrenAfterGroup;if(t)for(let a=0,o=t.length;a<o;++a)t[a].depthFirstSearch(e);e(this)}getAggregatedChildren(e,t){const a=this.beans;return a.aggChildrenSvc?.getAggregatedChildren(this,a.colModel.getCol(e),t)??[]}dispatchRowEvent(e){this.__localEventService?.dispatchEvent({type:e,node:this})}setSelected(e,t=!1,a="api"){this.beans.selectionSvc?.setNodesSelected({nodes:[this],newValue:e,clearSelection:t,source:a})}isRowPinned(){return!!this.rowPinned}__addEventListener(e,t){(this.__localEventService??(this.__localEventService=new Ct)).addEventListener(e,t)}__removeEventListener(e,t){this.removeLocalListener(e,t)}addEventListener(e,t){this.beans.validation?.checkRowEvents(e);const a=this.__localEventService??(this.__localEventService=new Ct);this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,a);const o=this.frameworkEventListenerService?.wrap(e,t)??t;a.addEventListener(e,o)}removeEventListener(e,t){const a=this.frameworkEventListenerService?.unwrap(e,t)??t;this.removeLocalListener(e,a)}removeLocalListener(e,t){const a=this.__localEventService;a&&(a.removeEventListener(e,t),a.noRegisteredListenersExist()&&(this.__localEventService=null))}isFullWidthCell(){if(x(61),this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return e?e({rowNode:this}):!1}getRoute(){if(this.level===-1)return[];if(this.key==null)return;const e=[];let t=this;for(;t?.key!=null;)e.push(t.key),t=t.parent;return e.reverse()}setRowIndex(e){this.rowIndex!==e&&(this.rowIndex=e,this.dispatchRowEvent("rowIndexChanged"))}setAllChildrenCount(e){this.allChildrenCount!==e&&(this.allChildrenCount=e,this.dispatchRowEvent("allChildrenCountChanged"))}setUiLevel(e){this.uiLevel!==e&&(this.uiLevel=e,this.dispatchRowEvent("uiLevelChanged"))}getFirstChild(){const e=this.childStore;return e?e.getFirstNode():this.childrenAfterSort?.[0]??null}_destroy(e){if(this.destroyed)return!1;this.destroyed=!0;const t=this.pinnedSibling;if(t?.rowPinned&&this.beans.pinnedRowModel?.pinRow(t,null),e===!0?this.clearRowTopAndRowIndex():e===!1?(this.setRowTop(null),this.setRowIndex(null)):(this.oldRowTop=null,this.rowTop=null,this.rowIndex=null,this.displayed=!1),!this.footer){const a=this.detailNode;a&&a._destroy(e);const o=this.sibling;o&&o._destroy(e)}return!0}};function Qd(e,t,a){return I(t,{type:a,node:e,data:e.data,rowIndex:e.rowIndex,rowPinned:e.rowPinned})}var ow=new Set(["__autoHeights","__checkAutoHeightsDebounced","__localEventService","__objectId","_groupData","_leafs","childStore","destroyed","groupValue","oldRowTop","pinnedSibling","rowPinned","sticky","treeNodeFlags","treeParent"]),Yd=(e,t)=>{const a=new vt(t);for(const o of Object.keys(e))ow.has(o)||(a[o]=e[o]);return a.oldRowTop=null,a},Ir=(e,t,a)=>{if(!a)return;let o=a.rowIndex;if(o==null)return;o+=t;const r=e.getRowCount();for(;o>=0&&o<r;){const i=e.getRow(o);if(!i||!i.footer&&!i.detail)return i;o+=t}},Zd=class{constructor(e,t){this.beans=e,this.floating=t,this.all=new Set,this.visible=new Set,this.order=[],this.queued=new Set}size(){return this.visible.size}add(e){const{all:t,visible:a,order:o}=this;t.has(e)||(t.add(e),a.add(e),o.push(e),this.sort())}delete(e){this.all.delete(e),this.visible.delete(e),this.queued.delete(e.id),Pe(this.order,e)}has(e){return this.visible.has(e)}forEach(e){this.order.forEach(e)}getByIndex(e){return this.order[e]}getById(e){for(const t of this.visible)if(t.id==e)return t}clear(){const{all:e,visible:t,order:a,queued:o}=this;e.clear(),o.clear(),t.clear(),a.length=0}sort(){const{sortSvc:e,rowNodeSorter:t,gos:a}=this.beans,o=e?.getSortOptions()??[],r=this.order,i=nw(r);if(r.sort((l,s)=>t?.compareRowNodes(o,l,s)||(l.pinnedSibling?.rowIndex??0)-(s.pinnedSibling?.rowIndex??0)),!i)return;const n=Ji(a);n==="bottom"||n==="pinnedBottom"?this.order.push(i):this.order.unshift(i)}hide(e){const{all:t,visible:a}=this,o=a.size;return t.forEach(r=>e(r)?a.delete(r):a.add(r)),this.order=Array.from(a),this.sort(),o!=a.size}queue(e){this.queued.add(e)}unqueue(e){this.queued.delete(e)}forEachQueued(e){this.queued.forEach(e)}};function Jd(e){if(e.level===-1)return!0;const t=e.parent;return t?.childrenAfterSort?.some(a=>a==e)?Jd(t):!1}function Fn(e,t){const{gos:a,rowModel:o,filterManager:r}=e;return Fa(a,o)?!o.getRowNode(t.id):r?.isAnyFilterPresent()?!Jd(t):a.get("pivotMode")?!t.group:!1}function rw(e){return!!e.footer&&e.level===-1}function iw(e){return!!e.pinnedSibling&&rw(e.pinnedSibling)}function nw(e){const t=e.findIndex(iw);if(t>-1)return e.splice(t,1)?.[0]}var Xd=class extends y{constructor(){super(...arguments),this.csrm=null,this.ssrm=!1}postConstruct(){const{gos:e,beans:t}=this;this.top=new Zd(t,"top"),this.bottom=new Zd(t,"bottom"),this.csrm=Ve(t)??null,this.ssrm=t.rowModel.getType()==="serverSide";const a=r=>Fn(t,r.pinnedSibling),o=()=>{const r=e.get("isRowPinned");r&&e.get("enableRowPinning")&&t.rowModel.forEachNode(i=>this.pinRow(i,r(i)),!0),this.refreshRowPositions(),this.dispatchRowPinnedEvents()};this.addManagedEventListeners({stylesChanged:this.onGridStylesChanges.bind(this),modelUpdated:({keepRenderedRows:r})=>{this.tryToEmptyQueues(),this.pinGrandTotalRow();let i=!1;this.forContainers(l=>{i||(i=l.hide(a))});const n=this.refreshRowPositions();(!r||n||i)&&this.dispatchRowPinnedEvents()},columnRowGroupChanged:()=>{this.forContainers(sw),this.refreshRowPositions()},rowNodeDataChanged:({node:r})=>{(e.get("isRowPinnable")?.(r)??!0)||this.pinRow(r,null)},firstDataRendered:o}),this.addManagedPropertyListener("pivotMode",()=>{this.forContainers(r=>r.hide(a)),this.dispatchRowPinnedEvents()}),this.addManagedPropertyListener("grandTotalRow",({currentValue:r})=>{this._grandTotalPinned=Jc(r)}),this.addManagedPropertyListener("isRowPinned",o)}destroy(){this.reset(!1),super.destroy()}reset(e=!0){this.forContainers(t=>{const a=[];t.forEach(o=>a.push(o)),a.forEach(o=>this.pinRow(o,null)),t.clear()}),e&&this.dispatchRowPinnedEvents()}pinRow(e,t,a){if(t!=null&&e.destroyed)return;if(e.footer){const n=e.level;if(n>-1)return;const l=t==null&&e.rowPinned!=null;if(n===-1&&!l){this._grandTotalPinned=t;const s=this.csrm;s?s.reMapRows():this.ssrm&&this.pinGrandTotalRow();return}}const o=e.rowPinned??e.pinnedSibling?.rowPinned;if(o!=null&&t!=null&&t!=o){const n=e.rowPinned?e:e.pinnedSibling,l=e.rowPinned?e.pinnedSibling:e;this.pinRow(n,null,a),this.pinRow(l,t,a);return}const i=a&&cw(this.beans,e,a);if(i){i.forEach(n=>this.pinRow(n,t));return}if(t==null){const n=e.rowPinned?e:e.pinnedSibling,l=this.findPinnedRowNode(n);if(!l)return;l.delete(n);const s=n.pinnedSibling;Mn(n),this.refreshRowPositions(t),this.dispatchRowPinnedEvents(s)}else{const n=$d(this.beans,e,t),l=this.getContainer(t);l.add(n),Fn(this.beans,e)&&l.hide(s=>Fn(this.beans,s.pinnedSibling)),this.refreshRowPositions(t),this.dispatchRowPinnedEvents(e)}}isManual(){return!0}isEmpty(e){return this.getContainer(e).size()===0}isRowsToRender(e){return!this.isEmpty(e)}ensureRowHeightsValid(){let e=!1,t=0;const a=o=>{if(o.rowHeightEstimated){const r=st(this.beans,o);o.setRowTop(t),o.setRowHeight(r.height),t+=r.height,e=!0}};return this.bottom.forEach(a),t=0,this.top.forEach(a),this.eventSvc.dispatchEvent({type:"pinnedHeightChanged"}),e}getPinnedTopTotalHeight(){return eg(this.top)}getPinnedBottomTotalHeight(){return eg(this.bottom)}getPinnedTopRowCount(){return this.top.size()}getPinnedBottomRowCount(){return this.bottom.size()}getPinnedTopRow(e){return this.top.getByIndex(e)}getPinnedBottomRow(e){return this.bottom.getByIndex(e)}getPinnedRowById(e,t){return this.getContainer(t).getById(e)}forEachPinnedRow(e,t){this.getContainer(e).forEach(t)}getPinnedState(){const e=t=>{const a=[];return this.forEachPinnedRow(t,o=>{const r=o.pinnedSibling?.id;r!=null&&a.push(r)}),a};return{top:e("top"),bottom:e("bottom")}}setPinnedState(e){this.forContainers((t,a)=>{for(const o of e[a]){const r=this.beans.rowModel.getRowNode(o);r?this.pinRow(r,a):t.queue(o)}})}getGrandTotalPinned(){return this._grandTotalPinned}setGrandTotalPinned(e){this._grandTotalPinned=e}tryToEmptyQueues(){this.forContainers((e,t)=>{const a=new Set;e.forEachQueued(o=>{const r=this.beans.rowModel.getRowNode(o);r&&a.add(r)});for(const o of a)e.unqueue(o.id),this.pinRow(o,t)})}pinGrandTotalRow(){const{beans:e,_grandTotalPinned:t}=this,a=this.csrm||this.ssrm?e.rowModel.rootNode?.sibling:void 0;if(!a)return;const o=a.pinnedSibling,r=o&&this.findPinnedRowNode(o);if(t){if(r&&r.floating!==t&&(Mn(o),r.delete(o)),r?.floating!==t){const i=$d(e,a,t);this.getContainer(t).add(i)}}else{if(!r)return;Mn(o),r.delete(o)}}onGridStylesChanges(e){e.rowHeightChanged&&this.forContainers(t=>t.forEach(a=>a.setRowHeight(a.rowHeight,!0)))}getContainer(e){return e==="top"?this.top:this.bottom}findPinnedRowNode(e){if(this.top.has(e))return this.top;if(this.bottom.has(e))return this.bottom}refreshRowPositions(e){const t=o=>lw(this.beans,o);if(e)return t(this.getContainer(e));let a=!1;return this.forContainers(o=>{const r=t(o);a||(a=r)}),a}forContainers(e){e(this.top,"top"),e(this.bottom,"bottom")}dispatchRowPinnedEvents(e){this.eventSvc.dispatchEvent({type:"pinnedRowsChanged"}),e?.dispatchRowEvent("rowPinned")}};function lw(e,t){let a=0,o=!1;return t.forEach((r,i)=>{if(o||(o=r.rowTop!==a),r.setRowTop(a),r.rowHeightEstimated||r.rowHeight==null){const n=st(e,r).height;o||(o=r.rowHeight!==n),r.setRowHeight(n)}r.setRowIndex(i),a+=r.rowHeight}),o}function $d(e,t,a){if(t.pinnedSibling)return t.pinnedSibling;const o=Yd(t,e);o.setRowTop(null),o.setRowIndex(null),o.rowPinned=a;const r=a==="top"?Ar:Pr;return o.id=`${r}${a}-${t.id}`,o.pinnedSibling=t,t.pinnedSibling=o,o}function Mn(e){if(!e.pinnedSibling)return;e.rowPinned=null,e._destroy(!1);const t=e.pinnedSibling;e.pinnedSibling=void 0,t&&(t.pinnedSibling=void 0,t.rowPinned=null)}function sw(e){const t=new Set;e.forEach(a=>{a.group&&t.add(a)}),t.forEach(a=>e.delete(a))}function cw(e,t,a){const{rowSpanSvc:o}=e,r=(a&&o?.isCellSpanning(a,t))??!1;if(a&&r)return o?.getCellSpan(a,t)?.spannedNodes}function eg(e){const t=e.size();if(t===0)return 0;const a=e.getByIndex(t-1);return a===void 0?0:a.rowTop+a.rowHeight}var tg=class extends y{constructor(){super(...arguments),this.nextId=0,this.pinnedTopRows={cache:{},order:[]},this.pinnedBottomRows={cache:{},order:[]}}postConstruct(){const e=this.gos;this.setPinnedRowData(e.get("pinnedTopRowData"),"top"),this.setPinnedRowData(e.get("pinnedBottomRowData"),"bottom"),this.addManagedPropertyListener("pinnedTopRowData",t=>this.setPinnedRowData(t.currentValue,"top")),this.addManagedPropertyListener("pinnedBottomRowData",t=>this.setPinnedRowData(t.currentValue,"bottom")),this.addManagedEventListeners({stylesChanged:this.onGridStylesChanges.bind(this)})}reset(){}isEmpty(e){return this.getCache(e).order.length===0}isRowsToRender(e){return!this.isEmpty(e)}isManual(){return!1}pinRow(e,t){}onGridStylesChanges(e){if(e.rowHeightChanged){const t=a=>{a.setRowHeight(a.rowHeight,!0)};yo(this.pinnedBottomRows,t),yo(this.pinnedTopRows,t)}}ensureRowHeightsValid(){let e=!1,t=0;const a=o=>{o.rowHeightEstimated&&(o.setRowHeight(st(this.beans,o).height),e=!0),o.rowTop!==t&&(o.setRowTop(t),e=!0),t+=o.rowHeight};return yo(this.pinnedBottomRows,a),t=0,yo(this.pinnedTopRows,a),this.eventSvc.dispatchEvent({type:"pinnedHeightChanged"}),e}setPinnedRowData(e,t){this.updateNodesFromRowData(e,t),this.eventSvc.dispatchEvent({type:"pinnedRowDataChanged"})}updateNodesFromRowData(e,t){const a=this.getCache(t);if(e===void 0){a.order.length=0,a.cache={};return}const o=ta(this.gos),r=t==="top"?Ar:Pr,i=new Set(a.order),n=[],l=new Set;let s=0,c=-1;for(const d of e){const g=o?.({data:d,level:0,rowPinned:t})??r+this.nextId++;if(l.has(g)){x(96,{id:g,data:d});continue}c++,l.add(g),n.push(g);const u=Co(a,g);if(u!==void 0)u.data!==d&&u.updateData(d),s+=this.setRowTopAndRowIndex(u,s,c),i.delete(g);else{const h=new vt(this.beans);h.id=g,h.data=d,h.rowPinned=t,s+=this.setRowTopAndRowIndex(h,s,c),a.cache[g]=h,a.order.push(g)}}for(const d of i)Co(a,d)?.clearRowTopAndRowIndex(),delete a.cache[d];a.order=n}setRowTopAndRowIndex(e,t,a){return e.setRowTop(t),e.setRowHeight(st(this.beans,e).height),e.setRowIndex(a),e.rowHeight}getPinnedTopTotalHeight(){return ag(this.pinnedTopRows)}getPinnedBottomTotalHeight(){return ag(this.pinnedBottomRows)}getPinnedTopRowCount(){return Dn(this.pinnedTopRows)}getPinnedBottomRowCount(){return Dn(this.pinnedBottomRows)}getPinnedTopRow(e){return zn(this.pinnedTopRows,e)}getPinnedBottomRow(e){return zn(this.pinnedBottomRows,e)}getPinnedRowById(e,t){return Co(this.getCache(t),e)}forEachPinnedRow(e,t){return yo(this.getCache(e),t)}getCache(e){return e==="top"?this.pinnedTopRows:this.pinnedBottomRows}getPinnedState(){return{top:[],bottom:[]}}setPinnedState(){}getGrandTotalPinned(){}setGrandTotalPinned(){}};function ag(e){const t=Dn(e);if(t===0)return 0;const a=zn(e,t-1);return a===void 0?0:a.rowTop+a.rowHeight}function Co(e,t){return e.cache[t]}function zn(e,t){return Co(e,e.order[t])}function yo(e,t){e.order.forEach((a,o)=>{const r=Co(e,a);r&&t(r,o)})}function Dn(e){return e.order.length}var og=class extends y{constructor(){super(...arguments),this.beanName="pinnedRowModel"}postConstruct(){const{gos:e}=this,t=()=>{const a=e.get("enableRowPinning"),o=Ji(e),i=!!a||(o==="pinnedBottom"||o==="pinnedTop"),n=i?this.inner instanceof tg:this.inner instanceof Xd;this.inner&&n&&this.destroyBean(this.inner),(n||!this.inner)&&(this.inner=this.createManagedBean(i?new Xd:new tg))};this.addManagedPropertyListeners(["enableRowPinning","grandTotalRow"],t),t()}reset(){return this.inner.reset()}isEmpty(e){return this.inner.isEmpty(e)}isManual(){return this.inner.isManual()}isRowsToRender(e){return this.inner.isRowsToRender(e)}pinRow(e,t,a){return this.inner.pinRow(e,t,a)}ensureRowHeightsValid(){return this.inner.ensureRowHeightsValid()}getPinnedRowById(e,t){return this.inner.getPinnedRowById(e,t)}getPinnedTopTotalHeight(){return this.inner.getPinnedTopTotalHeight()}getPinnedBottomTotalHeight(){return this.inner.getPinnedBottomTotalHeight()}getPinnedTopRowCount(){return this.inner.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.inner.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.inner.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.inner.getPinnedBottomRow(e)}forEachPinnedRow(e,t){return this.inner.forEachPinnedRow(e,t)}getPinnedState(){return this.inner.getPinnedState()}setPinnedState(e){return this.inner.setPinnedState(e)}setGrandTotalPinned(e){return this.inner.setGrandTotalPinned(e)}getGrandTotalPinned(){return this.inner.getGrandTotalPinned()}},rg=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(rg||{}),dw=500,gw=550,Tr,uw=e=>{if(!Tr)Tr=new WeakSet;else if(Tr.has(e))return!1;return Tr.add(e),!0},It=class{constructor(e,t=!1){this.eElement=e,this.preventClick=t,this.startListener=null,this.handlers=[],this.eventSvc=void 0,this.touchStart=null,this.lastTapTime=null,this.longPressTimer=0,this.moved=!1}addEventListener(e,t){let a=this.eventSvc;if(!a){if(a===null)return;this.eventSvc=a=new Ct;const o=this.onTouchStart.bind(this);this.startListener=o,this.eElement.addEventListener("touchstart",o,{passive:!0})}a.addEventListener(e,t)}removeEventListener(e,t){this.eventSvc?.removeEventListener(e,t)}onTouchStart(e){if(this.touchStart||!uw(e))return;const t=e.touches[0];this.touchStart=t;const a=this.handlers;if(!a.length){const o=this.eElement,r=o.ownerDocument,i=this.onTouchMove.bind(this),n=this.onTouchEnd.bind(this),l=this.onTouchCancel.bind(this),s={passive:!0},c={passive:!1};hr(a,[o,"touchmove",i,s],[r,"touchcancel",l,s],[r,"touchend",n,c],[r,"contextmenu",kt,c])}this.clearLongPress(),this.longPressTimer=window.setTimeout(()=>{this.longPressTimer=0,this.touchStart===t&&!this.moved&&(this.moved=!0,this.eventSvc?.dispatchEvent({type:"longTap",touchStart:t,touchEvent:e}))},gw)}onTouchMove(e){const{moved:t,touchStart:a}=this;if(!t&&a){const o=Sa(a,e.touches);o&&!kc(o,a,4)&&(this.clearLongPress(),this.moved=!0)}}onTouchEnd(e){const t=this.touchStart;!t||!Sa(t,e.changedTouches)||(this.moved||(this.eventSvc?.dispatchEvent({type:"tap",touchStart:t}),this.checkDoubleTap(t)),this.preventClick&&kt(e),this.cancel())}onTouchCancel(e){const t=this.touchStart;!t||!Sa(t,e.changedTouches)||(this.lastTapTime=null,this.cancel())}checkDoubleTap(e){let t=Date.now();const a=this.lastTapTime;a&&t-a>dw&&(this.eventSvc?.dispatchEvent({type:"doubleTap",touchStart:e}),t=null),this.lastTapTime=t}cancel(){this.clearLongPress(),Ni(this.handlers),this.touchStart=null}clearLongPress(){this.longPressTimer!==0&&(window.clearTimeout(this.longPressTimer),this.longPressTimer=0),this.moved=!1}destroy(){const e=this.startListener;e&&(this.startListener=null,this.eElement.removeEventListener("touchstart",e)),this.cancel(),this.eElement=null,this.eventSvc=null}},ig=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(ig||{}),hw=1,ng=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,this.instanceId=hw++,e?.beanClasses&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){this.id=e.id,this.beans.context=this,this.destroyCallback=e.destroyCallback;for(const t of Object.keys(e.providedBeanInstances))this.beans[t]=e.providedBeanInstances[t];for(const t of e.beanClasses){const a=new t;a.beanName?this.beans[a.beanName]=a:console.error(`Bean ${t.name} is missing beanName`),this.createdBeans.push(a)}for(const t of e.derivedBeans??[]){const{beanName:a,bean:o}=t(this);this.beans[a]=o,this.createdBeans.push(o)}e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){return this.initBeans([e],t),e}initBeans(e,t){const a=this.beans;for(const o of e)o.preWireBeans?.(a),o.wireBeans?.(a);for(const o of e)o.preConstruct?.();t&&e.forEach(t);for(const o of e)o.postConstruct?.()}getBeans(){return this.beans}getBean(e){return this.beans[e]}getId(){return this.id}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[],this.destroyCallback?.()}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}};function pw(e){return{beanName:"gridApi",bean:e.getBean("apiFunctionSvc").api}}var fw=["licenseManager","environment","eventSvc","gos","paginationAutoPageSizeSvc","apiFunctionSvc","gridApi","registry","agCompUtils","userCompFactory","rowContainerHeight","horizontalResizeSvc","localeSvc","pinnedRowModel","dragSvc","colGroupSvc","visibleCols","popupSvc","selectionSvc","colFilter","quickFilter","filterManager","colModel","headerNavigation","pageBounds","pagination","pageBoundsListener","rowSpanSvc","stickyRowSvc","rowRenderer","expressionSvc","alignedGridsSvc","navigation","valueCache","valueSvc","autoWidthCalc","filterMenuFactory","dragAndDrop","focusSvc","cellNavigation","cellStyles","scrollVisibleSvc","sortSvc","colHover","colAnimation","autoColSvc","selectionColSvc","changeDetectionSvc","animationFrameSvc","undoRedo","colDefFactory","rowStyleSvc","rowNodeBlockLoader","rowNodeSorter","ctrlsSvc","pinnedCols","dataTypeSvc","syncSvc","overlays","stateSvc","expansionSvc","apiEventSvc","ariaAnnounce","menuSvc","colMoves","colAutosize","colFlex","colResize","pivotColsSvc","valueColsSvc","rowGroupColsSvc","colNames","colViewport","pivotResultCols","showRowGroupCols","validation"],lg=Object.fromEntries(fw.map((e,t)=>[e,t]));function mw(e,t){const a=(e.beanName?lg[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER,o=(t.beanName?lg[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return a-o}function vw(e,t){return e?.beanName==="gridDestroySvc"?-1:t?.beanName==="gridDestroySvc"?1:0}function sg(e){const{rowIndex:t,rowPinned:a,column:o}=e;return`${t}.${a??"null"}.${o.getId()}`}function Lr(e,t){const a=e.column===t.column,o=e.rowPinned===t.rowPinned,r=e.rowIndex===t.rowIndex;return a&&o&&r}function cg(e,t){switch(e.rowPinned){case"top":if(t.rowPinned!=="top")return!0;break;case"bottom":if(t.rowPinned!=="bottom")return!1;break;default:if(z(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex<t.rowIndex}function dg(e,t){return!e&&!t?!0:!e||!t?!1:e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}function An(e){let t=0,a;const{pinnedRowModel:o,rowModel:r,pageBounds:i}=e;return o?.getPinnedTopRowCount()?a="top":r.getRowCount()?(a=null,t=i.getFirstRow()):o?.getPinnedBottomRowCount()&&(a="bottom"),a===void 0?null:{rowIndex:t,rowPinned:a}}function Pn(e){let t,a=null;const{pinnedRowModel:o,pageBounds:r}=e,i=o?.getPinnedBottomRowCount(),n=o?.getPinnedTopRowCount();return i?(a="bottom",t=i-1):e.rowModel.getRowCount()?t=r.getLastRow():n&&(a="top",t=n-1),t===void 0?null:{rowIndex:t,rowPinned:a}}function qe(e,t){switch(t.rowPinned){case"top":return e.pinnedRowModel?.getPinnedTopRow(t.rowIndex);case"bottom":return e.pinnedRowModel?.getPinnedBottomRow(t.rowIndex);default:return e.rowModel.getRow(t.rowIndex)}}function na(e,t){const a=e.spannedRowRenderer?.getCellByPosition(t);if(a)return a;const o=e.rowRenderer.getRowByPosition(t);return o?o.getCellCtrl(t.column):null}function bw(e,t,a){const{rowModel:o,pinnedRowModel:r}=e;let i;return i??(i=o?.getRowNode(t)),a?i??(i=r?.getPinnedRowById(t,a)):(i??(i=r?.getPinnedRowById(t,"top")),i??(i=r?.getPinnedRowById(t,"bottom"))),i}function ko(e,t,a=!1){const{rowIndex:o,rowPinned:r}=t,{pageBounds:i,pinnedRowModel:n,rowModel:l}=e;if(o===0)return r==="top"?null:r==="bottom"&&l.isRowsToRender()?{rowIndex:i.getLastRow(),rowPinned:null}:n?.isRowsToRender("top")?{rowIndex:n.getPinnedTopRowCount()-1,rowPinned:"top"}:null;if(a){const s=r?void 0:l.getRow(o);return gg(e,s,!0)??{rowIndex:o-1,rowPinned:r}}return{rowIndex:o-1,rowPinned:r}}function ww(e,t){const{pinnedRowModel:a,rowModel:o}=e,r=a?.getPinnedTopRowCount()??0,i=o.getRowCount(),{rowPinned:n,rowIndex:l}=t;return n==="top"?l:n==="bottom"?r+i+l:r+l}function In(e,t,a=!1){const{rowIndex:o,rowPinned:r}=t,{pageBounds:i,pinnedRowModel:n,rowModel:l}=e;if(Cw(e,t))return r==="bottom"?null:r==="top"&&l.isRowsToRender()?{rowIndex:i.getFirstRow(),rowPinned:null}:n?.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;if(a){const s=r?void 0:l.getRow(o);return gg(e,s)??{rowIndex:o+1,rowPinned:r}}return{rowIndex:o+1,rowPinned:r}}function gg(e,t,a=!1){const{gos:o,rowRenderer:r}=e;if(!t?.sticky||!Zi(o))return;const i=r.getStickyTopRowCtrls(),n=r.getStickyBottomRowCtrls(),l=!n.some(g=>g.rowNode.rowIndex===t.rowIndex),s=l?i:n,c=(a?-1:1)*(l?-1:1);let d;for(let g=0;g<s.length;g++)if(s[g].rowNode.rowIndex===t.rowIndex){d=s[g+c];break}return d?{rowIndex:d.rowNode.rowIndex,rowPinned:null}:void 0}function Cw(e,t){const{rowPinned:a,rowIndex:o}=t,{pinnedRowModel:r,pageBounds:i}=e;return a==="top"?(r?.getPinnedTopRowCount()??0)-1<=o:a==="bottom"?(r?.getPinnedBottomRowCount()??0)-1<=o:i.getLastRow()<=o}function ug(e,t,a){t.addManagedElementListeners(a,{keydown:o=>{if(!o.defaultPrevented&&!Sw(o)&&o.key===C.TAB){const r=o.shiftKey;At(e,a,!1,r)||la(e,r)&&o.preventDefault()}}})}function hg(e,t){return e.ctrlsSvc.get("gridCtrl").focusInnerElement(t)}function We(e){return e.gos.get("suppressHeaderFocus")||!!e.overlays?.exclusive}function So(e){return e.gos.get("suppressCellFocus")||!!e.overlays?.exclusive}function la(e,t,a=!1){const o=e.ctrlsSvc.get("gridCtrl"),r=o.focusNextInnerContainer(t);return r===!0?!0:r===!1?r:((a||!t&&!o.isDetailGrid()&&o.isFocusInsideGridBody())&&o.forceFocusOutOfContainer(t),!1)}function pg(e,t){const a=e.focusSvc,o=a.getFocusedCell();if(o&&t&&Lr(o,t)){const{rowIndex:r,rowPinned:i,column:n}=t;er(e)&&a.setFocusedCell({rowIndex:r,column:n,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!Sn()})}}function yw(e,t){const a=e.getFocusableContainerName();return a==="gridBody"?t():fg(e,()=>zt(e.getGui(),".ag-tab-guard").length>0)?a:null}function fg(e,t){e.setAllowFocus?.(!0);try{return t()}finally{e.setAllowFocus?.(!1)}}var mg="__ag_Grid_Skip_Focusable_Container";function kw(e){e[mg]=!0}function Sw(e){return e[mg]===!0}function xw(e){return e.cols?e.cols.treeDepth+1:-1}function Le(e){return e.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0}function Tn(e){const t=[],a=e.ctrlsSvc.getHeaderRowContainerCtrls();for(const o of a){if(!o)continue;const r=o.getGroupRowCount()||0;for(let i=0;i<r;i++){const n=o.getGroupRowCtrlAtIndex(i),l=t[i];if(n){const s=Rw(e,n);(l==null||s>l)&&(t[i]=s)}}}return t}function Rw(e,t){let o=e.colModel.pivotMode?Fw(e):vg(e);const r=t.getHeaderCellCtrls();for(const i of r){const{column:n}=i,l=n.getAutoHeaderHeight();l!=null&&l>o&&n.isAutoHeaderHeight()&&(o=l)}return o}function Ln(e){let a=e.colModel.pivotMode?Ew(e):xo(e);return e.colModel.forAllCols(o=>{const r=o.getAutoHeaderHeight();r!=null&&r>a&&o.isAutoHeaderHeight()&&(a=r)}),a}function xo(e){return e.gos.get("headerHeight")??e.environment.getDefaultHeaderHeight()}function Bn(e){return e.gos.get("floatingFiltersHeight")??xo(e)}function vg(e){return e.gos.get("groupHeaderHeight")??xo(e)}function Ew(e){return e.gos.get("pivotHeaderHeight")??xo(e)}function Fw(e){return e.gos.get("pivotGroupHeaderHeight")??vg(e)}function Mw(e,t){return e.headerRowIndex===t.headerRowIndex&&e.column===t.column}function zw(e){return e?.headerRowIndex!=null}var bg=class extends y{setComp(e,t,a){this.comp=e,this.eGui=t;const{beans:o}=this,{headerNavigation:r,touchSvc:i,ctrlsSvc:n}=o;r&&this.createManagedBean(new Ta(a,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,o),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,o)}),this.onPivotModeChanged(o),this.setupHeaderHeight();const l=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:l}),i?.mockHeaderContextMenu(this,l),n.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e),this.addManagedEventListeners({headerRowsChanged:e,columnHeaderHeightChanged:e,columnGroupHeaderHeightChanged:()=>nt(this.beans,()=>e()),stylesChanged:e,advancedFilterEnabledChanged:e})}setHeaderHeight(){const{beans:e}=this;let t=0;const a=Tn(e).reduce((n,l)=>n+l,0),o=Ln(e);e.filterManager?.hasFloatingFilters()&&(t+=Bn(e)),t+=a,t+=o;const r=e.environment.getHeaderRowBorderWidth(),i=t+r;if(this.headerHeightWithBorder!==i){this.headerHeightWithBorder=i;const n=`${i}px`;this.comp.setHeightAndMinHeight(n)}this.headerHeight!==t&&(this.headerHeight=t,this.eventSvc.dispatchEvent({type:"headerHeightChanged"}))}onPivotModeChanged(e){const t=e.colModel.pivotMode;this.comp.toggleCss("ag-pivot-on",t),this.comp.toggleCss("ag-pivot-off",!t)}onDisplayedColumnsChanged(e){const a=e.visibleCols.allCols.some(o=>o.isSpanHeaderHeight());this.comp.toggleCss("ag-header-allow-overflow",a)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),a=e.shiftKey,o=a!==t?"LEFT":"RIGHT",{beans:r}=this,{headerNavigation:i,focusSvc:n}=r;(i.navigateHorizontally(o,!0,e)||!a&&n.focusOverlay(!1)||la(r,a,!0))&&e.preventDefault()}handleKeyDown(e){let t=null;const{headerNavigation:a}=this.beans;switch(e.key){case C.LEFT:t="LEFT";case C.RIGHT:{z(t)||(t="RIGHT"),a.navigateHorizontally(t,!1,e)&&e.preventDefault();break}case C.UP:t="UP";case C.DOWN:{z(t)||(t="DOWN"),a.navigateVertically(t,e)&&e.preventDefault();break}default:return}}onFocusOut(e){const{relatedTarget:t}=e,{eGui:a,beans:o}=this;!t&&a.contains(Q(o))||a.contains(t)||(o.focusSvc.focusedHeader=null)}onHeaderContextMenu(e,t,a){const{menuSvc:o,ctrlsSvc:r}=this.beans;if(!e&&!a||!o?.isHeaderContextMenuEnabled())return;const{target:i}=e??t;(i===this.eGui||i===r.getHeaderRowContainerCtrl()?.eViewport)&&o.showHeaderContextMenu(void 0,e,a)}},On=class extends V{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},Dw={tag:"div",cls:"ag-header-cell",role:"columnheader",children:[{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"},{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"}]},Aw=class extends On{constructor(e){super(Dw,e),this.eResize=E,this.eHeaderCompWrapper=E,this.headerCompVersion=0}postConstruct(){const e=this.getGui(),t=()=>{const o=this.ctrl.getSelectAllGui();o&&(this.eResize.insertAdjacentElement("afterend",o),this.addDestroyFunc(()=>o.remove()))},a={setWidth:o=>e.style.width=o,toggleCss:(o,r)=>this.toggleCss(o,r),setUserStyles:o=>to(e,o),setAriaSort:o=>o?nc(e,o):lc(e),setUserCompDetails:o=>this.setUserCompDetails(o),getUserCompInstance:()=>this.headerComp,refreshSelectAllGui:t,removeSelectAllGui:()=>this.ctrl.getSelectAllGui()?.remove()};this.ctrl.setComp(a,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0),t()}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){this.headerComp&&(this.headerCompGui?.remove(),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(a=>this.afterCompCreated(t,a))}afterCompCreated(e,t){if(e!=this.headerCompVersion||!this.isAlive()){this.destroyBean(t);return}this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}},Pw={tag:"div",cls:"ag-header-group-cell",role:"columnheader",children:[{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"},{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"}]},Iw=class extends On{constructor(e){super(Pw,e),this.eResize=E,this.eHeaderCompWrapper=E}postConstruct(){const e=this.getGui(),t=(o,r)=>r!=null?e.setAttribute(o,r):e.removeAttribute(o),a={toggleCss:(o,r)=>this.toggleCss(o,r),setUserStyles:o=>to(e,o),setHeaderWrapperHidden:o=>{o?this.eHeaderCompWrapper.style.setProperty("display","none"):this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:o=>{o!=null?this.eHeaderCompWrapper.style.setProperty("max-height",`${o}px`):this.eHeaderCompWrapper.style.removeProperty("max-height"),this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",o!=null)},setResizableDisplayed:o=>U(this.eResize,o),setWidth:o=>e.style.width=o,setAriaExpanded:o=>t("aria-expanded",o),setUserCompDetails:o=>this.setUserCompDetails(o),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(a,e,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(e){e.newAgStackInstance().then(t=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}const a=this.getGui(),o=e.getGui();this.eHeaderCompWrapper.appendChild(o),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(a)}},Tw={tag:"div",cls:"ag-header-cell ag-floating-filter",role:"gridcell",children:[{tag:"div",ref:"eFloatingFilterBody",role:"presentation"},{tag:"div",ref:"eButtonWrapper",cls:"ag-floating-filter-button ag-hidden",role:"presentation",children:[{tag:"button",ref:"eButtonShowMainFilter",cls:"ag-button ag-floating-filter-button-button",attrs:{type:"button",tabindex:"-1"}}]}]},Lw=class extends On{constructor(e){super(Tw,e),this.eFloatingFilterBody=E,this.eButtonWrapper=E,this.eButtonShowMainFilter=E}postConstruct(){const e=this.getGui(),t={toggleCss:(a,o)=>this.toggleCss(a,o),setUserStyles:a=>to(e,a),addOrRemoveBodyCssClass:(a,o)=>this.eFloatingFilterBody.classList.toggle(a,o),setButtonWrapperDisplayed:a=>U(this.eButtonWrapper,a),setCompDetails:a=>this.setCompDetails(a),getFloatingFilterComp:()=>this.compPromise,setWidth:a=>e.style.width=a,setMenuIcon:a=>this.eButtonShowMainFilter.appendChild(a)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(e){if(!e){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=e.newAgStackInstance(),this.compPromise.then(t=>this.afterCompCreated(t))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp?.getGui().remove(),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp)}afterCompCreated(e){if(e){if(!this.isAlive()){this.destroyBean(e);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached?.()}}},Bw=class extends V{constructor(e){super({tag:"div",cls:e.headerRowClass,role:"row"}),this.ctrl=e,this.headerComps={}}postConstruct(){this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),wa(this.getGui(),this.ctrl.getAriaRowIndex());const t={setHeight:a=>this.getGui().style.height=a,setTop:a=>this.getGui().style.top=a,setHeaderCtrls:(a,o)=>this.setHeaderCtrls(a,o),setWidth:a=>this.getGui().style.width=a,setRowIndex:a=>wa(this.getGui(),a)};this.ctrl.setComp(t,void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const a=this.headerComps;this.headerComps={};for(const o of e){const r=o.instanceId;let i=a[r];delete a[r],i==null&&(i=this.createHeaderComp(o),this.getGui().appendChild(i.getGui())),this.headerComps[r]=i}if(Object.values(a).forEach(o=>{o.getGui().remove(),this.destroyBean(o)}),t){const o=Object.values(this.headerComps);o.sort((i,n)=>{const l=i.getCtrl().column.getLeft(),s=n.getCtrl().column.getLeft();return l-s});const r=o.map(i=>i.getGui());mc(this.getGui(),r)}}createHeaderComp(e){let t;switch(this.ctrl.type){case"group":t=new Iw(e);break;case"filter":t=new Lw(e);break;default:t=new Aw(e);break}return this.createBean(t),t.setParentComponent(this),t}},Nn=class extends y{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=se(this.gos,"print"),{visibleCols:t,scrollVisibleSvc:a}=this.beans,o=t.bodyWidth,r=t.getColsLeftWidth(),i=t.getDisplayedColumnsRightWidth();let n;e?n=o+r+i:(n=o,this.addSpacer&&(this.gos.get("enableRtl")?r:i)===0&&a.verticalScrollShowing&&(n+=a.getScrollbarWidth())),this.callback(n)}},Ow=class extends y{};function Ro(e,t,a){return a&&e.addDestroyFunc(()=>t.destroyBean(a)),a??e}var Hn=class extends y{constructor(e,t,a,o){super(),this.columnOrGroup=e,this.eCell=t,this.colsSpanning=o,this.columnOrGroup=e,this.ariaEl=t.querySelector("[role=columnheader]")||t,this.beans=a}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){const{beans:e,colsSpanning:t}=this;return e.gos.get("enableRtl")&&t?j(t):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const{gos:e,colAnimation:t}=this.beans,a=e.get("suppressColumnMoveAnimation"),o=z(this.columnOrGroup.getOldLeft());t?.isActive()&&o&&!a?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=this.modifyLeftForPrintLayout(e,e.getOldLeft()),a=this.modifyLeftForPrintLayout(e,e.getLeft());this.setLeft(t),this.actualLeft=a,this.beans.colAnimation.executeNextVMTurn(()=>{this.actualLeft===a&&this.setLeft(a)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){const{gos:a,visibleCols:o}=this.beans;if(!se(a,"print")||e.getPinned()==="left")return t;const i=o.getColsLeftWidth();if(e.getPinned()==="right"){const n=o.bodyWidth;return i+n+t}return i+t}setLeft(e){if(z(e)&&(this.eCell.style.left=`${e}px`),ee(this.columnOrGroup)){const t=this.columnOrGroup.getLeafColumns();if(!t.length)return;t.length>1&&ic(this.ariaEl,t.length)}}},Nw="ag-column-first",Hw="ag-column-last";function Gn(e,t,a,o){return _(e)?[]:Cg(e.headerClass,e,t,a,o)}function Gw(e,t,a,o){return _(e)?[]:Cg(e.toolPanelClass,e,t,a,o)}function wg(e,t,a){e.toggleCss(Nw,a.isColAtEdge(t,"first")),e.toggleCss(Hw,a.isColAtEdge(t,"last"))}function Vw(e,t,a,o){return I(t,{colDef:e,column:a,columnGroup:o})}function Cg(e,t,a,o,r){if(_(e))return[];let i;if(typeof e=="function"){const n=Vw(t,a,o,r);i=e(n)}else i=e;return typeof i=="string"?[i]:Array.isArray(i)?[...i]:[]}var qw=0,yg="headerCtrl",Vn=class extends y{constructor(e,t){super(),this.column=e,this.rowCtrl=t,this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.reAttemptToFocus=!1,this.instanceId=e.getUniqueId()+"-"+qw++}postConstruct(){const e=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],e),this.addManagedEventListeners({overlayExclusiveChanged:e})}setComp(e,t,a,o,r){t.setAttribute("col-id",this.column.colIdSanitised),this.wireComp(e,t,a,o,r),this.reAttemptToFocus&&(this.reAttemptToFocus=!1,this.focus(this.lastFocusEvent??void 0))}shouldStopEventPropagation(e){const{headerRowIndex:t,column:a}=this.beans.focusSvc.focusedHeader,o=a.getDefinition(),r=o?.suppressHeaderKeyboardEvent;if(!z(r))return!1;const i=I(this.gos,{colDef:o,column:a,headerRowIndex:t,event:e});return!!r(i)}getWrapperHasFocus(){return Q(this.beans)===this.eGui}setGui(e,t){this.eGui=e,this.addDomData(t),t.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),t.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}refreshHeaderStyles(){const e=this.column.getDefinition();if(!e)return;const{headerStyle:t}=e;let a;if(typeof t=="function"){const o=this.getHeaderClassParams();a=t(o)}else a=t;a&&this.comp.setUserStyles(a)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(e){const{wrapperElement:t,checkMeasuringCallback:a,compBean:o}=e,{beans:r}=this,i=g=>{if(!this.isAlive()||!o.isAlive())return;const{paddingTop:u,paddingBottom:h,borderBottomWidth:p,borderTopWidth:f}=Zt(this.eGui),m=u+h+p+f,w=t.offsetHeight+m;if(g<5){const k=!oe(r)?.contains(t),S=w==0;if(k||S){pr(()=>i(g+1),"raf",r);return}}this.setColHeaderHeight(this.column,w)};let n=!1,l;const s=()=>{const g=this.column.isAutoHeaderHeight();g&&!n&&c(),!g&&n&&d()},c=()=>{n=!0,this.comp.toggleCss("ag-header-cell-auto-height",!0),i(0),l=it(this.beans,t,()=>i(0))},d=()=>{n=!1,l&&l(),this.comp.toggleCss("ag-header-cell-auto-height",!1),l=void 0};s(),o.addDestroyFunc(()=>d()),o.addManagedListeners(this.column,{widthChanged:()=>n&&i(0)}),o.addManagedEventListeners({sortChanged:()=>{n&&window.setTimeout(()=>i(0))}}),a&&a(s)}onDisplayedColumnsChanged(){const{comp:e,column:t,beans:a,eGui:o}=this;!e||!t||!o||(wg(e,t,a.visibleCols),Pi(o,a.visibleCols.getAriaColIndex(t)))}addResizeAndMoveKeyboardListeners(e){e.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){const e=We(this.beans);this.eGui&&we(this.eGui,"tabindex",e?null:"-1")}onGuiKeyDown(e){const t=Q(this.beans),a=e.key===C.LEFT||e.key===C.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),t!==this.eGui||!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey)return;if((this.isResizing||a)&&(e.preventDefault(),e.stopImmediatePropagation()),(e.ctrlKey||e.metaKey)&&Rd(e)===C.C)return this.beans.clipboardSvc?.copyToClipboard();if(!a)return;const i=e.key===C.LEFT!==this.gos.get("enableRtl")?"left":"right";if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const n=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(n,e.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(i)}moveHeader(e){this.beans.colMoves?.moveHeader(e,this.eGui,this.column,this.rowCtrl.pinned,this)}getViewportAdjustedResizeDiff(e){const t=this.getResizeDiff(e),{pinnedCols:a}=this.beans;return a?a.getHeaderResizeDiff(t,this.column):t}getResizeDiff(e){const{gos:t,column:a}=this;let o=e.key===C.LEFT!==t.get("enableRtl");const r=a.getPinned(),i=t.get("enableRtl");return r&&i!==(r==="right")&&(o=!o),(o?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case C.PAGE_DOWN:case C.PAGE_UP:case C.PAGE_HOME:case C.PAGE_END:t&&e.preventDefault()}}addDomData(e){const t=yg,{eGui:a,gos:o}=this;$t(o,a,t,this),e.addDestroyFunc(()=>$t(o,a,t,null))}focus(e){if(!this.isAlive())return!1;const{eGui:t}=this;return t?(this.lastFocusEvent=e||null,t.focus()):this.reAttemptToFocus=!0,!0}focusThis(){this.beans.focusSvc.focusedHeader={headerRowIndex:this.rowCtrl.rowIndex,column:this.column}}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop?.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,a){const o=e??t,{menuSvc:r,gos:i}=this.beans;i.get("preventDefaultOnContextMenu")&&o.preventDefault(),r?.isHeaderContextMenuEnabled(a)&&r.showHeaderContextMenu(a,e,t),this.dispatchColumnMouseEvent("columnHeaderContextMenu",a)}dispatchColumnMouseEvent(e,t){this.eventSvc.dispatchEvent({type:e,column:t})}setColHeaderHeight(e,t){if(!e.setAutoHeaderHeight(t))return;const{eventSvc:a}=this;e.isColumn?a.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"}):a.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:e,source:"autosizeColumnGroupHeaderHeight"})}clearComponent(){this.removeDragSource(),this.resizeFeature=null,this.comp=null,this.eGui=null}destroy(){super.destroy(),this.column=null,this.lastFocusEvent=null,this.rowCtrl=null}},Ww=class extends Vn{constructor(){super(...arguments),this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map}wireComp(e,t,a,o,r){this.comp=e;const{rowCtrl:i,column:n,beans:l}=this,{colResize:s,context:c,colHover:d,rangeSvc:g}=l,u=Ro(this,c,r);this.setGui(t,u),this.updateState(),this.setupWidth(u),this.setupMovingCss(u),this.setupMenuClass(u),this.setupSortableClass(u),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:o,checkMeasuringCallback:p=>this.setRefreshFunction("measuring",p),compBean:u}),this.addColumnHoverListener(u),this.setupFilterClass(u),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(u),this.setupSelectAll(u),this.setupUserComp(),this.refreshAria(),s?this.resizeFeature=u.createManagedBean(s.createResizeFeature(i.pinned,n,a,e,this)):U(a,!1),d?.createHoverFeature(u,[n],t),g?.createRangeHighlightFeature(u,n,e),u.createManagedBean(new Hn(n,t,l)),u.createManagedBean(new Ta(t,{shouldStopEventPropagation:p=>this.shouldStopEventPropagation(p),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(u),u.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader","enableAdvancedFilter"],()=>this.refresh()),u.addManagedPropertyListener("cellSelection",()=>this.refreshAria()),u.addManagedListeners(n,{colDefChanged:()=>this.refresh(),formulaRefChanged:()=>this.refresh(),headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});const h=()=>this.checkDisplayName();u.addManagedEventListeners({columnValueChanged:h,columnRowGroupChanged:h,columnPivotChanged:h,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),u.addDestroyFunc(()=>{this.refreshFunctions={},this.selectAllFeature=null,this.dragSourceElement=void 0,this.userCompDetails=null,this.userHeaderClasses.clear(),this.ariaDescriptionProperties.clear(),this.clearComponent()})}resizeHeader(e,t){this.beans.colResize?.resizeHeader(this.column,e,t)}getHeaderClassParams(){const{column:e,beans:t}=this,a=e.colDef;return I(t.gos,{colDef:a,column:e,floatingFilter:!1})}setupUserComp(){const e=this.lookupUserCompDetails();e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return Lb(this.beans.userCompFactory,t,e)}createParams(){const{menuSvc:e,sortSvc:t,colFilter:a,gos:o}=this.beans;return I(o,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!e?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!a&&(!this.openFilterEnabled||Ce(this.gos)),showColumnMenu:(i,n)=>{e?.showColumnMenu({column:this.column,buttonElement:i,positionBy:"button",onClosedCallback:n})},showColumnMenuAfterMouseClick:(i,n)=>{e?.showColumnMenu({column:this.column,mouseEvent:i,positionBy:"mouse",onClosedCallback:n})},showFilter:i=>{e?.showFilterMenu({column:this.column,buttonElement:i,containerType:"columnFilter",positionBy:"button"})},progressSort:i=>{t?.progressSort(this.column,!!i,"uiColumnSorted")},setSort:(i,n)=>{t?.setSortForColumn(this.column,ze(i),!!n,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(i,n)=>{o.assertModuleRegistered("Tooltip",3),this.setupTooltip(i,n)}})}setupSelectAll(e){const{selectionSvc:t}=this.beans;t&&(this.selectAllFeature=e.createOptionalManagedBean(t.createSelectAllFeature(this.column)),this.selectAllFeature?.setComp(this),e.addManagedPropertyListener("rowSelection",()=>{const a=t.createSelectAllFeature(this.column);a&&!this.selectAllFeature?(this.selectAllFeature=e.createManagedBean(a),this.selectAllFeature?.setComp(this),this.comp.refreshSelectAllGui()):this.selectAllFeature&&!a&&(this.comp.removeSelectAllGui(),this.selectAllFeature=this.destroyBean(this.selectAllFeature))}))}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===C.SPACE?this.selectAllFeature?.onSpaceKeyDown(e):e.key===C.ENTER?this.onEnterKeyDown(e):e.key===C.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){const{column:t,gos:a,sortable:o,beans:r}=this;let i=!1;(e.ctrlKey||e.metaKey)&&(i=this.showMenuOnKeyPress(e,!0)),i||(!e.altKey&&Et(a)?r.rangeSvc?.handleColumnSelection(t,e):o&&r.sortSvc?.progressSort(t,e.shiftKey,"uiColumnSorted"))}showMenuOnKeyPress(e,t){const a=this.comp.getUserCompInstance();return kg(a)&&a.onMenuKeyboardShortcut(t)?(e.preventDefault(),!0):!1}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription()),Sn()&&this.setActiveHeader(!0)}onFocusOut(e){this.eGui.contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderTooltip(this.tooltipFeature,this,e,t)}setupStylesFromColDef(){this.setRefreshFunction("headerStyles",this.refreshHeaderStyles.bind(this)),this.refreshHeaderStyles()}setupClassesFromColDef(){const e=()=>{const t=this.column.colDef,a=Gn(t,this.gos,this.column,null),o=this.userHeaderClasses;this.userHeaderClasses=new Set(a);for(const r of a)o.has(r)?o.delete(r):this.comp.toggleCss(r,!0);for(const r of o)this.comp.toggleCss(r,!1)};this.setRefreshFunction("headerClasses",e),e()}setDragSource(e){this.dragSourceElement=e,this.removeDragSource(),!(!e||!this.draggable)&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null)}updateState(){const{menuSvc:e}=this.beans;this.menuEnabled=!!e?.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=!!e?.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(e,t){this.refreshFunctions[e]=t}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria();for(const e of Object.values(this.refreshFunctions))e()}refreshHeaderComp(){const e=this.lookupUserCompDetails();if(!e)return;(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==e.componentClass?this.attemptHeaderCompRefresh(e.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.colDef;return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}setupWidth(e){const t=()=>{const a=this.column.getActualWidth();this.comp.setWidth(`${a}px`)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupMovingCss(e){const t=()=>{this.comp.toggleCss("ag-header-cell-moving",this.column.isMoving())};e.addManagedListeners(this.column,{movingChanged:t}),t()}setupMenuClass(e){const t=()=>{this.comp?.toggleCss("ag-column-menu-visible",this.column.isMenuVisible())};e.addManagedListeners(this.column,{menuVisibleChanged:t}),t()}setupSortableClass(e){const t=()=>{this.comp.toggleCss("ag-header-cell-sortable",!!this.sortable)};t(),this.setRefreshFunction("updateSortable",t),e.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(e){const t=()=>{const a=this.column.isFilterActive();this.comp.toggleCss("ag-header-cell-filtered",a),this.refreshAria()};e.addManagedListeners(this.column,{filterActiveChanged:t}),t()}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.toggleCss("ag-header-cell-wrap-text",t)};e(),this.setRefreshFunction("wrapText",e)}onHeaderHighlightChanged(){const e=this.column.getHighlighted(),t=e===0,a=e===1;this.comp.toggleCss("ag-header-highlight-before",t),this.comp.toggleCss("ag-header-highlight-after",a)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:a,beans:o}=this,r=Tn(this.beans),i=r.reduce((u,h)=>u+h,0)===0;if(a.toggleCss("ag-header-parent-hidden",i),!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),a.toggleCss("ag-header-span-height",!1),a.toggleCss("ag-header-span-total",!1);return}const{numberOfParents:n,isSpanningTotal:l}=this.column.getColumnGroupPaddingInfo();a.toggleCss("ag-header-span-height",n>0);const s=Ln(o);if(n===0){a.toggleCss("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${s}px`);return}a.toggleCss("ag-header-span-total",l);const c=(this.column.getFirstRealParent()?.getLevel()??-1)+1,d=r.length-c;let g=0;for(let u=0;u<d;u++)g+=r[r.length-1-u];e.style.setProperty("top",`${-g}px`),e.style.setProperty("height",`${s+g}px`)}refreshAriaSort(){let e=null;const{beans:t,column:a,comp:o,sortable:r,gos:i}=this;if(r){const n=this.getLocaleTextFunc(),l=t.sortSvc?.getDisplaySortForColumn(a)??null;o.setAriaSort(qm(l)),e=Et(i)?n("ariaSortableColumnWithCellSelection","Press ALT ENTER to sort"):n("ariaSortableColumn","Press ENTER to sort")}else o.setAriaSort();this.setAriaDescriptionProperty("sort",e)}refreshAriaMenu(){let e=null;this.menuEnabled&&(e=this.getLocaleTextFunc()("ariaMenuColumn","Press ALT DOWN to open column menu")),this.setAriaDescriptionProperty("menu",e)}refreshAriaFilterButton(){let e=null;const{openFilterEnabled:t,gos:a}=this;t&&!Ce(a)&&(e=this.getLocaleTextFunc()("ariaFilterColumn","Press CTRL ENTER to open filter")),this.setAriaDescriptionProperty("filterButton",e)}refreshAriaFiltered(){let e=null;this.column.isFilterActive()&&(e=this.getLocaleTextFunc()("ariaColumnFiltered","Column Filtered")),this.setAriaDescriptionProperty("filter",e)}refreshAriaCellSelection(){let e=null;const{gos:t,column:a}=this;Et(t)&&!pe(a)&&(e=this.getLocaleTextFunc()("ariaColumnCellSelection","Press Enter to toggle selection for all visible cells in this column")),this.setAriaDescriptionProperty("cellSelection",e)}setAriaDescriptionProperty(e,t){const a=this.ariaDescriptionProperties;t!=null?a.set(e,t):a.delete(e)}announceAriaDescription(){const{beans:e,eGui:t,ariaDescriptionProperties:a}=this;if(!t.contains(Q(e)))return;const o=Array.from(a.keys()).sort((r,i)=>r==="filter"?-1:i.charCodeAt(0)-r.charCodeAt(0)).map(r=>a.get(r)).join(". ");e.ariaAnnounce?.announceValue(o,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered(),this.refreshAriaCellSelection()}addColumnHoverListener(e){this.beans.colHover?.addHeaderColumnHoverListener(e,this.comp,this.column)}addActiveHeaderMouseListeners(e){const t=r=>this.handleMouseOverChange(r.type==="mouseenter"),a=()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},o=r=>this.handleContextMenuMouseEvent(r,void 0,this.column);e.addManagedListeners(this.eGui,{mouseenter:t,mouseleave:t,click:a,contextmenu:o})}handleMouseOverChange(e){this.setActiveHeader(e),this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(e){this.comp.toggleCss("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return kg(t)?t.getAnchorElementForMenu(e):this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function kg(e){return typeof e?.getAnchorElementForMenu=="function"&&typeof e.onMenuKeyboardShortcut=="function"}var Uw=0,qn=class extends y{constructor(e,t,a){super(),this.rowIndex=e,this.pinned=t,this.type=a,this.instanceId=Uw++,this.comp=null,this.allCtrls=[];let o="ag-header-row-column";a==="group"?o="ag-header-row-group":a==="filter"&&(o="ag-header-row-filter"),this.headerRowClass=`ag-header-row ${o}`}setRowIndex(e){this.rowIndex=e,this.comp?.setRowIndex(this.getAriaRowIndex()),this.onRowHeightChanged()}postConstruct(){this.isPrintLayout=se(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){return this.comp?this.allCtrls.every(e=>e.eGui!=null):!1}setComp(e,t,a=!0){this.comp=e,t=Ro(this,this.beans.context,t),a&&(this.setRowIndex(this.rowIndex),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners(t)}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){const t=this.onRowHeightChanged.bind(this),a=this.onDisplayedColumnsChanged.bind(this);e.addManagedEventListeners({columnResized:this.setWidth.bind(this),displayedColumnsChanged:a,virtualColumnsChanged:o=>this.onVirtualColumnsChanged(o.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,stylesChanged:t,advancedFilterEnabledChanged:t}),e.addManagedPropertyListener("domLayout",a),e.addManagedPropertyListener("ensureDomOrder",o=>this.isEnsureDomOrder=o.currentValue),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}onDisplayedColumnsChanged(){this.isPrintLayout=se(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}setWidth(){if(!this.comp)return;const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleCols:e}=this.beans;return this.isPrintLayout?this.pinned!=null?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){if(!this.comp)return;const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){let e=0;const t=Tn(this.beans);for(let r=0;r<t.length;r++){if(r===this.rowIndex&&this.type==="group")return{topOffset:e,rowHeight:t[r]};e+=t[r]}const a=Ln(this.beans);if(this.type==="column")return{topOffset:e,rowHeight:a};e+=a;const o=Bn(this.beans);return{topOffset:e,rowHeight:o}}onVirtualColumnsChanged(e=!1){if(!this.comp)return;const t=this.getUpdatedHeaderCtrls(),a=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,a,e)}getUpdatedHeaderCtrls(){const e=this.ctrlsById;this.ctrlsById=new Map;const t=this.getColumnsInViewport();for(const o of t)this.recycleAndCreateHeaderCtrls(o,this.ctrlsById,e);const a=o=>{const{focusSvc:r,visibleCols:i}=this.beans;return r.isHeaderWrapperFocused(o)?i.isVisible(o.column):!1};if(e)for(const[o,r]of e)a(r)?this.ctrlsById.set(o,r):this.destroyBean(r);return this.allCtrls=Array.from(this.ctrlsById.values()),this.allCtrls}getHeaderCellCtrls(){return this.allCtrls}recycleAndCreateHeaderCtrls(e,t,a){if(e.isEmptyGroup())return;const o=e.getUniqueId();let r;if(a&&(r=a.get(o),a.delete(o)),r&&r.column!=e&&(this.destroyBean(r),r=void 0),r==null)switch(this.type){case"filter":{r=this.createBean(this.beans.registry.createDynamicBean("headerFilterCellCtrl",!0,e,this));break}case"group":r=this.createBean(this.beans.registry.createDynamicBean("headerGroupCellCtrl",!0,e,this));break;default:r=this.createBean(new Ww(e,this));break}t.set(o,r)}getColumnsInViewport(){if(!this.isPrintLayout)return this.getComponentsToRender();if(this.pinned)return[];const e=[];for(const t of["left",null,"right"])e.push(...this.getComponentsToRender(t));return e}getComponentsToRender(e=this.pinned){return this.type==="group"?this.beans.colViewport.getHeadersToRender(e,this.rowIndex):this.beans.colViewport.getColumnHeadersToRender(e)}focusHeader(e,t){const a=this.allCtrls.find(r=>r.column==e);return a?a.focus(t):!1}destroy(){this.allCtrls=this.destroyBeans(this.allCtrls),this.ctrlsById=void 0,this.comp=null,super.destroy()}},Sg=class extends y{constructor(e){super(),this.pinned=e,this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[]}setComp(e,t){this.comp=e,this.eViewport=t;const{pinnedCols:a,ctrlsSvc:o,colModel:r,colMoves:i}=this.beans;this.setupCenterWidth(),a?.setupHeaderPinnedWidth(this),this.setupDragAndDrop(i,this.eViewport);const n=this.refresh.bind(this,!0);this.addManagedEventListeners({displayedColumnsChanged:n,advancedFilterEnabledChanged:n});const l=`${typeof this.pinned=="string"?this.pinned:"center"}Header`;o.register(l,this),r.ready&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const{focusSvc:t,filterManager:a,visibleCols:o}=this.beans;let r=0;const i=t.getFocusHeaderToUseAfterRefresh(),n=()=>{const g=o.headerGroupRowCount;r=g,e||(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls));const u=this.groupsRowCtrls.length;if(u!==g){if(u>g){for(let h=g;h<u;h++)this.destroyBean(this.groupsRowCtrls[h]);this.groupsRowCtrls.length=g;return}for(let h=u;h<g;h++){const p=this.createBean(new qn(h,this.pinned,"group"));this.groupsRowCtrls.push(p)}}},l=()=>{const g=r++;if(this.hidden){this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl);return}this.columnsRowCtrl==null||!e?(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.columnsRowCtrl=this.createBean(new qn(g,this.pinned,"column"))):this.columnsRowCtrl.rowIndex!==g&&this.columnsRowCtrl.setRowIndex(g)},s=()=>{this.includeFloatingFilter=!!a?.hasFloatingFilters()&&!this.hidden;const g=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){g();return}e||g();const u=r++;this.filtersRowCtrl?this.filtersRowCtrl.rowIndex!==u&&this.filtersRowCtrl.setRowIndex(u):this.filtersRowCtrl=this.createBean(new qn(u,this.pinned,"filter"))},c=this.getAllCtrls();n(),l(),s();const d=this.getAllCtrls();this.comp.setCtrls(d),this.restoreFocusOnHeader(t,i),c.length!==d.length&&this.beans.eventSvc.dispatchEvent({type:"headerRowsChanged"})}getHeaderCtrlForColumn(e){const t=a=>a?.getHeaderCellCtrls().find(o=>o.column===e);if(dt(e))return t(this.columnsRowCtrl);if(this.groupsRowCtrls.length!==0)for(let a=0;a<this.groupsRowCtrls.length;a++){const o=t(this.groupsRowCtrls[a]);if(o)return o}}getHtmlElementForColumnHeader(e){return this.getHeaderCtrlForColumn(e)?.eGui??null}getRowType(e){return this.getAllCtrls()[e]?.type}focusHeader(e,t,a){const r=this.getAllCtrls()[e];return r?r.focusHeader(t,a):!1}getGroupRowCount(){return this.groupsRowCtrls.length}getGroupRowCtrlAtIndex(e){return this.groupsRowCtrls[e]}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}destroy(){this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl),this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls),super.destroy()}setupDragAndDrop(e,t){const a=e?.createBodyDropTarget(this.pinned,t);a&&this.createManagedBean(a)}restoreFocusOnHeader(e,t){if(!t)return;const{column:a}=t;a.getPinned()==this.pinned&&e.focusHeaderPosition({headerPosition:t,scroll:!1})}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new Nn(e=>this.comp.setCenterWidth(`${e}px`),!0))}},jw={tag:"div",cls:"ag-pinned-left-header",role:"rowgroup"},Kw={tag:"div",cls:"ag-pinned-right-header",role:"rowgroup"},_w={tag:"div",cls:"ag-header-viewport",role:"rowgroup",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eCenterContainer",cls:"ag-header-container",role:"presentation"}]},Wn=class extends V{constructor(e){super(),this.eCenterContainer=E,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:a=>this.setDisplayed(a),setCtrls:a=>this.setCtrls(a),setCenterWidth:a=>this.eCenterContainer.style.width=a,setViewportScrollLeft:a=>this.getGui().scrollLeft=a,setPinnedContainerWidth:a=>{const o=this.getGui();o.style.width=a,o.style.maxWidth=a,o.style.minWidth=a}};this.createManagedBean(new Sg(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",a=e?jw:t?Kw:_w;this.setTemplate(a),this.eRowContainer=this.eCenterContainer!==E?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),e.getGui().remove()}setCtrls(e){const t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let a;const o=r=>{const i=r.getGui();i.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(i),a&&fc(this.eRowContainer,i,a),a=i};for(const r of e){const i=r.instanceId,n=t[i];delete t[i];const l=n||this.createBean(new Bw(r));this.headerRowComps[i]=l,this.rowCompsList.push(l),o(l)}for(const r of Object.values(t))this.destroyRowComp(r)}},Qw={tag:"div",cls:"ag-header",role:"presentation"},Yw=class extends V{constructor(){super(Qw)}postConstruct(){const e={toggleCss:(o,r)=>this.toggleCss(o,r),setHeightAndMinHeight:o=>{this.getGui().style.height=o,this.getGui().style.minHeight=o}};this.createManagedBean(new bg).setComp(e,this.getGui(),this.getFocusableElement());const a=o=>{this.createManagedBean(o),this.appendChild(o)};a(new Wn("left")),a(new Wn(null)),a(new Wn("right"))}},Zw={selector:"AG-HEADER-ROOT",component:Yw},Ue={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},Un=class extends y{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.gos.get("domLayout"),t={autoHeight:e==="autoHeight",normal:e==="normal",print:e==="print"},a=t.autoHeight?Ue.AUTO_HEIGHT:t.print?Ue.PRINT:Ue.NORMAL;this.view.updateLayoutClasses(a,t)}},xg=class extends V{constructor(e,t){super(),this.direction=t,this.eViewport=E,this.eContainer=E,this.hideTimeout=0,this.setTemplate(e)}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.toggleCss("ag-apple-scrollbar",Hd()||Mt())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=Vd(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.toggleCss("ag-scrollbar-active",!0),a=()=>this.toggleCss("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:a,touchend:a})}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),nt(this.beans,()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=0),this.toggleCss("ag-scrollbar-scrolling",!0))},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout(()=>{this.toggleCss("ag-scrollbar-scrolling",!1),this.hideTimeout=0},400)}})}attemptSettingScrollPosition(e){const t=this.eViewport;Mc(this,()=>Me(t),()=>this.setScrollPosition(e),100)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}},Jw={tag:"div",cls:"ag-body-horizontal-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eLeftSpacer",cls:"ag-horizontal-left-spacer"},{tag:"div",ref:"eViewport",cls:"ag-body-horizontal-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-horizontal-scroll-container"}]},{tag:"div",ref:"eRightSpacer",cls:"ag-horizontal-right-spacer"}]},Rg=class extends xg{constructor(){super(Jw,"horizontal"),this.eLeftSpacer=E,this.eRightSpacer=E,this.setScrollVisibleDebounce=0}wireBeans(e){this.visibleCols=e.visibleCols,this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.refreshCompBottom.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.beans.ctrlsSvc.register("fakeHScrollComp",this),this.createManagedBean(new Nn(t=>this.eContainer.style.width=`${t}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.beans.pinnedRowModel?.getPinnedBottomTotalHeight()??0;this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleSvc.verticalScrollShowing;let t=this.visibleCols.getDisplayedColumnsRightWidth();const a=!this.enableRtl&&e,o=this.scrollVisibleSvc.getScrollbarWidth();a&&(t+=o),He(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=o);let r=this.visibleCols.getColsLeftWidth();this.enableRtl&&e&&(r+=o),He(this.eLeftSpacer,r),this.eLeftSpacer.classList.toggle("ag-scroller-corner",r<=o)}setScrollVisible(){const e=this.scrollVisibleSvc.horizontalScrollShowing,t=this.invisibleScrollbar,a=this.gos.get("suppressHorizontalScroll"),o=e&&this.scrollVisibleSvc.getScrollbarWidth()||0,i=a?0:o===0&&t?16:o,n=()=>{this.setScrollVisibleDebounce=0,this.toggleCss("ag-scrollbar-invisible",t),ao(this.getGui(),i),ao(this.eViewport,i),ao(this.eContainer,i),i||this.eContainer.style.setProperty("min-height","1px"),this.setVisible(e,{skipAriaHidden:!0})};window.clearTimeout(this.setScrollVisibleDebounce),e?this.setScrollVisibleDebounce=window.setTimeout(n,100):n()}getScrollPosition(){return sr(this.eViewport,this.enableRtl)}setScrollPosition(e){Me(this.eViewport)||this.attemptSettingScrollPosition(e),eo(this.eViewport,e,this.enableRtl)}},Xw={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:Rg},Eg=class extends y{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this,this.beans.rowContainerHeight)})}onHeightChanged(e){const t=e.uiContainerHeight,a=t!=null?`${t}px`:"";this.eContainer.style.height=a,this.eViewport&&(this.eViewport.style.height=a)}},$w={tag:"div",cls:"ag-body-vertical-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eViewport",cls:"ag-body-vertical-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-vertical-scroll-container"}]}]},Fg=class extends xg{constructor(){super($w,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new Eg(this.eContainer));const{ctrlsSvc:e}=this.beans;e.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this,e)})}setScrollVisible(){const{scrollVisibleSvc:e}=this.beans,t=e.verticalScrollShowing,a=this.invisibleScrollbar,o=t&&e.getScrollbarWidth()||0,r=o===0&&a?16:o;this.toggleCss("ag-scrollbar-invisible",a),He(this.getGui(),r),He(this.eViewport,r),He(this.eContainer,r),this.setDisplayed(t,{skipAriaHidden:!0})}onRowContainerHeightChanged(e){const a=e.getGridBodyCtrl().eBodyViewport,o=this.getScrollPosition(),r=a.scrollTop;o!=r&&this.setScrollPosition(r,!0)}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(e,t){!t&&!Me(this.eViewport)&&this.attemptSettingScrollPosition(e),this.eViewport.scrollTop=e}},eC={selector:"AG-FAKE-VERTICAL-SCROLL",component:Fg},Mg=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(Mg||{}),Tt="Viewport",zg="fakeVScrollComp",jn=["fakeHScrollComp","centerHeader","topCenter","bottomCenter","stickyTopCenter","stickyBottomCenter"],Dg=100,Kn=150,tC=class extends y{constructor(e){super(),this.clearRetryListenerFncs=[],this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.lastIsHorizontalScrollShowing=!1,this.scrollTimer=0,this.isScrollActive=!1,this.isVerticalPositionInvalidated=!0,this.isHorizontalPositionInvalidated=!0,this.eBodyViewport=e,this.resetLastHScrollDebounced=te(this,()=>this.lastScrollSource[1]=null,Kn),this.resetLastVScrollDebounced=te(this,()=>this.lastScrollSource[0]=null,Kn)}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.animationFrameSvc=e.animationFrameSvc,this.visibleCols=e.visibleCols}destroy(){super.destroy(),this.clearRetryListenerFncs=[],window.clearTimeout(this.scrollTimer)}postConstruct(){this.enableRtl=this.gos.get("enableRtl");const e=this.invalidateVerticalScroll.bind(this),t=this.invalidateHorizontalScroll.bind(this);this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),bodyHeightChanged:e,scrollGapChanged:t}),this.addManagedElementListeners(this.eBodyViewport,{scroll:e}),this.ctrlsSvc.whenReady(this,a=>{this.centerRowsCtrl=a.center,this.fakeVScrollComp=a.fakeVScrollComp,this.fakeHScrollComp=a.fakeHScrollComp,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}invalidateHorizontalScroll(){this.isHorizontalPositionInvalidated=!0}invalidateVerticalScroll(){this.isVerticalPositionInvalidated=!0}addScrollListener(){this.addHorizontalScrollListeners(),this.addVerticalScrollListeners()}addHorizontalScrollListeners(){this.addManagedElementListeners(this.centerRowsCtrl.eViewport,{scroll:this.onHScroll.bind(this,Tt)});for(const e of jn){const t=this.ctrlsSvc.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){const e=this.gos.get("debounceVerticalScrollbar"),t=e?te(this,this.onVScroll.bind(this,Tt),Dg):this.onVScroll.bind(this,Tt),a=e?te(this,this.onVScroll.bind(this,zg),Dg):this.onVScroll.bind(this,zg);this.addManagedElementListeners(this.eBodyViewport,{scroll:t}),this.registerScrollPartner(this.fakeVScrollComp,a)}registerScrollPartner(e,t){e.onScrollCallback(t)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){this.centerRowsCtrl!=null&&(e===void 0&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft()),this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e)))}setScrollLeftForAllContainersExceptCurrent(e){for(const t of[...jn,Tt]){if(this.lastScrollSource[1]===t)continue;const a=this.getViewportForSource(t);eo(a,e,this.enableRtl)}}getViewportForSource(e){return e===Tt?this.centerRowsCtrl.eViewport:this.ctrlsSvc.get(e).eViewport}isControllingScroll(e,t){return this.lastScrollSource[t]==null?(t===0?this.lastScrollSource[0]=e:this.lastScrollSource[1]=e,!0):this.lastScrollSource[t]===e}onHScroll(e){if(!this.isControllingScroll(e,1))return;const t=this.centerRowsCtrl.eViewport,{scrollLeft:a}=t;if(this.shouldBlockScrollUpdate(1,a,!0))return;const o=sr(this.getViewportForSource(e),this.enableRtl);this.doHorizontalScroll(o),this.resetLastHScrollDebounced()}onVScroll(e){if(!this.isControllingScroll(e,0))return;const t=e===Tt?this.eBodyViewport.scrollTop:this.fakeVScrollComp.getScrollPosition();let a=t;if(this.shouldBlockScrollUpdate(0,a,!0))return;e===Tt?this.fakeVScrollComp.setScrollPosition(a):(this.eBodyViewport.scrollTop=t,a=this.eBodyViewport.scrollTop,this.invalidateVerticalScroll(),a!==t&&this.fakeVScrollComp.setScrollPosition(a,!0));const{animationFrameSvc:o}=this;o?.setScrollTop(a),this.nextScrollTop=a,o?.active?o.schedule():this.scrollGridIfNeeded(!0),this.resetLastVScrollDebounced()}doHorizontalScroll(e){const t=this.fakeHScrollComp.getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}isScrolling(){return this.isScrollActive}fireScrollEvent(e){const t={type:"bodyScroll",direction:e===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.isScrollActive=!0,this.eventSvc.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=window.setTimeout(()=>{this.scrollTimer=0,this.isScrollActive=!1,this.eventSvc.dispatchEvent({...t,type:"bodyScrollEnd"})},Kn)}shouldBlockScrollUpdate(e,t,a=!1){return a&&!Mt()?!1:e===0?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=lr(this.eBodyViewport),{scrollHeight:a}=this.eBodyViewport;return e<0||e+t>a}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:a}=this.centerRowsCtrl.eViewport;if(this.enableRtl){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>a}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){const e=this.scrollLeft;let t=!1;for(const a of jn)if(this.getViewportForSource(a).scrollLeft!==e){t=!0;break}t&&this.onHScroll(Tt)}scrollGridIfNeeded(e=!1){const t=this.scrollTop!=this.nextScrollTop;return t&&(this.scrollTop=this.nextScrollTop,e&&this.invalidateVerticalScroll(),this.redrawRowsAfterScroll()),t}setHorizontalScrollPosition(e,t=!1){const o=this.centerRowsCtrl.eViewport.scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(this.enableRtl?e=e>0?0:o:e=Math.min(Math.max(e,0),o)),eo(this.centerRowsCtrl.eViewport,Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.invalidateVerticalScroll(),this.eBodyViewport.scrollTop=e}getVScrollPosition(){if(!this.isVerticalPositionInvalidated){const{lastOffsetHeight:a,lastScrollTop:o}=this;return{top:o,bottom:o+a}}this.isVerticalPositionInvalidated=!1;const{scrollTop:e,offsetHeight:t}=this.eBodyViewport;return this.lastScrollTop=e,this.lastOffsetHeight=t,{top:e,bottom:e+t}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.isHorizontalPositionInvalidated&&(this.lastIsHorizontalScrollShowing=this.centerRowsCtrl.isHorizontalScrollShowing(),this.isHorizontalPositionInvalidated=!1),this.lastIsHorizontalScrollShowing}scrollHorizontally(e){const t=this.centerRowsCtrl.eViewport.scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.eViewport.scrollLeft-t}scrollToTop(){this.setVerticalScrollPosition(0)}ensureNodeVisible(e,t=null){const{rowModel:a}=this.beans,o=a.getRowCount();let r=-1;for(let i=0;i<o;i++){const n=a.getRow(i);if(typeof e=="function"){if(n&&e(n)){r=i;break}}else if(e===n||e===n.data){r=i;break}}r>=0&&this.ensureIndexVisible(r,t)}ensureIndexVisible(e,t,a=0){if(se(this.gos,"print"))return;const{rowModel:o}=this.beans,r=o.getRowCount();if(typeof e!="number"||e<0||e>=r){x(88,{index:e});return}this.clearRetryListeners();const{frameworkOverrides:i,pageBounds:n,rowContainerHeight:l,rowRenderer:s}=this.beans;i.wrapIncoming(()=>{const c=this.ctrlsSvc.getGridBodyCtrl(),d=o.getRow(e);let g,u,h=0;this.invalidateVerticalScroll();do{const{stickyTopHeight:p,stickyBottomHeight:f}=c,m=d.rowTop,v=d.rowHeight,w=n.getPixelOffset(),b=d.rowTop-w,k=b+d.rowHeight,S=this.getVScrollPosition(),R=l.divStretchOffset,M=S.top+R,L=S.bottom+R,O=L-M,N=l.getScrollPositionForPixel(b),B=l.getScrollPositionForPixel(k-O),K=Math.min((N+B)/2,b),W=M+p>b,ge=L-f<k;let ie=null;t==="top"?ie=N-p:t==="bottom"?ie=B+f:t==="middle"?ie=K:W?ie=N-p:ge&&(B-N>O?ie=N-p:ie=B+f),ie!==null&&(this.setVerticalScrollPosition(ie),s.redraw({afterScroll:!0})),g=m!==d.rowTop||v!==d.rowHeight,u=p!==c.stickyTopHeight||f!==c.stickyBottomHeight,h++}while((g||u)&&h<10);if(this.animationFrameSvc?.flushAllFrames(),a<10&&(d?.stub||!this.beans.rowAutoHeight?.areRowsMeasured())){const p=this.getVScrollPosition().top;this.clearRetryListenerFncs=this.addManagedEventListeners({bodyScroll:()=>{const f=this.getVScrollPosition().top;p!==f&&this.clearRetryListeners()},modelUpdated:()=>{this.clearRetryListeners(),!(e>=o.getRowCount())&&this.ensureIndexVisible(e,t,a+1)}})}})}clearRetryListeners(){for(const e of this.clearRetryListenerFncs)e();this.clearRetryListenerFncs=[]}ensureColumnVisible(e,t="auto"){const{colModel:a,frameworkOverrides:o}=this.beans,r=a.getCol(e);if(!r||r.isPinned()||!this.visibleCols.isColDisplayed(r))return;const i=this.getPositionedHorizontalScroll(r,t);o.wrapIncoming(()=>{i!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(i),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameSvc?.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:a,columnAfterEnd:o}=this.isColumnOutsideViewport(e),r=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),i=this.centerRowsCtrl.getCenterWidth(),n=this.enableRtl;let l=(n?a:o)||r,s=n?o:a;t!=="auto"&&(l=t==="start",s=t==="end");const c=t==="middle";if(l||s||c){const{colLeft:d,colMiddle:g,colRight:u}=this.getColumnBounds(e);return c?g-i/2:l?n?u:d:n?d-i:u-i}return null}isColumnOutsideViewport(e){const{start:t,end:a}=this.getViewportBounds(),{colLeft:o,colRight:r}=this.getColumnBounds(e),i=this.enableRtl,n=i?t>r:a<r,l=i?a<o:t>o;return{columnBeforeStart:n,columnAfterEnd:l}}getColumnBounds(e){const t=this.enableRtl,a=this.visibleCols.bodyWidth,o=e.getActualWidth(),r=e.getLeft(),i=t?-1:1,n=t?a-r:r,l=n+o*i,s=n+o/2*i;return{colLeft:n,colMiddle:s,colRight:l}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft(),a=t,o=e+t;return{start:a,end:o,width:e}}},Ag={horizontal:{overflow:e=>e.scrollWidth-e.clientWidth,scrollSize:e=>e.scrollWidth,clientSize:e=>e.clientWidth,opposite:"vertical"},vertical:{overflow:e=>e.scrollHeight-e.clientHeight,scrollSize:e=>e.scrollHeight,clientSize:e=>e.clientHeight,opposite:"horizontal"}};function aC(e,t,a=yn()||0,o,r){return Pg(e,t,"horizontal",a,o,r)}function oC(e,t,a=yn()||0,o,r){return Pg(e,t,"vertical",a,o,r)}function Pg(e,t,a,o,r,i){const n=Ag[a],l=Ag[n.opposite],s=r?Me(r):!0,c=i?Me(i):!0,d=n.overflow(e);if(d<=0)return!1;if(!t||o===0)return!0;const g=l.overflow(t);if(g<=0)return!0;if(d<=o){if(s&&c&&rC({candidateOverflow:g,candidateScrollSize:l.scrollSize(t),candidateClientSize:l.clientSize(t),scrollbarWidth:o}))return!1;const u=n.clientSize(e)+o;return n.scrollSize(e)<=u}return!0}function rC({candidateOverflow:e,candidateScrollSize:t,candidateClientSize:a,scrollbarWidth:o}){if(e<=0||e>o)return!1;const r=a+o;return t>a&&t<=r}var iC=class extends y{constructor(e){super(),this.centerContainerCtrl=e}wireBeans(e){this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const{beans:e,centerContainerCtrl:t,gridBodyCtrl:a}=this,o=()=>{nt(e,()=>{this.onCenterViewportResized()})};t.registerViewportResizeListener(o),a.registerBodyViewportResizeListener(o)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleSvc.updateScrollGap(),this.centerContainerCtrl.isViewportInTheDOMTree()){const{pinnedCols:e,colFlex:t}=this.beans;e?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const a=this.centerContainerCtrl.getCenterWidth();a!==this.centerWidth&&(this.centerWidth=a,t?.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.scrollFeature.checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=this.gridBodyCtrl.eBodyViewport,t=lr(e);this.bodyHeight!==t&&(this.bodyHeight=t,this.eventSvc.dispatchEvent({type:"bodyHeightChanged"}))}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){if(!this.isAlive())return;const e={horizontalScrollShowing:this.centerContainerCtrl.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleSvc.setScrollsVisible(e)}onHorizontalViewportChanged(){const{centerContainerCtrl:e,beans:t}=this,a=e.getCenterWidth(),o=e.getViewportScrollLeft();t.colViewport.setScrollPosition(a,o)}};function _n(e){return e.altKey||e.ctrlKey||e.metaKey?!1:e.key?.length===1}function Eo(e,t,a,o){const r=t.getColDef().cellRendererParams?.suppressMouseEventHandling;return Ig(e,t,a,o,r)}function nC(e,t,a,o){const r=t?.suppressMouseEventHandling;return Ig(e,void 0,a,o,r)}function Ig(e,t,a,o,r){return r?r(I(e,{column:t,node:a,event:o})):!1}function Tg(e,t,a){let o=t;for(;o;){const r=Zc(e,o,a);if(r)return r;o=o.parentElement}return null}var Br="cellCtrl";function Or(e,t){return Tg(e,t,Br)}var Nr="renderedRow";function Lg(e,t){return Tg(e,t,Nr)}function Qn(e,t,a,o,r){const i=o?o.colDef.suppressKeyboardEvent:void 0;if(!i)return!1;const n=I(e,{event:t,editing:r,column:o,node:a,data:a.data,colDef:o.colDef});return!!(i&&i(n))}function Bg(e){const{pinnedRowModel:t,rowModel:a,rangeSvc:o,visibleCols:r}=e;if(!o||r.allCols.length===0)return;const i=t?.isEmpty("top")??!0,n=t?.isEmpty("bottom")??!0,l=i?null:"top";let s,c;n?(s=null,c=a.getRowCount()-1):(s="bottom",c=t?.getPinnedBottomRowCount()??-1),o.setCellRange({rowStartIndex:0,rowStartPinned:l,rowEndIndex:c,rowEndPinned:s})}var lC=class extends y{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.beans.touchSvc?.mockRowContextMenu(this),this.editSvc=this.beans.editSvc}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){let e="mousedown";ur("pointerdown")?e="pointerdown":ur("touchstart")&&(e="touchstart");const t=["dblclick","contextmenu","mouseover","mouseout","click",e];for(const a of t){const o=this.processMouseEvent.bind(this,a);this.addManagedElementListeners(this.element,{[a]:o})}}processMouseEvent(e,t){if(!oo(this.beans,t)||Je(t))return;const{cellCtrl:a,rowCtrl:o}=this.getControlsForEventTarget(t.target);e==="contextmenu"?(a?.column&&a.dispatchCellContextMenuEvent(t),this.beans.contextMenuSvc?.handleContextMenuMouseEvent(t,void 0,o,a)):(a&&a.onMouseEvent(e,t),o&&o.onMouseEvent(e,t))}getControlsForEventTarget(e){const{gos:t}=this;return{cellCtrl:Or(t,e),rowCtrl:Lg(t,e)}}processKeyboardEvent(e,t){const{cellCtrl:a,rowCtrl:o}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(a?this.processCellKeyboardEvent(a,e,t):o?.isFullWidth()&&this.processFullWidthRowKeyboardEvent(o,e,t))}processCellKeyboardEvent(e,t,a){const o=this.editSvc?.isEditing(e,{withOpenEditor:!0})??!1;!Qn(this.gos,a,e.rowNode,e.column,o)&&t==="keydown"&&(!o&&this.beans.navigation?.handlePageScrollingKey(a)||e.onKeyDown(a),this.doGridOperations(a,o),_n(a)&&e.processCharacter(a)),t==="keydown"&&this.eventSvc.dispatchEvent(e.createEvent(a,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,a){const{rowNode:o}=e,{focusSvc:r,navigation:i,notesSvc:n}=this.beans,s=r.getFocusedCell()?.column;!Qn(this.gos,a,o,s,!1)&&t==="keydown"&&this.processFullWidthRowKeyDown(e,a,s,i,n),t==="keydown"&&this.eventSvc.dispatchEvent(e.createRowEvent("cellKeyDown",a))}processFullWidthRowKeyDown(e,t,a,o=this.beans.navigation,r=this.beans.notesSvc){switch(t.key){case C.PAGE_HOME:case C.PAGE_END:case C.PAGE_UP:case C.PAGE_DOWN:o?.handlePageScrollingKey(t,!0);return;case C.LEFT:case C.RIGHT:if(!this.gos.get("embedFullWidthRows"))return;case C.UP:case C.DOWN:e.onKeyboardNavigate(t);return;case C.F2:this.processFullWidthRowNoteShortcut(e,t,a,r);return;case C.TAB:e.onTabKeyDown(t);return;default:}}processFullWidthRowNoteShortcut(e,t,a,o=this.beans.notesSvc){if(!t.shiftKey||!o?.hasDataSource())return;const r=e.rowNode,i=e.findFullWidthInfoForEvent(t);let n;if(i){const{pinned:s}=i;n={rowNode:r,location:"fullWidthRow",pinned:s==="left"||s==="right"?s:void 0}}else a&&(n={rowNode:r,column:a});if(!n)return;const l=o.getNoteAccess(n);l&&(!l.isSuppressed||l.canView)&&(o.showNote(l.params,!0),t.preventDefault())}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!oo(this.beans,e))return;const a=Rd(e),{clipboardSvc:o,undoRedo:r}=this.beans;if(a===C.A)return this.onCtrlAndA(e);if(a===C.C)return this.onCtrlAndC(o,e);if(a===C.D)return this.onCtrlAndD(o,e);if(a===C.V)return this.onCtrlAndV(o,e);if(a===C.X)return this.onCtrlAndX(o,e);if(a===C.Y)return this.onCtrlAndY(r);if(a===C.Z)return this.onCtrlAndZ(r,e)}onCtrlAndA(e){const{beans:{rowModel:t,rangeSvc:a,selectionSvc:o},gos:r}=this;a&&Qe(r)&&!Uv(r)&&t.isRowsToRender()?Bg(this.beans):o&&o.selectAllRowNodes({source:"keyboardSelectAll",selectAll:rd(r)}),e.preventDefault()}onCtrlAndC(e,t){if(!e||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:a}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(a,{withOpenEditor:!0})||(t.preventDefault(),e.copyToClipboard())}onCtrlAndX(e,t){if(!e||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:a}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(a,{withOpenEditor:!0})||(t.preventDefault(),e.cutToClipboard(void 0,"ui"))}onCtrlAndV(e,t){const{cellCtrl:a}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(a,{withOpenEditor:!0})||e&&!this.gos.get("suppressClipboardPaste")&&e.pasteFromClipboard()}onCtrlAndD(e,t){e&&!this.gos.get("suppressClipboardPaste")&&e.copyRangeDown(),t.preventDefault()}onCtrlAndZ(e,t){!this.gos.get("undoRedoCellEditing")||!e||(t.preventDefault(),t.shiftKey?e.redo("ui"):e.undo("ui"))}onCtrlAndY(e){e?.redo("ui")}},Hr=e=>e.topRowCtrls,Gr=e=>e.getStickyTopRowCtrls(),Vr=e=>e.getStickyBottomRowCtrls(),qr=e=>e.bottomRowCtrls,Wr=e=>e.allRowCtrls,Yn=e=>e.getCtrls("top"),Zn=e=>e.getCtrls("center"),Jn=e=>e.getCtrls("bottom"),sC={center:{type:"center",name:"center-cols",getRowCtrls:Wr,getSpannedRowCtrls:Zn},left:{type:"left",name:"pinned-left-cols",pinnedType:"left",getRowCtrls:Wr,getSpannedRowCtrls:Zn},right:{type:"right",name:"pinned-right-cols",pinnedType:"right",getRowCtrls:Wr,getSpannedRowCtrls:Zn},fullWidth:{type:"fullWidth",name:"full-width",fullWidth:!0,getRowCtrls:Wr},topCenter:{type:"center",name:"floating-top",getRowCtrls:Hr,getSpannedRowCtrls:Yn},topLeft:{type:"left",name:"pinned-left-floating",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:Hr,getSpannedRowCtrls:Yn},topRight:{type:"right",name:"pinned-right-floating",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:Hr,getSpannedRowCtrls:Yn},topFullWidth:{type:"fullWidth",name:"floating-top-full-width",fullWidth:!0,getRowCtrls:Hr},stickyTopCenter:{type:"center",name:"sticky-top",getRowCtrls:Gr},stickyTopLeft:{type:"left",name:"pinned-left-sticky-top",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:Gr},stickyTopRight:{type:"right",name:"pinned-right-sticky-top",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:Gr},stickyTopFullWidth:{type:"fullWidth",name:"sticky-top-full-width",fullWidth:!0,getRowCtrls:Gr},stickyBottomCenter:{type:"center",name:"sticky-bottom",getRowCtrls:Vr},stickyBottomLeft:{type:"left",name:"pinned-left-sticky-bottom",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:Vr},stickyBottomRight:{type:"right",name:"pinned-right-sticky-bottom",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:Vr},stickyBottomFullWidth:{type:"fullWidth",name:"sticky-bottom-full-width",fullWidth:!0,getRowCtrls:Vr},bottomCenter:{type:"center",name:"floating-bottom",getRowCtrls:qr,getSpannedRowCtrls:Jn},bottomLeft:{type:"left",name:"pinned-left-floating-bottom",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:qr,getSpannedRowCtrls:Jn},bottomRight:{type:"right",name:"pinned-right-floating-bottom",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:qr,getSpannedRowCtrls:Jn},bottomFullWidth:{type:"fullWidth",name:"floating-bottom-full-width",fullWidth:!0,getRowCtrls:qr}};function Xn(e){return`ag-${La(e).name}-viewport`}function $n(e){const t=La(e);return t.container??`ag-${t.name}-container`}function Og(e){return`ag-${La(e).name}-spanned-cells-container`}function La(e){return sC[e]}var cC=["topCenter","topLeft","topRight"],dC=["bottomCenter","bottomLeft","bottomRight"],gC=["center","left","right"],uC=["center","left","right","fullWidth"],hC=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],pC=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],fC=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],Ng=["stickyTopCenter","stickyTopLeft","stickyTopRight"],Hg=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],mC=[...Ng,"stickyTopFullWidth",...Hg,"stickyBottomFullWidth"],vC=[...cC,...dC,...gC,...Ng,...Hg],Gg=class extends y{constructor(e){super(),this.name=e,this.visible=!0,this.EMPTY_CTRLS=[],this.options=La(e)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new iC(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.beans.ctrlsSvc.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}setComp(e,t,a,o){this.comp=e,this.eContainer=t,this.eSpannedContainer=a,this.eViewport=o,this.createManagedBean(new lC(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();const{pinnedCols:r,rangeSvc:i}=this.beans,n=()=>this.onPinnedWidthChanged();this.forContainers(pC,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(r?.createPinnedWidthFeature(!0,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:n})}),this.forContainers(fC,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(r?.createPinnedWidthFeature(!1,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:n})}),this.forContainers(uC,()=>this.createManagedBean(new Eg(this.eContainer,this.name==="center"?o:void 0))),i&&this.forContainers(vC,()=>this.createManagedBean(i.createDragListenerFeature(this.eContainer))),this.forContainers(hC,()=>this.createManagedBean(new Nn(l=>this.comp.setContainerWidth(`${l}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}addListeners(){const{spannedRowRenderer:e,gos:t}=this.beans,a=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({displayedColumnsChanged:a,displayedColumnsWidthChanged:a,displayedRowsChanged:o=>this.onDisplayedRowsChanged(o.afterScroll)}),a(),this.onDisplayedRowsChanged(),e&&this.options.getSpannedRowCtrls&&t.get("enableCellSpan")&&this.addManagedListeners(e,{spannedRowsUpdated:()=>{const o=this.options.getSpannedRowCtrls(e);o&&this.comp.setSpannedRowCtrls(o,!1)}})}listenOnDomOrder(){if(mC.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const t=()=>{const a=this.gos.get("ensureDomOrder"),o=se(this.gos,"print");this.comp.setDomOrder(a||o)};this.addManagedPropertyListener("domLayout",t),t()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const{dragSvc:e}=this.beans;if(!e)return;const t=a=>{e.dragging&&a.cancelable&&a.preventDefault()};this.eContainer.addEventListener("touchmove",t,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",t))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),a=this.getCenterViewportScrollLeft();this.beans.colViewport.setScrollPosition(t,a,e)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return ka(this.eViewport)}getCenterViewportScrollLeft(){return sr(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=it(this.beans,this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return pc(this.eViewport)}getViewportScrollLeft(){return sr(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){const{beans:e,gos:t,eViewport:a}=this,o=t.get("alwaysShowHorizontalScroll"),{ctrlsSvc:r}=e,i=r.getGridBodyCtrl()?.eBodyViewport,n=r.get("fakeHScrollComp")?.getGui(),l=r.get("fakeVScrollComp")?.getGui();return o||aC(a,i,void 0,n,l)}setHorizontalScroll(e){this.comp.setHorizontalScroll(e)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){eo(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(this.options.pinnedType!=null)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.beans.rowRenderer);if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const a=se(this.gos,"print"),r=this.gos.get("embedFullWidthRows")||a,i=t.filter(n=>{const l=n.isFullWidth();return this.options.fullWidth?!r&&l:r||!l});this.comp.setRowCtrls({rowCtrls:i,useFlushSync:e})}},Vg="ag-force-vertical-scroll",bC="ag-selectable",wC="ag-column-moving",qg=class extends y{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.colModel=e.colModel,this.scrollVisibleSvc=e.scrollVisibleSvc,this.pinnedRowModel=e.pinnedRowModel,this.filterManager=e.filterManager,this.rowGroupColsSvc=e.rowGroupColsSvc}setComp(e,t,a,o,r,i,n){this.comp=e,this.eGridBody=t,this.eBodyViewport=a,this.eTop=o,this.eBottom=r,this.eStickyTop=i,this.eStickyBottom=n,this.eCenterColsViewport=a.querySelector(`.${Xn("center")}`),this.eFullWidthContainer=a.querySelector(`.${$n("fullWidth")}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",l=>this.setCellTextSelection(l.currentValue)),this.createManagedBean(new Un(this.comp)),this.scrollFeature=this.createManagedBean(new tC(a)),this.beans.rowDragSvc?.setupRowDrag(a,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([o,a,r,i,n]),this.setGridRootRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),this.filterManager?.setupAdvFilterHeaderComp(o),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){const e=this.setFloatingHeights.bind(this),t=this.setGridRootRole.bind(this),a=this.toggleRowResizeStyles.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.updateScrollingClasses.bind(this),pinnedRowDataChanged:e,pinnedHeightChanged:e,pinnedRowsChanged:e,headerHeightChanged:this.setStickyTopOffsetTop.bind(this),columnRowGroupChanged:t,columnPivotChanged:t,rowResizeStarted:a,rowResizeEnded:a}),this.addManagedPropertyListener("treeData",t)}toggleRowResizeStyles(e){const t=e.type==="rowResizeStarted";this.eBodyViewport.classList.toggle("ag-prevent-animation",t)}onGridColumnsChanged(){const e=this.beans.colModel.getCols();this.comp.setColumnCount(e.length)}onScrollVisibilityChanged(){const{scrollVisibleSvc:e}=this,t=e.verticalScrollShowing;this.setVerticalScrollPaddingVisible(t),this.setStickyWidth(t),this.setStickyBottomOffsetBottom();const a=t&&e.getScrollbarWidth()||0,o=Vd()?16:0,r=`calc(100% + ${a+o}px)`;nt(this.beans,()=>this.comp.setBodyViewportWidth(r)),this.updateScrollingClasses()}setGridRootRole(){const{rowGroupColsSvc:e,colModel:t,gos:a}=this;let o=a.get("treeData");if(!o){const r=t.pivotMode;o=(e?e.columns.length:0)>=(r?2:1)}this.comp.setGridRootRole(o?"treegrid":"grid")}addFocusListeners(e){for(const t of e)this.addManagedElementListeners(t,{focusin:a=>{const{target:o}=a,r=Yt(o,"ag-root",t);t.classList.toggle("ag-has-focus",!r)},focusout:a=>{const{target:o,relatedTarget:r}=a,i=t.contains(r),n=Yt(r,"ag-root",t);Yt(o,"ag-root",t)||(!i||n)&&t.classList.remove("ag-has-focus")}})}setColumnMovingCss(e){this.comp.setColumnMovingCss(wC,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(bC,e)}updateScrollingClasses(){const{eGridBody:{classList:e},scrollVisibleSvc:t}=this;e.toggle("ag-body-vertical-content-no-gap",!t.verticalScrollGap),e.toggle("ag-body-horizontal-content-no-gap",!t.horizontalScrollGap)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){this.beans.editSvc?.addStopEditingWhenGridLosesFocus([this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom])}updateRowCount(){const e=(this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.filterManager?.getHeaderRowCount()??0),{rowModel:t}=this.beans,a=t.isLastRowIndexKnown()?t.getRowCount():-1,o=a===-1?-1:e+a;this.comp.setRowCount(o)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const{gos:e,comp:t,ctrlsSvc:a}=this,o=e.get("alwaysShowVerticalScroll"),r=o?Vg:null,i=se(e,"normal");t.setAlwaysVerticalScrollClass(r,o);const n=a.get("center")?.eViewport,l=a.get("fakeHScrollComp")?.getGui(),s=a.get("fakeVScrollComp")?.getGui();return o||i&&oC(this.eBodyViewport,n,void 0,s,l)}setupRowAnimationCssClass(){const{rowContainerHeight:e,environment:t}=this.beans;let a=t.sizesMeasured;const o=()=>{const r=a&&ea(this.gos)&&!e.stretching,i=r?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(i,r)};o(),this.addManagedEventListeners({heightScaleChanged:o}),this.addManagedPropertyListener("animateRows",o),this.addManagedEventListeners({stylesChanged:()=>{!a&&t.sizesMeasured&&(a=!0,o())}})}addBodyViewportListener(){const{eBodyViewport:e,eStickyTop:t,eStickyBottom:a,eTop:o,eBottom:r,beans:{popupSvc:i,touchSvc:n}}=this,l=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(e,{contextmenu:l}),n?.mockBodyContextMenu(this,l),this.addManagedElementListeners(e,{wheel:this.onBodyViewportWheel.bind(this,i)});const s=this.onStickyWheel.bind(this);for(const d of[t,a,o,r])this.addManagedElementListeners(d,{wheel:s});const c=this.onHorizontalWheel.bind(this);for(const d of["left","right","topLeft","topRight","bottomLeft","bottomRight"])this.addManagedElementListeners(this.ctrlsSvc.get(d).eContainer,{wheel:c});this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:e=>this.onFullWidthContainerWheel(e)})}onFullWidthContainerWheel(e){const{deltaX:t,deltaY:a,shiftKey:o}=e;(o||Math.abs(t)>Math.abs(a))&&oo(this.beans,e)&&this.scrollGridBodyToMatchEvent(e)}onStickyWheel(e){const{deltaY:t}=e;this.scrollVertically(t)>0&&e.preventDefault()}onHorizontalWheel(e){const{deltaX:t,deltaY:a,shiftKey:o}=e;(o||Math.abs(t)>Math.abs(a))&&this.scrollGridBodyToMatchEvent(e)}scrollGridBodyToMatchEvent(e){const{deltaX:t,deltaY:a}=e;e.preventDefault(),this.eCenterColsViewport.scrollBy({left:t||a})}onBodyViewportContextMenu(e,t,a){if(!e&&!a)return;this.gos.get("preventDefaultOnContextMenu")&&(e||a).preventDefault();const{target:o}=e||t;(o===this.eBodyViewport||o===this.ctrlsSvc.get("center").eViewport)&&this.beans.contextMenuSvc?.showContextMenu({mouseEvent:e,touchEvent:a,value:null,anchorToElement:this.eGridBody,source:"ui"})}onBodyViewportWheel(e,t){this.gos.get("suppressScrollWhenPopupsAreOpen")&&e?.hasAnchoredPopup()&&t.preventDefault()}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.scrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}setFloatingHeights(){const{pinnedRowModel:e,beans:{environment:t}}=this,a=e?.getPinnedTopTotalHeight(),o=e?.getPinnedBottomTotalHeight(),r=t.getPinnedRowBorderWidth(),i=t.getRowBorderWidth(),n=r-i,l=a?n+a:0,s=o?n+o:0;this.comp.setTopHeight(l),this.comp.setBottomHeight(s),this.comp.setTopInvisible(l<=0),this.comp.setBottomInvisible(s<=0),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}setStickyWidth(e){if(!e)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const t=this.scrollVisibleSvc.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`)}}setStickyTopOffsetTop(){const t=this.ctrlsSvc.get("gridHeaderCtrl").headerHeight+(this.filterManager?.getHeaderHeight()??0),a=this.pinnedRowModel?.getPinnedTopTotalHeight()??0;let o=0;t>0&&(o+=t),a>0&&(o+=a),o>0&&(o+=1),this.comp.setStickyTopTop(`${o}px`)}setStickyBottomOffsetBottom(){const{pinnedRowModel:e,scrollVisibleSvc:t,comp:a}=this,o=e?.getPinnedBottomTotalHeight()??0,i=t.horizontalScrollShowing&&t.getScrollbarWidth()||0,n=o+i;a.setStickyBottomBottom(`${n}px`)}};function re(e){return yt(e)}var CC=class extends V{constructor(e,t,a,o,r){super(),this.cellCtrl=t,this.rowResizerElement=null,this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.gos=e.gos,this.column=t.column,this.rowNode=t.rowNode,this.eRow=o;const i=re({tag:"div",role:t.getCellAriaRole(),attrs:{"comp-id":`${this.getCompId()}`,"col-id":t.column.colIdSanitised}});this.eCell=i;let n;t.isCellSpanning()?(n=re({tag:"div",cls:"ag-spanned-cell-wrapper",role:"presentation"}),n.appendChild(i),this.setTemplateFromElement(n)):this.setTemplateFromElement(i),this.cellCssManager=new un(()=>i),this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const l={toggleCss:(s,c)=>this.cellCssManager.toggleCss(s,c),setUserStyles:s=>to(i,s),getFocusableElement:()=>i,setIncludeSelection:s=>this.includeSelection=s,setIncludeRowDrag:s=>this.includeRowDrag=s,setIncludeDndSource:s=>this.includeDndSource=s,setRowResizerElement:s=>this.setRowResizerElement(s),setRenderDetails:(s,c,d)=>this.setRenderDetails(s,c,d),setEditDetails:(s,c,d)=>this.setEditDetails(s,c,d),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue(),refreshEditStyles:(s,c)=>this.refreshEditStyles(s,c)};t.setComp(l,i,n,this.eCellWrapper,a,r,void 0)}getParentOfValue(){return this.eCellValue??this.eCellWrapper??this.eCell}setRowResizerElement(e){this.rowResizerElement&&Ee(this.rowResizerElement),this.rowResizerElement=e,e&&this.eCell.appendChild(e)}setRenderDetails(e,t,a){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const r=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(a||r)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t)),this.rowDraggingComp?.refreshVisibility(),this.rowResizerElement&&!this.rowResizerElement.parentElement&&this.eCell.appendChild(this.rowResizerElement)}setEditDetails(e,t,a){e?this.createCellEditorInstance(e,t,a):this.destroyEditor()}removeControls(){const e=this.beans.context;this.checkboxSelectionComp=e.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=e.destroyBean(this.dndSourceComp),this.rowDraggingComp=e.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,a=t||this.forceWrapper,o=a&&this.eCellWrapper==null;o&&(this.eCellWrapper=re({tag:"div",cls:"ag-cell-wrapper",role:"presentation"}),this.eCell.appendChild(this.eCellWrapper));const r=!a&&this.eCellWrapper!=null;r&&(Ee(this.eCellWrapper),this.eCellWrapper=void 0),this.cellCssManager.toggleCss("ag-cell-value",!a);const i=!e&&a,n=i&&this.eCellValue==null;if(n){const c=this.cellCtrl.getCellValueClass();this.eCellValue=re({tag:"span",cls:c,role:"presentation"}),this.eCellWrapper.appendChild(this.eCellValue)}const l=!i&&this.eCellValue!=null;l&&(Ee(this.eCellValue),this.eCellValue=void 0);const s=o||r||n||l;return s&&this.removeControls(),!e&&t&&this.addControls(),s}addControls(){const{cellCtrl:e,eCellWrapper:t,eCellValue:a,includeRowDrag:o,includeDndSource:r,includeSelection:i}=this,n=l=>{l&&t.insertBefore(l.getGui(),a)};o&&this.rowDraggingComp==null&&(this.rowDraggingComp=e.createRowDragComp(),n(this.rowDraggingComp)),r&&this.dndSourceComp==null&&(this.dndSourceComp=e.createDndSource(),n(this.dndSourceComp)),i&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=e.createSelectionCheckbox(),n(this.checkboxSelectionComp))}createCellEditorInstance(e,t,a){const o=this.editorVersion,r=e.newAgStackInstance(),{params:i}=e;r.then(l=>this.afterCellEditorCreated(o,l,i,t,a)),_(this.cellEditor)&&i.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();le(t);const a=_t(e);a!=null&&(t.textContent=a)}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),Ee(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;(this.cellEditorPopupWrapper?.getGui().contains(Q(this.beans))||this.cellCtrl.hasBrowserFocus())&&this.eCell.focus({preventScroll:!0}),this.hideEditorPopup?.(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),Ee(this.cellEditorGui),this.cellCtrl.disableEditorTooltipFeature(),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer?.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){const t=this.rendererVersion,a=i=>n=>{if(this.rendererVersion!==t||!this.isAlive())return;const s=i.newAgStackInstance(),c=this.afterCellRendererCreated.bind(this,t,i.componentClass);s?.then(c)},{animationFrameSvc:o}=this.beans;let r;if(o?.active&&this.firstRender?r=(i,n=!1)=>{o.createTask(a(i),this.rowNode.rowIndex,"p2",i.componentFromFramework,n)}:r=i=>a(i)(),e.params?.deferRender&&!this.cellCtrl.rowNode.group){const{loadingComp:i,onReady:n}=this.cellCtrl.getDeferLoadingCellRenderer();i&&(r(i),n.then(()=>r(e,!0)))}else r(e)}afterCellRendererCreated(e,t,a){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(a);return}this.cellRenderer=a,this.cellRendererClass=t;const r=a.getGui();if(this.cellRendererGui=r,r!=null){const i=this.getParentOfValue();le(i),i.appendChild(r)}}afterCellEditorCreated(e,t,a,o,r){const i=e!==this.editorVersion,{context:n}=this.beans;if(i){n.destroyBean(t);return}if(t.isCancelBeforeStart?.()){n.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){x(97,{colId:this.column.getId()}),n.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const s=o||t.isPopup?.();s?this.addPopupCellEditor(a,r):this.addInCellEditor(),this.refreshEditStyles(!0,s),t.afterGuiAttached?.(),this.cellCtrl.enableEditorTooltipFeature(t),this.cellCtrl.cellEditorAttached()}refreshEditStyles(e,t){const{cellCssManager:a}=this;a.toggleCss("ag-cell-inline-editing",e&&!t),a.toggleCss("ag-cell-popup-editing",e&&!!t),a.toggleCss("ag-cell-not-inline-editing",!e||!!t)}addInCellEditor(){const{eCell:e}=this;e.contains(Q(this.beans))&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),le(this.getParentOfValue()),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){const{gos:a,context:o,popupSvc:r,editSvc:i}=this.beans;a.get("editType")==="fullRow"&&x(98);const n=this.cellEditorPopupWrapper=o.createBean(i.createPopupEditorWrapper(e)),{cellEditor:l,cellEditorGui:s,eCell:c,rowNode:d,column:g,cellCtrl:u}=this,h=n.getGui();s&&h.appendChild(s);const p=a.get("stopEditingWhenCellsLoseFocus"),f=t??l.getPopupPosition?.()??"over",m=a.get("enableRtl"),v={ePopup:h,additionalParams:{column:g,rowNode:d},type:"popupCellEditor",eventSource:c,position:f,alignSide:m?"right":"left",keepWithinBounds:!0},w=r.positionPopupByComponent.bind(r,v),b=r.addPopup({modal:p,eChild:h,closeOnEsc:!0,closedCallback:k=>{u.onPopupEditorClosed(k)},anchorToElement:c,positionCallback:w,ariaOwns:c});b&&(this.hideEditorPopup=b.hideFunc)}detach(){this.getGui().remove()}destroy(){this.destroyRenderer(),this.destroyEditor(),this.removeControls(),super.destroy()}},yC=class extends V{constructor(e,t,a){super(),this.cellComps=new Map,this.beans=t,this.rowCtrl=e;const o=re({tag:"div",role:"row",attrs:{"comp-id":`${this.getCompId()}`}});this.setInitialStyle(o,a),this.setTemplateFromElement(o);const r=o.style;this.domOrder=this.rowCtrl.getDomOrder();const i={setDomOrder:n=>this.domOrder=n,setCellCtrls:n=>this.setCellCtrls(n),showFullWidth:n=>this.showFullWidth(n),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,getFullWidthCellRendererParams:()=>this.fullWidthCellRendererParams,toggleCss:(n,l)=>this.toggleCss(n,l),setUserStyles:n=>to(o,n),setTop:n=>r.top=n,setTransform:n=>r.transform=n,setRowIndex:n=>o.setAttribute("row-index",n),setRowId:n=>o.setAttribute("row-id",n),setRowBusinessKey:n=>o.setAttribute("row-business-key",n),refreshFullWidth:n=>{const l=n();return this.fullWidthCellRendererParams=l,this.fullWidthCellRenderer?.refresh?.(l)??!1}};e.setComp(i,this.getGui(),a,void 0),this.addDestroyFunc(()=>{e.unsetComp(a)})}setInitialStyle(e,t){const a=this.rowCtrl.getInitialTransform(t);if(a)e.style.setProperty("transform",a);else{const o=this.rowCtrl.getInitialRowTop(t);o&&e.style.setProperty("top",o)}}showFullWidth(e){const t=o=>{if(this.isAlive()){const r=o.getGui();this.getGui().appendChild(r),this.rowCtrl.setupDetailRowAutoHeight(r),this.setFullWidthRowComp(o,e.params)}else this.beans.context.destroyBean(o)};e.newAgStackInstance().then(t)}setCellCtrls(e){const t=new Map(this.cellComps);for(const a of e){const o=a.instanceId;this.cellComps.has(o)?t.delete(o):this.newCellComp(a)}this.destroyCells(t),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];for(const a of e){const o=this.cellComps.get(a.instanceId);o&&t.push(o.getGui())}mc(this.getGui(),t)}newCellComp(e){const t=this.beans.editSvc?.isEditing(e,{withOpenEditor:!0})??!1,a=new CC(this.beans,e,this.rowCtrl.printLayout,this.getGui(),t);this.cellComps.set(e.instanceId,a),this.getGui().appendChild(a.getGui())}destroy(){super.destroy(),this.destroyCells(this.cellComps)}setFullWidthRowComp(e,t){this.fullWidthCellRenderer=e,this.fullWidthCellRendererParams=t,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer),this.fullWidthCellRendererParams=void 0})}destroyCells(e){for(const t of e.values()){if(!t)continue;const a=t.cellCtrl.instanceId;this.cellComps.get(a)===t&&(t.detach(),t.destroy(),this.cellComps.delete(a))}}};function kC(e,t,a){const o=!!a.gos.get("enableCellSpan")&&!!t.getSpannedRowCtrls,r={tag:"div",ref:"eContainer",cls:$n(e),role:"rowgroup"};if(t.type==="center"||o){const i={tag:"div",ref:"eSpannedContainer",cls:`ag-spanning-container ${Og(e)}`,role:"presentation"};return r.role="presentation",{tag:"div",ref:"eViewport",cls:`ag-viewport ${Xn(e)}`,role:"rowgroup",children:[r,o?i:null]}}return r}var SC=class extends V{constructor(e){super(),this.eViewport=E,this.eContainer=E,this.eSpannedContainer=E,this.rowCompsNoSpan={},this.rowCompsWithSpan={},this.name=e?.name,this.options=La(this.name)}postConstruct(){this.setTemplate(kC(this.name,this.options,this.beans));const e={setHorizontalScroll:a=>this.eViewport.scrollLeft=a,setViewportHeight:a=>this.eViewport.style.height=a,setRowCtrls:({rowCtrls:a})=>this.setRowCtrls(a),setSpannedRowCtrls:a=>this.setRowCtrls(a,!0),setDomOrder:a=>{this.domOrder=a},setContainerWidth:a=>{this.eContainer.style.width=a,this.eSpannedContainer&&(this.eSpannedContainer.style.width=a)},setOffsetTop:a=>{const o=`translateY(${a})`;this.eContainer.style.transform=o,this.eSpannedContainer&&(this.eSpannedContainer.style.transform=o)}};this.createManagedBean(new Gg(this.name)).setComp(e,this.eContainer,this.eSpannedContainer,this.eViewport)}destroy(){this.setRowCtrls([]),this.setRowCtrls([],!0),super.destroy(),this.lastPlacedElement=null}setRowCtrls(e,t){const{beans:a,options:o}=this,r=t?this.eSpannedContainer:this.eContainer,i=t?{...this.rowCompsWithSpan}:{...this.rowCompsNoSpan},n={};t?this.rowCompsWithSpan=n:this.rowCompsNoSpan=n,this.lastPlacedElement=null;const l=[];for(const s of e){const c=s.instanceId,d=i[c];let g;if(d)g=d,delete i[c];else{if(!s.rowNode.displayed)continue;g=new yC(s,a,o.type)}n[c]=g,l.push([g,!d])}this.removeOldRows(Object.values(i)),this.addRowNodes(l,r)}addRowNodes(e,t){const{domOrder:a}=this;for(const[o,r]of e){const i=o.getGui();a?this.ensureDomOrder(i,t):r&&t.appendChild(i)}}removeOldRows(e){for(const t of e)t.getGui().remove(),t.destroy()}ensureDomOrder(e,t){fc(t,e,this.lastPlacedElement),this.lastPlacedElement=e}},xC={selector:"AG-ROW-CONTAINER",component:SC};function Fo(e,t){return t.map(a=>{const o=`e${a[0].toUpperCase()+a.substring(1)}RowContainer`;return e[o]={name:a},{tag:"ag-row-container",ref:o,attrs:{name:a}}})}function RC(e){const t={},a={tag:"div",ref:"eGridRoot",cls:"ag-root ag-unselectable",children:[{tag:"ag-header-root"},{tag:"div",ref:"eTop",cls:"ag-floating-top",role:"presentation",children:Fo(t,["topLeft","topCenter","topRight","topFullWidth"])},{tag:"div",ref:"eBody",cls:"ag-body",role:"presentation",children:[{tag:"div",ref:"eBodyViewport",cls:"ag-body-viewport",role:"presentation",children:Fo(t,["left","center","right","fullWidth"])},{tag:"ag-fake-vertical-scroll"}]},{tag:"div",ref:"eStickyTop",cls:"ag-sticky-top",role:"presentation",children:Fo(t,["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])},{tag:"div",ref:"eStickyBottom",cls:"ag-sticky-bottom",role:"presentation",children:Fo(t,["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])},{tag:"div",ref:"eBottom",cls:"ag-floating-bottom",role:"presentation",children:Fo(t,["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])},{tag:"ag-fake-horizontal-scroll"},e?{tag:"ag-overlay-wrapper"}:null]};return{paramsMap:t,elementParams:a}}var EC=class extends V{constructor(){super(...arguments),this.eGridRoot=E,this.eBodyViewport=E,this.eStickyTop=E,this.eStickyBottom=E,this.eTop=E,this.eBottom=E,this.eBody=E}postConstruct(){const{overlays:e,rangeSvc:t}=this.beans,a=e?.getOverlayWrapperSelector(),{paramsMap:o,elementParams:r}=RC(!!a);this.setTemplate(r,[...a?[a]:[],Xw,eC,Zw,xC],o);const i=(l,s)=>{const c=`${l}px`;s.style.minHeight=c,s.style.height=c},n={setRowAnimationCssOnBodyViewport:(l,s)=>this.setRowAnimationCssOnBodyViewport(l,s),setColumnCount:l=>rc(this.getGui(),l),setRowCount:l=>oc(this.getGui(),l),setTopHeight:l=>i(l,this.eTop),setBottomHeight:l=>i(l,this.eBottom),setTopInvisible:l=>this.eTop.classList.toggle("ag-invisible",l),setBottomInvisible:l=>this.eBottom.classList.toggle("ag-invisible",l),setStickyTopHeight:l=>this.eStickyTop.style.height=l,setStickyTopTop:l=>this.eStickyTop.style.top=l,setStickyTopWidth:l=>this.eStickyTop.style.width=l,setStickyBottomHeight:l=>{this.eStickyBottom.style.height=l,this.eStickyBottom.classList.toggle("ag-invisible",l==="0px")},setStickyBottomBottom:l=>this.eStickyBottom.style.bottom=l,setStickyBottomWidth:l=>this.eStickyBottom.style.width=l,setColumnMovingCss:(l,s)=>this.toggleCss(l,s),updateLayoutClasses:(l,s)=>{const c=[this.eBodyViewport.classList,this.eBody.classList];for(const d of c)d.toggle(Ue.AUTO_HEIGHT,s.autoHeight),d.toggle(Ue.NORMAL,s.normal),d.toggle(Ue.PRINT,s.print);this.toggleCss(Ue.AUTO_HEIGHT,s.autoHeight),this.toggleCss(Ue.NORMAL,s.normal),this.toggleCss(Ue.PRINT,s.print)},setAlwaysVerticalScrollClass:(l,s)=>this.eBodyViewport.classList.toggle(Vg,s),registerBodyViewportResizeListener:l=>{const s=it(this.beans,this.eBodyViewport,l);this.addDestroyFunc(()=>s())},setPinnedTopBottomOverflowY:l=>this.eTop.style.overflowY=this.eBottom.style.overflowY=l,setCellSelectableCss:(l,s)=>{for(const c of[this.eTop,this.eBodyViewport,this.eBottom])c.classList.toggle(l,s)},setBodyViewportWidth:l=>this.eBodyViewport.style.width=l,setGridRootRole:l=>_e(this.eGridRoot,l)};this.ctrl=this.createManagedBean(new qg),this.ctrl.setComp(n,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(t&&Qe(this.gos)||Ma(this.gos))&&Jm(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const a=this.eBodyViewport.classList;a.toggle("ag-row-animation",t),a.toggle("ag-row-no-animation",!t)}getFocusableContainerName(){return"gridBody"}},FC={selector:"AG-GRID-BODY",component:EC},Ur={TAB_GUARD:"ag-tab-guard",TAB_GUARD_TOP:"ag-tab-guard-top",TAB_GUARD_BOTTOM:"ag-tab-guard-bottom"},Wg=class extends ue{constructor(e,t){super(),this.stopPropagationCallbacks=t,this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:a,eTopGuard:o,eBottomGuard:r,focusTrapActive:i,forceFocusOutWhenTabGuardsAreEmpty:n,isFocusableContainer:l,focusInnerElement:s,onFocusIn:c,onFocusOut:d,shouldStopEventPropagation:g,onTabKeyDown:u,handleKeyDown:h,isEmpty:p,eFocusableElement:f}=e;this.comp=a,this.eTopGuard=o,this.eBottomGuard=r,this.providedFocusInnerElement=s,this.eFocusableElement=f,this.focusTrapActive=!!i,this.forceFocusOutWhenTabGuardsAreEmpty=!!n,this.isFocusableContainer=!!l,this.providedFocusIn=c,this.providedFocusOut=d,this.providedShouldStopEventPropagation=g,this.providedOnTabKeyDown=u,this.providedHandleKeyDown=h,this.providedIsEmpty=p}postConstruct(){this.createManagedBean(new Wd(this.eFocusableElement,this.stopPropagationCallbacks,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards();for(const e of[this.eTopGuard,this.eBottomGuard])this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)})}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&(this.providedIsEmpty?this.providedIsEmpty():zt(this.eFocusableElement,".ag-tab-guard").length===0)){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;!(this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t))&&this.forceFocusOutWhenTabGuardsAreEmpty&&this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard)}findNextElementOutsideAndFocus(e){const t=oe(this.beans),a=zt(t.body,null,!0),o=a.indexOf(e?this.eTopGuard:this.eBottomGuard);if(o===-1)return;let r,i;e?(r=0,i=o):(r=o+1,i=a.length);const n=a.slice(r,i),l=this.gos.get("tabIndex");n.sort((s,c)=>{const d=Number.parseInt(s.getAttribute("tabindex")||"0"),g=Number.parseInt(c.getAttribute("tabindex")||"0");return g===l?1:d===l?-1:d===0?1:g===0?-1:d-g}),n[e?n.length-1:0]?.focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(this.focusTrapActive||e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const a=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),a&&(a.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=zt(this.eFocusableElement);return this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(-1,1)),t.length?(t[e?t.length-1:0].focus({preventScroll:!0}),!0):!1}getNextFocusableElement(e){return At(this.beans,this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},el=class extends ue{constructor(e,t){super(),this.comp=e,this.stopPropagationCallbacks=t}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:a,eFocusableElement:o,stopPropagationCallbacks:r}=this,i=[t,a],n={setTabIndex:v=>{for(const w of i)v==null?w.removeAttribute("tabindex"):w.setAttribute("tabindex",v)}};this.addTabGuards(t,a);const{focusTrapActive:l=!1,onFocusIn:s,onFocusOut:c,focusInnerElement:d,handleKeyDown:g,onTabKeyDown:u,shouldStopEventPropagation:h,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:f,isFocusableContainer:m}=e;this.tabGuardCtrl=this.createManagedBean(new Wg({comp:n,focusTrapActive:l,eTopGuard:t,eBottomGuard:a,eFocusableElement:o,onFocusIn:s,onFocusOut:c,focusInnerElement:d,handleKeyDown:g,onTabKeyDown:u,shouldStopEventPropagation:h,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:f,isFocusableContainer:m},r))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=oe(this.beans).createElement("div"),a=e==="top"?Ur.TAB_GUARD_TOP:Ur.TAB_GUARD_BOTTOM;return t.classList.add(Ur.TAB_GUARD,a),_e(t,"presentation"),t}addTabGuards(e,t){const a=this.eFocusableElement;a.prepend(e),a.append(t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];le(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,a){gr(t)||(t=t.getGui());const{eBottomGuard:o}=this;o?o.before(t):e(t,a)}destroy(){const{eTopGuard:e,eBottomGuard:t}=this;Ee(e),Ee(t),super.destroy()}},Ug=class extends ra{initialiseTabGuard(e,t){this.tabGuardFeature=this.createManagedBean(new el(this,t)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},tl=class extends Ug{initialiseTabGuard(e){super.initialiseTabGuard(e,vo)}},jg=(e,t)=>fg(e,()=>Dt(e.getGui(),t,!1,!0)),Kg=e=>e?.getFocusableContainerName()??"external",MC=e=>e==null?"external":typeof e=="string"?e:"gridBody",_g=class extends y{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}setComp(e,t,a){this.view=e,this.eGridHostDiv=t,this.eGui=a,this.eGui.setAttribute("grid-id",this.beans.context.getId());const{dragAndDrop:o,ctrlsSvc:r}=this.beans;o?.registerGridDropTarget(()=>this.eGui,this),this.createManagedBean(new Un(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),this.gos.get("suppressContentVisibilityAuto")&&this.eGui.style.setProperty("content-visibility","visible");const i=it(this.beans,this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>i()),r.register("gridCtrl",this)}isDetailGrid(){return xn(this.getGui())?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){const e=this.beans;return{paginationSelector:e.pagination?.getPaginationSelector(),gridHeaderDropZonesSelector:e.registry?.getSelector("AG-GRID-HEADER-DROP-ZONES"),sideBarSelector:e.sideBar?.getSelector(),statusBarSelector:e.registry?.getSelector("AG-STATUS-BAR"),toolbarSelector:e.registry?.getSelector("AG-TOOLBAR"),watermarkSelector:e.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){this.eventSvc.dispatchEvent({type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight})}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){const{view:t}=this;e===!1?t.setCursor(null):t.setCursor(e===1?"ew-resize":"ns-resize")}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),{indexWithFocus:a,nextIndex:o}=this.getNextFocusableIndex(t,e),r=a===-1?e?t.length-1:0:o,{gos:i,beans:{focusSvc:n,navigation:l}}=this,s=i.getCallback("tabToNextGridContainer");if(s){const c=n.getDefaultTabToNextGridContainerTarget({backwards:e,focusableContainers:t,nextIndex:r}),d=Kg(t[r]),g=c==null&&d==="gridBody"?"gridBody":MC(c),u=s({backwards:e,previousContainer:Kg(t[a]),nextContainer:g,defaultTarget:c});if(u!==void 0){if(typeof u=="boolean")return u;if(typeof u=="string"){if(u==="gridBody")return this.focusGridBodyDefault(e)||void 0;const h=t.find(p=>p.getFocusableContainerName()===u);if(!h){Tc(`tabToNextGridContainer - ${u} container not found`);return}return jg(h,e)?!0:void 0}return zw(u)?n.focusHeaderPosition({headerPosition:u})||void 0:(l?.ensureCellVisible(u),n.setFocusedCell({...u,forceBrowserFocus:!0}),n.isCellFocused(u)||void 0)}}return this.focusNextInnerContainerDefault({backwards:e,focusableContainers:t,indexWithFocus:a,nextIndex:r})||void 0}focusInnerElement(e){const{gos:t,beans:a,beans:{focusSvc:o,visibleCols:r}}=this;if(t.getCallback("focusGridInnerElement")?.({fromBottom:!!e}))return!0;const n=this.getFocusableContainers();if(e)return this.focusNextInnerContainerDefault({backwards:!0,focusableContainers:n,indexWithFocus:n.length,nextIndex:n.length-1})?!0:o.focusGridView({column:j(r.allCols),backwards:!0});const l=r.allCols;if(t.get("headerHeight")===0||We(a)){if(o.focusGridView({column:l[0],backwards:e}))return!0;for(let s=1;s<n.length;s++)if(Dt(n[s].getGui(),e))return!0;return!1}return o.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}isFocusInsideGridBody(){const e=this.getFocusableContainers(),{indexWithFocus:t}=this.getNextFocusableIndex(e);return e[t]?.getFocusableContainerName()==="gridBody"}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}allowFocusForNextCoreContainer(e){const t=this.view.getFocusableContainers(),{indexWithFocus:a,nextIndex:o}=this.getNextFocusableIndex(t,e);this.focusNextInnerContainerDefault({backwards:!!e,focusableContainers:t,indexWithFocus:a,nextIndex:o})||this.forceFocusOutOfContainer(e)}isFocusable(){const e=this.beans;return!So(e)||!We(e)||!!e.sideBar?.comp?.isDisplayed()}getNextFocusableIndex(e,t){const a=Q(this.beans),o=e.findIndex(r=>r.getGui().contains(a));return{indexWithFocus:o,nextIndex:o+(t?-1:1)}}focusGridBodyDefault(e){const{gos:t,beans:a,beans:{focusSvc:o,visibleCols:{allCols:r}}}=this;return e?o.focusGridView({column:j(r),backwards:!0}):t.get("headerHeight")===0||We(a)?o.focusGridView({column:r[0]}):o.focusFirstHeader()}focusNextInnerContainerDefault(e){const{backwards:t,focusableContainers:a,indexWithFocus:o}=e,r=t?-1:1;for(let i=e.nextIndex;i>=0&&i<a.length;i+=r){const n=a[i];if(n.getFocusableContainerName()==="gridBody"&&(o===-1||(t?o>i:o<i))){if(this.focusGridBodyDefault(t))return!0;continue}if(jg(n,t))return!0}return!1}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers]}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},zC=class extends tl{constructor(e){super(),this.gridBody=E,this.toolbar=E,this.gridHeaderDropZones=E,this.sideBar=E,this.statusBar=E,this.pagination=E,this.rootWrapperBody=E,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:i=>this.addCss(i),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:i=>{this.getGui().style.userSelect=i??"",this.getGui().style.webkitUserSelect=i??""},setCursor:i=>{this.getGui().style.cursor=i??""}},t=this.createManagedBean(new _g),a=t.getOptionalSelectors(),o=this.createTemplate(a),r=[FC,...Object.values(a).filter(i=>!!i)];this.setTemplate(o,r),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:i=>t.focusInnerElement(i),forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:()=>!t.isFocusable()})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{e.remove(),St(this.gos,"Grid removed from DOM")})}updateLayoutClasses(e,t){const a=this.rootWrapperBody.classList,{AUTO_HEIGHT:o,NORMAL:r,PRINT:i}=Ue,{autoHeight:n,normal:l,print:s}=t;a.toggle(o,n),a.toggle(r,l),a.toggle(i,s),this.toggleCss(o,n),this.toggleCss(r,l),this.toggleCss(i,s)}createTemplate(e){const t=e.toolbarSelector?{tag:"ag-toolbar",ref:"toolbar"}:null,a=e.gridHeaderDropZonesSelector?{tag:"ag-grid-header-drop-zones",ref:"gridHeaderDropZones"}:null,o=e.sideBarSelector?{tag:"ag-side-bar",ref:"sideBar"}:null,r=e.statusBarSelector?{tag:"ag-status-bar",ref:"statusBar"}:null,i=e.watermarkSelector?{tag:"ag-watermark"}:null,n=e.paginationSelector?{tag:"ag-pagination",ref:"pagination"}:null;return{tag:"div",cls:"ag-root-wrapper",role:"presentation",children:[t,a,{tag:"div",ref:"rootWrapperBody",cls:"ag-root-wrapper-body",role:"presentation",children:[{tag:"ag-grid-body",ref:"gridBody"},o]},r,n,i]}}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){if(!e&&this.pagination?.isDisplayed()){this.pagination.forceFocusOutOfContainer(e);return}super.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[];this.toolbar&&e.push(this.toolbar),e.push(...this.gridHeaderDropZones?.getFocusableContainers?.()??[],this.gridBody);for(const t of[this.sideBar,this.statusBar,this.pagination])t&&e.push(t);return e.filter(t=>Me(t.getGui()))}},T=(e,t)=>{for(const a of Object.keys(t))t[a]=e;return t},Qg={dispatchEvent:"CommunityCore",...T("CommunityCore",{destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,isModuleRegistered:0}),...T("GridState",{getState:0,setState:0}),...T("SharedRowSelection",{setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0}),...T("RowApi",{redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRowIndex:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0}),...T("ScrollApi",{getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0}),...T("KeyboardNavigation",{getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0}),...T("EventApi",{addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0}),...T("ValueCache",{expireValueCache:0}),...T("CellApi",{getCellValue:0}),...T("SharedMenu",{showColumnMenu:0,hidePopupMenu:0}),...T("Sort",{onSortChanged:0}),...T("PinnedRow",{getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,forEachPinnedRow:0}),...T("Overlay",{showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0}),...T("RenderApi",{setGridAriaProperty:0,refreshCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0}),...T("HighlightChanges",{flashCells:0}),...T("RowDrag",{addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getRowDropPositionIndicator:0,setRowDropPositionIndicator:0}),...T("ColumnApi",{getColumnDefs:0,getColumnDef:0,getDisplayNameForColumn:0,getColumn:0,getColumns:0,applyColumnState:0,getColumnState:0,resetColumnState:0,isPinning:0,isPinningLeft:0,isPinningRight:0,getDisplayedColAfter:0,getDisplayedColBefore:0,setColumnsVisible:0,setColumnsPinned:0,getAllGridColumns:0,getDisplayedLeftColumns:0,getDisplayedCenterColumns:0,getDisplayedRightColumns:0,getAllDisplayedColumns:0,getAllDisplayedVirtualColumns:0}),...T("ColumnAutoSize",{sizeColumnsToFit:0,autoSizeColumns:0,autoSizeAllColumns:0}),...T("ColumnGroup",{setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumnGroup:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0}),...T("ColumnMove",{moveColumnByIndex:0,moveColumns:0}),...T("ColumnResize",{setColumnWidths:0}),...T("ColumnHover",{isColumnHovered:0}),...T("EditCore",{getCellEditorInstances:0,getEditingCells:0,getEditRowValues:0,stopEditing:0,startEditingCell:0,isEditing:0,validateEdit:0}),...T("BatchEdit",{startBatchEdit:0,cancelBatchEdit:0,commitBatchEdit:0,isBatchEditing:0}),...T("UndoRedoEdit",{undoCellEditing:0,redoCellEditing:0,getCurrentUndoSize:0,getCurrentRedoSize:0}),...T("FilterCore",{isAnyFilterPresent:0,onFilterChanged:0}),...T("ColumnFilter",{isColumnFilterPresent:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,hideColumnFilter:0,getColumnFilterHandler:0,doFilterAction:0}),...T("QuickFilter",{isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0}),...T("Notes",{getNote:0,setNote:0,refreshNotes:0}),...T("Find",{findGetActiveMatch:0,findGetTotalMatches:0,findGoTo:0,findNext:0,findPrevious:0,findGetNumMatches:0,findGetParts:0,findClearActive:0,findRefresh:0}),...T("Pagination",{paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0}),...T("CsrmSsrmSharedApi",{expandAll:0,collapseAll:0,resetRowGroupExpansion:0}),...T("SsrmInfiniteSharedApi",{setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...T("ClientSideRowModelApi",{onGroupExpandedOrCollapsed:0,refreshClientSideRowModel:0,isRowDataEmpty:0,forEachLeafNode:0,forEachNodeAfterFilter:0,forEachNodeAfterFilterAndSort:0,applyTransaction:0,applyTransactionAsync:0,flushAsyncTransactions:0,getBestCostNodeSelection:0,onRowHeightChanged:0,resetRowHeights:0}),...T("CsvExport",{getDataAsCsv:0,exportDataAsCsv:0}),...T("InfiniteRowModel",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...T("AdvancedFilter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...T("IntegratedCharts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...T("Clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...T("ExcelExport",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...T("SharedMasterDetail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...T("Formula",{refreshFormulas:0}),...T("ContextMenu",{showContextMenu:0}),...T("ColumnMenu",{showColumnChooser:0,hideColumnChooser:0}),...T("CellSelection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...T("SharedRowGrouping",{setRowGroupColumns:0,removeRowGroupColumns:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0}),...T("SharedAggregation",{addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0}),...T("SharedPivot",{isPivotMode:0,getPivotResultColumn:0,setValueColumns:0,getValueColumns:0,removeValueColumns:0,addValueColumns:0,setPivotColumns:0,removePivotColumns:0,addPivotColumns:0,getPivotColumns:0,setPivotResultColumns:0,getPivotResultColumns:0}),...T("ServerSideRowModelApi",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0,onRowHeightChanged:0,resetRowHeights:0}),...T("SideBar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...T("Toolbar",{getToolbarItemInstance:0}),...T("StatusBar",{getStatusPanel:0}),...T("AiToolkit",{getStructuredSchema:0})},al={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},DC=(e,t)=>e.eventSvc.dispatchEvent(t),Yg=class{};Reflect.defineProperty(Yg,"name",{value:"GridApi"});var AC=class extends y{constructor(){super(),this.beanName="apiFunctionSvc",this.api=new Yg,this.fns={...al,dispatchEvent:DC},this.preDestroyLink="";const{api:e}=this;for(const t of Object.keys(Qg))e[t]=this.makeApi(t)[t]}postConstruct(){this.preDestroyLink=this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(e,t){const{fns:a,beans:o}=this;a!==al&&(a[e]=o?.validation?.validateApiFunction(e,t)??t)}makeApi(e){return{[e]:(...t)=>{const{beans:a,fns:{[e]:o}}=this;return o?o(a,...t):this.apiNotFound(e)}}}apiNotFound(e){const{beans:t,gos:a,preDestroyLink:o}=this;if(!t)x(26,{fnName:e,preDestroyLink:o});else{const r=Qg[e];a.assertModuleRegistered(r,`api.${e}`)&&x(27,{fnName:e,module:r})}}destroy(){super.destroy(),this.fns=al,this.beans=null}};function Zg(e){return e.context.getId()}function PC(e){e.gridDestroySvc.destroy()}function IC(e){return e.gridDestroySvc.destroyCalled}function TC(e,t){return e.gos.get(t)}function LC(e,t,a){Jg(e,{[t]:a})}function Jg(e,t){e.gos.updateGridOptions({options:t})}function BC(e,t){const a=t.replace(/Module$/,"");return e.gos.isModuleRegistered(a)}function Xg(e,t,a){const o=ye(e,t,a);if(o){const{className:i}=o;if(typeof i=="string"&&i.includes("ag-icon")||typeof i=="object"&&i["ag-icon"])return o}const r=re({tag:"span"});return r.appendChild(o),r}function ye(e,t,a){let o=null;e==="smallDown"?x(262):e==="smallLeft"?x(263):e==="smallRight"&&x(264);const r=a?.colDef.icons;if(r&&(o=r[e]),t.gos&&!o){const i=t.gos.get("icons");i&&(o=i[e])}if(o){let i;if(typeof o=="function")i=o();else if(typeof o=="string")i=o;else{x(38,{iconName:e});return}if(typeof i=="string")return cr(i);if(gr(i))return i;x(133,{iconName:e});return}else{const i=t.registry.getIcon(e);return i||t.validation?.validateIcon(e),re({tag:"span",cls:`ag-icon ag-icon-${i??e}`,role:"presentation",attrs:{unselectable:"on"}})}}var OC={tag:"div",cls:"ag-drag-handle ag-row-drag",attrs:{draggable:"true"}},NC=class extends V{constructor(e,t,a){super(OC),this.rowNode=e,this.column=t,this.eCell=a}postConstruct(){this.getGui().appendChild(ye("rowDrag",this.beans,null)),this.addGuiEventListener("mousedown",t=>{t.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const{rowNode:t,column:a,eCell:o,gos:r}=this,i=a.colDef.dndSourceOnRowDrag,n=e.dataTransfer;if(n.setDragImage(o,0,0),i){const l=I(r,{rowNode:t,dragEvent:e});i(l)}else try{const l=JSON.stringify(t.data);n.setData("application/json",l),n.setData("text/plain",l)}catch{}}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},HC=".ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}.ag-dnd-ghost-not-allowed{border:var(--ag-drag-and-drop-image-not-allowed-border)}",GC={tag:"div",children:[{tag:"div",ref:"eGhost",cls:"ag-dnd-ghost ag-unselectable",children:[{tag:"span",ref:"eIcon",cls:"ag-dnd-ghost-icon ag-shake-left-to-right"},{tag:"div",ref:"eLabel",cls:"ag-dnd-ghost-label"}]}]},VC=class extends V{constructor(){super(),this.dragSource=null,this.eIcon=E,this.eLabel=E,this.eGhost=E,this.registerCSS(HC)}postConstruct(){const e=t=>Xg(t,this.beans,null);this.dropIconMap={pinned:e("columnMovePin"),hide:e("columnMoveHide"),move:e("columnMoveMove"),left:e("columnMoveLeft"),right:e("columnMoveRight"),group:e("columnMoveGroup"),aggregate:e("columnMoveValue"),pivot:e("columnMovePivot"),notAllowed:e("dropNotAllowed")}}init(e){this.dragSource=e.dragSource,this.setTemplate(GC),this.beans.environment.applyThemeClasses(this.eGhost)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t){const{eGhost:a,eIcon:o,dragSource:r,dropIconMap:i,gos:n}=this;le(o),e||(e=r?.getDefaultIconName?r.getDefaultIconName():"notAllowed");const l=i[e];a.classList.toggle("ag-dnd-ghost-not-allowed",e==="notAllowed"),o.classList.toggle("ag-shake-left-to-right",t),!(l===i.hide&&n.get("suppressDragLeaveHidesColumns"))&&l&&o.appendChild(l)}setLabel(e){this.eLabel.textContent=e}};function qC(e,t){e.rowDragSvc?.rowDragFeature?.addRowDropZone(t)}function WC(e,t){const a=e.dragAndDrop?.findExternalZone(t.getContainer());a&&e.dragAndDrop?.removeDropTarget(a)}function UC(e,t){return e.rowDragSvc?.rowDragFeature?.getRowDropZone(t)}function jC(e){const t=e.rowDropHighlightSvc;return t?{row:t.row,dropIndicatorPosition:t.position}:{row:null,dropIndicatorPosition:"none"}}function KC(e,t){const a=e.rowDropHighlightSvc;if(!a)return;const o=t?.row;let r=t?.dropIndicatorPosition;r!=="above"&&r!=="below"&&r!=="inside"&&(r="none");const i=o?.rowIndex;i==null||r==="none"?a.clear():a.set(o,r)}var $g=(e,t)=>{if(t!=null&&e?.setPointerCapture)try{return e.setPointerCapture(t),e.hasPointerCapture(t)}catch{}return!1},_C=(e,t)=>{if(typeof PointerEvent>"u"||!(t instanceof PointerEvent))return null;const a=t.pointerId;if(!$g(e,a))return null;const o={eElement:e,pointerId:a,onLost(r){YC(o,r)}};return e.addEventListener("lostpointercapture",o.onLost),o},QC=e=>{if(!e)return;eu(e);const{eElement:t,pointerId:a}=e;if(t){try{t.releasePointerCapture(a)}catch{}e.eElement=null}},eu=e=>{const{eElement:t,onLost:a}=e;t&&a&&(t.removeEventListener("lostpointercapture",a),e.onLost=null)},YC=(e,t)=>{eu(e);const{eElement:a,pointerId:o}=e;a&&t.pointerId===o&&$g(a,o)},Ba,Oa,ol={passive:!0},Lt={passive:!1},Xe=e=>{if(!Oa)Oa=new WeakSet;else if(Oa.has(e))return!1;return Oa.add(e),!0},tu=class extends ue{constructor(){super(...arguments),this.beanName="dragSvc",this.dragging=!1,this.drag=null,this.dragSources=[]}get startTarget(){return this.drag?.start.target??null}isPointer(){return!!Ba?.has(Ie(this.beans))}hasPointerCapture(){const e=this.drag?.pointerCapture;return!!(e&&this.beans.eRootDiv.hasPointerCapture?.(e.pointerId))}destroy(){this.drag&&this.cancelDrag();const e=this.dragSources;for(const t of e)au(t);e.length=0,super.destroy()}removeDragSource(e){const t=this.dragSources;for(let a=0,o=t.length;a<o;++a){const r=t[a];if(r.params===e){t.splice(a,1),au(r);break}}}addDragSource(e){if(!this.isAlive())return;const{eElement:t,includeTouch:a}=e,o=[];let r;if(a){const c=t.style;c&&(r=c.touchAction,c.touchAction="none")}const i={handlers:o,params:e,oldTouchAction:r};this.dragSources.push(i),hr(o,[t,"pointerdown",c=>this.onPointerDown(e,c),Lt],[t,"mousedown",c=>this.onMouseDown(e,c)]);const s=this.gos.get("suppressTouch");a&&!s&&hr(o,[t,"touchstart",d=>this.onTouchStart(e,d),Lt])}cancelDrag(e){const t=this.drag;e??(e=t?.eElement),e&&this.eventSvc.dispatchEvent({type:"dragCancelled",target:e}),t?.params.onDragCancel?.(),this.destroyDrag()}shouldPreventMouseEvent(e){const t=e.type;return(t==="mousemove"||t==="pointermove")&&e.cancelable&&oo(this.beans,e)&&!Ca(il(e))}initDrag(e,...t){this.drag=e;const a=this.beans,o=l=>this.onScroll(l),r=l=>this.onKeyDown(l),i=Ie(a),n=oe(a);hr(e.handlers,[i,"contextmenu",kt],[i,"keydown",r],[n,"scroll",o,{capture:!0}],[n.defaultView||window,"scroll",o],...t)}destroyDrag(){this.dragging=!1;const e=this.drag;if(e){const t=e.rootEl;Ba?.get(t)===e&&Ba.delete(t),this.drag=null,QC(e.pointerCapture),Ni(e.handlers)}}onPointerDown(e,t){if(this.isPointer())return;const a=this.beans;if(Oa?.has(t))return;const o=t.pointerType;if(o==="touch"&&(a.gos.get("suppressTouch")||!e.includeTouch||(e.stopPropagationForTouch&&t.stopPropagation(),Ca(il(t))))||!t.isPrimary||o==="mouse"&&t.button!==0)return;this.destroyDrag();const r=Ie(a),i=e.eElement,n=t.pointerId,l=new rl(r,e,t,n);Ba??(Ba=new WeakMap),Ba.set(r,l);const s=u=>{u.pointerId===n&&this.onMouseOrPointerMove(u)},c=u=>{u.pointerId===n&&this.onMouseOrPointerUp(u)},d=u=>{u.pointerId===n&&Xe(u)&&this.cancelDrag()},g=u=>this.draggingPreventDefault(u);this.initDrag(l,[r,"pointerup",c],[r,"pointercancel",d],[r,"pointermove",s,Lt],[r,"touchmove",g,Lt],[i,"mousemove",g,Lt]),e.dragStartPixels===0?this.onMouseOrPointerMove(t):Xe(t)}onTouchStart(e,t){if(this.gos.get("suppressTouch")||!e.includeTouch||!Xe(t)||Ca(il(t)))return;if(e.stopPropagationForTouch&&t.stopPropagation(),this.isPointer()){this.dragging&&kt(t);return}this.destroyDrag();const o=this.beans,r=Ie(o),i=new rl(r,e,t.touches[0]),n=u=>this.onTouchMove(u),l=u=>this.onTouchUp(u),s=u=>this.onTouchCancel(u),c=u=>this.draggingPreventDefault(u),d=Ie(o),g=t.target??e.eElement;this.initDrag(i,[g,"touchmove",n,ol],[g,"touchend",l,ol],[g,"touchcancel",s,ol],[d,"touchmove",c,Lt],[d,"touchend",l,Lt],[d,"touchcancel",s,Lt]),e.dragStartPixels===0&&this.onMove(i.start)}draggingPreventDefault(e){this.dragging&&kt(e)}onMouseDown(e,t){if(t.button!==0||Oa?.has(t)||this.isPointer())return;const a=this.beans;this.destroyDrag();const o=new rl(Ie(a),e,t),r=l=>this.onMouseOrPointerMove(l),i=l=>this.onMouseOrPointerUp(l),n=Ie(a);this.initDrag(o,[n,"mousemove",r],[n,"mouseup",i]),e.dragStartPixels===0?this.onMouseOrPointerMove(t):Xe(t)}onScroll(e){if(!Xe(e))return;const t=this.drag,a=t?.lastDrag;a&&this.dragging&&t.params?.onDragging?.(a)}onMouseOrPointerMove(e){Xe(e)&&(mt()&&oe(this.beans).getSelection()?.removeAllRanges(),this.shouldPreventMouseEvent(e)&&kt(e),this.onMove(e))}onTouchCancel(e){const t=this.drag;!t||!Xe(e)||Sa(t.start,e.changedTouches)&&this.cancelDrag()}onTouchMove(e){const t=this.drag;if(!t||!Xe(e))return;const a=Sa(t.start,e.touches);a&&(this.onMove(a),this.draggingPreventDefault(e))}onMove(e){const t=this.drag;if(!t)return;t.lastDrag=e;const a=t.params;if(!this.dragging){const o=t.start,i=a.dragStartPixels??4;if(kc(e,o,i)||(this.dragging=!0,a.capturePointer&&(t.pointerCapture=_C(this.beans.eRootDiv,e)),this.eventSvc.dispatchEvent({type:"dragStarted",target:a.eElement}),a.onDragStart?.(o),this.drag!==t)||(a.onDragging?.(o),this.drag!==t))return}a.onDragging?.(e)}onTouchUp(e){const t=this.drag;t&&Xe(e)&&this.onUp(Sa(t.start,e.changedTouches))}onMouseOrPointerUp(e){Xe(e)&&this.onUp(e)}onUp(e){const t=this.drag;t&&(e||(e=t.lastDrag),e&&this.dragging&&(this.dragging=!1,t.params.onDragStop?.(e),this.eventSvc.dispatchEvent({type:"dragStopped",target:t.params.eElement})),this.destroyDrag())}onKeyDown(e){e.key===C.ESCAPE&&this.cancelDrag()}},au=e=>{Ni(e.handlers);const t=e.oldTouchAction;if(t!=null){const a=e.params.eElement.style;a&&(a.touchAction=t)}},rl=class{constructor(e,t,a,o=null){this.rootEl=e,this.params=t,this.start=a,this.pointerId=o,this.handlers=[],this.lastDrag=null,this.pointerCapture=null,this.eElement=t.eElement}},il=e=>{const t=e.target;return t instanceof Element?t:null},ZC=class extends tu{shouldPreventMouseEvent(e){return this.gos.get("enableCellTextSelection")&&super.shouldPreventMouseEvent(e)}},JC=class extends y{constructor(){super(...arguments),this.beanName="horizontalResizeSvc"}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),onDragCancel:this.onDragStop.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0},{dragSvc:a}=this.beans;return a.addDragSource(t),()=>a.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const a=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(a)}setResizeIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(1),e.disableUserSelect(!0)}onDragStop(e){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},XC={tag:"div",cls:"ag-drag-handle ag-row-drag",attrs:{"aria-hidden":"true"}},jr={skipAriaHidden:!0},$C=class extends V{constructor(e,t,a,o,r,i=!1){super(),this.cellValueFn=e,this.rowNode=t,this.column=a,this.customGui=o,this.dragStartPixels=r,this.alwaysVisible=i,this.dragSource=null,this.disabled=!1}isCustomGui(){return this.customGui!=null}postConstruct(){const{beans:e,customGui:t}=this;t?this.setDragElement(t,this.dragStartPixels):(this.setTemplate(XC),this.getGui().appendChild(ye("rowDrag",e,null)),this.addDragSource()),this.alwaysVisible||this.initCellDrag()}initCellDrag(){const{beans:e,rowNode:t}=this,a=this.refreshVisibility.bind(this);this.addManagedListeners(e.eventSvc,{rowDragVisibilityChanged:a}),this.addManagedListeners(t,{dataChanged:a,cellChanged:a}),this.refreshVisibility()}setDragElement(e,t){this.setTemplateFromElement(e,void 0,void 0,!0),this.addDragSource(t)}refreshVisibility(){if(this.alwaysVisible)return;const{beans:e,column:t,rowNode:a}=this,{gos:o,dragAndDrop:r,rowDragSvc:i}=e,n=i?.visibility;let s=!(n==="suppress"||n==="hidden"&&!r?.hasExternalDropZones()),c=s;if(s&&!this.isCustomGui()&&t){const d=t.getColDef().rowDrag;if(d===!1)s=!1;else{const g=typeof d=="function";c=t.isRowDrag(a),s=g||c}}s&&c&&a.footer&&o.get("rowDragManaged")&&(c=!1,s=!0),c&&(c=s),s||this.setDisplayed(s,jr),c||this.setVisible(c,jr),this.setDisabled(!c||n==="disabled"&&!r?.hasExternalDropZones()),s&&this.setDisplayed(s,jr),c&&this.setVisible(c,jr)}setDisabled(e){e!==this.disabled&&(this.disabled=e,this.getGui()?.classList?.toggle("ag-drag-handle-disabled",e))}getSelectedNodes(){const e=this.rowNode;if(!this.gos.get("rowDragMultiRow"))return[e];const a=this.beans.selectionSvc?.getSelectedNodes()??[];return a.indexOf(e)!==-1?a:[e]}getDragItem(){const{column:e,rowNode:t}=this;return{rowNode:t,rowNodes:this.getSelectedNodes(),columns:e?[e]:void 0,defaultTextValue:this.cellValueFn()}}addDragSource(e=4){if(this.dragSource&&this.removeDragSource(),this.gos.get("rowDragManaged")&&this.rowNode.footer)return;const t=this.getGui();if(this.gos.get("enableCellTextSelection")){this.removeMouseDownListener();const o=ur("pointerdown")?{pointerdown:kt}:{mousedown:kt};this.mouseDownListener=this.addManagedElementListeners(t,o)[0]}const a=this.getLocaleTextFunc();this.dragSource={type:2,eElement:t,dragItemName:o=>this.getDragItemName(o,a),getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDrop.addDragSource(this.dragSource,!0)}getDragItemName(e,t){const a=e?.dragItem||this.getDragItem(),o=(e?.dropTarget?.rows.length??a.rowNodes?.length)||1,r=this.column?.getColDef()?.rowDragText??this.gos.get("rowDragText");if(r)return r(a,o);if(o!==1)return`${o} ${t("rowDragRows","rows")}`;const i=this.cellValueFn();return i||`1 ${t("rowDragRow","rows")}`}destroy(){this.removeDragSource(),this.removeMouseDownListener(),super.destroy()}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop.removeDragSource(this.dragSource),this.dragSource=null)}removeMouseDownListener(){this.mouseDownListener&&(this.mouseDownListener(),this.mouseDownListener=void 0)}},ou=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.includes("x"),this.scrollVertically=e.scrollAxis.includes("y"),this.scrollByTick=e.scrollByTick??20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}get scrolling(){return this.tickingInterval!==null}check(e,t=!1){const a=!this.scrollVertically||t||this.shouldSkipVerticalScroll(),o=!this.scrollHorizontally||this.shouldSkipHorizontalScroll();if(a&&o)return;const r=this.scrollContainer.getBoundingClientRect(),i=this.scrollByTick;this.tickLeft=!o&&e.clientX<r.left+i,this.tickRight=!o&&e.clientX>r.right-i,this.tickUp=!a&&e.clientY<r.top+i,this.tickDown=!a&&e.clientY>r.bottom-i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Mo=class{constructor(){this.reordered=!1,this.removals=[],this.updates=new Set,this.adds=new Set}},zo=e=>{let t=e.childrenAfterGroup;for(;t?.length;){const a=t[0];if(a.sourceRowIndex>=0)return a;t=a.childrenAfterGroup}},ru=(e,t,a,o)=>{if(!t.size||!e)return!1;let r=!1;const i=e.length??0;let n=-1;a&&(n=a.sourceRowIndex,a=n<0?zo(a):null,a&&(n=a.sourceRowIndex)),n<0||n>=i?n=i:o||++n;let l=n,s=Math.min(n,i-1);for(const g of t){const u=g.sourceRowIndex;u<l&&(l=u),u>s&&(s=u)}let c=l;for(let g=l;g<n;++g){const u=e[g];t.has(u)||(u.sourceRowIndex!==c&&(u.sourceRowIndex=c,e[c]=u,r=!0),++c)}let d=s;for(let g=s;g>=n;--g){const u=e[g];t.has(u)||(u.sourceRowIndex!==d&&(u.sourceRowIndex=d,e[d]=u,r=!0),--d)}for(const g of t)g.sourceRowIndex!==c&&(g.sourceRowIndex=c,e[c]=g,r=!0),++c;return r};function iu(e,t){return Or(e,t.target)?.getFocusedCellPosition()??null}function nl(e,t){const a=se(e.gos,"normal"),o=t;let r,i;o.clientX!=null||o.clientY!=null?(r=o.clientX,i=o.clientY):(r=o.x,i=o.y);const{pageFirstPixel:n}=e.pageBounds.getCurrentPagePixelRange();if(i+=n,a){const l=e.ctrlsSvc.getScrollFeature(),s=l.getVScrollPosition(),c=l.getHScrollPosition();r+=c.left,i+=s.top}return{x:r,y:i}}var e0=.25,t0=class extends y{constructor(e){super(),this.eContainer=e,this.lastDraggingEvent=null,this.autoScroll=null,this.autoScrollChanged=!1,this.autoScrollChanging=!1,this.autoScrollOldV=null}postConstruct(){const e=this.beans;e.ctrlsSvc.whenReady(this,t=>{const a=()=>t.gridBodyCtrl.scrollFeature.getVScrollPosition().top,o=new ou({scrollContainer:t.gridBodyCtrl.eBodyViewport,scrollAxis:"y",getVerticalPosition:a,setVerticalPosition:r=>t.gridBodyCtrl.scrollFeature.setVerticalScrollPosition(r),onScrollCallback:()=>{const r=a();if(this.autoScrollOldV!==r){this.autoScrollOldV=r,this.autoScrollChanging=!0;return}const i=this.autoScrollChanging;this.autoScrollChanged=i,this.autoScrollChanging=!1,i&&(e.dragAndDrop?.nudge(),this.autoScrollChanged=!1)}});this.autoScroll=o,this.clearAutoScroll()})}destroy(){super.destroy(),this.clearAutoScroll(),this.autoScroll=null,this.lastDraggingEvent=null,this.eContainer=null}getContainer(){return this.eContainer}isInterestedIn(e){return e===2}getIconName(e){return e?.dropTarget?.allowed===!1||this.beans.rowDragSvc.visibility!=="visible"?"notAllowed":"move"}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const a=this.beans.selectionSvc?.getSelectedNodes();if(a&&a.indexOf(t)>=0)return a.slice().sort(a0)}return[t]}onDragEnter(e){this.dragging(e,!0)}onDragging(e){this.dragging(e,!1)}dragging(e,t){const{lastDraggingEvent:a,beans:o}=this;if(t){const l=this.getRowNodes(e);e.dragItem.rowNodes=l,lu(l,!0)}this.lastDraggingEvent=e;const r=e.fromNudge,i=this.makeRowsDrop(a,e,r,!1);o.rowDropHighlightSvc?.fromDrag(e),t&&this.dispatchGridEvent("rowDragEnter",e),this.dispatchGridEvent("rowDragMove",e);const n=this.autoScroll;i?.rowDragManaged&&i.moved&&i.allowed&&i.sameGrid&&!i.suppressMoveWhenRowDragging&&(!r&&!n?.scrolling||this.autoScrollChanged)&&this.dropRows(i),n?.check(e.event)}isFromThisGrid(e){return e.dragSource.dragSourceDomDataKey===this.gos.getDomDataKey()}makeRowsDrop(e,t,a,o){const{beans:r,gos:i}=this,n=this.newRowsDrop(t,o),l=r.rowModel;if(t.dropTarget=n,t.changed=!1,!n)return null;let{sameGrid:s,rootNode:c,source:d,target:g}=n;g??(g=l.getRow(l.getRowCount()-1)??null);const u=this.beans.groupEditSvc,h=!!u?.canSetParent(n);let p=null;if(g?.footer){const m=Ir(l,-1,g)??Ir(l,1,g);h&&(p=g.sibling??c),g=m??null}g?.detail&&(g=g.parent),n.moved&&(n.moved=d!==g);let f=.5;if(g&&(s&&n.moved&&(p||!h)?f=d.rowIndex>g.rowIndex?-.5:.5:f=(n.y-g.rowTop-g.rowHeight/2)/g.rowHeight||0),!h&&s&&g&&n.moved&&$(i)){const m=o0(l,n);m&&(f=d.rowIndex>m.rowIndex?-.5:.5,g=m,n.moved&&(n.moved=d!==g))}return n.target=g,n.newParent=p,n.pointerPos=r0(g,n.y),n.yDelta=f,u?.fixRowsDrop(n,h,a,f),this.validateRowsDrop(n,h,o),t.changed||(t.changed=nu(e?.dropTarget,n)),n}newRowsDrop(e,t){const{beans:a,gos:o}=this,r=a.rowModel.rootNode,i=$(o)?o.get("rowDragManaged"):!1,n=o.get("suppressMoveWhenRowDragging"),l=this.isFromThisGrid(e);let{rowNode:s,rowNodes:c}=e.dragItem;if(c||(c=s?[s]:[]),s||(s=c[0]),!s||!r)return null;const d=this.beans.dragAndDrop.isDropZoneWithinThisGrid(e);let g=!0;i&&(!c.length||a.rowDragSvc.visibility!=="visible"||(n||!l)&&!d)&&(g=!1);const u=nl(a,e).y,h=this.getOverNode(u);return{api:a.gridApi,context:a.gridOptions.context,draggingEvent:e,rowDragManaged:i,suppressMoveWhenRowDragging:n,sameGrid:l,withinGrid:d,treeData:!1,rootNode:r,moved:s!==h,y:u,overNode:h,overIndex:h?.rowIndex??-1,pointerPos:"none",position:"none",source:s,target:h??null,newParent:null,rows:c,allowed:g,highlight:!t&&i&&n&&(d||!l),yDelta:0,inside:!1,droppedManaged:!1}}validateRowsDrop(e,t,a){const{source:o,target:r,yDelta:i,inside:n,moved:l,rowDragManaged:s,suppressMoveWhenRowDragging:c}=e;e.moved&&(e.moved=o!==r);const{position:d,fallbackPosition:g}=this.computeDropPosition(l,n,i);e.position=d,t||(e.newParent=null),this.enforceSuppressMoveWhenRowDragging(e,c,"initial");const u=(!s||e.allowed)&&this.gos.get("isRowValidDropPosition");u&&this.applyDropValidator(e,t,a,s,u),s&&(e.rows=this.filterRows(e)),this.beans.groupEditSvc?.clearNewSameParent(e,t),this.enforceSuppressMoveWhenRowDragging(e,c,"final"),e.position==="inside"&&(!e.allowed||!e.newParent)&&(e.position=g)}computeDropPosition(e,t,a){const o=a<0?"above":"below";return e?{position:t?"inside":o,fallbackPosition:o}:{position:"none",fallbackPosition:o}}enforceSuppressMoveWhenRowDragging(e,t,a){if(t){if(a==="initial"){e.moved||(e.allowed=!1);return}(!e.rows.length||e.position==="none")&&(e.allowed=!1)}}applyDropValidator(e,t,a,o,r){this.beans.groupEditSvc?.clearNewSameParent(e,t);const i=r(e);if(!i){e.allowed=!1;return}if(typeof i!="object")return;i.rows!==void 0&&(e.rows=i.rows??[]),t&&i.newParent!==void 0&&(e.newParent=i.newParent),i.target!==void 0&&(e.target=i.target),i.position&&(e.position=i.position),i.allowed!==void 0?e.allowed=i.allowed:o||(e.allowed=!0);const n=e.draggingEvent;i.changed&&n&&(n.changed=!0),!a&&i.highlight!==void 0&&(e.highlight=i.highlight)}addRowDropZone(e){if(!e.getContainer()){x(55);return}const t=this.beans.dragAndDrop;if(t.findExternalZone(e.getContainer())){x(56);return}const a=e.fromGrid?e:{getContainer:e.getContainer,onDragEnter:e.onDragEnter&&(r=>e.onDragEnter(this.rowDragEvent("rowDragEnter",r))),onDragLeave:e.onDragLeave&&(r=>e.onDragLeave(this.rowDragEvent("rowDragLeave",r))),onDragging:e.onDragging&&(r=>e.onDragging(this.rowDragEvent("rowDragMove",r))),onDragStop:e.onDragStop&&(r=>e.onDragStop(this.rowDragEvent("rowDragEnd",r))),onDragCancel:e.onDragCancel&&(r=>e.onDragCancel(this.rowDragEvent("rowDragCancel",r)))},o={isInterestedIn:r=>r===2,getIconName:()=>"move",external:!0,...a};t.addDropTarget(o),this.addDestroyFunc(()=>t.removeDropTarget(o))}getRowDropZone(e){return{getContainer:this.getContainer.bind(this),onDragEnter:a=>{this.onDragEnter(a),e?.onDragEnter?.(this.rowDragEvent("rowDragEnter",a))},onDragLeave:a=>{this.onDragLeave(a),e?.onDragLeave?.(this.rowDragEvent("rowDragLeave",a))},onDragging:a=>{this.onDragging(a),e?.onDragging?.(this.rowDragEvent("rowDragMove",a))},onDragStop:a=>{this.onDragStop(a),e?.onDragStop?.(this.rowDragEvent("rowDragEnd",a))},onDragCancel:a=>{this.onDragCancel(a),e?.onDragCancel?.(this.rowDragEvent("rowDragCancel",a))},fromGrid:!0}}getOverNode(e){const{pageBounds:t,rowModel:a}=this.beans,r=e>t.getCurrentPagePixelRange().pageLastPixel?-1:a.getRowIndexAtPixel(e);return r>=0?a.getRow(r):void 0}rowDragEvent(e,t){const a=this.beans,{dragItem:o,dropTarget:r,event:i,vDirection:n}=t,l=r?.rootNode===a.rowModel.rootNode,s=l?r.y:nl(a,t).y,c=l?r.overNode:this.getOverNode(s),d=l?r.overIndex:c?.rowIndex??-1;return{api:a.gridApi,context:a.gridOptions.context,type:e,event:i,node:o.rowNode,nodes:o.rowNodes,overIndex:d,overNode:c,y:s,vDirection:n,rowsDrop:r}}dispatchGridEvent(e,t){const a=this.rowDragEvent(e,t);this.eventSvc.dispatchEvent(a)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e,!1)}onDragStop(e){const t=this.lastDraggingEvent?.dropTarget??null,a=this.makeRowsDrop(this.lastDraggingEvent,e,!1,!0);this.dispatchGridEvent("rowDragEnd",e),a?.allowed&&a.rowDragManaged&&(!t?.droppedManaged||nu(t,a))&&this.dropRows(a),this.stopDragging(e,!0)}onDragCancel(e){this.dispatchGridEvent("rowDragCancel",e),this.stopDragging(e,!0)}stopDragging(e,t){this.clearAutoScroll(),this.beans.groupEditSvc?.stopDragging(t),this.beans.rowDropHighlightSvc?.fromDrag(null),lu(e.dragItem.rowNodes,!1),this.lastDraggingEvent=null}clearAutoScroll(){this.autoScroll?.ensureCleared(),this.autoScrollChanged=!1,this.autoScrollChanging=!1,this.autoScrollOldV=null}dropRows(e){return e.droppedManaged=!0,e.sameGrid?this.csrmMoveRows(e):this.csrmAddRows(e)}csrmAddRows({position:e,target:t,rows:a}){const o=ta(this.gos),r=this.beans.rowModel,i=a.filter(({data:l,rowPinned:s})=>!r.getRowNode(o?.({data:l,level:0,rowPinned:s})??l.id)).map(({data:l})=>l);if(i.length===0)return!1;let n;if(t){const l=t.sourceRowIndex>=0?t:zo(t);l&&(n=l.sourceRowIndex+(e==="above"?0:1))}return r.updateRowData({add:i,addIndex:n}),!0}filterRows(e){const{groupEditSvc:t}=this.beans,{rows:a,sameGrid:o}=e;let r;for(let i=0,n=a.length;i<n;++i){let l=!0;const s=a[i];(!s||s.footer||o&&s.destroyed&&!s.group||!this.csrmGetLeaf(s))&&(l=!1),l&&t&&!t.canDropRow(s,e)&&(l=!1),l?r?.push(s):r??(r=a.slice(0,i))}return r??a}csrmMoveRows(e){const t=this.beans.groupEditSvc;return t?.isGroupingDrop(e)?t.dropGroupEdit(e):this.csrmMoveRowsReorder(e)}csrmMoveRowsReorder({position:e,target:t,rows:a,newParent:o,rootNode:r}){let i=!1;const n=new Set;for(const u of a){o&&u.parent!==o&&(u.treeParent=o,i=!0);const h=this.csrmGetLeaf(u);h&&n.add(h)}if(!i&&n.size===0)return!1;const l=this.beans.focusSvc,s=l.getFocusedCell(),c=s&&na(this.beans,s);if(n.size&&ru(r._leafs,n,t,e==="above")&&(i=!0),!i)return!1;const d=this.beans.rowModel,g=new Mo;return g.reordered=!0,d.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:g}),c?c.focusCell():l.clearFocusedCell(),!0}csrmGetLeaf(e){if(e.sourceRowIndex>=0)return e.destroyed?void 0:e;const t=this.beans.groupEditSvc;return t?t.csrmFirstLeaf(e):zo(e)}},nu=(e,t)=>e!==t&&(e?.sameGrid!==t.sameGrid||e?.allowed!==t.allowed||e?.position!==t.position||e?.target!==t.target||e?.source!==t.source||e?.newParent!==t.newParent||!rt(e?.rows,t.rows)),a0=({rowIndex:e},{rowIndex:t})=>e!==null&&t!==null?e-t:0,lu=(e,t)=>{for(let a=0,o=e?.length||0;a<o;++a){const r=e[a];r.dragging!==t&&(r.dragging=t,r.dispatchRowEvent("draggingChanged"))}},o0=(e,t)=>{let a=null,o=t.target;if(o&&t.rows.indexOf(o)<0)return null;const r=t.source;if(!o||!r)return null;let i=o.rowIndex-r.rowIndex;const n=i<0?-1:1;i=t.suppressMoveWhenRowDragging?Math.abs(i):1;const l=new Set(t.rows);do{const s=Ir(e,n,o);if(!s)break;l.has(s)||(a=s,--i),o=s}while(i>0);return a},r0=(e,t)=>{const a=e?.rowTop,o=e?.rowHeight??0;if(a==null||!o||o<=0)return"none";const r=t-a,i=o*e0;return r<=i?"above":r>=o-i?"below":"inside"},i0=class extends y{constructor(){super(...arguments),this.beanName="rowDragSvc",this.rowDragFeature=null,this.visibility="suppress"}setupRowDrag(e,t){const a=t.createManagedBean(new t0(e)),o=this.beans.dragAndDrop;o.addDropTarget(a),t.addDestroyFunc(()=>o.removeDropTarget(a)),this.rowDragFeature=a;const r=()=>this.refreshVisibility();this.addManagedPropertyListeners(["rowDragManaged","suppressRowDrag","refreshAfterGroupEdit"],r),this.addManagedEventListeners({newColumnsLoaded:r,columnRowGroupChanged:r,columnPivotModeChanged:r,sortChanged:r,filterChanged:r}),this.visibility=this.computeVisibility()}createRowDragComp(e,t,a,o,r,i){return new $C(e,t,a,o,r,i)}createRowDragCompForRow(e,t){if(Qe(this.gos))return;const a=this.getLocaleTextFunc();return this.createRowDragComp(()=>`1 ${a("rowDragRow","row")}`,e,void 0,t,void 0,!0)}createRowDragCompForCell(e,t,a,o,r,i){const n=this.gos;return n.get("rowDragManaged")&&(!$(n)||n.get("pagination"))?void 0:this.createRowDragComp(a,e,t,o,r,i)}cancelRowDrag(){this.rowDragFeature?.lastDraggingEvent&&this.beans.dragSvc?.cancelDrag()}computeVisibility(){const e=this.beans,t=e.gos;if(t.get("suppressRowDrag"))return"suppress";if(!t.get("rowDragManaged"))return"visible";const o=e.colModel.pivotMode;return(o||e.rowGroupColsSvc?.columns?.length)&&!t.get("refreshAfterGroupEdit")?"hidden":o||e.filterManager?.isAnyFilterPresent()||e.sortSvc?.isSortActive()?"disabled":"visible"}refreshVisibility(){const e=this.visibility,t=this.computeVisibility();e!==t&&(this.visibility=t,this.eventSvc?.dispatchEvent({type:"rowDragVisibilityChanged"}))}},n0=class extends y{constructor(){super(...arguments),this.beanName="rowDropHighlightSvc",this.uiLevel=0,this.dragging=!1,this.row=null,this.position="none"}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this)})}onModelUpdated(){const e=this.row,t=this.dragging;!e||e?.rowIndex===null||this.position==="none"?this.clear():this.set(e,this.position),this.dragging=t}destroy(){this.clear(),super.destroy()}clear(){const e=this.row;this.dragging=!1,e&&(this.uiLevel=0,this.position="none",this.row=null,e.dispatchRowEvent("rowHighlightChanged"))}set(e,t){const a=e!==this.row,o=e.uiLevel,r=t!==this.position,i=o!==this.uiLevel;this.dragging=!1,(a||r||i)&&(a&&this.clear(),this.uiLevel=o,this.position=t,this.row=e,e.dispatchRowEvent("rowHighlightChanged"))}fromDrag(e){const t=e?.dropTarget;if(t){const{highlight:a,target:o,position:r}=t;if(a&&o&&r!=="none"){this.set(o,r),this.dragging=!0;return}}this.dragging&&this.clear()}},ll={moduleName:"Drag",version:F,beans:[ZC]},su={moduleName:"DragAndDrop",version:F,dynamicBeans:{dndSourceComp:NC},icons:{rowDrag:"grip"}},sl={moduleName:"SharedDragAndDrop",version:F,beans:[Kb],dependsOn:[ll],userComponents:{agDragAndDropImage:VC},icons:{columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",rowDrag:"grip"}},cu={moduleName:"RowDrag",version:F,beans:[n0,i0],apiFunctions:{addRowDropZone:qC,removeRowDropZone:WC,getRowDropZoneParams:UC,getRowDropPositionIndicator:jC,setRowDropPositionIndicator:KC},dependsOn:[sl]},du={moduleName:"HorizontalResize",version:F,beans:[JC],dependsOn:[ll]},l0=":where(.ag-ltr) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:left .2s}.ag-header-group-cell{transition:left .2s,width .2s}}:where(.ag-rtl) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:right .2s}.ag-header-group-cell{transition:right .2s,width .2s}}",s0=class extends y{constructor(){super(...arguments),this.beanName="colAnimation",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.activeNext=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){if(this.active)return;const{gos:e}=this;e.get("suppressColumnMoveAnimation")||e.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0,this.activeNext=!0)}finish(){this.active&&this.flush(()=>this.activeNext=!1,()=>this.active=!1)}executeNextVMTurn(e){this.activeNext?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount,{gridBodyCtrl:t}=this;t.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&t.setColumnMovingCss(!1)})}flush(e,t){const{executeNextFuncs:a,executeLaterFuncs:o}=this;if(a.length===0&&o.length===0){e(),t();return}const r=i=>{for(;i.length;){const n=i.pop();n&&n()}};this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e(),r(a)},0),window.setTimeout(()=>{t(),r(o)},200)})}};function c0(e,t,a){e.colMoves?.moveColumnByIndex(t,a,"api")}function d0(e,t,a){e.colMoves?.moveColumns(t,a,"api")}var g0=class extends y{constructor(e){super(),this.pinned=e,this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[]}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;if(t)for(const a of t)a.primary&&(a.isAnyFunctionActive()||(a.isAllowValue()?this.columnsToAggregate.push(a):a.isAllowRowGroup()?this.columnsToGroup.push(a):a.isAllowPivot()&&this.columnsToPivot.push(a)))}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){const{valueColsSvc:t,rowGroupColsSvc:a,pivotColsSvc:o}=this.beans;this.columnsToAggregate.length>0&&t?.addColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&a?.addColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&o?.addColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function u0(e,t){!t||t.length<=1||t.filter(o=>e.indexOf(o)<0).length>0||t.sort((o,r)=>{const i=e.indexOf(o),n=e.indexOf(r);return i-n})}function h0(e){const t=[...e];for(const a of e){let o=null,r=a.parent;for(;r?.getDisplayedLeafColumns().length===1;)o=r,r=r.parent;if(o!=null){const n=!!o.getColGroupDef()?.marryChildren?o.getProvidedColumnGroup().getLeafColumns():o.getLeafColumns();for(const l of n)t.includes(l)||t.push(l)}}return t}function p0(e,t,a,o){const r=o.allCols;let i=null,n=null;for(let l=0;l<e.length;l++){const s=e[l],c=a.getProposedColumnOrder(t,s);if(!a.doesOrderPassRules(c))continue;const d=c.filter(u=>r.includes(u));if(n===null)n=d;else if(!rt(d,n))break;const g=m0(c);(i===null||g<i.fragCount)&&(i={move:s,fragCount:g})}return i}function gu(e){const{isFromHeader:t,fromLeft:a,xPosition:o,fromEnter:r,fakeEvent:i,pinned:n,gos:l,colModel:s,colMoves:c,visibleCols:d}=e;let{allMovingColumns:g}=e;t&&(g=h0(g));const u=g.slice();u0(s.getCols(),u);const h=b0({movingCols:u,draggingRight:a,xPosition:o,pinned:n,gos:l,colModel:s,visibleCols:d}),p=f0(u,s);if(h.length===0)return;const f=h[0];if(p!==null&&(t||!r)&&!i&&(!a&&f>=p||a&&f<=p))return;const v=p0(h,u,c,d);if(!v)return;const w=v.move;if(!(w>s.getCols().length-u.length))return{columns:u,toIndex:w}}function uu(e){const{columns:t,toIndex:a}=gu(e)||{},{finished:o,colMoves:r}=e;return!t||a==null?null:(r.moveColumns(t,a,"uiColumnMoved",o),o?null:{columns:t,toIndex:a})}function f0(e,t){const a=t.getCols(),o=e.map(s=>a.indexOf(s)).sort((s,c)=>s-c),r=o[0];return j(o)-r!==o.length-1?null:r}function m0(e){function t(o){const r=[];let i=o.getOriginalParent();for(;i!=null;)r.push(i),i=i.getOriginalParent();return r}let a=0;for(let o=0;o<e.length-1;o++){let r=t(e[o]),i=t(e[o+1]);[r,i]=r.length>i.length?[r,i]:[i,r];for(const n of r)i.indexOf(n)===-1&&a++}return a}function v0(e,t){switch(t){case"left":return e.leftCols;case"right":return e.rightCols;default:return e.centerCols}}function b0(e){const{movingCols:t,draggingRight:a,xPosition:o,pinned:r,gos:i,colModel:n,visibleCols:l}=e;if(i.get("suppressMovableColumns")||t.some(b=>b.colDef.suppressMovable))return[];const c=v0(l,r),d=n.getCols(),g=c.filter(b=>t.includes(b)),u=c.filter(b=>!t.includes(b)),h=d.filter(b=>!t.includes(b));let p=0,f=o;if(a){let b=0;for(const k of g)b+=k.getActualWidth();f-=b}if(f>0){for(let b=0;b<u.length;b++){const k=u[b];if(f-=k.getActualWidth(),f<0)break;p++}a&&p++}let m;if(p>0){const b=u[p-1];m=h.indexOf(b)+1}else m=h.indexOf(u[0]),m===-1&&(m=0);const v=[m],w=(b,k)=>b-k;if(a){let b=m+1;const k=d.length-1;for(;b<=k;)v.push(b),b++;v.sort(w)}else{let b=m;const k=d.length-1;let S=d[b];for(;b<=k&&c.indexOf(S)<0;)b++,v.push(b),S=d[b];b=m-1;const R=0;for(;b>=R;)v.push(b),b--;v.sort(w).reverse()}return v}function cl(e){const{pinned:t,fromKeyboard:a,gos:o,ctrlsSvc:r,useHeaderRow:i,skipScrollPadding:n}=e;let l=r.getHeaderRowContainerCtrl(t)?.eViewport,{x:s}=e;return l?(a&&(s-=l.getBoundingClientRect().left),o.get("enableRtl")&&(i&&(l=l.querySelector(".ag-header-row")),s=l.clientWidth-s),t==null&&!n&&(s+=r.get("center").getCenterViewportScrollLeft()),s):0}function dl(e,t){for(const a of e)a.moving=t,a.dispatchColEvent("movingChanged","uiColumnMoved")}var hu=7,gl=100,Kr=gl/2,w0=5,C0=100,y0=class extends y{constructor(e){super(),this.pinned=e,this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.isCenterContainer=!z(e)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){const{pinned:e,lastDraggingEvent:t}=this,{dragItem:a}=t||{},o=a?.columns??[];for(const r of o){const i=r.getPinned();if(r.getColDef().lockPinned){if(i==e)return"move";continue}const n=a?.containerType;if(n===e||!e)return"move";if(e&&(!i||n!==e))return"pinned"}return"notAllowed"}onDragEnter(e){const t=e.dragItem,a=t.columns;if(e.dragSource.type===0)this.setColumnsVisible(a,!0,"uiColumnDragged");else{const r=t.visibleState,i=(a||[]).filter(n=>r[n.getId()]&&!n.isVisible());this.setColumnsVisible(i,!0,"uiColumnDragged")}this.gos.get("suppressMoveWhenColumnDragging")||this.attemptToPinColumns(a,this.pinned),this.onDragging(e,!0,!0)}onDragging(e=this.lastDraggingEvent,t=!1,a=!1,o=!1){const{gos:r,ctrlsSvc:i}=this.beans,n=r.get("suppressMoveWhenColumnDragging");if(o&&!n){this.finishColumnMoving();return}if(this.lastDraggingEvent=e,!e||!o&&_(e.hDirection))return;const l=cl({x:e.x,pinned:this.pinned,gos:r,ctrlsSvc:i});t||this.checkCenterForScrolling(l),n?this.handleColumnDragWhileSuppressingMovement(e,t,a,l,o):this.handleColumnDragWhileAllowingMovement(e,t,a,l,o)}onDragLeave(){this.ensureIntervalCleared(),this.clearHighlighted(),this.updateDragItemContainerType(),this.lastMovedInfo=null}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}onDragCancel(){this.clearHighlighted(),this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,a){if(!e?.length)return;const o=e.filter(r=>!r.getColDef().lockVisible);o.length&&this.beans.colModel.setColsVisible(o,t,a)}finishColumnMoving(){this.clearHighlighted();const e=this.lastMovedInfo;if(!e)return;const{columns:t,toIndex:a}=e;this.beans.colMoves.moveColumns(t,a,"uiColumnMoved",!0)}updateDragItemContainerType(){const{lastDraggingEvent:e}=this;if(this.gos.get("suppressMoveWhenColumnDragging")||!e)return;const t=e.dragItem;t&&(t.containerType=this.pinned)}handleColumnDragWhileSuppressingMovement(e,t,a,o,r){const i=this.getAllMovingColumns(e,!0);if(r){const n=this.isAttemptingToPin(i);n&&this.attemptToPinColumns(i,void 0,!0);const{fromLeft:l,xPosition:s}=this.getNormalisedXPositionInfo(i,n)||{};if(l==null||s==null){this.finishColumnMoving();return}this.moveColumnsAfterHighlight({allMovingColumns:i,xPosition:s,fromEnter:t,fakeEvent:a,fromLeft:l})}else{if(!this.beans.dragAndDrop.isDropZoneWithinThisGrid(e))return;this.highlightHoveredColumn(i,o)}}handleColumnDragWhileAllowingMovement(e,t,a,o,r){const i=this.getAllMovingColumns(e),n=this.normaliseDirection(e.hDirection)==="right",l=e.dragSource.type===1,s=this.getMoveColumnParams({allMovingColumns:i,isFromHeader:l,xPosition:o,fromLeft:n,fromEnter:t,fakeEvent:a}),c=uu({...s,finished:r});c&&(this.lastMovedInfo=c)}getAllMovingColumns(e,t=!1){const a=e.dragSource.getDragItem();let o;t?(o=a.columnsInSplit,o||(o=a.columns)):o=a.columns;const r=i=>i.colDef.lockPinned?i.getPinned()==this.pinned:!0;return o?o.filter(r):[]}getMoveColumnParams(e){const{allMovingColumns:t,isFromHeader:a,xPosition:o,fromLeft:r,fromEnter:i,fakeEvent:n}=e,{gos:l,colModel:s,colMoves:c,visibleCols:d}=this.beans;return{allMovingColumns:t,isFromHeader:a,fromLeft:r,xPosition:o,pinned:this.pinned,fromEnter:i,fakeEvent:n,gos:l,colModel:s,colMoves:c,visibleCols:d}}highlightHoveredColumn(e,t){const{gos:a,colModel:o}=this.beans,r=a.get("enableRtl"),i=o.getCols().filter(d=>d.isVisible()&&d.getPinned()===this.pinned);let n=null,l=null,s=null;for(const d of i){if(l=d.getActualWidth(),n=this.getNormalisedColumnLeft(d,0,r),n!=null){const g=n+l;if(n<=t&&g>=t){s=d;break}}n=null,l=null}if(s)e.indexOf(s)!==-1&&(s=null);else{for(let d=i.length-1;d>=0;d--){const g=i[d],u=i[d].parent;if(!u){s=g;break}const h=u?.getDisplayedLeafColumns();if(h.length){s=j(h);break}}if(!s)return;n=this.getNormalisedColumnLeft(s,0,r),l=s.getActualWidth()}if(s==null||n==null||l==null){this.lastHighlightedColumn?.column!==s&&this.clearHighlighted();return}let c;if(t-n<l/2){const d=i.indexOf(s);d===0?c=0:(c=1,s=i[d-1])}else c=1;(this.lastHighlightedColumn?.column!==s||this.lastHighlightedColumn?.position!==c)&&this.clearHighlighted(),pu(s,c),this.lastHighlightedColumn={column:s,position:c}}getNormalisedXPositionInfo(e,t){const{gos:a,visibleCols:o}=this.beans,r=a.get("enableRtl"),{firstMovingCol:i,column:n,position:l}=this.getColumnMoveAndTargetInfo(e,t,r);if(!i||!n||l==null)return;const s=o.allCols,c=s.indexOf(i),d=s.indexOf(n),g=l===0,u=c<d||c===d&&!g;let h=0;if(g?u&&(h-=1):u||(h+=1),d+h===c)return;const p=s[d+h];if(!p)return;const f=this.getNormalisedColumnLeft(p,20,r);return{fromLeft:u,xPosition:f}}getColumnMoveAndTargetInfo(e,t,a){const o=this.lastHighlightedColumn||{},{firstMovingCol:r,lastMovingCol:i}=k0(e);if(!r||!i||o.column||!t)return{firstMovingCol:r,...o};const l=this.getPinDirection()==="left";return{firstMovingCol:r,position:l?1:0,column:l!==a?r:i}}normaliseDirection(e){if(this.gos.get("enableRtl"))switch(e){case"left":return"right";case"right":return"left"}return e}getNormalisedColumnLeft(e,t,a){const{gos:o,ctrlsSvc:r}=this.beans,i=e.getLeft();if(i==null)return null;const n=e.getActualWidth();return cl({x:a?i+n-t:i+t,pinned:e.getPinned(),useHeaderRow:a,skipScrollPadding:!0,gos:o,ctrlsSvc:r})}isAttemptingToPin(e){const t=this.needToMoveLeft||this.needToMoveRight,a=this.failedMoveAttempts>hu;return t&&a||e.some(o=>o.getPinned()!==this.pinned)}moveColumnsAfterHighlight(e){const{allMovingColumns:t,xPosition:a,fromEnter:o,fakeEvent:r,fromLeft:i}=e,n=this.getMoveColumnParams({allMovingColumns:t,isFromHeader:!0,xPosition:a,fromLeft:i,fromEnter:o,fakeEvent:r}),{columns:l,toIndex:s}=gu(n)||{};l&&s!=null&&(this.lastMovedInfo={columns:l,toIndex:s}),this.finishColumnMoving()}clearHighlighted(){const{lastHighlightedColumn:e}=this;e&&(pu(e.column,null),this.lastHighlightedColumn=null)}checkCenterForScrolling(e){if(!this.isCenterContainer)return;const t=this.beans.ctrlsSvc.get("center"),a=t.getCenterViewportScrollLeft(),o=a+t.getCenterWidth();let r,i;this.gos.get("enableRtl")?(r=e<a+Kr,i=e>o-Kr):(i=e<a+Kr,r=e>o-Kr),this.needToMoveRight=r,this.needToMoveLeft=i,i||r?this.ensureIntervalStarted():this.ensureIntervalCleared()}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),C0),this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName()))}moveInterval(){let e;this.intervalCount++,e=10+this.intervalCount*w0,e>gl&&(e=gl);let t=null;const a=this.gridBodyCon.scrollFeature;if(this.needToMoveLeft?t=a.scrollHorizontally(-e):this.needToMoveRight&&(t=a.scrollHorizontally(e)),t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const{pinnedCols:o,dragAndDrop:r,gos:i}=this.beans;if(this.failedMoveAttempts<=hu+1||!o)return;if(r.setDragImageCompIcon("pinned"),!i.get("suppressMoveWhenColumnDragging")){const n=this.lastDraggingEvent?.dragItem.columns;this.attemptToPinColumns(n,void 0,!0)}}}getPinDirection(){if(this.needToMoveLeft||this.pinned==="left")return"left";if(this.needToMoveRight||this.pinned==="right")return"right"}attemptToPinColumns(e,t,a=!1){const o=(e||[]).filter(n=>!n.colDef.lockPinned);if(!o.length)return 0;a&&(t=this.getPinDirection());const{pinnedCols:r,dragAndDrop:i}=this.beans;return r?.setColsPinned(o,t,"uiColumnDragged"),a&&i.nudge(),o.length}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}};function pu(e,t){e.highlighted!==t&&(e.highlighted=t,e.dispatchColEvent("headerHighlightChanged","uiColumnMoved"))}function k0(e){const t=e.length;let a,o;for(let r=0;r<t;r++){if(!a){const i=e[r];i.getLeft()!=null&&(a=i)}if(!o){const i=e[t-1-r];i.getLeft()!=null&&(o=i)}if(a&&o)break}return{firstMovingCol:a,lastMovingCol:o}}var S0=class extends y{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){const{ctrlsSvc:e,dragAndDrop:t}=this.beans,a=this.pinned;e.whenReady(this,o=>{let r;const i=o.gridBodyCtrl.eBodyViewport;switch(a){case"left":r=[[i,o.left.eContainer],[o.bottomLeft.eContainer],[o.topLeft.eContainer]];break;case"right":r=[[i,o.right.eContainer],[o.bottomRight.eContainer],[o.topRight.eContainer]];break;default:r=[[i,o.center.eViewport],[o.bottomCenter.eViewport],[o.topCenter.eViewport]];break}this.eSecondaryContainers=r}),this.moveColumnFeature=this.createManagedBean(new y0(a)),this.bodyDropPivotTarget=this.createManagedBean(new g0(a)),t.addDropTarget(this),this.addDestroyFunc(()=>t.removeDropTarget(this))}isInterestedIn(e){return e===1||e===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.beans.colModel.pivotMode&&e.dragSource.type===0}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}onDragCancel(){this.currentDropListener.onDragCancel()}};function fu(e,t){const a=[],o=[],r=[];return e.forEach(n=>{const l=n.colDef.lockPosition;l==="right"?r.push(n):l==="left"||l===!0?a.push(n):o.push(n)}),t.get("enableRtl")?[...r,...o,...a]:[...a,...o,...r]}function mu(e,t){let a=!0;return Ze(null,t,o=>{if(!de(o))return;const r=o;if(!r.getColGroupDef()?.marryChildren)return;const l=[];for(const u of r.getLeafColumns()){const h=e.indexOf(u);l.push(h)}const s=Math.max.apply(Math,l),c=Math.min.apply(Math,l),d=s-c,g=r.getLeafColumns().length-1;d>g&&(a=!1)}),a}var x0=class extends y{constructor(){super(...arguments),this.beanName="colMoves"}moveColumnByIndex(e,t,a){const o=this.beans.colModel.getCols();if(!o)return;const r=o[e];this.moveColumns([r],t,a)}moveColumns(e,t,a,o=!0){const{colModel:r,colAnimation:i,visibleCols:n,eventSvc:l}=this.beans,s=r.getCols();if(!s)return;if(t>s.length-e.length){x(30,{toIndex:t});return}i?.start();const c=r.getColsForKeys(e);this.doesMovePassRules(c,t)&&(Qs(r.getCols(),c,t),n.refresh(a),l.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,toIndex:t,finished:o,source:a})),i?.finish()}doesMovePassRules(e,t){const a=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(a)}doesOrderPassRules(e){const{colModel:t,gos:a}=this.beans;return!(!mu(e,t.getColTree())||!(r=>{const i=c=>c?c==="left"||c===!0?-1:1:0,n=a.get("enableRtl");let l=n?1:-1,s=!0;for(const c of r){const d=i(c.colDef.lockPosition);n?d>l&&(s=!1):d<l&&(s=!1),l=d}return s})(e))}getProposedColumnOrder(e,t){const o=this.beans.colModel.getCols().slice();return Qs(o,e,t),o}createBodyDropTarget(e,t){return new S0(e,t)}moveHeader(e,t,a,o,r){const{ctrlsSvc:i,gos:n,colModel:l,visibleCols:s,focusSvc:c}=this.beans,d=t.getBoundingClientRect(),g=d.left,u=ee(a),h=u?d.width:a.getActualWidth(),p=e==="left"!==n.get("enableRtl"),f=cl({x:p?g-20:g+h+20,pinned:o,fromKeyboard:!0,gos:n,ctrlsSvc:i}),m=c.focusedHeader;uu({allMovingColumns:u?a.getLeafColumns():[a],isFromHeader:!0,fromLeft:e==="right",xPosition:f,pinned:o,fromEnter:!1,fakeEvent:!1,gos:n,colModel:l,colMoves:this,visibleCols:s,finished:!0});let v;if(u){const w=a.getDisplayedLeafColumns();v=p?w[0]:j(w)}else v=a;if(i.getScrollFeature().ensureColumnVisible(v,"auto"),(!r.isAlive()||n.get("ensureDomOrder"))&&m){let w;if(u){const b=a.getGroupId(),k=a.getLeafColumns();if(!k.length)return;const S=k[0].parent;if(!S)return;w=R0(S,b)}else w=a;w&&c.focusHeaderPosition({headerPosition:{...m,column:w}})}}setDragSourceForHeader(e,t,a){const{gos:o,colModel:r,dragAndDrop:i,visibleCols:n}=this.beans;let l=!o.get("suppressDragLeaveHidesColumns");const s=ee(t),c=s?t.getProvidedColumnGroup().getLeafColumns():[t],g={type:1,eElement:e,getDefaultIconName:()=>l?"hide":"notAllowed",getDragItem:s?()=>F0(t,n.allCols):()=>E0(t),dragItemName:a,onDragStarted:()=>{l=!o.get("suppressDragLeaveHidesColumns"),dl(c,!0)},onDragStopped:()=>dl(c,!1),onDragCancelled:()=>dl(c,!1),onGridEnter:u=>{if(l){const{columns:h=[],visibleState:p}=u??{},f=s?v=>!p||p[v.getColId()]:()=>!0,m=h.filter(v=>!v.getColDef().lockVisible&&f(v));r.setColsVisible(m,!0,"uiColumnMoved")}},onGridExit:u=>{if(l){const h=u?.columns?.filter(p=>!p.getColDef().lockVisible)||[];r.setColsVisible(h,!1,"uiColumnMoved")}}};return i.addDragSource(g,!0),g}};function R0(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.parent}}function E0(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t,containerType:e.pinned}}function F0(e,t){const a=e.getProvidedColumnGroup().getLeafColumns(),o={};for(const l of a)o[l.getId()]=l.isVisible();const r=[];for(const l of t)a.indexOf(l)>=0&&(r.push(l),Pe(a,l));for(const l of a)r.push(l);const i=[],n=e.getLeafColumns();for(const l of r)n.indexOf(l)!==-1&&i.push(l);return{columns:r,columnsInSplit:i,visibleState:o,containerType:i[0]?.pinned}}var vu={moduleName:"ColumnMove",version:F,beans:[x0,s0],apiFunctions:{moveColumnByIndex:c0,moveColumns:d0},dependsOn:[sl],css:[l0]},M0=class extends y{constructor(){super(...arguments),this.beanName="autoWidthCalc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const a=this.getHeaderCellForColumn(e);if(!a)return-1;const o=this.beans.rowRenderer.getAllCellsNotSpanningForColumn(e);return t||o.push(a),this.getPreferredWidthForElements(o)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.getPreferredWidthForElements([t]):-1}getPreferredWidthForElements(e,t){const a=document.createElement("form");a.style.position="fixed";const o=this.centerRowContainerCtrl.eContainer;for(const i of e)this.cloneItemIntoDummy(i,a);o.appendChild(a);const r=Math.ceil(a.getBoundingClientRect().width);return a.remove(),t=t??this.gos.get("autoSizePadding"),r+t}getHeaderCellForColumn(e){let t=null;for(const a of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()){const o=a.getHtmlElementForColumnHeader(e);o!=null&&(t=o)}return t}cloneItemIntoDummy(e,t){const a=e.cloneNode(!0);a.style.width="",a.style.position="static",a.style.left="";const o=document.createElement("div"),r=o.classList;["ag-header-cell","ag-header-group-cell"].some(l=>a.classList.contains(l))?(r.add("ag-header","ag-header-row"),o.style.position="static"):r.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(s=>n.classList.contains(s))){for(let s=0;s<n.classList.length;s++){const c=n.classList[s];c!="ag-row-position-absolute"&&r.add(c)}break}n=n.parentElement}o.appendChild(a),t.appendChild(o)}},bu={moduleName:"AutoWidth",version:F,beans:[M0]};function z0(e,t,a=!0,o="api"){e.colResize?.setColumnWidths(t,!1,a,o)}function wu(e,t){if(!e||e.length==0)return;const a=t(e[0]);for(let o=1;o<e.length;o++)if(a!==t(e[o]))return;return a}function Cu(e,t,a){if(!t.length)return;const o=t.length===1?t[0]:null,r=wu(t,i=>i.getPinned());e.dispatchEvent({type:"columnPinned",pinned:r??null,columns:t,column:o,source:a})}function D0(e,t,a){if(!t.length)return;const o=t.length===1?t[0]:null,r=wu(t,i=>i.isVisible());e.dispatchEvent({type:"columnVisible",visible:r,columns:t,column:o,source:a})}function yu(e,t,a,o){e.dispatchEvent({type:t,columns:a,column:a?.length==1?a[0]:null,source:o})}function Na(e,t,a,o,r=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:r,finished:a,source:o})}var A0=class extends y{constructor(e,t,a,o){super(),this.comp=e,this.eResize=t,this.pinned=a,this.columnGroup=o}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const{horizontalResizeSvc:e,gos:t,colAutosize:a}=this.beans,o=e.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});this.addDestroyFunc(o),!t.get("suppressAutoSize")&&a&&this.addDestroyFunc(a.addColumnGroupResize(this.eResize,this.columnGroup,()=>this.resizeLeafColumnsToFit("uiColumnResized")))}onResizeStart(e){const{columnsToResize:t,resizeStartWidth:a,resizeRatios:o,groupAfterColumns:r,groupAfterStartWidth:i,groupAfterRatios:n}=this.getInitialValues(e);this.resizeCols=t,this.resizeStartWidth=a,this.resizeRatios=o,this.resizeTakeFromCols=r,this.resizeTakeFromStartWidth=i,this.resizeTakeFromRatios=n,this.toggleColumnResizing(!0)}onResizing(e,t,a="uiColumnResized"){const o=this.normaliseDragChange(t),r=this.resizeStartWidth+o;this.resizeColumnsFromLocalValues(r,a,e)}getInitialValues(e){const t=s=>s.reduce((c,d)=>c+d.getActualWidth(),0),a=(s,c)=>s.map(d=>d.getActualWidth()/c),o=this.getColumnsToResize(),r=t(o),i=a(o,r),n={columnsToResize:o,resizeStartWidth:r,resizeRatios:i};let l=null;if(e&&(l=this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup,"After")??null),l){const s=l.getDisplayedLeafColumns(),c=n.groupAfterColumns=s.filter(g=>g.isResizable()),d=n.groupAfterStartWidth=t(c);n.groupAfterRatios=a(c,d)}else n.groupAfterColumns=void 0,n.groupAfterStartWidth=void 0,n.groupAfterRatios=void 0;return n}resizeLeafColumnsToFit(e){const t=this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup),a=this.getInitialValues();t>a.resizeStartWidth&&this.resizeColumns(a,t,e,!0)}resizeColumnsFromLocalValues(e,t,a=!0){if(!this.resizeCols||!this.resizeRatios)return;const o={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols,groupAfterStartWidth:this.resizeTakeFromStartWidth,groupAfterRatios:this.resizeTakeFromRatios};this.resizeColumns(o,e,t,a)}resizeColumns(e,t,a,o=!0){const{columnsToResize:r,resizeStartWidth:i,resizeRatios:n,groupAfterColumns:l,groupAfterStartWidth:s,groupAfterRatios:c}=e,d=[];if(d.push({columns:r,ratios:n,width:t}),l){const g=t-i;d.push({columns:l,ratios:c,width:s-g})}this.beans.colResize?.resizeColumnSets({resizeSets:d,finished:o,source:a}),o&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.toggleCss("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(t=>t.isResizable())}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?this.pinned!=="left"&&(t*=-1):this.pinned==="right"&&(t*=-1),t}destroy(){super.destroy(),this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}},P0=class extends y{constructor(e,t,a,o,r){super(),this.pinned=e,this.column=t,this.eResize=a,this.comp=o,this.ctrl=r}postConstruct(){const e=[];let t,a;const o=()=>{if(U(this.eResize,t),!t)return;const{horizontalResizeSvc:n,colAutosize:l}=this.beans,s=n.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});e.push(s),a&&l&&e.push(l.addColumnAutosizeListeners(this.eResize,this.column))},r=()=>{for(const n of e)n();e.length=0},i=()=>{const n=this.column.isResizable(),l=!this.gos.get("suppressAutoSize")&&!this.column.colDef.suppressAutoSize;(n!==t||l!==a)&&(t=n,a=l,r(),o())};i(),this.addDestroyFunc(r),this.ctrl.setRefreshFunction("resize",i)}onResizing(e,t){const{column:a,lastResizeAmount:o,resizeStartWidth:r,beans:i}=this,n=this.normaliseResizeAmount(t),l=r+n,s=[{key:a,newWidth:l}],{pinnedCols:c,ctrlsSvc:d,colResize:g}=i;if(this.column.getPinned()){const u=c?.leftWidth??0,h=c?.rightWidth??0,p=ka(d.getGridBodyCtrl().eBodyViewport)-50;if(u+h+(n-o)>p)return}this.lastResizeAmount=n,g?.setColumnWidths(s,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.column.resizing=e,this.comp.toggleCss("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const a=this.pinned!=="left",o=this.pinned==="right";return this.gos.get("enableRtl")?a&&(t*=-1):o&&(t*=-1),t}},I0=class extends y{constructor(){super(...arguments),this.beanName="colResize"}setColumnWidths(e,t,a,o){const r=[],{colModel:i,gos:n,visibleCols:l}=this.beans;for(const s of e){const c=i.getColDefColOrCol(s.key);if(!c)continue;if(r.push({width:s.newWidth,ratios:[1],columns:[c]}),n.get("colResizeDefault")==="shift"&&(t=!t),t){const g=l.getColAfter(c);if(!g)continue;const u=c.getActualWidth()-s.newWidth,h=g.getActualWidth()+u;r.push({width:h,ratios:[1],columns:[g]})}}r.length!==0&&this.resizeColumnSets({resizeSets:r,finished:a,source:o})}resizeColumnSets(e){const{resizeSets:t,finished:a,source:o}=e;if(!(!t||t.every(d=>T0(d)))){if(a){const d=t&&t.length>0?t[0].columns:null;Na(this.eventSvc,d,a,o)}return}const i=[],n=[];for(const d of t){const{width:g,columns:u,ratios:h}=d,p={},f={};for(const w of u)n.push(w);let m=!0,v=0;for(;m;){if(v++,v>1e3){q(31);break}m=!1;const w=[];let b=0,k=g;u.forEach((R,M)=>{if(f[R.getId()])k-=p[R.getId()];else{w.push(R);const O=h[M];b+=O}});const S=1/b;w.forEach((R,M)=>{const L=M===w.length-1;let O;L?O=k:(O=Math.round(h[M]*g*S),k-=O);const N=R.getMinWidth(),B=R.getMaxWidth();O<N?(O=N,f[R.getId()]=!0,m=!0):B>0&&O>B&&(O=B,f[R.getId()]=!0,m=!0),p[R.getId()]=O})}for(const w of u){const b=p[w.getId()];w.getActualWidth()!==b&&(w.setActualWidth(b,o),i.push(w))}}const l=i.length>0;let s=[];if(l){const{colFlex:d,visibleCols:g,colViewport:u}=this.beans;s=d?.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0})??[],g.setLeftValues(o),g.updateBodyWidths(),u.checkViewportColumns()}const c=n.concat(s);(l||a)&&Na(this.eventSvc,c,a,o,s)}resizeHeader(e,t,a){if(!e.isResizable())return;const o=e.getActualWidth(),r=e.getMinWidth(),i=e.getMaxWidth(),n=Math.min(Math.max(o+t,r),i);this.setColumnWidths([{key:e,newWidth:n}],a,!0,"uiColumnResized")}createResizeFeature(e,t,a,o,r){return new P0(e,t,a,o,r)}createGroupResizeFeature(e,t,a,o){return new A0(e,t,a,o)}};function T0(e){const{columns:t,width:a}=e;let o=0,r=0,i=!0;for(const s of t){const c=s.getMinWidth();o+=c||0;const d=s.getMaxWidth();d>0?r+=d:i=!1}const n=a>=o,l=!i||a<=r;return n&&l}var L0={moduleName:"ColumnResize",version:F,beans:[I0],apiFunctions:{setColumnWidths:z0},dependsOn:[du,bu]},B0=class extends y{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);for(const t of this.columnGroup.getLeafColumns())t.__addEventListener("widthChanged",e),t.__addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.__removeEventListener("widthChanged",e),t.__removeEventListener("visibleChanged",e)})}removeListenersOnChildrenColumns(){for(const e of this.removeChildListenersFuncs)e();this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.toggleCss("ag-hidden",e===0)}},O0=class extends Vn{constructor(){super(...arguments),this.onSuppressColMoveChange=()=>{!this.isAlive()||this.isSuppressMoving()?this.removeDragSource():this.dragSource||this.setDragSource(this.eGui)}}wireComp(e,t,a,o,r){const{column:i,beans:n}=this,{context:l,colNames:s,colHover:c,rangeSvc:d,colResize:g}=n;this.comp=e,r=Ro(this,l,r),this.setGui(t,r),this.displayName=s.getDisplayNameForColumnGroup(i,"header"),this.refreshHeaderStyles(),this.addClasses(),this.setupMovingCss(r),this.setupExpandable(r),this.setupTooltip(),this.refreshAnnouncement(),this.setupAutoHeight({wrapperElement:o,compBean:r}),this.setupUserComp(),this.addHeaderMouseListeners(r,o),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();const u=this.rowCtrl.pinned,h=i.getProvidedColumnGroup().getLeafColumns();c?.createHoverFeature(r,h,t),d?.createRangeHighlightFeature(r,i,e),r.createManagedBean(new Hn(i,t,n)),r.createManagedBean(new B0(e,i)),g?this.resizeFeature=r.createManagedBean(g.createGroupResizeFeature(e,a,u,i)):e.setResizableDisplayed(!1),r.createManagedBean(new Ta(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(r,h),this.addManagedEventListeners({cellSelectionChanged:()=>this.refreshAnnouncement()}),r.addManagedPropertyListener("cellSelection",()=>this.refreshAnnouncement()),r.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(r),r.addDestroyFunc(()=>this.clearComponent())}getHeaderClassParams(){const{column:e,beans:t}=this,a=e.getDefinition();return I(t.gos,{colDef:a,columnGroup:e,floatingFilter:!1})}refreshMaxHeaderHeight(){const{gos:e,comp:t}=this,a=e.get("groupHeaderHeight");a!=null?a===0?t.setHeaderWrapperHidden(!0):t.setHeaderWrapperMaxHeight(a):(t.setHeaderWrapperHidden(!1),t.setHeaderWrapperMaxHeight(null))}addHighlightListeners(e,t){if(this.beans.gos.get("suppressMoveWhenColumnDragging"))for(const a of t)e.addManagedListeners(a,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,a)})}onLeafColumnHighlightChanged(e){const t=this.column.getDisplayedLeafColumns(),a=t[0]===e,o=j(t)===e;if(!a&&!o)return;const r=e.getHighlighted(),i=!!this.rowCtrl.getHeaderCellCtrls().find(s=>s.column.isMoving());let n=!1,l=!1;if(i){const s=this.beans.gos.get("enableRtl"),c=r===1,d=r===0;a&&(s?l=c:n=d),o&&(s?n=d:l=c)}this.comp.toggleCss("ag-header-highlight-before",n),this.comp.toggleCss("ag-header-highlight-after",l)}resizeHeader(e,t){const{resizeFeature:a}=this;if(!a)return;const o=a.getInitialValues(t);a.resizeColumns(o,o.resizeStartWidth+e,"uiColumnResized",!0)}resizeLeafColumnsToFit(e){this.resizeFeature?.resizeLeafColumnsToFit(e)}setupUserComp(){const{colGroupSvc:e,userCompFactory:t,gos:a,enterpriseMenuFactory:o}=this.beans,r=this.column,i=r.getProvidedColumnGroup(),n=I(a,{displayName:this.displayName,columnGroup:r,setExpanded:s=>{e.setColumnGroupOpened(i,s,"gridInitializing")},setTooltip:(s,c)=>{a.assertModuleRegistered("Tooltip",3),this.setupTooltip(s,c)},showColumnMenu:(s,c)=>o?.showMenuAfterButtonClick(i,s,"columnMenu",c),showColumnMenuAfterMouseClick:(s,c)=>o?.showMenuAfterMouseEvent(i,s,"columnMenu",c),eGridHeader:this.eGui}),l=Ob(t,n);l&&this.comp.setUserCompDetails(l)}addHeaderMouseListeners(e,t){const{column:a,comp:o,beans:{rangeSvc:r},gos:i}=this,n=d=>this.handleMouseOverChange(d.type==="mouseenter"),l=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",a.getProvidedColumnGroup()),s=d=>this.handleContextMenuMouseEvent(d,void 0,a.getProvidedColumnGroup());e.addManagedListeners(this.eGui,{mouseenter:n,mouseleave:n,click:l,contextmenu:s}),o.toggleCss("ag-header-group-cell-selectable",Et(i));const c=r?.createHeaderGroupCellMouseListenerFeature(this.column,t);c&&this.createManagedBean(c)}handleMouseOverChange(e){this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderGroupTooltip(this.tooltipFeature,this,e,t)}setupExpandable(e){const t=this.column.getProvidedColumnGroup();this.refreshExpanded();const a=this.refreshExpanded.bind(this);e.addManagedListeners(t,{expandedChanged:a,expandableChanged:a})}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0),this.refreshHeaderStyles(),this.refreshAnnouncement()}addClasses(){const{column:e}=this,t=e.getColGroupDef(),a=Gn(t,this.gos,null,e);e.isPadding()?(a.push("ag-header-group-cell-no-group"),e.getLeafColumns().every(r=>r.isSpanHeaderHeight())&&a.push("ag-header-span-height")):(a.push("ag-header-group-cell-with-group"),t?.wrapHeaderText&&a.push("ag-header-cell-wrap-text"));for(const o of a)this.comp.toggleCss(o,!0)}setupMovingCss(e){const{column:t}=this,o=t.getProvidedColumnGroup().getLeafColumns(),r=()=>this.comp.toggleCss("ag-header-cell-moving",t.isMoving());for(const i of o)e.addManagedListeners(i,{movingChanged:r});r()}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription())}handleKeyDown(e){if(super.handleKeyDown(e),!this.getWrapperHasFocus())return;const{column:a,expandable:o,gos:r,beans:i}=this,n=Et(r);if(e.key==C.ENTER){if(n&&!e.altKey)i.rangeSvc?.handleColumnSelection(a,e);else if(o){const l=!a.isExpanded();i.colGroupSvc.setColumnGroupOpened(a.getProvidedColumnGroup(),l,"uiColumnExpanded")}}}refreshAnnouncement(){let e;const{gos:t,expandable:a}=this,o=Et(t),r=this.getLocaleTextFunc();o&&a?e=r("ariaColumnGroupCellSelectionAndExpansion","Press Enter to toggle selection for all visible cells in this column group. Press ALT ENTER to expand or collapse this column group"):o?e=r("ariaColumnGroupCellSelection","Press Enter to toggle selection for all visible cells in this column group"):a&&(e=r("ariaColumnGroupExpansion","Press ENTER to expand or collapse this column group")),this.ariaAnnouncement=e}announceAriaDescription(){const{beans:e,eGui:t,ariaAnnouncement:a}=this;!a||!t.contains(Q(e))||e.ariaAnnounce?.announceValue(a,"columnHeader")}setDragSource(e){!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),e&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null))}isSuppressMoving(){return this.gos.get("suppressMovableColumns")||this.column.getLeafColumns().some(e=>e.colDef.suppressMovable||e.colDef.lockPosition)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function N0(e,t,a){e.colGroupSvc?.setColumnGroupOpened(t,a,"api")}function H0(e,t,a){return e.colGroupSvc?.getColumnGroup(t,a)??null}function G0(e,t){return e.colGroupSvc?.getProvidedColGroup(t)??null}function V0(e,t,a){return e.colNames.getDisplayNameForColumnGroup(t,a)||""}function q0(e){return e.colGroupSvc?.getColumnGroupState()??[]}function W0(e,t){e.colGroupSvc?.setColumnGroupState(t,"api")}function U0(e){e.colGroupSvc?.resetColumnGroupState("api")}function j0(e){return e.visibleCols.treeLeft}function K0(e){return e.visibleCols.treeCenter}function _0(e){return e.visibleCols.treeRight}function Q0(e){return e.visibleCols.getAllTrees()}var ul=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let a;return typeof t!="number"?a=0:a=t+1,this.existingIds[e]=a,a}};function Y0(e,t){for(let a=0;a<t.length;a++){const o=e.indexOf(t[a]);o>=0&&(e[o]=e[e.length-1],e.pop())}}var Z0=class extends y{constructor(){super(...arguments),this.beanName="visibleCols",this.colsAndGroupsMap={},this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.headerGroupRowCount=0,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.isBodyWidthDirty=!0}refresh(e,t=!1){const{colFlex:a,colModel:o,colGroupSvc:r,colViewport:i,selectionColSvc:n}=this.beans;t||this.buildTrees(o,r),r?.updateOpenClosedVisibility(),this.leftCols=hl(this.treeLeft),this.centerCols=hl(this.treeCenter),this.rightCols=hl(this.treeRight),n?.refreshVisibility(this.leftCols,this.centerCols,this.rightCols),this.joinColsAriaOrder(o),this.joinCols(),this.headerGroupRowCount=this.getHeaderRowCount(),this.setLeftValues(e),this.autoHeightCols=this.allCols.filter(l=>l.isAutoHeight()),a?.refreshFlexedColumns(),this.updateBodyWidths(),this.setFirstRightAndLastLeftPinned(o,this.leftCols,this.rightCols,e),i.checkViewportColumns(!1),this.eventSvc.dispatchEvent({type:"displayedColumnsChanged",source:e})}getHeaderRowCount(){if(!this.gos.get("hidePaddedHeaderRows"))return this.beans.colModel.cols.treeDepth;let e=0;for(const t of this.allCols){let a=t.parent;for(;a;){if(!a.isPadding()){const o=a.getProvidedColumnGroup().getLevel()+1;o>e&&(e=o);break}a=a.parent}}return e}updateBodyWidths(){const e=pt(this.centerCols),t=pt(this.leftCols),a=pt(this.rightCols);this.isBodyWidthDirty=this.bodyWidth!==e,(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==a)&&(this.bodyWidth=e,this.leftWidth=t,this.rightWidth=a,this.eventSvc.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventSvc.dispatchEvent({type:"displayedColumnsWidthChanged"}))}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e,t,a,o){let r,i;this.gos.get("enableRtl")?(r=t?t[0]:null,i=a?j(a):null):(r=t?j(t):null,i=a?a[0]:null);for(const n of e.getCols())n.setLastLeftPinned(n===r,o),n.setFirstRightPinned(n===i,o)}buildTrees(e,t){const a=e.getColsToShow(),o=a.filter(s=>s.getPinned()=="left"),r=a.filter(s=>s.getPinned()=="right"),i=a.filter(s=>s.getPinned()!="left"&&s.getPinned()!="right"),n=new ul,l=s=>t?t.createColumnGroups(s):s.columns;this.treeLeft=l({columns:o,idCreator:n,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=l({columns:r,idCreator:n,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=l({columns:i,idCreator:n,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.ariaOrderColumns=[]}joinColsAriaOrder(e){const t=e.getCols(),a=[],o=[],r=[];for(const i of t){const n=i.getPinned();n?n===!0||n==="left"?a.push(i):r.push(i):o.push(i)}this.ariaOrderColumns=a.concat(o).concat(r)}getAriaColIndex(e){let t;return ee(e)?t=e.getLeafColumns()[0]:t=e,this.ariaOrderColumns.indexOf(t)+1}setLeftValuesOfGroups(){for(const e of[this.treeLeft,this.treeRight,this.treeCenter])for(const t of e)ee(t)&&t.checkLeft()}setLeftValuesOfCols(e){const{colModel:t}=this.beans;if(!t.getColDefCols())return;const o=t.getCols().slice(0),r=this.gos.get("enableRtl");for(const i of[this.leftCols,this.rightCols,this.centerCols]){if(r){let n=pt(i);for(const l of i)n-=l.getActualWidth(),l.setLeft(n,e)}else{let n=0;for(const l of i)l.setLeft(n,e),n+=l.getActualWidth()}Y0(o,i)}for(const i of o)i.setLeft(null,e)}joinCols(){this.gos.get("enableRtl")?this.allCols=this.rightCols.concat(this.centerCols).concat(this.leftCols):this.allCols=this.leftCols.concat(this.centerCols).concat(this.rightCols)}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}isColDisplayed(e){return this.allCols.indexOf(e)>=0}getLeftColsForRow(e){const{leftCols:t,beans:{colModel:a}}=this;return a.colSpanActive?this.getColsForRow(e,t):t}getRightColsForRow(e){const{rightCols:t,beans:{colModel:a}}=this;return a.colSpanActive?this.getColsForRow(e,t):t}getColsForRow(e,t,a,o){const r=[];let i=null;for(let n=0;n<t.length;n++){const l=t[n],s=t.length-n,c=Math.min(l.getColSpan(e),s),d=[l];if(c>1){const u=c-1;for(let h=1;h<=u;h++)d.push(t[n+h]);n+=u}let g;if(a){g=!1;for(const u of d)a(u)&&(g=!0)}else g=!0;g&&(r.length===0&&i&&o&&o(l)&&r.push(i),r.push(l)),i=l}return r}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getColBefore(e){const t=this.allCols,a=t.indexOf(e);return a>0?t[a-1]:null}isPinningLeft(){return this.leftCols.length>0}isPinningRight(){return this.rightCols.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=t=>{this.colsAndGroupsMap[t.getUniqueId()]=t};sa(this.treeCenter,!1,e),sa(this.treeLeft,!1,e),sa(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["leftCols","centerCols","rightCols"];e&&t.reverse();for(let a=0;a<t.length;a++){const o=this[t[a]];if(o.length)return e?j(o):o[0]}return null}getColAfter(e){const t=this.allCols,a=t.indexOf(e);return a<t.length-1?t[a+1]:null}getColsLeftWidth(){return pt(this.leftCols)}getDisplayedColumnsRightWidth(){return pt(this.rightCols)}isColAtEdge(e,t){const a=this.allCols;if(!a.length)return!1;const o=t==="first";let r;if(ee(e)){const i=e.getDisplayedLeafColumns();if(!i.length)return!1;r=o?i[0]:j(i)}else r=e;return(o?a[0]:j(a))===r}};function sa(e,t,a){if(e)for(let o=0;o<e.length;o++){const r=e[o];if(ee(r)){const i=t?r.getDisplayedChildren():r.getChildren();sa(i,t,a)}a(r)}}function hl(e){const t=[];return sa(e,!0,a=>{dt(a)&&t.push(a)}),t}var J0=class extends y{constructor(){super(...arguments),this.beanName="colGroupSvc"}getColumnGroupState(){const e=[],t=this.beans.colModel.getColTree();return Ze(null,t,a=>{de(a)&&e.push({groupId:a.getGroupId(),open:a.isExpanded()})}),e}resetColumnGroupState(e){const t=this.beans.colModel.getColDefColTree();if(!t)return;const a=[];Ze(null,t,o=>{if(de(o)){const r=o.getColGroupDef(),i={groupId:o.getGroupId(),open:r?r.openByDefault:void 0};a.push(i)}}),this.setColumnGroupState(a,e)}setColumnGroupState(e,t){const{colModel:a,colAnimation:o,visibleCols:r,eventSvc:i}=this.beans;if(!a.getColTree().length)return;o?.start();const l=[];for(const s of e){const c=s.groupId,d=s.open,g=this.getProvidedColGroup(c);g&&g.isExpanded()!==d&&(g.setExpanded(d),l.push(g))}r.refresh(t,!0),l.length&&i.dispatchEvent({type:"columnGroupOpened",columnGroup:l.length===1?l[0]:void 0,columnGroups:l}),o?.finish()}setColumnGroupOpened(e,t,a){let o;de(e)?o=e.getId():o=e||"",this.setColumnGroupState([{groupId:o,open:t}],a)}getProvidedColGroup(e){let t=null;return Ze(null,this.beans.colModel.getColTree(),a=>{de(a)&&a.getId()===e&&(t=a)}),t}getGroupAtDirection(e,t){const a=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),o=e.getDisplayedLeafColumns(),r=t==="After"?j(o):o[0],i=`getCol${t}`;for(;;){const n=this.beans.visibleCols[i](r);if(!n)return null;const l=this.getColGroupAtLevel(n,a);if(l!==e)return l}}getColGroupAtLevel(e,t){let a=e.parent,o,r;for(;o=a.getProvidedColumnGroup().getLevel(),r=a.getPaddingLevel(),!(o+r<=t);)a=a.parent;return a}updateOpenClosedVisibility(){const e=this.beans.visibleCols.getAllTrees();sa(e,!1,t=>{ee(t)&&t.calculateDisplayedColumns()})}getColumnGroup(e,t){if(!e)return null;if(ee(e))return e;const a=this.beans.visibleCols.getAllTrees(),o=typeof t=="number";let r=null;return sa(a,!1,i=>{if(ee(i)){const n=i;let l;o?l=e===n.getGroupId()&&t===n.getPartId():l=e===n.getGroupId(),l&&(r=n)}}),r}createColumnGroups(e){const{columns:t,idCreator:a,pinned:o,oldDisplayedGroups:r,isStandaloneStructure:i}=e,n=this.mapOldGroupsById(r),l=[];let s=t;for(;s.length;){const c=s;s=[];let d=0;const g=u=>{const h=d;d=u;const p=c[h],m=(ee(p)?p.getProvidedColumnGroup():p).getOriginalParent();if(m==null){for(let w=h;w<u;w++)l.push(c[w]);return}const v=this.createColumnGroup(m,a,n,o,i);for(let w=h;w<u;w++)v.addChild(c[w]);s.push(v)};for(let u=1;u<c.length;u++){const h=c[u],f=(ee(h)?h.getProvidedColumnGroup():h).getOriginalParent(),m=c[d],w=(ee(m)?m.getProvidedColumnGroup():m).getOriginalParent();f!==w&&g(u)}d<c.length&&g(c.length)}return i||this.setupParentsIntoCols(l,null),l}createProvidedColumnGroup(e,t,a,o,r,i,n){const l=r.getUniqueKey(t.groupId||null,null),s=tn(this.beans,t,l),c=new Aa(s,l,!1,a);this.createBean(c);const d=this.findExistingGroup(t,i);d&&i.splice(d.idx,1);const g=d?.group;g&&c.setExpanded(g.isExpanded());const u=md(this.beans,s.children,a+1,e,o,r,i,n);return c.setChildren(u),c}balanceColumnTree(e,t,a,o){const r=[];for(let i=0;i<e.length;i++){const n=e[i];if(de(n)){const l=n,s=this.balanceColumnTree(l.getChildren(),t+1,a,o);l.setChildren(s),r.push(l)}else{let l,s;for(let c=t;c<a;c++){const d=o.getUniqueKey(null,null),g=tn(this.beans,null,d),u=new Aa(g,d,!0,c);this.createBean(u),s&&s.setChildren([u]),s=u,l||(l=s)}if(l&&s)if(r.push(l),e.some(d=>de(d))){s.setChildren([n]);continue}else{s.setChildren(e);break}r.push(n)}}return r}findDepth(e){let t=0,a=e;for(;a?.[0]&&de(a[0]);)t++,a=a[0].getChildren();return t}findMaxDepth(e,t){let a=t;for(let o=0;o<e.length;o++){const r=e[o];if(de(r)){const i=r,n=this.findMaxDepth(i.getChildren(),t+1);a<n&&(a=n)}}return a}balanceTreeForAutoCols(e,t){const a=[];for(const o of e){let r=o;for(let i=t-1;i>=0;i--){const n=new Aa(null,`FAKE_PATH_${o.getId()}_${i}`,!0,i);this.createBean(n),n.setChildren([r]),r.originalParent=n,r=n}t===0&&(o.originalParent=null),a.push(r)}return a}findExistingGroup(e,t){if(e.groupId!=null)for(let o=0;o<t.length;o++){const r=t[o];if(r.getColGroupDef()&&r.getId()===e.groupId)return{idx:o,group:r}}}createColumnGroup(e,t,a,o,r){const i=e.getGroupId(),n=t.getInstanceIdForKey(i),l=Sd(i,n);let s=a[l];return s&&s.getProvidedColumnGroup()!==e&&(s=null),z(s)?s.reset():(s=new Ia(e,i,n,o),r||this.createBean(s)),s}mapOldGroupsById(e){const t={},a=o=>{for(const r of o)if(ee(r)){const i=r;t[r.getUniqueId()]=i,a(i.getChildren())}};return e&&a(e),t}setupParentsIntoCols(e,t){for(const a of e??[])if(a.parent!==t&&(this.beans.colViewport.colsWithinViewportHash=""),a.parent=t,ee(a)){const o=a;this.setupParentsIntoCols(o.getChildren(),o)}}},ku={moduleName:"ColumnGroup",version:F,dynamicBeans:{headerGroupCellCtrl:O0},beans:[J0],apiFunctions:{getAllDisplayedColumnGroups:Q0,getCenterDisplayedColumnGroups:K0,getColumnGroup:H0,getColumnGroupState:q0,getDisplayNameForColumnGroup:V0,getLeftDisplayedColumnGroups:j0,getProvidedColumnGroup:G0,getRightDisplayedColumnGroups:_0,resetColumnGroupState:U0,setColumnGroupOpened:N0,setColumnGroupState:W0}};function Be(e,t,a){const{colModel:o,rowGroupColsSvc:r,pivotColsSvc:i,autoColSvc:n,selectionColSvc:l,colAnimation:s,visibleCols:c,pivotResultCols:d,environment:g,valueColsSvc:u,eventSvc:h,gos:p}=e,f=o.getColDefCols()??[],m=l?.getColumns();if(!f.length&&!m?.length)return!1;if(t?.state&&!t.state.forEach)return x(32),!1;const v=(S,R,M,L,O)=>{if(!S)return;const N=ib(R,t.defaultState),B=N("flex").value1,K=N("sort").value1,W=N("sortType").value1,ge=ut(K)||Cr(W),ie=Ye(W),qs=po(K),Ws=ge?{type:ie,direction:qs}:void 0;if(vd(e,S,N("hide").value1,Ws,N("sortIndex").value1,N("pinned").value1,B,a),B==null){const Ya=N("width").value1;if(Ya!=null){const Zo=S.getColDef().minWidth??g.getDefaultColumnMinWidth();Zo!=null&&Ya>=Zo&&S.setActualWidth(Ya,a)}}O||!S.primary||(u?.syncColumnWithState(S,a,N),r?.syncColumnWithState(S,a,N,M),i?.syncColumnWithState(S,a,N,L))},w=(S,R,M)=>{const L=xu(e,a),O=R.slice(),N={},B={},K=[],W=[],ge=[];let ie=0;const qs=r?.columns.slice()??[],Ws=i?.columns.slice()??[];for(const xe of S){const Jo=xe.colId;if(Jo.startsWith(ht)){K.push(xe),ge.push(xe);continue}if(ft(Jo)){W.push(xe),ge.push(xe);continue}const Za=M(Jo);Za?(v(Za,xe,N,B,!1),Pe(O,Za)):(ge.push(xe),ie+=1)}const Ya=xe=>v(xe,null,N,B,!1);O.forEach(Ya),r?.sortColumns(Eu.bind(r,N,qs)),i?.sortColumns(Eu.bind(i,B,Ws)),o.refreshCols(!1,a);const Zo=(xe,Jo,Us=[])=>{for(const Za of Jo){const zm=xe(Za.colId);Pe(Us,zm),v(zm,Za,null,null,!0)}Us.forEach(Ya)};return Zo(xe=>n?.getColumn(xe)??null,K,n?.getColumns()?.slice()),Zo(xe=>l?.getColumn(xe)??null,W,l?.getColumns()?.slice()),X0(t,o,p),c.refresh(a),h.dispatchEvent({type:"columnEverythingChanged",source:a}),L(),{unmatchedAndAutoStates:ge,unmatchedCount:ie}};s?.start();let{unmatchedAndAutoStates:b,unmatchedCount:k}=w(t.state||[],f,S=>o.getColDefCol(S));if(b.length>0||z(t.defaultState)){const S=d?.getPivotResultCols()?.list??[];k=w(b,S,R=>d?.getPivotResultCol(R)??null).unmatchedCount}return s?.finish(),k===0}function Su(e,t){const{colModel:a,autoColSvc:o,selectionColSvc:r,eventSvc:i,gos:n}=e;if(!a.getColDefCols()?.length)return;const s=a.getColDefColTree(),c=on(s),d=[];let g=1e3,u=1e3;const h=w=>{const b=Ru(w);_(b.rowGroupIndex)&&b.rowGroup&&(b.rowGroupIndex=g++),_(b.pivotIndex)&&b.pivot&&(b.pivotIndex=u++),d.push(b)};o?.getColumns()?.forEach(h),r?.getColumns()?.forEach(h),c?.forEach(h),Be(e,{state:d},t);const p=o?.getColumns()??[],v=[...r?.getColumns()??[],...p,...c].map(w=>({colId:w.colId}));Be(e,{state:v,applyOrder:!0},t),i.dispatchEvent(I(n,{type:"columnsReset",source:t}))}function xu(e,t){const{rowGroupColsSvc:a,pivotColsSvc:o,valueColsSvc:r,colModel:i,sortSvc:n,eventSvc:l}=e,s={rowGroupColumns:a?.columns.slice()??[],pivotColumns:o?.columns.slice()??[],valueColumns:r?.columns.slice()??[]},c=Do(e),d={};for(const g of c)d[g.colId]=g;return()=>{const g=(R,M,L,O)=>{const N=M.map(O),B=L.map(O);if(rt(N,B))return;const W=new Set(M);for(const ie of L)W.delete(ie)||W.add(ie);const ge=[...W];l.dispatchEvent({type:R,columns:ge,column:ge.length===1?ge[0]:null,source:t})},u=R=>{const M=[];return i.forAllCols(L=>{const O=d[L.colId];O&&R(O,L)&&M.push(L)}),M},h=R=>R.colId;g("columnRowGroupChanged",s.rowGroupColumns,a?.columns??[],h),g("columnPivotChanged",s.pivotColumns,o?.columns??[],h);const f=u((R,M)=>{const L=R.aggFunc!=null,O=L!=M.isValueActive(),N=L&&R.aggFunc!=M.getAggFunc();return O||N});f.length>0&&yu(l,"columnValueChanged",f,t),Na(l,u((R,M)=>R.width!=M.getActualWidth()),!0,t),Cu(l,u((R,M)=>R.pinned!=M.getPinned()),t),D0(l,u((R,M)=>R.hide==M.isVisible()),t);const k=u((R,M)=>!ho(M.getSortDef(),{type:Ye(R.sortType),direction:po(R.sort)})||R.sortIndex!=M.getSortIndex());k.length>0&&n?.dispatchSortChangedEvents(t,k);const S=Do(e);ey(c,S,t,i,l)}}function Do(e){const{colModel:t,rowGroupColsSvc:a,pivotColsSvc:o}=e,r=t.getColDefCols();if(_(r)||!t.isAlive())return[];const i=a?.columns,n=o?.columns,l=[],s=d=>{const g=d.isRowGroupActive()&&i?i.indexOf(d):null,u=d.isPivotActive()&&n?n.indexOf(d):null,h=d.isValueActive()?d.getAggFunc():null,p=d.getSortIndex()!=null?d.getSortIndex():null;l.push({colId:d.colId,width:d.getActualWidth(),hide:!d.isVisible(),pinned:d.getPinned(),sort:d.getSort(),sortType:d.getSortDef()?.type,sortIndex:p,aggFunc:h,rowGroup:d.isRowGroupActive(),rowGroupIndex:g,pivot:d.isPivotActive(),pivotIndex:u,flex:d.getFlex()??null})};t.forAllCols(d=>s(d));const c=new Map(t.getCols().map((d,g)=>[d.colId,g]));return l.sort((d,g)=>{const u=c.has(d.colId)?c.get(d.colId):-1,h=c.has(g.colId)?c.get(g.colId):-1;return u-h}),l}function Ru(e){const t=(m,v)=>m??v??null,a=e.colDef,o=ze(t(a.sort,a.initialSort)),r=o.direction,i=o.type,n=t(a.sortIndex,a.initialSortIndex),l=t(a.hide,a.initialHide),s=t(a.pinned,a.initialPinned),c=t(a.width,a.initialWidth),d=t(a.flex,a.initialFlex);let g=t(a.rowGroupIndex,a.initialRowGroupIndex),u=t(a.rowGroup,a.initialRowGroup);g==null&&!u&&(g=null,u=null);let h=t(a.pivotIndex,a.initialPivotIndex),p=t(a.pivot,a.initialPivot);h==null&&!p&&(h=null,p=null);const f=t(a.aggFunc,a.initialAggFunc);return{colId:e.colId,sort:r,sortType:i,sortIndex:n,hide:l,pinned:s,width:c,flex:d,rowGroup:u,rowGroupIndex:g,pivot:p,pivotIndex:h,aggFunc:f}}function X0(e,t,a){if(!e.applyOrder||!e.state)return;const o=[];for(const r of e.state)r.colId!=null&&o.push(r.colId);$0(t.cols,o,t,a)}function $0(e,t,a,o){if(e==null)return;let r=[];const i={};for(const l of t){if(i[l])continue;const s=e.map[l];s&&(r.push(s),i[l]=!0)}let n=0;for(const l of e.list){const s=l.colId;if(i[s]!=null)continue;s.startsWith(ht)?r.splice(n++,0,l):r.push(l)}if(r=fu(r,o),!mu(r,a.getColTree())){x(39);return}e.list=r}function ey(e,t,a,o,r){const i={};for(const d of t)i[d.colId]=d;const n={};for(const d of e)i[d.colId]&&(n[d.colId]=!0);const l=e.filter(d=>n[d.colId]),s=t.filter(d=>n[d.colId]),c=[];s.forEach((d,g)=>{const u=l?.[g];if(u&&u.colId!==d.colId){const h=o.getCol(u.colId);h&&c.push(h)}}),c.length&&r.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,finished:!0,source:a})}var Eu=(e,t,a,o)=>{const r=e[a.getId()],i=e[o.getId()],n=r!=null,l=i!=null;if(n&&l)return r-i;if(n)return-1;if(l)return 1;const s=t.indexOf(a),c=t.indexOf(o),d=s>=0,g=c>=0;return d&&g?s-c:d?-1:1},ty=class extends y{constructor(){super(...arguments),this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","groupHideColumnsUntilExpanded","rowNumbers","hidePaddedHeaderRows"],e=>this.refreshAll(oa(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),oa(e.source)))}createColsFromColDefs(e){const{beans:t}=this,{valueCache:a,colAutosize:o,rowGroupColsSvc:r,pivotColsSvc:i,valueColsSvc:n,visibleCols:l,eventSvc:s,groupHierarchyColSvc:c}=t,d=this.colDefs?xu(t,e):void 0;a?.expire();const g=this.colDefCols?.list,u=this.colDefCols?.tree,h=pd(t,this.colDefs,!0,u,e);mo(t,this.colDefCols?.tree,h.columnTree);const p=h.columnTree,f=h.treeDepth,m=on(p),v={};for(const w of m)v[w.getId()]=w;this.colDefCols={tree:p,treeDepth:f,list:m,map:v},this.createColumnsForService([c],this.colDefCols,e),r?.extractCols(e,g),i?.extractCols(e,g),n?.extractCols(e,g),this.ready=!0,this.changeEventsDispatching=!0,this.refreshCols(!0,e),this.changeEventsDispatching=!1,l.refresh(e),s.dispatchEvent({type:"columnEverythingChanged",source:e}),d&&(this.changeEventsDispatching=!0,d(),this.changeEventsDispatching=!1),s.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing"&&o?.applyAutosizeStrategy()}refreshCols(e,t){if(!this.colDefCols)return;const a=this.cols?.tree;this.saveColOrder();const{autoColSvc:o,selectionColSvc:r,rowNumbersSvc:i,quickFilter:n,pivotResultCols:l,showRowGroupCols:s,rowAutoHeight:c,visibleCols:d,colViewport:g,eventSvc:u,formula:h}=this.beans,p=this.selectCols(l,this.colDefCols);h?.setFormulasActive(p),this.createColumnsForService([o,r,i],p,t);const f=Tv(this.gos,this.showingPivotResult);(!e||f)&&this.restoreColOrder(p),this.positionLockedCols(p),s?.refresh(),n?.refreshCols(),this.setColSpanActive(),c?.setAutoHeightActive(p),d.clear(),g.clear(),rt(a,this.cols.tree)||u.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,a){for(const o of e)o&&(o.createColumns(t,r=>{this.lastOrder=r(this.lastOrder),this.lastPivotOrder=r(this.lastPivotOrder)},a),o.addColumns(t))}selectCols(e,t){const a=e?.getPivotResultCols()??null;this.showingPivotResult=a!=null;const{map:o,list:r,tree:i,treeDepth:n}=a??t;return this.cols={list:r.slice(),map:{...o},tree:i.slice(),treeDepth:n},a&&(a.list.some(s=>this.cols?.map[s.colId]!==void 0)||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const{beans:e,showingPivotResult:t,cols:a}=this,{valueColsSvc:o,selectionColSvc:r,gos:i}=e,n=this.pivotMode&&!t,l=r?.isSelectionColumnEnabled(),s=Yc(e),c=o?.columns,d=$c(i);return a.list.filter(u=>{const h=Sr(u);return n?c?.includes(u)||h&&(!d||u.isVisible())||l&&ft(u)||s&&pe(u):h&&!d||u.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,a){Be(this.beans,{state:e.map(o=>({colId:typeof o=="string"?o:o.colId,hide:!t}))},a)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const a=t.filter(g=>e.map[g.getId()]!=null);if(a.length===0)return;if(a.length===e.list.length){e.list=a;return}const o=g=>{const u=g.getOriginalParent();return u?u.getChildren().length>1?!0:o(u):!1};if(!a.some(g=>o(g))){const g=new Set(a);for(const u of e.list)g.has(u)||a.push(u);e.list=a;return}const r=new Map;for(let g=0;g<a.length;g++){const u=a[g];r.set(u,g)}const i=e.list.filter(g=>!r.has(g));if(i.length===0){e.list=a;return}const n=(g,u)=>{const h=u?u.getOriginalParent():g.getOriginalParent();if(!h)return null;let p=null,f=null;for(const m of h.getChildren())if(!(m===u||m===g)){if(m instanceof gt){const v=r.get(m);if(v==null)continue;(p==null||p<v)&&(p=v,f=m);continue}m.forEachLeafColumn(v=>{const w=r.get(v);w!=null&&(p==null||p<w)&&(p=w,f=v)})}return f??n(g,h)},l=[],s=new Map;for(const g of i){const u=n(g,null);if(u==null){l.push(g);continue}const h=s.get(u);h===void 0?s.set(u,g):Array.isArray(h)?h.push(g):s.set(u,[h,g])}const c=new Array(e.list.length);let d=c.length-1;for(let g=l.length-1;g>=0;g--)c[d--]=l[g];for(let g=a.length-1;g>=0;g--){const u=a[g],h=s.get(u);if(h)if(Array.isArray(h))for(let p=h.length-1;p>=0;p--){const f=h[p];c[d--]=f}else c[d--]=h;c[d--]=u}e.list=c}positionLockedCols(e){e.list=fu(e.list,this.gos)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list??null:this.lastOrder=this.cols?.list??null}getColumnDefs(e){return this.colDefCols&&this.beans.colDefFactory?.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,this.cols?.list??[],e)}setColSpanActive(){this.colSpanActive=!!this.cols?.list.some(e=>e.getColDef().colSpan!=null)}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode||(this.pivotMode=e,!this.ready))return;this.refreshCols(!1,t);const{visibleCols:a,eventSvc:o}=this.beans;a.refresh(t),o.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){const e=this.beans.pivotColsSvc?.columns;return this.pivotMode&&!!e?.length}recreateColumnDefs(e){if(!this.cols)return;this.beans.autoColSvc?.updateColumns(e);const t=oa(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){mo(this.beans,this.colDefCols?.tree),super.destroy()}getColTree(){return this.cols?.tree??[]}getColDefColTree(){return this.colDefCols?.tree??[]}getColDefCols(){return this.colDefCols?.list??null}getCols(){return this.cols?.list??[]}forAllCols(e){const{pivotResultCols:t,autoColSvc:a,selectionColSvc:o,groupHierarchyColSvc:r}=this.beans;Xa(this.colDefCols?.list,e)||Xa(a?.columns?.list,e)||Xa(o?.columns?.list,e)||Xa(r?.columns?.list,e)||Xa(t?.getPivotResultCols()?.list,e)}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){return this.getColFromCollection(e,this.colDefCols)??this.getColFromServiceCols(e)}getColDefColOrCol(e){return e==null?null:this.getColFromCollection(e,this.colDefCols)??this.getColFromCollection(e,this.cols)??this.getColFromServiceCols(e)}getColOrColDefCol(e){return e==null?null:this.getColFromCollection(e,this.cols)??this.getColFromCollection(e,this.colDefCols)??this.getColFromServiceCols(e)}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)??this.getColFromServiceCols(e)}getColById(e){return this.cols?.map[e]??null}getColFromCollection(e,t){if(t==null)return null;const a=t.map;if(typeof e=="string"&&a[e])return a[e];const o=t.list;for(let r=0,i=o.length;r<i;++r)if(Pa(o[r],e))return o[r];return null}getColFromServiceCols(e){const t=this.beans;return t.autoColSvc?.getColumn(e)??t.selectionColSvc?.getColumn(e)??t.groupHierarchyColSvc?.getColumn(e)??null}},ay=".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-label-align-right){.ag-label,.ag-wrapper{flex:none}}.ag-label-align-top{align-items:flex-start;flex-direction:column}:where(.ag-label-align-top){.ag-label,.ag-wrapper{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}",Fu=class extends ra{constructor(e,t,a){super(t,a),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(ay)}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:a,labelAlignment:o,disabled:r,labelEllipsis:i}=this.config;r!=null&&this.setDisabled(r),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),a!=null&&this.setLabelWidth(a),i!=null&&this.setLabelEllipsis(i),this.setLabelAlignment(o||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;le(t),typeof e=="string"?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),e===""?(U(t,!1),_e(t,"presentation")):(U(t,!0),_e(t,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const a=this.getGui().classList;return a.toggle("ag-label-align-left",e==="left"),a.toggle("ag-label-align-right",e==="right"),a.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(dr(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return ya(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},pl=class extends Fu{constructor(e,t,a,o){super(e,t,a),this.className=o}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:a,ariaLabel:o}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),a!=null&&this.onValueChange(a),o!=null&&this.setAriaLabel(o),this.className&&this.addCss(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),a=this.getLabel();a==null||a==""||Um(e)!==null?ba(e,""):ba(e,t??"")}setAriaLabel(e){return Qt(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return He(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}};function oy(e){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:e,ref:"eInput",cls:"ag-input-field-input"}]}]}}var Bt=class extends pl{constructor(e,t,a="text",o="input"){super(e,e?.template??oy(o),[],t),this.inputType=a,this.displayFieldTag=o,this.eLabel=E,this.eWrapper=E,this.eInput=E}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:a,className:o}=this;e.classList.add(`${o}-label`),t.classList.add(`${o}-input-wrapper`),a.classList.add(`${o}-input`),this.addCss("ag-input-field"),a.id=a.id||`ag-${this.getCompId()}-input`;const{inputName:r,inputWidth:i,inputPlaceholder:n,autoComplete:l,tabIndex:s}=this.config;r!=null&&this.setInputName(r),i!=null&&this.setInputWidth(i),n!=null&&this.setInputPlaceholder(n),l!=null&&this.setAutoComplete(l),this.addInputListeners(),this.activateTabIndex([a],s)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){this.displayFieldTag==="input"&&(this.inputType=e,we(this.eInput,"type",e))}getInputElement(){return this.eInput}getWrapperElement(){return this.eWrapper}setInputWidth(e){return dr(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return we(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Qt(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return ya(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)we(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";we(this.eInput,"autocomplete",t)}return this}},Ao=class extends Bt{constructor(e,t="ag-checkbox",a="checkbox"){super(e,t,a),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t,name:a}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t),a!=null&&this.setName(a)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0;const a=this.eInput;a.checked=e,a.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,a){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:a});const o=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:o.id,name:o.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),a=this.selected=e.target.checked;this.refreshSelectedClass(a),this.dispatchChange(a,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",e===!0),t.toggle("ag-indeterminate",e==null)}},_r={selector:"AG-CHECKBOX",component:Ao},ry=".ag-checkbox-cell{height:100%}",iy={tag:"div",cls:"ag-cell-wrapper ag-checkbox-cell",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},ny=class extends V{constructor(){super(iy,[_r]),this.eCheckbox=E,this.registerCSS(ry)}init(e){this.refresh(e);const{eCheckbox:t,beans:a}=this,o=t.getInputElement();o.setAttribute("tabindex","-1"),$s(o,"polite"),this.addManagedListeners(o,{click:r=>{if(Pt(r),t.isDisabled())return;const i=t.getValue();this.onCheckboxChanged(i)},dblclick:r=>{Pt(r)}}),this.addManagedElementListeners(e.eGridCell,{keydown:r=>{if(r.key===C.SPACE&&!t.isDisabled()){e.eGridCell===Q(a)&&t.toggle();const i=t.getValue();this.onCheckboxChanged(i),r.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,a=!0;const{value:o,column:r,node:i}=e;if(i.group&&r)if(typeof o=="boolean")t=o;else{const g=r.getColId();g.startsWith(ht)?t=o==null||o===""?void 0:o==="true":i.aggData?.[g]!==void 0||i.sourceRowIndex>=0?t=o??void 0:a=!1}else t=o??void 0;const{eCheckbox:n}=this;if(!a){n.setDisplayed(!1);return}n.setValue(t);const l=e.disabled??!r?.isCellEditable(i);n.setDisabled(l);const s=this.getLocaleTextFunc(),c=nr(s,t),d=l?c:`${s("ariaToggleCellValue","Press SPACE to toggle cell value")} (${c})`;n.setInputAriaLabel(d)}onCheckboxChanged(e){const{params:t}=this,{column:a,node:o,value:r}=t,{editSvc:i}=this.beans;if(!a)return;const n={rowNode:o,column:a};i?.dispatchCellEvent(n,null,"cellEditingStarted",{value:r});const l=o.setDataValue(a,e,"ui");i?.dispatchCellEvent(n,null,"cellEditingStopped",{oldValue:r,newValue:e,valueChanged:l}),l||this.updateCheckbox(t)}},ly={tag:"div",cls:"ag-skeleton-container"},sy=class extends V{constructor(){super(ly)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>ba(e.eParentOfValue)),ba(e.eParentOfValue,t),e.deferRender?this.setupLoading(e):e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.getLocaleTextFunc();this.getGui().textContent=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");Qt(this.getGui(),t)}setupLoading(e){const t=re({tag:"div",cls:"ag-skeleton-effect"}),a=e.node.rowIndex;if(a!=null){const i=75+25*(a%2===0?Math.sin(a):Math.cos(a));t.style.width=`${i}%`}this.getGui().appendChild(t);const o=this.getLocaleTextFunc(),r=e.deferRender?o("ariaDeferSkeletonCellLoading","Cell is loading"):o("ariaSkeletonCellLoading","Row data is loading");Qt(this.getGui(),r)}refresh(e){return!1}},cy={moduleName:"CheckboxCellRenderer",version:F,userComponents:{agCheckboxCellRenderer:ny}},dy={moduleName:"SkeletonCellRenderer",version:F,userComponents:{agSkeletonCellRenderer:sy}};function gy(e,t){const a=e.colModel.getColDefColOrCol(t);return a?a.colDef:null}function uy(e){return e.colModel.getColumnDefs(!0)}function hy(e,t,a){return e.colNames.getDisplayNameForColumn(t,a)||""}function py(e,t){return e.colModel.getColDefColOrCol(t)}function fy(e){return e.colModel.getColDefCols()}function my(e,t){return Be(e,t,"api")}function vy(e){return Do(e)}function by(e){Su(e,"api")}function wy(e){return e.visibleCols.isPinningLeft()||e.visibleCols.isPinningRight()}function Cy(e){return e.visibleCols.isPinningLeft()}function yy(e){return e.visibleCols.isPinningRight()}function ky(e,t){return e.visibleCols.getColAfter(t)}function Sy(e,t){return e.visibleCols.getColBefore(t)}function xy(e,t,a){e.colModel.setColsVisible(t,a,"api")}function Ry(e,t,a){e.pinnedCols?.setColsPinned(t,a,"api")}function Ey(e){return e.colModel.getCols()}function Fy(e){return e.visibleCols.leftCols}function My(e){return e.visibleCols.centerCols}function zy(e){return e.visibleCols.rightCols}function Dy(e){return e.visibleCols.allCols}function Ay(e){return e.colViewport.getViewportColumns()}function fl(e,t){if(!e)return;const a=e,o={};for(const r of Object.keys(a)){if(t&&t.indexOf(r)>=0||zc.has(r))continue;const i=a[r];typeof i=="object"&&i!==null&&i.constructor===Object?o[r]=fl(i):o[r]=i}return o}var Py=class extends y{constructor(){super(...arguments),this.beanName="colDefFactory"}wireBeans(e){this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc}getColumnDefs(e,t,a,o,r=!1){const i=e.slice();t?i.sort((s,c)=>a.indexOf(s)-a.indexOf(c)):(a||r)&&i.sort((s,c)=>o.indexOf(s)-o.indexOf(c));const n=this.rowGroupColsSvc?.columns,l=this.pivotColsSvc?.columns;return this.buildColumnDefs(i,n,l)}buildColumnDefs(e,t=[],a=[]){const o=[],r={};for(const i of e){const n=this.createDefFromColumn(i,t,a);let l=!0,s=n,c=i.getOriginalParent(),d=null;for(;c;){if(c.isPadding()){c=c.getOriginalParent();continue}const g=r[c.getGroupId()];if(g){g.children.push(s),l=!1;break}const u=this.createDefFromGroup(c);if(u&&(u.children=[s],r[u.groupId]=u,s=u,c=c.getOriginalParent()),c!=null&&d===c){l=!1;break}d=c}l&&o.push(s)}return o}createDefFromGroup(e){const t=fl(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,a){const o=fl(e.colDef);return o.colId=e.colId,o.width=e.getActualWidth(),o.rowGroup=e.isRowGroupActive(),o.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,o.pivot=e.isPivotActive(),o.pivotIndex=e.isPivotActive()?a.indexOf(e):null,o.aggFunc=e.isValueActive()?e.getAggFunc():null,o.hide=e.isVisible()?void 0:!0,o.pinned=e.isPinned()?e.getPinned():null,o.sort=e.getSortDef(),o.sortIndex=e.getSortIndex()!=null?e.getSortIndex():null,o}},Iy=class extends y{constructor(){super(...arguments),this.beanName="colFlex",this.columnsHidden=!1}refreshFlexedColumns(e={}){const t=e.source??"flex";e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth);const a=this.flexViewportWidth,{visibleCols:o,colDelayRenderSvc:r}=this.beans,i=o.centerCols;let n=-1;if(e.resizingCols){const f=new Set(e.resizingCols);for(let m=i.length-1;m>=0;m--)if(f.has(i[m])){n=m;break}}let l=!1;const s=i.map((f,m)=>{const v=f.getFlex(),w=v!=null&&v>0&&m>n;return l||(l=w),{col:f,isFlex:w,flex:Math.max(0,v??0),initialSize:f.getActualWidth(),min:f.getMinWidth(),max:f.getMaxWidth(),targetSize:0}});if(l?(r?.hideColumns("colFlex"),this.columnsHidden=!0):this.columnsHidden&&this.revealColumns(r),!a||!l)return[];let c=s.length,d=s.reduce((f,m)=>f+m.flex,0),g=a;const u=(f,m)=>{f.frozenSize=m,f.col.setActualWidth(m,t),g-=m,d-=f.flex,c-=1},h=f=>f.frozenSize!=null;for(const f of s)f.isFlex||u(f,f.initialSize);for(;c>0;){const f=Math.round(d<1?g*d:g);let m,v=0,w=0;for(const S of s){if(h(S))continue;m=S,w+=f*(S.flex/d);const R=w-v,M=Math.round(R);S.targetSize=M,v+=M}m&&(m.targetSize+=f-v);let b=0;for(const S of s){if(h(S))continue;const R=S.targetSize,M=Math.min(Math.max(R,S.min),S.max);b+=M-R,S.violationType=M===R?void 0:M<R?"max":"min",S.targetSize=M}const k=b===0?"all":b>0?"min":"max";for(const S of s)h(S)||(k==="all"||S.violationType===k)&&u(S,S.targetSize)}e.skipSetLeft||o.setLeftValues(t),e.updateBodyWidths&&o.updateBodyWidths();const p=s.filter(f=>f.isFlex&&!f.violationType).map(f=>f.col);if(e.fireResizedEvent){const f=s.filter(v=>v.initialSize!==v.frozenSize).map(v=>v.col),m=s.filter(v=>v.flex).map(v=>v.col);Na(this.eventSvc,f,!0,t,m)}return this.revealColumns(r),p}revealColumns(e){this.columnsHidden&&(e?.revealColumns("colFlex"),this.columnsHidden=!1)}initCol(e){const{flex:t,initialFlex:a}=e.colDef;t!==void 0?e.flex=t:a!==void 0&&(e.flex=a)}setColFlex(e,t){e.flex=t??null,e.dispatchStateUpdatedEvent("flex")}},ke=e=>{if(typeof e=="bigint")return e;let t;if(typeof e=="number")t=e;else if(typeof e=="string"&&(t=e.trim(),t===""||(t.endsWith("n")&&(t=t.slice(0,-1)),!/^[+-]?\d+$/.test(t))))return null;if(t==null)return null;try{return BigInt(t)}catch{return null}},ml="T",Ty=new RegExp(`[${ml} ]`),Ly=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${ml}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function $e(e,t){return e.toString().padStart(t,"0")}function fe(e,t=!0,a=ml){if(!e)return null;let o=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(r=>$e(r,2)).join("-");return t&&(o+=a+[e.getHours(),e.getMinutes(),e.getSeconds()].map(r=>$e(r,2)).join(":")),o}function Po(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),$e(e.getDate(),2),$e(e.getHours(),2),`:${$e(e.getMinutes(),2)}`,`:${$e(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,$e(e.getDate(),2)].map(String):null}var vl=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"},bl=["January","February","March","April","May","June","July","August","September","October","November","December"],wl=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function By(e,t){if(t==null)return fe(e,!1);const a=$e(e.getFullYear(),4),o={YYYY:()=>a.slice(a.length-4,a.length),YY:()=>a.slice(a.length-2,a.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>bl[e.getMonth()],MMM:()=>bl[e.getMonth()].slice(0,3),MM:()=>$e(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${vl(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${vl(e.getDate())}`,DD:()=>$e(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>wl[e.getDay()],ddd:()=>wl[e.getDay()].slice(0,3),dd:()=>wl[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${vl(e.getDay())}`,d:()=>`${e.getDay()}`},r=new RegExp(Object.keys(o).join("|"),"g");return t.replace(r,i=>i in o?o[i]():i)}function Qr(e,t=!1){return!!me(e,t)}function Oy(e){return Qr(e,!0)}function me(e,t=!1,a){if(!e||!a&&!Ly.test(e))return null;const[o,r]=e.split(Ty);if(!o)return null;const i=o.split("-").map(h=>Number.parseInt(h,10));if(i.filter(h=>!isNaN(h)).length!==3)return null;const[n,l,s]=i,c=new Date(n,l-1,s);if(c.getFullYear()!==n||c.getMonth()!==l-1||c.getDate()!==s||!r&&t)return null;if(!r||r==="00:00:00")return c;const[d,g,u]=r.split(":").map(h=>Number.parseInt(h,10));if(d>=0&&d<24)c.setHours(d);else if(t)return null;if(g>=0&&g<60)c.setMinutes(g);else if(t)return null;if(u>=0&&u<60)c.setSeconds(u);else if(t)return null;return c}function Io(e,t){const a=t.split(".");let o=e;for(let r=0;r<a.length;r++){if(o==null)return;o=o[a[r]]}return o}var Ny=["dateTimeString","dateString","text","number","bigint","boolean","date"],Hy=class extends y{constructor(){super(...arguments),this.beanName="dataTypeSvc",this.dataTypeDefinitions={},this.isPendingInference=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[],this.columnDefinitionPropsPerDataType={number(){return{cellEditor:"agNumberCellEditor"}},bigint({filterModuleBean:e}){return e?{cellEditor:"agTextCellEditor"}:{cellEditor:"agTextCellEditor",comparator:{default:Wy,absolute:Uy}}},boolean(){return{cellEditor:"agCheckboxCellEditor",cellRenderer:"agCheckboxCellRenderer",getFindText:()=>null,suppressKeyboardEvent:({node:e,event:t,column:a})=>t.key===C.SPACE&&a.isCellEditable(e)}},date({formatValue:e}){return{cellEditor:"agDateCellEditor",keyCreator:e}},dateString({formatValue:e}){return{cellEditor:"agDateStringCellEditor",keyCreator:e}},dateTime(e){return this.date(e)},dateTimeString(e){return this.dateString(e)},object({formatValue:e,colModel:t,colId:a}){return{cellEditorParams:{useFormatter:!0},comparator:(o,r)=>{const i=t.getColDefCol(a),n=i?.colDef;if(!i||!n)return 0;const l=o==null?"":e({column:i,node:null,value:o}),s=r==null?"":e({column:i,node:null,value:r});return l===s?0:l>s?1:-1},keyCreator:e}},text(){return{}}}}wireBeans(e){this.colModel=e.colModel}postConstruct(){this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.colModel.recreateColumnDefs(e)})}processDataTypeDefinitions(){const e=this.getDefaultDataTypes(),t={},a={},o=d=>g=>{const{column:u,node:h,value:p}=g;let f=u.getColDef().valueFormatter;return f===d.groupSafeValueFormatter&&(f=d.valueFormatter),this.beans.valueSvc.formatValue(u,h,p,f)};for(const d of Object.keys(e)){const g=e[d],u={...g,groupSafeValueFormatter:Du(g,this.gos)};t[d]=u,a[d]=o(u)}const r=this.gos.get("dataTypeDefinitions")??{},i={};for(const d of Object.keys(r)){const g=r[d],u=this.processDataTypeDefinition(g,r,[d],e);u&&(t[d]=u,g.dataTypeMatcher&&(i[d]=g.dataTypeMatcher),a[d]=o(u))}const{valueParser:n,valueFormatter:l}=e.object,{valueParser:s,valueFormatter:c}=t.object;this.hasObjectValueParser=s!==n,this.hasObjectValueFormatter=c!==l,this.formatValueFuncs=a,this.dataTypeDefinitions=t,this.dataTypeMatchers=this.sortKeysInMatchers(i,e)}sortKeysInMatchers(e,t){const a={...e};for(const o of Ny)delete a[o],a[o]=e[o]??t[o].dataTypeMatcher;return a}processDataTypeDefinition(e,t,a,o){let r;const i=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let n=o[i];const l=t[i];if(n&&l&&(n=l),!zu(e,n,i))return;r=Mu(n,e)}else{if(a.includes(i)){x(44);return}const n=t[i];if(!zu(e,n,i))return;const l=this.processDataTypeDefinition(n,t,[...a,i],o);if(!l)return;r=Mu(l,e)}return{...r,groupSafeValueFormatter:Du(r,this.gos)}}updateColDefAndGetColumnType(e,t,a){let{cellDataType:o}=t;o===void 0&&(o=e.cellDataType);const{field:r}=t;if((o==null||o===!0)&&(o=this.canInferCellDataType(e,t)?this.inferCellDataType(r,a):!1),this.addFormulaCellEditorToColDef(e,t),!o){e.cellDataType=!1;return}const i=this.dataTypeDefinitions[o];if(!i){x(47,{cellDataType:o});return}return e.cellDataType=o,i.groupSafeValueFormatter&&(e.valueFormatter=i.groupSafeValueFormatter),i.valueParser&&(e.valueParser=i.valueParser),i.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,o,i,a),i.columnTypes}addFormulaCellEditorToColDef(e,t){!(t.allowFormula??e.allowFormula)||t.cellEditor||(e.cellEditor="agFormulaCellEditor")}addColumnListeners(e){if(!this.isPendingInference)return;const t=this.columnStateUpdatesPendingInference[e.colId];if(!t)return;const a=o=>{t.add(o.key)};e.__addEventListener("columnStateUpdated",a),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.__removeEventListener("columnStateUpdated",a))}canInferCellDataType(e,t){const{gos:a}=this;if(!$(a))return!1;const o={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(Cl(t,o))return!1;const r=t.type===null?e.type:t.type;if(r){const i=a.get("columnTypes")??{};if(xr(r).some(l=>{const s=i[l.trim()];return s&&Cl(s,o)}))return!1}return!Cl(e,o)}inferCellDataType(e,t){if(!e)return;let a;const o=this.getInitialData();return o?a=e.includes(".")&&!this.gos.get("suppressFieldDotNotation")?Io(o,e):o[e]:this.initWaitForRowData(t),a==null?void 0:Object.keys(this.dataTypeMatchers).find(i=>this.dataTypeMatchers[i](a))??"object"}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const t=this.beans.rowModel.rootNode?._leafs;if(t?.length)return t[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isPendingInference)return;this.isPendingInference=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions,{colAutosize:a,eventSvc:o}=this.beans;t&&a&&(a.shouldQueueResizeOperations=!0);const[r]=this.addManagedEventListeners({rowDataUpdateStarted:i=>{const{firstRowData:n}=i;n&&(r?.(),this.isPendingInference=!1,this.processColumnsPendingInference(n,t),this.columnStateUpdatesPendingInference={},t&&a?.processResizeOperations(),o.dispatchEvent({type:"dataTypesInferred"}))}})}processColumnsPendingInference(e,t){this.initialData=e;const a=[];this.destroyColumnStateUpdateListeners();const o={},r={};for(const i of Object.keys(this.columnStateUpdatesPendingInference)){const n=this.columnStateUpdatesPendingInference[i],l=this.colModel.getCol(i);if(!l)continue;const s=l.colDef;if(!this.resetColDefIntoCol(l,"cellDataTypeInferred"))continue;const c=l.colDef;if(t&&c.type&&c.type!==s.type){const d=jy(l,n);d.rowGroup&&d.rowGroupIndex==null&&(o[i]=d),d.pivot&&d.pivotIndex==null&&(r[i]=d),a.push(d)}}t&&a.push(...this.generateColumnStateForRowGroupAndPivotIndexes(o,r)),a.length&&Be(this.beans,{state:a},"cellDataTypeInferred"),this.initialData=null}generateColumnStateForRowGroupAndPivotIndexes(e,t){const a={},{rowGroupColsSvc:o,pivotColsSvc:r}=this.beans;return o?.restoreColumnOrder(a,e),r?.restoreColumnOrder(a,t),Object.values(a)}resetColDefIntoCol(e,t){const a=e.getUserProvidedColDef();if(!a)return!1;const o=fo(this.beans,a,e.colId);return e.setColDef(o,a,t),!0}getDateStringTypeDefinition(e){const{dateString:t}=this.dataTypeDefinitions;return e?this.getDataTypeDefinition(e)??t:t}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDateIncludesTimeFlag(e){return e==="dateTime"||e==="dateTimeString"}getDataTypeDefinition(e){const t=e.colDef;if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,t){if(t==null)return!0;const a=this.getDataTypeDefinition(e)?.dataTypeMatcher;return!a||e.colDef.allowFormula&&this.beans.formula?.isFormula(t)?!0:a(t)}validateColDef(e,t,a,o){if(e.cellDataType==="object"){const r=s=>s?.cellDataType==null||s?.cellDataType===!0,i=r(t)&&r(a),n=s=>x(48,{property:s,inferred:i,colId:o}),{object:l}=this.dataTypeDefinitions;e.valueFormatter===l.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&n("Formatter"),e.editable&&e.valueParser===l.valueParser&&!this.hasObjectValueParser&&n("Parser")}}postProcess(e){const t=e.cellDataType;if(!t||typeof t!="string")return;const{dataTypeDefinitions:a,beans:o,formatValueFuncs:r}=this,i=a[t];i&&o.colFilter?.setColDefPropsForDataType(e,i,r[t])}getFormatValue(e){return this.formatValueFuncs[e]}isColPendingInference(e){return this.isPendingInference&&!!this.columnStateUpdatesPendingInference[e]}setColDefPropertiesForBaseDataType(e,t,a,o){const r=this.formatValueFuncs[t],i=this.columnDefinitionPropsPerDataType[a.baseDataType]({colDef:e,cellDataType:t,colModel:this.colModel,dataTypeDefinition:a,colId:o,formatValue:r,filterModuleBean:this.beans.filterManager});e.cellEditor==="agFormulaCellEditor"&&i.cellEditor!==e.cellEditor&&(i.cellEditor=e.cellEditor),Object.assign(e,i)}getDateObjectTypeDef(e){const t=this.getLocaleTextFunc(),a=this.getDateIncludesTimeFlag(e);return{baseDataType:e,valueParser:o=>me(o.newValue&&String(o.newValue)),valueFormatter:o=>o.value==null?"":!(o.value instanceof Date)||isNaN(o.value.getTime())?t("invalidDate","Invalid Date"):fe(o.value,a)??"",dataTypeMatcher:o=>o instanceof Date}}getDateStringTypeDef(e){const t=this.getDateIncludesTimeFlag(e);return{baseDataType:e,dateParser:a=>me(a)??void 0,dateFormatter:a=>fe(a??null,t)??void 0,valueParser:a=>Qr(String(a.newValue))?a.newValue:null,valueFormatter:a=>Qr(String(a.value))?String(a.value):"",dataTypeMatcher:a=>typeof a=="string"&&Qr(a)}}getDefaultDataTypes(){const e=this.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:t=>t.newValue?.trim?.()===""?null:Number(t.newValue),valueFormatter:t=>t.value==null?"":typeof t.value!="number"||isNaN(t.value)?e("invalidNumber","Invalid Number"):String(t.value),dataTypeMatcher:t=>typeof t=="number"},bigint:{baseDataType:"bigint",valueParser:t=>{const{newValue:a}=t;return a==null||typeof a=="string"&&a.trim()===""?null:ke(a)},valueFormatter:t=>t.value==null?"":typeof t.value!="bigint"?e("invalidBigInt","Invalid BigInt"):String(t.value),dataTypeMatcher:t=>typeof t=="bigint"},text:{baseDataType:"text",valueParser:t=>t.newValue===""?null:$o(t.newValue),dataTypeMatcher:t=>typeof t=="string"},boolean:{baseDataType:"boolean",valueParser:t=>t.newValue==null?t.newValue:t.newValue?.trim?.()===""?null:String(t.newValue).toLowerCase()==="true",valueFormatter:t=>t.value==null?"":String(t.value),dataTypeMatcher:t=>typeof t=="boolean"},date:this.getDateObjectTypeDef("date"),dateString:this.getDateStringTypeDef("dateString"),dateTime:this.getDateObjectTypeDef("dateTime"),dateTimeString:{...this.getDateStringTypeDef("dateTimeString"),dataTypeMatcher:t=>typeof t=="string"&&Oy(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:t=>$o(t.value)??""}}}destroyColumnStateUpdateListeners(){for(const e of this.columnStateUpdateListenerDestroyFuncs)e();this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}};function Mu(e,t){const a={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(a.columnTypes=[...xr(e.columnTypes),...xr(t.columnTypes)]),a}function zu(e,t,a){return t?t.baseDataType!==e.baseDataType?(x(46),!1):!0:(x(45,{parentCellDataType:a}),!1)}var Gy=e=>typeof e=="bigint"||typeof e=="number",Vy=e=>e==="number"||e==="bigint";function Du(e,t){if(e.valueFormatter)return a=>{const{node:o,colDef:r,column:i,value:n}=a;if(o?.group){const l=(r.pivotValueColumn??i).getAggFunc();if(l){if(l==="first"||l==="last")return e.valueFormatter(a);const{baseDataType:s}=e;if(Vy(s)&&l!=="count"){if(Gy(n))return e.valueFormatter(a);if(n==null)return;if(typeof n=="object"){if(typeof n.toNumber=="function")return e.valueFormatter({...a,value:n.toNumber()});if("value"in n)return e.valueFormatter({...a,value:n.value})}}return}}else if(t.get("groupHideOpenParents")&&a.column.isRowGroupActive()&&typeof a.value=="string"&&!e.dataTypeMatcher?.(a.value))return;return e.valueFormatter(a)}}function qy(e,t,a,o){if(!t[a])return!1;const r=e[a];return r===null?(t[a]=!1,!1):o===void 0?!!r:r===o}function Wy(e,t){if(e==null)return t==null?0:-1;if(t==null)return 1;const a=ke(e),o=ke(t);return a!=null&&o!=null?a===o?0:a>o?1:-1:0}function Uy(e,t){if(e==null)return t==null?0:-1;if(t==null)return 1;const a=Au(e),o=Au(t);return a!=null&&o!=null?a===o?0:a>o?1:-1:0}function Au(e){const t=ke(e);return t==null?null:t<0n?-t:t}function Cl(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([a,o])=>qy(e,t,a,o))}function jy(e,t){const a=Ru(e);for(const o of t)delete a[o],o==="rowGroup"?delete a.rowGroupIndex:o==="pivot"&&delete a.pivotIndex;return a}var Ky={moduleName:"DataType",version:F,beans:[Hy],dependsOn:[cy]},_y={moduleName:"ColumnFlex",version:F,beans:[Iy]},yl={moduleName:"ColumnApi",version:F,beans:[Py],apiFunctions:{getColumnDef:gy,getDisplayNameForColumn:hy,getColumn:py,getColumns:fy,applyColumnState:my,getColumnState:vy,resetColumnState:by,isPinning:wy,isPinningLeft:Cy,isPinningRight:yy,getDisplayedColAfter:ky,getDisplayedColBefore:Sy,setColumnsVisible:xy,setColumnsPinned:Ry,getAllGridColumns:Ey,getDisplayedLeftColumns:Fy,getDisplayedCenterColumns:My,getDisplayedRightColumns:zy,getAllDisplayedColumns:Dy,getAllDisplayedVirtualColumns:Ay,getColumnDefs:uy}},Qy=class extends y{constructor(){super(...arguments),this.beanName="colNames"}getDisplayNameForColumn(e,t,a=!1){if(!e)return null;const o=this.getHeaderName(e.getColDef(),e,null,null,t),{aggColNameSvc:r}=this.beans;return a&&r?r.getHeaderName(e,o):o}getDisplayNameForProvidedColumnGroup(e,t,a){const o=t?.getColGroupDef();return o?this.getHeaderName(o,null,e,t,a):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,a,o,r){const i=e.headerValueGetter;if(i){const n=I(this.gos,{colDef:e,column:t,columnGroup:a,providedColumnGroup:o,location:r});return typeof i=="function"?i(n):typeof i=="string"?this.beans.expressionSvc?.evaluate(i,n)??null:""}else{if(e.headerName!=null)return e.headerName;if(e.field)return Js(e.field)}return""}},Yy=class extends y{constructor(){super(...arguments),this.beanName="colViewport",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.columnsToRenderLeft=[],this.columnsToRenderRight=[],this.columnsToRenderCenter=[]}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}getScrollPosition(){return this.scrollPosition}setScrollPosition(e,t,a=!1){const{visibleCols:o}=this,r=o.isBodyWidthDirty;if(!(e===this.scrollWidth&&t===this.scrollPosition&&!r)){if(this.scrollWidth=e,this.scrollPosition=t,o.isBodyWidthDirty=!0,this.gos.get("enableRtl")){const n=o.bodyWidth;this.viewportLeft=n-t-e,this.viewportRight=n-t}else this.viewportLeft=t,this.viewportRight=e+t;this.colModel.ready&&this.checkViewportColumns(a)}}getColumnHeadersToRender(e){switch(e){case"left":return this.columnsToRenderLeft;case"right":return this.columnsToRenderRight;default:return this.columnsToRenderCenter}}getHeadersToRender(e,t){let a;switch(e){case"left":a=this.rowsOfHeadersToRenderLeft[t];break;case"right":a=this.rowsOfHeadersToRenderRight[t];break;default:a=this.rowsOfHeadersToRenderCenter[t];break}return a??[]}extractViewportColumns(){const e=this.visibleCols.centerCols;this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.columnsToRenderLeft=[],this.columnsToRenderRight=[],this.columnsToRenderCenter=[],this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return e.isAutoHeaderHeight()||Zy(e)?!0:this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,a=t+e.getActualWidth(),o=this.viewportLeft-200,r=this.viewportRight+200,i=t<o&&a<o,n=t>r&&a>r;return!i&&!n}getViewportColumns(){const{leftCols:e,rightCols:t}=this.visibleCols;return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.colModel.colSpanActive)return this.colsWithinViewport;const t=i=>{const n=i.getLeft();return z(n)&&n>this.viewportLeft},a=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),{visibleCols:o}=this,r=o.centerCols;return o.getColsForRow(e,r,a,t)}checkViewportColumns(e=!1){this.extractViewport()&&this.eventSvc.dispatchEvent({type:"virtualColumnsChanged",afterScroll:e})}calculateHeaderRows(){const{leftCols:e,rightCols:t}=this.visibleCols;this.columnsToRenderLeft=e,this.columnsToRenderRight=t,this.columnsToRenderCenter=this.colsWithinViewport;const a=o=>{const r=new Set,i={};for(const n of o){let l=n.parent;const s=n.isSpanHeaderHeight();for(;l&&!r.has(l);){if(s&&l.isPadding()){l=l.parent;continue}const d=l.getProvidedColumnGroup().getLevel();i[d]??(i[d]=[]),i[d].push(l),r.add(l),l=l.parent}}return i};this.rowsOfHeadersToRenderLeft=a(e),this.rowsOfHeadersToRenderRight=a(t),this.rowsOfHeadersToRenderCenter=a(this.headerColsWithinViewport)}extractViewport(){const e=o=>`${o.getId()}-${o.getPinned()||"normal"}`;this.extractViewportColumns();const t=this.getViewportColumns().map(e).join("#"),a=this.colsWithinViewportHash!==t;return a&&(this.colsWithinViewportHash=t,this.calculateHeaderRows()),a}};function Zy(e){for(;e;){if(e.isAutoHeaderHeight())return!0;e=e.parent}return!1}var Jy=class extends y{constructor(){super(...arguments),this.beanName="agCompUtils"}adaptFunction(e,t){if(!e.cellRenderer)return null;class a{refresh(){return!1}getGui(){return this.eGui}init(r){const i=t(r),n=typeof i;if(n==="string"||n==="number"||n==="boolean"){this.eGui=cr("<span>"+i+"</span>");return}if(i==null){this.eGui=re({tag:"span"});return}this.eGui=i}}return a}},Xy={moduleName:"CellRendererFunction",version:F,beans:[Jy]},Pu=class extends ue{constructor(){super(...arguments),this.beanName="registry"}registerDynamicBeans(e){if(e){this.dynamicBeans??(this.dynamicBeans={});for(const t of Object.keys(e))this.dynamicBeans[t]=e[t]}}createDynamicBean(e,t,...a){if(!this.dynamicBeans)throw new Error(this.getDynamicError(e,!0));const o=this.dynamicBeans[e];if(o==null){if(t)throw new Error(this.getDynamicError(e,!1));return}return new o(...a)}};function $y(e){return typeof e=="object"&&!!e.getComp}var e1=class extends Pu{constructor(){super(...arguments),this.agGridDefaults={},this.agGridDefaultOverrides={},this.jsComps={},this.selectors={},this.icons={}}postConstruct(){const e=this.gos.get("components");if(e!=null)for(const t of Object.keys(e))this.jsComps[t]=e[t]}registerModule(e){const{icons:t,userComponents:a,dynamicBeans:o,selectors:r}=e;if(a){const i=(n,l,s,c)=>{this.agGridDefaults[n]=l,(s||c)&&(this.agGridDefaultOverrides[n]={params:s,processParams:c})};for(const n of Object.keys(a)){let l=a[n];if($y(l)&&(l=l.getComp(this.beans)),typeof l=="object"){const{classImp:s,params:c,processParams:d}=l;i(n,s,c,d)}else i(n,l)}}this.registerDynamicBeans(o);for(const i of r??[])this.selectors[i.selector]=i;if(t)for(const i of Object.keys(t))this.icons[i]=t[i]}getUserComponent(e,t){const a=(l,s,c,d)=>({componentFromFramework:s,component:l,params:c,processParams:d}),{frameworkOverrides:o}=this.beans,r=o.frameworkComponent(t,this.gos.get("components"));if(r!=null)return a(r,!0);const i=this.jsComps[t];if(i){const l=o.isFrameworkComponent(i);return a(i,l)}const n=this.agGridDefaults[t];if(n){const l=this.agGridDefaultOverrides[t];return a(n,!1,l?.params,l?.processParams)}return this.beans.validation?.missingUserComponent(e,t,this.agGridDefaults,this.jsComps),null}getSelector(e){return this.selectors[e]}getIcon(e){return this.icons[e]}getDynamicError(e,t){return t?Ge(279,{name:e}):this.beans.validation?.missingDynamicBean(e)??Ge(256)}},t1=23,a1=class extends y{constructor(){super(...arguments),this.beanName="ctrlsSvc",this.params={},this.ready=!1,this.readyCallbacks=[]}postConstruct(){this.addEventListener("ready",()=>{if(this.updateReady(),this.ready){for(const e of this.readyCallbacks)e(this.params);this.readyCallbacks.length=0}},this.beans.frameworkOverrides.runWhenReadyAsync?.()??!1)}updateReady(){const e=Object.values(this.params);this.ready=e.length===t1&&e.every(t=>t?.isAlive()??!1)}whenReady(e,t){this.ready?t(this.params):this.readyCallbacks.push(t),e.addDestroyFunc(()=>{const a=this.readyCallbacks.indexOf(t);a>=0&&this.readyCallbacks.splice(a,1)})}register(e,t){this.params[e]=t,this.updateReady(),this.ready&&this.dispatchLocalEvent({type:"ready"}),t.addDestroyFunc(()=>{this.updateReady()})}get(e){return this.params[e]}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:a}=this.params;return[e,a,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}getScrollFeature(){return this.getGridBodyCtrl().scrollFeature}},o1=':where([class^=ag-]),:where([class^=ag-]):after,:where([class^=ag-]):before{box-sizing:border-box}:where([class^=ag-]):where(button){color:inherit}:where([class^=ag-]):where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}:where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-tab-guard{display:block;height:0;position:absolute;width:0}.ag-tab-guard-top{top:1px}.ag-tab-guard-bottom{bottom:1px}.ag-measurement-container{height:0;overflow:hidden;visibility:hidden;width:0}.ag-measurement-element-border{display:inline-block}.ag-measurement-element-border:before{border-left:var(--ag-internal-measurement-border);content:"";display:block}.ag-popup-child{top:0;z-index:5}.ag-popup-child:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-wrapper-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);font-weight:var(--ag-font-weight);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled .ag-icon,[disabled] .ag-icon{opacity:.5}.ag-icon-grip.ag-disabled,.ag-icon-grip[disabled]{opacity:.35}.ag-icon-loading{animation-duration:1s;animation-iteration-count:infinite;animation-name:spin;animation-timing-function:linear}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}.ag-menu{background-color:var(--ag-menu-background-color);border:var(--ag-menu-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-menu-shadow);color:var(--ag-menu-text-color);max-height:100%;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}',kl=typeof window!="object"||!window?.document?.fonts?.forEach,Yr=!1,ca=(e,t,a,o,r,i,n=!1)=>{if(kl||Yr)return;let l=e;o&&(l=`@layer ${CSS.escape(o).replaceAll("\\.",".")} { ${e} }`);let s=et.map.get(t);if(s||(s=[],et.map.set(t,s)),s.some(u=>u.injectedCss===l))return;const c=document.createElement("style");i&&c.setAttribute("nonce",i),c.dataset.agCss=a,c.dataset.agCssVersion=F,c.textContent=l;const d={rawCss:e,injectedCss:l,el:c,priority:r,isParams:n};let g;for(const u of s){if(u.priority>r)break;g=u}if(g){g.el.after(c);const u=s.indexOf(g);s.splice(u+1,0,d)}else t.nodeName==="STYLE"?t.after(c):t.insertBefore(c,t.querySelector(":not(title, meta)")),s.push(d)},Iu=(e,t,a,o)=>{ca(o1,e,"shared",t,0,a),o?.forEach((r,i)=>r.forEach(n=>ca(n,e,i,t,0,a)))},r1=(e,t,a,o,r,i)=>{if(kl||Yr)return;const n=et.grids.get(e);n?n.paramsCss=t:et.grids.set(e,{styleContainer:o,paramsCss:t}),Sl(o),t&&a&&ca(t,o,a,r,2,i,!0)},i1=e=>{const t=et.grids.get(e)?.styleContainer;if(!t)return;et.grids.delete(e),Array.from(et.grids.values()).some(o=>o.styleContainer===t)?Sl(t):(Sl(t,!0),et.map.delete(t))},Sl=(e,t=!1)=>{const a=new Set;for(const r of et.grids.values())r.styleContainer===e&&a.add(r.paramsCss);const o=et.map.get(e)??[];for(let r=o.length-1;r>=0;r--)(t||o[r].isParams&&!a.has(o[r].rawCss))&&(o[r].el.remove(),o.splice(r,1))},Tu=()=>{const e=globalThis.agStyleInjectionVersions??(globalThis.agStyleInjectionVersions=new Map);let t=e.get(F);return t||(t={map:new WeakMap,grids:new Map,paramsId:0},e.set(F,t)),t},et=Tu(),H=e=>new Lu(e),Ot="$default",n1=0,Lu=class{constructor({feature:e,params:t,modeParams:a={},css:o,cssImports:r}){this.feature=e,this.css=o,this.cssImports=r,this.modeParams={[Ot]:{...a[Ot]??{},...t??{}},...a}}use(e,t,a){let o=this._inject;if(o==null){let{css:r}=this;if(r){const i=`ag-theme-${this.feature??"part"}-${++n1}`;typeof r=="function"&&(r=r()),r=`:where(.${i}) {
13955
13955
  ${r}
13956
13956
  }
13957
13957
  `;for(const n of this.cssImports??[])r=`@import url(${JSON.stringify(n)});