@infinite-table/infinite-react 8.0.0 → 8.0.2
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.
- package/index.d.ts +376 -1
- package/index.dev.js +552 -55
- package/index.dev.mjs +610 -122
- package/index.js +8 -8
- package/index.mjs +8 -8
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Lh=Object.create;var ac=Object.defineProperty;var kh=Object.getOwnPropertyDescriptor;var zh=Object.getOwnPropertyNames;var Vh=Object.getPrototypeOf,Gh=Object.prototype.hasOwnProperty;var Hh=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Kh=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of zh(e))!Gh.call(n,r)&&r!==t&&ac(n,r,{get:()=>e[r],enumerable:!(o=kh(e,r))||o.enumerable});return n};var en=(n,e,t)=>(t=n!=null?Lh(Vh(n)):{},Kh(e||!n||!n.__esModule?ac(t,"default",{value:n,enumerable:!0}):t,n));var Oo=Hh((Jx,qu)=>{"use strict";qu.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});function Mt(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}import*as Ie from"react";var Q=(...n)=>n.filter(e=>!!`${e}`).join(" ");import*as Po from"react";import{useRef as hc}from"react";function ye(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=null;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function lt(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var lc=(n,e)=>n-e;var Pr=(n,e)=>lc(n.revision,e.revision),ee=class n{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),c=!a;if(i!==void 0){if(i<0)return;i--}let u=(d,f)=>{let p=r.get(f);if(!p)return;let{map:m}=p,g=f===this.emptyKey;if(g&&!c)return;let b=g?[]:[...e,f],h=m?()=>this.visitWithNext(b,t,o,m,i!==void 0?i-1:void 0):void 0;if(p.hasOwnProperty("value")){let y=t(p.value,b,l,h,p);if(o&&y===!0)return!0;l++}else h?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,f]of r){let p=u(f,d);if(o&&p===!0)return p}};this.fill(e)}static clone(e){let t=new n;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push(i)},t),o}getEntriesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push([r,i])},t),o}getLeafNodesStartingWith(e,t,o){let{respectOrder:r=!1}=o||{},i=[],a=[];return this.getStartingWith(e,(l,s,c)=>{!c.map&&c.hasOwnProperty("value")&&(r?i.push(c):a.push(t(c)))},o),r?i.sort(Pr).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>o.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>[o.keys,o.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:o,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=f=>{i?a.push(f):l.push(f.keys)},c=this.map,u,d=!1;if(e.length)for(let f=0,p=e.length;f<p;f++){let m=e[f];if(u=c.get(m),!u||!u.map)if(d=!0,f===p-1){d=!0;break}else return[];c=u.map}else if(!o&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(o||(s({...u,keys:e}),d=!0)),d?i?a.sort(Pr).map(f=>f.keys):l:(this.visitWithNext(e,(f,p,m,g,b)=>{s({...b,keys:p})},!1,c,r,o),i?a.sort(Pr).map(f=>f.keys):l)}getKeysStartingWith(e,t){let o=[];return this.getStartingWith(e,r=>{o.push(r)},t),o}getStartingWith(e,t,o){let{excludeSelf:r,depthLimit:i}=o||{},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(c,u,d,f,p)=>{t(u,c,{...p,keys:u}),f?.()},!1,a,i,r)}getMapAt(e){let t=this.map,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let o=this.map;e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((o,r)=>{let{map:i}=o;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0}delete(e){let t=this.map;e.length?e=[...e]:e=[this.emptyKey];let o=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],c=a===l-1,u=t.get(s);if(c){u&&(u.hasOwnProperty("value")&&(delete u.value,delete u.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),u.map&&u.map.size===0&&delete u.map,u.map||t.delete(s));break}else{if(!u||!u.map){i=!1;break}r.push(u),t=u.map,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.length-1],c=e[e.length-1],u=s?.get(c);u&&(delete u.map,u.hasOwnProperty("value")||s.delete(c))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],c=lt(()=>{if(l)for(let[u]of l){let d=this.visitKey(u,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let u=r(a,s,c);if(i&&u===!0)return!0}c()}getArray(e){let t=[];return this.visit((o,r)=>{let i=e({...o,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(Pr);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};globalThis.DeepMap=ee;function Me(){return globalThis}var Ar=["#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],sc=Symbol("color"),Mr=new WeakMap,Ma=ye();function Aa(n=Ar){Mr.set(n,n.map(e=>0))}Aa();var Bh=(n=Ar)=>{let e=[];Mr.has(n)?e=Mr.get(n):(e=n.map(o=>0),Mr.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??Ar[0]},Vn=":",Ea="*",cc="-",Wh=",",jh="debug",$h="diffdebug",dc=!1,zn=new ee,Gn=new Map;function _a(n,e){let t=n.split(Vn),o=new ee;o.set(t,!0);let r=e.split(Vn),i=new Set(r).has(Ea),a=r.indexOf(Ea),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(Vn)):!0}}function fc(n,e){let t=`channel=${n}_permissions=${e}`;if(Gn.has(t))return Gn.get(t);let o=e.split(Wh);function r(l){return Gn.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(Ea)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(cc);if(c&&(s=s.substring(cc.length)),_a(n,s))return r(!c)}for(let l=0;l<a.length;l++){let s=a[l],c=s.startsWith("-");if(c&&(s=s.substring(1)),_a(n,s))return r(!c)}return r(!1)}var Oa=()=>je.enable??(Me()&&Me().localStorage?.getItem(jh))??"",Uh=()=>je.diffenable??(Me()&&Me().localStorage?.getItem($h))??`${dc}`,Fa="",pc=dc;function Na(n){pc=`${Uh()}`=="true",Fa!==n&&(Fa=n,Gn.clear())}function mc(n){Na(Oa()),typeof Me()<"u"&&Me().addEventListener&&Me().addEventListener("storage",function(){Na(Oa())});function e(t,o){let r=o?`${o}${Vn}${t}`:t,i=r.split(Vn),a=zn.get(i);if(a)return a;let l=zn.get(i.slice(0,-1)),s=(l?l.logFn:je.logFn)??gc,c=s,u,d=0,f=()=>u??fc(r,Fa),p=Bh(je.colors),m=Object.defineProperties((...g)=>{let b=Ma.getListenersCount(),h;if(b>0&&(h=h??Date.now(),Ma({color:p,channel:r,args:g,timestamp:h})),f()){if(h=h??Date.now(),d&&pc){let T=h-d;c(`%c[${r}]`,`color: ${p}`,`+${T}ms:`)}d=h;let y=[],S;if(g.forEach(T=>{if(T[sc])S===void 0&&(S=!0),y.push(...T);else{if(typeof T!="string"&&typeof T!="number"){S=!1;return}y.push(`${T}%s`)}}),S){let T=[`%c[${r}]%c %s`,`color: ${p}`,"",...y,""];c(...T)}else c(`%c[${r}]%c %s`,`color: ${p}`,"",...g)}},{channel:{value:r},color:{value:(g,...b)=>{let h=[`%c${b.join(" ")}%c%s`,`color: ${g}`,""];return h.toString=()=>b.join(" "),h[sc]=!0,h}},extend:{value:g=>e(g,r)},enabled:{get:()=>f(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{zn.delete(i)}}});return zn.set(i,m),m}return e(n)}var gc=console.log.bind(console),uc;Object.defineProperty(mc,"enable",{get:()=>uc,set:n=>{uc=n,Na(Oa())}});var je=mc;je.colors=Ar;je.logFn=gc;var Yh=(n,e)=>Ma.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;_a(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});je.onLogIntent=Yh;je.isChannelEnabled=fc;je.destroyAll=()=>{Aa(),Aa(je.colors),zn.clear(),Gn.clear()};var Rt=n=>{let e=je(n?`IT:${n}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},lo=n=>{let e=je(n?`IT:${n}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Hn=()=>Hn;Hn.extend=()=>Hn;var ft=class{constructor(e){this.debug=Hn,this.error=Hn}};import*as qh from"react";import{useMemo as dR,useRef as Xh,useEffect as Zh,useLayoutEffect as Qh,useCallback as fR}from"react";var Kn=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?Mt(e,{wait:o}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=n.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(n),()=>{a.disconnect()}},Er=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=Xh({width:0,height:0}),r=i=>{let a;return n.current&&(a=Kn(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};Zh(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),Qh(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};var Jh=lo("CSSVariableWatch"),eb=Rt("CSSVariableWatch"),tb={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},ob=n=>{let e=hc(0),t=Po.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);Er(n.ref,t,{earlyAttach:!0}),Po.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o!=null)return e.current=o,eb(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);Jh(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},Bn=n=>{let e=hc(null);ob({...n,ref:e});let t=n.varName.startsWith("var(")?n.varName:`var(${n.varName})`,{allowInts:o=!1}=n;return Po.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:tb},Po.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};import{useCallback as ib,useContext as ka}from"react";import{useCallback as nb,useRef as _r,useSyncExternalStore as rb}from"react";function pt(n,e,t){if(n===e)return!0;if(!n||!e)return!1;let o=typeof n;if(o!==typeof e||o!=="object")return!1;var i=Object.keys(n),a=Object.keys(e);t&&(i=i.filter(u=>!t.has(u)),a=a.filter(u=>!t.has(u)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var c=i[s];if(!(t&&t.has(c))&&(n[c]!==e[c]||!Object.prototype.hasOwnProperty.call(e,c)))return!1}return!0}function so(){let n=null,e=new Set;return{getSnapshot(){return n},setSnapshot(t){n=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}function bc(n,e,t){let o=_r(e);o.current=e;let r=_r(t);r.current=t;let i=_r(void 0),a=_r(!1),l=nb(()=>{let s=n.getSnapshot(),c=o.current(s);return a.current&&r.current(i.current,c)?i.current:(i.current=c,a.current=!0,c)},[n]);return rb(n.subscribe,l,l)}function Or(n,e){return bc(n,e,Object.is)}function tn(n,e){return bc(n,e,pt)}import*as yc from"react";var La;function on(){return La||(La=yc.createContext(null))}var Sc=so(),Tc=()=>{};function Fr(){let n=on();return ka(n)||void 0}function Nr(){let n=Fr();return ib(()=>n?.getSnapshot(),[n])}function $t(n){let e=on(),t=ka(e),o=tn(t||Sc,t?n:Tc);return t?o??void 0:void 0}function Mo(){let n=on(),e=ka(n),o=Or(e||Sc,e?r=>r.masterRowInfo:Tc);return e?o:void 0}import*as nn from"react";import{useReducer as mb,createContext as gb,useMemo as Ka,useEffect as hb,useState as wc,useRef as Ic,useLayoutEffect as bb}from"react";function za(n,e){let t=new Set;function o(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(c,u){return t.add(u),c[u]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return n.apply(this,s)}return{fn:o,propertyReads:t}}var Va=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function co(n){if(n==null)return!1;let e=n;return!0}function Wn(n){return n!==void 0}function uo(n,e){let t=e[n];return Wn(t)}import{useCallback as sb,useEffect as cb,useRef as Ga}from"react";import{useCallback as ab,useState as lb}from"react";var kt=()=>{let[n,e]=lb(0);return[n,ab(()=>{e(t=>t+1)},[e])]};var Cc=n=>{let e=sb(n,[]),t=Ga(!1),o=Ga(!1),r=Ga(void 0),[i,a]=kt();t.current&&(o.current=!0),cb(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};import{useCallback as ub,useRef as db}from"react";function _e(n){let e=db(n);return e.current=n,ub(()=>e.current,[])}import{useRef as fb,useLayoutEffect as pb}from"react";var Ao=(n,e)=>{let t=fb(e===void 0?n:e);return pb(()=>{t.current=n}),t.current};var jn={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var Ha=class n{constructor(e){this.debugId=e;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=e=>{if(this.markerDetails.startTs)return this;let t=performance.now();return this.markerDetails.details=e?.details??[],this.markerDetails.startTs=t,this};this.end=(e={})=>{if(this.stopped)return this;this.stopped=!0;let t=e.startTs??this.markerDetails.startTs,o=e.endTs??this.markerDetails.endTs??performance.now(),r=e.color||this.markerDetails.color||"primary",i=e.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...e.details||[]],l=e.tooltip||this.markerDetails.tooltip,s=e.label||this.markerDetails.label||"Unknown",c=e.track||this.markerDetails.track||"Unknown";return performance.measure(s,{start:t,end:o,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:c,color:r,properties:a.length>0?a.map(u=>[u.name,u.value]):void 0,tooltipText:l}}}),this};this.debugId=e}static create(e){return new n(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys(jn).reduce((t,o)=>{let r={start:e.start,end:i=>e.end({...i,track:jn[o].track,label:i.label}),get label(){let i=jn[o];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:c=>e.end({...c,track:i.track,label:i.labels[l]})};return Object.defineProperty(a,l,{get:()=>(e.markerDetails.label=i.labels[l],s)}),a},{})}};return Object.defineProperty(t,o,{get:()=>{let i=jn[o];return e.markerDetails.track=i.track,r}}),t},{})}};function Qe(n){return Ha.create(n)}var yb=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)},Ba;function Rc(){return Ba||(Ba=gb(null))}function Sb(n,e,t,o,r,i,a){let l=e();return Object.keys(l).reduce((s,c)=>{let u=c;return Object.defineProperty(s,c,{set:f=>{let p=t(),m=e(),g=m[u],b=!0;if(i&&typeof i[u]=="function"&&i[u](f,{actions:s,state:m})===!1&&(b=!1),b){let S=[f],T=`on${Va(c)}Change`;if(a&&a[u]){let C=a[u](f,m);T=C.callbackName||T,S=C.callbackParams}yb(p,T,S)}let h=o[u];typeof h=="function"&&(f=h(f));let y=!!r?.[u];uo(c,p)&&!y||n({payload:{updatedProps:null,mappedState:{[c]:f}}})}}),s},{})}function Tb(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=uo(r,e)?e[r]:e[`default${Va(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function At(n){let e=n.getParentState||(()=>null);function t(r){let[i]=wc(()=>n.initSetupState?n.initSetupState(r):{}),a=Ic(new Set),l=Ka(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),c=_e(s);function u(){let v={};l&&(v=Tb(l,r,i));let D={...i,...v};if(n.mapPropsToState){let{fn:R,propertyReads:P}=za(n.mapPropsToState,{getProxyTargetFromArgs:M=>M.props,putProxyToArgs:(M,x)=>[{...x,props:M}]}),A=R({props:r,state:D,oldState:null,parentState:s});return a.current=new Set([...a.current,...P]),{...D,...A}}return D}let[d]=wc(u),f=_e(r),p=(v,D)=>{if(D.type==="REPLACE_STATE")return D.payload;let R=c?.()??null,P=D.payload.mappedState,A=D.payload.updatedPropsToState,M={...v};if(P&&Object.assign(M,P),n.mapPropsToState){let{fn:_,propertyReads:E}=za(n.mapPropsToState,{getProxyTargetFromArgs:k=>k.props,putProxyToArgs:(k,V)=>[{...V,props:k}]}),L=_({props:f(),state:M,oldState:v,parentState:R});a.current=new Set([...a.current,...E]),Object.assign(M,L)}return D.type==="ASSIGN_STATE"&&Object.assign(M,D.payload),n.concludeReducer?n.concludeReducer({previousState:v,state:M,updatedProps:A,parentState:R}):M},[m,g]=mb(p,d),b=_e(m),{allowedControlledPropOverrides:h}=n,y=Ka(()=>Sb(g,b,f,l,h,n.interceptActions,n.mappedCallbacks),[g,l,h]),S=n.Context??Rc(),T=Ka(()=>({componentState:m,componentActions:y,getComponentState:b,replaceState:v=>{g({type:"REPLACE_STATE",payload:v})},assignState:v=>{g({type:"ASSIGN_STATE",payload:v})}}),[m,y,b]),C=Ao(r),w=Ic(!1);w.current=!1;let I=n.layoutEffect?bb:hb;return I(()=>{let v=r,D={},R=0,P={},A=0,M={},x=0;if(new Set([...Object.keys(v),...Object.keys(C)]).forEach(L=>{let k=L,V=C[k],W=v[k];if(k!=="children"&&V!==W&&(M[k]={newValue:W,oldValue:V},x++,uo(k,r)||uo(k,C)))if(l.hasOwnProperty(L)){let O=W,F=l[L];typeof F=="function"&&(O=F(W)),m[k]!==O&&(D[k]=O,R++)}else a.current.has(L)&&(P[k]=v[k],A++)}),A>0||R>0){let L=m.debugId,k=L?Qe(L).track.ComponentState.label.PropUpdate.start():void 0,V=n.debugName?typeof n.debugName=="function"?`${n.debugName(v)}:rerender`:`${n.debugName}:rerender`:"rerender";Rt(V)("Triggered by new values for the following props",...Object.keys(D??{}),...Object.keys(P??{})),k&&k.end({label:V,details:[R>0?{name:"Updated properties",value:Object.keys(D).join(", ")}:void 0,A>0?{name:"Updated props",value:Object.keys(P).join(", ")}:void 0,A>0||P?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(co)});let O={payload:{mappedState:R?D:null,updatedPropsToState:A?P:null}};if(w.current=!0,g(O),n.onPropChange){for(var E in M)if(M.hasOwnProperty(E)){let{newValue:F,oldValue:J}=M[E];n.onPropChange({name:E,newValue:F,oldValue:J},r,y,m)}}n.onPropsChange&&x&&n.onPropsChange(M,r,y,m)}}),I(()=>{s!=null&&!w.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),Cc(()=>()=>{n.cleanup?.(b())}),{contextValue:T,ContextComponent:S}}return{ManagedComponentContextProvider:nn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return nn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Et(n){return n=n??Rc(),nn.useContext(n)}import*as kc from"react";var st="Infinite",Le={rootClassName:st};var Lr=()=>Le;var vc="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Dc={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var zt="_16lm1iw3b _16lm1iw3c _16lm1iw35",xc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},rn={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var kr={1:"_16lm1iw1c",none:"_16lm1iw1d"},$n={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Pc={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Mc={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Ac={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Ec={none:"_16lm1iwd"},_c={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var zr={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Oc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Fc={none:"_16lm1iw1x"};var Nc={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Lc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function zc(n){let{rootClassName:e}=Lr();return kc.createElement("div",{...n,className:Q(`${e}Footer`,zr.relative,rn.flex,$n.row,n.className)})}import*as ve from"react";import{useCallback as Zf,useContext as HS,useEffect as KS,useRef as BS}from"react";import{createPortal as WS}from"react-dom";function Vr(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}function Z(n){return n.slice(4,-1)}import*as Vc from"react";var ke=n=>{let e=n.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...n.style};return Vc.createElement("svg",{viewBox:"0 0 24 24",...n,style:t},n.children)};import*as Un from"react";var Gc=n=>Un.createElement(ke,{...n},Un.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29"}),Un.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Un.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));import*as Wa from"react";var Hc=n=>Wa.createElement(ke,{...n},Wa.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"}));import*as ja from"react";var $a=n=>ja.createElement(ke,{...n},ja.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));import*as Ua from"react";var Kc=n=>Ua.createElement(ke,{...n},Ua.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));import*as Ya from"react";var Bc=n=>Ya.createElement(ke,{...n},Ya.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));import*as qa from"react";var Wc=n=>qa.createElement(ke,{...n},qa.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));import*as Xa from"react";var jc=n=>Xa.createElement(ke,{...n},Xa.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));import*as Za from"react";var $c=n=>Za.createElement(ke,{...n},Za.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));import*as Qa from"react";var Uc=n=>Qa.createElement(ke,{...n},Qa.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"}));import*as sl from"react";import*as ot from"react";import{useEffect as kb,useState as vu}from"react";import*as an from"react";import{useEffect as vb,useLayoutEffect as Db,useState as gu}from"react";function Cb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function wb(n){var e=Cb(n,"string");return typeof e=="symbol"?e:String(e)}function Ib(n,e,t){return e=wb(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yc(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function qc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yc(Object(t),!0).forEach(function(o){Ib(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Yc(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Xc(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var Rb=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},ge=n=>{var e=t=>{var o=n.defaultClassName,r=qc(qc({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=n.variantClassNames[i][s];c&&(o+=" "+c)}}for(var[u,d]of n.compoundVariants)Rb(u,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return Xc(n.variantClassNames,t=>Xc(t,o=>o.split(" ")[0]))}},e};var Zc="_1eexc2a6";var Qc=ge({defaultClassName:"_12zfob12c _16lm1iw1z _16lm1iw22 _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw33",variantClassNames:{filtered:{false:"_12zfob12d",true:"_12zfob12e"},verticalAlign:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"},align:{start:"_12zfob12i",end:"_12zfob12j",center:"_12zfob12k"}},defaultVariants:{},compoundVariants:[]}),Jc="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",eu=ge({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),tu=ge({defaultClassName:"_12zfob1r",variantClassNames:{rowActive:{false:"_12zfob1s",true:"_12zfob1t"},cellSelected:{false:"_12zfob1u",true:"_12zfob1v"},rowSelected:{false:"_12zfob1w",true:"_12zfob1x",null:"_12zfob1y"},rowDisabled:{false:"_12zfob1z",true:"_12zfob110"},firstRow:{false:"_12zfob111",true:"_12zfob112"},treeNode:{parent:"_12zfob113",leaf:"_12zfob114",false:"_12zfob115"},firstRowInHorizontalLayoutPage:{false:"_12zfob116",true:"_12zfob117"},groupRow:{false:"_12zfob118",true:"_12zfob119"},groupCell:{false:"_12zfob11a",true:"_12zfob11b"},align:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},verticalAlign:{start:"_12zfob11f",end:"_12zfob11g",center:"_12zfob11h"},zebra:{false:"_12zfob11i",even:"_12zfob11j",odd:"_12zfob11k"},dragging:{true:"_12zfob11l",false:"_12zfob11m"},insideDisabledDraggingPage:{true:"_12zfob11n",false:"_12zfob11o"},first:{true:"_12zfob11p",false:"_12zfob11q"},last:{true:"_12zfob11r",false:"_12zfob11s"},groupByField:{true:"_12zfob11t",false:"_12zfob11u"},firstInCategory:{true:"_12zfob11v",false:"_12zfob11w"},lastInCategory:{true:"_12zfob11x",false:"_12zfob11y"},pinned:{start:"_12zfob11z",end:"_12zfob120",false:"_12zfob121"},filtered:{true:"_12zfob122",false:"_12zfob123"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob124"],[{pinned:"end",firstInCategory:!0},"_12zfob125"],[{pinned:!1,lastInCategory:!0},"_12zfob126"]]}),ou=ge({defaultClassName:"_12zfob1c _16lm1iw1s _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1d",end:"_12zfob1e",false:"_12zfob1f"},firstInCategory:{true:"_12zfob1g",false:"_12zfob1h"},lastInCategory:{true:"_12zfob1i",false:"_12zfob1j"},overflow:{true:"_12zfob1k",false:"_12zfob1l"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1m"],[{pinned:"start",firstInCategory:!0},"_12zfob1n"],[{overflow:!0,pinned:"end"},"_12zfob1o"],[{pinned:"end",lastInCategory:!0},"_12zfob1p"]]}),nu="_12zfob12u _16lm1iw22 _16lm1iw1z";var ru="_12zfob17",iu="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",au=ge({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Ja=ge({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),lu="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",su=ge({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),cu="_12zfob1b _16lm1iw2",uu="_16lm1iw1",du="_12zfob16",fu=ge({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),pu="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var bt="InfiniteIcon";var mu="_6aunoi0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var xb={transition:"width 0.25s, opacity 0.25s"};function ln(n){let[e,t]=gu(!0),[o,r]=gu(0),{lineWidth:i=1,style:a,className:l,index:s}=n,c=s!=null&&s>0,u=n.size??16,d=Math.floor(u/4),f=[u-1*d,u-2*d,u-3*d],p={...xb,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if(vb(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),Db(()=>{t(!0)},[]),!e)return null;let m={};return an.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:Q(l,bt,mu,`${bt}-filter`)},c?an.createElement("div",{"data-name":"index",style:m,className:ru},s):null,an.createElement("div",{style:{width:f[0],...p}}),an.createElement("div",{style:{width:f[1],...p}}),an.createElement("div",{style:{width:f[2],...p}}))}var el=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((I,v)=>{let D=I.maxSize??r??void 0,R=I.minSize??o??void 0;s.push(R),c.push(D),I.size!=null&&(D!=null&&I.size>D&&(I.size=D),R!=null&&I.size<R&&(I.size=R));let P=I.flex==0?null:I.flex;if(I.size==null&&P==null)throw`Items must specify either a size or a flex property. Item at index ${v} doesn't have either of those.`;P!=null&&(l+=1),a+=P??0,i+=I.size??0});let u=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,f={},p={},m=0;t.forEach((I,v)=>{if(I.flex!=null){let D=d*I.flex,R=I.maxSize??r??void 0,P=I.minSize??o??void 0,A=!1,M=0;R!=null&&D>R&&(f[v]=!0,A=!0,M=R),P!=null&&D<P&&(p[v]=!0,A=!0,M=P),A&&(m+=1,l-=1,a-=I.flex,u-=M)}}),m&&(d=u/a);let g=[],b=0,h=u,y=a,S=0,T=0,C=[];return{items:t.map((I,v)=>{let D={...I},R=I.maxSize??r??void 0,P=I.minSize??o??void 0,A=0,M=f[v],x=p[v],_=M||x,E=I.size??0;if(I.flex!=null){if(_)x&&(A=P),M&&(A=R);else{b+=1;let L=k=>(R!=null&&k>R&&(k=R),P!=null&&k<P&&(k=P),k);b===l?A=L(h):(A=L(Math.round(I.flex*d)),T+=A,h=u-T,y-=I.flex,d=h/y)}E=A,D.flexSize=A}return g.push(A),C.push(E),D.computedSize=E,S+=E,D}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:C,remainingSize:Math.round(e-S)}};function Gr(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}var tl=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((R,P)=>(R[P]={...n.columnSizing[P]},R),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],c=l.id,u=s?.id,d=l.computedWidth,f=l.computedMinWidth,p=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,b=s?.computedMinWidth,h=s?.computedMaxWidth,y=s?.computedFlex?"flex":"width",S=!1,T=!1,C=r>0?1:-1,{value:w,clamped:I,diff:v}=Gr(d+r,f,p,C);if(n.shareSpaceOnResize){if(s==null)return o[c]={...o[c],[m]:w},T=I==="min",S=I==="max",{adjustedDiff:w-d,reservedWidth:t,columnSizing:o,minReached:T,maxReached:S,constrained:T||S};let{value:R,clamped:P,diff:A}=Gr(g-r,b,h,C);if(I&&P&&(Math.abs(v)>Math.abs(A)?P=!1:I=!1),!(!I&&!P)){if(I){let M=Gr(g-r-v,b,h,C);R=M.value,P=M.clamped,A=M.diff}else if(P){let M=Gr(d+r+A,f,p,C);w=M.value,I=M.clamped,v=M.diff}}o[c]={...o[c],[m]:w},o[u]={...o[u],[y]:R},T=I==="min"||P==="min",S=I==="max"||P==="max"}else o[c]={...o[c],[m]:w},T=I==="min",S=I==="max";let D=w-d;return{adjustedDiff:D,reservedWidth:n.shareSpaceOnResize?t:t-D,columnSizing:o,minReached:T,maxReached:S,constrained:T||S}};function hu(n,e){return n+e}function Pb(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var bu=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((h,y)=>(h[y]={...n.columnSizing[y]},h),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((h,y)=>n.dragHandlePositionAfter-y).reverse(),a=i.map(h=>n.items[h]),l=a.map(h=>h.computedWidth),s=a.map(h=>h.computedFlex?"flex":"width"),c=0,{computedSizes:u}=el({items:a.map(h=>(h.resizable===!1&&(c+=h.computedWidth),{maxSize:h.computedMaxWidth,minSize:h.computedMinWidth,flex:h.resizable?h.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(hu,0)+r-c,0)}),d=a.map((h,y)=>u[y]-h.computedWidth),f=!0,p=!0,m=!0,g=[];d.forEach((h,y)=>{let S=a[y];if(!S.resizable){g.push(0);return}let T=s[y],C=l[y],w=Pb(o),{maxReached:I,minReached:v,constrained:D,adjustedDiff:R}=tl({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:h,dragHandlePositionAfter:i[y],shareSpaceOnResize:!1,items:n.items,columnSizing:w});o[S.id]={...w[S.id],[T]:C+R},g.push(R),I||(p=!1),v||(f=!1),D||(m=!1)});let b=g.reduce(hu,0);return{minReached:f,maxReached:p,constrained:m,adjustedDiffs:g,adjustedDiff:b,columnSizing:o,reservedWidth:t-b}};var Hr;function fo(){if(Hr!=null)return Hr;let n=Me().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),Hr=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Hr}var yu=["start",void 0,"end"],Su=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:yu.indexOf(r)-yu.indexOf(i)}),n);function Tu(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function ol(n,...e){return Tu(t=>t!=null,n,...e)}function Cu(n,e,...t){return Tu((o,r)=>!(r in n),e,...t)}var Kr=Object.freeze({}),Mb={string:Kr,number:{}};function nl(n,e){let t=e.default||Kr;return n.type===void 0?t:n.type===null?Kr:typeof n.type=="string"?e[n.type]||Mb[n.type]||Kr:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var Br=!0,Ab=!0,Eb=!0,_b="string",sn="unknown",Ob=lo("getComputedVisibleColumns"),Fb=(n,e,t)=>n[t]!==!1,rl=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1},wu=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:c,pinnedEndMaxWidth:u,filterValue:d,sortable:f,sortInfo:p,multiSort:m,filterTypes:g=Eo,viewportReservedWidth:b,resizableColumns:h,draggableColumns:y,columnDefaultDraggable:S,columnOrder:T,columnPinning:C,editable:w,columnDefaultEditable:I,columnDefaultFilterable:v,columnDefaultGroupable:D,columnDefaultSortable:R,columnSizing:P,columnTypes:A,columnVisibility:M,columnVisibilityAssumeVisible:x,groupBy:_})=>{let E=0,L={};_.forEach((K,re)=>{K.field&&(L[K.field]=re)});let k=(d||[]).reduce((K,re)=>{let{id:le,field:he}=re;return he&&(K[he]=re),le&&(K[le]=re),K},{}),V=Su(T===!0?Object.keys(n):T,C),W=V.filter(K=>n[K]?Fb(M,x,K):(Ob(`Column with id "${K}" specified in columnOrder array cannot be found in the columns map.`),!1)),O=new Map,F=W.map((K,re)=>{let le=n[K];return O.set(K,re),le}),J=(p??[]).reduce((K,re,le)=>(re.id?K[re.id]={sortInfo:re,index:le}:re.field&&(K[re.field]={sortInfo:re,index:le}),K),{});function j(K){let re=n[K],le=nl(re,A),he={minWidth:le?.minWidth,maxWidth:le?.maxWidth,width:le?.defaultWidth,flex:le?.defaultFlex},$e=ol({width:re?.defaultWidth,flex:re?.defaultFlex,minWidth:re?.minWidth,maxWidth:re?.maxWidth},P[K]);$e.width!=null&&delete he.flex,$e.flex!=null&&delete he.width,$e=ol(he,$e);let oe=$e.flex??void 0,H=$e.minWidth??re?.minWidth??t,et=$e.maxWidth??re?.maxWidth??o,Ce=oe!=null?void 0:$e.width??(i?void 0:r);return!Ce&&oe==null&&(i?oe=i:Ce=H),{size:Ce,flex:oe,minSize:H,maxSize:et}}let U=el({availableSize:Math.max(e.width-(b??0)-(a??fo()),0),maxSize:o,minSize:t,items:W.map(j)}),{computedSizes:ie,flexSizes:be,minSizes:Te,maxSizes:ce}=U,fe=[],me=[],$=[],G=[];G.length=W.length;let q=new Map,B=new Map,ae=0,ne=0,z=0,de=null,N=[],X=0,se=0,ue=0;F.forEach((K,re)=>{let le=W[re],he=ie[re],$e=N[re]=rl(le,C);$e==="start"?X+=he:$e==="end"?ue+=he:se+=he});let De=e.width-ue,xe=[],Ve=new Map;W.forEach((K,re)=>{let le=F[re];Ve.set(K,le)});let Fe=[];Object.keys(n).forEach(K=>{let re=n[K];Fe.push(K),Ve.has(K)||Ve.set(K,re)});let Ne=new Map;Ve.forEach((K,re)=>{let le=O.get(re);le==null&&(le=-1);let he=le!=-1,$e=W[le+1],oe=nl(K,A),H=le,et=J[re]?J[re]:K.field?J[K.field]??null:null,Ce=et?.sortInfo??null,tt=!!Ce,ht=tt&&Ce.dir===1,xt=tt&&!ht,Nn=et?.index??-1,Jo=he?{}:j(re),Ln=he?ie[le]:Jo.size||0,wa=he&&be[le]||null,Ia=he?Te[le]||0:Jo.minSize||0,Ra=he?ce[le]||1e4:Jo.maxSize||1e4,it=he?rl(re,C):!1,Dr=he?le===W.length-1:!1,Pe=H,at=he?it==="start"?ne:it==="end"?z:E-ne:0;it=="start"?Pe=he?H:-1:it==="end"?Pe=he?H-(fe.length+$.length):-1:Pe=he?H-fe.length:-1;let jt=he?it==="start"||it===!1?E:De+z:-1,Pt=he?it!==de:!1,kn=he?Dr||it!==rl($e,C):!1,tc=K.cssEllipsis??oe.cssEllipsis??l,Mh=K.headerCssEllipsis??oe.cssEllipsis??K.cssEllipsis??oe.headerCssEllipsis??s??tc,xr=he&&(k[re]||K.field||K.groupByForColumn)&&(k[re]||k[K.field||K.groupByForColumn])||null,Ah=K.defaultFilterable??oe.defaultFilterable??v??!0,Eh=w??K.defaultEditable??oe.defaultEditable??I??!1,va=K.dataType||oe.dataType||(Array.isArray(K.type)?K.type[0]:K.type)||_b,_h=K.sortType||oe.sortType||va,oc=K.filterType||oe.filterType||va,nc=!1;if(xr!=null&&!xr.disabled){let Pa=g[oc];Pa&&(!Pa.emptyValues||!Pa.emptyValues.includes(xr.filter.value))&&(nc=!0)}let xo=K.field??oe.field,rc=K.valueGetter??oe.valueGetter,Da=K.defaultGroupable??oe.defaultGroupable??D??!!xo;xo||(Da=!1),K.groupByForColumn&&(Da=!1);let xa=K.defaultSortable??oe.defaultSortable;xa==null&&!K.groupByForColumn&&xo==null&&rc==null&&(xa=!1);let ic=xo?L[xo]!==void 0:!1,Oh=ic?L[xo]:void 0,Fh=f??xa??R??Br,Nh=K.resizable??oe.resizable??h??Ab,Ue={colType:oe,align:oe.align,headerAlign:oe.headerAlign,computedVisible:he,verticalAlign:oe.verticalAlign,defaultHiddenWhenGroupedBy:oe.defaultHiddenWhenGroupedBy,valueGetter:rc,valueFormatter:oe.valueFormatter,renderValue:oe.renderValue,render:oe.render,style:oe.style,className:oe.className,contentFocusable:oe.contentFocusable,renderMenuIcon:oe.renderMenuIcon,renderSortIcon:oe.renderSortIcon,renderRowDetailIcon:oe.renderRowDetailIcon,renderSelectionCheckBox:oe.renderSelectionCheckBox,renderHeaderSelectionCheckBox:oe.renderHeaderSelectionCheckBox,headerStyle:oe.headerStyle,headerClassName:oe.headerClassName,columnGroup:oe.columnGroup,getValueToEdit:oe.getValueToEdit,getValueToPersist:oe.getValueToPersist,shouldAcceptEdit:oe.shouldAcceptEdit,field:xo,...K,components:{...oe.components,...K.components},computedResizable:Nh,computedMinWidth:Ia,computedMaxWidth:Ra,computedFlex:wa,computedDataType:va,computedEditable:Eh,computedSortType:_h,computedFilterType:oc,cssEllipsis:tc,headerCssEllipsis:Mh,computedFilterValue:xr,computedFiltered:nc,computedFilterable:Ah,computedGroupable:Da,computedGroupedBy:ic,computedGroupedByIndex:Oh,computedWidth:Ln,computedAbsoluteOffset:jt,computedPinningOffset:at,computedVisibleIndexInCategory:Pe,computedOffset:E,computedSortable:Fh,computedSortInfo:Ce,computedSortIndex:Nn,computedMultiSort:m,computedSorted:tt,computedSortedAsc:ht,computedSortedDesc:xt,computedVisibleIndex:H,computedPinned:it,computedDraggable:y??K.defaultDraggable??S??Eb,computedFirstInCategory:Pt,computedLastInCategory:kn,computedFirst:le===0,computedLast:Dr,id:re,header:K.header??oe.header??K.name??K.field};he&&(E+=Ln,q.set(Ue.id,Ue),G[le]=Ue,it==="start"&&(fe.push(Ue),ne+=Ue.computedWidth),it==="end"&&(me.push(Ue),z+=Ue.computedWidth),it||($.push(Ue),ae+=Ue.computedWidth),de=it),Ue.groupByForColumn&&(Ue.computedSortType=K.sortType||oe.sortType||sn,xe.push(Ue)),B.set(Ue.id,Ue),Ue.field&&!Ue.groupByForColumn&&!Ne.has(Ue.field)&&Ne.set(Ue.field,Ue)}),xe.forEach(K=>{K.computedSortable=Iu(K,{fieldsToColumn:Ne,sortable:f,columnDefaultSortable:R})});let Ke=new Map;Fe.forEach(K=>{let re=B.get(K);re&&Ke.set(K,re)}),B.forEach(K=>{Ke.has(K.id)||Ke.set(K.id,K)});let qe=c!=null?Math.min(c,ne):ne,Xe=u!=null?Math.min(u,z):z;return{computedRemainingSpace:e.width-(X+ue+se),computedPinnedStartColumnsWidth:ne,computedPinnedEndColumnsWidth:z,computedUnpinnedColumnsWidth:ae,computedColumnOrder:V,computedPinnedStartColumns:fe,computedPinnedEndColumns:me,computedUnpinnedOffset:ne,computedPinnedEndOffset:ne+ae,computedUnpinnedColumns:$,computedVisibleColumns:G,computedColumnsMap:B,computedColumnsMapInInitialOrder:Ke,computedVisibleColumnsMap:q,computedPinnedEndWidth:Xe,computedPinnedStartWidth:qe,renderSelectionCheckBox:G.reduce((K,re)=>K||!!re.renderSelectionCheckBox,!1),fieldsToColumn:Ne}};function Iu(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r}=e;if(t)return t;let i=n.defaultSortable??n.colType.defaultSortable;if(i!=null)return i;let a=r??Br;return n.computedSortType!==sn&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((f,p)=>{if(!f)return!1;let m=p.field||p.groupField,g;if(m){let b=o.get(m),h=b?u.getColumnApi(b.id):void 0;b&&h?g=h.isSortable():g=!1}return g===void 0&&p.valueGetter&&(g=!0),g??r??Br},!0)}}function ct(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)}};return l}function _o(n,e,t){let o=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:f,selectionMode:p}=u,m=i(),g=o.header&&typeof o.header!="function"?o.header:o.name||o.id||"";if(typeof o.header=="function"){let b=ct(o.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=o.header({horizontalLayoutPageIndex:null,column:o,columnApi:b,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:o.computedSortInfo,columnFilterValue:o.computedFilterValue,filtered:o.computedFiltered,allRowsSelected:d,someRowsSelected:f,selectionMode:p,api:r,renderBag:{header:g}})??null}return g}import*as Ru from"react";var Wr=`${st}HeaderCell__filter`,il=`${st}HeaderCell__filterOperator`,al=Ru.createContext(null);import{useContext as Lb}from"react";import{createContext as Nb}from"react";var ll;function jr(){return ll||(ll=Nb(null))}function te(n){let e=jr(),t=Lb(e);return tn(t,n)}function Ge(){return te(n=>({getState:n.getState,actions:n.actions,getComputed:n.getComputed,getDataSourceState:n.getDataSourceState,dataSourceApi:n.dataSourceApi,dataSourceActions:n.dataSourceActions,api:n.api,getDataSourceMasterContext:n.getDataSourceMasterContext}))}var zb=`${Wr}__input`,$r=n=>n.stopPropagation();function Du(n){let{filterOperatorMenuVisibleForColumnId:e}=te(u=>({filterOperatorMenuVisibleForColumnId:u.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Ur(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=vu(!1),l=ot.useCallback(()=>{a(!0)},[]),s=ot.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return ot.createElement("div",{onPointerUp:$r,onPointerDown:$r,onFocus:l,onBlur:s,className:`${Wr} ${Ja({active:c})}`,style:{height:n.columnHeaderHeight}},ot.createElement(al.Provider,{value:n},ot.createElement(r,null),ot.createElement(o,null)))}function xu(){let{columnApi:n,disabled:e,operator:t}=Yn(),o=t?.components?.Icon??ln;return ot.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:Q(il,iu,e?`${il}--disabled`:"")},ot.createElement(o,{size:20,className:`${au({disabled:e})}`}))}function Pu(){return ot.createElement("div",{onPointerUp:$r,onPointerDown:$r,className:`${Wr} ${Ja({active:!1})} ${Pc["50%"]}`})}function Yn(){let n=Ge(),{column:e,columnApi:t}=Ur(),o=_o(e,n,"column-filter"),r=ot.useContext(al),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=vu(l?.filter.value??""),d=ot.useCallback(b=>{u(b),r.onChange(b)},[r.onChange]),f=ot.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),p=ot.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);kb(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let b=[...s.emptyValues][0];b!==c&&u(b)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:n.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:c,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:f,removeColumnFilter:p,ariaLabel:`Filter for ${o}`,className:`${nu} ${zb}`}}function cn(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Yn();return sl.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function Yr(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Yn();return sl.createElement("input",{"aria-label":n,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:o})}function Vb(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:cn},operators:[{name:"includes",components:{Icon:Gc},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:$a},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:Uc},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Hc},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Yr},operators:[{label:"Equals",components:{Icon:$a},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:$c},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:Bc},fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>t},{name:"gte",components:{Icon:Kc},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>=t},{name:"lt",components:{Icon:jc},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<t},{name:"lte",components:{Icon:Wc},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<=t}]}}}var Eo=Vb();function qr(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as dd,useState as fd}from"react";function po(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function Mu(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}var Y={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var Au="true",pe={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},Eu="column-header-height";var _u=`.${Le.rootClassName}`;function cl(n){return po(n,_u)}var Ou=Z(Y.scrollLeft),Gb=Z(Y.scrollTop),Hb=Z(Y.columnWidthAtIndex),ul=Z(Y.columnOffsetAtIndex),Fu=Z(Y.columnReorderEffectDurationAtIndex),Kb=Z(Y.columnOffsetAtIndexWhileReordering),Bb=Z(Y.columnVisibilityAtIndex),Wb=Z(Y.columnZIndexAtIndex);function Vt(n,e,t){let o=t?cl(t):document.querySelector(_u);jb(n,e,o)}function jb(n,e,t){if(t){let o=n,r=Y[o]?Z(Y[o]):n;t.style.setProperty(r,`${e}`)}}function un(n,e){if(e)for(var t in n){let o=Y[t]?Z(Y[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function dl(n,e,t){Vt(`${ul}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${Ou}))`:`${n.computedAbsoluteOffset+e}px`,t)}function fl(n,e,t){Vt(`${Wb}-${n}`,`${e}`,t)}function dn(n,e,t){Vt(`${Kb}-${n}`,typeof e=="number"?`calc( var(${ul}-${n}) + ${e}px )`:e,t)}function qn(n,e,t){Vt(`${Bb}-${n}`,e,t)}function Xr(n,e,t){Vt(`${Fu}-${n}`,t??"",e)}function pl(n,e){let t=`${Fu}-${n}`;Vt(t,pe.components.Cell.reorderEffectDuration,e)}var we={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${Hb}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Vt(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${ul}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Vt(this.varName.get(n),e,t)}}};function Nu(n,e){un({[Ou]:`${n.scrollLeft}px`,[Gb]:`${n.scrollTop}px`},e)}var Lu="_16lm1iw1",ku="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",zu="_1yeub2vs",Vu="_1yeub2vr",Gu=ge({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var ml="_1yeub2vp";var Vx=ge({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var gl=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};var Xn={bodyWidth:{name:Z(pe.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Z(pe.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Z(pe.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Z(pe.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Z(pe.runtime.browserScrollbarWidth),value:""}},$b=Z(Y.scrollbarWidthHorizontal),Hu=Z(Y.scrollbarWidthVertical),Ub=Z(Y.columnWidthAtIndex),Yb=Z(Y.columnZIndexAtIndex),Ku=Z(Y.scrollLeft),qb=Z(Y.activeCellColWidth),Bu=Z(Y.activeCellColOffset),Uu=Z(Y.baseZIndexForCells),Xb=Z(Y.pinnedStartWidth),Wu=Z(Y.bodyWidth),Zb=Z(Y.bodyHeight),ju=Z(Y.pinnedEndOffset),$u=Z(Y.pinnedEndWidth),Qb=Z(Y.computedVisibleColumnsCount);function hl(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${Uu}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Yu(n){let e=fo(),{actions:t,getState:o,focused:r,focusedWithin:i,domRef:a,scrollerDOMRef:l,onBlurWithin:s,onFocusWithin:c,onSelfFocus:u,onSelfBlur:d,bodySize:f,activeCellIndex:p,wrapRowsHorizontally:m,computedPinnedStartColumnsWidth:g,computedPinnedEndColumnsWidth:b,computedPinnedStartColumns:h,computedPinnedEndColumns:y,computedVisibleColumns:S,computedUnpinnedColumnsWidth:T,scrollbars:C,focusedClassName:w,focusedWithinClassName:I,computedPinnedStartOverflow:v,computedPinnedEndOverflow:D,focusedStyle:R,focusedWithinStyle:P,brain:A}=te(O=>{let{state:F,computed:J}=O;return{brain:F.brain,actions:O.actions,getState:O.getState,focused:F.focused,focusedWithin:F.focusedWithin,domRef:F.domRef,scrollerDOMRef:F.scrollerDOMRef,onBlurWithin:F.onBlurWithin,onFocusWithin:F.onFocusWithin,onSelfFocus:F.onSelfFocus,onSelfBlur:F.onSelfBlur,bodySize:F.bodySize,activeCellIndex:F.activeCellIndex,wrapRowsHorizontally:F.wrapRowsHorizontally,computedPinnedStartColumnsWidth:J.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:J.computedPinnedEndColumnsWidth,computedPinnedStartColumns:J.computedPinnedStartColumns,computedPinnedEndColumns:J.computedPinnedEndColumns,computedVisibleColumns:J.computedVisibleColumns,computedUnpinnedColumnsWidth:J.computedUnpinnedColumnsWidth,scrollbars:J.scrollbars,focusedClassName:O.state.focusedClassName,focusedWithinClassName:O.state.focusedWithinClassName,computedPinnedStartOverflow:J.computedPinnedStartOverflow,computedPinnedEndOverflow:J.computedPinnedEndOverflow,focusedStyle:O.state.focusedStyle,focusedWithinStyle:O.state.focusedWithinStyle}}),M=[],x=S.reduce((O,F)=>{let J=F.computedVisibleIndex;O[we.columnWidths.varName.get(J)]=F.computedWidth+"px",O[we.columnOffsets.varName.get(J)]=F.computedPinned==="start"?`calc( ${F.computedOffset}px + var(${Ku}) )`:F.computedPinned==="end"?`calc( var(${ju}) ${M.length?"+":""} ${M.map(U=>we.columnWidths.get(U.computedVisibleIndex)).join(" + ")} + var(${Ku}) )`:`${F.computedOffset}px`;let j=hl(F,{pinnedStartColsCount:h.length,visibleColsCount:S.length});return O[`${Yb}-${J}`]=`${j}`,F.computedPinned==="end"&&M.push(F),O},{});if(f.width&&(x[Xn.browserScrollbarWidth.name]=`${fo()}px`),x[Xn.bodyWidth.name]=`calc(${Y.bodyWidth} - ${Y.scrollbarWidthVertical})`,x[Xn.totalVisibleColumnsWidthValue.name]=`${g+b+T}px`,x[Xn.totalVisibleColumnsWidthVar.name]=`calc(${S.map((O,F)=>`var(${Ub}-${F})`).join(" + ")})`,x[Xn.visibleColumnsCount.name]=S.length,p!=null){x[qb]=we.columnWidths.get(p[1]);let O=we.columnOffsets.get(p[1]);if(A.isHorizontalLayoutBrain){let F=A.getPageIndexForRow(p[0]);x[Bu]=F?`calc( ${pe.runtime.totalVisibleColumnsWidthVar} * ${F} + ${O})`:O}else x[Bu]=O}x[Qb]=S.length,x[$b]=C.horizontal?`${e}px`:"0px",x[Hu]=C.vertical?`${e}px`:"0px",x[Xb]="calc( "+h.map(O=>we.columnWidths.get(O.computedVisibleIndex)).join(" + ")+")",x[$u]="calc( "+y.map(O=>we.columnWidths.get(O.computedVisibleIndex)).join(" + ")+")",x[Uu]=S.length*10,x[ju]=`calc( var(${Wu}) - var(${$u}) - var(${Hu}) )`,x[Wu]=`${f.width}px`,x[Zb]=`${f.height}px`;let _=gl(O=>{t.focused=O}),E=gl(O=>{t.focusedWithin=O}),V={...n,onFocus:O=>{if(n?.onFocus?.(O),O.target===a.current||O.target===l.current){if(o().focused)return;_(!0),u?.(O),i&&(E(!1),s?.(O));return}i||(E(!0),c?.(O))},onBlur:O=>{if(n?.onBlur?.(O),O.target===a.current||O.target===l.current){if(!o().focused)return;_(!1),d?.(O),i&&(E(!1),s?.(O));return}a.current?.contains(O.relatedTarget)||(E(!1),s?.(O))}},W=Q(Ut,ku,m?`${Ut}--horizontal-layout`:null,V?.className,g?`${Ut}--has-pinned-start ${Vu}`:null,b?`${Ut}--has-pinned-end ${zu}`:null,r?`${Ut}--focused`:null,i?`${Ut}--focused-within`:null,r&&w?w:null,i&&I?I:null,v?`${Ut}--has-pinned-start-overflow`:null,D?`${Ut}--has-pinned-end-overflow`:null,Gu({horizontalLayout:!!m,hasPinnedStart:!!g,hasPinnedEnd:!!b,focused:r,focusedWithin:i}));return V.className=W,V.style={...n?.style,...x},r&&R&&Object.assign(V.style,R),i&&P&&Object.assign(V.style,P),V}var nd=en(Oo());function Zr(n){return n.map(e=>e instanceof mo?e:new mo(null,[e]))}var mo=class n{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new n("+",[this,...e])}subtract(...e){return new n("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new n("*",[this,...e])}divide(...e){return new n("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>Jb(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function Jb(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var ey=(...n)=>new mo("+",Zr(n)),Xu=(...n)=>new mo("-",Zr(n)),ty=(...n)=>new mo("*",Zr(n)),oy=(...n)=>new mo("/",Zr(n)),Zn={add:ey,subtract:Xu,minus:Xu,multiply:ty,divide:oy};var Fo=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var ze=Me().requestAnimationFrame||(n=>setTimeout(n,16)),_t=Me().cancelAnimationFrame||(n=>clearTimeout(n));var Zu=n=>{let e=null,t=null;return{stop(){e!==null&&_t(e),t!=null&&_t(t)},scroll(o){e!==null&&_t(e),t!=null&&_t(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return o.scrollLeft=o.scrollLeft-f,e=ze(()=>{i.scroll(o)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return o.scrollLeft=o.scrollLeft+f,t=ze(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var Be=class n{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new n(e)}static from(e){return new n(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,o=e.left-this.left;return{top:t,left:o}}};function Qu(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Ju(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function ny(n,e,t){let o=Qu(n,t),r=Qu(e,t);return o===r?Ju(t,e)-Ju(t,n):o-r}function ed(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>ny(o,r,t)),e}function ry(n){if(n.length<2)return!1;let e=n[0].left,t=n[0].top,o={left:!1,top:!1};for(let r=1,i=n.length;r<i;r++){if(o.left&&o.top)return!1;n[r].left!==e&&(o.left=!0),n[r].top!==t&&(o.top=!0)}return!(o.left&&o.top)}function iy(n,e){if(n.length<2)return n[0]?n[0].left===e.left&&n[0].top===e.top:!1;n=ed(n);let t=n[0],o=n[n.length-1];return t.left===o.left?e.left===t.left&&e.top>=Math.min(t.top,o.top)&&e.top<=Math.max(t.top,o.top):e.top===t.top&&e.left>=Math.min(t.left,o.left)&&e.left<=Math.max(t.left,o.left)}function td(n,e){if(ry(n))return iy(n,e);n=ed(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(ay([t,i,a],e))return!0}return!1}function ay(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var fn=class{containsPoint(e){return td(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var pn=class n extends fn{static clone(e){return new n(e)}constructor(e){super(),this.points=e.map(Be.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function ly(n,e){let t=Math.min(n.left,e.left),o=Math.min(n.top,e.top),r=n.left+n.width,i=e.left+e.width,a=Math.max(r,i),l=n.top+n.height,s=e.top+e.height,c=Math.max(l,s);return new Re({top:o,left:t,width:a-t,height:c-o})}var Re=class n extends fn{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new n(t)}static clone(t){return new n(t)}static from(t){return n.clone(t)}static fromPoint(t){return n.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let o=this;for(let r of t)o=ly(o,r);return o}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new pn(this.getPoints()).containsPoint(t)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Be.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var od=10,sy=Z(Y.pinnedStartWidth);function rd(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:f,setProxyPosition:p,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:b,horizontalLayoutPageIndex:h,pageWidth:y}=n;function S(G){let q=G==="start"?k:V;return _===L?q:L===G?q+M.computedWidth:_===G?q-M.computedWidth:q}function T(G){if(G.columnIndex===x||h!=null)return!0;let q=e[G.columnIndex];if(q.computedPinned)return!0;let B=l.getScrollPosition().scrollLeft,ae=q.computedOffset+(h!=null&&y!=null?y*h:0);return ae>=B+S("start")&&ae+q.computedWidth<=B+u.width-S("end")}let C=(G,q)=>{let{restrictToParentGroup:B,dragColumn:ae}=q,ne=[];if(G.forEach(de=>{if(de.computedVisibleIndex===x)return;let N={columnId:de.id,columnIndex:de.computedVisibleIndex,offsetX:de.computedOffset+Math.round(de.computedWidth/2)};T(N)&&ne.push(N)}),B){let N=function(se,ue,De){let xe=G[se];xe&&(xe.columnGroup!==ae.columnGroup&&De.add(xe.id),N(se+ue,ue,De))};var z=N;let de=ae.computedVisibleIndex,X=new Set;N(de-1,-1,X),N(de+1,1,X),ne=ne.filter(se=>!X.has(se.columnId))}return ne},I=r.length,v={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},D={left:v.clientX-u.left-(v.clientX-s.left)+od,top:v.clientY-u.top-(v.clientY-s.top)+od},R=l.getScrollPosition(),P=e.map(G=>G.computedVisibleIndex),A=P,M=t.get(i),x=M.computedVisibleIndex,_=M?.computedPinned,E=x,L=_,k=l.getFixedStartColsWidth(),V=l.getFixedEndColsWidth(),W=v,O={x:0,y:0},F=1,J=0;function j(G){let q=Math.round(G.clientX),B=Math.round(G.clientY);if(q===W.clientX&&B===W.clientY)return Re.from(s).shift({left:O.x,top:O.y});W={clientX:q,clientY:B};let ne=l.getScrollPosition().scrollLeft-R.scrollLeft;return O.x=W.clientX-v.clientX,O.y=W.clientY-v.clientY,J=O.x+ne,F=J<0?-1:1,p({left:D.left+O.x,top:D.top+O.y}),Re.from(s).shift({left:O.x,top:O.y})}function U(G){let q=0;_?_==="start"&&G.forEach((B,ae)=>{q||e[B]?.computedPinned!=="start"&&(q=ae)}):G.forEach((B,ae)=>{e[B]?.computedPinned==="start"&&(q=ae+1)}),I=q,ie("start",G,q)}function ie(G,q,B){if(G==="start"){let ae=0;for(let ne=0;ne<B;ne++){let z=q[ne],de=e[z];ae+=de.computedWidth}Vt(sy,`${ae}px`,a)}}function be(G){if(G==null||G===E)return;if(E===-1&&G!==-1&&(qn(x,"",a),m(!1)),E=G,G===-1){Te(x);return}let q=Fo(P,x,E>x?E-1:E);I=0;let ae=new Set;return q.forEach((ne,z)=>{let de=A[z];ne!==de&&ae.add(ne),U(q)}),A=q,ce(ae),{newColumnIndexes:q,indexesWithTransition:ae,pinnedStartCount:I}}function Te(G){A=A.filter(B=>B!==G),e.forEach(B=>{let ae=B.computedVisibleIndex,ne=ae>G;pl(ae,a);let z="";ne&&(z=Zn.minus(we.columnOffsets.get(ae),we.columnWidths.get(G)).done()),dn(ae,z,a)}),qn(G,"hidden",a),m(!0)}function ce(G){e.forEach(q=>{let B=q.computedVisibleIndex;G.has(B)?pl(B,a):Xr(B,a);let ae=B===x,ne=F===-1?B<E||B>x:B<x||B>=E,z="";F===-1?z=ae?we.columnOffsets.get(E):ne?we.columnOffsets.get(B):Zn.add(we.columnOffsets.get(B),we.columnWidths.get(x)).done():z=ne?we.columnOffsets.get(B):ae?Zn.add(we.columnOffsets.get(E-1),we.columnWidths.get(E-1)).minus(we.columnWidths.get(x)).done():Zn.minus(we.columnOffsets.get(B),we.columnWidths.get(x)).done(),dn(B,z,a)})}let fe=u.left+S("start"),me=u.right-S("end"),$=Zu({scrollOffsetStart:fe,scrollOffsetEnd:me});return j(v),{speedScroller:$,stop(){$.stop()},onMove(G){let q=j(G);if(g().dropTargetListId==="grouping-toolbar"||f&&!d.containsPoint(q.getCenter()))return f&&be(-1),null;$.scroll({mousePosition:W,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(N){b.scrollLeft=N}});let B=C(e,{dragColumn:M,restrictToParentGroup:c==="group"}),ae=F===-1?M.computedOffset+J:M.computedOffset+M.computedWidth+J,ne=(0,nd.default)(B,ae,({offsetX:N},X)=>N<X?-1:N>X?1:0);ne<0&&(ne=~ne),B.length?ne=B[ne]?B[ne].columnIndex:B[B.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),ne=0),ne===x+1&&(ne=x),be(ne);let z={};o.forEach(N=>{z[N.id]="end"});for(let N=0;N<I;N++){let X=A[N],se=e[X];z[se.id]="start"}let de=A.map(N=>e[N].id);return{columnPinning:z,columnOrder:de}}}}function bl(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return o;if(a>i){let l=e.indexOf(r),s=e[l-1],c=o.indexOf(s),u=o.indexOf(r);return Fo(o,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=o.indexOf(s),u=o.indexOf(r);return Fo(o,u,c)}return e}import*as mt from"react";var No=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let o=((...r)=>{this.off(e,o),t(...r)});return this.on(e,o)}off(e,t){let o=this.listeners[e];if(!o)return;let r=o.indexOf(t);r!==-1&&o.splice(r,1)}emit(e,...t){let o=this.listeners[e];o&&o.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var id=en(Oo());var ad=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=o,f=c===a,p=Be.from(d.getCenter());if(!l.containsPoint(p))return null;e.activeDragSourcePosition="inside";let m=f?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),b=e.breakpoints,h=Math.round(m===1?r==="horizontal"?g.right-(f?0:g.width/2):g.bottom-(f?0:g.height/2):r==="horizontal"?g.left+(f?0:g.width/2):g.top+(f?0:g.height/2)),y=(0,id.default)(b,h,(I,v)=>I-v);y<0&&(y=~y),m===1&&y===u+1&&f&&y--;let S=Math.min(u,y),T=Math.max(u,y),C=f?i.map((I,v)=>{if(v===u&&f)return t;if(v<S||v>=T)return{left:0,top:0};let D=y<=v?1:-1;return r==="horizontal"?{left:Math.round(D*g.width),top:0}:{left:0,top:Math.round(D*g.height)}}):i.map((I,v)=>{let D=y<=v?1:0;return r==="horizontal"?{left:Math.round(D*g.width),top:0}:{left:0,top:Math.round(D*g.height)}}),w={offset:t,dropIndex:y,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:C,dragRect:g,status:"accepted"};return e.acceptsDrop(w)?{event:w,error:null,success:!0}:(w.status="rejected",{event:w,error:"rejected by interaction target",success:!1})},ld=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=o,d=Be.from(s.getCenter()),f=u===i,p=a.containsPoint(d);if(p&&!(f&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!f)return null;e.activeDragSourcePosition="outside";let m=f?o.dragIndex:-1,g=s.toDOMRect(),b={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!p,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:f?l.map((h,y)=>h.id===c.id?t:p?{left:0,top:0}:y>m?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(h=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(b)?{event:b,error:null,success:!0}:(b.status="rejected",{event:b,error:"rejected by interaction target",success:!1})};var Ae=class Ae{static startDrag(e,t){let o=e instanceof mn?e:new mn(e),r=new yl({activeDragSource:o,startPoint:t});return r.on("start",Ae.onDragStart),r.on("move",Ae.onDragMove),r.on("drop",Ae.onDragDrop),r.start(),r}static emit(e,...t){Ae.emitter.emit(e,...t)}static on(e,t){return Ae.emitter.on(e,t)}static registerDragInteractionTarget(e){if(Ae.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return Ae.dragInteractionTargetsMap.set(e.listId,e),Ae.emit("register",e),()=>{Ae.unregisterDragInteractionTarget(e)}}static unregisterAll(){Ae.dragInteractionTargetsMap.forEach(e=>{Ae.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!Ae.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}Ae.dragInteractionTargetsMap.delete(e.listId),e.unregister(),Ae.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:o}=e.activeDragSource,r=e.activeDragSource.listId,a=Ae.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;Ae.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?o:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),Ae.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:o})}static withDragMove(e,t){let{activeDragSource:o}=e,{listId:r}=o,i=[],a=!0,l=Ae.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(Ae.dragInteractionTargetsMap.get(r))),Ae.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=ad(e,s);if(c){t(s,c),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let c=ld(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:o,dragItem:r}=t,i=null,a=[];Ae.withDragMove(e,(c,{event:u})=>{c.move(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null,s=l?.dropTargetListId??null;Ae.emit("drag-move",{dragSourceListId:o,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:o,dragItem:r}=t,i=null,a=[];Ae.withDragMove(e,(s,{event:c})=>{s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;Ae.emit("drag-drop",{dragSourceListId:o,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),Ae.unregisterAll()}};Ae.dragInteractionTargetsMap=new Map,Ae.emitter=new No;var yt=Ae,mn=class n{static clone(e){let t=e.getData();return new n(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){pt(this.data,e)||(this.data=e,this.dragRectangle=new Re(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let o=n.clone(e),r=Re.from(o.dragRectangle);return r.shift(t),o.dragRectangle=r,o}},yl=class extends No{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=mn.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:o}=this.activeDragSource,r={dragSourceListId:t,dragItemId:o.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let o={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=mn.shift(this.initialDragSource,o),this.currentOffset=o,this.emit("move",this)}};globalThis.DragManager=yt;import{useEffect as cy}from"react";var sd=mt.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:n=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),Lo=()=>mt.useContext(sd),Sl=n=>{let[e,t]=mt.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),o=mt.useRef(e);o.current=e;let r=mt.useCallback(()=>{let a=o.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=mt.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return cy(()=>{let a=yt.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),l=yt.on("drag-move",c=>{let u=o.current,d={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(u)!==JSON.stringify(d)&&t(d)}),s=yt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[yt,t]),mt.createElement(sd.Provider,{value:i},typeof n.children=="function"?n.children(i):n.children)};var Tl=`${st}Body`,cd=n=>n.querySelector(`.${Tl}`);var ko=`${st}HeaderCell`,Cl=`${st}HeaderWrapper`,ud=n=>Array.from(n.querySelectorAll(`.${Cl}`));function Qr(n){if(!n)return!1;let e=n.tagName;return e==="INPUT"||e==="BUTTON"}var uy=Z(Y.baseZIndexForCells),dy=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:pt(n,e)},pd=({columnId:n,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o})=>{let[r,i]=fd(null),[a,l]=fd(!1),{getCurrentDragSourceAndTarget:s}=Lo(),{getComputed:c,getState:u,api:d,computedDraggable:f,rootRef:p,actions:m}=te(h=>({actions:h.actions,getComputed:h.getComputed,getState:h.getState,api:h.api,computedDraggable:h.computed.computedVisibleColumnsMap.get(n)?.computedDraggable,rootRef:h.state.domRef})),g=dd(h=>{let y=c().computedVisibleColumnsMap.get(n);if(!y||!y.computedSortable)return;let{multiSortBehavior:S}=u();d.toggleSortingForColumn(n,{multiSortBehavior:S==="replace"&&(h.ctrlKey||h.metaKey)?"append":S})},[]),b=dd(h=>{if(Qr(h.target))return;let{brain:y,draggableColumnsRestrictTo:S}=u(),{computedVisibleColumns:T,computedVisibleColumnsMap:C,computedPinnedStartColumns:w,computedUnpinnedColumns:I,computedPinnedEndColumns:v}=c(),D=C.get(n);if(!D.computedDraggable){g(h);return}let R=e.current,P=R.getBoundingClientRect(),A=p.current.getBoundingClientRect(),M=y.getAvailableSize(),x=D.computedVisibleIndex,_=y.getVirtualColIndex(D.computedVisibleIndex,{pageIndex:t||0}),E=y.isHorizontalLayoutBrain?y.getPageWidth():null,L=R.style.cursor??"auto",k=!1,V=p.current,W=Re.from(cd(V).getBoundingClientRect()),O=ud(V).map(fe=>Re.from(fe.getBoundingClientRect())),F=W.getMinimumBoundingRectangle(...O),J=rd({brain:y,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o,pageWidth:E,draggableColumnsRestrictTo:S,computedPinnedEndColumns:v,computedPinnedStartColumns:w,computedUnpinnedColumns:I,computedVisibleColumns:T,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:P,dragColumnId:n,getCurrentDragSourceAndTarget:s,api:d,infiniteDOMNode:p.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:A,acceptDropToReorderRect:F,initialMousePosition:{clientX:h.clientX,clientY:h.clientY}}),j=null,U,ie;function be(fe){let{columnPinning:me,columnOrder:$}=fe;dy(u().columnPinning,me)||(m.columnPinning=me);let G=c().computedColumnOrder;JSON.stringify($,G)&&(T.forEach(q=>{dn(q.computedVisibleIndex,"",p.current)}),m.columnOrder=bl({newColumnOrder:$,visibleColumnOrder:c().computedVisibleColumns.map(q=>q.id),existingColumnOrder:G,dragColumnId:n}))}let Te=fe=>{let{headerBrain:me,brain:$}=u();if(!k){k=!0;let G=$.keepColumnRendered(_),q=me.keepColumnRendered(_);if($.isHorizontalLayoutBrain){let ae=$.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ne=me.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ie=()=>{ae(),ne()}}U=()=>{G(),q()},m.columnReorderDragColumnId=D.id,t!=null&&(m.columnReorderInPageIndex=t),fl(x,`calc( var(${uy}) + 10000 )`,p.current),p.current?.classList.add(ml),R.style.cursor="grabbing"}j=J.onMove(fe)},ce=fe=>{let me=fe.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:$}=u(),G=e.current;p.current?.classList.remove(ml),J.stop(),y.update({...M}),U?.(),ie?.(),T.forEach(B=>{Xr(B.computedVisibleIndex,p.current),qn(B.computedVisibleIndex,"",p.current),dn(B.computedVisibleIndex,"",p.current)}),fl(x,hl(D,{pinnedStartColsCount:w.length,visibleColsCount:T.length}),p.current),G.style.cursor=L,G.releasePointerCapture(me),G.removeEventListener("pointermove",Te),G.removeEventListener("pointerup",ce),i(null);let q=d.getColumnApi(D.id)?.isSortable()??!1;!k&&q&&d.toggleSortingForColumn(D.id,{multiSortBehavior:$==="replace"&&(fe.ctrlKey||fe.metaKey)?"append":$}),j?be(j):k&&o&&d.setVisibilityForColumn(D.id,!1),m.columnReorderDragColumnId=!1,t!=null&&(m.columnReorderInPageIndex=null)})};R.addEventListener("pointermove",Te),R.addEventListener("pointerup",ce),R.setPointerCapture(h.pointerId)},[n,t]);return{onPointerDown:f?b:g,dragColumnOutside:a,proxyPosition:r}};import*as hn from"react";import*as Se from"react";import{useCallback as nt,useContext as vy,useMemo as Dy,useSyncExternalStore as xy}from"react";import*as Vo from"react";var md=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;import*as Qn from"react";import{useState as fy}from"react";var gd="_6rdmyg0 _16lm1iw1d _16lm1iwk _16lm1iw9",hd=ge({defaultClassName:"_6rdmyg1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_6rdmyg3"},direction:{end:"_6rdmyg4",start:"_6rdmyg5"},disabled:{true:"_6rdmyg6",false:"_6rdmyg7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var Jr=`${bt}-expand-collapse`;function zo(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=fy(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),uo("expanded",n)||i(!r)};Qn.useEffect(()=>{uo("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return Qn.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:Q(n.className,gd,hd({direction:t||"start",expanded:r,disabled:o}),`${bt}`,`${Jr}`,`${Jr}--${l}`,`${Jr}--${t==="end"?"end":"start"}`,o?`${Jr}--disabled`:"")},Qn.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}import*as ei from"react";var bd="_16lm1iwb _16lm1iw1d _16lm1iwk";var yd=n=>ei.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",display:"block",shapeRendering:"auto"},width:"24px",height:"24px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:Q(n.className,bd,"InfiniteIcon","InfiniteIcon-loading")},ei.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},ei.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var{rootClassName:py}=Le,Gt=`${py}ColumnCell`;var Sd=ge({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Td="_7pupv00",Cd=ge({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function wd({rowInfo:n}){return{[Z(pe.components.Row.groupNesting)]:n.dataSourceHasGrouping?n.isGroupRow?n.groupNesting-1:n.groupNesting:0}}function ti({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=o,d=Q(rn.flex,i.align==="end"?$n.rowReverse:$n.row,Dc.center,`${Gt}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||c)?Sd({align:a}):null);if(e==="multi-column"){if(n+1!==u.groupNesting&&u.isGroupRow)return c?Vo.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return Vo.createElement("div",{className:d},s,c,Vo.createElement("div",{className:zt},l??null))}}function oi({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===n&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&n+1!==u.groupNesting)return null;let f=u.groupKeys,p=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return md(u)?p=Vo.createElement(yd,null):m&&(p=Vo.createElement(zo,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(f)}})),o&&(r.renderBag.groupIcon=p,p=Vo.createElement(gt,{render:o,renderParam:r})),p}}function Id(n,e,t){let{groupByForColumn:o,groupIndexForColumn:r,groupRenderStrategy:i}=n,a=o.column?{...o.column}:{},l={header:`Group by ${o.field||o.groupField}`,groupByForColumn:o,render:ti({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:oi({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(n,e)}:l={...l,...t}),l}function Rd(n,e,t){let o=typeof t=="function"?t(n,e):t,r={};return n.sortable!=null&&(r.sortable=n.sortable),{...r,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:ti({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...o,renderGroupIcon:oi({initialRenderGroupIcon:o?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}var vd="_1eexc2a7 _1eexc2a6",Dd=ge({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),xd=ge({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var Pd="_1eexc2a5",ni=ge({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),ri="_1eexc2a8";import*as ii from"react";import{useEffect as my,useRef as gy}from"react";var Md="qz8ht90 _16lm1iwk";function hy(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:by}=At({forwardProps:hy,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function yy(){let{componentState:n,componentActions:e}=Et(),{checked:t,domProps:o,disabled:r}=n,i=gy(null);return my(()=>{i.current.indeterminate=t==null},[t]),ii.createElement("input",{...o,className:Q("InfiniteCheckBox",Md,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function Yt(n){return ii.createElement(by,{...n},ii.createElement(yy,null))}function Sy(n){return typeof n.field=="string"}function Ad(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?o.get(i.field||i.groupField):void 0}!r&&e.field&&(r=o.get(e.field))}return r}function St(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,f=e().computedColumnsMap.get(i),{activeRowIndex:p,keyboardNavigation:m,isRowDetailEnabled:g}=o(),b=r===p&&m==="row",h=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:S}}=gn({column:f,rowInfo:c,rowDetailState:h,columnsMap:e().computedColumnsMap,context:n}),T=ct(f.id,n);return u?{api:a,dataSourceApi:l,column:f,columnApi:T,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:T,column:f,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:T,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:T,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}}function Ed(n){return Od(n.column,n.rowInfo)}function _d(n){let{column:e,context:t,rowInfo:o,visibleColumnsIds:r}=n,i=Ad({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=gn(n),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let f=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",p=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:u,stylingParam:d,formattedValueContext:c,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:Ty({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnsIds:n.visibleColumnsIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:f,verticalAlign:p,formattedValueContext:c}),groupByColumnReference:i}}function Ty(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=n,{value:u}=c,{api:d,getDataSourceState:f,getState:p,dataSourceApi:m}=t,{editingCell:g}=p(),{indexInAll:b}=o,h=f(),{selectionMode:y,cellSelection:S}=h,T=Ad({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),C=d.toggleGroupRow,w=S?.isCellSelected(o.id,e.id)??!1,I={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:w,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===o.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:T,selectionMode:y,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:b,toggleGroupRow:C,toggleCurrentGroupRow:()=>{o.isGroupRow&&C(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:h.groupBy,pivotBy:h.pivotBy};return Object.defineProperty(I,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),I}function Od(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:Sy(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function Cy(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}}function gn(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=Od(e,t),a=Cy(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}import*as qt from"react";var{rootClassName:Fd}=Le,Go=`${Fd}Cell`,wl=`${Fd}Cell_content`,wy=Z(Y.columnWidthAtIndex),Iy=Z(Y.columnReorderEffectDurationAtIndex);function Ry(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:f,cssPosition:p,renderChildren:m,horizontalLayoutPageIndex:g,...b}=n,h=typeof m=="function"?m():m,y={width:`var(${wy}-${i.computedVisibleIndex})`,transition:`transform var(${Iy}-${i.computedVisibleIndex}, 0s)`,...b.style},S={...b,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:Q(b.className,Go,vd),children:qt.createElement(qt.Fragment,null,d,qt.createElement("div",{className:Q(wl,e?zt:_c.hidden,s),style:r},h),u)};c!=null&&(S["data-row-id"]=`${c}`);let T=f==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return T?qt.createElement(T,{...S,ref:a}):qt.createElement("div",{...S,ref:a})}var ai=qt.memo(Ry);import*as Ho from"react";import{useCallback as Il,useRef as Nd}from"react";function Ld(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=Rl(),i=Nd(null),a=Nd(!1),l=Ho.useCallback(u=>{i.current=u,u&&u.focus()},[]),s=Il(u=>{let{key:d}=u;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,o()):u.stopPropagation()},[]),c=Il(()=>{a.current||t()},[]);return Ho.createElement(Ho.Fragment,null,Ho.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:c,className:Q(vc,Ec.none),type:"text",defaultValue:n,onChange:Il(u=>{e(u.target.value)},[])}))}function kd(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}var Py=Z(Y.columnZIndexAtIndex),My=Z(Y.columnVisibilityAtIndex);function Ay({rowInfo:n}){return{[Z(pe.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}var Jn=Se.createContext(null),Ey=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return Se.createElement(zo,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},_y={display:"inline-block",visibility:"visible"},vl=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return Se.createElement(zo,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:_y,expanded:o,onChange:t})},Oy=n=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:o,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=n;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),c=l.getDataSourceState().isNodeSelectable,u=s?.CheckBox||Yt;return Se.createElement(u,{domProps:{className:ri},disabled:e.isTreeNode?!c(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():o()},checked:e.rowSelected})};function Dl(n,e){return n?typeof n=="function"?n(e):n:void 0}function xl(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function Fy(n){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:o,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,cellStyle:s,cellClassName:c,rowDetailState:u,width:d,column:f,onMouseLeave:p,onMouseEnter:m,onRowMouseEnter:g,onRowMouseLeave:b,rowIndex:h,rowHeight:y,columnsMap:S,fieldsToColumn:T,domRef:C,hidden:w,showZebraRows:I,getDataSourceState:v,dataSourceApi:D,dataSourceActions:R,getState:P,imperativeApi:A,componentActions:M,getComputed:x,getDataSourceMasterContext:_}=n,E=xy(nt(Pe=>t.subscribeToRowIndex(h,Pe),[t,h]),nt(()=>t.getRowInfoAtIndex(h),[t,h])),L=!E,k=!f,V=Se.useRef(null),W=nt(Pe=>{V.current=Pe,C&&C(Pe)},[C]),O=E??{id:"",indexInAll:h,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:F}=O,J=x(),{activeRowIndex:j,keyboardNavigation:U,columnReorderInPageIndex:ie}=P(),be=h===j&&U==="row",Te={getState:P,getDataSourceState:v,getDataSourceMasterContext:_,actions:M,dataSourceActions:R,api:A,dataSourceApi:D},ce=O.rowDisabled,fe=J.computedVisibleColumns.map(Pe=>Pe.id),me=_d({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:f,rowInfo:O,rowDetailState:u,columnsMap:S,visibleColumnsIds:fe,fieldsToColumn:T,context:Te}),{stylingParam:$,renderParams:G,formattedValueContext:q,renderFunctions:B,groupByColumnReference:ae,inEdit:ne}=me,{align:z,verticalAlign:de}=G,N=G,X=Se.useRef(N),se=g&&m?Pe=>{let jt={...q,rowIndex:h};g(jt,Pe),m(Pe)}:m,ue=b&&p?Pe=>{let at={...q,rowIndex:h,rowInfo:O};b(at,Pe),p(Pe)}:p,De=nt(Pe=>{let at=f.computedVisibleIndex;P().cellClick({rowIndex:h,colIndex:at,event:Pe})},[h,f.computedVisibleIndex,U]),xe=nt(Pe=>{let at=f.computedVisibleIndex;if(P().cellMouseDown({rowIndex:h,colIndex:at,event:Pe}),U==="row"){ce||(M.activeRowIndex=h);return}U==="cell"&&(M.activeCellIndex=[h,at])},[h,ce,f.computedVisibleIndex,U]),{selectionMode:Ve,cellSelection:Fe,isNodeReadOnly:Ne}=e,Ke=N.cellSelected;N.domRef=W,N.htmlElementRef=V,N.toggleCurrentTreeNode=nt(N.toggleCurrentTreeNode,[O]),N.selectCell=nt(N.selectCell,[O]),N.deselectCell=nt(N.deselectCell,[O]),N.selectCurrentRow=nt(N.selectCurrentRow,[O]),N.deselectCurrentRow=nt(N.deselectCurrentRow,[O]),N.toggleCurrentGroupRow=nt(N.toggleCurrentGroupRow,[O]),N.toggleCurrentRowSelection=nt(N.toggleCurrentRowSelection,[O]),N.toggleCurrentGroupRowSelection=nt(N.toggleCurrentGroupRowSelection,[O]),N.toggleCurrentTreeNodeSelection=nt(N.toggleCurrentTreeNodeSelection,[O]);let qe=f.components?.Editor??Ld,Xe=ne?Se.createElement(Vd,{contextValue:N},Se.createElement(qe,null)):null,Ze=nt(lt(()=>{if(w||ne)return null;if(X.current=N,B.renderGroupIcon&&(N.renderBag.groupIcon=Se.createElement(gt,{render:B.renderGroupIcon,renderParam:{...N,renderBag:{...N.renderBag}}})),B.renderSelectionCheckBox&&Ve=="multi-row"&&(N.renderBag.selectionCheckBox=Se.createElement(gt,{render:Oy,renderParam:N}),B.renderSelectionCheckBox!==!0&&(N.renderBag.selectionCheckBox=Se.createElement(gt,{render:B.renderSelectionCheckBox,renderParam:{...N,renderBag:{...N.renderBag}}}))),O.isTreeNode){let{isParentNode:jt}=O,Pt;Pt=(jt?B.renderTreeIconForParentNode:B.renderTreeIconForLeafNode)||typeof B.renderTreeIcon=="function"?B.renderTreeIcon:jt&&B.renderTreeIcon===!0?vl:void 0,Pt===!0?Pt=vl:Pt&&(N.renderBag.treeIcon=Se.createElement(gt,{render:vl,renderParam:N})),Pt&&(N.renderBag.treeIcon=Se.createElement(gt,{render:Pt,renderParam:{...N,renderBag:{...N.renderBag}}}))}B.renderRowDetailIcon&&(N.renderBag.rowDetailsIcon=Se.createElement(gt,{render:Ey,renderParam:{...N,renderBag:{...N.renderBag}}}),typeof B.renderRowDetailIcon=="function"&&(N.renderBag.rowDetailsIcon=Se.createElement(gt,{render:B.renderRowDetailIcon,renderParam:{...N,renderBag:{...N.renderBag}}}))),B.renderValue&&(N.renderBag.value=Se.createElement(gt,{render:B.renderValue,renderParam:{...N,renderBag:{...N.renderBag}}})),O.isGroupRow&&B.renderGroupValue&&(N.renderBag.value=Se.createElement(gt,{render:B.renderGroupValue,renderParam:{...N,renderBag:{...N.renderBag}}})),!O.isGroupRow&&B.renderLeafValue&&(N.renderBag.value=Se.createElement(gt,{render:B.renderLeafValue,renderParam:{...N,renderBag:{...N.renderBag}}})),X.current=N;let Pe=N.renderBag.value;Pe instanceof Date&&(Pe=Pe.toLocaleDateString());let at=Se.createElement(Se.Fragment,null,z!=="end"?N.renderBag.treeIcon:null,z!=="end"?N.renderBag.groupIcon:null,z!=="end"?N.renderBag.rowDetailsIcon:null,z!=="end"?N.renderBag.selectionCheckBox:null,Pe,z==="end"?N.renderBag.selectionCheckBox:null,z==="end"?N.renderBag.rowDetailsIcon:null,z==="end"?N.renderBag.groupIcon:null,z==="end"?N.renderBag.treeIcon:null);return f.render?Se.createElement(gt,{render:f.render,renderParam:{...N,renderBag:{...N.renderBag,all:at}}}):at}),[f,w,ne,u,f.renderTreeIcon||f.renderTreeIconForParentNode?Ne:!1,...kd(N,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),K=J.computedVisibleColumns.map(Pe=>Pe.id),re=J.computedColumnOrder,le={...q,visibleColumnIds:K,allColumnIds:re,rowIndex:h,rowHasSelectedCells:!1};Object.defineProperty(le,"rowHasSelectedCells",{get(){return O.hasSelectedCells(K)}});let he=O.isTreeNode&&(f.renderTreeIcon||f.renderTreeIconForLeafNode||f.renderTreeIconForParentNode),$e=typeof r=="function"?r(le):r,oe;ae?.className&&(oe=Dl(ae.className,$)),c&&(oe=Q(oe,Dl(c,$))),f.className&&(oe=Q(oe,Dl(f.className,$))),he&&(oe=Q(oe,Cd({align:z})));let H;O.dataSourceHasGrouping&&f.groupByForColumn&&(H=wd({rowInfo:O})),he&&(H=Ay({rowInfo:O})),o&&(H=typeof o=="function"?{...H,...o(le)}:{...H,...o}),s&&(H=xl(H,s,$)),ae?.style&&(H=xl(H,ae.style,$)),f.style&&(H=xl(H,f.style,$)),H=H||{},H.height=y,H.zIndex=`var(${Py}-${f.computedVisibleIndex})`,H.visibility=`var(${My}-${f.computedVisibleIndex}, visible)`;let et=Dy(()=>H,[H?JSON.stringify(H):null]),Ce=i!=null?i%2===1:(O.indexInAll!=null?O.indexInAll:h)%2===1,tt=I?Ce?"odd":"even":!1,ht=!1,xt=!1,Nn=!1,Jo=!1;if(Fe&&Ke){let Pe=l(),at=Pe[O.indexInAll-1],jt=Pe[O.indexInAll+1],Pt=J.computedVisibleColumns[f.computedVisibleIndex+1],kn=J.computedVisibleColumns[f.computedVisibleIndex-1];ht=at?!Fe.isCellSelected(at.id,f.id):!0,f.computedPinned==="end"&&f.computedFirstInCategory?xt=!0:xt=kn?!Fe.isCellSelected(O.id,kn.id):!0,f.computedPinned==="start"&&f.computedLastInCategory?Nn=!0:Nn=Pt?!Fe.isCellSelected(O.id,Pt.id):!0,Jo=jt?!Fe.isCellSelected(jt.id,f.id):!0}let Ln=Fe&&Ke?{top:ht,left:xt,right:Nn,bottom:Jo}:null,wa=ie!=null?a!==ie:!1,Ia=Xe,Ra=Ze(),it={domRef:W,cellType:"body",column:f,width:d,rowId:O.id,horizontalLayoutPageIndex:a,style:et,onMouseLeave:ue,onMouseEnter:se,onClick:De,afterChildren:Ia,onMouseDown:xe,cssEllipsis:f.cssEllipsis??!0,className:Q(Ln?xd(Ln):"",qr(f,[Gt,Go],Dd,{dragging:!1,insideDisabledDraggingPage:wa,zebra:tt,align:z,verticalAlign:de,rowDisabled:ce,rowActive:be,cellSelected:Ke,rowSelected:F,treeNode:O.isTreeNode?O.isParentNode?"parent":"leaf":!1,firstRow:O.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:O.isGroupRow,groupCell:O.isGroupRow?!!f.groupByForColumn:!1,rowExpanded:O.isGroupRow?!O.collapsed:!1}),oe,$e),renderChildren:nt(()=>Ra,[Ze])},Dr=Jn.Provider;return k||L?Se.createElement("div",{ref:W,style:{display:"none"}}):Se.createElement(Dr,{value:X.current},Se.createElement(ai,{...it}))}var zd=Se.memo(Fy);function li(){return vy(Jn)}function Rl(){let{api:n,editingValueRef:e,editingCell:t}=te(p=>({api:p.api,editingCell:p.state.editingCell,editingValueRef:p.state.editingValueRef})),{column:o,rowInfo:r}=li(),[i]=Se.useState(()=>t?.value),[a,l]=Se.useState(i),s=t?!t.active&&!!t.waiting:!1,c=Se.useCallback(p=>{e.current=p,l(p)},[]);Se.useLayoutEffect(()=>{e.current=i},[]);let u=n.confirmEdit,d=n.cancelEdit,f=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:f}}function er(n){return n.render(n.renderParam)??null}function gt(n){let e=Jn.Provider;return hn.createElement(e,{value:n.renderParam},hn.createElement(er,{render:n.render,renderParam:n.renderParam}))}function Vd(n){let e=Jn.Provider;return hn.createElement(e,{value:n.contextValue},n.children)}function go(n){let e=si.Provider;return hn.createElement(e,{value:n.renderParam},hn.createElement(er,{render:n.render,renderParam:n.renderParam}))}import*as ho from"react";var Ny={width:"100%",pointerEvents:"none"},Pl=`${bt}-menu`,Ml=Vr({"data-name":""}),Al={[Ml["data-name"]]:"menu-icon"};function tr(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...Ny,borderTop:`${pe.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return ho.createElement("div",{...o,style:e,...Al,onPointerDown:s=>s.stopPropagation(),className:Q(t,su({menuVisible:i,reserveSpaceWhenHidden:r}),bt,`${bt}-menu`)},a??ho.createElement(ho.Fragment,null,ho.createElement("div",{className:Pl,style:l}),ho.createElement("div",{className:Pl,style:l}),ho.createElement("div",{className:Pl,style:l})))}import*as bn from"react";import{useEffect as Ly,useState as Hd}from"react";var Gd="_1ek6mqy0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var ky={transition:"width 0.25s, opacity 0.25s"};function ci(n){let[e,t]=Hd(!0),[o,r]=Hd(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=n,u=c!=null&&c>0,d=n.size??16,f=Math.floor(d/4),p=i?[d-3*f,d-2*f,d-f]:[0,0,0];i===-1&&p.reverse();let m={...ky,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};Ly(()=>{let h=i!=0?1:0;if(!e&&h&&t(!0),h!==o){let y=requestAnimationFrame(()=>{r(h)});return()=>{cancelAnimationFrame(y)}}return()=>{}},[i,e]);let g=()=>{let y=!(o===0&&i===0);y!==e&&t(y)};if(!e&&!n.forceSize)return null;let b={};return i===-1&&(b.top="100%"),bn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:Q(s,bt,Gd,`${bt}-sort`)},u?bn.createElement("div",{"data-name":"index",style:b,className:du},c):null,bn.createElement("div",{style:{width:p[0],...m},onTransitionEnd:g}),bn.createElement("div",{style:{width:p[1],...m}}),bn.createElement("div",{style:{width:p[2],...m}}))}import*as Ud from"react";import{useCallback as $d}from"react";import{useRef as Wd,useState as zy}from"react";import*as or from"react";function Kd(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){we.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;we.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?dl(l,i,o.current):we.columnOffsets.set(a,l.computedOffset+i,o.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let c=e[l];if(c.computedPinned==="start"){dl(c,i,o.current);continue}c.computedPinned!=="end"&&we.columnOffsets.set(l,c.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||we.columnOffsets.set(l,c.computedOffset+i,o.current)}}}}}function Bd(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,c=i.current;if(o.forEach((u,d)=>{s+=u;let f=n[d],p=r[f],m=p.computedWidth+u;we.columnWidths.set(f,m,c),p.computedPinned!=="end"&&(l&&we.columnOffsets.set(f,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&we.columnOffsets.set(u,d.computedOffset+s,c)}}}}var ui="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",di=ge({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw23 _16lm1iw2a",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0,computedFirstInCategory:!1},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0,computedLastInCategory:!1},"zneyzhn"]]}),fi=ge({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw26 _16lm1iw2e",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:Vy}=Le,Gy=`${Vy}HeaderCell_ResizeHandle`;function Hy(n){let{brain:e,headerBrain:t}=te(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),o=Wd(null),[r,i]=zy(!1),a=Wd(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,f=()=>{},p=g=>{g.stopPropagation();let b=!!g.shiftKey,h=g.pointerId,y=g.clientX,S=g.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),D=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});f=()=>{v(),D()}}S.setPointerCapture(h);let T=Kd(n.columnIndex,{columns:n.columns,shareSpaceOnResize:b,domRef:o}),C=(v,{done:D}={})=>{s&&(v=v/(s+1),D&&(v=Math.round(v))),c==="end"&&(v*=-1);let{adjustedDiff:R,constrained:P}=n.computeResize({diff:v,shareSpaceOnResize:b});return a.current!==P&&i(P),T.resize(R),R},w=v=>{C(Math.round(v.clientX-y))},I=v=>{S.releasePointerCapture(h),S.removeEventListener("pointermove",w),S.removeEventListener("pointerup",I);let D=Math.round(v.clientX-y),R=C(D,{done:!0});f(),n.onResize({diff:R,shareSpaceOnResize:b})};S.addEventListener("pointermove",w),S.addEventListener("pointerup",I)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return or.createElement("div",{ref:o,className:`${Gy} ${ui} ${fi({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:p},or.createElement("div",{style:m,className:di({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var jd=or.memo(Hy);function Yd(n,e){let{computedVisibleColumns:t,getState:o,getComputed:r,actions:i}=te(c=>({computedVisibleColumns:c.computed.computedVisibleColumns,getState:c.getState,getComputed:c.getComputed,actions:c.actions})),a=$d(({diff:c,shareSpaceOnResize:u})=>{let d=o(),{columnSizing:f,viewportReservedWidth:p,bodySize:m}=d,g=r().computedVisibleColumns,b=!1,h=g.reduce((T,C)=>(C.computedFlex&&(T[C.id]={...f[C.id],flex:C.computedWidth},b=!0),T),{}),y=b?{...f,...h}:f;return tl({shareSpaceOnResize:u,availableSize:m.width,reservedWidth:p||0,dragHandleOffset:c,dragHandlePositionAfter:n.computedVisibleIndex,columnSizing:y,items:g.map(T=>({id:T.id,computedFlex:T.computedFlex,computedWidth:T.computedWidth,computedMinWidth:T.computedMinWidth,computedMaxWidth:T.computedMaxWidth}))})},[n,o,r]),l=$d(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:f}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=f),i.columnSizing=d},[a,i]);return n.computedResizable?Ud.createElement(jd,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}import*as rt from"react";import{useCallback as El,useEffect as _l}from"react";var qd=ge({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Xd=ge({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Zd(n,e){return pt(n,e)}var pi=class extends No{constructor(t){super();this.dragIndex=-1;this.breakpoints=[];this.activeDragSourcePosition="outside";this.previousAcceptsDropResult=!0;this.setData(t)}get listId(){return this.data.listId}setData(t){return Zd(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Zd(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let o=!0;return typeof this.data.shouldAcceptDrop=="function"&&(o=this.data.shouldAcceptDrop(t)),o=!!o,o!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=o,o?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),o}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let o=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>o||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=o?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:o,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(p,m)=>m),d=[];o===-1?d=u.filter(p=>p!==r):d=Fo(u,r,o>r?o-1:o);let f={dragIndex:r,dropIndex:o,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",f)}};var Jd=rt.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),nr=()=>rt.useContext(Jd),Ky=n=>{let{node:e,offset:t}=n;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},By=n=>`${n.getAttribute(bo)}`;function Wy(n){let e=n.current?.querySelectorAll(mi)??[];return!e||e.length,Array.from(e).map(o=>{let r=By(o),i=o.getBoundingClientRect();return{id:r,rect:i}})}function jy(n){let{domRef:e,orientation:t,dragListId:o}=n,r=Re.from(e.current.getBoundingClientRect());return{draggableItems:Wy(e),orientation:t,listId:o,listRectangle:r,acceptDropsFrom:n.acceptDropsFrom,shouldAcceptDrop:n.shouldAcceptDrop,initial:n.initial}}function ef(n){return new pi(jy(n))}function $y(n,e){let t=_e(e),[o,r]=rt.useState(null),i=El(l=>{if(l)yt.registerDragInteractionTarget(l);else{let s=a();s&&yt.unregisterDragInteractionTarget(s)}r(l)},[]),a=_e(o);return _l(()=>yt.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),f=l.getData();if(f.initial&&f.listId!==s&&c?.includes(f.listId)){let p=ef({domRef:n,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(p)}}),[t]),{interactionTarget:o,setInteractionTarget:i,getInteractionTarget:a}}var Ko=n=>{let e=rt.useRef(null),{dropTargetListId:t,dragSourceListId:o}=Lo(),{updateDragOperationSourceAndTarget:r,dragItemId:i,status:a}=Lo(),l=_e(n.onDrop),s=_e(n.onAcceptDrop),c=_e(n.onRemove),u=_e(n.updatePosition??Ky),{interactionTarget:d,setInteractionTarget:f}=$y(e,n);_l(()=>{let T=document.querySelector(`[${Qd}="${n.dragListId}"]`);T?e.current=T:console.warn(`DragList with id "${n.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[n.dragListId]),_l(()=>{if(d){let T=n.dragListId,C=d.on("start",({dragItem:v,dragSourceListId:D,dropTargetListId:R})=>{r({dragSourceListId:D,dropTargetListId:R,dragItemId:v.id,status:"accepted"})}),w=d.on("move",({offsetsForItems:v,items:D,status:R})=>{if(R==="rejected")return;let P=m(),A=u();D.forEach((M,x)=>{let _=v[x],E=P[x];E&&A({id:M.id,node:E,offset:_})})}),I=d.on("drop",v=>{let{sortedIndexes:D,dragIndex:R,dropIndex:P,dragItem:A,items:M,dragSourceListId:x,dropTargetListId:_,outside:E,status:L}=v,k=m();p.current=[];let V=s(),W=c(),O=l(),F=u();M.forEach((U,ie)=>{let be=k[ie];be&&F({id:U.id,node:be,offset:null})}),T===_&&x!==T&&V&&L==="accepted"&&V({dragItemId:A.id,dragSourceListId:x,dropTargetListId:_,dragIndex:R,dropIndex:P,dropItemId:M[P]?.id});let j=null;P===-1&&x===T&&_===T&&E&&(j=W),P!==-1&&_===T&&x===T&&(j=O),j&&j?.(D,{dragIndex:R,dropIndex:P,dragItemId:M[R].id,dropItemId:M[P]?.id})});return()=>{C(),w(),I()}}},[d,n.dragListId]);let p=rt.useRef([]),m=El(()=>{let T=p.current;return(!T||T.length===0)&&(T=Array.from(e.current?.querySelectorAll(mi)??[]),p.current=T),T},[]),g=El(T=>{let C=T.currentTarget,w=C.getAttribute(bo);if(w==null){let E=po(C,mi);E&&(w=E.getAttribute(bo))}if(w==null){console.warn("Could not find drag item id for element",C,`Make sure you have a parent element with a ${bo} attribute`);return}w=`${w}`;let I=null,v=Array.from(e.current?.querySelectorAll(mi)??[]);p.current=v;let D=ef({domRef:e,orientation:n.orientation,dragListId:n.dragListId,acceptDropsFrom:n.acceptDropsFrom,initial:!0}),R=D.getData().draggableItems,P=R.findIndex(E=>E.id===w),A=R[P];f(D);let M={left:T.clientX,top:T.clientY},x=E=>{I||(I=yt.startDrag({listId:n.dragListId,dragItem:A,dragIndex:P},M)),I.move({left:E.clientX,top:E.clientY})},_=()=>{if(Me().removeEventListener("pointermove",x),!I){f(null);return}I.drop(),I=null};Me().addEventListener("pointermove",x),Me().addEventListener("pointerup",_,{once:!0})},[n.orientation,n.dragListId,n.acceptDropsFrom,n.removeOnDropOutside]),b=!!i,h=rt.useMemo(()=>({dragItemId:i,onDragItemPointerDown:g,dragSourceListId:o,dropTargetListId:t,status:a,dragListId:n.dragListId,draggingInProgress:b}),[i,g,b,o,t,n.dragListId]),y={className:Q("DragList",b?"DragList--dragging":"",qd({dragging:b})),[Qd]:n.dragListId},S=typeof n.children=="function"?n.children(y,h):n.children;return rt.createElement(Jd.Provider,{value:h},S)},Qd="data-drag-list-id",bo="data-drag-item-id",mi=`[${bo}]`,Uy=rt.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),Yy=n=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:o,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=nr(),l=i===o&&r===`${n.id}`,s=rt.useMemo(()=>({dragItemId:n.id,active:l,dragListId:o,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[n.id,l,t,i,a]),c={"data-drag-item-id":`${n.id}`,onPointerDown:e,className:Q("DraggableItem",l?"DraggableItem--active":"",Xd({active:l,draggingInProgress:t}))},u=typeof n.children=="function"?n.children(c,s):n.children;return rt.createElement(Uy.Provider,{value:s},u)};Ko.DraggableItem=Yy;import*as Ol from"react";var tf=n=>Ol.createElement(ke,{...n,viewBox:"0 -960 960 960"},Ol.createElement("path",{d:"m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"}));import*as ur from"react";function of(){return{}}var nf=n=>({allowColumnHideWhileDragging:e=>e??!0});import{createContext as qy}from"react";var Xy=qy(null);function Fl(){return Xy}import*as Ot from"react";import*as jo from"react";import{useCallback as _f,useEffect as jl,useRef as RS,useState as vS}from"react";import*as gi from"react";function Zy(n){let{height:e,width:t,count:o}=n;return gi.createElement("div",{"data-count":o,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var rf=gi.memo(Zy);var af="mlx2t3";import*as hi from"react";import{useRef as Jy}from"react";import{useEffect as Qy}from"react";var lf=(n,e)=>{Qy(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var sf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},cf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},uf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Nl="_1ueijco1",df="_1ueijco0 _16lm1iw0";var ff=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=sf[`${n}`]:e=Q(cf[`${n.horizontal}`],uf[`${n.vertical}`]),e};var eS="InfiniteVirtualScrollContainer";var pf=hi.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??Jy(null);return lf(u,i),hi.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:Q(a,eS,df,ff(r))},o)});import*as vi from"react";import{useLayoutEffect as Wl,useMemo as aS}from"react";import*as hf from"react";import{useLayoutEffect as mf,useRef as gf,useState as tS}from"react";function oS(n){let[e,t]=tS(n.updater.get),o=gf(null),r=gf(n.afterCommit);return r.current=n.afterCommit,mf(()=>{function i(l){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(l)})):t(l)}let a=n.updater.onChange(i);return()=>{o.current!=null&&cancelAnimationFrame(o.current),a()}},[n.updater,n.useraf]),mf(()=>{r.current?.()}),e??null}var yo=hf.memo(oS);var bf=en(Oo());var Ll=(n,e)=>n-e,Xt={horizontal:!0,vertical:!0};function bi(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var kl="DebugID=";function So(n,e){return e&&e.startsWith(kl)?e:e?`${kl}${n}:${e}`:`${kl}${n}`}var yi={start:0,end:0},zl=n=>{n()},Vl=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},yf=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},rr=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function nS(n){return n.horizontalChange||n.verticalChange}var Bo=class extends ft{constructor(t){let o=So(t,`${t}:MatrixBrain`);super(o);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=yi;this.verticalExtendRangeBy=yi;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{rr(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?zl:rr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?zl:rr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=this.getColWidth(u);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let c=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:o}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=this.getRowHeight(u);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let c=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=Xt)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=Xt)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.startIndex,s=t.startIndex,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let f=l;for(;d[f]!=f;)f--;a.push([f,u])}}}if(r){let l=t.startIndex,s=o.startIndex,c=o.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let f=l;for(;d[f]!=f;)f--;a.push([u,f])}}}return a};this.computeRenderRange=(t=Xt)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof o!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,f=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),f&&(r+=f);let p=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return p>m&&(p=m,u=Math.max(a,p-r)),{startIndex:u,endIndex:p}};this.getItemAt=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,o),d=u,u=a[c],d===u&&d!=0))return i-1;let f=(0,bf.default)(a,t,Ll);return f>=0?f:~f-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],c=i[t-1];s==null&&console.error(`Offset was not available for ${o==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),f=u.get(a);if(d[i]===void 0){let p=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:o};for(;p<=m;p++)if(d[p]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=p;let b=s(g);d[p]=p,f[p]=b;let h=p;for(;b>1;)h+=1,d[h]=p,f[h]=0,b-=1}}};this.getCellSpan=(t,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,c=Math.min(t,r-1);for(;s<=c;s++)this.computeCacheFor(s,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Vl;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=o,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=Xt){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",f=u&&s!==this.availableWidth,p=d&&c!==this.availableHeight;f&&(this.availableWidth=s,this.availableRenderWidth=s),p&&(this.availableHeight=c,this.availableRenderHeight=c),(f||p)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",b=m&&r!==this.rows,h=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let y=a!=null,S=l!=null,T=y&&a!==this.rowHeight,C=S&&l!==this.colWidth;y&&(this.rowHeight=a),S&&(this.colWidth=l);let w=t.rowspan!=null,I=t.colspan!=null,v=w&&t.rowspan!=this.rowspan,D=I&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),D&&(this.colspan=t.colspan);let R=h||C||f||D,P=b||T||p||v;(o||nS)({horizontalChange:R,verticalChange:P,colsChanged:h,colWidthChanged:C,widthChanged:f,colspanChanged:D,rowsChanged:b,rowHeightChanged:T,heightChanged:p,rowspanChanged:v})&&this.updateRenderCount({horizontal:R,vertical:P})}extendRenderRange(t){let{direction:o}=t,r=o==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:o})}}updateRenderCount(t=Xt){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=Xt){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?zl:rr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof o=="function"){let u=[],d=0,f=r;d+=s,f-=c;for(let p=d;p<f;p++)u.push(this.getItemSize(p,t));a=bi(l,u)}else a=(o?Math.ceil(l/o):0)+1;return a+=s+c,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{rr(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let o=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=yi,this.verticalExtendRangeBy=yi,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Hl=en(Oo());function Sf(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function Tf(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function ir(n,e){for(let t of n)if(e(t))return t}import*as wf from"react";var Cf=new Map,rS=()=>{},Gl=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=ye();this.afterCommit=()=>{if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}};let o=Cf.get(e)??0,r=`${e}:GridCellReact:${o}`;Cf.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=ye(),this.node=wf.createElement(yo,{key:r,name:r,updater:this.updater,afterCommit:this.afterCommit}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=rS,this.element=null,this.node=null}getNode(){return this.node}update(e,t){this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},yn=class yn extends ft{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=ye();this.cellAttachmentChangeSubscription=ye();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=new Gl(this.debugId);return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,o=t.values().next().value;return o||(this.poolSize+=yn.POOL_SIZE_INCREMENT,o=t.values().next().value),o||this.error("No cells available in the pool!"),o}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}set poolSize(t){t=Math.ceil(t/yn.POOL_SIZE_INCREMENT)*yn.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};yn.POOL_SIZE_INCREMENT=1;var Si=yn;var Ti=(n,e)=>n-e,Ci=class extends ft{constructor(t){super(`${t}:GridCellManager`);this.matrix=new ee;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[f,p]=d,m=f<i,g=f>=l,b=p<a,h=p>=s;(m||g||b||h)&&c.add(u)}),c};this.debugId=t,this.pool=new Si(t),this.offRemoveCell=this.pool.onRemoveCell(o=>this.onRemoveCell(o))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=ir(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=ir(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+1},(s,c)=>{let u=[a,c],d=this.getCellAt(u);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Ti)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Ti)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((o,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,Hl.default)(o,t,Ti);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,Hl.default)(o,t,Ti);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>o&&this.detachCellAt(a),l===o&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return ir(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return ir(t,r=>this.getCellPosition(r)?.[1]===o)}getCellCountInMatrix(){return this.matrix.size}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var vf=en(Oo());import*as Rf from"react";var If=new Map,iS=()=>{},Kl=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=ye();let t=If.get(e)??0,o=`${e}:ListRowReact:${t}`;If.set(e,t+1),this.debugId=o,this.updater=ye(),this.node=Rf.createElement(yo,{key:`detail-row-${o}`,name:`detail-row-${o}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=iS,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Sn=class Sn extends ft{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=ye();this.rowAttachmentChangeSubscription=ye();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=new Kl(this.debugId);return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,o=t.values().next().value;return o||(this.poolSize+=Sn.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/Sn.POOL_SIZE_INCREMENT)*Sn.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};Sn.POOL_SIZE_INCREMENT=1;var wi=Sn;var Ii=class extends ft{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new wi(t),this.offRemoveRow=this.pool.onRemoveRow(o=>this.onRemoveRow(o))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,vf.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Df=!0,Wo=Z(Y.y),xf=Z(Y.scrollTop),C_=Z(Y.columnOffsetAtIndex),Bl=Z(Y.columnOffsetAtIndexWhileReordering),Tn=class extends ft{constructor(t,o){o=o||"ReactHeadlessTableRenderer";super(o);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,o,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(Wo,i?`calc( ${r}px + var(${xf}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${Wo}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=we.columnOffsets.get(r),d=`${Bl}-${r}`,f=s?`calc( ${a}px + var(${xf}) )`:`${a}px`;t.__currentTransformY!==f&&(t.__currentTransformY=f,t.style.setProperty(Wo,f));let p=`translate3d(var(${d}, ${u}), var(${Wo}), 0)`;t.__transformValue!==p&&(t.__transformValue=p,t.style.transform=p),c!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),f=r.getFixedEndRowsHeight(),p=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=p+m.height;l||(l=c>g-f?"end":c<p+d?"start":"end");let b=i.scrollTop;if(l==="center"?b=c-Math.floor((r.getAvailableSize().height-d-f)/2):l==="start"?(s=-s,b+=c-p+s-d):(s+=u,b+=c-g+s+f),this.brain.isHorizontalLayoutBrain){let h=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(h,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:b}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let c=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),f=r.getFixedStartColsWidth(),p=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=p+m.width;l||(l=c>g-f?"end":c<p+d?"start":"end");let b=i.scrollLeft;return l==="center"?b=c-Math.floor((r.getAvailableSize().width-d-f)/2):l==="start"?(s=-s,b+=c-p+s-d):(s+=u,b+=c-g+s+f),{...i,scrollLeft:b}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let c=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-o,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,c]}=i.getRenderRange();if(t<l||t>=c)return!1;let u=Math.floor((l+c)/2);if(t>=u){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,f]=c,[p,m]=u,g=[];if(i&&(o&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[p,i]})),a&&(o&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[p,l]})),o){let b={start:[0,f],end:[o,m],rowFixed:"start",colFixed:!1};g.push(b)}if(r){let b={rowFixed:"end",colFixed:!1,start:[s-r,f],end:[s,m]};g.push(b)}return g};this.isCellFixed=(t,o)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,f=!1;if(t<r&&(u=!0,f="start"),i&&!u){let p=c-i;t>=p&&(u=!0,f="end")}if(o<a&&(d=!0,f="start"),l&&!d){let p=s-l;o>=p&&(d=!0,f="end")}return{row:u?f:!1,col:d?f:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(o)};this.onMouseLeaveNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(o)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};ze(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:c,y:u}=s;if(r){let d=()=>{this.updateHoverClassNamesForRow(a);let f=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=f.rowIndex,r.dataset.colIndex=f.colIndex,Df){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let m=(o?o.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==m&&(r.__zIndex=m,r.style.zIndex=m)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?t.setPendingAfterCommitWork(d):d()}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let o=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;o&&(o.dataset.detailRowIndex=r,Df&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:o,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:c,fixedRowsStart:u,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(x=>{let _=i.getRowIndex(x);if(_!=null){let E=this.brain.getItemOffsetFor(_,"vertical");if(E==null)return;let L=x.getElement();if(!L)return;this.setDetailTransform(L,_,{y:E,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let f=this.cellManager.getOneAttachedCell();f&&Nu(t,this.getInfiniteNode(f.getElement()));let p=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:b}=this.brain.getRenderRange(),[h,y]=g,[S,T]=b;function C(x,_,E){let L=r.getCellAt([x,_]);if(L==null)return;let k=o.getCellOffset(x,_),V=L.getElement();V&&k&&E(x,_,V,k)}let w=(x,_,E,{x:L,y:k})=>{this.setTransform(E,x,_,{x:L,y:k,scrollLeft:!0},s-_)},I=(x,_,E,L)=>{this.setTransform(E,x,_,{x:L.x,y:L.y,scrollTop:!0},u-x)},v=(x,_,E,{y:L})=>{let k=p[_];this.setTransform(E,x,_,{x:k,y:L,scrollLeft:!0},a-_)},D=(x,_,E,L)=>{this.setTransform(E,x,_,{x:L.x,y:m[x],scrollTop:!0},l-x)},R=(x,_,E,{x:L,y:k})=>{this.setTransform(E,x,_,{x:L,scrollLeft:!0,y:k,scrollTop:!0},1e5)},P=(x,_,E,{x:L})=>{this.setTransform(E,x,_,{x:L,scrollLeft:!0,y:m[x],scrollTop:!0},2e5)},A=(x,_,E,L)=>{this.setTransform(E,x,_,{x:p[_],y:L.y,scrollLeft:!0,scrollTop:!0},3e5)},M=(x,_,E)=>{this.setTransform(E,x,_,{x:p[_],y:m[x],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let x=h;x<S;x++){for(let _=0;_<s;_++)C(x,_,w);if(c){let _=a-c;for(let E=_;E<a;E++)C(x,E,v)}}if(u||d)for(let x=y;x<T;x++){for(let _=0;_<u;_++)C(_,x,I);if(d){let _=l-d;for(let E=_;E<l;E++)C(E,x,D)}}if(s&&u)for(let x=0;x<u;x++)for(let _=0;_<s;_++)C(x,_,R);if(s&&d){let x=l-d;for(let _=x;_<l;_++)for(let E=0;E<s;E++)C(_,E,P)}if(c&&u){let x=a-c;for(let _=0;_<u;_++)for(let E=x;E<a;E++)C(_,E,A)}if(c&&d){let x=l-d,_=a-c;for(let E=x;E<l;E++)for(let L=_;L<a;L++)C(E,L,M)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=o,this.cellManager=new Ci(o),this.cellManager.onCellAttachmentChange((s,c)=>{c?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new Ii(o),this.rowManager.onRowAttachmentChange((s,c)=>{c?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),ze(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),a=t.onScrollStart(this.onScrollStart),l=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),i(),a(),l()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=cl(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:o,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,f=this.getFixedRanges(t),p=[t,...f],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let R=t.start[1],P=t.end[1];m.forEach(A=>{R<=A&&A<P||p.push({start:[t.start[0],A],end:[t.end[0],A+1]})})}let g=new Map,b=p.map(this.getExtraSpanCellsForRange).flat();b&&b.forEach(([R,P])=>{g.set(`${R}:${P}`,!0)});let h=p.reduce((R,P)=>R+Vl(P),0),y=r?p.reduce((R,P)=>R+yf(P),0):0,S=this.brain.getRowCount(),T=this.brain.getColCount();d.detachCellsStartingAt([S,T]);let C=Math.min(S*T,h);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>y&&(u.poolSize=y));let w=Sf(...p.map(R=>d.getCellsOutsideRenderRange(R)));w=Tf(w,R=>{let P=d.getCellPosition(R);return!(P&&g.has(`${P[0]}:${P[1]}`))}),d.detachCells(w),d.poolSize=C;let I=new Map,v=new Map;p.forEach(R=>{let{start:P,end:A}=R,[M,x]=P,[_,E]=A;for(let L=M;L<_;L++){for(let V=x;V<E;V++){let W=`${L}:${V}`;if(I.has(W))continue;I.set(W,!0);let{rendered:O,mapped:F}=this.isCellRenderedAndMappedCorrectly(L,V);if(L===M||V===x){let j=this.isCellCovered(L,V);if(j&&g.has(`${j[0]}:${j[1]}`)){let U=d.getCellAt([L,V]);U!=null&&d.detachCell(U);continue}}if(O&&!i&&F)continue;let J;O?J=d.getCellAt([L,V]):J=d.getCellFor([L,V],c?"row":"column"),J==null&&(J=d.getDetachedCell()),this.renderCellAt(L,V,J,o)}!r||v.has(L)||(v.set(L,!0),u.isRowAttachedAt(L)&&!i)||this.renderDetailRowAtElement(L,this.rowManager.getRowFor(L),r)}}),b.forEach(([R,P])=>{let{rendered:A,mapped:M}=this.isCellRenderedAndMappedCorrectly(R,P);if(A){if(i||!M){let _=[R,P],E=d.getCellAt(_);this.renderCellAt(R,P,E,o)}return}let x=d.getCellFor([R,P],c?"row":"column");x!=null&&this.renderCellAt(R,P,x,o)});let D=d.getAllCells().map(R=>R.getNode());return r&&u.getAllRows().forEach(R=>{D.push(R.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(D),D}renderDetailRowAtElement(t,o,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:o.ref});if(o.isMounted()||o.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(c,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}getMatrixRowIndexFromElement(t){let o=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(o):o}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),c=this.brain.getRowspan(t,o),u=this.brain.getColspan(t,o),d=c===1?l:this.brain.getRowHeightWithSpan(t,o,c),f=u===1?s:this.brain.getColWidthWithSpan(t,o,u),{row:p,col:m}=this.isCellFixed(t,o),g=!!a,{rowIndex:b,colIndex:h}=this.getCellRealCoordinates(t,o),y=i({rowIndex:b,colIndex:h,height:l,width:s,rowspan:c,colspan:u,rowFixed:p,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(C=>{let w=C.getElement();w&&(w.style.position="absolute",w.style.left="0px",w.style.top="0px"),this.updateElementPosition(C)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:b,renderColIndex:h}:void 0,T=this.brain.isHorizontalLayoutBrain;if(!y){T?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(y,r,[t,o],S),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Ri=class extends Tn{constructor(t,o){super(t,o);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=pe.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",f=we.columnOffsets.get(l.colIndex),p=`${Bl}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(Wo,m));let g=`calc(var(${p}, ${f}) + ${d})`,b=`var(${Wo})`,h=`translate3d(${g}, ${b}, 0px)`;t.__transformValue!==h&&(t.__transformValue=h,t.style.transform=h)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function ar(n){let e=n.isHorizontalLayoutBrain?new Ri(n,`${n.name}:HorizontalLayoutTableRenderer`):new Tn(n,`${n.name}:ReactHeadlessTableRenderer`),t=ye();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function lS(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=aS(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:ar(e),[e,n.onRenderUpdater,n.renderer]);return Wl(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),Wl(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),Wl(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:o})})},[i,e,t,o,a,r]),vi.createElement(yo,{updater:a})}var Di=vi.memo(lS);import*as lr from"react";import{useEffect as sS,useLayoutEffect as cS,useRef as uS}from"react";var Pf=ge({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),xi="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Mf=ge({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:dS}=Le,fS=`${dS}-ActiveRowIndicator`,pS=`calc(${Y.activeCellRowOffsetX} + var(${Z(Y.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,mS={[Z(Y.activeCellOffsetY)]:Y.activeCellRowOffset,transform:`translate3d(${pS}, calc( ${Y.activeCellOffsetY} + var(${Z(Y.scrollTopForActiveRow)}, 0px)), 0px)`,height:Y.activeCellRowHeight,maxWidth:pe.runtime.totalVisibleColumnsWidthVar},gS=n=>{let{brain:e}=n,t=uS(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=kt();return cS(()=>{if(n.activeRowIndex==null)return;let a="0px",l=n.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let f=e.getPageIndexForRow(l);f>0&&(a=`calc(${pe.runtime.totalVisibleColumnsWidthVar} * ${f})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),c=e.getItemOffsetFor(l,"vertical"),u=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`,activeCellRowOffsetX:a};un(d,u)},[n.activeRowIndex,e]),sS(()=>{let a=c=>{un({scrollTopForActiveRow:`${-c.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-c.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),lr.createElement("div",{className:xi,"data-name":"active-row"},lr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${fS} ${Mf({active:o})}`,style:o?mS:void 0}))},Af=lr.memo(gS);import*as sr from"react";import{useEffect as hS,useLayoutEffect as bS,useRef as yS}from"react";var{rootClassName:SS}=Le,TS=`${SS}-ActiveCellIndicator`,CS=Z(Y.columnZIndexAtIndex),wS=(n,e,t,o)=>{if(e==null)return;let[r]=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(r=r%n.rowsPerPage);let i=typeof t=="function"?t(r):t??n.getRowHeight(r),a=n.getItemOffsetFor(r,"vertical"),l=o.current;un({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},IS=n=>{let{brain:e}=n,[t,o]=kt(),r=yS(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];return bS(()=>{wS(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]),hS(()=>{let a=e.onRenderCountChange(()=>{o()});return()=>{a()}},[e]),sr.createElement("div",{className:xi,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${CS}-${n.activeCellIndex[1]})`}:void 0},sr.createElement("div",{"data-name":"active-cell-indicator",className:`${TS} ${Pf({visible:i})}`}))},Ef=sr.memo(IS);var Pi=[Pd,`${st}DetachedCell`];function Mi(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var DS=Q(af,Nl);function Of(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:f,forceRerenderTimestamp:p,scrollVarHostRef:m,...g}=n,{autoFocus:b}=g,h=RS(null),[y,S]=vS({width:0,height:0});jl(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),jl(()=>{let w=h.current?.parentNode;return w?(b&&document.activeElement!==w&&w.focus(),Kn(w,()=>{let D={height:w.clientHeight,width:w.clientWidth};e.update(D)},{debounce:50})):void 0},[f,e]);let T=_f(w=>{requestAnimationFrame(()=>{h.current&&h.current.style.setProperty("transform",`translate3d(${-w.scrollLeft}px, ${-w.scrollTop}px, 0px)`)})},[]),C=_f(w=>{e.setScrollPosition(w,T)},[e,T]);return jl(()=>{let w=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),T(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),w},[e]),jo.createElement(pf,{onContainerScroll:C,...g,ref:t},jo.createElement("div",{ref:h,className:DS,"data-name":"scroll-transform-target"},jo.createElement(Di,{forceRerenderTimestamp:p,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:Pi}),u!=null?jo.createElement(Ef,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?jo.createElement(Af,{brain:e,activeRowIndex:c}):null,jo.createElement(rf,{width:y.width,height:y.height}))}function Ff(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((u,d)=>{let f=u.id,p=n[d-1],m=p?.id??"",g=new Set,b=p?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(f,g);let h={type:"column",id:f,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([f],h);let y=u.columnGroup,S,T=h;for(;y;){let C=e[y];if(C){g.add(y);let w=[f,...g];S=b.has(y)?i.get(y):void 0,S||(S={id:y,type:"group",ref:C,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:h.computedPinned,depth:t.get(y)??0},r.set(w,S),i.set(y,S)),S.columnItems.push(h),S.uniqueGroupId.push(h.id),T&&!b.has(T.id)&&S.children.push(T),T=S,y=C.columnGroup}else break}});let l=[],s=new ee,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((f,p)=>f+p.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&Nf(u.children),l.push(u),c+=d}if(u.type==="group")u.columnItems.forEach(d=>{s.set([u.depth,d.ref.computedVisibleIndex],u)});else for(let d=u.depth;d<=o+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Nf(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&Nf(t.children),e+=o})}import*as To from"react";import{useCallback as Wf,useEffect as OS,useMemo as FS,useRef as NS}from"react";import*as $l from"react";import*as Vf from"react";import{useCallback as zf}from"react";import{useRef as Lf,useState as xS}from"react";import*as cr from"react";var{rootClassName:PS}=Le,MS=`${PS}HeaderCell_ResizeHandle`;function AS(n){let e=Lf(null),[t,o]=xS(!1),r=Lf(t);r.current=t;let i=n.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let f=d.pointerId,p=d.clientX,m=d.target;m.setPointerCapture(f);let g=!0,b=Bd(n.groupColumns.map(T=>T.computedVisibleIndex),{columns:n.columns,domRef:e}),h=T=>{a==="end"&&(T*=-1);let{constrained:C,adjustedDiffs:w,adjustedDiff:I}=n.computeResize(T);return r.current!==C&&o(C),b.resize(w),I},y=T=>{if(g){let C=n.groupColumns.reduce((v,D)=>v+D.computedWidth-D.computedMinWidth,0),w=n.brain.getAvailableSize(),I={width:w.width+C,height:w.height};n.brain.update(I),g=!1}h(Math.round(T.clientX-p))},S=T=>{m.releasePointerCapture(f),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",S);let C=Math.round(T.clientX-p),w=h(C);n.onResize(w)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",S)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:pe.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return cr.createElement("div",{ref:e,className:`${MS} ${ui} ${fi({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},cr.createElement("div",{style:{...u,...n.style},className:di({constrained:t})}))}var kf=cr.memo(AS);function Gf(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:c}=te(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),u=n[n.length-1],d=zf(g=>{let b=l(),{columnSizing:h,viewportReservedWidth:y,bodySize:S}=b,T=s().computedVisibleColumns,C=!1,w=T.reduce((D,R)=>(R.computedFlex&&(D[R.id]={...h[R.id],flex:R.computedWidth},C=!0),D),{}),I=C?{...h,...w}:h;return bu({availableSize:S.width,reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:I,columnGroupSize:n.length,items:T.map(D=>({id:D.id,resizable:D.computedResizable,computedFlex:D.computedFlex,computedWidth:D.computedWidth,computedMinWidth:D.computedMinWidth,computedMaxWidth:D.computedMaxWidth}))})},[u]),f=zf(g=>{let{columnSizing:b,reservedWidth:h}=d(g);c.viewportReservedWidth=h,c.columnSizing=b},[d]);return n.some(g=>g.computedResizable)?Vf.createElement(kf,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:f}):null}var Hf=`${st}HeaderGroup`,Kf=Z(Y.columnWidthAtIndex),ES=Z(Y.columnZIndexAtIndex);function Bf(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=Gf(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=o[0],u=o.length>1?"calc( "+o.map(p=>`var(${Kf}-${p.computedVisibleIndex})`).join(" + ")+" )":`var(${Kf}-${c.computedVisibleIndex})`,d=`calc(var(${ES}-${c.computedVisibleIndex}) + ${i-e.depth})`,f=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return f=f&&typeof f=="object"?f:{},f.width=u,f.height=t,$l.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,className:Q(lu,Hf),style:f,"data-z-index":d},$l.createElement("div",{className:Q(`${Hf}__header-content`,zt)},a),s)}import{useContext as _S}from"react";import*as ql from"react";var Ul;function Xl(){return Ul||(Ul=ql.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var Yl;function Ai(){return Yl||(Yl=ql.createContext(null))}function Oe(n){let e=Ai(),t=_S(e);return tn(t,n)}function Ht(){return Oe(n=>({getDataSourceState:n.getDataSourceState,getDataSourceMasterContext:n.getDataSourceMasterContext,dataSourceActions:n.dataSourceActions,dataSourceApi:n.dataSourceApi,assignState:n.assignState}))}var{rootClassName:LS}=Le,kS=[],jf=`${LS}Header`,zS=ou({overflow:!1}),$f=()=>{};function VS(n){let{bodyBrain:e,headerBrain:t,columns:o,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=n,{getState:c,headerOptions:u,headerRenderer:d,headerOnRenderUpdater:f,showColumnFilters:p,computedColumnsMap:m}=te(A=>({computedColumnsMap:A.computed.computedColumnsMap,getState:A.getState,headerOptions:A.state.headerOptions,headerRenderer:A.state.headerRenderer,headerOnRenderUpdater:A.state.headerOnRenderUpdater,showColumnFilters:A.state.showColumnFilters})),g=NS(null),b=Wf(A=>{g.current&&(g.current.style.transform=`translate3d(-${A.scrollLeft}px, 0px, 0px)`)},[]);OS(()=>{let A=t.onScroll(b);return b(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),A},[t]);let h={ref:g,className:Q(jf,`${jf}--virtualized`,i,zS),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:S,dataSourceActions:T}=Ht(),{allRowsSelected:C,someRowsSelected:w,selectionMode:I,filterTypes:v,filterDelay:D}=Oe(A=>({allRowsSelected:A.dataSourceState.allRowsSelected,someRowsSelected:A.dataSourceState.someRowsSelected,selectionMode:A.dataSourceState.selectionMode,filterTypes:A.dataSourceState.filterTypes,filterDelay:A.dataSourceState.filterDelay})),R=FS(()=>({allRowsSelected:C,someRowsSelected:w,selectionMode:I}),[C,w,I]),P=Wf(A=>{let{rowIndex:M,colIndex:x,domRef:_,height:E,widthWithColspan:L,heightWithRowspan:k,hidden:V}=A,W=o[x];if(!W||V)return null;let O=t.isHorizontalLayoutBrain?t.getPageIndexForRow(M):null,F=l?l.pathsToCells.get([M,x]):null;if(F&&F.type==="group"){let J=F.columnItems.map(ie=>ie.ref),j={...F.ref,id:F.id,uniqueGroupId:F.uniqueGroupId,depth:F.depth,columns:J.map(ie=>ie.id),computedWidth:F.computedWidth,groupOffset:F.groupOffset};return c().columnGroupVisibility[F.id]!==!1?To.createElement(Bf,{horizontalLayoutPageIndex:O,bodyBrain:e,columnGroupsMaxDepth:s,domRef:_,columns:J,width:L,height:E,columnGroup:j}):null}return To.createElement(Yf,{domRef:_,column:W,horizontalLayoutPageIndex:O,headerOptions:u,dataSourceStatePartialForHeaderCell:R,filterTypes:v,filterDelay:D,getDataSourceState:y,dataSourceApi:S,dataSourceActions:T,width:L,height:k,columnsMap:m})},[u,o,a,l,s,p,t,y,S,T,v,D,R]);return To.createElement(Ko,{orientation:"horizontal",dragListId:"header",onDrop:$f,updatePosition:$f},A=>To.createElement("div",{...A,...h,className:Q(A.className,h.className)},To.createElement(Di,{name:"header",renderCell:P,brain:t,renderer:d,onRenderUpdater:f,cellHoverClassNames:kS,cellDetachedClassNames:Pi})))}var Uf=To.memo(VS);function qf(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=te(w=>({computedPinnedStartColumns:w.computed.computedPinnedStartColumns,computedPinnedEndColumns:w.computed.computedPinnedEndColumns,computedVisibleColumns:w.computed.computedVisibleColumns,columnSize:w.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:c,columnGroupsMaxDepth:u,computedColumnGroups:d,showColumnFilters:f}=te(w=>({columnHeaderHeight:w.state.columnHeaderHeight,columnGroupsDepthsMap:w.state.columnGroupsDepthsMap,columnGroupsMaxDepth:w.state.columnGroupsMaxDepth,computedColumnGroups:w.state.computedColumnGroups,showColumnFilters:w.state.showColumnFilters})),p=!d||!Object.keys(d).length?1:u+2,m=p*s+(f?s:0),g=Ot.useMemo(()=>{if(!(!d||!Object.keys(d).length))return Ff(a,d,c,u)},[a,d,c]),b=Ot.useCallback(({rowIndex:w,colIndex:I})=>{let v=a[I],D=1,R=1;if(!v||!g)return{rowspan:D,colspan:R};let P=g.pathsToCells.get([w,I]);if(!P)return{rowspan:D,colspan:R};if(P.type==="column")return{colspan:R,rowspan:p-P.depth};let A=P.columnItems.findIndex(M=>M.id===v.id);return{rowspan:D,colspan:A===0?P.columnItems.length:1}},[d,u,a,g,p,c]),h=Ot.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).rowspan,[b]),y=Ot.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).colspan,[b]),S=Ot.useCallback(w=>f?w<p-1?s:2*s:s,[p,f,s]);Mi(e,{colWidth:l,rowHeight:S,rows:p,cols:a.length,height:m,rowspan:h,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let T=Ot.createElement(Uf,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:u,columnAndGroupTreeInfo:g}),C=o.vertical&&fo()?Ot.createElement("div",{className:cu,style:{zIndex:1e3,width:fo()}}):null;return Ot.createElement("div",{className:`${Cl} ${pu}`,style:{height:m}},T,C)}var{ManagedComponentContextProvider:GS}=At({initSetupState:of,forwardProps:nf,Context:Fl()});function Zl(n){let{getComputed:e,header:t,brain:o,headerBrain:r,wrapRowsHorizontally:i}=te(l=>({getComputed:l.getComputed,header:l.state.header,brain:l.state.brain,headerBrain:l.state.headerBrain,wrapRowsHorizontally:l.state.wrapRowsHorizontally})),{scrollbars:a}=e();return t?ur.createElement(GS,{...n},ur.createElement(qf,{wrapRowsHorizontally:!!i,bodyBrain:o,headerBrain:r,scrollbars:a})):null}function Xf(){return ur.useContext(Fl()).componentState}var jS=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||Yt;return ve.createElement(s,{domProps:{className:ri},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},si=ve.createContext(null);var $S=Z(Y.columnZIndexAtIndex),US=Z(Y.columnVisibilityAtIndex),Ql=ve.createElement("div",{className:kr[1]}),Qf=Vr({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[bo]:""});function YS(n){let e=n.column,{allowColumnHideWhileDragging:t}=Xf(),{dataSourceStatePartialForHeaderCell:o,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:c}=n,{allRowsSelected:u,someRowsSelected:d,selectionMode:f}=o,{onDragItemPointerDown:p}=nr(),{api:m,getComputed:g,getState:b,actions:h,getDataSourceMasterContext:y,showColumnFilters:S,components:T,portalDOMRef:C,columnHeaderHeight:w,columnReorderDragColumnId:I,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:D}=te(H=>({api:H.api,getComputed:H.getComputed,getState:H.getState,actions:H.actions,getDataSourceMasterContext:H.getDataSourceMasterContext,showColumnFilters:H.state.showColumnFilters,components:H.state.components,portalDOMRef:H.state.portalDOMRef,columnHeaderHeight:H.state.columnHeaderHeight,columnReorderDragColumnId:H.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:H.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:H.state.columnReorderInPageIndex})),R=I===e.id,P=D!=null?r!==D:!1,{onResize:A,height:M,width:x,headerOptions:_,columnsMap:E}=n,L=e.computedSortInfo,k=e.header,V=Zf(H=>{G.current=H,n.domRef?.(H)},[n.domRef]),W=_.alwaysReserveSpaceForSortIcon,O=e.headerAlign??e.align,F=(typeof O=="function"?O({isHeader:!0,column:e}):O)??"start",J=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",j=ct(e,{actions:h,api:m,dataSourceActions:l,dataSourceApi:a,getComputed:g,getDataSourceState:i,getDataSourceMasterContext:y,getState:b}),U=j.isSortable(),ie=U&&(e.computedSorted||W)?ve.createElement(ci,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:pe.spacing[2],marginInlineEnd:pe.spacing[2]},className:`${ko}__sort-icon ${uu} ${fu({align:F})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,Te=e.computedFilterable&&e.computedFiltered?ve.createElement(ln,null):null,ce=e.headerCssEllipsis??e.cssEllipsis??!0,fe={reserveSpaceWhenHidden:F==="center",menuVisible:v===e.id,style:F==="end"?{marginInlineStart:`calc(${pe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:pe.spacing[2]}:{marginInlineEnd:`calc(${pe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:pe.spacing[2]},domProps:{onMouseDown:H=>{H.stopPropagation(),j.toggleContextMenu(H.target)}}},me=e.components?.MenuIcon||T?.MenuIcon||tr,$=ve.createElement(me,{...fe}),G=BS(null),q={horizontalLayoutPageIndex:r,dragging:R,domRef:V,htmlElementRef:G,renderLocation:"column-header",column:e,columnsMap:E,columnSortInfo:L,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:u,selectionMode:f,api:m,dataSourceApi:a,columnApi:j,renderBag:{sortIcon:ie,filterIcon:Te,menuIcon:$,menuIconProps:fe,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},B=q,ae=B.renderBag.header,ne=()=>{let H={...q,renderBag:{...q.renderBag}};if(e.renderSortIcon&&(H.renderBag.sortIcon=ve.createElement(go,{render:e.renderSortIcon,renderParam:{...H,renderBag:{...H.renderBag}}})),e.renderFilterIcon&&(H.renderBag.filterIcon=ve.createElement(go,{render:e.renderFilterIcon,renderParam:{...H,renderBag:{...H.renderBag}}})),typeof e.renderMenuIcon=="function"&&(H.renderBag.menuIcon=ve.createElement(go,{render:ht=>{if(typeof e.renderMenuIcon!="function")return null;let xt=e.renderMenuIcon(ht);return xt?xt.type===me||xt.type===tr?xt:ve.createElement(me,{...fe},xt):null},renderParam:{...H,renderBag:{...H.renderBag}}})),e.renderSelectionCheckBox&&f==="multi-row"){H.renderBag.selectionCheckBox=ve.createElement(go,{render:jS,renderParam:{...H,renderBag:{...H.renderBag}}});let ht=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;ht&&ht!==!0&&(H.renderBag.selectionCheckBox=ve.createElement(go,{render:ht,renderParam:{...H,renderBag:{...H.renderBag}}}))}k instanceof Function&&(H.renderBag.header=ae=ve.createElement(go,{render:k,renderParam:{...H,renderBag:{...H.renderBag}}}));let et=e.renderMenuIcon===!1?null:H.renderBag.menuIcon,Ce=ce?ve.createElement("div",{className:zt},H.renderBag.header):H.renderBag.header,tt=ve.createElement(ve.Fragment,null,F==="center"?Ql:null,H.renderBag.selectionCheckBox,Ce,H.renderBag.sortIcon,H.renderBag.filterIcon,F==="center"?Ql:null,F!=="center"?Ql:null,et);return e.renderHeader?ve.createElement(go,{render:e.renderHeader,renderParam:{...H,renderBag:{...H.renderBag,all:tt}}}):tt};KS(()=>{let H=null,et=G.current;return A&&et&&(H=Kn(et,A)),()=>{H?.()}},[G.current,n.onResize]);let z={height:M};e.headerStyle&&(z=typeof e.headerStyle=="function"?{...z,...e.headerStyle(B)||{}}:{...z,...e.headerStyle});let de=typeof e.headerClassName=="function"?e.headerClassName(B):e.headerClassName,{onPointerDown:N,proxyPosition:X,dragColumnOutside:se}=pd({columnId:e.id,domRef:G,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),ue=null,De=si.Provider,xe={filtered:e.computedFiltered,verticalAlign:J,align:F},Ve=ve.useMemo(()=>{let H=et=>{m.setColumnFilter(e.id,et)};return c>0?Mt(H,{wait:c}):H},[c,e.id]),Fe=e.computedFilterType,Ne=s[Fe],Ke=e.computedFilterable?e.computedFilterValue?.filter.operator??Ne?.defaultOperator:void 0,qe=e.computedFilterable&&Ne?Ne.operators.find(H=>H.name===Ke):void 0,Xe=qe?.components?.FilterEditor||Ne?.components?.FilterEditor||e.components?.FilterEditor||cn,Ze=Ne?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,K=Yd(e,{horizontalLayoutPageIndex:r}),re=`var(${$S}-${e.computedVisibleIndex})`;z.zIndex=re,z.visibility=`var(${US}-${e.computedVisibleIndex}, visible)`;let le={"data-field":`${e.field||""}`,"data-column-id":e.id,[bo]:e.id,"data-header-align":F,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},he=e.computedFilterable?ve.createElement(Du,{horizontalLayoutPageIndex:r,filterEditor:Xe,filterOperatorSwitch:Ze??xu,operator:qe,filterTypes:s,onChange:Ve,columnFilterType:Fe,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:w}):ve.createElement(Pu,null);B.renderBag.filterEditor=he;let $e=Zf(H=>{N(H),p(H)},[N,p]),oe=ne();return R&&X&&(ue=ve.createElement("div",{key:e.id,className:`${ko}Proxy ${Jc}`,style:{height:M,width:x,left:X.left??0,top:X.top??0}},ve.createElement("div",{className:eu({visible:se})},ve.createElement(tf,{size:16})),ae),ue=WS(ue,C.current)),ve.createElement(De,{value:B},ve.createElement(ai,{domRef:V,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",column:e,...le,"data-z-index":re,style:z,width:x,onPointerDown:$e,contentClassName:Q(Qc(xe),Mc[F]),contentStyle:S?{height:M/2}:void 0,className:Q(ko,Fc.none,U?xc.pointer:"",de,qr(e,[ko,Go],tu,{dragging:R,insideDisabledDraggingPage:P,align:F,verticalAlign:J,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Zc),cssEllipsis:ce,afterChildren:ve.createElement(ve.Fragment,null,S?he:null,K),renderChildren:oe}),ue)}var Yf=ve.memo(YS);function Ur(){return HS(si)}import*as Zt from"react";import{useEffect as qS}from"react";function Jf(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var ep={padding:pe.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},XS={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},tp=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(Jf(t),o,"important")},op=Zt.forwardRef(function(e,t){let{rootClassName:o}=Lr(),r=Zt.useRef(null),i=Zt.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return qS(()=>{let a=()=>{setTimeout(()=>{tp(r.current,ep),tp(r.current?.firstElementChild,XS)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),Zt.createElement("div",{ref:i,...e,className:Q(`${o}-Footer`,Lu,e.className),style:ep},"Powered by"," ",Zt.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});function Jl(n){return n.map(Kt)}function Kt(n){if(Me().structuredClone)return Me().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return Jl(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(Jl(Array.from(n)));if(n instanceof Map)return new Map(Jl(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=Kt(n[t]));return e}function dr(n){return n}var $o=Object.seal({data:null,field:null});var wo="____root____",rp="____not_loaded_yet____";function Co(){return!1}function es(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function Ei(n,e,t,o,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function ip(n,e){let{marker:t,reducers:o={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:c}=n;t&&t.start();let u=new ee;function d(h,y,S,T=0,C=[]){let w=!S.length||T===S.length-1,I=y[c?.values||"values"]||{};for(let v in I)if(I.hasOwnProperty(v)){let D=v;C.push(D),f.set(C,!0),h.set(C,{reducerResults:I[v][c?.totals||"totals"]||{},items:[]}),w||d(h,I[v],S,T+1,C),C.pop()}}let f=r?new ee:void 0,p=[],m=es(o),g=Kt(m);e.visitDepthFirst((h,y,S,T)=>{let[C,...w]=y,I=h.children,v=u.get(w);if(v&&(v.cache=h.cache,v.childrenLoading=h.childrenLoading,v.childrenAvailable=h.childrenAvailable,v.error=h.error),w.length==i.length&&i.length){if(v){v.items=I;for(let R=0,P=w.length;R<P;R++){let A=w.slice(0,R),M=u.get(A);M&&(M.items=M.items||[],M.items=M.items.concat(I))}I=a.indexArray(I,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return T?.()}for(let D=0,R=I.length;D<R;D++){if(!I[D]){let x={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...w,`${rp}${D}`],x);continue}let P=I[D].data,A=I[D].keys||[];if(A.length){let x=A[A.length-1];w.push(x)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:P,totalChildrenCount:I[D].totalChildrenCount,reducerResults:I[D].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(w,M),r){let x=M.pivotDeepMap=new ee,_=I[D].pivot;d(x,_,r,0,p)}A.length&&w.pop()}T?.()});let b={deepMap:u,groupParams:n,initialData:e,reducerResults:g};return r&&(b.topLevelPivotColumns=f,b.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(h=>h.field).join(", ")}]}),b}function np(n,e,t,o,r,i,a,l,s,c=dr){let{items:u,reducerResults:d,pivotDeepMap:f}=n.get(e);if(u.push(o),a&&Ei(o,r,a,d,e),i){for(let p=0,m=i.length;p<m;p++){let{field:g,valueGetter:b,toKey:h}=i[p],y=g?o[g]:null;b&&($o.data=o,$o.field=g,y=b($o));let S=(h||c)(y,o);t.push(S),f.has(t)||(l.set(t,!0),f?.set(t,{reducerResults:Kt(s),items:[]}));let{reducerResults:T,items:C}=f.get(t);C.push(o),a&&Ei(o,r,a,T,e)}t.length=0}}function ap(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=n,d=u(r),f=[...o,d],p=s(r);if(t.set(f,!0),p){for(let h=0,y=o.length;h<=y;h++){let S=o.slice(0,h),T=e.get(S),{reducerResults:C,items:w}=T;w.push(r),T.leavesAvailableCount++,T.totalLeafNodesCount++,a&&Ei(r,i,a,C,S)}return}let m=Kt(l),g=[];e.set(f,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:o.length});let b=c(r);if(!(!b||!Array.isArray(b))){for(let h=0,y=b.length;h<y;h++){let S=b[h];ap(n,e,t,f,S,h,a,l)}a&&fr(a,m,g)}}function ts(n,e){let{reducers:t,marker:o}=n;if(o){let c=Object.keys(t??{});o.start({details:c.length>0?[{name:"Reducers",value:c.join(", ")}]:void 0})}let r=es(t),i=Kt(r),a=new ee,l=new ee;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:i,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let c=0,u=e.length;c<u;c++)ap(n,a,l,[],e[c],c,t,r);t&&fr(t,i,e);let s={deepMap:a,treeParams:n,treePaths:l,initialData:e,reducerResults:i};return o&&o.end(),s}function os(n,e){let{marker:t,groupBy:o,defaultToKey:r=dr,pivot:i,reducers:a}=n;t&&t.start();let l=o.length,s=i?new ee:void 0,c=new ee,u=[],d=[],f=es(a),p=Kt(f);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Kt(f)};i&&(g.pivotDeepMap=new ee),c.set(u,g)}for(let g=0,b=e.length;g<b;g++){let h=e[g],y={};for(let S=0;S<l;S++){let{field:T,groupField:C,valueGetter:w,toKey:I}=o[S],v=T?h[T]:null;w&&($o.data=h,$o.field=T,v=w($o));let D=(I||r)(v,h);if(y[T||C]=D,u.push(D),!c.has(u)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:Kt(f)};i&&(R.pivotDeepMap=new ee),c.set(u,R)}np(c,u,d,h,g,i,a,s,f,r)}l||np(c,u,d,h,g,i,a,s,f,r),a&&Ei(h,g,a,p,u),u.length=0}a&&(c.visitDepthFirst((g,b,h,y)=>{fr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:T},C,w,I)=>{fr(a,T,S),I?.()}),y?.()}),fr(a,p,e));let m={deepMap:c,groupParams:n,initialData:e,reducerResults:p};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:o.map(g=>g.field).join(", ")}]}),m}function ZS(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function QS(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,f=d??null,p;if(Object.keys(c).length>0){f={...d},p={};for(let y in i)if(i.hasOwnProperty(y)){let T=i[y].field;T&&(p[T]=c[y]),T&&f[T]==null&&(f[T]=c[y])}}let m=!0,g=o[o.length-1],b=g;if(f!=null){let y=t[o.length-1];y&&y.field&&(b=f[y.field]),y&&y.toKey&&(b=y.toKey(b,f)),b=b??g}return typeof b=="string"&&b.startsWith(rp)&&(m=!1,b=null),{data:f,reducerData:p,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Co,hasSelectedCells:Co,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:b,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function _i(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function fr(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function lp(n,e,t,o,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:f,withRowInfo:p,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:b,rowsPerPage:h}=r,{deepMap:y}=u,S=n.length,T=t[t.length-1],C=T?T.nodeExpanded:!0;for(let w=0;w<S;w++){let I=n[w],v=c(I,w),D=[...e,v];if(l(I)){let E={id:v,nodePath:D,isGroupRow:!1,data:I,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Co,hasSelectedCells:Co,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,w],indexInParent:w,indexInAll:C?i.length:-1};f&&(E.rowSelected=f(E)),d&&(E.rowDisabled=d(E)),p&&p(E);let L=b&&h!=null&&h>0&&E.indexInAll%h===0?E.indexInAll/h:null;for(let k=0,V=t.length;k<V;k++){let W=t[k];if(C||(W.collapsedLeafNodesCount+=1),W.deepRowInfoArray.push(E),L!=null&&C){if(typeof b=="function"&&b(W)!==!0)continue;let O=_i(W,E.indexInAll,L);i[O.indexInAll]=O,E.indexInAll++}}C&&(i[E.indexInAll]=E);continue}let A=y.get(D)?.totalLeafNodesCount??0,M={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:D,id:v,data:I,indexInAll:i.length,indexInParent:w,indexInParentNodes:[...o,w],totalLeafNodesCount:A,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Co,hasSelectedCells:Co,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(M.rowSelected=f(M),g)){let E=g.getSelectionCountFor(M.nodePath);M.selectedLeafNodesCount=E.selectedCount,M.deselectedLeafNodesCount=E.deselectedCount}d&&(M.rowDisabled=d(M)),p&&p(M);let x=!0;if(m&&(M.selfExpanded=x=m(M)),C||(x=!1),M.nodeExpanded=x,C&&b&&h!=null&&h>0){let E=M.indexInAll,L=M.parentNodes;if(L.length>0&&E%h===0){let k=E/h,V=0;L.forEach(W=>{typeof b=="function"&&b(W)!==!0||(i.push(_i(W,E+V,k)),V++,M.indexInAll++)})}}C&&(i[M.indexInAll]=M);let _=s(I);Array.isArray(_)&&lp(_,D,[...t,M],M.indexInParentNodes,r,i)}return i}function sp(n){let{dataArray:e,marker:t}=n;t&&t.start();let o=[];return lp(e,[],[],[],n,o),t&&t.end(),{data:o}}function cp(n){let{marker:e,lazyLoad:t,groupResult:o,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:c,isRowSelected:u,rowSelectionState:d,generateGroupRows:f,reducers:p={}}=n,{groupParams:m,deepMap:g,pivot:b}=o,{groupBy:h}=m;e&&e.start({details:[{name:"Group by fields",value:h.map(w=>w.field).join(", ")}]});let y=[],S=[],T=[],C=[];return g.visitDepthFirst((w,I,v,D)=>{let R=w.items,P=I.length,A=s?.isGroupRowCollapsed(I)??!1;C.push(v);let M=QS({lazyLoad:t,groupBy:h,parents:Array.from(T),reducers:p,indexInGroup:v,indexInParentGroups:Array.from(C),indexInAll:y.length,groupKeys:I,error:w.error,totalChildrenCount:w.totalChildrenCount,childrenLoading:(w.childrenLoading||!A&&!w.childrenAvailable)&&t,childrenAvailable:w.childrenAvailable,directChildrenCount:I.length===h.length?w.items.length:g.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},w);if(u&&(M.rowSelected=u(M),d)){let k=d.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=k.selectedCount,M.deselectedChildredCount=k.deselectedCount}c&&(M.rowDisabled=c(M));let x=T[T.length-1],_=x?.collapsed??!1;_&&(A=!0),M.collapsed=A;let E=f||A;if(_&&(E=!1),E){if(i&&r!=null&&r>0){let k=M.indexInAll,V=M.parents;if(V.length>0&&k%r===0){let W=k/r,O=0;V.forEach(F=>{typeof i=="function"&&i(F)!==!0||(y.push(_i(F,k+O,W)),O++,M.indexInAll++)})}}y.push(M),S.push(y.length-1)}M.collapsedChildrenCount=0,T.forEach(k=>{k.deepRowInfoArray.push(M),k.collapsedGroupsCount+=A?1:0}),x&&M.selfLoaded&&t&&(x.directChildrenLoadedCount+=1),a&&a(M),T.push(M);let L=!0;if(L){if(D)D();else if(!b){let k=y.length;A||(y.length+=R.length);let V=0;for(let W=0,O=R.length;W<O;W++){let F=R[W];if(!A&&i&&r!=null&&r>0){let ie=k+W+V;if(ie%r===0){let be=ie/r;T.forEach(Te=>{if(typeof i=="function"&&i(Te)!==!0)return;let ce=k+W+V;y[ce]=_i(Te,ce,be),V++,y.length++})}}let J=k+W+V,U={id:F?l(F,J):`${I}-${W}`,data:F,isCellSelected:Co,hasSelectedCells:Co,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!F,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:A,groupKeys:I,parents:Array.from(T),indexInParentGroups:[...C,W],indexInGroup:W,indexInAll:J,groupBy:h,groupNesting:P+1,groupCount:M.groupCount};u&&(U.rowSelected=u(U)),c&&(U.rowDisabled=c(U)),a&&a(U),T.forEach((ie,be)=>{be===T.length-1&&F&&(ie.directChildrenLoadedCount+=1),A&&(ie.collapsedChildrenCount+=1),ie.deepRowInfoArray.push(U)}),A||(y[k+W+V]=U)}}}T.pop(),C.pop()}),e&&e.end(),{data:y,groupRowsIndexes:S}}import*as tm from"react";var JS=()=>{};function eT(n,e){let t=new ee,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let u of c){let d=[...l,u[u.length-1]],f=t.get(d),p=f?f[o]??[]:[];a(d,p),p.length&&(f||(f=typeof r=="function"?r(d,p):r),f[o]=p),s.push(f)}return s}return a([],[])}function up(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(o),d=[...t,u],f=r(o),p=lt(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let g=0,b=m.length;g<b;g++){let h=m[g];up(n,e,d,h)}});f?(c?.(o),s?.(o,JS)):(l?.(o,p,i(o)),s?.(o,p))}function dp(n,e,t){for(let o=0,r=t.length;o<r;o++)up(n,e,[],t[o])}var tT=function(n,e){return n-e},oT=function(n,e){return n=`${n}`,e=`${e}`,n.localeCompare(e)},nT=function(n,e){return n-e},rT={number:tT,string:oT,date:nT},pr=rT;function fp(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var Qt=(n,e,t)=>{let o=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;return r&&r.start(),e.sort(pp(fp(n),o)),r&&r.end(),e},ns=(n,e,t)=>{let{marker:o}=t;o&&o.start();let r=pp(fp(n),t.get),i=t.depthFirst??!1,a=t.inplace??!1;i||(a?e.sort(r):e=[...e].sort(r));let{nodesKey:l,toKey:s}=t,c=d=>d[l],u=d=>d[l]===void 0;return dp({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??c,toKey:s},{onParentNode:(d,f,p)=>{if(i&&f(),Array.isArray(p)){let m=a?p.sort(r):[...p].sort(r);d[l]=m}i||f()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),o&&o.end(),e};Qt.knownTypes=pr;var iT=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=Qt.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys(Qt.knownTypes).join(", ")}`)}return r||(r=pr.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,c=r(l,s);return c===0?c:o*c}},aT=n=>n.map(iT).filter(e=>e instanceof Function),pp=(n,e)=>{let t=aT(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};var Oi=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new ee(o.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new ee(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var Tt=class extends Oi{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};import*as lT from"react";function rs(n){return Oe(e=>n(e.dataSourceState))}function Cn(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||dr)(l,n);return t.push(s),t},[])}var Ee=class n{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new ee;this.deselectedMap=new ee;this.onlyUsePrimaryKeys=!1;this.selectionCache=new ee;this.selectionCountCache=new ee;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Cn(r,o):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let o=this.getGroupDeepMap()?.get(e);return o?o.totalChildrenCount??(o.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let o=t?.get(e);return o?o.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new n(e,t,o)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)})}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)})}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getGroupByLength();if(e.length>r){let c=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,c),c}if(r&&this.onlyUsePrimaryKeys){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(p=>{if(this.defaultSelection){if(this.deselectedMap.has([p])){d++;return}u++}else{if(this.selectedMap.has([p])){u++;return}d++}});let f={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,f),f}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=u-(d+f),m={selectedCount:d+(c?p:0),deselectedCount:f+(c?0:p)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let c=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=c,l=this.deselectedMap.getAllChildrenSizeFor(e),l===c&&(a=0)):(l=c,a=this.selectedMap.getAllChildrenSizeFor(e),a===c&&(l=0))}i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),f=u?!0:d?!1:t,{selectedCount:p,deselectedCount:m}=this.getSelectionCountFor(c,f);a+=p,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var sT="*",We=class{constructor(e){this.wildcard=sT;this.cache=new ee;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[f,p]=d;p===t&&l.push([f,t])})}if(i){let c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[f]=d;f===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),o)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,o){if(o){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(o){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(o){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,o=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),o&&o.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let o=this.selectedRowsToColumns.get(e);if(o){if(o.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>o.has(r)):!1}return!1}error(e){lo(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),c=this.deselectedRowsToColumns.get(this.wildcard),u=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let p=this.selectedRowsToColumns.get(e);return p&&p.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var cT=je("IT:InfiniteTable"),uT="#dc3545",dT="#eb9316";var gp="Warn",hp="Error",fT="Info",pT="Success",mT="Logs",Fi=cT.extend(mT),JN=Fi.extend(fT),gT=Fi.extend(gp),hT=Fi.extend(hp),eL=Fi.extend(pT);var bT=dT,yT=uT;var ST=(n,e)=>{e=e?e.extend?e.extend(gp):e:gT,e(typeof e.color=="function"?e.color(bT,n):n)},TT=(n,e)=>{e=e?e.extend?e.extend(hp):e:hT,e(typeof e.color=="function"?e.color(yT,n):n)};var mp=new ee,bp=(n,...e)=>{mp.has(e)||(mp.set(e,!0),n())};var wn=(n,e=n,t)=>{bp(()=>ST(n,t),e,"warn")},yp=(n,e=n,t)=>{bp(()=>TT(n,t),e,"error")};function Ni(n,e){return new Ee(n,ut(e))}function ut(n){return()=>{let e=typeof n=="function"?n():n;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function Sp(n){let{getDataSourceState:e,dataSourceActions:t}=n;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Ee))throw"Invalid row selection";let a=new Ee(r,ut(e));a.selectAll(),t.rowSelection=a},deselectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Ee))throw"Invalid row selection";let a=new Ee(r,ut(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Ee))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?Cn(u,c):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Ee))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Cn(d,c):[]}let u=new Ee(a,ut(e));u.selectRow(r,i),t.rowSelection=u},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:c}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof Ee))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Cn(d,c):[]}let u=new Ee(l,ut(e));u.deselectRow(r,i),t.rowSelection=u}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Ee))throw"Invalid row selection";let s=new Ee(a,ut(e));s.selectGroupRow(r),t.rowSelection=s},deselectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Ee))throw"Invalid row selection";let s=new Ee(a,ut(e));s.deselectGroupRow(r),t.rowSelection=s},toggleGroupRowSelection(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Ee))throw"Invalid row selection";let s=new Ee(a,ut(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new Ee(i,ut(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof Ee))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Ee(r,ut(i)):i.rowSelection,l=[];return i.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),i.originalDataArray.forEach(s=>{let c=i.toPrimaryKey(s);a.isRowSelected(c)&&l.push(c)}),l}}}var is=new WeakMap,CT=n=>n;function Tp(n,e=50,t){is.set(n,{lastCallTime:0,lastCallArg:null});let o=t??CT;return r=>{let{lastCallTime:i,lastCallArg:a}=is.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=pt(o(a),o(r));s<e&&c||(is.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var Li=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new ee;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let c=o&&!o.isEmpty();if(c&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let u=[...o.getMutationsArray(),...o.getTreeMutationsArray()];for(let d=0,f=u.length;d<f;d++){let p=u[d];if(p.type==="insert"){let m=r(p.data);s?this.addNodePath([m],p.data,t):this.add(m,p.data),e.push(p.data)}}o?.removeInfo(void 0)}}else{let u=(d,f)=>{for(let p=0;p<d.length;p++){let m=d[p];c&&s&&Array.isArray(m[l])&&(m=d[p]={...m});let g=!1;if(m!=null){let b=r(m),h=s?[...f,b]:void 0,y=s&&!!h,S=y?o?.getMutationsForNodePath(h):o?.getMutationsForPrimaryKey(b);if(S&&S.length){for(let T=0,C=S.length;T<C;T++){let w=S[T];if(w.type==="delete"&&!g&&(y?this.removeNodePath(h,t):this.remove(b),g=!0,d.splice(p,1),p--),w.type==="update"&&!g&&(m={...m,...w.data},d[p]=m),w.type==="update-children"&&!g){let I=w.children(m[l],m);m={...m},I!==void 0?m[l]=I:delete m[l],d[p]=m}w.type==="insert"&&(w.position==="before"?(d.splice(p,0,w.data),p--):d.splice(p+1,0,w.data))}y?o?.removeNodePathInfo(h):o?.removeInfo(b)}if(!g)if(y){this.addNodePath(h,m);let T=a(m),C=T?null:i(m);!T&&Array.isArray(C)&&(f.push(b),c&&(m[l]=C=C.concat()),u(C,f),f.pop())}else this.add(b,m)}}};u(e,[])}return e}}};import{useEffect as xn,useMemo as Np,useRef as Wi,useState as _T}from"react";import{useEffect as Cp,useLayoutEffect as wT,useRef as In}from"react";function Rn(n,e){let t=In({}),o=In({}),r=o.current,i=In({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,Cp(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=n(s,r)),i.current={},o.current={},c},l)}function pL(n,e){let t=In({}),o=In({}),r=o.current,i=In({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,wT(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=n(s,r)),i.current={},o.current={},c},l)}function mL(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);Cp(n,t)}function as(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function ls(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function ss(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function wp({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(p=>({...r[p],id:p}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=lt(function(){l.forEach((p,m)=>{s[`total:${p.id}`]=ls({header:`${p.name||p.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:p,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[p.id]:null})})});(!a&&t==="start"||o==="start")&&u();let d=!i&&l.length===1;return n.visitDepthFirst((p,m,g,b)=>{if(m=[...m],t==="end"&&b?.(),m.length===a){let h=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let T=S;S=m.join("/");let C=m[m.length-1];c[S]=ss({header:`${C}`,columnGroup:T,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:h,pivotIndex:m.length-1,pivotGroupKey:C})}l.forEach((T,C)=>{let w=d?`${m[m.length-1]}`:T.name||T.id,I=ls({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:T,pivotAggregatorIndex:C,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:h,defaultSortable:!1,columnGroup:S,header:w,valueFormatter:({rowInfo:D})=>D.isGroupRow?D.pivotValuesMap?.get(m)?.reducerResults[T.id]:null}),v=`${T.id}:${m.join("/")}`;s[v]=I})}else{let h=m.join("/"),y=m.slice(0,-1);if(c[h]=ss({columnGroup:y.length?y.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let S=e[m.length-1],T=y.length?y.join("/"):void 0;if(!d){let C=T;T=`total:${m.join("/")}`,c[T]=ss({header:`${m[m.length-1]} total`,columnGroup:C,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((C,w)=>{let I=d?`${m[m.length-1]} total `:`${C.name||C.id} total`,v=ls({columnGroup:T,header:I,pivotAggregator:C,pivotAggregatorIndex:w,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:D})=>D.isGroupRow?D.pivotValuesMap?.get(m)?.reducerResults[C.id]:null});s[`total:${C.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&b?.()}),(!a&&t==="end"||o==="end")&&u(),{columns:s,columnGroups:c}}var Ip=Symbol("CLEAR"),Uo=class n{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new ee;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Ip,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Ip);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>ee.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let o=new n({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:ee.clone(e.nodePathToData),o}};function Io(n,e){return e().dataArray[n]}function ki(n){return n().dataArray}var dt=class{constructor(e){this.collapsedPathsMap=new ee;this.expandedPathsMap=new ee;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:o,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?o.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?o.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var IT=(n,e)=>n.length-e.length,Je=class n{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new ee;this.cache=new ee;this.strictMode=!1;let o=e instanceof Object.getPrototypeOf(this).constructor,r=o?e.getState():e;this.setConfig(t||(o?e.config:{treePaths:new ee})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Array.isArray(e)?new ee(e.map(t=>[t,!0])):e:this.config.treePaths}withTreePaths(e,t){let o=this.config.treePaths;t=this.getTreePaths(t);let r=t!==o;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=o,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(o=>o.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],o){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},o)}getSelectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&o.push(i.keys)})},t),o}getDeselectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||o.push(i.keys)})},t),o}isLeafNode(e){let{treePaths:t}=this.config;return t.has(e)?t.getKeysForLeafNodesStartingWith(e).length===1:null}getLeafNodesCount(e){return this.config.treePaths.getKeysForLeafNodesStartingWith(e).length}static from(e,t){return new n(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:Array.isArray(t.treePaths)?new ee(t.treePaths.map(o=>[o,!0])):t.treePaths,strictCheckPaths:t.strictCheckPaths??!0},this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(e){if(!this.strictMode)return!0;let{treePaths:t}=this.config;return t.has(e)}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let o=this.cache.get(e);if(o)return o;if(this.isLeafNode(e)!==!1){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0}).sort(IT);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!l.length){if(i!==null){let f=r?i:!1;return this.cacheIt(e,{selected:f,selectedCount:f?r:0,deselectedCount:f?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,f=l.length;d<f;d++){let p=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(p);if(u?(s-=g,c+=g):(c-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.xcache(),this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function Vi(n,e){return new Je(n,vn(e))}function vn(n){return()=>({treePaths:(typeof n=="function"?n():n).treePaths})}var zi=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof Je))throw"Invalid tree selection";let a=new Je(r,vn(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:e,selected:t},this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}getSelectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!o)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(o.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new dt({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new dt({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new dt(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new dt(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new dt(o.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?Io(o,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let o=new Je(e,vn(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let o=new Je(e,vn(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Je))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};var Dn=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var Ct=class extends Dn{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var cs=1e3;function Rp(n){return new us(n)}var us=class{constructor(e){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>ki(this.getState);this.getRowInfoByIndex=e=>Io(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),o=t.getDataForNodePath(e);return o||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?cs:r;return isNaN(a)||(a=cs),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let c=u=>t.position==="start"?[...e,...u||[]]:[...u||[],...e];return this.updateChildrenByNodePath(c,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=o?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let o=this.getState().rowDisabledState,r=o?new Ct(o):new Ct({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Ct({enabledRows:!0,disabledRows:[]});return}let t=new Ct(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Ct({disabledRows:!0,enabledRows:[]});return}let t=new Ct(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new zi({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(o=>{this.resolvePendingPromise=o});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:o,nodesKey:r}=this.getState(),i=t?Uo.clone(t,{light:!0}):new Uo({nodesKey:o?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let f=a.primaryKeys[d],p=this.getDataByPrimaryKey(f);p&&i.update(a.primaryKeys[d],u,p,a.metadata)}else if(a.nodePaths){let f=this.getDataByNodePath(a.nodePaths[d]);f&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,f,a.metadata):i.updateNodePath(a.nodePaths[d],u,f,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??cs,i=o.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=f=>{clearTimeout(d),u=f,o.waitForNodePathPromises.delete(e),c(f)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return o.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function vp(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:f,isTree:p}=n;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((b,h)=>b||typeof h!="function"?l.has(h):!1,!1),t))break}if(c&&c.length){if(l===!0)o=!0;else for(let m of c)if(m.field&&l.has(m.field)){o=!0;break}}if(p&&(l===!0?r=!0:r=l.has(f)),u&&u.length)if(l===!0)i=!0;else for(let m of u){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:o,filterValue:i,aggregationReducers:a,tree:r}}function Gi(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function Hi(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function Ki(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function fs(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var Bt=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function ds(){return!1}function RT(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:ds,hasSelectedCells:ds};return o&&(a.rowSelected=o(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var vT=lt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
1
|
+
var Bh=Object.create;var lc=Object.defineProperty;var Wh=Object.getOwnPropertyDescriptor;var jh=Object.getOwnPropertyNames;var $h=Object.getPrototypeOf,Uh=Object.prototype.hasOwnProperty;var Yh=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var qh=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of jh(e))!Uh.call(n,r)&&r!==t&&lc(n,r,{get:()=>e[r],enumerable:!(o=Wh(e,r))||o.enumerable});return n};var en=(n,e,t)=>(t=n!=null?Bh($h(n)):{},qh(e||!n||!n.__esModule?lc(t,"default",{value:n,enumerable:!0}):t,n));var Fo=Yh((pP,Xu)=>{"use strict";Xu.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});function At(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}import*as Re from"react";var ee=(...n)=>n.filter(e=>!!`${e}`).join(" ");import*as Mo from"react";import{useRef as bc}from"react";function Se(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=null;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function lt(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var sc=(n,e)=>n-e;var Ar=(n,e)=>sc(n.revision,e.revision),te=class n{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),c=!a;if(i!==void 0){if(i<0)return;i--}let u=(d,f)=>{let p=r.get(f);if(!p)return;let{map:m}=p,g=f===this.emptyKey;if(g&&!c)return;let b=g?[]:[...e,f],h=m?()=>this.visitWithNext(b,t,o,m,i!==void 0?i-1:void 0):void 0;if(p.hasOwnProperty("value")){let y=t(p.value,b,l,h,p);if(o&&y===!0)return!0;l++}else h?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,f]of r){let p=u(f,d);if(o&&p===!0)return p}};this.fill(e)}static clone(e){let t=new n;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push(i)},t),o}getEntriesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push([r,i])},t),o}getLeafNodesStartingWith(e,t,o){let{respectOrder:r=!1}=o||{},i=[],a=[];return this.getStartingWith(e,(l,s,c)=>{!c.map&&c.hasOwnProperty("value")&&(r?i.push(c):a.push(t(c)))},o),r?i.sort(Ar).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>o.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>[o.keys,o.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:o,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=f=>{i?a.push(f):l.push(f.keys)},c=this.map,u,d=!1;if(e.length)for(let f=0,p=e.length;f<p;f++){let m=e[f];if(u=c.get(m),!u||!u.map)if(d=!0,f===p-1){d=!0;break}else return[];c=u.map}else if(!o&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(o||(s({...u,keys:e}),d=!0)),d?i?a.sort(Ar).map(f=>f.keys):l:(this.visitWithNext(e,(f,p,m,g,b)=>{s({...b,keys:p})},!1,c,r,o),i?a.sort(Ar).map(f=>f.keys):l)}getKeysStartingWith(e,t){let o=[];return this.getStartingWith(e,r=>{o.push(r)},t),o}getStartingWith(e,t,o){let{excludeSelf:r,depthLimit:i}=o||{},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(c,u,d,f,p)=>{t(u,c,{...p,keys:u}),f?.()},!1,a,i,r)}getMapAt(e){let t=this.map,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let o=this.map;e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((o,r)=>{let{map:i}=o;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0}delete(e){let t=this.map;e.length?e=[...e]:e=[this.emptyKey];let o=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],c=a===l-1,u=t.get(s);if(c){u&&(u.hasOwnProperty("value")&&(delete u.value,delete u.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),u.map&&u.map.size===0&&delete u.map,u.map||t.delete(s));break}else{if(!u||!u.map){i=!1;break}r.push(u),t=u.map,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.length-1],c=e[e.length-1],u=s?.get(c);u&&(delete u.map,u.hasOwnProperty("value")||s.delete(c))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],c=lt(()=>{if(l)for(let[u]of l){let d=this.visitKey(u,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let u=r(a,s,c);if(i&&u===!0)return!0}c()}getArray(e){let t=[];return this.visit((o,r)=>{let i=e({...o,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(Ar);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};globalThis.DeepMap=te;function ve(){return globalThis}var _r=["#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],cc=Symbol("color"),Er=new WeakMap,Aa=Se();function Ea(n=_r){Er.set(n,n.map(e=>0))}Ea();var Xh=(n=_r)=>{let e=[];Er.has(n)?e=Er.get(n):(e=n.map(o=>0),Er.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??_r[0]},Gn=":",_a="*",uc="-",Zh=",",Qh="debug",Jh="diffdebug",fc=!1,Vn=new te,Hn=new Map;function Oa(n,e){let t=n.split(Gn),o=new te;o.set(t,!0);let r=e.split(Gn),i=new Set(r).has(_a),a=r.indexOf(_a),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(Gn)):!0}}function pc(n,e){let t=`channel=${n}_permissions=${e}`;if(Hn.has(t))return Hn.get(t);let o=e.split(Zh);function r(l){return Hn.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(_a)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(uc);if(c&&(s=s.substring(uc.length)),Oa(n,s))return r(!c)}for(let l=0;l<a.length;l++){let s=a[l],c=s.startsWith("-");if(c&&(s=s.substring(1)),Oa(n,s))return r(!c)}return r(!1)}var Fa=()=>$e.enable??(ve()&&ve().localStorage?.getItem(Qh))??"",eb=()=>$e.diffenable??(ve()&&ve().localStorage?.getItem(Jh))??`${fc}`,Na="",mc=fc;function La(n){mc=`${eb()}`=="true",Na!==n&&(Na=n,Hn.clear())}function gc(n){La(Fa()),typeof ve()<"u"&&ve().addEventListener&&ve().addEventListener("storage",function(){La(Fa())});function e(t,o){let r=o?`${o}${Gn}${t}`:t,i=r.split(Gn),a=Vn.get(i);if(a)return a;let l=Vn.get(i.slice(0,-1)),s=(l?l.logFn:$e.logFn)??hc,c=s,u,d=0,f=()=>u??pc(r,Na),p=Xh($e.colors),m=Object.defineProperties((...g)=>{let b=Aa.getListenersCount(),h;if(b>0&&(h=h??Date.now(),Aa({color:p,channel:r,args:g,timestamp:h})),f()){if(h=h??Date.now(),d&&mc){let T=h-d;c(`%c[${r}]`,`color: ${p}`,`+${T}ms:`)}d=h;let y=[],S;if(g.forEach(T=>{if(T[cc])S===void 0&&(S=!0),y.push(...T);else{if(typeof T!="string"&&typeof T!="number"){S=!1;return}y.push(`${T}%s`)}}),S){let T=[`%c[${r}]%c %s`,`color: ${p}`,"",...y,""];c(...T)}else c(`%c[${r}]%c %s`,`color: ${p}`,"",...g)}},{channel:{value:r},color:{value:(g,...b)=>{let h=[`%c${b.join(" ")}%c%s`,`color: ${g}`,""];return h.toString=()=>b.join(" "),h[cc]=!0,h}},extend:{value:g=>e(g,r)},enabled:{get:()=>f(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{Vn.delete(i)}}});return Vn.set(i,m),m}return e(n)}var hc=console.log.bind(console),dc;Object.defineProperty(gc,"enable",{get:()=>dc,set:n=>{dc=n,La(Fa())}});var $e=gc;$e.colors=_r;$e.logFn=hc;var tb=(n,e)=>Aa.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;Oa(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});$e.onLogIntent=tb;$e.isChannelEnabled=pc;$e.destroyAll=()=>{Ea(),Ea($e.colors),Vn.clear(),Hn.clear()};var Rt=n=>{let e=$e(n?`IT:${n}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},so=n=>{let e=$e(n?`IT:${n}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Kn=()=>Kn;Kn.extend=()=>Kn;var ft=class{constructor(e){this.debug=Kn,this.error=Kn}};import*as ob from"react";import{useMemo as vR,useRef as nb,useEffect as rb,useLayoutEffect as ib,useCallback as DR}from"react";var Bn=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?At(e,{wait:o}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=n.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(n),()=>{a.disconnect()}},Or=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=nb({width:0,height:0}),r=i=>{let a;return n.current&&(a=Bn(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};rb(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),ib(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};var ab=so("CSSVariableWatch"),lb=Rt("CSSVariableWatch"),sb={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},cb=n=>{let e=bc(0),t=Mo.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);Or(n.ref,t,{earlyAttach:!0}),Mo.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o!=null)return e.current=o,lb(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);ab(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},Wn=n=>{let e=bc(null);cb({...n,ref:e});let t=n.varName.startsWith("var(")?n.varName:`var(${n.varName})`,{allowInts:o=!1}=n;return Mo.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:sb},Mo.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};import{useCallback as fb,useContext as za}from"react";import{useCallback as ub,useRef as Fr,useSyncExternalStore as db}from"react";function pt(n,e,t){if(n===e)return!0;if(!n||!e)return!1;let o=typeof n;if(o!==typeof e||o!=="object")return!1;var i=Object.keys(n),a=Object.keys(e);t&&(i=i.filter(u=>!t.has(u)),a=a.filter(u=>!t.has(u)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var c=i[s];if(!(t&&t.has(c))&&(n[c]!==e[c]||!Object.prototype.hasOwnProperty.call(e,c)))return!1}return!0}function co(){let n=null,e=new Set;return{getSnapshot(){return n},setSnapshot(t){n=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}function yc(n,e,t){let o=Fr(e);o.current=e;let r=Fr(t);r.current=t;let i=Fr(void 0),a=Fr(!1),l=ub(()=>{let s=n.getSnapshot(),c=o.current(s);return a.current&&r.current(i.current,c)?i.current:(i.current=c,a.current=!0,c)},[n]);return db(n.subscribe,l,l)}function Nr(n,e){return yc(n,e,Object.is)}function tn(n,e){return yc(n,e,pt)}import*as Sc from"react";var ka;function on(){return ka||(ka=Sc.createContext(null))}var Tc=co(),Cc=()=>{};function Lr(){let n=on();return za(n)||void 0}function kr(){let n=Lr();return fb(()=>n?.getSnapshot(),[n])}function Ut(n){let e=on(),t=za(e),o=tn(t||Tc,t?n:Cc);return t?o??void 0:void 0}function Ao(){let n=on(),e=za(n),o=Nr(e||Tc,e?r=>r.masterRowInfo:Cc);return e?o:void 0}import*as nn from"react";import{useReducer as Cb,createContext as wb,useMemo as Ba,useEffect as Ib,useState as Ic,useRef as Rc,useLayoutEffect as Rb}from"react";function Va(n,e){let t=new Set;function o(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(c,u){return t.add(u),c[u]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return n.apply(this,s)}return{fn:o,propertyReads:t}}var Ga=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function uo(n){if(n==null)return!1;let e=n;return!0}function jn(n){return n!==void 0}function fo(n,e){let t=e[n];return jn(t)}import{useCallback as gb,useEffect as hb,useRef as Ha}from"react";import{useCallback as pb,useState as mb}from"react";var zt=()=>{let[n,e]=mb(0);return[n,pb(()=>{e(t=>t+1)},[e])]};var wc=n=>{let e=gb(n,[]),t=Ha(!1),o=Ha(!1),r=Ha(void 0),[i,a]=zt();t.current&&(o.current=!0),hb(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};import{useCallback as bb,useRef as yb}from"react";function _e(n){let e=yb(n);return e.current=n,bb(()=>e.current,[])}import{useRef as Sb,useLayoutEffect as Tb}from"react";var Eo=(n,e)=>{let t=Sb(e===void 0?n:e);return Tb(()=>{t.current=n}),t.current};var $n={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var Ka=class n{constructor(e){this.debugId=e;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=e=>{if(this.markerDetails.startTs)return this;let t=performance.now();return this.markerDetails.details=e?.details??[],this.markerDetails.startTs=t,this};this.end=(e={})=>{if(this.stopped)return this;this.stopped=!0;let t=e.startTs??this.markerDetails.startTs,o=e.endTs??this.markerDetails.endTs??performance.now(),r=e.color||this.markerDetails.color||"primary",i=e.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...e.details||[]],l=e.tooltip||this.markerDetails.tooltip,s=e.label||this.markerDetails.label||"Unknown",c=e.track||this.markerDetails.track||"Unknown";return performance.measure(s,{start:t,end:o,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:c,color:r,properties:a.length>0?a.map(u=>[u.name,u.value]):void 0,tooltipText:l}}}),this};this.debugId=e}static create(e){return new n(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys($n).reduce((t,o)=>{let r={start:e.start,end:i=>e.end({...i,track:$n[o].track,label:i.label}),get label(){let i=$n[o];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:c=>e.end({...c,track:i.track,label:i.labels[l]})};return Object.defineProperty(a,l,{get:()=>(e.markerDetails.label=i.labels[l],s)}),a},{})}};return Object.defineProperty(t,o,{get:()=>{let i=$n[o];return e.markerDetails.track=i.track,r}}),t},{})}};function Je(n){return Ka.create(n)}var vb=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)},Wa;function vc(){return Wa||(Wa=wb(null))}function Db(n,e,t,o,r,i,a){let l=e();return Object.keys(l).reduce((s,c)=>{let u=c;return Object.defineProperty(s,c,{set:f=>{let p=t(),m=e(),g=m[u],b=!0;if(i&&typeof i[u]=="function"&&i[u](f,{actions:s,state:m})===!1&&(b=!1),b){let S=[f],T=`on${Ga(c)}Change`;if(a&&a[u]){let C=a[u](f,m);T=C.callbackName||T,S=C.callbackParams}vb(p,T,S)}let h=o[u];typeof h=="function"&&(f=h(f));let y=!!r?.[u];fo(c,p)&&!y||n({payload:{updatedProps:null,mappedState:{[c]:f}}})}}),s},{})}function xb(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=fo(r,e)?e[r]:e[`default${Ga(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function Et(n){let e=n.getParentState||(()=>null);function t(r){let[i]=Ic(()=>n.initSetupState?n.initSetupState(r):{}),a=Rc(new Set),l=Ba(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),c=_e(s);function u(){let v={};l&&(v=xb(l,r,i));let x={...i,...v};if(n.mapPropsToState){let{fn:R,propertyReads:P}=Va(n.mapPropsToState,{getProxyTargetFromArgs:M=>M.props,putProxyToArgs:(M,D)=>[{...D,props:M}]}),A=R({props:r,state:x,oldState:null,parentState:s});return a.current=new Set([...a.current,...P]),{...x,...A}}return x}let[d]=Ic(u),f=_e(r),p=(v,x)=>{if(x.type==="REPLACE_STATE")return x.payload;let R=c?.()??null,P=x.payload.mappedState,A=x.payload.updatedPropsToState,M={...v};if(P&&Object.assign(M,P),n.mapPropsToState){let{fn:_,propertyReads:O}=Va(n.mapPropsToState,{getProxyTargetFromArgs:V=>V.props,putProxyToArgs:(V,z)=>[{...z,props:V}]}),L=_({props:f(),state:M,oldState:v,parentState:R});a.current=new Set([...a.current,...O]),Object.assign(M,L)}return x.type==="ASSIGN_STATE"&&Object.assign(M,x.payload),n.concludeReducer?n.concludeReducer({previousState:v,state:M,updatedProps:A,parentState:R}):M},[m,g]=Cb(p,d),b=_e(m),{allowedControlledPropOverrides:h}=n,y=Ba(()=>Db(g,b,f,l,h,n.interceptActions,n.mappedCallbacks),[g,l,h]),S=n.Context??vc(),T=Ba(()=>({componentState:m,componentActions:y,getComponentState:b,replaceState:v=>{g({type:"REPLACE_STATE",payload:v})},assignState:v=>{g({type:"ASSIGN_STATE",payload:v})}}),[m,y,b]),C=Eo(r),w=Rc(!1);w.current=!1;let I=n.layoutEffect?Rb:Ib;return I(()=>{let v=r,x={},R=0,P={},A=0,M={},D=0;if(new Set([...Object.keys(v),...Object.keys(C)]).forEach(L=>{let V=L,z=C[V],G=v[V];if(V!=="children"&&z!==G&&(M[V]={newValue:G,oldValue:z},D++,fo(V,r)||fo(V,C)))if(l.hasOwnProperty(L)){let E=G,F=l[L];typeof F=="function"&&(E=F(G)),m[V]!==E&&(x[V]=E,R++)}else a.current.has(L)&&(P[V]=v[V],A++)}),A>0||R>0){let L=m.debugId,V=L?Je(L).track.ComponentState.label.PropUpdate.start():void 0,z=n.debugName?typeof n.debugName=="function"?`${n.debugName(v)}:rerender`:`${n.debugName}:rerender`:"rerender";Rt(z)("Triggered by new values for the following props",...Object.keys(x??{}),...Object.keys(P??{})),V&&V.end({label:z,details:[R>0?{name:"Updated properties",value:Object.keys(x).join(", ")}:void 0,A>0?{name:"Updated props",value:Object.keys(P).join(", ")}:void 0,A>0||P?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(uo)});let E={payload:{mappedState:R?x:null,updatedPropsToState:A?P:null}};if(w.current=!0,g(E),n.onPropChange){for(var O in M)if(M.hasOwnProperty(O)){let{newValue:F,oldValue:q}=M[O];n.onPropChange({name:O,newValue:F,oldValue:q},r,y,m)}}n.onPropsChange&&D&&n.onPropsChange(M,r,y,m)}}),I(()=>{s!=null&&!w.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),wc(()=>()=>{n.cleanup?.(b())}),{contextValue:T,ContextComponent:S}}return{ManagedComponentContextProvider:nn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return nn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function _t(n){return n=n??vc(),nn.useContext(n)}import*as zc from"react";var st="Infinite",Le={rootClassName:st};var zr=()=>Le;var Dc="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",xc={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Vt="_16lm1iw3b _16lm1iw3c _16lm1iw35",Pc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},rn={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Vr={1:"_16lm1iw1c",none:"_16lm1iw1d"},Un={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Mc={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Ac={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Ec={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var _c={none:"_16lm1iwd"},Oc={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Gr={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Fc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Nc={none:"_16lm1iw1x"};var Lc={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var kc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function Vc(n){let{rootClassName:e}=zr();return zc.createElement("div",{...n,className:ee(`${e}Footer`,Gr.relative,rn.flex,Un.row,n.className)})}import*as xe from"react";import{useCallback as rp,useContext as tT,useEffect as oT,useRef as nT}from"react";import{createPortal as rT}from"react-dom";function Hr(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}function J(n){return n.slice(4,-1)}import*as Gc from"react";var ke=n=>{let e=n.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...n.style};return Gc.createElement("svg",{viewBox:"0 0 24 24",...n,style:t},n.children)};import*as Yn from"react";var Hc=n=>Yn.createElement(ke,{...n},Yn.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29"}),Yn.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Yn.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));import*as ja from"react";var Kc=n=>ja.createElement(ke,{...n},ja.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"}));import*as $a from"react";var Ua=n=>$a.createElement(ke,{...n},$a.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));import*as Ya from"react";var Bc=n=>Ya.createElement(ke,{...n},Ya.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));import*as qa from"react";var Wc=n=>qa.createElement(ke,{...n},qa.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));import*as Xa from"react";var jc=n=>Xa.createElement(ke,{...n},Xa.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));import*as Za from"react";var $c=n=>Za.createElement(ke,{...n},Za.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));import*as Qa from"react";var Uc=n=>Qa.createElement(ke,{...n},Qa.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));import*as Ja from"react";var Yc=n=>Ja.createElement(ke,{...n},Ja.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"}));import*as cl from"react";import*as nt from"react";import{useEffect as Wb,useState as Du}from"react";import*as an from"react";import{useEffect as _b,useLayoutEffect as Ob,useState as hu}from"react";function Pb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Mb(n){var e=Pb(n,"string");return typeof e=="symbol"?e:String(e)}function Ab(n,e,t){return e=Mb(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qc(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function Xc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qc(Object(t),!0).forEach(function(o){Ab(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):qc(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Zc(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var Eb=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},be=n=>{var e=t=>{var o=n.defaultClassName,r=Xc(Xc({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=n.variantClassNames[i][s];c&&(o+=" "+c)}}for(var[u,d]of n.compoundVariants)Eb(u,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return Zc(n.variantClassNames,t=>Zc(t,o=>o.split(" ")[0]))}},e};var Qc="_1eexc2a6";var Jc=be({defaultClassName:"_12zfob12c _16lm1iw1z _16lm1iw22 _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw33",variantClassNames:{filtered:{false:"_12zfob12d",true:"_12zfob12e"},verticalAlign:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"},align:{start:"_12zfob12i",end:"_12zfob12j",center:"_12zfob12k"}},defaultVariants:{},compoundVariants:[]}),eu="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",tu=be({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),ou=be({defaultClassName:"_12zfob1r",variantClassNames:{rowActive:{false:"_12zfob1s",true:"_12zfob1t"},cellSelected:{false:"_12zfob1u",true:"_12zfob1v"},rowSelected:{false:"_12zfob1w",true:"_12zfob1x",null:"_12zfob1y"},rowDisabled:{false:"_12zfob1z",true:"_12zfob110"},firstRow:{false:"_12zfob111",true:"_12zfob112"},treeNode:{parent:"_12zfob113",leaf:"_12zfob114",false:"_12zfob115"},firstRowInHorizontalLayoutPage:{false:"_12zfob116",true:"_12zfob117"},groupRow:{false:"_12zfob118",true:"_12zfob119"},groupCell:{false:"_12zfob11a",true:"_12zfob11b"},align:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},verticalAlign:{start:"_12zfob11f",end:"_12zfob11g",center:"_12zfob11h"},zebra:{false:"_12zfob11i",even:"_12zfob11j",odd:"_12zfob11k"},dragging:{true:"_12zfob11l",false:"_12zfob11m"},insideDisabledDraggingPage:{true:"_12zfob11n",false:"_12zfob11o"},first:{true:"_12zfob11p",false:"_12zfob11q"},last:{true:"_12zfob11r",false:"_12zfob11s"},groupByField:{true:"_12zfob11t",false:"_12zfob11u"},firstInCategory:{true:"_12zfob11v",false:"_12zfob11w"},lastInCategory:{true:"_12zfob11x",false:"_12zfob11y"},pinned:{start:"_12zfob11z",end:"_12zfob120",false:"_12zfob121"},filtered:{true:"_12zfob122",false:"_12zfob123"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob124"],[{pinned:"end",firstInCategory:!0},"_12zfob125"],[{pinned:!1,lastInCategory:!0},"_12zfob126"]]}),nu=be({defaultClassName:"_12zfob1c _16lm1iw1s _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1d",end:"_12zfob1e",false:"_12zfob1f"},firstInCategory:{true:"_12zfob1g",false:"_12zfob1h"},lastInCategory:{true:"_12zfob1i",false:"_12zfob1j"},overflow:{true:"_12zfob1k",false:"_12zfob1l"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1m"],[{pinned:"start",firstInCategory:!0},"_12zfob1n"],[{overflow:!0,pinned:"end"},"_12zfob1o"],[{pinned:"end",lastInCategory:!0},"_12zfob1p"]]}),ru="_12zfob12u _16lm1iw22 _16lm1iw1z";var iu="_12zfob17",au="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",lu=be({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),el=be({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),su="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",cu=be({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),uu="_12zfob1b _16lm1iw2",du="_16lm1iw1",fu="_12zfob16",pu=be({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),mu="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var yt="InfiniteIcon";var gu="_6aunoi0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Fb={transition:"width 0.25s, opacity 0.25s"};function ln(n){let[e,t]=hu(!0),[o,r]=hu(0),{lineWidth:i=1,style:a,className:l,index:s}=n,c=s!=null&&s>0,u=n.size??16,d=Math.floor(u/4),f=[u-1*d,u-2*d,u-3*d],p={...Fb,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if(_b(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),Ob(()=>{t(!0)},[]),!e)return null;let m={};return an.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:ee(l,yt,gu,`${yt}-filter`)},c?an.createElement("div",{"data-name":"index",style:m,className:iu},s):null,an.createElement("div",{style:{width:f[0],...p}}),an.createElement("div",{style:{width:f[1],...p}}),an.createElement("div",{style:{width:f[2],...p}}))}var tl=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((I,v)=>{let x=I.maxSize??r??void 0,R=I.minSize??o??void 0;s.push(R),c.push(x),I.size!=null&&(x!=null&&I.size>x&&(I.size=x),R!=null&&I.size<R&&(I.size=R));let P=I.flex==0?null:I.flex;if(I.size==null&&P==null)throw`Items must specify either a size or a flex property. Item at index ${v} doesn't have either of those.`;P!=null&&(l+=1),a+=P??0,i+=I.size??0});let u=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,f={},p={},m=0;t.forEach((I,v)=>{if(I.flex!=null){let x=d*I.flex,R=I.maxSize??r??void 0,P=I.minSize??o??void 0,A=!1,M=0;R!=null&&x>R&&(f[v]=!0,A=!0,M=R),P!=null&&x<P&&(p[v]=!0,A=!0,M=P),A&&(m+=1,l-=1,a-=I.flex,u-=M)}}),m&&(d=u/a);let g=[],b=0,h=u,y=a,S=0,T=0,C=[];return{items:t.map((I,v)=>{let x={...I},R=I.maxSize??r??void 0,P=I.minSize??o??void 0,A=0,M=f[v],D=p[v],_=M||D,O=I.size??0;if(I.flex!=null){if(_)D&&(A=P),M&&(A=R);else{b+=1;let L=V=>(R!=null&&V>R&&(V=R),P!=null&&V<P&&(V=P),V);b===l?A=L(h):(A=L(Math.round(I.flex*d)),T+=A,h=u-T,y-=I.flex,d=h/y)}O=A,x.flexSize=A}return g.push(A),C.push(O),x.computedSize=O,S+=O,x}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:C,remainingSize:Math.round(e-S)}};function Kr(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}var ol=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((R,P)=>(R[P]={...n.columnSizing[P]},R),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],c=l.id,u=s?.id,d=l.computedWidth,f=l.computedMinWidth,p=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,b=s?.computedMinWidth,h=s?.computedMaxWidth,y=s?.computedFlex?"flex":"width",S=!1,T=!1,C=r>0?1:-1,{value:w,clamped:I,diff:v}=Kr(d+r,f,p,C);if(n.shareSpaceOnResize){if(s==null)return o[c]={...o[c],[m]:w},T=I==="min",S=I==="max",{adjustedDiff:w-d,reservedWidth:t,columnSizing:o,minReached:T,maxReached:S,constrained:T||S};let{value:R,clamped:P,diff:A}=Kr(g-r,b,h,C);if(I&&P&&(Math.abs(v)>Math.abs(A)?P=!1:I=!1),!(!I&&!P)){if(I){let M=Kr(g-r-v,b,h,C);R=M.value,P=M.clamped,A=M.diff}else if(P){let M=Kr(d+r+A,f,p,C);w=M.value,I=M.clamped,v=M.diff}}o[c]={...o[c],[m]:w},o[u]={...o[u],[y]:R},T=I==="min"||P==="min",S=I==="max"||P==="max"}else o[c]={...o[c],[m]:w},T=I==="min",S=I==="max";let x=w-d;return{adjustedDiff:x,reservedWidth:n.shareSpaceOnResize?t:t-x,columnSizing:o,minReached:T,maxReached:S,constrained:T||S}};function bu(n,e){return n+e}function Nb(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var yu=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((h,y)=>(h[y]={...n.columnSizing[y]},h),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((h,y)=>n.dragHandlePositionAfter-y).reverse(),a=i.map(h=>n.items[h]),l=a.map(h=>h.computedWidth),s=a.map(h=>h.computedFlex?"flex":"width"),c=0,{computedSizes:u}=tl({items:a.map(h=>(h.resizable===!1&&(c+=h.computedWidth),{maxSize:h.computedMaxWidth,minSize:h.computedMinWidth,flex:h.resizable?h.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(bu,0)+r-c,0)}),d=a.map((h,y)=>u[y]-h.computedWidth),f=!0,p=!0,m=!0,g=[];d.forEach((h,y)=>{let S=a[y];if(!S.resizable){g.push(0);return}let T=s[y],C=l[y],w=Nb(o),{maxReached:I,minReached:v,constrained:x,adjustedDiff:R}=ol({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:h,dragHandlePositionAfter:i[y],shareSpaceOnResize:!1,items:n.items,columnSizing:w});o[S.id]={...w[S.id],[T]:C+R},g.push(R),I||(p=!1),v||(f=!1),x||(m=!1)});let b=g.reduce(bu,0);return{minReached:f,maxReached:p,constrained:m,adjustedDiffs:g,adjustedDiff:b,columnSizing:o,reservedWidth:t-b}};var Br;function po(){if(Br!=null)return Br;let n=ve().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),Br=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Br}var Su=["start",void 0,"end"],Tu=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Su.indexOf(r)-Su.indexOf(i)}),n);function Cu(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function nl(n,...e){return Cu(t=>t!=null,n,...e)}function wu(n,e,...t){return Cu((o,r)=>!(r in n),e,...t)}var Wr=Object.freeze({}),Lb={string:Wr,number:{}};function rl(n,e){let t=e.default||Wr;return n.type===void 0?t:n.type===null?Wr:typeof n.type=="string"?e[n.type]||Lb[n.type]||Wr:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var jr=!0,kb=!0,zb=!0,Vb="string",sn="unknown",Gb=so("getComputedVisibleColumns"),Hb=(n,e,t)=>n[t]!==!1,il=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1},Iu=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:c,pinnedEndMaxWidth:u,filterValue:d,sortable:f,sortInfo:p,multiSort:m,filterTypes:g=_o,viewportReservedWidth:b,resizableColumns:h,draggableColumns:y,columnDefaultDraggable:S,columnOrder:T,columnPinning:C,editable:w,columnDefaultEditable:I,columnDefaultFilterable:v,columnDefaultGroupable:x,columnDefaultSortable:R,columnSizing:P,columnTypes:A,columnVisibility:M,columnVisibilityAssumeVisible:D,groupBy:_})=>{let O=0,L={};_.forEach((j,le)=>{j.field&&(L[j.field]=le)});let V=(d||[]).reduce((j,le)=>{let{id:ce,field:ye}=le;return ye&&(j[ye]=le),ce&&(j[ce]=le),j},{}),z=Tu(T===!0?Object.keys(n):T,C),G=z.filter(j=>n[j]?Hb(M,D,j):(Gb(`Column with id "${j}" specified in columnOrder array cannot be found in the columns map.`),!1)),E=new Map,F=G.map((j,le)=>{let ce=n[j];return E.set(j,le),ce}),q=(p??[]).reduce((j,le,ce)=>(le.id?j[le.id]={sortInfo:le,index:ce}:le.field&&(j[le.field]={sortInfo:le,index:ce}),j),{});function B(j){let le=n[j],ce=rl(le,A),ye={minWidth:ce?.minWidth,maxWidth:ce?.maxWidth,width:ce?.defaultWidth,flex:ce?.defaultFlex},Ue=nl({width:le?.defaultWidth,flex:le?.defaultFlex,minWidth:le?.minWidth,maxWidth:le?.maxWidth},P[j]);Ue.width!=null&&delete ye.flex,Ue.flex!=null&&delete ye.width,Ue=nl(ye,Ue);let ae=Ue.flex??void 0,W=Ue.minWidth??le?.minWidth??t,tt=Ue.maxWidth??le?.maxWidth??o,Ce=ae!=null?void 0:Ue.width??(i?void 0:r);return!Ce&&ae==null&&(i?ae=i:Ce=W),{size:Ce,flex:ae,minSize:W,maxSize:tt}}let U=tl({availableSize:Math.max(e.width-(b??0)-(a??po()),0),maxSize:o,minSize:t,items:G.map(B)}),{computedSizes:ne,flexSizes:me,minSizes:he,maxSizes:ie}=U,ue=[],fe=[],Y=[],k=[];k.length=G.length;let $=new Map,K=new Map,X=0,oe=0,H=0,se=null,N=[],Q=0,de=0,pe=0;F.forEach((j,le)=>{let ce=G[le],ye=ne[le],Ue=N[le]=il(ce,C);Ue==="start"?Q+=ye:Ue==="end"?pe+=ye:de+=ye});let Pe=e.width-pe,Me=[],Ve=new Map;G.forEach((j,le)=>{let ce=F[le];Ve.set(j,ce)});let Fe=[];Object.keys(n).forEach(j=>{let le=n[j];Fe.push(j),Ve.has(j)||Ve.set(j,le)});let Ne=new Map;Ve.forEach((j,le)=>{let ce=E.get(le);ce==null&&(ce=-1);let ye=ce!=-1,Ue=G[ce+1],ae=rl(j,A),W=ce,tt=q[le]?q[le]:j.field?q[j.field]??null:null,Ce=tt?.sortInfo??null,ot=!!Ce,bt=ot&&Ce.dir===1,Pt=ot&&!bt,Ln=tt?.index??-1,Jo=ye?{}:B(le),kn=ye?ne[ce]:Jo.size||0,Ia=ye&&me[ce]||null,Ra=ye?he[ce]||0:Jo.minSize||0,va=ye?ie[ce]||1e4:Jo.maxSize||1e4,it=ye?il(le,C):!1,Pr=ye?ce===G.length-1:!1,Ae=W,at=ye?it==="start"?oe:it==="end"?H:O-oe:0;it=="start"?Ae=ye?W:-1:it==="end"?Ae=ye?W-(ue.length+Y.length):-1:Ae=ye?W-ue.length:-1;let $t=ye?it==="start"||it===!1?O:Pe+H:-1,Mt=ye?it!==se:!1,zn=ye?Pr||it!==il(Ue,C):!1,oc=j.cssEllipsis??ae.cssEllipsis??l,Lh=j.headerCssEllipsis??ae.cssEllipsis??j.cssEllipsis??ae.headerCssEllipsis??s??oc,Mr=ye&&(V[le]||j.field||j.groupByForColumn)&&(V[le]||V[j.field||j.groupByForColumn])||null,kh=j.defaultFilterable??ae.defaultFilterable??v??!0,zh=w??j.defaultEditable??ae.defaultEditable??I??!1,Da=j.dataType||ae.dataType||(Array.isArray(j.type)?j.type[0]:j.type)||Vb,Vh=j.sortType||ae.sortType||Da,nc=j.filterType||ae.filterType||Da,rc=!1;if(Mr!=null&&!Mr.disabled){let Ma=g[nc];Ma&&(!Ma.emptyValues||!Ma.emptyValues.includes(Mr.filter.value))&&(rc=!0)}let Po=j.field??ae.field,ic=j.valueGetter??ae.valueGetter,xa=j.defaultGroupable??ae.defaultGroupable??x??!!Po;Po||(xa=!1),j.groupByForColumn&&(xa=!1);let Pa=j.defaultSortable??ae.defaultSortable;Pa==null&&!j.groupByForColumn&&Po==null&&ic==null&&(Pa=!1);let ac=Po?L[Po]!==void 0:!1,Gh=ac?L[Po]:void 0,Hh=f??Pa??R??jr,Kh=j.resizable??ae.resizable??h??kb,Ye={colType:ae,align:ae.align,headerAlign:ae.headerAlign,computedVisible:ye,verticalAlign:ae.verticalAlign,defaultHiddenWhenGroupedBy:ae.defaultHiddenWhenGroupedBy,valueGetter:ic,valueFormatter:ae.valueFormatter,renderValue:ae.renderValue,render:ae.render,style:ae.style,className:ae.className,contentFocusable:ae.contentFocusable,renderMenuIcon:ae.renderMenuIcon,renderSortIcon:ae.renderSortIcon,renderRowDetailIcon:ae.renderRowDetailIcon,renderSelectionCheckBox:ae.renderSelectionCheckBox,renderHeaderSelectionCheckBox:ae.renderHeaderSelectionCheckBox,headerStyle:ae.headerStyle,headerClassName:ae.headerClassName,columnGroup:ae.columnGroup,getValueToEdit:ae.getValueToEdit,getValueToPersist:ae.getValueToPersist,shouldAcceptEdit:ae.shouldAcceptEdit,field:Po,...j,components:{...ae.components,...j.components},computedResizable:Kh,computedMinWidth:Ra,computedMaxWidth:va,computedFlex:Ia,computedDataType:Da,computedEditable:zh,computedSortType:Vh,computedFilterType:nc,cssEllipsis:oc,headerCssEllipsis:Lh,computedFilterValue:Mr,computedFiltered:rc,computedFilterable:kh,computedGroupable:xa,computedGroupedBy:ac,computedGroupedByIndex:Gh,computedWidth:kn,computedAbsoluteOffset:$t,computedPinningOffset:at,computedVisibleIndexInCategory:Ae,computedOffset:O,computedSortable:Hh,computedSortInfo:Ce,computedSortIndex:Ln,computedMultiSort:m,computedSorted:ot,computedSortedAsc:bt,computedSortedDesc:Pt,computedVisibleIndex:W,computedPinned:it,computedDraggable:y??j.defaultDraggable??S??zb,computedFirstInCategory:Mt,computedLastInCategory:zn,computedFirst:ce===0,computedLast:Pr,id:le,header:j.header??ae.header??j.name??j.field};ye&&(O+=kn,$.set(Ye.id,Ye),k[ce]=Ye,it==="start"&&(ue.push(Ye),oe+=Ye.computedWidth),it==="end"&&(fe.push(Ye),H+=Ye.computedWidth),it||(Y.push(Ye),X+=Ye.computedWidth),se=it),Ye.groupByForColumn&&(Ye.computedSortType=j.sortType||ae.sortType||sn,Me.push(Ye)),K.set(Ye.id,Ye),Ye.field&&!Ye.groupByForColumn&&!Ne.has(Ye.field)&&Ne.set(Ye.field,Ye)}),Me.forEach(j=>{j.computedSortable=Ru(j,{fieldsToColumn:Ne,sortable:f,columnDefaultSortable:R})});let Ke=new Map;Fe.forEach(j=>{let le=K.get(j);le&&Ke.set(j,le)}),K.forEach(j=>{Ke.has(j.id)||Ke.set(j.id,j)});let Xe=c!=null?Math.min(c,oe):oe,Ze=u!=null?Math.min(u,H):H;return{computedRemainingSpace:e.width-(Q+pe+de),computedPinnedStartColumnsWidth:oe,computedPinnedEndColumnsWidth:H,computedUnpinnedColumnsWidth:X,computedColumnOrder:z,computedPinnedStartColumns:ue,computedPinnedEndColumns:fe,computedUnpinnedOffset:oe,computedPinnedEndOffset:oe+X,computedUnpinnedColumns:Y,computedVisibleColumns:k,computedColumnsMap:K,computedColumnsMapInInitialOrder:Ke,computedVisibleColumnsMap:$,computedPinnedEndWidth:Ze,computedPinnedStartWidth:Xe,renderSelectionCheckBox:k.reduce((j,le)=>j||!!le.renderSelectionCheckBox,!1),fieldsToColumn:Ne}};function Ru(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r}=e;if(t)return t;let i=n.defaultSortable??n.colType.defaultSortable;if(i!=null)return i;let a=r??jr;return n.computedSortType!==sn&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((f,p)=>{if(!f)return!1;let m=p.field||p.groupField,g;if(m){let b=o.get(m),h=b?u.getColumnApi(b.id):void 0;b&&h?g=h.isSortable():g=!1}return g===void 0&&p.valueGetter&&(g=!0),g??r??jr},!0)}}function ct(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)}};return l}function Oo(n,e,t){let o=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:f,selectionMode:p}=u,m=i(),g=o.header&&typeof o.header!="function"?o.header:o.name||o.id||"";if(typeof o.header=="function"){let b=ct(o.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=o.header({horizontalLayoutPageIndex:null,column:o,columnApi:b,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:o.computedSortInfo,columnFilterValue:o.computedFilterValue,filtered:o.computedFiltered,allRowsSelected:d,someRowsSelected:f,selectionMode:p,api:r,renderBag:{header:g}})??null}return g}import*as vu from"react";var $r=`${st}HeaderCell__filter`,al=`${st}HeaderCell__filterOperator`,ll=vu.createContext(null);import{useContext as Bb}from"react";import{createContext as Kb}from"react";var sl;function Ur(){return sl||(sl=Kb(null))}function re(n){let e=Ur(),t=Bb(e);return tn(t,n)}function Ge(){return re(n=>({getState:n.getState,actions:n.actions,getComputed:n.getComputed,getDataSourceState:n.getDataSourceState,dataSourceApi:n.dataSourceApi,dataSourceActions:n.dataSourceActions,api:n.api,getDataSourceMasterContext:n.getDataSourceMasterContext}))}var jb=`${$r}__input`,Yr=n=>n.stopPropagation();function xu(n){let{filterOperatorMenuVisibleForColumnId:e}=re(u=>({filterOperatorMenuVisibleForColumnId:u.state.filterOperatorMenuVisibleForColumnId})),{column:t}=qr(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=Du(!1),l=nt.useCallback(()=>{a(!0)},[]),s=nt.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return nt.createElement("div",{onPointerUp:Yr,onPointerDown:Yr,onFocus:l,onBlur:s,className:`${$r} ${el({active:c})}`,style:{height:n.columnHeaderHeight}},nt.createElement(ll.Provider,{value:n},nt.createElement(r,null),nt.createElement(o,null)))}function Pu(){let{columnApi:n,disabled:e,operator:t}=qn(),o=t?.components?.Icon??ln;return nt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:ee(al,au,e?`${al}--disabled`:"")},nt.createElement(o,{size:20,className:`${lu({disabled:e})}`}))}function Mu(){return nt.createElement("div",{onPointerUp:Yr,onPointerDown:Yr,className:`${$r} ${el({active:!1})} ${Mc["50%"]}`})}function qn(){let n=Ge(),{column:e,columnApi:t}=qr(),o=Oo(e,n,"column-filter"),r=nt.useContext(ll),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=Du(l?.filter.value??""),d=nt.useCallback(b=>{u(b),r.onChange(b)},[r.onChange]),f=nt.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),p=nt.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);Wb(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let b=[...s.emptyValues][0];b!==c&&u(b)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:n.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:c,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:f,removeColumnFilter:p,ariaLabel:`Filter for ${o}`,className:`${ru} ${jb}`}}function cn(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=qn();return cl.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function Xr(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=qn();return cl.createElement("input",{"aria-label":n,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:o})}function $b(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:cn},operators:[{name:"includes",components:{Icon:Hc},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:Ua},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:Yc},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Kc},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Xr},operators:[{label:"Equals",components:{Icon:Ua},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:Uc},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:Wc},fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>t},{name:"gte",components:{Icon:Bc},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>=t},{name:"lt",components:{Icon:$c},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<t},{name:"lte",components:{Icon:jc},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<=t}]}}}var _o=$b();function Zr(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as fd,useState as pd}from"react";import{flushSync as by}from"react-dom";function mo(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function Au(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}var Z={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var Eu="true",ge={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},_u="column-header-height";var Ou=`.${Le.rootClassName}`;function ul(n){return mo(n,Ou)}var Fu=J(Z.scrollLeft),Ub=J(Z.scrollTop),Yb=J(Z.columnWidthAtIndex),dl=J(Z.columnOffsetAtIndex),Nu=J(Z.columnReorderEffectDurationAtIndex),qb=J(Z.columnOffsetAtIndexWhileReordering),Xb=J(Z.columnVisibilityAtIndex),Zb=J(Z.columnZIndexAtIndex);function Gt(n,e,t){let o=t?ul(t):document.querySelector(Ou);Qb(n,e,o)}function Qb(n,e,t){if(t){let o=n,r=Z[o]?J(Z[o]):n;t.style.setProperty(r,`${e}`)}}function un(n,e){if(e)for(var t in n){let o=Z[t]?J(Z[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function fl(n,e,t){Gt(`${dl}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${Fu}))`:`${n.computedAbsoluteOffset+e}px`,t)}function pl(n,e,t){Gt(`${Zb}-${n}`,`${e}`,t)}function Xn(n,e,t){Gt(`${qb}-${n}`,typeof e=="number"?`calc( var(${dl}-${n}) + ${e}px )`:e,t)}function Zn(n,e,t){Gt(`${Xb}-${n}`,e,t)}function Qr(n,e,t){Gt(`${Nu}-${n}`,t??"",e)}function ml(n,e){let t=`${Nu}-${n}`;Gt(t,ge.components.Cell.reorderEffectDuration,e)}var we={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${Yb}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Gt(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${dl}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Gt(this.varName.get(n),e,t)}}};function Lu(n,e){un({[Fu]:`${n.scrollLeft}px`,[Ub]:`${n.scrollTop}px`},e)}var ku="_16lm1iw1",zu="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Vu="_1yeub2vs",Gu="_1yeub2vr",Hu=be({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var gl="_1yeub2vp";var Jx=be({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var hl=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};var Qn={bodyWidth:{name:J(ge.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:J(ge.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:J(ge.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:J(ge.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:J(ge.runtime.browserScrollbarWidth),value:""}},Jb=J(Z.scrollbarWidthHorizontal),Ku=J(Z.scrollbarWidthVertical),ey=J(Z.columnWidthAtIndex),ty=J(Z.columnZIndexAtIndex),Bu=J(Z.scrollLeft),oy=J(Z.activeCellColWidth),Wu=J(Z.activeCellColOffset),Yu=J(Z.baseZIndexForCells),ny=J(Z.pinnedStartWidth),ju=J(Z.bodyWidth),ry=J(Z.bodyHeight),$u=J(Z.pinnedEndOffset),Uu=J(Z.pinnedEndWidth),iy=J(Z.computedVisibleColumnsCount);function bl(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${Yu}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function qu(n){let e=po(),{actions:t,getState:o,focused:r,focusedWithin:i,domRef:a,scrollerDOMRef:l,onBlurWithin:s,onFocusWithin:c,onSelfFocus:u,onSelfBlur:d,bodySize:f,activeCellIndex:p,wrapRowsHorizontally:m,computedPinnedStartColumnsWidth:g,computedPinnedEndColumnsWidth:b,computedPinnedStartColumns:h,computedPinnedEndColumns:y,computedVisibleColumns:S,computedUnpinnedColumnsWidth:T,scrollbars:C,focusedClassName:w,focusedWithinClassName:I,computedPinnedStartOverflow:v,computedPinnedEndOverflow:x,focusedStyle:R,focusedWithinStyle:P,brain:A}=re(E=>{let{state:F,computed:q}=E;return{brain:F.brain,actions:E.actions,getState:E.getState,focused:F.focused,focusedWithin:F.focusedWithin,domRef:F.domRef,scrollerDOMRef:F.scrollerDOMRef,onBlurWithin:F.onBlurWithin,onFocusWithin:F.onFocusWithin,onSelfFocus:F.onSelfFocus,onSelfBlur:F.onSelfBlur,bodySize:F.bodySize,activeCellIndex:F.activeCellIndex,wrapRowsHorizontally:F.wrapRowsHorizontally,computedPinnedStartColumnsWidth:q.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:q.computedPinnedEndColumnsWidth,computedPinnedStartColumns:q.computedPinnedStartColumns,computedPinnedEndColumns:q.computedPinnedEndColumns,computedVisibleColumns:q.computedVisibleColumns,computedUnpinnedColumnsWidth:q.computedUnpinnedColumnsWidth,scrollbars:q.scrollbars,focusedClassName:E.state.focusedClassName,focusedWithinClassName:E.state.focusedWithinClassName,computedPinnedStartOverflow:q.computedPinnedStartOverflow,computedPinnedEndOverflow:q.computedPinnedEndOverflow,focusedStyle:E.state.focusedStyle,focusedWithinStyle:E.state.focusedWithinStyle}}),M=[],D=S.reduce((E,F)=>{let q=F.computedVisibleIndex;E[we.columnWidths.varName.get(q)]=F.computedWidth+"px",E[we.columnOffsets.varName.get(q)]=F.computedPinned==="start"?`calc( ${F.computedOffset}px + var(${Bu}) )`:F.computedPinned==="end"?`calc( var(${$u}) ${M.length?"+":""} ${M.map(U=>we.columnWidths.get(U.computedVisibleIndex)).join(" + ")} + var(${Bu}) )`:`${F.computedOffset}px`;let B=bl(F,{pinnedStartColsCount:h.length,visibleColsCount:S.length});return E[`${ty}-${q}`]=`${B}`,F.computedPinned==="end"&&M.push(F),E},{});if(f.width&&(D[Qn.browserScrollbarWidth.name]=`${po()}px`),D[Qn.bodyWidth.name]=`calc(${Z.bodyWidth} - ${Z.scrollbarWidthVertical})`,D[Qn.totalVisibleColumnsWidthValue.name]=`${g+b+T}px`,D[Qn.totalVisibleColumnsWidthVar.name]=`calc(${S.map((E,F)=>`var(${ey}-${F})`).join(" + ")})`,D[Qn.visibleColumnsCount.name]=S.length,p!=null){D[oy]=we.columnWidths.get(p[1]);let E=we.columnOffsets.get(p[1]);if(A.isHorizontalLayoutBrain){let F=A.getPageIndexForRow(p[0]);D[Wu]=F?`calc( ${ge.runtime.totalVisibleColumnsWidthVar} * ${F} + ${E})`:E}else D[Wu]=E}D[iy]=S.length,D[Jb]=C.horizontal?`${e}px`:"0px",D[Ku]=C.vertical?`${e}px`:"0px",D[ny]="calc( "+h.map(E=>we.columnWidths.get(E.computedVisibleIndex)).join(" + ")+")",D[Uu]="calc( "+y.map(E=>we.columnWidths.get(E.computedVisibleIndex)).join(" + ")+")",D[Yu]=S.length*10,D[$u]=`calc( var(${ju}) - var(${Uu}) - var(${Ku}) )`,D[ju]=`${f.width}px`,D[ry]=`${f.height}px`;let _=hl(E=>{t.focused=E}),O=hl(E=>{t.focusedWithin=E}),z={...n,onFocus:E=>{if(n?.onFocus?.(E),E.target===a.current||E.target===l.current){if(o().focused)return;_(!0),u?.(E),i&&(O(!1),s?.(E));return}i||(O(!0),c?.(E))},onBlur:E=>{if(n?.onBlur?.(E),E.target===a.current||E.target===l.current){if(!o().focused)return;_(!1),d?.(E),i&&(O(!1),s?.(E));return}a.current?.contains(E.relatedTarget)||(O(!1),s?.(E))}},G=ee(Yt,zu,m?`${Yt}--horizontal-layout`:null,z?.className,g?`${Yt}--has-pinned-start ${Gu}`:null,b?`${Yt}--has-pinned-end ${Vu}`:null,r?`${Yt}--focused`:null,i?`${Yt}--focused-within`:null,r&&w?w:null,i&&I?I:null,v?`${Yt}--has-pinned-start-overflow`:null,x?`${Yt}--has-pinned-end-overflow`:null,Hu({horizontalLayout:!!m,hasPinnedStart:!!g,hasPinnedEnd:!!b,focused:r,focusedWithin:i}));return z.className=G,z.style={...n?.style,...D},r&&R&&Object.assign(z.style,R),i&&P&&Object.assign(z.style,P),z}var rd=en(Fo());function Jr(n){return n.map(e=>e instanceof go?e:new go(null,[e]))}var go=class n{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new n("+",[this,...e])}subtract(...e){return new n("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new n("*",[this,...e])}divide(...e){return new n("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>ay(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function ay(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var ly=(...n)=>new go("+",Jr(n)),Zu=(...n)=>new go("-",Jr(n)),sy=(...n)=>new go("*",Jr(n)),cy=(...n)=>new go("/",Jr(n)),Jn={add:ly,subtract:Zu,minus:Zu,multiply:sy,divide:cy};var No=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var ze=ve().requestAnimationFrame||(n=>setTimeout(n,16)),Ot=ve().cancelAnimationFrame||(n=>clearTimeout(n));var Qu=n=>{let e=null,t=null;return{stop(){e!==null&&Ot(e),t!=null&&Ot(t)},scroll(o){e!==null&&Ot(e),t!=null&&Ot(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return o.scrollLeft=o.scrollLeft-f,e=ze(()=>{i.scroll(o)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return o.scrollLeft=o.scrollLeft+f,t=ze(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var Be=class n{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new n(e)}static from(e){return new n(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,o=e.left-this.left;return{top:t,left:o}}};function Ju(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function ed(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function uy(n,e,t){let o=Ju(n,t),r=Ju(e,t);return o===r?ed(t,e)-ed(t,n):o-r}function td(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>uy(o,r,t)),e}function dy(n){if(n.length<2)return!1;let e=n[0].left,t=n[0].top,o={left:!1,top:!1};for(let r=1,i=n.length;r<i;r++){if(o.left&&o.top)return!1;n[r].left!==e&&(o.left=!0),n[r].top!==t&&(o.top=!0)}return!(o.left&&o.top)}function fy(n,e){if(n.length<2)return n[0]?n[0].left===e.left&&n[0].top===e.top:!1;n=td(n);let t=n[0],o=n[n.length-1];return t.left===o.left?e.left===t.left&&e.top>=Math.min(t.top,o.top)&&e.top<=Math.max(t.top,o.top):e.top===t.top&&e.left>=Math.min(t.left,o.left)&&e.left<=Math.max(t.left,o.left)}function od(n,e){if(dy(n))return fy(n,e);n=td(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(py([t,i,a],e))return!0}return!1}function py(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var dn=class{containsPoint(e){return od(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var fn=class n extends dn{static clone(e){return new n(e)}constructor(e){super(),this.points=e.map(Be.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function my(n,e){let t=Math.min(n.left,e.left),o=Math.min(n.top,e.top),r=n.left+n.width,i=e.left+e.width,a=Math.max(r,i),l=n.top+n.height,s=e.top+e.height,c=Math.max(l,s);return new De({top:o,left:t,width:a-t,height:c-o})}var De=class n extends dn{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new n(t)}static clone(t){return new n(t)}static from(t){return n.clone(t)}static fromPoint(t){return n.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let o=this;for(let r of t)o=my(o,r);return o}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new fn(this.getPoints()).containsPoint(t)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Be.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var nd=10,gy=J(Z.pinnedStartWidth);function id(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:f,setProxyPosition:p,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:b,horizontalLayoutPageIndex:h,pageWidth:y}=n;function S(k){let $=k==="start"?V:z;return _===L?$:L===k?$+M.computedWidth:_===k?$-M.computedWidth:$}function T(k){if(k.columnIndex===D||h!=null)return!0;let $=e[k.columnIndex];if($.computedPinned)return!0;let K=l.getScrollPosition().scrollLeft,X=$.computedOffset+(h!=null&&y!=null?y*h:0);return X>=K+S("start")&&X+$.computedWidth<=K+u.width-S("end")}let C=(k,$)=>{let{restrictToParentGroup:K,dragColumn:X}=$,oe=[];if(k.forEach(se=>{if(se.computedVisibleIndex===D)return;let N={columnId:se.id,columnIndex:se.computedVisibleIndex,offsetX:se.computedOffset+Math.round(se.computedWidth/2)};T(N)&&oe.push(N)}),K){let N=function(de,pe,Pe){let Me=k[de];Me&&(Me.columnGroup!==X.columnGroup&&Pe.add(Me.id),N(de+pe,pe,Pe))};var H=N;let se=X.computedVisibleIndex,Q=new Set;N(se-1,-1,Q),N(se+1,1,Q),oe=oe.filter(de=>!Q.has(de.columnId))}return oe},I=r.length,v={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},x={left:v.clientX-u.left-(v.clientX-s.left)+nd,top:v.clientY-u.top-(v.clientY-s.top)+nd},R=l.getScrollPosition(),P=e.map(k=>k.computedVisibleIndex),A=P,M=t.get(i),D=M.computedVisibleIndex,_=M?.computedPinned,O=D,L=_,V=l.getFixedStartColsWidth(),z=l.getFixedEndColsWidth(),G=v,E={x:0,y:0},F=1,q=0;function B(k){let $=Math.round(k.clientX),K=Math.round(k.clientY);if($===G.clientX&&K===G.clientY)return De.from(s).shift({left:E.x,top:E.y});G={clientX:$,clientY:K};let oe=l.getScrollPosition().scrollLeft-R.scrollLeft;return E.x=G.clientX-v.clientX,E.y=G.clientY-v.clientY,q=E.x+oe,F=q<0?-1:1,p({left:x.left+E.x,top:x.top+E.y}),De.from(s).shift({left:E.x,top:E.y})}function U(k){let $=0;_?_==="start"&&k.forEach((K,X)=>{$||e[K]?.computedPinned!=="start"&&($=X)}):k.forEach((K,X)=>{e[K]?.computedPinned==="start"&&($=X+1)}),I=$,ne("start",k,$)}function ne(k,$,K){if(k==="start"){let X=0;for(let oe=0;oe<K;oe++){let H=$[oe],se=e[H];X+=se.computedWidth}Gt(gy,`${X}px`,a)}}function me(k){if(k==null||k===O)return;if(O===-1&&k!==-1&&(Zn(D,"",a),m(!1)),O=k,k===-1){he(D);return}let $=No(P,D,O>D?O-1:O);I=0;let X=new Set;return $.forEach((oe,H)=>{let se=A[H];oe!==se&&X.add(oe),U($)}),A=$,ie(X),{newColumnIndexes:$,indexesWithTransition:X,pinnedStartCount:I}}function he(k){A=A.filter(K=>K!==k),e.forEach(K=>{let X=K.computedVisibleIndex,oe=X>k;ml(X,a);let H="";oe&&(H=Jn.minus(we.columnOffsets.get(X),we.columnWidths.get(k)).done()),Xn(X,H,a)}),Zn(k,"hidden",a),m(!0)}function ie(k){e.forEach($=>{let K=$.computedVisibleIndex;k.has(K)?ml(K,a):Qr(K,a);let X=K===D,oe=F===-1?K<O||K>D:K<D||K>=O,H="";F===-1?H=X?we.columnOffsets.get(O):oe?we.columnOffsets.get(K):Jn.add(we.columnOffsets.get(K),we.columnWidths.get(D)).done():H=oe?we.columnOffsets.get(K):X?Jn.add(we.columnOffsets.get(O-1),we.columnWidths.get(O-1)).minus(we.columnWidths.get(D)).done():Jn.minus(we.columnOffsets.get(K),we.columnWidths.get(D)).done(),Xn(K,H,a)})}let ue=u.left+S("start"),fe=u.right-S("end"),Y=Qu({scrollOffsetStart:ue,scrollOffsetEnd:fe});return B(v),{speedScroller:Y,stop(){Y.stop()},onMove(k){let $=B(k);if(g().dropTargetListId==="grouping-toolbar"||f&&!d.containsPoint($.getCenter()))return f&&me(-1),null;Y.scroll({mousePosition:G,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(N){b.scrollLeft=N}});let K=C(e,{dragColumn:M,restrictToParentGroup:c==="group"}),X=F===-1?M.computedOffset+q:M.computedOffset+M.computedWidth+q,oe=(0,rd.default)(K,X,({offsetX:N},Q)=>N<Q?-1:N>Q?1:0);oe<0&&(oe=~oe),K.length?oe=K[oe]?K[oe].columnIndex:K[K.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),oe=0),oe===D+1&&(oe=D),me(oe);let H={};o.forEach(N=>{H[N.id]="end"});for(let N=0;N<I;N++){let Q=A[N],de=e[Q];H[de.id]="start"}let se=A.map(N=>e[N].id);return{columnPinning:H,columnOrder:se}}}}function yl(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return o;if(a>i){let l=e.indexOf(r),s=e[l-1],c=o.indexOf(s),u=o.indexOf(r);return No(o,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=o.indexOf(s),u=o.indexOf(r);return No(o,u,c)}return e}import*as gt from"react";var Lo=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let o=((...r)=>{this.off(e,o),t(...r)});return this.on(e,o)}off(e,t){let o=this.listeners[e];if(!o)return;let r=o.indexOf(t);r!==-1&&o.splice(r,1)}emit(e,...t){let o=this.listeners[e];o&&o.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var ad=en(Fo());var ld=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=o,f=c===a,p=Be.from(d.getCenter());if(!l.containsPoint(p))return null;e.activeDragSourcePosition="inside";let m=f?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),b=e.breakpoints,h=Math.round(m===1?r==="horizontal"?g.right-(f?0:g.width/2):g.bottom-(f?0:g.height/2):r==="horizontal"?g.left+(f?0:g.width/2):g.top+(f?0:g.height/2)),y=(0,ad.default)(b,h,(I,v)=>I-v);y<0&&(y=~y),m===1&&y===u+1&&f&&y--;let S=Math.min(u,y),T=Math.max(u,y),C=f?i.map((I,v)=>{if(v===u&&f)return t;if(v<S||v>=T)return{left:0,top:0};let x=y<=v?1:-1;return r==="horizontal"?{left:Math.round(x*g.width),top:0}:{left:0,top:Math.round(x*g.height)}}):i.map((I,v)=>{let x=y<=v?1:0;return r==="horizontal"?{left:Math.round(x*g.width),top:0}:{left:0,top:Math.round(x*g.height)}}),w={offset:t,dropIndex:y,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:C,dragRect:g,status:"accepted"};return e.acceptsDrop(w)?{event:w,error:null,success:!0}:(w.status="rejected",{event:w,error:"rejected by interaction target",success:!1})},sd=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=o,d=Be.from(s.getCenter()),f=u===i,p=a.containsPoint(d);if(p&&!(f&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!f)return null;e.activeDragSourcePosition="outside";let m=f?o.dragIndex:-1,g=s.toDOMRect(),b={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!p,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:f?l.map((h,y)=>h.id===c.id?t:p?{left:0,top:0}:y>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(h=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(b)?{event:b,error:null,success:!0}:(b.status="rejected",{event:b,error:"rejected by interaction target",success:!1})};var Ie=class Ie{static startDrag(e,t){let o=e instanceof pn?e:new pn(e),r=new Sl({activeDragSource:o,startPoint:t});return Ie.currentDragOperation=r,r.on("start",Ie.onDragStart),r.on("move",Ie.onDragMove),r.on("drop",Ie.onDragDrop),r.start(),r}static retriggerMove(){let e=Ie.currentDragOperation;e&&e.phase==="move"&&Ie.onDragMove(e)}static emit(e,...t){Ie.emitter.emit(e,...t)}static on(e,t){return Ie.emitter.on(e,t)}static registerDragInteractionTarget(e){if(Ie.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return Ie.dragInteractionTargetsMap.set(e.listId,e),Ie.emit("register",e),()=>{Ie.unregisterDragInteractionTarget(e)}}static unregisterAll(){Ie.dragInteractionTargetsMap.forEach(e=>{Ie.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!Ie.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}Ie.dragInteractionTargetsMap.delete(e.listId),e.unregister(),Ie.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:o}=e.activeDragSource,r=e.activeDragSource.listId,a=Ie.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;Ie.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?o:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),Ie.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:o})}static withDragMove(e,t){let{activeDragSource:o}=e,{listId:r}=o,i=[],a=!0,l=Ie.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(Ie.dragInteractionTargetsMap.get(r))),Ie.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=ld(e,s);if(c){t(s,c),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let c=sd(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:o,dragItem:r}=t,i=null,a=[];Ie.withDragMove(e,(c,{event:u})=>{c.move(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null,s=l?.dropTargetListId??null;Ie.emit("drag-move",{dragSourceListId:o,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:o,dragItem:r}=t,i=null,a=[];Ie.withDragMove(e,(s,{event:c})=>{s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;Ie.emit("drag-drop",{dragSourceListId:o,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),Ie.currentDragOperation=null,Ie.unregisterAll()}};Ie.dragInteractionTargetsMap=new Map,Ie.currentDragOperation=null,Ie.emitter=new Lo;var mt=Ie,pn=class n{static clone(e){let t=e.getData();return new n(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){pt(this.data,e)||(this.data=e,this.dragRectangle=new De(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let o=n.clone(e),r=De.from(o.dragRectangle);return r.shift(t),o.dragRectangle=r,o}},Sl=class extends Lo{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=pn.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:o}=this.activeDragSource,r={dragSourceListId:t,dragItemId:o.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let o={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=pn.shift(this.initialDragSource,o),this.currentOffset=o,this.emit("move",this)}};globalThis.DragManager=mt;import{useEffect as hy}from"react";var cd=gt.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:n=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),ho=()=>gt.useContext(cd),Tl=n=>{let[e,t]=gt.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),o=gt.useRef(e);o.current=e;let r=gt.useCallback(()=>{let a=o.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=gt.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return hy(()=>{let a=mt.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),l=mt.on("drag-move",c=>{let u=o.current,d={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(u)!==JSON.stringify(d)&&t(d)}),s=mt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[mt,t]),gt.createElement(cd.Provider,{value:i},typeof n.children=="function"?n.children(i):n.children)};var Cl=`${st}Body`,ud=n=>n.querySelector(`.${Cl}`);var ko=`${st}HeaderCell`,wl=`${st}HeaderWrapper`,dd=n=>Array.from(n.querySelectorAll(`.${wl}`));function ei(n){if(!n)return!1;let e=n.tagName;return e==="INPUT"||e==="BUTTON"}var yy=J(Z.baseZIndexForCells),Sy=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:pt(n,e)},md=({columnId:n,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o})=>{let[r,i]=pd(null),[a,l]=pd(!1),{getCurrentDragSourceAndTarget:s}=ho(),{getComputed:c,getState:u,api:d,computedDraggable:f,rootRef:p,actions:m}=re(h=>({actions:h.actions,getComputed:h.getComputed,getState:h.getState,api:h.api,computedDraggable:h.computed.computedVisibleColumnsMap.get(n)?.computedDraggable,rootRef:h.state.domRef})),g=fd(h=>{let y=c().computedVisibleColumnsMap.get(n);if(!y||!y.computedSortable)return;let{multiSortBehavior:S}=u();d.toggleSortingForColumn(n,{multiSortBehavior:S==="replace"&&(h.ctrlKey||h.metaKey)?"append":S})},[]),b=fd(h=>{if(ei(h.target))return;let{brain:y,draggableColumnsRestrictTo:S}=u(),{computedVisibleColumns:T,computedVisibleColumnsMap:C,computedPinnedStartColumns:w,computedUnpinnedColumns:I,computedPinnedEndColumns:v}=c(),x=C.get(n);if(!x.computedDraggable){g(h);return}let R=e.current,P=R.getBoundingClientRect(),A=p.current.getBoundingClientRect(),M=y.getAvailableSize(),D=x.computedVisibleIndex,_=y.getVirtualColIndex(x.computedVisibleIndex,{pageIndex:t||0}),O=y.isHorizontalLayoutBrain?y.getPageWidth():null,L=R.style.cursor??"auto",V=!1,z=p.current,G=De.from(ud(z).getBoundingClientRect()),E=dd(z).map(ue=>De.from(ue.getBoundingClientRect())),F=G.getMinimumBoundingRectangle(...E),q=id({brain:y,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o,pageWidth:O,draggableColumnsRestrictTo:S,computedPinnedEndColumns:v,computedPinnedStartColumns:w,computedUnpinnedColumns:I,computedVisibleColumns:T,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:P,dragColumnId:n,getCurrentDragSourceAndTarget:s,api:d,infiniteDOMNode:p.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:A,acceptDropToReorderRect:F,initialMousePosition:{clientX:h.clientX,clientY:h.clientY}}),B=null,U,ne;function me(ue){let{columnPinning:fe,columnOrder:Y}=ue;Sy(u().columnPinning,fe)||(m.columnPinning=fe);let k=c().computedColumnOrder;JSON.stringify(Y,k)&&(m.columnOrder=yl({newColumnOrder:Y,visibleColumnOrder:c().computedVisibleColumns.map($=>$.id),existingColumnOrder:k,dragColumnId:n}))}let he=ue=>{let{headerBrain:fe,brain:Y}=u();if(!V){V=!0;let k=Y.keepColumnRendered(_),$=fe.keepColumnRendered(_);if(Y.isHorizontalLayoutBrain){let X=Y.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),oe=fe.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ne=()=>{X(),oe()}}U=()=>{k(),$()},m.columnReorderDragColumnId=x.id,t!=null&&(m.columnReorderInPageIndex=t),pl(D,`calc( var(${yy}) + 10000 )`,p.current),p.current?.classList.add(gl),R.style.cursor="grabbing"}B=q.onMove(ue)},ie=ue=>{let fe=ue.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:Y}=u(),k=e.current,$=p.current;$?.classList.remove(gl),q.stop(),y.update({...M}),U?.(),ne?.(),k.style.cursor=L,k.releasePointerCapture(fe),k.removeEventListener("pointermove",he),k.removeEventListener("pointerup",ie),i(null);let K=d.getColumnApi(x.id)?.isSortable()??!1;!V&&K&&d.toggleSortingForColumn(x.id,{multiSortBehavior:Y==="replace"&&(ue.ctrlKey||ue.metaKey)?"append":Y}),by(()=>{B?me(B):V&&o&&d.setVisibilityForColumn(x.id,!1),m.columnReorderDragColumnId=!1,t!=null&&(m.columnReorderInPageIndex=null)}),T.forEach(X=>{Qr(X.computedVisibleIndex,$),Zn(X.computedVisibleIndex,"",$),Xn(X.computedVisibleIndex,"",$)}),pl(D,bl(x,{pinnedStartColsCount:w.length,visibleColsCount:T.length}),$)})};R.addEventListener("pointermove",he),R.addEventListener("pointerup",ie),R.setPointerCapture(h.pointerId)},[n,t]);return{onPointerDown:f?b:g,dragColumnOutside:a,proxyPosition:r}};import*as gn from"react";import*as Te from"react";import{useCallback as rt,useContext as Oy,useMemo as Fy,useSyncExternalStore as Ny}from"react";import*as Vo from"react";var gd=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;import*as er from"react";import{useState as Ty}from"react";var hd="_6rdmyg0 _16lm1iw1d _16lm1iwk _16lm1iw9",bd=be({defaultClassName:"_6rdmyg1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_6rdmyg3"},direction:{end:"_6rdmyg4",start:"_6rdmyg5"},disabled:{true:"_6rdmyg6",false:"_6rdmyg7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var ti=`${yt}-expand-collapse`;function zo(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=Ty(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),fo("expanded",n)||i(!r)};er.useEffect(()=>{fo("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return er.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:ee(n.className,hd,bd({direction:t||"start",expanded:r,disabled:o}),`${yt}`,`${ti}`,`${ti}--${l}`,`${ti}--${t==="end"?"end":"start"}`,o?`${ti}--disabled`:"")},er.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}import*as oi from"react";var yd="_16lm1iwb _16lm1iw1d _16lm1iwk";var Sd=n=>oi.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",display:"block",shapeRendering:"auto"},width:"24px",height:"24px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:ee(n.className,yd,"InfiniteIcon","InfiniteIcon-loading")},oi.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},oi.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var{rootClassName:Cy}=Le,Ht=`${Cy}ColumnCell`;var Td=be({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Cd="_7pupv00",wd=be({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function Id({rowInfo:n}){return{[J(ge.components.Row.groupNesting)]:n.dataSourceHasGrouping?n.isGroupRow?n.groupNesting-1:n.groupNesting:0}}function ni({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=o,d=ee(rn.flex,i.align==="end"?Un.rowReverse:Un.row,xc.center,`${Ht}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||c)?Td({align:a}):null);if(e==="multi-column"){if(n+1!==u.groupNesting&&u.isGroupRow)return c?Vo.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return Vo.createElement("div",{className:d},s,c,Vo.createElement("div",{className:Vt},l??null))}}function ri({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===n&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&n+1!==u.groupNesting)return null;let f=u.groupKeys,p=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return gd(u)?p=Vo.createElement(Sd,null):m&&(p=Vo.createElement(zo,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(f)}})),o&&(r.renderBag.groupIcon=p,p=Vo.createElement(ht,{render:o,renderParam:r})),p}}function Rd(n,e,t){let{groupByForColumn:o,groupIndexForColumn:r,groupRenderStrategy:i}=n,a=o.column?{...o.column}:{},l={header:`Group by ${o.field||o.groupField}`,groupByForColumn:o,render:ni({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:ri({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(n,e)}:l={...l,...t}),l}function vd(n,e,t){let o=typeof t=="function"?t(n,e):t,r={};return n.sortable!=null&&(r.sortable=n.sortable),{...r,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:ni({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...o,renderGroupIcon:ri({initialRenderGroupIcon:o?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}var Dd="_1eexc2a7 _1eexc2a6",xd=be({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),Pd=be({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var Md="_1eexc2a5",ii=be({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),ai="_1eexc2a8";import*as li from"react";import{useEffect as wy,useRef as Iy}from"react";var Ad="qz8ht90 _16lm1iwk";function Ry(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:vy}=Et({forwardProps:Ry,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function Dy(){let{componentState:n,componentActions:e}=_t(),{checked:t,domProps:o,disabled:r}=n,i=Iy(null);return wy(()=>{i.current.indeterminate=t==null},[t]),li.createElement("input",{...o,className:ee("InfiniteCheckBox",Ad,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function qt(n){return li.createElement(vy,{...n},li.createElement(Dy,null))}function xy(n){return typeof n.field=="string"}function Ed(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?o.get(i.field||i.groupField):void 0}!r&&e.field&&(r=o.get(e.field))}return r}function St(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,f=e().computedColumnsMap.get(i),{activeRowIndex:p,keyboardNavigation:m,isRowDetailEnabled:g}=o(),b=r===p&&m==="row",h=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:S}}=mn({column:f,rowInfo:c,rowDetailState:h,columnsMap:e().computedColumnsMap,context:n}),T=ct(f.id,n);return u?{api:a,dataSourceApi:l,column:f,columnApi:T,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:T,column:f,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:T,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:T,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}}function _d(n){return Fd(n.column,n.rowInfo)}function Od(n){let{column:e,context:t,rowInfo:o,visibleColumnsIds:r}=n,i=Ed({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=mn(n),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let f=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",p=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:u,stylingParam:d,formattedValueContext:c,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:Py({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnsIds:n.visibleColumnsIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:f,verticalAlign:p,formattedValueContext:c}),groupByColumnReference:i}}function Py(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=n,{value:u}=c,{api:d,getDataSourceState:f,getState:p,dataSourceApi:m}=t,{editingCell:g}=p(),{indexInAll:b}=o,h=f(),{selectionMode:y,cellSelection:S}=h,T=Ed({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),C=d.toggleGroupRow,w=S?.isCellSelected(o.id,e.id)??!1,I={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:w,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===o.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:T,selectionMode:y,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:b,toggleGroupRow:C,toggleCurrentGroupRow:()=>{o.isGroupRow&&C(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:h.groupBy,pivotBy:h.pivotBy};return Object.defineProperty(I,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),I}function Fd(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:xy(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function My(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}}function mn(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=Fd(e,t),a=My(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}import*as Xt from"react";var{rootClassName:Nd}=Le,Go=`${Nd}Cell`,Il=`${Nd}Cell_content`,Ay=J(Z.columnWidthAtIndex),Ey=J(Z.columnReorderEffectDurationAtIndex);function _y(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:f,cssPosition:p,renderChildren:m,horizontalLayoutPageIndex:g,...b}=n,h=typeof m=="function"?m():m,y={width:`var(${Ay}-${i.computedVisibleIndex})`,transition:`transform var(${Ey}-${i.computedVisibleIndex}, 0s)`,...b.style},S={...b,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:ee(b.className,Go,Dd),children:Xt.createElement(Xt.Fragment,null,d,Xt.createElement("div",{className:ee(Il,e?Vt:Oc.hidden,s),style:r},h),u)};c!=null&&(S["data-row-id"]=`${c}`);let T=f==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return T?Xt.createElement(T,{...S,ref:a}):Xt.createElement("div",{...S,ref:a})}var si=Xt.memo(_y);import*as Ho from"react";import{useCallback as Rl,useRef as Ld}from"react";function kd(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=vl(),i=Ld(null),a=Ld(!1),l=Ho.useCallback(u=>{i.current=u,u&&u.focus()},[]),s=Rl(u=>{let{key:d}=u;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,o()):u.stopPropagation()},[]),c=Rl(()=>{a.current||t()},[]);return Ho.createElement(Ho.Fragment,null,Ho.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:c,className:ee(Dc,_c.none),type:"text",defaultValue:n,onChange:Rl(u=>{e(u.target.value)},[])}))}function zd(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}var Ly=J(Z.columnZIndexAtIndex),ky=J(Z.columnVisibilityAtIndex);function zy({rowInfo:n}){return{[J(ge.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}var tr=Te.createContext(null),Vy=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return Te.createElement(zo,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},Gy={display:"inline-block",visibility:"visible"},Dl=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return Te.createElement(zo,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:Gy,expanded:o,onChange:t})},Hy=n=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:o,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=n;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),c=l.getDataSourceState().isNodeSelectable,u=s?.CheckBox||qt;return Te.createElement(u,{domProps:{className:ai},disabled:e.isTreeNode?!c(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():o()},checked:e.rowSelected})};function xl(n,e){return n?typeof n=="function"?n(e):n:void 0}function Pl(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function Ky(n){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:o,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,cellStyle:s,cellClassName:c,rowDetailState:u,width:d,column:f,onMouseLeave:p,onMouseEnter:m,onRowMouseEnter:g,onRowMouseLeave:b,rowIndex:h,rowHeight:y,columnsMap:S,fieldsToColumn:T,domRef:C,hidden:w,showZebraRows:I,getDataSourceState:v,dataSourceApi:x,dataSourceActions:R,getState:P,imperativeApi:A,componentActions:M,getComputed:D,getDataSourceMasterContext:_}=n,O=Ny(rt(Ae=>t.subscribeToRowIndex(h,Ae),[t,h]),rt(()=>t.getRowInfoAtIndex(h),[t,h])),L=!O,V=!f,z=Te.useRef(null),G=rt(Ae=>{z.current=Ae,C&&C(Ae)},[C]),E=O??{id:"",indexInAll:h,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:F}=E,q=D(),{activeRowIndex:B,keyboardNavigation:U,columnReorderInPageIndex:ne}=P(),me=h===B&&U==="row",he={getState:P,getDataSourceState:v,getDataSourceMasterContext:_,actions:M,dataSourceActions:R,api:A,dataSourceApi:x},ie=E.rowDisabled,ue=q.computedVisibleColumns.map(Ae=>Ae.id),fe=Od({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:f,rowInfo:E,rowDetailState:u,columnsMap:S,visibleColumnsIds:ue,fieldsToColumn:T,context:he}),{stylingParam:Y,renderParams:k,formattedValueContext:$,renderFunctions:K,groupByColumnReference:X,inEdit:oe}=fe,{align:H,verticalAlign:se}=k,N=k,Q=Te.useRef(N),de=g&&m?Ae=>{let $t={...$,rowIndex:h};g($t,Ae),m(Ae)}:m,pe=b&&p?Ae=>{let at={...$,rowIndex:h,rowInfo:E};b(at,Ae),p(Ae)}:p,Pe=rt(Ae=>{let at=f.computedVisibleIndex;P().cellClick({rowIndex:h,colIndex:at,event:Ae})},[h,f.computedVisibleIndex,U]),Me=rt(Ae=>{let at=f.computedVisibleIndex;if(P().cellMouseDown({rowIndex:h,colIndex:at,event:Ae}),U==="row"){ie||(M.activeRowIndex=h);return}U==="cell"&&(M.activeCellIndex=[h,at])},[h,ie,f.computedVisibleIndex,U]),{selectionMode:Ve,cellSelection:Fe,isNodeReadOnly:Ne}=e,Ke=N.cellSelected;N.domRef=G,N.htmlElementRef=z,N.toggleCurrentTreeNode=rt(N.toggleCurrentTreeNode,[E]),N.selectCell=rt(N.selectCell,[E]),N.deselectCell=rt(N.deselectCell,[E]),N.selectCurrentRow=rt(N.selectCurrentRow,[E]),N.deselectCurrentRow=rt(N.deselectCurrentRow,[E]),N.toggleCurrentGroupRow=rt(N.toggleCurrentGroupRow,[E]),N.toggleCurrentRowSelection=rt(N.toggleCurrentRowSelection,[E]),N.toggleCurrentGroupRowSelection=rt(N.toggleCurrentGroupRowSelection,[E]),N.toggleCurrentTreeNodeSelection=rt(N.toggleCurrentTreeNodeSelection,[E]);let Xe=f.components?.Editor??kd,Ze=oe?Te.createElement(Gd,{contextValue:N},Te.createElement(Xe,null)):null,Qe=rt(lt(()=>{if(w||oe)return null;if(Q.current=N,K.renderGroupIcon&&(N.renderBag.groupIcon=Te.createElement(ht,{render:K.renderGroupIcon,renderParam:{...N,renderBag:{...N.renderBag}}})),K.renderSelectionCheckBox&&Ve=="multi-row"&&(N.renderBag.selectionCheckBox=Te.createElement(ht,{render:Hy,renderParam:N}),K.renderSelectionCheckBox!==!0&&(N.renderBag.selectionCheckBox=Te.createElement(ht,{render:K.renderSelectionCheckBox,renderParam:{...N,renderBag:{...N.renderBag}}}))),E.isTreeNode){let{isParentNode:$t}=E,Mt;Mt=($t?K.renderTreeIconForParentNode:K.renderTreeIconForLeafNode)||typeof K.renderTreeIcon=="function"?K.renderTreeIcon:$t&&K.renderTreeIcon===!0?Dl:void 0,Mt===!0?Mt=Dl:Mt&&(N.renderBag.treeIcon=Te.createElement(ht,{render:Dl,renderParam:N})),Mt&&(N.renderBag.treeIcon=Te.createElement(ht,{render:Mt,renderParam:{...N,renderBag:{...N.renderBag}}}))}K.renderRowDetailIcon&&(N.renderBag.rowDetailsIcon=Te.createElement(ht,{render:Vy,renderParam:{...N,renderBag:{...N.renderBag}}}),typeof K.renderRowDetailIcon=="function"&&(N.renderBag.rowDetailsIcon=Te.createElement(ht,{render:K.renderRowDetailIcon,renderParam:{...N,renderBag:{...N.renderBag}}}))),K.renderValue&&(N.renderBag.value=Te.createElement(ht,{render:K.renderValue,renderParam:{...N,renderBag:{...N.renderBag}}})),E.isGroupRow&&K.renderGroupValue&&(N.renderBag.value=Te.createElement(ht,{render:K.renderGroupValue,renderParam:{...N,renderBag:{...N.renderBag}}})),!E.isGroupRow&&K.renderLeafValue&&(N.renderBag.value=Te.createElement(ht,{render:K.renderLeafValue,renderParam:{...N,renderBag:{...N.renderBag}}})),Q.current=N;let Ae=N.renderBag.value;Ae instanceof Date&&(Ae=Ae.toLocaleDateString());let at=Te.createElement(Te.Fragment,null,H!=="end"?N.renderBag.treeIcon:null,H!=="end"?N.renderBag.groupIcon:null,H!=="end"?N.renderBag.rowDetailsIcon:null,H!=="end"?N.renderBag.selectionCheckBox:null,Ae,H==="end"?N.renderBag.selectionCheckBox:null,H==="end"?N.renderBag.rowDetailsIcon:null,H==="end"?N.renderBag.groupIcon:null,H==="end"?N.renderBag.treeIcon:null);return f.render?Te.createElement(ht,{render:f.render,renderParam:{...N,renderBag:{...N.renderBag,all:at}}}):at}),[f,w,oe,u,f.renderTreeIcon||f.renderTreeIconForParentNode?Ne:!1,...zd(N,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),j=q.computedVisibleColumns.map(Ae=>Ae.id),le=q.computedColumnOrder,ce={...$,visibleColumnIds:j,allColumnIds:le,rowIndex:h,rowHasSelectedCells:!1};Object.defineProperty(ce,"rowHasSelectedCells",{get(){return E.hasSelectedCells(j)}});let ye=E.isTreeNode&&(f.renderTreeIcon||f.renderTreeIconForLeafNode||f.renderTreeIconForParentNode),Ue=typeof r=="function"?r(ce):r,ae;X?.className&&(ae=xl(X.className,Y)),c&&(ae=ee(ae,xl(c,Y))),f.className&&(ae=ee(ae,xl(f.className,Y))),ye&&(ae=ee(ae,wd({align:H})));let W;E.dataSourceHasGrouping&&f.groupByForColumn&&(W=Id({rowInfo:E})),ye&&(W=zy({rowInfo:E})),o&&(W=typeof o=="function"?{...W,...o(ce)}:{...W,...o}),s&&(W=Pl(W,s,Y)),X?.style&&(W=Pl(W,X.style,Y)),f.style&&(W=Pl(W,f.style,Y)),W=W||{},W.height=y,W.zIndex=`var(${Ly}-${f.computedVisibleIndex})`,W.visibility=`var(${ky}-${f.computedVisibleIndex}, visible)`;let tt=Fy(()=>W,[W?JSON.stringify(W):null]),Ce=i!=null?i%2===1:(E.indexInAll!=null?E.indexInAll:h)%2===1,ot=I?Ce?"odd":"even":!1,bt=!1,Pt=!1,Ln=!1,Jo=!1;if(Fe&&Ke){let Ae=l(),at=Ae[E.indexInAll-1],$t=Ae[E.indexInAll+1],Mt=q.computedVisibleColumns[f.computedVisibleIndex+1],zn=q.computedVisibleColumns[f.computedVisibleIndex-1];bt=at?!Fe.isCellSelected(at.id,f.id):!0,f.computedPinned==="end"&&f.computedFirstInCategory?Pt=!0:Pt=zn?!Fe.isCellSelected(E.id,zn.id):!0,f.computedPinned==="start"&&f.computedLastInCategory?Ln=!0:Ln=Mt?!Fe.isCellSelected(E.id,Mt.id):!0,Jo=$t?!Fe.isCellSelected($t.id,f.id):!0}let kn=Fe&&Ke?{top:bt,left:Pt,right:Ln,bottom:Jo}:null,Ia=ne!=null?a!==ne:!1,Ra=Ze,va=Qe(),it={domRef:G,cellType:"body",column:f,width:d,rowId:E.id,horizontalLayoutPageIndex:a,style:tt,onMouseLeave:pe,onMouseEnter:de,onClick:Pe,afterChildren:Ra,onMouseDown:Me,cssEllipsis:f.cssEllipsis??!0,className:ee(kn?Pd(kn):"",Zr(f,[Ht,Go],xd,{dragging:!1,insideDisabledDraggingPage:Ia,zebra:ot,align:H,verticalAlign:se,rowDisabled:ie,rowActive:me,cellSelected:Ke,rowSelected:F,treeNode:E.isTreeNode?E.isParentNode?"parent":"leaf":!1,firstRow:E.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:E.isGroupRow,groupCell:E.isGroupRow?!!f.groupByForColumn:!1,rowExpanded:E.isGroupRow?!E.collapsed:!1}),ae,Ue),renderChildren:rt(()=>va,[Qe])},Pr=tr.Provider;return V||L?Te.createElement("div",{ref:G,style:{display:"none"}}):Te.createElement(Pr,{value:Q.current},Te.createElement(si,{...it}))}var Vd=Te.memo(Ky);function ci(){return Oy(tr)}function vl(){let{api:n,editingValueRef:e,editingCell:t}=re(p=>({api:p.api,editingCell:p.state.editingCell,editingValueRef:p.state.editingValueRef})),{column:o,rowInfo:r}=ci(),[i]=Te.useState(()=>t?.value),[a,l]=Te.useState(i),s=t?!t.active&&!!t.waiting:!1,c=Te.useCallback(p=>{e.current=p,l(p)},[]);Te.useLayoutEffect(()=>{e.current=i},[]);let u=n.confirmEdit,d=n.cancelEdit,f=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:f}}function or(n){return n.render(n.renderParam)??null}function ht(n){let e=tr.Provider;return gn.createElement(e,{value:n.renderParam},gn.createElement(or,{render:n.render,renderParam:n.renderParam}))}function Gd(n){let e=tr.Provider;return gn.createElement(e,{value:n.contextValue},n.children)}function bo(n){let e=ui.Provider;return gn.createElement(e,{value:n.renderParam},gn.createElement(or,{render:n.render,renderParam:n.renderParam}))}import*as yo from"react";var By={width:"100%",pointerEvents:"none"},Ml=`${yt}-menu`,Al=Hr({"data-name":""}),El={[Al["data-name"]]:"menu-icon"};function nr(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...By,borderTop:`${ge.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return yo.createElement("div",{...o,style:e,...El,onPointerDown:s=>s.stopPropagation(),className:ee(t,cu({menuVisible:i,reserveSpaceWhenHidden:r}),yt,`${yt}-menu`)},a??yo.createElement(yo.Fragment,null,yo.createElement("div",{className:Ml,style:l}),yo.createElement("div",{className:Ml,style:l}),yo.createElement("div",{className:Ml,style:l})))}import*as hn from"react";import{useEffect as Wy,useState as Kd}from"react";var Hd="_1ek6mqy0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var jy={transition:"width 0.25s, opacity 0.25s"};function di(n){let[e,t]=Kd(!0),[o,r]=Kd(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=n,u=c!=null&&c>0,d=n.size??16,f=Math.floor(d/4),p=i?[d-3*f,d-2*f,d-f]:[0,0,0];i===-1&&p.reverse();let m={...jy,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};Wy(()=>{let h=i!=0?1:0;if(!e&&h&&t(!0),h!==o){let y=requestAnimationFrame(()=>{r(h)});return()=>{cancelAnimationFrame(y)}}return()=>{}},[i,e]);let g=()=>{let y=!(o===0&&i===0);y!==e&&t(y)};if(!e&&!n.forceSize)return null;let b={};return i===-1&&(b.top="100%"),hn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:ee(s,yt,Hd,`${yt}-sort`)},u?hn.createElement("div",{"data-name":"index",style:b,className:fu},c):null,hn.createElement("div",{style:{width:p[0],...m},onTransitionEnd:g}),hn.createElement("div",{style:{width:p[1],...m}}),hn.createElement("div",{style:{width:p[2],...m}}))}import*as Yd from"react";import{useCallback as Ud}from"react";import{useRef as jd,useState as $y}from"react";import*as rr from"react";function Bd(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){we.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;we.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?fl(l,i,o.current):we.columnOffsets.set(a,l.computedOffset+i,o.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let c=e[l];if(c.computedPinned==="start"){fl(c,i,o.current);continue}c.computedPinned!=="end"&&we.columnOffsets.set(l,c.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||we.columnOffsets.set(l,c.computedOffset+i,o.current)}}}}}function Wd(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,c=i.current;if(o.forEach((u,d)=>{s+=u;let f=n[d],p=r[f],m=p.computedWidth+u;we.columnWidths.set(f,m,c),p.computedPinned!=="end"&&(l&&we.columnOffsets.set(f,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&we.columnOffsets.set(u,d.computedOffset+s,c)}}}}var fi="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",pi=be({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw23 _16lm1iw2a",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0,computedFirstInCategory:!1},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0,computedLastInCategory:!1},"zneyzhn"]]}),mi=be({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw26 _16lm1iw2e",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:Uy}=Le,Yy=`${Uy}HeaderCell_ResizeHandle`;function qy(n){let{brain:e,headerBrain:t}=re(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),o=jd(null),[r,i]=$y(!1),a=jd(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,f=()=>{},p=g=>{g.stopPropagation();let b=!!g.shiftKey,h=g.pointerId,y=g.clientX,S=g.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),x=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});f=()=>{v(),x()}}S.setPointerCapture(h);let T=Bd(n.columnIndex,{columns:n.columns,shareSpaceOnResize:b,domRef:o}),C=(v,{done:x}={})=>{s&&(v=v/(s+1),x&&(v=Math.round(v))),c==="end"&&(v*=-1);let{adjustedDiff:R,constrained:P}=n.computeResize({diff:v,shareSpaceOnResize:b});return a.current!==P&&i(P),T.resize(R),R},w=v=>{C(Math.round(v.clientX-y))},I=v=>{S.releasePointerCapture(h),S.removeEventListener("pointermove",w),S.removeEventListener("pointerup",I);let x=Math.round(v.clientX-y),R=C(x,{done:!0});f(),n.onResize({diff:R,shareSpaceOnResize:b})};S.addEventListener("pointermove",w),S.addEventListener("pointerup",I)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return rr.createElement("div",{ref:o,className:`${Yy} ${fi} ${mi({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:p},rr.createElement("div",{style:m,className:pi({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var $d=rr.memo(qy);function qd(n,e){let{computedVisibleColumns:t,getState:o,getComputed:r,actions:i}=re(c=>({computedVisibleColumns:c.computed.computedVisibleColumns,getState:c.getState,getComputed:c.getComputed,actions:c.actions})),a=Ud(({diff:c,shareSpaceOnResize:u})=>{let d=o(),{columnSizing:f,viewportReservedWidth:p,bodySize:m}=d,g=r().computedVisibleColumns,b=!1,h=g.reduce((T,C)=>(C.computedFlex&&(T[C.id]={...f[C.id],flex:C.computedWidth},b=!0),T),{}),y=b?{...f,...h}:f;return ol({shareSpaceOnResize:u,availableSize:m.width,reservedWidth:p||0,dragHandleOffset:c,dragHandlePositionAfter:n.computedVisibleIndex,columnSizing:y,items:g.map(T=>({id:T.id,computedFlex:T.computedFlex,computedWidth:T.computedWidth,computedMinWidth:T.computedMinWidth,computedMaxWidth:T.computedMaxWidth}))})},[n,o,r]),l=Ud(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:f}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=f),i.columnSizing=d},[a,i]);return n.computedResizable?Yd.createElement($d,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}import*as We from"react";import{useCallback as _l,useEffect as Ol,useState as tS}from"react";var Xd=be({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Zd=be({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Qd(n,e){return pt(n,e)}var ir=class extends Lo{constructor(t){super();this.dragIndex=-1;this.breakpoints=[];this.activeDragSourcePosition="outside";this.previousAcceptsDropResult=!0;this.setData(t)}get listId(){return this.data.listId}setData(t){return Qd(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Qd(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let o=!0;return typeof this.data.shouldAcceptDrop=="function"&&(o=this.data.shouldAcceptDrop(t)),o=!!o,o!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=o,o?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),o}adjustForScroll(t){this.breakpoints=this.breakpoints.map(o=>o-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let o=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>o||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=o?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:o,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(p,m)=>m),d=[];o===-1?d=u.filter(p=>p!==r):d=No(u,r,o>r?o-1:o);let f={dragIndex:r,dropIndex:o,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",f)}};var Xy={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:n=>n**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function Zy(n,e){let t=getComputedStyle(n),o=e==="vertical"?t.overflowY:t.overflowX;return o!=="auto"&&o!=="scroll"?!1:e==="vertical"?n.scrollHeight>n.clientHeight:n.scrollWidth>n.clientWidth}function Qy(n,e){let t=n;for(;t&&!(t===document.documentElement||t===document.body);){if(Zy(t,e))return t;t=t.parentElement}return null}function Jy(n,e){return{startScrollingFrom:n*e.startFromPercentage,maxScrollValueAt:n*e.maxScrollAtPercentage}}var tf=1;function Jd(n,e,t){if(n>e.startScrollingFrom)return 0;if(n<=e.maxScrollValueAt)return t.maxPixelScroll;if(n===e.startScrollingFrom)return tf;let r=1-(n-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function eS(n,e,t){let{accelerateAt:o,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return n;if(i<o)return tf;let a=(i-o)/(r-o);return Math.ceil(n*t.ease(a))}function ef(n,e,t,o,r,i,a){if(n<e||n>t)return 0;let l=Jy(o,r),s=n-e,c=t-n,u=c<s,d;return u?d=Jd(c,l,r):d=-Jd(s,l,r),d===0?0:a?(d>0?1:-1)*eS(Math.abs(d),i,r):d}var bn=class{constructor(e){this.scrollContainer=null;this.rafId=null;this.lastPointer={left:0,top:0};this.dragStartTime=0;this.shouldUseDampening=!1;this.active=!1;this.maxScrollTop=0;this.maxScrollLeft=0;this.orientation=e.orientation,this.onScroll=e.onScroll,this.config={...Xy,...e.config}}start(e){this.scrollContainer=Qy(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},o=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=o,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,o=0;return this.orientation==="vertical"?t=ef(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):o=ef(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:o}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var rf=We.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),yn=()=>We.useContext(rf),oS=n=>{let{node:e,offset:t}=n;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},nS=n=>`${n.getAttribute(vt)}`;function rS(n){let e=n.current?.querySelectorAll(gi)??[];return!e||e.length,Array.from(e).map(o=>{let r=nS(o),i=o.getBoundingClientRect();return{id:r,rect:i}})}function iS(n){let{domRef:e,orientation:t,dragListId:o}=n,r=rS(e),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,c=i.right;for(let f of r){let p=f.rect;p.top<a&&(a=p.top),p.left<l&&(l=p.left),p.bottom>s&&(s=p.bottom),p.right>c&&(c=p.right)}let u=De.from({top:a,left:l,width:c-l,height:s-a});return{draggableItems:r,orientation:t,listId:o,listRectangle:u,acceptDropsFrom:n.acceptDropsFrom,shouldAcceptDrop:n.shouldAcceptDrop,initial:n.initial,preserveDragSpace:n.preserveDragSpace}}function af(n){return new ir(iS(n))}function aS(n,e){let t=_e(e),[o,r]=We.useState(null),i=_l(l=>{if(l)mt.registerDragInteractionTarget(l);else{let s=a();s&&mt.unregisterDragInteractionTarget(s)}r(l)},[]),a=_e(o);return Ol(()=>mt.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),f=l.getData();if(f.initial&&f.listId!==s&&c?.includes(f.listId)){let p=af({domRef:n,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(p)}}),[t]),{interactionTarget:o,setInteractionTarget:i,getInteractionTarget:a}}function lf(n,e){let t=n.cloneNode(!0);return t.removeAttribute(vt),t.style.position="fixed",t.style.top=`${e.top}px`,t.style.left=`${e.left}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.zIndex="999999",t.style.pointerEvents="none",t.style.margin="0",t.style.boxSizing="border-box",t.style.transform="none",document.body.appendChild(t),t}function sf({proxyElement:n,dx:e,dy:t}){n.style.transform=`translate3d(${e}px, ${t}px, 0)`}function of(n){let e=n.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",n.current=null)}var Ko=n=>{let e=We.useRef(null),t=We.useRef(null),[o,r]=tS(null),i=We.useRef({top:0,left:0}),a=We.useRef(null),l=We.useCallback(R=>{a.current=R},[]),{dropTargetListId:s,dragSourceListId:c}=ho(),{updateDragOperationSourceAndTarget:u,dragItemId:d,status:f}=ho(),p=_e(n.onDrop),m=_e(n.onAcceptDrop),g=_e(n.onRemove),b=_e(n.updatePosition??oS),{interactionTarget:h,setInteractionTarget:y}=aS(e,n);Ol(()=>{let R=document.querySelector(`[${nf}="${n.dragListId}"]`);R?e.current=R:console.warn(`DragList with id "${n.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[n.dragListId]),Ol(()=>{if(h){let R=n.dragListId,P=h.on("start",({dragItem:V,dragSourceListId:z,dropTargetListId:G})=>{u({dragSourceListId:z,dropTargetListId:G,dragItemId:V.id,status:"accepted"})}),A=h.on("move",({offsetsForItems:V,items:z,status:G,dragItem:E})=>{if(G==="rejected")return;let F=T(),q=b(),B=t.current;z.forEach((U,ne)=>{let me=V[ne],he=F[ne];if(he&&!(B&&U.id===B.dragItemId)){if(!B&&U.id===E.id){let ie=i.current;me={left:me.left+ie.left,top:me.top+ie.top}}q({id:U.id,node:he,offset:me})}})}),M=h.on("drop",V=>{let{sortedIndexes:z,dragIndex:G,dropIndex:E,dragItem:F,items:q,dragSourceListId:B,dropTargetListId:U,outside:ne,status:me}=V,he=T();S.current=[];let ie=m(),ue=g(),fe=p(),Y=b();q.forEach((K,X)=>{let oe=he[X];oe&&Y({id:K.id,node:oe,offset:null})}),of(t),r(K=>K&&(requestAnimationFrame(()=>r(null)),{...K,dragItemId:null})),R===U&&B!==R&&ie&&me==="accepted"&&ie({dragItemId:F.id,dragSourceListId:B,dropTargetListId:U,dragIndex:G,dropIndex:E,dropItemId:q[E]?.id});let $=null;E===-1&&B===R&&U===R&&ne&&($=ue),E!==-1&&U===R&&B===R&&($=fe),$&&$?.(z,{dragIndex:G,dropIndex:E,dragItemId:q[G].id,dropItemId:q[E]?.id})}),D=null,_=null,O=null,L=null;if(!h.getData().initial&&e.current){if(D=new bn({orientation:n.orientation,onScroll:()=>{}}),D.start(e.current),_=D.getScrollContainer(),_){let V=n.orientation==="vertical"?_.scrollTop:_.scrollLeft;O=()=>{let z=n.orientation==="vertical"?_.scrollTop:_.scrollLeft,G=z-V;V=z,G!==0&&(h.adjustForScroll(G),mt.retriggerMove())},_.addEventListener("scroll",O)}L=V=>{D.updatePointer({left:V.clientX,top:V.clientY})},ve().addEventListener("pointermove",L)}return()=>{P(),A(),M(),D&&D.stop(),_&&O&&_.removeEventListener("scroll",O),L&&ve().removeEventListener("pointermove",L)}}},[h,n.dragListId]);let S=We.useRef([]),T=_l(()=>{let R=S.current;return(!R||R.length===0)&&(R=Array.from(e.current?.querySelectorAll(gi)??[]),S.current=R),R},[]),C=_l(R=>{let P=R.currentTarget,A=P.getAttribute(vt);if(A==null){let k=mo(P,gi);k&&(A=k.getAttribute(vt))}if(A==null){console.warn("Could not find drag item id for element",P,`Make sure you have a parent element with a ${vt} attribute`);return}A=`${A}`;let M=null,D=Array.from(e.current?.querySelectorAll(gi)??[]);S.current=D;let _=af({domRef:e,orientation:n.orientation,dragListId:n.dragListId,acceptDropsFrom:n.acceptDropsFrom,initial:!0,preserveDragSpace:n.preserveDragSpace}),O=_.getData().draggableItems,L=O.findIndex(k=>k.id===A),V=O[L],z=D[L].getAttribute(vt)===`${A}`?D[L]:D.find(k=>k.getAttribute(vt)===`${A}`);y(_);let G={left:R.clientX,top:R.clientY},E={left:R.clientX,top:R.clientY};i.current={top:0,left:0};let F=new bn({orientation:n.orientation,onScroll:()=>{}});e.current&&F.start(e.current);let q=F.getScrollContainer(),B=q?n.orientation==="vertical"?q.scrollTop:q.scrollLeft:0;function U(){M&&M.move({left:E.left,top:E.top})}let ne=()=>{if(!q)return;let k=n.orientation==="vertical"?q.scrollTop:q.scrollLeft,$=k-B;B=k,$!==0&&(_.adjustForScroll($),n.orientation==="vertical"?i.current.top+=$:i.current.left+=$),U()};q?.addEventListener("scroll",ne);let me=n.dragStrategy??"proxy",he=me==="proxy"&&!n.renderDragProxy,ie=me==="proxy"&&!!n.renderDragProxy,ue=n.onDragProxyMove??sf,fe=k=>{if(E={left:k.clientX,top:k.clientY},!M){if(M=mt.startDrag({listId:n.dragListId,dragItem:V,dragIndex:L},G),z&&he){let X=z.getBoundingClientRect(),oe=null,H={dragItemNode:z,dragItemId:`${A}`,initialRect:X,initialCoords:G,get proxyElement(){return oe||(oe=lf(z,X)),oe}},se=n.onDragProxySetup?.(H),N=se?.proxyElement??H.proxyElement;z.style.visibility="hidden",t.current={proxyElement:N,originalNode:z,dragItemId:`${A}`,initialRect:X,cleanup:se?.cleanup}}if(z&&ie){let X=z.getBoundingClientRect();z.style.visibility="hidden",t.current={proxyElement:z,originalNode:z,dragItemId:`${A}`,initialRect:X,cleanup:()=>{}},r({dragItemId:`${A}`,initialRect:X,dx:0,dy:0})}}let $=k.clientX-G.left,K=k.clientY-G.top;if(ie)r(X=>X&&{...X,dx:$,dy:K});else{let X=t.current;X&&ue({proxyElement:X.proxyElement,dx:$,dy:K})}F.updatePointer({left:k.clientX,top:k.clientY}),U()},Y=()=>{if(F.stop(),q?.removeEventListener("scroll",ne),ve().removeEventListener("pointermove",fe),ie&&(r(k=>k&&{...k,dragItemId:null}),requestAnimationFrame(()=>{r(null)})),!M){of(t),y(null);return}M.drop(),M=null};ve().addEventListener("pointermove",fe),ve().addEventListener("pointerup",Y,{once:!0})},[n.orientation,n.dragListId,n.acceptDropsFrom,n.removeOnDropOutside,n.dragStrategy,n.renderDragProxy,n.onDragProxySetup,n.onDragProxyMove]),w=!!d,I=We.useMemo(()=>({dragItemId:d,onDragItemPointerDown:C,dragSourceListId:c,dropTargetListId:s,status:f,dragListId:n.dragListId,draggingInProgress:w}),[d,C,w,c,s,n.dragListId]),v={className:ee("DragList",w?"DragList--dragging":"",Xd({dragging:w})),[nf]:n.dragListId},x=typeof n.children=="function"?n.children(v,I):n.children;return We.createElement(rf.Provider,{value:I},x,o&&n.renderDragProxy?n.renderDragProxy({...o,ref:l}):null)},nf="data-drag-list-id",vt="data-drag-item-id",gi=`[${vt}]`,lS=We.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),sS=n=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:o,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=yn(),l=i===o&&r===`${n.id}`,s=We.useMemo(()=>({dragItemId:n.id,active:l,dragListId:o,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[n.id,l,t,i,a]),c={"data-drag-item-id":`${n.id}`,onPointerDown:e,className:ee("DraggableItem",l?"DraggableItem--active":"",Zd({active:l,draggingInProgress:t}))},u=typeof n.children=="function"?n.children(c,s):n.children;return We.createElement(lS.Provider,{value:s},u)};Ko.DraggableItem=sS;import*as Fl from"react";var cf=n=>Fl.createElement(ke,{...n,viewBox:"0 -960 960 960"},Fl.createElement("path",{d:"m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"}));import*as fr from"react";function uf(){return{}}var df=n=>({allowColumnHideWhileDragging:e=>e??!0});import{createContext as cS}from"react";var uS=cS(null);function Nl(){return uS}import*as Ft from"react";import*as jo from"react";import{useCallback as Vf,useEffect as $l,useRef as zS,useState as VS}from"react";import*as hi from"react";function dS(n){let{height:e,width:t,count:o}=n;return hi.createElement("div",{"data-count":o,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var ff=hi.memo(dS);var pf="mlx2t3";import*as bi from"react";import{useRef as pS}from"react";import{useEffect as fS}from"react";var mf=(n,e)=>{fS(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var gf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},hf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},bf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Ll="_1ueijco1",yf="_1ueijco0 _16lm1iw0";var Sf=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=gf[`${n}`]:e=ee(hf[`${n.horizontal}`],bf[`${n.vertical}`]),e};var mS="InfiniteVirtualScrollContainer";var Tf=bi.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??pS(null);return mf(u,i),bi.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:ee(a,mS,yf,Sf(r))},o)});import*as Di from"react";import{useLayoutEffect as jl,useMemo as TS}from"react";import*as If from"react";import{useLayoutEffect as Cf,useRef as wf,useState as gS}from"react";function hS(n){let[e,t]=gS(n.updater.get),o=wf(null),r=wf(n.afterCommit);return r.current=n.afterCommit,Cf(()=>{function i(l){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(l)})):t(l)}let a=n.updater.onChange(i);return()=>{o.current!=null&&cancelAnimationFrame(o.current),a()}},[n.updater,n.useraf]),Cf(()=>{r.current?.()}),e??null}var So=If.memo(hS);var Rf=en(Fo());var kl=(n,e)=>n-e,Zt={horizontal:!0,vertical:!0};function yi(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var zl="DebugID=";function To(n,e){return e&&e.startsWith(zl)?e:e?`${zl}${n}:${e}`:`${zl}${n}`}var Si={start:0,end:0},Vl=n=>{n()},Gl=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},vf=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},ar=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function bS(n){return n.horizontalChange||n.verticalChange}var Bo=class extends ft{constructor(t){let o=To(t,`${t}:MatrixBrain`);super(o);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Si;this.verticalExtendRangeBy=Si;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{ar(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Vl:ar;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Vl:ar;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=this.getColWidth(u);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let c=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:o}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=this.getRowHeight(u);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let c=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=Zt)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=Zt)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.startIndex,s=t.startIndex,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let f=l;for(;d[f]!=f;)f--;a.push([f,u])}}}if(r){let l=t.startIndex,s=o.startIndex,c=o.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let f=l;for(;d[f]!=f;)f--;a.push([u,f])}}}return a};this.computeRenderRange=(t=Zt)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof o!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,f=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),f&&(r+=f);let p=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return p>m&&(p=m,u=Math.max(a,p-r)),{startIndex:u,endIndex:p}};this.getItemAt=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,o),d=u,u=a[c],d===u&&d!=0))return i-1;let f=(0,Rf.default)(a,t,kl);return f>=0?f:~f-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],c=i[t-1];s==null&&console.error(`Offset was not available for ${o==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),f=u.get(a);if(d[i]===void 0){let p=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:o};for(;p<=m;p++)if(d[p]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=p;let b=s(g);d[p]=p,f[p]=b;let h=p;for(;b>1;)h+=1,d[h]=p,f[h]=0,b-=1}}};this.getCellSpan=(t,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,c=Math.min(t,r-1);for(;s<=c;s++)this.computeCacheFor(s,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Gl;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=o,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=Zt){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",f=u&&s!==this.availableWidth,p=d&&c!==this.availableHeight;f&&(this.availableWidth=s,this.availableRenderWidth=s),p&&(this.availableHeight=c,this.availableRenderHeight=c),(f||p)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",b=m&&r!==this.rows,h=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let y=a!=null,S=l!=null,T=y&&a!==this.rowHeight,C=S&&l!==this.colWidth;y&&(this.rowHeight=a),S&&(this.colWidth=l);let w=t.rowspan!=null,I=t.colspan!=null,v=w&&t.rowspan!=this.rowspan,x=I&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),x&&(this.colspan=t.colspan);let R=h||C||f||x,P=b||T||p||v;(o||bS)({horizontalChange:R,verticalChange:P,colsChanged:h,colWidthChanged:C,widthChanged:f,colspanChanged:x,rowsChanged:b,rowHeightChanged:T,heightChanged:p,rowspanChanged:v})&&this.updateRenderCount({horizontal:R,vertical:P})}extendRenderRange(t){let{direction:o}=t,r=o==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:o})}}updateRenderCount(t=Zt){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=Zt){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Vl:ar;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof o=="function"){let u=[],d=0,f=r;d+=s,f-=c;for(let p=d;p<f;p++)u.push(this.getItemSize(p,t));a=yi(l,u)}else a=(o?Math.ceil(l/o):0)+1;return a+=s+c,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{ar(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let o=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Si,this.verticalExtendRangeBy=Si,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Kl=en(Fo());function Df(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function xf(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function lr(n,e){for(let t of n)if(e(t))return t}import*as Mf from"react";var Pf=new Map,yS=()=>{},Hl=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Se();this.afterCommit=()=>{if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}};let o=Pf.get(e)??0,r=`${e}:GridCellReact:${o}`;Pf.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=Se(),this.node=Mf.createElement(So,{key:r,name:r,updater:this.updater,afterCommit:this.afterCommit}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=yS,this.element=null,this.node=null}getNode(){return this.node}update(e,t){this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Sn=class Sn extends ft{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=Se();this.cellAttachmentChangeSubscription=Se();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=new Hl(this.debugId);return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,o=t.values().next().value;return o||(this.poolSize+=Sn.POOL_SIZE_INCREMENT,o=t.values().next().value),o||this.error("No cells available in the pool!"),o}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}set poolSize(t){t=Math.ceil(t/Sn.POOL_SIZE_INCREMENT)*Sn.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};Sn.POOL_SIZE_INCREMENT=1;var Ti=Sn;var Ci=(n,e)=>n-e,wi=class extends ft{constructor(t){super(`${t}:GridCellManager`);this.matrix=new te;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[f,p]=d,m=f<i,g=f>=l,b=p<a,h=p>=s;(m||g||b||h)&&c.add(u)}),c};this.debugId=t,this.pool=new Ti(t),this.offRemoveCell=this.pool.onRemoveCell(o=>this.onRemoveCell(o))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=lr(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=lr(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+1},(s,c)=>{let u=[a,c],d=this.getCellAt(u);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Ci)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Ci)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((o,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,Kl.default)(o,t,Ci);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,Kl.default)(o,t,Ci);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>o&&this.detachCellAt(a),l===o&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return lr(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return lr(t,r=>this.getCellPosition(r)?.[1]===o)}getCellCountInMatrix(){return this.matrix.size}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var _f=en(Fo());import*as Ef from"react";var Af=new Map,SS=()=>{},Bl=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Se();let t=Af.get(e)??0,o=`${e}:ListRowReact:${t}`;Af.set(e,t+1),this.debugId=o,this.updater=Se(),this.node=Ef.createElement(So,{key:`detail-row-${o}`,name:`detail-row-${o}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=SS,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Tn=class Tn extends ft{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=Se();this.rowAttachmentChangeSubscription=Se();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=new Bl(this.debugId);return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,o=t.values().next().value;return o||(this.poolSize+=Tn.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/Tn.POOL_SIZE_INCREMENT)*Tn.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};Tn.POOL_SIZE_INCREMENT=1;var Ii=Tn;var Ri=class extends ft{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new Ii(t),this.offRemoveRow=this.pool.onRemoveRow(o=>this.onRemoveRow(o))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,_f.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Of=!0,Wo=J(Z.y),Ff=J(Z.scrollTop),z_=J(Z.columnOffsetAtIndex),Wl=J(Z.columnOffsetAtIndexWhileReordering),Cn=class extends ft{constructor(t,o){o=o||"ReactHeadlessTableRenderer";super(o);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,o,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(Wo,i?`calc( ${r}px + var(${Ff}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${Wo}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=we.columnOffsets.get(r),d=`${Wl}-${r}`,f=s?`calc( ${a}px + var(${Ff}) )`:`${a}px`;t.__currentTransformY!==f&&(t.__currentTransformY=f,t.style.setProperty(Wo,f));let p=`translate3d(var(${d}, ${u}), var(${Wo}), 0)`;t.__transformValue!==p&&(t.__transformValue=p,t.style.transform=p),c!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),f=r.getFixedEndRowsHeight(),p=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=p+m.height;l||(l=c>g-f?"end":c<p+d?"start":"end");let b=i.scrollTop;if(l==="center"?b=c-Math.floor((r.getAvailableSize().height-d-f)/2):l==="start"?(s=-s,b+=c-p+s-d):(s+=u,b+=c-g+s+f),this.brain.isHorizontalLayoutBrain){let h=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(h,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:b}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let c=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),f=r.getFixedStartColsWidth(),p=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=p+m.width;l||(l=c>g-f?"end":c<p+d?"start":"end");let b=i.scrollLeft;return l==="center"?b=c-Math.floor((r.getAvailableSize().width-d-f)/2):l==="start"?(s=-s,b+=c-p+s-d):(s+=u,b+=c-g+s+f),{...i,scrollLeft:b}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let c=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-o,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,c]}=i.getRenderRange();if(t<l||t>=c)return!1;let u=Math.floor((l+c)/2);if(t>=u){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,f]=c,[p,m]=u,g=[];if(i&&(o&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[p,i]})),a&&(o&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[p,l]})),o){let b={start:[0,f],end:[o,m],rowFixed:"start",colFixed:!1};g.push(b)}if(r){let b={rowFixed:"end",colFixed:!1,start:[s-r,f],end:[s,m]};g.push(b)}return g};this.isCellFixed=(t,o)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,f=!1;if(t<r&&(u=!0,f="start"),i&&!u){let p=c-i;t>=p&&(u=!0,f="end")}if(o<a&&(d=!0,f="start"),l&&!d){let p=s-l;o>=p&&(d=!0,f="end")}return{row:u?f:!1,col:d?f:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(o)};this.onMouseLeaveNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(o)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};ze(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:c,y:u}=s;if(r){let d=()=>{this.updateHoverClassNamesForRow(a);let f=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=f.rowIndex,r.dataset.colIndex=f.colIndex,Of){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let m=(o?o.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==m&&(r.__zIndex=m,r.style.zIndex=m)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?t.setPendingAfterCommitWork(d):d()}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let o=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;o&&(o.dataset.detailRowIndex=r,Of&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:o,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:c,fixedRowsStart:u,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(D=>{let _=i.getRowIndex(D);if(_!=null){let O=this.brain.getItemOffsetFor(_,"vertical");if(O==null)return;let L=D.getElement();if(!L)return;this.setDetailTransform(L,_,{y:O,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let f=this.cellManager.getOneAttachedCell();f&&Lu(t,this.getInfiniteNode(f.getElement()));let p=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:b}=this.brain.getRenderRange(),[h,y]=g,[S,T]=b;function C(D,_,O){let L=r.getCellAt([D,_]);if(L==null)return;let V=o.getCellOffset(D,_),z=L.getElement();z&&V&&O(D,_,z,V)}let w=(D,_,O,{x:L,y:V})=>{this.setTransform(O,D,_,{x:L,y:V,scrollLeft:!0},s-_)},I=(D,_,O,L)=>{this.setTransform(O,D,_,{x:L.x,y:L.y,scrollTop:!0},u-D)},v=(D,_,O,{y:L})=>{let V=p[_];this.setTransform(O,D,_,{x:V,y:L,scrollLeft:!0},a-_)},x=(D,_,O,L)=>{this.setTransform(O,D,_,{x:L.x,y:m[D],scrollTop:!0},l-D)},R=(D,_,O,{x:L,y:V})=>{this.setTransform(O,D,_,{x:L,scrollLeft:!0,y:V,scrollTop:!0},1e5)},P=(D,_,O,{x:L})=>{this.setTransform(O,D,_,{x:L,scrollLeft:!0,y:m[D],scrollTop:!0},2e5)},A=(D,_,O,L)=>{this.setTransform(O,D,_,{x:p[_],y:L.y,scrollLeft:!0,scrollTop:!0},3e5)},M=(D,_,O)=>{this.setTransform(O,D,_,{x:p[_],y:m[D],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let D=h;D<S;D++){for(let _=0;_<s;_++)C(D,_,w);if(c){let _=a-c;for(let O=_;O<a;O++)C(D,O,v)}}if(u||d)for(let D=y;D<T;D++){for(let _=0;_<u;_++)C(_,D,I);if(d){let _=l-d;for(let O=_;O<l;O++)C(O,D,x)}}if(s&&u)for(let D=0;D<u;D++)for(let _=0;_<s;_++)C(D,_,R);if(s&&d){let D=l-d;for(let _=D;_<l;_++)for(let O=0;O<s;O++)C(_,O,P)}if(c&&u){let D=a-c;for(let _=0;_<u;_++)for(let O=D;O<a;O++)C(_,O,A)}if(c&&d){let D=l-d,_=a-c;for(let O=D;O<l;O++)for(let L=_;L<a;L++)C(O,L,M)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=o,this.cellManager=new wi(o),this.cellManager.onCellAttachmentChange((s,c)=>{c?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new Ri(o),this.rowManager.onRowAttachmentChange((s,c)=>{c?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),ze(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),a=t.onScrollStart(this.onScrollStart),l=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),i(),a(),l()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=ul(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:o,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,f=this.getFixedRanges(t),p=[t,...f],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let R=t.start[1],P=t.end[1];m.forEach(A=>{R<=A&&A<P||p.push({start:[t.start[0],A],end:[t.end[0],A+1]})})}let g=new Map,b=p.map(this.getExtraSpanCellsForRange).flat();b&&b.forEach(([R,P])=>{g.set(`${R}:${P}`,!0)});let h=p.reduce((R,P)=>R+Gl(P),0),y=r?p.reduce((R,P)=>R+vf(P),0):0,S=this.brain.getRowCount(),T=this.brain.getColCount();d.detachCellsStartingAt([S,T]);let C=Math.min(S*T,h);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>y&&(u.poolSize=y));let w=Df(...p.map(R=>d.getCellsOutsideRenderRange(R)));w=xf(w,R=>{let P=d.getCellPosition(R);return!(P&&g.has(`${P[0]}:${P[1]}`))}),d.detachCells(w),d.poolSize=C;let I=new Map,v=new Map;p.forEach(R=>{let{start:P,end:A}=R,[M,D]=P,[_,O]=A;for(let L=M;L<_;L++){for(let z=D;z<O;z++){let G=`${L}:${z}`;if(I.has(G))continue;I.set(G,!0);let{rendered:E,mapped:F}=this.isCellRenderedAndMappedCorrectly(L,z);if(L===M||z===D){let B=this.isCellCovered(L,z);if(B&&g.has(`${B[0]}:${B[1]}`)){let U=d.getCellAt([L,z]);U!=null&&d.detachCell(U);continue}}if(E&&!i&&F)continue;let q;E?q=d.getCellAt([L,z]):q=d.getCellFor([L,z],c?"row":"column"),q==null&&(q=d.getDetachedCell()),this.renderCellAt(L,z,q,o)}!r||v.has(L)||(v.set(L,!0),u.isRowAttachedAt(L)&&!i)||this.renderDetailRowAtElement(L,this.rowManager.getRowFor(L),r)}}),b.forEach(([R,P])=>{let{rendered:A,mapped:M}=this.isCellRenderedAndMappedCorrectly(R,P);if(A){if(i||!M){let _=[R,P],O=d.getCellAt(_);this.renderCellAt(R,P,O,o)}return}let D=d.getCellFor([R,P],c?"row":"column");D!=null&&this.renderCellAt(R,P,D,o)});let x=d.getAllCells().map(R=>R.getNode());return r&&u.getAllRows().forEach(R=>{x.push(R.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(x),x}renderDetailRowAtElement(t,o,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:o.ref});if(o.isMounted()||o.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(c,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}getMatrixRowIndexFromElement(t){let o=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(o):o}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),c=this.brain.getRowspan(t,o),u=this.brain.getColspan(t,o),d=c===1?l:this.brain.getRowHeightWithSpan(t,o,c),f=u===1?s:this.brain.getColWidthWithSpan(t,o,u),{row:p,col:m}=this.isCellFixed(t,o),g=!!a,{rowIndex:b,colIndex:h}=this.getCellRealCoordinates(t,o),y=i({rowIndex:b,colIndex:h,height:l,width:s,rowspan:c,colspan:u,rowFixed:p,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(C=>{let w=C.getElement();w&&(w.style.position="absolute",w.style.left="0px",w.style.top="0px"),this.updateElementPosition(C)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:b,renderColIndex:h}:void 0,T=this.brain.isHorizontalLayoutBrain;if(!y){T?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(y,r,[t,o],S),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var vi=class extends Cn{constructor(t,o){super(t,o);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=ge.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",f=we.columnOffsets.get(l.colIndex),p=`${Wl}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(Wo,m));let g=`calc(var(${p}, ${f}) + ${d})`,b=`var(${Wo})`,h=`translate3d(${g}, ${b}, 0px)`;t.__transformValue!==h&&(t.__transformValue=h,t.style.transform=h)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function sr(n){let e=n.isHorizontalLayoutBrain?new vi(n,`${n.name}:HorizontalLayoutTableRenderer`):new Cn(n,`${n.name}:ReactHeadlessTableRenderer`),t=Se();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function CS(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=TS(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:sr(e),[e,n.onRenderUpdater,n.renderer]);return jl(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),jl(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),jl(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:o})})},[i,e,t,o,a,r]),Di.createElement(So,{updater:a})}var xi=Di.memo(CS);import*as cr from"react";import{useEffect as wS,useLayoutEffect as IS,useRef as RS}from"react";var Nf=be({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Pi="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Lf=be({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:vS}=Le,DS=`${vS}-ActiveRowIndicator`,xS=`calc(${Z.activeCellRowOffsetX} + var(${J(Z.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,PS={[J(Z.activeCellOffsetY)]:Z.activeCellRowOffset,transform:`translate3d(${xS}, calc( ${Z.activeCellOffsetY} + var(${J(Z.scrollTopForActiveRow)}, 0px)), 0px)`,height:Z.activeCellRowHeight,maxWidth:ge.runtime.totalVisibleColumnsWidthVar},MS=n=>{let{brain:e}=n,t=RS(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=zt();return IS(()=>{if(n.activeRowIndex==null)return;let a="0px",l=n.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let f=e.getPageIndexForRow(l);f>0&&(a=`calc(${ge.runtime.totalVisibleColumnsWidthVar} * ${f})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),c=e.getItemOffsetFor(l,"vertical"),u=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`,activeCellRowOffsetX:a};un(d,u)},[n.activeRowIndex,e]),wS(()=>{let a=c=>{un({scrollTopForActiveRow:`${-c.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-c.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),cr.createElement("div",{className:Pi,"data-name":"active-row"},cr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${DS} ${Lf({active:o})}`,style:o?PS:void 0}))},kf=cr.memo(MS);import*as ur from"react";import{useEffect as AS,useLayoutEffect as ES,useRef as _S}from"react";var{rootClassName:OS}=Le,FS=`${OS}-ActiveCellIndicator`,NS=J(Z.columnZIndexAtIndex),LS=(n,e,t,o)=>{if(e==null)return;let[r]=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(r=r%n.rowsPerPage);let i=typeof t=="function"?t(r):t??n.getRowHeight(r),a=n.getItemOffsetFor(r,"vertical"),l=o.current;un({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},kS=n=>{let{brain:e}=n,[t,o]=zt(),r=_S(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];return ES(()=>{LS(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]),AS(()=>{let a=e.onRenderCountChange(()=>{o()});return()=>{a()}},[e]),ur.createElement("div",{className:Pi,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${NS}-${n.activeCellIndex[1]})`}:void 0},ur.createElement("div",{"data-name":"active-cell-indicator",className:`${FS} ${Nf({visible:i})}`}))},zf=ur.memo(kS);var Mi=[Md,`${st}DetachedCell`];function Ai(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var GS=ee(pf,Ll);function Gf(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:f,forceRerenderTimestamp:p,scrollVarHostRef:m,...g}=n,{autoFocus:b}=g,h=zS(null),[y,S]=VS({width:0,height:0});$l(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),$l(()=>{let w=h.current?.parentNode;return w?(b&&document.activeElement!==w&&w.focus(),Bn(w,()=>{let x={height:w.clientHeight,width:w.clientWidth};e.update(x)},{debounce:50})):void 0},[f,e]);let T=Vf(w=>{requestAnimationFrame(()=>{h.current&&h.current.style.setProperty("transform",`translate3d(${-w.scrollLeft}px, ${-w.scrollTop}px, 0px)`)})},[]),C=Vf(w=>{e.setScrollPosition(w,T)},[e,T]);return $l(()=>{let w=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),T(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),w},[e]),jo.createElement(Tf,{onContainerScroll:C,...g,ref:t},jo.createElement("div",{ref:h,className:GS,"data-name":"scroll-transform-target"},jo.createElement(xi,{forceRerenderTimestamp:p,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:Mi}),u!=null?jo.createElement(zf,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?jo.createElement(kf,{brain:e,activeRowIndex:c}):null,jo.createElement(ff,{width:y.width,height:y.height}))}function Hf(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((u,d)=>{let f=u.id,p=n[d-1],m=p?.id??"",g=new Set,b=p?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(f,g);let h={type:"column",id:f,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([f],h);let y=u.columnGroup,S,T=h;for(;y;){let C=e[y];if(C){g.add(y);let w=[f,...g];S=b.has(y)?i.get(y):void 0,S||(S={id:y,type:"group",ref:C,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:h.computedPinned,depth:t.get(y)??0},r.set(w,S),i.set(y,S)),S.columnItems.push(h),S.uniqueGroupId.push(h.id),T&&!b.has(T.id)&&S.children.push(T),T=S,y=C.columnGroup}else break}});let l=[],s=new te,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((f,p)=>f+p.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&Kf(u.children),l.push(u),c+=d}if(u.type==="group")u.columnItems.forEach(d=>{s.set([u.depth,d.ref.computedVisibleIndex],u)});else for(let d=u.depth;d<=o+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Kf(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&Kf(t.children),e+=o})}import*as Co from"react";import{useCallback as Zf,useEffect as US,useMemo as YS,useRef as qS}from"react";import*as Ul from"react";import*as $f from"react";import{useCallback as jf}from"react";import{useRef as Bf,useState as HS}from"react";import*as dr from"react";var{rootClassName:KS}=Le,BS=`${KS}HeaderCell_ResizeHandle`;function WS(n){let e=Bf(null),[t,o]=HS(!1),r=Bf(t);r.current=t;let i=n.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let f=d.pointerId,p=d.clientX,m=d.target;m.setPointerCapture(f);let g=!0,b=Wd(n.groupColumns.map(T=>T.computedVisibleIndex),{columns:n.columns,domRef:e}),h=T=>{a==="end"&&(T*=-1);let{constrained:C,adjustedDiffs:w,adjustedDiff:I}=n.computeResize(T);return r.current!==C&&o(C),b.resize(w),I},y=T=>{if(g){let C=n.groupColumns.reduce((v,x)=>v+x.computedWidth-x.computedMinWidth,0),w=n.brain.getAvailableSize(),I={width:w.width+C,height:w.height};n.brain.update(I),g=!1}h(Math.round(T.clientX-p))},S=T=>{m.releasePointerCapture(f),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",S);let C=Math.round(T.clientX-p),w=h(C);n.onResize(w)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",S)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:ge.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return dr.createElement("div",{ref:e,className:`${BS} ${fi} ${mi({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},dr.createElement("div",{style:{...u,...n.style},className:pi({constrained:t})}))}var Wf=dr.memo(WS);function Uf(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:c}=re(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),u=n[n.length-1],d=jf(g=>{let b=l(),{columnSizing:h,viewportReservedWidth:y,bodySize:S}=b,T=s().computedVisibleColumns,C=!1,w=T.reduce((x,R)=>(R.computedFlex&&(x[R.id]={...h[R.id],flex:R.computedWidth},C=!0),x),{}),I=C?{...h,...w}:h;return yu({availableSize:S.width,reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:I,columnGroupSize:n.length,items:T.map(x=>({id:x.id,resizable:x.computedResizable,computedFlex:x.computedFlex,computedWidth:x.computedWidth,computedMinWidth:x.computedMinWidth,computedMaxWidth:x.computedMaxWidth}))})},[u]),f=jf(g=>{let{columnSizing:b,reservedWidth:h}=d(g);c.viewportReservedWidth=h,c.columnSizing=b},[d]);return n.some(g=>g.computedResizable)?$f.createElement(Wf,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:f}):null}var Yf=`${st}HeaderGroup`,qf=J(Z.columnWidthAtIndex),jS=J(Z.columnZIndexAtIndex);function Xf(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=Uf(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=o[0],u=o.length>1?"calc( "+o.map(p=>`var(${qf}-${p.computedVisibleIndex})`).join(" + ")+" )":`var(${qf}-${c.computedVisibleIndex})`,d=`calc(var(${jS}-${c.computedVisibleIndex}) + ${i-e.depth})`,f=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return f=f&&typeof f=="object"?f:{},f.width=u,f.height=t,Ul.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,className:ee(su,Yf),style:f,"data-z-index":d},Ul.createElement("div",{className:ee(`${Yf}__header-content`,Vt)},a),s)}import{useContext as $S}from"react";import*as Xl from"react";var Yl;function Zl(){return Yl||(Yl=Xl.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var ql;function Ei(){return ql||(ql=Xl.createContext(null))}function Oe(n){let e=Ei(),t=$S(e);return tn(t,n)}function Kt(){return Oe(n=>({getDataSourceState:n.getDataSourceState,getDataSourceMasterContext:n.getDataSourceMasterContext,dataSourceActions:n.dataSourceActions,dataSourceApi:n.dataSourceApi,assignState:n.assignState}))}var{rootClassName:XS}=Le,ZS=[],Qf=`${XS}Header`,QS=nu({overflow:!1}),Jf=()=>{};function JS(n){let{bodyBrain:e,headerBrain:t,columns:o,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=n,{getState:c,headerOptions:u,headerRenderer:d,headerOnRenderUpdater:f,showColumnFilters:p,computedColumnsMap:m}=re(A=>({computedColumnsMap:A.computed.computedColumnsMap,getState:A.getState,headerOptions:A.state.headerOptions,headerRenderer:A.state.headerRenderer,headerOnRenderUpdater:A.state.headerOnRenderUpdater,showColumnFilters:A.state.showColumnFilters})),g=qS(null),b=Zf(A=>{g.current&&(g.current.style.transform=`translate3d(-${A.scrollLeft}px, 0px, 0px)`)},[]);US(()=>{let A=t.onScroll(b);return b(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),A},[t]);let h={ref:g,className:ee(Qf,`${Qf}--virtualized`,i,QS),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:S,dataSourceActions:T}=Kt(),{allRowsSelected:C,someRowsSelected:w,selectionMode:I,filterTypes:v,filterDelay:x}=Oe(A=>({allRowsSelected:A.dataSourceState.allRowsSelected,someRowsSelected:A.dataSourceState.someRowsSelected,selectionMode:A.dataSourceState.selectionMode,filterTypes:A.dataSourceState.filterTypes,filterDelay:A.dataSourceState.filterDelay})),R=YS(()=>({allRowsSelected:C,someRowsSelected:w,selectionMode:I}),[C,w,I]),P=Zf(A=>{let{rowIndex:M,colIndex:D,domRef:_,height:O,widthWithColspan:L,heightWithRowspan:V,hidden:z}=A,G=o[D];if(!G||z)return null;let E=t.isHorizontalLayoutBrain?t.getPageIndexForRow(M):null,F=l?l.pathsToCells.get([M,D]):null;if(F&&F.type==="group"){let q=F.columnItems.map(ne=>ne.ref),B={...F.ref,id:F.id,uniqueGroupId:F.uniqueGroupId,depth:F.depth,columns:q.map(ne=>ne.id),computedWidth:F.computedWidth,groupOffset:F.groupOffset};return c().columnGroupVisibility[F.id]!==!1?Co.createElement(Xf,{horizontalLayoutPageIndex:E,bodyBrain:e,columnGroupsMaxDepth:s,domRef:_,columns:q,width:L,height:O,columnGroup:B}):null}return Co.createElement(tp,{domRef:_,column:G,horizontalLayoutPageIndex:E,headerOptions:u,dataSourceStatePartialForHeaderCell:R,filterTypes:v,filterDelay:x,getDataSourceState:y,dataSourceApi:S,dataSourceActions:T,width:L,height:V,columnsMap:m})},[u,o,a,l,s,p,t,y,S,T,v,x,R]);return Co.createElement(Ko,{orientation:"horizontal",dragListId:"header",dragStrategy:"inline",onDrop:Jf,updatePosition:Jf},A=>Co.createElement("div",{...A,...h,className:ee(A.className,h.className)},Co.createElement(xi,{name:"header",renderCell:P,brain:t,renderer:d,onRenderUpdater:f,cellHoverClassNames:ZS,cellDetachedClassNames:Mi})))}var ep=Co.memo(JS);function op(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=re(w=>({computedPinnedStartColumns:w.computed.computedPinnedStartColumns,computedPinnedEndColumns:w.computed.computedPinnedEndColumns,computedVisibleColumns:w.computed.computedVisibleColumns,columnSize:w.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:c,columnGroupsMaxDepth:u,computedColumnGroups:d,showColumnFilters:f}=re(w=>({columnHeaderHeight:w.state.columnHeaderHeight,columnGroupsDepthsMap:w.state.columnGroupsDepthsMap,columnGroupsMaxDepth:w.state.columnGroupsMaxDepth,computedColumnGroups:w.state.computedColumnGroups,showColumnFilters:w.state.showColumnFilters})),p=!d||!Object.keys(d).length?1:u+2,m=p*s+(f?s:0),g=Ft.useMemo(()=>{if(!(!d||!Object.keys(d).length))return Hf(a,d,c,u)},[a,d,c]),b=Ft.useCallback(({rowIndex:w,colIndex:I})=>{let v=a[I],x=1,R=1;if(!v||!g)return{rowspan:x,colspan:R};let P=g.pathsToCells.get([w,I]);if(!P)return{rowspan:x,colspan:R};if(P.type==="column")return{colspan:R,rowspan:p-P.depth};let A=P.columnItems.findIndex(M=>M.id===v.id);return{rowspan:x,colspan:A===0?P.columnItems.length:1}},[d,u,a,g,p,c]),h=Ft.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).rowspan,[b]),y=Ft.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).colspan,[b]),S=Ft.useCallback(w=>f?w<p-1?s:2*s:s,[p,f,s]);Ai(e,{colWidth:l,rowHeight:S,rows:p,cols:a.length,height:m,rowspan:h,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let T=Ft.createElement(ep,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:u,columnAndGroupTreeInfo:g}),C=o.vertical&&po()?Ft.createElement("div",{className:uu,style:{zIndex:1e3,width:po()}}):null;return Ft.createElement("div",{className:`${wl} ${mu}`,style:{height:m}},T,C)}var{ManagedComponentContextProvider:eT}=Et({initSetupState:uf,forwardProps:df,Context:Nl()});function Ql(n){let{getComputed:e,header:t,brain:o,headerBrain:r,wrapRowsHorizontally:i}=re(l=>({getComputed:l.getComputed,header:l.state.header,brain:l.state.brain,headerBrain:l.state.headerBrain,wrapRowsHorizontally:l.state.wrapRowsHorizontally})),{scrollbars:a}=e();return t?fr.createElement(eT,{...n},fr.createElement(op,{wrapRowsHorizontally:!!i,bodyBrain:o,headerBrain:r,scrollbars:a})):null}function np(){return fr.useContext(Nl()).componentState}var iT=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||qt;return xe.createElement(s,{domProps:{className:ai},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},ui=xe.createContext(null);var aT=J(Z.columnZIndexAtIndex),lT=J(Z.columnVisibilityAtIndex),Jl=xe.createElement("div",{className:Vr[1]}),ip=Hr({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[vt]:""});function sT(n){let e=n.column,{allowColumnHideWhileDragging:t}=np(),{dataSourceStatePartialForHeaderCell:o,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:c}=n,{allRowsSelected:u,someRowsSelected:d,selectionMode:f}=o,{onDragItemPointerDown:p}=yn(),{api:m,getComputed:g,getState:b,actions:h,getDataSourceMasterContext:y,showColumnFilters:S,components:T,portalDOMRef:C,columnHeaderHeight:w,columnReorderDragColumnId:I,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:x}=re(W=>({api:W.api,getComputed:W.getComputed,getState:W.getState,actions:W.actions,getDataSourceMasterContext:W.getDataSourceMasterContext,showColumnFilters:W.state.showColumnFilters,components:W.state.components,portalDOMRef:W.state.portalDOMRef,columnHeaderHeight:W.state.columnHeaderHeight,columnReorderDragColumnId:W.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:W.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:W.state.columnReorderInPageIndex})),R=I===e.id,P=x!=null?r!==x:!1,{onResize:A,height:M,width:D,headerOptions:_,columnsMap:O}=n,L=e.computedSortInfo,V=e.header,z=rp(W=>{k.current=W,n.domRef?.(W)},[n.domRef]),G=_.alwaysReserveSpaceForSortIcon,E=e.headerAlign??e.align,F=(typeof E=="function"?E({isHeader:!0,column:e}):E)??"start",q=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",B=ct(e,{actions:h,api:m,dataSourceActions:l,dataSourceApi:a,getComputed:g,getDataSourceState:i,getDataSourceMasterContext:y,getState:b}),U=B.isSortable(),ne=U&&(e.computedSorted||G)?xe.createElement(di,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:ge.spacing[2],marginInlineEnd:ge.spacing[2]},className:`${ko}__sort-icon ${du} ${pu({align:F})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,he=e.computedFilterable&&e.computedFiltered?xe.createElement(ln,null):null,ie=e.headerCssEllipsis??e.cssEllipsis??!0,ue={reserveSpaceWhenHidden:F==="center",menuVisible:v===e.id,style:F==="end"?{marginInlineStart:`calc(${ge.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:ge.spacing[2]}:{marginInlineEnd:`calc(${ge.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:ge.spacing[2]},domProps:{onMouseDown:W=>{W.stopPropagation(),B.toggleContextMenu(W.target)}}},fe=e.components?.MenuIcon||T?.MenuIcon||nr,Y=xe.createElement(fe,{...ue}),k=nT(null),$={horizontalLayoutPageIndex:r,dragging:R,domRef:z,htmlElementRef:k,renderLocation:"column-header",column:e,columnsMap:O,columnSortInfo:L,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:u,selectionMode:f,api:m,dataSourceApi:a,columnApi:B,renderBag:{sortIcon:ne,filterIcon:he,menuIcon:Y,menuIconProps:ue,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},K=$,X=K.renderBag.header,oe=()=>{let W={...$,renderBag:{...$.renderBag}};if(e.renderSortIcon&&(W.renderBag.sortIcon=xe.createElement(bo,{render:e.renderSortIcon,renderParam:{...W,renderBag:{...W.renderBag}}})),e.renderFilterIcon&&(W.renderBag.filterIcon=xe.createElement(bo,{render:e.renderFilterIcon,renderParam:{...W,renderBag:{...W.renderBag}}})),typeof e.renderMenuIcon=="function"&&(W.renderBag.menuIcon=xe.createElement(bo,{render:bt=>{if(typeof e.renderMenuIcon!="function")return null;let Pt=e.renderMenuIcon(bt);return Pt?Pt.type===fe||Pt.type===nr?Pt:xe.createElement(fe,{...ue},Pt):null},renderParam:{...W,renderBag:{...W.renderBag}}})),e.renderSelectionCheckBox&&f==="multi-row"){W.renderBag.selectionCheckBox=xe.createElement(bo,{render:iT,renderParam:{...W,renderBag:{...W.renderBag}}});let bt=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;bt&&bt!==!0&&(W.renderBag.selectionCheckBox=xe.createElement(bo,{render:bt,renderParam:{...W,renderBag:{...W.renderBag}}}))}V instanceof Function&&(W.renderBag.header=X=xe.createElement(bo,{render:V,renderParam:{...W,renderBag:{...W.renderBag}}}));let tt=e.renderMenuIcon===!1?null:W.renderBag.menuIcon,Ce=ie?xe.createElement("div",{className:Vt},W.renderBag.header):W.renderBag.header,ot=xe.createElement(xe.Fragment,null,F==="center"?Jl:null,W.renderBag.selectionCheckBox,Ce,W.renderBag.sortIcon,W.renderBag.filterIcon,F==="center"?Jl:null,F!=="center"?Jl:null,tt);return e.renderHeader?xe.createElement(bo,{render:e.renderHeader,renderParam:{...W,renderBag:{...W.renderBag,all:ot}}}):ot};oT(()=>{let W=null,tt=k.current;return A&&tt&&(W=Bn(tt,A)),()=>{W?.()}},[k.current,n.onResize]);let H={height:M};e.headerStyle&&(H=typeof e.headerStyle=="function"?{...H,...e.headerStyle(K)||{}}:{...H,...e.headerStyle});let se=typeof e.headerClassName=="function"?e.headerClassName(K):e.headerClassName,{onPointerDown:N,proxyPosition:Q,dragColumnOutside:de}=md({columnId:e.id,domRef:k,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),pe=null,Pe=ui.Provider,Me={filtered:e.computedFiltered,verticalAlign:q,align:F},Ve=xe.useMemo(()=>{let W=tt=>{m.setColumnFilter(e.id,tt)};return c>0?At(W,{wait:c}):W},[c,e.id]),Fe=e.computedFilterType,Ne=s[Fe],Ke=e.computedFilterable?e.computedFilterValue?.filter.operator??Ne?.defaultOperator:void 0,Xe=e.computedFilterable&&Ne?Ne.operators.find(W=>W.name===Ke):void 0,Ze=Xe?.components?.FilterEditor||Ne?.components?.FilterEditor||e.components?.FilterEditor||cn,Qe=Ne?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,j=qd(e,{horizontalLayoutPageIndex:r}),le=`var(${aT}-${e.computedVisibleIndex})`;H.zIndex=le,H.visibility=`var(${lT}-${e.computedVisibleIndex}, visible)`;let ce={"data-field":`${e.field||""}`,"data-column-id":e.id,[vt]:e.id,"data-header-align":F,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},ye=e.computedFilterable?xe.createElement(xu,{horizontalLayoutPageIndex:r,filterEditor:Ze,filterOperatorSwitch:Qe??Pu,operator:Xe,filterTypes:s,onChange:Ve,columnFilterType:Fe,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:w}):xe.createElement(Mu,null);K.renderBag.filterEditor=ye;let Ue=rp(W=>{N(W),p(W)},[N,p]),ae=oe();return R&&Q&&(pe=xe.createElement("div",{key:e.id,className:`${ko}Proxy ${eu}`,style:{height:M,width:D,left:Q.left??0,top:Q.top??0}},xe.createElement("div",{className:tu({visible:de})},xe.createElement(cf,{size:16})),X),pe=rT(pe,C.current)),xe.createElement(Pe,{value:K},xe.createElement(si,{domRef:z,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",column:e,...ce,"data-z-index":le,style:H,width:D,onPointerDown:Ue,contentClassName:ee(Jc(Me),Ac[F]),contentStyle:S?{height:M/2}:void 0,className:ee(ko,Nc.none,U?Pc.pointer:"",se,Zr(e,[ko,Go],ou,{dragging:R,insideDisabledDraggingPage:P,align:F,verticalAlign:q,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Qc),cssEllipsis:ie,afterChildren:xe.createElement(xe.Fragment,null,S?ye:null,j),renderChildren:ae}),pe)}var tp=xe.memo(sT);function qr(){return tT(ui)}import*as Qt from"react";import{useEffect as cT}from"react";function ap(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var lp={padding:ge.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},uT={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},sp=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(ap(t),o,"important")},cp=Qt.forwardRef(function(e,t){let{rootClassName:o}=zr(),r=Qt.useRef(null),i=Qt.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return cT(()=>{let a=()=>{setTimeout(()=>{sp(r.current,lp),sp(r.current?.firstElementChild,uT)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),Qt.createElement("div",{ref:i,...e,className:ee(`${o}-Footer`,ku,e.className),style:lp},"Powered by"," ",Qt.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});function es(n){return n.map(Bt)}function Bt(n){if(ve().structuredClone)return ve().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return es(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(es(Array.from(n)));if(n instanceof Map)return new Map(es(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=Bt(n[t]));return e}function pr(n){return n}var $o=Object.seal({data:null,field:null});var Io="____root____",dp="____not_loaded_yet____";function wo(){return!1}function ts(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function _i(n,e,t,o,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function fp(n,e){let{marker:t,reducers:o={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:c}=n;t&&t.start();let u=new te;function d(h,y,S,T=0,C=[]){let w=!S.length||T===S.length-1,I=y[c?.values||"values"]||{};for(let v in I)if(I.hasOwnProperty(v)){let x=v;C.push(x),f.set(C,!0),h.set(C,{reducerResults:I[v][c?.totals||"totals"]||{},items:[]}),w||d(h,I[v],S,T+1,C),C.pop()}}let f=r?new te:void 0,p=[],m=ts(o),g=Bt(m);e.visitDepthFirst((h,y,S,T)=>{let[C,...w]=y,I=h.children,v=u.get(w);if(v&&(v.cache=h.cache,v.childrenLoading=h.childrenLoading,v.childrenAvailable=h.childrenAvailable,v.error=h.error),w.length==i.length&&i.length){if(v){v.items=I;for(let R=0,P=w.length;R<P;R++){let A=w.slice(0,R),M=u.get(A);M&&(M.items=M.items||[],M.items=M.items.concat(I))}I=a.indexArray(I,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return T?.()}for(let x=0,R=I.length;x<R;x++){if(!I[x]){let D={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...w,`${dp}${x}`],D);continue}let P=I[x].data,A=I[x].keys||[];if(A.length){let D=A[A.length-1];w.push(D)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:P,totalChildrenCount:I[x].totalChildrenCount,reducerResults:I[x].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(w,M),r){let D=M.pivotDeepMap=new te,_=I[x].pivot;d(D,_,r,0,p)}A.length&&w.pop()}T?.()});let b={deepMap:u,groupParams:n,initialData:e,reducerResults:g};return r&&(b.topLevelPivotColumns=f,b.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(h=>h.field).join(", ")}]}),b}function up(n,e,t,o,r,i,a,l,s,c=pr){let{items:u,reducerResults:d,pivotDeepMap:f}=n.get(e);if(u.push(o),a&&_i(o,r,a,d,e),i){for(let p=0,m=i.length;p<m;p++){let{field:g,valueGetter:b,toKey:h}=i[p],y=g?o[g]:null;b&&($o.data=o,$o.field=g,y=b($o));let S=(h||c)(y,o);t.push(S),f.has(t)||(l.set(t,!0),f?.set(t,{reducerResults:Bt(s),items:[]}));let{reducerResults:T,items:C}=f.get(t);C.push(o),a&&_i(o,r,a,T,e)}t.length=0}}function pp(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=n,d=u(r),f=[...o,d],p=s(r);if(t.set(f,!0),p){for(let h=0,y=o.length;h<=y;h++){let S=o.slice(0,h),T=e.get(S),{reducerResults:C,items:w}=T;w.push(r),T.leavesAvailableCount++,T.totalLeafNodesCount++,a&&_i(r,i,a,C,S)}return}let m=Bt(l),g=[];e.set(f,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:o.length});let b=c(r);if(!(!b||!Array.isArray(b))){for(let h=0,y=b.length;h<y;h++){let S=b[h];pp(n,e,t,f,S,h,a,l)}a&&mr(a,m,g)}}function os(n,e){let{reducers:t,marker:o}=n;if(o){let c=Object.keys(t??{});o.start({details:c.length>0?[{name:"Reducers",value:c.join(", ")}]:void 0})}let r=ts(t),i=Bt(r),a=new te,l=new te;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:i,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let c=0,u=e.length;c<u;c++)pp(n,a,l,[],e[c],c,t,r);t&&mr(t,i,e);let s={deepMap:a,treeParams:n,treePaths:l,initialData:e,reducerResults:i};return o&&o.end(),s}function ns(n,e){let{marker:t,groupBy:o,defaultToKey:r=pr,pivot:i,reducers:a}=n;t&&t.start();let l=o.length,s=i?new te:void 0,c=new te,u=[],d=[],f=ts(a),p=Bt(f);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Bt(f)};i&&(g.pivotDeepMap=new te),c.set(u,g)}for(let g=0,b=e.length;g<b;g++){let h=e[g],y={};for(let S=0;S<l;S++){let{field:T,groupField:C,valueGetter:w,toKey:I}=o[S],v=T?h[T]:null;w&&($o.data=h,$o.field=T,v=w($o));let x=(I||r)(v,h);if(y[T||C]=x,u.push(x),!c.has(u)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:Bt(f)};i&&(R.pivotDeepMap=new te),c.set(u,R)}up(c,u,d,h,g,i,a,s,f,r)}l||up(c,u,d,h,g,i,a,s,f,r),a&&_i(h,g,a,p,u),u.length=0}a&&(c.visitDepthFirst((g,b,h,y)=>{mr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:T},C,w,I)=>{mr(a,T,S),I?.()}),y?.()}),mr(a,p,e));let m={deepMap:c,groupParams:n,initialData:e,reducerResults:p};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:o.map(g=>g.field).join(", ")}]}),m}function dT(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function fT(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,f=d??null,p;if(Object.keys(c).length>0){f={...d},p={};for(let y in i)if(i.hasOwnProperty(y)){let T=i[y].field;T&&(p[T]=c[y]),T&&f[T]==null&&(f[T]=c[y])}}let m=!0,g=o[o.length-1],b=g;if(f!=null){let y=t[o.length-1];y&&y.field&&(b=f[y.field]),y&&y.toKey&&(b=y.toKey(b,f)),b=b??g}return typeof b=="string"&&b.startsWith(dp)&&(m=!1,b=null),{data:f,reducerData:p,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:wo,hasSelectedCells:wo,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:b,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function Oi(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function mr(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function mp(n,e,t,o,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:f,withRowInfo:p,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:b,rowsPerPage:h}=r,{deepMap:y}=u,S=n.length,T=t[t.length-1],C=T?T.nodeExpanded:!0;for(let w=0;w<S;w++){let I=n[w],v=c(I,w),x=[...e,v];if(l(I)){let O={id:v,nodePath:x,isGroupRow:!1,data:I,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:wo,hasSelectedCells:wo,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,w],indexInParent:w,indexInAll:C?i.length:-1};f&&(O.rowSelected=f(O)),d&&(O.rowDisabled=d(O)),p&&p(O);let L=b&&h!=null&&h>0&&O.indexInAll%h===0?O.indexInAll/h:null;for(let V=0,z=t.length;V<z;V++){let G=t[V];if(C||(G.collapsedLeafNodesCount+=1),G.deepRowInfoArray.push(O),L!=null&&C){if(typeof b=="function"&&b(G)!==!0)continue;let E=Oi(G,O.indexInAll,L);i[E.indexInAll]=E,O.indexInAll++}}C&&(i[O.indexInAll]=O);continue}let A=y.get(x)?.totalLeafNodesCount??0,M={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:x,id:v,data:I,indexInAll:i.length,indexInParent:w,indexInParentNodes:[...o,w],totalLeafNodesCount:A,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:wo,hasSelectedCells:wo,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(M.rowSelected=f(M),g)){let O=g.getSelectionCountFor(M.nodePath);M.selectedLeafNodesCount=O.selectedCount,M.deselectedLeafNodesCount=O.deselectedCount}d&&(M.rowDisabled=d(M)),p&&p(M);let D=!0;if(m&&(M.selfExpanded=D=m(M)),C||(D=!1),M.nodeExpanded=D,C&&b&&h!=null&&h>0){let O=M.indexInAll,L=M.parentNodes;if(L.length>0&&O%h===0){let V=O/h,z=0;L.forEach(G=>{typeof b=="function"&&b(G)!==!0||(i.push(Oi(G,O+z,V)),z++,M.indexInAll++)})}}C&&(i[M.indexInAll]=M);let _=s(I);Array.isArray(_)&&mp(_,x,[...t,M],M.indexInParentNodes,r,i)}return i}function gp(n){let{dataArray:e,marker:t}=n;t&&t.start();let o=[];return mp(e,[],[],[],n,o),t&&t.end(),{data:o}}function hp(n){let{marker:e,lazyLoad:t,groupResult:o,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:c,isRowSelected:u,rowSelectionState:d,generateGroupRows:f,reducers:p={}}=n,{groupParams:m,deepMap:g,pivot:b}=o,{groupBy:h}=m;e&&e.start({details:[{name:"Group by fields",value:h.map(w=>w.field).join(", ")}]});let y=[],S=[],T=[],C=[];return g.visitDepthFirst((w,I,v,x)=>{let R=w.items,P=I.length,A=s?.isGroupRowCollapsed(I)??!1;C.push(v);let M=fT({lazyLoad:t,groupBy:h,parents:Array.from(T),reducers:p,indexInGroup:v,indexInParentGroups:Array.from(C),indexInAll:y.length,groupKeys:I,error:w.error,totalChildrenCount:w.totalChildrenCount,childrenLoading:(w.childrenLoading||!A&&!w.childrenAvailable)&&t,childrenAvailable:w.childrenAvailable,directChildrenCount:I.length===h.length?w.items.length:g.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},w);if(u&&(M.rowSelected=u(M),d)){let V=d.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=V.selectedCount,M.deselectedChildredCount=V.deselectedCount}c&&(M.rowDisabled=c(M));let D=T[T.length-1],_=D?.collapsed??!1;_&&(A=!0),M.collapsed=A;let O=f||A;if(_&&(O=!1),O){if(i&&r!=null&&r>0){let V=M.indexInAll,z=M.parents;if(z.length>0&&V%r===0){let G=V/r,E=0;z.forEach(F=>{typeof i=="function"&&i(F)!==!0||(y.push(Oi(F,V+E,G)),E++,M.indexInAll++)})}}y.push(M),S.push(y.length-1)}M.collapsedChildrenCount=0,T.forEach(V=>{V.deepRowInfoArray.push(M),V.collapsedGroupsCount+=A?1:0}),D&&M.selfLoaded&&t&&(D.directChildrenLoadedCount+=1),a&&a(M),T.push(M);let L=!0;if(L){if(x)x();else if(!b){let V=y.length;A||(y.length+=R.length);let z=0;for(let G=0,E=R.length;G<E;G++){let F=R[G];if(!A&&i&&r!=null&&r>0){let ne=V+G+z;if(ne%r===0){let me=ne/r;T.forEach(he=>{if(typeof i=="function"&&i(he)!==!0)return;let ie=V+G+z;y[ie]=Oi(he,ie,me),z++,y.length++})}}let q=V+G+z,U={id:F?l(F,q):`${I}-${G}`,data:F,isCellSelected:wo,hasSelectedCells:wo,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!F,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:A,groupKeys:I,parents:Array.from(T),indexInParentGroups:[...C,G],indexInGroup:G,indexInAll:q,groupBy:h,groupNesting:P+1,groupCount:M.groupCount};u&&(U.rowSelected=u(U)),c&&(U.rowDisabled=c(U)),a&&a(U),T.forEach((ne,me)=>{me===T.length-1&&F&&(ne.directChildrenLoadedCount+=1),A&&(ne.collapsedChildrenCount+=1),ne.deepRowInfoArray.push(U)}),A||(y[V+G+z]=U)}}}T.pop(),C.pop()}),e&&e.end(),{data:y,groupRowsIndexes:S}}import*as sm from"react";var pT=()=>{};function mT(n,e){let t=new te,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let u of c){let d=[...l,u[u.length-1]],f=t.get(d),p=f?f[o]??[]:[];a(d,p),p.length&&(f||(f=typeof r=="function"?r(d,p):r),f[o]=p),s.push(f)}return s}return a([],[])}function bp(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(o),d=[...t,u],f=r(o),p=lt(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let g=0,b=m.length;g<b;g++){let h=m[g];bp(n,e,d,h)}});f?(c?.(o),s?.(o,pT)):(l?.(o,p,i(o)),s?.(o,p))}function yp(n,e,t){for(let o=0,r=t.length;o<r;o++)bp(n,e,[],t[o])}var gT=function(n,e){return n-e},hT=function(n,e){return n=`${n}`,e=`${e}`,n.localeCompare(e)},bT=function(n,e){return n-e},yT={number:gT,string:hT,date:bT},gr=yT;function Sp(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var Jt=(n,e,t)=>{let o=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;return r&&r.start(),e.sort(Tp(Sp(n),o)),r&&r.end(),e},rs=(n,e,t)=>{let{marker:o}=t;o&&o.start();let r=Tp(Sp(n),t.get),i=t.depthFirst??!1,a=t.inplace??!1;i||(a?e.sort(r):e=[...e].sort(r));let{nodesKey:l,toKey:s}=t,c=d=>d[l],u=d=>d[l]===void 0;return yp({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??c,toKey:s},{onParentNode:(d,f,p)=>{if(i&&f(),Array.isArray(p)){let m=a?p.sort(r):[...p].sort(r);d[l]=m}i||f()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),o&&o.end(),e};Jt.knownTypes=gr;var ST=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=Jt.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys(Jt.knownTypes).join(", ")}`)}return r||(r=gr.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,c=r(l,s);return c===0?c:o*c}},TT=n=>n.map(ST).filter(e=>e instanceof Function),Tp=(n,e)=>{let t=TT(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};var Fi=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new te(o.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new te(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var Tt=class extends Fi{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};import*as CT from"react";function is(n){return Oe(e=>n(e.dataSourceState))}function wn(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||pr)(l,n);return t.push(s),t},[])}var Ee=class n{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new te;this.deselectedMap=new te;this.onlyUsePrimaryKeys=!1;this.selectionCache=new te;this.selectionCountCache=new te;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?wn(r,o):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let o=this.getGroupDeepMap()?.get(e);return o?o.totalChildrenCount??(o.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let o=t?.get(e);return o?o.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new n(e,t,o)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)})}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)})}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getGroupByLength();if(e.length>r){let c=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,c),c}if(r&&this.onlyUsePrimaryKeys){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(p=>{if(this.defaultSelection){if(this.deselectedMap.has([p])){d++;return}u++}else{if(this.selectedMap.has([p])){u++;return}d++}});let f={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,f),f}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=u-(d+f),m={selectedCount:d+(c?p:0),deselectedCount:f+(c?0:p)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let c=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=c,l=this.deselectedMap.getAllChildrenSizeFor(e),l===c&&(a=0)):(l=c,a=this.selectedMap.getAllChildrenSizeFor(e),a===c&&(l=0))}i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),f=u?!0:d?!1:t,{selectedCount:p,deselectedCount:m}=this.getSelectionCountFor(c,f);a+=p,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var wT="*",je=class{constructor(e){this.wildcard=wT;this.cache=new te;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[f,p]=d;p===t&&l.push([f,t])})}if(i){let c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[f]=d;f===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),o)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,o){if(o){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(o){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(o){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,o=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),o&&o.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let o=this.selectedRowsToColumns.get(e);if(o){if(o.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>o.has(r)):!1}return!1}error(e){so(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),c=this.deselectedRowsToColumns.get(this.wildcard),u=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let p=this.selectedRowsToColumns.get(e);return p&&p.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var IT=$e("IT:InfiniteTable"),RT="#dc3545",vT="#eb9316";var wp="Warn",Ip="Error",DT="Info",xT="Success",PT="Logs",Ni=IT.extend(PT),yL=Ni.extend(DT),MT=Ni.extend(wp),AT=Ni.extend(Ip),SL=Ni.extend(xT);var ET=vT,_T=RT;var OT=(n,e)=>{e=e?e.extend?e.extend(wp):e:MT,e(typeof e.color=="function"?e.color(ET,n):n)},FT=(n,e)=>{e=e?e.extend?e.extend(Ip):e:AT,e(typeof e.color=="function"?e.color(_T,n):n)};var Cp=new te,Rp=(n,...e)=>{Cp.has(e)||(Cp.set(e,!0),n())};var In=(n,e=n,t)=>{Rp(()=>OT(n,t),e,"warn")},vp=(n,e=n,t)=>{Rp(()=>FT(n,t),e,"error")};function Li(n,e){return new Ee(n,ut(e))}function ut(n){return()=>{let e=typeof n=="function"?n():n;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function Dp(n){let{getDataSourceState:e,dataSourceActions:t}=n;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Ee))throw"Invalid row selection";let a=new Ee(r,ut(e));a.selectAll(),t.rowSelection=a},deselectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Ee))throw"Invalid row selection";let a=new Ee(r,ut(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Ee))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?wn(u,c):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Ee))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?wn(d,c):[]}let u=new Ee(a,ut(e));u.selectRow(r,i),t.rowSelection=u},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:c}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof Ee))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?wn(d,c):[]}let u=new Ee(l,ut(e));u.deselectRow(r,i),t.rowSelection=u}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Ee))throw"Invalid row selection";let s=new Ee(a,ut(e));s.selectGroupRow(r),t.rowSelection=s},deselectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Ee))throw"Invalid row selection";let s=new Ee(a,ut(e));s.deselectGroupRow(r),t.rowSelection=s},toggleGroupRowSelection(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Ee))throw"Invalid row selection";let s=new Ee(a,ut(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new Ee(i,ut(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof Ee))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Ee(r,ut(i)):i.rowSelection,l=[];return i.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),i.originalDataArray.forEach(s=>{let c=i.toPrimaryKey(s);a.isRowSelected(c)&&l.push(c)}),l}}}var as=new WeakMap,NT=n=>n;function xp(n,e=50,t){as.set(n,{lastCallTime:0,lastCallArg:null});let o=t??NT;return r=>{let{lastCallTime:i,lastCallArg:a}=as.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=pt(o(a),o(r));s<e&&c||(as.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var ki=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new te;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let c=o&&!o.isEmpty();if(c&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let u=[...o.getMutationsArray(),...o.getTreeMutationsArray()];for(let d=0,f=u.length;d<f;d++){let p=u[d];if(p.type==="insert"){let m=r(p.data);s?this.addNodePath([m],p.data,t):this.add(m,p.data),e.push(p.data)}}o?.removeInfo(void 0)}}else{let u=(d,f)=>{for(let p=0;p<d.length;p++){let m=d[p];c&&s&&Array.isArray(m[l])&&(m=d[p]={...m});let g=!1;if(m!=null){let b=r(m),h=s?[...f,b]:void 0,y=s&&!!h,S=y?o?.getMutationsForNodePath(h):o?.getMutationsForPrimaryKey(b);if(S&&S.length){for(let T=0,C=S.length;T<C;T++){let w=S[T];if(w.type==="delete"&&!g&&(y?this.removeNodePath(h,t):this.remove(b),g=!0,d.splice(p,1),p--),w.type==="update"&&!g&&(m={...m,...w.data},d[p]=m),w.type==="update-children"&&!g){let I=w.children(m[l],m);m={...m},I!==void 0?m[l]=I:delete m[l],d[p]=m}w.type==="insert"&&(w.position==="before"?(d.splice(p,0,w.data),p--):d.splice(p+1,0,w.data))}y?o?.removeNodePathInfo(h):o?.removeInfo(b)}if(!g)if(y){this.addNodePath(h,m);let T=a(m),C=T?null:i(m);!T&&Array.isArray(C)&&(f.push(b),c&&(m[l]=C=C.concat()),u(C,f),f.pop())}else this.add(b,m)}}};u(e,[])}return e}}};import{useEffect as Pn,useMemo as Kp,useRef as ji,useState as $T}from"react";import{useEffect as Pp,useLayoutEffect as LT,useRef as Rn}from"react";function vn(n,e){let t=Rn({}),o=Rn({}),r=o.current,i=Rn({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,Pp(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=n(s,r)),i.current={},o.current={},c},l)}function _L(n,e){let t=Rn({}),o=Rn({}),r=o.current,i=Rn({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,LT(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=n(s,r)),i.current={},o.current={},c},l)}function OL(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);Pp(n,t)}function ls(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function ss(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function cs(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function Mp({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(p=>({...r[p],id:p}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=lt(function(){l.forEach((p,m)=>{s[`total:${p.id}`]=ss({header:`${p.name||p.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:p,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[p.id]:null})})});(!a&&t==="start"||o==="start")&&u();let d=!i&&l.length===1;return n.visitDepthFirst((p,m,g,b)=>{if(m=[...m],t==="end"&&b?.(),m.length===a){let h=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let T=S;S=m.join("/");let C=m[m.length-1];c[S]=cs({header:`${C}`,columnGroup:T,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:h,pivotIndex:m.length-1,pivotGroupKey:C})}l.forEach((T,C)=>{let w=d?`${m[m.length-1]}`:T.name||T.id,I=ss({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:T,pivotAggregatorIndex:C,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:h,defaultSortable:!1,columnGroup:S,header:w,valueFormatter:({rowInfo:x})=>x.isGroupRow?x.pivotValuesMap?.get(m)?.reducerResults[T.id]:null}),v=`${T.id}:${m.join("/")}`;s[v]=I})}else{let h=m.join("/"),y=m.slice(0,-1);if(c[h]=cs({columnGroup:y.length?y.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let S=e[m.length-1],T=y.length?y.join("/"):void 0;if(!d){let C=T;T=`total:${m.join("/")}`,c[T]=cs({header:`${m[m.length-1]} total`,columnGroup:C,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((C,w)=>{let I=d?`${m[m.length-1]} total `:`${C.name||C.id} total`,v=ss({columnGroup:T,header:I,pivotAggregator:C,pivotAggregatorIndex:w,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:x})=>x.isGroupRow?x.pivotValuesMap?.get(m)?.reducerResults[C.id]:null});s[`total:${C.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&b?.()}),(!a&&t==="end"||o==="end")&&u(),{columns:s,columnGroups:c}}var Ap=Symbol("CLEAR"),Uo=class n{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new te;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Ap,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Ap);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>te.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let o=new n({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:te.clone(e.nodePathToData),o}};function Ro(n,e){return e().dataArray[n]}function zi(n){return n().dataArray}var dt=class{constructor(e){this.collapsedPathsMap=new te;this.expandedPathsMap=new te;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:o,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?o.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?o.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var kT=(n,e)=>n.length-e.length,et=class n{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new te;this.cache=new te;this.strictMode=!1;let o=e instanceof Object.getPrototypeOf(this).constructor,r=o?e.getState():e;this.setConfig(t||(o?e.config:{treePaths:new te})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Array.isArray(e)?new te(e.map(t=>[t,!0])):e:this.config.treePaths}withTreePaths(e,t){let o=this.config.treePaths;t=this.getTreePaths(t);let r=t!==o;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=o,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(o=>o.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],o){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},o)}getSelectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&o.push(i.keys)})},t),o}getDeselectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||o.push(i.keys)})},t),o}isLeafNode(e){let{treePaths:t}=this.config;return t.has(e)?t.getKeysForLeafNodesStartingWith(e).length===1:null}getLeafNodesCount(e){return this.config.treePaths.getKeysForLeafNodesStartingWith(e).length}static from(e,t){return new n(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:Array.isArray(t.treePaths)?new te(t.treePaths.map(o=>[o,!0])):t.treePaths,strictCheckPaths:t.strictCheckPaths??!0},this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(e){if(!this.strictMode)return!0;let{treePaths:t}=this.config;return t.has(e)}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let o=this.cache.get(e);if(o)return o;if(this.isLeafNode(e)!==!1){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0}).sort(kT);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!l.length){if(i!==null){let f=r?i:!1;return this.cacheIt(e,{selected:f,selectedCount:f?r:0,deselectedCount:f?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,f=l.length;d<f;d++){let p=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(p);if(u?(s-=g,c+=g):(c-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.xcache(),this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function Gi(n,e){return new et(n,Dn(e))}function Dn(n){return()=>({treePaths:(typeof n=="function"?n():n).treePaths})}var Vi=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof et))throw"Invalid tree selection";let a=new et(r,Dn(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:e,selected:t},this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}getSelectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!o)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(o.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new dt({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new dt({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new dt(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new dt(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new dt(o.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?Ro(o,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof et))throw"Invalid node selection";let o=new et(e,Dn(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof et))throw"Invalid node selection";let o=new et(e,Dn(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof et))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};var xn=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var Ct=class extends xn{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var us=1e3;function Ep(n){return new ds(n)}var ds=class{constructor(e){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>zi(this.getState);this.getRowInfoByIndex=e=>Ro(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),o=t.getDataForNodePath(e);return o||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?us:r;return isNaN(a)||(a=us),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let c=u=>t.position==="start"?[...e,...u||[]]:[...u||[],...e];return this.updateChildrenByNodePath(c,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=o?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let o=this.getState().rowDisabledState,r=o?new Ct(o):new Ct({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Ct({enabledRows:!0,disabledRows:[]});return}let t=new Ct(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Ct({disabledRows:!0,enabledRows:[]});return}let t=new Ct(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new Vi({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(o=>{this.resolvePendingPromise=o});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:o,nodesKey:r}=this.getState(),i=t?Uo.clone(t,{light:!0}):new Uo({nodesKey:o?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let f=a.primaryKeys[d],p=this.getDataByPrimaryKey(f);p&&i.update(a.primaryKeys[d],u,p,a.metadata)}else if(a.nodePaths){let f=this.getDataByNodePath(a.nodePaths[d]);f&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,f,a.metadata):i.updateNodePath(a.nodePaths[d],u,f,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??us,i=o.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=f=>{clearTimeout(d),u=f,o.waitForNodePathPromises.delete(e),c(f)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return o.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function _p(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:f,isTree:p}=n;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((b,h)=>b||typeof h!="function"?l.has(h):!1,!1),t))break}if(c&&c.length){if(l===!0)o=!0;else for(let m of c)if(m.field&&l.has(m.field)){o=!0;break}}if(p&&(l===!0?r=!0:r=l.has(f)),u&&u.length)if(l===!0)i=!0;else for(let m of u){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:o,filterValue:i,aggregationReducers:a,tree:r}}function Hi(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function Ki(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function Bi(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function ps(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var Wt=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function fs(){return!1}function zT(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:fs,hasSelectedCells:fs};return o&&(a.rowSelected=o(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var VT=lt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
2
2
|
|
|
3
3
|
Your filtering function probably looks like this:
|
|
4
4
|
|
|
@@ -10,21 +10,21 @@ function treeFilterFunction({ data }) {
|
|
|
10
10
|
|
|
11
11
|
Make sure you avoid mutations.
|
|
12
12
|
|
|
13
|
-
`)});function Dp(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a}=n,l=[],s=c=>{let u=r(c);if(i(c)||!Array.isArray(u))return c;let d=Dp({...n,dataArray:u});return d.length===0?!1:(c={...c,[a]:d},c)};for(let c=0,u=e.length;c<u;c++){let d=e[c],f=r(d),p=t({data:d,index:c,dataArray:e,primaryKey:o(d,c),filterTreeNode:s});p&&(p===!0?p=d:typeof p=="object"&&p===d&&f!==r(p)&&vT(),l.push(p))}return l}function xp(n){let{filterTypes:e,marker:t,operatorsByFilterType:o,filterFunction:r,toPrimaryKey:i,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}=n,{dataArray:u}=n;t?.start({details:[{name:"Count before",value:u.length}]}),r&&(u=u.filter((f,p,m)=>r({data:f,index:p,dataArray:m,primaryKey:i(f,p)}))),a&&(u=Dp({...n,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}));let d=fs(n.filterValue,e)||[];if(d&&d.length){let f=u.filter((p,m,g)=>{let b={data:p,index:m,dataArray:g,primaryKey:i(p,m),field:void 0};for(let h=0,y=d.length;h<y;h++){let S=d[h],{disabled:T,field:C,valueGetter:w,filter:{type:I,value:v,operator:D}}=S,R=e[I];if(T||!R)continue;let P=o[I]?.[D];if(!P)continue;let M=w||R.valueGetter||(({data:_,field:E})=>E?_[E]:_);b.field=C;let x=b;if(x.filterValue=v,x.currentValue=M(x),x.emptyValues=R.emptyValues,!P.fn(x))return!1}return!0});return t?.end({details:[{name:"Count after",value:f.length}]}),f}return t?.end({details:[{name:"Count after",value:u.length}]}),u}function Pp(n){let e,{state:t,previousState:o}=n,r=t.debugId,i;r&&(i=Qe(r).track.DataSource.label.PrepareData.start());let a=vp(t),l=t.sortInfo,s=t.sortMode,c=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(c=!1);let u=Bt(o,t,["refetchKey"]),d=Bt(o,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&u&&(d=!0),!1&&(t.originalLazyGroupData=new ee,d=!0);let p=t.cache?Uo.clone(t.cache):void 0;p&&!p.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,b=t.isTree,h=g?X=>X[g]:void 0,y=g?X=>X[g]===void 0:void 0,S,T;d&&(t.indexer.clear(),t.lazyLoad||(S=p?.getMutations(),T=p?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:p,getNodeChildren:h,isLeafNode:y,nodesKey:g}),b&&t.waitForNodePathPromises.visit(({value:X},se)=>{X&&t.indexer.getDataForNodePath(se)!==void 0&&X.resolve(!0)}))),p&&(p.clear(),t.cache=void 0);let{filterFunction:w,treeFilterFunction:I,filterValue:v,filterTypes:D,operatorsByFilterType:R}=t,P=!!w||!!I||Array.isArray(v)&&v.length,A=P&&t.filterMode==="local",M=Bt(o,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),x=d||M,_=Bt(o,t,["sortInfo"]),E=d||M||_,L=t.filterMode==="local"&&(x||!t.lastFilterDataArray),k=c&&(E||!t.lastSortDataArray||a.sortInfo),V=t.groupBy,W=t.pivotBy,O=!b&&(V.length>0||!!W),F=b,J=Bt(o,t,["rowDisabledState","isRowDisabled"]),j=Bt(o,t,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),U=Bt(o,t,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),ie=d||E||Bt(o,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),be=d||E||Bt(o,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),Te=Bt(o,t,["rowInfoReducers"]),ce=O&&(ie||!t.lastGroupDataArray||a.groupBy)||j||J||Te,fe=F&&(be||a.tree||!t.lastTreeDataArray)||U||J||Te,me=Date.now(),$=t.originalDataArray;if(F&&fe){let X={marker:r?Qe(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m};t.unfilteredTreePaths=ts(X,$).treePaths}if(P||(t.unfilteredCount=$.length),A){t.unfilteredCount=$.length;let X=me;L?(t.devToolsDetected&&(X=Date.now()),$=xp({marker:r?Qe(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:h,isLeafNode:y,nodesKey:g,treeFilterFunction:I,dataArray:$,toPrimaryKey:m,filterTypes:D,operatorsByFilterType:R,filterFunction:w,filterValue:v}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-X)):$=t.lastFilterDataArray,t.lastFilterDataArray=$,t.filteredAt=me}if(t.filteredCount=$.length,t.postFilterDataArray=$,c){let X=Qt.knownTypes;if(Qt.knownTypes={...X,...t.sortTypes},k){let se=me;if(t.devToolsDetected&&(se=Date.now()),r&&(e=Qe(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:$.length}]})),t.sortFunction?($=t.sortFunction(l,[...$]),e&&(e.end(),e=void 0)):b?$=ns(l,$,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:h,toKey:m,nodesKey:g}):$=Qt(l,[...$],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let ue=Date.now()-se;t.debugTimings.set("sort",ue)}}else $=t.lastSortDataArray;Qt.knownTypes=X,t.lastSortDataArray=$,t.sortedAt=me}t.postSortDataArray=$;let G=t.dataArray,q=t.rowSelection instanceof Ee?t.rowSelection:void 0,B=t.treeExpandState instanceof dt?t.treeExpandState:void 0,ae=t.cellSelection instanceof We?t.cellSelection:void 0;q?.xcache();let ne=t.selectionMode==="single-row"?X=>X.id===t.rowSelection:t.selectionMode==="multi-row"?X=>{let se=q;return X.isGroupRow?se.getGroupRowSelectionState(X.groupKeys):se.isRowSelected(X.id,X.dataSourceHasGrouping?X.groupKeys:void 0)}:void 0,z=t.isRowDisabled||ds;t.isRowSelected&&t.selectionMode==="multi-row"&&(ne=X=>t.isRowSelected(X,q,t.selectionMode));let de;t.isNodeExpanded&&(de=X=>t.isNodeExpanded(X,B)),t.isNodeCollapsed&&(de=X=>!t.isNodeExpanded(X,B)),de||(de=se=>B.isNodeExpanded(se.nodePath));let N=t.rowInfoReducers;if(O){if(ce){let X=me;t.devToolsDetected&&(X=Date.now());let se=t.aggregationReducers,ue=t.lazyLoad?ip({groupBy:V,pivot:W,mappings:t.pivotMappings,reducers:se,indexer:t.indexer,toPrimaryKey:m,cache:p,marker:r?Qe(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):os({groupBy:V,pivot:W,reducers:se,marker:r?Qe(r).track.DataSource.label.Group.start():void 0},$);t.groupDeepMap=ue.deepMap,q&&(q.getConfig=ut(t));let De=Object.keys(N||{}),xe=Gi(N),Ve={reducers:N,results:xe,reducerKeys:De,rowInfo:{}},Fe=xe?Ze=>{Ve.rowInfo=Ze,Hi(Ve)}:void 0,Ne=ae?Ze=>{Ze.isCellSelected=K=>ae.isCellSelected(Ze.id,K)}:void 0,Ke=Fe||Ne?as(Fe,Ne):void 0,qe=cp({marker:r?Qe(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:ue,lazyLoad:!!t.lazyLoad,reducers:se,toPrimaryKey:m,isRowSelected:ne,rowSelectionState:q,withRowInfo:Ke,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});G=qe.data,t.rowInfoReducerResults=Ki({reducers:N,results:xe,array:G}),t.groupRowsIndexesInDataArray=qe.groupRowsIndexes,t.reducerResults=ue.reducerResults;let Xe=W?wp({deepMap:ue.topLevelPivotColumns,pivotBy:W,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=Xe?.columns,t.pivotColumnGroups=Xe?.columnGroups,t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-X)}else G=t.lastGroupDataArray;t.lastGroupDataArray=G,t.groupedAt=me}else if(F){if(fe){let X=me;t.devToolsDetected&&(X=Date.now());let se=t.aggregationReducers,ue={marker:r?Qe(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m,reducers:se},De=ts(ue,$);t.treeDeepMap=De.deepMap,t.treePaths=De.treePaths;let xe=t.selectionMode==="multi-row"?Mp(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=xe;let Ve=Object.keys(N||{}),Fe=Gi(N),Ne={reducers:N,results:Fe,reducerKeys:Ve,rowInfo:{}},Ke=Fe?le=>{Ne.rowInfo=le,Hi(Ne)}:void 0,qe=ae?le=>{le.isCellSelected=he=>ae.isCellSelected(le.id,he)}:void 0,Xe=Ke||qe?as(Ke,qe):void 0,Ze=t.selectionMode==="single-row"?le=>le.id===t.treeSelection:t.selectionMode==="multi-row"?le=>xe.isNodeSelected(le.nodePath):void 0,K=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;G=sp({marker:r?Qe(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:De,treeParams:ue,dataArray:$,reducers:se,toPrimaryKey:m,isNodeSelected:Ze,isNodeExpanded:de,treeSelectionState:xe,withRowInfo:Xe,repeatWrappedGroupRows:K,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=Ki({reducers:N,results:Fe,array:G}),t.reducerResults=De.reducerResults,t.totalLeafNodesCount=De.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=me,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-X)}else G=t.lastTreeDataArray;t.lastTreeDataArray=G}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.groupRowsIndexesInDataArray=void 0,o.postSortDataArray!=t.postSortDataArray||ie||j||J||Te){let se=Object.keys(N||{}),ue=Gi(N),De={reducers:N,results:ue,reducerKeys:se,rowInfo:{}};G=$.map((xe,Ve)=>{let Fe=RT(xe,xe?m(xe):Ve,Ve,ne,z,ae);return ue&&(De.rowInfo=Fe,Hi(De)),Fe}),t.rowInfoReducerResults=Ki({reducers:N,results:ue,array:G})}if(t.postGroupDataArray=G,G!==t.dataArray&&(t.updatedAt=me),t.dataArray=G,t.reducedAt=me,t.selectionMode==="multi-row")if(O&&t.lazyLoad){r&&(e=Qe(r).track.DataSource.label.ComputeSelectionCountLazy.start());let X=!0,se=!1;t.dataArray.forEach(ue=>{if(!ue.isTreeNode&&ue.isGroupRow&&ue.groupKeys.length===1){let{rowSelected:De}=ue;De!==!0&&(X=!1),(De===!0||De===null)&&(se=!0)}}),t.allRowsSelected=X,t.someRowsSelected=se,r&&(e?.end(),e=void 0)}else{r&&(e=Qe(r).track.DataSource.label.ComputeSelectionCount.start());let X=t.isTree?t.totalLeafNodesCount:t.filteredCount,se=t.isTree?t.treeSelectionState?t.treeSelectionState.getSelectedCount():0:t.rowSelection.getSelectedCount();t.allRowsSelected=X===se,t.someRowsSelected=se>0,r&&(e?.end(),e=void 0)}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:me,mutations:S?.size?S:void 0,treeMutations:T?.size?T:void 0}),t.rowInfoStore.notifyDataArray(G,{marker:r?Qe(r).track.DataSource.label.DiffRowInfoInStore:void 0}),i&&i?.track.DataSource.label.PrepareData.end({details:[L||k||ce||fe?{name:"Performed operations",value:[L?"filter":null,k?"sort":null,ce?"group":null,fe?"tree":null].filter(co).join(", ")}:null,u?{name:"Refetch key",value:`Old ${o.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(co)}),t}function Ft(){let n=Me().performance?.now();return`${Date.now()}:${n}`}function DT(n,e,t){return e=e.replaceAll("$ERR_CODE",n),e=`${e}
|
|
13
|
+
`)});function Op(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a}=n,l=[],s=c=>{let u=r(c);if(i(c)||!Array.isArray(u))return c;let d=Op({...n,dataArray:u});return d.length===0?!1:(c={...c,[a]:d},c)};for(let c=0,u=e.length;c<u;c++){let d=e[c],f=r(d),p=t({data:d,index:c,dataArray:e,primaryKey:o(d,c),filterTreeNode:s});p&&(p===!0?p=d:typeof p=="object"&&p===d&&f!==r(p)&&VT(),l.push(p))}return l}function Fp(n){let{filterTypes:e,marker:t,operatorsByFilterType:o,filterFunction:r,toPrimaryKey:i,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}=n,{dataArray:u}=n;t?.start({details:[{name:"Count before",value:u.length}]}),r&&(u=u.filter((f,p,m)=>r({data:f,index:p,dataArray:m,primaryKey:i(f,p)}))),a&&(u=Op({...n,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}));let d=ps(n.filterValue,e)||[];if(d&&d.length){let f=u.filter((p,m,g)=>{let b={data:p,index:m,dataArray:g,primaryKey:i(p,m),field:void 0};for(let h=0,y=d.length;h<y;h++){let S=d[h],{disabled:T,field:C,valueGetter:w,filter:{type:I,value:v,operator:x}}=S,R=e[I];if(T||!R)continue;let P=o[I]?.[x];if(!P)continue;let M=w||R.valueGetter||(({data:_,field:O})=>O?_[O]:_);b.field=C;let D=b;if(D.filterValue=v,D.currentValue=M(D),D.emptyValues=R.emptyValues,!P.fn(D))return!1}return!0});return t?.end({details:[{name:"Count after",value:f.length}]}),f}return t?.end({details:[{name:"Count after",value:u.length}]}),u}function Np(n){let e,{state:t,previousState:o}=n,r=t.debugId,i;r&&(i=Je(r).track.DataSource.label.PrepareData.start());let a=_p(t),l=t.sortInfo,s=t.sortMode,c=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(c=!1);let u=Wt(o,t,["refetchKey"]),d=Wt(o,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&u&&(d=!0),!1&&(t.originalLazyGroupData=new te,d=!0);let p=t.cache?Uo.clone(t.cache):void 0;p&&!p.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,b=t.isTree,h=g?Q=>Q[g]:void 0,y=g?Q=>Q[g]===void 0:void 0,S,T;d&&(t.indexer.clear(),t.lazyLoad||(S=p?.getMutations(),T=p?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:p,getNodeChildren:h,isLeafNode:y,nodesKey:g}),b&&t.waitForNodePathPromises.visit(({value:Q},de)=>{Q&&t.indexer.getDataForNodePath(de)!==void 0&&Q.resolve(!0)}))),p&&(p.clear(),t.cache=void 0);let{filterFunction:w,treeFilterFunction:I,filterValue:v,filterTypes:x,operatorsByFilterType:R}=t,P=!!w||!!I||Array.isArray(v)&&v.length,A=P&&t.filterMode==="local",M=Wt(o,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),D=d||M,_=Wt(o,t,["sortInfo"]),O=d||M||_,L=t.filterMode==="local"&&(D||!t.lastFilterDataArray),V=c&&(O||!t.lastSortDataArray||a.sortInfo),z=t.groupBy,G=t.pivotBy,E=!b&&(z.length>0||!!G),F=b,q=Wt(o,t,["rowDisabledState","isRowDisabled"]),B=Wt(o,t,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),U=Wt(o,t,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),ne=d||O||Wt(o,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),me=d||O||Wt(o,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),he=Wt(o,t,["rowInfoReducers"]),ie=E&&(ne||!t.lastGroupDataArray||a.groupBy)||B||q||he,ue=F&&(me||a.tree||!t.lastTreeDataArray)||U||q||he,fe=Date.now(),Y=t.originalDataArray;if(F&&ue){let Q={marker:r?Je(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m};t.unfilteredTreePaths=os(Q,Y).treePaths}if(P||(t.unfilteredCount=Y.length),A){t.unfilteredCount=Y.length;let Q=fe;L?(t.devToolsDetected&&(Q=Date.now()),Y=Fp({marker:r?Je(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:h,isLeafNode:y,nodesKey:g,treeFilterFunction:I,dataArray:Y,toPrimaryKey:m,filterTypes:x,operatorsByFilterType:R,filterFunction:w,filterValue:v}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-Q)):Y=t.lastFilterDataArray,t.lastFilterDataArray=Y,t.filteredAt=fe}if(t.filteredCount=Y.length,t.postFilterDataArray=Y,c){let Q=Jt.knownTypes;if(Jt.knownTypes={...Q,...t.sortTypes},V){let de=fe;if(t.devToolsDetected&&(de=Date.now()),r&&(e=Je(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:Y.length}]})),t.sortFunction?(Y=t.sortFunction(l,[...Y]),e&&(e.end(),e=void 0)):b?Y=rs(l,Y,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:h,toKey:m,nodesKey:g}):Y=Jt(l,[...Y],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let pe=Date.now()-de;t.debugTimings.set("sort",pe)}}else Y=t.lastSortDataArray;Jt.knownTypes=Q,t.lastSortDataArray=Y,t.sortedAt=fe}t.postSortDataArray=Y;let k=t.dataArray,$=t.rowSelection instanceof Ee?t.rowSelection:void 0,K=t.treeExpandState instanceof dt?t.treeExpandState:void 0,X=t.cellSelection instanceof je?t.cellSelection:void 0;$?.xcache();let oe=t.selectionMode==="single-row"?Q=>Q.id===t.rowSelection:t.selectionMode==="multi-row"?Q=>{let de=$;return Q.isGroupRow?de.getGroupRowSelectionState(Q.groupKeys):de.isRowSelected(Q.id,Q.dataSourceHasGrouping?Q.groupKeys:void 0)}:void 0,H=t.isRowDisabled||fs;t.isRowSelected&&t.selectionMode==="multi-row"&&(oe=Q=>t.isRowSelected(Q,$,t.selectionMode));let se;t.isNodeExpanded&&(se=Q=>t.isNodeExpanded(Q,K)),t.isNodeCollapsed&&(se=Q=>!t.isNodeExpanded(Q,K)),se||(se=de=>K.isNodeExpanded(de.nodePath));let N=t.rowInfoReducers;if(E){if(ie){let Q=fe;t.devToolsDetected&&(Q=Date.now());let de=t.aggregationReducers,pe=t.lazyLoad?fp({groupBy:z,pivot:G,mappings:t.pivotMappings,reducers:de,indexer:t.indexer,toPrimaryKey:m,cache:p,marker:r?Je(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):ns({groupBy:z,pivot:G,reducers:de,marker:r?Je(r).track.DataSource.label.Group.start():void 0},Y);t.groupDeepMap=pe.deepMap,$&&($.getConfig=ut(t));let Pe=Object.keys(N||{}),Me=Hi(N),Ve={reducers:N,results:Me,reducerKeys:Pe,rowInfo:{}},Fe=Me?Qe=>{Ve.rowInfo=Qe,Ki(Ve)}:void 0,Ne=X?Qe=>{Qe.isCellSelected=j=>X.isCellSelected(Qe.id,j)}:void 0,Ke=Fe||Ne?ls(Fe,Ne):void 0,Xe=hp({marker:r?Je(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:pe,lazyLoad:!!t.lazyLoad,reducers:de,toPrimaryKey:m,isRowSelected:oe,rowSelectionState:$,withRowInfo:Ke,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});k=Xe.data,t.rowInfoReducerResults=Bi({reducers:N,results:Me,array:k}),t.groupRowsIndexesInDataArray=Xe.groupRowsIndexes,t.reducerResults=pe.reducerResults;let Ze=G?Mp({deepMap:pe.topLevelPivotColumns,pivotBy:G,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=Ze?.columns,t.pivotColumnGroups=Ze?.columnGroups,t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-Q)}else k=t.lastGroupDataArray;t.lastGroupDataArray=k,t.groupedAt=fe}else if(F){if(ue){let Q=fe;t.devToolsDetected&&(Q=Date.now());let de=t.aggregationReducers,pe={marker:r?Je(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m,reducers:de},Pe=os(pe,Y);t.treeDeepMap=Pe.deepMap,t.treePaths=Pe.treePaths;let Me=t.selectionMode==="multi-row"?Lp(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=Me;let Ve=Object.keys(N||{}),Fe=Hi(N),Ne={reducers:N,results:Fe,reducerKeys:Ve,rowInfo:{}},Ke=Fe?ce=>{Ne.rowInfo=ce,Ki(Ne)}:void 0,Xe=X?ce=>{ce.isCellSelected=ye=>X.isCellSelected(ce.id,ye)}:void 0,Ze=Ke||Xe?ls(Ke,Xe):void 0,Qe=t.selectionMode==="single-row"?ce=>ce.id===t.treeSelection:t.selectionMode==="multi-row"?ce=>Me.isNodeSelected(ce.nodePath):void 0,j=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;k=gp({marker:r?Je(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:Pe,treeParams:pe,dataArray:Y,reducers:de,toPrimaryKey:m,isNodeSelected:Qe,isNodeExpanded:se,treeSelectionState:Me,withRowInfo:Ze,repeatWrappedGroupRows:j,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=Bi({reducers:N,results:Fe,array:k}),t.reducerResults=Pe.reducerResults,t.totalLeafNodesCount=Pe.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=fe,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-Q)}else k=t.lastTreeDataArray;t.lastTreeDataArray=k}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.groupRowsIndexesInDataArray=void 0,o.postSortDataArray!=t.postSortDataArray||ne||B||q||he){let de=Object.keys(N||{}),pe=Hi(N),Pe={reducers:N,results:pe,reducerKeys:de,rowInfo:{}};k=Y.map((Me,Ve)=>{let Fe=zT(Me,Me?m(Me):Ve,Ve,oe,H,X);return pe&&(Pe.rowInfo=Fe,Ki(Pe)),Fe}),t.rowInfoReducerResults=Bi({reducers:N,results:pe,array:k})}if(t.postGroupDataArray=k,k!==t.dataArray&&(t.updatedAt=fe),t.dataArray=k,t.reducedAt=fe,t.selectionMode==="multi-row")if(E&&t.lazyLoad){r&&(e=Je(r).track.DataSource.label.ComputeSelectionCountLazy.start());let Q=!0,de=!1;t.dataArray.forEach(pe=>{if(!pe.isTreeNode&&pe.isGroupRow&&pe.groupKeys.length===1){let{rowSelected:Pe}=pe;Pe!==!0&&(Q=!1),(Pe===!0||Pe===null)&&(de=!0)}}),t.allRowsSelected=Q,t.someRowsSelected=de,r&&(e?.end(),e=void 0)}else{r&&(e=Je(r).track.DataSource.label.ComputeSelectionCount.start());let Q=t.isTree?t.totalLeafNodesCount:t.filteredCount,de=t.isTree?t.treeSelectionState?t.treeSelectionState.getSelectedCount():0:t.rowSelection.getSelectedCount();t.allRowsSelected=Q===de,t.someRowsSelected=de>0,r&&(e?.end(),e=void 0)}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:fe,mutations:S?.size?S:void 0,treeMutations:T?.size?T:void 0}),t.rowInfoStore.notifyDataArray(k,{marker:r?Je(r).track.DataSource.label.DiffRowInfoInStore:void 0}),i&&i?.track.DataSource.label.PrepareData.end({details:[L||V||ie||ue?{name:"Performed operations",value:[L?"filter":null,V?"sort":null,ie?"group":null,ue?"tree":null].filter(uo).join(", ")}:null,u?{name:"Refetch key",value:`Old ${o.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(uo)}),t}function Nt(){let n=ve().performance?.now();return`${Date.now()}:${n}`}function GT(n,e,t){return e=e.replaceAll("$ERR_CODE",n),e=`${e}
|
|
14
14
|
|
|
15
15
|
ERROR_CODE = ${n}
|
|
16
16
|
|
|
17
|
-
See http://infinite-table.com/docs/reference/error-codes#${n} for more info.`,{code:n,message:e,type:t??"error"}}function
|
|
18
|
-
Make sure you don't pass a new reference on every render.`}),
|
|
17
|
+
See http://infinite-table.com/docs/reference/error-codes#${n} for more info.`,{code:n,message:e,type:t??"error"}}function kp(n){return Object.entries(n).reduce((e,[t,o])=>{let r=t,i=GT(r,typeof o=="string"?o:o.message,typeof o=="string"?void 0:o.type);return e[r]=i,e},{})}function HT(n){return{message:n.join(""),type:"warning"}}function KT(n){return{message:n.join(""),type:"error"}}var BT=kp({DS001:HT`The "data" prop of your DataSource seems to be updating too frequently.
|
|
18
|
+
Make sure you don't pass a new reference on every render.`}),WT=kp({CSS001_CSS:KT`It appears you have not loaded the CSS file for InfiniteTable.
|
|
19
19
|
In most environments, you should be able to fix this by adding the following line:
|
|
20
20
|
|
|
21
21
|
import '@infinite-table/infinite-react/index.css'
|
|
22
|
-
`}),
|
|
22
|
+
`}),zp={...BT,...WT};var eo=new Map,to=new Map,vo=new Map,oo=new Map;var Dt=new Map,Vp=n=>{Dt.delete(n),vo.delete(n),eo.delete(n),oo.delete(n),to.delete(n)};function ms(n,e,t){let o=Dt.get(n);if(!o)return;let r=vo.get(n);(!r||!Object.hasOwn(r,e))&&vo.set(n,{...r||{},[e]:o.getState()[e]}),eo.set(n,{...eo.get(n)||{},[e]:t}),o.actions[e]=t}function Wi(n,e,t){let o=Dt.get(n);if(!o)return;let r=oo.get(n);(!r||!Object.hasOwn(r,e))&&oo.set(n,{...r||{},[e]:o.getDataSourceState()[e]}),to.set(n,{...to.get(n)||{},[e]:t}),o.dataSourceActions[e]=t}var jT=n=>{let e=n.type==="error"?so(n.debugId):Rt(n.debugId),t=n.type==="error"?vp:In,o=n.debugId?`${n.code}-${n.debugId}`:n.code,r=n.message;n.debugId&&(r=`${r}
|
|
23
23
|
|
|
24
|
-
Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},mr=n=>{let{debugId:e,key:t}=n,o=Ep[t];if(o&&(ET({...o,debugId:e}),e&&t)){let r=vt.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),gr(e))}};globalThis.logDevToolsWarning=mr;var gr=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=vt.get(n);t&&e(n,t)};var Op=!0,OT=()=>new Promise(n=>{ze(n)}),FT={originalDataArray:!0,changes:!0},NT={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function oo(n,e,t){let o=n.multiSort?n.sortInfo:n.sortInfo?.[0]??null,r={append:!1,originalDataArray:n.originalDataArray,sortInfo:o,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(r.livePaginationCursor=n.livePaginationCursor,r.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=n.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=Lp(r.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=n.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!FT[l]){let s=l,c=NT[s],u=r[s],d=a[s];(c?c(u,d):u===d)||(i[s]=!0)}return r.changes=i,r}function Yo(n,e,t,o,r){let i=oo(e,o,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,c=[wo,...i.groupKeys||[]],u=s.get(c);if(!u){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(u&&u.cache&&c.length>1){let d=u.children,f=d.length,p=!0;for(let m=0;m<f;m++)if(d[m]==null){p=!1;break}if(p)return Promise.resolve(!0)}u?u.childrenLoading||(u.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Op,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=Ft()}typeof n=="function"&&(n=n(i));let l=typeof n=="object"&&typeof n.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(n).then(s=>{let c=[],u=!1;if(Array.isArray(s.data)){let f=s;if(c=f.data,f.livePaginationCursor!==void 0&&(t.livePaginationCursor=f.livePaginationCursor),f.mappings&&(t.pivotMappings=f.mappings),f.totalCountUnfiltered&&(t.unfilteredCount=f.totalCountUnfiltered),e.lazyLoad){let m=function(g,b,h){let y=[wo,...g],S=b.data,T={cache:b.cache??Op,childrenLoading:!1,childrenAvailable:!0,totalCount:b.totalCount??S.length,totalCountUnfiltered:b.totalCount??S.length,children:S,error:b.error},C=[];if(i.lazyLoadBatchSize&&!h){let I=p.get(y),v=!I,D=Cu({children:!0},I||{},T);v&&(D.chidren=[]),D.children.length=D.totalCount;let R=i.lazyLoadStartIndex??0,P=Math.min(b.totalCount??S.length,R+i.lazyLoadBatchSize);for(let A=R;A<P;A++){let M=T.children[A-R];if(!M)throw`lazily loaded item not found at index ${A-R}`;D.children[A]=M,M.dataset&&C.push({keys:M.keys,dataset:M.dataset})}v&&p.set(y,D)}else T.children.forEach(I=>{I&&I.dataset&&C.push({keys:I.keys,dataset:I.dataset})}),T.children.length=T.totalCount,p.set(y,T);let w=!1;if(!g||!g.length){let I=p.get([wo]);t.originalDataArray=[...I.children],w=!0}if(w||(t.originalLazyGroupDataChangeDetect=Ft()),C.length){let I=g;C.forEach(({keys:v,dataset:D})=>{m(v,D,I)})}};var d=m;let p=e.originalLazyGroupData;u=!0,m(i.groupKeys||[],f)}}else c=s;u||(t.originalDataArray=a?e.originalDataArray.concat(c):c),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function Lp(n,{filterTypes:e,filterMode:t}){return t==="local"?n:(fs(n,e)||[]).map(o=>{let r={...o};return delete r.valueGetter,r})}function Fp(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function kp(n){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:o}=n,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:f,filterMode:p,livePagination:m,livePaginationCursor:g,filterTypes:b,cursorId:h}=o,[y,S]=_T({vertical:!1,horizontal:!1}),T=Wi(y);xn(()=>(a.onChange(R=>{R&&(T.current=R,S(R))}),()=>a.destroy()),[a]),xn(()=>{if(!m)return;let R=requestAnimationFrame(()=>{T.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(R)},[g]),xn(()=>{if(!m||g!==void 0)return;let R=requestAnimationFrame(()=>{T.current?.vertical||h!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(R)},[i.length,g]),xn(()=>{let R=e(),{livePaginationCursor:P,livePagination:A,dataArray:M}=R;!y.vertical&&A&&(P?t.cursorId=P:P===void 0&&M.length&&(t.cursorId=M.length))},[y.vertical]);let C=Np(()=>Lp(f,{filterTypes:b,filterMode:p}),[f,p,b]),w={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?C:null,cursorId:m?h:null},I=Wi(!0);LT(n,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:f,refetchKey:l,cursorId:m?h:null});let v=Nr(),D=Wi([]);Rn(()=>{let R=e(),P=v(),{isDetail:A,isDetailReady:M}=Fp(P,e);if(A&&!M)return;let x=Date.now(),_=D.current;_.length>=10&&_.splice(0,1),_.push(x),x-_[0]<200&&_.length>=10&&mr({debugId:R.debugId,key:"DS001"}),typeof R.data!="function"&&Yo(R.data,R,t,void 0,P)},{data:r}),Rn(R=>{let P=Object.keys(R),A=!1;if(P.length===1){if(A=!!R.cursorId,R.filterValue&&e().filterMode==="local")return;let L=e().data;if(Array.isArray(L)&&R.refetchKey){t.originalDataArray=L;return}}let M=v(),{isDetail:x,isDetailReady:_}=Fp(M,e);if(x&&!_)return;let E=e();if(typeof E.data=="function"){let L;E.debugId&&(L=Qe(E.debugId).track.DataSource.label.RemoteDataLoad.start()),Yo(E.data,E,t,{append:A},M).then(()=>{L?.end()})}},{...w,data:r}),Rn(()=>{let R=e();if(I.current){I.current=!1;let P=oo(R,void 0,v());t.dataParams=P}},w)}function LT(n,e){let{getDataSourceState:t,dataSourceActions:o,dataSourceState:r}=n;xn(()=>{o.lazyLoadCacheOfLoadedBatches=new ee},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:c,groupRowsState:u,scrollStopDelayUpdatedByTable:d}=r,f=Wi(null),p=(g,b,h=t().lazyLoadCacheOfLoadedBatches)=>{let y=t();if(g=g||f.current,!g)return;let{renderStartIndex:S,renderEndIndex:T}=g,{lazyLoadBatchSize:C,lazyLoad:w}=y;w&&((!C||C<=0)&&(!y.groupBy||y.groupBy.length===0)||kT({startIndex:S,endIndex:T,lazyLoadBatchSize:C,componentState:y,componentActions:o,dismissLoadedRows:b?.dismissLoadedRows??!1},h))},m=Np(()=>Mt(p,{wait:d}),[d]);Rn(g=>{if(a)return g.sortInfo||g.filterValue||g.groupBy||g.pivotBy||g.refetchKey||g.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),p(s.get(),{dismissLoadedRows:!0})):(g.originalLazyGroupDataChangeDetect||g.groupRowsState)&&p(s.get()),s.onChange(b=>{f.current=b,p(b)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,groupRowsState:u}),xn(()=>{i&&i>0&&m()},[c])}function kT(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,c=l?()=>!1:g=>s[g].data!=null,u=!l,d=new ee,f=["_______xxx______"];for(let g=t;g<=o;g++){let b=s[g];if(!b)continue;let h=c(g),y=b.dataSourceHasGrouping&&b.groupKeys?[...b.groupKeys]:[];b.isGroupRow&&b.dataSourceHasGrouping&&b.groupKeys&&y.pop();let S=y.length?y:f,T=b.dataSourceHasGrouping?b.indexInGroup:b.indexInAll;if(b.isGroupRow&&!b.collapsed&&!b.childrenAvailable){let C={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:b.groupKeys,append:u},w=b.groupKeys,I=d.get(w);if(!I?.[b.id]){let v=!I;I=I||{},I[b.id]||(I[b.id]=C),v&&d.set(w,I)}}if(!h&&r!=null){let C=d.get(S),w=Math.floor(T/r)*r,I=T-w,v=s[b.indexInAll-I].indexInAll,D=c(v),R=s[v].id;if(D||C?.[R])continue;let P=!C;C=C||{};let A={lazyLoadStartIndex:w,lazyLoadBatchSize:r,groupKeys:y,append:u};C[R]||(C[R]=A),P&&d.set(S,C)}}let p=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,b)=>{let h=[...b.groupKeys,b.lazyLoadStartIndex];if(e&&e.has(h))return g;e?.set(h,!0);let y=[i.data,i,a,b];return g.then(()=>OT()).then(()=>Yo(...y))},p)}var zT=Object.freeze([]),zp=(n,e)=>{let t=n??zT,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};function ji(n,e){if(n===e)return!0;if(n==null||e==null)return n===e;if(typeof n!=typeof e)return!1;if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0,o=n.length;t<o;t++)if(!ji(n[t],e[t]))return!1;return!0}if(typeof n=="object"){let t=Object.keys(n),o=Object.keys(e);if(t.length!==o.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!ji(n[r],e[r]))return!1;return!0}return!1}function VT(n,e){return!(n===void 0||e===void 0||n.isGroupRow!==e.isGroupRow||n.dataSourceHasGrouping!==e.dataSourceHasGrouping||n.isTreeNode!==e.isTreeNode||n.isTreeNode&&n.isParentNode!==e.isParentNode)}var $i={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},Vp={...$i,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},GT={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},HT={...$i,...GT,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},Gp={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},KT={...$i,...Gp,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},BT={...$i,...Gp,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},WT=Object.entries(Vp).map(([n,e])=>e?n:void 0).filter(Boolean),jT=Object.entries(Vp).map(([n,e])=>e?n:void 0),$T=Object.entries(HT).map(([n,e])=>e?n:void 0),UT=Object.entries(KT).map(([n,e])=>e?n:void 0),YT=Object.entries(BT).map(([n,e])=>e?n:void 0);function qT(n,e){if(n===e)return!0;if(!n||!e||!VT(n,e)||n.id!==e.id||n.data!==e.data&&!ji(n.data,e.data))return!1;let t=[];n.dataSourceHasGrouping?t=n.isGroupRow?$T:jT:n.isTreeNode?t=n.isTreeNode&&n.isParentNode?YT:UT:t=WT;for(let o of t){let r=n[o],i=e[o];if(!(typeof r=="function"||typeof i=="function")&&!ji(r,i))return!1}return!0}function Hp(){let n=[],e=new Map,t=(s,c)=>{let u=n,d=c?.marker;d&&d.start({details:[{name:"new dataArray length",value:s.length},{name:"old dataArray length",value:u.length}]});let f=[],p=i();for(let m of p){let g=u[m],b=s[m];if(b===void 0){f.push(m);continue}qT(g,b)||f.push(m)}n=s,f.length>0&&queueMicrotask(()=>{for(let m=0,g=f.length;m<g;m++){let b=f[m],h=e.get(b);if(h)for(let y of h)y()}}),d&&d.end({details:[{name:"updated row infos",value:f.length}]})},o=s=>n[s],r=(s,c)=>{let u=e.get(s);return u||(u=new Set,e.set(s,u)),u.add(c),()=>{let d=e.get(s);d&&(d.delete(c),d.size===0&&e.delete(s))}},i=()=>Array.from(e.keys());return{notifyDataArray:t,getRowInfoAtIndex:o,subscribeToRowIndex:r,getDataArray:()=>n,clear:()=>{n=[],e.clear()}}}var XT=Symbol("cursorId"),Kp=n=>n.totalLeafNodesCount===0,ZT=n=>n.isParentNode?!Kp(n):!0;function Bp(n){let e=Date.now(),t=[],o=[],r=new ee;return{logger:Rt(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Hp(),indexer:new Li,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new ee,waitForNodePathPromises:new ee,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new ee,dataParams:void 0,onCleanup:ye(),notifyScrollbarsChange:ye(),notifyScrollStop:ye(),notifyRenderRangeChange:ye(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:XT,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:o,unfilteredCount:o.length,filteredCount:o.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function QT(n){let e={...n};return delete e.originalDataArray,e}var JT=[],Wp=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.unfilteredTreePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear(),n.rowInfoStore.clear()},jp=(n,e)=>({onDataParamsChange:t=>t?Tp(t,100,QT):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Kp,isNodeSelectable:t=>t??ZT,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,filterDelay:t=>t??200,filterTypes:t=>({...Eo,...t}),sortTypes:t=>({...pr,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugId&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof Ct)return t;let o=n.propsCache.get("rowDisabledState")??Nt,r=o.get(t);return r||(r=new Ct(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>zp(t,n.propsCache.get("sortInfo")),groupBy:t=>t??JT});function eC(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}var Nt=new WeakMap;function tC(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var oC={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Mp(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
24
|
+
Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},hr=n=>{let{debugId:e,key:t}=n,o=zp[t];if(o&&(jT({...o,debugId:e}),e&&t)){let r=Dt.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),br(e))}};globalThis.logDevToolsWarning=hr;var br=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=Dt.get(n);t&&e(n,t)};var Gp=!0,UT=()=>new Promise(n=>{ze(n)}),YT={originalDataArray:!0,changes:!0},qT={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function no(n,e,t){let o=n.multiSort?n.sortInfo:n.sortInfo?.[0]??null,r={append:!1,originalDataArray:n.originalDataArray,sortInfo:o,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(r.livePaginationCursor=n.livePaginationCursor,r.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=n.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=Bp(r.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=n.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!YT[l]){let s=l,c=qT[s],u=r[s],d=a[s];(c?c(u,d):u===d)||(i[s]=!0)}return r.changes=i,r}function Yo(n,e,t,o,r){let i=no(e,o,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,c=[Io,...i.groupKeys||[]],u=s.get(c);if(!u){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(u&&u.cache&&c.length>1){let d=u.children,f=d.length,p=!0;for(let m=0;m<f;m++)if(d[m]==null){p=!1;break}if(p)return Promise.resolve(!0)}u?u.childrenLoading||(u.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Gp,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=Nt()}typeof n=="function"&&(n=n(i));let l=typeof n=="object"&&typeof n.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(n).then(s=>{let c=[],u=!1;if(Array.isArray(s.data)){let f=s;if(c=f.data,f.livePaginationCursor!==void 0&&(t.livePaginationCursor=f.livePaginationCursor),f.mappings&&(t.pivotMappings=f.mappings),f.totalCountUnfiltered&&(t.unfilteredCount=f.totalCountUnfiltered),e.lazyLoad){let m=function(g,b,h){let y=[Io,...g],S=b.data,T={cache:b.cache??Gp,childrenLoading:!1,childrenAvailable:!0,totalCount:b.totalCount??S.length,totalCountUnfiltered:b.totalCount??S.length,children:S,error:b.error},C=[];if(i.lazyLoadBatchSize&&!h){let I=p.get(y),v=!I,x=wu({children:!0},I||{},T);v&&(x.chidren=[]),x.children.length=x.totalCount;let R=i.lazyLoadStartIndex??0,P=Math.min(b.totalCount??S.length,R+i.lazyLoadBatchSize);for(let A=R;A<P;A++){let M=T.children[A-R];if(!M)throw`lazily loaded item not found at index ${A-R}`;x.children[A]=M,M.dataset&&C.push({keys:M.keys,dataset:M.dataset})}v&&p.set(y,x)}else T.children.forEach(I=>{I&&I.dataset&&C.push({keys:I.keys,dataset:I.dataset})}),T.children.length=T.totalCount,p.set(y,T);let w=!1;if(!g||!g.length){let I=p.get([Io]);t.originalDataArray=[...I.children],w=!0}if(w||(t.originalLazyGroupDataChangeDetect=Nt()),C.length){let I=g;C.forEach(({keys:v,dataset:x})=>{m(v,x,I)})}};var d=m;let p=e.originalLazyGroupData;u=!0,m(i.groupKeys||[],f)}}else c=s;u||(t.originalDataArray=a?e.originalDataArray.concat(c):c),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function Bp(n,{filterTypes:e,filterMode:t}){return t==="local"?n:(ps(n,e)||[]).map(o=>{let r={...o};return delete r.valueGetter,r})}function Hp(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function Wp(n){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:o}=n,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:f,filterMode:p,livePagination:m,livePaginationCursor:g,filterTypes:b,cursorId:h}=o,[y,S]=$T({vertical:!1,horizontal:!1}),T=ji(y);Pn(()=>(a.onChange(R=>{R&&(T.current=R,S(R))}),()=>a.destroy()),[a]),Pn(()=>{if(!m)return;let R=requestAnimationFrame(()=>{T.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(R)},[g]),Pn(()=>{if(!m||g!==void 0)return;let R=requestAnimationFrame(()=>{T.current?.vertical||h!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(R)},[i.length,g]),Pn(()=>{let R=e(),{livePaginationCursor:P,livePagination:A,dataArray:M}=R;!y.vertical&&A&&(P?t.cursorId=P:P===void 0&&M.length&&(t.cursorId=M.length))},[y.vertical]);let C=Kp(()=>Bp(f,{filterTypes:b,filterMode:p}),[f,p,b]),w={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?C:null,cursorId:m?h:null},I=ji(!0);XT(n,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:f,refetchKey:l,cursorId:m?h:null});let v=kr(),x=ji([]);vn(()=>{let R=e(),P=v(),{isDetail:A,isDetailReady:M}=Hp(P,e);if(A&&!M)return;let D=Date.now(),_=x.current;_.length>=10&&_.splice(0,1),_.push(D),D-_[0]<200&&_.length>=10&&hr({debugId:R.debugId,key:"DS001"}),typeof R.data!="function"&&Yo(R.data,R,t,void 0,P)},{data:r}),vn(R=>{let P=Object.keys(R),A=!1;if(P.length===1){if(A=!!R.cursorId,R.filterValue&&e().filterMode==="local")return;let L=e().data;if(Array.isArray(L)&&R.refetchKey){t.originalDataArray=L;return}}let M=v(),{isDetail:D,isDetailReady:_}=Hp(M,e);if(D&&!_)return;let O=e();if(typeof O.data=="function"){let L;O.debugId&&(L=Je(O.debugId).track.DataSource.label.RemoteDataLoad.start()),Yo(O.data,O,t,{append:A},M).then(()=>{L?.end()})}},{...w,data:r}),vn(()=>{let R=e();if(I.current){I.current=!1;let P=no(R,void 0,v());t.dataParams=P}},w)}function XT(n,e){let{getDataSourceState:t,dataSourceActions:o,dataSourceState:r}=n;Pn(()=>{o.lazyLoadCacheOfLoadedBatches=new te},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:c,groupRowsState:u,scrollStopDelayUpdatedByTable:d}=r,f=ji(null),p=(g,b,h=t().lazyLoadCacheOfLoadedBatches)=>{let y=t();if(g=g||f.current,!g)return;let{renderStartIndex:S,renderEndIndex:T}=g,{lazyLoadBatchSize:C,lazyLoad:w}=y;w&&((!C||C<=0)&&(!y.groupBy||y.groupBy.length===0)||ZT({startIndex:S,endIndex:T,lazyLoadBatchSize:C,componentState:y,componentActions:o,dismissLoadedRows:b?.dismissLoadedRows??!1},h))},m=Kp(()=>At(p,{wait:d}),[d]);vn(g=>{if(a)return g.sortInfo||g.filterValue||g.groupBy||g.pivotBy||g.refetchKey||g.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),p(s.get(),{dismissLoadedRows:!0})):(g.originalLazyGroupDataChangeDetect||g.groupRowsState)&&p(s.get()),s.onChange(b=>{f.current=b,p(b)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,groupRowsState:u}),Pn(()=>{i&&i>0&&m()},[c])}function ZT(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,c=l?()=>!1:g=>s[g].data!=null,u=!l,d=new te,f=["_______xxx______"];for(let g=t;g<=o;g++){let b=s[g];if(!b)continue;let h=c(g),y=b.dataSourceHasGrouping&&b.groupKeys?[...b.groupKeys]:[];b.isGroupRow&&b.dataSourceHasGrouping&&b.groupKeys&&y.pop();let S=y.length?y:f,T=b.dataSourceHasGrouping?b.indexInGroup:b.indexInAll;if(b.isGroupRow&&!b.collapsed&&!b.childrenAvailable){let C={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:b.groupKeys,append:u},w=b.groupKeys,I=d.get(w);if(!I?.[b.id]){let v=!I;I=I||{},I[b.id]||(I[b.id]=C),v&&d.set(w,I)}}if(!h&&r!=null){let C=d.get(S),w=Math.floor(T/r)*r,I=T-w,v=s[b.indexInAll-I].indexInAll,x=c(v),R=s[v].id;if(x||C?.[R])continue;let P=!C;C=C||{};let A={lazyLoadStartIndex:w,lazyLoadBatchSize:r,groupKeys:y,append:u};C[R]||(C[R]=A),P&&d.set(S,C)}}let p=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,b)=>{let h=[...b.groupKeys,b.lazyLoadStartIndex];if(e&&e.has(h))return g;e?.set(h,!0);let y=[i.data,i,a,b];return g.then(()=>UT()).then(()=>Yo(...y))},p)}var QT=Object.freeze([]),jp=(n,e)=>{let t=n??QT,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};function $i(n,e){if(n===e)return!0;if(n==null||e==null)return n===e;if(typeof n!=typeof e)return!1;if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0,o=n.length;t<o;t++)if(!$i(n[t],e[t]))return!1;return!0}if(typeof n=="object"){let t=Object.keys(n),o=Object.keys(e);if(t.length!==o.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!$i(n[r],e[r]))return!1;return!0}return!1}function JT(n,e){return!(n===void 0||e===void 0||n.isGroupRow!==e.isGroupRow||n.dataSourceHasGrouping!==e.dataSourceHasGrouping||n.isTreeNode!==e.isTreeNode||n.isTreeNode&&n.isParentNode!==e.isParentNode)}var Ui={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},$p={...Ui,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},eC={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},tC={...Ui,...eC,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},Up={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},oC={...Ui,...Up,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},nC={...Ui,...Up,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},rC=Object.entries($p).map(([n,e])=>e?n:void 0).filter(Boolean),iC=Object.entries($p).map(([n,e])=>e?n:void 0),aC=Object.entries(tC).map(([n,e])=>e?n:void 0),lC=Object.entries(oC).map(([n,e])=>e?n:void 0),sC=Object.entries(nC).map(([n,e])=>e?n:void 0);function cC(n,e){if(n===e)return!0;if(!n||!e||!JT(n,e)||n.id!==e.id||n.data!==e.data&&!$i(n.data,e.data))return!1;let t=[];n.dataSourceHasGrouping?t=n.isGroupRow?aC:iC:n.isTreeNode?t=n.isTreeNode&&n.isParentNode?sC:lC:t=rC;for(let o of t){let r=n[o],i=e[o];if(!(typeof r=="function"||typeof i=="function")&&!$i(r,i))return!1}return!0}function Yp(){let n=[],e=new Map,t=(s,c)=>{let u=n,d=c?.marker;d&&d.start({details:[{name:"new dataArray length",value:s.length},{name:"old dataArray length",value:u.length}]});let f=[],p=i();for(let m of p){let g=u[m],b=s[m];if(b===void 0){f.push(m);continue}cC(g,b)||f.push(m)}n=s,f.length>0&&queueMicrotask(()=>{for(let m=0,g=f.length;m<g;m++){let b=f[m],h=e.get(b);if(h)for(let y of h)y()}}),d&&d.end({details:[{name:"updated row infos",value:f.length}]})},o=s=>n[s],r=(s,c)=>{let u=e.get(s);return u||(u=new Set,e.set(s,u)),u.add(c),()=>{let d=e.get(s);d&&(d.delete(c),d.size===0&&e.delete(s))}},i=()=>Array.from(e.keys());return{notifyDataArray:t,getRowInfoAtIndex:o,subscribeToRowIndex:r,getDataArray:()=>n,clear:()=>{n=[],e.clear()}}}var uC=Symbol("cursorId"),qp=n=>n.totalLeafNodesCount===0,dC=n=>n.isParentNode?!qp(n):!0;function Xp(n){let e=Date.now(),t=[],o=[],r=new te;return{logger:Rt(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Yp(),indexer:new ki,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new te,waitForNodePathPromises:new te,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new te,dataParams:void 0,onCleanup:Se(),notifyScrollbarsChange:Se(),notifyScrollStop:Se(),notifyRenderRangeChange:Se(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:uC,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:o,unfilteredCount:o.length,filteredCount:o.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function fC(n){let e={...n};return delete e.originalDataArray,e}var pC=[],Zp=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.unfilteredTreePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear(),n.rowInfoStore.clear()},Qp=(n,e)=>({onDataParamsChange:t=>t?xp(t,100,fC):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??qp,isNodeSelectable:t=>t??dC,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,filterDelay:t=>t??200,filterTypes:t=>({..._o,...t}),sortTypes:t=>({...gr,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugId&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof Ct)return t;let o=n.propsCache.get("rowDisabledState")??Lt,r=o.get(t);return r||(r=new Ct(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>jp(t,n.propsCache.get("sortInfo")),groupBy:t=>t??pC});function mC(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}var Lt=new WeakMap;function gC(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var hC={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Lp(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
`);let o=vn(t);if(n instanceof Je)return n.setConfig(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??oC,i=Nt.get(r);return i&&i.setConfig(o),i=i??new Je(r,o),Nt.set(r,i),i}function $p(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=Wn(e.sortInfo),a=Wn(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((x,_)=>{let E=l[_].operators;x[_]=x[_]||{};let L=x[_];return E.forEach(k=>{L[k.name]=k}),x},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let x=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(x!==void 0&&(x&&typeof x=="object"?u="multi-row":u="single-row"),!u){let _=c.treeSelection??c.defaultTreeSelection;_!==void 0&&(u=typeof _=="object"?"multi-row":"single-row")}u=u??!1}let d=null,f=null,p=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(u!==!1&&(u==="single-row"||u==="multi-row")&&(p===null?d=u==="single-row"?null:new Ee({selectedRows:[],deselectedRows:[],defaultSelection:!1},ut(t)):u==="single-row"||p instanceof Ee?d=p:d=new Ee(p,ut(t))),u==="single-cell"||u==="multi-cell"))if(m===null)f=u==="single-cell"?null:new We;else if(m instanceof We)f=m;else{let x=Nt.get(m)??new We(m);Nt.set(m,x),f=x}let g=t.primaryKey,b=typeof g=="function"?x=>g(x):x=>x[g],h=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(h&&!(h instanceof dt)){let x=Nt.get(h)??new dt(h);Nt.set(h,x),h=x}h=h||new dt({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof Tt)){let x=Nt.get(y)??new Tt(y);Nt.set(y,x),y=x}y=y||new Tt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=tC(e.shouldReloadData||{}),T=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),C=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,w=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&wn('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&wn('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&wn('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let I=typeof e.data=="function"?T??"local":"local",v=e.sortFunction?"local":C??(i?"remote":"local"),D=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":w??(typeof e.data=="function"?"remote":"local"),R=S.pivotBy?"remote":"local",P=t.rowDisabledState,A=e.isRowDisabled;if(!A&&P){let x=Nt.get(P);x?A=x:(A=_=>P.isRowDisabled(_.id),Nt.set(P,A))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:y,treeExpandState:h,treeExpandMode:h.mode,shouldReloadData:{filterValue:S?.filterValue??D==="remote",sortInfo:S?.sortInfo??v==="remote",groupBy:S?.groupBy??I==="remote",pivotBy:S?.pivotBy??R==="remote"},isRowDisabled:A,rowSelection:d,cellSelection:f,groupMode:I,sortMode:v,filterMode:D,pivotMode:R,toPrimaryKey:b,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let x=!o||o.originalDataArray!==t.originalDataArray,_=typeof e.livePaginationCursor=="function"?x?eC(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=_}if(t.devToolsDetected&&t.debugId){let x=eo.get(t.debugId);x&&(M={...M,...x})}return M}var nC=Rt("DataSource:fullLazyLoad");function Up(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&nC('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new Tt({collapsedRows:!0,expandedRows:[]})))}function Yp(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[n,{selectionMode:"single-row"}]};let t=e.__apiRef.current,o=t.treeApi;return{callbackParams:[n.getState(),{treeSelectionState:n,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:o}]}},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof We?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function qp(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=oo(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ze(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=oo(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ze(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=oo(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ze(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=oo(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ze(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=oo(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=oo(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>pt(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Rt(So(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function Xp(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}import ms,{useCallback as rC,useEffect as Qp,useLayoutEffect as gs,useState as Jp}from"react";function Zp(){return so()}function hr(n){let e=Mo(),t=Nr(),o=!!e,r=o?e.id:"master",{contextValue:i,ContextComponent:a}=em(n),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=_e(s),[d]=Jp(()=>Rp({getState:u,actions:l})),f={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:u,assignState:c,dataSourceApi:d},p=_e(i),m=_e(f),g=Xl(),b=rC(({children:h})=>{let y=Ai(),[S]=Jp(()=>Zp());typeof h=="function"&&(h=h(u()));let T=m();return S.setSnapshot(T),gs(()=>{S.notify()}),ms.createElement(a.Provider,{key:r,value:p()},ms.createElement(g.Provider,{value:T},ms.createElement(y.Provider,{value:S},h)))},[a,o,r]);return gs(()=>{let h=t();h&&h.registerDetail(f)},[]),gs(()=>()=>{let h=u();h.onCleanup(h)},[]),kp({dataSourceState:s,dataSourceActions:l,getDataSourceState:u}),Qp(()=>{s.onDataArrayChange?.(s.originalDataArray,s.originalDataArrayChangedInfo),s.onDataMutations&&s.originalDataArrayChangedInfo.mutations&&s.originalDataArrayChangedInfo.mutations.size&&s.onDataMutations({primaryKeyField:typeof s.primaryKey=="string"?s.primaryKey:void 0,dataArray:s.originalDataArray,mutations:s.originalDataArrayChangedInfo.mutations,timestamp:s.originalDataArrayChangedInfo.timestamp}),s.onTreeDataMutations&&s.originalDataArrayChangedInfo.treeMutations&&s.originalDataArrayChangedInfo.treeMutations.size&&s.onTreeDataMutations({nodesKey:s.nodesKey?s.nodesKey:void 0,dataArray:s.originalDataArray,treeMutations:s.originalDataArrayChangedInfo.treeMutations,timestamp:s.originalDataArrayChangedInfo.timestamp})},[s.originalDataArrayChangedInfo]),Qp(()=>{s.onReady?.(d)},[]),{DataSource:b,state:f.dataSourceState}}var Dt=class extends Dn{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var Yi=class Yi{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??Yi.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};Yi.DEFAULT_SIZE=10;var Ui=Yi;var hs=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},qi=class{constructor(e){this.storage=new Ui(e)}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},bs=class{constructor(){this.storage=new Map}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},br=class{constructor(e){this.cacheStorage=e===!1?new hs:e===!0?new bs:typeof e=="number"?new qi(e):new qi(5)}add(e,t){this.cacheStorage.add(e,t)}get(e){return this.cacheStorage.get(e)}delete(e){this.cacheStorage.delete(e)}has(e){return this.cacheStorage.has(e)}};var iC=(e=>(e.INIT="INIT",e))(iC||{});var{useManagedComponent:em}=At({debugName:"DataSource",initSetupState:Bp,forwardProps:jp,concludeReducer:Pp,mapPropsToState:$p,onPropChange:Up,cleanup:Wp,interceptActions:qp(),mappedCallbacks:Yp()});function pz(n){let{DataSource:e}=hr(n);return tm.createElement(e,null,n.children??null)}function mz(){let{rowInfoReducerResults:n}=Oe(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return n}function ys(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(p,m){let g=l[c+p*m],b=a.get(g);if(b&&b.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,f;for(;!f&&u<l.length&&(u++,f=s(u,d),f||(d*=-1,f=s(u,d)),!f););return f&&(o.columnMenuVisibleForColumnId=f),f}function Xi(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function Ss(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function om(n,e,t){if(Ss(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/o),f=Math.floor(c/o),p=l%o,m=c%o,g=Math.min(p,m),b=Math.max(p,m),h=[];for(let y=d;y<=f;y++)for(let S=g;S<=b;S++){let T=y*o+S;if(y===d)for(let C=s;C<r;C++)h.push({rowIndex:T,colIndex:C});else if(y===f)for(let C=0;C<=u;C++)h.push({rowIndex:T,colIndex:C});else for(let C=0;C<r;C++)h.push({rowIndex:T,colIndex:C})}return h}function aC(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var Ts=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Io(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new We(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),f=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!f)return;let p=d.computedVisibleIndex,m=f.computedVisibleIndex,g=Io(l,this.getDataSourceState),b=Io(c,this.getDataSourceState);if(!g||!b)return;let h=g.indexInAll,y=b.indexInAll,[S,T]=Xi({rowIndex:h,colIndex:p},{rowIndex:y,colIndex:m});for(let C=S.rowIndex;C<=T.rowIndex;C++)for(let w=S.colIndex;w<=T.colIndex;w++){let I={rowIndex:C,colIndex:w},[v,D]=this.getCellSelectionPosition(I);o?a.selectCell(v,D):a.deselectCell(v,D)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=ki(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(f=>{this.isCellSelected({rowId:d.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=aC(Array.from(a),i),u=l.map(d=>c.map(f=>this.isCellSelected({rowId:d.id,colId:f})?e(d,f):t));return{columnIds:c,positions:u}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new We(t);o.debugId=e.debugId??"",o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new We(t);o.debugId=e.debugId??"",o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new We:new We(o);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=new We(o);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState(),r=o.cellSelection;if(!r)return;let i=new We(r);i.debugId=o.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let r=new We(o);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function nm(n){return new Ts(n)}function rm(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new Dt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.rowDetailState=new Dt({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(i){let a=t().isRowDetailExpanded;if(!a)return!0;let l=e.getRowInfoByPrimaryKey(i);return l?!a(l):!0},isRowDetailEnabledForRow(i){let{isRowDetailEnabled:a}=t();if(!a)return!1;if(typeof a=="function"){let l=e.getRowInfoByPrimaryKey(i);return l?a(l):!1}return!0},isRowDetailExpanded(i){return!r.isRowDetailCollapsed(i)},collapseRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new Dt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,o.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new Dt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function vo(n,e,t){return Math.min(Math.max(n,e),t)}function Zi(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return vo(a,r,i)}function lC(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:f}=u;if(f==null)return!1;let{start:[p],end:[m]}=d.getRenderRange(),g=f,b=m-p-1,h=0,y=c-1,S={ArrowDown:()=>{f=Zi(o,f,1)},ArrowUp:()=>{f=Zi(o,f,-1)},ArrowLeft:()=>{let C=s[f];if(d.isHorizontalLayoutBrain){let w=d.rowsPerPage;f-w>=h?f=f-w:S.ArrowUp();return}return C&&C.isGroupRow?i.collapseGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.collapseRowDetail(C.id):!1},ArrowRight:()=>{let C=s[f];if(d.isHorizontalLayoutBrain){let w=d.rowsPerPage;f+w<=y?f=f+w:S.ArrowDown();return}return C&&C.isGroupRow?i.expandGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.expandRowDetail(C.id):!1},Enter:()=>{let C=s[f];return C&&C.isGroupRow?i.toggleGroupRow(C.groupKeys):C&&C.isTreeNode&&C.isParentNode?a.treeApi.toggleNode(C.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.toggleRowDetail(C.id):!1},PageDown:()=>{f=Math.min(f+b,c-1)},PageUp:()=>{f=Math.max(f-b,h)},End:()=>{f=y},Home:()=>{f=h}},T=S[l];return T?(T(),g!==f?(r.activeRowIndex=f,!0):!1):!1}function Cs(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,c=i().dataArray,u=o(),{activeCellIndex:d,brain:f}=u;if(!d)return!1;let[p,m]=d,{start:[g,b],end:[h,y]}=f.getRenderRange(),S=h-g-1,T=y-b-1,C=i().dataArray.length-1,w=r().computedVisibleColumns.length-1,I=0,v=0;p=vo(p,0,C),m=vo(m,0,w);let D={ArrowDown:()=>{p=vo(p+1,I,C)},ArrowUp:()=>{p=vo(p-1,I,C)},ArrowLeft:()=>{if(m===v)if(p!==I&&(m=w),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;p-P>=I?p=p-P:D.ArrowUp()}else D.ArrowUp();else m=vo(m-1,v,w)},ArrowRight:()=>{if(m===w)if(p!==C&&(m=v),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;p+P<=C?p=p+P:D.ArrowDown()}else D.ArrowDown();else m=vo(m+1,v,w)},Enter:()=>{let P=c[p];return P&&P.isGroupRow?t.toggleGroupRow(P.groupKeys):P&&P.isTreeNode&&P.isParentNode?a.treeApi.toggleNode(P.nodePath):P&&t.rowDetailApi.isRowDetailEnabledForRow(P.id)?t.rowDetailApi.toggleRowDetail(P.id):!1},PageDown:()=>{s?m=Math.min(m+T,w):p=Math.min(p+S,C)},PageUp:()=>{s?m=Math.max(m-T,v):p=Math.max(p-S,I)},End:()=>{s?m=w:p=C},Home:()=>{s?m=v:p=I}},R=D[l];return R?(R(),[p,m]):!1}function sC(n,e){let t=Cs(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var cC={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function im(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!cC[t]?!1:i!=null&&l==="row"?lC(n,e):a!=null&&l==="cell"?sC(n,e):!1}var ws=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Zi(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Cs(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function am(n){return new ws(n)}function lm(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var Is=class{constructor(e){this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(d=>requestAnimationFrame(d));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a={...St({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;o.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,f=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(f)}),c;try{c=await s(a)}catch(d){c=d}let u=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:u},Promise.resolve(u)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),c=s.get(l),u=t.shouldAcceptEdit??c.shouldAcceptEdit,d=u?u({...St({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(d).then(f=>{if(f===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let c=l.computedEditable(St({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>ct(e,{...this.context,api:this});this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),c=l.get(r),u=i.getRowInfoByIndex(s),d=u?.id;if(!u||!c)return c||console.warn(`No column found with id: "${r}"`),u||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let f=this,{isRowDetailEnabled:p}=a(),m=!p||typeof p=="function"&&!p(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=gn({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:f},rowDetailState:m});return{value:g.formattedValueContext.value,formattedValue:g.formattedValue,rawValue:g.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new Tt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),o=new Tt(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[wo,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||Yo(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=ee.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Ft())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,o={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){o=o||{};let g=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,f=r.brain.scrollTopMax;if(d<0&&f<0)return!0;let p=c.scrollLeft>d+(o.offset||0),m=c.scrollTop>f+(o.offset||0);return p&&m?!1:(c.scrollLeft!==u.scrollLeft&&!p&&(r.scrollerDOMRef.current.scrollLeft=c.scrollLeft),c.scrollTop!==u.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=c.scrollTop),!0)};this.context=e,this.rowSelectionApi=Sp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=am({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=rm({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=nm({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(ys(t),e?.()),setTimeout(()=>{this.isDestroyed()||(ys(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,u=this.getComputed().computedColumnsMap.get(t),d=s[a],f=i??Ed({column:u,rowInfo:d}),p=f;u.getValueToEdit&&(f=await u.getValueToEdit(St({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:f,initialValue:p,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,o);return}let l=i.groupByForColumn,s=i.field,c=l?Array.isArray(l)?l:[l]:[],u=c.map(p=>p.valueGetter?m=>p.valueGetter({data:m,field:p.field}):p.field?p.field:p.groupField??void 0).filter(co);u.length&&(s=u);let d=i.computedSortType;c.length&&d===sn&&(d=c.flatMap(m=>{let g=m.field??m.groupField,b=g?r.get(g):null;return b?b.computedSortType:sn}));let f={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(f.valueGetter=p=>i.valueGetter({data:p,field:i.field})),this.setSortInfoForColumn(e,f,o)}setSortInfoForColumn(e,t,o){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!lm(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:lm(d,l)?(c=!0,t):d),c||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;o.computedFilterValue?(u={...o.computedFilterValue,filter:{...o.computedFilterValue.filter,operator:c}},s.defaultFilterValue!==void 0&&(u.filter.value=s.defaultFilterValue)):(u={filter:{operator:c,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:o.valueGetter},o.field&&(u.field=o.field)),u.id=o.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],c=o.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,f=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:f}}}return a}).filter(co),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.scrollLeft=Math.max(e,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.scrollTop=Math.max(e,0))}scrollRowIntoView(e,t={offset:0}){let o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=o.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&(o.scrollerDOMRef.current.scrollTop=s.scrollTop),u&&(o.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),c=o.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(o.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function sm(n){return new Is(n)}import{useEffect as cm,useRef as uC,useState as dC}from"react";var fC=10;function pC(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${Go} > .${wl}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${ko}`);if(t===!1&&d)return;let f=u.getAttribute("data-column-id"),p=c.cloneNode(!0);p.style.visibility="hidden",p.style.pointerEvents="none",p.classList.remove(...zt.split(" ")),p.style.position="absolute",p.style.width="auto",u.appendChild(p);let m=p.offsetWidth;if(u.removeChild(p),!s[f]){let g=Me().getComputedStyle(u);s[f]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+fC}if(m+=s[f],d){let g=0;u.childNodes.forEach(b=>{if(b!==c){let h=b,y=Math.max(h.offsetWidth,parseInt(h.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let S=Me().getComputedStyle(h);g+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=g}r&&r.has(f)||o&&!o.has(f)||(l[f]=Math.max(m,l[f]||0))}),l}function um(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=Et(),[a,l]=dC(0),s=typeof r=="object"?r.key:r,c=_e(s),u=uC(null);cm(()=>{if(c()==null)return;let{current:f}=u,p=()=>{r!==f&&l(a+1)};return i.onRenderRangeChange(p)},[i]),cm(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),f,p,m=!0;typeof d=="object"&&(d.columnsToResize&&(f=new Set(d.columnsToResize)),d.columnsToSkip&&(p=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let g=pC(t,{includeHeader:m,columnsToResize:f,columnsToSkip:p}),b=Object.keys(g);if(!b.length)return;let h=n().columnSizing,y={...h},S=!1;b.forEach(T=>{y[T]={width:g[T]},S=S||y[T].width!==h[T]?.width}),S&&(e.columnSizing=y)},[s,o,a])}import{useEffect as OC,useMemo as FC,useState as Ps}from"react";var Qi=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,o,r){if(r.horizontalLayout&&!Ss(e,t,r)){om(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=Xi(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let c=i.rowIndex;c<=a.rowIndex;c++)for(let u=i.colIndex;u<=a.colIndex;u++){let d=this.getCellSelectionPosition({rowIndex:c,colIndex:u});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function dm(n,e){return n<e?[n,e]:[e,n]}var Ji=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[o,r]=dm(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[o,r]=dm(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let o;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))o=r;else break}this.multiSelectEndIndex=o}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};import{useMemo as mC}from"react";function fm(n){let{getDataSourceState:e}=Oe(o=>({getDataSourceState:o.getDataSourceState}));return mC(()=>n.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,c=n[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}import{useCallback as gC}from"react";var TV=Rt("useColumnSizeFn");function pm(n){return gC(t=>{let o=n[t];return o?o.computedWidth:0},[n])}import{useEffect as Pn,useLayoutEffect as SC,useMemo as TC}from"react";import{createRef as qo}from"react";var hC={scrollLeft:0,scrollTop:0},yr=class{constructor(){this.scrollPosition=hC;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let o=0,r=t.length;o<r;o++)t[o](e)}};function mm(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}import*as gm from"react";function hm(n){return(e,t)=>gm.createElement(n,{key:e.id,rowInfo:e,cache:t})}var Sr=class extends Bo{constructor(t,o){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.options=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let c=l-s*this.pageWidth,u=[];for(let d=0;d<this.initialCols;d++)u.push(this.getItemSize(d,t));return a+=bi(c,u.concat(u)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,f=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=s,this.availableRenderHeight=s),(d||f)&&this.notifyAvailableSizeChange();let p=typeof o=="number",m=typeof r=="number",g=p&&o!==this.initialRows,b=m&&r!==this.initialCols;p&&g&&(this.initialRows=o,this.rows=o),m&&b&&(this.initialCols=r,this.cols=r);let h=i!=null,y=a!=null,S=h&&i!==this.rowHeight,T=y&&a!==this.initialColWidth;h&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let C=g||S||f,w=b||T||d||C;(w||C)&&this.updateRenderCount({horizontal:w,vertical:C})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=Xt){let o=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/o);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*o,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(o=>{ze(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var bm={};function Rs(n){return`.${Gt}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function vs(n,e){let t=So(n),o=e?new Sr(t,{isHeader:!1}):new Bo(t),r=`${t}:header`,i=e?new Sr(r,{isHeader:!0,masterBrain:o}):new Bo(r);o.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=ar(o),{renderer:s,onRenderUpdater:c}=ar(i);return o.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:o,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function ym({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=vs(n,!!e),c=qo(),u=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:u,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:d=>{if(!c.current)return null;let f=Rs(d);return c.current.querySelector(f)||null},brain:o,headerBrain:r,domRef:c,columnMenuTargetRef:qo(),editingValueRef:qo(),scrollerDOMRef:qo(),portalDOMRef:qo(),focusDetectDOMRef:qo(),activeCellIndicatorDOMRef:qo(),onColumnMenuClick:ye(),cellContextMenu:ye(),contextMenu:ye(),onFilterOperatorMenuClick:ye(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:ye(),onRowHeightCSSVarChange:ye(),onRowDetailHeightCSSVarChange:ye(),onColumnHeaderHeightCSSVarChange:ye(),cellClick:ye(),cellMouseDown:ye(),keyDown:ye(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:t,columnVisibilityForGrouping:{},pinnedStartScrollListener:new yr,pinnedEndScrollListener:new yr,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Sm=n=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new br(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e||"",keyboardSelection:e=>e??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??bm,columnGroupVisibility:e=>e??bm,columnSizing:e=>e||{},columnTypes:e=>e||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:e=>e??"replace",collapsedColumnGroups:e=>e??new Map,columnGroups:1});function bC(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Tm=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.headerRenderer.destroy(),n.onRenderUpdater.destroy(),n.headerOnRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function Cm(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var ea=new WeakMap;function wm(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Im=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=o?.pivotColumnGroups?mm(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=bC({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let b=ea.get(d);b||(b=hm(d),ea.set(d,b)),u=b}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof Dt)&&(c=new Dt(c)),c=c||new Dt({expandedRows:[],collapsedRows:!0}));let f=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,p=c?e.isRowDetailExpanded:void 0;!p&&c&&(p=ea.get(c),p||(p=b=>c.isRowDetailsExpanded(b.id),typeof c=="object"&&ea.set(c,p)));let m=u?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:p,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:f,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||pe.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let b=Jt.get(t.debugId);b&&(g={...g,...b})}return g};function Rm(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function vm(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,c=0,u=r.length;for(let d=0;d<u;d++){let f=r[d],p=i[f];if(!p.isTreeNode&&p.isGroupRow&&(c=Math.max(c,p.groupNesting-1),c===s-1))break}return Object.keys(o).forEach(d=>{let f=o[d],{groupByForColumn:p}=f;if(Array.isArray(p))return;let m=p.field||p.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}import{useCallback as yC}from"react";function Ds(){let{getDataSourceState:n,dataSourceActions:e,getDataSourceMasterContext:t}=Oe(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return yC(r=>{let i=n(),a=new Tt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[wo,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||Yo(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=ee.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Ft())}},[])}function CC(n){return TC(()=>Cm(n),[n])}function Dm(n,e){let{groupBy:t,dataSourceActions:o}=Oe(c=>({groupBy:c.dataSourceState.groupBy,dataSourceActions:c.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=n;Pn(()=>{o.generateGroupRows=r!=="inline"},[r]),Pn(()=>{o.pivotTotalColumnPosition=i},[i]),Pn(()=>{a!=null&&(o.pivotGrandTotalColumnPosition=a)},[a]);let l=CC(t);wC(l,n,e);let{toggleGroupRow:s}=IC();return RC(l,n,e),{toggleGroupRow:s}}function wC(n,e,t){let o=Ds(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(c,u,d,f){let p={};if(d==="inline")return Object.keys(c).forEach(m=>{let g=c[m],b={},h=u.get(g.field);if(h&&d==="inline"){let{groupIndex:S}=h;b={groupByForColumn:h.groupBy,field:h.groupBy?.field,valueGetter:h.groupBy?.valueGetter,valueFormatter:({rowInfo:T})=>T.isGroupRow?T.groupKeys?.[S]:T.value,rowspan:({rowInfo:T,dataArray:C})=>{if(T.isTreeNode||!T.isGroupRow)return 1;let w=C[T.indexInAll-1]||{indexInParentGroups:[]};if(!w||!w.dataSourceHasGrouping)return 1;let I=w.indexInParentGroups||[],v=T.indexInParentGroups||[],D=!1;for(let A=0;A<=S;A++){let M=I[A];if(v[A]!==M){D=!0;break}}if(!D)return 1;let R=T.parents[S];return R?R.groupCount-(R.collapsedChildrenCount||0)+(R.collapsedGroupsCount||0):1},renderGroupIcon:oi({groupIndexForColumn:S,groupRenderStrategy:d,toggleGroupRow:f,initialRenderGroupIcon:g.renderGroupIcon}),render:ti({groupIndexForColumn:S,groupRenderStrategy:d})}}let y={...b,...g};p[m]=y}),Object.keys(p).length===0?void 0:p}Pn(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,n,i,o)})()},[r,n,i,o])}function IC(){let{groupBy:n,pivotBy:e,selectionMode:t}=Oe(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:f}=Et(),p=Ds();return Pn(()=>{(()=>{let{columns:g,groupColumnIds:b}=vC({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:p,selectionMode:t});o.columnsWhenGrouping=g;let h=f().columnOrder;if(b.length&&Array.isArray(h)){let y=new Set(h),S=!1;b.forEach(T=>{y.has(T)||(S=!0,h=[T,...h])}),S&&(o.columnOrder=h)}})()},[r,n,e,t,a,i,l,s,u,c]),{toggleGroupRow:p}}function RC(n,e,t){let{dataArray:o,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Oe(b=>({getDataSourceState:b.getDataSourceState,dataArray:b.dataSourceState.dataArray,groupRowsIndexesInDataArray:b.dataSourceState.groupRowsIndexesInDataArray,groupBy:b.dataSourceState.groupBy,groupRowsState:b.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:b.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:f,groupRenderStrategy:p}=e,m=t,g=_e(e);SC(()=>{if(p!=="multi-column")return;let b=g(),h=Rm(u,n),y=vm({computedGroupColumns:h,columnVisibility:b.columnVisibility,hideEmptyGroupColumns:f,groupRowsIndexesInDataArray:r,dataArray:o,groupBy:i,groupByMap:n});pt(b.columnVisibility,y)||(m.columnVisibility=y)},[s,p,l,i,n,u,f?o:null,f?a:null,f?r:null,f]),Pn(()=>{let b=i.length>0,h=g(),{columnVisibility:y,columnVisibilityForGrouping:S,hideColumnWhenGrouped:T}=h,C={...y},w={...S},I=!1,v=new Set,D=new Set;Object.keys(u).forEach(R=>{let P=u[R];if(P.defaultHiddenWhenGroupedBy||T!=null)if(P.defaultHiddenWhenGroupedBy==="*"&&b||(P.defaultHiddenWhenGroupedBy===!0||T)&&P.field&&n.get(P.field)||typeof P.defaultHiddenWhenGroupedBy=="string"&&n.get(P.defaultHiddenWhenGroupedBy)||typeof P.defaultHiddenWhenGroupedBy=="object"&&Object.keys(P.defaultHiddenWhenGroupedBy).reduce((M,x)=>M||n.has(x),!1)){if(w[R]!==!1){if(y[R]===!1)return;w[R]=!1,I=!0,v.add(R)}}else w[R]===!1&&(delete w[R],I=!0,D.add(R))}),I&&(m.columnVisibilityForGrouping=w,D.forEach(R=>{delete C[R]}),v.forEach(R=>{C[R]=!1}),m.columnVisibility=C)},[u,c,i,n,d])}function vC(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=n;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let f={},p=[];if(c==="multi-column")t.forEach((m,g,b)=>{let h=Id({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:g,groupCount:b.length,groupRenderStrategy:c,selectionMode:r},u,i),y=h.id||`group-by-${m.field||m.groupField}`;p.push(y),f[y]=h});else if(c==="single-column"&&t.length){let m=Rd({groupCount:t.length,groupBy:t,pivotBy:o,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";p.push(g),f[g]=m}if(e){let m={};Object.keys(d).forEach(g=>{let b=d[g];b.field&&(m[b.field]=b)}),Object.keys(e).forEach(g=>{let b=e[g],h=b.pivotTotalColumn&&b.columnGroup,y=b.pivotTotalColumn&&!b.columnGroup;if(h&&a===!1||y&&l===!1)return;let S={...b};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:o,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?m[S.pivotAggregator?.field]:void 0,...S}),!S.render&&S.renderValue&&(S.render=T=>S.renderValue(T)),f[g]=S})}else Object.keys(d).forEach(m=>{let g=d[m];f[m]=g});return{columns:Object.keys(f).length?f:void 0,groupColumnIds:p}}import{useMemo as DC}from"react";var xm=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:c,columnDefaultDraggable:u,sortInfo:d,multiSort:f,filterValue:p,filterTypes:m,columnOrder:g,columnPinning:b,editable:h,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:T,columnDefaultSortable:C,scrollbarWidth:w,columnTypes:I,pinnedEndMaxWidth:v,pinnedStartMaxWidth:D,viewportReservedWidth:R,resizableColumns:P,columnVisibility:A,columnVisibilityAssumeVisible:M,columnSizing:x,groupBy:_})=>{let{computedRemainingSpace:L,computedColumnOrder:k,computedVisibleColumns:V,computedVisibleColumnsMap:W,computedPinnedStartColumns:O,computedPinnedEndColumns:F,computedUnpinnedColumns:J,computedPinnedStartColumnsWidth:j,computedPinnedEndColumnsWidth:U,computedUnpinnedColumnsWidth:ie,computedUnpinnedOffset:be,computedPinnedEndOffset:Te,computedPinnedEndWidth:ce,computedPinnedStartWidth:fe,renderSelectionCheckBox:me,computedColumnsMap:$,computedColumnsMapInInitialOrder:G,fieldsToColumn:q}=DC(()=>wu({columns:n,scrollbarWidth:w,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:R,resizableColumns:P,filterValue:p,filterTypes:m,sortable:a,sortInfo:d,multiSort:f,pinnedEndMaxWidth:v,pinnedStartMaxWidth:D,draggableColumns:c,columnDefaultDraggable:u,columnOrder:g,columnPinning:b,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:T,columnDefaultSortable:C,editable:h,columnSizing:x,columnTypes:I,columnVisibility:A,columnVisibilityAssumeVisible:M??!0,groupBy:_}),[n,e.width,t,o,r,R,w,a,d,f,p,m,g,A,M,u,c,P,v,D,x,I,b,y,S,T,h,_,1]);return{renderSelectionCheckBox:me,columns:n,computedColumnsMap:$,computedPinnedEndWidth:ce,computedPinnedStartWidth:fe,computedRemainingSpace:L,computedUnpinnedOffset:be,computedPinnedEndOffset:Te,computedPinnedStartColumnsWidth:j,computedPinnedEndColumnsWidth:U,computedUnpinnedColumnsWidth:ie,computedPinnedStartColumns:O,computedPinnedEndColumns:F,computedUnpinnedColumns:J,computedVisibleColumns:V,computedVisibleColumnsMap:W,computedColumnOrder:k,computedColumnsMapInInitialOrder:G,fieldsToColumn:q}};import{useMemo as xC}from"react";var xs=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function PC(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],f=d?o(d):0;return e&&e.rowHeight.set(u,f),f}:o;let l=typeof o=="function",s=typeof t=="function";return u=>{if(e&&e.rowHeight.has(u)&&e.rowDetailHeight.has(u))return e.rowHeight.get(u)+e.rowDetailHeight.get(u);let d=a().dataArray[u];if(!d)return e&&(e.rowHeight.set(u,0),e.rowDetailHeight.set(u,0)),0;let f=l?o(d):o;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,0)),f;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,m)),f+m}}function Pm(n){return xC(()=>{let e=new xs;return{computedRowHeight:PC(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}},[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}import{useState as MC,useEffect as AC,useLayoutEffect as EC}from"react";var _C={vertical:!1,horizontal:!1};function Mm(n){let e=n().brain,{getDataSourceState:t}=Ht(),[o,r]=MC(_C);return AC(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(c=>c.vertical===l&&c.horizontal===s?c:{vertical:l,horizontal:s})}),[e]),EC(()=>{let i=t(),{onScrollbarsChange:a}=n(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function Am(n){let{state:e,actions:t,getState:o}=n,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:f,pinnedStartMaxWidth:p,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:b,columnSizing:h,editable:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,columnTypes:w,rowHeight:I,rowDetailHeight:v,isRowDetailExpanded:D,isRowDetailEnabled:R,bodySize:P,showSeparatePivotColumnForSingleAggregation:A,onRowHeightCSSVarChange:M,onFlashingDurationCSSVarChange:x,onRowDetailHeightCSSVarChange:_,onColumnHeaderHeightCSSVarChange:E,computedColumns:L,viewportReservedWidth:k,resizableColumns:V,sortable:W,draggableColumns:O}=e,F=t,{multiSort:J,filterValue:j,filterTypes:U,groupBy:ie,sortInfo:be,dataSourceActions:Te,getDataSourceState:ce,dataSourceApi:fe}=Oe(Ce=>({dataSourceActions:Ce.dataSourceActions,getDataSourceState:Ce.getDataSourceState,dataSourceApi:Ce.dataSourceApi,sortInfo:Ce.dataSourceState.sortInfo,multiSort:Ce.dataSourceState.multiSort,filterValue:Ce.dataSourceState.filterValue,filterTypes:Ce.dataSourceState.filterTypes,groupBy:Ce.dataSourceState.groupBy}));Ps(()=>{M.onChange(Ce=>{Ce&&(F.rowHeight=Ce)}),x.onChange(Ce=>{let tt=Ce?Ce*1:null;tt!=null&&!isNaN(tt)&&(F.flashingDurationCSSVarValue=tt)}),_.onChange(Ce=>{Ce&&(F.rowDetailHeight=Ce)}),E.onChange(Ce=>{Ce&&(F.columnHeaderHeight=Ce)})}),OC(()=>{Te.showSeparatePivotColumnForSingleAggregation=A},[A]);let{toggleGroupRow:me}=Dm(e,t),$=L,{computedColumnOrder:G,computedVisibleColumns:q,computedVisibleColumnsMap:B,computedPinnedStartColumns:ae,computedPinnedEndColumns:ne,computedUnpinnedColumns:z,computedPinnedStartColumnsWidth:de,computedPinnedEndColumnsWidth:N,computedUnpinnedColumnsWidth:X,computedUnpinnedOffset:se,computedPinnedEndOffset:ue,computedRemainingSpace:De,computedPinnedStartWidth:xe,computedPinnedEndWidth:Ve,renderSelectionCheckBox:Fe,computedColumnsMap:Ne,computedColumnsMapInInitialOrder:Ke,fieldsToColumn:qe}=xm({columns:$,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:f,pinnedStartMaxWidth:p,pinnedEndMaxWidth:m,bodySize:P,viewportReservedWidth:k,resizableColumns:V,sortable:W,draggableColumns:O,sortInfo:be??void 0,multiSort:J,groupBy:ie,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:b,editable:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,filterValue:j,filterTypes:U,columnSizing:h,columnTypes:w}),Xe=fm(q),Ze=pm(q),K=Mm(o),re=xe?de>xe:!1,le=Ve?N>Ve:!1,[he]=Ps(()=>new Ji({isRowDisabledAt:tt=>ce().dataArray[tt]?.rowDisabled??!1,getIdForIndex:tt=>ce().dataArray[tt]?.id??-1})),$e=_e(q),[oe]=Ps(()=>new Qi({getPrimaryKeyByIndex:fe.getPrimaryKeyByIndex,getColumnIdByIndex:Ce=>$e()[Ce]?.id||""})),{computedRowHeight:H,computedRowSizeCacheForDetails:et}=Pm({rowDetailHeight:v,rowHeight:I,isRowDetailsExpanded:D,isRowDetailsEnabled:R,getDataSourceState:ce});return FC(()=>({multiRowSelector:he,multiCellSelector:oe,computedRowSizeCacheForDetails:et,computedRowHeight:H,scrollbars:K,columnSize:Ze,rowspan:Xe,toggleGroupRow:me,computedColumnsMap:Ne,computedColumnsMapInInitialOrder:Ke,renderSelectionCheckBox:Fe,computedPinnedStartOverflow:re,computedPinnedEndOverflow:le,computedPinnedStartWidth:xe,computedPinnedEndWidth:Ve,computedVisibleColumns:q,computedColumnOrder:G,computedRemainingSpace:De,computedVisibleColumnsMap:B,computedPinnedStartColumns:ae,computedPinnedEndColumns:ne,computedUnpinnedColumns:z,computedPinnedStartColumnsWidth:de,computedPinnedEndColumnsWidth:N,computedUnpinnedColumnsWidth:X,computedUnpinnedOffset:se,computedPinnedEndOffset:ue,fieldsToColumn:qe}),[he,oe,et,H,K,Ze,Xe,me,Ne,Ke,Fe,re,le,xe,Ve,q,G,De,B,ae,ne,z,de,N,X,se,ue,qe])}import{useMemo as HC}from"react";function NC(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function LC(){return 4294967295}function kC(n,e,t){return e=e>>>8^n[t^e&255],e}function zC(n){return n=~n,n=n<0?4294967295+n+1:n,n}function Ms(n,e=3988292384){var t=NC(e),o=0,r;for(o=LC(),r=0;r<n.length;r++)o=kC(t,o,n.charCodeAt(r));return o=zC(o),`${o}`}var VC=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},Em=(n,e=console.error.bind(console))=>{n=["* * * infinite-table.com * * *",...n];let t=Math.max(Math.max(...n.map(o=>o.length))+8,60);n.forEach(o=>{let r=(t-o.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+o+" "+"*".repeat(l))}),e("*".repeat(t))},_m=(n="",e,t)=>{let o;try{o=GC(n)}catch{return Em(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(o.end);return i<r?(Em([`
|
|
27
|
+
`);let o=Dn(t);if(n instanceof et)return n.setConfig(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??hC,i=Lt.get(r);return i&&i.setConfig(o),i=i??new et(r,o),Lt.set(r,i),i}function Jp(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=jn(e.sortInfo),a=jn(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((D,_)=>{let O=l[_].operators;D[_]=D[_]||{};let L=D[_];return O.forEach(V=>{L[V.name]=V}),D},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let D=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(D!==void 0&&(D&&typeof D=="object"?u="multi-row":u="single-row"),!u){let _=c.treeSelection??c.defaultTreeSelection;_!==void 0&&(u=typeof _=="object"?"multi-row":"single-row")}u=u??!1}let d=null,f=null,p=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(u!==!1&&(u==="single-row"||u==="multi-row")&&(p===null?d=u==="single-row"?null:new Ee({selectedRows:[],deselectedRows:[],defaultSelection:!1},ut(t)):u==="single-row"||p instanceof Ee?d=p:d=new Ee(p,ut(t))),u==="single-cell"||u==="multi-cell"))if(m===null)f=u==="single-cell"?null:new je;else if(m instanceof je)f=m;else{let D=Lt.get(m)??new je(m);Lt.set(m,D),f=D}let g=t.primaryKey,b=typeof g=="function"?D=>g(D):D=>D[g],h=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(h&&!(h instanceof dt)){let D=Lt.get(h)??new dt(h);Lt.set(h,D),h=D}h=h||new dt({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof Tt)){let D=Lt.get(y)??new Tt(y);Lt.set(y,D),y=D}y=y||new Tt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=gC(e.shouldReloadData||{}),T=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),C=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,w=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&In('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&In('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&In('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let I=typeof e.data=="function"?T??"local":"local",v=e.sortFunction?"local":C??(i?"remote":"local"),x=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":w??(typeof e.data=="function"?"remote":"local"),R=S.pivotBy?"remote":"local",P=t.rowDisabledState,A=e.isRowDisabled;if(!A&&P){let D=Lt.get(P);D?A=D:(A=_=>P.isRowDisabled(_.id),Lt.set(P,A))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:y,treeExpandState:h,treeExpandMode:h.mode,shouldReloadData:{filterValue:S?.filterValue??x==="remote",sortInfo:S?.sortInfo??v==="remote",groupBy:S?.groupBy??I==="remote",pivotBy:S?.pivotBy??R==="remote"},isRowDisabled:A,rowSelection:d,cellSelection:f,groupMode:I,sortMode:v,filterMode:x,pivotMode:R,toPrimaryKey:b,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let D=!o||o.originalDataArray!==t.originalDataArray,_=typeof e.livePaginationCursor=="function"?D?mC(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=_}if(t.devToolsDetected&&t.debugId){let D=to.get(t.debugId);D&&(M={...M,...D})}return M}var bC=Rt("DataSource:fullLazyLoad");function em(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&bC('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new Tt({collapsedRows:!0,expandedRows:[]})))}function tm(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[n,{selectionMode:"single-row"}]};let t=e.__apiRef.current,o=t.treeApi;return{callbackParams:[n.getState(),{treeSelectionState:n,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:o}]}},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof je?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function om(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=no(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ze(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=no(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ze(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=no(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ze(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=no(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ze(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=no(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=no(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>pt(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Rt(To(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function nm(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}import gs,{useCallback as yC,useEffect as im,useLayoutEffect as hs,useState as am}from"react";function rm(){return co()}function yr(n){let e=Ao(),t=kr(),o=!!e,r=o?e.id:"master",{contextValue:i,ContextComponent:a}=lm(n),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=_e(s),[d]=am(()=>Ep({getState:u,actions:l})),f={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:u,assignState:c,dataSourceApi:d},p=_e(i),m=_e(f),g=Zl(),b=yC(({children:h})=>{let y=Ei(),[S]=am(()=>rm());typeof h=="function"&&(h=h(u()));let T=m();return S.setSnapshot(T),hs(()=>{S.notify()}),gs.createElement(a.Provider,{key:r,value:p()},gs.createElement(g.Provider,{value:T},gs.createElement(y.Provider,{value:S},h)))},[a,o,r]);return hs(()=>{let h=t();h&&h.registerDetail(f)},[]),hs(()=>()=>{let h=u();h.onCleanup(h)},[]),Wp({dataSourceState:s,dataSourceActions:l,getDataSourceState:u}),im(()=>{s.onDataArrayChange?.(s.originalDataArray,s.originalDataArrayChangedInfo),s.onDataMutations&&s.originalDataArrayChangedInfo.mutations&&s.originalDataArrayChangedInfo.mutations.size&&s.onDataMutations({primaryKeyField:typeof s.primaryKey=="string"?s.primaryKey:void 0,dataArray:s.originalDataArray,mutations:s.originalDataArrayChangedInfo.mutations,timestamp:s.originalDataArrayChangedInfo.timestamp}),s.onTreeDataMutations&&s.originalDataArrayChangedInfo.treeMutations&&s.originalDataArrayChangedInfo.treeMutations.size&&s.onTreeDataMutations({nodesKey:s.nodesKey?s.nodesKey:void 0,dataArray:s.originalDataArray,treeMutations:s.originalDataArrayChangedInfo.treeMutations,timestamp:s.originalDataArrayChangedInfo.timestamp})},[s.originalDataArrayChangedInfo]),im(()=>{s.onReady?.(d)},[]),{DataSource:b,state:f.dataSourceState}}var xt=class extends xn{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var qi=class qi{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??qi.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};qi.DEFAULT_SIZE=10;var Yi=qi;var bs=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},Xi=class{constructor(e){this.storage=new Yi(e)}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},ys=class{constructor(){this.storage=new Map}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},Sr=class{constructor(e){this.cacheStorage=e===!1?new bs:e===!0?new ys:typeof e=="number"?new Xi(e):new Xi(5)}add(e,t){this.cacheStorage.add(e,t)}get(e){return this.cacheStorage.get(e)}delete(e){this.cacheStorage.delete(e)}has(e){return this.cacheStorage.has(e)}};var SC=(e=>(e.INIT="INIT",e))(SC||{});var{useManagedComponent:lm}=Et({debugName:"DataSource",initSetupState:Xp,forwardProps:Qp,concludeReducer:Np,mapPropsToState:Jp,onPropChange:em,cleanup:Zp,interceptActions:om(),mappedCallbacks:tm()});function _z(n){let{DataSource:e}=yr(n);return sm.createElement(e,null,n.children??null)}function Oz(){let{rowInfoReducerResults:n}=Oe(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return n}function Ss(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(p,m){let g=l[c+p*m],b=a.get(g);if(b&&b.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,f;for(;!f&&u<l.length&&(u++,f=s(u,d),f||(d*=-1,f=s(u,d)),!f););return f&&(o.columnMenuVisibleForColumnId=f),f}function Zi(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function Ts(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function cm(n,e,t){if(Ts(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/o),f=Math.floor(c/o),p=l%o,m=c%o,g=Math.min(p,m),b=Math.max(p,m),h=[];for(let y=d;y<=f;y++)for(let S=g;S<=b;S++){let T=y*o+S;if(y===d)for(let C=s;C<r;C++)h.push({rowIndex:T,colIndex:C});else if(y===f)for(let C=0;C<=u;C++)h.push({rowIndex:T,colIndex:C});else for(let C=0;C<r;C++)h.push({rowIndex:T,colIndex:C})}return h}function TC(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var Cs=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Ro(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new je(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),f=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!f)return;let p=d.computedVisibleIndex,m=f.computedVisibleIndex,g=Ro(l,this.getDataSourceState),b=Ro(c,this.getDataSourceState);if(!g||!b)return;let h=g.indexInAll,y=b.indexInAll,[S,T]=Zi({rowIndex:h,colIndex:p},{rowIndex:y,colIndex:m});for(let C=S.rowIndex;C<=T.rowIndex;C++)for(let w=S.colIndex;w<=T.colIndex;w++){let I={rowIndex:C,colIndex:w},[v,x]=this.getCellSelectionPosition(I);o?a.selectCell(v,x):a.deselectCell(v,x)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=zi(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(f=>{this.isCellSelected({rowId:d.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=TC(Array.from(a),i),u=l.map(d=>c.map(f=>this.isCellSelected({rowId:d.id,colId:f})?e(d,f):t));return{columnIds:c,positions:u}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new je(t);o.debugId=e.debugId??"",o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new je(t);o.debugId=e.debugId??"",o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new je:new je(o);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=new je(o);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState(),r=o.cellSelection;if(!r)return;let i=new je(r);i.debugId=o.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let r=new je(o);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function um(n){return new Cs(n)}function dm(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new xt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.rowDetailState=new xt({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(i){let a=t().isRowDetailExpanded;if(!a)return!0;let l=e.getRowInfoByPrimaryKey(i);return l?!a(l):!0},isRowDetailEnabledForRow(i){let{isRowDetailEnabled:a}=t();if(!a)return!1;if(typeof a=="function"){let l=e.getRowInfoByPrimaryKey(i);return l?a(l):!1}return!0},isRowDetailExpanded(i){return!r.isRowDetailCollapsed(i)},collapseRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new xt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,o.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new xt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function Do(n,e,t){return Math.min(Math.max(n,e),t)}function Qi(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return Do(a,r,i)}function CC(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:f}=u;if(f==null)return!1;let{start:[p],end:[m]}=d.getRenderRange(),g=f,b=m-p-1,h=0,y=c-1,S={ArrowDown:()=>{f=Qi(o,f,1)},ArrowUp:()=>{f=Qi(o,f,-1)},ArrowLeft:()=>{let C=s[f];if(d.isHorizontalLayoutBrain){let w=d.rowsPerPage;f-w>=h?f=f-w:S.ArrowUp();return}return C&&C.isGroupRow?i.collapseGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.collapseRowDetail(C.id):!1},ArrowRight:()=>{let C=s[f];if(d.isHorizontalLayoutBrain){let w=d.rowsPerPage;f+w<=y?f=f+w:S.ArrowDown();return}return C&&C.isGroupRow?i.expandGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.expandRowDetail(C.id):!1},Enter:()=>{let C=s[f];return C&&C.isGroupRow?i.toggleGroupRow(C.groupKeys):C&&C.isTreeNode&&C.isParentNode?a.treeApi.toggleNode(C.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.toggleRowDetail(C.id):!1},PageDown:()=>{f=Math.min(f+b,c-1)},PageUp:()=>{f=Math.max(f-b,h)},End:()=>{f=y},Home:()=>{f=h}},T=S[l];return T?(T(),g!==f?(r.activeRowIndex=f,!0):!1):!1}function ws(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,c=i().dataArray,u=o(),{activeCellIndex:d,brain:f}=u;if(!d)return!1;let[p,m]=d,{start:[g,b],end:[h,y]}=f.getRenderRange(),S=h-g-1,T=y-b-1,C=i().dataArray.length-1,w=r().computedVisibleColumns.length-1,I=0,v=0;p=Do(p,0,C),m=Do(m,0,w);let x={ArrowDown:()=>{p=Do(p+1,I,C)},ArrowUp:()=>{p=Do(p-1,I,C)},ArrowLeft:()=>{if(m===v)if(p!==I&&(m=w),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;p-P>=I?p=p-P:x.ArrowUp()}else x.ArrowUp();else m=Do(m-1,v,w)},ArrowRight:()=>{if(m===w)if(p!==C&&(m=v),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;p+P<=C?p=p+P:x.ArrowDown()}else x.ArrowDown();else m=Do(m+1,v,w)},Enter:()=>{let P=c[p];return P&&P.isGroupRow?t.toggleGroupRow(P.groupKeys):P&&P.isTreeNode&&P.isParentNode?a.treeApi.toggleNode(P.nodePath):P&&t.rowDetailApi.isRowDetailEnabledForRow(P.id)?t.rowDetailApi.toggleRowDetail(P.id):!1},PageDown:()=>{s?m=Math.min(m+T,w):p=Math.min(p+S,C)},PageUp:()=>{s?m=Math.max(m-T,v):p=Math.max(p-S,I)},End:()=>{s?m=w:p=C},Home:()=>{s?m=v:p=I}},R=x[l];return R?(R(),[p,m]):!1}function wC(n,e){let t=ws(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var IC={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function fm(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!IC[t]?!1:i!=null&&l==="row"?CC(n,e):a!=null&&l==="cell"?wC(n,e):!1}var Is=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Qi(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=ws(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function pm(n){return new Is(n)}function mm(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var Rs=class{constructor(e){this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(d=>requestAnimationFrame(d));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a={...St({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;o.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,f=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(f)}),c;try{c=await s(a)}catch(d){c=d}let u=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:u},Promise.resolve(u)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),c=s.get(l),u=t.shouldAcceptEdit??c.shouldAcceptEdit,d=u?u({...St({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(d).then(f=>{if(f===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let c=l.computedEditable(St({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>ct(e,{...this.context,api:this});this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),c=l.get(r),u=i.getRowInfoByIndex(s),d=u?.id;if(!u||!c)return c||console.warn(`No column found with id: "${r}"`),u||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let f=this,{isRowDetailEnabled:p}=a(),m=!p||typeof p=="function"&&!p(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=mn({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:f},rowDetailState:m});return{value:g.formattedValueContext.value,formattedValue:g.formattedValue,rawValue:g.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new Tt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),o=new Tt(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[Io,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||Yo(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=te.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Nt())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,o={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){o=o||{};let g=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,f=r.brain.scrollTopMax;if(d<0&&f<0)return!0;let p=c.scrollLeft>d+(o.offset||0),m=c.scrollTop>f+(o.offset||0);return p&&m?!1:(c.scrollLeft!==u.scrollLeft&&!p&&(r.scrollerDOMRef.current.scrollLeft=c.scrollLeft),c.scrollTop!==u.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=c.scrollTop),!0)};this.context=e,this.rowSelectionApi=Dp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=pm({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=dm({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=um({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(Ss(t),e?.()),setTimeout(()=>{this.isDestroyed()||(Ss(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,u=this.getComputed().computedColumnsMap.get(t),d=s[a],f=i??_d({column:u,rowInfo:d}),p=f;u.getValueToEdit&&(f=await u.getValueToEdit(St({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:f,initialValue:p,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,o);return}let l=i.groupByForColumn,s=i.field,c=l?Array.isArray(l)?l:[l]:[],u=c.map(p=>p.valueGetter?m=>p.valueGetter({data:m,field:p.field}):p.field?p.field:p.groupField??void 0).filter(uo);u.length&&(s=u);let d=i.computedSortType;c.length&&d===sn&&(d=c.flatMap(m=>{let g=m.field??m.groupField,b=g?r.get(g):null;return b?b.computedSortType:sn}));let f={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(f.valueGetter=p=>i.valueGetter({data:p,field:i.field})),this.setSortInfoForColumn(e,f,o)}setSortInfoForColumn(e,t,o){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!mm(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:mm(d,l)?(c=!0,t):d),c||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;o.computedFilterValue?(u={...o.computedFilterValue,filter:{...o.computedFilterValue.filter,operator:c}},s.defaultFilterValue!==void 0&&(u.filter.value=s.defaultFilterValue)):(u={filter:{operator:c,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:o.valueGetter},o.field&&(u.field=o.field)),u.id=o.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],c=o.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,f=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:f}}}return a}).filter(uo),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.scrollLeft=Math.max(e,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.scrollTop=Math.max(e,0))}scrollRowIntoView(e,t={offset:0}){let o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=o.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&(o.scrollerDOMRef.current.scrollTop=s.scrollTop),u&&(o.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),c=o.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(o.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function gm(n){return new Rs(n)}import{useEffect as hm,useRef as RC,useState as vC}from"react";var DC=10;function xC(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${Go} > .${Il}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${ko}`);if(t===!1&&d)return;let f=u.getAttribute("data-column-id"),p=c.cloneNode(!0);p.style.visibility="hidden",p.style.pointerEvents="none",p.classList.remove(...Vt.split(" ")),p.style.position="absolute",p.style.width="auto",u.appendChild(p);let m=p.offsetWidth;if(u.removeChild(p),!s[f]){let g=ve().getComputedStyle(u);s[f]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+DC}if(m+=s[f],d){let g=0;u.childNodes.forEach(b=>{if(b!==c){let h=b,y=Math.max(h.offsetWidth,parseInt(h.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let S=ve().getComputedStyle(h);g+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=g}r&&r.has(f)||o&&!o.has(f)||(l[f]=Math.max(m,l[f]||0))}),l}function bm(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=_t(),[a,l]=vC(0),s=typeof r=="object"?r.key:r,c=_e(s),u=RC(null);hm(()=>{if(c()==null)return;let{current:f}=u,p=()=>{r!==f&&l(a+1)};return i.onRenderRangeChange(p)},[i]),hm(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),f,p,m=!0;typeof d=="object"&&(d.columnsToResize&&(f=new Set(d.columnsToResize)),d.columnsToSkip&&(p=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let g=xC(t,{includeHeader:m,columnsToResize:f,columnsToSkip:p}),b=Object.keys(g);if(!b.length)return;let h=n().columnSizing,y={...h},S=!1;b.forEach(T=>{y[T]={width:g[T]},S=S||y[T].width!==h[T]?.width}),S&&(e.columnSizing=y)},[s,o,a])}import{useEffect as UC,useMemo as YC,useState as Ms}from"react";var Ji=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,o,r){if(r.horizontalLayout&&!Ts(e,t,r)){cm(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=Zi(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let c=i.rowIndex;c<=a.rowIndex;c++)for(let u=i.colIndex;u<=a.colIndex;u++){let d=this.getCellSelectionPosition({rowIndex:c,colIndex:u});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function ym(n,e){return n<e?[n,e]:[e,n]}var ea=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[o,r]=ym(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[o,r]=ym(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let o;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))o=r;else break}this.multiSelectEndIndex=o}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};import{useMemo as PC}from"react";function Sm(n){let{getDataSourceState:e}=Oe(o=>({getDataSourceState:o.getDataSourceState}));return PC(()=>n.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,c=n[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}import{useCallback as MC}from"react";var VV=Rt("useColumnSizeFn");function Tm(n){return MC(t=>{let o=n[t];return o?o.computedWidth:0},[n])}import{useEffect as Mn,useLayoutEffect as OC,useMemo as FC}from"react";import{createRef as qo}from"react";var AC={scrollLeft:0,scrollTop:0},Tr=class{constructor(){this.scrollPosition=AC;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let o=0,r=t.length;o<r;o++)t[o](e)}};function Cm(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}import*as wm from"react";function Im(n){return(e,t)=>wm.createElement(n,{key:e.id,rowInfo:e,cache:t})}var Cr=class extends Bo{constructor(t,o){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.options=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let c=l-s*this.pageWidth,u=[];for(let d=0;d<this.initialCols;d++)u.push(this.getItemSize(d,t));return a+=yi(c,u.concat(u)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,f=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=s,this.availableRenderHeight=s),(d||f)&&this.notifyAvailableSizeChange();let p=typeof o=="number",m=typeof r=="number",g=p&&o!==this.initialRows,b=m&&r!==this.initialCols;p&&g&&(this.initialRows=o,this.rows=o),m&&b&&(this.initialCols=r,this.cols=r);let h=i!=null,y=a!=null,S=h&&i!==this.rowHeight,T=y&&a!==this.initialColWidth;h&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let C=g||S||f,w=b||T||d||C;(w||C)&&this.updateRenderCount({horizontal:w,vertical:C})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=Zt){let o=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/o);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*o,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(o=>{ze(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var Rm={};function vs(n){return`.${Ht}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function Ds(n,e){let t=To(n),o=e?new Cr(t,{isHeader:!1}):new Bo(t),r=`${t}:header`,i=e?new Cr(r,{isHeader:!0,masterBrain:o}):new Bo(r);o.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=sr(o),{renderer:s,onRenderUpdater:c}=sr(i);return o.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:o,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function vm({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Ds(n,!!e),c=qo(),u=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:u,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:d=>{if(!c.current)return null;let f=vs(d);return c.current.querySelector(f)||null},brain:o,headerBrain:r,domRef:c,columnMenuTargetRef:qo(),editingValueRef:qo(),scrollerDOMRef:qo(),portalDOMRef:qo(),focusDetectDOMRef:qo(),activeCellIndicatorDOMRef:qo(),onColumnMenuClick:Se(),cellContextMenu:Se(),contextMenu:Se(),onFilterOperatorMenuClick:Se(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:Se(),onRowHeightCSSVarChange:Se(),onRowDetailHeightCSSVarChange:Se(),onColumnHeaderHeightCSSVarChange:Se(),cellClick:Se(),cellMouseDown:Se(),keyDown:Se(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:t,columnVisibilityForGrouping:{},pinnedStartScrollListener:new Tr,pinnedEndScrollListener:new Tr,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Dm=n=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new Sr(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e||"",keyboardSelection:e=>e??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??Rm,columnGroupVisibility:e=>e??Rm,columnSizing:e=>e||{},columnTypes:e=>e||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:e=>e??"replace",collapsedColumnGroups:e=>e??new Map,columnGroups:1});function EC(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var xm=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.headerRenderer.destroy(),n.onRenderUpdater.destroy(),n.headerOnRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function Pm(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var ta=new WeakMap;function Mm(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Am=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=o?.pivotColumnGroups?Cm(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=EC({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let b=ta.get(d);b||(b=Im(d),ta.set(d,b)),u=b}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof xt)&&(c=new xt(c)),c=c||new xt({expandedRows:[],collapsedRows:!0}));let f=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,p=c?e.isRowDetailExpanded:void 0;!p&&c&&(p=ta.get(c),p||(p=b=>c.isRowDetailsExpanded(b.id),typeof c=="object"&&ta.set(c,p)));let m=u?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:p,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:f,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||ge.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let b=eo.get(t.debugId);b&&(g={...g,...b})}return g};function Em(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function _m(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,c=0,u=r.length;for(let d=0;d<u;d++){let f=r[d],p=i[f];if(!p.isTreeNode&&p.isGroupRow&&(c=Math.max(c,p.groupNesting-1),c===s-1))break}return Object.keys(o).forEach(d=>{let f=o[d],{groupByForColumn:p}=f;if(Array.isArray(p))return;let m=p.field||p.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}import{useCallback as _C}from"react";function xs(){let{getDataSourceState:n,dataSourceActions:e,getDataSourceMasterContext:t}=Oe(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return _C(r=>{let i=n(),a=new Tt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Io,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||Yo(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=te.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Nt())}},[])}function NC(n){return FC(()=>Pm(n),[n])}function Om(n,e){let{groupBy:t,dataSourceActions:o}=Oe(c=>({groupBy:c.dataSourceState.groupBy,dataSourceActions:c.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=n;Mn(()=>{o.generateGroupRows=r!=="inline"},[r]),Mn(()=>{o.pivotTotalColumnPosition=i},[i]),Mn(()=>{a!=null&&(o.pivotGrandTotalColumnPosition=a)},[a]);let l=NC(t);LC(l,n,e);let{toggleGroupRow:s}=kC();return zC(l,n,e),{toggleGroupRow:s}}function LC(n,e,t){let o=xs(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(c,u,d,f){let p={};if(d==="inline")return Object.keys(c).forEach(m=>{let g=c[m],b={},h=u.get(g.field);if(h&&d==="inline"){let{groupIndex:S}=h;b={groupByForColumn:h.groupBy,field:h.groupBy?.field,valueGetter:h.groupBy?.valueGetter,valueFormatter:({rowInfo:T})=>T.isGroupRow?T.groupKeys?.[S]:T.value,rowspan:({rowInfo:T,dataArray:C})=>{if(T.isTreeNode||!T.isGroupRow)return 1;let w=C[T.indexInAll-1]||{indexInParentGroups:[]};if(!w||!w.dataSourceHasGrouping)return 1;let I=w.indexInParentGroups||[],v=T.indexInParentGroups||[],x=!1;for(let A=0;A<=S;A++){let M=I[A];if(v[A]!==M){x=!0;break}}if(!x)return 1;let R=T.parents[S];return R?R.groupCount-(R.collapsedChildrenCount||0)+(R.collapsedGroupsCount||0):1},renderGroupIcon:ri({groupIndexForColumn:S,groupRenderStrategy:d,toggleGroupRow:f,initialRenderGroupIcon:g.renderGroupIcon}),render:ni({groupIndexForColumn:S,groupRenderStrategy:d})}}let y={...b,...g};p[m]=y}),Object.keys(p).length===0?void 0:p}Mn(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,n,i,o)})()},[r,n,i,o])}function kC(){let{groupBy:n,pivotBy:e,selectionMode:t}=Oe(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:f}=_t(),p=xs();return Mn(()=>{(()=>{let{columns:g,groupColumnIds:b}=VC({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:p,selectionMode:t});o.columnsWhenGrouping=g;let h=f().columnOrder;if(b.length&&Array.isArray(h)){let y=new Set(h),S=!1;b.forEach(T=>{y.has(T)||(S=!0,h=[T,...h])}),S&&(o.columnOrder=h)}})()},[r,n,e,t,a,i,l,s,u,c]),{toggleGroupRow:p}}function zC(n,e,t){let{dataArray:o,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Oe(b=>({getDataSourceState:b.getDataSourceState,dataArray:b.dataSourceState.dataArray,groupRowsIndexesInDataArray:b.dataSourceState.groupRowsIndexesInDataArray,groupBy:b.dataSourceState.groupBy,groupRowsState:b.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:b.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:f,groupRenderStrategy:p}=e,m=t,g=_e(e);OC(()=>{if(p!=="multi-column")return;let b=g(),h=Em(u,n),y=_m({computedGroupColumns:h,columnVisibility:b.columnVisibility,hideEmptyGroupColumns:f,groupRowsIndexesInDataArray:r,dataArray:o,groupBy:i,groupByMap:n});pt(b.columnVisibility,y)||(m.columnVisibility=y)},[s,p,l,i,n,u,f?o:null,f?a:null,f?r:null,f]),Mn(()=>{let b=i.length>0,h=g(),{columnVisibility:y,columnVisibilityForGrouping:S,hideColumnWhenGrouped:T}=h,C={...y},w={...S},I=!1,v=new Set,x=new Set;Object.keys(u).forEach(R=>{let P=u[R];if(P.defaultHiddenWhenGroupedBy||T!=null)if(P.defaultHiddenWhenGroupedBy==="*"&&b||(P.defaultHiddenWhenGroupedBy===!0||T)&&P.field&&n.get(P.field)||typeof P.defaultHiddenWhenGroupedBy=="string"&&n.get(P.defaultHiddenWhenGroupedBy)||typeof P.defaultHiddenWhenGroupedBy=="object"&&Object.keys(P.defaultHiddenWhenGroupedBy).reduce((M,D)=>M||n.has(D),!1)){if(w[R]!==!1){if(y[R]===!1)return;w[R]=!1,I=!0,v.add(R)}}else w[R]===!1&&(delete w[R],I=!0,x.add(R))}),I&&(m.columnVisibilityForGrouping=w,x.forEach(R=>{delete C[R]}),v.forEach(R=>{C[R]=!1}),m.columnVisibility=C)},[u,c,i,n,d])}function VC(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=n;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let f={},p=[];if(c==="multi-column")t.forEach((m,g,b)=>{let h=Rd({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:g,groupCount:b.length,groupRenderStrategy:c,selectionMode:r},u,i),y=h.id||`group-by-${m.field||m.groupField}`;p.push(y),f[y]=h});else if(c==="single-column"&&t.length){let m=vd({groupCount:t.length,groupBy:t,pivotBy:o,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";p.push(g),f[g]=m}if(e){let m={};Object.keys(d).forEach(g=>{let b=d[g];b.field&&(m[b.field]=b)}),Object.keys(e).forEach(g=>{let b=e[g],h=b.pivotTotalColumn&&b.columnGroup,y=b.pivotTotalColumn&&!b.columnGroup;if(h&&a===!1||y&&l===!1)return;let S={...b};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:o,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?m[S.pivotAggregator?.field]:void 0,...S}),!S.render&&S.renderValue&&(S.render=T=>S.renderValue(T)),f[g]=S})}else Object.keys(d).forEach(m=>{let g=d[m];f[m]=g});return{columns:Object.keys(f).length?f:void 0,groupColumnIds:p}}import{useMemo as GC}from"react";var Fm=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:c,columnDefaultDraggable:u,sortInfo:d,multiSort:f,filterValue:p,filterTypes:m,columnOrder:g,columnPinning:b,editable:h,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:T,columnDefaultSortable:C,scrollbarWidth:w,columnTypes:I,pinnedEndMaxWidth:v,pinnedStartMaxWidth:x,viewportReservedWidth:R,resizableColumns:P,columnVisibility:A,columnVisibilityAssumeVisible:M,columnSizing:D,groupBy:_})=>{let{computedRemainingSpace:L,computedColumnOrder:V,computedVisibleColumns:z,computedVisibleColumnsMap:G,computedPinnedStartColumns:E,computedPinnedEndColumns:F,computedUnpinnedColumns:q,computedPinnedStartColumnsWidth:B,computedPinnedEndColumnsWidth:U,computedUnpinnedColumnsWidth:ne,computedUnpinnedOffset:me,computedPinnedEndOffset:he,computedPinnedEndWidth:ie,computedPinnedStartWidth:ue,renderSelectionCheckBox:fe,computedColumnsMap:Y,computedColumnsMapInInitialOrder:k,fieldsToColumn:$}=GC(()=>Iu({columns:n,scrollbarWidth:w,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:R,resizableColumns:P,filterValue:p,filterTypes:m,sortable:a,sortInfo:d,multiSort:f,pinnedEndMaxWidth:v,pinnedStartMaxWidth:x,draggableColumns:c,columnDefaultDraggable:u,columnOrder:g,columnPinning:b,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:T,columnDefaultSortable:C,editable:h,columnSizing:D,columnTypes:I,columnVisibility:A,columnVisibilityAssumeVisible:M??!0,groupBy:_}),[n,e.width,t,o,r,R,w,a,d,f,p,m,g,A,M,u,c,P,v,x,D,I,b,y,S,T,h,_,1]);return{renderSelectionCheckBox:fe,columns:n,computedColumnsMap:Y,computedPinnedEndWidth:ie,computedPinnedStartWidth:ue,computedRemainingSpace:L,computedUnpinnedOffset:me,computedPinnedEndOffset:he,computedPinnedStartColumnsWidth:B,computedPinnedEndColumnsWidth:U,computedUnpinnedColumnsWidth:ne,computedPinnedStartColumns:E,computedPinnedEndColumns:F,computedUnpinnedColumns:q,computedVisibleColumns:z,computedVisibleColumnsMap:G,computedColumnOrder:V,computedColumnsMapInInitialOrder:k,fieldsToColumn:$}};import{useMemo as HC}from"react";var Ps=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function KC(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],f=d?o(d):0;return e&&e.rowHeight.set(u,f),f}:o;let l=typeof o=="function",s=typeof t=="function";return u=>{if(e&&e.rowHeight.has(u)&&e.rowDetailHeight.has(u))return e.rowHeight.get(u)+e.rowDetailHeight.get(u);let d=a().dataArray[u];if(!d)return e&&(e.rowHeight.set(u,0),e.rowDetailHeight.set(u,0)),0;let f=l?o(d):o;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,0)),f;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,m)),f+m}}function Nm(n){return HC(()=>{let e=new Ps;return{computedRowHeight:KC(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}},[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}import{useState as BC,useEffect as WC,useLayoutEffect as jC}from"react";var $C={vertical:!1,horizontal:!1};function Lm(n){let e=n().brain,{getDataSourceState:t}=Kt(),[o,r]=BC($C);return WC(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(c=>c.vertical===l&&c.horizontal===s?c:{vertical:l,horizontal:s})}),[e]),jC(()=>{let i=t(),{onScrollbarsChange:a}=n(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function km(n){let{state:e,actions:t,getState:o}=n,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:f,pinnedStartMaxWidth:p,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:b,columnSizing:h,editable:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,columnTypes:w,rowHeight:I,rowDetailHeight:v,isRowDetailExpanded:x,isRowDetailEnabled:R,bodySize:P,showSeparatePivotColumnForSingleAggregation:A,onRowHeightCSSVarChange:M,onFlashingDurationCSSVarChange:D,onRowDetailHeightCSSVarChange:_,onColumnHeaderHeightCSSVarChange:O,computedColumns:L,viewportReservedWidth:V,resizableColumns:z,sortable:G,draggableColumns:E}=e,F=t,{multiSort:q,filterValue:B,filterTypes:U,groupBy:ne,sortInfo:me,dataSourceActions:he,getDataSourceState:ie,dataSourceApi:ue}=Oe(Ce=>({dataSourceActions:Ce.dataSourceActions,getDataSourceState:Ce.getDataSourceState,dataSourceApi:Ce.dataSourceApi,sortInfo:Ce.dataSourceState.sortInfo,multiSort:Ce.dataSourceState.multiSort,filterValue:Ce.dataSourceState.filterValue,filterTypes:Ce.dataSourceState.filterTypes,groupBy:Ce.dataSourceState.groupBy}));Ms(()=>{M.onChange(Ce=>{Ce&&(F.rowHeight=Ce)}),D.onChange(Ce=>{let ot=Ce?Ce*1:null;ot!=null&&!isNaN(ot)&&(F.flashingDurationCSSVarValue=ot)}),_.onChange(Ce=>{Ce&&(F.rowDetailHeight=Ce)}),O.onChange(Ce=>{Ce&&(F.columnHeaderHeight=Ce)})}),UC(()=>{he.showSeparatePivotColumnForSingleAggregation=A},[A]);let{toggleGroupRow:fe}=Om(e,t),Y=L,{computedColumnOrder:k,computedVisibleColumns:$,computedVisibleColumnsMap:K,computedPinnedStartColumns:X,computedPinnedEndColumns:oe,computedUnpinnedColumns:H,computedPinnedStartColumnsWidth:se,computedPinnedEndColumnsWidth:N,computedUnpinnedColumnsWidth:Q,computedUnpinnedOffset:de,computedPinnedEndOffset:pe,computedRemainingSpace:Pe,computedPinnedStartWidth:Me,computedPinnedEndWidth:Ve,renderSelectionCheckBox:Fe,computedColumnsMap:Ne,computedColumnsMapInInitialOrder:Ke,fieldsToColumn:Xe}=Fm({columns:Y,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:f,pinnedStartMaxWidth:p,pinnedEndMaxWidth:m,bodySize:P,viewportReservedWidth:V,resizableColumns:z,sortable:G,draggableColumns:E,sortInfo:me??void 0,multiSort:q,groupBy:ne,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:b,editable:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,filterValue:B,filterTypes:U,columnSizing:h,columnTypes:w}),Ze=Sm($),Qe=Tm($),j=Lm(o),le=Me?se>Me:!1,ce=Ve?N>Ve:!1,[ye]=Ms(()=>new ea({isRowDisabledAt:ot=>ie().dataArray[ot]?.rowDisabled??!1,getIdForIndex:ot=>ie().dataArray[ot]?.id??-1})),Ue=_e($),[ae]=Ms(()=>new Ji({getPrimaryKeyByIndex:ue.getPrimaryKeyByIndex,getColumnIdByIndex:Ce=>Ue()[Ce]?.id||""})),{computedRowHeight:W,computedRowSizeCacheForDetails:tt}=Nm({rowDetailHeight:v,rowHeight:I,isRowDetailsExpanded:x,isRowDetailsEnabled:R,getDataSourceState:ie});return YC(()=>({multiRowSelector:ye,multiCellSelector:ae,computedRowSizeCacheForDetails:tt,computedRowHeight:W,scrollbars:j,columnSize:Qe,rowspan:Ze,toggleGroupRow:fe,computedColumnsMap:Ne,computedColumnsMapInInitialOrder:Ke,renderSelectionCheckBox:Fe,computedPinnedStartOverflow:le,computedPinnedEndOverflow:ce,computedPinnedStartWidth:Me,computedPinnedEndWidth:Ve,computedVisibleColumns:$,computedColumnOrder:k,computedRemainingSpace:Pe,computedVisibleColumnsMap:K,computedPinnedStartColumns:X,computedPinnedEndColumns:oe,computedUnpinnedColumns:H,computedPinnedStartColumnsWidth:se,computedPinnedEndColumnsWidth:N,computedUnpinnedColumnsWidth:Q,computedUnpinnedOffset:de,computedPinnedEndOffset:pe,fieldsToColumn:Xe}),[ye,ae,tt,W,j,Qe,Ze,fe,Ne,Ke,Fe,le,ce,Me,Ve,$,k,Pe,K,X,oe,H,se,N,Q,de,pe,Xe])}import{useMemo as tw}from"react";function qC(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function XC(){return 4294967295}function ZC(n,e,t){return e=e>>>8^n[t^e&255],e}function QC(n){return n=~n,n=n<0?4294967295+n+1:n,n}function As(n,e=3988292384){var t=qC(e),o=0,r;for(o=XC(),r=0;r<n.length;r++)o=ZC(t,o,n.charCodeAt(r));return o=QC(o),`${o}`}var JC=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},zm=(n,e=console.error.bind(console))=>{n=["* * * infinite-table.com * * *",...n];let t=Math.max(Math.max(...n.map(o=>o.length))+8,60);n.forEach(o=>{let r=(t-o.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+o+" "+"*".repeat(l))}),e("*".repeat(t))},Vm=(n="",e,t)=>{let o;try{o=ew(n)}catch{return zm(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(o.end);return i<r?(zm([`
|
|
28
28
|
Your Infinite Table license has expired on ${i.toDateString()}.
|
|
29
|
-
`,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),!1):!0},GC=n=>{let e="",t=n.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let c=t[s];if(Ms(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Ms(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),VC(t)};var KC=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,BC=/(https):\/\/\S+(\.csb\.app)/g,Om=typeof window<"u"?window.location.origin:"",WC=()=>{let[n,e,t]=Array.from(KC.exec(Om)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},jC=()=>{let[n,e,t]=Array.from(BC.exec(Om)||[]);return e==="https"&&t===".csb.app"},$C=jC()||WC(),Fm=(n="")=>{let t=!!Mo();return HC(()=>{if(t)return!0;let r=_m(n,{publishedAt:1624970570587,version:"8.0.0"});return!n&&!r&&$C?!0:r},[n,t])};import{useRef as Nm,useEffect as Lm}from"react";var UC=10;function km(n,e,t){let o=Nm(!1),r=Nm(null);Lm(()=>{n!=null&&(o.current=!1,_t(r.current))},[n]),Lm(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,_t(r.current),r.current=ze(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<UC&&a(l)})};var i=a;a()}return()=>{_t(r.current)}},[n,e])}import{useRef as zm,useEffect as Vm}from"react";var YC=10;function Gm(n,e,t){let o=zm(!1),r=zm(null);Vm(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),Vm(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<YC&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}function Hm(){return so()}var Km=n=>`--infinite-${n}`;import{useCallback as rw,useMemo as iw,useEffect as aw}from"react";function Bm(n,e){As(n,e),XC(n,e),e.detail===2&&qC(n,e),n.getState().onCellClick?.(n,e)}function qC(n,e){if(Qr(e.target))return;let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function XC(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:f}=r(),{brain:p,debugId:m}=o(),{rowsPerPage:g}=p,b=f.length,h=new We(u);h.debugId=m??"",d.cellSelectionState=h;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let S=!!o().wrapRowsHorizontally;d.multiSelectClick(y,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:b}:{horizontalLayout:S})}else d.resetClick(y);l.cellSelection=h}function As(n,e){let{rowIndex:t,getDataSourceState:o,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=n,{multiRowSelector:s,renderSelectionCheckBox:c}=r(),u=o(),{selectionMode:d,groupBy:f,dataArray:p,isTree:m}=u;if(f.length||m||p[t]?.rowDisabled)return!1;if(d==="multi-row"){if(c&&!e.key)return!1;let{rowSelection:b}=u;if(b=l(b),s.rowSelectionState=b,b&&typeof b=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=b,!0}else if(d==="single-row"){let h=p[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(h):a.rowSelectionApi.selectRow(h)}return!1}function Wm(n,e){e.detail!==2&&void 0}var ZC={Enter:!0," ":!0,a:!0};function jm(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=n,{key:c,ctrlKey:u,metaKey:d}=e;if(!ZC[c])return!1;let f=t(),p=o(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:b,keyboardSelection:h}=f,{selectionMode:y,groupBy:S,rowSelection:T,treeSelectionState:C,isTree:w}=p;if(h===!1)return!1;let I=b==="row"&&m!=null?m:b==="cell"&&g!=null?g[0]:null,v=I!=null?p.dataArray[I]:null;if(!v||I==null)return!1;if(y==="single-row"&&c===" ")return i.rowSelectionApi.toggleRowSelection(v.id),!0;if(y!=="multi-row")return!1;if(c==="a"&&(u||d)){if(w&&C){let R=s(C);return R.selectAll(),r.treeSelection=R,!0}let D=l(T);return D.selectAll(),r.rowSelection=D,!0}if(c===" "){if(S.length)return v.isGroupRow&&v.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(v.groupKeys):i.rowSelectionApi.toggleRowSelection(v.id),!0;if(w){if(v.isTreeNode&&v.nodePath)return a.treeApi.toggleNodeSelection(v.nodePath),!0}else{let D={...e},{renderSelectionCheckBox:R}=n.getComputed();return R&&(D.metaKey=!1,D.ctrlKey=!0),As({...n,rowIndex:I},D)}}return!1}var $m=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Um=n=>Array.from(n.querySelectorAll($m)).filter(t=>!!t.offsetParent),ta=n=>n.querySelector($m);var qm=en(Oo());async function Ym(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var QC=10,JC=(n,e)=>n-e;function oa(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=o(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),f=u[n.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===n.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let p=c[n.rowIndex],m=!s||typeof s=="function"&&!s(p)?!1:i.rowDetailApi.isRowDetailExpanded(p.id)?"expanded":"collapsed",g=ct(f.id,e);return f.contentFocusable({column:f,...gn({column:f,rowInfo:p,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function Es(n,e,t){let o=t.getState().editingCell;return ew(n,e,t,{isCellFocusable:oa,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function Xm(n,e,t){let o=(0,qm.default)(t,n+e,JC);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=Xm;function ew(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,f)=>(d.push(f.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),c=n.rowIndex,u=n.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:Xm(u,e,a),u===null){if(c+=e,c<0||c>=s.length)return null;continue}if(i({colIndex:u,rowIndex:c},t))return{colIndex:u,rowIndex:c}}return null}async function Zm(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=oa(e,n)?e:Es(e,-1,n);if(t){await _s([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;ta(o)?.focus()}}async function _s([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=QC,l=null,s=!1;function c(u=0){u++,_t(l),l=ze(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&u<a&&c(u),s){try{await Ym(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var tw=`.${Gt}`;function Qm(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r||i&&t===-1)return!1;let a=i?null:po(o,tw),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:u}=n.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&oa({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:Es({rowIndex:l,colIndex:s},t,n);if(!c){if(t===-1)r.focus();else{let u=Um(document.body),d=n.getState().focusDetectDOMRef.current,f=u.findIndex(m=>m===d);u[f+1]?.focus()}return!0}return _s([c.rowIndex,c.colIndex],n).then(()=>{let u=n.getState().getDOMNodeForCell(c);if(!u)return;ta(u)?.focus()}),!0}var Jm={control:"ctrl"},eg={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},ow={esc:"escape"},og={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},ng=Object.keys(og),Os=new Set(ng),nw=new Set(["shift","alt"]);function Fs(n,e){return Array.isArray(e)?e.some(t=>tg(n,t)):tg(n,e)}function tg(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(f=>f.toLowerCase().trim()),r=o.find(f=>eg[f]),i=o.map(f=>Jm[f]||eg[f]||ow[f]||f),a=i.filter(f=>Os.has(f)),l=i.filter(f=>!Os.has(f)),s=ng.reduce((f,p)=>(f[p]=og[p](n),f),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(f=>s[f]);if(!a.every(f=>s[f]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(p=>!nw.has(p)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||Os.has(t)||t==="meta"||Jm[t]?!1:l.reduce((f,p)=>f?p==="*"||t===p:!1,!0)}async function rg(n,e){let t={...n,cloneRowSelection:a=>Ni(a,n.getDataSourceState),cloneTreeSelection:a=>Vi(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&jm(t,e)&&e.preventDefault(),(Qm(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&im(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,c=n.getComputed().computedVisibleColumns[s];c.computedEditable&&n.api.startEdit({rowIndex:l,columnId:c.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!Fs(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function lw(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=Ge(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=Ht();return iw(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>Vi(u,i),cloneRowSelection:u=>Ni(u,i)}),[n,e,i,a,t,l,o])}function sw(){let n=lw();aw(()=>{let e=n.getState().keyDown.onChange(a=>{rg(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],c=ct(s.id,n);Bm({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=n.getComputed().computedVisibleColumns[c],d=ct(u.id,n);Wm({...n,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function cw(){let{getState:n}=te(t=>({getState:t.getState}));return{onKeyDown:rw(t=>{n().keyDown(t)},[])}}function ig(){return sw(),cw()}import{useEffect as xg}from"react";import*as He from"react";import{useCallback as Ls,useEffect as uw,useLayoutEffect as dw,useState as ra}from"react";import{createPortal as fw}from"react-dom";function Ns(n){return!!n.tagName}function sg(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=Re.from(Ns(e)?e.getBoundingClientRect():e),a=Re.from(Ns(t)?t.getBoundingClientRect():t),l=o?Re.from(Ns(o)?o.getBoundingClientRect():o):null;if(!l)return{...ag({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=ag({anchorRect:a,targetRect:i,position:r[c],constrainRect:l});if(c===0&&(s={...d,index:0}),d.valid)return{...d,index:c}}return s}function ag(n){let e=Re.from(n.targetRect),t=Re.from(n.anchorRect),o=n.constrainRect?Re.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=lg(e,i),s=lg(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function lg(n,e){return e==="TopLeft"?Be.from({top:n.top,left:n.left}):e==="TopCenter"?Be.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?Be.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?Be.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?Be.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?Be.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?Be.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?Be.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):Be.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}var na="__is_infinite_menu_component";function pw(n){return n&&typeof n.then=="function"||n instanceof Promise}function dg(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function cg(n){return typeof n=="function"&&(n=n()),pw(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&dg(n)&&(n=n.getBoundingClientRect()),n?Re.from(n):null}async function mw(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),dg(o)&&(r=o),r||null}return t(await e)}function gw(n){return He.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function hw(n){let e=He.useRef(null);return uw(()=>n.realign.onChange(t=>{e.current&&t&&ug(e.current,t)}),[n.realign]),He.createElement("div",{style:{position:"absolute",top:0,left:0},ref:Ls(t=>{t&&ug(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}async function ug(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await cg(t)||void 0,a=o?await cg(o):void 0,l=Re.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=sg({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=n.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=n.offsetParent;if(u){let d=u.getBoundingClientRect(),f=d.left,p=d.top,m=s.left-f,g=s.top-p;n.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function bw(n,e){let[t,o]=ra(null);return dw(()=>{async function r(){let i=e?await mw(e):null;i!=null&&o(i)}e&&r()},[e]),e?t?fw(n,t):He.createElement(He.Fragment,null):e===null||e===!1?n:He.createElement(gw,null,n)}function yw(n){if(He.Children.count(n)===1){let e=He.Children.only(n);if(He.isValidElement(e))return e.props.id||e.key}return null}function Sw(n,e,t){if(He.Children.count(n)===1){let o=He.Children.only(n);if(He.isValidElement(o)&&o.type[na]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),He.cloneElement(o,r)}}return n}function no(n){let e=n,[t]=ra(()=>new Map),[o,r]=ra(null),[i,a]=ra(0),l=Ls(()=>{let m=[];for(let[g,b]of t)m.push(He.createElement(hw,{...b,key:b.key}));return m},[]),[s,c]=kt(),u=bw(l(),n.portalContainer),d=Ls((m,g)=>{let h=`${g.id||yw(m)||Ft()}`,y=t.get(h),S=w=>()=>{let I=typeof w=="function"?w():w;return Sw(I,e.portalContainer,g.constrainTo??e.constrainTo)},T=S(m),C=(w,I)=>{if(!y)return;let v=S(w);Object.assign(y,{children:v}),c(),!!!I?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),C(m),C):(y={key:h,children:T,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:ye()},t.set(y.key,y),c(),C)},[t,e.portalContainer,c]);He.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let f=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},p=()=>{t.clear(),c()};return He.useEffect(()=>{},[]),{portal:u,hideOverlay:f,clearAll:p,rerenderOverlays:c,showOverlay:d}}import*as vg from"react";import*as An from"react";import*as Mn from"react";import*as Tr from"react";function ia(n){return null}ia.defaultProps={__is_menu_item:!0};var fg="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",pg=ge({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),mg="db3arf1",gg="db3arfd";var Tw="-";function Cw(){return Tr.createElement("hr",{className:gg})}var aa=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===Tw?Tr.createElement(Cw,null):r:null;return i!=null?{type:"item",parentMenuId:o,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}};function hg(n,e){return Tr.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===ia)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),aa(n,o)}return aa(n,t)})||[]}var bg="submenu";function yg(){let n=Mn.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Ft(),focused:!1,destroyed:!1,domRef:n}}var Sg=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),ww=[{name:"label"}],Tg=n=>{let{props:e,state:t}=n,{activeItemKey:o,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,c=e.id||t.generatedId;s&&(c=`${s}-${c}`);let u=[...e.columns||ww],d={columns:u,keyboardActiveItemKey:r,activeItemKey:o,menuId:c},f=[];i?f=i.map(aa.bind(null,d)):!i&&typeof a!="function"&&(f=hg(d,a)),l&&f.filter(g=>g.type==="item"&&g.menu!=null).length>0&&!u.find(g=>g.name==bg)&&u.push({name:bg,render:({domProps:g,item:b})=>b.menu?Mn.createElement("div",{...g},Mn.createElement(zo,{expanded:!1})):Mn.createElement("div",{...g})});let p=f.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:f,runtimeSelectableItems:p,columns:u,menuId:c}};import*as Lt from"react";import{useCallback as Xo,useLayoutEffect as Ew,useRef as _w,useState as Vs}from"react";var Cr=class extends pn{constructor(e){super(e.slice(0,3))}};var Iw=250;function Rw(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}ze(i)};ze(()=>{i()})})}var vw=Me(),la=class{constructor(e){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||Iw;this.getPointerMoveTarget=()=>document.documentElement||vw;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=e=>{if(clearTimeout(this.mouseMoveTimeoutId),!e){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let t=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=t);let r=t-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=t;let i=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e)};if(r){i();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&i()},this.getTimeout());let l=new Be({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,u=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(u-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=u,(s?new Cr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Cr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(e,t)=>{if(e!==this.activeItem){if(e==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=e,this.params.onItemActivate(e,t),this.activeItemMenuRect=null,Rw(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Be({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};import{createContext as Dw,useContext as xw}from"react";var ks=Dw(null);function zs(){return xw(ks)}import{useCallback as Pw,useEffect as Mw,useRef as Aw}from"react";function Cg(){let n=Aw(!0);return Mw(()=>(n.current=!0,()=>{n.current=!1}),[]),Pw(()=>n.current,[])}function Ow(n,e){let{parentMenuId:t,setSubmenuApi:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=n.menu;return u?(typeof u=="function"&&(u=u()),Lt.createElement(Wt,{key:c,parentMenuItemKey:n.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,f)=>{u?.onShow?.(d,f),o(f)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(n.key),s.focus())}})):null}function Fw(n,e){let t=wg(n,e);if(!t.length)return null;let o=Re.from(t[0]?.getBoundingClientRect()),r=Re.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function wg(n,e){let t=po(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function Nw(n,e){let t=wg(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function Lw({onItemActivate:n}){let{getState:e}=zs(),[{onItemEnter:t,onItemLeave:o}]=Vs(()=>new la({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?Re.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:Xo(t,[]),onItemLeave:Xo(o,[])}}function Ig(n){let{domProps:e}=n,{componentState:{columns:t,runtimeItems:o,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:f,autoFocus:p,parentMenuItemKey:m,domRef:g},componentActions:b,getState:h}=zs(),y=Xo(j=>{b.keyboardActiveItemKey=j},[]),S=Xo(j=>{b.activeItemKey=j},[]),T=Cg(),[C,w]=Vs(null),I=null;Ew(()=>{let{runtimeItems:j}=h(),U=j.filter(ie=>ie.type==="item"&&i===ie.key)[0];if(!U||!U.menu){w(null),P();return}if(U){let ie=Fw(r,U.key);ie&&D(()=>Ow(U,{constrainTo:l,setSubmenuApi:w,setActiveItemKey:S,setKeyboardActiveItemKey:y,parentMenuId:r,onHideIntent:W,api:O}),{id:`${r}-submenu`,alignTo:ie,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let v=(j,U)=>{y(U.key),S(U.key),U.originalMenuItem.onClick&&U.originalMenuItem.onClick(j);let ie={key:U.key,item:U.originalMenuItem,hideMenu:W};U.originalMenuItem.onAction&&U.originalMenuItem.onAction(ie),c&&c(ie),U.originalMenuItem.hideMenuOnAction&&W()},{showOverlay:D,portal:R,clearAll:P}=no({portalContainer:!1}),{onItemEnter:A,onItemLeave:M}=Lw({onItemActivate:j=>{if(!T())return;let U=j?j.key:null;S(U)}});I=o.map((j,U)=>Lt.createElement(kw,{key:j.type==="item"?j.key:U,onItemEnter:(ie,be)=>{A(ie.key,be)},onItemLeave:(ie,be)=>{M(ie.key,be)},columns:t,active:j.type==="item"&&j.key===i,keyboardActive:j.type==="item"&&j.key===a,item:j,index:U,onClick:v}));let x=t.map(j=>j.width||(typeof j.flex=="number"?`${j.flex}fr`:j.flex)||"auto").join(" "),_={...e.style,gridTemplateColumns:x,gridTemplateRows:o.map(()=>"auto").join(" ")};u||(_.whiteSpace="nowrap");function E(j){let{runtimeItems:U,runtimeSelectableItems:ie}=h(),be=U.findIndex($=>$.type==="item"&&$.key===a),Te=a,ce=U[be],fe={ArrowUp:()=>{let $=U.slice(0,be).filter(G=>G.type==="item"&&!G.disabled).pop();$&&$.type==="item"&&$.key&&(Te=$.key)},ArrowDown:()=>{let $=U.slice(be+1).filter(G=>G.type==="item"&&!G.disabled)[0];$&&$.type==="item"&&$.key&&(Te=$.key)},Home:()=>{fe.PageUp()},End:()=>{fe.PageDown()},PageUp:()=>{Te=ie[0].key},PageDown:()=>{Te=ie[ie.length-1].key},ArrowLeft:()=>{S(null),h().parentMenuId&&(b.destroyed=!0)},ArrowRight:()=>{ce&&(S(ce.key),ze(()=>{T()&&C&&C.getParentMenuId()===h().menuId&&C.focus()}))},Enter:()=>{if(ce)if(ce.originalMenuItem?.menu){if(ce&&ce.originalMenuItem.menu&&C){fe.ArrowLeft();return}ce&&S(ce.key)}else v(j,ce)}," ":()=>{if(!ce)return;ce.originalMenuItem.menu||v(j,ce);let $=Nw(r,ce.key);$&&$.click()},Escape:()=>{fe.ArrowLeft();let $=h();$.parentMenuId||$.onHideIntent?.($)}},me=fe[j.key];me&&(me(),j.preventDefault()),Te!=a&&y(Te)}function L(){b.focused=!1}let k=Xo(function(){b.focused=!0,setTimeout(()=>{V.current&&g.current&&g.current===document.activeElement&&h().keyboardActiveItemKey==null&&y(h().runtimeSelectableItems[0]?.key??null)})},[]),V=_w(!0),W=Xo(()=>{let j=h();j.onHideIntent?.(j)},[h]),[O]=Vs(()=>({hideMenu:W,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),k())},getMenuId:()=>h().menuId,getParentMenuId:()=>h().parentMenuId})),F=Xo(j=>{j?(g.current=j,d?.(h(),O),p&&O.focus()):(f?.(h()),g.current=j)},[]),J=Lt.createElement("div",{className:rn.contents},Lt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:F,onKeyDown:j=>{e.onKeyDown?.(j),E(j)},onMouseDown:j=>{V.current=!1,e.onMouseDown?.(j)},onMouseUp:j=>{V.current=!0,e.onMouseUp?.(j)},onFocus:k,onBlur:L,className:Q(fg,e.className,"InfiniteMenu"),style:_},I),R);return s?null:J}function kw(n){let[e,t]=Lt.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=Lt.createElement("div",{style:r.style},r.value);else{let u=0;c=o.map((d,f)=>{let p=r.value,m=d.field||d.name,g=f+1,b=g+r.span;if(g<u)return null;u=b;let y={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:b},"data-menu-column-id":`${r.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${r.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${r.key}`,className:Q(pg({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||n.active}),r.className),onPointerEnter:S=>{r.disabled||n.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||n.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||n.onClick(S,r)}};return d.render?Lt.createElement(er,{key:`${s}-${m}`,render:d.render,renderParam:{item:p,column:d,value:p[m],domProps:y}}):Lt.createElement("div",{key:`${s}-${m}`,...y},p[m])}).filter(Boolean)}return Lt.createElement("div",{className:mg},c)}var{ManagedComponentContextProvider:zw}=At({initSetupState:yg,forwardProps:Sg,mapPropsToState:Tg,layoutEffect:!0});function Vw(n){let{componentActions:e,componentState:t}=Et(),o=_e(t);return An.createElement(ks.Provider,{value:{componentActions:e,componentState:t,getState:o}},An.createElement(Ig,{domProps:n.domProps}))}function Wt(n){let{children:e,portalContainer:t,items:o,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:f,parentMenuItemKey:p,autoFocus:m,id:g,onHideIntent:b,__is_infinite_menu_component:h,...y}=n;return An.createElement(zw,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...n},An.createElement(Vw,{domProps:y}))}Wt[na]=!0;import*as Gs from"react";function Rg(n,e){let{columnApi:t,column:o,getComputed:r,api:i,dataSourceApi:a}=e,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((f,p)=>{let m=_o(f,e,"column-menu");u.push({key:p,label:m,check:Gs.createElement(Yt,{key:f.id,disabled:f.computedVisible&&i.getVisibleColumnsCount()===1,checked:f.computedVisible,onChange:g=>{let b=!!g;i.setVisibilityForColumn(f.id,b),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}},"-",{key:"group-by",label:"Group by",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((f,p)=>{if(f.groupByForColumn)return;let m=_o(f,e,"column-menu");u.push({key:p,label:m,check:Gs.createElement(Yt,{key:f.id,disabled:!f.computedGroupable,checked:f.computedGroupedBy,onChange:()=>{a.toggleGroupByField(f.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function Dg(n,e,t){if(n==null)return null;let{getComputed:o,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??Wt,s=o().computedColumnsMap.get(n);if(!s)return null;let c={column:s,columnApi:ct(s.id,e),...e},u=Rg([],c),d=a?a(u,c):u,f=m=>{m.__insideMenu=!0},p=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!d||!d.length?null:vg.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:p,onHideIntent:m=>{p(m),t?.()}})}var Gw=`[${Ml["data-name"]}="${Al["data-name"]}"]`;function Hw(n){let{columnId:e,context:t,clearAll:o,showOverlay:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){o(),a.columnMenuVisibleForColumnId=null}let u=n.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${Qf["data-column-id"]}="${e}"] ${Gw}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Dg(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function Pg(){let n=Ge(),{getState:e,actions:t,columnMenuVisibleForColumnId:o,columnMenuVisibleKey:r}=te(c=>({getState:c.getState,actions:c.actions,columnMenuVisibleForColumnId:c.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:c.state.columnMenuVisibleKey})),{portalDOMRef:i}=$t(c=>({portalDOMRef:c.getMasterState().portalDOMRef}))||{},{showOverlay:a,portal:l,clearAll:s}=no({portalContainer:i?.current??!1});return xg(()=>{let c=e();return c.onColumnMenuClick.onChange(u=>{u&&(c.columnMenuTargetRef.current=u.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=u.column.id)})},[]),xg(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=e();if(c){let f=function(p){p.__insideMenu!==!0&&(s(),t.columnMenuVisibleForColumnId=null)};var d=f;return document.documentElement.addEventListener("mousedown",f),Hw({columnId:c,context:n,clearAll:s,showOverlay:a}),()=>{document.documentElement.removeEventListener("mousedown",f)}}else u.current=null,s();return()=>{}},[o,r]),{menuPortal:l}}import*as Mg from"react";import{useCallback as Kw}from"react";var Bw={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function Ag(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=Ge(),{getDataSourceState:a,getDataSourceMasterContext:l}=Ht(),{focusDetectDOMRef:s}=n(),c=Kw(async()=>{Zm({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return Mg.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:Bw})}import{useEffect as wr}from"react";function Ww(){let n=Ge(),{getState:e,editingCell:t}=te(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active?t.cancelled:void 0;wr(()=>{if(o){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...St({rowIndex:r,columnId:i,...n}),initialValue:a})}},[o])}function jw(){let n=Ge(),{getState:e,editingCell:t}=te(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;wr(()=>{if(o){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...St({rowIndex:r,columnId:i,...n}),value:a,error:o,initialValue:l})}},[o])}function $w(){let n=Ge(),{editingCell:e}=te(r=>({editingCell:r.state.editingCell})),t=e?.active,o=Ao(t);wr(()=>{!t&&o&&n.api.focus()},[t,o])}function Uw(){let n=Ge(),{editingCell:e,getState:t}=te(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e&&!e.active&&!e.cancelled&&e.accepted===!0;wr(()=>{if(o){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...St({rowIndex:a,columnId:l,...n}),value:i,initialValue:s};t().onEditAccepted?.(c),n.api.persistEdit({value:i})}},[o])}function Yw(){let n=Ge(),{editingCell:e,getState:t}=te(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e?e.persisted:void 0;wr(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:c,initialValue:u}=r,d={...St({rowIndex:l,columnId:s,...n}),value:c,initialValue:u};o instanceof Error?i?.({...d,error:o}):a?.(d)}},[o])}function Eg(){Ww(),jw(),Uw(),Yw(),$w()}import{useEffect as Fg}from"react";import*as Do from"react";import*as Hs from"react";var sa=n=>Hs.createElement(ke,{...n},Hs.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));import*as Ks from"react";var _g=n=>Ks.createElement(ke,{...n},Ks.createElement("path",{d:"m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"}));function Og(n,e,t){if(n==null)return null;let{getComputed:o,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),f=u?.Menu??Wt,p=o().computedColumnsMap.get(n);if(!p)return null;let m=I=>{I.__insideMenu=!0},g=I=>{I.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:b}=i(),h=b[p.computedFilterType];if(!h)return null;let y=h.operators.map(I=>{let v=I.name,D=p.computedFilterValue?p.computedFilterValue.filter.operator===v:v===h.defaultOperator,R=I.components?.Icon??ln;return{key:v,icon:Do.createElement(R,null),label:Do.createElement(Do.Fragment,null,I.label??I.name),onAction:()=>{c.setColumnFilterOperator(n,v)},checked:D?Do.createElement(_g,{size:16}):null}}),T=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Do.createElement(sa,null),disabled:!p.computedFiltered,onAction:()=>{c.clearColumnFilter(n)}},"-"],...y],C={column:p,api:c,getState:r,getDataSourceState:i,getComputed:o,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:p.computedFilterValue,filterTypes:b},w=d?d(T,C):T;return Do.createElement(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:w,onShow:I=>{I.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:I=>{g(I),t?.()}})}var ca=10;function Ng(){let{portalDOMRef:n}=$t(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},e=Ge(),{getState:t,actions:o}=e,{showOverlay:r,portal:i,clearAll:a}=no({portalContainer:n?.current??!1});return Fg(()=>t().onFilterOperatorMenuClick.onChange(s=>{if(!s)return;let{target:c,column:u}=s;function d(){a(),o.filterOperatorMenuVisibleForColumnId=null}let f=c?.parentElement||c,p=Re.from(f.getBoundingClientRect());p.top-=ca,p.left-=ca,p.width+=2*ca,p.height+=2*ca,r(()=>Og(u.id,e,d),{constrainTo:t().domRef.current,id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),o.contextMenuVisibleFor=null,o.cellContextMenuVisibleFor=null,o.columnMenuVisibleForColumnId=null,o.filterOperatorMenuVisibleForColumnId=u.id}),[]),Fg(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.filterOperatorMenuVisibleForColumnId=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}import{useEffect as da}from"react";import*as $s from"react";import*as Bs from"react";function ua(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function Ws(n){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),n.onHideIntent?.()}}}function js(n,e,t){if(!n)return null;let o=ye();return n.then(r=>{let{items:i,columns:a}=ua(r);i&&i.length&&o(Bs.createElement(t,{...e,items:i||[],columns:a}))}),Bs.createElement(yo,{updater:o})}function Lg(n,e,t){let{columnId:o,rowIndex:r,event:i}=n,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??Wt,{computedColumnsMap:d}=a(),f=d.get(o),p={...St({...e,rowIndex:r,columnId:f.id}),event:i};if(!f||!c)return{cellContext:p,menu:null,preventDefault:!1};let m=Ws({onHideIntent:t}),g=c(p,e),b=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:p,menu:js(g,m,u),preventDefault:b};let{items:h,columns:y}=ua(g);return!h||!h.length?{cellContext:p,menu:null,preventDefault:Array.isArray(h)}:{preventDefault:b,menu:$s.createElement(u,{...m,columns:y,items:h}),cellContext:p}}function kg(n,e,t){let{getState:o,getComputed:r}=e,{components:i,getContextMenuItems:a}=o(),l=i?.Menu??Wt,{computedColumnsMap:s}=r(),c=n.columnId?s.get(n.columnId):void 0,u=c?{...n,...St({...e,rowIndex:n.rowIndex,columnId:c.id})}:n;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=Ws({onHideIntent:t}),f=a(u,e),p=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:u,menu:js(f,d,l),preventDefault:p};let{items:m,columns:g}=ua(f);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:p,menu:$s.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var fa=5,zg=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function Vg(){let n=Ge(),{portalDOMRef:e}=$t(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=no({portalContainer:e?.current??!1});return da(()=>{let{actions:l,getState:s,getDataSourceState:c}=n;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:f}=d;function p(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:b}=Lg(d,n,p),h=Re.fromPoint({top:f.clientY,left:f.clientX});h.width+=fa,h.height+=fa,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:h,alignPosition:zg}),b&&f.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:y}=s();y&&y({...g,getState:s,getDataSourceState:c},f)})},[]),da(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.cellContextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function Gg(){let n=Ge(),{portalDOMRef:e}=$t(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=no({portalContainer:e?.current??!1});return da(()=>{let{actions:l,getState:s}=n;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function f(){a(),l.contextMenuVisibleFor=null}let{menu:p,cellContext:m,preventDefault:g}=kg(u,n,f),b={top:d.clientY,left:d.clientX},h=Re.fromPoint(b);h.width+=fa,h.height+=fa,r(p,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:h,alignPosition:zg}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:b,...u};let{onContextMenu:y}=s();y&&y({...n,...m},d)})},[]),da(()=>{let{contextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.contextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}import{useRef as Zw}from"react";import*as Hg from"react";import{useCallback as qw,useEffect as Xw}from"react";function Us(n,e){let{brain:t}=te(r=>({brain:r.state.brain})),o=qw(n,e);Xw(()=>t.onScroll(o),[t,o])}var Ys="yzx0vj0";function Kg(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=Zw(null);Us(s=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-s.scrollLeft}px, 0px, 0px)`)},[r]);let l={...i.style};return e==="column"?l.width=pe.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=pe.runtime.bodyWidth),o==="column"?l.minWidth=pe.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=pe.runtime.bodyWidth),t==="column"?l.maxWidth=pe.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=pe.runtime.bodyWidth),Hg.createElement("div",{ref:a,...i,className:i.className?Q(i.className,Ys):Ys,style:l},i.children)}var Qw=Z(Y.columnWidthAtIndex),Jw=Z(Y.columnOffsetAtIndex);function eI(){let{computedVisibleColumns:n}=te(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return n.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${Qw}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${Jw}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var pa="InfiniteTable";import{useEffect as tI}from"react";function Bg(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=te(u=>({getState:u.getState,actions:u.actions,dataSourceActions:u.dataSourceActions,getDataSourceState:u.getDataSourceState})),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),tI(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:p,repeatWrappedGroupRows:m}=o(),g=!1,b=l.rowsPerPage,h=(r&&r.length>0||i)&&b>0?b:null;return p!=h&&(t.rowsPerPage=h,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,f=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),f()}},[l,s,r,i,c])}import{useEffect as ma,useRef as oI}from"react";var Ir=ge({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),Wg="_143ofgf5",jg="_143ofgf3";var nI=Z(pe.loaded),qs={source:"infinite-table-page",target:"infinite-table-devtools-background"};function $g(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{...qs,url:Xs(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...qs,url:Xs(),type:t,payload:{debugId:o,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)}}}}var Xs=lt(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function rI(n){window.postMessage(n)}var iI=lt(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){vt.set(e,t);let{devToolsDetected:o}=t.getState();o||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage($g({type:"update",debugId:e},t))}else _p(e),window.postMessage($g({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,je.onLogIntent("IT:*",e=>{rI({...qs,url:Xs(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let o="";try{o=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return o}return String(t)}),timestamp:e.timestamp}})}),n});function Ug(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=te(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),o=n(),{domRef:r,debugId:i}=o;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(nI)!==`${Au}`&&mr({debugId:i,key:"CSS001_CSS"}),ma(()=>{e().debugId!==i&&(t.debugId=i)},[i]),sI()}var ga=ye(),aI={revertAll:n=>{let e=vt.get(n.debugId);if(e){let t=Ro.get(n.debugId);Ro.delete(n.debugId),Jt.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=to.get(n.debugId);to.delete(n.debugId),eo.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=vt.get(n.debugId);if(e){let t=n.property,o=Jt.get(n.debugId),r=Ro.get(n.debugId),i=eo.get(n.debugId),a=to.get(n.debugId),l=t;r&&o&&o[l]!==void 0&&(delete o[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=to.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:n=>{let e=vt.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),gr(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),gr(n.debugId))}}},discardAllWarnings:n=>{let e=vt.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),gr(n.debugId))},setColumnVisibility:n=>{ps(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{Bi(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{ps(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{Bi(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{Bi(n.debugId,"multiSort",n.multiSort)},highlight:n=>{let e=vt.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${Ir.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(Ir.classNames.base),r.innerHTML=[`<div class="${jg}"></div>`,`<div class="${Wg}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${o.left}px`,r.style.top=`${o.top}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,i.innerHTML=n.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(Ir.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(Ir.classNames.variants.active.true)}}}}};function lI(){typeof window<"u"&&window.addEventListener("message",n=>{if(n&&n.data&&typeof n.data.source=="string"&&typeof n.data.target=="string"&&n.data.target==="infinite-table-page"&&n.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(iI(),ga(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=aI[e];t&&t(n.data.payload)}})}lI();function sI(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,actions:r,dataSourceApi:i,api:a}=te(u=>({getState:u.getState,getComputed:u.getComputed,getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions,actions:u.actions,dataSourceApi:u.dataSourceApi,api:u.api})),s=n().debugId,c=oI(s);return c.current=s,ma(()=>{let u=c.current;if(!u)return;let d=p=>{p(u,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},f=ga.get();if(f){d(f);return}return ga.onChange(p=>{p&&d(p)})},[]),ma(()=>{let u=c.current;if(!u)return;let d=ga.get();d&&d(u,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),ma(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function cI(){let{masterPortalDOMRef:n}=$t(o=>({masterPortalDOMRef:o.getMasterState().portalDOMRef}))??{},e=te(o=>o.state.portalDOMRef);return n?.current??e?.current}import*as wt from"react";import{useCallback as uI}from"react";var Yg="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",qg=ge({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),Xg="hs68h81",Zg=ge({defaultClassName:"hs68h80 _16lm1iw1p",variantClassNames:{orientation:{horizontal:"_16lm1iw2h _16lm1iw2j",vertical:"_16lm1iw2f"},draggingInProgress:{true:"_16lm1iw1h",false:"hs68h86"},dropRejected:{true:"hs68h87",false:"hs68h88"},active:{true:"hs68h89",false:"hs68h8a"}},defaultVariants:{},compoundVariants:[[{dropRejected:!0,active:!0},"hs68h8b"],[{dropRejected:!1,active:!0},"hs68h8c"],[{active:!1,dropRejected:!1},"hs68h8d"]]});import*as Zo from"react";function Qg(n){return Zo.createElement("div",{...n.domProps})}function Jg(n){let{active:e}=n;return Zo.createElement("div",{className:Xg},e?"Drop to group":"Drag columns to group")}function eh(n){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),n.onClear?.())};return Zo.createElement("div",{...n.domProps},n.label,Zo.createElement("div",{className:kr[1]}),Zo.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${n.field}`,className:Yg,onKeyDown:e,onMouseDown:n.onClear},Zo.createElement(sa,{size:20})))}var dI=(n,e)=>t=>{e&&e(t);let o=Date.now(),r=!1,i=()=>{r=!0};Me().addEventListener("mousemove",i,{once:!0}),Me().addEventListener("mouseup",()=>{r||(Me().removeEventListener("mousemove",i),Date.now()-o<200&&requestAnimationFrame(()=>{n()}))},{once:!0})};function fI(n){let{column:e,onClear:t,components:o,field:r,id:i,toggleSorting:a}=n,{dragSourceListId:l,dragItemId:s}=nr(),c=l===En,u=Ge(),d=(e?_o(e.id,u,"grouping-toolbar"):r)??i,f=e?wt.createElement(ci,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,p=wt.createElement(wt.Fragment,null,d,f),m=s===i&&l===En,g=Q(qg({draggingInProgress:c,active:m}),n.domProps?.className),b=dI(a,n.domProps?.onMouseDown),h={...n.domProps,className:g,onMouseDown:b},y=o?.ToolbarItem??eh;return wt.createElement(y,{active:m,domProps:h,column:e,field:r,label:p,onClear:t})}var En="grouping-toolbar";function th(n){let{groupBy:e}=Oe(S=>({groupBy:S.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:o,api:r}=te(S=>({getComputed:S.getComputed,dataSourceApi:S.dataSourceApi,api:S.api})),{dropTargetListId:i,dragSourceListId:a}=Lo(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===En,u=a===En,d=n.components?.Placeholder??Jg,f=n.components?.Host??Qg,p=e.length?wt.createElement(wt.Fragment,null,e.map((S,T)=>{let C=S.field?l.get(S.field):void 0,w=`${S.field??`idx-${T}`}`;return wt.createElement(Ko.DraggableItem,{key:w,id:w},I=>wt.createElement(fI,{id:w,components:n.components,domProps:I,field:S.field,column:C,toggleSorting:()=>{C&&r.toggleSortingForColumn(C.id)},onClear:()=>{let v=e.filter(D=>D!==S).filter(Boolean);o.setGroupBy(v)}}))})):wt.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=S=>{let T=S.map(C=>e[C]);o.setGroupBy(T)},g=S=>{let{dragItemId:T}=S,C=T,w=s.get(C);if(!w||!w.field||!w.computedGroupable)return;let I=[...e];I.splice(S.dropIndex,0,{field:w.field}),o.setGroupBy(I)},b=uI(S=>{let{computedColumnsMap:T}=t(),C=S.dragItem.id,w=T.get(C);return!(!w||!w.computedGroupable||e.some(I=>I.field===w.field))},[e]),h=n.orientation??"horizontal",{domProps:y}=n;return wt.createElement(Ko,{orientation:h,dragListId:En,acceptDropsFrom:["header",En],onDrop:m,onAcceptDrop:g,shouldAcceptDrop:b},(S,{draggingInProgress:T,status:C})=>{let w=Q(Zg({active:c,orientation:h,draggingInProgress:T,dropRejected:C==="rejected"}),S.className,y?.className),I={...S,...y,className:w,children:p};return wt.createElement(f,{active:c,rejectDrop:C==="rejected",domProps:I,orientation:h})})}import*as On from"react";import{useMemo as sh}from"react";import{useCallback as TI,useEffect as Rr,useRef as CI}from"react";import*as ha from"react";function oh(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return Mi(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}import*as ro from"react";var nh=ge({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as rh,useRef as pI}from"react";function mI(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function gI(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=Xp(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(n,l),r.detailDataSourcesStateToRestore=a}function hI(n,e){let t=pI(!1);return{currentRowCache:rh(()=>({getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)}),[e,n]),cacheCalledByRowDetailRenderer:t}}function ih(n){let{rowDetailsCache:e,rowInfo:t}=n,{getDataSourceState:o,dataSourceActions:r}=Oe(c=>({getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions})),{getMasterState:i}=te(c=>({getMasterState:c.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=hI(t.id,e),s=rh(()=>{let c=o().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:lt(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.dataSourceState.destroyedRef.current||(d.dataSourceActions.stateReadyAsDetails=!0)});return}mI(t.id,{masterState:o(),detailContext:d}),requestAnimationFrame(()=>{d.dataSourceState.destroyedRef.current||(d.dataSourceActions.stateReadyAsDetails=!0)}),d.dataSourceState.onCleanup.onChange(()=>{let f=a.get();f&&gI(t.id,{detailState:d.getDataSourceState(),masterActions:r,masterState:o(),cacheEntryForRow:f})})}),shouldRestoreState:c}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function ah(){return so()}var{rootClassName:bI}=Le,yI=`${bI}RowDetail`;function SI(n){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:o,rowInfo:r,detailOffset:i,rowDetailsCache:a}=n,{masterDetailContextValue:l,currentRowCache:s}=ih({rowDetailsCache:a,rowInfo:r}),c=on(),[u]=ro.useState(()=>ah());return u.setSnapshot(l),ro.useLayoutEffect(()=>{u.notify()},[l]),ro.createElement(c.Provider,{value:u},ro.createElement("div",{ref:e,className:Q(yI,nh({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${Y.bodyWidth} - ${Y.scrollbarWidthVertical})`,height:o}},t(r,s)))}var lh=ro.memo(SI);var wI=1;function ch(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:c,onRowMouseEnter:u,onRowMouseLeave:d,groupRenderStrategy:f,brain:p,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:b,isRowDetailsEnabled:h,cellClassName:y,cellStyle:S,rowStyle:T,rowDetailCache:C,rowClassName:w,onScrollToTop:I,onScrollToBottom:v,onScrollStop:D,scrollToBottomOffset:R,wrapRowsHorizontally:P,updatedAt:A,ready:M,editingCell:x}=te(z=>({actions:z.actions,getState:z.getState,getComputed:z.getComputed,getDataSourceMasterContext:z.getDataSourceMasterContext,rowHeight:z.state.rowHeight,rowDetailHeight:z.state.rowDetailHeight,onRowMouseEnter:z.state.onRowMouseEnter,onRowMouseLeave:z.state.onRowMouseLeave,groupRenderStrategy:z.state.groupRenderStrategy,brain:z.state.brain,showZebraRows:z.state.showZebraRows,rowDetailRenderer:z.state.rowDetailRenderer,isRowDetailsExpanded:z.state.isRowDetailExpanded,isRowDetailsEnabled:z.state.isRowDetailEnabled,cellClassName:z.state.cellClassName,cellStyle:z.state.cellStyle,rowStyle:z.state.rowStyle,rowDetailCache:z.state.rowDetailCache,rowClassName:z.state.rowClassName,onScrollToTop:z.state.onScrollToTop,onScrollToBottom:z.state.onScrollToBottom,onScrollStop:z.state.onScrollStop,scrollToBottomOffset:z.state.scrollToBottomOffset,wrapRowsHorizontally:z.state.wrapRowsHorizontally,updatedAt:z.state.updatedAt,ready:z.state.ready,editingCell:z.state.editingCell})),{computedPinnedStartColumns:_,computedPinnedEndColumns:E,computedVisibleColumns:L,computedColumnsMap:k,computedRowHeight:V,computedRowSizeCacheForDetails:W,fieldsToColumn:O,rowspan:F,toggleGroupRow:J,columnSize:j}=e,{dataArray:U,rowInfoStore:ie,selectionMode:be,cellSelection:Te,isNodeReadOnly:ce,getDataSourceState:fe,dataSourceApi:me,dataSourceActions:$}=Oe(z=>({dataSourceApi:z.dataSourceApi,dataSourceActions:z.dataSourceActions,getDataSourceState:z.getDataSourceState,dataArray:z.dataSourceState.dataArray,rowInfoStore:z.dataSourceState.rowInfoStore,selectionMode:z.dataSourceState.selectionMode,cellSelection:z.dataSourceState.cellSelection,isNodeReadOnly:z.dataSourceState.isNodeReadOnly})),G=_e(U);oh({columnSize:j,brain:p,computedPinnedStartColumns:_,computedPinnedEndColumns:E,computedVisibleColumns:L,computedRowHeight:V,dataArray:U,bodySize:t,rowspan:F});let q=CI(0);Rr(()=>p.onRenderCountChange(()=>{q.current=p.scrollTopMax}),[p]),Rr(()=>p.onRenderRangeChange(z=>{i().onRenderRangeChange?.(z)}),[p]),Rr(()=>p.onScrollStop(z=>{let{scrollTop:de,scrollLeft:N}=z;if(de===0&&I?.(),de+(R??wI)>=q.current){v?.();let{livePagination:ue,livePaginationCursor:De,dataArray:xe}=fe();ue&&($.cursorId=De!==void 0?Date.now():xe.length)}if(D){let ue=p.getRenderRange();D({scrollTop:de,scrollLeft:N,renderRange:ue,viewportSize:i().bodySize,firstVisibleRowIndex:ue.start[0],lastVisibleRowIndex:ue.end[0],firstVisibleColIndex:ue.start[1],lastVisibleColIndex:ue.end[1]})}}),[p,I,v,D]),Rr(()=>{t.height&&(r.ready=!0)},[!!t.height]),Rr(()=>{let{onReady:z}=i();z&&z({api:o,dataSourceApi:me})},[M]);let B=sh(()=>({isNodeReadOnly:ce,selectionMode:be,cellSelection:Te}),[ce,be,Te]),ae=TI(z=>{let{rowIndex:de,colIndex:N,heightWithRowspan:X,domRef:se,hidden:ue,width:De,onMouseLeave:xe,onMouseEnter:Ve}=z,Ne=G()[de],Ke=L[N];if(!Ne||!Ke)return null;let qe=W?W.getRowHeight(de):X,Xe=!1;!h||typeof h=="function"&&!h(Ne)?Xe=!1:b&&(Xe=b(Ne)?"expanded":"collapsed");let Ze=P?p.getRowIndexInPage(de):null,K=P?p.getPageIndexForRow(de):null,re=o.isEditorVisibleForCell({rowIndex:de,columnId:Ke.id});return ha.createElement(zd,{...{getData:G,virtualized:!0,showZebraRows:m,groupRenderStrategy:f,rowIndexInHorizontalLayoutPage:Ze,horizontalLayoutPageIndex:K,rowIndex:de,rowInfoStore:ie,hidden:ue,toggleGroupRow:J,rowHeight:qe,rowDetailState:Xe,onMouseEnter:Ve,onMouseLeave:xe,onRowMouseEnter:u,onRowMouseLeave:d,domRef:se,width:De,column:Ke,columnsMap:k,fieldsToColumn:O,rowStyle:T,rowClassName:w,cellStyle:S,cellClassName:y,inEditMode:re,getDataSourceState:fe,dataSourceApi:me,dataSourceActions:$,getState:i,imperativeApi:o,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:B}})},[s,c,u,d,W,V,b,G,L,k,O,f,P,J,m,p,ie,T,w,y,S,fe,me,$,i,o,r,a,l,A,x,B]),ne=sh(()=>{if(b)return z=>{let{rowIndex:de,domRef:N}=z,se=G()[de];if(!se||!b(se)||!W)return ha.createElement("div",{ref:N,className:Nc.hidden});let{rowDetailHeight:ue,rowHeight:De}=W.getSize(de);return ha.createElement(lh,{rowInfo:se,rowDetailsCache:C,rowIndex:de,domRef:N,detailOffset:De,rowDetailHeight:ue,rowDetailRenderer:g})}},[M,ae,g,c,b,C]);return{renderCell:ae,renderDetailRow:ne}}import{useEffect as II}from"react";function uh(){let{state:n,getState:e,actions:t}=te(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:o}=n,r=Ao(o);II(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=vs(pa,!!o);t.brain=c.brain,t.headerBrain=c.headerBrain,t.renderer=c.renderer,t.onRenderUpdater=c.onRenderUpdater,t.headerRenderer=c.headerRenderer,t.headerOnRenderUpdater=c.headerOnRenderUpdater}},[r,o])}import*as ph from"react";var dh="_16lm1iw1 _16lm1iw1c _16lm1iwe";var fh=Q(dh,Tl);function mh(n){return ph.createElement("div",{...n,className:n.className?Q(fh,n.className):fh})}import*as _n from"react";var gh={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},hh="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",bh="qy58ya4";var{rootClassName:RI}=Le,Zs=`${RI}-LoadMask`;function vI(n){let{visible:e,children:t="Loading"}=n;return _n.createElement("div",{className:`${gh[e?"visible":"hidden"]} ${Zs}`},_n.createElement("div",{className:`${hh} ${Zs}-Overlay`}),_n.createElement("div",{className:`${bh} ${Zs}-Text`},t))}var ba=_n.memo(vI);import{useMemo as DI}from"react";var xI=[Td,`${Gt}--hovered`];function PI(n){return Array.isArray(n)&&(n=n.join(" ")),n.split(" ").map(e=>e.trim()).filter(Boolean)}function Qo(n){let e=Ge(),t=Mo(),{getComputed:o,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,columnReorderDragColumnId:d,scrollStopDelay:f,brain:p,scrollerDOMRef:m,components:g,bodySize:b,activeCellIndex:h,rowDetailRenderer:y,showHoverRows:S,wrapRowsHorizontally:T,domProps:C,domRef:w,forceBodyRerenderTimestamp:I,rowHoverClassName:v,ready:D}=te(F=>({ready:F.state.ready,columnReorderDragColumnId:F.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:F.state.forceBodyRerenderTimestamp,renderer:F.state.renderer,onRenderUpdater:F.state.onRenderUpdater,debugId:F.state.debugId,keyboardNavigation:F.state.keyboardNavigation,activeRowIndex:F.state.activeRowIndex,loadingText:F.state.loadingText,scrollStopDelay:F.state.scrollStopDelay,brain:F.state.brain,scrollerDOMRef:F.state.scrollerDOMRef,components:F.state.components,bodySize:F.state.bodySize,activeCellIndex:F.state.activeCellIndex,rowDetailRenderer:F.state.rowDetailRenderer,showHoverRows:F.state.showHoverRows,wrapRowsHorizontally:F.state.wrapRowsHorizontally,domProps:F.state.domProps,domRef:F.state.domRef,rowHoverClassName:F.state.rowHoverClassName})),R=g?.LoadMask??ba,P=o(),{computedRowHeight:A,computedRowSizeCacheForDetails:M}=P,x=M?.getRowHeight||A,{loading:_}=Oe(F=>({loading:F.dataSourceState.loading})),E=On.useCallback(F=>{let J=e.getState(),j=F.target;if(!t&&F._from_row_detail)return;t&&(F._from_row_detail=!0);let U=Mu(j,Rs(),J.domRef.current),ie,be,Te,ce;U&&(be=Number(U.dataset.colIndex),ce=Number(U.dataset.rowIndex),ie=e.getComputed().computedVisibleColumns[be].id,Te=e.dataSourceApi.getRowInfoArray()[ce].id);let fe={columnId:ie,colIndex:be,rowId:Te,rowIndex:ce,event:F,target:U??F.target};U&&J.cellContextMenu(fe),J.contextMenu(fe)},[]),{renderCell:L,renderDetailRow:k}=ch({imperativeApi:r,getComputed:o,domRef:w,bodySize:b,computed:P}),{autoFocus:V,tabIndex:W}=C??{};uh();let O=DI(()=>{if(!S)return;let F=[];return v&&(F=F.concat(v)),n.rowHoverClassName&&(F=F.concat(n.rowHoverClassName)),Qo.rowHoverClassName&&(F=F.concat(Qo.rowHoverClassName)),PI(F)},[S,v,n.rowHoverClassName,Qo.rowHoverClassName]);return On.createElement(mh,{onContextMenu:E},On.createElement(Of,{forceRerenderTimestamp:I,debugId:l,tabIndex:W??0,autoFocus:V??void 0,activeRowIndex:D&&s==="row"?c:null,activeCellIndex:D&&s==="cell"&&!d?h:null,scrollStopDelay:f,renderer:i,wrapRowsHorizontally:T,onRenderUpdater:a,brain:p,activeCellRowHeight:x,renderCell:L,renderDetailRow:y?k:void 0,cellHoverClassNames:O,scrollerDOMRef:m,scrollVarHostRef:w}),On.createElement(R,{visible:_},u))}Qo.rowHoverClassName=xI;var Ut=Le.rootClassName,{ManagedComponentContextProvider:MI}=At({initSetupState:ym,forwardProps:Sm,mapPropsToState:Im,cleanup:Tm,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:wm(),getParentState:()=>rs(n=>n),debugName:n=>So(n.debugId,pa)}),AI=Ie.memo(function(){let e=Fr(),{componentState:t,api:o,initialChildren:r}=te(V=>({componentState:V.state,api:V.api,initialChildren:V.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Oe(V=>({dataArrayLength:V.dataSourceState.dataArray.length,getDataSourceState:V.getDataSourceState,dataSourceActions:V.dataSourceActions,dataSourceApi:V.dataSourceApi})),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:f,onRowDetailHeightCSSVarChange:p,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:b,columnHeaderHeightCSSVar:h,scrollStopDelay:y,brain:S,activeRowIndex:T,activeCellIndex:C}=t,{licenseKey:w}=t;!w&&io.licenseKey&&(w=io.licenseKey),Gm(T,i,o),km(C,i,o);let{onKeyDown:I}=ig();Ie.useEffect(()=>{let V=a(),W=Mt(O=>{V.notifyRenderRangeChange({renderStartIndex:O[0],renderEndIndex:O[1]})},{wait:y});return S.onVerticalRenderRangeChange(W)},[S,y]);let v=Fm(w),{autoFocus:D,tabIndex:R,...P}=t.domProps??{},A=Yu(P);Ie.useEffect(()=>{S.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),um(),Bg(),Eg();let{menuPortal:M}=Pg(),{menuPortal:x}=Vg(),{menuPortal:_}=Gg(),{menuPortal:E}=Ng();Ie.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(t.id,t.ready,o,{dataSourceApi:s})},[t.ready,o,s]);let L=Ug();Ie.useEffect(()=>{if(e){let V=e.getSnapshot();u.current=V.getMasterState().portalDOMRef.current}},[]);let k=r??Ie.createElement(Ie.Fragment,null,Ie.createElement(Zl,null),Ie.createElement(Qo,null));return Ie.createElement("div",{"data-debug-id":L,onKeyDown:I,ref:c,...A},k,Ie.createElement("div",{ref:u,className:Q(`${st}Portal`,Lc[1e7],zr.absolute,Oc[0],Ac[0])},M,x,_,E),g?Ie.createElement(Bn,{key:"row-height",varName:g,onChange:d}):null,Ie.createElement(Bn,{key:"flashing-duration",allowInts:!0,varName:pe.components.Cell.flashingDuration,onChange:f}),b?Ie.createElement(Bn,{key:"row-detail-height",varName:b,onChange:p}):null,h?Ie.createElement(Bn,{key:"column-header-height",varName:h,onChange:m}):null,v?null:Ie.createElement(op,null),Ie.createElement(Ag,null))});function EI({children:n,store:e}){let{componentActions:t,componentState:o}=Et(),{scrollerDOMRef:r,scrollTopKey:i}=o,a=_e(o),l=Am({state:o,actions:t,getState:a}),s=_e(l),c=Fr(),{getDataSourceState:u,dataSourceActions:d,getDataSourceMasterContext:f,dataSourceApi:p}=Ht(),[m]=Ie.useState(()=>sm({getComputed:s,getState:a,getDataSourceState:u,getDataSourceMasterContext:f,dataSourceApi:p,actions:t,dataSourceActions:d})),g={actions:t,state:o,computed:l,dataSourceActions:d,getDataSourceMasterContext:f,getDataSourceState:u,getComputed:s,getState:a,api:m,dataSourceApi:p,children:n};return e.setSnapshot(g),Ie.useLayoutEffect(()=>{e.notify()}),Er(r,b=>{let h={width:b.width,height:b.height};t.bodySize=h},{earlyAttach:!0,debounce:50}),Ie.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),Ie.createElement(AI,null)}var _I=40,OI=Km(Eu),io=function(n){let[e]=Ie.useState(()=>Hm()),t=jr();return Ie.createElement(MI,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:_I,columnHeaderHeight:OI,...n},Ie.createElement(Sl,null,Ie.createElement(t.Provider,{value:e},Ie.createElement(EI,{children:n.children,store:e}))))};io.Header=Zl;io.Body=Qo;io.HScrollSyncContent=Kg;io.Footer=()=>Ie.createElement(zc,null);io.GroupingToolbar=th;import*as yh from"react";function Oj(n){let{DataSource:e}=hr({nodesKey:"children",...n});return yh.createElement(e,null,n.children??null)}import*as Sh from"react";function FI(n){return Sh.createElement(io,{...n})}var NI=n=>(t,{unfilteredTreePaths:o,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Je(i,{treePaths:o});r.forEachLeafNodePath((u,{selected:d})=>{l.setNodeSelection(u,d)}),a&&r.forEachLeafNodePath(u=>{l.setNodeSelection(u,a.selected)},a.nodePath);let c={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};n(c)};var ya=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let o=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,o(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=je(`IT:${e}:DataQuery`)}};function Fn(n){if(Array.isArray(n))return n.map(Fn);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=Fn(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var ao=class ao{constructor(e){this.queryCache=new ee;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Fn(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new ya(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Fn(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Fn(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Fn(e);this.queryCache.delete(t)};if(this.options=e,ao.clients.has(e.name)){let t=`There's already a DataClient with name "${e.name}". Specify a different name for the client`;throw new Error(t)}ao.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=ao.clients.get(e);t&&t.destroy()}static destroyAll(){ao.clients.forEach(e=>{ao.destroy(e.name)})}destroy(){ao.clients.delete(this.options.name)}};ao.clients=new Map;var Th=ao;var LI={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},kI={instantEdit:LI};import{useEffect as n3}from"react";function zI(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var Sa=class Sa{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Sa.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}};Sa.DEFAULT_SIZE=10;var Qs=Sa;var Ta=class Ta{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Ta.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};Ta.DEFAULT_SIZE=10;var Js=Ta;import{useEffect as VI,useRef as Ca}from"react";var GI=(n,e)=>n.every((t,o)=>t===e[o]),HI=(n,e)=>{let t=Ca(e),o=GI(e,t.current),r=Ca(!0);t.current=e;let i=Ca(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=Ca(n);l.current=n,VI(()=>{if(r.current){r.current=!1;return}return l.current()},a)};import{useEffect as KI,useRef as vr}from"react";var Ch=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),ec=(n,e)=>{let{same:t,different:o,compare:r}=e,i=vr(t),a=vr(o),l=Ch(t,i.current,r),s=!Ch(o,a.current,r),c=vr(!0);i.current=t,a.current=o;let u=vr(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let f=vr(n);f.current=n,l&&s&&(c.current=!1),KI(()=>{if(!c.current)return f.current()},d)};import*as It from"react";var wh=Z(Y.currentFlashingDuration),BI=({children:n})=>It.createElement(It.Fragment,null,n),Ih=1e3,Rh={up:ni({direction:"up"}).split(" "),down:ni({direction:"down"}).split(" "),neutral:ni({direction:"neutral"}).split(" ")},vh=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=BI}=n;return It.forwardRef((i,a)=>{let l=li(),{flashingDurationCSSVarValue:s}=te(I=>({flashingDurationCSSVarValue:I.state.flashingDurationCSSVarValue})),c=typeof s=="number"?s??e??Ih:e??Ih,{domRef:u,value:d,column:f,rowInfo:p,htmlElementRef:m}=l,g=p.id,b=f.id,h=It.useRef(!0),y=It.useRef(d),S=h.current?null:y.current;h.current=!1;let T=It.useRef(void 0),C=It.useRef(void 0),w=It.useRef(void 0);return ec(()=>{if(d===y.current)return;let I=()=>{let P=m.current;if(T.current&&(clearTimeout(T.current),T.current=void 0),w.current&&(clearTimeout(w.current),w.current=void 0),C.current&&P){let A=C.current,M=Rh[A];P.classList.remove(...t?[t,...M]:M),P.style.removeProperty(wh),C.current=void 0}};y.current=d;let v=m.current;if(!v)return;I();let D=typeof d=="number"?d>S?"up":"down":"neutral",R=Rh[D];return v.style.setProperty(wh,`${c}`),v.classList.add(...t?[t,...R]:R),C.current=D,T.current=setTimeout(I,c),I},{same:[b,g],different:[d]}),It.createElement("div",{ref:u,...i,className:Q(i.className)},o({children:i.children,oldValue:S}))})},WI=vh();import*as Ye from"react";import{useEffect as xh,useRef as Dh}from"react";import{createPortal as jI}from"react-dom";function $I(n){let[e,t]=Ye.useState(null);return xh(()=>{let{debugTarget:o}=n,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[o]){let i=globalThis.INFINITE[o].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[n.debugTarget]),typeof e=="function"?Ye.createElement(Ph.Provider,{value:{getState:e}},Ye.createElement(UI,null)):null}var Ph=Ye.createContext({getState:()=>null});function UI(){let n=Ye.useContext(Ph),{getState:e}=n,[,t]=kt(),o=e().renderer.cellManager;xh(()=>{let s=Mt(()=>{console.log("rerender"),t()},{wait:500});return o.onCellAttachmentChange(s)},[o,t]);let r=o.getRowsWithCells(),i=o.getColumnsWithCells(),a=Dh(null),l=Dh(null);return Ye.createElement("div",{style:{overflow:"auto"}},jI(Ye.createElement("div",{ref:a,style:{position:"absolute",top:0,left:0,width:"0px",height:"0px",pointerEvents:"none",background:"rgba(255, 0, 0, 0.5)",opacity:"0"}}),document.body),Ye.createElement("table",{style:{borderCollapse:"collapse"}},Ye.createElement("thead",null,Ye.createElement("tr",null,i.map(s=>Ye.createElement("th",{key:s,"data-col-index":s},s)))),Ye.createElement("tbody",null,r.map(s=>Ye.createElement("tr",{key:s,"data-row-index":s},i.map(c=>Ye.createElement("td",{key:c,style:{padding:5,border:"1px solid gray",background:o.getCellAt([s,c])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":c},Ye.createElement("button",{onClick:()=>{let u=o.getCellAt([s,c])?.getElement();if(!u)return;let d=u.getBoundingClientRect();a.current.style.top=`${d.top}px`,a.current.style.left=`${d.left}px`,a.current.style.width=`${d.width}px`,a.current.style.height=`${d.height}px`,a.current.style.opacity="0.5",a.current.style.transition="opacity 0.5s",l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a.current.style.opacity="0",l.current=null},2e3),console.log(u)},style:{cursor:"pointer"}},"(",s,",",c,")"))))))))}var _3={CheckBox:Yt,LoadMask:ba,MenuIcon:tr,StringFilterEditor:cn,NumberFilterEditor:Yr};export{We as CellSelectionState,Th as DataClient,pz as DataSource,iC as DataSourceActionType,ee as DeepMap,Qs as FixedSizeSet,WI as FlashingColumnCell,Tt as GroupRowsState,$I as INTERNAL_MatrixDebugger,io as InfiniteTable,Ut as InfiniteTableClassName,AI as InfiniteTableComponent,Wt as Menu,br as RowDetailCache,Dt as RowDetailState,Ct as RowDisabledState,Ee as RowSelectionState,Oj as TreeDataSource,dt as TreeExpandState,FI as TreeGrid,Je as TreeSelectionState,Js as WeakFixedSizeSet,ug as alignNode,_3 as components,vh as createFlashingColumnCellComponent,Mt as debounce,je as debug,Eo as defaultFilterTypes,Fs as eventMatchesKeyboardShortcut,xp as filterDataArray,Eo as filterTypes,ZS as flatten,At as getComponentStateRoot,os as group,zI as interceptMap,kI as keyboardShortcuts,Qt as multisort,ns as multisortNested,Fn as queryKeyToCacheKey,eT as toTreeDataArray,Et as useComponentState,hr as useDataSourceInternal,Oe as useDataSourceSelector,rs as useDataSourceState,ec as useEffectWhen,HI as useEffectWhenSameDeps,Rn as useEffectWithChanges,mL as useEffectWithObject,Us as useGridScroll,li as useInfiniteColumnCell,Rl as useInfiniteColumnEditor,Yn as useInfiniteColumnFilterEditor,Ur as useInfiniteHeaderCell,cI as useInfinitePortalContainer,pL as useLayoutEffectWithChanges,em as useManagedDataSource,Mo as useMasterRowInfo,no as useOverlay,bw as useOverlayPortal,Ao as usePrevious,mz as useRowInfoReducers,eI as useVisibleColumnSizes,NI as withSelectedLeafNodesOnly};
|
|
29
|
+
`,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),!1):!0},ew=n=>{let e="",t=n.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let c=t[s];if(As(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(As(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),JC(t)};var ow=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,nw=/(https):\/\/\S+(\.csb\.app)/g,Gm=typeof window<"u"?window.location.origin:"",rw=()=>{let[n,e,t]=Array.from(ow.exec(Gm)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},iw=()=>{let[n,e,t]=Array.from(nw.exec(Gm)||[]);return e==="https"&&t===".csb.app"},aw=iw()||rw(),Hm=(n="")=>{let t=!!Ao();return tw(()=>{if(t)return!0;let r=Vm(n,{publishedAt:1624970570587,version:"8.0.2"});return!n&&!r&&aw?!0:r},[n,t])};import{useRef as Km,useEffect as Bm}from"react";var lw=10;function Wm(n,e,t){let o=Km(!1),r=Km(null);Bm(()=>{n!=null&&(o.current=!1,Ot(r.current))},[n]),Bm(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,Ot(r.current),r.current=ze(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<lw&&a(l)})};var i=a;a()}return()=>{Ot(r.current)}},[n,e])}import{useRef as jm,useEffect as $m}from"react";var sw=10;function Um(n,e,t){let o=jm(!1),r=jm(null);$m(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),$m(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<sw&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}function Ym(){return co()}var qm=n=>`--infinite-${n}`;import{useCallback as yw,useMemo as Sw,useEffect as Tw}from"react";function Xm(n,e){Es(n,e),uw(n,e),e.detail===2&&cw(n,e),n.getState().onCellClick?.(n,e)}function cw(n,e){if(ei(e.target))return;let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function uw(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:f}=r(),{brain:p,debugId:m}=o(),{rowsPerPage:g}=p,b=f.length,h=new je(u);h.debugId=m??"",d.cellSelectionState=h;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let S=!!o().wrapRowsHorizontally;d.multiSelectClick(y,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:b}:{horizontalLayout:S})}else d.resetClick(y);l.cellSelection=h}function Es(n,e){let{rowIndex:t,getDataSourceState:o,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=n,{multiRowSelector:s,renderSelectionCheckBox:c}=r(),u=o(),{selectionMode:d,groupBy:f,dataArray:p,isTree:m}=u;if(f.length||m||p[t]?.rowDisabled)return!1;if(d==="multi-row"){if(c&&!e.key)return!1;let{rowSelection:b}=u;if(b=l(b),s.rowSelectionState=b,b&&typeof b=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=b,!0}else if(d==="single-row"){let h=p[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(h):a.rowSelectionApi.selectRow(h)}return!1}function Zm(n,e){e.detail!==2&&void 0}var dw={Enter:!0," ":!0,a:!0};function Qm(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=n,{key:c,ctrlKey:u,metaKey:d}=e;if(!dw[c])return!1;let f=t(),p=o(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:b,keyboardSelection:h}=f,{selectionMode:y,groupBy:S,rowSelection:T,treeSelectionState:C,isTree:w}=p;if(h===!1)return!1;let I=b==="row"&&m!=null?m:b==="cell"&&g!=null?g[0]:null,v=I!=null?p.dataArray[I]:null;if(!v||I==null)return!1;if(y==="single-row"&&c===" ")return i.rowSelectionApi.toggleRowSelection(v.id),!0;if(y!=="multi-row")return!1;if(c==="a"&&(u||d)){if(w&&C){let R=s(C);return R.selectAll(),r.treeSelection=R,!0}let x=l(T);return x.selectAll(),r.rowSelection=x,!0}if(c===" "){if(S.length)return v.isGroupRow&&v.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(v.groupKeys):i.rowSelectionApi.toggleRowSelection(v.id),!0;if(w){if(v.isTreeNode&&v.nodePath)return a.treeApi.toggleNodeSelection(v.nodePath),!0}else{let x={...e},{renderSelectionCheckBox:R}=n.getComputed();return R&&(x.metaKey=!1,x.ctrlKey=!0),Es({...n,rowIndex:I},x)}}return!1}var Jm=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),eg=n=>Array.from(n.querySelectorAll(Jm)).filter(t=>!!t.offsetParent),oa=n=>n.querySelector(Jm);var og=en(Fo());async function tg(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var fw=10,pw=(n,e)=>n-e;function na(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=o(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),f=u[n.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===n.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let p=c[n.rowIndex],m=!s||typeof s=="function"&&!s(p)?!1:i.rowDetailApi.isRowDetailExpanded(p.id)?"expanded":"collapsed",g=ct(f.id,e);return f.contentFocusable({column:f,...mn({column:f,rowInfo:p,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function _s(n,e,t){let o=t.getState().editingCell;return mw(n,e,t,{isCellFocusable:na,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function ng(n,e,t){let o=(0,og.default)(t,n+e,pw);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=ng;function mw(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,f)=>(d.push(f.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),c=n.rowIndex,u=n.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:ng(u,e,a),u===null){if(c+=e,c<0||c>=s.length)return null;continue}if(i({colIndex:u,rowIndex:c},t))return{colIndex:u,rowIndex:c}}return null}async function rg(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=na(e,n)?e:_s(e,-1,n);if(t){await Os([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;oa(o)?.focus()}}async function Os([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=fw,l=null,s=!1;function c(u=0){u++,Ot(l),l=ze(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&u<a&&c(u),s){try{await tg(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var gw=`.${Ht}`;function ig(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r||i&&t===-1)return!1;let a=i?null:mo(o,gw),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:u}=n.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&na({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:_s({rowIndex:l,colIndex:s},t,n);if(!c){if(t===-1)r.focus();else{let u=eg(document.body),d=n.getState().focusDetectDOMRef.current,f=u.findIndex(m=>m===d);u[f+1]?.focus()}return!0}return Os([c.rowIndex,c.colIndex],n).then(()=>{let u=n.getState().getDOMNodeForCell(c);if(!u)return;oa(u)?.focus()}),!0}var ag={control:"ctrl"},lg={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},hw={esc:"escape"},cg={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},ug=Object.keys(cg),Fs=new Set(ug),bw=new Set(["shift","alt"]);function Ns(n,e){return Array.isArray(e)?e.some(t=>sg(n,t)):sg(n,e)}function sg(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(f=>f.toLowerCase().trim()),r=o.find(f=>lg[f]),i=o.map(f=>ag[f]||lg[f]||hw[f]||f),a=i.filter(f=>Fs.has(f)),l=i.filter(f=>!Fs.has(f)),s=ug.reduce((f,p)=>(f[p]=cg[p](n),f),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(f=>s[f]);if(!a.every(f=>s[f]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(p=>!bw.has(p)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||Fs.has(t)||t==="meta"||ag[t]?!1:l.reduce((f,p)=>f?p==="*"||t===p:!1,!0)}async function dg(n,e){let t={...n,cloneRowSelection:a=>Li(a,n.getDataSourceState),cloneTreeSelection:a=>Gi(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&Qm(t,e)&&e.preventDefault(),(ig(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&fm(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,c=n.getComputed().computedVisibleColumns[s];c.computedEditable&&n.api.startEdit({rowIndex:l,columnId:c.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!Ns(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function Cw(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=Ge(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=Kt();return Sw(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>Gi(u,i),cloneRowSelection:u=>Li(u,i)}),[n,e,i,a,t,l,o])}function ww(){let n=Cw();Tw(()=>{let e=n.getState().keyDown.onChange(a=>{dg(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],c=ct(s.id,n);Xm({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=n.getComputed().computedVisibleColumns[c],d=ct(u.id,n);Zm({...n,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function Iw(){let{getState:n}=re(t=>({getState:t.getState}));return{onKeyDown:yw(t=>{n().keyDown(t)},[])}}function fg(){return ww(),Iw()}import{useEffect as Fg}from"react";import*as He from"react";import{useCallback as ks,useEffect as Rw,useLayoutEffect as vw,useState as ia}from"react";import{createPortal as Dw}from"react-dom";function Ls(n){return!!n.tagName}function gg(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=De.from(Ls(e)?e.getBoundingClientRect():e),a=De.from(Ls(t)?t.getBoundingClientRect():t),l=o?De.from(Ls(o)?o.getBoundingClientRect():o):null;if(!l)return{...pg({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=pg({anchorRect:a,targetRect:i,position:r[c],constrainRect:l});if(c===0&&(s={...d,index:0}),d.valid)return{...d,index:c}}return s}function pg(n){let e=De.from(n.targetRect),t=De.from(n.anchorRect),o=n.constrainRect?De.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=mg(e,i),s=mg(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function mg(n,e){return e==="TopLeft"?Be.from({top:n.top,left:n.left}):e==="TopCenter"?Be.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?Be.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?Be.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?Be.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?Be.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?Be.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?Be.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):Be.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}var ra="__is_infinite_menu_component";function xw(n){return n&&typeof n.then=="function"||n instanceof Promise}function yg(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function hg(n){return typeof n=="function"&&(n=n()),xw(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&yg(n)&&(n=n.getBoundingClientRect()),n?De.from(n):null}async function Pw(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),yg(o)&&(r=o),r||null}return t(await e)}function Mw(n){return He.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function Aw(n){let e=He.useRef(null);return Rw(()=>n.realign.onChange(t=>{e.current&&t&&bg(e.current,t)}),[n.realign]),He.createElement("div",{style:{position:"absolute",top:0,left:0},ref:ks(t=>{t&&bg(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}async function bg(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await hg(t)||void 0,a=o?await hg(o):void 0,l=De.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=gg({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=n.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=n.offsetParent;if(u){let d=u.getBoundingClientRect(),f=d.left,p=d.top,m=s.left-f,g=s.top-p;n.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function Ew(n,e){let[t,o]=ia(null);return vw(()=>{async function r(){let i=e?await Pw(e):null;i!=null&&o(i)}e&&r()},[e]),e?t?Dw(n,t):He.createElement(He.Fragment,null):e===null||e===!1?n:He.createElement(Mw,null,n)}function _w(n){if(He.Children.count(n)===1){let e=He.Children.only(n);if(He.isValidElement(e))return e.props.id||e.key}return null}function Ow(n,e,t){if(He.Children.count(n)===1){let o=He.Children.only(n);if(He.isValidElement(o)&&o.type[ra]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),He.cloneElement(o,r)}}return n}function ro(n){let e=n,[t]=ia(()=>new Map),[o,r]=ia(null),[i,a]=ia(0),l=ks(()=>{let m=[];for(let[g,b]of t)m.push(He.createElement(Aw,{...b,key:b.key}));return m},[]),[s,c]=zt(),u=Ew(l(),n.portalContainer),d=ks((m,g)=>{let h=`${g.id||_w(m)||Nt()}`,y=t.get(h),S=w=>()=>{let I=typeof w=="function"?w():w;return Ow(I,e.portalContainer,g.constrainTo??e.constrainTo)},T=S(m),C=(w,I)=>{if(!y)return;let v=S(w);Object.assign(y,{children:v}),c(),!!!I?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),C(m),C):(y={key:h,children:T,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Se()},t.set(y.key,y),c(),C)},[t,e.portalContainer,c]);He.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let f=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},p=()=>{t.clear(),c()};return He.useEffect(()=>{},[]),{portal:u,hideOverlay:f,clearAll:p,rerenderOverlays:c,showOverlay:d}}import*as _g from"react";import*as En from"react";import*as An from"react";import*as wr from"react";function aa(n){return null}aa.defaultProps={__is_menu_item:!0};var Sg="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Tg=be({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),Cg="db3arf1",wg="db3arfd";var Fw="-";function Nw(){return wr.createElement("hr",{className:wg})}var la=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===Fw?wr.createElement(Nw,null):r:null;return i!=null?{type:"item",parentMenuId:o,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}};function Ig(n,e){return wr.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===aa)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),la(n,o)}return la(n,t)})||[]}var Rg="submenu";function vg(){let n=An.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Nt(),focused:!1,destroyed:!1,domRef:n}}var Dg=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),Lw=[{name:"label"}],xg=n=>{let{props:e,state:t}=n,{activeItemKey:o,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,c=e.id||t.generatedId;s&&(c=`${s}-${c}`);let u=[...e.columns||Lw],d={columns:u,keyboardActiveItemKey:r,activeItemKey:o,menuId:c},f=[];i?f=i.map(la.bind(null,d)):!i&&typeof a!="function"&&(f=Ig(d,a)),l&&f.filter(g=>g.type==="item"&&g.menu!=null).length>0&&!u.find(g=>g.name==Rg)&&u.push({name:Rg,render:({domProps:g,item:b})=>b.menu?An.createElement("div",{...g},An.createElement(zo,{expanded:!1})):An.createElement("div",{...g})});let p=f.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:f,runtimeSelectableItems:p,columns:u,menuId:c}};import*as kt from"react";import{useCallback as Xo,useLayoutEffect as jw,useRef as $w,useState as Gs}from"react";var Ir=class extends fn{constructor(e){super(e.slice(0,3))}};var kw=250;function zw(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}ze(i)};ze(()=>{i()})})}var Vw=ve(),sa=class{constructor(e){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||kw;this.getPointerMoveTarget=()=>document.documentElement||Vw;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=e=>{if(clearTimeout(this.mouseMoveTimeoutId),!e){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let t=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=t);let r=t-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=t;let i=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e)};if(r){i();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&i()},this.getTimeout());let l=new Be({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,u=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(u-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=u,(s?new Ir([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Ir([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(e,t)=>{if(e!==this.activeItem){if(e==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=e,this.params.onItemActivate(e,t),this.activeItemMenuRect=null,zw(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Be({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};import{createContext as Gw,useContext as Hw}from"react";var zs=Gw(null);function Vs(){return Hw(zs)}import{useCallback as Kw,useEffect as Bw,useRef as Ww}from"react";function Pg(){let n=Ww(!0);return Bw(()=>(n.current=!0,()=>{n.current=!1}),[]),Kw(()=>n.current,[])}function Uw(n,e){let{parentMenuId:t,setSubmenuApi:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=n.menu;return u?(typeof u=="function"&&(u=u()),kt.createElement(jt,{key:c,parentMenuItemKey:n.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,f)=>{u?.onShow?.(d,f),o(f)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(n.key),s.focus())}})):null}function Yw(n,e){let t=Mg(n,e);if(!t.length)return null;let o=De.from(t[0]?.getBoundingClientRect()),r=De.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function Mg(n,e){let t=mo(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function qw(n,e){let t=Mg(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function Xw({onItemActivate:n}){let{getState:e}=Vs(),[{onItemEnter:t,onItemLeave:o}]=Gs(()=>new sa({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?De.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:Xo(t,[]),onItemLeave:Xo(o,[])}}function Ag(n){let{domProps:e}=n,{componentState:{columns:t,runtimeItems:o,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:f,autoFocus:p,parentMenuItemKey:m,domRef:g},componentActions:b,getState:h}=Vs(),y=Xo(B=>{b.keyboardActiveItemKey=B},[]),S=Xo(B=>{b.activeItemKey=B},[]),T=Pg(),[C,w]=Gs(null),I=null;jw(()=>{let{runtimeItems:B}=h(),U=B.filter(ne=>ne.type==="item"&&i===ne.key)[0];if(!U||!U.menu){w(null),P();return}if(U){let ne=Yw(r,U.key);ne&&x(()=>Uw(U,{constrainTo:l,setSubmenuApi:w,setActiveItemKey:S,setKeyboardActiveItemKey:y,parentMenuId:r,onHideIntent:G,api:E}),{id:`${r}-submenu`,alignTo:ne,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let v=(B,U)=>{y(U.key),S(U.key),U.originalMenuItem.onClick&&U.originalMenuItem.onClick(B);let ne={key:U.key,item:U.originalMenuItem,hideMenu:G};U.originalMenuItem.onAction&&U.originalMenuItem.onAction(ne),c&&c(ne),U.originalMenuItem.hideMenuOnAction&&G()},{showOverlay:x,portal:R,clearAll:P}=ro({portalContainer:!1}),{onItemEnter:A,onItemLeave:M}=Xw({onItemActivate:B=>{if(!T())return;let U=B?B.key:null;S(U)}});I=o.map((B,U)=>kt.createElement(Zw,{key:B.type==="item"?B.key:U,onItemEnter:(ne,me)=>{A(ne.key,me)},onItemLeave:(ne,me)=>{M(ne.key,me)},columns:t,active:B.type==="item"&&B.key===i,keyboardActive:B.type==="item"&&B.key===a,item:B,index:U,onClick:v}));let D=t.map(B=>B.width||(typeof B.flex=="number"?`${B.flex}fr`:B.flex)||"auto").join(" "),_={...e.style,gridTemplateColumns:D,gridTemplateRows:o.map(()=>"auto").join(" ")};u||(_.whiteSpace="nowrap");function O(B){let{runtimeItems:U,runtimeSelectableItems:ne}=h(),me=U.findIndex(Y=>Y.type==="item"&&Y.key===a),he=a,ie=U[me],ue={ArrowUp:()=>{let Y=U.slice(0,me).filter(k=>k.type==="item"&&!k.disabled).pop();Y&&Y.type==="item"&&Y.key&&(he=Y.key)},ArrowDown:()=>{let Y=U.slice(me+1).filter(k=>k.type==="item"&&!k.disabled)[0];Y&&Y.type==="item"&&Y.key&&(he=Y.key)},Home:()=>{ue.PageUp()},End:()=>{ue.PageDown()},PageUp:()=>{he=ne[0].key},PageDown:()=>{he=ne[ne.length-1].key},ArrowLeft:()=>{S(null),h().parentMenuId&&(b.destroyed=!0)},ArrowRight:()=>{ie&&(S(ie.key),ze(()=>{T()&&C&&C.getParentMenuId()===h().menuId&&C.focus()}))},Enter:()=>{if(ie)if(ie.originalMenuItem?.menu){if(ie&&ie.originalMenuItem.menu&&C){ue.ArrowLeft();return}ie&&S(ie.key)}else v(B,ie)}," ":()=>{if(!ie)return;ie.originalMenuItem.menu||v(B,ie);let Y=qw(r,ie.key);Y&&Y.click()},Escape:()=>{ue.ArrowLeft();let Y=h();Y.parentMenuId||Y.onHideIntent?.(Y)}},fe=ue[B.key];fe&&(fe(),B.preventDefault()),he!=a&&y(he)}function L(){b.focused=!1}let V=Xo(function(){b.focused=!0,setTimeout(()=>{z.current&&g.current&&g.current===document.activeElement&&h().keyboardActiveItemKey==null&&y(h().runtimeSelectableItems[0]?.key??null)})},[]),z=$w(!0),G=Xo(()=>{let B=h();B.onHideIntent?.(B)},[h]),[E]=Gs(()=>({hideMenu:G,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),V())},getMenuId:()=>h().menuId,getParentMenuId:()=>h().parentMenuId})),F=Xo(B=>{B?(g.current=B,d?.(h(),E),p&&E.focus()):(f?.(h()),g.current=B)},[]),q=kt.createElement("div",{className:rn.contents},kt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:F,onKeyDown:B=>{e.onKeyDown?.(B),O(B)},onMouseDown:B=>{z.current=!1,e.onMouseDown?.(B)},onMouseUp:B=>{z.current=!0,e.onMouseUp?.(B)},onFocus:V,onBlur:L,className:ee(Sg,e.className,"InfiniteMenu"),style:_},I),R);return s?null:q}function Zw(n){let[e,t]=kt.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=kt.createElement("div",{style:r.style},r.value);else{let u=0;c=o.map((d,f)=>{let p=r.value,m=d.field||d.name,g=f+1,b=g+r.span;if(g<u)return null;u=b;let y={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:b},"data-menu-column-id":`${r.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${r.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${r.key}`,className:ee(Tg({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||n.active}),r.className),onPointerEnter:S=>{r.disabled||n.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||n.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||n.onClick(S,r)}};return d.render?kt.createElement(or,{key:`${s}-${m}`,render:d.render,renderParam:{item:p,column:d,value:p[m],domProps:y}}):kt.createElement("div",{key:`${s}-${m}`,...y},p[m])}).filter(Boolean)}return kt.createElement("div",{className:Cg},c)}var{ManagedComponentContextProvider:Qw}=Et({initSetupState:vg,forwardProps:Dg,mapPropsToState:xg,layoutEffect:!0});function Jw(n){let{componentActions:e,componentState:t}=_t(),o=_e(t);return En.createElement(zs.Provider,{value:{componentActions:e,componentState:t,getState:o}},En.createElement(Ag,{domProps:n.domProps}))}function jt(n){let{children:e,portalContainer:t,items:o,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:f,parentMenuItemKey:p,autoFocus:m,id:g,onHideIntent:b,__is_infinite_menu_component:h,...y}=n;return En.createElement(Qw,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...n},En.createElement(Jw,{domProps:y}))}jt[ra]=!0;import*as Hs from"react";function Eg(n,e){let{columnApi:t,column:o,getComputed:r,api:i,dataSourceApi:a}=e,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((f,p)=>{let m=Oo(f,e,"column-menu");u.push({key:p,label:m,check:Hs.createElement(qt,{key:f.id,disabled:f.computedVisible&&i.getVisibleColumnsCount()===1,checked:f.computedVisible,onChange:g=>{let b=!!g;i.setVisibilityForColumn(f.id,b),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}},"-",{key:"group-by",label:"Group by",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((f,p)=>{if(f.groupByForColumn)return;let m=Oo(f,e,"column-menu");u.push({key:p,label:m,check:Hs.createElement(qt,{key:f.id,disabled:!f.computedGroupable,checked:f.computedGroupedBy,onChange:()=>{a.toggleGroupByField(f.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function Og(n,e,t){if(n==null)return null;let{getComputed:o,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??jt,s=o().computedColumnsMap.get(n);if(!s)return null;let c={column:s,columnApi:ct(s.id,e),...e},u=Eg([],c),d=a?a(u,c):u,f=m=>{m.__insideMenu=!0},p=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!d||!d.length?null:_g.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:p,onHideIntent:m=>{p(m),t?.()}})}var eI=`[${Al["data-name"]}="${El["data-name"]}"]`;function tI(n){let{columnId:e,context:t,clearAll:o,showOverlay:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){o(),a.columnMenuVisibleForColumnId=null}let u=n.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${ip["data-column-id"]}="${e}"] ${eI}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Og(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function Ng(){let n=Ge(),{getState:e,actions:t,columnMenuVisibleForColumnId:o,columnMenuVisibleKey:r}=re(c=>({getState:c.getState,actions:c.actions,columnMenuVisibleForColumnId:c.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:c.state.columnMenuVisibleKey})),{portalDOMRef:i}=Ut(c=>({portalDOMRef:c.getMasterState().portalDOMRef}))||{},{showOverlay:a,portal:l,clearAll:s}=ro({portalContainer:i?.current??!1});return Fg(()=>{let c=e();return c.onColumnMenuClick.onChange(u=>{u&&(c.columnMenuTargetRef.current=u.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=u.column.id)})},[]),Fg(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=e();if(c){let f=function(p){p.__insideMenu!==!0&&(s(),t.columnMenuVisibleForColumnId=null)};var d=f;return document.documentElement.addEventListener("mousedown",f),tI({columnId:c,context:n,clearAll:s,showOverlay:a}),()=>{document.documentElement.removeEventListener("mousedown",f)}}else u.current=null,s();return()=>{}},[o,r]),{menuPortal:l}}import*as Lg from"react";import{useCallback as oI}from"react";var nI={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function kg(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=Ge(),{getDataSourceState:a,getDataSourceMasterContext:l}=Kt(),{focusDetectDOMRef:s}=n(),c=oI(async()=>{rg({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return Lg.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:nI})}import{useEffect as Rr}from"react";function rI(){let n=Ge(),{getState:e,editingCell:t}=re(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active?t.cancelled:void 0;Rr(()=>{if(o){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...St({rowIndex:r,columnId:i,...n}),initialValue:a})}},[o])}function iI(){let n=Ge(),{getState:e,editingCell:t}=re(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;Rr(()=>{if(o){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...St({rowIndex:r,columnId:i,...n}),value:a,error:o,initialValue:l})}},[o])}function aI(){let n=Ge(),{editingCell:e}=re(r=>({editingCell:r.state.editingCell})),t=e?.active,o=Eo(t);Rr(()=>{!t&&o&&n.api.focus()},[t,o])}function lI(){let n=Ge(),{editingCell:e,getState:t}=re(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e&&!e.active&&!e.cancelled&&e.accepted===!0;Rr(()=>{if(o){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...St({rowIndex:a,columnId:l,...n}),value:i,initialValue:s};t().onEditAccepted?.(c),n.api.persistEdit({value:i})}},[o])}function sI(){let n=Ge(),{editingCell:e,getState:t}=re(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e?e.persisted:void 0;Rr(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:c,initialValue:u}=r,d={...St({rowIndex:l,columnId:s,...n}),value:c,initialValue:u};o instanceof Error?i?.({...d,error:o}):a?.(d)}},[o])}function zg(){rI(),iI(),lI(),sI(),aI()}import{useEffect as Hg}from"react";import*as xo from"react";import*as Ks from"react";var ca=n=>Ks.createElement(ke,{...n},Ks.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));import*as Bs from"react";var Vg=n=>Bs.createElement(ke,{...n},Bs.createElement("path",{d:"m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"}));function Gg(n,e,t){if(n==null)return null;let{getComputed:o,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),f=u?.Menu??jt,p=o().computedColumnsMap.get(n);if(!p)return null;let m=I=>{I.__insideMenu=!0},g=I=>{I.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:b}=i(),h=b[p.computedFilterType];if(!h)return null;let y=h.operators.map(I=>{let v=I.name,x=p.computedFilterValue?p.computedFilterValue.filter.operator===v:v===h.defaultOperator,R=I.components?.Icon??ln;return{key:v,icon:xo.createElement(R,null),label:xo.createElement(xo.Fragment,null,I.label??I.name),onAction:()=>{c.setColumnFilterOperator(n,v)},checked:x?xo.createElement(Vg,{size:16}):null}}),T=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:xo.createElement(ca,null),disabled:!p.computedFiltered,onAction:()=>{c.clearColumnFilter(n)}},"-"],...y],C={column:p,api:c,getState:r,getDataSourceState:i,getComputed:o,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:p.computedFilterValue,filterTypes:b},w=d?d(T,C):T;return xo.createElement(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:w,onShow:I=>{I.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:I=>{g(I),t?.()}})}var ua=10;function Kg(){let{portalDOMRef:n}=Ut(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},e=Ge(),{getState:t,actions:o}=e,{showOverlay:r,portal:i,clearAll:a}=ro({portalContainer:n?.current??!1});return Hg(()=>t().onFilterOperatorMenuClick.onChange(s=>{if(!s)return;let{target:c,column:u}=s;function d(){a(),o.filterOperatorMenuVisibleForColumnId=null}let f=c?.parentElement||c,p=De.from(f.getBoundingClientRect());p.top-=ua,p.left-=ua,p.width+=2*ua,p.height+=2*ua,r(()=>Gg(u.id,e,d),{constrainTo:t().domRef.current,id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),o.contextMenuVisibleFor=null,o.cellContextMenuVisibleFor=null,o.columnMenuVisibleForColumnId=null,o.filterOperatorMenuVisibleForColumnId=u.id}),[]),Hg(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.filterOperatorMenuVisibleForColumnId=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}import{useEffect as fa}from"react";import*as Us from"react";import*as Ws from"react";function da(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function js(n){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),n.onHideIntent?.()}}}function $s(n,e,t){if(!n)return null;let o=Se();return n.then(r=>{let{items:i,columns:a}=da(r);i&&i.length&&o(Ws.createElement(t,{...e,items:i||[],columns:a}))}),Ws.createElement(So,{updater:o})}function Bg(n,e,t){let{columnId:o,rowIndex:r,event:i}=n,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??jt,{computedColumnsMap:d}=a(),f=d.get(o),p={...St({...e,rowIndex:r,columnId:f.id}),event:i};if(!f||!c)return{cellContext:p,menu:null,preventDefault:!1};let m=js({onHideIntent:t}),g=c(p,e),b=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:p,menu:$s(g,m,u),preventDefault:b};let{items:h,columns:y}=da(g);return!h||!h.length?{cellContext:p,menu:null,preventDefault:Array.isArray(h)}:{preventDefault:b,menu:Us.createElement(u,{...m,columns:y,items:h}),cellContext:p}}function Wg(n,e,t){let{getState:o,getComputed:r}=e,{components:i,getContextMenuItems:a}=o(),l=i?.Menu??jt,{computedColumnsMap:s}=r(),c=n.columnId?s.get(n.columnId):void 0,u=c?{...n,...St({...e,rowIndex:n.rowIndex,columnId:c.id})}:n;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=js({onHideIntent:t}),f=a(u,e),p=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:u,menu:$s(f,d,l),preventDefault:p};let{items:m,columns:g}=da(f);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:p,menu:Us.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var pa=5,jg=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function $g(){let n=Ge(),{portalDOMRef:e}=Ut(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=ro({portalContainer:e?.current??!1});return fa(()=>{let{actions:l,getState:s,getDataSourceState:c}=n;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:f}=d;function p(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:b}=Bg(d,n,p),h=De.fromPoint({top:f.clientY,left:f.clientX});h.width+=pa,h.height+=pa,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:h,alignPosition:jg}),b&&f.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:y}=s();y&&y({...g,getState:s,getDataSourceState:c},f)})},[]),fa(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.cellContextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function Ug(){let n=Ge(),{portalDOMRef:e}=Ut(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=ro({portalContainer:e?.current??!1});return fa(()=>{let{actions:l,getState:s}=n;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function f(){a(),l.contextMenuVisibleFor=null}let{menu:p,cellContext:m,preventDefault:g}=Wg(u,n,f),b={top:d.clientY,left:d.clientX},h=De.fromPoint(b);h.width+=pa,h.height+=pa,r(p,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:h,alignPosition:jg}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:b,...u};let{onContextMenu:y}=s();y&&y({...n,...m},d)})},[]),fa(()=>{let{contextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.contextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}import{useRef as dI}from"react";import*as Yg from"react";import{useCallback as cI,useEffect as uI}from"react";function Ys(n,e){let{brain:t}=re(r=>({brain:r.state.brain})),o=cI(n,e);uI(()=>t.onScroll(o),[t,o])}var qs="yzx0vj0";function qg(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=dI(null);Ys(s=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-s.scrollLeft}px, 0px, 0px)`)},[r]);let l={...i.style};return e==="column"?l.width=ge.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=ge.runtime.bodyWidth),o==="column"?l.minWidth=ge.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=ge.runtime.bodyWidth),t==="column"?l.maxWidth=ge.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=ge.runtime.bodyWidth),Yg.createElement("div",{ref:a,...i,className:i.className?ee(i.className,qs):qs,style:l},i.children)}var fI=J(Z.columnWidthAtIndex),pI=J(Z.columnOffsetAtIndex);function mI(){let{computedVisibleColumns:n}=re(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return n.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${fI}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${pI}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var ma="InfiniteTable";import{useEffect as gI}from"react";function Xg(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=re(u=>({getState:u.getState,actions:u.actions,dataSourceActions:u.dataSourceActions,getDataSourceState:u.getDataSourceState})),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),gI(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:p,repeatWrappedGroupRows:m}=o(),g=!1,b=l.rowsPerPage,h=(r&&r.length>0||i)&&b>0?b:null;return p!=h&&(t.rowsPerPage=h,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,f=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),f()}},[l,s,r,i,c])}import{useEffect as ga,useRef as hI}from"react";var vr=be({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),Zg="_143ofgf5",Qg="_143ofgf3";var bI=J(ge.loaded),Xs={source:"infinite-table-page",target:"infinite-table-devtools-background"};function Jg(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{...Xs,url:Zs(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Xs,url:Zs(),type:t,payload:{debugId:o,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)}}}}var Zs=lt(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function yI(n){window.postMessage(n)}var SI=lt(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){Dt.set(e,t);let{devToolsDetected:o}=t.getState();o||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(Jg({type:"update",debugId:e},t))}else Vp(e),window.postMessage(Jg({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,$e.onLogIntent("IT:*",e=>{yI({...Xs,url:Zs(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let o="";try{o=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return o}return String(t)}),timestamp:e.timestamp}})}),n});function eh(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=re(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),o=n(),{domRef:r,debugId:i}=o;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(bI)!==`${Eu}`&&hr({debugId:i,key:"CSS001_CSS"}),ga(()=>{e().debugId!==i&&(t.debugId=i)},[i]),wI()}var ha=Se(),TI={revertAll:n=>{let e=Dt.get(n.debugId);if(e){let t=vo.get(n.debugId);vo.delete(n.debugId),eo.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=oo.get(n.debugId);oo.delete(n.debugId),to.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=Dt.get(n.debugId);if(e){let t=n.property,o=eo.get(n.debugId),r=vo.get(n.debugId),i=to.get(n.debugId),a=oo.get(n.debugId),l=t;r&&o&&o[l]!==void 0&&(delete o[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=oo.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:n=>{let e=Dt.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),br(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),br(n.debugId))}}},discardAllWarnings:n=>{let e=Dt.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),br(n.debugId))},setColumnVisibility:n=>{ms(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{Wi(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{ms(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{Wi(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{Wi(n.debugId,"multiSort",n.multiSort)},highlight:n=>{let e=Dt.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${vr.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(vr.classNames.base),r.innerHTML=[`<div class="${Qg}"></div>`,`<div class="${Zg}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${o.left}px`,r.style.top=`${o.top}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,i.innerHTML=n.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(vr.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(vr.classNames.variants.active.true)}}}}};function CI(){typeof window<"u"&&window.addEventListener("message",n=>{if(n&&n.data&&typeof n.data.source=="string"&&typeof n.data.target=="string"&&n.data.target==="infinite-table-page"&&n.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(SI(),ha(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=TI[e];t&&t(n.data.payload)}})}CI();function wI(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,actions:r,dataSourceApi:i,api:a}=re(u=>({getState:u.getState,getComputed:u.getComputed,getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions,actions:u.actions,dataSourceApi:u.dataSourceApi,api:u.api})),s=n().debugId,c=hI(s);return c.current=s,ga(()=>{let u=c.current;if(!u)return;let d=p=>{p(u,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},f=ha.get();if(f){d(f);return}return ha.onChange(p=>{p&&d(p)})},[]),ga(()=>{let u=c.current;if(!u)return;let d=ha.get();d&&d(u,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),ga(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function II(){let{masterPortalDOMRef:n}=Ut(o=>({masterPortalDOMRef:o.getMasterState().portalDOMRef}))??{},e=re(o=>o.state.portalDOMRef);return n?.current??e?.current}import*as wt from"react";import{useCallback as RI}from"react";var th="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",oh=be({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),nh="hs68h81",rh=be({defaultClassName:"hs68h80 _16lm1iw1p",variantClassNames:{orientation:{horizontal:"_16lm1iw2h _16lm1iw2j",vertical:"_16lm1iw2f"},draggingInProgress:{true:"_16lm1iw1h",false:"hs68h86"},dropRejected:{true:"hs68h87",false:"hs68h88"},active:{true:"hs68h89",false:"hs68h8a"}},defaultVariants:{},compoundVariants:[[{dropRejected:!0,active:!0},"hs68h8b"],[{dropRejected:!1,active:!0},"hs68h8c"],[{active:!1,dropRejected:!1},"hs68h8d"]]});import*as Zo from"react";function ih(n){return Zo.createElement("div",{...n.domProps})}function ah(n){let{active:e}=n;return Zo.createElement("div",{className:nh},e?"Drop to group":"Drag columns to group")}function lh(n){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),n.onClear?.())};return Zo.createElement("div",{...n.domProps},n.label,Zo.createElement("div",{className:Vr[1]}),Zo.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${n.field}`,className:th,onKeyDown:e,onMouseDown:n.onClear},Zo.createElement(ca,{size:20})))}var vI=(n,e)=>t=>{e&&e(t);let o=Date.now(),r=!1,i=()=>{r=!0};ve().addEventListener("mousemove",i,{once:!0}),ve().addEventListener("mouseup",()=>{r||(ve().removeEventListener("mousemove",i),Date.now()-o<200&&requestAnimationFrame(()=>{n()}))},{once:!0})};function DI(n){let{column:e,onClear:t,components:o,field:r,id:i,toggleSorting:a}=n,{dragSourceListId:l,dragItemId:s}=yn(),c=l===_n,u=Ge(),d=(e?Oo(e.id,u,"grouping-toolbar"):r)??i,f=e?wt.createElement(di,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,p=wt.createElement(wt.Fragment,null,d,f),m=s===i&&l===_n,g=ee(oh({draggingInProgress:c,active:m}),n.domProps?.className),b=vI(a,n.domProps?.onMouseDown),h={...n.domProps,className:g,onMouseDown:b},y=o?.ToolbarItem??lh;return wt.createElement(y,{active:m,domProps:h,column:e,field:r,label:p,onClear:t})}var _n="grouping-toolbar";function sh(n){let{groupBy:e}=Oe(S=>({groupBy:S.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:o,api:r}=re(S=>({getComputed:S.getComputed,dataSourceApi:S.dataSourceApi,api:S.api})),{dropTargetListId:i,dragSourceListId:a}=ho(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===_n,u=a===_n,d=n.components?.Placeholder??ah,f=n.components?.Host??ih,p=e.length?wt.createElement(wt.Fragment,null,e.map((S,T)=>{let C=S.field?l.get(S.field):void 0,w=`${S.field??`idx-${T}`}`;return wt.createElement(Ko.DraggableItem,{key:w,id:w},I=>wt.createElement(DI,{id:w,components:n.components,domProps:I,field:S.field,column:C,toggleSorting:()=>{C&&r.toggleSortingForColumn(C.id)},onClear:()=>{let v=e.filter(x=>x!==S).filter(Boolean);o.setGroupBy(v)}}))})):wt.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=S=>{let T=S.map(C=>e[C]);o.setGroupBy(T)},g=S=>{let{dragItemId:T}=S,C=T,w=s.get(C);if(!w||!w.field||!w.computedGroupable)return;let I=[...e];I.splice(S.dropIndex,0,{field:w.field}),o.setGroupBy(I)},b=RI(S=>{let{computedColumnsMap:T}=t(),C=S.dragItem.id,w=T.get(C);return!(!w||!w.computedGroupable||e.some(I=>I.field===w.field))},[e]),h=n.orientation??"horizontal",{domProps:y}=n;return wt.createElement(Ko,{orientation:h,dragListId:_n,acceptDropsFrom:["header",_n],onDrop:m,dragStrategy:"inline",onAcceptDrop:g,shouldAcceptDrop:b},(S,{draggingInProgress:T,status:C})=>{let w=ee(rh({active:c,orientation:h,draggingInProgress:T,dropRejected:C==="rejected"}),S.className,y?.className),I={...S,...y,className:w,children:p};return wt.createElement(f,{active:c,rejectDrop:C==="rejected",domProps:I,orientation:h})})}import*as Fn from"react";import{useMemo as gh}from"react";import{useCallback as FI,useEffect as Dr,useRef as NI}from"react";import*as ba from"react";function ch(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return Ai(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}import*as io from"react";var uh=be({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as dh,useRef as xI}from"react";function PI(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function MI(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=nm(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(n,l),r.detailDataSourcesStateToRestore=a}function AI(n,e){let t=xI(!1);return{currentRowCache:dh(()=>({getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)}),[e,n]),cacheCalledByRowDetailRenderer:t}}function fh(n){let{rowDetailsCache:e,rowInfo:t}=n,{getDataSourceState:o,dataSourceActions:r}=Oe(c=>({getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions})),{getMasterState:i}=re(c=>({getMasterState:c.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=AI(t.id,e),s=dh(()=>{let c=o().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:lt(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.dataSourceState.destroyedRef.current||(d.dataSourceActions.stateReadyAsDetails=!0)});return}PI(t.id,{masterState:o(),detailContext:d}),requestAnimationFrame(()=>{d.dataSourceState.destroyedRef.current||(d.dataSourceActions.stateReadyAsDetails=!0)}),d.dataSourceState.onCleanup.onChange(()=>{let f=a.get();f&&MI(t.id,{detailState:d.getDataSourceState(),masterActions:r,masterState:o(),cacheEntryForRow:f})})}),shouldRestoreState:c}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function ph(){return co()}var{rootClassName:EI}=Le,_I=`${EI}RowDetail`;function OI(n){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:o,rowInfo:r,detailOffset:i,rowDetailsCache:a}=n,{masterDetailContextValue:l,currentRowCache:s}=fh({rowDetailsCache:a,rowInfo:r}),c=on(),[u]=io.useState(()=>ph());return u.setSnapshot(l),io.useLayoutEffect(()=>{u.notify()},[l]),io.createElement(c.Provider,{value:u},io.createElement("div",{ref:e,className:ee(_I,uh({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${Z.bodyWidth} - ${Z.scrollbarWidthVertical})`,height:o}},t(r,s)))}var mh=io.memo(OI);var LI=1;function hh(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:c,onRowMouseEnter:u,onRowMouseLeave:d,groupRenderStrategy:f,brain:p,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:b,isRowDetailsEnabled:h,cellClassName:y,cellStyle:S,rowStyle:T,rowDetailCache:C,rowClassName:w,onScrollToTop:I,onScrollToBottom:v,onScrollStop:x,scrollToBottomOffset:R,wrapRowsHorizontally:P,updatedAt:A,ready:M,editingCell:D}=re(H=>({actions:H.actions,getState:H.getState,getComputed:H.getComputed,getDataSourceMasterContext:H.getDataSourceMasterContext,rowHeight:H.state.rowHeight,rowDetailHeight:H.state.rowDetailHeight,onRowMouseEnter:H.state.onRowMouseEnter,onRowMouseLeave:H.state.onRowMouseLeave,groupRenderStrategy:H.state.groupRenderStrategy,brain:H.state.brain,showZebraRows:H.state.showZebraRows,rowDetailRenderer:H.state.rowDetailRenderer,isRowDetailsExpanded:H.state.isRowDetailExpanded,isRowDetailsEnabled:H.state.isRowDetailEnabled,cellClassName:H.state.cellClassName,cellStyle:H.state.cellStyle,rowStyle:H.state.rowStyle,rowDetailCache:H.state.rowDetailCache,rowClassName:H.state.rowClassName,onScrollToTop:H.state.onScrollToTop,onScrollToBottom:H.state.onScrollToBottom,onScrollStop:H.state.onScrollStop,scrollToBottomOffset:H.state.scrollToBottomOffset,wrapRowsHorizontally:H.state.wrapRowsHorizontally,updatedAt:H.state.updatedAt,ready:H.state.ready,editingCell:H.state.editingCell})),{computedPinnedStartColumns:_,computedPinnedEndColumns:O,computedVisibleColumns:L,computedColumnsMap:V,computedRowHeight:z,computedRowSizeCacheForDetails:G,fieldsToColumn:E,rowspan:F,toggleGroupRow:q,columnSize:B}=e,{dataArray:U,rowInfoStore:ne,selectionMode:me,cellSelection:he,isNodeReadOnly:ie,getDataSourceState:ue,dataSourceApi:fe,dataSourceActions:Y}=Oe(H=>({dataSourceApi:H.dataSourceApi,dataSourceActions:H.dataSourceActions,getDataSourceState:H.getDataSourceState,dataArray:H.dataSourceState.dataArray,rowInfoStore:H.dataSourceState.rowInfoStore,selectionMode:H.dataSourceState.selectionMode,cellSelection:H.dataSourceState.cellSelection,isNodeReadOnly:H.dataSourceState.isNodeReadOnly})),k=_e(U);ch({columnSize:B,brain:p,computedPinnedStartColumns:_,computedPinnedEndColumns:O,computedVisibleColumns:L,computedRowHeight:z,dataArray:U,bodySize:t,rowspan:F});let $=NI(0);Dr(()=>p.onRenderCountChange(()=>{$.current=p.scrollTopMax}),[p]),Dr(()=>p.onRenderRangeChange(H=>{i().onRenderRangeChange?.(H)}),[p]),Dr(()=>p.onScrollStop(H=>{let{scrollTop:se,scrollLeft:N}=H;if(se===0&&I?.(),se+(R??LI)>=$.current){v?.();let{livePagination:pe,livePaginationCursor:Pe,dataArray:Me}=ue();pe&&(Y.cursorId=Pe!==void 0?Date.now():Me.length)}if(x){let pe=p.getRenderRange();x({scrollTop:se,scrollLeft:N,renderRange:pe,viewportSize:i().bodySize,firstVisibleRowIndex:pe.start[0],lastVisibleRowIndex:pe.end[0],firstVisibleColIndex:pe.start[1],lastVisibleColIndex:pe.end[1]})}}),[p,I,v,x]),Dr(()=>{t.height&&(r.ready=!0)},[!!t.height]),Dr(()=>{let{onReady:H}=i();H&&H({api:o,dataSourceApi:fe})},[M]);let K=gh(()=>({isNodeReadOnly:ie,selectionMode:me,cellSelection:he}),[ie,me,he]),X=FI(H=>{let{rowIndex:se,colIndex:N,heightWithRowspan:Q,domRef:de,hidden:pe,width:Pe,onMouseLeave:Me,onMouseEnter:Ve}=H,Ne=k()[se],Ke=L[N];if(!Ne||!Ke)return null;let Xe=G?G.getRowHeight(se):Q,Ze=!1;!h||typeof h=="function"&&!h(Ne)?Ze=!1:b&&(Ze=b(Ne)?"expanded":"collapsed");let Qe=P?p.getRowIndexInPage(se):null,j=P?p.getPageIndexForRow(se):null,le=o.isEditorVisibleForCell({rowIndex:se,columnId:Ke.id});return ba.createElement(Vd,{...{getData:k,virtualized:!0,showZebraRows:m,groupRenderStrategy:f,rowIndexInHorizontalLayoutPage:Qe,horizontalLayoutPageIndex:j,rowIndex:se,rowInfoStore:ne,hidden:pe,toggleGroupRow:q,rowHeight:Xe,rowDetailState:Ze,onMouseEnter:Ve,onMouseLeave:Me,onRowMouseEnter:u,onRowMouseLeave:d,domRef:de,width:Pe,column:Ke,columnsMap:V,fieldsToColumn:E,rowStyle:T,rowClassName:w,cellStyle:S,cellClassName:y,inEditMode:le,getDataSourceState:ue,dataSourceApi:fe,dataSourceActions:Y,getState:i,imperativeApi:o,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:K}})},[s,c,u,d,G,z,b,k,L,V,E,f,P,q,m,p,ne,T,w,y,S,ue,fe,Y,i,o,r,a,l,A,D,K]),oe=gh(()=>{if(b)return H=>{let{rowIndex:se,domRef:N}=H,de=k()[se];if(!de||!b(de)||!G)return ba.createElement("div",{ref:N,className:Lc.hidden});let{rowDetailHeight:pe,rowHeight:Pe}=G.getSize(se);return ba.createElement(mh,{rowInfo:de,rowDetailsCache:C,rowIndex:se,domRef:N,detailOffset:Pe,rowDetailHeight:pe,rowDetailRenderer:g})}},[M,X,g,c,b,C]);return{renderCell:X,renderDetailRow:oe}}import{useEffect as kI}from"react";function bh(){let{state:n,getState:e,actions:t}=re(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:o}=n,r=Eo(o);kI(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=Ds(ma,!!o);t.brain=c.brain,t.headerBrain=c.headerBrain,t.renderer=c.renderer,t.onRenderUpdater=c.onRenderUpdater,t.headerRenderer=c.headerRenderer,t.headerOnRenderUpdater=c.headerOnRenderUpdater}},[r,o])}import*as Th from"react";var yh="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Sh=ee(yh,Cl);function Ch(n){return Th.createElement("div",{...n,className:n.className?ee(Sh,n.className):Sh})}import*as On from"react";var wh={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},Ih="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Rh="qy58ya4";var{rootClassName:zI}=Le,Qs=`${zI}-LoadMask`;function VI(n){let{visible:e,children:t="Loading"}=n;return On.createElement("div",{className:`${wh[e?"visible":"hidden"]} ${Qs}`},On.createElement("div",{className:`${Ih} ${Qs}-Overlay`}),On.createElement("div",{className:`${Rh} ${Qs}-Text`},t))}var ya=On.memo(VI);import{useMemo as GI}from"react";var HI=[Cd,`${Ht}--hovered`];function KI(n){return Array.isArray(n)&&(n=n.join(" ")),n.split(" ").map(e=>e.trim()).filter(Boolean)}function Qo(n){let e=Ge(),t=Ao(),{getComputed:o,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,columnReorderDragColumnId:d,scrollStopDelay:f,brain:p,scrollerDOMRef:m,components:g,bodySize:b,activeCellIndex:h,rowDetailRenderer:y,showHoverRows:S,wrapRowsHorizontally:T,domProps:C,domRef:w,forceBodyRerenderTimestamp:I,rowHoverClassName:v,ready:x}=re(F=>({ready:F.state.ready,columnReorderDragColumnId:F.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:F.state.forceBodyRerenderTimestamp,renderer:F.state.renderer,onRenderUpdater:F.state.onRenderUpdater,debugId:F.state.debugId,keyboardNavigation:F.state.keyboardNavigation,activeRowIndex:F.state.activeRowIndex,loadingText:F.state.loadingText,scrollStopDelay:F.state.scrollStopDelay,brain:F.state.brain,scrollerDOMRef:F.state.scrollerDOMRef,components:F.state.components,bodySize:F.state.bodySize,activeCellIndex:F.state.activeCellIndex,rowDetailRenderer:F.state.rowDetailRenderer,showHoverRows:F.state.showHoverRows,wrapRowsHorizontally:F.state.wrapRowsHorizontally,domProps:F.state.domProps,domRef:F.state.domRef,rowHoverClassName:F.state.rowHoverClassName})),R=g?.LoadMask??ya,P=o(),{computedRowHeight:A,computedRowSizeCacheForDetails:M}=P,D=M?.getRowHeight||A,{loading:_}=Oe(F=>({loading:F.dataSourceState.loading})),O=Fn.useCallback(F=>{let q=e.getState(),B=F.target;if(!t&&F._from_row_detail)return;t&&(F._from_row_detail=!0);let U=Au(B,vs(),q.domRef.current),ne,me,he,ie;U&&(me=Number(U.dataset.colIndex),ie=Number(U.dataset.rowIndex),ne=e.getComputed().computedVisibleColumns[me].id,he=e.dataSourceApi.getRowInfoArray()[ie].id);let ue={columnId:ne,colIndex:me,rowId:he,rowIndex:ie,event:F,target:U??F.target};U&&q.cellContextMenu(ue),q.contextMenu(ue)},[]),{renderCell:L,renderDetailRow:V}=hh({imperativeApi:r,getComputed:o,domRef:w,bodySize:b,computed:P}),{autoFocus:z,tabIndex:G}=C??{};bh();let E=GI(()=>{if(!S)return;let F=[];return v&&(F=F.concat(v)),n.rowHoverClassName&&(F=F.concat(n.rowHoverClassName)),Qo.rowHoverClassName&&(F=F.concat(Qo.rowHoverClassName)),KI(F)},[S,v,n.rowHoverClassName,Qo.rowHoverClassName]);return Fn.createElement(Ch,{onContextMenu:O},Fn.createElement(Gf,{forceRerenderTimestamp:I,debugId:l,tabIndex:G??0,autoFocus:z??void 0,activeRowIndex:x&&s==="row"?c:null,activeCellIndex:x&&s==="cell"&&!d?h:null,scrollStopDelay:f,renderer:i,wrapRowsHorizontally:T,onRenderUpdater:a,brain:p,activeCellRowHeight:D,renderCell:L,renderDetailRow:y?V:void 0,cellHoverClassNames:E,scrollerDOMRef:m,scrollVarHostRef:w}),Fn.createElement(R,{visible:_},u))}Qo.rowHoverClassName=HI;var Yt=Le.rootClassName,{ManagedComponentContextProvider:BI}=Et({initSetupState:vm,forwardProps:Dm,mapPropsToState:Am,cleanup:xm,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Mm(),getParentState:()=>is(n=>n),debugName:n=>To(n.debugId,ma)}),WI=Re.memo(function(){let e=Lr(),{componentState:t,api:o,initialChildren:r}=re(z=>({componentState:z.state,api:z.api,initialChildren:z.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Oe(z=>({dataArrayLength:z.dataSourceState.dataArray.length,getDataSourceState:z.getDataSourceState,dataSourceActions:z.dataSourceActions,dataSourceApi:z.dataSourceApi})),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:f,onRowDetailHeightCSSVarChange:p,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:b,columnHeaderHeightCSSVar:h,scrollStopDelay:y,brain:S,activeRowIndex:T,activeCellIndex:C}=t,{licenseKey:w}=t;!w&&ao.licenseKey&&(w=ao.licenseKey),Um(T,i,o),Wm(C,i,o);let{onKeyDown:I}=fg();Re.useEffect(()=>{let z=a(),G=At(E=>{z.notifyRenderRangeChange({renderStartIndex:E[0],renderEndIndex:E[1]})},{wait:y});return S.onVerticalRenderRangeChange(G)},[S,y]);let v=Hm(w),{autoFocus:x,tabIndex:R,...P}=t.domProps??{},A=qu(P);Re.useEffect(()=>{S.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),bm(),Xg(),zg();let{menuPortal:M}=Ng(),{menuPortal:D}=$g(),{menuPortal:_}=Ug(),{menuPortal:O}=Kg();Re.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(t.id,t.ready,o,{dataSourceApi:s})},[t.ready,o,s]);let L=eh();Re.useEffect(()=>{if(e){let z=e.getSnapshot();u.current=z.getMasterState().portalDOMRef.current}},[]);let V=r??Re.createElement(Re.Fragment,null,Re.createElement(Ql,null),Re.createElement(Qo,null));return Re.createElement("div",{"data-debug-id":L,onKeyDown:I,ref:c,...A},V,Re.createElement("div",{ref:u,className:ee(`${st}Portal`,kc[1e7],Gr.absolute,Fc[0],Ec[0])},M,D,_,O),g?Re.createElement(Wn,{key:"row-height",varName:g,onChange:d}):null,Re.createElement(Wn,{key:"flashing-duration",allowInts:!0,varName:ge.components.Cell.flashingDuration,onChange:f}),b?Re.createElement(Wn,{key:"row-detail-height",varName:b,onChange:p}):null,h?Re.createElement(Wn,{key:"column-header-height",varName:h,onChange:m}):null,v?null:Re.createElement(cp,null),Re.createElement(kg,null))});function jI({children:n,store:e}){let{componentActions:t,componentState:o}=_t(),{scrollerDOMRef:r,scrollTopKey:i}=o,a=_e(o),l=km({state:o,actions:t,getState:a}),s=_e(l),c=Lr(),{getDataSourceState:u,dataSourceActions:d,getDataSourceMasterContext:f,dataSourceApi:p}=Kt(),[m]=Re.useState(()=>gm({getComputed:s,getState:a,getDataSourceState:u,getDataSourceMasterContext:f,dataSourceApi:p,actions:t,dataSourceActions:d})),g={actions:t,state:o,computed:l,dataSourceActions:d,getDataSourceMasterContext:f,getDataSourceState:u,getComputed:s,getState:a,api:m,dataSourceApi:p,children:n};return e.setSnapshot(g),Re.useLayoutEffect(()=>{e.notify()}),Or(r,b=>{let h={width:b.width,height:b.height};t.bodySize=h},{earlyAttach:!0,debounce:50}),Re.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),Re.createElement(WI,null)}var $I=40,UI=qm(_u),ao=function(n){let[e]=Re.useState(()=>Ym()),t=Ur();return Re.createElement(BI,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:$I,columnHeaderHeight:UI,...n},Re.createElement(Tl,null,Re.createElement(t.Provider,{value:e},Re.createElement(jI,{children:n.children,store:e}))))};ao.Header=Ql;ao.Body=Qo;ao.HScrollSyncContent=qg;ao.Footer=()=>Re.createElement(Vc,null);ao.GroupingToolbar=sh;import*as vh from"react";function Qj(n){let{DataSource:e}=yr({nodesKey:"children",...n});return vh.createElement(e,null,n.children??null)}import*as Dh from"react";function YI(n){return Dh.createElement(ao,{...n})}var qI=n=>(t,{unfilteredTreePaths:o,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new et(i,{treePaths:o});r.forEachLeafNodePath((u,{selected:d})=>{l.setNodeSelection(u,d)}),a&&r.forEachLeafNodePath(u=>{l.setNodeSelection(u,a.selected)},a.nodePath);let c={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};n(c)};var Sa=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let o=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,o(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=$e(`IT:${e}:DataQuery`)}};function Nn(n){if(Array.isArray(n))return n.map(Nn);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=Nn(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var lo=class lo{constructor(e){this.queryCache=new te;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Nn(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new Sa(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Nn(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Nn(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Nn(e);this.queryCache.delete(t)};if(this.options=e,lo.clients.has(e.name)){let t=`There's already a DataClient with name "${e.name}". Specify a different name for the client`;throw new Error(t)}lo.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=lo.clients.get(e);t&&t.destroy()}static destroyAll(){lo.clients.forEach(e=>{lo.destroy(e.name)})}destroy(){lo.clients.delete(this.options.name)}};lo.clients=new Map;var xh=lo;var XI={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},ZI={instantEdit:XI};import{useEffect as w$}from"react";function QI(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var Ta=class Ta{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Ta.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}};Ta.DEFAULT_SIZE=10;var Js=Ta;var Ca=class Ca{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Ca.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};Ca.DEFAULT_SIZE=10;var ec=Ca;import{useEffect as JI,useRef as wa}from"react";var eR=(n,e)=>n.every((t,o)=>t===e[o]),tR=(n,e)=>{let t=wa(e),o=eR(e,t.current),r=wa(!0);t.current=e;let i=wa(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=wa(n);l.current=n,JI(()=>{if(r.current){r.current=!1;return}return l.current()},a)};import{useEffect as oR,useRef as xr}from"react";var Ph=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),tc=(n,e)=>{let{same:t,different:o,compare:r}=e,i=xr(t),a=xr(o),l=Ph(t,i.current,r),s=!Ph(o,a.current,r),c=xr(!0);i.current=t,a.current=o;let u=xr(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let f=xr(n);f.current=n,l&&s&&(c.current=!1),oR(()=>{if(!c.current)return f.current()},d)};import*as It from"react";var Mh=J(Z.currentFlashingDuration),nR=({children:n})=>It.createElement(It.Fragment,null,n),Ah=1e3,Eh={up:ii({direction:"up"}).split(" "),down:ii({direction:"down"}).split(" "),neutral:ii({direction:"neutral"}).split(" ")},_h=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=nR}=n;return It.forwardRef((i,a)=>{let l=ci(),{flashingDurationCSSVarValue:s}=re(I=>({flashingDurationCSSVarValue:I.state.flashingDurationCSSVarValue})),c=typeof s=="number"?s??e??Ah:e??Ah,{domRef:u,value:d,column:f,rowInfo:p,htmlElementRef:m}=l,g=p.id,b=f.id,h=It.useRef(!0),y=It.useRef(d),S=h.current?null:y.current;h.current=!1;let T=It.useRef(void 0),C=It.useRef(void 0),w=It.useRef(void 0);return tc(()=>{if(d===y.current)return;let I=()=>{let P=m.current;if(T.current&&(clearTimeout(T.current),T.current=void 0),w.current&&(clearTimeout(w.current),w.current=void 0),C.current&&P){let A=C.current,M=Eh[A];P.classList.remove(...t?[t,...M]:M),P.style.removeProperty(Mh),C.current=void 0}};y.current=d;let v=m.current;if(!v)return;I();let x=typeof d=="number"?d>S?"up":"down":"neutral",R=Eh[x];return v.style.setProperty(Mh,`${c}`),v.classList.add(...t?[t,...R]:R),C.current=x,T.current=setTimeout(I,c),I},{same:[b,g],different:[d]}),It.createElement("div",{ref:u,...i,className:ee(i.className)},o({children:i.children,oldValue:S}))})},rR=_h();import*as qe from"react";import{useEffect as Fh,useRef as Oh}from"react";import{createPortal as iR}from"react-dom";function aR(n){let[e,t]=qe.useState(null);return Fh(()=>{let{debugTarget:o}=n,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[o]){let i=globalThis.INFINITE[o].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[n.debugTarget]),typeof e=="function"?qe.createElement(Nh.Provider,{value:{getState:e}},qe.createElement(lR,null)):null}var Nh=qe.createContext({getState:()=>null});function lR(){let n=qe.useContext(Nh),{getState:e}=n,[,t]=zt(),o=e().renderer.cellManager;Fh(()=>{let s=At(()=>{console.log("rerender"),t()},{wait:500});return o.onCellAttachmentChange(s)},[o,t]);let r=o.getRowsWithCells(),i=o.getColumnsWithCells(),a=Oh(null),l=Oh(null);return qe.createElement("div",{style:{overflow:"auto"}},iR(qe.createElement("div",{ref:a,style:{position:"absolute",top:0,left:0,width:"0px",height:"0px",pointerEvents:"none",background:"rgba(255, 0, 0, 0.5)",opacity:"0"}}),document.body),qe.createElement("table",{style:{borderCollapse:"collapse"}},qe.createElement("thead",null,qe.createElement("tr",null,i.map(s=>qe.createElement("th",{key:s,"data-col-index":s},s)))),qe.createElement("tbody",null,r.map(s=>qe.createElement("tr",{key:s,"data-row-index":s},i.map(c=>qe.createElement("td",{key:c,style:{padding:5,border:"1px solid gray",background:o.getCellAt([s,c])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":c},qe.createElement("button",{onClick:()=>{let u=o.getCellAt([s,c])?.getElement();if(!u)return;let d=u.getBoundingClientRect();a.current.style.top=`${d.top}px`,a.current.style.left=`${d.left}px`,a.current.style.width=`${d.width}px`,a.current.style.height=`${d.height}px`,a.current.style.opacity="0.5",a.current.style.transition="opacity 0.5s",l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a.current.style.opacity="0",l.current=null},2e3),console.log(u)},style:{cursor:"pointer"}},"(",s,",",c,")"))))))))}var Z$={CheckBox:qt,LoadMask:ya,MenuIcon:nr,StringFilterEditor:cn,NumberFilterEditor:Xr};export{bn as AutoScroller,je as CellSelectionState,vt as DRAG_ITEM_ATTRIBUTE,xh as DataClient,_z as DataSource,SC as DataSourceActionType,te as DeepMap,Tl as DragDropProvider,ir as DragInteractionTarget,Ko as DragList,Js as FixedSizeSet,rR as FlashingColumnCell,Tt as GroupRowsState,aR as INTERNAL_MatrixDebugger,ao as InfiniteTable,Yt as InfiniteTableClassName,WI as InfiniteTableComponent,jt as Menu,Sr as RowDetailCache,xt as RowDetailState,Ct as RowDisabledState,Ee as RowSelectionState,Qj as TreeDataSource,dt as TreeExpandState,YI as TreeGrid,et as TreeSelectionState,ec as WeakFixedSizeSet,bg as alignNode,Z$ as components,lf as createDefaultProxy,_h as createFlashingColumnCellComponent,At as debounce,$e as debug,sf as defaultDragProxyMove,_o as defaultFilterTypes,Ns as eventMatchesKeyboardShortcut,Fp as filterDataArray,_o as filterTypes,dT as flatten,Et as getComponentStateRoot,ns as group,QI as interceptMap,ZI as keyboardShortcuts,Jt as multisort,rs as multisortNested,Nn as queryKeyToCacheKey,mT as toTreeDataArray,_t as useComponentState,yr as useDataSourceInternal,Oe as useDataSourceSelector,is as useDataSourceState,ho as useDragDropProvider,yn as useDragListContext,tc as useEffectWhen,tR as useEffectWhenSameDeps,vn as useEffectWithChanges,OL as useEffectWithObject,Ys as useGridScroll,ci as useInfiniteColumnCell,vl as useInfiniteColumnEditor,qn as useInfiniteColumnFilterEditor,qr as useInfiniteHeaderCell,II as useInfinitePortalContainer,_L as useLayoutEffectWithChanges,lm as useManagedDataSource,Ao as useMasterRowInfo,ro as useOverlay,Ew as useOverlayPortal,Eo as usePrevious,Oz as useRowInfoReducers,mI as useVisibleColumnSizes,qI as withSelectedLeafNodesOnly};
|
|
30
30
|
//!collapsed || lazyLoad;
|