@infinite-table/infinite-react 4.1.1 → 4.2.0

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.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var Cm=Object.create;var Nr=Object.defineProperty,Sm=Object.defineProperties,ym=Object.getOwnPropertyDescriptor,Tm=Object.getOwnPropertyDescriptors,bm=Object.getOwnPropertyNames,So=Object.getOwnPropertySymbols,Rm=Object.getPrototypeOf,Kr=Object.prototype.hasOwnProperty,gl=Object.prototype.propertyIsEnumerable;var kr=Math.pow,hl=(o,e,t)=>e in o?Nr(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,C=(o,e)=>{for(var t in e||(e={}))Kr.call(e,t)&&hl(o,t,e[t]);if(So)for(var t of So(e))gl.call(e,t)&&hl(o,t,e[t]);return o},P=(o,e)=>Sm(o,Tm(e));var At=(o,e)=>{var t={};for(var n in o)Kr.call(o,n)&&e.indexOf(n)<0&&(t[n]=o[n]);if(o!=null&&So)for(var n of So(o))e.indexOf(n)<0&&gl.call(o,n)&&(t[n]=o[n]);return t};var wm=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var Im=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of bm(e))!Kr.call(o,r)&&r!==t&&Nr(o,r,{get:()=>e[r],enumerable:!(n=ym(e,r))||n.enumerable});return o};var Br=(o,e,t)=>(t=o!=null?Cm(Rm(o)):{},Im(e||!o||!o.__esModule?Nr(t,"default",{value:o,enumerable:!0}):t,o));var _e=(o,e,t)=>new Promise((n,r)=>{var i=s=>{try{l(t.next(s))}catch(u){r(u)}},a=s=>{try{l(t.throw(s))}catch(u){r(u)}},l=s=>s.done?n(s.value):Promise.resolve(s.value).then(i,a);l((t=t.apply(o,e)).next())}),Cl=(o,e,t)=>(e=o[Symbol.asyncIterator],t=(n,r)=>(r=o[n])&&(e[n]=i=>new Promise((a,l,s)=>(i=r.call(o,i),s=i.done,Promise.resolve(i.value).then(u=>a({value:u,done:s}),l)))),e?e.call(o):(o=o[Symbol.iterator](),e={},t("next"),t("return"),e));var Oo=wm((OT,Zl)=>{Zl.exports=function(o,e,t,n,r){var i,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(r===void 0)r=o.length-1;else if(r=r|0,r<n||r>=o.length)throw new RangeError("invalid upper bound");for(;n<=r;)if(i=n+(r-n>>>1),a=+t(o[i],e,i,o),a<0)n=i+1;else if(a>0)r=i-1;else return i;return~n}});function St(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}import*as se from"react";var J=(...o)=>o.filter(e=>!!`${e}`).join(" ");import*as Yt from"react";import{useRef as Ml}from"react";function Ft(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Sl=(o,e)=>o-e;var xm=(o,e)=>Sl(o.revision,e.revision),le=class{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,n)=>this.visitKey(n,this.map,[],e))};this.visitDepthFirst=e=>{this.visitWithNext([],e)};this.visitWithNext=(e,t,n=this.map,r,i)=>{if(!n)return;let a=0,l=n.has(this.emptyKey),s=!i;if(r!==void 0){if(r<0)return;r--}let u=(c,d)=>{let p=n.get(d);if(!p)return;let{map:f}=p,m=d===this.emptyKey;if(m&&!s)return;let h=m?[]:[...e,d],g=f?()=>this.visitWithNext(h,t,f,r!==void 0?r-1:void 0):void 0;p.hasOwnProperty("value")?(t(p.value,h,a,g),a++):g==null||g()};l&&(u(void 0,this.emptyKey),s=!1,a=0),n.forEach(u)};this.fill(e)}static clone(e){let t=new le;return e.visit((n,r)=>{t.set(r,n.value)}),t}fill(e){e&&e.forEach(t=>{let[n,r]=t;this.set(n,r)})}getValuesStartingWith(e,t,n){let r=[];return this.getStartingWith(e,(i,a)=>{r.push(a)},t,n),r}getKeysStartingWith(e,t,n){let r=[];return this.getStartingWith(e,i=>{r.push(i)},t,n),r}getStartingWith(e,t,n,r){let i=this.map,a,l=!1;if(e.length)for(let s=0,u=e.length;s<u;s++){let c=e[s];if(a=i.get(c),!a||!a.map)if(l=!0,s===u-1){l=!0;break}else return;i=a.map}a&&a.value!==void 0&&(n||t(e,a.value)),!l&&this.visitWithNext(e,(s,u,c,d)=>{t(u,s),d==null||d()},i,r,n)}getMapAt(e){let t=this.map,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){var n;let t=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=t.get(a);if(!s||!s.map)return 0;if(t=s.map,l)return(n=t==null?void 0:t.size)!=null?n:0}return 0}set(e,t){let n=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=n.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,n.set(a,s),this.length++):(s.map||(s.map=new Map,n.set(a,s)),s.length++,n=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===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((n,r)=>{let{map:i}=n;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 n=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],u=a===l-1,c=t.get(s);if(u){c&&(c.hasOwnProperty("value")&&(delete c.value,delete c.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),c.map&&c.map.size===0&&delete c.map,c.map||t.delete(s));break}else{if(!c||!c.map){i=!1;break}r.push(c),t=c.map,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&(a==null?void 0:a.size)===0){let s=n[n.length-1],u=e[e.length-1],c=s==null?void 0:s.get(u);c&&(delete c.map,c.hasOwnProperty("value")||s.delete(u))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===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,n,r){let i=t.get(e);if(!i)return;let{map:a}=i,l=e===this.emptyKey?[]:[...n,e],s=Ft(()=>{a&&a.forEach((u,c)=>{this.visitKey(c,a,l,r)})});i.hasOwnProperty("value")&&r(i,l,s),s()}getArray(e){let t=[];return this.visit((n,r)=>{let i=e(P(C({},n),{keys:r}));r.length===0?t.splice(0,0,i):t.push(i)}),t}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let n=[];return t.forEach(r=>{r.value!==void 0&&n.push(r.value)}),n}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(P(C({},r),{keys:i}))}),t.sort(xm);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};function xe(){return globalThis}var Hn=["#0000CC","#0000FF","#0033CC","#0033FF","#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"],yl=Symbol("color"),yo=new WeakMap;yo.set(Hn,Hn.map(o=>0));var vm=(o=Hn)=>{var n,r;let e=[];yo.has(o)?e=yo.get(o):(e=o.map(i=>0),yo.set(o,e));let t=e.reduce((i,a,l,s)=>a<s[i]?l:i,0);return e[t]!=null&&e[t]++,(r=(n=o[t])!=null?n:o[0])!=null?r:Hn[0]},bo=":",Wr="*",Tl="-",Pm=",",Dm="debug",Mm="diffdebug",Il=!1,Ln=new le,To=new Map;function bl(o,e){let t=o.split(bo),n=new le;n.set(t,!0);let r=e.split(bo),i=new Set(r).has(Wr),a=i?r.slice(0,r.indexOf(Wr)):r;if(n.getKeysStartingWith(a,i).length>0)return!0}function Rl(o,e){let t=`channel=${o}_permissions=${e}`;if(To.has(t))return To.get(t);let n=e.split(Pm);function r(l){return To.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(Wr)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(Tl);if(u&&(s=s.substring(Tl.length)),bl(o,s))return r(!u)}for(let l=0;l<a.length;l++){let s=a[l],u=s.startsWith("-");if(u&&(s=s.substring(1)),bl(o,s))return r(!u)}return r(!1)}var jr=()=>{var o,e,t;return(t=(e=yt.enable)!=null?e:xe()&&((o=xe().localStorage)==null?void 0:o.getItem(Dm)))!=null?t:""},Em=()=>{var o,e,t;return(t=(e=yt.diffenable)!=null?e:xe()&&((o=xe().localStorage)==null?void 0:o.getItem(Mm)))!=null?t:`${Il}`},Ro="",xl=Il;function $r(o){xl=`${Em()}`=="true",Ro!==o&&(Ro=o,To.clear())}function vl(o){$r(jr()),typeof xe()!="undefined"&&xe().addEventListener&&xe().addEventListener("storage",function(){$r(jr())});function e(t,n){var m;let r=n?`${n}${bo}${t}`:t,i=r.split(bo);if(Ln.has(i))return Ln.get(i);let a=Ln.get(i.slice(0,-1)),l=(m=a?a.logFn:yt.logFn)!=null?m:Pl,s=l,u,c=0,d=()=>u!=null?u:Rl(r,Ro),p=vm(yt.colors),f=Object.defineProperties((...h)=>{if(Rl(r,Ro)){let g=Date.now();if(c&&xl){let S=g-c;s(`%c[${r}]`,`color: ${p}`,`+${S}ms:`)}c=g;let y=[],T;if(h.forEach(S=>{if(S[yl])T===void 0&&(T=!0),y.push(...S);else{if(typeof S!="string"&&typeof S!="number"){T=!1;return}y.push(`${S}%s`)}}),T){let S=[`%c[${r}]%c %s`,`color: ${p}`,"",...y,""];s(...S)}else s(`%c[${r}]`,`color: ${p}`,...h)}},{channel:{value:r},color:{value:(h,...g)=>{let y=[`%c${g.join(" ")}%c%s`,`color: ${h}`,""];return y.toString=()=>g.join(" "),y[yl]=!0,y}},extend:{value:h=>e(h,r)},enabled:{get:()=>d()},logFn:{configurable:!1,get:()=>s,set:h=>{s=h!=null?h:l}},destroy:{value:()=>{Ln.delete(i)}}});return Ln.set(i,f),f}return e(o)}var Pl=console.log.bind(console),wl;Object.defineProperty(vl,"enable",{get:()=>wl,set:o=>{wl=o,$r(jr())}});var yt=vl;yt.colors=Hn;yt.logFn=Pl;var Dl=yt("InfiniteTable"),et=o=>{let e=Dl.extend(o);return e.logFn=console.log.bind(console),e},wo=o=>{let e=Dl.extend(`${o}:error`);return e.logFn=console.error.bind(console),e},Nn=()=>Nn;Nn.extend=()=>Nn;var dt=class{constructor(e){this.debug=Nn,this.error=Nn}};import*as Am from"react";import{useMemo as Dy,useRef as Fm,useEffect as _m,useLayoutEffect as Om,useCallback as My}from"react";var Kn=(o,e,t={debounce:0})=>{var l;let n=(l=t.debounce)!=null?l:0,r=window.ResizeObserver,i=n?St(e,{wait:n}):e,a=new r(s=>{var p;let u=s[0],{width:c,height:d}=u.contentRect;if((p=u.borderBoxSize)!=null&&p[0])d=u.borderBoxSize[0].blockSize,c=u.borderBoxSize[0].inlineSize;else{let f=o.getBoundingClientRect();d=f.height,c=f.width}i({width:c,height:d})});return a.observe(o),()=>{a.disconnect()}},Io=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=Fm({width:0,height:0}),r=i=>{let a;return o.current&&(a=Kn(o.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=n.current;(s.width!==l.width||s.height!==l.height)&&(n.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};_m(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),Om(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};var Vm=wo("CSSVariableWatch"),zm=et("CSSVariableWatch"),Gm={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},Lm=o=>{let e=Ml(0),t=Yt.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);Io(o.ref,t,{earlyAttach:!0}),Yt.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n)return e.current=n,zm(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);Vm(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},xo=o=>{let e=Ml(null);Lm(P(C({},o),{ref:e}));let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return Yt.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Gm},Yt.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};import*as Po from"react";import*as El from"react";var Ur;function kn(){return Ur||(Ur=El.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}import*as Al from"react";var Yr;function vo(){return Yr||(Yr=Al.createContext(void 0))}function un(){let o=kn();return Po.useContext(o).componentState}function me(){let o=kn();return Po.useContext(o)}function ze(){let o=vo();return Po.useContext(o)}import*as qt from"react";import{useCallback as bf,useEffect as ri,useRef as Rf,useState as wf}from"react";import*as Do from"react";function Hm(o){let{height:e,width:t,count:n}=o;return Do.createElement("div",{"data-count":n,"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 Fl=Do.memo(Hm);var _l="mlx2t3";import*as Mo from"react";import{useRef as Km}from"react";import{useEffect as Nm}from"react";var Ol=(o,e)=>{Nm(()=>{let t=o==null?void 0:o.current,n=i=>{let a=i.target;e==null||e({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t==null||t.addEventListener("scroll",n,r),()=>{t==null||t.removeEventListener("scroll",n)}},[e,o==null?void 0:o.current])};var Vl={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},zl={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Gl={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},qr="_1ueijco1",Ll="_1ueijco0 _16lm1iw0";var Hl=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=Vl[`${o}`]:e=J(zl[`${o.horizontal}`],Gl[`${o.vertical}`]),e};var km="InfiniteVirtualScrollContainer";var Nl=Mo.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s}=e,u=t!=null?t:Km(null);return Ol(u,i),Mo.createElement("div",{ref:u,style:s,tabIndex:l,className:J(a,km,Ll,Hl(r))},n)});import*as Lo from"react";import{useEffect as os,useLayoutEffect as Qm,useMemo as ef}from"react";import*as Kl from"react";import{useEffect as Bm,useRef as Wm,useState as jm}from"react";function $m(o){let[e,t]=jm(o.updater.get),n=Wm(null);return Bm(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e!=null?e:null}var Bn=Kl.memo($m);function we(o=!1){let e=null,t=[],n=null,r=(i,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{e=i,n=null;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a==null||a(l)});else{e=i;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a==null||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}import*as ti from"react";function Xr(...o){if(!o.length)return[];let e=new Map;o.forEach(n=>{var r;for(let i=0,a=n.length;i<a;i++){let l=n[i],s=(r=e.get(l))!=null?r:0;e.set(l,s+1)}return e});let t=o.length;return o[0].filter(n=>e.get(n)===t)}var be=xe().requestAnimationFrame||(o=>setTimeout(o,16)),tt=xe().cancelAnimationFrame||(o=>clearTimeout(o));function q(o){return o.slice(4,-1)}var j={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",activeCellRowOffset:"var(--_16hkbkc2)",activeCellRowHeight:"var(--_16hkbkc3)",activeCellOffsetX:"var(--_16hkbkc4)",activeCellOffsetY:"var(--_16hkbkc5)",scrollTopForActiveRow:"var(--_16hkbkc6)",activeCellColWidth:"var(--_16hkbkc7)",activeCellColOffset:"var(--_16hkbkc8)",columnReorderEffectDurationAtIndex:"var(--_16hkbkc9)",columnWidthAtIndex:"var(--_16hkbkca)",columnOffsetAtIndex:"var(--_16hkbkcb)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcc)",columnZIndexAtIndex:"var(--_16hkbkcd)",pinnedStartWidth:"var(--_16hkbkce)",pinnedEndWidth:"var(--_16hkbkcf)",pinnedEndOffset:"var(--_16hkbkcg)",computedVisibleColumnsCount:"var(--_16hkbkch)",baseZIndexForCells:"var(--_16hkbkci)",bodyWidth:"var(--_16hkbkcj)",bodyHeight:"var(--_16hkbkck)",scrollbarWidthHorizontal:"var(--_16hkbkcl)",scrollbarWidthVertical:"var(--_16hkbkcm)",scrollLeft:"var(--_16hkbkcn)",scrollTop:"var(--_16hkbkco)"};function cn(o,e){let t=o;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function kl(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}var nt="Infinite",Ie={rootClassName:nt};var fe={color:{accent:"var(--infinite-accent-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)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidth:"var(--infinite-runtime-total-visible-columns-width)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)"},components:{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:{padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",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)",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)"},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)",selectedBackground:"var(--infinite-row-selected-background)",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)",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)"}}},Bl="column-header-height";var Wl=`.${Ie.rootClassName}`;function Zr(o){return cn(o,Wl)}var jl=q(j.scrollLeft),Um=q(j.scrollTop),$l=q(j.columnWidthAtIndex),Eo=q(j.columnOffsetAtIndex),Ul=q(j.columnReorderEffectDurationAtIndex),Ym=q(j.columnOffsetAtIndexWhileReordering),qm=q(j.columnZIndexAtIndex);function Tt(o,e,t){let n=t?Zr(t):document.querySelector(Wl);Xm(o,e,n)}function Xm(o,e,t){if(t){let n=j[o]?q(j[o]):o;t.style.setProperty(n,`${e}`)}}function dn(o,e){if(e)for(var t in o)e.style.setProperty(j[t]?q(j[t]):t,`${o[t]}`)}function Ao(o,e,t){Tt(`${$l}-${o}`,typeof e=="number"?e+"px":e,t)}function pn(o,e,t){Tt(`${Eo}-${o}`,typeof e=="number"?e+"px":e,t)}function Jr(o,e,t){Tt(`${Eo}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${jl}))`:`${o.computedAbsoluteOffset+e}px`,t)}function Qr(o,e,t){Tt(`${qm}-${o}`,`${e}`,t)}function Wn(o,e,t){Tt(`${Ym}-${o}`,typeof e=="number"?`calc( var(${Eo}-${o}) + ${e}px )`:e,t)}function Fo(o,e,t){Tt(`${Ul}-${o}`,t!=null?t:"",e)}function Yl(o,e){let t=`${Ul}-${o}`;Tt(t,fe.components.Cell.reorderEffectDuration,e)}function _o(o){return`${$l}-${o}`}function ql(o){return`${Eo}-${o}`}function Xl(o,e){dn({[jl]:`${o.scrollLeft}px`,[Um]:`${o.scrollTop}px`},e)}var Ql=Br(Oo());var ei=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},es=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},mn={horizontal:!0,vertical:!0},Jl=(o,e)=>o-e,jn=typeof window!="undefined"?requestAnimationFrame:o=>setTimeout(o,0),$n=class extends dt{constructor(t){let n=`MatrixBrain${t?`:${t}`:""}`;super(n);this.scrolling=!1;this.width=0;this.name="";this.height=0;this.cols=0;this.rows=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;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.update=t=>{let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,u=typeof l=="number",c=typeof s=="number",d=u&&l!==this.width,p=c&&s!==this.height;this.setAvailableSize({width:l,height:s},{skipUpdateRenderCount:!0});let f=typeof n=="number",m=typeof r=="number",h=f&&n!==this.rows,g=m&&r!==this.cols;f&&(this.rows=n),m&&(this.cols=r);let y=i!=null,T=a!=null,S=y&&i!==this.rowHeight,b=T&&a!==this.colWidth;y&&(this.rowHeight=i),T&&(this.colWidth=a);let R=t.rowspan!=null,v=t.colspan!=null,I=R&&t.rowspan!=this.rowspan,w=v&&t.colspan!=this.colspan;I&&(this.rowspan=t.rowspan),w&&(this.colspan=t.colspan);let x=g||b||d||w,M=h||S||p||I;(x||M)&&this.updateRenderCount({horizontal:x,vertical:M})};this.setRowsAndCols=({rows:t,cols:n})=>{let r=t===this.rows,i=n===this.cols;this.rows=t,this.cols=n,this.updateRenderCount({horizontal:!i,vertical:!r})};this.updateRenderCount=(t=mn)=>{this.reset(t),this.doUpdateRenderCount(t)};this.doUpdateRenderCount=(t=mn)=>{(!this.width||!this.height)&&this.setRenderCount({horizontal:0,vertical:0}),this.setRenderCount(this.computeRenderCount(t))};this.setScrolling=t=>{let n=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==n&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let n=0,r=t.length;n<r;n++)t[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,n=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](n,r)};this.setScrollPosition=(t,n)=>{this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(n==null||n(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,n=this.getAvailableSize();t.forEach(r=>{jn(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyRenderRangeChange=()=>{if(this.destroyed)return;let t=this.onRenderRangeChangeFns,n=this.getRenderRange();t.forEach(r=>{jn(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=()=>{if(this.destroyed)return;let t=this.onVerticalRenderRangeChangeFns,n=this.verticalRenderRange;t.forEach(r=>{jn(()=>{this.destroyed||t.has(r)&&r([n.startIndex,n.endIndex])})})};this.notifyHorizontalRenderRangeChange=()=>{if(this.destroyed)return;let t=this.onHorizontalRenderRangeChangeFns,n=this.horizontalRenderRange;t.forEach(r=>{jn(()=>{this.destroyed||t.has(r)&&r([n.startIndex,n.endIndex])})})};this.computeDirectionalRenderCount=(t,n,r,i)=>{let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;if(typeof n=="function"){let s=[];for(let c=0;c<r;c++)s.push(this.getItemSize(c,t));s.sort(Jl);let u=0;for(let c=0;c<r&&(u+=s[c],a++,!(u>l));c++);a+=1}else a=(n?Math.ceil(l/n):0)+1;return a=Math.min(r,a),a};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 n=this.cols-this.fixedColsEnd;n<this.cols;n++)t+=this.getColWidth(n);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=this.getColWidth(c);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let u=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=this.getRowHeight(c);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let u=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=mn)=>{let n=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:n})=>{t===void 0&&(t=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=n===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=n,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:n,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=mn)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,u=t.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(l,c,"vertical");let d=this.rowspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,c])}}}if(r){let l=t.startIndex,s=n.startIndex,u=n.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(c,l,"horizontal");let d=this.colspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([c,p])}}}return a};this.computeRenderRange=(t=mn)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,r=t==="horizontal"?this.cols:this.rows;if(!n)return{startIndex:0,endIndex:0};let i=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,a=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;a+=this.getFixedStartSize(t);let l=this.getItemAt(a,t),s=l+n,u=Math.max(i,r-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return s>u&&(s=u,l=Math.max(i,s-n)),{startIndex:l,endIndex:s}};this.getItemAt=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,n),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,Ql.default)(a,t,Jl);return p>=0?p:~p-1};this.getCellOffset=(t,n)=>({x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")});this.getItemOffsetFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="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],u=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let u=r==="horizontal"?this.colspanParent:this.rowspanParent;u.has(a)||u.set(a,[]);let c=r==="horizontal"?this.colspanValue:this.rowspanValue;c.has(a)||c.set(a,[]);let d=u.get(a),p=c.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,h={rowIndex:t,colIndex:n};for(;f<=m;f++)if(d[f]===void 0){h[r==="horizontal"?"colIndex":"rowIndex"]=f;let g=s(h);d[f]=f,p[f]=g;let y=f;for(;g>1;)y+=1,d[y]=f,p[y]=0,g-=1}}};this.getCellSpan=(t,n,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[a]||1};this.getRowspan=(t,n)=>this.getCellSpan(t,n,"vertical");this.getColspan=(t,n)=>this.getCellSpan(t,n,"horizontal");this.getRowspanParent=(t,n)=>this.getItemSpanParent(t,n,"vertical");this.getColspanParent=(t,n)=>this.getItemSpanParent(t,n,"horizontal");this.getItemSpanParent=(t,n,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[a]};this.getRowHeightWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"vertical");this.getColWidthWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"horizontal");this.getItemSizeWithSpan=(t,n,r,i)=>{let a=i==="horizontal"?n: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,n)=>{let r=n==="horizontal"?this.cols:this.rows,i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,u=Math.min(t,r-1);for(;s<=u;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.getTotalSize=()=>({height:this.getTotalSizeFor("vertical"),width:this.getTotalSizeFor("horizontal")});this.getTotalSizeFor=t=>{let n=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*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u};this.setRenderRange=({horizontal:t,vertical:n,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=ei;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(n=>n!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==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(n=>n!==t)});this.getAvailableSize=()=>({width:this.width,height:this.height});this.destroy=()=>{this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns=new Set,this.onRenderRangeChangeFns=new Set,this.onVerticalRenderRangeChangeFns=new Set,this.onHorizontalRenderRangeChangeFns=new Set)};this.name=n,this.reset()}reset(t=mn){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}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0}setRowAndColumnSizes({rowHeight:t,colWidth:n}){let r=n===this.colWidth,i=t===this.rowHeight;this.rowHeight=t,this.colWidth=n,this.updateRenderCount({horizontal:!r,vertical:!i})}setAvailableSize(t,n){let{width:r,height:i}=t;r=r!=null?r:this.width,i=i!=null?i:this.height;let a=r===this.width,l=i===this.height;a&&l||(this.width=r,this.height=i,this.notifyAvailableSizeChange(),!(n&&n.skipUpdateRenderCount)&&this.updateRenderCount({horizontal:!a,vertical:!l}))}get scrollTopMax(){return this.getTotalSize().height-this.height}get scrollLeftMax(){return this.getTotalSize().width-this.width}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}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:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{jn(()=>{this.destroyed||i.has(a)&&a(r)})})}getItemSizeCacheFor(t,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}};var Vo=class extends dt{constructor(){super("MappedCells");this.getElementFromListForColumn=(t,n)=>{let{elementIndexToCell:r}=this,i=t.length-1;for(let a=i;a>=0;a--){let l=t[a],s=r[l];if(s&&s[1]===n)return a===i?t.pop():(t.splice(a,1),l)}return t.pop()};this.getElementsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,u=[];for(let c=0,d=this.elementIndexToCell.length;c<d;c++){let p=this.elementIndexToCell[c];if(!p)continue;let[f,m]=p,h=f<i,g=f>=l,y=m<a,T=m>=s;(h||g||y||T)&&u.push(c)}return u};this.isCellRendered=(t,n)=>this.cellToElementIndex.has([t,n]);this.isElementRendered=t=>!!this.elementIndexToCell[t];this.getElementsForRowIndex=t=>this.cellToElementIndex.getValuesStartingWith([t]);this.getRenderedNodeAtElement=t=>this.renderedElements[t]||null;this.getRenderedCellAtElement=t=>this.elementIndexToCell[t]||null;this.getRenderedNodeForCell=(t,n)=>{let r=this.cellToElementIndex.get([t,n]);return r!=null&&this.renderedElements[r]||null};this.getElementIndexForCell=(t,n)=>{let r=this.cellToElementIndex.get([t,n]);return r!=null?r:null};this.renderCellAtElement=(t,n,r,i)=>{let a=[t,n],l=this.elementIndexToCell[r];l&&this.cellToElementIndex.delete([l[0],l[1]]),i&&(this.renderedElements[r]=i),this.elementIndexToCell[r]=[t,n],this.cellToElementIndex.set(a,r)};this.discardCell=(t,n)=>{let r=[t,n],i=this.cellToElementIndex.get(r);i!=null&&(this.renderedElements[i]=null,this.elementIndexToCell[i]=null,this.cellToElementIndex.delete(r))};this.discardElement=t=>{let n=this.elementIndexToCell[t];if(n){let r=[n[0],n[1]];return this.renderedElements[t]=null,this.elementIndexToCell[t]=null,this.cellToElementIndex.delete(r),n}return null};this.discardElementsStartingWith=(t,n)=>{let r=null,i=!1;if(t<this.elementIndexToCell.length){for(let a=t,l=this.elementIndexToCell.length;a<l;a++)r=this.discardElement(a),r&&(i=!0),n&&n(a,r);this.elementIndexToCell.length=t,this.renderedElements.length=t}return i};this.init()}init(){this.elementIndexToCell=[],this.cellToElementIndex=new le,this.renderedElements=[]}reset(){this.init()}destroy(){this.elementIndexToCell=[],this.cellToElementIndex.clear(),this.renderedElements=[]}};var zo=class extends dt{constructor(){super("MappedVirtualRows");this.getElementsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i]=n,[a]=r,l=[];for(let s=0,u=this.elementIndexToRowIndex.length;s<u;s++){let c=this.elementIndexToRowIndex[s];if(c==null)continue;let d=c<i,p=c>=a;(d||p)&&l.push(s)}return l};this.isRowRendered=t=>this.rowToElementIndex[t]!=null;this.isElementRendered=t=>this.elementIndexToRowIndex[t]!=null;this.getRenderedNodeAtElement=t=>this.renderedElements[t]||null;this.getRenderedRowAtElement=t=>{let n=this.elementIndexToRowIndex[t];return n!=null?n:null};this.getRenderedNodeForRow=t=>{var r;let n=this.rowToElementIndex[t];return n!=null&&(r=this.renderedElements[n])!=null?r:null};this.getElementIndexForRow=t=>{let n=this.rowToElementIndex[t];return n!=null?n:null};this.renderRowAtElement=(t,n,r)=>{let i=this.elementIndexToRowIndex[n];i!=null&&(this.rowToElementIndex[i]=null),r!==void 0&&(this.renderedElements[n]=r),this.elementIndexToRowIndex[n]=t,this.rowToElementIndex[t]=n};this.discardRow=t=>{let n=this.rowToElementIndex[t];n!=null&&(this.renderedElements[n]=null,this.elementIndexToRowIndex[n]=null,this.rowToElementIndex[t]=null)};this.discardElement=t=>{let n=this.elementIndexToRowIndex[t];return n!=null?(this.renderedElements[t]=null,this.elementIndexToRowIndex[t]=null,this.rowToElementIndex[n]=null,n):null};this.discardElementsStartingWith=(t,n)=>{let r=null,i=!1;if(t<this.elementIndexToRowIndex.length){for(let a=t,l=this.elementIndexToRowIndex.length;a<l;a++)r=this.discardElement(a),r&&(i=!0),n&&n(a,r);this.elementIndexToRowIndex.length=t,this.renderedElements.length=t}return i};this.init()}init(){this.elementIndexToRowIndex=[],this.rowToElementIndex=[],this.renderedElements=[]}reset(){this.init()}destroy(){this.elementIndexToRowIndex=[],this.rowToElementIndex=[],this.renderedElements=[]}};var ts=!0,Go=q(j.y),ns=q(j.scrollTop),Zm=q(j.columnOffsetAtIndex),Jm=q(j.columnOffsetAtIndexWhileReordering),fn=class extends dt{constructor(t){super("ReactHeadlessTableRenderer");this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.itemDOMElements=[];this.itemDOMRefs=[];this.updaters=[];this.detailRowDOMElements=[];this.detailRowDOMRefs=[];this.detailRowUpdaters=[];this.items=[];this.detailItems=[];this.currentHoveredRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(Go,i?`calc( ${r}px + var(${ns}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${Go}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=`${Zm}-${r}`,d=`${Jm}-${r}`;t.style.setProperty(Go,s?`calc( ${a}px + var(${ns}) )`:`${a}px`),t.style.transform=`translate3d(var(${d}, var(${c})), var(${Go}), 0)`,u!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===t)return null;return{start:t,end:n}};this.getScrollPositionForScrollRowIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),{scrollAdjustPosition:a,offset:l=0}=n;if(this.isRowFullyVisible(t)&&!a)return i;let s=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),c=r.getFixedStartRowsHeight(),d=r.getFixedEndRowsHeight(),p=i.scrollTop,f=r.getAvailableSize();if(!f.height)return null;let m=p+f.height;a||(a=s>m-d?"end":s<p+c?"start":"end");let h=i.scrollTop;return a==="center"?h=s-Math.floor((r.getAvailableSize().height-c-d)/2):a==="start"?(l=-l,h+=s-p+l-c):(l+=u,h+=s-m+l+d),P(C({},i),{scrollTop:h})};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),{scrollAdjustPosition:a,offset:l=0}=n;if(this.isColumnFullyVisible(t)&&!a)return i;let s=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),c=r.getFixedStartColsWidth(),d=r.getFixedStartColsWidth(),p=i.scrollLeft,f=r.getAvailableSize();if(!f.width)return null;let m=p+f.width;a||(a=s>m-d?"end":s<p+c?"start":"end");let h=i.scrollLeft;return a==="center"?h=s-Math.floor((r.getAvailableSize().width-c-d)/2):a==="start"?(l=-l,h+=s-p+l-c):(l+=u,h+=s-m+l+d),P(C({},i),{scrollLeft:h})};this.getScrollPositionForScrollCellIntoView=(t,n,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(n,{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,n=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-n);this.isRowVisible=(t,n=10)=>{if(!this.isRowRendered(t))return!1;let{brain:r}=this;if(r.isRowFixed(t))return!0;let{start:[i],end:[a]}=this.brain.getRenderRange(),l=Math.floor((i+a)/2);if(t<i||t>=a)return!1;if(t>=l){let s=r.getItemAt(r.getAvailableSize().height+r.getScrollPosition().scrollTop-n,"vertical");return t<=s}if(t<l){let s=r.getItemAt(r.getScrollPosition().scrollTop+n,"vertical");return t>=s}return!0};this.isRowRendered=t=>this.mappedCells.getElementsForRowIndex(t).length>0;this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n);this.isColumnFullyVisible=(t,n=2)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n);this.isColumnVisible=(t,n=10)=>{if(!this.isColumnRendered(t))return!1;let{brain:r}=this;if(r.isColFixed(t))return!0;let{start:[i,a],end:[l,s]}=r.getRenderRange();if(t<a||t>=s)return!1;let u=Math.floor((a+s)/2);if(t>=u){let c=r.getItemAt(r.getAvailableSize().width+r.getScrollPosition().scrollLeft-n-r.getFixedEndColsWidth(),"horizontal");return t<=c}if(t<u){let c=r.getItemAt(r.getScrollPosition().scrollLeft+n+r.getFixedStartColsWidth(),"horizontal");return t>=c}return!0};this.isCellRendered=(t,n)=>this.isRowRendered(t)&&this.isColumnRendered(n);this.isColumnRendered=t=>{let{start:[n]}=this.brain.getRenderRange();return this.mappedCells.getRenderedNodeForCell(n,t)!==null};this.getExtraSpanCellsForRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.renderRange=(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a})=>{if(this.destroyed)return[];let{start:l,end:s}=t,{mappedCells:u,mappedDetailRows:c}=this,d=this.getFixedRanges(t),p=[t,...d],f=new Map,m=p.map(this.getExtraSpanCellsForRange).flat();m&&m.forEach(([I,w])=>{f.set(`${I}:${w}`,!0)});let h=p.reduce((I,w)=>I+ei(w),0),g=r?p.reduce((I,w)=>I+es(w),0):0;this.itemDOMElements.length>=h&&(u.discardElementsStartingWith(h,I=>{this.updaters[I]&&this.updaters[I].destroy()}),this.itemDOMElements.length=Math.min(this.itemDOMElements.length,h),this.itemDOMRefs.length=Math.min(this.itemDOMRefs.length,h),this.updaters.length=Math.min(this.updaters.length,h),this.items.length=Math.min(this.items.length,h)),r&&this.detailRowDOMElements.length&&this.detailRowDOMElements.length>=g&&(c.discardElementsStartingWith(g,I=>{this.detailRowUpdaters[I]&&this.detailRowUpdaters[I].destroy()}),this.detailRowDOMElements.length=Math.min(this.detailRowDOMElements.length,g),this.detailRowDOMRefs.length=Math.min(this.detailRowDOMRefs.length,g),this.detailRowUpdaters.length=Math.min(this.detailRowUpdaters.length,g),this.detailItems.length=Math.min(this.detailItems.length,g));let y=Xr(...p.map(u.getElementsOutsideRenderRange)),T=r?Xr(...p.map(c.getElementsOutsideRenderRange)):[],S=y.filter(I=>{let w=this.mappedCells.getRenderedCellAtElement(I);return!(w&&f.has(`${w[0]}:${w[1]}`))});this.items.length>h&&(this.items.length=h),r&&this.detailItems.length>g&&(this.detailItems.length=g);for(let I=this.items.length;I<h;I++)this.renderElement(I),S.splice(0,0,I);if(r)for(let I=this.detailItems.length;I<g;I++)this.renderDetailElement(I),T.splice(0,0,I);let b=new Map,R=new Map;p.forEach(I=>{let{start:w,end:x}=I,[M,D]=w,[V,z]=x;for(let F=M;F<V;F++){for(let O=D;O<z;O++){let L=`${F}:${O}`;if(b.has(L))continue;b.set(L,!0);let K=u.isCellRendered(F,O);if(F===M||O===D){let re=this.isCellCovered(F,O);if(re&&f.has(`${re[0]}:${re[1]}`)){let X=u.getElementIndexForCell(F,O);X!=null&&S.push(X);continue}}if(K&&!i)continue;let Z=K?u.getElementIndexForCell(F,O):u.getElementFromListForColumn(S,O);Z!=null&&this.renderCellAtElement(F,O,Z,n)}if(!r||R.has(F))continue;R.set(F,!0);let E=c.isRowRendered(F);if(E&&!i)continue;let A=E?c.getElementIndexForRow(F):T.pop();A!=null&&this.renderDetailRowAtElement(F,A,r)}}),m.forEach(([I,w])=>{if(u.isCellRendered(I,w)){if(i){let M=u.getElementIndexForCell(I,w);this.renderCellAtElement(I,w,M,n)}return}let x=S.pop();x!=null&&this.renderCellAtElement(I,w,x,n)});let v=this.items;return v=[...this.items,...this.detailItems],this.adjustFixedElementsOnScroll(),a&&a(v),v};this.getFixedRanges=t=>{let{fixedRowsStart:n,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:u,end:c}=t,[d,p]=u,[f,m]=c,h=[];if(i&&(n&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&h.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),h.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&h.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),h.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let g={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};h.push(g)}if(r){let g={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};h.push(g)}return h};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),u=this.brain.getRowCount(),c=!1,d=!1,p=!1;if(t<r&&(c=!0,p="start"),i&&!c){let f=u-i;t>=f&&(c=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnter=t=>{this.currentHoveredRow=t,!this.scrolling&&this.addHoverClass(t)};this.addHoverClass=t=>{this.mappedCells.getElementsForRowIndex(t).forEach(n=>{let r=this.itemDOMElements[n];r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.currentHoveredRow!=-1&&this.currentHoveredRow===t&&this.removeHoverClass(t),this.currentHoveredRow=-1,!this.scrolling&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.mappedCells.getElementsForRowIndex(t).forEach(n=>{let r=this.itemDOMElements[n];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 n=()=>{this.currentHoveredRow!=-1&&!this.scrolling&&(this.currentHoveredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};be(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n)=>{if(this.destroyed)return;let r=this.itemDOMElements[t],i=this.mappedCells.getRenderedCellAtElement(t);if(i==null)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:u,y:c}=s;if(r)if(this.updateHoverClassNamesForRow(a),r.dataset.rowIndex=a,r.dataset.colIndex=l,ts){this.setTransform(r,a,l,{x:u,y:c},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let d=n?n.hidden:!!this.isCellCovered(a,l);r.style.zIndex=d?"-1":r.dataset.zIndex||"auto"}else r.style.display="",r.style.left=`${u}px`,r.style.top=`${c}px`};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let n=this.detailRowDOMElements[t],r=this.mappedDetailRows.getRenderedRowAtElement(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;n&&(n.dataset.detailRowIndex=r,ts&&(this.setDetailTransform(n,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0};this.onScrollStop=()=>{this.scrolling=!1,this.currentHoveredRow!=-1&&this.addHoverClass(this.currentHoveredRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{mappedCells:n,brain:r,itemDOMElements:i,detailRowDOMElements:a}=this,l=this.brain.getColCount(),s=this.brain.getRowCount(),{fixedColsStart:u,fixedColsEnd:c,fixedRowsStart:d,fixedRowsEnd:p}=this.brain.getFixedCellInfo();if(a.length&&this.detailRowDOMElements.forEach((F,E)=>{if(!F)return;let A=this.mappedDetailRows.getRenderedRowAtElement(E);if(A!=null){let O=this.brain.getItemOffsetFor(A,"vertical");if(O==null)return;this.setDetailTransform(F,A,{y:O,scrollLeft:t.scrollLeft})}}),!u&&!c&&!d&&!p)return;i[0]&&Xl(t,this.getInfiniteNode(i[0]));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:g}=this.brain.getRenderRange(),[y,T]=h,[S,b]=g;function R(F,E,A){let O=n.getElementIndexForCell(F,E);if(O===null)return;let L=r.getCellOffset(F,E),K=i[O];O!=null&&K&&L&&A(F,E,K,L)}let v=(F,E,A,{x:O,y:L})=>{this.setTransform(A,F,E,{x:O,y:L,scrollLeft:!0},u-E)},I=(F,E,A,O)=>{this.setTransform(A,F,E,{x:O.x,y:O.y,scrollTop:!0},d-F)},w=(F,E,A,{y:O})=>{let L=f[E];this.setTransform(A,F,E,{x:L,y:O,scrollLeft:!0},l-E)},x=(F,E,A,O)=>{this.setTransform(A,F,E,{x:O.x,y:m[F],scrollTop:!0},s-F)},M=(F,E,A,{x:O,y:L})=>{this.setTransform(A,F,E,{x:O,scrollLeft:!0,y:L,scrollTop:!0},1e5)},D=(F,E,A,{x:O})=>{this.setTransform(A,F,E,{x:O,scrollLeft:!0,y:m[F],scrollTop:!0},2e5)},V=(F,E,A,O)=>{this.setTransform(A,F,E,{x:f[E],y:O.y,scrollLeft:!0,scrollTop:!0},3e5)},z=(F,E,A)=>{this.setTransform(A,F,E,{x:f[E],y:m[F],scrollLeft:!0,scrollTop:!0},4e5)};if(u||c)for(let F=y;F<S;F++){for(let E=0;E<u;E++)R(F,E,v);if(c){let E=l-c;for(let A=E;A<l;A++)R(F,A,w)}}if(d||p)for(let F=T;F<b;F++){for(let E=0;E<d;E++)R(E,F,I);if(p){let E=s-p;for(let A=E;A<s;A++)R(A,F,x)}}if(u&&d)for(let F=0;F<d;F++)for(let E=0;E<u;E++)R(F,E,M);if(u&&p){let F=s-p;for(let E=F;E<s;E++)for(let A=0;A<u;A++)R(E,A,D)}if(c&&d){let F=l-c;for(let E=0;E<d;E++)for(let A=F;A<l;A++)R(E,A,V)}if(c&&p){let F=s-p,E=l-c;for(let A=F;A<s;A++)for(let O=E;O<l;O++)R(A,O,z)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null,this.mappedCells=null,this.mappedDetailRows=null)};this.brain=t,this.debugId=t.name,this.mappedCells=new Vo,this.mappedDetailRows=new zo;let n=t.onScroll(this.adjustFixedElementsOnScroll),r=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),be(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),i=t.onScrollStart(this.onScrollStart),a=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{n(),r(),i(),a()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=Zr(t)),this.infiniteNode}renderElement(t){let n=i=>{i&&(this.itemDOMElements[t]=i,i.style.position="absolute",i.style.left="0px",i.style.top="0px",this.updateElementPosition(t))};this.itemDOMRefs[t]=n,this.updaters[t]=we();let r=ti.createElement(Bn,{key:t,name:`${t}`,updater:this.updaters[t]});return this.items[t]=r,r}renderDetailElement(t){let n=i=>{i&&(this.detailRowDOMElements[t]=i,i.style.position="absolute",i.style.left="0px",this.updateDetailElementPosition(t))};this.detailRowDOMRefs[t]=n,this.detailRowUpdaters[t]=we();let r=ti.createElement(Bn,{key:`detail-${t}`,name:`detail-${t}`,updater:this.detailRowUpdaters[t]});return this.detailItems[t]=r,r}renderDetailRowAtElement(t,n,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,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:this.detailRowDOMRefs[n]}),c=this.detailRowUpdaters[n];if(!c){this.error(`Cannot find detail item updater for item ${t} at this time... sorry.`);return}this.mappedDetailRows.renderRowAtElement(t,n,u),c(u),this.updateDetailElementPosition(n)}renderCellAtElement(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),u=this.brain.getRowspan(t,n),c=this.brain.getColspan(t,n),d=u===1?l:this.brain.getRowHeightWithSpan(t,n,u),p=c===1?s:this.brain.getColWidthWithSpan(t,n,c),{row:f,col:m}=this.isCellFixed(t,n),h=!!a,g=i({rowIndex:t,colIndex:n,height:l,width:s,rowspan:u,colspan:c,rowFixed:f,colFixed:m,hidden:h,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnter.bind(null,t),onMouseLeave:this.onMouseLeave.bind(null,t),domRef:this.itemDOMRefs[r]}),y=this.updaters[r];if(!y){this.error(`Cannot find item updater for item ${t},${n} at this time... sorry.`);return}this.mappedCells.renderCellAtElement(t,n,r,g),y(g),this.updateElementPosition(r,{hidden:h,rowspan:u,colspan:c})}reset(){this.itemDOMElements=[],this.itemDOMRefs=[],this.updaters=[],this.items=[],this.mappedCells.reset(),this.mappedDetailRows.reset()}};function tf(o){let e=new fn(o),t=we();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function nf(o){let{brain:e,renderCell:t,renderDetailRow:n}=o,{renderer:r,onRenderUpdater:i}=ef(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:tf(e),[e,o.onRenderUpdater,o.renderer]);return os(()=>{r.cellHoverClassNames=o.cellHoverClassNames||[]},[r,o.cellHoverClassNames]),Qm(()=>{let a=e.getRenderRange();r.renderRange(a,{onRender:i,force:!0,renderCell:t,renderDetailRow:n})},[r,e,t,n,i]),os(()=>e.onRenderRangeChange(l=>{r.renderRange(l,{force:!1,onRender:s=>{let u=i.get();u&&s&&u.length===s.length||i(s)},renderCell:t,renderDetailRow:n})}),[t,n]),Lo.createElement(Bn,{updater:i})}var Ho=Lo.memo(nf);import*as Un from"react";import{useEffect as af,useLayoutEffect as lf,useRef as sf}from"react";import{useCallback as of,useState as rf}from"react";var pt=()=>{let[o,e]=rf(0);return[o,of(()=>{e(t=>t+1)},[e])]};var ni={visible:"nxbq1c2 nxbq1c1 _16lm1iwl _16lm1iw2",hidden:"nxbq1c3 nxbq1c1 _16lm1iwl _16lm1iw2"},No="nxbq1c0 _16lm1iwl _16lm1iw4 _16lm1iw1e _16lm1iw1c _16lm1iw18 _16lm1iwu";var oi={visible:"j26lrx1 j26lrx0 _16lm1iwl _16lm1iw4 _16lm1iw1b _16lm1iw1c _16lm1iw1e",hidden:"j26lrx2 j26lrx0 _16lm1iwl _16lm1iw4 _16lm1iw1b _16lm1iw1c _16lm1iw1e"};var{rootClassName:uf}=Ie,cf=`${uf}-ActiveRowIndicator`,df={[q(j.activeCellOffsetY)]:j.activeCellRowOffset,transform:`translate3d(0px, calc( ${j.activeCellOffsetY} + var(${q(j.scrollTopForActiveRow)}, 0px)), 0px)`,height:j.activeCellRowHeight},pf=o=>{let{brain:e}=o,t=sf(null),n=o.activeRowIndex!=null&&e.getRowCount()>o.activeRowIndex,[r,i]=pt();return lf(()=>{if(o.activeRowIndex==null)return;let a=o.activeRowIndex,l=e.getRowHeight(a),s=e.getItemOffsetFor(a,"vertical"),u=t.current,c={activeCellRowHeight:`${l}px`,activeCellRowOffset:`${s}px`};dn(c,u)},[o.activeRowIndex]),af(()=>{let a=e.onScroll(s=>{dn({scrollTopForActiveRow:`${-s.scrollTop}px`},t.current)}),l=e.onRenderCountChange(i);return()=>{l(),a()}},[e]),Un.createElement("div",{className:No,"data-name":"active-row"},Un.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${cf} ${n?oi.visible:oi.hidden}`,style:n?df:void 0}))},rs=Un.memo(pf);import*as Yn from"react";import{useEffect as mf,useLayoutEffect as ff,useRef as hf}from"react";var{rootClassName:gf}=Ie,Cf=`${gf}-ActiveCellIndicator`,Sf=q(j.columnZIndexAtIndex),yf=(o,e,t,n)=>{if(e==null)return;let r=e[0],i=typeof t=="function"?t(r):t!=null?t:o.getRowHeight(r),a=o.getItemOffsetFor(r,"vertical"),l=n.current;dn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},Tf=o=>{let{brain:e}=o,[t,n]=pt(),r=hf(null),i=o.activeCellIndex!=null&&e.getRowCount()>o.activeCellIndex[0];return ff(()=>{yf(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight]),mf(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),Yn.createElement("div",{className:No,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${Sf}-${o.activeCellIndex[1]})`}:void 0},Yn.createElement("div",{"data-name":"active-cell-indicator",className:`${Cf} ${i?ni.visible:ni.hidden}`}))},is=Yn.memo(Tf);function Ko(o,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&o.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),o.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 If=J(_l,qr);function as(o){let y=o,{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d}=y,p=At(y,["brain","scrollerDOMRef","scrollStopDelay","renderCell","renderDetailRow","activeCellRowHeight","cellHoverClassNames","renderer","activeRowIndex","activeCellIndex","onRenderUpdater"]),f=Rf(null),[m,h]=wf({width:0,height:0});ri(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),ri(()=>{var R;let T=(R=f.current)==null?void 0:R.parentNode;return T?Kn(T,()=>{let v={height:T.clientHeight,width:T.clientWidth};e.update(v)},{debounce:50}):void 0},[]);let g=bf(T=>{e.setScrollPosition(T,S=>{f.current.style.transform=`translate3d(${-S.scrollLeft}px, ${-S.scrollTop}px, 0px)`})},[e]);return ri(()=>{let T=e.onRenderCountChange(()=>{h(e.getTotalSize())});return h(e.getTotalSize()),T},[e]),qt.createElement(Nl,P(C({onContainerScroll:g},p),{ref:t}),qt.createElement("div",{ref:f,className:If,"data-name":"scroll-transform-target"},qt.createElement(Ho,{renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l}),qt.createElement(is,{brain:e,rowHeight:a,activeCellIndex:c})),qt.createElement(rs,{brain:e,activeRowIndex:u}),qt.createElement(Fl,{width:m.width,height:m.height}))}import*as hn from"react";import{useReducer as Af,createContext as Ff,useMemo as si,useEffect as _f,useState as ss,useRef as Of,useLayoutEffect as Vf}from"react";function ii(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(u,c){return t.add(c),u[c]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var ai=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function qn(o){return o!==void 0}function _t(o,e){let t=e[o];return qn(t)}import{useCallback as xf,useEffect as vf,useRef as li}from"react";var ls=o=>{let e=xf(o,[]),t=li(!1),n=li(!1),r=li(),[i,a]=pt();t.current&&(n.current=!0),vf(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};import{useCallback as Pf,useRef as Df}from"react";function Oe(o){let e=Df(o);return e.current=o,Pf(()=>e.current,[])}import{useRef as Mf,useLayoutEffect as Ef}from"react";var ko=(o,e)=>{let t=Mf(e===void 0?o:e);return Ef(()=>{t.current=o}),t.current};var zf=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)},Gf=et("rerender"),ui;function us(){return ui||(ui=Ff(null))}function Lf(o,e,t,n,r,i,a){let l=e();return Object.keys(l).reduce((s,u)=>{let c=u;return Object.defineProperty(s,u,{set:p=>{let f=t(),m=e(),h=m[c],g=!0;if(i&&typeof i[c]=="function"&&i[c](p,{actions:s,state:m})===!1&&(g=!1),g){let S=[p],b=`on${ai(u)}Change`;if(a&&a[c]){let R=a[c](p,m);b=R.callbackName||b,S=R.callbackParams}zf(f,b,S)}let y=n[c];typeof y=="function"&&(p=y(p));let T=!!(r!=null&&r[c]);_t(u,f)&&!T||o({payload:{updatedProps:null,mappedState:{[u]:p}}})}}),s},{})}function Hf(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=_t(r,e)?e[r]:e[`default${ai(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function bt(o){return hn.memo(function(t){var R,v;let[n]=ss(()=>o.initSetupState?o.initSetupState(t):{}),r=Of(new Set),i=si(()=>o.forwardProps?o.forwardProps(n):{},[n]),a=(v=(R=o.getParentState)==null?void 0:R.call(o))!=null?v:null,l=Oe(a);function s(){let I={};i&&(I=Hf(i,t,n));let w=C(C({},n),I);if(o.mapPropsToState){let{fn:x,propertyReads:M}=ii(o.mapPropsToState,{getProxyTargetFromArgs:V=>V.props,putProxyToArgs:(V,z)=>[P(C({},z),{props:V})]}),D=x({props:t,state:w,oldState:null,parentState:a});return r.current=new Set([...r.current,...M]),C(C({},w),D)}return w}let[u]=ss(s),c=Oe(t),d=(I,w)=>{var F;if(w.type==="REPLACE_STATE")return w.payload;let x=(F=l==null?void 0:l())!=null?F:null,M=w.payload.mappedState,D=w.payload.updatedPropsToState,V=Object.assign({},I);if(M&&Object.assign(V,M),o.mapPropsToState){let{fn:E,propertyReads:A}=ii(o.mapPropsToState,{getProxyTargetFromArgs:L=>L.props,putProxyToArgs:(L,K)=>[P(C({},K),{props:L})]}),O=E({props:c(),state:V,oldState:I,parentState:x});r.current=new Set([...r.current,...A]),Object.assign(V,O)}return w.type==="ASSIGN_STATE"&&Object.assign(V,w.payload),o.concludeReducer?o.concludeReducer({previousState:I,state:V,updatedProps:D,parentState:x}):V},[p,f]=Af(d,u),m=Oe(p),{allowedControlledPropOverrides:h}=o,g=si(()=>Lf(f,m,c,i,h,o.interceptActions,o.mappedCallbacks),[f,i,h]),y=us(),T=si(()=>({componentState:p,componentActions:g,getComponentState:m,replaceState:I=>{f({type:"REPLACE_STATE",payload:I})},assignState:I=>{f({type:"ASSIGN_STATE",payload:I})}}),[p,g,m]),S=ko(t);return(o.layoutEffect?Vf:_f)(()=>{let I=t,w={},x=0,M={},D=0,V={},z=0;if(new Set([...Object.keys(I),...Object.keys(S)]).forEach(A=>{let O=A,L=S[O],K=I[O];if(O!=="children"&&L!==K&&(V[O]={newValue:K,oldValue:L},z++,_t(O,t)||_t(O,S)))if(i.hasOwnProperty(A)){let Z=K,re=i[A];typeof re=="function"&&(Z=re(K)),p[O]!==Z&&(w[O]=Z,x++)}else r.current.has(A)&&(M[O]=I[O],D++)}),D>0||x>0){if(Gf("Triggered by new values for the following props",...Object.keys(w!=null?w:{}),...Object.keys(M!=null?M:{})),f({payload:{mappedState:x?w:null,updatedPropsToState:D?M:null}}),o.onPropChange){for(var E in V)if(V.hasOwnProperty(E)){let{newValue:O,oldValue:L}=V[E];o.onPropChange({name:E,newValue:O,oldValue:L},t,g,p)}}o.onPropsChange&&z&&o.onPropsChange(V,t,g,p)}}),ls(()=>()=>{var I;(I=o.cleanup)==null||I.call(o,m())}),hn.createElement(y.Provider,{value:T},t.children)})}function ve(){let o=us();return hn.useContext(o)}import*as Rs from"react";var Bo=()=>Ie;var cs="_16lm1iw2 _16lm1iw1c _16lm1iw1e _16lm1iw1j _16lm1iw1h",ds={center:"_16lm1iw1q",stretch:"_16lm1iw1r"};var mt="_16lm1iw23 _16lm1iw24 _16lm1iw1x",ps={pointer:"_16lm1iwi",default:"_16lm1iwj",colResize:"_16lm1iwk"},gn={flex:"_16lm1iwz",contents:"_16lm1iw10",none:"_16lm1iw11",block:"_16lm1iw12",grid:"_16lm1iw13",inlineBlock:"_16lm1iw14",inlineFlex:"_16lm1iw15",inlineGrid:"_16lm1iw16"};var Wo={1:"_16lm1iwm",none:"_16lm1iwn"},Xn={column:"_16lm1iw1m",columnReverse:"_16lm1iw1n",row:"_16lm1iw1o",rowReverse:"_16lm1iw1p"};var ms={center:"_16lm1iw1s",spaceBetween:"_16lm1iw1t",spaceAround:"_16lm1iw1u",start:"_16lm1iw1v",end:"_16lm1iw1w"},fs={0:"_16lm1iw1e","100%":"_16lm1iw1f",auto:"_16lm1iw1g"};var hs={none:"_16lm1iwd"},gs={hidden:"_16lm1iw1x",auto:"_16lm1iw1y",visible:"_16lm1iw1z"};var Zn={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Cs={0:"_16lm1iw1c","100%":"_16lm1iw1d"};var Ss="_16lm1iwe",ys={none:"_16lm1iw17"};var Ts={visible:"_16lm1iw20",hidden:"_16lm1iw21"};var bs={1:"_16lm1iwo",10:"_16lm1iwp",100:"_16lm1iwq",1e3:"_16lm1iwr",1e4:"_16lm1iws",1e5:"_16lm1iwt",1e6:"_16lm1iwu",1e7:"_16lm1iwv","1k":"_16lm1iww","10k":"_16lm1iwx","100k":"_16lm1iwy"};function ws(o){let{rootClassName:e}=Bo();return Rs.createElement("div",P(C({},o),{className:J(`${e}Footer`,Zn.relative,gn.flex,Xn.row,o.className)}))}import*as he from"react";import{useCallback as Yh,useContext as qh,useEffect as Xh,useRef as Zh}from"react";import{createPortal as Jh}from"react-dom";function jo(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}import*as Is from"react";var Me=o=>{var n;let e=(n=o.size)!=null?n:"var(--infinite-icon-size)",t=C({flex:"none",width:e,height:e,fill:"currentColor"},o.style);return Is.createElement("svg",P(C({viewBox:"0 0 24 24"},o),{style:t}),o.children)};import*as ci from"react";var xs=o=>ci.createElement(Me,C({},o),ci.createElement("path",{d:"M5,4V7H10.5V19H13.5V7H19V4H5Z"}));import*as di from"react";var vs=o=>di.createElement(Me,C({},o),di.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 pi from"react";var mi=o=>pi.createElement(Me,C({},o),pi.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));import*as fi from"react";var Ps=o=>fi.createElement(Me,C({},o),fi.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 hi from"react";var Ds=o=>hi.createElement(Me,C({},o),hi.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));import*as gi from"react";var Ms=o=>gi.createElement(Me,C({},o),gi.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 Ci from"react";var Es=o=>Ci.createElement(Me,C({},o),Ci.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));import*as Si from"react";var As=o=>Si.createElement(Me,C({},o),Si.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));import*as yi from"react";var Fs=o=>yi.createElement(Me,C({},o),yi.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 Mi from"react";import*as He from"react";import{useEffect as rh,useState as uu}from"react";import{useContext as Kf}from"react";import{createContext as Nf}from"react";var Ti;function Cn(){return Ti||(Ti=Nf(null))}var ne=()=>{let o=Cn();return Kf(o)};import{useContext as kf}from"react";var _s=()=>{let o=Cn(),{state:e}=kf(o);return e};import*as Sn from"react";import{useEffect as Uf,useLayoutEffect as Yf,useState as eu}from"react";function Bf(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var n=t.call(o,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function Wf(o){var e=Bf(o,"string");return typeof e=="symbol"?e:String(e)}function jf(o,e,t){return e=Wf(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Os(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function Vs(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Os(Object(t),!0).forEach(function(n){jf(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Os(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function zs(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var $f=(o,e,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=e[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},Se=o=>{var e=t=>{var n=o.defaultClassName,r=Vs(Vs({},o.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:o.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=o.variantClassNames[i][s];u&&(n+=" "+u)}}for(var[c,d]of o.compoundVariants)$f(c,r,o.defaultVariants)&&(n+=" "+d);return n};return e.variants=()=>Object.keys(o.variantClassNames),e.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return zs(o.variantClassNames,t=>zs(t,n=>n.split(" ")[0]))}},e};var Gs="_1eexc2a5 _16lm1iwz _16lm1iw1o _16lm1iw1q _16lm1iw2 _16lm1iw22 _16lm1iw23 _16lm1iw17";var Ls=Se({defaultClassName:"_12zfob120 _16lm1iw19 _16lm1iw1b _16lm1iwz _16lm1iw1o _16lm1iw1q _16lm1iw1v",variantClassNames:{filtered:{false:"_12zfob121",true:"_12zfob122"},verticalAlign:{start:"_12zfob123",end:"_12zfob124",center:"_12zfob125"},align:{start:"_12zfob126",end:"_12zfob127",center:"_12zfob128"}},defaultVariants:{},compoundVariants:[]}),Hs="_12zfob1n _16lm1iw23 _16lm1iw24 _16lm1iw1x",Ns=Se({defaultClassName:"_12zfob1o _16lm1iw12",variantClassNames:{rowActive:{false:"_12zfob1p",true:"_12zfob1q"},cellSelected:{false:"_12zfob1r",true:"_12zfob1s"},rowSelected:{false:"_12zfob1t",true:"_12zfob1u",null:"_12zfob1v"},firstRow:{false:"_12zfob1w",true:"_12zfob1x"},groupRow:{false:"_12zfob1y",true:"_12zfob1z"},groupCell:{false:"_12zfob110",true:"_12zfob111"},align:{start:"_12zfob112",end:"_12zfob113",center:"_12zfob114"},verticalAlign:{start:"_12zfob115",end:"_12zfob116",center:"_12zfob117"},zebra:{false:"_12zfob118",even:"_12zfob119",odd:"_12zfob11a"},dragging:{true:"_12zfob11b",false:"_12zfob11c"},first:{true:"_12zfob11d",false:"_12zfob11e"},last:{true:"_12zfob11f",false:"_12zfob11g"},groupByField:{true:"_12zfob11h",false:"_12zfob11i"},firstInCategory:{true:"_12zfob11j",false:"_12zfob11k"},lastInCategory:{true:"_12zfob11l",false:"_12zfob11m"},pinned:{start:"_12zfob11n",end:"_12zfob11o",false:"_12zfob11p"},filtered:{true:"_12zfob11q",false:"_12zfob11r"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob11s"],[{pinned:"end",firstInCategory:!0},"_12zfob11t"],[{pinned:!1,lastInCategory:!0},"_12zfob11u"]]}),Ks=Se({defaultClassName:"_12zfob19 _16lm1iw12 _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1a",end:"_12zfob1b",false:"_12zfob1c"},firstInCategory:{true:"_12zfob1d",false:"_12zfob1e"},lastInCategory:{true:"_12zfob1f",false:"_12zfob1g"},overflow:{true:"_12zfob1h",false:"_12zfob1i"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1j"],[{pinned:"start",firstInCategory:!0},"_12zfob1k"],[{overflow:!0,pinned:"end"},"_12zfob1l"],[{pinned:"end",lastInCategory:!0},"_12zfob1m"]]}),ks="_12zfob12i _16lm1iw1b _16lm1iw19";var Bs="_12zfob17",Ws="_12zfob12e _16lm1iwz _16lm1iw1o _16lm1iw1q _16lm1iw1",js=Se({defaultClassName:"_12zfob12f _16lm1iw1 _16lm1iw1c",variantClassNames:{disabled:{true:"_12zfob12g",false:"_12zfob12h"}},defaultVariants:{},compoundVariants:[]}),bi=Se({defaultClassName:"_12zfob12b _16lm1iwz _16lm1iw1o _16lm1iw1r _16lm1iw1",variantClassNames:{active:{true:"_12zfob12c",false:"_12zfob12d"}},defaultVariants:{},compoundVariants:[]}),$s="_12zfob12a _16lm1iwz _16lm1iw1o _16lm1iw1q",Us=Se({defaultClassName:"_12zfob11v _16lm1iw1 _16lm1iwz _16lm1iw1m _16lm1iw1u _16lm1iw21",variantClassNames:{menuVisible:{true:"_12zfob11w"},reserveSpaceWhenHidden:{true:"_12zfob11x",false:"_12zfob11y"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob11z"]]}),Ys="_12zfob18 _16lm1iw2",qs="_16lm1iw1",Xs="_12zfob16",Zs=Se({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Js="_12zfob129 _16lm1iw1x _16lm1iw1 _16lm1iwz _16lm1iw1o";var Ue="InfiniteTableIcon";var Qs="_6aunoi0 _16lm1iwz _16lm1iw1m _16lm1iw1 _16lm1iw1u _16lm1iw1q";var qf={transition:"width 0.25s, opacity 0.25s"};function yn(o){var h;let[e,t]=eu(!0),[n,r]=eu(0),{lineWidth:i=1,style:a,className:l,index:s}=o,u=s!=null&&s>0,c=(h=o.size)!=null?h:16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f=P(C(P(C({},qf),{borderTop:`${i}px solid currentColor`}),o.lineStyle),{opacity:n});if(Uf(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),Yf(()=>{t(!0)},[]),!e)return null;let m={};return Sn.createElement("div",{"data-name":"filter-icon",style:P(C({},a),{width:c}),className:J(l,Ue,Qs,`${Ue}-sort`)},u?Sn.createElement("div",{"data-name":"index",style:m,className:Bs},s):null,Sn.createElement("div",{style:C({width:p[0]},f)}),Sn.createElement("div",{style:C({width:p[1]},f)}),Sn.createElement("div",{style:C({width:p[2]},f)}))}var Ri=o=>{let{availableSize:e,items:t,minSize:n,maxSize:r}=o;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],u=[];t.forEach((I,w)=>{var V,z,F,E,A;let x=(z=(V=I.maxSize)!=null?V:r)!=null?z:void 0,M=(E=(F=I.minSize)!=null?F:n)!=null?E:void 0;s.push(M),u.push(x),I.size!=null&&(x!=null&&I.size>x&&(I.size=x),M!=null&&I.size<M&&(I.size=M));let D=I.flex==0?null:I.flex;if(I.size==null&&D==null)throw`Items must specify either a size or a flex property. Item at index ${w} doesn't have either of those.`;D!=null&&(l+=1),a+=D!=null?D:0,i+=(A=I.size)!=null?A:0});let c=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((I,w)=>{var x,M,D,V;if(I.flex!=null){let z=d*I.flex,F=(M=(x=I.maxSize)!=null?x:r)!=null?M:void 0,E=(V=(D=I.minSize)!=null?D:n)!=null?V:void 0,A=!1,O=0;F!=null&&z>F&&(p[w]=!0,A=!0,O=F),E!=null&&z<E&&(f[w]=!0,A=!0,O=E),A&&(m+=1,l-=1,a-=I.flex,c-=O)}}),m&&(d=c/a);let h=[],g=0,y=c,T=a,S=0,b=0,R=[];return{items:t.map((I,w)=>{var O,L,K,Z,re;let x=C({},I),M=(L=(O=I.maxSize)!=null?O:r)!=null?L:void 0,D=(Z=(K=I.minSize)!=null?K:n)!=null?Z:void 0,V=0,z=p[w],F=f[w],E=z||F,A=(re=I.size)!=null?re:0;if(I.flex!=null){if(E)F&&(V=D),z&&(V=M);else{g+=1;let X=ee=>(M!=null&&ee>M&&(ee=M),D!=null&&ee<D&&(ee=D),ee);g===l?V=X(y):(V=X(Math.round(I.flex*d)),b+=V,y=c-b,T-=I.flex,d=y/T)}A=V,x.flexSize=V}return h.push(V),R.push(A),x.computedSize=A,S+=A,x}),flexSizes:h,minSizes:s,maxSizes:u,computedSizes:R,remainingSize:Math.round(e-S)}};function $o(o,e,t,n){return e!=null&&o<=e?{value:e,clamped:"min",diff:(o-e)*n}:t!=null&&o>=t?{value:t,clamped:"max",diff:(t-o)*n}:{value:o,clamped:!1,diff:0}}var wi=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((M,D)=>(M[D]=C({},o.columnSizing[D]),M),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[i],s=o.items[a],u=l.id,c=s==null?void 0:s.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",h=s==null?void 0:s.computedWidth,g=s==null?void 0:s.computedMinWidth,y=s==null?void 0:s.computedMaxWidth,T=s!=null&&s.computedFlex?"flex":"width",S=!1,b=!1,R=r>0?1:-1,{value:v,clamped:I,diff:w}=$o(d+r,p,f,R);if(o.shareSpaceOnResize){if(s==null)return n[u]=P(C({},n[u]),{[m]:v}),b=I==="min",S=I==="max",{adjustedDiff:v-d,reservedWidth:t,columnSizing:n,minReached:b,maxReached:S,constrained:b||S};let{value:M,clamped:D,diff:V}=$o(h-r,g,y,R);if(I&&D&&(Math.abs(w)>Math.abs(V)?D=!1:I=!1),!(!I&&!D)){if(I){let z=$o(h-r-w,g,y,R);M=z.value,D=z.clamped,V=z.diff}else if(D){let z=$o(d+r+V,p,f,R);v=z.value,I=z.clamped,w=z.diff}}n[u]=P(C({},n[u]),{[m]:v}),n[c]=P(C({},n[c]),{[T]:M}),b=I==="min"||D==="min",S=I==="max"||D==="max"}else n[u]=P(C({},n[u]),{[m]:v}),b=I==="min",S=I==="max";let x=v-d;return{adjustedDiff:x,reservedWidth:o.shareSpaceOnResize?t:t-x,columnSizing:n,minReached:b,maxReached:S,constrained:b||S}};function tu(o,e){return o+e}function Xf(o){return Object.keys(o).reduce((t,n)=>(t[n]=C({},o[n]),t),{})}var nu=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((y,T)=>(y[T]=C({},o.columnSizing[T]),y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((y,T)=>o.dragHandlePositionAfter-T).reverse(),a=i.map(y=>o.items[y]),l=a.map(y=>y.computedWidth),s=a.map(y=>y.computedFlex?"flex":"width"),u=0,{computedSizes:c}=Ri({items:a.map(y=>(y.resizable===!1&&(u+=y.computedWidth),{maxSize:y.computedMaxWidth,minSize:y.computedMinWidth,flex:y.resizable?y.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(tu,0)+r-u,0)}),d=a.map((y,T)=>c[T]-y.computedWidth),p=!0,f=!0,m=!0,h=[];d.forEach((y,T)=>{let S=a[T];if(!S.resizable){h.push(0);return}let b=s[T],R=l[T],v=Xf(n),{maxReached:I,minReached:w,constrained:x,adjustedDiff:M}=wi({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[T],shareSpaceOnResize:!1,items:o.items,columnSizing:v});n[S.id]=P(C({},v[S.id]),{[b]:R+M}),h.push(M),I||(f=!1),w||(p=!1),x||(m=!1)});let g=h.reduce(tu,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:h,adjustedDiff:g,columnSizing:n,reservedWidth:t-g}};var Uo;function Xt(){var n,r;if(Uo!=null)return Uo;let o=(n=xe().document)!=null?n:null;if(!o)return 0;let e=o.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",o.body.appendChild(e);let t=o.createElement("div");return e.appendChild(t),Uo=e.offsetWidth-t.offsetWidth,(r=e.parentNode)==null||r.removeChild(e),Uo}var ou=["start",void 0,"end"],ru=(o,e)=>(e&&Object.keys(e).length>0&&o.sort((t,n)=>{let r=e[t],i=e[n];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:ou.indexOf(r)-ou.indexOf(i)}),o);function iu(o,e,...t){let n=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&o(r[i],i)&&(n[i]=r[i])}),n}function Ii(o,...e){return iu(t=>t!=null,o,...e)}function au(o,e,...t){return iu((n,r)=>!(r in o),e,...t)}var Yo=Object.freeze({}),Zf={string:Yo,number:{}};function xi(o,e){let t=e.default||Yo;return o.type===void 0?t:o.type===null?Yo:typeof o.type=="string"?e[o.type]||Zf[o.type]||Yo:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var qo=!0,Jf=!0,Qf=!0,eh="string",Tn="unknown",th=wo("getComputedVisibleColumns"),nh=(o,e,t)=>o[t]!==!1,vi=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1},lu=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:u,pinnedEndMaxWidth:c,filterValue:d,sortable:p,sortInfo:f,multiSort:m,filterTypes:h=Zt,viewportReservedWidth:g,resizableColumns:y,draggableColumns:T,columnOrder:S,columnPinning:b,editable:R,columnDefaultEditable:v,columnDefaultFilterable:I,columnDefaultSortable:w,columnSizing:x,columnTypes:M,columnVisibility:D,columnVisibilityAssumeVisible:V})=>{let z=0,F=(d||[]).reduce((N,U)=>{let{id:ae,field:ue}=U;return ue&&(N[ue]=U),ae&&(N[ae]=U),N},{}),E=ru(S===!0?Object.keys(o):S,b),A=E.filter(N=>o[N]?nh(D,V,N):(th(`Column with id "${N}" specified in columnOrder array cannot be found in the columns map.`),!1)),O=new Map,L=A.map((N,U)=>{let ae=o[N];return O.set(N,U),ae}),K=(f!=null?f:[]).reduce((N,U,ae)=>(U.id?N[U.id]={sortInfo:U,index:ae}:U.field&&(N[U.field]={sortInfo:U,index:ae}),N),{});function Z(N){var Fe,Je,st,ut,Ct,Et;let U=o[N],ae=xi(U,M),ue={minWidth:ae==null?void 0:ae.minWidth,maxWidth:ae==null?void 0:ae.maxWidth,width:ae==null?void 0:ae.defaultWidth,flex:ae==null?void 0:ae.defaultFlex},Ge=Ii({width:U==null?void 0:U.defaultWidth,flex:U==null?void 0:U.defaultFlex,minWidth:U==null?void 0:U.minWidth,maxWidth:U==null?void 0:U.maxWidth},x[N]);Ge.width!=null&&delete ue.flex,Ge.flex!=null&&delete ue.width,Ge=Ii(ue,Ge);let oe=(Fe=Ge.flex)!=null?Fe:void 0,Be=(st=(Je=Ge.minWidth)!=null?Je:U==null?void 0:U.minWidth)!=null?st:t,We=(Ct=(ut=Ge.maxWidth)!=null?ut:U==null?void 0:U.maxWidth)!=null?Ct:n,Te=oe!=null?void 0:(Et=Ge.width)!=null?Et:i?void 0:r;return!Te&&oe==null&&(i?oe=i:Te=Be),{size:Te,flex:oe,minSize:Be,maxSize:We}}let re=Ri({availableSize:Math.max(e.width-(g!=null?g:0)-(a!=null?a:Xt()),0),maxSize:n,minSize:t,items:A.map(Z)}),{computedSizes:X,flexSizes:ee,minSizes:H,maxSizes:B}=re,$=[],_=[],k=[],G=[];G.length=A.length;let W=new Map,Q=new Map,Y=0,te=0,ge=0,ye=null,ke=[],je=0,at=0,Ce=0;L.forEach((N,U)=>{let ae=A[U],ue=X[U],Ge=ke[U]=vi(ae,b);Ge==="start"?je+=ue:Ge==="end"?Ce+=ue:at+=ue});let De=e.width-Ce,$e=[],de=new Map;A.forEach((N,U)=>{let ae=L[U];de.set(N,ae)});let Bt=[];Object.keys(o).forEach(N=>{let U=o[N];Bt.push(N),de.has(N)||de.set(N,U)});let lt=new Map;de.forEach((N,U)=>{var Na,Ka,ka,Ba,Wa,ja,$a,Ua,Ya,qa,Xa,Za,Ja,Qa,el,tl,nl,ol,rl,il,al,ll,sl,ul,cl,dl,pl,ml,fl;let ae=O.get(U);ae==null&&(ae=-1);let ue=ae!=-1,Ge=A[ae+1],oe=xi(N,M),Be=ae,We=K[U]?K[U]:N.field&&(Na=K[N.field])!=null?Na:null,Te=(Ka=We==null?void 0:We.sortInfo)!=null?Ka:null,Fe=!!Te,Je=Fe&&Te.dir===1,st=Fe&&!Je,ut=(ka=We==null?void 0:We.index)!=null?ka:-1,Ct=ue?{}:Z(U),Et=ue?X[ae]:Ct.size||0,ie=ue&&ee[ae]||null,Qe=ue?H[ae]||0:Ct.minSize||0,zr=ue?B[ae]||1e4:Ct.maxSize||1e4,Le=ue?vi(U,b):!1,Gn=ue?ae===A.length-1:!1,ct=Be,Ut=ue?Le==="start"?te:Le==="end"?ge:z-te:0;Le=="start"?ct=ue?Be:-1:Le==="end"?ct=ue?Be-($.length+k.length):-1:ct=ue?Be-$.length:-1;let sm=ue?Le==="start"||Le===!1?z:De+ge:-1,um=ue?Le!==ye:!1,cm=ue?Gn||Le!==vi(Ge,b):!1,Va=(Wa=(Ba=N.cssEllipsis)!=null?Ba:oe.cssEllipsis)!=null?Wa:l,dm=(qa=(Ya=(Ua=($a=(ja=N.headerCssEllipsis)!=null?ja:oe.cssEllipsis)!=null?$a:N.cssEllipsis)!=null?Ua:oe.headerCssEllipsis)!=null?Ya:s)!=null?qa:Va,Co=ue&&(F[U]||N.field||N.groupByForColumn)&&(F[U]||F[N.field||N.groupByForColumn])||null,pm=(Ja=(Za=(Xa=N.defaultFilterable)!=null?Xa:oe.defaultFilterable)!=null?Za:I)!=null?Ja:!0,mm=(tl=(el=(Qa=R!=null?R:N.defaultEditable)!=null?Qa:oe.defaultEditable)!=null?el:v)!=null?tl:!1,Gr=N.dataType||oe.dataType||(Array.isArray(N.type)?N.type[0]:N.type)||eh,fm=N.sortType||oe.sortType||Gr,za=N.filterType||oe.filterType||Gr,Ga=!1;if(Co!=null&&!Co.disabled){let Hr=h[za];Hr&&(!Hr.emptyValues||!Hr.emptyValues.includes(Co.filter.value))&&(Ga=!0)}let La=(nl=N.field)!=null?nl:oe.field,Ha=(ol=N.valueGetter)!=null?ol:oe.valueGetter,Lr=(rl=N.defaultSortable)!=null?rl:oe.defaultSortable;Lr==null&&!N.groupByForColumn&&La==null&&Ha==null&&(Lr=!1);let hm=(al=(il=p!=null?p:Lr)!=null?il:w)!=null?al:qo,gm=(ul=(sl=(ll=N.resizable)!=null?ll:oe.resizable)!=null?sl:y)!=null?ul:Jf,Ve=P(C({colType:oe,align:oe.align,headerAlign:oe.headerAlign,computedVisible:ue,verticalAlign:oe.verticalAlign,defaultHiddenWhenGroupedBy:oe.defaultHiddenWhenGroupedBy,valueGetter:Ha,valueFormatter:oe.valueFormatter,renderValue:oe.renderValue,render:oe.render,style:oe.style,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:La},N),{components:C(C({},oe.components),N.components),computedResizable:gm,computedMinWidth:Qe,computedMaxWidth:zr,computedFlex:ie,computedDataType:Gr,computedEditable:mm,computedSortType:fm,computedFilterType:za,cssEllipsis:Va,headerCssEllipsis:dm,computedFilterValue:Co,computedFiltered:Ga,computedFilterable:pm,computedWidth:Et,computedAbsoluteOffset:sm,computedPinningOffset:Ut,computedVisibleIndexInCategory:ct,computedOffset:z,computedSortable:hm,computedSortInfo:Te,computedSortIndex:ut,computedMultiSort:m,computedSorted:Fe,computedSortedAsc:Je,computedSortedDesc:st,computedVisibleIndex:Be,computedPinned:Le,computedDraggable:(dl=(cl=N.draggable)!=null?cl:T)!=null?dl:Qf,computedFirstInCategory:um,computedLastInCategory:cm,computedFirst:ae===0,computedLast:Gn,id:U,header:(fl=(ml=(pl=N.header)!=null?pl:oe.header)!=null?ml:N.name)!=null?fl:N.field});ue&&(z+=Et,W.set(Ve.id,Ve),G[ae]=Ve,Le==="start"&&($.push(Ve),te+=Ve.computedWidth),Le==="end"&&(_.push(Ve),ge+=Ve.computedWidth),Le||(k.push(Ve),Y+=Ve.computedWidth),ye=Le),Ve.groupByForColumn&&(Ve.computedSortType=N.sortType||oe.sortType||Tn,$e.push(Ve)),Q.set(Ve.id,Ve),Ve.field&&!Ve.groupByForColumn&&!lt.has(Ve.field)&&lt.set(Ve.field,Ve)}),$e.forEach(N=>{N.computedSortable=su(N,{fieldsToColumn:lt,sortable:p,columnDefaultSortable:w})});let Mt=new Map;Bt.forEach(N=>{let U=Q.get(N);U&&Mt.set(N,U)}),Q.forEach(N=>{Mt.has(N.id)||Mt.set(N.id,N)});let Wt=u!=null?Math.min(u,te):te,jt=c!=null?Math.min(c,ge):ge;return{computedRemainingSpace:e.width-(je+Ce+at),computedPinnedStartColumnsWidth:te,computedPinnedEndColumnsWidth:ge,computedUnpinnedColumnsWidth:Y,computedColumnOrder:E,computedPinnedStartColumns:$,computedPinnedEndColumns:_,computedUnpinnedOffset:te,computedPinnedEndOffset:te+Y,computedUnpinnedColumns:k,computedVisibleColumns:G,computedColumnsMap:Q,computedColumnsMapInInitialOrder:Mt,computedVisibleColumnsMap:W,computedPinnedEndWidth:jt,computedPinnedStartWidth:Wt,renderSelectionCheckBox:G.reduce((N,U)=>N||!!U.renderSelectionCheckBox,!1),fieldsToColumn:lt}};function su(o,e){var s;let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r}=e;if(t)return t;let i=(s=o.defaultSortable)!=null?s:o.colType.defaultSortable;if(i!=null)return i;let a=r!=null?r:qo;return o.computedSortType!==Tn&&a?!0:u=>{let{column:c,api:d}=u,p=c.groupByForColumn||[];return p!=null&&!Array.isArray(p)&&(p=[p]),(p||[]).reduce((f,m)=>{var y;if(!f)return!1;let h=m.field||m.groupField,g;if(h){let T=n.get(h),S=T?d.getColumnApi(T.id):void 0;T&&S?g=S.isSortable():g=!1}return g===void 0&&m.valueGetter&&(g=!0),(y=g!=null?g:r)!=null?y:qo},!0)}}function Ne(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){var u,c;return(c=(u=l.getCellValuesByPrimaryKey(s))==null?void 0:u.value)!=null?c:null},toggleContextMenu(s){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},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 Xo(o,e){var h;let t=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:n,getComputed:r,getDataSourceState:i,actions:a,dataSourceActions:l,dataSourceApi:s}=e,u=i(),{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=u,f=r(),m=t.header&&typeof t.header!="function"?t.header:t.name||t.id||"";if(typeof t.header=="function"){let g=Ne(t.id,P(C({},e),{actions:a,dataSourceActions:l,dataSourceApi:s}));m=(h=t.header({column:t,columnApi:g,insideColumnMenu:!0,dragging:!1,columnsMap:f.computedColumnsMap,columnSortInfo:t.computedSortInfo,columnFilterValue:t.computedFilterValue,filtered:t.computedFiltered,allRowsSelected:c,someRowsSelected:d,selectionMode:p,api:n,renderBag:{header:m}}))!=null?h:null}return m}import oh from"react";var Zo=`${nt}HeaderCell__filter`,Pi=`${nt}HeaderCell__filterOperator`,Di=oh.createContext(null);var ih=`${Zo}__input`,Jo=o=>o.stopPropagation();function cu(o){let{filterOperatorMenuVisibleForColumnId:e}=_s(),{column:t}=Qo(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=uu(!1),l=He.useCallback(()=>{a(!0)},[]),s=He.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return He.createElement("div",{onPointerUp:Jo,onPointerDown:Jo,onFocus:l,onBlur:s,className:`${Zo} ${bi({active:u})}`,style:{height:o.columnHeaderHeight}},He.createElement(Di.Provider,{value:o},He.createElement(r,null),He.createElement(n,null)))}function du(){var r,i;let{columnApi:o,disabled:e,operator:t}=Jn(),n=(i=(r=t==null?void 0:t.components)==null?void 0:r.Icon)!=null?i:yn;return He.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:a=>{a.stopPropagation(),!e&&o.toggleFilterOperatorMenu(a.target)},className:J(Pi,Ws,e?`${Pi}--disabled`:"")},He.createElement(n,{size:20,className:`${js({disabled:e})}`}))}function pu(){return He.createElement("div",{onPointerUp:Jo,onPointerDown:Jo,className:`${Zo} ${bi({active:!1})}`,style:{height:"100%"}})}function Jn(){var g;let o=ne(),{column:e,columnApi:t}=Qo(),n=Xo(e,o),r=He.useContext(Di),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=uu((g=l==null?void 0:l.filter.value)!=null?g:""),d=He.useCallback(y=>{c(y),r.onChange(y)},[r.onChange]),p=He.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=He.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);rh(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let y=[...s.emptyValues][0];y!==u&&c(y)}},[l==null?void 0:l.filter.value]);let m=r.operator,h=m==null?void 0:m.name;return{api:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:h,operator:m,value:u,disabled:l==null?void 0:l.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${ks} ${ih}`}}function bn(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Jn();return Mi.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function er(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Jn();return Mi.createElement("input",{"aria-label":o,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:n})}function ah(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:bn},operators:[{name:"includes",components:{Icon:xs},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:mi},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:Fs},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:vs},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:er},operators:[{label:"Equals",components:{Icon:mi},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:As},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:Ds},fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>t},{name:"gte",components:{Icon:Ps},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>=t},{name:"lt",components:{Icon:Es},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<t},{name:"lte",components:{Icon:Ms},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<=t}]}}}var Zt=ah();function tr(o,e,t,n){var l,s;let r=[...e],i={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:(l=n.rowSelected)!=null?l:"null",rowActive:n.rowActive,dragging:n.dragging,firstRow:(s=n.firstRow)!=null?s:!1,groupRow:n.groupRow,groupCell:n.groupCell,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=t(i);return r.push(a),o.computedFirst&&r.push(...e.map(u=>`${u}--first`)),o.groupByForColumn&&r.push(...e.map(u=>`${u}--group-column`)),o.computedLast&&r.push(...e.map(u=>`${u}--last`)),o.computedFirstInCategory&&r.push(...e.map(u=>`${u}--first-in-category`)),o.computedLastInCategory&&r.push(...e.map(u=>`${u}--last-in-category`)),n.rowSelected&&r.push(...e.map(u=>`${u}--row-selected`)),n.cellSelected&&r.push(...e.map(u=>`${u}--cell-selected`)),n.firstRow&&r.push(...e.map(u=>`${u}--first-row`)),n.groupRow&&(r.push(...e.map(u=>`${u}--group-row`)),r.push(...e.map(u=>`${u}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?r.push(...e.map(u=>`${u}--pinned-${o.computedPinned}`)):r.push(...e.map(u=>`${u}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as Eu,useState as gh}from"react";var mu="_16lm1iw1",fu="_1yeub2v0 _16lm1iw1 _16lm1iwz _16lm1iw1m _16lm1iw0",hu="_1yeub2vq",gu="_1yeub2vp",Cu=Se({defaultClassName:"_1yeub2v2",variantClassNames:{focused:{true:"_1yeub2v3",false:"_1yeub2v4"},focusedWithin:{true:"_1yeub2v5",false:"_1yeub2v6"},hasPinnedStart:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedEnd:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedStartOverflow:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedEndOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vf"]]});var Ei="_1yeub2vn";var px=Se({defaultClassName:"_1yeub2vj",variantClassNames:{pinned:{start:"_1yeub2vk",end:"_1yeub2vl",false:"_1yeub2vm"}},defaultVariants:{},compoundVariants:[]});var Ai=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};var Fi={bodyWidth:{name:q(fe.runtime.bodyWidth),value:""},totalVisibleColumnsWidth:{name:q(fe.runtime.totalVisibleColumnsWidth),value:""},visibleColumnsCount:{name:q(fe.runtime.visibleColumnsCount),value:""}},lh=q(j.scrollbarWidthHorizontal),Su=q(j.scrollbarWidthVertical),yu=q(j.columnWidthAtIndex),sh=q(j.columnOffsetAtIndex),uh=q(j.columnZIndexAtIndex),Tu=q(j.scrollLeft),ch=q(j.activeCellColWidth),dh=q(j.activeCellColOffset),Iu=q(j.baseZIndexForCells),ph=q(j.pinnedStartWidth),bu=q(j.bodyWidth),mh=q(j.bodyHeight),Ru=q(j.pinnedEndOffset),wu=q(j.pinnedEndWidth),fh=q(j.computedVisibleColumnsCount);function _i(o,e){let t="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?t=e.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(t=e.visibleColsCount+o.computedVisibleIndexInCategory):t=-n*10,typeof t=="number"?`calc( var(${Iu}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function xu(o){let e=Xt(),{computed:t,state:n,actions:r,getState:i}=ne(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:u,onBlurWithin:c,onFocusWithin:d,onSelfFocus:p,onSelfBlur:f,bodySize:m,activeCellIndex:h}=n,{computedPinnedStartColumnsWidth:g,computedPinnedEndColumnsWidth:y,computedPinnedStartColumns:T,computedPinnedEndColumns:S,computedVisibleColumns:b,computedUnpinnedColumnsWidth:R,scrollbars:v}=t,I=[],w=b.reduce((E,A)=>{let O=A.computedVisibleIndex;E[`${yu}-${O}`]=A.computedWidth+"px",E[`${sh}-${O}`]=A.computedPinned==="start"?`calc( ${A.computedOffset}px + var(${Tu}) )`:A.computedPinned==="end"?`calc( var(${Ru}) ${I.length?"+":""} ${I.map(K=>`var(${yu}-${K.computedVisibleIndex})`).join(" + ")} + var(${Tu}) )`:`${A.computedOffset}px`;let L=_i(A,{pinnedStartColsCount:T.length,visibleColsCount:b.length});return E[`${uh}-${O}`]=`${L}`,A.computedPinned==="end"&&I.push(A),E},{});w[Fi.bodyWidth.name]=`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,w[Fi.totalVisibleColumnsWidth.name]=`${g+y+R}px`,w[Fi.visibleColumnsCount.name]=b.length,h!=null&&(w[ch]=`var(${_o(h[1])})`,w[dh]=`var(${ql(h[1])})`),w[fh]=b.length,w[lh]=v.horizontal?`${e}px`:"0px",w[Su]=v.vertical?`${e}px`:"0px",w[ph]="calc( "+T.map(E=>`var(${_o(E.computedVisibleIndex)})`).join(" + ")+")",w[wu]="calc( "+S.map(E=>`var(${_o(E.computedVisibleIndex)})`).join(" + ")+")",w[Iu]=b.length*10,w[Ru]=`calc( var(${bu}) - var(${wu}) - var(${Su}) )`,w[bu]=`${m.width}px`,w[mh]=`${m.height}px`;let x=Ai(E=>{r.focused=E}),M=Ai(E=>{r.focusedWithin=E}),D=E=>{var A;if((A=o==null?void 0:o.onFocus)==null||A.call(o,E),E.target===s.current||E.target===u.current){if(i().focused)return;x(!0),p==null||p(E),l&&(M(!1),c==null||c(E));return}l||(M(!0),d==null||d(E))},V=E=>{var O,L;if((O=o==null?void 0:o.onBlur)==null||O.call(o,E),E.target===s.current||E.target===u.current){if(!i().focused)return;x(!1),f==null||f(E),l&&(M(!1),c==null||c(E));return}((L=s.current)==null?void 0:L.contains(E.relatedTarget))||(M(!1),c==null||c(E))},z=P(C({},o),{onFocus:D,onBlur:V}),F=J(Ot,fu,z==null?void 0:z.className,g?`${Ot}--has-pinned-start ${gu}`:null,y?`${Ot}--has-pinned-end ${hu}`:null,a?`${Ot}--focused`:null,l?`${Ot}--focused-within`:null,a&&n.focusedClassName?n.focusedClassName:null,l&&n.focusedWithinClassName?n.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${Ot}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${Ot}--has-pinned-end-overflow`:null,Cu({hasPinnedStart:!!g,hasPinnedEnd:!!y,focused:a,focusedWithin:l}));return z.className=F,z.style=C(C({},o==null?void 0:o.style),w),a&&n.focusedStyle&&Object.assign(z.style,n.focusedStyle),l&&n.focusedWithinStyle&&Object.assign(z.style,n.focusedWithinStyle),z}var Du=Br(Oo());var Qn=(o,e,t)=>{if(o=[...o],e===t||o[e]===void 0||o[t]===void 0)return o;let n=o[e];return t<e,o.splice(e,1),o.splice(t,0,n),o};var vu=o=>{let e=null,t=null;return{stop(){e!==null&&tt(e),t!=null&&tt(t)},scroll(n){e!==null&&tt(e),t!=null&&tt(t);let r=C(C({offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15]},o),n),i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=be(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=be(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var Pu=10,hh=q(j.pinnedStartWidth);function Mu(o){let{columnOffsetAtIndexCSSVar:e,columnWidthAtIndexCSSVar:t,computedVisibleColumns:n,computedVisibleColumnsMap:r,computedPinnedEndColumns:i,computedPinnedStartColumns:a,dragColumnId:l,infiniteDOMNode:s,brain:u,dragColumnHeaderTargetRect:c,tableRect:d,setProxyPosition:p,api:f}=o;function m(_){let k=_==="start"?z:F;return M===V?k:V===_?k+w.computedWidth:M===_?k-w.computedWidth:k}function h(_){if(_.index===x)return!0;let k=n[_.index];if(k.computedPinned)return!0;let G=u.getScrollPosition().scrollLeft;return k.computedOffset>=G+m("start")&&k.computedOffset+k.computedWidth<G+d.width-m("end")}let g=_=>{let k=[];return _.forEach(G=>{let W={columnId:G.id,index:G.computedVisibleIndex,breakpoint:G.computedOffset+Math.round(G.computedWidth/2)};h(W)&&k.push(W)}),k},T=a.length,S={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},b={left:S.clientX-d.left-(S.clientX-c.left)+Pu,top:S.clientY-d.top-(S.clientY-c.top)+Pu},R=u.getScrollPosition(),v=n.map(_=>_.computedVisibleIndex),I=v,w=r.get(l),x=w.computedVisibleIndex,M=w==null?void 0:w.computedPinned,D=x,V=M,z=u.getFixedStartColsWidth(),F=u.getFixedEndColsWidth(),E=S,A={x:0,y:0},O=1,L=0;function K(_){let k=Math.round(_.clientX),G=Math.round(_.clientY);if(k===E.clientX&&G===E.clientY)return;E={clientX:k,clientY:G};let Q=u.getScrollPosition().scrollLeft-R.scrollLeft;A.x=E.clientX-S.clientX,A.y=E.clientY-S.clientY,L=A.x+Q,O=L<0?-1:1,p({left:b.left+A.x,top:b.top+A.y})}function Z(_){let k=0;M?M==="start"&&_.forEach((G,W)=>{var Q;k||((Q=n[G])==null?void 0:Q.computedPinned)!=="start"&&(k=W)}):_.forEach((G,W)=>{var Q;((Q=n[G])==null?void 0:Q.computedPinned)==="start"&&(k=W+1)}),T=k,re("start",_,k)}function re(_,k,G){if(_==="start"){let W=0;for(let Q=0;Q<G;Q++){let Y=k[Q],te=n[Y];W+=te.computedWidth}Tt(hh,`${W}px`,s)}}function X(_){if(_===D)return;D=_;let k=Qn(v,x,D>x?D-1:D);T=0;let W=new Set;return k.forEach((Q,Y)=>{let te=I[Y];Q!==te&&W.add(Q),Z(k)}),I=k,ee(W),{newColumnIndexes:k,indexesWithTransition:W,pinnedStartCount:T}}function ee(_){n.forEach(k=>{let G=k.computedVisibleIndex;_.has(G)?Yl(G,s):Fo(G,s);let W=G===x,Q=O===-1?G<D||G>x:G<x||G>=D,Y="";O===-1?Y=W?`var(${e}-${D})`:Q?`var(${e}-${G})`:`calc( var(${e}-${G}) + var(${t}-${x}) )`:Y=Q?`var(${e}-${G})`:W?`calc( var(${e}-${D-1}) + var(${t}-${D-1}) - var(${t}-${x}) )`:`calc( var(${e}-${G}) - var(${t}-${x}) )`,Wn(G,Y,s)})}let H=d.left+m("start"),B=d.right-m("end"),$=vu({scrollOffsetStart:H,scrollOffsetEnd:B});return K(S),{speedScroller:$,stop(){$.stop()},onMove(_){K(_),$.scroll({mousePosition:E,get scrollLeft(){return u.getScrollPosition().scrollLeft},set scrollLeft(te){f.scrollLeft=te}});let k=g(n),G=O===-1?w.computedOffset+L:w.computedOffset+w.computedWidth+L,W=(0,Du.default)(k,G,({breakpoint:te},ge)=>te<ge?-1:te>ge?1:0);W<0&&(W=~W),W=k[W]?k[W].index:k[k.length-1].index+1,W!=null&&W!==D&&(O===1&&D===x+1&&(W=x),X(W));let Q={};i.forEach(te=>{Q[te.id]="end"});for(let te=0;te<T;te++){let ge=I[te],ye=n[ge];Q[ye.id]="start"}let Y=I.map(te=>n[te].id);return{columnPinning:Q,columnOrder:Y}}}}function Vt(o,e,t){if(o===e)return!0;if(!o||!e)return!1;var n=Object.keys(o),r=Object.keys(e);t&&(n=n.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=n.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=n[a];if(!(t&&t.has(l))&&(o[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function Oi(o){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:n,dragColumnId:r}=o;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 n;if(a>i){let l=e.indexOf(r),s=e[l-1],u=n.indexOf(s),c=n.indexOf(r);return Qn(n,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=n.indexOf(s),c=n.indexOf(r);return Qn(n,c,u)}return e}var Ch=q(j.columnOffsetAtIndex),Sh=q(j.columnWidthAtIndex),yh=q(j.baseZIndexForCells),Th=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:Vt(o,e)},Au=({columnId:o,domRef:e})=>{var p;let[t,n]=gh(null),{actions:r,computed:i,getComputed:a,getState:l,api:s,state:{domRef:u}}=ne(),c=Eu(f=>{let m=a().computedVisibleColumnsMap.get(o);if(!m||!m.computedSortable)return;let{multiSortBehavior:h}=l();s.toggleSortingForColumn(o,{multiSortBehavior:h==="replace"&&(f.ctrlKey||f.metaKey)?"append":h})},[]),d=Eu(f=>{var O,L;if(((O=f.target)==null?void 0:O.tagName)==="INPUT")return;let{brain:m}=l(),{computedVisibleColumns:h,computedVisibleColumnsMap:g,computedPinnedStartColumns:y,computedUnpinnedColumns:T,computedPinnedEndColumns:S}=a(),b=g.get(o);if(!b.computedDraggable){c(f);return}let R=e.current,v=R.getBoundingClientRect(),I=u.current.getBoundingClientRect(),w=m.getAvailableSize(),x=b.computedVisibleIndex,M=(L=R.style.cursor)!=null?L:"auto",D=!1,V=Mu({brain:m,columnOffsetAtIndexCSSVar:Ch,columnWidthAtIndexCSSVar:Sh,computedPinnedEndColumns:S,computedPinnedStartColumns:y,computedUnpinnedColumns:T,computedVisibleColumns:h,computedVisibleColumnsMap:g,dragColumnHeaderTargetRect:v,dragColumnId:o,api:s,infiniteDOMNode:u.current,setProxyPosition:n,tableRect:I,initialMousePosition:{clientX:f.clientX,clientY:f.clientY}}),z=null;function F(K){let{columnPinning:Z,columnOrder:re}=K;Th(l().columnPinning,Z)||(r.columnPinning=Z);let X=a().computedColumnOrder;JSON.stringify(re,X)&&(h.forEach(ee=>{Wn(ee.computedVisibleIndex,"",u.current)}),r.columnOrder=Oi({newColumnOrder:re,visibleColumnOrder:a().computedVisibleColumns.map(ee=>ee.id),existingColumnOrder:X,dragColumnId:o}))}let E=K=>{var X;let{headerBrain:Z,brain:re}=l();D||(D=!0,re.setRenderCount({horizontal:h.length,vertical:void 0}),Z.setRenderCount({horizontal:h.length,vertical:void 0}),r.columnReorderDragColumnId=b.id,Qr(x,`calc( var(${yh}) + 10000 )`,u.current),(X=u.current)==null||X.classList.add(Ei),R.style.cursor="grabbing"),z=V.onMove(K)},A=K=>{var ee,H,B;let{multiSortBehavior:Z}=l(),re=e.current;(ee=u.current)==null||ee.classList.remove(Ei),V.stop(),m.setAvailableSize(C({},w)),h.forEach($=>{Fo($.computedVisibleIndex,u.current),Wn($.computedVisibleIndex,"",u.current)}),Qr(x,_i(b,{pinnedStartColsCount:y.length,visibleColsCount:h.length}),u.current),re.style.cursor=M,re.releasePointerCapture(K.pointerId),re.removeEventListener("pointermove",E),re.removeEventListener("pointerup",A),n(null);let X=(B=(H=s.getColumnApi(b.id))==null?void 0:H.isSortable())!=null?B:!1;!D&&X&&s.toggleSortingForColumn(b.id,{multiSortBehavior:Z==="replace"&&(K.ctrlKey||K.metaKey)?"append":Z}),z&&F(z),r.columnReorderDragColumnId=!1};R.addEventListener("pointermove",E),R.addEventListener("pointerup",A),R.setPointerCapture(f.pointerId)},[o]);return{onPointerDown:(p=i.computedVisibleColumnsMap.get(o))!=null&&p.computedDraggable?d:c,proxyPosition:t}};import*as In from"react";import*as ce from"react";import{useCallback as ft,useContext as Oh,useMemo as Vh}from"react";import*as Jt from"react";var Fu=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;import*as eo from"react";import{useState as bh}from"react";var _u="_16lm1iw7 _16lm1iwn _16lm1iwi _16lm1iw9",Ou=Se({defaultClassName:"_198z9781",variantClassNames:{expanded:{true:"_16lm1iwg",false:"_198z9783"},direction:{end:"_198z9784",start:"_198z9785"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwh"]]});function Rn(o){var a;let{size:e=24,direction:t="start"}=o,[n,r]=bh((a=o.expanded)!=null?a:o.defaultExpanded),i=()=>{var l;(l=o.onChange)==null||l.call(o,!n),_t("expanded",o)||r(!n)};return eo.useEffect(()=>{_t("expanded",o)&&r(o.expanded)},[o.expanded]),eo.createElement("svg",{"data-name":"expander-icon",xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:i,className:J(o.className,_u,Ou({direction:t||"start",expanded:n}),`${Ue}`,`${Ue}-expander`,`InfiniteIcon-expander--${n?"expanded":"collapsed"}`,`InfiniteIcon-expander--${t==="end"?"end":"start"}`)},eo.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}import*as nr from"react";var Vu="_16lm1iwb _16lm1iwn _16lm1iwi";var zu=o=>nr.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:J(o.className,Vu,"InfiniteIcon","InfiniteIcon-loading")},nr.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},nr.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var Gu=Se({defaultClassName:"_7pupv0c",variantClassNames:{align:{start:"_7pupv0d",center:"_7pupv0e",end:"_7pupv0f"}},defaultVariants:{},compoundVariants:[]}),bv=Se({defaultClassName:"_7pupv02 _7pupv00",variantClassNames:{zebra:{false:"_7pupv03",even:"_7pupv04",odd:"_7pupv05"},groupRow:{true:"_7pupv06",false:"_7pupv07"},inlineGroupRow:{true:"_7pupv08",false:"_7pupv09"},showHoverRows:{true:"_7pupv0a",false:"_7pupv0b"}},defaultVariants:{},compoundVariants:[]}),Lu="_7pupv01";function Hu({rowInfo:o}){return{[q(fe.components.Row.groupNesting)]:o.dataSourceHasGrouping?o.isGroupRow?o.groupNesting-1:o.groupNesting:0}}function or({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=n,d=J(gn.flex,i.align==="end"?Xn.rowReverse:Xn.row,ds.center,`${Qt}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||u)?Gu({align:a}):null);if(e==="multi-column"){if(o+1!==c.groupNesting&&c.isGroupRow)return u?Jt.createElement("div",{className:d},u):null}else e==="single-column"&&c.isGroupRow;return Jt.createElement("div",{className:d},s,u,Jt.createElement("div",{className:mt},l!=null?l:null))}}function rr({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{var g,y,T;let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&((g=i.parents)==null?void 0:g[o])||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===o&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&o+1!==c.groupNesting)return null;let p=c.groupKeys,f=null,m=s?(((y=c.groupKeys)==null?void 0:y.length)||0)<(l==null?void 0:l.length):(((T=c.groupKeys)==null?void 0:T.length)||0)<=(l==null?void 0:l.length);return Fu(c)?f=Jt.createElement(zu,null):m&&(f=Jt.createElement(Rn,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=Jt.createElement(Xe,{render:n,renderParam:r})),f}}function Nu(o,e,t){let{groupByForColumn:n,groupIndexForColumn:r,groupRenderStrategy:i}=o,a=n.column?C({},n.column):{},l=P(C({header:`Group by ${n.field||n.groupField}`,groupByForColumn:n,render:or({groupIndexForColumn:r,groupRenderStrategy:i})},a),{renderGroupIcon:rr({initialRenderGroupIcon:a==null?void 0:a.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})});return t&&(typeof t=="function"?l=C(C({},l),t(o,e)):l=C(C({},l),t)),l}function Ku(o,e,t){let n=typeof t=="function"?t(o,e):t,r={};return o.sortable!=null&&(r.sortable=o.sortable),P(C(P(C({},r),{header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:or({groupIndexForColumn:0,groupRenderStrategy:"single-column"})}),n),{renderGroupIcon:rr({initialRenderGroupIcon:n==null?void 0:n.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})})}function ku(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var Bu="_1eexc2a6 _1eexc2a5 _16lm1iwz _16lm1iw1o _16lm1iw1q _16lm1iw2 _16lm1iw22 _16lm1iw23 _16lm1iw17",Wu=Se({defaultClassName:"_1eexc2ah",variantClassNames:{dragging:{false:"_1eexc2ai",true:"_1eexc2aj"},cellSelected:{false:"_1eexc2ak",true:"_1eexc2al"},align:{start:"_1eexc2am",end:"_1eexc2an",center:"_1eexc2ao"},verticalAlign:{start:"_1eexc2ap",end:"_1eexc2aq",center:"_1eexc2ar"},rowActive:{false:"_1eexc2as",true:"_1eexc2at"},groupRow:{false:"_1eexc2au",true:"_1eexc2av"},groupCell:{false:"_1eexc2aw",true:"_1eexc2ax"},zebra:{false:"_1eexc2ay",even:"_1eexc2az",odd:"_1eexc2a10"},rowSelected:{true:"_1eexc2a11",false:"_1eexc2a12",null:"_1eexc2a13"},first:{true:"_1eexc2a14",false:"_1eexc2a15"},last:{true:"_1eexc2a16",false:"_1eexc2a17"},groupByField:{true:"_1eexc2a18",false:"_1eexc2a19"},firstInCategory:{true:"_1eexc2a1a",false:"_1eexc2a1b"},firstRow:{true:"_1eexc2a1c",false:"_1eexc2a1d"},lastInCategory:{true:"_1eexc2a1e",false:"_1eexc2a1f"},pinned:{start:"_1eexc2a1g",end:"_1eexc2a1h",false:"_1eexc2a1i"},filtered:{true:"_1eexc2a1j",false:"_1eexc2a1k"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_1eexc2a1l"],[{pinned:"start",firstInCategory:!0},"_1eexc2a1m"],[{pinned:"end",firstInCategory:!0},"_1eexc2a1n"],[{pinned:"end",lastInCategory:!0},"_1eexc2a1o"],[{align:"center",groupCell:!1},"_1eexc2a1p"]]}),ju=Se({defaultClassName:"_1eexc2a8",variantClassNames:{right:{true:"_1eexc2a9",false:"_1eexc2aa"},left:{true:"_1eexc2ab",false:"_1eexc2ac"},top:{true:"_1eexc2ad",false:"_1eexc2ae"},bottom:{true:"_1eexc2af",false:"_1eexc2ag"}},defaultVariants:{},compoundVariants:[]});var ir="_1eexc2a7";import*as ar from"react";import{useEffect as Rh,useRef as wh}from"react";var $u="qz8ht90 _16lm1iwi";function Ih(){return{checked:1,disabled:o=>o!=null?o:!1,domProps:1}}var xh=bt({forwardProps:Ih,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function vh(){let{componentState:o,componentActions:e}=ve(),{checked:t,domProps:n,disabled:r}=o,i=wh(null);return Rh(()=>{i.current.indeterminate=t==null},[t]),ar.createElement("input",P(C({},n),{className:J("InfiniteCheckBox",$u,n==null?void 0:n.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}}))}function zt(o){return ar.createElement(xh,C({},o),ar.createElement(vh,null))}function Ph(o){return typeof o.field=="string"}function Uu(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?n.get(i.field||i.groupField):void 0}!r&&e.field&&(r=n.get(e.field))}return r}function Ye(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),u=s[r],{isGroupRow:c}=u,d=e().computedColumnsMap.get(i),{activeRowIndex:p,keyboardNavigation:f,isRowDetailEnabled:m}=n(),h=r===p&&f==="row",g=!m||typeof m=="function"&&!m(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:T}}=wn({column:d,rowInfo:u,rowDetailState:g,columnsMap:e().computedColumnsMap,context:o}),S=Ne(d.id,o);return c?{api:a,dataSourceApi:l,column:d,columnApi:S,isGroupRow:!0,rowDetailState:!1,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:T}:{api:a,dataSourceApi:l,columnApi:S,column:d,isGroupRow:!1,rowDetailState:g,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:T}}function Yu(o){return Xu(o.column,o.rowInfo)}function qu(o){var m,h;let{column:e,context:t,rowInfo:n,visibleColumnsIds:r}=o,i=Uu({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=wn(P(C({},o),{column:e})),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=P(C({column:o.column,inEdit:c,rowHasSelectedCells:!1},u),{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align(C({isHeader:!1},d)):(m=e.align)!=null?m:"start",f=typeof e.verticalAlign=="function"?e.verticalAlign(C({isHeader:!1},d)):(h=e.verticalAlign)!=null?h:"center";return{inEdit:c,stylingParam:d,formattedValueContext:u,renderFunctions:{renderGroupIcon:e.renderGroupIcon||(i==null?void 0:i.renderGroupIcon),renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderValue:e.renderValue||(i==null?void 0:i.renderValue),renderGroupValue:e.renderGroupValue||(i==null?void 0:i.renderGroupValue),renderLeafValue:e.renderLeafValue||(i==null?void 0:i.renderLeafValue)},renderParams:Dh(P(C({},o),{align:p,verticalAlign:f,formattedValueContext:u})),groupByColumnReference:i}}function Dh(o){var I;let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=o,{value:c}=u,{api:d,getDataSourceState:p,getState:f}=t,{editingCell:m}=f(),{indexInAll:h}=n,g=p(),{selectionMode:y,cellSelection:T}=g,S=Uu({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),b=d.toggleGroupRow,R=(I=T==null?void 0:T.isCellSelected(n.id,e.id))!=null?I:!1,v=P(C({column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:R,rowHasSelectedCells:!1},u),{editError:m&&m.primaryKey===n.id&&m.columnId===e.id&&!m.active&&m.accepted instanceof Error?m.accepted:void 0,groupByColumn:S,selectionMode:y,api:d,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:n.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:n.id,colId:e.id})},renderBag:{all:null,value:typeof c=="boolean"?`${c}`:c,selectionCheckBox:null,groupIcon:null},selectCurrentRow:()=>d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0),deselectCurrentRow:()=>d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0),rowIndex:h,toggleGroupRow:b,toggleCurrentGroupRow:()=>{n.isGroupRow&&b(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!n.isGroupRow)return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:g.groupBy,pivotBy:g.pivotBy});return Object.defineProperty(v,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),v}function Xu(o,e){let{data:t,isGroupRow:n,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=n&&i&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===i[i.length-1])?e.value:Ph(o)?t==null?void 0:t[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function Mh(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),u=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:t.isGroupRow,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:t.isGroupRow,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}}function wn(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=Xu(e,t),a=Mh(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}import*as Rt from"react";var{rootClassName:Zu}=Ie,en=`${Zu}Cell`,Vi=`${Zu}Cell_content`,Eh=q(j.columnWidthAtIndex),Ah=q(j.columnReorderEffectDurationAtIndex);function Fh(o){var R,v;let b=o,{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:u,afterChildren:c,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m}=b,h=At(b,["cssEllipsis","virtualized","skipColumnShifting","contentStyle","column","domRef","width","contentClassName","rowId","afterChildren","beforeChildren","cellType","cssPosition","renderChildren"]),g=m(),y=C({width:`var(${Eh}-${i.computedVisibleIndex})`,transition:`transform var(${Ah}-${i.computedVisibleIndex}, 0s)`},h.style),T=P(C({},h),{style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:J(h.className,en,Bu),children:Rt.createElement(Rt.Fragment,null,d,Rt.createElement("div",{className:J(Vi,e?mt:gs.hidden,s),style:r},g),c)});u!=null&&(T["data-row-id"]=`${u}`);let S=p==="body"?(R=i.components)==null?void 0:R.ColumnCell:(v=i.components)==null?void 0:v.HeaderCell;return S?Rt.createElement(S,C({},T)):Rt.createElement("div",P(C({},T),{ref:a}))}var lr=Rt.memo(Fh);import*as tn from"react";import{useCallback as Ju,useRef as _h}from"react";function Qu(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=zi(),i=_h(),a=tn.useCallback(s=>{i.current=s,s&&s.focus()},[]),l=Ju(s=>{let{key:u}=s;u==="Enter"||u==="Tab"?t():u==="Escape"?n():s.stopPropagation()},[]);return tn.createElement(tn.Fragment,null,tn.createElement("input",{readOnly:r,ref:a,onKeyDown:l,onBlur:()=>t(),className:J(cs,hs.none),type:"text",defaultValue:o,onChange:Ju(s=>{e(s.target.value)},[])}))}var{rootClassName:zh}=Ie,Gh=q(j.columnZIndexAtIndex),to=ce.createContext(null),Qt=`${zh}ColumnCell`,Lh=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return ce.createElement(Rn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},Hh=o=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:n,toggleCurrentGroupRowSelection:r,column:i}=o;return e.isGroupRow&&i.groupByForColumn,ce.createElement(zt,{domProps:{className:ir},onChange:a=>{if(e.isGroupRow){r();return}a?t():n()},checked:e.rowSelected})};function Gi(o,e){return o?typeof o=="function"?o(e):o:void 0}function Li(o,e,t){return typeof e=="function"?C(C({},o),e(t)):C(C({},o),e)}function Nh(o){var oe,Be,We;let{rowInfo:e,rowStyle:t,rowClassName:n,getData:r,cellStyle:i,cellClassName:a,rowDetailState:l,width:s,column:u,onMouseLeave:c,onMouseEnter:d,rowIndex:p,rowHeight:f,columnsMap:m,fieldsToColumn:h,domRef:g,hidden:y,showZebraRows:T}=o;if(!u)return ce.createElement("div",{ref:g},"no column");let{rowSelected:S}=e,{getState:b,actions:R,computed:v,api:I,getDataSourceMasterContext:w}=ne(),{componentState:x,getState:M,api:D,componentActions:V}=me(),{activeRowIndex:z,keyboardNavigation:F}=b(),E=p===z&&F==="row",A={getState:b,getDataSourceState:M,getDataSourceMasterContext:w,actions:R,dataSourceActions:V,api:I,dataSourceApi:D},O=v.computedVisibleColumns.map(Te=>Te.id),L=qu({column:u,rowInfo:e,rowDetailState:l,columnsMap:m,visibleColumnsIds:O,fieldsToColumn:h,context:A}),{stylingParam:K,renderParams:Z,formattedValueContext:re,renderFunctions:X,groupByColumnReference:ee,inEdit:H}=L,{align:B,verticalAlign:$}=Z,_=Z,k=ce.useRef(_),G=ft(Te=>{let Fe=u.computedVisibleIndex;b().cellClick({rowIndex:p,colIndex:Fe,event:Te})},[p,u.computedVisibleIndex,F]),W=ft(Te=>{let Fe=u.computedVisibleIndex;if(b().cellMouseDown({rowIndex:p,colIndex:Fe,event:Te}),F==="row"){R.activeRowIndex=p;return}F==="cell"&&(R.activeCellIndex=[p,Fe])},[p,u.computedVisibleIndex,F]),{selectionMode:Q,cellSelection:Y}=x,te=_.cellSelected;_.domRef=g,_.selectCell=ft(_.selectCell,[e]),_.deselectCell=ft(_.deselectCell,[e]),_.selectCurrentRow=ft(_.selectCurrentRow,[e]),_.deselectCurrentRow=ft(_.deselectCurrentRow,[e]),_.toggleCurrentGroupRow=ft(_.toggleCurrentGroupRow,[e]),_.toggleCurrentRowSelection=ft(_.toggleCurrentRowSelection,[e]),_.toggleCurrentGroupRowSelection=ft(_.toggleCurrentGroupRowSelection,[e]);let ge=(Be=(oe=u.components)==null?void 0:oe.Editor)!=null?Be:Qu,ye=H?ce.createElement(nc,{contextValue:_},ce.createElement(ge,null)):null,ke=ft(Ft(()=>{if(y||H)return null;X.renderGroupIcon&&(_.renderBag.groupIcon=ce.createElement(Xe,{render:X.renderGroupIcon,renderParam:P(C({},_),{renderBag:C({},_.renderBag)})})),X.renderSelectionCheckBox&&Q=="multi-row"&&(_.renderBag.selectionCheckBox=ce.createElement(Xe,{render:Hh,renderParam:_}),X.renderSelectionCheckBox!==!0&&(_.renderBag.selectionCheckBox=ce.createElement(Xe,{render:X.renderSelectionCheckBox,renderParam:P(C({},_),{renderBag:C({},_.renderBag)})}))),X.renderRowDetailIcon&&(_.renderBag.rowDetailsIcon=ce.createElement(Xe,{render:Lh,renderParam:P(C({},_),{renderBag:C({},_.renderBag)})}),typeof X.renderRowDetailIcon=="function"&&(_.renderBag.rowDetailsIcon=ce.createElement(Xe,{render:X.renderRowDetailIcon,renderParam:P(C({},_),{renderBag:C({},_.renderBag)})}))),X.renderValue&&(_.renderBag.value=ce.createElement(Xe,{render:X.renderValue,renderParam:P(C({},_),{renderBag:C({},_.renderBag)})})),e.isGroupRow&&X.renderGroupValue&&(_.renderBag.value=ce.createElement(Xe,{render:X.renderGroupValue,renderParam:P(C({},_),{renderBag:C({},_.renderBag)})})),!e.isGroupRow&&X.renderLeafValue&&(_.renderBag.value=ce.createElement(Xe,{render:X.renderLeafValue,renderParam:P(C({},_),{renderBag:C({},_.renderBag)})})),k.current=_;let Te=_.renderBag.value;Te instanceof Date&&(Te=Te.toLocaleDateString());let Fe=ce.createElement(ce.Fragment,null,B!=="end"?_.renderBag.groupIcon:null,B!=="end"?_.renderBag.rowDetailsIcon:null,B!=="end"?_.renderBag.selectionCheckBox:null,Te,B==="end"?_.renderBag.selectionCheckBox:null,B==="end"?_.renderBag.rowDetailsIcon:null,B==="end"?_.renderBag.groupIcon:null);return u.render?ce.createElement(Xe,{render:u.render,renderParam:P(C({},_),{renderBag:P(C({},_.renderBag),{all:Fe})})}):Fe}),[u,y,H,l,...ku(_,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,rowHasSelectedCells:!0})]),je=v.computedVisibleColumns.map(Te=>Te.id),at=v.computedColumnOrder,Ce=P(C({},re),{visibleColumnIds:je,allColumnIds:at,rowIndex:p,rowHasSelectedCells:!1});Object.defineProperty(Ce,"rowHasSelectedCells",{get(){return e.hasSelectedCells(je)}});let De=typeof n=="function"?n(Ce):n,$e;ee!=null&&ee.className&&($e=Gi(ee.className,K)),a&&($e=J($e,Gi(a,K))),u.className&&($e=J($e,Gi(u.className,K)));let de;e.dataSourceHasGrouping&&u.groupByForColumn&&(de=Hu({rowInfo:e})),t&&(de=typeof t=="function"?C(C({},de),t(Ce)):C(C({},de),t)),i&&(de=Li(de,i,K)),ee!=null&&ee.style&&(de=Li(de,ee.style,K)),u.style&&(de=Li(de,u.style,K)),de=de||{},de.height=f,de.zIndex=`var(${Gh}-${u.computedVisibleIndex})`;let Bt=Vh(()=>de,[de?JSON.stringify(de):null]),lt=(e.indexInAll!=null?e.indexInAll:p)%2===1,Mt=T?lt?"odd":"even":!1,Wt=!1,jt=!1,$t=!1,N=!1;if(Y&&te){let Te=r(),Fe=Te[e.indexInAll-1],Je=Te[e.indexInAll+1],st=v.computedVisibleColumns[u.computedVisibleIndex+1],ut=v.computedVisibleColumns[u.computedVisibleIndex-1];Wt=Fe?!Y.isCellSelected(Fe.id,u.id):!0,u.computedPinned==="end"&&u.computedFirstInCategory?jt=!0:jt=ut?!Y.isCellSelected(e.id,ut.id):!0,u.computedPinned==="start"&&u.computedLastInCategory?$t=!0:$t=st?!Y.isCellSelected(e.id,st.id):!0,N=Je?!Y.isCellSelected(Je.id,u.id):!0}let U=Y&&te?{top:Wt,left:jt,right:$t,bottom:N}:null,ae=ye,ue={domRef:g,cellType:"body",column:u,width:s,rowId:e.id,style:Bt,onMouseLeave:c,onMouseEnter:d,onClick:G,afterChildren:ae,onMouseDown:W,cssEllipsis:(We=u.cssEllipsis)!=null?We:!0,className:J(U?ju(U):"",tr(u,[Qt,en],Wu,{dragging:!1,zebra:Mt,align:B,verticalAlign:$,rowActive:E,cellSelected:te,rowSelected:S,firstRow:e.indexInAll===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!u.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),$e,De),renderChildren:ke},Ge=to.Provider;return ce.createElement(Ge,{value:k.current},ce.createElement(lr,C({},ue)))}var ec=ce.memo(Nh);function tc(){return Oh(to)}function zi(){let{api:o,state:{editingValueRef:e,editingCell:t}}=ne(),{column:n,rowInfo:r}=tc(),[i]=ce.useState(()=>t==null?void 0:t.value),[a,l]=ce.useState(i),s=t?!t.active&&!!t.waiting:!1,u=ce.useCallback(f=>{e.current=f,l(f)},[]);ce.useLayoutEffect(()=>{e.current=i},[]);let c=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function no(o){var e;return(e=o.render(o.renderParam))!=null?e:null}function Xe(o){let e=to.Provider;return In.createElement(e,{value:o.renderParam},In.createElement(no,{render:o.render,renderParam:o.renderParam}))}function nc(o){let e=to.Provider;return In.createElement(e,{value:o.contextValue},o.children)}function Gt(o){let e=sr.Provider;return In.createElement(e,{value:o.renderParam},In.createElement(no,{render:o.render,renderParam:o.renderParam}))}import*as Lt from"react";var Kh={width:"100%",pointerEvents:"none"},Hi=`${Ue}-menu`,Ni=jo({"data-name":""}),Ki={[Ni["data-name"]]:"menu-icon"};function oo(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l=C(P(C({},Kh),{borderTop:`${fe.components.HeaderCell.menuIconLineWidth} solid currentColor`}),o.lineStyle);return Lt.createElement("div",P(C(P(C({},n),{style:e}),Ki),{onPointerDown:s=>s.stopPropagation(),className:J(t,Us({menuVisible:i,reserveSpaceWhenHidden:r}),Ue,`${Ue}-menu`)}),a!=null?a:Lt.createElement(Lt.Fragment,null,Lt.createElement("div",{className:Hi,style:l}),Lt.createElement("div",{className:Hi,style:l}),Lt.createElement("div",{className:Hi,style:l})))}import*as xn from"react";import{useEffect as kh,useState as rc}from"react";var oc="_1ek6mqy0 _16lm1iwz _16lm1iw1m _16lm1iw1 _16lm1iw1u";var Bh={transition:"width 0.25s, opacity 0.25s"};function ic(o){var y;let[e,t]=rc(!0),[n,r]=rc(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=o,c=u!=null&&u>0,d=(y=o.size)!=null?y:16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m=P(C(P(C({},Bh),{borderTop:`${a}px solid currentColor`}),o.lineStyle),{opacity:n});kh(()=>{let T=i!=0?1:0;if(!e&&T&&t(!0),T!==n){let S=requestAnimationFrame(()=>{r(T)});return()=>{cancelAnimationFrame(S)}}return()=>{}},[i,e]);let h=()=>{let S=!(n===0&&i===0);S!==e&&t(S)};if(!e)return null;let g={};return i===-1&&(g.top="100%"),xn.createElement("div",{"data-name":"sort-icon",style:P(C({},l),{width:d}),className:J(s,Ue,oc,`${Ue}-sort`)},c?xn.createElement("div",{"data-name":"index",style:g,className:Xs},u):null,xn.createElement("div",{style:C({width:f[0]},m),onTransitionEnd:h}),xn.createElement("div",{style:C({width:f[1]},m)}),xn.createElement("div",{style:C({width:f[2]},m)}))}import*as dc from"react";import{useCallback as cc}from"react";import{useRef as sc,useState as Wh}from"react";import*as ro from"react";function ac(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){Ao(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;Ao(a,l.computedWidth-i,n.current),l.computedPinned==="start"?Jr(l,i,n.current):pn(a,l.computedOffset+i,n.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let u=e[l];if(u.computedPinned==="start"){Jr(u,i,n.current);continue}u.computedPinned!=="end"&&pn(l,u.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||pn(l,u.computedOffset+i,n.current)}}}}}function lc(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,u=i.current;if(n.forEach((c,d)=>{s+=c;let p=o[d],f=r[p],m=f.computedWidth+c;Ao(p,m,u),f.computedPinned!=="end"&&(l&&pn(p,l,u),l+=m)}),a.computedPinned!=="end")for(let c=t+1;c<r.length;c++){let d=r[c];d.computedPinned!=="end"&&pn(c,d.computedOffset+s,u)}}}}var ur="zneyzh0 _16lm1iw2 _16lm1iw1c _16lm1iw1j _16lm1iw1h _16lm1iwk _16lm1iw1x",cr=Se({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw1c _16lm1iw1h",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},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0},"zneyzhn"]]}),dr=Se({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw1e _16lm1iw1l",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:jh}=Ie,$h=`${jh}HeaderCell_ResizeHandle`;function Uh(o){let e=sc(null),[t,n]=Wh(!1),r=sc(t);r.current=t;let i=o.columns[o.columnIndex];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,u=d=>{d.stopPropagation();let p=!!d.shiftKey,f=d.pointerId,m=d.clientX,h=d.target;h.setPointerCapture(f);let g=ac(o.columnIndex,{columns:o.columns,shareSpaceOnResize:p,domRef:e}),y=b=>{a==="end"&&(b*=-1);let{adjustedDiff:R,constrained:v}=o.computeResize({diff:b,shareSpaceOnResize:p});return r.current!==v&&n(v),g.resize(R),R},T=b=>{y(Math.round(b.clientX-m))},S=b=>{h.releasePointerCapture(f),h.removeEventListener("pointermove",T),h.removeEventListener("pointerup",S);let R=Math.round(b.clientX-m),v=y(R);o.onResize({diff:v,shareSpaceOnResize:p})};h.addEventListener("pointermove",T),h.addEventListener("pointerup",S)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:0}:a==="end"&&l?{right:void 0}:void 0;return ro.createElement("div",{ref:e,className:`${$h} ${ur} ${dr({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},ro.createElement("div",{style:c,className:cr({constrained:t,computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}))}var uc=ro.memo(Uh);function pc(o){let{computed:{computedVisibleColumns:e},getState:t,getComputed:n,actions:r}=ne(),i=cc(({diff:s,shareSpaceOnResize:u})=>{let c=t(),{columnSizing:d,viewportReservedWidth:p,bodySize:f}=c,m=n().computedVisibleColumns,h=!1,g=m.reduce((S,b)=>(b.computedFlex&&(S[b.id]=P(C({},d[b.id]),{flex:b.computedWidth}),h=!0),S),{}),y=h?C(C({},d),g):d;return wi({shareSpaceOnResize:u,availableSize:f.width,reservedWidth:p||0,dragHandleOffset:s,dragHandlePositionAfter:o.computedVisibleIndex,columnSizing:y,items:m.map(S=>({id:S.id,computedFlex:S.computedFlex,computedWidth:S.computedWidth,computedMinWidth:S.computedMinWidth,computedMaxWidth:S.computedMaxWidth}))})},[o]),a=cc(({diff:s,shareSpaceOnResize:u})=>{let{columnSizing:c,reservedWidth:d}=i({diff:s,shareSpaceOnResize:u});u||(r.viewportReservedWidth=d),r.columnSizing=c},[i]);return o.computedResizable?dc.createElement(uc,{columns:e,columnIndex:o.computedVisibleIndex,computeResize:i,onResize:a}):null}var nn=`${nt}HeaderCell`;var Qh=o=>{let{allRowsSelected:e,someRowsSelected:t,api:n}=o;return he.createElement(zt,{domProps:{className:ir},onChange:i=>{i?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:e?!0:t?null:!1})},sr=he.createContext(null);var eg=q(j.columnZIndexAtIndex),ki=he.createElement("div",{className:Wo[1]}),mc=jo({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":""});function fc(o){var $t,N,U,ae,ue,Ge,oe,Be,We,Te,Fe,Je,st,ut,Ct,Et;let e=o.column,{api:t,getComputed:n,getState:r,actions:i,state:{showColumnFilters:a,components:l,portalDOMRef:s,columnHeaderHeight:u,columnReorderDragColumnId:c,columnMenuVisibleForColumnId:d},getDataSourceMasterContext:p}=ne(),{api:f,componentActions:m,getState:h,componentState:{filterDelay:g,filterTypes:y}}=me(),{allRowsSelected:T,someRowsSelected:S,selectionMode:b}=un(),R=c===e.id,{onResize:v,height:I,width:w,headerOptions:x,columnsMap:M}=o,D=e.computedSortInfo,V=e.header,z=Yh(ie=>{var Qe;W.current=ie,(Qe=o.domRef)==null||Qe.call(o,ie)},[o.domRef]),F=x.alwaysReserveSpaceForSortIcon,E=($t=e.headerAlign)!=null?$t:e.align,A=(N=typeof E=="function"?E({isHeader:!0,column:e}):E)!=null?N:"start",O=(U=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)!=null?U:"center",L=Ne(e,{actions:i,api:t,dataSourceActions:m,dataSourceApi:f,getComputed:n,getDataSourceState:h,getDataSourceMasterContext:p,getState:r}),K=L.isSortable(),Z=K&&(e.computedSorted||F)?he.createElement(ic,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:fe.spacing[2],marginInlineEnd:fe.spacing[2]},className:`${nn}__sort-icon ${qs} ${Zs({align:A})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,X=e.computedFilterable&&e.computedFiltered?he.createElement(yn,null):null,ee=(ue=(ae=e.headerCssEllipsis)!=null?ae:e.cssEllipsis)!=null?ue:!0,H={reserveSpaceWhenHidden:A==="center",menuVisible:d===e.id,style:A==="end"?{marginInlineStart:`calc(${fe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:fe.spacing[2]}:{marginInlineEnd:`calc(${fe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:fe.spacing[2]},domProps:{onMouseDown:ie=>{ie.stopPropagation(),L.toggleContextMenu(ie.target)}}},B=((Ge=e.components)==null?void 0:Ge.MenuIcon)||(l==null?void 0:l.MenuIcon)||oo,$=he.createElement(B,C({},H)),_={dragging:R,domRef:z,insideColumnMenu:!1,column:e,columnsMap:M,columnSortInfo:D,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:S,allRowsSelected:T,selectionMode:b,api:t,columnApi:L,renderBag:{sortIcon:Z,filterIcon:X,menuIcon:$,menuIconProps:H,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},k=_,G=()=>{var Gn;let ie=P(C({},_),{renderBag:C({},_.renderBag)});if(e.renderSortIcon&&(ie.renderBag.sortIcon=he.createElement(Gt,{render:e.renderSortIcon,renderParam:P(C({},ie),{renderBag:C({},ie.renderBag)})})),e.renderFilterIcon&&(ie.renderBag.filterIcon=he.createElement(Gt,{render:e.renderFilterIcon,renderParam:P(C({},ie),{renderBag:C({},ie.renderBag)})})),typeof e.renderMenuIcon=="function"&&(ie.renderBag.menuIcon=he.createElement(Gt,{render:ct=>{if(typeof e.renderMenuIcon!="function")return null;let Ut=e.renderMenuIcon(ct);return Ut?Ut.type===B||Ut.type===oo?Ut:he.createElement(B,C({},H),Ut):null},renderParam:P(C({},ie),{renderBag:C({},ie.renderBag)})})),e.renderSelectionCheckBox&&b==="multi-row"){ie.renderBag.selectionCheckBox=he.createElement(Gt,{render:Qh,renderParam:P(C({},ie),{renderBag:C({},ie.renderBag)})});let ct=(Gn=e.renderHeaderSelectionCheckBox)!=null?Gn:e.renderSelectionCheckBox;ct&&ct!==!0&&(ie.renderBag.selectionCheckBox=he.createElement(Gt,{render:ct,renderParam:P(C({},ie),{renderBag:C({},ie.renderBag)})}))}V instanceof Function&&(ie.renderBag.header=he.createElement(Gt,{render:V,renderParam:P(C({},ie),{renderBag:C({},ie.renderBag)})}));let Qe=e.renderMenuIcon===!1?null:ie.renderBag.menuIcon,zr=ee?he.createElement("div",{className:mt},ie.renderBag.header):ie.renderBag.header,Le=he.createElement(he.Fragment,null,A==="center"?ki:null,ie.renderBag.selectionCheckBox,zr,ie.renderBag.sortIcon,ie.renderBag.filterIcon,A==="center"?ki:null,A!=="center"?ki:null,Qe);return e.renderHeader?he.createElement(Gt,{render:e.renderHeader,renderParam:P(C({},ie),{renderBag:P(C({},ie.renderBag),{all:Le})})}):Le},W=Zh(null);Xh(()=>{let ie=null,Qe=W.current;return v&&Qe&&(ie=Kn(Qe,v)),()=>{ie==null||ie()}},[W.current,o.onResize]);let Q={height:I};e.headerStyle&&(Q=typeof e.headerStyle=="function"?C(C({},Q),e.headerStyle(k)||{}):C(C({},Q),e.headerStyle));let Y=typeof e.headerClassName=="function"?e.headerClassName(k):e.headerClassName,{onPointerDown:te,proxyPosition:ge}=Au({columnId:e.id,domRef:W}),ye=null;R&&ge&&(ye=he.createElement("div",{key:e.id,className:`${nn}Proxy ${Hs}`,style:{position:"absolute",height:I,width:w,left:(oe=ge.left)!=null?oe:0,top:(Be=ge.top)!=null?Be:0,zIndex:1e9}},k.renderBag.header),ye=Jh(ye,s.current));let ke=sr.Provider,je={filtered:e.computedFiltered,verticalAlign:O,align:A},at=he.useMemo(()=>{let ie=Qe=>{t.setColumnFilter(e.id,Qe)};return g>0?St(ie,{wait:g}):ie},[g,e.id]),Ce=e.computedFilterType,De=y[Ce],$e=e.computedFilterable?(Te=(We=e.computedFilterValue)==null?void 0:We.filter.operator)!=null?Te:De==null?void 0:De.defaultOperator:void 0,de=e.computedFilterable&&De?De.operators.find(ie=>ie.name===$e):void 0,Bt=((Fe=de==null?void 0:de.components)==null?void 0:Fe.FilterEditor)||((Je=De==null?void 0:De.components)==null?void 0:Je.FilterEditor)||((st=e.components)==null?void 0:st.FilterEditor)||bn,lt=((ut=De==null?void 0:De.components)==null?void 0:ut.FilterOperatorSwitch)||((Ct=e.components)==null?void 0:Ct.FilterOperatorSwitch),Mt=pc(e),Wt=`var(${eg}-${e.computedVisibleIndex})`;Q.zIndex=Wt;let jt={"data-field":`${e.field||""}`,"data-column-id":e.id,"data-header-align":A,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${(Et=e.computedSortIndex)!=null?Et:-1}`};return he.createElement(ke,{value:k},he.createElement(lr,P(C({domRef:z,cellType:"header",column:e},jt),{"data-z-index":Wt,style:Q,width:w,onPointerDown:te,contentClassName:J(Ls(je),ms[A]),contentStyle:a?{height:I/2}:void 0,className:J(nn,ys.none,K?ps.pointer:"",Y,tr(e,[nn,en],Ns,{dragging:R,align:A,verticalAlign:O,rowSelected:!1,cellSelected:!1,zebra:!1,rowActive:!1,firstRow:!0,groupCell:!1,groupRow:!1,rowExpanded:!1}),Gs),cssEllipsis:ee,afterChildren:he.createElement(he.Fragment,null,a?e.computedFilterable?he.createElement(cu,{filterEditor:Bt,filterOperatorSwitch:lt!=null?lt:du,operator:de,filterTypes:y,onChange:at,columnFilterType:Ce,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:u}):he.createElement(pu,null):null,Mt),renderChildren:G})),ye)}function Qo(){return qh(sr)}import*as ot from"react";function hc(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((c,d)=>{var R,v,I,w;let p=c.id,f=o[d-1],m=(R=f==null?void 0:f.id)!=null?R:"",h=new Set,g=(f==null?void 0:f.computedPinned)!==c.computedPinned?new Set:(v=a.get(m))!=null?v:new Set;a.set(p,h);let y={type:"column",id:p,ref:c,groupOffset:0,computedPinned:c.computedPinned,computedWidth:c.computedWidth,depth:c.columnGroup?((I=t.get(c.columnGroup))!=null?I:0)+1:0};r.set([p],y);let T=c.columnGroup,S,b=y;for(;T;){let x=e[T];if(x){h.add(T);let M=[p,...h];S=g.has(T)?i.get(T):void 0,S||(S={id:T,type:"group",ref:x,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[T],computedWidth:0,computedPinned:y.computedPinned,depth:(w=t.get(T))!=null?w:0},r.set(M,S),i.set(T,S)),S.columnItems.push(y),S.uniqueGroupId.push(y.id),b&&!g.has(b.id)&&S.children.push(b),b=S,T=x.columnGroup}else break}});let l=[],s=new le,u=0;return r.forEach(c=>{if(!c.ref.columnGroup){let d=c.type==="column"?c.ref.computedWidth:c.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);c.groupOffset=u,c.computedWidth=d,c.type==="group"&&gc(c.children),l.push(c),u+=d}if(c.type==="group")c.columnItems.forEach(d=>{s.set([c.depth,d.ref.computedVisibleIndex],c)});else for(let d=c.depth;d<=n+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function gc(o,e=0){o.forEach(t=>{let n=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=n,t.groupOffset=e,t.type==="group"&&gc(t.children),e+=n})}import*as on from"react";import{useCallback as ag,useEffect as lg,useRef as sg}from"react";import*as Bi from"react";import*as Tc from"react";import{useCallback as yc}from"react";import{useRef as Cc,useState as tg}from"react";import*as io from"react";var{rootClassName:ng}=Ie,og=`${ng}HeaderCell_ResizeHandle`;function rg(o){let e=Cc(null),[t,n]=tg(!1),r=Cc(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,u=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let h=!0,g=lc(o.groupColumns.map(b=>b.computedVisibleIndex),{columns:o.columns,domRef:e}),y=b=>{a==="end"&&(b*=-1);let{constrained:R,adjustedDiffs:v,adjustedDiff:I}=o.computeResize(b);return r.current!==R&&n(R),g.resize(v),I},T=b=>{if(h){let R=o.groupColumns.reduce((w,x)=>w+x.computedWidth-x.computedMinWidth,0),v=o.brain.getAvailableSize(),I={width:v.width+R,height:v.height};o.brain.setAvailableSize(I),h=!1}y(Math.round(b.clientX-f))},S=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",T),m.removeEventListener("pointerup",S);let R=Math.round(b.clientX-f),v=y(R);o.onResize(v)};m.addEventListener("pointermove",T),m.addEventListener("pointerup",S)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:fe.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return io.createElement("div",{ref:e,className:`${og} ${ur} ${dr({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},io.createElement("div",{style:C(C({},c),o.style),className:cr({constrained:t})}))}var Sc=io.memo(rg);function bc(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:u}=ne(),c=o[o.length-1],d=yc(h=>{let g=l(),{columnSizing:y,viewportReservedWidth:T,bodySize:S}=g,b=s().computedVisibleColumns,R=!1,v=b.reduce((x,M)=>(M.computedFlex&&(x[M.id]=P(C({},y[M.id]),{flex:M.computedWidth}),R=!0),x),{}),I=R?C(C({},y),v):y;return nu({availableSize:S.width,reservedWidth:T||0,dragHandleOffset:h,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:I,columnGroupSize:o.length,items:b.map(x=>({id:x.id,resizable:x.computedResizable,computedFlex:x.computedFlex,computedWidth:x.computedWidth,computedMinWidth:x.computedMinWidth,computedMaxWidth:x.computedMaxWidth}))})},[c]),p=yc(h=>{let{columnSizing:g,reservedWidth:y}=d(h);u.viewportReservedWidth=y,u.columnSizing=g},[d]);return o.some(h=>h.computedResizable)?Tc.createElement(Sc,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var Rc=`${nt}HeaderGroup`,wc=q(j.columnWidthAtIndex),ig=q(j.columnZIndexAtIndex);function Ic(o){let{columnGroup:e,height:t,columns:n,bodyBrain:r,columnGroupsMaxDepth:i}=o,{header:a}=e;a instanceof Function&&(a=a({columnGroup:e}));let l=bc(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),s=n[0],u=n.length>1?"calc( "+n.map(d=>`var(${wc}-${d.computedVisibleIndex})`).join(" + ")+" )":`var(${wc}-${s.computedVisibleIndex})`,c=`calc(var(${ig}-${s.computedVisibleIndex}) + ${i-e.depth})`;return Bi.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:J($s,Rc),style:{width:u,height:t},"data-z-index":c},Bi.createElement("div",{className:J(`${Rc}__header-content`,mt)},a),l)}var{rootClassName:ug}=Ie,xc=`${ug}Header`;function cg(o){let{bodyBrain:e,headerBrain:t,columns:n,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=o,{computed:u,state:{headerBrain:c,headerOptions:d,showColumnFilters:p}}=ne(),{computedColumnsMap:f}=u;lg(()=>{let T=b=>{m.current&&(m.current.style.transform=`translate3d(-${b.scrollLeft}px, 0px, 0px)`)};return t.onScroll(T)},[t]);let m=sg(null),h=Ks({overflow:!1}),g={ref:m,className:J(xc,`${xc}--virtualized`,i,h),style:P(C({},r),{height:a})},y=ag(T=>{let{rowIndex:S,colIndex:b,domRef:R,height:v,widthWithColspan:I,heightWithRowspan:w,hidden:x}=T,M=n[b];if(!M||x)return null;let D=l?l.pathsToCells.get([S,b]):null;if(D&&D.type==="group"){let V=D.columnItems.map(F=>F.ref),z=P(C({},D.ref),{id:D.id,uniqueGroupId:D.uniqueGroupId,depth:D.depth,columns:V.map(F=>F.id),computedWidth:D.computedWidth,groupOffset:D.groupOffset});return on.createElement(Ic,{bodyBrain:e,columnGroupsMaxDepth:s,domRef:R,columns:V,width:I,height:v,columnGroup:z})}return on.createElement(fc,{domRef:R,column:M,headerOptions:d,width:I,height:w,columnsMap:f})},[d,n,a,l,s,p]);return on.createElement("div",C({},g),on.createElement(Ho,{name:"header",renderCell:y,brain:c,cellHoverClassNames:[]}))}var vc=on.memo(cg);function Pc(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,r=ne(),{computedPinnedStartColumns:i,computedPinnedEndColumns:a,computedVisibleColumns:l,columnSize:s}=r.computed,{state:{columnHeaderHeight:u,columnGroupsDepthsMap:c,columnGroupsMaxDepth:d,computedColumnGroups:p,showColumnFilters:f}}=r,m=!p||!Object.keys(p).length?1:d+2,h=m*u+(f?u:0),g=ot.useMemo(()=>{if(!(!p||!Object.keys(p).length))return hc(l,p,c,d)},[l,p,c]),y=ot.useCallback(({rowIndex:I,colIndex:w})=>{let x=l[w],M=1,D=1;if(!x||!g)return{rowspan:M,colspan:D};let V=g.pathsToCells.get([I,w]);if(!V)return{rowspan:M,colspan:D};if(V.type==="column")return{colspan:D,rowspan:m-V.depth};let z=V.columnItems.findIndex(F=>F.id===x.id);return{rowspan:M,colspan:z===0?V.columnItems.length:1}},[p,d,l,g,m,c]),T=ot.useCallback(({rowIndex:I,colIndex:w})=>y({rowIndex:I,colIndex:w}).rowspan,[y]),S=ot.useCallback(({rowIndex:I,colIndex:w})=>y({rowIndex:I,colIndex:w}).colspan,[y]),b=ot.useCallback(I=>f?I<m-1?u:2*u:u,[m,f,u]);Ko(e,{colWidth:s,rowHeight:b,rows:m,cols:l.length,height:h,rowspan:T,colspan:S},{fixedColsEnd:a.length,fixedColsStart:i.length});let R=ot.createElement(vc,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:h,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:g}),v=n.vertical&&Xt()?ot.createElement("div",{className:Ys,style:{zIndex:1e3,width:Xt()}}):null;return ot.createElement("div",{className:Js,style:{height:h}},R,v)}import*as wt from"react";import{useEffect as dg}from"react";function Dc(o,e){let{separator:t}=e!=null?e:{separator:"-"};return o.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Mc={padding:fe.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},pg={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},Ec=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(Dc(t),n,"important")},Ac=wt.forwardRef(function(e,t){let{rootClassName:n}=Bo(),r=wt.useRef(null),i=wt.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return dg(()=>{let a=()=>{be(()=>{var s;Ec(r.current,Mc),Ec((s=r.current)==null?void 0:s.firstElementChild,pg)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),wt.createElement("div",P(C({ref:i},e),{className:J(`${n}-Footer`,mu,e.className),style:Mc}),"Powered by"," ",wt.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});import*as vn from"react";var Fc={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw1c _16lm1iw1e _16lm1iw1j _16lm1iw1h",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw1c _16lm1iw1e _16lm1iw1j _16lm1iw1h"},_c="qy58ya3 _16lm1iw2 _16lm1iw1c _16lm1iw1e _16lm1iw1j _16lm1iw1h",Oc="qy58ya4";var{rootClassName:mg}=Ie,Wi=`${mg}-LoadMask`;function fg(o){let{visible:e,children:t="Loading"}=o;return vn.createElement("div",{className:`${Fc[e?"visible":"hidden"]} ${Wi}`},vn.createElement("div",{className:`${_c} ${Wi}-Overlay`}),vn.createElement("div",{className:`${Oc} ${Wi}-Text`},t))}var pr=vn.memo(fg);function ji(o){return o.map(Ht)}function Ht(o){if(xe().structuredClone)return xe().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return ji(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(ji(Array.from(o)));if(o instanceof Map)return new Map(ji(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=Ht(o[t]));return e}function ao(o){return o}var rn=Object.seal({data:null,field:null});var Nt="____root____",zc="____not_loaded_yet____";function mr(){return!1}function Gc(o){if(!o||!Object.keys(o).length)return{};let e={};for(let t in o)if(o.hasOwnProperty(t)){let n=o[t].initialValue;e[t]=typeof n=="function"?n():n}return e}function Ui(o,e,t,n,r){var i;if(!(!t||!Object.keys(t).length)){for(let a in t)if(t.hasOwnProperty(a)){let l=t[a];if(typeof l.reducer!="function")continue;let s=n[a],u=l.getter?(i=l.getter(o))!=null?i:null:l.field?o[l.field]:null;n[a]=l.reducer(s,u,o,e,r)}}}function Lc(o,e){let{reducers:t={},pivot:n,groupBy:r,indexer:i,toPrimaryKey:a,cache:l,mappings:s}=o,u=new le;function c(g,y,T,S=0,b=[]){let R=!T.length||S===T.length-1,v=y[(s==null?void 0:s.values)||"values"]||{};for(let I in v)if(v.hasOwnProperty(I)){let w=I;b.push(w),d.set(b,!0),g.set(b,{reducerResults:v[I][(s==null?void 0:s.totals)||"totals"]||{},items:[]}),R||c(g,v[I],T,S+1,b),b.pop()}}let d=n?new le:void 0,p=[],f=Gc(t),m=Ht(f);e.visitDepthFirst((g,y,T,S)=>{let[b,...R]=y,v=g.children,I=u.get(R);if(I&&(I.cache=g.cache,I.childrenLoading=g.childrenLoading,I.childrenAvailable=g.childrenAvailable,I.error=g.error),R.length==r.length&&r.length){if(I){I.items=v;for(let w=0,x=R.length;w<x;w++){let M=R.slice(0,w),D=u.get(M);D&&(D.items=D.items||[],D.items=D.items.concat(v))}i.indexArray(v,{toPrimaryKey:a,cache:l})}return S==null?void 0:S()}for(let w=0,x=v.length;w<x;w++){if(!v[w]){let z={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1};u.set([...R,`${zc}${w}`],z);continue}let M=v[w].data,D=v[w].keys||[];if(D.length){let z=D[D.length-1];R.push(z)}let V={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:M,totalChildrenCount:v[w].totalChildrenCount,reducerResults:v[w].aggregations||{}};if(u.set(R,V),n){let z=V.pivotDeepMap=new le,F=v[w].pivot;c(z,F,n,0,p)}D.length&&R.pop()}S==null||S()});let h={deepMap:u,groupParams:o,initialData:e,reducerResults:m};return n&&(h.topLevelPivotColumns=d,h.pivot=n),h}function Vc(o,e,t,n,r,i,a,l,s,u=ao){let{items:c,reducerResults:d,pivotDeepMap:p}=o.get(e);if(c.push(n),a&&Ui(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:h,valueGetter:g,toKey:y}=i[f],T=h?n[h]:null;g&&(rn.data=n,rn.field=h,T=g(rn));let S=(y||u)(T,n);t.push(S),p.has(t)||(l.set(t,!0),p==null||p.set(t,{reducerResults:Ht(s),items:[]}));let{reducerResults:b,items:R}=p.get(t);R.push(n),a&&Ui(n,r,a,b,e)}t.length=0}}function Yi(o,e){let{groupBy:t,defaultToKey:n=ao,pivot:r,reducers:i}=o,a=t.length,l=r?new le:void 0,s=new le,u=[],c=[],d=Gc(i),p=Ht(d);if(!a){let m={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Ht(d)};r&&(m.pivotDeepMap=new le),s.set(u,m)}for(let m=0,h=e.length;m<h;m++){let g=e[m],y={};for(let T=0;T<a;T++){let{field:S,groupField:b,valueGetter:R,toKey:v}=t[T],I=S?g[S]:null;R&&(rn.data=g,rn.field=S,I=R(rn));let w=(v||n)(I,g);if(y[S||b]=w,u.push(w),!s.has(u)){let x={items:[],cache:!1,commonData:C({},y),childrenLoading:!1,childrenAvailable:!1,reducerResults:Ht(d)};r&&(x.pivotDeepMap=new le),s.set(u,x)}Vc(s,u,c,g,m,r,i,l,d,n)}a||Vc(s,u,c,g,m,r,i,l,d,n),i&&Ui(g,m,i,p,u),u.length=0}i&&s.visitDepthFirst((m,h,g,y)=>{$i(i,m.reducerResults,m.items),r&&m.pivotDeepMap.visitDepthFirst(({items:T,reducerResults:S},b,R,v)=>{$i(i,S,T),v==null||v()}),y==null||y()}),i&&$i(i,p,e);let f={deepMap:s,groupParams:o,initialData:e,reducerResults:p};return r&&(f.topLevelPivotColumns=l,f.pivot=r),f}function hg(o){let{groupParams:e,deepMap:t}=o,n=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===n){let l=t.get(a).items;i.push(...l)}return i},r),r}function gg(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:u,pivotDeepMap:c,commonData:d}=e,p=d!=null?d:null,f;if(Object.keys(u).length>0){p=C({},d),f={};for(let T in i)if(i.hasOwnProperty(T)){let b=i[T].field;b&&(f[b]=u[T]),b&&p[b]==null&&(p[b]=u[T])}}let m=!0,h=n[n.length-1],g=h;if(p!=null){let T=t[n.length-1];T&&T.field&&(g=p[T.field]),T&&T.toKey&&(g=T.toKey(g,p)),g=g!=null?g:h}return typeof g=="string"&&g.startsWith(zc)&&(m=!1,g=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,isCellSelected:mr,hasSelectedCells:mr,selfLoaded:m,error:o.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:g,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function $i(o,e,t){if(o){for(let n in o)if(o.hasOwnProperty(n)){let r=o[n];r.done&&(e[n]=r.done(e[n],t))}}return e}function Hc(o){let{lazyLoad:e,groupResult:t,withRowInfo:n,toPrimaryKey:r,groupRowsState:i,isRowSelected:a,rowSelectionState:l,generateGroupRows:s,reducers:u={}}=o,{groupParams:c,deepMap:d,pivot:p}=t,{groupBy:f}=c,m=[],h=[],g=[],y=[];return d.visitDepthFirst((T,S,b,R)=>{var F,E;let v=T.items,I=S.length,w=(F=i==null?void 0:i.isGroupRowCollapsed(S))!=null?F:!1;y.push(b);let x=gg({lazyLoad:e,groupBy:f,parents:Array.from(g),reducers:u,indexInGroup:b,indexInParentGroups:Array.from(y),indexInAll:m.length,groupKeys:S,error:T.error,totalChildrenCount:T.totalChildrenCount,childrenLoading:(T.childrenLoading||!w&&!T.childrenAvailable)&&e,childrenAvailable:T.childrenAvailable,directChildrenCount:S.length===f.length?T.items.length:d.getDirectChildrenSizeFor(S),directChildrenLoadedCount:0},T);if(a&&(x.rowSelected=a(x),l)){let A=l.getSelectionCountFor(x.groupKeys);x.selectedChildredCount=A.selectedCount,x.deselectedChildredCount=A.deselectedCount}let M=g[g.length-1],D=(E=M==null?void 0:M.collapsed)!=null?E:!1;D&&(w=!0),x.collapsed=w;let V=s||w;D&&(V=!1),V&&(m.push(x),h.push(m.length-1)),x.collapsedChildrenCount=0,g.forEach(A=>{A.deepRowInfoArray.push(x),A.collapsedGroupsCount+=w?1:0}),M&&x.selfLoaded&&e&&(M.directChildrenLoadedCount+=1),n&&n(x),g.push(x);let z=!0;if(z){if(R)R();else if(!p){let A=m.length;w||(m.length+=v.length);for(let O=0,L=v.length;O<L;O++){let K=v[O],Z=A+O,X={id:K?r(K,Z):`${S}-${O}`,data:K,isCellSelected:mr,hasSelectedCells:mr,dataSourceHasGrouping:!0,isGroupRow:!1,selfLoaded:!!K,rowSelected:!1,rootGroupBy:f,collapsed:w,groupKeys:S,parents:Array.from(g),indexInParentGroups:[...y,O],indexInGroup:O,indexInAll:Z,groupBy:f,groupNesting:I+1,groupCount:x.groupCount};a&&(X.rowSelected=a(X)),n&&n(X),g.forEach((ee,H)=>{H===g.length-1&&K&&(ee.directChildrenLoadedCount+=1),w&&(ee.collapsedChildrenCount+=1),ee.deepRowInfoArray.push(X)}),w||(m[A+O]=X)}}}g.pop(),y.pop()}),{data:m,groupRowsIndexes:h}}import*as ht from"react";import{useEffect as cd,useLayoutEffect as ud}from"react";var Cg=function(o,e){return o-e},Sg=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},yg=function(o,e){return o-e},Tg={number:Cg,string:Sg,date:yg},lo=Tg;var It=(o,e,t)=>{let n=o.map(r=>Array.isArray(r.field)?r.field.map((i,a)=>{var u;let l=Array.isArray(r.type)?(u=r.type[a])!=null?u:r.type[0]:r.type;return typeof i=="function"?P(C({},r),{valueGetter:i,field:void 0,type:l}):P(C({},r),{type:l,field:i})}):r).flat();return e.sort(wg(n,t)),e};It.knownTypes=lo;var bg=o=>{if(!o)return;let e=o.field,t=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let r=o.fn;if(!r&&o.type){let i=Array.isArray(o.type)?o.type[0]:o.type;r=It.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(It.knownTypes).join(", ")}`)}return r||(r=lo.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,u=r(l,s);return u===0?u:n*u}},Rg=o=>o.map(bg).filter(e=>e instanceof Function),wg=(o,e)=>{let t=Rg(o);return(n,r)=>{e&&(n=e(n),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(n,r),i!==0))return i;return i}};var xt=class{constructor(){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,n)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:n}),this.primaryKeyToData.set(r,i)};this.insert=(e,t,n,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:n,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.update=(e,t,n,r)=>{this.allFieldsAffected||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:n,metadata:r}),this.primaryKeyToData.set(e,a)};this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutations=()=>new Map(this.primaryKeyToData)}static clone(e,{light:t=!1}={}){let n=new xt;return n.allFieldsAffected=e.allFieldsAffected,n.affectedFields=new Set(e.affectedFields),n.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),n}};function Pn(o,e){return e().dataArray[o]}function fr(o){return o().dataArray}function Nc(o){return new qi(o)}var qi=class{constructor(e){this.pendingOperations=[];this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>fr(this.getState);this.getRowInfoByIndex=e=>{var t;return(t=Pn(e,this.getState))!=null?t:null};this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>{var n;return(n=this.getState().idToIndexMap.get(e))!=null?n:-1};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByPrimaryKey=e=>{var n;let{indexer:t}=this.getState();return(n=t.getDataForPrimaryKey(e))!=null?n:null};this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let n=this.batchOperation({type:"update",array:e,primaryKeys:e.map(r=>this.toPrimaryKey(r)),metadata:t==null?void 0:t.metadata});return t!=null&&t.flush&&this.commit(),n};this.removeDataByPrimaryKey=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t==null?void 0:t.metadata});return t!=null&&t.flush&&this.commit(),n};this.removeData=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:[this.toPrimaryKey(e)],metadata:t==null?void 0:t.metadata});return t!=null&&t.flush&&this.commit(),n};this.removeDataArrayByPrimaryKeys=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e,metadata:t==null?void 0:t.metadata});return t!=null&&t.flush&&this.commit(),n};this.removeDataArray=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e.map(this.toPrimaryKey),metadata:t==null?void 0:t.metadata});return t!=null&&t.flush&&this.commit(),n};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,P(C({},t),{position:"end"}));this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let n="before",r;if(t.position==="before"||t.position==="after")n=t.position,r=t.primaryKey;else{let a=this.getOriginalDataArray();t.position==="start"?(n="before",r=this.toPrimaryKey(a[0])):(n="after",r=this.toPrimaryKey(a[a.length-1]))}let i=this.batchOperation({type:"insert",array:e,position:n,metadata:t==null?void 0:t.metadata,primaryKey:r});return t!=null&&t.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.getState=e.getState,this.actions=e.actions}batchOperation(e){return this.pendingPromise||(this.pendingPromise=new Promise(t=>{this.resolvePendingPromise=t}),be(()=>{this.commit()})),this.pendingOperations.push(e),this.pendingPromise}batchOperations(e){this.pendingOperations.push(...e)}commitOperations(e){if(!e.length)return;let t=this.getState().cache,n=t?xt.clone(t,{light:!0}):new xt;e.forEach(r=>{switch(r.type){case"update":r.array.forEach((l,s)=>{let u=r.primaryKeys[s],c=this.getRowInfoByPrimaryKey(u);c&&!c.isGroupRow&&n.update(r.primaryKeys[s],l,c.data,r.metadata)});break;case"delete":r.primaryKeys.forEach(l=>{let s=this.getRowInfoByPrimaryKey(l);s&&!s.isGroupRow&&n.delete(l,s.data,r.metadata)});break;case"insert":let i=r.primaryKey,a=r.position;r.array.forEach(l=>{n.insert(i,l,a,r.metadata),i=this.toPrimaryKey(l),a="after"});break}}),this.actions.cache=n}commit(){if(this.commitOperations(this.pendingOperations),this.pendingOperations.length=0,this.pendingPromise&&this.resolvePendingPromise){let e=this.resolvePendingPromise;requestAnimationFrame(()=>{e(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}}};function Kc(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=e.getAffectedFields(),{sortInfo:l,groupBy:s,filterValue:u,aggregationReducers:c}=o;if(l&&l.length)if(a===!0)t=!0;else for(let d of l){let p=d.field;if(p&&(p=Array.isArray(p)?p:[p],t=p.reduce((f,m)=>f||typeof m!="function"?a.has(m):!1,!1),t))break}if(s&&s.length){if(a===!0)n=!0;else for(let d of s)if(d.field&&a.has(d.field)){n=!0;break}}if(u&&u.length)if(a===!0)r=!0;else for(let d of u){if(d.id){r=!0;break}if(d.field&&a.has(d.field)){r=!0;break}}if(c&&Object.keys(c).length){if(a===!0)i=!0;else for(let d in c)if(c.hasOwnProperty(d)){let p=c[d];if(p.field){if(a.has(p.field)){i=!0;break}}else{i=!0;break}}}return{sortInfo:t,groupBy:n,filterValue:r,aggregationReducers:i}}var hr=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){var e,t;(e=this.positiveMap)==null||e.clear(),(t=this.negativeMap)==null||t.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(r=>[r,!0]))):this.negativeMap=new le(n.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 le(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){var t,n;if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!((t=this.negativeMap)!=null&&t.has(e))}return(n=this.positiveMap)==null?void 0:n.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){var n;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`;(n=this.positiveMap)==null||n.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var qe=class extends hr{constructor(e){super(e)}getState(){var e,t,n,r;return{expandedRows:this.allPositive?!0:(t=(e=this.positiveMap)==null?void 0:e.topDownKeys())!=null?t:[],collapsedRows:this.allNegative?!0:(r=(n=this.negativeMap)==null?void 0:n.topDownKeys())!=null?r:[]}}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{useEffect as An,useMemo as qc,useRef as oa,useState as Dg}from"react";import{useEffect as kc,useRef as Xi}from"react";function Dn(o,e){let t=Xi({}),n=Xi({}),r=n.current,i=Xi({}),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,kc(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=o(s,r)),i.current={},n.current={},u},l)}function BE(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);kc(o,t)}function Bc(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function Zi(o){let{pivotByAtIndex:e,pivotAggregator:t}=o;return e!=null&&e.column&&(typeof e.column=="function"?Object.assign(o,e.column({column:o})):Object.assign(o,e.column)),t!=null&&t.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(o,t.pivotColumn({column:o})):Object.assign(o,t.pivotColumn)),o}function Ji(o){let{pivotByAtIndex:e}=o;return e!=null&&e.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(o,e.columnGroup({columnGroup:o})):Object.assign(o,e.columnGroup)),o}function Wc({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>P(C({},r[f]),{id:f}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},u={},c=Ft(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Zi({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>{var g;return h.isGroupRow?(g=h.reducerResults)==null?void 0:g[f.id]:null}})})});(!a&&t==="start"||n==="start")&&c();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,h,g)=>{if(m=[...m],t==="end"&&(g==null||g()),m.length===a){let y=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let b=S;S=m.join("/");let R=m[m.length-1];u[S]=Ji({header:`${R}`,columnGroup:b,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:y,pivotIndex:m.length-1,pivotGroupKey:R})}l.forEach((b,R)=>{let v=d?`${m[m.length-1]}`:b.name||b.id,I=Zi({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:b,pivotAggregatorIndex:R,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:y,defaultSortable:!1,columnGroup:S,header:v,valueFormatter:({rowInfo:x})=>{var M,D;return x.isGroupRow?(D=(M=x.pivotValuesMap)==null?void 0:M.get(m))==null?void 0:D.reducerResults[b.id]:null}}),w=`${b.id}:${m.join("/")}`;s[w]=I})}else{let y=m.join("/"),T=m.slice(0,-1);if(u[y]=Ji({columnGroup:T.length?T.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],b=T.length?T.join("/"):void 0;if(!d){let R=b;b=`total:${m.join("/")}`,u[b]=Ji({header:`${m[m.length-1]} total`,columnGroup:R,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((R,v)=>{let I=d?`${m[m.length-1]} total `:`${R.name||R.id} total`,w=Zi({columnGroup:b,header:I,pivotAggregator:R,pivotAggregatorIndex:v,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:x})=>{var M,D;return x.isGroupRow?(D=(M=x.pivotValuesMap)==null?void 0:M.get(m))==null?void 0:D.reducerResults[R.id]:null}});s[`total:${R.id}:${m.join("/")}`]=w})}}(t==="start"||t===!1)&&(g==null||g())}),(!a&&t==="end"||n==="end")&&c(),{columns:s,columnGroups:u}}function Mn(o,e){return e.reduce((t,n)=>{let{field:r,valueGetter:i,toKey:a}=n,l=r?o[r]:i==null?void 0:i({data:o,field:r}),s=(a||ao)(l,o);return t.push(s),t},[])}function gr(o,e){return new pe(o,Ke(e))}function Ke(o){return()=>{let e=typeof o=="function"?o():o;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function jc(o){let{getDataSourceState:e,dataSourceActions:t}=o;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 pe))throw"Invalid row selection";let a=new pe(r,Ke(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 pe))throw"Invalid row selection";let a=new pe(r,Ke(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=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 pe))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?Mn(c,u):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=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 pe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Mn(d,u):[]}let c=new pe(a,Ke(e));c.selectRow(r,i),t.rowSelection=c},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:u}=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 pe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Mn(d,u):[]}let c=new pe(l,Ke(e));c.deselectRow(r,i),t.rowSelection=c}},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 pe))throw"Invalid row selection";let s=new pe(a,Ke(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 pe))throw"Invalid row selection";let s=new pe(a,Ke(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 pe))throw"Invalid row selection";let s=new pe(a,Ke(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new pe(i,Ke(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof pe))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new pe(r,Ke(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 u=i.toPrimaryKey(s);a.isRowSelected(u)&&l.push(u)}),l}}}var Ig=et("CellSelectionState"),xg="*",Ae=class{constructor(e){this.wildcard=xg;this.cache=new le;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;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,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let u=this.deselectedColumnsToRows.get(t),c=this.selectedColumnsToRows.get(t);u==null||u.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),c==null||c.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let u=this.deselectedRowsToColumns.get(t),c=this.selectedRowsToColumns.get(t);u==null||u.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),c==null||c.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(u=>{this.cache.delete(u)}),this.cache.delete(s),n)if(this.defaultSelection){let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1);let c=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(c!=null&&c.has(t)||d!=null&&d.has(e))&&this.setCellInSelection(e,t,!0)}else{let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection){let u=this.selectedRowsToColumns.get(e);u!=null&&u.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0)}else{let u=this.selectedRowsToColumns.get(e);u!=null&&u.has(t)&&this.setCellInSelection(e,t,!1);let c=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(c!=null&&c.has(t)||d!=null&&d.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,n){if(n){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(n){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,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){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(n){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,n=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)}),n&&n.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 n=this.selectedRowsToColumns.get(e);if(n){if(n.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=>n.has(r)):!1}return!1}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(console.error("CellSelectionState.isCellSelected should not be called with wildcard"),Ig("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){var m,h;let n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),u=this.deselectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let g=this.deselectedRowsToColumns.get(e);return g&&g.has(t)?a():s!=null&&s.has(e)||u!=null&&u.has(t)?(m=this.selectedRowsToColumns.get(e))!=null&&m.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():c!=null&&c.has(e)||d!=null&&d.has(t)?(h=this.deselectedRowsToColumns.get(e))!=null&&h.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var pe=class{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new le;this.deselectedMap=new le;this.onlyUsePrimaryKeys=!1;this.selectionCache=new le;this.selectionCountCache=new le;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,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Mn(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){var r;if(e.length==0)return this.getConfig().totalCount;let t=this.getGroupDeepMap(),n=t==null?void 0:t.get(e);return n?(r=n.totalChildrenCount)!=null?r:n.items.length||0:0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return(t==null?void 0:t.getKeysStartingWith(e,!0,1))||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return((t==null?void 0:t.getKeysStartingWith([],!0,1))||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let n=t==null?void 0:t.get(e);return n?n.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,n){return new pe(e,t,n)}update(e){var t,n;this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),(t=this.selectedRows)==null||t.forEach(this._selectedMapSet),(n=this.deselectedRows)==null||n.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()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}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 n=[...t,e],r=this.selectionCache.get(n);if(r!==void 0)return r;let i=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(i)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(n,!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(n,!0),!0;if(s)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,n){t?this.setRowAsSelected(e,n):this.setRowAsDeselected(e,n)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:n,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=n&&r?null:!!n;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],n=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!n?!0:n&&!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,!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,!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 n=[...t,e];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(n),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 n=[...t,e];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(n),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){var u,c;let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let d=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,d),d}if(r&&this.onlyUsePrimaryKeys){let d=this.getAllPrimaryKeysInsideGroup(e),p=0,f=0;d.forEach(h=>{if(this.defaultSelection){if(this.deselectedMap.has([h])){f++;return}p++}else{if(this.selectedMap.has([h])){p++;return}f++}});let m={selectedCount:p,deselectedCount:f};return this.selectionCountCache.set(e,m),m}t=t!=null?t:this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let d=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,p=this.getGroupCount(e),f=this.selectedMap.getKeysStartingWith(e,!0,1).length,m=this.deselectedMap.getKeysStartingWith(e,!0,1).length,h=p-(f+m),g={selectedCount:f+(d?h:0),deselectedCount:m+(d?0:h)};return this.selectionCountCache.set(e,g),g}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let d=((c=(u=this.getConfig().groupDeepMap)==null?void 0:u.get(e))==null?void 0:c.totalChildrenCount)||0;t?(a=d,l=this.deselectedMap.getAllChildrenSizeFor(e),l===d&&(a=0)):(l=d,a=this.selectedMap.getAllChildrenSizeFor(e),a===d&&(l=0))}i.forEach(d=>{let p=this.selectedMap.get(d),f=this.deselectedMap.get(d),m=p?!0:f?!1:t,{selectedCount:h,deselectedCount:g}=this.getSelectionCountFor(d,m);a+=h,l+=g});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};function Qi(o){if(!o)return;let e=Object.keys(o);if(!e.length)return;let t={};for(let n=0,r=e.length;n<r;n++){let i=e[n],a=o[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function ea(o){let e=o.reducerKeys,t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;n[a]=l(n[a],o.rowInfo)}}function ta(o){let e=Object.keys(o.reducers||{});if(!e.length||!o.results)return o.results;let t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}function na(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var En=(o,e,t)=>{for(let n=0,r=t.length;n<r;n++){let i=t[n],a=o[i],l=e[i];if(a!==l)return!0}return!1};function $c(){return!1}function vg(o,e,t,n,r){let i={dataSourceHasGrouping:!1,data:o,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,isCellSelected:$c,hasSelectedCells:$c};return n&&(i.rowSelected=n(i)),r&&(i.isCellSelected=a=>r.isCellSelected(i.id,a),i.hasSelectedCells=a=>r.isCellSelectionInRow(i.id,a)),i}function Pg(o){let{filterTypes:e,operatorsByFilterType:t,filterFunction:n,toPrimaryKey:r}=o,{dataArray:i}=o;n&&(i=i.filter((l,s,u)=>n({data:l,index:s,dataArray:u,primaryKey:r(l,s)})));let a=na(o.filterValue,e)||[];return a&&a.length?i.filter((l,s,u)=>{var d;let c={data:l,index:s,dataArray:u,primaryKey:r(l,s),field:void 0};for(let p=0,f=a.length;p<f;p++){let m=a[p],{disabled:h,field:g,valueGetter:y,filter:{type:T,value:S,operator:b}}=m,R=e[T];if(h||!R)continue;let v=(d=t[T])==null?void 0:d[b];if(!v)continue;let w=y||R.valueGetter||(({data:M,field:D})=>D?M[D]:M);c.field=g;let x=c;if(x.filterValue=S,x.currentValue=w(x),x.emptyValues=R.emptyValues,!v.fn(x))return!1}return!0}):i}function Uc(o){var H,B;let{state:e,previousState:t}=o,n=Kc(e),r=e.sortInfo,i=e.sortMode,a=r!=null&&r.length?i==="local":!1;(e.lazyLoad||e.livePagination)&&(a=!1);let l=En(t,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]),s=t&&e.data!==t.data,u=e.lazyLoad&&t&&(t.groupBy!==e.groupBy||t.sortInfo!==e.sortInfo);s&&(u=!0),u&&(e.originalLazyGroupData=new le,l=!0);let c=e.cache?xt.clone(e.cache):void 0;c&&!c.isEmpty()&&(l=!0);let d=e.toPrimaryKey,p;l&&(e.indexer.clear(),e.lazyLoad||(p=c==null?void 0:c.getMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:d,cache:c}))),c&&(c.clear(),e.cache=void 0);let{filterFunction:m,filterValue:h,filterTypes:g,operatorsByFilterType:y}=e,T=!!m||Array.isArray(h)&&h.length,S=T&&e.filterMode==="local",b=En(t,e,["filterFunction","filterValue","filterTypes"]),R=l||b,v=En(t,e,["sortInfo"]),I=l||b||v,w=e.filterMode==="local"&&(R||!e.lastFilterDataArray),x=a&&(I||!e.lastSortDataArray||n.sortInfo),M=e.groupBy,D=e.pivotBy,V=M.length>0||!!D,z=En(t,e,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),F=l||I||En(t,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation"]),E=En(t,e,["rowInfoReducers"]),A=V&&(F||!e.lastGroupDataArray||n.groupBy)||z||E,O=Date.now(),L=e.originalDataArray;if(T||(e.unfilteredCount=L.length),S&&(e.unfilteredCount=L.length,L=w?Pg({dataArray:L,toPrimaryKey:d,filterTypes:g,operatorsByFilterType:y,filterFunction:m,filterValue:h}):e.lastFilterDataArray,e.lastFilterDataArray=L,e.filteredAt=O),e.filteredCount=L.length,e.postFilterDataArray=L,a){let $=It.knownTypes;It.knownTypes=C(C({},$),e.sortTypes);let _=e.sortFunction||It;L=x?_(r,[...L]):e.lastSortDataArray,It.knownTypes=$,e.lastSortDataArray=L,e.sortedAt=O}e.postSortDataArray=L;let K=e.dataArray,Z=e.rowSelection instanceof pe?e.rowSelection:void 0,re=e.cellSelection instanceof Ae?e.cellSelection:void 0;Z==null||Z.xcache();let X=e.selectionMode==="single-row"?$=>$.id===e.rowSelection:e.selectionMode==="multi-row"?$=>{let _=Z;return $.isGroupRow?_.getGroupRowSelectionState($.groupKeys):_.isRowSelected($.id,$.dataSourceHasGrouping?$.groupKeys:void 0)}:void 0;e.isRowSelected&&e.selectionMode==="multi-row"&&(X=$=>e.isRowSelected($,Z,e.selectionMode));let ee=e.rowInfoReducers;if(V){if(A){let $=e.aggregationReducers,_=e.lazyLoad?Lc({groupBy:M,pivot:D,mappings:e.pivotMappings,reducers:$,indexer:e.indexer,toPrimaryKey:d,cache:c},e.originalLazyGroupData):Yi({groupBy:M,pivot:D,reducers:$},L);e.groupDeepMap=_.deepMap,Z&&(Z.getConfig=Ke(e));let k=Object.keys(ee||{}),G=Qi(ee),W={reducers:ee,results:G,reducerKeys:k,rowInfo:{}},Q=G?ke=>{W.rowInfo=ke,ea(W)}:void 0,Y=re?ke=>{ke.isCellSelected=je=>re.isCellSelected(ke.id,je)}:void 0,te=Q||Y?Bc(Q,Y):void 0,ge=Hc({groupResult:_,lazyLoad:!!e.lazyLoad,reducers:$,toPrimaryKey:d,isRowSelected:X,rowSelectionState:Z,withRowInfo:te,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});K=ge.data,e.rowInfoReducerResults=ta({reducers:ee,results:G,array:K}),e.groupRowsIndexesInDataArray=ge.groupRowsIndexes,e.reducerResults=_.reducerResults;let ye=D?Wc({deepMap:_.topLevelPivotColumns,pivotBy:D,pivotTotalColumnPosition:(H=e.pivotTotalColumnPosition)!=null?H:"end",pivotGrandTotalColumnPosition:(B=e.pivotGrandTotalColumnPosition)!=null?B:!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=ye==null?void 0:ye.columns,e.pivotColumnGroups=ye==null?void 0:ye.columnGroups}else K=e.lastGroupDataArray;e.lastGroupDataArray=K,e.groupedAt=O}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,t.postSortDataArray!=e.postSortDataArray||F||z||E){let _=Object.keys(ee||{}),k=Qi(ee),G={reducers:ee,results:k,reducerKeys:_,rowInfo:{}};K=L.map((W,Q)=>{let Y=vg(W,W?d(W):Q,Q,X,re);return k&&(G.rowInfo=Y,ea(G)),Y}),e.rowInfoReducerResults=ta({reducers:ee,results:k,array:K})}if(e.postGroupDataArray=K,K!==e.dataArray&&(e.updatedAt=O),e.dataArray=K,e.reducedAt=O,e.selectionMode==="multi-row")if(V&&e.lazyLoad){let $=!0,_=!1;e.dataArray.forEach(k=>{if(k.isGroupRow&&k.groupKeys.length===1){let{rowSelected:G}=k;G!==!0&&($=!1),(G===!0||G===null)&&(_=!0)}}),e.allRowsSelected=$,e.someRowsSelected=_}else{let $=e.filteredCount,_=e.rowSelection.getSelectedCount();e.allRowsSelected=$===_,e.someRowsSelected=_>0}return e.originalDataArrayChanged=l,l&&(e.originalDataArrayChangedInfo={timestamp:O,mutations:p!=null&&p.size?p:void 0}),e}function rt(){var e;let o=(e=xe().performance)==null?void 0:e.now();return`${Date.now()}:${o}`}var Mg=!0,Eg=()=>new Promise(o=>{be(o)}),Ag={originalDataArray:!0,changes:!0},Fg={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function vt(o,e,t){var l,s;let n=o.multiSort?o.sortInfo:(s=(l=o.sortInfo)==null?void 0:l[0])!=null?s:null,r={append:!1,originalDataArray:o.originalDataArray,sortInfo:n,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(r.livePaginationCursor=o.livePaginationCursor,r.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=o.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let u=Xc(r.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});u&&u.length&&(r.filterValue=u)}let i={},a=o.dataParams||{};for(let u in r)if(r.hasOwnProperty(u)&&!Ag[u]){let c=u,d=Fg[c],p=r[c],f=a[c];(d?d(p,f):p===f)||(i[c]=!0)}return r.changes=i,r}function an(o,e,t,n,r){let i=vt(e,n,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,u=[Nt,...i.groupKeys||[]],c=s.get(u);if(!c){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(c&&c.cache&&u.length>1){let d=c.children,p=d.length,f=!0;for(let m=0;m<p;m++)if(d[m]==null){f=!1;break}if(f)return Promise.resolve(!0)}c?c.childrenLoading||(c.childrenLoading=!0):s.set(u,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Mg,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=rt()}typeof o=="function"&&(o=o(i));let l=typeof o=="object"&&typeof o.then=="function";return l&&!e.lazyLoad&&(t.loading=!0),Promise.resolve(o).then(s=>{let u=[],c=!1;if(Array.isArray(s.data)){let p=s;if(u=p.data,p.livePaginationCursor!==void 0&&(t.livePaginationCursor=p.livePaginationCursor),p.mappings&&(t.pivotMappings=p.mappings),p.totalCountUnfiltered&&(t.unfilteredCount=p.totalCountUnfiltered),e.lazyLoad){let m=function(h,g,y){var I,w,x,M;let T=[Nt,...h],S=g.data,b={cache:!!g.cache,childrenLoading:!1,childrenAvailable:!0,totalCount:(I=g.totalCount)!=null?I:S.length,totalCountUnfiltered:(w=g.totalCount)!=null?w:S.length,children:S,error:g.error},R=[];if(i.lazyLoadBatchSize&&!y){let D=f.get(T),V=!D,z=au({children:!0},D||{},b);V&&(z.chidren=[]),z.children.length=z.totalCount;let F=(x=i.lazyLoadStartIndex)!=null?x:0,E=Math.min((M=g.totalCount)!=null?M:S.length,F+i.lazyLoadBatchSize);for(let A=F;A<E;A++){let O=b.children[A-F];if(!O)throw`lazily loaded item not found at index ${A-F}`;z.children[A]=O,O.dataset&&R.push({keys:O.keys,dataset:O.dataset})}V&&f.set(T,z)}else b.children.forEach(D=>{D&&D.dataset&&R.push({keys:D.keys,dataset:D.dataset})}),b.children.length=b.totalCount,f.set(T,b);let v=!1;if(!h||!h.length){let D=f.get([Nt]);t.originalDataArray=[...D.children],v=!0}if(v||(t.originalLazyGroupDataChangeDetect=rt()),R.length){let D=h;R.forEach(({keys:V,dataset:z})=>{m(V,z,D)})}};var d=m;let f=e.originalLazyGroupData;c=!0,m(i.groupKeys||[],p)}}else u=s;c||(t.originalDataArray=a?e.originalDataArray.concat(u):u),l&&!e.lazyLoad&&(t.loading=!1)})}function Xc(o,{filterTypes:e,filterMode:t}){return t==="local"?o:(na(o,e)||[]).map(n=>{let r=C({},n);return delete r.valueGetter,r})}function Yc(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function Zc(){let{getComponentState:o,componentActions:e,componentState:t}=ve(),{data:n,dataArray:r,notifyScrollbarsChange:i,refetchKey:a,sortInfo:l,sortMode:s,groupMode:u,groupBy:c,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:h,filterTypes:g,cursorId:y}=t,[T,S]=Dg({vertical:!1,horizontal:!1}),b=oa(T);An(()=>(i.onChange(x=>{x&&(b.current=x,S(x))}),()=>i.destroy()),[i]),An(()=>{if(!m)return;let x=requestAnimationFrame(()=>{var M;(M=b.current)!=null&&M.vertical||h&&(e.cursorId=h)});return()=>cancelAnimationFrame(x)},[h]),An(()=>{if(!m||h!==void 0)return;let x=requestAnimationFrame(()=>{var M;(M=b.current)!=null&&M.vertical||y!=null&&r.length&&(e.cursorId=r.length)});return()=>cancelAnimationFrame(x)},[r.length,h]),An(()=>{let x=o(),{livePaginationCursor:M,livePagination:D,dataArray:V}=x;!T.vertical&&D&&(M?e.cursorId=M:M===void 0&&V.length&&(e.cursorId=V.length))},[T.vertical]);let R=qc(()=>Xc(p,{filterTypes:g,filterMode:f}),[p,f,g]),v={sortInfo:s==="remote"?l:null,groupBy:u==="remote"?c:null,pivotBy:d,refetchKey:a,filterValue:R,cursorId:m?y:null},I=oa(!0);_g();let w=Oe(ze());Dn(()=>{let x=o(),M=w(),{isDetail:D,isDetailReady:V}=Yc(M,o);D&&!V||typeof x.data!="function"&&an(x.data,x,e,void 0,M)},{data:n}),Dn(x=>{let M=Object.keys(x),D=!1;if(M.length===1&&(D=!!x.cursorId,x.filterValue&&o().filterMode==="local"))return;let V=w(),{isDetail:z,isDetailReady:F}=Yc(V,o);if(z&&!F)return;let E=o();typeof E.data=="function"&&an(E.data,E,e,{append:D},V)},P(C({},v),{data:n})),Dn(()=>{let x=o();if(I.current){I.current=!1;let M=vt(x,void 0,w());e.dataParams=M}},v)}function _g(){let{getComponentState:o,componentActions:e,componentState:t}=ve();An(()=>{e.lazyLoadCacheOfLoadedBatches=new le},[t.data,t.dataParams]);let{lazyLoadBatchSize:n,lazyLoad:r,originalLazyGroupDataChangeDetect:i,notifyRenderRangeChange:a,dataArray:l,groupRowsState:s,scrollStopDelayUpdatedByTable:u}=t,c=oa(null),d=(f,m=o().lazyLoadCacheOfLoadedBatches)=>{let h=o();if(f=f||c.current,!f)return;let{renderStartIndex:g,renderEndIndex:y}=f,{lazyLoadBatchSize:T,lazyLoad:S}=h;S&&((!T||T<=0)&&(!h.groupBy||h.groupBy.length===0)||Og({startIndex:g,endIndex:y,lazyLoadBatchSize:T,componentState:h,componentActions:e},m))},p=qc(()=>St(d,{wait:u}),[u]);Dn(f=>{if(r)return(f.originalLazyGroupDataChangeDetect||f.groupRowsState)&&d(a.get()),a.onChange(m=>{c.current=m,d(m)})},{lazyLoadBatchSize:n,lazyLoad:r,originalLazyGroupDataChangeDetect:i,groupRowsState:s}),An(()=>{n&&n>0&&p()},[l])}function Og(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a}=o,{dataArray:l}=i,s=f=>l[f].data!=null,u=new le,c=["_______xxx______"];for(let f=t;f<=n;f++){let m=l[f];if(!m)continue;let h=s(f),g=m.dataSourceHasGrouping&&m.groupKeys?[...m.groupKeys]:[];m.isGroupRow&&m.dataSourceHasGrouping&&m.groupKeys&&g.pop();let y=g.length?g:c,T=m.dataSourceHasGrouping?m.indexInGroup:m.indexInAll;if(m.isGroupRow&&!m.collapsed&&!m.childrenAvailable){let S={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:m.groupKeys},b=m.groupKeys,R=u.get(b);if(!(R!=null&&R[m.id])){let v=!R;R=R||{},R[m.id]||(R[m.id]=S),v&&u.set(b,R)}}if(!h&&r!=null){let S=u.get(y),b=Math.floor(T/r)*r,R=T-b,v=l[m.indexInAll-R].indexInAll,I=s(v),w=l[v].id;if(I||S!=null&&S[w])continue;let x=!S;S=S||{};let M={lazyLoadStartIndex:b,lazyLoadBatchSize:r,groupKeys:g};S[w]||(S[w]=M),x&&u.set(y,S)}}let d=Promise.resolve(!0),p=[];u.topDownValues().forEach(f=>{p.push(...Object.values(f))}),p.reduce((f,m)=>{let h=[...m.groupKeys,m.lazyLoadStartIndex];if(e&&e.has(h))return f;e==null||e.set(h,!0);let g=[i.data,i,a,m];return f.then(()=>Eg()).then(()=>an(...g))},d)}var ra=new WeakMap,Vg=o=>o;function Jc(o,e=50,t){ra.set(o,{lastCallTime:0,lastCallArg:null});let n=t!=null?t:Vg;return r=>{let{lastCallTime:i,lastCallArg:a}=ra.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=Vt(n(a),n(r));s<e&&u||(ra.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var Cr=class{constructor(){this.primaryKeyToData=new Map;this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.clear=()=>{this.primaryKeyToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.indexArray=(e,t)=>{let{cache:n,toPrimaryKey:r}=t;n&&!n.isEmpty()&&(e=e.concat());for(let i=0;i<e.length;i++){let a=e[i],l=!1;if(a!=null){let s=r(a),u=n==null?void 0:n.getMutationsForPrimaryKey(s);if(u&&u.length){for(let c=0,d=u.length;c<d;c++){let p=u[c];if(p.type==="delete"&&!l&&(this.primaryKeyToData.delete(s),l=!0,e.splice(i,1)),p.type==="update"&&!l&&(a=C(C({},a),p.data),e[i]=a),p.type==="insert"){let f=r(p.data);this.add(f,p.data),p.position==="before"?(e.splice(i,0,p.data),i--):e.splice(i+1,0,p.data)}}n==null||n.removeInfo(s)}l||this.add(s,a)}}return e}}};var zg=Object.freeze([]),Qc=(o,e)=>{let t=o!=null?o:zg,n=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===n.length)return r}return e&&t&&e.set(t,n),n};var Gg=Symbol("cursorId");function td(){let o=Date.now(),e=[],t=[],n=new le;return{indexer:new Cr,destroyedRef:{current:!1},idToIndexMap:new Map,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},lazyLoadCacheOfLoadedBatches:new le,dataParams:void 0,onCleanup:we(),notifyScrollbarsChange:we(),notifyScrollStop:we(),notifyRenderRangeChange:we(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:n,originalLazyGroupDataChangeDetect:0,originalDataArray:e,cursorId:Gg,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:t,unfilteredCount:t.length,filteredCount:t.length,updatedAt:o,groupedAt:0,sortedAt:0,filteredAt:0,reducedAt:o,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0}}function Lg(o){let e=C({},o);return delete e.originalDataArray,e}var Hg=[],nd=o=>{o.destroyedRef.current=!0},od=o=>({onDataParamsChange:e=>e?Jc(e,100,Lg):void 0,lazyLoad:e=>!!e,data:1,debugId:1,pivotBy:1,primaryKey:1,livePagination:1,refetchKey:e=>e!=null?e:"",filterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:e=>e!=null?e:!1,filterDelay:e=>e!=null?e:200,filterTypes:e=>C(C({},Zt),e),sortTypes:e=>C(C({},lo),e),sortFunction:1,onReady:1,rowInfoReducers:(e,t)=>{let n={initialValue:()=>{t.idToIndexMap.clear()},reducer:(r,i)=>{t.idToIndexMap.set(i.id,i.indexInAll)}};return e?P(C({},e),{__idToIndex:n}):{__idToIndex:n}},isRowSelected:1,onDataArrayChange:1,onDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:e=>e!=null?e:!0,loading:e=>e!=null?e:!1,sortInfo:e=>Qc(e,o.propsCache.get("sortInfo")),groupBy:e=>e!=null?e:Hg});function Ng(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}var ed=new WeakMap;function rd(o){var y,T,S,b;let{props:e,state:t,oldState:n}=o,r=qn(e.sortInfo),i=qn(e.filterValue),{filterTypes:a}=t,l=Object.keys(a).reduce((R,v)=>{let I=a[v].operators;R[v]=R[v]||{};let w=R[v];return I.forEach(x=>{w[x.name]=x}),R},{}),s=e.selectionMode;if(s===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)s="multi-cell";else{let R=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;R!==void 0&&(R&&typeof R=="object"?s="multi-row":s="single-row"),s=s!=null?s:!1}let u=null,c=null,d=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,p=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(s!==!1&&((s==="single-row"||s==="multi-row")&&(d===null?u=s==="single-row"?null:new pe({selectedRows:[],deselectedRows:[],defaultSelection:!1},Ke(t)):s==="single-row"||d instanceof pe?u=d:u=new pe(d,Ke(t))),s==="single-cell"||s==="multi-cell"))if(p===null)c=s==="single-cell"?null:new Ae;else if(p instanceof Ae)c=p;else{let R=(y=ed.get(p))!=null?y:new Ae(p);ed.set(p,R),c=R}let f=t.primaryKey,m=typeof f=="function"?R=>f(R):R=>R[f],h=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;h&&!(h instanceof qe)&&(h=new qe(h)),h=h||new qe(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let g={selectionMode:s,groupRowsState:h,rowSelection:u,cellSelection:c,toPrimaryKey:m,operatorsByFilterType:l,controlledSort:r,controlledFilter:i,groupMode:typeof e.data=="function"&&(T=e.groupMode)!=null?T:"local",sortMode:e.sortFunction?"local":(S=e.sortMode)!=null?S:r?"remote":"local",filterMode:typeof e.filterFunction=="function"?"local":(b=e.filterMode)!=null?b:typeof e.data=="function"?"remote":"local",multiSort:Array.isArray(r?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let R=!n||n.originalDataArray!==t.originalDataArray,v=typeof e.livePaginationCursor=="function"?R?Ng(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;g.livePaginationCursor=v}return g}var Kg=et("DataSource:fullLazyLoad");function id(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&Kg('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new qe({collapsedRows:!0,expandedRows:[]})))}var kg=et("DataSource:dataParams");function ad(){return{rowSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},cellSelection:(o,e)=>e.selectionMode==="single-cell"?{callbackParams:[o instanceof Ae?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function ld(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=vt(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&be(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=vt(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&be(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=vt(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&be(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=vt(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&be(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=vt(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=vt(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>Vt(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(kg("onDataParamsChange triggered because the following values have changed",o==null?void 0:o.changes),!0)}}function sd(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}var ia=class{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t!=null?t:ia.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.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}},so=ia;so.DEFAULT_SIZE=10;var aa=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},Sr=class{constructor(e){this.storage=new so(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)}},la=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)}},uo=class{constructor(e){this.cacheStorage=e===!1?new aa:e===!0?new la:typeof e=="number"?new Sr(e):new Sr(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 yr=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){var e,t;(e=this.positiveMap)==null||e.clear(),(t=this.negativeMap)==null||t.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of n)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){var t,n;if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!((t=this.negativeMap)!=null&&t.has(e))}return!!((n=this.positiveMap)!=null&&n.has(e))}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){var n;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`;(n=this.positiveMap)==null||n.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var Ze=class extends yr{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){var r,i,a,l;let t=this.allPositive?!0:[...(i=(r=this.positiveMap)==null?void 0:r.keys())!=null?i:[]],n=this.allNegative?!0:[...(l=(a=this.negativeMap)==null?void 0:a.keys())!=null?l:[]];return{expandedRows:t,collapsedRows:n}}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,n){return this.setItemValue(t,n)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var Bg=(e=>(e.INIT="INIT",e))(Bg||{});function Wg(o){let{children:e}=o,{api:t,componentState:n}=me();return typeof e=="function"&&(e=e(n)),cd(()=>{var r;(r=n.onReady)==null||r.call(n,t)},[]),ht.createElement(ht.Fragment,null,e)}var jg=bt({initSetupState:td,forwardProps:od,concludeReducer:Uc,mapPropsToState:rd,onPropChange:id,cleanup:nd,interceptActions:ld(),mappedCallbacks:ad()});function $g({children:o,isDetail:e}){let t=kn(),n=ze(),r=Oe(n),{componentState:i,componentActions:a,assignState:l}=ve();i.getDataSourceMasterContextRef.current=r;let s=Oe(i),[u]=ht.useState(()=>Nc({getState:s,actions:a})),c={componentState:i,componentActions:a,getDataSourceMasterContext:r,getState:s,assignState:l,api:u};return ud(()=>{n&&n.registerDetail(c)},[]),ud(()=>()=>{let d=s();d.onCleanup(d)},[]),Zc(),cd(()=>{var d;(d=i.onDataArrayChange)==null||d.call(i,i.originalDataArray,i.originalDataArrayChangedInfo),i.onDataMutations&&i.originalDataArrayChangedInfo.mutations&&i.originalDataArrayChangedInfo.mutations.size&&i.onDataMutations({primaryKeyField:typeof i.primaryKey=="string"?i.primaryKey:void 0,dataArray:i.originalDataArray,mutations:i.originalDataArrayChangedInfo.mutations,timestamp:i.originalDataArrayChangedInfo.timestamp})},[i.originalDataArrayChangedInfo]),ht.createElement(t.Provider,{value:c},ht.createElement(Wg,{children:o}))}function N1(o){let e=ze(),t=!!e,n=t?e.masterRowInfo.id:"master";return ht.createElement(jg,P(C({},o),{key:n}),ht.createElement($g,{children:o.children,isDetail:t}))}function K1(){let{rowInfoReducerResults:o}=un();return o}function k1(){let o=ze();if(o)return o.masterRowInfo}function sa(o){let{getComputed:e,getState:t,actions:n}=o,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){n.columnMenuVisibleKey=Date.now();return}function s(f,m){let h=l[u+f*m],g=a.get(h);if(g&&g.renderMenuIcon!==!1)return h}let u=l.indexOf(r),c=0,d=-1,p;for(;!p&&c<l.length&&(c++,p=s(c,d),p||(d*=-1,p=s(c,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function ua(o){if(o==null)return!1;let e=o;return!0}function Ug(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}function da(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}var ca=class{constructor(e){this.getCellSelectionPosition=e=>{var r,i,a;let t=(i=e.rowId)!=null?i:(r=Pn(e.rowIndex,this.getDataSourceState))==null?void 0:r.id,n=(a=e.colId)!=null?a:this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,n]};this.setRangeSelected=(e,t,n)=>{let i=this.getDataSourceState().cellSelection;if(!i)return;let a=new Ae(i),[l,s]=this.getCellSelectionPosition(e),[u,c]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(c);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,h=Pn(l,this.getDataSourceState),g=Pn(u,this.getDataSourceState);if(!h||!g)return;let y=h.indexInAll,T=g.indexInAll,[S,b]=da({rowIndex:y,colIndex:f},{rowIndex:T,colIndex:m});for(let R=S.rowIndex;R<=b.rowIndex;R++)for(let v=S.colIndex;v<=b.colIndex;v++){let I={rowIndex:R,colIndex:v},[w,x]=this.getCellSelectionPosition(I);n?a.selectCell(w,x):a.deselectCell(w,x)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=fr(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let u=Ug(Array.from(a),i),c=l.map(d=>u.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:u,positions:c}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let n=new Ae(t);n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let n=new Ae(t);n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{var r,i;let[t,n]=this.getCellSelectionPosition(e);return(i=(r=this.getDataSourceState().cellSelection)==null?void 0:r.isCellSelected(t,n))!=null?i:!1};this.selectCell=e=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let[n,r]=this.getCellSelectionPosition(e),i=e.clear?new Ae:new Ae(t);i.selectCell(n,r),this.dataSourceActions.cellSelection=i};this.deselectCell=e=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let[n,r]=this.getCellSelectionPosition(e),i=new Ae(t);i.deselectCell(n,r),this.dataSourceActions.cellSelection=i};this.selectColumn=(e,t)=>{t!=null&&t.clear&&this.deselectAll();let n=this.getDataSourceState().cellSelection;if(!n)return;let r=new Ae(n);r.selectColumn(e),this.dataSourceActions.cellSelection=r};this.deselectColumn=e=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let n=new Ae(t);n.deselectColumn(e),this.dataSourceActions.cellSelection=n};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function dd(o){return new ca(o)}function pd(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new Ze({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new Ze({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 Ze(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,n.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 Ze(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,n.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function md(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var pa=class{constructor(e){this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};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(n=>t.has(n))};this.persistEdit=e=>_e(this,null,function*(){var d,p;e=e!=null?e:{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));yield new Promise(f=>requestAnimationFrame(f));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=(d=e.value)!=null?d:t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell=P(C({},t),{active:!1,waiting:"persist"}));let a=P(C({},Ye(P(C({rowIndex:t.rowIndex,columnId:t.columnId},this.context),{api:this}))),{value:i,initialValue:t.initialValue}),l=i;n.current=null,r.getValueToPersist&&(l=yield r.getValueToPersist(a)),a.value=l,t.value=l;let s=(p=this.getState().persistEdit)!=null?p:()=>{if(!a.column.field)return i;let f=this.getDataSourceState().primaryKey,m=a.data&&typeof f=="string"?{[f]:a.data[f],[a.column.field]:l}:P(C({},a.data),{[a.column.field]:l});return this.context.dataSourceApi.updateData(m)},u;try{u=yield s(a)}catch(f){u=f}let c=u instanceof Error?u:!0;return this.actions.editingCell=P(C({},t),{active:!1,accepted:!1,waiting:!1,persisted:c}),Promise.resolve(c)});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:n}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===n&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=e=>_e(this,null,function*(){var a,l;let t=this.getState(),{editingCell:n,editingValueRef:r}=t;if(!n)return!0;e||(e={});let i=(a=e.value)!=null?a:r.current;if(!e.cancel&&!e.reject){let{rowIndex:s,columnId:u}=n;this.actions.editingCell=P(C({},t.editingCell),{value:i,active:!1,waiting:"accept"});let{computedColumnsMap:c}=this.getComputed(),d=c.get(u),p=(l=t.shouldAcceptEdit)!=null?l:d.shouldAcceptEdit,f=p?p(P(C({},Ye(P(C({},this.context),{api:this,dataSourceApi:this.context.dataSourceApi,columnId:u,rowIndex:s}))),{value:i,initialValue:n.initialValue})):!0;return yield new Promise(m=>requestAnimationFrame(m)),Promise.resolve(f).then(m=>{if(m===!0)return this.actions.editingCell=P(C({},t.editingCell),{active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i}),!0;throw m}).catch(m=>(m instanceof Error||(m=new Error(`Edit rejected: ${m}`)),this.actions.editingCell=P(C({},n),{value:i,persisted:!1,active:!1,waiting:!1,accepted:m}),{reject:m,value:i}))}return e.cancel&&(n!=null&&n.active)?(this.actions.editingCell=P(C({},n),{active:!1,cancelled:!0,waiting:!1,persisted:!1}),{cancel:!0,value:i}):e.reject&&(n!=null&&n.active)?(this.actions.editingCell=P(C({},n),{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=>{var t;return(t=this.getComputed().computedVisibleColumns[e])!=null?t:null};this.isCellEditable=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,i=t!=null?t:this.context.dataSourceApi.getIndexByPrimaryKey(n),{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 u=l.computedEditable(Ye(P(C({},this.context),{api:this,columnId:r,rowIndex:i})));return typeof u=="boolean"?Promise.resolve(u):u};this.getColumnApi=e=>Ne(e,P(C({},this.context),{api:this}));this.isColumnSortable=e=>{var t,n;return(n=(t=this.getColumnApi(e))==null?void 0:t.isSortable())!=null?n:!1};this.getCellValue=e=>{var t,n;return(n=(t=this.getCellValues(e))==null?void 0:t.value)!=null?n:null};this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t!=null?t:i.getIndexByPrimaryKey(n),u=l.get(r),c=i.getRowInfoByIndex(s),d=c==null?void 0:c.id;if(!c||!u)return u||console.warn(`No column found with id: "${r}"`),c||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(c)?!1:this.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",h=wn({column:u,rowInfo:c,columnsMap:l,context:P(C({},this.context),{api:p}),rowDetailState:m});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.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.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new qe(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(),n=new qe(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[Nt,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i!=null&&i.cache||an(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i!=null&&i.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=le.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=rt())}};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,n={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let h=i.computedVisibleColumnsMap.get(t);if(!h)return!1;a=h.computedVisibleIndex}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,n),s=r.renderer.getScrollPositionForScrollRowIntoView(e,n);if(!l||!s)return!1;let u={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},c=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=u.scrollLeft>d+(n.offset||0),m=u.scrollTop>p+(n.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=u.scrollLeft),u.scrollTop!==c.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=u.scrollTop),!0)};this.context=e,this.rowSelectionApi=jc({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.rowDetailApi=pd({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=dd({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(){var e;(e=this.getState().scrollerDOMRef.current)==null||e.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(sa(t),e==null||e()),setTimeout(()=>{this.isDestroyed()||(sa(t),e==null||e())},n)}isDestroyed(){return!this.getState().domRef.current}startEdit(e){return _e(this,null,function*(){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n!=null?n:this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(l=>_e(this,null,function*(){var s;if(l){let u=this.getDataSourceState().dataArray,d=this.getComputed().computedColumnsMap.get(t),p=u[a],f=i!=null?i:Yu({column:d,rowInfo:p}),m=f;d.getValueToEdit&&(f=yield d.getValueToEdit(Ye(P(C({},this.context),{rowIndex:a,columnId:t,api:this})))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:f,initialValue:m,rowIndex:a,primaryKey:(s=u[a])==null?void 0:s.id}}return l}))})}setSortingForColumn(e,t,n){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,n);return}let l=i.groupByForColumn,s=i.field,u=l?Array.isArray(l)?l:[l]:[],c=u.map(f=>{var m;return f.valueGetter?h=>f.valueGetter({data:h,field:f.field}):f.field?f.field:(m=f.groupField)!=null?m:void 0}).filter(ua);c.length&&(s=c);let d=i.computedSortType;u.length&&d===Tn&&(d=u.flatMap(m=>{var y;let h=(y=m.field)!=null?y:m.groupField,g=h?r.get(h):null;return g?g.computedSortType:Tn}));let p={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(p.valueGetter=f=>i.valueGetter({data:f,field:i.field})),this.setSortInfoForColumn(e,p,n)}setSortInfoForColumn(e,t,n){var d,p,f;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=(p=(d=r.sortInfo)==null?void 0:d.slice())!=null?p:[];if(t===null){s=s.filter(m=>!md(m,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if(((f=n==null?void 0:n.multiSortBehavior)!=null?f:this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(m=>u?m:md(m,l)?(u=!0,t):m),u||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 n=C({},this.getState().columnPinning);t===!1?delete n[e]:n[e]=t,this.actions.columnPinning=n}setColumnFilter(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(n.computedFilterValue)a=P(C({},n.computedFilterValue),{filter:C({},n.computedFilterValue.filter)});else{let l=n.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(s.field=n.field||n.groupByForColumn),a=s}a.id=n.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){var d;let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=n.computedFilterType,l=i[a].operators,s=(d=l.find(p=>p.name===t))!=null?d:l.find(p=>p.name===i[a].defaultOperator),u=s.name,c;n.computedFilterValue?(c=P(C({},n.computedFilterValue),{filter:P(C({},n.computedFilterValue.filter),{operator:u})}),s.defaultFilterValue!==void 0&&(c.filter.value=s.defaultFilterValue)):(c={filter:{operator:u,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(c.field=n.field)),c.id=n.id,this.setFilterValueForColumn(e,c)}setFilterValueForColumn(e,t){var l;let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=(l=this.getDataSourceState().filterValue)!=null?l:[],a=!1;i=i.map(s=>s===n.computedFilterValue?(a=!0,t):s),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){var a;let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=(a=this.getDataSourceState().filterValue)!=null?a:[],i=!1;r=r.filter(l=>l===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){var a;let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let n=this.getDataSourceState(),r=(a=n.filterValue)!=null?a:[],i=!1;r=r.map(l=>{var s,u,c;if(l===t.computedFilterValue){let d=t.computedFilterValue.filter.type,p=n.operatorsByFilterType[d],f=n.filterTypes[d];if(i=!0,!f)return null;let m=(s=l.filter.operator)!=null?s:f==null?void 0:f.defaultOperator,g=(c=(u=p[m].defaultFilterValue)!=null?u:(f.emptyValues||[])[0])!=null?c:void 0;return P(C({},l),{filter:P(C({},l.filter),{operator:m,value:g})})}return l}).filter(ua),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let n=C({},this.getState().columnVisibility);t?delete n[e]:n[e]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){let t=this.getState();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.scrollTop=Math.max(e,0)}scrollRowIntoView(e,t={offset:0}){let n=this.getState(),r=n.renderer.getScrollPositionForScrollRowIntoView(e,t);if(!r)return!1;let i=n.brain.getScrollPosition(),a=n.brain.scrollTopMax;return r.scrollTop>a+(t.offset||0)?!1:(r.scrollTop!==i.scrollTop&&(n.scrollerDOMRef.current.scrollTop=r.scrollTop),!0)}scrollColumnIntoView(e,t={offset:0}){let n=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=n.brain.getScrollPosition(),u=n.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function fd(o){return new pa(o)}import{useEffect as hd,useRef as Yg,useState as qg}from"react";var Xg=10;function Zg(o,e){var u;let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${en} > .${Vi}`,a=(u=o.current)==null?void 0:u.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let d=c.parentElement,p=d.matches(`.${nn}`);if(t===!1&&p)return;let f=d.getAttribute("data-column-id"),m=c.cloneNode(!0);m.style.visibility="hidden",m.style.pointerEvents="none",m.classList.remove(...mt.split(" ")),m.style.position="absolute",m.style.width="auto",d.appendChild(m);let h=m.offsetWidth;if(d.removeChild(m),!s[f]){let g=xe().getComputedStyle(d);s[f]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+Xg}if(h+=s[f],p){let g=0;d.childNodes.forEach(y=>{if(y!==c){let T=y,S=Math.max(T.offsetWidth,parseInt(T.style.width,10));if(isNaN(S)&&(S=0),g+=S,S>0){let b=xe().getComputedStyle(T);g+=parseInt(b.marginLeft,10)+parseInt(b.marginRight,10)}}}),h+=g}r&&r.has(f)||n&&!n.has(f)||(l[f]=Math.max(h,l[f]||0))}),l}function gd(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=ve(),[a,l]=qg(0),s=typeof r=="object"?r.key:r,u=Oe(s),c=Yg(null);hd(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),hd(()=>{var b;if(s==null)return;let{autoSizeColumnsKey:d}=o(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=(b=d.includeHeader)!=null?b:m),c.current=s;let h=Zg(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),g=Object.keys(h);if(!g.length)return;let y=o().columnSizing,T=C({},y),S=!1;g.forEach(R=>{var v;T[R]={width:h[R]},S=S||T[R].width!==((v=y[R])==null?void 0:v.width)}),S&&(e.columnSizing=T)},[s,n,a])}import{useMemo as iC}from"react";import{useCallback as aC,useEffect as po,useRef as lC}from"react";import*as Tr from"react";function Cd(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return Ko(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}import*as co from"react";var Sd=Se({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as yd,useRef as Jg}from"react";function Qg(o,e){let{masterState:t,detailContext:n}=e,r=t.detailDataSourcesStateToRestore;if(r.has(o)){let i=r.get(o);return n.assignState(i),!0}return!1}function eC(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=sd(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(o,l),r.detailDataSourcesStateToRestore=a}function tC(o,e){let t=Jg(!1);return{currentRowCache:yd(()=>({getRowId:()=>o,add:r=>{t.current=!0,e.add(o,r)},get:()=>e.get(o),delete:()=>(t.current=!0,e.delete(o)),has:()=>e.has(o)}),[e,o]),cacheCalledByRowDetailRenderer:t}}function Td(o){let{rowDetailsCache:e,rowInfo:t}=o,{getState:n,componentActions:r}=me(),{getState:i}=ne(),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=tC(t.id,e),s=yd(()=>{let u=n().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:Ft(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)});return}Qg(t.id,{masterState:n(),detailContext:d}),requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)}),d.componentState.onCleanup.onChange(()=>{let p=a.get();p&&eC(t.id,{detailState:d.getState(),masterActions:r,masterState:n(),cacheEntryForRow:p})})}),shouldRestoreState:u}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}var{rootClassName:nC}=Ie,oC=`${nC}RowDetail`;function rC(o){let e=vo(),{domRef:t,rowDetailRenderer:n,rowDetailHeight:r,rowInfo:i,detailOffset:a,rowDetailsCache:l}=o,{masterDetailContextValue:s,currentRowCache:u}=Td({rowDetailsCache:l,rowInfo:i});return co.createElement(e.Provider,{value:s},co.createElement("div",{ref:t,className:J(oC,Sd({})),style:{position:"absolute",top:`${a}px`,left:0,width:`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,height:r}},n(i,u)))}var bd=co.memo(rC);var sC=1;function Rd(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,state:i,getState:a}=ne(),{computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:u,computedColumnsMap:c,computedRowHeight:d,computedRowSizeCacheForDetails:p,fieldsToColumn:f,rowspan:m,toggleGroupRow:h,columnSize:g}=e,{componentState:y,getState:T,componentActions:S,api:b}=me(),{dataArray:R}=y,v=Oe(R),{rowHeight:I,rowDetailHeight:w,groupRenderStrategy:x,brain:M,showZebraRows:D,rowDetailRenderer:V,isRowDetailExpanded:z,isRowDetailEnabled:F,cellClassName:E,cellStyle:A,rowStyle:O,rowDetailCache:L,rowClassName:K,onScrollToTop:Z,onScrollToBottom:re,scrollToBottomOffset:X,ready:ee}=i,H=y.updatedAt;Cd({columnSize:g,brain:M,computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:u,computedRowHeight:d,dataArray:R,bodySize:t,rowspan:m});let B=lC(0);po(()=>M.onRenderCountChange(()=>{B.current=M.scrollTopMax}),[M]),po(()=>M.onScrollStop(G=>{let{scrollTop:W}=G;W===0&&(Z==null||Z());let Q=X!=null?X:sC;if(W+Q>=B.current){re==null||re();let{livePagination:te,livePaginationCursor:ge,dataArray:ye}=T();te&&(S.cursorId=ge!==void 0?Date.now():ye.length)}}),[M,Z,re]),po(()=>{t.height&&(r.ready=!0)},[!!t.height]),po(()=>{let{onReady:G}=a();G&&G({api:n,dataSourceApi:b})},[ee]);let[,$]=pt();po(()=>{$()},[y]);let _=aC(G=>{let{rowIndex:W,colIndex:Q,heightWithRowspan:Y,domRef:te,hidden:ge,width:ye,onMouseLeave:ke,onMouseEnter:je}=G,Ce=v()[W],De=u[Q];if(!Ce)return null;let $e=p?p.getRowHeight(W):Y,de=!1;return!F||typeof F=="function"&&!F(Ce)?de=!1:z&&(de=z(Ce)?"expanded":"collapsed"),Tr.createElement(ec,C({},{getData:v,virtualized:!0,showZebraRows:D,groupRenderStrategy:x,rowIndex:W,rowInfo:Ce,hidden:ge,toggleGroupRow:h,rowHeight:$e,rowDetailState:de,onMouseEnter:je,onMouseLeave:ke,domRef:te,width:ye,column:De,columnsMap:c,fieldsToColumn:f,rowStyle:O,rowClassName:K,cellStyle:A,cellClassName:E}))},[I,w,p,d,z,v,u,c,f,x,h,D,H,O,K,E,A]),k=iC(()=>{if(z)return G=>{let{rowIndex:W,domRef:Q}=G,te=v()[W];if(!te||!z(te)||!p)return Tr.createElement("div",{ref:Q,className:Ts.hidden});let{rowDetailHeight:ge,rowHeight:ye}=p.getSize(W);return Tr.createElement(bd,{rowInfo:te,rowDetailsCache:L,rowIndex:W,domRef:Q,detailOffset:ye,rowDetailHeight:ge,rowDetailRenderer:V})}},[ee,_,V,w,z,L]);return{renderCell:_,renderDetailRow:k}}import{useEffect as MC,useState as ga}from"react";var br=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:n}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(n);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 n={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition),this.selectRange(this.multiSelectStartPosition,e),this.multiSelectEndPosition=e)}setRangeSelected(e,t,n){let[r,i]=da(e,t),a=this.getCellSelectionPosition(r),l=this.getCellSelectionPosition(i);if(!(!a||!l))for(let s=r.rowIndex;s<=i.rowIndex;s++)for(let u=r.colIndex;u<=i.colIndex;u++){let c=this.getCellSelectionPosition({rowIndex:s,colIndex:u});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))}}deselectRange(e,t){this.setRangeSelected(e,t,!1)}selectRange(e,t){this.setRangeSelected(e,t,!0)}};function wd(o,e){return o<e?[o,e]:[e,o]}var Rr=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[n,r]=wd(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);i.selectRow(l)}}deselectRange(e,t){let[n,r]=wd(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(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 n;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))n=r;else break}this.multiSelectEndIndex=n}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};import{useMemo as uC}from"react";function Id(o){let{getState:e}=me();return uC(()=>o.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,u=o[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}import{useCallback as cC}from"react";var y_=et("useColumnSizeFn");function xd(o){return cC(t=>{let n=o[t];return n?n.computedWidth:0},[o])}import{useEffect as Fn,useLayoutEffect as hC,useMemo as gC}from"react";import{createRef as ln}from"react";var dC={scrollLeft:0,scrollTop:0},mo=class{constructor(){this.scrollPosition=dC;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 n=0,r=t.length;n<r;n++)t[n](e)}};function vd(o){let e=new Map;return Object.keys(o).forEach(t=>{let r=o[t].columnGroup,i=0;for(;r;){let a=o[r];if(!a)break;i++,r=a.columnGroup}e.set(t,i)}),e}import*as Pd from"react";function Dd(o){return(e,t)=>Pd.createElement(o,{key:e.id,rowInfo:e,cache:t})}function pC(o){let e=new fn(o),t=we();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function ma(o){return`.${Qt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Md({debugId:o}){let e={},t=new $n(o),n=new $n("header");t.onScroll(l=>{n.setScrollPosition({scrollLeft:l.scrollLeft,scrollTop:0})});let{renderer:r,onRenderUpdater:i}=pC(t);t.onAvailableSizeChange(l=>{n.setAvailableSize({width:l.width})});let a=ln();return{renderer:r,onRenderUpdater:i,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:l=>{if(!a.current)return null;let s=ma(l);return a.current.querySelector(s)||null},brain:t,headerBrain:n,domRef:a,columnMenuTargetRef:ln(),editingValueRef:ln(),scrollerDOMRef:ln(),portalDOMRef:ln(),focusDetectDOMRef:ln(),activeCellIndicatorDOMRef:ln(),onColumnMenuClick:we(),cellContextMenu:we(),contextMenu:we(),onFilterOperatorMenuClick:we(),onRowHeightCSSVarChange:we(),onRowDetailHeightCSSVarChange:we(),onColumnHeaderHeightCSSVarChange:we(),cellClick:we(),cellMouseDown:we(),keyDown:we(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:e,columnVisibilityForGrouping:{},pinnedStartScrollListener:new mo,pinnedEndScrollListener:new mo,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null}}var Ed=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,cellClassName:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,columnDefaultFlex:1,columnMenuRealignDelay:e=>e!=null?e:50,scrollStopDelay:e=>e!=null?e:250,viewportReservedWidth:e=>e!=null?e:0,resizableColumns:e=>e!=null?e:!0,rowDetailCache:e=>new uo(e),hideColumnWhenGrouped:e=>e!=null?e:!1,columnMinWidth:e=>e!=null?e:30,columnMaxWidth:e=>e!=null?e:5e3,columnDefaultWidth:e=>e!=null?e:200,columnCssEllipsis:e=>e!=null?e:!0,draggableColumns:e=>e!=null?e:!0,headerOptions:e=>C({alwaysReserveSpaceForSortIcon:!0},e),showSeparatePivotColumnForSingleAggregation:e=>e!=null?e:!1,sortable:1,hideEmptyGroupColumns:e=>e!=null?e:!1,pivotTotalColumnPosition:e=>e!=null?e:"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e||"",keyboardSelection:e=>e!=null?e:!0,activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e!=null?e:!0,header:e=>e!=null?e:!0,showZebraRows:e=>e!=null?e:!0,showHoverRows:e=>e!=null?e:!0,virtualizeColumns:e=>e!=null?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!=null?e:{},columnSizing:e=>e||{},columnTypes:e=>e||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:e=>e!=null?e:"replace",collapsedColumnGroups:e=>e!=null?e:new Map,columnGroups:1});function mC(o){let{groupBy:e,groupColumn:t,groupRenderStrategy:n}=o;return n||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Ad=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.onRenderUpdater.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Fd(o){return o.reduce((e,t,n)=>{let r={groupBy:t,groupIndex:n};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var wr=new WeakMap;function _d(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Od=o=>{var h,g,y,T,S;let{props:e,state:t,oldState:n,parentState:r}=o,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=(n==null?void 0:n.columnGroups)||t.pivotColumnGroups&&t.pivotColumnGroups!=(n==null?void 0:n.pivotColumnGroups)?vd(i):t.columnGroupsDepthsMap,l=r==null?void 0:r.groupBy,s=mC({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=(h=e.components)==null?void 0:h.RowDetail;if(!c&&d){let b=wr.get(d);b||(b=Dd(d),wr.set(d,b)),c=b}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof Ze)&&(u=new Ze(u)),u=u||new Ze({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=wr.get(u),f||(f=b=>u.isRowDetailsExpanded(b.id),typeof u=="object"&&wr.set(u,f)));let m=c?e.isRowDetailEnabled||!0:!1;return{rowDetailRenderer:c,rowDetailState:u,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:(g=e.showColumnFilters)!=null?g:!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:(y=e.keyboardNavigation)!=null?y:t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell",columnHeaderCssEllipsis:(S=(T=e.columnHeaderCssEllipsis)!=null?T:e.columnCssEllipsis)!=null?S:!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),0):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||fe.components.Header.columnHeaderHeight:""}};function Vd(o,e){let t={};return Object.keys(o).forEach(n=>{let r=o[n],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[n]=r)}),t}function zd(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l=C({},o.columnVisibility);if(!e)return Object.keys(n).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,u=0,c=r.length;for(let d=0;d<c;d++){let p=r[d],f=i[p];if(f.isGroupRow&&(u=Math.max(u,f.groupNesting-1),u===s-1))break}return Object.keys(n).forEach(d=>{let p=n[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}import{useCallback as fC}from"react";function fa(){let{getState:o,componentActions:e,getDataSourceMasterContext:t}=me();return fC(r=>{let i=o(),a=new qe(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Nt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s!=null&&s.cache||an(i.data,i,e,{groupKeys:r},t()):s!=null&&s.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=le.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=rt())}},[])}function CC(o){return gC(()=>Fd(o),[o])}function Gd(){let{componentState:{groupBy:o},componentActions:e}=me(),{componentState:{groupRenderStrategy:t,pivotTotalColumnPosition:n,pivotGrandTotalColumnPosition:r}}=ve();Fn(()=>{e.generateGroupRows=t!=="inline"},[t]),Fn(()=>{e.pivotTotalColumnPosition=n},[n]),Fn(()=>{r!=null&&(e.pivotGrandTotalColumnPosition=r)},[r]);let i=CC(o);SC(i);let{toggleGroupRow:a}=yC();return TC(i),{toggleGroupRow:a}}function SC(o){let e=fa(),{componentActions:t,componentState:{columns:n,groupRenderStrategy:r}}=ve();function i(a,l,s,u){let c={};if(s==="inline")return Object.keys(a).forEach(d=>{var g,y;let p=a[d],f={},m=l.get(p.field);if(m&&s==="inline"){let{groupIndex:T}=m;f={groupByForColumn:m.groupBy,field:(g=m.groupBy)==null?void 0:g.field,valueGetter:(y=m.groupBy)==null?void 0:y.valueGetter,valueFormatter:({rowInfo:S})=>{var b;return S.isGroupRow?(b=S.groupKeys)==null?void 0:b[T]:S.value},rowspan:({rowInfo:S,dataArray:b})=>{if(!S.isGroupRow)return 1;let R=b[S.indexInAll-1]||{indexInParentGroups:[]};if(!R||!R.dataSourceHasGrouping)return 1;let v=R.indexInParentGroups||[],I=S.indexInParentGroups||[],w=!1;for(let D=0;D<=T;D++){let V=v[D];if(I[D]!==V){w=!0;break}}if(!w)return 1;let x=S.parents[T];return x?x.groupCount-(x.collapsedChildrenCount||0)+(x.collapsedGroupsCount||0):1},renderGroupIcon:rr({groupIndexForColumn:T,groupRenderStrategy:s,toggleGroupRow:u,initialRenderGroupIcon:p.renderGroupIcon}),render:or({groupIndexForColumn:T,groupRenderStrategy:s})}}let h=C(C({},f),p);c[d]=h}),Object.keys(c).length===0?void 0:c}Fn(()=>{(()=>{t.columnsWhenInlineGroupRenderStrategy=i(n,o,r,e)})()},[n,o,r,e])}function yC(){let{componentState:{groupBy:o,pivotBy:e,selectionMode:t}}=me(),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=ve(),f=fa();return Fn(()=>{(()=>{let{columns:h,groupColumnIds:g}=bC({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=h;let y=p().columnOrder;if(g.length&&Array.isArray(y)){let T=new Set(y),S=!1;g.forEach(b=>{T.has(b)||(S=!0,y=[b,...y])}),S&&(n.columnOrder=y)}})()},[r,o,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function TC(o){let{componentState:{dataArray:e,groupRowsIndexesInDataArray:t,groupBy:n,groupRowsState:r,originalLazyGroupDataChangeDetect:i},getState:a}=me(),{getComponentState:l,componentActions:s,componentState:{columnTypes:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}}=ve();hC(()=>{if(f!=="multi-column")return;let m=l(),h=Vd(c,o),g=zd({computedGroupColumns:h,columnVisibility:m.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:t,dataArray:e,groupBy:n,groupByMap:o});Vt(m.columnVisibility,g)||(s.columnVisibility=g)},[a,f,i,n,o,c,p?e:null,p?r:null,p?t:null,p]),Fn(()=>{let m=n.length>0,h=l(),{columnVisibility:g,columnVisibilityForGrouping:y,hideColumnWhenGrouped:T}=h,S=C({},g),b=C({},y),R=!1,v=new Set,I=new Set;Object.keys(c).forEach(w=>{let x=c[w];if(x.defaultHiddenWhenGroupedBy||T!=null)if(x.defaultHiddenWhenGroupedBy==="*"&&m||(x.defaultHiddenWhenGroupedBy===!0||T)&&x.field&&o.get(x.field)||typeof x.defaultHiddenWhenGroupedBy=="string"&&o.get(x.defaultHiddenWhenGroupedBy)||typeof x.defaultHiddenWhenGroupedBy=="object"&&Object.keys(x.defaultHiddenWhenGroupedBy).reduce((D,V)=>D||o.has(V),!1)){if(b[w]!==!1){if(g[w]===!1)return;b[w]=!1,R=!0,v.add(w)}}else b[w]===!1&&(delete b[w],R=!0,I.add(w))}),R&&(s.columnVisibilityForGrouping=b,I.forEach(w=>{delete S[w]}),v.forEach(w=>{S[w]=!1}),s.columnVisibility=S)},[c,u,n,o,d])}function bC(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=o;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,h,g)=>{let y=Nu({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:h,groupCount:g.length,groupRenderStrategy:u,selectionMode:r},c,i),T=y.id||`group-by-${m.field||m.groupField}`;f.push(T),p[T]=y});else if(u==="single-column"&&t.length){let m=Ku({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:u,selectionMode:r},c,i),h=m.id||"group-by";f.push(h),p[h]=m}if(e){let m={};Object.keys(d).forEach(h=>{let g=d[h];g.field&&(m[g.field]=g)}),Object.keys(e).forEach(h=>{var b,R;let g=e[h],y=g.pivotTotalColumn&&g.columnGroup,T=g.pivotTotalColumn&&!g.columnGroup;if(y&&a===!1||T&&l===!1)return;let S=C({},g);if(s&&(typeof s=="function"?S=C(C({},S),s({column:S,pivotBy:n,groupBy:t})):S=C(C({},S),s)),S.inheritFromColumn!==!1){let v=typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:(b=S.pivotAggregator)!=null&&b.field?m[(R=S.pivotAggregator)==null?void 0:R.field]:void 0;S=C(C({},v),S)}!S.render&&S.renderValue&&(S.render=v=>S.renderValue(v)),p[h]=S})}else Object.keys(d).forEach(m=>{let h=d[m];p[m]=h});return{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}import{useMemo as RC}from"react";var Ld=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:u,sortInfo:c,multiSort:d,filterValue:p,filterTypes:f,columnOrder:m,columnPinning:h,editable:g,columnDefaultEditable:y,columnDefaultFilterable:T,columnDefaultSortable:S,scrollbarWidth:b,columnTypes:R,pinnedEndMaxWidth:v,pinnedStartMaxWidth:I,viewportReservedWidth:w,resizableColumns:x,columnVisibility:M,columnVisibilityAssumeVisible:D,columnSizing:V})=>{let{computedRemainingSpace:F,computedColumnOrder:E,computedVisibleColumns:A,computedVisibleColumnsMap:O,computedPinnedStartColumns:L,computedPinnedEndColumns:K,computedUnpinnedColumns:Z,computedPinnedStartColumnsWidth:re,computedPinnedEndColumnsWidth:X,computedUnpinnedColumnsWidth:ee,computedUnpinnedOffset:H,computedPinnedEndOffset:B,computedPinnedEndWidth:$,computedPinnedStartWidth:_,renderSelectionCheckBox:k,computedColumnsMap:G,computedColumnsMapInInitialOrder:W,fieldsToColumn:Q}=RC(()=>lu({columns:o,scrollbarWidth:b,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:w,resizableColumns:x,filterValue:p,filterTypes:f,sortable:a,sortInfo:c,multiSort:d,pinnedEndMaxWidth:v,pinnedStartMaxWidth:I,draggableColumns:u,columnOrder:m,columnPinning:h,columnDefaultEditable:y,columnDefaultFilterable:T,columnDefaultSortable:S,editable:g,columnSizing:V,columnTypes:R,columnVisibility:M,columnVisibilityAssumeVisible:D!=null?D:!0}),[o,e.width,t,n,r,w,b,a,c,d,p,f,m,M,D,x,v,I,V,R,h,y,T,g,1]);return{renderSelectionCheckBox:k,columns:o,computedColumnsMap:G,computedPinnedEndWidth:$,computedPinnedStartWidth:_,computedRemainingSpace:F,computedUnpinnedOffset:H,computedPinnedEndOffset:B,computedPinnedStartColumnsWidth:re,computedPinnedEndColumnsWidth:X,computedUnpinnedColumnsWidth:ee,computedPinnedStartColumns:L,computedPinnedEndColumns:K,computedUnpinnedColumns:Z,computedVisibleColumns:A,computedVisibleColumnsMap:O,computedColumnOrder:E,computedColumnsMapInInitialOrder:W,fieldsToColumn:Q}};import{useMemo as wC}from"react";var ha=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>{var t;return(t=this.rowHeight.get(e))!=null?t:0};this.getRowDetailHeight=e=>{var t;return(t=this.rowDetailHeight.get(e))!=null?t:0}}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),n=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:n,totalRowHeight:t+n}}};function IC(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?n(d):0;return e&&e.rowHeight.set(c,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return c=>{if(e&&e.rowHeight.has(c)&&e.rowDetailHeight.has(c))return e.rowHeight.get(c)+e.rowDetailHeight.get(c);let d=a().dataArray[c];if(!d)return e&&(e.rowHeight.set(c,0),e.rowDetailHeight.set(c,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,m)),p+m}}function Hd(o){return wC(()=>{let e=new ha;return{computedRowHeight:IC(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}},[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}import{useState as xC,useEffect as vC,useLayoutEffect as PC}from"react";var DC={vertical:!1,horizontal:!1};function Nd(o){let{getComponentState:e}=ve(),{getState:t}=me(),[n,r]=xC(DC);return vC(()=>o.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=o;r({vertical:i>0,horizontal:a>0})}),[o]),PC(()=>{let i=t(),{onScrollbarsChange:a}=e(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function Kd(){var at;let{componentActions:o,componentState:e}=ve(),{componentActions:t,componentState:n,getState:r,api:i}=me(),{columnOrder:a,columnVisibility:l,columnPinning:s,columnSizing:u,editable:c,columnDefaultEditable:d,columnDefaultFilterable:p,columnTypes:f,rowHeight:m,rowDetailHeight:h,isRowDetailExpanded:g,isRowDetailEnabled:y,brain:T,bodySize:S,showSeparatePivotColumnForSingleAggregation:b}=e;ga(()=>{e.onRowHeightCSSVarChange.onChange(Ce=>{Ce&&(o.rowHeight=Ce)}),e.onRowDetailHeightCSSVarChange.onChange(Ce=>{Ce&&(o.rowDetailHeight=Ce)}),e.onColumnHeaderHeightCSSVarChange.onChange(Ce=>{Ce&&(o.columnHeaderHeight=Ce)})}),MC(()=>{t.showSeparatePivotColumnForSingleAggregation=b},[b]);let{multiSort:R,filterValue:v,filterTypes:I}=n,{toggleGroupRow:w}=Gd(),x=e.computedColumns,{computedColumnOrder:M,computedVisibleColumns:D,computedVisibleColumnsMap:V,computedPinnedStartColumns:z,computedPinnedEndColumns:F,computedUnpinnedColumns:E,computedPinnedStartColumnsWidth:A,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:L,computedUnpinnedOffset:K,computedPinnedEndOffset:Z,computedRemainingSpace:re,computedPinnedStartWidth:X,computedPinnedEndWidth:ee,renderSelectionCheckBox:H,computedColumnsMap:B,computedColumnsMapInInitialOrder:$,fieldsToColumn:_}=Ld({columns:x,scrollbarWidth:void 0,columnCssEllipsis:e.columnCssEllipsis,columnHeaderCssEllipsis:e.columnHeaderCssEllipsis,columnMinWidth:e.columnMinWidth,columnMaxWidth:e.columnMaxWidth,columnDefaultWidth:e.columnDefaultWidth,columnDefaultFlex:e.columnDefaultFlex,columnDefaultSortable:e.columnDefaultSortable,pinnedStartMaxWidth:e.pinnedStartMaxWidth,pinnedEndMaxWidth:e.pinnedEndMaxWidth,bodySize:S,viewportReservedWidth:e.viewportReservedWidth,resizableColumns:e.resizableColumns,sortable:e.sortable,draggableColumns:e.draggableColumns,sortInfo:(at=n.sortInfo)!=null?at:void 0,multiSort:R,columnOrder:a,columnVisibility:l,columnVisibilityAssumeVisible:!0,columnPinning:s,editable:c,columnDefaultEditable:d,columnDefaultFilterable:p,filterValue:v,filterTypes:I,columnSizing:u,columnTypes:f}),k=Id(D),G=xd(D),W=Nd(T),Q=X?A>X:!1,Y=ee?O>ee:!1,[te]=ga(()=>new Rr({getIdForIndex:De=>r().dataArray[De].id})),ge=Oe(D),[ye]=ga(()=>new br({getPrimaryKeyByIndex:i.getPrimaryKeyByIndex,getColumnIdByIndex:Ce=>{var De;return((De=ge()[Ce])==null?void 0:De.id)||""}})),{computedRowHeight:ke,computedRowSizeCacheForDetails:je}=Hd({rowDetailHeight:h,rowHeight:m,isRowDetailsExpanded:g,isRowDetailsEnabled:y,getDataSourceState:r});return{multiRowSelector:te,multiCellSelector:ye,computedRowSizeCacheForDetails:je,computedRowHeight:ke,scrollbars:W,columnSize:G,rowspan:k,toggleGroupRow:w,computedColumnsMap:B,computedColumnsMapInInitialOrder:$,renderSelectionCheckBox:H,computedPinnedStartOverflow:Q,computedPinnedEndOverflow:Y,computedPinnedStartWidth:X,computedPinnedEndWidth:ee,computedVisibleColumns:D,computedColumnOrder:M,computedRemainingSpace:re,computedVisibleColumnsMap:V,computedPinnedStartColumns:z,computedPinnedEndColumns:F,computedUnpinnedColumns:E,computedPinnedStartColumnsWidth:A,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:L,computedUnpinnedOffset:K,computedPinnedEndOffset:Z,fieldsToColumn:_}}import{useMemo as zC}from"react";function EC(o=3988292384){var e=new Array,t,n,r;for(t=0;t<256;t++){for(r=t,n=8;n>0;n--)(r&1)==1?r=r>>>1^o:r=r>>>1;e[t]=r}return e}function AC(){return 4294967295}function FC(o,e,t){return e=e>>>8^o[t^e&255],e}function _C(o){return o=~o,o=o<0?4294967295+o+1:o,o}function Ca(o,e=3988292384){var t=EC(e),n=0,r;for(n=AC(),r=0;r<o.length;r++)n=FC(t,n,o.charCodeAt(r));return n=_C(n),`${n}`}var OC=o=>{var n;let e=o.reduce((r,i)=>(r.set(i.name,i.value),r),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:(n=e.get("Ref"))!=null?n:""}},kd=(o,e=console.error.bind(console))=>{o=["* * * infinite-table.com * * *",...o];let t=Math.max(Math.max(...o.map(n=>n.length))+4*2,60);o.forEach(n=>{let r=(t-n.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+n+" "+"*".repeat(l))}),e("*".repeat(t))},Bd=(o="",e,t)=>{let n;try{n=VC(o)}catch(a){return kd(["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(n.end);return i<r?(kd([`
1
+ var wm=Object.create;var kr=Object.defineProperty,Im=Object.defineProperties,xm=Object.getOwnPropertyDescriptor,vm=Object.getOwnPropertyDescriptors,Pm=Object.getOwnPropertyNames,So=Object.getOwnPropertySymbols,Dm=Object.getPrototypeOf,Br=Object.prototype.hasOwnProperty,yl=Object.prototype.propertyIsEnumerable;var Wr=Math.pow,Sl=(o,e,t)=>e in o?kr(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,C=(o,e)=>{for(var t in e||(e={}))Br.call(e,t)&&Sl(o,t,e[t]);if(So)for(var t of So(e))yl.call(e,t)&&Sl(o,t,e[t]);return o},D=(o,e)=>Im(o,vm(e));var At=(o,e)=>{var t={};for(var n in o)Br.call(o,n)&&e.indexOf(n)<0&&(t[n]=o[n]);if(o!=null&&So)for(var n of So(o))e.indexOf(n)<0&&yl.call(o,n)&&(t[n]=o[n]);return t};var Mm=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var Em=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Pm(e))!Br.call(o,r)&&r!==t&&kr(o,r,{get:()=>e[r],enumerable:!(n=xm(e,r))||n.enumerable});return o};var jr=(o,e,t)=>(t=o!=null?wm(Dm(o)):{},Em(e||!o||!o.__esModule?kr(t,"default",{value:o,enumerable:!0}):t,o));var _e=(o,e,t)=>new Promise((n,r)=>{var i=s=>{try{l(t.next(s))}catch(u){r(u)}},a=s=>{try{l(t.throw(s))}catch(u){r(u)}},l=s=>s.done?n(s.value):Promise.resolve(s.value).then(i,a);l((t=t.apply(o,e)).next())}),Tl=(o,e,t)=>(e=o[Symbol.asyncIterator],t=(n,r)=>(r=o[n])&&(e[n]=i=>new Promise((a,l,s)=>(i=r.call(o,i),s=i.done,Promise.resolve(i.value).then(u=>a({value:u,done:s}),l)))),e?e.call(o):(o=o[Symbol.iterator](),e={},t("next"),t("return"),e));var Oo=Mm((YT,es)=>{es.exports=function(o,e,t,n,r){var i,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(r===void 0)r=o.length-1;else if(r=r|0,r<n||r>=o.length)throw new RangeError("invalid upper bound");for(;n<=r;)if(i=n+(r-n>>>1),a=+t(o[i],e,i,o),a<0)n=i+1;else if(a>0)r=i-1;else return i;return~n}});function yt(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}import*as se from"react";var Q=(...o)=>o.filter(e=>!!`${e}`).join(" ");import*as Yt from"react";import{useRef as Fl}from"react";function Ft(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var bl=(o,e)=>o-e;var Am=(o,e)=>bl(o.revision,e.revision),ae=class{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,n)=>this.visitKey(n,this.map,[],e))};this.visitDepthFirst=e=>{this.visitWithNext([],e)};this.visitWithNext=(e,t,n=this.map,r,i)=>{if(!n)return;let a=0,l=n.has(this.emptyKey),s=!i;if(r!==void 0){if(r<0)return;r--}let u=(c,d)=>{let p=n.get(d);if(!p)return;let{map:f}=p,m=d===this.emptyKey;if(m&&!s)return;let h=m?[]:[...e,d],g=f?()=>this.visitWithNext(h,t,f,r!==void 0?r-1:void 0):void 0;p.hasOwnProperty("value")?(t(p.value,h,a,g),a++):g==null||g()};l&&(u(void 0,this.emptyKey),s=!1,a=0),n.forEach(u)};this.fill(e)}static clone(e){let t=new ae;return e.visit((n,r)=>{t.set(r,n.value)}),t}fill(e){e&&e.forEach(t=>{let[n,r]=t;this.set(n,r)})}getValuesStartingWith(e,t,n){let r=[];return this.getStartingWith(e,(i,a)=>{r.push(a)},t,n),r}getKeysStartingWith(e,t,n){let r=[];return this.getStartingWith(e,i=>{r.push(i)},t,n),r}getStartingWith(e,t,n,r){let i=this.map,a,l=!1;if(e.length)for(let s=0,u=e.length;s<u;s++){let c=e[s];if(a=i.get(c),!a||!a.map)if(l=!0,s===u-1){l=!0;break}else return;i=a.map}a&&a.value!==void 0&&(n||t(e,a.value)),!l&&this.visitWithNext(e,(s,u,c,d)=>{t(u,s),d==null||d()},i,r,n)}getMapAt(e){let t=this.map,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){var n;let t=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=t.get(a);if(!s||!s.map)return 0;if(t=s.map,l)return(n=t==null?void 0:t.size)!=null?n:0}return 0}set(e,t){let n=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=n.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,n.set(a,s),this.length++):(s.map||(s.map=new Map,n.set(a,s)),s.length++,n=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===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((n,r)=>{let{map:i}=n;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 n=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],u=a===l-1,c=t.get(s);if(u){c&&(c.hasOwnProperty("value")&&(delete c.value,delete c.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),c.map&&c.map.size===0&&delete c.map,c.map||t.delete(s));break}else{if(!c||!c.map){i=!1;break}r.push(c),t=c.map,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&(a==null?void 0:a.size)===0){let s=n[n.length-1],u=e[e.length-1],c=s==null?void 0:s.get(u);c&&(delete c.map,c.hasOwnProperty("value")||s.delete(u))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===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,n,r){let i=t.get(e);if(!i)return;let{map:a}=i,l=e===this.emptyKey?[]:[...n,e],s=Ft(()=>{a&&a.forEach((u,c)=>{this.visitKey(c,a,l,r)})});i.hasOwnProperty("value")&&r(i,l,s),s()}getArray(e){let t=[];return this.visit((n,r)=>{let i=e(D(C({},n),{keys:r}));r.length===0?t.splice(0,0,i):t.push(i)}),t}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let n=[];return t.forEach(r=>{r.value!==void 0&&n.push(r.value)}),n}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(D(C({},r),{keys:i}))}),t.sort(Am);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};function xe(){return globalThis}var Hn=["#0000CC","#0000FF","#0033CC","#0033FF","#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"],Rl=Symbol("color"),yo=new WeakMap;yo.set(Hn,Hn.map(o=>0));var Fm=(o=Hn)=>{var n,r;let e=[];yo.has(o)?e=yo.get(o):(e=o.map(i=>0),yo.set(o,e));let t=e.reduce((i,a,l,s)=>a<s[i]?l:i,0);return e[t]!=null&&e[t]++,(r=(n=o[t])!=null?n:o[0])!=null?r:Hn[0]},bo=":",$r="*",wl="-",_m=",",Om="debug",Vm="diffdebug",Pl=!1,Gn=new ae,To=new Map;function Il(o,e){let t=o.split(bo),n=new ae;n.set(t,!0);let r=e.split(bo),i=new Set(r).has($r),a=i?r.slice(0,r.indexOf($r)):r;if(n.getKeysStartingWith(a,i).length>0)return!0}function xl(o,e){let t=`channel=${o}_permissions=${e}`;if(To.has(t))return To.get(t);let n=e.split(_m);function r(l){return To.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes($r)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(wl);if(u&&(s=s.substring(wl.length)),Il(o,s))return r(!u)}for(let l=0;l<a.length;l++){let s=a[l],u=s.startsWith("-");if(u&&(s=s.substring(1)),Il(o,s))return r(!u)}return r(!1)}var Ur=()=>{var o,e,t;return(t=(e=tt.enable)!=null?e:xe()&&((o=xe().localStorage)==null?void 0:o.getItem(Om)))!=null?t:""},zm=()=>{var o,e,t;return(t=(e=tt.diffenable)!=null?e:xe()&&((o=xe().localStorage)==null?void 0:o.getItem(Vm)))!=null?t:`${Pl}`},Ro="",Dl=Pl;function Yr(o){Dl=`${zm()}`=="true",Ro!==o&&(Ro=o,To.clear())}function Ml(o){Yr(Ur()),typeof xe()!="undefined"&&xe().addEventListener&&xe().addEventListener("storage",function(){Yr(Ur())});function e(t,n){var m;let r=n?`${n}${bo}${t}`:t,i=r.split(bo);if(Gn.has(i))return Gn.get(i);let a=Gn.get(i.slice(0,-1)),l=(m=a?a.logFn:tt.logFn)!=null?m:El,s=l,u,c=0,d=()=>u!=null?u:xl(r,Ro),p=Fm(tt.colors),f=Object.defineProperties((...h)=>{if(xl(r,Ro)){let g=Date.now();if(c&&Dl){let S=g-c;s(`%c[${r}]`,`color: ${p}`,`+${S}ms:`)}c=g;let y=[],T;if(h.forEach(S=>{if(S[Rl])T===void 0&&(T=!0),y.push(...S);else{if(typeof S!="string"&&typeof S!="number"){T=!1;return}y.push(`${S}%s`)}}),T){let S=[`%c[${r}]%c %s`,`color: ${p}`,"",...y,""];s(...S)}else s(`%c[${r}]`,`color: ${p}`,...h)}},{channel:{value:r},color:{value:(h,...g)=>{let y=[`%c${g.join(" ")}%c%s`,`color: ${h}`,""];return y.toString=()=>g.join(" "),y[Rl]=!0,y}},extend:{value:h=>e(h,r)},enabled:{get:()=>d()},logFn:{configurable:!1,get:()=>s,set:h=>{s=h!=null?h:l}},destroy:{value:()=>{Gn.delete(i)}}});return Gn.set(i,f),f}return e(o)}var El=console.log.bind(console),vl;Object.defineProperty(Ml,"enable",{get:()=>vl,set:o=>{vl=o,Yr(Ur())}});var tt=Ml;tt.colors=Hn;tt.logFn=El;var Al=tt("InfiniteTable"),Ue=o=>{let e=Al.extend(o);return e.logFn=console.log.bind(console),e},wo=o=>{let e=Al.extend(`${o}:error`);return e.logFn=console.error.bind(console),e},Nn=()=>Nn;Nn.extend=()=>Nn;var pt=class{constructor(e){this.debug=Nn,this.error=Nn}};import*as Lm from"react";import{useMemo as ky,useRef as Gm,useEffect as Hm,useLayoutEffect as Nm,useCallback as By}from"react";var Kn=(o,e,t={debounce:0})=>{var l;let n=(l=t.debounce)!=null?l:0,r=window.ResizeObserver,i=n?yt(e,{wait:n}):e,a=new r(s=>{var p;let u=s[0],{width:c,height:d}=u.contentRect;if((p=u.borderBoxSize)!=null&&p[0])d=u.borderBoxSize[0].blockSize,c=u.borderBoxSize[0].inlineSize;else{let f=o.getBoundingClientRect();d=f.height,c=f.width}i({width:c,height:d})});return a.observe(o),()=>{a.disconnect()}},Io=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=Gm({width:0,height:0}),r=i=>{let a;return o.current&&(a=Kn(o.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=n.current;(s.width!==l.width||s.height!==l.height)&&(n.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};Hm(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),Nm(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};var Km=wo("CSSVariableWatch"),km=Ue("CSSVariableWatch"),Bm={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},Wm=o=>{let e=Fl(0),t=Yt.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);Io(o.ref,t,{earlyAttach:!0}),Yt.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n)return e.current=n,km(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);Km(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},xo=o=>{let e=Fl(null);Wm(D(C({},o),{ref:e}));let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return Yt.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Bm},Yt.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};import*as Po from"react";import*as _l from"react";var qr;function kn(){return qr||(qr=_l.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}import*as Ol from"react";var Xr;function vo(){return Xr||(Xr=Ol.createContext(void 0))}function un(){let o=kn();return Po.useContext(o).componentState}function me(){let o=kn();return Po.useContext(o)}function ze(){let o=vo();return Po.useContext(o)}import*as qt from"react";import{useCallback as Pf,useEffect as ai,useRef as Df,useState as Mf}from"react";import*as Do from"react";function jm(o){let{height:e,width:t,count:n}=o;return Do.createElement("div",{"data-count":n,"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 Vl=Do.memo(jm);var zl="mlx2t3";import*as Mo from"react";import{useRef as Um}from"react";import{useEffect as $m}from"react";var Ll=(o,e)=>{$m(()=>{let t=o==null?void 0:o.current,n=i=>{let a=i.target;e==null||e({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t==null||t.addEventListener("scroll",n,r),()=>{t==null||t.removeEventListener("scroll",n)}},[e,o==null?void 0:o.current])};var Gl={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Hl={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Nl={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Zr="_1ueijco1",Kl="_1ueijco0 _16lm1iw0";var kl=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=Gl[`${o}`]:e=Q(Hl[`${o.horizontal}`],Nl[`${o.vertical}`]),e};var Ym="InfiniteVirtualScrollContainer";var Bl=Mo.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s}=e,u=t!=null?t:Um(null);return Ll(u,i),Mo.createElement("div",{ref:u,style:s,tabIndex:l,className:Q(a,Ym,Kl,kl(r))},n)});import*as Go from"react";import{useEffect as as,useLayoutEffect as af,useMemo as lf}from"react";import*as Wl from"react";import{useEffect as qm,useRef as Xm,useState as Zm}from"react";function Jm(o){let[e,t]=Zm(o.updater.get),n=Xm(null);return qm(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e!=null?e:null}var Bn=Wl.memo(Jm);function we(o=!1){let e=null,t=[],n=null,r=(i,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{e=i,n=null;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a==null||a(l)});else{e=i;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a==null||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}import*as oi from"react";function Jr(...o){if(!o.length)return[];let e=new Map;o.forEach(n=>{var r;for(let i=0,a=n.length;i<a;i++){let l=n[i],s=(r=e.get(l))!=null?r:0;e.set(l,s+1)}return e});let t=o.length;return o[0].filter(n=>e.get(n)===t)}var be=xe().requestAnimationFrame||(o=>setTimeout(o,16)),nt=xe().cancelAnimationFrame||(o=>clearTimeout(o));function Z(o){return o.slice(4,-1)}var j={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",activeCellRowOffset:"var(--_16hkbkc2)",activeCellRowHeight:"var(--_16hkbkc3)",activeCellOffsetX:"var(--_16hkbkc4)",activeCellOffsetY:"var(--_16hkbkc5)",scrollTopForActiveRow:"var(--_16hkbkc6)",activeCellColWidth:"var(--_16hkbkc7)",activeCellColOffset:"var(--_16hkbkc8)",columnReorderEffectDurationAtIndex:"var(--_16hkbkc9)",columnWidthAtIndex:"var(--_16hkbkca)",columnOffsetAtIndex:"var(--_16hkbkcb)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcc)",columnZIndexAtIndex:"var(--_16hkbkcd)",pinnedStartWidth:"var(--_16hkbkce)",pinnedEndWidth:"var(--_16hkbkcf)",pinnedEndOffset:"var(--_16hkbkcg)",computedVisibleColumnsCount:"var(--_16hkbkch)",baseZIndexForCells:"var(--_16hkbkci)",bodyWidth:"var(--_16hkbkcj)",bodyHeight:"var(--_16hkbkck)",scrollbarWidthHorizontal:"var(--_16hkbkcl)",scrollbarWidthVertical:"var(--_16hkbkcm)",scrollLeft:"var(--_16hkbkcn)",scrollTop:"var(--_16hkbkco)"};function cn(o,e){let t=o;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function jl(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}var ot="Infinite",Ie={rootClassName:ot};var fe={color:{accent:"var(--infinite-accent-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)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidth:"var(--infinite-runtime-total-visible-columns-width)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)"},components:{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:{padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",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)",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)"},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)",selectedBackground:"var(--infinite-row-selected-background)",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)",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)"}}},$l="column-header-height";var Ul=`.${Ie.rootClassName}`;function Qr(o){return cn(o,Ul)}var Yl=Z(j.scrollLeft),Qm=Z(j.scrollTop),ql=Z(j.columnWidthAtIndex),Eo=Z(j.columnOffsetAtIndex),Xl=Z(j.columnReorderEffectDurationAtIndex),ef=Z(j.columnOffsetAtIndexWhileReordering),tf=Z(j.columnZIndexAtIndex);function Tt(o,e,t){let n=t?Qr(t):document.querySelector(Ul);nf(o,e,n)}function nf(o,e,t){if(t){let n=j[o]?Z(j[o]):o;t.style.setProperty(n,`${e}`)}}function dn(o,e){if(e)for(var t in o)e.style.setProperty(j[t]?Z(j[t]):t,`${o[t]}`)}function Ao(o,e,t){Tt(`${ql}-${o}`,typeof e=="number"?e+"px":e,t)}function pn(o,e,t){Tt(`${Eo}-${o}`,typeof e=="number"?e+"px":e,t)}function ei(o,e,t){Tt(`${Eo}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${Yl}))`:`${o.computedAbsoluteOffset+e}px`,t)}function ti(o,e,t){Tt(`${tf}-${o}`,`${e}`,t)}function Wn(o,e,t){Tt(`${ef}-${o}`,typeof e=="number"?`calc( var(${Eo}-${o}) + ${e}px )`:e,t)}function Fo(o,e,t){Tt(`${Xl}-${o}`,t!=null?t:"",e)}function Zl(o,e){let t=`${Xl}-${o}`;Tt(t,fe.components.Cell.reorderEffectDuration,e)}function _o(o){return`${ql}-${o}`}function Jl(o){return`${Eo}-${o}`}function Ql(o,e){dn({[Yl]:`${o.scrollLeft}px`,[Qm]:`${o.scrollTop}px`},e)}var ns=jr(Oo());var ni=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},os=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},mn={horizontal:!0,vertical:!0},ts=(o,e)=>o-e,jn=typeof window!="undefined"?requestAnimationFrame:o=>setTimeout(o,0),$n=class extends pt{constructor(t){let n=`MatrixBrain${t?`:${t}`:""}`;super(n);this.scrolling=!1;this.width=0;this.name="";this.height=0;this.cols=0;this.rows=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;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.update=t=>{let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,u=typeof l=="number",c=typeof s=="number",d=u&&l!==this.width,p=c&&s!==this.height;this.setAvailableSize({width:l,height:s},{skipUpdateRenderCount:!0});let f=typeof n=="number",m=typeof r=="number",h=f&&n!==this.rows,g=m&&r!==this.cols;f&&(this.rows=n),m&&(this.cols=r);let y=i!=null,T=a!=null,S=y&&i!==this.rowHeight,b=T&&a!==this.colWidth;y&&(this.rowHeight=i),T&&(this.colWidth=a);let w=t.rowspan!=null,v=t.colspan!=null,I=w&&t.rowspan!=this.rowspan,R=v&&t.colspan!=this.colspan;I&&(this.rowspan=t.rowspan),R&&(this.colspan=t.colspan);let x=g||b||d||R,E=h||S||p||I;(x||E)&&this.updateRenderCount({horizontal:x,vertical:E})};this.setRowsAndCols=({rows:t,cols:n})=>{let r=t===this.rows,i=n===this.cols;this.rows=t,this.cols=n,this.updateRenderCount({horizontal:!i,vertical:!r})};this.updateRenderCount=(t=mn)=>{this.reset(t),this.doUpdateRenderCount(t)};this.doUpdateRenderCount=(t=mn)=>{(!this.width||!this.height)&&this.setRenderCount({horizontal:0,vertical:0}),this.setRenderCount(this.computeRenderCount(t))};this.setScrolling=t=>{let n=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==n&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let n=0,r=t.length;n<r;n++)t[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,n=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](n,r)};this.setScrollPosition=(t,n)=>{this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(n==null||n(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,n=this.getAvailableSize();t.forEach(r=>{jn(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyRenderRangeChange=()=>{if(this.destroyed)return;let t=this.onRenderRangeChangeFns,n=this.getRenderRange();t.forEach(r=>{jn(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=()=>{if(this.destroyed)return;let t=this.onVerticalRenderRangeChangeFns,n=this.verticalRenderRange;t.forEach(r=>{jn(()=>{this.destroyed||t.has(r)&&r([n.startIndex,n.endIndex])})})};this.notifyHorizontalRenderRangeChange=()=>{if(this.destroyed)return;let t=this.onHorizontalRenderRangeChangeFns,n=this.horizontalRenderRange;t.forEach(r=>{jn(()=>{this.destroyed||t.has(r)&&r([n.startIndex,n.endIndex])})})};this.computeDirectionalRenderCount=(t,n,r,i)=>{let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;if(typeof n=="function"){let s=[];for(let c=0;c<r;c++)s.push(this.getItemSize(c,t));s.sort(ts);let u=0;for(let c=0;c<r&&(u+=s[c],a++,!(u>l));c++);a+=1}else a=(n?Math.ceil(l/n):0)+1;return a=Math.min(r,a),a};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 n=this.cols-this.fixedColsEnd;n<this.cols;n++)t+=this.getColWidth(n);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=this.getColWidth(c);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let u=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=this.getRowHeight(c);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let u=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=mn)=>{let n=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:n})=>{t===void 0&&(t=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=n===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=n,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:n,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=mn)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,u=t.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(l,c,"vertical");let d=this.rowspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,c])}}}if(r){let l=t.startIndex,s=n.startIndex,u=n.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(c,l,"horizontal");let d=this.colspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([c,p])}}}return a};this.computeRenderRange=(t=mn)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,r=t==="horizontal"?this.cols:this.rows;if(!n)return{startIndex:0,endIndex:0};let i=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,a=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;a+=this.getFixedStartSize(t);let l=this.getItemAt(a,t),s=l+n,u=Math.max(i,r-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return s>u&&(s=u,l=Math.max(i,s-n)),{startIndex:l,endIndex:s}};this.getItemAt=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,n),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,ns.default)(a,t,ts);return p>=0?p:~p-1};this.getCellOffset=(t,n)=>({x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")});this.getItemOffsetFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="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],u=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let u=r==="horizontal"?this.colspanParent:this.rowspanParent;u.has(a)||u.set(a,[]);let c=r==="horizontal"?this.colspanValue:this.rowspanValue;c.has(a)||c.set(a,[]);let d=u.get(a),p=c.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,h={rowIndex:t,colIndex:n};for(;f<=m;f++)if(d[f]===void 0){h[r==="horizontal"?"colIndex":"rowIndex"]=f;let g=s(h);d[f]=f,p[f]=g;let y=f;for(;g>1;)y+=1,d[y]=f,p[y]=0,g-=1}}};this.getCellSpan=(t,n,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[a]||1};this.getRowspan=(t,n)=>this.getCellSpan(t,n,"vertical");this.getColspan=(t,n)=>this.getCellSpan(t,n,"horizontal");this.getRowspanParent=(t,n)=>this.getItemSpanParent(t,n,"vertical");this.getColspanParent=(t,n)=>this.getItemSpanParent(t,n,"horizontal");this.getItemSpanParent=(t,n,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[a]};this.getRowHeightWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"vertical");this.getColWidthWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"horizontal");this.getItemSizeWithSpan=(t,n,r,i)=>{let a=i==="horizontal"?n: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,n)=>{let r=n==="horizontal"?this.cols:this.rows,i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,u=Math.min(t,r-1);for(;s<=u;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.getTotalSize=()=>({height:this.getTotalSizeFor("vertical"),width:this.getTotalSizeFor("horizontal")});this.getTotalSizeFor=t=>{let n=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*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u};this.setRenderRange=({horizontal:t,vertical:n,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=ni;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(n=>n!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==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(n=>n!==t)});this.getAvailableSize=()=>({width:this.width,height:this.height});this.destroy=()=>{this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns=new Set,this.onRenderRangeChangeFns=new Set,this.onVerticalRenderRangeChangeFns=new Set,this.onHorizontalRenderRangeChangeFns=new Set)};this.name=n,this.reset()}reset(t=mn){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}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0}setRowAndColumnSizes({rowHeight:t,colWidth:n}){let r=n===this.colWidth,i=t===this.rowHeight;this.rowHeight=t,this.colWidth=n,this.updateRenderCount({horizontal:!r,vertical:!i})}setAvailableSize(t,n){let{width:r,height:i}=t;r=r!=null?r:this.width,i=i!=null?i:this.height;let a=r===this.width,l=i===this.height;a&&l||(this.width=r,this.height=i,this.notifyAvailableSizeChange(),!(n&&n.skipUpdateRenderCount)&&this.updateRenderCount({horizontal:!a,vertical:!l}))}get scrollTopMax(){return this.getTotalSize().height-this.height}get scrollLeftMax(){return this.getTotalSize().width-this.width}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}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:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{jn(()=>{this.destroyed||i.has(a)&&a(r)})})}getItemSizeCacheFor(t,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}};var Vo=class extends pt{constructor(){super("MappedCells");this.getElementFromListForColumn=(t,n)=>{let{elementIndexToCell:r}=this,i=t.length-1;for(let a=i;a>=0;a--){let l=t[a],s=r[l];if(s&&s[1]===n)return a===i?t.pop():(t.splice(a,1),l)}return t.pop()};this.getElementsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,u=[];for(let c=0,d=this.elementIndexToCell.length;c<d;c++){let p=this.elementIndexToCell[c];if(!p)continue;let[f,m]=p,h=f<i,g=f>=l,y=m<a,T=m>=s;(h||g||y||T)&&u.push(c)}return u};this.isCellRendered=(t,n)=>this.cellToElementIndex.has([t,n]);this.isElementRendered=t=>!!this.elementIndexToCell[t];this.getElementsForRowIndex=t=>this.cellToElementIndex.getValuesStartingWith([t]);this.getRenderedNodeAtElement=t=>this.renderedElements[t]||null;this.getRenderedCellAtElement=t=>this.elementIndexToCell[t]||null;this.getRenderedNodeForCell=(t,n)=>{let r=this.cellToElementIndex.get([t,n]);return r!=null&&this.renderedElements[r]||null};this.getElementIndexForCell=(t,n)=>{let r=this.cellToElementIndex.get([t,n]);return r!=null?r:null};this.renderCellAtElement=(t,n,r,i)=>{let a=[t,n],l=this.elementIndexToCell[r];l&&this.cellToElementIndex.delete([l[0],l[1]]),i&&(this.renderedElements[r]=i),this.elementIndexToCell[r]=[t,n],this.cellToElementIndex.set(a,r)};this.discardCell=(t,n)=>{let r=[t,n],i=this.cellToElementIndex.get(r);i!=null&&(this.renderedElements[i]=null,this.elementIndexToCell[i]=null,this.cellToElementIndex.delete(r))};this.discardElement=t=>{let n=this.elementIndexToCell[t];if(n){let r=[n[0],n[1]];return this.renderedElements[t]=null,this.elementIndexToCell[t]=null,this.cellToElementIndex.delete(r),n}return null};this.discardElementsStartingWith=(t,n)=>{let r=null,i=!1;if(t<this.elementIndexToCell.length){for(let a=t,l=this.elementIndexToCell.length;a<l;a++)r=this.discardElement(a),r&&(i=!0),n&&n(a,r);this.elementIndexToCell.length=t,this.renderedElements.length=t}return i};this.init()}init(){this.elementIndexToCell=[],this.cellToElementIndex=new ae,this.renderedElements=[]}reset(){this.init()}destroy(){this.elementIndexToCell=[],this.cellToElementIndex.clear(),this.renderedElements=[]}};var zo=class extends pt{constructor(){super("MappedVirtualRows");this.getElementsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i]=n,[a]=r,l=[];for(let s=0,u=this.elementIndexToRowIndex.length;s<u;s++){let c=this.elementIndexToRowIndex[s];if(c==null)continue;let d=c<i,p=c>=a;(d||p)&&l.push(s)}return l};this.isRowRendered=t=>this.rowToElementIndex[t]!=null;this.isElementRendered=t=>this.elementIndexToRowIndex[t]!=null;this.getRenderedNodeAtElement=t=>this.renderedElements[t]||null;this.getRenderedRowAtElement=t=>{let n=this.elementIndexToRowIndex[t];return n!=null?n:null};this.getRenderedNodeForRow=t=>{var r;let n=this.rowToElementIndex[t];return n!=null&&(r=this.renderedElements[n])!=null?r:null};this.getElementIndexForRow=t=>{let n=this.rowToElementIndex[t];return n!=null?n:null};this.renderRowAtElement=(t,n,r)=>{let i=this.elementIndexToRowIndex[n];i!=null&&(this.rowToElementIndex[i]=null),r!==void 0&&(this.renderedElements[n]=r),this.elementIndexToRowIndex[n]=t,this.rowToElementIndex[t]=n};this.discardRow=t=>{let n=this.rowToElementIndex[t];n!=null&&(this.renderedElements[n]=null,this.elementIndexToRowIndex[n]=null,this.rowToElementIndex[t]=null)};this.discardElement=t=>{let n=this.elementIndexToRowIndex[t];return n!=null?(this.renderedElements[t]=null,this.elementIndexToRowIndex[t]=null,this.rowToElementIndex[n]=null,n):null};this.discardElementsStartingWith=(t,n)=>{let r=null,i=!1;if(t<this.elementIndexToRowIndex.length){for(let a=t,l=this.elementIndexToRowIndex.length;a<l;a++)r=this.discardElement(a),r&&(i=!0),n&&n(a,r);this.elementIndexToRowIndex.length=t,this.renderedElements.length=t}return i};this.init()}init(){this.elementIndexToRowIndex=[],this.rowToElementIndex=[],this.renderedElements=[]}reset(){this.init()}destroy(){this.elementIndexToRowIndex=[],this.rowToElementIndex=[],this.renderedElements=[]}};var rs=!0,Lo=Z(j.y),is=Z(j.scrollTop),of=Z(j.columnOffsetAtIndex),rf=Z(j.columnOffsetAtIndexWhileReordering),fn=class extends pt{constructor(t){super("ReactHeadlessTableRenderer");this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.itemDOMElements=[];this.itemDOMRefs=[];this.updaters=[];this.detailRowDOMElements=[];this.detailRowDOMRefs=[];this.detailRowUpdaters=[];this.items=[];this.detailItems=[];this.currentHoveredRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(Lo,i?`calc( ${r}px + var(${is}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${Lo}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=`${of}-${r}`,d=`${rf}-${r}`;t.style.setProperty(Lo,s?`calc( ${a}px + var(${is}) )`:`${a}px`),t.style.transform=`translate3d(var(${d}, var(${c})), var(${Lo}), 0)`,u!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===t)return null;return{start:t,end:n}};this.getScrollPositionForScrollRowIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),{scrollAdjustPosition:a,offset:l=0}=n;if(this.isRowFullyVisible(t)&&!a)return i;let s=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),c=r.getFixedStartRowsHeight(),d=r.getFixedEndRowsHeight(),p=i.scrollTop,f=r.getAvailableSize();if(!f.height)return null;let m=p+f.height;a||(a=s>m-d?"end":s<p+c?"start":"end");let h=i.scrollTop;return a==="center"?h=s-Math.floor((r.getAvailableSize().height-c-d)/2):a==="start"?(l=-l,h+=s-p+l-c):(l+=u,h+=s-m+l+d),D(C({},i),{scrollTop:h})};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),{scrollAdjustPosition:a,offset:l=0}=n;if(this.isColumnFullyVisible(t)&&!a)return i;let s=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),c=r.getFixedStartColsWidth(),d=r.getFixedStartColsWidth(),p=i.scrollLeft,f=r.getAvailableSize();if(!f.width)return null;let m=p+f.width;a||(a=s>m-d?"end":s<p+c?"start":"end");let h=i.scrollLeft;return a==="center"?h=s-Math.floor((r.getAvailableSize().width-c-d)/2):a==="start"?(l=-l,h+=s-p+l-c):(l+=u,h+=s-m+l+d),D(C({},i),{scrollLeft:h})};this.getScrollPositionForScrollCellIntoView=(t,n,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(n,{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,n=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-n);this.isRowVisible=(t,n=10)=>{if(!this.isRowRendered(t))return!1;let{brain:r}=this;if(r.isRowFixed(t))return!0;let{start:[i],end:[a]}=this.brain.getRenderRange(),l=Math.floor((i+a)/2);if(t<i||t>=a)return!1;if(t>=l){let s=r.getItemAt(r.getAvailableSize().height+r.getScrollPosition().scrollTop-n,"vertical");return t<=s}if(t<l){let s=r.getItemAt(r.getScrollPosition().scrollTop+n,"vertical");return t>=s}return!0};this.isRowRendered=t=>this.mappedCells.getElementsForRowIndex(t).length>0;this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n);this.isColumnFullyVisible=(t,n=2)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n);this.isColumnVisible=(t,n=10)=>{if(!this.isColumnRendered(t))return!1;let{brain:r}=this;if(r.isColFixed(t))return!0;let{start:[i,a],end:[l,s]}=r.getRenderRange();if(t<a||t>=s)return!1;let u=Math.floor((a+s)/2);if(t>=u){let c=r.getItemAt(r.getAvailableSize().width+r.getScrollPosition().scrollLeft-n-r.getFixedEndColsWidth(),"horizontal");return t<=c}if(t<u){let c=r.getItemAt(r.getScrollPosition().scrollLeft+n+r.getFixedStartColsWidth(),"horizontal");return t>=c}return!0};this.isCellRendered=(t,n)=>this.isRowRendered(t)&&this.isColumnRendered(n);this.isColumnRendered=t=>{let{start:[n]}=this.brain.getRenderRange();return this.mappedCells.getRenderedNodeForCell(n,t)!==null};this.getExtraSpanCellsForRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.renderRange=(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a})=>{if(this.destroyed)return[];let{start:l,end:s}=t,{mappedCells:u,mappedDetailRows:c}=this,d=this.getFixedRanges(t),p=[t,...d],f=new Map,m=p.map(this.getExtraSpanCellsForRange).flat();m&&m.forEach(([I,R])=>{f.set(`${I}:${R}`,!0)});let h=p.reduce((I,R)=>I+ni(R),0),g=r?p.reduce((I,R)=>I+os(R),0):0;this.itemDOMElements.length>=h&&(u.discardElementsStartingWith(h,I=>{this.updaters[I]&&this.updaters[I].destroy()}),this.itemDOMElements.length=Math.min(this.itemDOMElements.length,h),this.itemDOMRefs.length=Math.min(this.itemDOMRefs.length,h),this.updaters.length=Math.min(this.updaters.length,h),this.items.length=Math.min(this.items.length,h)),r&&this.detailRowDOMElements.length&&this.detailRowDOMElements.length>=g&&(c.discardElementsStartingWith(g,I=>{this.detailRowUpdaters[I]&&this.detailRowUpdaters[I].destroy()}),this.detailRowDOMElements.length=Math.min(this.detailRowDOMElements.length,g),this.detailRowDOMRefs.length=Math.min(this.detailRowDOMRefs.length,g),this.detailRowUpdaters.length=Math.min(this.detailRowUpdaters.length,g),this.detailItems.length=Math.min(this.detailItems.length,g));let y=Jr(...p.map(u.getElementsOutsideRenderRange)),T=r?Jr(...p.map(c.getElementsOutsideRenderRange)):[],S=y.filter(I=>{let R=this.mappedCells.getRenderedCellAtElement(I);return!(R&&f.has(`${R[0]}:${R[1]}`))});this.items.length>h&&(this.items.length=h),r&&this.detailItems.length>g&&(this.detailItems.length=g);for(let I=this.items.length;I<h;I++)this.renderElement(I),S.splice(0,0,I);if(r)for(let I=this.detailItems.length;I<g;I++)this.renderDetailElement(I),T.splice(0,0,I);let b=new Map,w=new Map;p.forEach(I=>{let{start:R,end:x}=I,[E,P]=R,[V,z]=x;for(let F=E;F<V;F++){for(let _=P;_<z;_++){let H=`${F}:${_}`;if(b.has(H))continue;b.set(H,!0);let G=u.isCellRendered(F,_);if(F===E||_===P){let U=this.isCellCovered(F,_);if(U&&f.has(`${U[0]}:${U[1]}`)){let $=u.getElementIndexForCell(F,_);$!=null&&S.push($);continue}}if(G&&!i)continue;let J=G?u.getElementIndexForCell(F,_):u.getElementFromListForColumn(S,_);J!=null&&this.renderCellAtElement(F,_,J,n)}if(!r||w.has(F))continue;w.set(F,!0);let M=c.isRowRendered(F);if(M&&!i)continue;let A=M?c.getElementIndexForRow(F):T.pop();A!=null&&this.renderDetailRowAtElement(F,A,r)}}),m.forEach(([I,R])=>{if(u.isCellRendered(I,R)){if(i){let E=u.getElementIndexForCell(I,R);this.renderCellAtElement(I,R,E,n)}return}let x=S.pop();x!=null&&this.renderCellAtElement(I,R,x,n)});let v=this.items;return v=[...this.items,...this.detailItems],this.adjustFixedElementsOnScroll(),a&&a(v),v};this.getFixedRanges=t=>{let{fixedRowsStart:n,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:u,end:c}=t,[d,p]=u,[f,m]=c,h=[];if(i&&(n&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&h.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),h.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&h.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),h.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let g={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};h.push(g)}if(r){let g={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};h.push(g)}return h};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),u=this.brain.getRowCount(),c=!1,d=!1,p=!1;if(t<r&&(c=!0,p="start"),i&&!c){let f=u-i;t>=f&&(c=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnter=t=>{this.currentHoveredRow=t,!this.scrolling&&this.addHoverClass(t)};this.addHoverClass=t=>{this.mappedCells.getElementsForRowIndex(t).forEach(n=>{let r=this.itemDOMElements[n];r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.currentHoveredRow!=-1&&this.currentHoveredRow===t&&this.removeHoverClass(t),this.currentHoveredRow=-1,!this.scrolling&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.mappedCells.getElementsForRowIndex(t).forEach(n=>{let r=this.itemDOMElements[n];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 n=()=>{this.currentHoveredRow!=-1&&!this.scrolling&&(this.currentHoveredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};be(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n)=>{if(this.destroyed)return;let r=this.itemDOMElements[t],i=this.mappedCells.getRenderedCellAtElement(t);if(i==null)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:u,y:c}=s;if(r)if(this.updateHoverClassNamesForRow(a),r.dataset.rowIndex=a,r.dataset.colIndex=l,rs){this.setTransform(r,a,l,{x:u,y:c},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let d=n?n.hidden:!!this.isCellCovered(a,l);r.style.zIndex=d?"-1":r.dataset.zIndex||"auto"}else r.style.display="",r.style.left=`${u}px`,r.style.top=`${c}px`};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let n=this.detailRowDOMElements[t],r=this.mappedDetailRows.getRenderedRowAtElement(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;n&&(n.dataset.detailRowIndex=r,rs&&(this.setDetailTransform(n,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0};this.onScrollStop=()=>{this.scrolling=!1,this.currentHoveredRow!=-1&&this.addHoverClass(this.currentHoveredRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{mappedCells:n,brain:r,itemDOMElements:i,detailRowDOMElements:a}=this,l=this.brain.getColCount(),s=this.brain.getRowCount(),{fixedColsStart:u,fixedColsEnd:c,fixedRowsStart:d,fixedRowsEnd:p}=this.brain.getFixedCellInfo();if(a.length&&this.detailRowDOMElements.forEach((F,M)=>{if(!F)return;let A=this.mappedDetailRows.getRenderedRowAtElement(M);if(A!=null){let _=this.brain.getItemOffsetFor(A,"vertical");if(_==null)return;this.setDetailTransform(F,A,{y:_,scrollLeft:t.scrollLeft})}}),!u&&!c&&!d&&!p)return;i[0]&&Ql(t,this.getInfiniteNode(i[0]));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:g}=this.brain.getRenderRange(),[y,T]=h,[S,b]=g;function w(F,M,A){let _=n.getElementIndexForCell(F,M);if(_===null)return;let H=r.getCellOffset(F,M),G=i[_];_!=null&&G&&H&&A(F,M,G,H)}let v=(F,M,A,{x:_,y:H})=>{this.setTransform(A,F,M,{x:_,y:H,scrollLeft:!0},u-M)},I=(F,M,A,_)=>{this.setTransform(A,F,M,{x:_.x,y:_.y,scrollTop:!0},d-F)},R=(F,M,A,{y:_})=>{let H=f[M];this.setTransform(A,F,M,{x:H,y:_,scrollLeft:!0},l-M)},x=(F,M,A,_)=>{this.setTransform(A,F,M,{x:_.x,y:m[F],scrollTop:!0},s-F)},E=(F,M,A,{x:_,y:H})=>{this.setTransform(A,F,M,{x:_,scrollLeft:!0,y:H,scrollTop:!0},1e5)},P=(F,M,A,{x:_})=>{this.setTransform(A,F,M,{x:_,scrollLeft:!0,y:m[F],scrollTop:!0},2e5)},V=(F,M,A,_)=>{this.setTransform(A,F,M,{x:f[M],y:_.y,scrollLeft:!0,scrollTop:!0},3e5)},z=(F,M,A)=>{this.setTransform(A,F,M,{x:f[M],y:m[F],scrollLeft:!0,scrollTop:!0},4e5)};if(u||c)for(let F=y;F<S;F++){for(let M=0;M<u;M++)w(F,M,v);if(c){let M=l-c;for(let A=M;A<l;A++)w(F,A,R)}}if(d||p)for(let F=T;F<b;F++){for(let M=0;M<d;M++)w(M,F,I);if(p){let M=s-p;for(let A=M;A<s;A++)w(A,F,x)}}if(u&&d)for(let F=0;F<d;F++)for(let M=0;M<u;M++)w(F,M,E);if(u&&p){let F=s-p;for(let M=F;M<s;M++)for(let A=0;A<u;A++)w(M,A,P)}if(c&&d){let F=l-c;for(let M=0;M<d;M++)for(let A=F;A<l;A++)w(M,A,V)}if(c&&p){let F=s-p,M=l-c;for(let A=F;A<s;A++)for(let _=M;_<l;_++)w(A,_,z)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null,this.mappedCells=null,this.mappedDetailRows=null)};this.brain=t,this.debugId=t.name,this.mappedCells=new Vo,this.mappedDetailRows=new zo;let n=t.onScroll(this.adjustFixedElementsOnScroll),r=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),be(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),i=t.onScrollStart(this.onScrollStart),a=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{n(),r(),i(),a()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=Qr(t)),this.infiniteNode}renderElement(t){let n=i=>{i&&(this.itemDOMElements[t]=i,i.style.position="absolute",i.style.left="0px",i.style.top="0px",this.updateElementPosition(t))};this.itemDOMRefs[t]=n,this.updaters[t]=we();let r=oi.createElement(Bn,{key:t,name:`${t}`,updater:this.updaters[t]});return this.items[t]=r,r}renderDetailElement(t){let n=i=>{i&&(this.detailRowDOMElements[t]=i,i.style.position="absolute",i.style.left="0px",this.updateDetailElementPosition(t))};this.detailRowDOMRefs[t]=n,this.detailRowUpdaters[t]=we();let r=oi.createElement(Bn,{key:`detail-${t}`,name:`detail-${t}`,updater:this.detailRowUpdaters[t]});return this.detailItems[t]=r,r}renderDetailRowAtElement(t,n,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,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:this.detailRowDOMRefs[n]}),c=this.detailRowUpdaters[n];if(!c){this.error(`Cannot find detail item updater for item ${t} at this time... sorry.`);return}this.mappedDetailRows.renderRowAtElement(t,n,u),c(u),this.updateDetailElementPosition(n)}renderCellAtElement(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),u=this.brain.getRowspan(t,n),c=this.brain.getColspan(t,n),d=u===1?l:this.brain.getRowHeightWithSpan(t,n,u),p=c===1?s:this.brain.getColWidthWithSpan(t,n,c),{row:f,col:m}=this.isCellFixed(t,n),h=!!a,g=i({rowIndex:t,colIndex:n,height:l,width:s,rowspan:u,colspan:c,rowFixed:f,colFixed:m,hidden:h,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnter.bind(null,t),onMouseLeave:this.onMouseLeave.bind(null,t),domRef:this.itemDOMRefs[r]}),y=this.updaters[r];if(!y){this.error(`Cannot find item updater for item ${t},${n} at this time... sorry.`);return}this.mappedCells.renderCellAtElement(t,n,r,g),y(g),this.updateElementPosition(r,{hidden:h,rowspan:u,colspan:c})}reset(){this.itemDOMElements=[],this.itemDOMRefs=[],this.updaters=[],this.items=[],this.mappedCells.reset(),this.mappedDetailRows.reset()}};function sf(o){let e=new fn(o),t=we();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function uf(o){let{brain:e,renderCell:t,renderDetailRow:n}=o,{renderer:r,onRenderUpdater:i}=lf(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:sf(e),[e,o.onRenderUpdater,o.renderer]);return as(()=>{r.cellHoverClassNames=o.cellHoverClassNames||[]},[r,o.cellHoverClassNames]),af(()=>{let a=e.getRenderRange();r.renderRange(a,{onRender:i,force:!0,renderCell:t,renderDetailRow:n})},[r,e,t,n,i]),as(()=>e.onRenderRangeChange(l=>{r.renderRange(l,{force:!1,onRender:s=>{let u=i.get();u&&s&&u.length===s.length||i(s)},renderCell:t,renderDetailRow:n})}),[t,n]),Go.createElement(Bn,{updater:i})}var Ho=Go.memo(uf);import*as Un from"react";import{useEffect as pf,useLayoutEffect as mf,useRef as ff}from"react";import{useCallback as cf,useState as df}from"react";var mt=()=>{let[o,e]=df(0);return[o,cf(()=>{e(t=>t+1)},[e])]};var ri={visible:"nxbq1c2 nxbq1c1 _16lm1iwl _16lm1iw2",hidden:"nxbq1c3 nxbq1c1 _16lm1iwl _16lm1iw2"},No="nxbq1c0 _16lm1iwl _16lm1iw4 _16lm1iw1e _16lm1iw1c _16lm1iw18 _16lm1iwu";var ii={visible:"j26lrx1 j26lrx0 _16lm1iwl _16lm1iw4 _16lm1iw1b _16lm1iw1c _16lm1iw1e",hidden:"j26lrx2 j26lrx0 _16lm1iwl _16lm1iw4 _16lm1iw1b _16lm1iw1c _16lm1iw1e"};var{rootClassName:hf}=Ie,gf=`${hf}-ActiveRowIndicator`,Cf={[Z(j.activeCellOffsetY)]:j.activeCellRowOffset,transform:`translate3d(0px, calc( ${j.activeCellOffsetY} + var(${Z(j.scrollTopForActiveRow)}, 0px)), 0px)`,height:j.activeCellRowHeight},Sf=o=>{let{brain:e}=o,t=ff(null),n=o.activeRowIndex!=null&&e.getRowCount()>o.activeRowIndex,[r,i]=mt();return mf(()=>{if(o.activeRowIndex==null)return;let a=o.activeRowIndex,l=e.getRowHeight(a),s=e.getItemOffsetFor(a,"vertical"),u=t.current,c={activeCellRowHeight:`${l}px`,activeCellRowOffset:`${s}px`};dn(c,u)},[o.activeRowIndex]),pf(()=>{let a=e.onScroll(s=>{dn({scrollTopForActiveRow:`${-s.scrollTop}px`},t.current)}),l=e.onRenderCountChange(i);return()=>{l(),a()}},[e]),Un.createElement("div",{className:No,"data-name":"active-row"},Un.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${gf} ${n?ii.visible:ii.hidden}`,style:n?Cf:void 0}))},ls=Un.memo(Sf);import*as Yn from"react";import{useEffect as yf,useLayoutEffect as Tf,useRef as bf}from"react";var{rootClassName:Rf}=Ie,wf=`${Rf}-ActiveCellIndicator`,If=Z(j.columnZIndexAtIndex),xf=(o,e,t,n)=>{if(e==null)return;let r=e[0],i=typeof t=="function"?t(r):t!=null?t:o.getRowHeight(r),a=o.getItemOffsetFor(r,"vertical"),l=n.current;dn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},vf=o=>{let{brain:e}=o,[t,n]=mt(),r=bf(null),i=o.activeCellIndex!=null&&e.getRowCount()>o.activeCellIndex[0];return Tf(()=>{xf(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight]),yf(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),Yn.createElement("div",{className:No,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${If}-${o.activeCellIndex[1]})`}:void 0},Yn.createElement("div",{"data-name":"active-cell-indicator",className:`${wf} ${i?ri.visible:ri.hidden}`}))},ss=Yn.memo(vf);function Ko(o,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&o.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),o.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 Ef=Q(zl,Zr);function us(o){let y=o,{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d}=y,p=At(y,["brain","scrollerDOMRef","scrollStopDelay","renderCell","renderDetailRow","activeCellRowHeight","cellHoverClassNames","renderer","activeRowIndex","activeCellIndex","onRenderUpdater"]),f=Df(null),[m,h]=Mf({width:0,height:0});ai(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),ai(()=>{var w;let T=(w=f.current)==null?void 0:w.parentNode;return T?Kn(T,()=>{let v={height:T.clientHeight,width:T.clientWidth};e.update(v)},{debounce:50}):void 0},[]);let g=Pf(T=>{e.setScrollPosition(T,S=>{f.current.style.transform=`translate3d(${-S.scrollLeft}px, ${-S.scrollTop}px, 0px)`})},[e]);return ai(()=>{let T=e.onRenderCountChange(()=>{h(e.getTotalSize())});return h(e.getTotalSize()),T},[e]),qt.createElement(Bl,D(C({onContainerScroll:g},p),{ref:t}),qt.createElement("div",{ref:f,className:Ef,"data-name":"scroll-transform-target"},qt.createElement(Ho,{renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l}),qt.createElement(ss,{brain:e,rowHeight:a,activeCellIndex:c})),qt.createElement(ls,{brain:e,activeRowIndex:u}),qt.createElement(Vl,{width:m.width,height:m.height}))}import*as hn from"react";import{useReducer as Lf,createContext as Gf,useMemo as ci,useEffect as Hf,useState as ds,useRef as Nf,useLayoutEffect as Kf}from"react";function li(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(u,c){return t.add(c),u[c]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var si=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function qn(o){return o!==void 0}function _t(o,e){let t=e[o];return qn(t)}import{useCallback as Af,useEffect as Ff,useRef as ui}from"react";var cs=o=>{let e=Af(o,[]),t=ui(!1),n=ui(!1),r=ui(),[i,a]=mt();t.current&&(n.current=!0),Ff(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};import{useCallback as _f,useRef as Of}from"react";function Oe(o){let e=Of(o);return e.current=o,_f(()=>e.current,[])}import{useRef as Vf,useLayoutEffect as zf}from"react";var ko=(o,e)=>{let t=Vf(e===void 0?o:e);return zf(()=>{t.current=o}),t.current};var kf=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)},di;function ps(){return di||(di=Gf(null))}function Bf(o,e,t,n,r,i,a){let l=e();return Object.keys(l).reduce((s,u)=>{let c=u;return Object.defineProperty(s,u,{set:p=>{let f=t(),m=e(),h=m[c],g=!0;if(i&&typeof i[c]=="function"&&i[c](p,{actions:s,state:m})===!1&&(g=!1),g){let S=[p],b=`on${si(u)}Change`;if(a&&a[c]){let w=a[c](p,m);b=w.callbackName||b,S=w.callbackParams}kf(f,b,S)}let y=n[c];typeof y=="function"&&(p=y(p));let T=!!(r!=null&&r[c]);_t(u,f)&&!T||o({payload:{updatedProps:null,mappedState:{[u]:p}}})}}),s},{})}function Wf(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=_t(r,e)?e[r]:e[`default${si(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function bt(o){return hn.memo(function(t){var w,v;let[n]=ds(()=>o.initSetupState?o.initSetupState(t):{}),r=Nf(new Set),i=ci(()=>o.forwardProps?o.forwardProps(n):{},[n]),a=(v=(w=o.getParentState)==null?void 0:w.call(o))!=null?v:null,l=Oe(a);function s(){let I={};i&&(I=Wf(i,t,n));let R=C(C({},n),I);if(o.mapPropsToState){let{fn:x,propertyReads:E}=li(o.mapPropsToState,{getProxyTargetFromArgs:V=>V.props,putProxyToArgs:(V,z)=>[D(C({},z),{props:V})]}),P=x({props:t,state:R,oldState:null,parentState:a});return r.current=new Set([...r.current,...E]),C(C({},R),P)}return R}let[u]=ds(s),c=Oe(t),d=(I,R)=>{var F;if(R.type==="REPLACE_STATE")return R.payload;let x=(F=l==null?void 0:l())!=null?F:null,E=R.payload.mappedState,P=R.payload.updatedPropsToState,V=Object.assign({},I);if(E&&Object.assign(V,E),o.mapPropsToState){let{fn:M,propertyReads:A}=li(o.mapPropsToState,{getProxyTargetFromArgs:H=>H.props,putProxyToArgs:(H,G)=>[D(C({},G),{props:H})]}),_=M({props:c(),state:V,oldState:I,parentState:x});r.current=new Set([...r.current,...A]),Object.assign(V,_)}return R.type==="ASSIGN_STATE"&&Object.assign(V,R.payload),o.concludeReducer?o.concludeReducer({previousState:I,state:V,updatedProps:P,parentState:x}):V},[p,f]=Lf(d,u),m=Oe(p),{allowedControlledPropOverrides:h}=o,g=ci(()=>Bf(f,m,c,i,h,o.interceptActions,o.mappedCallbacks),[f,i,h]),y=ps(),T=ci(()=>({componentState:p,componentActions:g,getComponentState:m,replaceState:I=>{f({type:"REPLACE_STATE",payload:I})},assignState:I=>{f({type:"ASSIGN_STATE",payload:I})}}),[p,g,m]),S=ko(t);return(o.layoutEffect?Kf:Hf)(()=>{let I=t,R={},x=0,E={},P=0,V={},z=0;if(new Set([...Object.keys(I),...Object.keys(S)]).forEach(A=>{let _=A,H=S[_],G=I[_];if(_!=="children"&&H!==G&&(V[_]={newValue:G,oldValue:H},z++,_t(_,t)||_t(_,S)))if(i.hasOwnProperty(A)){let J=G,U=i[A];typeof U=="function"&&(J=U(G)),p[_]!==J&&(R[_]=J,x++)}else r.current.has(A)&&(E[_]=I[_],P++)}),P>0||x>0){if((o.debugName?Ue(`${o.debugName}:rerender`):Ue("rerender"))("Triggered by new values for the following props",...Object.keys(R!=null?R:{}),...Object.keys(E!=null?E:{})),f({payload:{mappedState:x?R:null,updatedPropsToState:P?E:null}}),o.onPropChange){for(var M in V)if(V.hasOwnProperty(M)){let{newValue:H,oldValue:G}=V[M];o.onPropChange({name:M,newValue:H,oldValue:G},t,g,p)}}o.onPropsChange&&z&&o.onPropsChange(V,t,g,p)}}),cs(()=>()=>{var I;(I=o.cleanup)==null||I.call(o,m())}),hn.createElement(y.Provider,{value:T},t.children)})}function ve(){let o=ps();return hn.useContext(o)}import*as xs from"react";var Bo=()=>Ie;var ms="_16lm1iw2 _16lm1iw1c _16lm1iw1e _16lm1iw1j _16lm1iw1h",fs={center:"_16lm1iw1q",stretch:"_16lm1iw1r"};var ft="_16lm1iw23 _16lm1iw24 _16lm1iw1x",hs={pointer:"_16lm1iwi",default:"_16lm1iwj",colResize:"_16lm1iwk"},gn={flex:"_16lm1iwz",contents:"_16lm1iw10",none:"_16lm1iw11",block:"_16lm1iw12",grid:"_16lm1iw13",inlineBlock:"_16lm1iw14",inlineFlex:"_16lm1iw15",inlineGrid:"_16lm1iw16"};var Wo={1:"_16lm1iwm",none:"_16lm1iwn"},Xn={column:"_16lm1iw1m",columnReverse:"_16lm1iw1n",row:"_16lm1iw1o",rowReverse:"_16lm1iw1p"};var gs={center:"_16lm1iw1s",spaceBetween:"_16lm1iw1t",spaceAround:"_16lm1iw1u",start:"_16lm1iw1v",end:"_16lm1iw1w"},Cs={0:"_16lm1iw1e","100%":"_16lm1iw1f",auto:"_16lm1iw1g"};var Ss={none:"_16lm1iwd"},ys={hidden:"_16lm1iw1x",auto:"_16lm1iw1y",visible:"_16lm1iw1z"};var Zn={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Ts={0:"_16lm1iw1c","100%":"_16lm1iw1d"};var bs="_16lm1iwe",Rs={none:"_16lm1iw17"};var ws={visible:"_16lm1iw20",hidden:"_16lm1iw21"};var Is={1:"_16lm1iwo",10:"_16lm1iwp",100:"_16lm1iwq",1e3:"_16lm1iwr",1e4:"_16lm1iws",1e5:"_16lm1iwt",1e6:"_16lm1iwu",1e7:"_16lm1iwv","1k":"_16lm1iww","10k":"_16lm1iwx","100k":"_16lm1iwy"};function vs(o){let{rootClassName:e}=Bo();return xs.createElement("div",D(C({},o),{className:Q(`${e}Footer`,Zn.relative,gn.flex,Xn.row,o.className)}))}import*as he from"react";import{useCallback as Qh,useContext as eg,useEffect as tg,useRef as ng}from"react";import{createPortal as og}from"react-dom";function jo(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}import*as Ps from"react";var Me=o=>{var n;let e=(n=o.size)!=null?n:"var(--infinite-icon-size)",t=C({flex:"none",width:e,height:e,fill:"currentColor"},o.style);return Ps.createElement("svg",D(C({viewBox:"0 0 24 24"},o),{style:t}),o.children)};import*as pi from"react";var Ds=o=>pi.createElement(Me,C({},o),pi.createElement("path",{d:"M5,4V7H10.5V19H13.5V7H19V4H5Z"}));import*as mi from"react";var Ms=o=>mi.createElement(Me,C({},o),mi.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 fi from"react";var hi=o=>fi.createElement(Me,C({},o),fi.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));import*as gi from"react";var Es=o=>gi.createElement(Me,C({},o),gi.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 Ci from"react";var As=o=>Ci.createElement(Me,C({},o),Ci.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));import*as Si from"react";var Fs=o=>Si.createElement(Me,C({},o),Si.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 yi from"react";var _s=o=>yi.createElement(Me,C({},o),yi.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));import*as Ti from"react";var Os=o=>Ti.createElement(Me,C({},o),Ti.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));import*as bi from"react";var Vs=o=>bi.createElement(Me,C({},o),bi.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 Ai from"react";import*as He from"react";import{useEffect as uh,useState as pu}from"react";import{useContext as $f}from"react";import{createContext as jf}from"react";var Ri;function Cn(){return Ri||(Ri=jf(null))}var oe=()=>{let o=Cn();return $f(o)};import{useContext as Uf}from"react";var zs=()=>{let o=Cn(),{state:e}=Uf(o);return e};import*as Sn from"react";import{useEffect as Jf,useLayoutEffect as Qf,useState as ou}from"react";function Yf(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var n=t.call(o,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function qf(o){var e=Yf(o,"string");return typeof e=="symbol"?e:String(e)}function Xf(o,e,t){return e=qf(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Ls(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function Gs(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ls(Object(t),!0).forEach(function(n){Xf(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Ls(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function Hs(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var Zf=(o,e,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=e[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},Se=o=>{var e=t=>{var n=o.defaultClassName,r=Gs(Gs({},o.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:o.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=o.variantClassNames[i][s];u&&(n+=" "+u)}}for(var[c,d]of o.compoundVariants)Zf(c,r,o.defaultVariants)&&(n+=" "+d);return n};return e.variants=()=>Object.keys(o.variantClassNames),e.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return Hs(o.variantClassNames,t=>Hs(t,n=>n.split(" ")[0]))}},e};var Ns="_1eexc2a5 _16lm1iwz _16lm1iw1o _16lm1iw1q _16lm1iw2 _16lm1iw22 _16lm1iw23 _16lm1iw17";var Ks=Se({defaultClassName:"_12zfob120 _16lm1iw19 _16lm1iw1b _16lm1iwz _16lm1iw1o _16lm1iw1q _16lm1iw1v",variantClassNames:{filtered:{false:"_12zfob121",true:"_12zfob122"},verticalAlign:{start:"_12zfob123",end:"_12zfob124",center:"_12zfob125"},align:{start:"_12zfob126",end:"_12zfob127",center:"_12zfob128"}},defaultVariants:{},compoundVariants:[]}),ks="_12zfob1n _16lm1iw23 _16lm1iw24 _16lm1iw1x",Bs=Se({defaultClassName:"_12zfob1o _16lm1iw12",variantClassNames:{rowActive:{false:"_12zfob1p",true:"_12zfob1q"},cellSelected:{false:"_12zfob1r",true:"_12zfob1s"},rowSelected:{false:"_12zfob1t",true:"_12zfob1u",null:"_12zfob1v"},firstRow:{false:"_12zfob1w",true:"_12zfob1x"},groupRow:{false:"_12zfob1y",true:"_12zfob1z"},groupCell:{false:"_12zfob110",true:"_12zfob111"},align:{start:"_12zfob112",end:"_12zfob113",center:"_12zfob114"},verticalAlign:{start:"_12zfob115",end:"_12zfob116",center:"_12zfob117"},zebra:{false:"_12zfob118",even:"_12zfob119",odd:"_12zfob11a"},dragging:{true:"_12zfob11b",false:"_12zfob11c"},first:{true:"_12zfob11d",false:"_12zfob11e"},last:{true:"_12zfob11f",false:"_12zfob11g"},groupByField:{true:"_12zfob11h",false:"_12zfob11i"},firstInCategory:{true:"_12zfob11j",false:"_12zfob11k"},lastInCategory:{true:"_12zfob11l",false:"_12zfob11m"},pinned:{start:"_12zfob11n",end:"_12zfob11o",false:"_12zfob11p"},filtered:{true:"_12zfob11q",false:"_12zfob11r"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob11s"],[{pinned:"end",firstInCategory:!0},"_12zfob11t"],[{pinned:!1,lastInCategory:!0},"_12zfob11u"]]}),Ws=Se({defaultClassName:"_12zfob19 _16lm1iw12 _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1a",end:"_12zfob1b",false:"_12zfob1c"},firstInCategory:{true:"_12zfob1d",false:"_12zfob1e"},lastInCategory:{true:"_12zfob1f",false:"_12zfob1g"},overflow:{true:"_12zfob1h",false:"_12zfob1i"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1j"],[{pinned:"start",firstInCategory:!0},"_12zfob1k"],[{overflow:!0,pinned:"end"},"_12zfob1l"],[{pinned:"end",lastInCategory:!0},"_12zfob1m"]]}),js="_12zfob12i _16lm1iw1b _16lm1iw19";var $s="_12zfob17",Us="_12zfob12e _16lm1iwz _16lm1iw1o _16lm1iw1q _16lm1iw1",Ys=Se({defaultClassName:"_12zfob12f _16lm1iw1 _16lm1iw1c",variantClassNames:{disabled:{true:"_12zfob12g",false:"_12zfob12h"}},defaultVariants:{},compoundVariants:[]}),wi=Se({defaultClassName:"_12zfob12b _16lm1iwz _16lm1iw1o _16lm1iw1r _16lm1iw1",variantClassNames:{active:{true:"_12zfob12c",false:"_12zfob12d"}},defaultVariants:{},compoundVariants:[]}),qs="_12zfob12a _16lm1iwz _16lm1iw1o _16lm1iw1q",Xs=Se({defaultClassName:"_12zfob11v _16lm1iw1 _16lm1iwz _16lm1iw1m _16lm1iw1u _16lm1iw21",variantClassNames:{menuVisible:{true:"_12zfob11w"},reserveSpaceWhenHidden:{true:"_12zfob11x",false:"_12zfob11y"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob11z"]]}),Zs="_12zfob18 _16lm1iw2",Js="_16lm1iw1",Qs="_12zfob16",eu=Se({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),tu="_12zfob129 _16lm1iw1x _16lm1iw1 _16lm1iwz _16lm1iw1o";var Ye="InfiniteTableIcon";var nu="_6aunoi0 _16lm1iwz _16lm1iw1m _16lm1iw1 _16lm1iw1u _16lm1iw1q";var eh={transition:"width 0.25s, opacity 0.25s"};function yn(o){var h;let[e,t]=ou(!0),[n,r]=ou(0),{lineWidth:i=1,style:a,className:l,index:s}=o,u=s!=null&&s>0,c=(h=o.size)!=null?h:16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f=D(C(D(C({},eh),{borderTop:`${i}px solid currentColor`}),o.lineStyle),{opacity:n});if(Jf(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),Qf(()=>{t(!0)},[]),!e)return null;let m={};return Sn.createElement("div",{"data-name":"filter-icon",style:D(C({},a),{width:c}),className:Q(l,Ye,nu,`${Ye}-sort`)},u?Sn.createElement("div",{"data-name":"index",style:m,className:$s},s):null,Sn.createElement("div",{style:C({width:p[0]},f)}),Sn.createElement("div",{style:C({width:p[1]},f)}),Sn.createElement("div",{style:C({width:p[2]},f)}))}var Ii=o=>{let{availableSize:e,items:t,minSize:n,maxSize:r}=o;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],u=[];t.forEach((I,R)=>{var V,z,F,M,A;let x=(z=(V=I.maxSize)!=null?V:r)!=null?z:void 0,E=(M=(F=I.minSize)!=null?F:n)!=null?M:void 0;s.push(E),u.push(x),I.size!=null&&(x!=null&&I.size>x&&(I.size=x),E!=null&&I.size<E&&(I.size=E));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 ${R} doesn't have either of those.`;P!=null&&(l+=1),a+=P!=null?P:0,i+=(A=I.size)!=null?A:0});let c=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((I,R)=>{var x,E,P,V;if(I.flex!=null){let z=d*I.flex,F=(E=(x=I.maxSize)!=null?x:r)!=null?E:void 0,M=(V=(P=I.minSize)!=null?P:n)!=null?V:void 0,A=!1,_=0;F!=null&&z>F&&(p[R]=!0,A=!0,_=F),M!=null&&z<M&&(f[R]=!0,A=!0,_=M),A&&(m+=1,l-=1,a-=I.flex,c-=_)}}),m&&(d=c/a);let h=[],g=0,y=c,T=a,S=0,b=0,w=[];return{items:t.map((I,R)=>{var _,H,G,J,U;let x=C({},I),E=(H=(_=I.maxSize)!=null?_:r)!=null?H:void 0,P=(J=(G=I.minSize)!=null?G:n)!=null?J:void 0,V=0,z=p[R],F=f[R],M=z||F,A=(U=I.size)!=null?U:0;if(I.flex!=null){if(M)F&&(V=P),z&&(V=E);else{g+=1;let $=ee=>(E!=null&&ee>E&&(ee=E),P!=null&&ee<P&&(ee=P),ee);g===l?V=$(y):(V=$(Math.round(I.flex*d)),b+=V,y=c-b,T-=I.flex,d=y/T)}A=V,x.flexSize=V}return h.push(V),w.push(A),x.computedSize=A,S+=A,x}),flexSizes:h,minSizes:s,maxSizes:u,computedSizes:w,remainingSize:Math.round(e-S)}};function $o(o,e,t,n){return e!=null&&o<=e?{value:e,clamped:"min",diff:(o-e)*n}:t!=null&&o>=t?{value:t,clamped:"max",diff:(t-o)*n}:{value:o,clamped:!1,diff:0}}var xi=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((E,P)=>(E[P]=C({},o.columnSizing[P]),E),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[i],s=o.items[a],u=l.id,c=s==null?void 0:s.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",h=s==null?void 0:s.computedWidth,g=s==null?void 0:s.computedMinWidth,y=s==null?void 0:s.computedMaxWidth,T=s!=null&&s.computedFlex?"flex":"width",S=!1,b=!1,w=r>0?1:-1,{value:v,clamped:I,diff:R}=$o(d+r,p,f,w);if(o.shareSpaceOnResize){if(s==null)return n[u]=D(C({},n[u]),{[m]:v}),b=I==="min",S=I==="max",{adjustedDiff:v-d,reservedWidth:t,columnSizing:n,minReached:b,maxReached:S,constrained:b||S};let{value:E,clamped:P,diff:V}=$o(h-r,g,y,w);if(I&&P&&(Math.abs(R)>Math.abs(V)?P=!1:I=!1),!(!I&&!P)){if(I){let z=$o(h-r-R,g,y,w);E=z.value,P=z.clamped,V=z.diff}else if(P){let z=$o(d+r+V,p,f,w);v=z.value,I=z.clamped,R=z.diff}}n[u]=D(C({},n[u]),{[m]:v}),n[c]=D(C({},n[c]),{[T]:E}),b=I==="min"||P==="min",S=I==="max"||P==="max"}else n[u]=D(C({},n[u]),{[m]:v}),b=I==="min",S=I==="max";let x=v-d;return{adjustedDiff:x,reservedWidth:o.shareSpaceOnResize?t:t-x,columnSizing:n,minReached:b,maxReached:S,constrained:b||S}};function ru(o,e){return o+e}function th(o){return Object.keys(o).reduce((t,n)=>(t[n]=C({},o[n]),t),{})}var iu=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((y,T)=>(y[T]=C({},o.columnSizing[T]),y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((y,T)=>o.dragHandlePositionAfter-T).reverse(),a=i.map(y=>o.items[y]),l=a.map(y=>y.computedWidth),s=a.map(y=>y.computedFlex?"flex":"width"),u=0,{computedSizes:c}=Ii({items:a.map(y=>(y.resizable===!1&&(u+=y.computedWidth),{maxSize:y.computedMaxWidth,minSize:y.computedMinWidth,flex:y.resizable?y.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(ru,0)+r-u,0)}),d=a.map((y,T)=>c[T]-y.computedWidth),p=!0,f=!0,m=!0,h=[];d.forEach((y,T)=>{let S=a[T];if(!S.resizable){h.push(0);return}let b=s[T],w=l[T],v=th(n),{maxReached:I,minReached:R,constrained:x,adjustedDiff:E}=xi({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[T],shareSpaceOnResize:!1,items:o.items,columnSizing:v});n[S.id]=D(C({},v[S.id]),{[b]:w+E}),h.push(E),I||(f=!1),R||(p=!1),x||(m=!1)});let g=h.reduce(ru,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:h,adjustedDiff:g,columnSizing:n,reservedWidth:t-g}};var Uo;function Xt(){var n,r;if(Uo!=null)return Uo;let o=(n=xe().document)!=null?n:null;if(!o)return 0;let e=o.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",o.body.appendChild(e);let t=o.createElement("div");return e.appendChild(t),Uo=e.offsetWidth-t.offsetWidth,(r=e.parentNode)==null||r.removeChild(e),Uo}var au=["start",void 0,"end"],lu=(o,e)=>(e&&Object.keys(e).length>0&&o.sort((t,n)=>{let r=e[t],i=e[n];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:au.indexOf(r)-au.indexOf(i)}),o);function su(o,e,...t){let n=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&o(r[i],i)&&(n[i]=r[i])}),n}function vi(o,...e){return su(t=>t!=null,o,...e)}function uu(o,e,...t){return su((n,r)=>!(r in o),e,...t)}var Yo=Object.freeze({}),nh={string:Yo,number:{}};function Pi(o,e){let t=e.default||Yo;return o.type===void 0?t:o.type===null?Yo:typeof o.type=="string"?e[o.type]||nh[o.type]||Yo:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var qo=!0,oh=!0,rh=!0,ih="string",Tn="unknown",ah=wo("getComputedVisibleColumns"),lh=(o,e,t)=>o[t]!==!1,Di=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1},cu=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:u,pinnedEndMaxWidth:c,filterValue:d,sortable:p,sortInfo:f,multiSort:m,filterTypes:h=Zt,viewportReservedWidth:g,resizableColumns:y,draggableColumns:T,columnOrder:S,columnPinning:b,editable:w,columnDefaultEditable:v,columnDefaultFilterable:I,columnDefaultSortable:R,columnSizing:x,columnTypes:E,columnVisibility:P,columnVisibilityAssumeVisible:V})=>{let z=0,F=(d||[]).reduce((K,q)=>{let{id:le,field:ue}=q;return ue&&(K[ue]=q),le&&(K[le]=q),K},{}),M=lu(S===!0?Object.keys(o):S,b),A=M.filter(K=>o[K]?lh(P,V,K):(ah(`Column with id "${K}" specified in columnOrder array cannot be found in the columns map.`),!1)),_=new Map,H=A.map((K,q)=>{let le=o[K];return _.set(K,q),le}),G=(f!=null?f:[]).reduce((K,q,le)=>(q.id?K[q.id]={sortInfo:q,index:le}:q.field&&(K[q.field]={sortInfo:q,index:le}),K),{});function J(K){var Fe,Qe,ut,ct,St,Et;let q=o[K],le=Pi(q,E),ue={minWidth:le==null?void 0:le.minWidth,maxWidth:le==null?void 0:le.maxWidth,width:le==null?void 0:le.defaultWidth,flex:le==null?void 0:le.defaultFlex},Le=vi({width:q==null?void 0:q.defaultWidth,flex:q==null?void 0:q.defaultFlex,minWidth:q==null?void 0:q.minWidth,maxWidth:q==null?void 0:q.maxWidth},x[K]);Le.width!=null&&delete ue.flex,Le.flex!=null&&delete ue.width,Le=vi(ue,Le);let re=(Fe=Le.flex)!=null?Fe:void 0,Be=(ut=(Qe=Le.minWidth)!=null?Qe:q==null?void 0:q.minWidth)!=null?ut:t,We=(St=(ct=Le.maxWidth)!=null?ct:q==null?void 0:q.maxWidth)!=null?St:n,Te=re!=null?void 0:(Et=Le.width)!=null?Et:i?void 0:r;return!Te&&re==null&&(i?re=i:Te=Be),{size:Te,flex:re,minSize:Be,maxSize:We}}let U=Ii({availableSize:Math.max(e.width-(g!=null?g:0)-(a!=null?a:Xt()),0),maxSize:n,minSize:t,items:A.map(J)}),{computedSizes:$,flexSizes:ee,minSizes:N,maxSizes:k}=U,Y=[],O=[],B=[],L=[];L.length=A.length;let W=new Map,te=new Map,X=0,ne=0,ge=0,ye=null,ke=[],je=0,lt=0,Ce=0;H.forEach((K,q)=>{let le=A[q],ue=$[q],Le=ke[q]=Di(le,b);Le==="start"?je+=ue:Le==="end"?Ce+=ue:lt+=ue});let De=e.width-Ce,$e=[],de=new Map;A.forEach((K,q)=>{let le=H[q];de.set(K,le)});let Bt=[];Object.keys(o).forEach(K=>{let q=o[K];Bt.push(K),de.has(K)||de.set(K,q)});let st=new Map;de.forEach((K,q)=>{var Ba,Wa,ja,$a,Ua,Ya,qa,Xa,Za,Ja,Qa,el,tl,nl,ol,rl,il,al,ll,sl,ul,cl,dl,pl,ml,fl,hl,gl,Cl;let le=_.get(q);le==null&&(le=-1);let ue=le!=-1,Le=A[le+1],re=Pi(K,E),Be=le,We=G[q]?G[q]:K.field&&(Ba=G[K.field])!=null?Ba:null,Te=(Wa=We==null?void 0:We.sortInfo)!=null?Wa:null,Fe=!!Te,Qe=Fe&&Te.dir===1,ut=Fe&&!Qe,ct=(ja=We==null?void 0:We.index)!=null?ja:-1,St=ue?{}:J(q),Et=ue?$[le]:St.size||0,ie=ue&&ee[le]||null,et=ue?N[le]||0:St.minSize||0,Gr=ue?k[le]||1e4:St.maxSize||1e4,Ge=ue?Di(q,b):!1,Ln=ue?le===A.length-1:!1,dt=Be,Ut=ue?Ge==="start"?ne:Ge==="end"?ge:z-ne:0;Ge=="start"?dt=ue?Be:-1:Ge==="end"?dt=ue?Be-(Y.length+B.length):-1:dt=ue?Be-Y.length:-1;let fm=ue?Ge==="start"||Ge===!1?z:De+ge:-1,hm=ue?Ge!==ye:!1,gm=ue?Ln||Ge!==Di(Le,b):!1,Ga=(Ua=($a=K.cssEllipsis)!=null?$a:re.cssEllipsis)!=null?Ua:l,Cm=(Ja=(Za=(Xa=(qa=(Ya=K.headerCssEllipsis)!=null?Ya:re.cssEllipsis)!=null?qa:K.cssEllipsis)!=null?Xa:re.headerCssEllipsis)!=null?Za:s)!=null?Ja:Ga,Co=ue&&(F[q]||K.field||K.groupByForColumn)&&(F[q]||F[K.field||K.groupByForColumn])||null,Sm=(tl=(el=(Qa=K.defaultFilterable)!=null?Qa:re.defaultFilterable)!=null?el:I)!=null?tl:!0,ym=(rl=(ol=(nl=w!=null?w:K.defaultEditable)!=null?nl:re.defaultEditable)!=null?ol:v)!=null?rl:!1,Hr=K.dataType||re.dataType||(Array.isArray(K.type)?K.type[0]:K.type)||ih,Tm=K.sortType||re.sortType||Hr,Ha=K.filterType||re.filterType||Hr,Na=!1;if(Co!=null&&!Co.disabled){let Kr=h[Ha];Kr&&(!Kr.emptyValues||!Kr.emptyValues.includes(Co.filter.value))&&(Na=!0)}let Ka=(il=K.field)!=null?il:re.field,ka=(al=K.valueGetter)!=null?al:re.valueGetter,Nr=(ll=K.defaultSortable)!=null?ll:re.defaultSortable;Nr==null&&!K.groupByForColumn&&Ka==null&&ka==null&&(Nr=!1);let bm=(ul=(sl=p!=null?p:Nr)!=null?sl:R)!=null?ul:qo,Rm=(pl=(dl=(cl=K.resizable)!=null?cl:re.resizable)!=null?dl:y)!=null?pl:oh,Ve=D(C({colType:re,align:re.align,headerAlign:re.headerAlign,computedVisible:ue,verticalAlign:re.verticalAlign,defaultHiddenWhenGroupedBy:re.defaultHiddenWhenGroupedBy,valueGetter:ka,valueFormatter:re.valueFormatter,renderValue:re.renderValue,render:re.render,style:re.style,contentFocusable:re.contentFocusable,renderMenuIcon:re.renderMenuIcon,renderSortIcon:re.renderSortIcon,renderRowDetailIcon:re.renderRowDetailIcon,renderSelectionCheckBox:re.renderSelectionCheckBox,renderHeaderSelectionCheckBox:re.renderHeaderSelectionCheckBox,headerStyle:re.headerStyle,headerClassName:re.headerClassName,columnGroup:re.columnGroup,getValueToEdit:re.getValueToEdit,getValueToPersist:re.getValueToPersist,shouldAcceptEdit:re.shouldAcceptEdit,field:Ka},K),{components:C(C({},re.components),K.components),computedResizable:Rm,computedMinWidth:et,computedMaxWidth:Gr,computedFlex:ie,computedDataType:Hr,computedEditable:ym,computedSortType:Tm,computedFilterType:Ha,cssEllipsis:Ga,headerCssEllipsis:Cm,computedFilterValue:Co,computedFiltered:Na,computedFilterable:Sm,computedWidth:Et,computedAbsoluteOffset:fm,computedPinningOffset:Ut,computedVisibleIndexInCategory:dt,computedOffset:z,computedSortable:bm,computedSortInfo:Te,computedSortIndex:ct,computedMultiSort:m,computedSorted:Fe,computedSortedAsc:Qe,computedSortedDesc:ut,computedVisibleIndex:Be,computedPinned:Ge,computedDraggable:(fl=(ml=K.draggable)!=null?ml:T)!=null?fl:rh,computedFirstInCategory:hm,computedLastInCategory:gm,computedFirst:le===0,computedLast:Ln,id:q,header:(Cl=(gl=(hl=K.header)!=null?hl:re.header)!=null?gl:K.name)!=null?Cl:K.field});ue&&(z+=Et,W.set(Ve.id,Ve),L[le]=Ve,Ge==="start"&&(Y.push(Ve),ne+=Ve.computedWidth),Ge==="end"&&(O.push(Ve),ge+=Ve.computedWidth),Ge||(B.push(Ve),X+=Ve.computedWidth),ye=Ge),Ve.groupByForColumn&&(Ve.computedSortType=K.sortType||re.sortType||Tn,$e.push(Ve)),te.set(Ve.id,Ve),Ve.field&&!Ve.groupByForColumn&&!st.has(Ve.field)&&st.set(Ve.field,Ve)}),$e.forEach(K=>{K.computedSortable=du(K,{fieldsToColumn:st,sortable:p,columnDefaultSortable:R})});let Mt=new Map;Bt.forEach(K=>{let q=te.get(K);q&&Mt.set(K,q)}),te.forEach(K=>{Mt.has(K.id)||Mt.set(K.id,K)});let Wt=u!=null?Math.min(u,ne):ne,jt=c!=null?Math.min(c,ge):ge;return{computedRemainingSpace:e.width-(je+Ce+lt),computedPinnedStartColumnsWidth:ne,computedPinnedEndColumnsWidth:ge,computedUnpinnedColumnsWidth:X,computedColumnOrder:M,computedPinnedStartColumns:Y,computedPinnedEndColumns:O,computedUnpinnedOffset:ne,computedPinnedEndOffset:ne+X,computedUnpinnedColumns:B,computedVisibleColumns:L,computedColumnsMap:te,computedColumnsMapInInitialOrder:Mt,computedVisibleColumnsMap:W,computedPinnedEndWidth:jt,computedPinnedStartWidth:Wt,renderSelectionCheckBox:L.reduce((K,q)=>K||!!q.renderSelectionCheckBox,!1),fieldsToColumn:st}};function du(o,e){var s;let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r}=e;if(t)return t;let i=(s=o.defaultSortable)!=null?s:o.colType.defaultSortable;if(i!=null)return i;let a=r!=null?r:qo;return o.computedSortType!==Tn&&a?!0:u=>{let{column:c,api:d}=u,p=c.groupByForColumn||[];return p!=null&&!Array.isArray(p)&&(p=[p]),(p||[]).reduce((f,m)=>{var y;if(!f)return!1;let h=m.field||m.groupField,g;if(h){let T=n.get(h),S=T?d.getColumnApi(T.id):void 0;T&&S?g=S.isSortable():g=!1}return g===void 0&&m.valueGetter&&(g=!0),(y=g!=null?g:r)!=null?y:qo},!0)}}function Ne(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){var u,c;return(c=(u=l.getCellValuesByPrimaryKey(s))==null?void 0:u.value)!=null?c:null},toggleContextMenu(s){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},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 Xo(o,e){var h;let t=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:n,getComputed:r,getDataSourceState:i,actions:a,dataSourceActions:l,dataSourceApi:s}=e,u=i(),{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=u,f=r(),m=t.header&&typeof t.header!="function"?t.header:t.name||t.id||"";if(typeof t.header=="function"){let g=Ne(t.id,D(C({},e),{actions:a,dataSourceActions:l,dataSourceApi:s}));m=(h=t.header({column:t,columnApi:g,insideColumnMenu:!0,dragging:!1,columnsMap:f.computedColumnsMap,columnSortInfo:t.computedSortInfo,columnFilterValue:t.computedFilterValue,filtered:t.computedFiltered,allRowsSelected:c,someRowsSelected:d,selectionMode:p,api:n,renderBag:{header:m}}))!=null?h:null}return m}import sh from"react";var Zo=`${ot}HeaderCell__filter`,Mi=`${ot}HeaderCell__filterOperator`,Ei=sh.createContext(null);var ch=`${Zo}__input`,Jo=o=>o.stopPropagation();function mu(o){let{filterOperatorMenuVisibleForColumnId:e}=zs(),{column:t}=Qo(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=pu(!1),l=He.useCallback(()=>{a(!0)},[]),s=He.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return He.createElement("div",{onPointerUp:Jo,onPointerDown:Jo,onFocus:l,onBlur:s,className:`${Zo} ${wi({active:u})}`,style:{height:o.columnHeaderHeight}},He.createElement(Ei.Provider,{value:o},He.createElement(r,null),He.createElement(n,null)))}function fu(){var r,i;let{columnApi:o,disabled:e,operator:t}=Jn(),n=(i=(r=t==null?void 0:t.components)==null?void 0:r.Icon)!=null?i:yn;return He.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:a=>{a.stopPropagation(),!e&&o.toggleFilterOperatorMenu(a.target)},className:Q(Mi,Us,e?`${Mi}--disabled`:"")},He.createElement(n,{size:20,className:`${Ys({disabled:e})}`}))}function hu(){return He.createElement("div",{onPointerUp:Jo,onPointerDown:Jo,className:`${Zo} ${wi({active:!1})}`,style:{height:"100%"}})}function Jn(){var g;let o=oe(),{column:e,columnApi:t}=Qo(),n=Xo(e,o),r=He.useContext(Ei),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=pu((g=l==null?void 0:l.filter.value)!=null?g:""),d=He.useCallback(y=>{c(y),r.onChange(y)},[r.onChange]),p=He.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=He.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);uh(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let y=[...s.emptyValues][0];y!==u&&c(y)}},[l==null?void 0:l.filter.value]);let m=r.operator,h=m==null?void 0:m.name;return{api:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:h,operator:m,value:u,disabled:l==null?void 0:l.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${js} ${ch}`}}function bn(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Jn();return Ai.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function er(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Jn();return Ai.createElement("input",{"aria-label":o,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:n})}function dh(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:bn},operators:[{name:"includes",components:{Icon:Ds},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:hi},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:Vs},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Ms},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:er},operators:[{label:"Equals",components:{Icon:hi},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:Os},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:As},fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>t},{name:"gte",components:{Icon:Es},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>=t},{name:"lt",components:{Icon:_s},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<t},{name:"lte",components:{Icon:Fs},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<=t}]}}}var Zt=dh();function tr(o,e,t,n){var l,s;let r=[...e],i={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:(l=n.rowSelected)!=null?l:"null",rowActive:n.rowActive,dragging:n.dragging,firstRow:(s=n.firstRow)!=null?s:!1,groupRow:n.groupRow,groupCell:n.groupCell,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=t(i);return r.push(a),o.computedFirst&&r.push(...e.map(u=>`${u}--first`)),o.groupByForColumn&&r.push(...e.map(u=>`${u}--group-column`)),o.computedLast&&r.push(...e.map(u=>`${u}--last`)),o.computedFirstInCategory&&r.push(...e.map(u=>`${u}--first-in-category`)),o.computedLastInCategory&&r.push(...e.map(u=>`${u}--last-in-category`)),n.rowSelected&&r.push(...e.map(u=>`${u}--row-selected`)),n.cellSelected&&r.push(...e.map(u=>`${u}--cell-selected`)),n.firstRow&&r.push(...e.map(u=>`${u}--first-row`)),n.groupRow&&(r.push(...e.map(u=>`${u}--group-row`)),r.push(...e.map(u=>`${u}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?r.push(...e.map(u=>`${u}--pinned-${o.computedPinned}`)):r.push(...e.map(u=>`${u}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as _u,useState as bh}from"react";var gu="_16lm1iw1",Cu="_1yeub2v0 _16lm1iw1 _16lm1iwz _16lm1iw1m _16lm1iw0",Su="_1yeub2vq",yu="_1yeub2vp",Tu=Se({defaultClassName:"_1yeub2v2",variantClassNames:{focused:{true:"_1yeub2v3",false:"_1yeub2v4"},focusedWithin:{true:"_1yeub2v5",false:"_1yeub2v6"},hasPinnedStart:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedEnd:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedStartOverflow:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedEndOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vf"]]});var Fi="_1yeub2vn";var vx=Se({defaultClassName:"_1yeub2vj",variantClassNames:{pinned:{start:"_1yeub2vk",end:"_1yeub2vl",false:"_1yeub2vm"}},defaultVariants:{},compoundVariants:[]});var _i=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};var Oi={bodyWidth:{name:Z(fe.runtime.bodyWidth),value:""},totalVisibleColumnsWidth:{name:Z(fe.runtime.totalVisibleColumnsWidth),value:""},visibleColumnsCount:{name:Z(fe.runtime.visibleColumnsCount),value:""}},ph=Z(j.scrollbarWidthHorizontal),bu=Z(j.scrollbarWidthVertical),Ru=Z(j.columnWidthAtIndex),mh=Z(j.columnOffsetAtIndex),fh=Z(j.columnZIndexAtIndex),wu=Z(j.scrollLeft),hh=Z(j.activeCellColWidth),gh=Z(j.activeCellColOffset),Pu=Z(j.baseZIndexForCells),Ch=Z(j.pinnedStartWidth),Iu=Z(j.bodyWidth),Sh=Z(j.bodyHeight),xu=Z(j.pinnedEndOffset),vu=Z(j.pinnedEndWidth),yh=Z(j.computedVisibleColumnsCount);function Vi(o,e){let t="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?t=e.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(t=e.visibleColsCount+o.computedVisibleIndexInCategory):t=-n*10,typeof t=="number"?`calc( var(${Pu}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Du(o){let e=Xt(),{computed:t,state:n,actions:r,getState:i}=oe(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:u,onBlurWithin:c,onFocusWithin:d,onSelfFocus:p,onSelfBlur:f,bodySize:m,activeCellIndex:h}=n,{computedPinnedStartColumnsWidth:g,computedPinnedEndColumnsWidth:y,computedPinnedStartColumns:T,computedPinnedEndColumns:S,computedVisibleColumns:b,computedUnpinnedColumnsWidth:w,scrollbars:v}=t,I=[],R=b.reduce((M,A)=>{let _=A.computedVisibleIndex;M[`${Ru}-${_}`]=A.computedWidth+"px",M[`${mh}-${_}`]=A.computedPinned==="start"?`calc( ${A.computedOffset}px + var(${wu}) )`:A.computedPinned==="end"?`calc( var(${xu}) ${I.length?"+":""} ${I.map(G=>`var(${Ru}-${G.computedVisibleIndex})`).join(" + ")} + var(${wu}) )`:`${A.computedOffset}px`;let H=Vi(A,{pinnedStartColsCount:T.length,visibleColsCount:b.length});return M[`${fh}-${_}`]=`${H}`,A.computedPinned==="end"&&I.push(A),M},{});R[Oi.bodyWidth.name]=`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,R[Oi.totalVisibleColumnsWidth.name]=`${g+y+w}px`,R[Oi.visibleColumnsCount.name]=b.length,h!=null&&(R[hh]=`var(${_o(h[1])})`,R[gh]=`var(${Jl(h[1])})`),R[yh]=b.length,R[ph]=v.horizontal?`${e}px`:"0px",R[bu]=v.vertical?`${e}px`:"0px",R[Ch]="calc( "+T.map(M=>`var(${_o(M.computedVisibleIndex)})`).join(" + ")+")",R[vu]="calc( "+S.map(M=>`var(${_o(M.computedVisibleIndex)})`).join(" + ")+")",R[Pu]=b.length*10,R[xu]=`calc( var(${Iu}) - var(${vu}) - var(${bu}) )`,R[Iu]=`${m.width}px`,R[Sh]=`${m.height}px`;let x=_i(M=>{r.focused=M}),E=_i(M=>{r.focusedWithin=M}),P=M=>{var A;if((A=o==null?void 0:o.onFocus)==null||A.call(o,M),M.target===s.current||M.target===u.current){if(i().focused)return;x(!0),p==null||p(M),l&&(E(!1),c==null||c(M));return}l||(E(!0),d==null||d(M))},V=M=>{var _,H;if((_=o==null?void 0:o.onBlur)==null||_.call(o,M),M.target===s.current||M.target===u.current){if(!i().focused)return;x(!1),f==null||f(M),l&&(E(!1),c==null||c(M));return}((H=s.current)==null?void 0:H.contains(M.relatedTarget))||(E(!1),c==null||c(M))},z=D(C({},o),{onFocus:P,onBlur:V}),F=Q(Ot,Cu,z==null?void 0:z.className,g?`${Ot}--has-pinned-start ${yu}`:null,y?`${Ot}--has-pinned-end ${Su}`:null,a?`${Ot}--focused`:null,l?`${Ot}--focused-within`:null,a&&n.focusedClassName?n.focusedClassName:null,l&&n.focusedWithinClassName?n.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${Ot}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${Ot}--has-pinned-end-overflow`:null,Tu({hasPinnedStart:!!g,hasPinnedEnd:!!y,focused:a,focusedWithin:l}));return z.className=F,z.style=C(C({},o==null?void 0:o.style),R),a&&n.focusedStyle&&Object.assign(z.style,n.focusedStyle),l&&n.focusedWithinStyle&&Object.assign(z.style,n.focusedWithinStyle),z}var Au=jr(Oo());var Qn=(o,e,t)=>{if(o=[...o],e===t||o[e]===void 0||o[t]===void 0)return o;let n=o[e];return t<e,o.splice(e,1),o.splice(t,0,n),o};var Mu=o=>{let e=null,t=null;return{stop(){e!==null&&nt(e),t!=null&&nt(t)},scroll(n){e!==null&&nt(e),t!=null&&nt(t);let r=C(C({offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15]},o),n),i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=be(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=be(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var Eu=10,Th=Z(j.pinnedStartWidth);function Fu(o){let{columnOffsetAtIndexCSSVar:e,columnWidthAtIndexCSSVar:t,computedVisibleColumns:n,computedVisibleColumnsMap:r,computedPinnedEndColumns:i,computedPinnedStartColumns:a,dragColumnId:l,infiniteDOMNode:s,brain:u,dragColumnHeaderTargetRect:c,tableRect:d,setProxyPosition:p,api:f}=o;function m(O){let B=O==="start"?z:F;return E===V?B:V===O?B+R.computedWidth:E===O?B-R.computedWidth:B}function h(O){if(O.index===x)return!0;let B=n[O.index];if(B.computedPinned)return!0;let L=u.getScrollPosition().scrollLeft;return B.computedOffset>=L+m("start")&&B.computedOffset+B.computedWidth<L+d.width-m("end")}let g=O=>{let B=[];return O.forEach(L=>{let W={columnId:L.id,index:L.computedVisibleIndex,breakpoint:L.computedOffset+Math.round(L.computedWidth/2)};h(W)&&B.push(W)}),B},T=a.length,S={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},b={left:S.clientX-d.left-(S.clientX-c.left)+Eu,top:S.clientY-d.top-(S.clientY-c.top)+Eu},w=u.getScrollPosition(),v=n.map(O=>O.computedVisibleIndex),I=v,R=r.get(l),x=R.computedVisibleIndex,E=R==null?void 0:R.computedPinned,P=x,V=E,z=u.getFixedStartColsWidth(),F=u.getFixedEndColsWidth(),M=S,A={x:0,y:0},_=1,H=0;function G(O){let B=Math.round(O.clientX),L=Math.round(O.clientY);if(B===M.clientX&&L===M.clientY)return;M={clientX:B,clientY:L};let te=u.getScrollPosition().scrollLeft-w.scrollLeft;A.x=M.clientX-S.clientX,A.y=M.clientY-S.clientY,H=A.x+te,_=H<0?-1:1,p({left:b.left+A.x,top:b.top+A.y})}function J(O){let B=0;E?E==="start"&&O.forEach((L,W)=>{var te;B||((te=n[L])==null?void 0:te.computedPinned)!=="start"&&(B=W)}):O.forEach((L,W)=>{var te;((te=n[L])==null?void 0:te.computedPinned)==="start"&&(B=W+1)}),T=B,U("start",O,B)}function U(O,B,L){if(O==="start"){let W=0;for(let te=0;te<L;te++){let X=B[te],ne=n[X];W+=ne.computedWidth}Tt(Th,`${W}px`,s)}}function $(O){if(O===P)return;P=O;let B=Qn(v,x,P>x?P-1:P);T=0;let W=new Set;return B.forEach((te,X)=>{let ne=I[X];te!==ne&&W.add(te),J(B)}),I=B,ee(W),{newColumnIndexes:B,indexesWithTransition:W,pinnedStartCount:T}}function ee(O){n.forEach(B=>{let L=B.computedVisibleIndex;O.has(L)?Zl(L,s):Fo(L,s);let W=L===x,te=_===-1?L<P||L>x:L<x||L>=P,X="";_===-1?X=W?`var(${e}-${P})`:te?`var(${e}-${L})`:`calc( var(${e}-${L}) + var(${t}-${x}) )`:X=te?`var(${e}-${L})`:W?`calc( var(${e}-${P-1}) + var(${t}-${P-1}) - var(${t}-${x}) )`:`calc( var(${e}-${L}) - var(${t}-${x}) )`,Wn(L,X,s)})}let N=d.left+m("start"),k=d.right-m("end"),Y=Mu({scrollOffsetStart:N,scrollOffsetEnd:k});return G(S),{speedScroller:Y,stop(){Y.stop()},onMove(O){G(O),Y.scroll({mousePosition:M,get scrollLeft(){return u.getScrollPosition().scrollLeft},set scrollLeft(ne){f.scrollLeft=ne}});let B=g(n),L=_===-1?R.computedOffset+H:R.computedOffset+R.computedWidth+H,W=(0,Au.default)(B,L,({breakpoint:ne},ge)=>ne<ge?-1:ne>ge?1:0);W<0&&(W=~W),W=B[W]?B[W].index:B[B.length-1].index+1,W!=null&&W!==P&&(_===1&&P===x+1&&(W=x),$(W));let te={};i.forEach(ne=>{te[ne.id]="end"});for(let ne=0;ne<T;ne++){let ge=I[ne],ye=n[ge];te[ye.id]="start"}let X=I.map(ne=>n[ne].id);return{columnPinning:te,columnOrder:X}}}}function Vt(o,e,t){if(o===e)return!0;if(!o||!e)return!1;var n=Object.keys(o),r=Object.keys(e);t&&(n=n.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=n.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=n[a];if(!(t&&t.has(l))&&(o[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function zi(o){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:n,dragColumnId:r}=o;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 n;if(a>i){let l=e.indexOf(r),s=e[l-1],u=n.indexOf(s),c=n.indexOf(r);return Qn(n,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=n.indexOf(s),c=n.indexOf(r);return Qn(n,c,u)}return e}var Rh=Z(j.columnOffsetAtIndex),wh=Z(j.columnWidthAtIndex),Ih=Z(j.baseZIndexForCells),xh=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:Vt(o,e)},Ou=({columnId:o,domRef:e})=>{var p;let[t,n]=bh(null),{actions:r,computed:i,getComputed:a,getState:l,api:s,state:{domRef:u}}=oe(),c=_u(f=>{let m=a().computedVisibleColumnsMap.get(o);if(!m||!m.computedSortable)return;let{multiSortBehavior:h}=l();s.toggleSortingForColumn(o,{multiSortBehavior:h==="replace"&&(f.ctrlKey||f.metaKey)?"append":h})},[]),d=_u(f=>{var _,H;if(((_=f.target)==null?void 0:_.tagName)==="INPUT")return;let{brain:m}=l(),{computedVisibleColumns:h,computedVisibleColumnsMap:g,computedPinnedStartColumns:y,computedUnpinnedColumns:T,computedPinnedEndColumns:S}=a(),b=g.get(o);if(!b.computedDraggable){c(f);return}let w=e.current,v=w.getBoundingClientRect(),I=u.current.getBoundingClientRect(),R=m.getAvailableSize(),x=b.computedVisibleIndex,E=(H=w.style.cursor)!=null?H:"auto",P=!1,V=Fu({brain:m,columnOffsetAtIndexCSSVar:Rh,columnWidthAtIndexCSSVar:wh,computedPinnedEndColumns:S,computedPinnedStartColumns:y,computedUnpinnedColumns:T,computedVisibleColumns:h,computedVisibleColumnsMap:g,dragColumnHeaderTargetRect:v,dragColumnId:o,api:s,infiniteDOMNode:u.current,setProxyPosition:n,tableRect:I,initialMousePosition:{clientX:f.clientX,clientY:f.clientY}}),z=null;function F(G){let{columnPinning:J,columnOrder:U}=G;xh(l().columnPinning,J)||(r.columnPinning=J);let $=a().computedColumnOrder;JSON.stringify(U,$)&&(h.forEach(ee=>{Wn(ee.computedVisibleIndex,"",u.current)}),r.columnOrder=zi({newColumnOrder:U,visibleColumnOrder:a().computedVisibleColumns.map(ee=>ee.id),existingColumnOrder:$,dragColumnId:o}))}let M=G=>{var $;let{headerBrain:J,brain:U}=l();P||(P=!0,U.setRenderCount({horizontal:h.length,vertical:void 0}),J.setRenderCount({horizontal:h.length,vertical:void 0}),r.columnReorderDragColumnId=b.id,ti(x,`calc( var(${Ih}) + 10000 )`,u.current),($=u.current)==null||$.classList.add(Fi),w.style.cursor="grabbing"),z=V.onMove(G)},A=G=>{var ee,N,k;let{multiSortBehavior:J}=l(),U=e.current;(ee=u.current)==null||ee.classList.remove(Fi),V.stop(),m.setAvailableSize(C({},R)),h.forEach(Y=>{Fo(Y.computedVisibleIndex,u.current),Wn(Y.computedVisibleIndex,"",u.current)}),ti(x,Vi(b,{pinnedStartColsCount:y.length,visibleColsCount:h.length}),u.current),U.style.cursor=E,U.releasePointerCapture(G.pointerId),U.removeEventListener("pointermove",M),U.removeEventListener("pointerup",A),n(null);let $=(k=(N=s.getColumnApi(b.id))==null?void 0:N.isSortable())!=null?k:!1;!P&&$&&s.toggleSortingForColumn(b.id,{multiSortBehavior:J==="replace"&&(G.ctrlKey||G.metaKey)?"append":J}),z&&F(z),r.columnReorderDragColumnId=!1};w.addEventListener("pointermove",M),w.addEventListener("pointerup",A),w.setPointerCapture(f.pointerId)},[o]);return{onPointerDown:(p=i.computedVisibleColumnsMap.get(o))!=null&&p.computedDraggable?d:c,proxyPosition:t}};import*as In from"react";import*as ce from"react";import{useCallback as ht,useContext as Hh,useMemo as Nh}from"react";import*as Jt from"react";var Vu=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;import*as eo from"react";import{useState as vh}from"react";var zu="_16lm1iw7 _16lm1iwn _16lm1iwi _16lm1iw9",Lu=Se({defaultClassName:"_198z9781",variantClassNames:{expanded:{true:"_16lm1iwg",false:"_198z9783"},direction:{end:"_198z9784",start:"_198z9785"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwh"]]});function Rn(o){var a;let{size:e=24,direction:t="start"}=o,[n,r]=vh((a=o.expanded)!=null?a:o.defaultExpanded),i=()=>{var l;(l=o.onChange)==null||l.call(o,!n),_t("expanded",o)||r(!n)};return eo.useEffect(()=>{_t("expanded",o)&&r(o.expanded)},[o.expanded]),eo.createElement("svg",{"data-name":"expander-icon",xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:i,className:Q(o.className,zu,Lu({direction:t||"start",expanded:n}),`${Ye}`,`${Ye}-expander`,`InfiniteIcon-expander--${n?"expanded":"collapsed"}`,`InfiniteIcon-expander--${t==="end"?"end":"start"}`)},eo.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}import*as nr from"react";var Gu="_16lm1iwb _16lm1iwn _16lm1iwi";var Hu=o=>nr.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(o.className,Gu,"InfiniteIcon","InfiniteIcon-loading")},nr.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},nr.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var Nu=Se({defaultClassName:"_7pupv0c",variantClassNames:{align:{start:"_7pupv0d",center:"_7pupv0e",end:"_7pupv0f"}},defaultVariants:{},compoundVariants:[]}),Vv=Se({defaultClassName:"_7pupv02 _7pupv00",variantClassNames:{zebra:{false:"_7pupv03",even:"_7pupv04",odd:"_7pupv05"},groupRow:{true:"_7pupv06",false:"_7pupv07"},inlineGroupRow:{true:"_7pupv08",false:"_7pupv09"},showHoverRows:{true:"_7pupv0a",false:"_7pupv0b"}},defaultVariants:{},compoundVariants:[]}),Ku="_7pupv01";function ku({rowInfo:o}){return{[Z(fe.components.Row.groupNesting)]:o.dataSourceHasGrouping?o.isGroupRow?o.groupNesting-1:o.groupNesting:0}}function or({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=n,d=Q(gn.flex,i.align==="end"?Xn.rowReverse:Xn.row,fs.center,`${Qt}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||u)?Nu({align:a}):null);if(e==="multi-column"){if(o+1!==c.groupNesting&&c.isGroupRow)return u?Jt.createElement("div",{className:d},u):null}else e==="single-column"&&c.isGroupRow;return Jt.createElement("div",{className:d},s,u,Jt.createElement("div",{className:ft},l!=null?l:null))}}function rr({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{var g,y,T;let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&((g=i.parents)==null?void 0:g[o])||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===o&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&o+1!==c.groupNesting)return null;let p=c.groupKeys,f=null,m=s?(((y=c.groupKeys)==null?void 0:y.length)||0)<(l==null?void 0:l.length):(((T=c.groupKeys)==null?void 0:T.length)||0)<=(l==null?void 0:l.length);return Vu(c)?f=Jt.createElement(Hu,null):m&&(f=Jt.createElement(Rn,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=Jt.createElement(Ze,{render:n,renderParam:r})),f}}function Bu(o,e,t){let{groupByForColumn:n,groupIndexForColumn:r,groupRenderStrategy:i}=o,a=n.column?C({},n.column):{},l=D(C({header:`Group by ${n.field||n.groupField}`,groupByForColumn:n,render:or({groupIndexForColumn:r,groupRenderStrategy:i})},a),{renderGroupIcon:rr({initialRenderGroupIcon:a==null?void 0:a.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})});return t&&(typeof t=="function"?l=C(C({},l),t(o,e)):l=C(C({},l),t)),l}function Wu(o,e,t){let n=typeof t=="function"?t(o,e):t,r={};return o.sortable!=null&&(r.sortable=o.sortable),D(C(D(C({},r),{header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:or({groupIndexForColumn:0,groupRenderStrategy:"single-column"})}),n),{renderGroupIcon:rr({initialRenderGroupIcon:n==null?void 0:n.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})})}function ju(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var $u="_1eexc2a6 _1eexc2a5 _16lm1iwz _16lm1iw1o _16lm1iw1q _16lm1iw2 _16lm1iw22 _16lm1iw23 _16lm1iw17",Uu=Se({defaultClassName:"_1eexc2ah",variantClassNames:{dragging:{false:"_1eexc2ai",true:"_1eexc2aj"},cellSelected:{false:"_1eexc2ak",true:"_1eexc2al"},align:{start:"_1eexc2am",end:"_1eexc2an",center:"_1eexc2ao"},verticalAlign:{start:"_1eexc2ap",end:"_1eexc2aq",center:"_1eexc2ar"},rowActive:{false:"_1eexc2as",true:"_1eexc2at"},groupRow:{false:"_1eexc2au",true:"_1eexc2av"},groupCell:{false:"_1eexc2aw",true:"_1eexc2ax"},zebra:{false:"_1eexc2ay",even:"_1eexc2az",odd:"_1eexc2a10"},rowSelected:{true:"_1eexc2a11",false:"_1eexc2a12",null:"_1eexc2a13"},first:{true:"_1eexc2a14",false:"_1eexc2a15"},last:{true:"_1eexc2a16",false:"_1eexc2a17"},groupByField:{true:"_1eexc2a18",false:"_1eexc2a19"},firstInCategory:{true:"_1eexc2a1a",false:"_1eexc2a1b"},firstRow:{true:"_1eexc2a1c",false:"_1eexc2a1d"},lastInCategory:{true:"_1eexc2a1e",false:"_1eexc2a1f"},pinned:{start:"_1eexc2a1g",end:"_1eexc2a1h",false:"_1eexc2a1i"},filtered:{true:"_1eexc2a1j",false:"_1eexc2a1k"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_1eexc2a1l"],[{pinned:"start",firstInCategory:!0},"_1eexc2a1m"],[{pinned:"end",firstInCategory:!0},"_1eexc2a1n"],[{pinned:"end",lastInCategory:!0},"_1eexc2a1o"],[{align:"center",groupCell:!1},"_1eexc2a1p"]]}),Yu=Se({defaultClassName:"_1eexc2a8",variantClassNames:{right:{true:"_1eexc2a9",false:"_1eexc2aa"},left:{true:"_1eexc2ab",false:"_1eexc2ac"},top:{true:"_1eexc2ad",false:"_1eexc2ae"},bottom:{true:"_1eexc2af",false:"_1eexc2ag"}},defaultVariants:{},compoundVariants:[]});var ir="_1eexc2a7";import*as ar from"react";import{useEffect as Ph,useRef as Dh}from"react";var qu="qz8ht90 _16lm1iwi";function Mh(){return{checked:1,disabled:o=>o!=null?o:!1,domProps:1}}var Eh=bt({forwardProps:Mh,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function Ah(){let{componentState:o,componentActions:e}=ve(),{checked:t,domProps:n,disabled:r}=o,i=Dh(null);return Ph(()=>{i.current.indeterminate=t==null},[t]),ar.createElement("input",D(C({},n),{className:Q("InfiniteCheckBox",qu,n==null?void 0:n.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}}))}function zt(o){return ar.createElement(Eh,C({},o),ar.createElement(Ah,null))}function Fh(o){return typeof o.field=="string"}function Xu(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?n.get(i.field||i.groupField):void 0}!r&&e.field&&(r=n.get(e.field))}return r}function qe(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),u=s[r],{isGroupRow:c}=u,d=e().computedColumnsMap.get(i),{activeRowIndex:p,keyboardNavigation:f,isRowDetailEnabled:m}=n(),h=r===p&&f==="row",g=!m||typeof m=="function"&&!m(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:T}}=wn({column:d,rowInfo:u,rowDetailState:g,columnsMap:e().computedColumnsMap,context:o}),S=Ne(d.id,o);return c?{api:a,dataSourceApi:l,column:d,columnApi:S,isGroupRow:!0,rowDetailState:!1,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:T}:{api:a,dataSourceApi:l,columnApi:S,column:d,isGroupRow:!1,rowDetailState:g,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:T}}function Zu(o){return Qu(o.column,o.rowInfo)}function Ju(o){var m,h;let{column:e,context:t,rowInfo:n,visibleColumnsIds:r}=o,i=Xu({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=wn(D(C({},o),{column:e})),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=D(C({column:o.column,inEdit:c,rowHasSelectedCells:!1},u),{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align(C({isHeader:!1},d)):(m=e.align)!=null?m:"start",f=typeof e.verticalAlign=="function"?e.verticalAlign(C({isHeader:!1},d)):(h=e.verticalAlign)!=null?h:"center";return{inEdit:c,stylingParam:d,formattedValueContext:u,renderFunctions:{renderGroupIcon:e.renderGroupIcon||(i==null?void 0:i.renderGroupIcon),renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderValue:e.renderValue||(i==null?void 0:i.renderValue),renderGroupValue:e.renderGroupValue||(i==null?void 0:i.renderGroupValue),renderLeafValue:e.renderLeafValue||(i==null?void 0:i.renderLeafValue)},renderParams:_h(D(C({},o),{align:p,verticalAlign:f,formattedValueContext:u})),groupByColumnReference:i}}function _h(o){var I;let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=o,{value:c}=u,{api:d,getDataSourceState:p,getState:f}=t,{editingCell:m}=f(),{indexInAll:h}=n,g=p(),{selectionMode:y,cellSelection:T}=g,S=Xu({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),b=d.toggleGroupRow,w=(I=T==null?void 0:T.isCellSelected(n.id,e.id))!=null?I:!1,v=D(C({column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:w,rowHasSelectedCells:!1},u),{editError:m&&m.primaryKey===n.id&&m.columnId===e.id&&!m.active&&m.accepted instanceof Error?m.accepted:void 0,groupByColumn:S,selectionMode:y,api:d,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:n.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:n.id,colId:e.id})},renderBag:{all:null,value:typeof c=="boolean"?`${c}`:c,selectionCheckBox:null,groupIcon:null},selectCurrentRow:()=>d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0),deselectCurrentRow:()=>d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0),rowIndex:h,toggleGroupRow:b,toggleCurrentGroupRow:()=>{n.isGroupRow&&b(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!n.isGroupRow)return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:g.groupBy,pivotBy:g.pivotBy});return Object.defineProperty(v,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),v}function Qu(o,e){let{data:t,isGroupRow:n,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=n&&i&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===i[i.length-1])?e.value:Fh(o)?t==null?void 0:t[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function Oh(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),u=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:t.isGroupRow,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:t.isGroupRow,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}}function wn(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=Qu(e,t),a=Oh(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}import*as Rt from"react";var{rootClassName:ec}=Ie,en=`${ec}Cell`,Li=`${ec}Cell_content`,Vh=Z(j.columnWidthAtIndex),zh=Z(j.columnReorderEffectDurationAtIndex);function Lh(o){var w,v;let b=o,{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:u,afterChildren:c,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m}=b,h=At(b,["cssEllipsis","virtualized","skipColumnShifting","contentStyle","column","domRef","width","contentClassName","rowId","afterChildren","beforeChildren","cellType","cssPosition","renderChildren"]),g=m(),y=C({width:`var(${Vh}-${i.computedVisibleIndex})`,transition:`transform var(${zh}-${i.computedVisibleIndex}, 0s)`},h.style),T=D(C({},h),{style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:Q(h.className,en,$u),children:Rt.createElement(Rt.Fragment,null,d,Rt.createElement("div",{className:Q(Li,e?ft:ys.hidden,s),style:r},g),c)});u!=null&&(T["data-row-id"]=`${u}`);let S=p==="body"?(w=i.components)==null?void 0:w.ColumnCell:(v=i.components)==null?void 0:v.HeaderCell;return S?Rt.createElement(S,C({},T)):Rt.createElement("div",D(C({},T),{ref:a}))}var lr=Rt.memo(Lh);import*as tn from"react";import{useCallback as tc,useRef as Gh}from"react";function nc(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=Gi(),i=Gh(),a=tn.useCallback(s=>{i.current=s,s&&s.focus()},[]),l=tc(s=>{let{key:u}=s;u==="Enter"||u==="Tab"?t():u==="Escape"?n():s.stopPropagation()},[]);return tn.createElement(tn.Fragment,null,tn.createElement("input",{readOnly:r,ref:a,onKeyDown:l,onBlur:()=>t(),className:Q(ms,Ss.none),type:"text",defaultValue:o,onChange:tc(s=>{e(s.target.value)},[])}))}var{rootClassName:Kh}=Ie,kh=Z(j.columnZIndexAtIndex),to=ce.createContext(null),Qt=`${Kh}ColumnCell`,Bh=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return ce.createElement(Rn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},Wh=o=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:n,toggleCurrentGroupRowSelection:r,column:i}=o;return e.isGroupRow&&i.groupByForColumn,ce.createElement(zt,{domProps:{className:ir},onChange:a=>{if(e.isGroupRow){r();return}a?t():n()},checked:e.rowSelected})};function Hi(o,e){return o?typeof o=="function"?o(e):o:void 0}function Ni(o,e,t){return typeof e=="function"?C(C({},o),e(t)):C(C({},o),e)}function jh(o){var re,Be,We;let{rowInfo:e,rowStyle:t,rowClassName:n,getData:r,cellStyle:i,cellClassName:a,rowDetailState:l,width:s,column:u,onMouseLeave:c,onMouseEnter:d,rowIndex:p,rowHeight:f,columnsMap:m,fieldsToColumn:h,domRef:g,hidden:y,showZebraRows:T}=o;if(!u)return ce.createElement("div",{ref:g},"no column");let{rowSelected:S}=e,{getState:b,actions:w,computed:v,api:I,getDataSourceMasterContext:R}=oe(),{componentState:x,getState:E,api:P,componentActions:V}=me(),{activeRowIndex:z,keyboardNavigation:F}=b(),M=p===z&&F==="row",A={getState:b,getDataSourceState:E,getDataSourceMasterContext:R,actions:w,dataSourceActions:V,api:I,dataSourceApi:P},_=v.computedVisibleColumns.map(Te=>Te.id),H=Ju({column:u,rowInfo:e,rowDetailState:l,columnsMap:m,visibleColumnsIds:_,fieldsToColumn:h,context:A}),{stylingParam:G,renderParams:J,formattedValueContext:U,renderFunctions:$,groupByColumnReference:ee,inEdit:N}=H,{align:k,verticalAlign:Y}=J,O=J,B=ce.useRef(O),L=ht(Te=>{let Fe=u.computedVisibleIndex;b().cellClick({rowIndex:p,colIndex:Fe,event:Te})},[p,u.computedVisibleIndex,F]),W=ht(Te=>{let Fe=u.computedVisibleIndex;if(b().cellMouseDown({rowIndex:p,colIndex:Fe,event:Te}),F==="row"){w.activeRowIndex=p;return}F==="cell"&&(w.activeCellIndex=[p,Fe])},[p,u.computedVisibleIndex,F]),{selectionMode:te,cellSelection:X}=x,ne=O.cellSelected;O.domRef=g,O.selectCell=ht(O.selectCell,[e]),O.deselectCell=ht(O.deselectCell,[e]),O.selectCurrentRow=ht(O.selectCurrentRow,[e]),O.deselectCurrentRow=ht(O.deselectCurrentRow,[e]),O.toggleCurrentGroupRow=ht(O.toggleCurrentGroupRow,[e]),O.toggleCurrentRowSelection=ht(O.toggleCurrentRowSelection,[e]),O.toggleCurrentGroupRowSelection=ht(O.toggleCurrentGroupRowSelection,[e]);let ge=(Be=(re=u.components)==null?void 0:re.Editor)!=null?Be:nc,ye=N?ce.createElement(ic,{contextValue:O},ce.createElement(ge,null)):null,ke=ht(Ft(()=>{if(y||N)return null;$.renderGroupIcon&&(O.renderBag.groupIcon=ce.createElement(Ze,{render:$.renderGroupIcon,renderParam:D(C({},O),{renderBag:C({},O.renderBag)})})),$.renderSelectionCheckBox&&te=="multi-row"&&(O.renderBag.selectionCheckBox=ce.createElement(Ze,{render:Wh,renderParam:O}),$.renderSelectionCheckBox!==!0&&(O.renderBag.selectionCheckBox=ce.createElement(Ze,{render:$.renderSelectionCheckBox,renderParam:D(C({},O),{renderBag:C({},O.renderBag)})}))),$.renderRowDetailIcon&&(O.renderBag.rowDetailsIcon=ce.createElement(Ze,{render:Bh,renderParam:D(C({},O),{renderBag:C({},O.renderBag)})}),typeof $.renderRowDetailIcon=="function"&&(O.renderBag.rowDetailsIcon=ce.createElement(Ze,{render:$.renderRowDetailIcon,renderParam:D(C({},O),{renderBag:C({},O.renderBag)})}))),$.renderValue&&(O.renderBag.value=ce.createElement(Ze,{render:$.renderValue,renderParam:D(C({},O),{renderBag:C({},O.renderBag)})})),e.isGroupRow&&$.renderGroupValue&&(O.renderBag.value=ce.createElement(Ze,{render:$.renderGroupValue,renderParam:D(C({},O),{renderBag:C({},O.renderBag)})})),!e.isGroupRow&&$.renderLeafValue&&(O.renderBag.value=ce.createElement(Ze,{render:$.renderLeafValue,renderParam:D(C({},O),{renderBag:C({},O.renderBag)})})),B.current=O;let Te=O.renderBag.value;Te instanceof Date&&(Te=Te.toLocaleDateString());let Fe=ce.createElement(ce.Fragment,null,k!=="end"?O.renderBag.groupIcon:null,k!=="end"?O.renderBag.rowDetailsIcon:null,k!=="end"?O.renderBag.selectionCheckBox:null,Te,k==="end"?O.renderBag.selectionCheckBox:null,k==="end"?O.renderBag.rowDetailsIcon:null,k==="end"?O.renderBag.groupIcon:null);return u.render?ce.createElement(Ze,{render:u.render,renderParam:D(C({},O),{renderBag:D(C({},O.renderBag),{all:Fe})})}):Fe}),[u,y,N,l,...ju(O,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,rowHasSelectedCells:!0})]),je=v.computedVisibleColumns.map(Te=>Te.id),lt=v.computedColumnOrder,Ce=D(C({},U),{visibleColumnIds:je,allColumnIds:lt,rowIndex:p,rowHasSelectedCells:!1});Object.defineProperty(Ce,"rowHasSelectedCells",{get(){return e.hasSelectedCells(je)}});let De=typeof n=="function"?n(Ce):n,$e;ee!=null&&ee.className&&($e=Hi(ee.className,G)),a&&($e=Q($e,Hi(a,G))),u.className&&($e=Q($e,Hi(u.className,G)));let de;e.dataSourceHasGrouping&&u.groupByForColumn&&(de=ku({rowInfo:e})),t&&(de=typeof t=="function"?C(C({},de),t(Ce)):C(C({},de),t)),i&&(de=Ni(de,i,G)),ee!=null&&ee.style&&(de=Ni(de,ee.style,G)),u.style&&(de=Ni(de,u.style,G)),de=de||{},de.height=f,de.zIndex=`var(${kh}-${u.computedVisibleIndex})`;let Bt=Nh(()=>de,[de?JSON.stringify(de):null]),st=(e.indexInAll!=null?e.indexInAll:p)%2===1,Mt=T?st?"odd":"even":!1,Wt=!1,jt=!1,$t=!1,K=!1;if(X&&ne){let Te=r(),Fe=Te[e.indexInAll-1],Qe=Te[e.indexInAll+1],ut=v.computedVisibleColumns[u.computedVisibleIndex+1],ct=v.computedVisibleColumns[u.computedVisibleIndex-1];Wt=Fe?!X.isCellSelected(Fe.id,u.id):!0,u.computedPinned==="end"&&u.computedFirstInCategory?jt=!0:jt=ct?!X.isCellSelected(e.id,ct.id):!0,u.computedPinned==="start"&&u.computedLastInCategory?$t=!0:$t=ut?!X.isCellSelected(e.id,ut.id):!0,K=Qe?!X.isCellSelected(Qe.id,u.id):!0}let q=X&&ne?{top:Wt,left:jt,right:$t,bottom:K}:null,le=ye,ue={domRef:g,cellType:"body",column:u,width:s,rowId:e.id,style:Bt,onMouseLeave:c,onMouseEnter:d,onClick:L,afterChildren:le,onMouseDown:W,cssEllipsis:(We=u.cssEllipsis)!=null?We:!0,className:Q(q?Yu(q):"",tr(u,[Qt,en],Uu,{dragging:!1,zebra:Mt,align:k,verticalAlign:Y,rowActive:M,cellSelected:ne,rowSelected:S,firstRow:e.indexInAll===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!u.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),$e,De),renderChildren:ke},Le=to.Provider;return ce.createElement(Le,{value:B.current},ce.createElement(lr,C({},ue)))}var oc=ce.memo(jh);function rc(){return Hh(to)}function Gi(){let{api:o,state:{editingValueRef:e,editingCell:t}}=oe(),{column:n,rowInfo:r}=rc(),[i]=ce.useState(()=>t==null?void 0:t.value),[a,l]=ce.useState(i),s=t?!t.active&&!!t.waiting:!1,u=ce.useCallback(f=>{e.current=f,l(f)},[]);ce.useLayoutEffect(()=>{e.current=i},[]);let c=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function no(o){var e;return(e=o.render(o.renderParam))!=null?e:null}function Ze(o){let e=to.Provider;return In.createElement(e,{value:o.renderParam},In.createElement(no,{render:o.render,renderParam:o.renderParam}))}function ic(o){let e=to.Provider;return In.createElement(e,{value:o.contextValue},o.children)}function Lt(o){let e=sr.Provider;return In.createElement(e,{value:o.renderParam},In.createElement(no,{render:o.render,renderParam:o.renderParam}))}import*as Gt from"react";var $h={width:"100%",pointerEvents:"none"},Ki=`${Ye}-menu`,ki=jo({"data-name":""}),Bi={[ki["data-name"]]:"menu-icon"};function oo(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l=C(D(C({},$h),{borderTop:`${fe.components.HeaderCell.menuIconLineWidth} solid currentColor`}),o.lineStyle);return Gt.createElement("div",D(C(D(C({},n),{style:e}),Bi),{onPointerDown:s=>s.stopPropagation(),className:Q(t,Xs({menuVisible:i,reserveSpaceWhenHidden:r}),Ye,`${Ye}-menu`)}),a!=null?a:Gt.createElement(Gt.Fragment,null,Gt.createElement("div",{className:Ki,style:l}),Gt.createElement("div",{className:Ki,style:l}),Gt.createElement("div",{className:Ki,style:l})))}import*as xn from"react";import{useEffect as Uh,useState as lc}from"react";var ac="_1ek6mqy0 _16lm1iwz _16lm1iw1m _16lm1iw1 _16lm1iw1u";var Yh={transition:"width 0.25s, opacity 0.25s"};function sc(o){var y;let[e,t]=lc(!0),[n,r]=lc(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=o,c=u!=null&&u>0,d=(y=o.size)!=null?y:16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m=D(C(D(C({},Yh),{borderTop:`${a}px solid currentColor`}),o.lineStyle),{opacity:n});Uh(()=>{let T=i!=0?1:0;if(!e&&T&&t(!0),T!==n){let S=requestAnimationFrame(()=>{r(T)});return()=>{cancelAnimationFrame(S)}}return()=>{}},[i,e]);let h=()=>{let S=!(n===0&&i===0);S!==e&&t(S)};if(!e)return null;let g={};return i===-1&&(g.top="100%"),xn.createElement("div",{"data-name":"sort-icon",style:D(C({},l),{width:d}),className:Q(s,Ye,ac,`${Ye}-sort`)},c?xn.createElement("div",{"data-name":"index",style:g,className:Qs},u):null,xn.createElement("div",{style:C({width:f[0]},m),onTransitionEnd:h}),xn.createElement("div",{style:C({width:f[1]},m)}),xn.createElement("div",{style:C({width:f[2]},m)}))}import*as fc from"react";import{useCallback as mc}from"react";import{useRef as dc,useState as qh}from"react";import*as ro from"react";function uc(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){Ao(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;Ao(a,l.computedWidth-i,n.current),l.computedPinned==="start"?ei(l,i,n.current):pn(a,l.computedOffset+i,n.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let u=e[l];if(u.computedPinned==="start"){ei(u,i,n.current);continue}u.computedPinned!=="end"&&pn(l,u.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||pn(l,u.computedOffset+i,n.current)}}}}}function cc(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,u=i.current;if(n.forEach((c,d)=>{s+=c;let p=o[d],f=r[p],m=f.computedWidth+c;Ao(p,m,u),f.computedPinned!=="end"&&(l&&pn(p,l,u),l+=m)}),a.computedPinned!=="end")for(let c=t+1;c<r.length;c++){let d=r[c];d.computedPinned!=="end"&&pn(c,d.computedOffset+s,u)}}}}var ur="zneyzh0 _16lm1iw2 _16lm1iw1c _16lm1iw1j _16lm1iw1h _16lm1iwk _16lm1iw1x",cr=Se({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw1c _16lm1iw1h",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},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0},"zneyzhn"]]}),dr=Se({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw1e _16lm1iw1l",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:Xh}=Ie,Zh=`${Xh}HeaderCell_ResizeHandle`;function Jh(o){let e=dc(null),[t,n]=qh(!1),r=dc(t);r.current=t;let i=o.columns[o.columnIndex];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,u=d=>{d.stopPropagation();let p=!!d.shiftKey,f=d.pointerId,m=d.clientX,h=d.target;h.setPointerCapture(f);let g=uc(o.columnIndex,{columns:o.columns,shareSpaceOnResize:p,domRef:e}),y=b=>{a==="end"&&(b*=-1);let{adjustedDiff:w,constrained:v}=o.computeResize({diff:b,shareSpaceOnResize:p});return r.current!==v&&n(v),g.resize(w),w},T=b=>{y(Math.round(b.clientX-m))},S=b=>{h.releasePointerCapture(f),h.removeEventListener("pointermove",T),h.removeEventListener("pointerup",S);let w=Math.round(b.clientX-m),v=y(w);o.onResize({diff:v,shareSpaceOnResize:p})};h.addEventListener("pointermove",T),h.addEventListener("pointerup",S)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:0}:a==="end"&&l?{right:void 0}:void 0;return ro.createElement("div",{ref:e,className:`${Zh} ${ur} ${dr({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},ro.createElement("div",{style:c,className:cr({constrained:t,computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}))}var pc=ro.memo(Jh);function hc(o){let{computed:{computedVisibleColumns:e},getState:t,getComputed:n,actions:r}=oe(),i=mc(({diff:s,shareSpaceOnResize:u})=>{let c=t(),{columnSizing:d,viewportReservedWidth:p,bodySize:f}=c,m=n().computedVisibleColumns,h=!1,g=m.reduce((S,b)=>(b.computedFlex&&(S[b.id]=D(C({},d[b.id]),{flex:b.computedWidth}),h=!0),S),{}),y=h?C(C({},d),g):d;return xi({shareSpaceOnResize:u,availableSize:f.width,reservedWidth:p||0,dragHandleOffset:s,dragHandlePositionAfter:o.computedVisibleIndex,columnSizing:y,items:m.map(S=>({id:S.id,computedFlex:S.computedFlex,computedWidth:S.computedWidth,computedMinWidth:S.computedMinWidth,computedMaxWidth:S.computedMaxWidth}))})},[o]),a=mc(({diff:s,shareSpaceOnResize:u})=>{let{columnSizing:c,reservedWidth:d}=i({diff:s,shareSpaceOnResize:u});u||(r.viewportReservedWidth=d),r.columnSizing=c},[i]);return o.computedResizable?fc.createElement(pc,{columns:e,columnIndex:o.computedVisibleIndex,computeResize:i,onResize:a}):null}var nn=`${ot}HeaderCell`;var rg=o=>{let{allRowsSelected:e,someRowsSelected:t,api:n}=o;return he.createElement(zt,{domProps:{className:ir},onChange:i=>{i?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:e?!0:t?null:!1})},sr=he.createContext(null);var ig=Z(j.columnZIndexAtIndex),Wi=he.createElement("div",{className:Wo[1]}),gc=jo({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":""});function Cc(o){var $t,K,q,le,ue,Le,re,Be,We,Te,Fe,Qe,ut,ct,St,Et;let e=o.column,{api:t,getComputed:n,getState:r,actions:i,state:{showColumnFilters:a,components:l,portalDOMRef:s,columnHeaderHeight:u,columnReorderDragColumnId:c,columnMenuVisibleForColumnId:d},getDataSourceMasterContext:p}=oe(),{api:f,componentActions:m,getState:h,componentState:{filterDelay:g,filterTypes:y}}=me(),{allRowsSelected:T,someRowsSelected:S,selectionMode:b}=un(),w=c===e.id,{onResize:v,height:I,width:R,headerOptions:x,columnsMap:E}=o,P=e.computedSortInfo,V=e.header,z=Qh(ie=>{var et;W.current=ie,(et=o.domRef)==null||et.call(o,ie)},[o.domRef]),F=x.alwaysReserveSpaceForSortIcon,M=($t=e.headerAlign)!=null?$t:e.align,A=(K=typeof M=="function"?M({isHeader:!0,column:e}):M)!=null?K:"start",_=(q=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)!=null?q:"center",H=Ne(e,{actions:i,api:t,dataSourceActions:m,dataSourceApi:f,getComputed:n,getDataSourceState:h,getDataSourceMasterContext:p,getState:r}),G=H.isSortable(),J=G&&(e.computedSorted||F)?he.createElement(sc,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:fe.spacing[2],marginInlineEnd:fe.spacing[2]},className:`${nn}__sort-icon ${Js} ${eu({align:A})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,$=e.computedFilterable&&e.computedFiltered?he.createElement(yn,null):null,ee=(ue=(le=e.headerCssEllipsis)!=null?le:e.cssEllipsis)!=null?ue:!0,N={reserveSpaceWhenHidden:A==="center",menuVisible:d===e.id,style:A==="end"?{marginInlineStart:`calc(${fe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:fe.spacing[2]}:{marginInlineEnd:`calc(${fe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:fe.spacing[2]},domProps:{onMouseDown:ie=>{ie.stopPropagation(),H.toggleContextMenu(ie.target)}}},k=((Le=e.components)==null?void 0:Le.MenuIcon)||(l==null?void 0:l.MenuIcon)||oo,Y=he.createElement(k,C({},N)),O={dragging:w,domRef:z,insideColumnMenu:!1,column:e,columnsMap:E,columnSortInfo:P,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:S,allRowsSelected:T,selectionMode:b,api:t,columnApi:H,renderBag:{sortIcon:J,filterIcon:$,menuIcon:Y,menuIconProps:N,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},B=O,L=()=>{var Ln;let ie=D(C({},O),{renderBag:C({},O.renderBag)});if(e.renderSortIcon&&(ie.renderBag.sortIcon=he.createElement(Lt,{render:e.renderSortIcon,renderParam:D(C({},ie),{renderBag:C({},ie.renderBag)})})),e.renderFilterIcon&&(ie.renderBag.filterIcon=he.createElement(Lt,{render:e.renderFilterIcon,renderParam:D(C({},ie),{renderBag:C({},ie.renderBag)})})),typeof e.renderMenuIcon=="function"&&(ie.renderBag.menuIcon=he.createElement(Lt,{render:dt=>{if(typeof e.renderMenuIcon!="function")return null;let Ut=e.renderMenuIcon(dt);return Ut?Ut.type===k||Ut.type===oo?Ut:he.createElement(k,C({},N),Ut):null},renderParam:D(C({},ie),{renderBag:C({},ie.renderBag)})})),e.renderSelectionCheckBox&&b==="multi-row"){ie.renderBag.selectionCheckBox=he.createElement(Lt,{render:rg,renderParam:D(C({},ie),{renderBag:C({},ie.renderBag)})});let dt=(Ln=e.renderHeaderSelectionCheckBox)!=null?Ln:e.renderSelectionCheckBox;dt&&dt!==!0&&(ie.renderBag.selectionCheckBox=he.createElement(Lt,{render:dt,renderParam:D(C({},ie),{renderBag:C({},ie.renderBag)})}))}V instanceof Function&&(ie.renderBag.header=he.createElement(Lt,{render:V,renderParam:D(C({},ie),{renderBag:C({},ie.renderBag)})}));let et=e.renderMenuIcon===!1?null:ie.renderBag.menuIcon,Gr=ee?he.createElement("div",{className:ft},ie.renderBag.header):ie.renderBag.header,Ge=he.createElement(he.Fragment,null,A==="center"?Wi:null,ie.renderBag.selectionCheckBox,Gr,ie.renderBag.sortIcon,ie.renderBag.filterIcon,A==="center"?Wi:null,A!=="center"?Wi:null,et);return e.renderHeader?he.createElement(Lt,{render:e.renderHeader,renderParam:D(C({},ie),{renderBag:D(C({},ie.renderBag),{all:Ge})})}):Ge},W=ng(null);tg(()=>{let ie=null,et=W.current;return v&&et&&(ie=Kn(et,v)),()=>{ie==null||ie()}},[W.current,o.onResize]);let te={height:I};e.headerStyle&&(te=typeof e.headerStyle=="function"?C(C({},te),e.headerStyle(B)||{}):C(C({},te),e.headerStyle));let X=typeof e.headerClassName=="function"?e.headerClassName(B):e.headerClassName,{onPointerDown:ne,proxyPosition:ge}=Ou({columnId:e.id,domRef:W}),ye=null;w&&ge&&(ye=he.createElement("div",{key:e.id,className:`${nn}Proxy ${ks}`,style:{position:"absolute",height:I,width:R,left:(re=ge.left)!=null?re:0,top:(Be=ge.top)!=null?Be:0,zIndex:1e9}},B.renderBag.header),ye=og(ye,s.current));let ke=sr.Provider,je={filtered:e.computedFiltered,verticalAlign:_,align:A},lt=he.useMemo(()=>{let ie=et=>{t.setColumnFilter(e.id,et)};return g>0?yt(ie,{wait:g}):ie},[g,e.id]),Ce=e.computedFilterType,De=y[Ce],$e=e.computedFilterable?(Te=(We=e.computedFilterValue)==null?void 0:We.filter.operator)!=null?Te:De==null?void 0:De.defaultOperator:void 0,de=e.computedFilterable&&De?De.operators.find(ie=>ie.name===$e):void 0,Bt=((Fe=de==null?void 0:de.components)==null?void 0:Fe.FilterEditor)||((Qe=De==null?void 0:De.components)==null?void 0:Qe.FilterEditor)||((ut=e.components)==null?void 0:ut.FilterEditor)||bn,st=((ct=De==null?void 0:De.components)==null?void 0:ct.FilterOperatorSwitch)||((St=e.components)==null?void 0:St.FilterOperatorSwitch),Mt=hc(e),Wt=`var(${ig}-${e.computedVisibleIndex})`;te.zIndex=Wt;let jt={"data-field":`${e.field||""}`,"data-column-id":e.id,"data-header-align":A,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${(Et=e.computedSortIndex)!=null?Et:-1}`};return he.createElement(ke,{value:B},he.createElement(lr,D(C({domRef:z,cellType:"header",column:e},jt),{"data-z-index":Wt,style:te,width:R,onPointerDown:ne,contentClassName:Q(Ks(je),gs[A]),contentStyle:a?{height:I/2}:void 0,className:Q(nn,Rs.none,G?hs.pointer:"",X,tr(e,[nn,en],Bs,{dragging:w,align:A,verticalAlign:_,rowSelected:!1,cellSelected:!1,zebra:!1,rowActive:!1,firstRow:!0,groupCell:!1,groupRow:!1,rowExpanded:!1}),Ns),cssEllipsis:ee,afterChildren:he.createElement(he.Fragment,null,a?e.computedFilterable?he.createElement(mu,{filterEditor:Bt,filterOperatorSwitch:st!=null?st:fu,operator:de,filterTypes:y,onChange:lt,columnFilterType:Ce,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:u}):he.createElement(hu,null):null,Mt),renderChildren:L})),ye)}function Qo(){return eg(sr)}import*as rt from"react";function Sc(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((c,d)=>{var w,v,I,R;let p=c.id,f=o[d-1],m=(w=f==null?void 0:f.id)!=null?w:"",h=new Set,g=(f==null?void 0:f.computedPinned)!==c.computedPinned?new Set:(v=a.get(m))!=null?v:new Set;a.set(p,h);let y={type:"column",id:p,ref:c,groupOffset:0,computedPinned:c.computedPinned,computedWidth:c.computedWidth,depth:c.columnGroup?((I=t.get(c.columnGroup))!=null?I:0)+1:0};r.set([p],y);let T=c.columnGroup,S,b=y;for(;T;){let x=e[T];if(x){h.add(T);let E=[p,...h];S=g.has(T)?i.get(T):void 0,S||(S={id:T,type:"group",ref:x,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[T],computedWidth:0,computedPinned:y.computedPinned,depth:(R=t.get(T))!=null?R:0},r.set(E,S),i.set(T,S)),S.columnItems.push(y),S.uniqueGroupId.push(y.id),b&&!g.has(b.id)&&S.children.push(b),b=S,T=x.columnGroup}else break}});let l=[],s=new ae,u=0;return r.forEach(c=>{if(!c.ref.columnGroup){let d=c.type==="column"?c.ref.computedWidth:c.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);c.groupOffset=u,c.computedWidth=d,c.type==="group"&&yc(c.children),l.push(c),u+=d}if(c.type==="group")c.columnItems.forEach(d=>{s.set([c.depth,d.ref.computedVisibleIndex],c)});else for(let d=c.depth;d<=n+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function yc(o,e=0){o.forEach(t=>{let n=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=n,t.groupOffset=e,t.type==="group"&&yc(t.children),e+=n})}import*as on from"react";import{useCallback as dg,useEffect as pg,useRef as mg}from"react";import*as ji from"react";import*as wc from"react";import{useCallback as Rc}from"react";import{useRef as Tc,useState as ag}from"react";import*as io from"react";var{rootClassName:lg}=Ie,sg=`${lg}HeaderCell_ResizeHandle`;function ug(o){let e=Tc(null),[t,n]=ag(!1),r=Tc(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,u=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let h=!0,g=cc(o.groupColumns.map(b=>b.computedVisibleIndex),{columns:o.columns,domRef:e}),y=b=>{a==="end"&&(b*=-1);let{constrained:w,adjustedDiffs:v,adjustedDiff:I}=o.computeResize(b);return r.current!==w&&n(w),g.resize(v),I},T=b=>{if(h){let w=o.groupColumns.reduce((R,x)=>R+x.computedWidth-x.computedMinWidth,0),v=o.brain.getAvailableSize(),I={width:v.width+w,height:v.height};o.brain.setAvailableSize(I),h=!1}y(Math.round(b.clientX-f))},S=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",T),m.removeEventListener("pointerup",S);let w=Math.round(b.clientX-f),v=y(w);o.onResize(v)};m.addEventListener("pointermove",T),m.addEventListener("pointerup",S)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:fe.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return io.createElement("div",{ref:e,className:`${sg} ${ur} ${dr({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},io.createElement("div",{style:C(C({},c),o.style),className:cr({constrained:t})}))}var bc=io.memo(ug);function Ic(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:u}=oe(),c=o[o.length-1],d=Rc(h=>{let g=l(),{columnSizing:y,viewportReservedWidth:T,bodySize:S}=g,b=s().computedVisibleColumns,w=!1,v=b.reduce((x,E)=>(E.computedFlex&&(x[E.id]=D(C({},y[E.id]),{flex:E.computedWidth}),w=!0),x),{}),I=w?C(C({},y),v):y;return iu({availableSize:S.width,reservedWidth:T||0,dragHandleOffset:h,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:I,columnGroupSize:o.length,items:b.map(x=>({id:x.id,resizable:x.computedResizable,computedFlex:x.computedFlex,computedWidth:x.computedWidth,computedMinWidth:x.computedMinWidth,computedMaxWidth:x.computedMaxWidth}))})},[c]),p=Rc(h=>{let{columnSizing:g,reservedWidth:y}=d(h);u.viewportReservedWidth=y,u.columnSizing=g},[d]);return o.some(h=>h.computedResizable)?wc.createElement(bc,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var xc=`${ot}HeaderGroup`,vc=Z(j.columnWidthAtIndex),cg=Z(j.columnZIndexAtIndex);function Pc(o){let{columnGroup:e,height:t,columns:n,bodyBrain:r,columnGroupsMaxDepth:i}=o,{header:a}=e;a instanceof Function&&(a=a({columnGroup:e}));let l=Ic(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),s=n[0],u=n.length>1?"calc( "+n.map(d=>`var(${vc}-${d.computedVisibleIndex})`).join(" + ")+" )":`var(${vc}-${s.computedVisibleIndex})`,c=`calc(var(${cg}-${s.computedVisibleIndex}) + ${i-e.depth})`;return ji.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:Q(qs,xc),style:{width:u,height:t},"data-z-index":c},ji.createElement("div",{className:Q(`${xc}__header-content`,ft)},a),l)}var{rootClassName:fg}=Ie,Dc=`${fg}Header`;function hg(o){let{bodyBrain:e,headerBrain:t,columns:n,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=o,{computed:u,state:{headerBrain:c,headerOptions:d,showColumnFilters:p}}=oe(),{computedColumnsMap:f}=u;pg(()=>{let T=b=>{m.current&&(m.current.style.transform=`translate3d(-${b.scrollLeft}px, 0px, 0px)`)};return t.onScroll(T)},[t]);let m=mg(null),h=Ws({overflow:!1}),g={ref:m,className:Q(Dc,`${Dc}--virtualized`,i,h),style:D(C({},r),{height:a})},y=dg(T=>{let{rowIndex:S,colIndex:b,domRef:w,height:v,widthWithColspan:I,heightWithRowspan:R,hidden:x}=T,E=n[b];if(!E||x)return null;let P=l?l.pathsToCells.get([S,b]):null;if(P&&P.type==="group"){let V=P.columnItems.map(F=>F.ref),z=D(C({},P.ref),{id:P.id,uniqueGroupId:P.uniqueGroupId,depth:P.depth,columns:V.map(F=>F.id),computedWidth:P.computedWidth,groupOffset:P.groupOffset});return on.createElement(Pc,{bodyBrain:e,columnGroupsMaxDepth:s,domRef:w,columns:V,width:I,height:v,columnGroup:z})}return on.createElement(Cc,{domRef:w,column:E,headerOptions:d,width:I,height:R,columnsMap:f})},[d,n,a,l,s,p]);return on.createElement("div",C({},g),on.createElement(Ho,{name:"header",renderCell:y,brain:c,cellHoverClassNames:[]}))}var Mc=on.memo(hg);function Ec(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,r=oe(),{computedPinnedStartColumns:i,computedPinnedEndColumns:a,computedVisibleColumns:l,columnSize:s}=r.computed,{state:{columnHeaderHeight:u,columnGroupsDepthsMap:c,columnGroupsMaxDepth:d,computedColumnGroups:p,showColumnFilters:f}}=r,m=!p||!Object.keys(p).length?1:d+2,h=m*u+(f?u:0),g=rt.useMemo(()=>{if(!(!p||!Object.keys(p).length))return Sc(l,p,c,d)},[l,p,c]),y=rt.useCallback(({rowIndex:I,colIndex:R})=>{let x=l[R],E=1,P=1;if(!x||!g)return{rowspan:E,colspan:P};let V=g.pathsToCells.get([I,R]);if(!V)return{rowspan:E,colspan:P};if(V.type==="column")return{colspan:P,rowspan:m-V.depth};let z=V.columnItems.findIndex(F=>F.id===x.id);return{rowspan:E,colspan:z===0?V.columnItems.length:1}},[p,d,l,g,m,c]),T=rt.useCallback(({rowIndex:I,colIndex:R})=>y({rowIndex:I,colIndex:R}).rowspan,[y]),S=rt.useCallback(({rowIndex:I,colIndex:R})=>y({rowIndex:I,colIndex:R}).colspan,[y]),b=rt.useCallback(I=>f?I<m-1?u:2*u:u,[m,f,u]);Ko(e,{colWidth:s,rowHeight:b,rows:m,cols:l.length,height:h,rowspan:T,colspan:S},{fixedColsEnd:a.length,fixedColsStart:i.length});let w=rt.createElement(Mc,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:h,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:g}),v=n.vertical&&Xt()?rt.createElement("div",{className:Zs,style:{zIndex:1e3,width:Xt()}}):null;return rt.createElement("div",{className:tu,style:{height:h}},w,v)}import*as wt from"react";import{useEffect as gg}from"react";function Ac(o,e){let{separator:t}=e!=null?e:{separator:"-"};return o.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Fc={padding:fe.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},Cg={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},_c=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(Ac(t),n,"important")},Oc=wt.forwardRef(function(e,t){let{rootClassName:n}=Bo(),r=wt.useRef(null),i=wt.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return gg(()=>{let a=()=>{be(()=>{var s;_c(r.current,Fc),_c((s=r.current)==null?void 0:s.firstElementChild,Cg)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),wt.createElement("div",D(C({ref:i},e),{className:Q(`${n}-Footer`,gu,e.className),style:Fc}),"Powered by"," ",wt.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});import*as vn from"react";var Vc={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw1c _16lm1iw1e _16lm1iw1j _16lm1iw1h",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw1c _16lm1iw1e _16lm1iw1j _16lm1iw1h"},zc="qy58ya3 _16lm1iw2 _16lm1iw1c _16lm1iw1e _16lm1iw1j _16lm1iw1h",Lc="qy58ya4";var{rootClassName:Sg}=Ie,$i=`${Sg}-LoadMask`;function yg(o){let{visible:e,children:t="Loading"}=o;return vn.createElement("div",{className:`${Vc[e?"visible":"hidden"]} ${$i}`},vn.createElement("div",{className:`${zc} ${$i}-Overlay`}),vn.createElement("div",{className:`${Lc} ${$i}-Text`},t))}var pr=vn.memo(yg);function Ui(o){return o.map(Ht)}function Ht(o){if(xe().structuredClone)return xe().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Ui(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Ui(Array.from(o)));if(o instanceof Map)return new Map(Ui(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=Ht(o[t]));return e}function ao(o){return o}var rn=Object.seal({data:null,field:null});var Nt="____root____",Hc="____not_loaded_yet____";function mr(){return!1}function Nc(o){if(!o||!Object.keys(o).length)return{};let e={};for(let t in o)if(o.hasOwnProperty(t)){let n=o[t].initialValue;e[t]=typeof n=="function"?n():n}return e}function qi(o,e,t,n,r){var i;if(!(!t||!Object.keys(t).length)){for(let a in t)if(t.hasOwnProperty(a)){let l=t[a];if(typeof l.reducer!="function")continue;let s=n[a],u=l.getter?(i=l.getter(o))!=null?i:null:l.field?o[l.field]:null;n[a]=l.reducer(s,u,o,e,r)}}}function Kc(o,e){let{reducers:t={},pivot:n,groupBy:r,indexer:i,toPrimaryKey:a,cache:l,mappings:s}=o,u=new ae;function c(g,y,T,S=0,b=[]){let w=!T.length||S===T.length-1,v=y[(s==null?void 0:s.values)||"values"]||{};for(let I in v)if(v.hasOwnProperty(I)){let R=I;b.push(R),d.set(b,!0),g.set(b,{reducerResults:v[I][(s==null?void 0:s.totals)||"totals"]||{},items:[]}),w||c(g,v[I],T,S+1,b),b.pop()}}let d=n?new ae:void 0,p=[],f=Nc(t),m=Ht(f);e.visitDepthFirst((g,y,T,S)=>{let[b,...w]=y,v=g.children,I=u.get(w);if(I&&(I.cache=g.cache,I.childrenLoading=g.childrenLoading,I.childrenAvailable=g.childrenAvailable,I.error=g.error),w.length==r.length&&r.length){if(I){I.items=v;for(let R=0,x=w.length;R<x;R++){let E=w.slice(0,R),P=u.get(E);P&&(P.items=P.items||[],P.items=P.items.concat(v))}i.indexArray(v,{toPrimaryKey:a,cache:l})}return S==null?void 0:S()}for(let R=0,x=v.length;R<x;R++){if(!v[R]){let z={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1};u.set([...w,`${Hc}${R}`],z);continue}let E=v[R].data,P=v[R].keys||[];if(P.length){let z=P[P.length-1];w.push(z)}let V={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:E,totalChildrenCount:v[R].totalChildrenCount,reducerResults:v[R].aggregations||{}};if(u.set(w,V),n){let z=V.pivotDeepMap=new ae,F=v[R].pivot;c(z,F,n,0,p)}P.length&&w.pop()}S==null||S()});let h={deepMap:u,groupParams:o,initialData:e,reducerResults:m};return n&&(h.topLevelPivotColumns=d,h.pivot=n),h}function Gc(o,e,t,n,r,i,a,l,s,u=ao){let{items:c,reducerResults:d,pivotDeepMap:p}=o.get(e);if(c.push(n),a&&qi(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:h,valueGetter:g,toKey:y}=i[f],T=h?n[h]:null;g&&(rn.data=n,rn.field=h,T=g(rn));let S=(y||u)(T,n);t.push(S),p.has(t)||(l.set(t,!0),p==null||p.set(t,{reducerResults:Ht(s),items:[]}));let{reducerResults:b,items:w}=p.get(t);w.push(n),a&&qi(n,r,a,b,e)}t.length=0}}function Xi(o,e){let{groupBy:t,defaultToKey:n=ao,pivot:r,reducers:i}=o,a=t.length,l=r?new ae:void 0,s=new ae,u=[],c=[],d=Nc(i),p=Ht(d);if(!a){let m={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Ht(d)};r&&(m.pivotDeepMap=new ae),s.set(u,m)}for(let m=0,h=e.length;m<h;m++){let g=e[m],y={};for(let T=0;T<a;T++){let{field:S,groupField:b,valueGetter:w,toKey:v}=t[T],I=S?g[S]:null;w&&(rn.data=g,rn.field=S,I=w(rn));let R=(v||n)(I,g);if(y[S||b]=R,u.push(R),!s.has(u)){let x={items:[],cache:!1,commonData:C({},y),childrenLoading:!1,childrenAvailable:!1,reducerResults:Ht(d)};r&&(x.pivotDeepMap=new ae),s.set(u,x)}Gc(s,u,c,g,m,r,i,l,d,n)}a||Gc(s,u,c,g,m,r,i,l,d,n),i&&qi(g,m,i,p,u),u.length=0}i&&s.visitDepthFirst((m,h,g,y)=>{Yi(i,m.reducerResults,m.items),r&&m.pivotDeepMap.visitDepthFirst(({items:T,reducerResults:S},b,w,v)=>{Yi(i,S,T),v==null||v()}),y==null||y()}),i&&Yi(i,p,e);let f={deepMap:s,groupParams:o,initialData:e,reducerResults:p};return r&&(f.topLevelPivotColumns=l,f.pivot=r),f}function Tg(o){let{groupParams:e,deepMap:t}=o,n=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===n){let l=t.get(a).items;i.push(...l)}return i},r),r}function bg(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:u,pivotDeepMap:c,commonData:d}=e,p=d!=null?d:null,f;if(Object.keys(u).length>0){p=C({},d),f={};for(let T in i)if(i.hasOwnProperty(T)){let b=i[T].field;b&&(f[b]=u[T]),b&&p[b]==null&&(p[b]=u[T])}}let m=!0,h=n[n.length-1],g=h;if(p!=null){let T=t[n.length-1];T&&T.field&&(g=p[T.field]),T&&T.toKey&&(g=T.toKey(g,p)),g=g!=null?g:h}return typeof g=="string"&&g.startsWith(Hc)&&(m=!1,g=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,isCellSelected:mr,hasSelectedCells:mr,selfLoaded:m,error:o.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:g,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function Yi(o,e,t){if(o){for(let n in o)if(o.hasOwnProperty(n)){let r=o[n];r.done&&(e[n]=r.done(e[n],t))}}return e}function kc(o){let{lazyLoad:e,groupResult:t,withRowInfo:n,toPrimaryKey:r,groupRowsState:i,isRowSelected:a,rowSelectionState:l,generateGroupRows:s,reducers:u={}}=o,{groupParams:c,deepMap:d,pivot:p}=t,{groupBy:f}=c,m=[],h=[],g=[],y=[];return d.visitDepthFirst((T,S,b,w)=>{var F,M;let v=T.items,I=S.length,R=(F=i==null?void 0:i.isGroupRowCollapsed(S))!=null?F:!1;y.push(b);let x=bg({lazyLoad:e,groupBy:f,parents:Array.from(g),reducers:u,indexInGroup:b,indexInParentGroups:Array.from(y),indexInAll:m.length,groupKeys:S,error:T.error,totalChildrenCount:T.totalChildrenCount,childrenLoading:(T.childrenLoading||!R&&!T.childrenAvailable)&&e,childrenAvailable:T.childrenAvailable,directChildrenCount:S.length===f.length?T.items.length:d.getDirectChildrenSizeFor(S),directChildrenLoadedCount:0},T);if(a&&(x.rowSelected=a(x),l)){let A=l.getSelectionCountFor(x.groupKeys);x.selectedChildredCount=A.selectedCount,x.deselectedChildredCount=A.deselectedCount}let E=g[g.length-1],P=(M=E==null?void 0:E.collapsed)!=null?M:!1;P&&(R=!0),x.collapsed=R;let V=s||R;P&&(V=!1),V&&(m.push(x),h.push(m.length-1)),x.collapsedChildrenCount=0,g.forEach(A=>{A.deepRowInfoArray.push(x),A.collapsedGroupsCount+=R?1:0}),E&&x.selfLoaded&&e&&(E.directChildrenLoadedCount+=1),n&&n(x),g.push(x);let z=!0;if(z){if(w)w();else if(!p){let A=m.length;R||(m.length+=v.length);for(let _=0,H=v.length;_<H;_++){let G=v[_],J=A+_,$={id:G?r(G,J):`${S}-${_}`,data:G,isCellSelected:mr,hasSelectedCells:mr,dataSourceHasGrouping:!0,isGroupRow:!1,selfLoaded:!!G,rowSelected:!1,rootGroupBy:f,collapsed:R,groupKeys:S,parents:Array.from(g),indexInParentGroups:[...y,_],indexInGroup:_,indexInAll:J,groupBy:f,groupNesting:I+1,groupCount:x.groupCount};a&&($.rowSelected=a($)),n&&n($),g.forEach((ee,N)=>{N===g.length-1&&G&&(ee.directChildrenLoadedCount+=1),R&&(ee.collapsedChildrenCount+=1),ee.deepRowInfoArray.push($)}),R||(m[A+_]=$)}}}g.pop(),y.pop()}),{data:m,groupRowsIndexes:h}}import*as gt from"react";import{useEffect as gd,useLayoutEffect as hd}from"react";var Rg=function(o,e){return o-e},wg=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},Ig=function(o,e){return o-e},xg={number:Rg,string:wg,date:Ig},lo=xg;var It=(o,e,t)=>{let n=o.map(r=>Array.isArray(r.field)?r.field.map((i,a)=>{var u;let l=Array.isArray(r.type)?(u=r.type[a])!=null?u:r.type[0]:r.type;return typeof i=="function"?D(C({},r),{valueGetter:i,field:void 0,type:l}):D(C({},r),{type:l,field:i})}):r).flat();return e.sort(Dg(n,t)),e};It.knownTypes=lo;var vg=o=>{if(!o)return;let e=o.field,t=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let r=o.fn;if(!r&&o.type){let i=Array.isArray(o.type)?o.type[0]:o.type;r=It.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(It.knownTypes).join(", ")}`)}return r||(r=lo.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,u=r(l,s);return u===0?u:n*u}},Pg=o=>o.map(vg).filter(e=>e instanceof Function),Dg=(o,e)=>{let t=Pg(o);return(n,r)=>{e&&(n=e(n),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(n,r),i!==0))return i;return i}};var xt=class{constructor(){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,n)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:n}),this.primaryKeyToData.set(r,i)};this.insert=(e,t,n,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:n,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.update=(e,t,n,r)=>{this.allFieldsAffected||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:n,metadata:r}),this.primaryKeyToData.set(e,a)};this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutations=()=>new Map(this.primaryKeyToData)}static clone(e,{light:t=!1}={}){let n=new xt;return n.allFieldsAffected=e.allFieldsAffected,n.affectedFields=new Set(e.affectedFields),n.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),n}};function Pn(o,e){return e().dataArray[o]}function fr(o){return o().dataArray}function Bc(o){return new Zi(o)}var Zi=class{constructor(e){this.pendingOperations=[];this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>fr(this.getState);this.getRowInfoByIndex=e=>{var t;return(t=Pn(e,this.getState))!=null?t:null};this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>{var n;return(n=this.getState().idToIndexMap.get(e))!=null?n:-1};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByPrimaryKey=e=>{var n;let{indexer:t}=this.getState();return(n=t.getDataForPrimaryKey(e))!=null?n:null};this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let n=this.batchOperation({type:"update",array:e,primaryKeys:e.map(r=>this.toPrimaryKey(r)),metadata:t==null?void 0:t.metadata});return t!=null&&t.flush&&this.commit(),n};this.removeDataByPrimaryKey=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t==null?void 0:t.metadata});return t!=null&&t.flush&&this.commit(),n};this.removeData=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:[this.toPrimaryKey(e)],metadata:t==null?void 0:t.metadata});return t!=null&&t.flush&&this.commit(),n};this.removeDataArrayByPrimaryKeys=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e,metadata:t==null?void 0:t.metadata});return t!=null&&t.flush&&this.commit(),n};this.removeDataArray=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e.map(this.toPrimaryKey),metadata:t==null?void 0:t.metadata});return t!=null&&t.flush&&this.commit(),n};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,D(C({},t),{position:"end"}));this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let n="before",r;if(t.position==="before"||t.position==="after")n=t.position,r=t.primaryKey;else{let a=this.getOriginalDataArray();t.position==="start"?(n="before",r=this.toPrimaryKey(a[0])):(n="after",r=this.toPrimaryKey(a[a.length-1]))}let i=this.batchOperation({type:"insert",array:e,position:n,metadata:t==null?void 0:t.metadata,primaryKey:r});return t!=null&&t.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.getState=e.getState,this.actions=e.actions}batchOperation(e){return this.pendingPromise||(this.pendingPromise=new Promise(t=>{this.resolvePendingPromise=t}),be(()=>{this.commit()})),this.pendingOperations.push(e),this.pendingPromise}batchOperations(e){this.pendingOperations.push(...e)}commitOperations(e){if(!e.length)return;let t=this.getState().cache,n=t?xt.clone(t,{light:!0}):new xt;e.forEach(r=>{switch(r.type){case"update":r.array.forEach((l,s)=>{let u=r.primaryKeys[s],c=this.getRowInfoByPrimaryKey(u);c&&!c.isGroupRow&&n.update(r.primaryKeys[s],l,c.data,r.metadata)});break;case"delete":r.primaryKeys.forEach(l=>{let s=this.getRowInfoByPrimaryKey(l);s&&!s.isGroupRow&&n.delete(l,s.data,r.metadata)});break;case"insert":let i=r.primaryKey,a=r.position;r.array.forEach(l=>{n.insert(i,l,a,r.metadata),i=this.toPrimaryKey(l),a="after"});break}}),this.actions.cache=n}commit(){if(this.commitOperations(this.pendingOperations),this.pendingOperations.length=0,this.pendingPromise&&this.resolvePendingPromise){let e=this.resolvePendingPromise;requestAnimationFrame(()=>{e(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}}};function Wc(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=e.getAffectedFields(),{sortInfo:l,groupBy:s,filterValue:u,aggregationReducers:c}=o;if(l&&l.length)if(a===!0)t=!0;else for(let d of l){let p=d.field;if(p&&(p=Array.isArray(p)?p:[p],t=p.reduce((f,m)=>f||typeof m!="function"?a.has(m):!1,!1),t))break}if(s&&s.length){if(a===!0)n=!0;else for(let d of s)if(d.field&&a.has(d.field)){n=!0;break}}if(u&&u.length)if(a===!0)r=!0;else for(let d of u){if(d.id){r=!0;break}if(d.field&&a.has(d.field)){r=!0;break}}if(c&&Object.keys(c).length){if(a===!0)i=!0;else for(let d in c)if(c.hasOwnProperty(d)){let p=c[d];if(p.field){if(a.has(p.field)){i=!0;break}}else{i=!0;break}}}return{sortInfo:t,groupBy:n,filterValue:r,aggregationReducers:i}}var hr=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){var e,t;(e=this.positiveMap)==null||e.clear(),(t=this.negativeMap)==null||t.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(r=>[r,!0]))):this.negativeMap=new ae(n.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 ae(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){var t,n;if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!((t=this.negativeMap)!=null&&t.has(e))}return(n=this.positiveMap)==null?void 0:n.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){var n;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`;(n=this.positiveMap)==null||n.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var Xe=class extends hr{constructor(e){super(e)}getState(){var e,t,n,r;return{expandedRows:this.allPositive?!0:(t=(e=this.positiveMap)==null?void 0:e.topDownKeys())!=null?t:[],collapsedRows:this.allNegative?!0:(r=(n=this.negativeMap)==null?void 0:n.topDownKeys())!=null?r:[]}}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{useEffect as An,useMemo as Jc,useRef as ia,useState as _g}from"react";import{useEffect as jc,useRef as Ji}from"react";function Dn(o,e){let t=Ji({}),n=Ji({}),r=n.current,i=Ji({}),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,jc(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=o(s,r)),i.current={},n.current={},u},l)}function oA(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);jc(o,t)}function $c(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function Qi(o){let{pivotByAtIndex:e,pivotAggregator:t}=o;return e!=null&&e.column&&(typeof e.column=="function"?Object.assign(o,e.column({column:o})):Object.assign(o,e.column)),t!=null&&t.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(o,t.pivotColumn({column:o})):Object.assign(o,t.pivotColumn)),o}function ea(o){let{pivotByAtIndex:e}=o;return e!=null&&e.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(o,e.columnGroup({columnGroup:o})):Object.assign(o,e.columnGroup)),o}function Uc({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>D(C({},r[f]),{id:f}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},u={},c=Ft(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Qi({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>{var g;return h.isGroupRow?(g=h.reducerResults)==null?void 0:g[f.id]:null}})})});(!a&&t==="start"||n==="start")&&c();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,h,g)=>{if(m=[...m],t==="end"&&(g==null||g()),m.length===a){let y=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let b=S;S=m.join("/");let w=m[m.length-1];u[S]=ea({header:`${w}`,columnGroup:b,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:y,pivotIndex:m.length-1,pivotGroupKey:w})}l.forEach((b,w)=>{let v=d?`${m[m.length-1]}`:b.name||b.id,I=Qi({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:b,pivotAggregatorIndex:w,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:y,defaultSortable:!1,columnGroup:S,header:v,valueFormatter:({rowInfo:x})=>{var E,P;return x.isGroupRow?(P=(E=x.pivotValuesMap)==null?void 0:E.get(m))==null?void 0:P.reducerResults[b.id]:null}}),R=`${b.id}:${m.join("/")}`;s[R]=I})}else{let y=m.join("/"),T=m.slice(0,-1);if(u[y]=ea({columnGroup:T.length?T.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],b=T.length?T.join("/"):void 0;if(!d){let w=b;b=`total:${m.join("/")}`,u[b]=ea({header:`${m[m.length-1]} total`,columnGroup:w,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((w,v)=>{let I=d?`${m[m.length-1]} total `:`${w.name||w.id} total`,R=Qi({columnGroup:b,header:I,pivotAggregator:w,pivotAggregatorIndex:v,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:x})=>{var E,P;return x.isGroupRow?(P=(E=x.pivotValuesMap)==null?void 0:E.get(m))==null?void 0:P.reducerResults[w.id]:null}});s[`total:${w.id}:${m.join("/")}`]=R})}}(t==="start"||t===!1)&&(g==null||g())}),(!a&&t==="end"||n==="end")&&c(),{columns:s,columnGroups:u}}function Mn(o,e){return e.reduce((t,n)=>{let{field:r,valueGetter:i,toKey:a}=n,l=r?o[r]:i==null?void 0:i({data:o,field:r}),s=(a||ao)(l,o);return t.push(s),t},[])}function gr(o,e){return new pe(o,Ke(e))}function Ke(o){return()=>{let e=typeof o=="function"?o():o;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function Yc(o){let{getDataSourceState:e,dataSourceActions:t}=o;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 pe))throw"Invalid row selection";let a=new pe(r,Ke(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 pe))throw"Invalid row selection";let a=new pe(r,Ke(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=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 pe))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?Mn(c,u):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=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 pe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Mn(d,u):[]}let c=new pe(a,Ke(e));c.selectRow(r,i),t.rowSelection=c},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:u}=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 pe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Mn(d,u):[]}let c=new pe(l,Ke(e));c.deselectRow(r,i),t.rowSelection=c}},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 pe))throw"Invalid row selection";let s=new pe(a,Ke(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 pe))throw"Invalid row selection";let s=new pe(a,Ke(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 pe))throw"Invalid row selection";let s=new pe(a,Ke(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new pe(i,Ke(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof pe))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new pe(r,Ke(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 u=i.toPrimaryKey(s);a.isRowSelected(u)&&l.push(u)}),l}}}var Mg=Ue("CellSelectionState"),Eg="*",Ae=class{constructor(e){this.wildcard=Eg;this.cache=new ae;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;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,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let u=this.deselectedColumnsToRows.get(t),c=this.selectedColumnsToRows.get(t);u==null||u.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),c==null||c.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let u=this.deselectedRowsToColumns.get(t),c=this.selectedRowsToColumns.get(t);u==null||u.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),c==null||c.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(u=>{this.cache.delete(u)}),this.cache.delete(s),n)if(this.defaultSelection){let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1);let c=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(c!=null&&c.has(t)||d!=null&&d.has(e))&&this.setCellInSelection(e,t,!0)}else{let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection){let u=this.selectedRowsToColumns.get(e);u!=null&&u.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0)}else{let u=this.selectedRowsToColumns.get(e);u!=null&&u.has(t)&&this.setCellInSelection(e,t,!1);let c=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(c!=null&&c.has(t)||d!=null&&d.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,n){if(n){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(n){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,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){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(n){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,n=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)}),n&&n.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 n=this.selectedRowsToColumns.get(e);if(n){if(n.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=>n.has(r)):!1}return!1}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(console.error("CellSelectionState.isCellSelected should not be called with wildcard"),Mg("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){var m,h;let n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),u=this.deselectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let g=this.deselectedRowsToColumns.get(e);return g&&g.has(t)?a():s!=null&&s.has(e)||u!=null&&u.has(t)?(m=this.selectedRowsToColumns.get(e))!=null&&m.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():c!=null&&c.has(e)||d!=null&&d.has(t)?(h=this.deselectedRowsToColumns.get(e))!=null&&h.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var pe=class{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new ae;this.deselectedMap=new ae;this.onlyUsePrimaryKeys=!1;this.selectionCache=new ae;this.selectionCountCache=new ae;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,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Mn(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){var r;if(e.length==0)return this.getConfig().totalCount;let t=this.getGroupDeepMap(),n=t==null?void 0:t.get(e);return n?(r=n.totalChildrenCount)!=null?r:n.items.length||0:0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return(t==null?void 0:t.getKeysStartingWith(e,!0,1))||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return((t==null?void 0:t.getKeysStartingWith([],!0,1))||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let n=t==null?void 0:t.get(e);return n?n.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,n){return new pe(e,t,n)}update(e){var t,n;this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),(t=this.selectedRows)==null||t.forEach(this._selectedMapSet),(n=this.deselectedRows)==null||n.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()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}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 n=[...t,e],r=this.selectionCache.get(n);if(r!==void 0)return r;let i=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(i)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(n,!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(n,!0),!0;if(s)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,n){t?this.setRowAsSelected(e,n):this.setRowAsDeselected(e,n)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:n,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=n&&r?null:!!n;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],n=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!n?!0:n&&!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,!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,!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 n=[...t,e];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(n),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 n=[...t,e];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(n),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){var u,c;let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let d=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,d),d}if(r&&this.onlyUsePrimaryKeys){let d=this.getAllPrimaryKeysInsideGroup(e),p=0,f=0;d.forEach(h=>{if(this.defaultSelection){if(this.deselectedMap.has([h])){f++;return}p++}else{if(this.selectedMap.has([h])){p++;return}f++}});let m={selectedCount:p,deselectedCount:f};return this.selectionCountCache.set(e,m),m}t=t!=null?t:this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let d=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,p=this.getGroupCount(e),f=this.selectedMap.getKeysStartingWith(e,!0,1).length,m=this.deselectedMap.getKeysStartingWith(e,!0,1).length,h=p-(f+m),g={selectedCount:f+(d?h:0),deselectedCount:m+(d?0:h)};return this.selectionCountCache.set(e,g),g}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let d=((c=(u=this.getConfig().groupDeepMap)==null?void 0:u.get(e))==null?void 0:c.totalChildrenCount)||0;t?(a=d,l=this.deselectedMap.getAllChildrenSizeFor(e),l===d&&(a=0)):(l=d,a=this.selectedMap.getAllChildrenSizeFor(e),a===d&&(l=0))}i.forEach(d=>{let p=this.selectedMap.get(d),f=this.deselectedMap.get(d),m=p?!0:f?!1:t,{selectedCount:h,deselectedCount:g}=this.getSelectionCountFor(d,m);a+=h,l+=g});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};function ta(o){if(!o)return;let e=Object.keys(o);if(!e.length)return;let t={};for(let n=0,r=e.length;n<r;n++){let i=e[n],a=o[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function na(o){let e=o.reducerKeys,t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;n[a]=l(n[a],o.rowInfo)}}function oa(o){let e=Object.keys(o.reducers||{});if(!e.length||!o.results)return o.results;let t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}function ra(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var En=(o,e,t)=>{for(let n=0,r=t.length;n<r;n++){let i=t[n],a=o[i],l=e[i];if(a!==l)return!0}return!1};function qc(){return!1}function Ag(o,e,t,n,r){let i={dataSourceHasGrouping:!1,data:o,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,isCellSelected:qc,hasSelectedCells:qc};return n&&(i.rowSelected=n(i)),r&&(i.isCellSelected=a=>r.isCellSelected(i.id,a),i.hasSelectedCells=a=>r.isCellSelectionInRow(i.id,a)),i}function Fg(o){let{filterTypes:e,operatorsByFilterType:t,filterFunction:n,toPrimaryKey:r}=o,{dataArray:i}=o;n&&(i=i.filter((l,s,u)=>n({data:l,index:s,dataArray:u,primaryKey:r(l,s)})));let a=ra(o.filterValue,e)||[];return a&&a.length?i.filter((l,s,u)=>{var d;let c={data:l,index:s,dataArray:u,primaryKey:r(l,s),field:void 0};for(let p=0,f=a.length;p<f;p++){let m=a[p],{disabled:h,field:g,valueGetter:y,filter:{type:T,value:S,operator:b}}=m,w=e[T];if(h||!w)continue;let v=(d=t[T])==null?void 0:d[b];if(!v)continue;let R=y||w.valueGetter||(({data:E,field:P})=>P?E[P]:E);c.field=g;let x=c;if(x.filterValue=S,x.currentValue=R(x),x.emptyValues=w.emptyValues,!v.fn(x))return!1}return!0}):i}function Xc(o){var N,k;let{state:e,previousState:t}=o,n=Wc(e),r=e.sortInfo,i=e.sortMode,a=r!=null&&r.length?i==="local":!1;(e.lazyLoad||e.livePagination)&&(a=!1);let l=En(t,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]),s=t&&e.data!==t.data,u=e.lazyLoad&&t&&(t.groupBy!==e.groupBy||t.sortInfo!==e.sortInfo);s&&(u=!0),u&&(e.originalLazyGroupData=new ae,l=!0);let c=e.cache?xt.clone(e.cache):void 0;c&&!c.isEmpty()&&(l=!0);let d=e.toPrimaryKey,p;l&&(e.indexer.clear(),e.lazyLoad||(p=c==null?void 0:c.getMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:d,cache:c}))),c&&(c.clear(),e.cache=void 0);let{filterFunction:m,filterValue:h,filterTypes:g,operatorsByFilterType:y}=e,T=!!m||Array.isArray(h)&&h.length,S=T&&e.filterMode==="local",b=En(t,e,["filterFunction","filterValue","filterTypes"]),w=l||b,v=En(t,e,["sortInfo"]),I=l||b||v,R=e.filterMode==="local"&&(w||!e.lastFilterDataArray),x=a&&(I||!e.lastSortDataArray||n.sortInfo),E=e.groupBy,P=e.pivotBy,V=E.length>0||!!P,z=En(t,e,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),F=l||I||En(t,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation"]),M=En(t,e,["rowInfoReducers"]),A=V&&(F||!e.lastGroupDataArray||n.groupBy)||z||M,_=Date.now(),H=e.originalDataArray;if(T||(e.unfilteredCount=H.length),S&&(e.unfilteredCount=H.length,H=R?Fg({dataArray:H,toPrimaryKey:d,filterTypes:g,operatorsByFilterType:y,filterFunction:m,filterValue:h}):e.lastFilterDataArray,e.lastFilterDataArray=H,e.filteredAt=_),e.filteredCount=H.length,e.postFilterDataArray=H,a){let Y=It.knownTypes;It.knownTypes=C(C({},Y),e.sortTypes);let O=e.sortFunction||It;H=x?O(r,[...H]):e.lastSortDataArray,It.knownTypes=Y,e.lastSortDataArray=H,e.sortedAt=_}e.postSortDataArray=H;let G=e.dataArray,J=e.rowSelection instanceof pe?e.rowSelection:void 0,U=e.cellSelection instanceof Ae?e.cellSelection:void 0;J==null||J.xcache();let $=e.selectionMode==="single-row"?Y=>Y.id===e.rowSelection:e.selectionMode==="multi-row"?Y=>{let O=J;return Y.isGroupRow?O.getGroupRowSelectionState(Y.groupKeys):O.isRowSelected(Y.id,Y.dataSourceHasGrouping?Y.groupKeys:void 0)}:void 0;e.isRowSelected&&e.selectionMode==="multi-row"&&($=Y=>e.isRowSelected(Y,J,e.selectionMode));let ee=e.rowInfoReducers;if(V){if(A){let Y=e.aggregationReducers,O=e.lazyLoad?Kc({groupBy:E,pivot:P,mappings:e.pivotMappings,reducers:Y,indexer:e.indexer,toPrimaryKey:d,cache:c},e.originalLazyGroupData):Xi({groupBy:E,pivot:P,reducers:Y},H);e.groupDeepMap=O.deepMap,J&&(J.getConfig=Ke(e));let B=Object.keys(ee||{}),L=ta(ee),W={reducers:ee,results:L,reducerKeys:B,rowInfo:{}},te=L?ke=>{W.rowInfo=ke,na(W)}:void 0,X=U?ke=>{ke.isCellSelected=je=>U.isCellSelected(ke.id,je)}:void 0,ne=te||X?$c(te,X):void 0,ge=kc({groupResult:O,lazyLoad:!!e.lazyLoad,reducers:Y,toPrimaryKey:d,isRowSelected:$,rowSelectionState:J,withRowInfo:ne,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});G=ge.data,e.rowInfoReducerResults=oa({reducers:ee,results:L,array:G}),e.groupRowsIndexesInDataArray=ge.groupRowsIndexes,e.reducerResults=O.reducerResults;let ye=P?Uc({deepMap:O.topLevelPivotColumns,pivotBy:P,pivotTotalColumnPosition:(N=e.pivotTotalColumnPosition)!=null?N:"end",pivotGrandTotalColumnPosition:(k=e.pivotGrandTotalColumnPosition)!=null?k:!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=ye==null?void 0:ye.columns,e.pivotColumnGroups=ye==null?void 0:ye.columnGroups}else G=e.lastGroupDataArray;e.lastGroupDataArray=G,e.groupedAt=_}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,t.postSortDataArray!=e.postSortDataArray||F||z||M){let O=Object.keys(ee||{}),B=ta(ee),L={reducers:ee,results:B,reducerKeys:O,rowInfo:{}};G=H.map((W,te)=>{let X=Ag(W,W?d(W):te,te,$,U);return B&&(L.rowInfo=X,na(L)),X}),e.rowInfoReducerResults=oa({reducers:ee,results:B,array:G})}if(e.postGroupDataArray=G,G!==e.dataArray&&(e.updatedAt=_),e.dataArray=G,e.reducedAt=_,e.selectionMode==="multi-row")if(V&&e.lazyLoad){let Y=!0,O=!1;e.dataArray.forEach(B=>{if(B.isGroupRow&&B.groupKeys.length===1){let{rowSelected:L}=B;L!==!0&&(Y=!1),(L===!0||L===null)&&(O=!0)}}),e.allRowsSelected=Y,e.someRowsSelected=O}else{let Y=e.filteredCount,O=e.rowSelection.getSelectedCount();e.allRowsSelected=Y===O,e.someRowsSelected=O>0}return e.originalDataArrayChanged=l,l&&(e.originalDataArrayChangedInfo={timestamp:_,mutations:p!=null&&p.size?p:void 0}),e}function it(){var e;let o=(e=xe().performance)==null?void 0:e.now();return`${Date.now()}:${o}`}var Og=!0,Vg=()=>new Promise(o=>{be(o)}),zg={originalDataArray:!0,changes:!0},Lg={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function vt(o,e,t){var l,s;let n=o.multiSort?o.sortInfo:(s=(l=o.sortInfo)==null?void 0:l[0])!=null?s:null,r={append:!1,originalDataArray:o.originalDataArray,sortInfo:n,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(r.livePaginationCursor=o.livePaginationCursor,r.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=o.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let u=Qc(r.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});u&&u.length&&(r.filterValue=u)}let i={},a=o.dataParams||{};for(let u in r)if(r.hasOwnProperty(u)&&!zg[u]){let c=u,d=Lg[c],p=r[c],f=a[c];(d?d(p,f):p===f)||(i[c]=!0)}return r.changes=i,r}function an(o,e,t,n,r){let i=vt(e,n,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,u=[Nt,...i.groupKeys||[]],c=s.get(u);if(!c){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(c&&c.cache&&u.length>1){let d=c.children,p=d.length,f=!0;for(let m=0;m<p;m++)if(d[m]==null){f=!1;break}if(f)return Promise.resolve(!0)}c?c.childrenLoading||(c.childrenLoading=!0):s.set(u,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Og,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=it()}typeof o=="function"&&(o=o(i));let l=typeof o=="object"&&typeof o.then=="function";return l&&!e.lazyLoad&&(t.loading=!0),Promise.resolve(o).then(s=>{let u=[],c=!1;if(Array.isArray(s.data)){let p=s;if(u=p.data,p.livePaginationCursor!==void 0&&(t.livePaginationCursor=p.livePaginationCursor),p.mappings&&(t.pivotMappings=p.mappings),p.totalCountUnfiltered&&(t.unfilteredCount=p.totalCountUnfiltered),e.lazyLoad){let m=function(h,g,y){var I,R,x,E;let T=[Nt,...h],S=g.data,b={cache:!!g.cache,childrenLoading:!1,childrenAvailable:!0,totalCount:(I=g.totalCount)!=null?I:S.length,totalCountUnfiltered:(R=g.totalCount)!=null?R:S.length,children:S,error:g.error},w=[];if(i.lazyLoadBatchSize&&!y){let P=f.get(T),V=!P,z=uu({children:!0},P||{},b);V&&(z.chidren=[]),z.children.length=z.totalCount;let F=(x=i.lazyLoadStartIndex)!=null?x:0,M=Math.min((E=g.totalCount)!=null?E:S.length,F+i.lazyLoadBatchSize);for(let A=F;A<M;A++){let _=b.children[A-F];if(!_)throw`lazily loaded item not found at index ${A-F}`;z.children[A]=_,_.dataset&&w.push({keys:_.keys,dataset:_.dataset})}V&&f.set(T,z)}else b.children.forEach(P=>{P&&P.dataset&&w.push({keys:P.keys,dataset:P.dataset})}),b.children.length=b.totalCount,f.set(T,b);let v=!1;if(!h||!h.length){let P=f.get([Nt]);t.originalDataArray=[...P.children],v=!0}if(v||(t.originalLazyGroupDataChangeDetect=it()),w.length){let P=h;w.forEach(({keys:V,dataset:z})=>{m(V,z,P)})}};var d=m;let f=e.originalLazyGroupData;c=!0,m(i.groupKeys||[],p)}}else u=s;c||(t.originalDataArray=a?e.originalDataArray.concat(u):u),l&&!e.lazyLoad&&(t.loading=!1)})}function Qc(o,{filterTypes:e,filterMode:t}){return t==="local"?o:(ra(o,e)||[]).map(n=>{let r=C({},n);return delete r.valueGetter,r})}function Zc(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function ed(){let{getComponentState:o,componentActions:e,componentState:t}=ve(),{data:n,dataArray:r,notifyScrollbarsChange:i,refetchKey:a,sortInfo:l,shouldReloadData:s,groupBy:u,pivotBy:c,filterValue:d,filterMode:p,livePagination:f,livePaginationCursor:m,filterTypes:h,cursorId:g}=t,[y,T]=_g({vertical:!1,horizontal:!1}),S=ia(y);An(()=>(i.onChange(R=>{R&&(S.current=R,T(R))}),()=>i.destroy()),[i]),An(()=>{if(!f)return;let R=requestAnimationFrame(()=>{var x;(x=S.current)!=null&&x.vertical||m&&(e.cursorId=m)});return()=>cancelAnimationFrame(R)},[m]),An(()=>{if(!f||m!==void 0)return;let R=requestAnimationFrame(()=>{var x;(x=S.current)!=null&&x.vertical||g!=null&&r.length&&(e.cursorId=r.length)});return()=>cancelAnimationFrame(R)},[r.length,m]),An(()=>{let R=o(),{livePaginationCursor:x,livePagination:E,dataArray:P}=R;!y.vertical&&E&&(x?e.cursorId=x:x===void 0&&P.length&&(e.cursorId=P.length))},[y.vertical]);let b=Jc(()=>Qc(d,{filterTypes:h,filterMode:p}),[d,p,h]),w={sortInfo:s.sortInfo?l:null,groupBy:s.groupBy?u:null,pivotBy:s.pivotBy?c:null,refetchKey:a,filterValue:s.filterValue?b:null,cursorId:f?g:null},v=ia(!0);Gg();let I=Oe(ze());Dn(()=>{let R=o(),x=I(),{isDetail:E,isDetailReady:P}=Zc(x,o);E&&!P||typeof R.data!="function"&&an(R.data,R,e,void 0,x)},{data:n}),Dn(R=>{let x=Object.keys(R),E=!1;if(x.length===1&&(E=!!R.cursorId,R.filterValue&&o().filterMode==="local"))return;let P=I(),{isDetail:V,isDetailReady:z}=Zc(P,o);if(V&&!z)return;let F=o();typeof F.data=="function"&&an(F.data,F,e,{append:E},P)},D(C({},w),{data:n})),Dn(()=>{let R=o();if(v.current){v.current=!1;let x=vt(R,void 0,I());e.dataParams=x}},w)}function Gg(){let{getComponentState:o,componentActions:e,componentState:t}=ve();An(()=>{e.lazyLoadCacheOfLoadedBatches=new ae},[t.data,t.dataParams]);let{lazyLoadBatchSize:n,lazyLoad:r,originalLazyGroupDataChangeDetect:i,notifyRenderRangeChange:a,dataArray:l,groupRowsState:s,scrollStopDelayUpdatedByTable:u}=t,c=ia(null),d=(f,m=o().lazyLoadCacheOfLoadedBatches)=>{let h=o();if(f=f||c.current,!f)return;let{renderStartIndex:g,renderEndIndex:y}=f,{lazyLoadBatchSize:T,lazyLoad:S}=h;S&&((!T||T<=0)&&(!h.groupBy||h.groupBy.length===0)||Hg({startIndex:g,endIndex:y,lazyLoadBatchSize:T,componentState:h,componentActions:e},m))},p=Jc(()=>yt(d,{wait:u}),[u]);Dn(f=>{if(r)return(f.originalLazyGroupDataChangeDetect||f.groupRowsState)&&d(a.get()),a.onChange(m=>{c.current=m,d(m)})},{lazyLoadBatchSize:n,lazyLoad:r,originalLazyGroupDataChangeDetect:i,groupRowsState:s}),An(()=>{n&&n>0&&p()},[l])}function Hg(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a}=o,{dataArray:l}=i,s=f=>l[f].data!=null,u=new ae,c=["_______xxx______"];for(let f=t;f<=n;f++){let m=l[f];if(!m)continue;let h=s(f),g=m.dataSourceHasGrouping&&m.groupKeys?[...m.groupKeys]:[];m.isGroupRow&&m.dataSourceHasGrouping&&m.groupKeys&&g.pop();let y=g.length?g:c,T=m.dataSourceHasGrouping?m.indexInGroup:m.indexInAll;if(m.isGroupRow&&!m.collapsed&&!m.childrenAvailable){let S={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:m.groupKeys},b=m.groupKeys,w=u.get(b);if(!(w!=null&&w[m.id])){let v=!w;w=w||{},w[m.id]||(w[m.id]=S),v&&u.set(b,w)}}if(!h&&r!=null){let S=u.get(y),b=Math.floor(T/r)*r,w=T-b,v=l[m.indexInAll-w].indexInAll,I=s(v),R=l[v].id;if(I||S!=null&&S[R])continue;let x=!S;S=S||{};let E={lazyLoadStartIndex:b,lazyLoadBatchSize:r,groupKeys:g};S[R]||(S[R]=E),x&&u.set(y,S)}}let d=Promise.resolve(!0),p=[];u.topDownValues().forEach(f=>{p.push(...Object.values(f))}),p.reduce((f,m)=>{let h=[...m.groupKeys,m.lazyLoadStartIndex];if(e&&e.has(h))return f;e==null||e.set(h,!0);let g=[i.data,i,a,m];return f.then(()=>Vg()).then(()=>an(...g))},d)}var nd=tt("InfiniteTable");var Ng="#eb9316";var od="Warn",Kg="Error",kg="Info",Bg="Success",Wg="Logs",Cr=nd.extend(Wg),i1=Cr.extend(kg),jg=Cr.extend(od),a1=Cr.extend(Kg),l1=Cr.extend(Bg);var $g=Ng;var Ug=(o,e)=>{e=e?e.extend(od):jg,e(nd.color($g,o))};var td=new ae,Yg=(o,...e)=>{td.has(e)||(td.set(e,!0),o())};var Sr=(o,e=o,t)=>{Yg(()=>Ug(o,t),e,"warn")};var aa=new WeakMap,qg=o=>o;function rd(o,e=50,t){aa.set(o,{lastCallTime:0,lastCallArg:null});let n=t!=null?t:qg;return r=>{let{lastCallTime:i,lastCallArg:a}=aa.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=Vt(n(a),n(r));s<e&&u||(aa.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var yr=class{constructor(){this.primaryKeyToData=new Map;this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.clear=()=>{this.primaryKeyToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.indexArray=(e,t)=>{let{cache:n,toPrimaryKey:r}=t;n&&!n.isEmpty()&&(e=e.concat());for(let i=0;i<e.length;i++){let a=e[i],l=!1;if(a!=null){let s=r(a),u=n==null?void 0:n.getMutationsForPrimaryKey(s);if(u&&u.length){for(let c=0,d=u.length;c<d;c++){let p=u[c];if(p.type==="delete"&&!l&&(this.primaryKeyToData.delete(s),l=!0,e.splice(i,1)),p.type==="update"&&!l&&(a=C(C({},a),p.data),e[i]=a),p.type==="insert"){let f=r(p.data);this.add(f,p.data),p.position==="before"?(e.splice(i,0,p.data),i--):e.splice(i+1,0,p.data)}}n==null||n.removeInfo(s)}l||this.add(s,a)}}return e}}};var Xg=Object.freeze([]),id=(o,e)=>{let t=o!=null?o:Xg,n=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===n.length)return r}return e&&t&&e.set(t,n),n};var la=Ue("DataSource"),Zg=Symbol("cursorId");function ld(){let o=Date.now(),e=[],t=[],n=new ae;return{indexer:new yr,destroyedRef:{current:!1},idToIndexMap:new Map,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},lazyLoadCacheOfLoadedBatches:new ae,dataParams:void 0,onCleanup:we(),notifyScrollbarsChange:we(),notifyScrollStop:we(),notifyRenderRangeChange:we(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:n,originalLazyGroupDataChangeDetect:0,originalDataArray:e,cursorId:Zg,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:t,unfilteredCount:t.length,filteredCount:t.length,updatedAt:o,groupedAt:0,sortedAt:0,filteredAt:0,reducedAt:o,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0}}function Jg(o){let e=C({},o);return delete e.originalDataArray,e}var Qg=[],sd=o=>{o.destroyedRef.current=!0},ud=o=>({onDataParamsChange:e=>e?rd(e,100,Jg):void 0,lazyLoad:e=>!!e,data:1,debugId:1,pivotBy:1,primaryKey:1,livePagination:1,refetchKey:e=>e!=null?e:"",filterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:e=>e!=null?e:!1,filterDelay:e=>e!=null?e:200,filterTypes:e=>C(C({},Zt),e),sortTypes:e=>C(C({},lo),e),sortFunction:1,onReady:1,rowInfoReducers:(e,t)=>{let n={initialValue:()=>{t.idToIndexMap.clear()},reducer:(r,i)=>{t.idToIndexMap.set(i.id,i.indexInAll)}};return e?D(C({},e),{__idToIndex:n}):{__idToIndex:n}},isRowSelected:1,onDataArrayChange:1,onDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:e=>e!=null?e:!0,loading:e=>e!=null?e:!1,sortInfo:e=>id(e,o.propsCache.get("sortInfo")),groupBy:e=>e!=null?e:Qg});function eC(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}var ad=new WeakMap;function cd(o){var x,E,P,V,z,F,M,A,_,H,G,J;let{props:e,state:t,oldState:n}=o,r=qn(e.sortInfo),i=qn(e.filterValue),{filterTypes:a}=t,l=Object.keys(a).reduce((U,$)=>{let ee=a[$].operators;U[$]=U[$]||{};let N=U[$];return ee.forEach(k=>{N[k.name]=k}),U},{}),s=e.selectionMode;if(s===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)s="multi-cell";else{let U=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;U!==void 0&&(U&&typeof U=="object"?s="multi-row":s="single-row"),s=s!=null?s:!1}let u=null,c=null,d=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,p=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(s!==!1&&((s==="single-row"||s==="multi-row")&&(d===null?u=s==="single-row"?null:new pe({selectedRows:[],deselectedRows:[],defaultSelection:!1},Ke(t)):s==="single-row"||d instanceof pe?u=d:u=new pe(d,Ke(t))),s==="single-cell"||s==="multi-cell"))if(p===null)c=s==="single-cell"?null:new Ae;else if(p instanceof Ae)c=p;else{let U=(x=ad.get(p))!=null?x:new Ae(p);ad.set(p,U),c=U}let f=t.primaryKey,m=typeof f=="function"?U=>f(U):U=>U[f],h=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;h&&!(h instanceof Xe)&&(h=new Xe(h)),h=h||new Xe(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let{shouldReloadData:g={}}=e,y=(E=e.groupMode)!=null?E:g.groupBy!=null?g.groupBy?"remote":"local":void 0,T=((P=e.sortMode)!=null?P:g.sortInfo!=null)?g.sortInfo?"remote":"local":void 0,S=((V=e.filterMode)!=null?V:g.filterValue!=null)?g.filterValue?"remote":"local":void 0;e.groupMode&&Sr('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",la),e.sortMode&&Sr('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",la),e.filterMode&&Sr('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",la);let b=typeof e.data=="function"&&y!=null?y:"local",w=e.sortFunction?"local":T!=null?T:r?"remote":"local",v=typeof e.filterFunction=="function"?"local":S!=null?S:typeof e.data=="function"?"remote":"local",I=g.pivotBy?"remote":"local",R={selectionMode:s,groupRowsState:h,shouldReloadData:{filterValue:(F=(z=e.shouldReloadData)==null?void 0:z.filterValue)!=null?F:v==="remote",sortInfo:(A=(M=e.shouldReloadData)==null?void 0:M.sortInfo)!=null?A:w==="remote",groupBy:(H=(_=e.shouldReloadData)==null?void 0:_.groupBy)!=null?H:b==="remote",pivotBy:(J=(G=e.shouldReloadData)==null?void 0:G.pivotBy)!=null?J:I==="remote"},rowSelection:u,cellSelection:c,groupMode:b,sortMode:w,filterMode:v,pivotMode:I,toPrimaryKey:m,operatorsByFilterType:l,controlledSort:r,controlledFilter:i,multiSort:Array.isArray(r?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let U=!n||n.originalDataArray!==t.originalDataArray,$=typeof e.livePaginationCursor=="function"?U?eC(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;R.livePaginationCursor=$}return R}var tC=Ue("DataSource:fullLazyLoad");function dd(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&tC('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new Xe({collapsedRows:!0,expandedRows:[]})))}var nC=Ue("DataSource:dataParams");function pd(){return{rowSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},cellSelection:(o,e)=>e.selectionMode==="single-cell"?{callbackParams:[o instanceof Ae?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function md(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=vt(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&be(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=vt(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&be(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=vt(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&be(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=vt(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&be(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=vt(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=vt(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>Vt(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(nC("onDataParamsChange triggered because the following values have changed",o==null?void 0:o.changes),!0)}}function fd(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}var sa=class{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t!=null?t:sa.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.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}},so=sa;so.DEFAULT_SIZE=10;var ua=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},Tr=class{constructor(e){this.storage=new so(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)}},ca=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)}},uo=class{constructor(e){this.cacheStorage=e===!1?new ua:e===!0?new ca:typeof e=="number"?new Tr(e):new Tr(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 br=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){var e,t;(e=this.positiveMap)==null||e.clear(),(t=this.negativeMap)==null||t.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of n)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){var t,n;if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!((t=this.negativeMap)!=null&&t.has(e))}return!!((n=this.positiveMap)!=null&&n.has(e))}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){var n;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`;(n=this.positiveMap)==null||n.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var Je=class extends br{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){var r,i,a,l;let t=this.allPositive?!0:[...(i=(r=this.positiveMap)==null?void 0:r.keys())!=null?i:[]],n=this.allNegative?!0:[...(l=(a=this.negativeMap)==null?void 0:a.keys())!=null?l:[]];return{expandedRows:t,collapsedRows:n}}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,n){return this.setItemValue(t,n)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var oC=(e=>(e.INIT="INIT",e))(oC||{});function rC(o){let{children:e}=o,{api:t,componentState:n}=me();return typeof e=="function"&&(e=e(n)),gd(()=>{var r;(r=n.onReady)==null||r.call(n,t)},[]),gt.createElement(gt.Fragment,null,e)}var iC=bt({debugName:"DataSource",initSetupState:ld,forwardProps:ud,concludeReducer:Xc,mapPropsToState:cd,onPropChange:dd,cleanup:sd,interceptActions:md(),mappedCallbacks:pd()});function aC({children:o,isDetail:e}){let t=kn(),n=ze(),r=Oe(n),{componentState:i,componentActions:a,assignState:l}=ve();i.getDataSourceMasterContextRef.current=r;let s=Oe(i),[u]=gt.useState(()=>Bc({getState:s,actions:a})),c={componentState:i,componentActions:a,getDataSourceMasterContext:r,getState:s,assignState:l,api:u};return hd(()=>{n&&n.registerDetail(c)},[]),hd(()=>()=>{let d=s();d.onCleanup(d)},[]),ed(),gd(()=>{var d;(d=i.onDataArrayChange)==null||d.call(i,i.originalDataArray,i.originalDataArrayChangedInfo),i.onDataMutations&&i.originalDataArrayChangedInfo.mutations&&i.originalDataArrayChangedInfo.mutations.size&&i.onDataMutations({primaryKeyField:typeof i.primaryKey=="string"?i.primaryKey:void 0,dataArray:i.originalDataArray,mutations:i.originalDataArrayChangedInfo.mutations,timestamp:i.originalDataArrayChangedInfo.timestamp})},[i.originalDataArrayChangedInfo]),gt.createElement(t.Provider,{value:c},gt.createElement(rC,{children:o}))}function sF(o){let e=ze(),t=!!e,n=t?e.masterRowInfo.id:"master";return gt.createElement(iC,D(C({},o),{key:n}),gt.createElement(aC,{children:o.children,isDetail:t}))}function uF(){let{rowInfoReducerResults:o}=un();return o}function cF(){let o=ze();if(o)return o.masterRowInfo}function da(o){let{getComputed:e,getState:t,actions:n}=o,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){n.columnMenuVisibleKey=Date.now();return}function s(f,m){let h=l[u+f*m],g=a.get(h);if(g&&g.renderMenuIcon!==!1)return h}let u=l.indexOf(r),c=0,d=-1,p;for(;!p&&c<l.length&&(c++,p=s(c,d),p||(d*=-1,p=s(c,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function pa(o){if(o==null)return!1;let e=o;return!0}function lC(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}function fa(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}var ma=class{constructor(e){this.getCellSelectionPosition=e=>{var r,i,a;let t=(i=e.rowId)!=null?i:(r=Pn(e.rowIndex,this.getDataSourceState))==null?void 0:r.id,n=(a=e.colId)!=null?a:this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,n]};this.setRangeSelected=(e,t,n)=>{let i=this.getDataSourceState().cellSelection;if(!i)return;let a=new Ae(i),[l,s]=this.getCellSelectionPosition(e),[u,c]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(c);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,h=Pn(l,this.getDataSourceState),g=Pn(u,this.getDataSourceState);if(!h||!g)return;let y=h.indexInAll,T=g.indexInAll,[S,b]=fa({rowIndex:y,colIndex:f},{rowIndex:T,colIndex:m});for(let w=S.rowIndex;w<=b.rowIndex;w++)for(let v=S.colIndex;v<=b.colIndex;v++){let I={rowIndex:w,colIndex:v},[R,x]=this.getCellSelectionPosition(I);n?a.selectCell(R,x):a.deselectCell(R,x)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=fr(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let u=lC(Array.from(a),i),c=l.map(d=>u.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:u,positions:c}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let n=new Ae(t);n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let n=new Ae(t);n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{var r,i;let[t,n]=this.getCellSelectionPosition(e);return(i=(r=this.getDataSourceState().cellSelection)==null?void 0:r.isCellSelected(t,n))!=null?i:!1};this.selectCell=e=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let[n,r]=this.getCellSelectionPosition(e),i=e.clear?new Ae:new Ae(t);i.selectCell(n,r),this.dataSourceActions.cellSelection=i};this.deselectCell=e=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let[n,r]=this.getCellSelectionPosition(e),i=new Ae(t);i.deselectCell(n,r),this.dataSourceActions.cellSelection=i};this.selectColumn=(e,t)=>{t!=null&&t.clear&&this.deselectAll();let n=this.getDataSourceState().cellSelection;if(!n)return;let r=new Ae(n);r.selectColumn(e),this.dataSourceActions.cellSelection=r};this.deselectColumn=e=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let n=new Ae(t);n.deselectColumn(e),this.dataSourceActions.cellSelection=n};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function Cd(o){return new ma(o)}function Sd(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new Je({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new Je({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 Je(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,n.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 Je(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,n.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function yd(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var ha=class{constructor(e){this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};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(n=>t.has(n))};this.persistEdit=e=>_e(this,null,function*(){var d,p;e=e!=null?e:{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));yield new Promise(f=>requestAnimationFrame(f));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=(d=e.value)!=null?d:t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell=D(C({},t),{active:!1,waiting:"persist"}));let a=D(C({},qe(D(C({rowIndex:t.rowIndex,columnId:t.columnId},this.context),{api:this}))),{value:i,initialValue:t.initialValue}),l=i;n.current=null,r.getValueToPersist&&(l=yield r.getValueToPersist(a)),a.value=l,t.value=l;let s=(p=this.getState().persistEdit)!=null?p:()=>{if(!a.column.field)return i;let f=this.getDataSourceState().primaryKey,m=a.data&&typeof f=="string"?{[f]:a.data[f],[a.column.field]:l}:D(C({},a.data),{[a.column.field]:l});return this.context.dataSourceApi.updateData(m)},u;try{u=yield s(a)}catch(f){u=f}let c=u instanceof Error?u:!0;return this.actions.editingCell=D(C({},t),{active:!1,accepted:!1,waiting:!1,persisted:c}),Promise.resolve(c)});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:n}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===n&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=e=>_e(this,null,function*(){var a,l;let t=this.getState(),{editingCell:n,editingValueRef:r}=t;if(!n)return!0;e||(e={});let i=(a=e.value)!=null?a:r.current;if(!e.cancel&&!e.reject){let{rowIndex:s,columnId:u}=n;this.actions.editingCell=D(C({},t.editingCell),{value:i,active:!1,waiting:"accept"});let{computedColumnsMap:c}=this.getComputed(),d=c.get(u),p=(l=t.shouldAcceptEdit)!=null?l:d.shouldAcceptEdit,f=p?p(D(C({},qe(D(C({},this.context),{api:this,dataSourceApi:this.context.dataSourceApi,columnId:u,rowIndex:s}))),{value:i,initialValue:n.initialValue})):!0;return yield new Promise(m=>requestAnimationFrame(m)),Promise.resolve(f).then(m=>{if(m===!0)return this.actions.editingCell=D(C({},t.editingCell),{active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i}),!0;throw m}).catch(m=>(m instanceof Error||(m=new Error(`Edit rejected: ${m}`)),this.actions.editingCell=D(C({},n),{value:i,persisted:!1,active:!1,waiting:!1,accepted:m}),{reject:m,value:i}))}return e.cancel&&(n!=null&&n.active)?(this.actions.editingCell=D(C({},n),{active:!1,cancelled:!0,waiting:!1,persisted:!1}),{cancel:!0,value:i}):e.reject&&(n!=null&&n.active)?(this.actions.editingCell=D(C({},n),{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=>{var t;return(t=this.getComputed().computedVisibleColumns[e])!=null?t:null};this.isCellEditable=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,i=t!=null?t:this.context.dataSourceApi.getIndexByPrimaryKey(n),{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 u=l.computedEditable(qe(D(C({},this.context),{api:this,columnId:r,rowIndex:i})));return typeof u=="boolean"?Promise.resolve(u):u};this.getColumnApi=e=>Ne(e,D(C({},this.context),{api:this}));this.isColumnSortable=e=>{var t,n;return(n=(t=this.getColumnApi(e))==null?void 0:t.isSortable())!=null?n:!1};this.getCellValue=e=>{var t,n;return(n=(t=this.getCellValues(e))==null?void 0:t.value)!=null?n:null};this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t!=null?t:i.getIndexByPrimaryKey(n),u=l.get(r),c=i.getRowInfoByIndex(s),d=c==null?void 0:c.id;if(!c||!u)return u||console.warn(`No column found with id: "${r}"`),c||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(c)?!1:this.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",h=wn({column:u,rowInfo:c,columnsMap:l,context:D(C({},this.context),{api:p}),rowDetailState:m});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.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.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new Xe(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(),n=new Xe(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[Nt,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i!=null&&i.cache||an(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i!=null&&i.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=ae.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=it())}};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,n={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let h=i.computedVisibleColumnsMap.get(t);if(!h)return!1;a=h.computedVisibleIndex}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,n),s=r.renderer.getScrollPositionForScrollRowIntoView(e,n);if(!l||!s)return!1;let u={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},c=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=u.scrollLeft>d+(n.offset||0),m=u.scrollTop>p+(n.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=u.scrollLeft),u.scrollTop!==c.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=u.scrollTop),!0)};this.context=e,this.rowSelectionApi=Yc({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.rowDetailApi=Sd({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Cd({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(){var e;(e=this.getState().scrollerDOMRef.current)==null||e.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(da(t),e==null||e()),setTimeout(()=>{this.isDestroyed()||(da(t),e==null||e())},n)}isDestroyed(){return!this.getState().domRef.current}startEdit(e){return _e(this,null,function*(){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n!=null?n:this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(l=>_e(this,null,function*(){var s;if(l){let u=this.getDataSourceState().dataArray,d=this.getComputed().computedColumnsMap.get(t),p=u[a],f=i!=null?i:Zu({column:d,rowInfo:p}),m=f;d.getValueToEdit&&(f=yield d.getValueToEdit(qe(D(C({},this.context),{rowIndex:a,columnId:t,api:this})))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:f,initialValue:m,rowIndex:a,primaryKey:(s=u[a])==null?void 0:s.id}}return l}))})}setSortingForColumn(e,t,n){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,n);return}let l=i.groupByForColumn,s=i.field,u=l?Array.isArray(l)?l:[l]:[],c=u.map(f=>{var m;return f.valueGetter?h=>f.valueGetter({data:h,field:f.field}):f.field?f.field:(m=f.groupField)!=null?m:void 0}).filter(pa);c.length&&(s=c);let d=i.computedSortType;u.length&&d===Tn&&(d=u.flatMap(m=>{var y;let h=(y=m.field)!=null?y:m.groupField,g=h?r.get(h):null;return g?g.computedSortType:Tn}));let p={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(p.valueGetter=f=>i.valueGetter({data:f,field:i.field})),this.setSortInfoForColumn(e,p,n)}setSortInfoForColumn(e,t,n){var d,p,f;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=(p=(d=r.sortInfo)==null?void 0:d.slice())!=null?p:[];if(t===null){s=s.filter(m=>!yd(m,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if(((f=n==null?void 0:n.multiSortBehavior)!=null?f:this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(m=>u?m:yd(m,l)?(u=!0,t):m),u||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 n=C({},this.getState().columnPinning);t===!1?delete n[e]:n[e]=t,this.actions.columnPinning=n}setColumnFilter(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(n.computedFilterValue)a=D(C({},n.computedFilterValue),{filter:C({},n.computedFilterValue.filter)});else{let l=n.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(s.field=n.field||n.groupByForColumn),a=s}a.id=n.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){var d;let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=n.computedFilterType,l=i[a].operators,s=(d=l.find(p=>p.name===t))!=null?d:l.find(p=>p.name===i[a].defaultOperator),u=s.name,c;n.computedFilterValue?(c=D(C({},n.computedFilterValue),{filter:D(C({},n.computedFilterValue.filter),{operator:u})}),s.defaultFilterValue!==void 0&&(c.filter.value=s.defaultFilterValue)):(c={filter:{operator:u,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(c.field=n.field)),c.id=n.id,this.setFilterValueForColumn(e,c)}setFilterValueForColumn(e,t){var l;let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=(l=this.getDataSourceState().filterValue)!=null?l:[],a=!1;i=i.map(s=>s===n.computedFilterValue?(a=!0,t):s),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){var a;let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=(a=this.getDataSourceState().filterValue)!=null?a:[],i=!1;r=r.filter(l=>l===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){var a;let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let n=this.getDataSourceState(),r=(a=n.filterValue)!=null?a:[],i=!1;r=r.map(l=>{var s,u,c;if(l===t.computedFilterValue){let d=t.computedFilterValue.filter.type,p=n.operatorsByFilterType[d],f=n.filterTypes[d];if(i=!0,!f)return null;let m=(s=l.filter.operator)!=null?s:f==null?void 0:f.defaultOperator,g=(c=(u=p[m].defaultFilterValue)!=null?u:(f.emptyValues||[])[0])!=null?c:void 0;return D(C({},l),{filter:D(C({},l.filter),{operator:m,value:g})})}return l}).filter(pa),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let n=C({},this.getState().columnVisibility);t?delete n[e]:n[e]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){let t=this.getState();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.scrollTop=Math.max(e,0)}scrollRowIntoView(e,t={offset:0}){let n=this.getState(),r=n.renderer.getScrollPositionForScrollRowIntoView(e,t);if(!r)return!1;let i=n.brain.getScrollPosition(),a=n.brain.scrollTopMax;return r.scrollTop>a+(t.offset||0)?!1:(r.scrollTop!==i.scrollTop&&(n.scrollerDOMRef.current.scrollTop=r.scrollTop),!0)}scrollColumnIntoView(e,t={offset:0}){let n=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=n.brain.getScrollPosition(),u=n.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function Td(o){return new ha(o)}import{useEffect as bd,useRef as sC,useState as uC}from"react";var cC=10;function dC(o,e){var u;let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${en} > .${Li}`,a=(u=o.current)==null?void 0:u.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let d=c.parentElement,p=d.matches(`.${nn}`);if(t===!1&&p)return;let f=d.getAttribute("data-column-id"),m=c.cloneNode(!0);m.style.visibility="hidden",m.style.pointerEvents="none",m.classList.remove(...ft.split(" ")),m.style.position="absolute",m.style.width="auto",d.appendChild(m);let h=m.offsetWidth;if(d.removeChild(m),!s[f]){let g=xe().getComputedStyle(d);s[f]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+cC}if(h+=s[f],p){let g=0;d.childNodes.forEach(y=>{if(y!==c){let T=y,S=Math.max(T.offsetWidth,parseInt(T.style.width,10));if(isNaN(S)&&(S=0),g+=S,S>0){let b=xe().getComputedStyle(T);g+=parseInt(b.marginLeft,10)+parseInt(b.marginRight,10)}}}),h+=g}r&&r.has(f)||n&&!n.has(f)||(l[f]=Math.max(h,l[f]||0))}),l}function Rd(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=ve(),[a,l]=uC(0),s=typeof r=="object"?r.key:r,u=Oe(s),c=sC(null);bd(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),bd(()=>{var b;if(s==null)return;let{autoSizeColumnsKey:d}=o(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=(b=d.includeHeader)!=null?b:m),c.current=s;let h=dC(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),g=Object.keys(h);if(!g.length)return;let y=o().columnSizing,T=C({},y),S=!1;g.forEach(w=>{var v;T[w]={width:h[w]},S=S||T[w].width!==((v=y[w])==null?void 0:v.width)}),S&&(e.columnSizing=T)},[s,n,a])}import{useMemo as yC}from"react";import{useCallback as TC,useEffect as po,useRef as bC}from"react";import*as Rr from"react";function wd(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return Ko(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}import*as co from"react";var Id=Se({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as xd,useRef as pC}from"react";function mC(o,e){let{masterState:t,detailContext:n}=e,r=t.detailDataSourcesStateToRestore;if(r.has(o)){let i=r.get(o);return n.assignState(i),!0}return!1}function fC(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=fd(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(o,l),r.detailDataSourcesStateToRestore=a}function hC(o,e){let t=pC(!1);return{currentRowCache:xd(()=>({getRowId:()=>o,add:r=>{t.current=!0,e.add(o,r)},get:()=>e.get(o),delete:()=>(t.current=!0,e.delete(o)),has:()=>e.has(o)}),[e,o]),cacheCalledByRowDetailRenderer:t}}function vd(o){let{rowDetailsCache:e,rowInfo:t}=o,{getState:n,componentActions:r}=me(),{getState:i}=oe(),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=hC(t.id,e),s=xd(()=>{let u=n().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:Ft(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)});return}mC(t.id,{masterState:n(),detailContext:d}),requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)}),d.componentState.onCleanup.onChange(()=>{let p=a.get();p&&fC(t.id,{detailState:d.getState(),masterActions:r,masterState:n(),cacheEntryForRow:p})})}),shouldRestoreState:u}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}var{rootClassName:gC}=Ie,CC=`${gC}RowDetail`;function SC(o){let e=vo(),{domRef:t,rowDetailRenderer:n,rowDetailHeight:r,rowInfo:i,detailOffset:a,rowDetailsCache:l}=o,{masterDetailContextValue:s,currentRowCache:u}=vd({rowDetailsCache:l,rowInfo:i});return co.createElement(e.Provider,{value:s},co.createElement("div",{ref:t,className:Q(CC,Id({})),style:{position:"absolute",top:`${a}px`,left:0,width:`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,height:r}},n(i,u)))}var Pd=co.memo(SC);var RC=1;function Dd(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,state:i,getState:a}=oe(),{computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:u,computedColumnsMap:c,computedRowHeight:d,computedRowSizeCacheForDetails:p,fieldsToColumn:f,rowspan:m,toggleGroupRow:h,columnSize:g}=e,{componentState:y,getState:T,componentActions:S,api:b}=me(),{dataArray:w}=y,v=Oe(w),{rowHeight:I,rowDetailHeight:R,groupRenderStrategy:x,brain:E,showZebraRows:P,rowDetailRenderer:V,isRowDetailExpanded:z,isRowDetailEnabled:F,cellClassName:M,cellStyle:A,rowStyle:_,rowDetailCache:H,rowClassName:G,onScrollToTop:J,onScrollToBottom:U,scrollToBottomOffset:$,ready:ee}=i,N=y.updatedAt;wd({columnSize:g,brain:E,computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:u,computedRowHeight:d,dataArray:w,bodySize:t,rowspan:m});let k=bC(0);po(()=>E.onRenderCountChange(()=>{k.current=E.scrollTopMax}),[E]),po(()=>E.onScrollStop(L=>{let{scrollTop:W}=L;W===0&&(J==null||J());let te=$!=null?$:RC;if(W+te>=k.current){U==null||U();let{livePagination:ne,livePaginationCursor:ge,dataArray:ye}=T();ne&&(S.cursorId=ge!==void 0?Date.now():ye.length)}}),[E,J,U]),po(()=>{t.height&&(r.ready=!0)},[!!t.height]),po(()=>{let{onReady:L}=a();L&&L({api:n,dataSourceApi:b})},[ee]);let[,Y]=mt();po(()=>{Y()},[y]);let O=TC(L=>{let{rowIndex:W,colIndex:te,heightWithRowspan:X,domRef:ne,hidden:ge,width:ye,onMouseLeave:ke,onMouseEnter:je}=L,Ce=v()[W],De=u[te];if(!Ce)return null;let $e=p?p.getRowHeight(W):X,de=!1;return!F||typeof F=="function"&&!F(Ce)?de=!1:z&&(de=z(Ce)?"expanded":"collapsed"),Rr.createElement(oc,C({},{getData:v,virtualized:!0,showZebraRows:P,groupRenderStrategy:x,rowIndex:W,rowInfo:Ce,hidden:ge,toggleGroupRow:h,rowHeight:$e,rowDetailState:de,onMouseEnter:je,onMouseLeave:ke,domRef:ne,width:ye,column:De,columnsMap:c,fieldsToColumn:f,rowStyle:_,rowClassName:G,cellStyle:A,cellClassName:M}))},[I,R,p,d,z,v,u,c,f,x,h,P,N,_,G,M,A]),B=yC(()=>{if(z)return L=>{let{rowIndex:W,domRef:te}=L,ne=v()[W];if(!ne||!z(ne)||!p)return Rr.createElement("div",{ref:te,className:ws.hidden});let{rowDetailHeight:ge,rowHeight:ye}=p.getSize(W);return Rr.createElement(Pd,{rowInfo:ne,rowDetailsCache:H,rowIndex:W,domRef:te,detailOffset:ye,rowDetailHeight:ge,rowDetailRenderer:V})}},[ee,O,V,R,z,H]);return{renderCell:O,renderDetailRow:B}}import{useEffect as BC,useState as ya}from"react";var wr=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:n}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(n);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 n={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition),this.selectRange(this.multiSelectStartPosition,e),this.multiSelectEndPosition=e)}setRangeSelected(e,t,n){let[r,i]=fa(e,t),a=this.getCellSelectionPosition(r),l=this.getCellSelectionPosition(i);if(!(!a||!l))for(let s=r.rowIndex;s<=i.rowIndex;s++)for(let u=r.colIndex;u<=i.colIndex;u++){let c=this.getCellSelectionPosition({rowIndex:s,colIndex:u});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))}}deselectRange(e,t){this.setRangeSelected(e,t,!1)}selectRange(e,t){this.setRangeSelected(e,t,!0)}};function Md(o,e){return o<e?[o,e]:[e,o]}var Ir=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[n,r]=Md(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);i.selectRow(l)}}deselectRange(e,t){let[n,r]=Md(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(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 n;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))n=r;else break}this.multiSelectEndIndex=n}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};import{useMemo as wC}from"react";function Ed(o){let{getState:e}=me();return wC(()=>o.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,u=o[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}import{useCallback as IC}from"react";var K_=Ue("useColumnSizeFn");function Ad(o){return IC(t=>{let n=o[t];return n?n.computedWidth:0},[o])}import{useEffect as Fn,useLayoutEffect as MC,useMemo as EC}from"react";import{createRef as ln}from"react";var xC={scrollLeft:0,scrollTop:0},mo=class{constructor(){this.scrollPosition=xC;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 n=0,r=t.length;n<r;n++)t[n](e)}};function Fd(o){let e=new Map;return Object.keys(o).forEach(t=>{let r=o[t].columnGroup,i=0;for(;r;){let a=o[r];if(!a)break;i++,r=a.columnGroup}e.set(t,i)}),e}import*as _d from"react";function Od(o){return(e,t)=>_d.createElement(o,{key:e.id,rowInfo:e,cache:t})}function vC(o){let e=new fn(o),t=we();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function ga(o){return`.${Qt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Vd({debugId:o}){let e={},t=new $n(o),n=new $n("header");t.onScroll(l=>{n.setScrollPosition({scrollLeft:l.scrollLeft,scrollTop:0})});let{renderer:r,onRenderUpdater:i}=vC(t);t.onAvailableSizeChange(l=>{n.setAvailableSize({width:l.width})});let a=ln();return{renderer:r,onRenderUpdater:i,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:l=>{if(!a.current)return null;let s=ga(l);return a.current.querySelector(s)||null},brain:t,headerBrain:n,domRef:a,columnMenuTargetRef:ln(),editingValueRef:ln(),scrollerDOMRef:ln(),portalDOMRef:ln(),focusDetectDOMRef:ln(),activeCellIndicatorDOMRef:ln(),onColumnMenuClick:we(),cellContextMenu:we(),contextMenu:we(),onFilterOperatorMenuClick:we(),onRowHeightCSSVarChange:we(),onRowDetailHeightCSSVarChange:we(),onColumnHeaderHeightCSSVarChange:we(),cellClick:we(),cellMouseDown:we(),keyDown:we(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:e,columnVisibilityForGrouping:{},pinnedStartScrollListener:new mo,pinnedEndScrollListener:new mo,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null}}var zd=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,cellClassName:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,columnDefaultFlex:1,columnMenuRealignDelay:e=>e!=null?e:50,scrollStopDelay:e=>e!=null?e:250,viewportReservedWidth:e=>e!=null?e:0,resizableColumns:e=>e!=null?e:!0,rowDetailCache:e=>new uo(e),hideColumnWhenGrouped:e=>e!=null?e:!1,columnMinWidth:e=>e!=null?e:30,columnMaxWidth:e=>e!=null?e:5e3,columnDefaultWidth:e=>e!=null?e:200,columnCssEllipsis:e=>e!=null?e:!0,draggableColumns:e=>e!=null?e:!0,headerOptions:e=>C({alwaysReserveSpaceForSortIcon:!0},e),showSeparatePivotColumnForSingleAggregation:e=>e!=null?e:!1,sortable:1,hideEmptyGroupColumns:e=>e!=null?e:!1,pivotTotalColumnPosition:e=>e!=null?e:"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e||"",keyboardSelection:e=>e!=null?e:!0,activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e!=null?e:!0,header:e=>e!=null?e:!0,showZebraRows:e=>e!=null?e:!0,showHoverRows:e=>e!=null?e:!0,virtualizeColumns:e=>e!=null?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!=null?e:{},columnSizing:e=>e||{},columnTypes:e=>e||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:e=>e!=null?e:"replace",collapsedColumnGroups:e=>e!=null?e:new Map,columnGroups:1});function PC(o){let{groupBy:e,groupColumn:t,groupRenderStrategy:n}=o;return n||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Ld=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.onRenderUpdater.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Gd(o){return o.reduce((e,t,n)=>{let r={groupBy:t,groupIndex:n};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var xr=new WeakMap;function Hd(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Nd=o=>{var h,g,y,T,S;let{props:e,state:t,oldState:n,parentState:r}=o,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=(n==null?void 0:n.columnGroups)||t.pivotColumnGroups&&t.pivotColumnGroups!=(n==null?void 0:n.pivotColumnGroups)?Fd(i):t.columnGroupsDepthsMap,l=r==null?void 0:r.groupBy,s=PC({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=(h=e.components)==null?void 0:h.RowDetail;if(!c&&d){let b=xr.get(d);b||(b=Od(d),xr.set(d,b)),c=b}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof Je)&&(u=new Je(u)),u=u||new Je({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=xr.get(u),f||(f=b=>u.isRowDetailsExpanded(b.id),typeof u=="object"&&xr.set(u,f)));let m=c?e.isRowDetailEnabled||!0:!1;return{rowDetailRenderer:c,rowDetailState:u,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:(g=e.showColumnFilters)!=null?g:!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:(y=e.keyboardNavigation)!=null?y:t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell",columnHeaderCssEllipsis:(S=(T=e.columnHeaderCssEllipsis)!=null?T:e.columnCssEllipsis)!=null?S:!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),0):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||fe.components.Header.columnHeaderHeight:""}};function Kd(o,e){let t={};return Object.keys(o).forEach(n=>{let r=o[n],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[n]=r)}),t}function kd(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l=C({},o.columnVisibility);if(!e)return Object.keys(n).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,u=0,c=r.length;for(let d=0;d<c;d++){let p=r[d],f=i[p];if(f.isGroupRow&&(u=Math.max(u,f.groupNesting-1),u===s-1))break}return Object.keys(n).forEach(d=>{let p=n[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}import{useCallback as DC}from"react";function Ca(){let{getState:o,componentActions:e,getDataSourceMasterContext:t}=me();return DC(r=>{let i=o(),a=new Xe(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Nt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s!=null&&s.cache||an(i.data,i,e,{groupKeys:r},t()):s!=null&&s.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=ae.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=it())}},[])}function AC(o){return EC(()=>Gd(o),[o])}function Bd(){let{componentState:{groupBy:o},componentActions:e}=me(),{componentState:{groupRenderStrategy:t,pivotTotalColumnPosition:n,pivotGrandTotalColumnPosition:r}}=ve();Fn(()=>{e.generateGroupRows=t!=="inline"},[t]),Fn(()=>{e.pivotTotalColumnPosition=n},[n]),Fn(()=>{r!=null&&(e.pivotGrandTotalColumnPosition=r)},[r]);let i=AC(o);FC(i);let{toggleGroupRow:a}=_C();return OC(i),{toggleGroupRow:a}}function FC(o){let e=Ca(),{componentActions:t,componentState:{columns:n,groupRenderStrategy:r}}=ve();function i(a,l,s,u){let c={};if(s==="inline")return Object.keys(a).forEach(d=>{var g,y;let p=a[d],f={},m=l.get(p.field);if(m&&s==="inline"){let{groupIndex:T}=m;f={groupByForColumn:m.groupBy,field:(g=m.groupBy)==null?void 0:g.field,valueGetter:(y=m.groupBy)==null?void 0:y.valueGetter,valueFormatter:({rowInfo:S})=>{var b;return S.isGroupRow?(b=S.groupKeys)==null?void 0:b[T]:S.value},rowspan:({rowInfo:S,dataArray:b})=>{if(!S.isGroupRow)return 1;let w=b[S.indexInAll-1]||{indexInParentGroups:[]};if(!w||!w.dataSourceHasGrouping)return 1;let v=w.indexInParentGroups||[],I=S.indexInParentGroups||[],R=!1;for(let P=0;P<=T;P++){let V=v[P];if(I[P]!==V){R=!0;break}}if(!R)return 1;let x=S.parents[T];return x?x.groupCount-(x.collapsedChildrenCount||0)+(x.collapsedGroupsCount||0):1},renderGroupIcon:rr({groupIndexForColumn:T,groupRenderStrategy:s,toggleGroupRow:u,initialRenderGroupIcon:p.renderGroupIcon}),render:or({groupIndexForColumn:T,groupRenderStrategy:s})}}let h=C(C({},f),p);c[d]=h}),Object.keys(c).length===0?void 0:c}Fn(()=>{(()=>{t.columnsWhenInlineGroupRenderStrategy=i(n,o,r,e)})()},[n,o,r,e])}function _C(){let{componentState:{groupBy:o,pivotBy:e,selectionMode:t}}=me(),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=ve(),f=Ca();return Fn(()=>{(()=>{let{columns:h,groupColumnIds:g}=VC({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=h;let y=p().columnOrder;if(g.length&&Array.isArray(y)){let T=new Set(y),S=!1;g.forEach(b=>{T.has(b)||(S=!0,y=[b,...y])}),S&&(n.columnOrder=y)}})()},[r,o,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function OC(o){let{componentState:{dataArray:e,groupRowsIndexesInDataArray:t,groupBy:n,groupRowsState:r,originalLazyGroupDataChangeDetect:i},getState:a}=me(),{getComponentState:l,componentActions:s,componentState:{columnTypes:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}}=ve();MC(()=>{if(f!=="multi-column")return;let m=l(),h=Kd(c,o),g=kd({computedGroupColumns:h,columnVisibility:m.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:t,dataArray:e,groupBy:n,groupByMap:o});Vt(m.columnVisibility,g)||(s.columnVisibility=g)},[a,f,i,n,o,c,p?e:null,p?r:null,p?t:null,p]),Fn(()=>{let m=n.length>0,h=l(),{columnVisibility:g,columnVisibilityForGrouping:y,hideColumnWhenGrouped:T}=h,S=C({},g),b=C({},y),w=!1,v=new Set,I=new Set;Object.keys(c).forEach(R=>{let x=c[R];if(x.defaultHiddenWhenGroupedBy||T!=null)if(x.defaultHiddenWhenGroupedBy==="*"&&m||(x.defaultHiddenWhenGroupedBy===!0||T)&&x.field&&o.get(x.field)||typeof x.defaultHiddenWhenGroupedBy=="string"&&o.get(x.defaultHiddenWhenGroupedBy)||typeof x.defaultHiddenWhenGroupedBy=="object"&&Object.keys(x.defaultHiddenWhenGroupedBy).reduce((P,V)=>P||o.has(V),!1)){if(b[R]!==!1){if(g[R]===!1)return;b[R]=!1,w=!0,v.add(R)}}else b[R]===!1&&(delete b[R],w=!0,I.add(R))}),w&&(s.columnVisibilityForGrouping=b,I.forEach(R=>{delete S[R]}),v.forEach(R=>{S[R]=!1}),s.columnVisibility=S)},[c,u,n,o,d])}function VC(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=o;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,h,g)=>{let y=Bu({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:h,groupCount:g.length,groupRenderStrategy:u,selectionMode:r},c,i),T=y.id||`group-by-${m.field||m.groupField}`;f.push(T),p[T]=y});else if(u==="single-column"&&t.length){let m=Wu({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:u,selectionMode:r},c,i),h=m.id||"group-by";f.push(h),p[h]=m}if(e){let m={};Object.keys(d).forEach(h=>{let g=d[h];g.field&&(m[g.field]=g)}),Object.keys(e).forEach(h=>{var b,w;let g=e[h],y=g.pivotTotalColumn&&g.columnGroup,T=g.pivotTotalColumn&&!g.columnGroup;if(y&&a===!1||T&&l===!1)return;let S=C({},g);if(s&&(typeof s=="function"?S=C(C({},S),s({column:S,pivotBy:n,groupBy:t})):S=C(C({},S),s)),S.inheritFromColumn!==!1){let v=typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:(b=S.pivotAggregator)!=null&&b.field?m[(w=S.pivotAggregator)==null?void 0:w.field]:void 0;S=C(C({},v),S)}!S.render&&S.renderValue&&(S.render=v=>S.renderValue(v)),p[h]=S})}else Object.keys(d).forEach(m=>{let h=d[m];p[m]=h});return{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}import{useMemo as zC}from"react";var Wd=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:u,sortInfo:c,multiSort:d,filterValue:p,filterTypes:f,columnOrder:m,columnPinning:h,editable:g,columnDefaultEditable:y,columnDefaultFilterable:T,columnDefaultSortable:S,scrollbarWidth:b,columnTypes:w,pinnedEndMaxWidth:v,pinnedStartMaxWidth:I,viewportReservedWidth:R,resizableColumns:x,columnVisibility:E,columnVisibilityAssumeVisible:P,columnSizing:V})=>{let{computedRemainingSpace:F,computedColumnOrder:M,computedVisibleColumns:A,computedVisibleColumnsMap:_,computedPinnedStartColumns:H,computedPinnedEndColumns:G,computedUnpinnedColumns:J,computedPinnedStartColumnsWidth:U,computedPinnedEndColumnsWidth:$,computedUnpinnedColumnsWidth:ee,computedUnpinnedOffset:N,computedPinnedEndOffset:k,computedPinnedEndWidth:Y,computedPinnedStartWidth:O,renderSelectionCheckBox:B,computedColumnsMap:L,computedColumnsMapInInitialOrder:W,fieldsToColumn:te}=zC(()=>cu({columns:o,scrollbarWidth:b,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:R,resizableColumns:x,filterValue:p,filterTypes:f,sortable:a,sortInfo:c,multiSort:d,pinnedEndMaxWidth:v,pinnedStartMaxWidth:I,draggableColumns:u,columnOrder:m,columnPinning:h,columnDefaultEditable:y,columnDefaultFilterable:T,columnDefaultSortable:S,editable:g,columnSizing:V,columnTypes:w,columnVisibility:E,columnVisibilityAssumeVisible:P!=null?P:!0}),[o,e.width,t,n,r,R,b,a,c,d,p,f,m,E,P,x,v,I,V,w,h,y,T,g,1]);return{renderSelectionCheckBox:B,columns:o,computedColumnsMap:L,computedPinnedEndWidth:Y,computedPinnedStartWidth:O,computedRemainingSpace:F,computedUnpinnedOffset:N,computedPinnedEndOffset:k,computedPinnedStartColumnsWidth:U,computedPinnedEndColumnsWidth:$,computedUnpinnedColumnsWidth:ee,computedPinnedStartColumns:H,computedPinnedEndColumns:G,computedUnpinnedColumns:J,computedVisibleColumns:A,computedVisibleColumnsMap:_,computedColumnOrder:M,computedColumnsMapInInitialOrder:W,fieldsToColumn:te}};import{useMemo as LC}from"react";var Sa=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>{var t;return(t=this.rowHeight.get(e))!=null?t:0};this.getRowDetailHeight=e=>{var t;return(t=this.rowDetailHeight.get(e))!=null?t:0}}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),n=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:n,totalRowHeight:t+n}}};function GC(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?n(d):0;return e&&e.rowHeight.set(c,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return c=>{if(e&&e.rowHeight.has(c)&&e.rowDetailHeight.has(c))return e.rowHeight.get(c)+e.rowDetailHeight.get(c);let d=a().dataArray[c];if(!d)return e&&(e.rowHeight.set(c,0),e.rowDetailHeight.set(c,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,m)),p+m}}function jd(o){return LC(()=>{let e=new Sa;return{computedRowHeight:GC(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}},[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}import{useState as HC,useEffect as NC,useLayoutEffect as KC}from"react";var kC={vertical:!1,horizontal:!1};function $d(o){let{getComponentState:e}=ve(),{getState:t}=me(),[n,r]=HC(kC);return NC(()=>o.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=o;r({vertical:i>0,horizontal:a>0})}),[o]),KC(()=>{let i=t(),{onScrollbarsChange:a}=e(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function Ud(){var lt;let{componentActions:o,componentState:e}=ve(),{componentActions:t,componentState:n,getState:r,api:i}=me(),{columnOrder:a,columnVisibility:l,columnPinning:s,columnSizing:u,editable:c,columnDefaultEditable:d,columnDefaultFilterable:p,columnTypes:f,rowHeight:m,rowDetailHeight:h,isRowDetailExpanded:g,isRowDetailEnabled:y,brain:T,bodySize:S,showSeparatePivotColumnForSingleAggregation:b}=e;ya(()=>{e.onRowHeightCSSVarChange.onChange(Ce=>{Ce&&(o.rowHeight=Ce)}),e.onRowDetailHeightCSSVarChange.onChange(Ce=>{Ce&&(o.rowDetailHeight=Ce)}),e.onColumnHeaderHeightCSSVarChange.onChange(Ce=>{Ce&&(o.columnHeaderHeight=Ce)})}),BC(()=>{t.showSeparatePivotColumnForSingleAggregation=b},[b]);let{multiSort:w,filterValue:v,filterTypes:I}=n,{toggleGroupRow:R}=Bd(),x=e.computedColumns,{computedColumnOrder:E,computedVisibleColumns:P,computedVisibleColumnsMap:V,computedPinnedStartColumns:z,computedPinnedEndColumns:F,computedUnpinnedColumns:M,computedPinnedStartColumnsWidth:A,computedPinnedEndColumnsWidth:_,computedUnpinnedColumnsWidth:H,computedUnpinnedOffset:G,computedPinnedEndOffset:J,computedRemainingSpace:U,computedPinnedStartWidth:$,computedPinnedEndWidth:ee,renderSelectionCheckBox:N,computedColumnsMap:k,computedColumnsMapInInitialOrder:Y,fieldsToColumn:O}=Wd({columns:x,scrollbarWidth:void 0,columnCssEllipsis:e.columnCssEllipsis,columnHeaderCssEllipsis:e.columnHeaderCssEllipsis,columnMinWidth:e.columnMinWidth,columnMaxWidth:e.columnMaxWidth,columnDefaultWidth:e.columnDefaultWidth,columnDefaultFlex:e.columnDefaultFlex,columnDefaultSortable:e.columnDefaultSortable,pinnedStartMaxWidth:e.pinnedStartMaxWidth,pinnedEndMaxWidth:e.pinnedEndMaxWidth,bodySize:S,viewportReservedWidth:e.viewportReservedWidth,resizableColumns:e.resizableColumns,sortable:e.sortable,draggableColumns:e.draggableColumns,sortInfo:(lt=n.sortInfo)!=null?lt:void 0,multiSort:w,columnOrder:a,columnVisibility:l,columnVisibilityAssumeVisible:!0,columnPinning:s,editable:c,columnDefaultEditable:d,columnDefaultFilterable:p,filterValue:v,filterTypes:I,columnSizing:u,columnTypes:f}),B=Ed(P),L=Ad(P),W=$d(T),te=$?A>$:!1,X=ee?_>ee:!1,[ne]=ya(()=>new Ir({getIdForIndex:De=>r().dataArray[De].id})),ge=Oe(P),[ye]=ya(()=>new wr({getPrimaryKeyByIndex:i.getPrimaryKeyByIndex,getColumnIdByIndex:Ce=>{var De;return((De=ge()[Ce])==null?void 0:De.id)||""}})),{computedRowHeight:ke,computedRowSizeCacheForDetails:je}=jd({rowDetailHeight:h,rowHeight:m,isRowDetailsExpanded:g,isRowDetailsEnabled:y,getDataSourceState:r});return{multiRowSelector:ne,multiCellSelector:ye,computedRowSizeCacheForDetails:je,computedRowHeight:ke,scrollbars:W,columnSize:L,rowspan:B,toggleGroupRow:R,computedColumnsMap:k,computedColumnsMapInInitialOrder:Y,renderSelectionCheckBox:N,computedPinnedStartOverflow:te,computedPinnedEndOverflow:X,computedPinnedStartWidth:$,computedPinnedEndWidth:ee,computedVisibleColumns:P,computedColumnOrder:E,computedRemainingSpace:U,computedVisibleColumnsMap:V,computedPinnedStartColumns:z,computedPinnedEndColumns:F,computedUnpinnedColumns:M,computedPinnedStartColumnsWidth:A,computedPinnedEndColumnsWidth:_,computedUnpinnedColumnsWidth:H,computedUnpinnedOffset:G,computedPinnedEndOffset:J,fieldsToColumn:O}}import{useMemo as XC}from"react";function WC(o=3988292384){var e=new Array,t,n,r;for(t=0;t<256;t++){for(r=t,n=8;n>0;n--)(r&1)==1?r=r>>>1^o:r=r>>>1;e[t]=r}return e}function jC(){return 4294967295}function $C(o,e,t){return e=e>>>8^o[t^e&255],e}function UC(o){return o=~o,o=o<0?4294967295+o+1:o,o}function Ta(o,e=3988292384){var t=WC(e),n=0,r;for(n=jC(),r=0;r<o.length;r++)n=$C(t,n,o.charCodeAt(r));return n=UC(n),`${n}`}var YC=o=>{var n;let e=o.reduce((r,i)=>(r.set(i.name,i.value),r),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:(n=e.get("Ref"))!=null?n:""}},Yd=(o,e=console.error.bind(console))=>{o=["* * * infinite-table.com * * *",...o];let t=Math.max(Math.max(...o.map(n=>n.length))+4*2,60);o.forEach(n=>{let r=(t-n.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+n+" "+"*".repeat(l))}),e("*".repeat(t))},qd=(o="",e,t)=>{let n;try{n=qC(o)}catch(a){return Yd(["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(n.end);return i<r?(Yd([`
2
2
  Your Infinite Table license has expired on ${i.toDateString()}.
3
- `,`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},VC=o=>{let e="",t=o.split("|").map(l=>{let[s,u]=l.split("=");return s==="C"&&(e=u),{name:s,value:u}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let u=t[s];if(Ca(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Ca(a)!==r)throw"Invalid license";return t=t.map(l=>P(C({},l),{value:decodeURI(l.value)})),OC(t)};var GC=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,LC=/(https):\/\/\S+(\.csb\.app)/g,Wd=typeof window!="undefined"?window.location.origin:"",HC=()=>{let[o,e,t]=Array.from(GC.exec(Wd)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},NC=()=>{let[o,e,t]=Array.from(LC.exec(Wd)||[]);return e==="https"&&t===".csb.app"},KC=NC()||HC(),jd=(o="")=>{let t=!!ze();return zC(()=>{if(t)return!0;let r=Bd(o,{publishedAt:1624970570587,version:"4.1.1"});return!o&&!r&&KC?!0:r},[o,t])};import{useRef as $d,useEffect as Ud}from"react";var kC=10;function Yd(o,e,t){let n=$d(!1),r=$d(null);Ud(()=>{o!=null&&(n.current=!1,tt(r.current))},[o]),Ud(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,tt(r.current),r.current=be(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<kC&&a(l)})};var i=a;a()}return()=>{tt(r.current)}},[o,e])}import{useRef as qd,useEffect as Xd}from"react";var BC=10;function Zd(o,e,t){let n=qd(!1),r=qd(null);Xd(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),Xd(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<BC&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}var Jd=o=>`--infinite-${o}`;import{useCallback as nS,useMemo as oS,useEffect as rS}from"react";function Qd(o,e){var t,n;Sa(o,e),jC(o,e),e.detail===2&&WC(o,e),(n=(t=o.getState()).onCellClick)==null||n.call(t,o,e)}function WC(o,e){let n=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:n.id})}function jC(o,e){let{getDataSourceState:t,getComputed:n,rowIndex:r,colIndex:i,dataSourceActions:a}=o,l=t(),{selectionMode:s,cellSelection:u}=l;if(!u||s!=="multi-cell")return;let{multiCellSelector:c}=n(),d=new Ae(u);c.cellSelectionState=d;let p={rowIndex:r,colIndex:i};e.metaKey||e.ctrlKey?c.singleAddClick(p):e.shiftKey?c.multiSelectClick(p):c.resetClick(p),a.cellSelection=d}function Sa(o,e){let{rowIndex:t,getDataSourceState:n,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=o,{multiRowSelector:s,renderSelectionCheckBox:u}=r(),c=n(),{selectionMode:d,groupBy:p,dataArray:f}=c;if(p.length)return!1;if(d==="multi-row"){if(u&&!e.key)return!1;let{rowSelection:m}=c;if(m=l(m),s.rowSelectionState=m,m&&typeof m=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=m,!0}else if(d==="single-row"){let m=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(m):a.rowSelectionApi.selectRow(m)}return!1}function ep(o,e){e.detail!==2&&void 0}function Pt(o,e,t){return Math.min(Math.max(o,e),t)}function $C(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i}=o,{key:a}=e,l=n().dataArray,s=l.length,u=t(),{brain:c}=u,{activeRowIndex:d}=u;if(d==null)return!1;let{start:[p],end:[f]}=c.getRenderRange(),m=d,h=f-p-1,g=0,y=s-1,S={ArrowDown:()=>{d=Pt(d+1,g,y)},ArrowUp:()=>{d=Pt(d-1,g,y)},ArrowLeft:()=>{let b=l[d];return b&&b.isGroupRow?i.collapseGroupRow(b.groupKeys):b&&i.rowDetailApi.isRowDetailEnabledForRow(b.id)?i.rowDetailApi.collapseRowDetail(b.id):!1},ArrowRight:()=>{let b=l[d];return b&&b.isGroupRow?i.expandGroupRow(b.groupKeys):b&&i.rowDetailApi.isRowDetailEnabledForRow(b.id)?i.rowDetailApi.expandRowDetail(b.id):!1},Enter:()=>{let b=l[d];return b&&b.isGroupRow?i.toggleGroupRow(b.groupKeys):i.rowDetailApi.isRowDetailEnabledForRow(b.id)?i.rowDetailApi.toggleRowDetail(b.id):!1},PageDown:()=>{d=Math.min(d+h,s-1)},PageUp:()=>{d=Math.max(d-h,g)},End:()=>{d=y},Home:()=>{d=g}}[a];return S?(S(),m!==d?(r.activeRowIndex=d,!0):!1):!1}function UC(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,actions:a}=o,{key:l,shiftKey:s}=e,u=i().dataArray,c=n(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[h,g],end:[y,T]}=p.getRenderRange(),S=y-h-1,b=T-g-1,R=i().dataArray.length-1,v=r().computedVisibleColumns.length-1,I=0,w=0;f=Pt(f,0,R),m=Pt(m,0,v),a.activeCellIndex=[f,m];let x={ArrowDown:()=>{f=Pt(f+1,I,R)},ArrowUp:()=>{f=Pt(f-1,I,R)},ArrowLeft:()=>{m===w?(f!==I&&(m=v),x.ArrowUp()):m=Pt(m-1,w,v)},ArrowRight:()=>{m===v?(f!==R&&(m=w),x.ArrowDown()):m=Pt(m+1,w,v)},Enter:()=>{let D=u[f];return D&&D.isGroupRow?t.toggleGroupRow(D.groupKeys):D&&t.rowDetailApi.isRowDetailEnabledForRow(D.id)?t.rowDetailApi.toggleRowDetail(D.id):!1},PageDown:()=>{s?m=Math.min(m+b,v):f=Math.min(f+S,R)},PageUp:()=>{s?m=Math.max(m-b,w):f=Math.max(f-S,I)},End:()=>{s?m=v:f=R},Home:()=>{s?m=w:f=I}},M=x[l];return M?(M(),a.activeCellIndex=[f,m],!0):!1}var YC={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function tp(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!YC[t]?!1:i!=null&&l==="row"?$C(o,e):a!=null&&l==="cell"?UC(o,e):!1}var qC={Enter:!0," ":!0,a:!0};function np(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,api:i,cloneRowSelection:a}=o,{key:l,ctrlKey:s,metaKey:u}=e;if(!qC[l])return!1;let c=t(),d=n(),{activeRowIndex:p,activeCellIndex:f,keyboardNavigation:m,keyboardSelection:h}=c,{selectionMode:g,groupBy:y,rowSelection:T}=d;if(h===!1)return!1;let S=m==="row"&&p!=null?p:m==="cell"&&f!=null?f[0]:null,b=S!=null?d.dataArray[S]:null;if(!b||S==null)return!1;if(g==="single-row"&&l===" ")return i.rowSelectionApi.toggleRowSelection(b.id),!0;if(g!=="multi-row")return!1;if(l==="a"&&(s||u)){let R=a(T);return R.selectAll(),r.rowSelection=R,!0}if(l===" "){if(y.length)return b.isGroupRow&&b.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(b.groupKeys):i.rowSelectionApi.toggleRowSelection(b.id),!0;{let R=C({},e),{renderSelectionCheckBox:v}=o.getComputed();return v&&(R.metaKey=!1,R.ctrlKey=!0),Sa(P(C({},o),{rowIndex:S}),R)}}return!1}var op=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),rp=o=>Array.from(o.querySelectorAll(op)).filter(t=>!!t.offsetParent),Ir=o=>o.querySelector(op);var ap=Br(Oo());function ip(o,e=10,t=300){return _e(this,null,function*(){return new Promise((n,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!o()){setTimeout(a,e);return}n(!0)}a()})})}var XC=10,ZC=(o,e)=>o-e;function xr(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=n(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",h=Ne(p.id,e);return p.contentFocusable(P(C({column:p},wn({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext),{columnApi:h,api:i,dataSourceApi:a}))}function ya(o,e,t){let n=t.getState().editingCell;return JC(o,e,t,{isCellFocusable:xr,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function lp(o,e,t){var r;let n=(0,ap.default)(t,o+e,ZC);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:(r=t[n])!=null?r:null}globalThis.getNextCol=lp;function JC(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),u=o.rowIndex,c=o.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:lp(c,e,a),c===null){if(u+=e,u<0||u>=s.length)return null;continue}if(i({colIndex:c,rowIndex:u},t))return{colIndex:c,rowIndex:u}}return null}function sp(o){return _e(this,null,function*(){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=xr(e,o)?e:ya(e,-1,o);if(t){yield Ta([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;let r=Ir(n);r==null||r.focus()}})}function Ta(n,r){return _e(this,arguments,function*([o,e],t){let{api:i}=t;return new Promise((a,l)=>{let s=XC,u=null,c=!1;function d(p=0){p++,tt(u),u=be(()=>_e(this,null,function*(){if(c=i.scrollCellIntoView(o,e,{offset:30}),!c&&p<s&&d(p),c){try{yield ip(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(f){l(f);return}a(!0)}}))}d()})})}var QC=`.${Qt}`;function up(o,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,n=e.target,r=o.getState().scrollerDOMRef.current,i=document.activeElement===r||n===r;if(!r||i&&t===-1)return!1;let a=i?null:cn(n,QC),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:c}=o.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&xr({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:ya({rowIndex:l,colIndex:s},t,o);if(!u){if(t===-1)r.focus();else{let c=rp(document.body),d=o.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d),f=c[p+1];f==null||f.focus()}return!0}return Ta([u.rowIndex,u.colIndex],o).then(()=>{let c=o.getState().getDOMNodeForCell(u);if(!c)return;let d=Ir(c);d==null||d.focus()}),!0}var cp={control:"ctrl"},dp={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},eS={esc:"escape"},mp={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},fp=Object.keys(mp),ba=new Set(fp),tS=new Set(["shift","alt"]);function Ra(o,e){return Array.isArray(e)?e.some(t=>pp(o,t)):pp(o,e)}function pp(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>dp[p]),i=n.map(p=>cp[p]||dp[p]||eS[p]||p),a=i.filter(p=>ba.has(p)),l=i.filter(p=>!ba.has(p)),s=fp.reduce((p,f)=>(p[f]=mp[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let u=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(u.length<a.length||u.filter(f=>!tS.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||ba.has(t)||t==="meta"||cp[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}function hp(o,e){return _e(this,null,function*(){var r,i;let t=P(C({},o),{cloneRowSelection:c=>gr(c,o.getDataSourceState)});if(np(t,e)&&e.preventDefault(),(up(t,e)||!o.getState().focusedWithin&&tp(t,e))&&e.preventDefault(),e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:c}=o.getState();if(c){let[d,p]=c,f=o.getComputed().computedVisibleColumns[p];f.computedEditable&&o.api.startEdit({rowIndex:d,columnId:f.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&e.preventDefault()),(i=(r=o.getState()).onKeyDown)==null||i.call(r,o,e);let{keyboardShortcuts:n}=o.getState();if(n)try{for(var a=Cl(n),l,s,u;l=!(s=yield a.next()).done;l=!1){let c=s.value;if(!Ra(e,c.key)||c.when&&!(yield c.when(o)))continue;let d=yield c.handler(o,e);if(d&&d.stopNext)break}}catch(s){u=[s]}finally{try{l&&(s=a.return)&&(yield s.call(a))}finally{if(u)throw u[0]}}})}function iS(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=ne(),{getState:i,componentActions:a,api:l}=me();return oS(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneRowSelection:c=>gr(c,i)}),[o,e,i,a,t,l,n])}function aS(){let o=iS();rS(()=>{let e=o.getState().keyDown.onChange(a=>{hp(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],u=Ne(s.id,o);Qd(P(C({},o),{rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u}),P(C({},l),{key:""}))}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=o.getComputed().computedVisibleColumns[u],d=Ne(c.id,o);ep(P(C({},o),{rowIndex:s,colIndex:u,column:c,columnApi:d}),l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function lS(){let{getState:o}=ne();return{onKeyDown:nS(t=>{o().keyDown(t)},[])}}function gp(){return aS(),lS()}import{useEffect as kp}from"react";import*as Pe from"react";import{useCallback as Ia,useEffect as dS,useLayoutEffect as pS,useState as Pr}from"react";import{createPortal as mS}from"react-dom";var Ee=class{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new Ee(e)}static from(e){return new Ee(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,n=e.left-this.left;return{top:t,left:n}}};function Cp(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Sp(o,e){return Math.sqrt(kr(e.top-o.top,2)+kr(e.left-o.left,2))}function sS(o,e,t){let n=Cp(o,t),r=Cp(e,t);return n===r?Sp(t,e)-Sp(t,o):n-r}function uS(o){if(o.length<3)return o;let[...e]=o,t={top:0,left:0};return o.forEach(n=>{t.top+=n.top,t.left+=n.left}),t.top/=o.length,t.left/=o.length,e.sort((n,r)=>sS(n,r,t)),e}function yp(o,e){o=uS(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(cS([t,i,a],e))return!0}return!1}function cS(o,e){let[t,n,r]=o,i=e,a=(n.left-t.left)*(r.top-t.top)-(n.top-t.top)*(r.left-t.left);return a*((n.left-t.left)*(i.top-t.top)-(n.top-t.top)*(i.left-t.left))>=0&&a*((r.left-n.left)*(i.top-n.top)-(r.top-n.top)*(i.left-n.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var _n=class{containsPoint(e){return yp(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let n=0,r=t.length;n<r;n++)if(!this.containsPoint(t[n]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let n=e.getPoints();for(let r=0,i=n.length;r<i;r++)if(this.containsPoint(n[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var Kt=class extends _n{constructor(t){super();this.points=t.map(Ee.clone)}static clone(t){return new Kt(t)}getPoints(){return this.points}shift(t){return this.points.forEach(n=>{n.shift(t)}),this}};var Re=class extends _n{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 Re(t)}static clone(t){return new Re(t)}static from(t){return Re.clone(t)}static fromPoint(t){return Re.from({top:t.top,left:t.left,width:0,height:0})}containsPoint(t){return new Kt(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}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Ee.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};function wa(o){return!!o.tagName}function Rp(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=Re.from(wa(e)?e.getBoundingClientRect():e),a=Re.from(wa(t)?t.getBoundingClientRect():t),l=n?Re.from(wa(n)?n.getBoundingClientRect():n):null;if(!l){let u=Tp({anchorRect:a,targetRect:i,position:r[0]});return P(C({},u),{index:0})}let s=null;for(let u=0,c=r.length;u<c;u++){let d=Tp({anchorRect:a,targetRect:i,position:r[u],constrainRect:l});if(u===0&&(s=P(C({},d),{index:0})),d.valid)return P(C({},d),{index:u})}return s}function Tp(o){let e=Re.from(o.targetRect),t=Re.from(o.anchorRect),n=o.constrainRect?Re.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=bp(e,i),s=bp(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function bp(o,e){return e==="TopLeft"?Ee.from({top:o.top,left:o.left}):e==="TopCenter"?Ee.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?Ee.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?Ee.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?Ee.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?Ee.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?Ee.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?Ee.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Ee.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}var vr="__is_infinite_menu_component";function fS(o){return o&&typeof o.then=="function"||o instanceof Promise}function xp(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}function wp(o){return _e(this,null,function*(){return typeof o=="function"&&(o=o()),fS(o)&&(o=yield o),typeof o=="string"&&(o=document.querySelector(o)),o&&xp(o)&&(o=o.getBoundingClientRect()),o?Re.from(o):null})}function hS(o){return _e(this,null,function*(){let e=null;typeof o=="function"?e=o():e=o;function t(n){let r=null;return typeof n=="string"&&(r=document.querySelector(n)),xp(n)&&(r=n),r||null}return t(yield e)})}function gS(o){return Pe.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function CS(o){let e=Pe.useRef(null);return dS(()=>o.realign.onChange(t=>{e.current&&t&&Ip(e.current,t)}),[o.realign]),Pe.createElement("div",{style:{position:"absolute",top:0,left:0},ref:Ia(t=>{t&&Ip(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}function Ip(o,e){return _e(this,null,function*(){let{constrainTo:t,alignTo:n,alignPosition:r}=e;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n=P(C({},n),{width:0,height:0})),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&(yield wp(t))||void 0,a=n?yield wp(n):void 0,l=Re.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Rp({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=o.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=o.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,h=s.top-f;o.style.transform=`translate3d(${m}px,${h}px, 0px)`}}})}function SS(o,e){let[t,n]=Pr(null);return pS(()=>{function r(){return _e(this,null,function*(){let i=e?yield hS(e):null;i!=null&&n(i)})}e&&r()},[e]),e?t?mS(o,t):Pe.createElement(Pe.Fragment,null):e===null||e===!1?o:Pe.createElement(gS,null,o)}function yS(o){if(Pe.Children.count(o)===1){let e=Pe.Children.only(o);if(Pe.isValidElement(e))return e.props.id||e.key}return null}function TS(o,e,t){if(Pe.Children.count(o)===1){let n=Pe.Children.only(o);if(Pe.isValidElement(n)&&n.type[vr]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Pe.cloneElement(n,r)}}return o}globalThis.allhandles={};globalThis.thehandles={};function Dt(o){let e=o,[t]=Pr(()=>new Map),[n,r]=Pr(null),[i,a]=Pr(0),l=Ia(()=>{let m=[];for(let[h,g]of t)m.push(Pe.createElement(CS,P(C({},g),{key:g.key})));return m},[]),[s,u]=pt(),c=SS(l(),o.portalContainer),d=Ia((m,h)=>{let y=`${h.id||yS(m)||rt()}`,T=t.get(y),S=()=>{var R;let b=typeof m=="function"?m():m;return TS(b,e.portalContainer,(R=h.constrainTo)!=null?R:e.constrainTo)};if(T){Object.assign(T,h,{children:S}),u(),r(T.key),a(Date.now());return}return T={key:y,children:S,alignPosition:h.alignPosition,alignTo:h.alignTo,constrainTo:h.constrainTo,realign:we()},t.set(T.key,T),u(),()=>u()},[t,e.portalContainer,u]);Pe.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return Pe.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}import*as Np from"react";import*as Vn from"react";import*as On from"react";import*as fo from"react";function Dr(o){return null}Dr.defaultProps={__is_menu_item:!0};var vp="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw16 _16lm1iw1m _16lm1iw8",Pp=Se({defaultClassName:"db3arf2 _16lm1iwz _16lm1iw1q _16lm1iw17",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwj _16lm1iw17",false:"_16lm1iwi"},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"]]}),Dp="db3arf1",Mp="db3arfd";var bS="-";function RS(){return fo.createElement("hr",{className:Mp})}var Mr=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===bS?fo.createElement(RS,null):r:null;return i!=null?{type:"item",parentMenuId:n,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:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}};function Ep(o,e){return fo.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Dr)){let n=C({},t.props);return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),Mr(o,n)}return Mr(o,t)})||[]}var Ap="submenu";function Fp(){let o=On.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:rt(),focused:!1,destroyed:!1,domRef:o}}var _p=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),wS=[{name:"label"}],Op=o=>{let{props:e,state:t}=o,{activeItemKey:n,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,u=e.id||t.generatedId;s&&(u=`${s}-${u}`);let c=[...e.columns||wS],d={columns:c,keyboardActiveItemKey:r,activeItemKey:n,menuId:u},p=[];i?p=i.map(Mr.bind(null,d)):!i&&typeof a!="function"&&(p=Ep(d,a)),l&&p.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!c.find(h=>h.name==Ap)&&c.push({name:Ap,render:({domProps:h,item:g})=>g.menu?On.createElement("div",C({},h),On.createElement(Rn,{expanded:!1})):On.createElement("div",C({},h))});let f=p.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:p,runtimeSelectableItems:f,columns:c,menuId:u}};import*as it from"react";import{useCallback as sn,useLayoutEffect as FS,useRef as _S,useState as Pa}from"react";var ho=class extends Kt{constructor(e){super(e.slice(0,3))}};var IS=250;function xS(o,e=100){let t=Date.now();return new Promise(n=>{let r,i=()=>{if(r=o(),r!==void 0){n(r);return}if(Date.now()-t>e){n(void 0);return}be(i)};be(()=>{i()})})}var vS=xe(),Er=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||IS;this.getPointerMoveTarget=()=>document.documentElement||vS;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 Ee({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,c=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(c-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=c,(s?new ho([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new ho([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,xS(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(n=>{this.activeItem==e&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(e,t,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Ee({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,n.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 PS,useContext as DS}from"react";var xa=PS(null);function va(){return DS(xa)}import{useCallback as MS,useEffect as ES,useRef as AS}from"react";function Vp(){let o=AS(!0);return ES(()=>(o.current=!0,()=>{o.current=!1}),[]),MS(()=>o.current,[])}function OS(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,u=`${t}-submenu`,c=o.menu;return c?(typeof c=="function"&&(c=c()),it.createElement(gt,P(C({key:u,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a},c),{autoFocus:!1,onShow:(d,p)=>{var f;(f=c==null?void 0:c.onShow)==null||f.call(c,d,p),n(p)},onHideIntent:d=>{var p;(p=c==null?void 0:c.onHideIntent)==null||p.call(c,d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}}))):null}function VS(o,e){var a;let t=zp(o,e);if(!t.length)return null;let n=Re.from((a=t[0])==null?void 0:a.getBoundingClientRect()),r=Re.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function zp(o,e){let t=cn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${o}"]`);if(!t)return[];let n=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(n)}function zS(o,e){let t=zp(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}function GS({onItemActivate:o}){let{getState:e}=va(),[{onItemEnter:t,onItemLeave:n}]=Pa(()=>new Er({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){o(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];o(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:sn(t,[]),onItemLeave:sn(n,[])}}function Gp(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:u,wrapLabels:c,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:h},componentActions:g,getState:y}=va(),T=sn(H=>{g.keyboardActiveItemKey=H},[]),S=sn(H=>{g.activeItemKey=H},[]),b=Vp(),[R,v]=Pa(null),I=null;FS(()=>{let{runtimeItems:H}=y(),B=H.filter($=>$.type==="item"&&i===$.key)[0];if(!B||!B.menu){v(null),D();return}if(B){let $=VS(r,B.key);$&&x(()=>OS(B,{constrainTo:l,setSubmenuApi:v,setActiveItemKey:S,setKeyboardActiveItemKey:T,parentMenuId:r,onHideIntent:Z,api:re}),{id:`${r}-submenu`,alignTo:$,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let w=(H,B)=>{T(B.key),S(B.key),B.originalMenuItem.onClick&&B.originalMenuItem.onClick(H);let $={key:B.key,item:B.originalMenuItem,hideMenu:Z};B.originalMenuItem.onAction&&B.originalMenuItem.onAction($),u&&u($),B.originalMenuItem.hideMenuOnAction&&Z()},{showOverlay:x,portal:M,clearAll:D}=Dt({portalContainer:!1}),{onItemEnter:V,onItemLeave:z}=GS({onItemActivate:H=>{if(!b())return;let B=H?H.key:null;S(B)}});I=n.map((H,B)=>it.createElement(LS,{key:H.type==="item"?H.key:B,onItemEnter:($,_)=>{V($.key,_)},onItemLeave:($,_)=>{z($.key,_)},columns:t,active:H.type==="item"&&H.key===i,keyboardActive:H.type==="item"&&H.key===a,item:H,index:B,onClick:w}));let F=t.map(H=>H.width||(typeof H.flex=="number"?`${H.flex}fr`:H.flex)||"auto").join(" "),E=P(C({},e.style),{gridTemplateColumns:F,gridTemplateRows:n.map(()=>"auto").join(" ")});c||(E.whiteSpace="nowrap");function A(H){let{runtimeItems:B,runtimeSelectableItems:$}=y(),_=B.findIndex(Y=>Y.type==="item"&&Y.key===a),k=a,G=B[_],W={ArrowUp:()=>{let Y=B.slice(0,_).filter(te=>te.type==="item"&&!te.disabled).pop();Y&&Y.type==="item"&&Y.key&&(k=Y.key)},ArrowDown:()=>{let Y=B.slice(_+1).filter(te=>te.type==="item"&&!te.disabled)[0];Y&&Y.type==="item"&&Y.key&&(k=Y.key)},Home:()=>{W.PageUp()},End:()=>{W.PageDown()},PageUp:()=>{k=$[0].key},PageDown:()=>{k=$[$.length-1].key},ArrowLeft:()=>{S(null),y().parentMenuId&&(g.destroyed=!0)},ArrowRight:()=>{G&&(S(G.key),be(()=>{b()&&R&&R.getParentMenuId()===y().menuId&&R.focus()}))},Enter:()=>{var Y;if(G)if((Y=G.originalMenuItem)!=null&&Y.menu){if(G&&G.originalMenuItem.menu&&R){W.ArrowLeft();return}G&&S(G.key)}else w(H,G)}," ":()=>{if(!G)return;G.originalMenuItem.menu||w(H,G);let Y=zS(r,G.key);Y&&Y.click()},Escape:()=>{var te;W.ArrowLeft();let Y=y();Y.parentMenuId||(te=Y.onHideIntent)==null||te.call(Y,Y)}},Q=W[H.key];Q&&(Q(),H.preventDefault()),k!=a&&T(k)}function O(){g.focused=!1}let L=sn(function(){g.focused=!0,setTimeout(()=>{var H,B;K.current&&h.current&&h.current===document.activeElement&&y().keyboardActiveItemKey==null&&T((B=(H=y().runtimeSelectableItems[0])==null?void 0:H.key)!=null?B:null)})},[]),K=_S(!0),Z=sn(()=>{var B;let H=y();(B=H.onHideIntent)==null||B.call(H,H)},[y]),[re]=Pa(()=>({hideMenu:Z,focus:()=>{h.current&&(h.current.focus(),setTimeout(()=>{h.current&&h.current!==document.activeElement&&h.current.focus()},10),L())},getMenuId:()=>y().menuId,getParentMenuId:()=>y().parentMenuId})),X=sn(H=>{H?(h.current=H,d==null||d(y(),re),f&&re.focus()):(p==null||p(y()),h.current=H)},[]),ee=it.createElement("div",{className:gn.contents},it.createElement("div",P(C({},e),{"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:X,onKeyDown:H=>{var B;(B=e.onKeyDown)==null||B.call(e,H),A(H)},onMouseDown:H=>{var B;K.current=!1,(B=e.onMouseDown)==null||B.call(e,H)},onMouseUp:H=>{var B;K.current=!0,(B=e.onMouseUp)==null||B.call(e,H)},onFocus:L,onBlur:O,className:J(vp,e.className,"InfiniteMenu"),style:E}),I),M);return s?null:ee}function LS(o){let[e,t]=it.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,u=null;if(r.type==="decoration")u=it.createElement("div",{style:r.style},r.value);else{let c=0;u=n.map((d,p)=>{let f=r.value,m=d.field||d.name,h=p+1,g=h+r.span;if(h<c)return null;c=g;let T={style:P(C(C({},d.style),r.style),{gridColumnStart:h,gridColumnEnd:g}),"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:J(Pp({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:S=>{var b;r.disabled||(b=o.onItemEnter)==null||b.call(o,r,S)},onPointerLeave:S=>{var b;r.disabled||(b=o.onItemLeave)==null||b.call(o,r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||o.onClick(S,r)}};return d.render?it.createElement(no,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:T}}):it.createElement("div",C({key:`${s}-${m}`},T),f[m])}).filter(Boolean)}return it.createElement("div",{className:Dp},u)}var HS=bt({initSetupState:Fp,forwardProps:_p,mapPropsToState:Op,layoutEffect:!0});function NS(o){let{componentActions:e,componentState:t}=ve(),n=Oe(t);return Vn.createElement(xa.Provider,{value:{componentActions:e,componentState:t,getState:n}},Vn.createElement(Gp,{domProps:o.domProps}))}function gt(o){let b=o,{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:u=!1,onAction:c,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:h,onHideIntent:g,__is_infinite_menu_component:y}=b,T=At(b,["children","portalContainer","items","parentMenuId","addSubmenuColumnIfNeeded","bubbleActionsFromSubmenus","onShow","onHide","wrapLabels","onAction","constrainTo","columns","parentMenuItemKey","autoFocus","id","onHideIntent","__is_infinite_menu_component"]);return Vn.createElement(HS,C({addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u},o),Vn.createElement(NS,{domProps:T}))}gt[vr]=!0;import*as Lp from"react";function Hp(o,e){let{columnApi:t,column:n,getComputed:r,api:i}=e,l=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{i.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{i.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{i.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...l,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{i.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{i.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{i.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((d,p)=>{let f=Xo(d,e);u.push({key:p,label:f,check:Lp.createElement(zt,{key:d.id,disabled:d.computedVisible&&i.getVisibleColumnsCount()===1,checked:d.computedVisible,onChange:m=>{let h=!!m;i.setVisibilityForColumn(d.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function Kp(o,e,t){var m;if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=(m=i==null?void 0:i.Menu)!=null?m:gt,s=n().computedColumnsMap.get(o);if(!s)return null;let u=C({column:s,columnApi:Ne(s.id,e)},e),c=Hp([],u),d=a?a(c,u):c,p=h=>{h.__insideMenu=!0},f=h=>{var g,y;(y=(g=h.domRef.current)==null?void 0:g.parentNode)==null||y.removeEventListener("mousedown",p)};return!d||!d.length?null:Np.createElement(l,{autoFocus:!0,items:d,onShow:h=>{var g,y;(y=(g=h.domRef.current)==null?void 0:g.parentNode)==null||y.addEventListener("mousedown",p)},onHide:f,onHideIntent:h=>{f(h),t==null||t()}})}var KS=`[${Ni["data-name"]}="${Ki["data-name"]}"]`;function kS(o){var d;let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){n(),a.columnMenuVisibleForColumnId=null}let c=o.target;if(c||(c=(d=l.current)!=null?d:void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let p=`[${mc["data-column-id"]}="${e}"] ${KS}`;c=i().domRef.current.querySelector(p)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Kp(e,t,u),{constrainTo:s.current,id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function Bp(){let o=ne(),e=ze(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=Dt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});kp(()=>{let{actions:u,getState:c}=o,d=c();return d.onColumnMenuClick.onChange(p=>{p&&(d.columnMenuTargetRef.current=p.target,u.contextMenuVisibleFor=null,u.cellContextMenuVisibleFor=null,u.filterOperatorMenuVisibleForColumnId=null,u.columnMenuVisibleForColumnId=p.column.id)})},[]);let{columnMenuVisibleForColumnId:l,columnMenuVisibleKey:s}=t();return kp(()=>{let{columnMenuVisibleForColumnId:u,columnMenuTargetRef:c}=t();if(u){let p=function(f){f.__insideMenu!==!0&&(a(),n.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),kS({columnId:u,context:o,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else c.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}import*as Wp from"react";import{useCallback as BS}from"react";var WS={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function jp(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=ne(),{getState:a,getDataSourceMasterContext:l}=me(),{focusDetectDOMRef:s}=o(),u=BS(()=>_e(this,null,function*(){sp({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})}),[]);return Wp.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:WS})}import{useEffect as go}from"react";function jS(){let o=ne(),{getState:e}=o,{editingCell:t}=e(),n=t&&!t.active?t.cancelled:void 0;go(()=>{if(n){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l==null||l(P(C({},Ye(C({rowIndex:r,columnId:i},o))),{initialValue:a}))}},[n])}function $S(){let o=ne(),{getState:e,state:{editingCell:t}}=o,n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;go(()=>{if(n){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s==null||s(P(C({},Ye(C({rowIndex:r,columnId:i},o))),{value:a,error:n,initialValue:l}))}},[n])}function US(){let o=ne(),{state:{editingCell:e}}=o,t=e==null?void 0:e.active,n=ko(t);go(()=>{!t&&n&&o.api.focus()},[t,n])}function YS(){let o=ne(),{state:{editingCell:e},getState:t}=o,n=e&&!e.active&&!e.cancelled&&e.accepted===!0;go(()=>{var r,i;if(n){let{editingCell:a}=t(),{value:l,rowIndex:s,columnId:u,initialValue:c}=a,d=P(C({},Ye(C({rowIndex:s,columnId:u},o))),{value:l,initialValue:c});(i=(r=t()).onEditAccepted)==null||i.call(r,d),o.api.persistEdit({value:l})}},[n])}function qS(){let o=ne(),{state:{editingCell:e},getState:t}=o,n=e?e.persisted:void 0;go(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:u,initialValue:c}=r,d=P(C({},Ye(C({rowIndex:l,columnId:s},o))),{value:u,initialValue:c});n instanceof Error?i==null||i(P(C({},d),{error:n})):a==null||a(d)}},[n])}function $p(){jS(),$S(),YS(),qS(),US()}import{useEffect as Xp}from"react";import*as kt from"react";import*as Da from"react";var Up=o=>Da.createElement(Me,C({},o),Da.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 Ma from"react";var Yp=o=>Ma.createElement(Me,C({},o),Ma.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 qp(o,e,t){var I;if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:u}=e,{components:c,getFilterOperatorMenuItems:d}=r(),p=(I=c==null?void 0:c.Menu)!=null?I:gt,f=n().computedColumnsMap.get(o);if(!f)return null;let m=w=>{w.__insideMenu=!0},h=w=>{var x,M;(M=(x=w.domRef.current)==null?void 0:x.parentNode)==null||M.removeEventListener("mousedown",m)},{filterTypes:g}=i(),y=g[f.computedFilterType];if(!y)return null;let T=y.operators.map(w=>{var V,z,F;let x=w.name,M=f.computedFilterValue?f.computedFilterValue.filter.operator===x:x===y.defaultOperator,D=(z=(V=w.components)==null?void 0:V.Icon)!=null?z:yn;return{key:x,icon:kt.createElement(D,null),label:kt.createElement(kt.Fragment,null,(F=w.label)!=null?F:w.name),onAction:()=>{u.setColumnFilterOperator(o,x)},checked:M?kt.createElement(Yp,{size:16}):null}}),b=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{u.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:kt.createElement(Up,null),disabled:!f.computedFiltered,onAction:()=>{u.clearColumnFilter(o)}},"-"],...T],R={column:f,api:u,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:g},v=d?d(b,R):b;return kt.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:v,onShow:w=>{var x,M;(M=(x=w.domRef.current)==null?void 0:x.parentNode)==null||M.addEventListener("mousedown",m)},onHide:h,onHideIntent:w=>{h(w),t==null||t()}})}var Ar=10;function Zp(){let o=ne(),e=ze(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=Dt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Xp(()=>{let{actions:l,getState:s}=o;return s().onFilterOperatorMenuClick.onChange(c=>{if(!c)return;let{target:d,column:p}=c;function f(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=(d==null?void 0:d.parentElement)||d,h=Re.from(m.getBoundingClientRect());h.top-=Ar,h.left-=Ar,h.width+=2*Ar,h.height+=2*Ar,r(()=>qp(p.id,o,f),{constrainTo:s().domRef.current,id:"filter-operator-menu",alignTo:h,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),l.contextMenuVisibleFor=null,l.cellContextMenuVisibleFor=null,l.columnMenuVisibleForColumnId=null,l.filterOperatorMenuVisibleForColumnId=p.id})},[]),Xp(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}import{useEffect as Fr}from"react";import*as Ea from"react";function Jp(o,e,t){var S;let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:u}=l(),c=(S=s==null?void 0:s.Menu)!=null?S:gt,{computedColumnsMap:d}=a(),p=d.get(n),f=P(C({},Ye(P(C({},e),{rowIndex:r,columnId:p.id}))),{event:i});if(!p||!u)return{cellContext:f,menu:null,preventDefault:!1};let m=u(f,e),h=m?Array.isArray(m)?m:m.items:null,g=m&&!Array.isArray(m)?m.columns:void 0,y=b=>{b.__insideMenu=!0},T=b=>{var R,v;(v=(R=b.domRef.current)==null?void 0:R.parentNode)==null||v.removeEventListener("mousedown",y)};return!h||!h.length?{cellContext:f,menu:null,preventDefault:Array.isArray(h)}:{preventDefault:!0,menu:Ea.createElement(c,{columns:g,autoFocus:!0,items:h,onShow:b=>{var R,v;(v=(R=b.domRef.current)==null?void 0:R.parentNode)==null||v.addEventListener("mousedown",y)},onHide:T,onHideIntent:b=>{T(b),t==null||t()}}),cellContext:f}}function Qp(o,e,t){var g;let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=(g=i==null?void 0:i.Menu)!=null?g:gt,{computedColumnsMap:s}=r(),u=o.columnId?s.get(o.columnId):void 0,c=u?C(C({},o),Ye(P(C({},e),{rowIndex:o.rowIndex,columnId:u.id}))):o;if(!a)return{cellContext:c,menu:null,preventDefault:!1};let d=a(c,e),p=d?Array.isArray(d)?d:d.items:null,f=d&&!Array.isArray(d)?d.columns:void 0,m=y=>{y.__insideMenu=!0},h=y=>{var T,S;(S=(T=y.domRef.current)==null?void 0:T.parentNode)==null||S.removeEventListener("mousedown",m)};return!p||!p.length?{cellContext:c,menu:null,preventDefault:Array.isArray(p)}:{preventDefault:!0,menu:Ea.createElement(l,{columns:f,autoFocus:!0,items:p,onShow:y=>{var T,S;(S=(T=y.domRef.current)==null?void 0:T.parentNode)==null||S.addEventListener("mousedown",m)},onHide:h,onHideIntent:y=>{h(y),t==null||t()}}),cellContext:c}}var _r=5,em=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function tm(){let o=ne(),e=ze(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=Dt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Fr(()=>{let{actions:l,getState:s,getDataSourceState:u}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:h,preventDefault:g}=Jp(d,o,f),y=Re.fromPoint({top:p.clientY,left:p.clientX});y.width+=_r,y.height+=_r,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:em}),g&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:T}=s();T&&T(P(C({},h),{getState:s,getDataSourceState:u}),p)})},[]),Fr(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function nm(){let o=ne(),e=ze(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=Dt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Fr(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(c=>{if(!c)return;let{event:d}=c;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:h}=Qp(c,o,p),g={top:d.clientY,left:d.clientX},y=Re.fromPoint(g);y.width+=_r,y.height+=_r,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:em}),h&&d.preventDefault(),l.contextMenuVisibleFor=C({point:g},c);let{onContextMenu:T}=s();T&&T(C(C({},o),m),d)})},[]),Fr(()=>{let{contextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}import{useRef as JS}from"react";import*as om from"react";import{useCallback as XS,useEffect as ZS}from"react";function Aa(o,e){let{state:{brain:t}}=ne(),n=XS(o,e);ZS(()=>t.onScroll(n),[t,n])}var Fa="yzx0vj0";function rm(o){let s=o,{width:e,maxWidth:t,minWidth:n,scrollable:r}=s,i=At(s,["width","maxWidth","minWidth","scrollable"]),a=JS(null);Aa(u=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-u.scrollLeft}px, 0px, 0px)`)},[r]);let l=C({},i.style);return e==="column"?l.width=fe.runtime.totalVisibleColumnsWidth:e==="viewport"&&(l.width=fe.runtime.bodyWidth),n==="column"?l.minWidth=fe.runtime.totalVisibleColumnsWidth:n==="viewport"&&(l.minWidth=fe.runtime.bodyWidth),t==="column"?l.maxWidth=fe.runtime.totalVisibleColumnsWidth:t==="viewport"&&(l.maxWidth=fe.runtime.bodyWidth),om.createElement("div",P(C({ref:a},i),{className:i.className?J(i.className,Fa):Fa,style:l}),i.children)}var QS=q(j.columnWidthAtIndex),ey=q(j.columnOffsetAtIndex);function ty(){return ne().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${QS}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${ey}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var Ot=Ie.rootClassName,ny=[Lu,"InfiniteColumnCell--hovered"],oy=bt({initSetupState:Md,forwardProps:Ed,mapPropsToState:Od,cleanup:Ad,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:_d(),getParentState:()=>un(),debugName:"InfiniteTable"});function am(){let o=ne(),{state:e,getComputed:t}=o,{header:n,brain:r,headerBrain:i}=e,{scrollbars:a}=t();return n?se.createElement(Pc,{bodyBrain:r,headerBrain:i,scrollbars:a}):null}var im=J(`${nt}Body`,Zn.relative,Wo[1],Ss);function ry(o){return se.createElement("div",P(C({},o),{className:o.className?J(im,o.className):im}))}function lm(){var D;let o=ne(),e=ze(),{state:t,getComputed:n,api:r}=o,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:u,loadingText:c,scrollStopDelay:d,brain:p,scrollerDOMRef:f,components:m,bodySize:h,activeCellIndex:g,rowDetailRenderer:y}=t,T=(D=m==null?void 0:m.LoadMask)!=null?D:pr,S=n(),{computedRowHeight:b,computedRowSizeCacheForDetails:R}=S,v=(R==null?void 0:R.getRowHeight)||b,{componentState:{loading:I}}=me(),w=se.useCallback(V=>{let z=o.getState(),F=V.target;if(!e&&V._from_row_detail)return;e&&(V._from_row_detail=!0);let E=kl(F,ma(),z.domRef.current),A,O,L,K;E&&(O=Number(E.dataset.colIndex),K=Number(E.dataset.rowIndex),A=o.getComputed().computedVisibleColumns[O].id,L=o.dataSourceApi.getRowInfoArray()[K].id);let Z={columnId:A,colIndex:O,rowId:L,rowIndex:K,event:V,target:E!=null?E:V.target};E&&z.cellContextMenu(Z),z.contextMenu(Z)},[]),{renderCell:x,renderDetailRow:M}=Rd({imperativeApi:r,getComputed:n,domRef:t.domRef,bodySize:h,computed:S});return se.createElement(ry,{onContextMenu:w},se.createElement(as,{debugId:l,tabIndex:0,activeRowIndex:t.ready&&s==="row"?u:null,activeCellIndex:t.ready&&s==="cell"&&!t.columnReorderDragColumnId?g:null,scrollStopDelay:d,renderer:i,onRenderUpdater:a,brain:p,activeCellRowHeight:v,renderCell:x,renderDetailRow:y?M:void 0,cellHoverClassNames:ny,scrollerDOMRef:f}),se.createElement(T,{visible:I},c))}var iy=se.memo(function(){let e=ne(),t=ze(),{state:n,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=me(),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onRowDetailHeightCSSVarChange:p,onColumnHeaderHeightCSSVarChange:f,rowHeightCSSVar:m,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:g,scrollStopDelay:y,brain:T,activeRowIndex:S,activeCellIndex:b}=n,{licenseKey:R}=n;!R&&zn.licenseKey&&(R=zn.licenseKey),Zd(S,a.length,r),Yd(b,a.length,r);let{onKeyDown:v}=gp();se.useEffect(()=>{let F=l(),E=St(A=>{F.notifyRenderRangeChange({renderStartIndex:A[0],renderEndIndex:A[1]})},{wait:y});return T.onVerticalRenderRangeChange(E)},[T,y]);let I=jd(R),w=xu(n.domProps);se.useEffect(()=>{T.setScrollStopDelay(y),s.scrollStopDelayUpdatedByTable=y},[y]),gd(),$p();let{menuPortal:x}=Bp(),{menuPortal:M}=tm(),{menuPortal:D}=nm(),{menuPortal:V}=Zp();se.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(n.id,n.ready,e.api,e)},[n.ready]),se.useEffect(()=>{t&&(c.current=t.getMasterState().portalDOMRef.current)},[]);let z=i!=null?i:se.createElement(se.Fragment,null,se.createElement(am,null),se.createElement(lm,null));return se.createElement("div",C({onKeyDown:v,ref:u},w),z,se.createElement("div",{ref:c,className:J(`${nt}Portal`,bs[1e7],Zn.absolute,Cs[0],fs[0])},x,M,D,V),m?se.createElement(xo,{varName:m,onChange:d}):null,h?se.createElement(xo,{varName:h,onChange:p}):null,g?se.createElement(xo,{varName:g,onChange:f}):null,I?null:se.createElement(Ac,null),se.createElement(jp,null))});function ay({children:o}){let{componentActions:e,componentState:t}=ve(),{scrollerDOMRef:n,scrollTopKey:r}=t,i=Kd(),a=Oe(i),l=Oe(t),s=ze(),{getState:u,componentActions:c,getDataSourceMasterContext:d,api:p}=me(),[f]=se.useState(()=>fd({getComputed:a,getState:l,getDataSourceState:u,getDataSourceMasterContext:d,dataSourceApi:p,actions:e,dataSourceActions:c})),m={actions:e,state:t,computed:i,dataSourceActions:c,getDataSourceMasterContext:d,getDataSourceState:u,getComputed:a,getState:l,api:f,dataSourceApi:p,children:o};Io(n,g=>{let y={width:g.width,height:g.height};e.bodySize=y},{earlyAttach:!0,debounce:50}),se.useEffect(()=>{n.current&&(n.current.scrollTop=0)},[r,n]);let h=Cn();return se.createElement(h.Provider,{value:m},se.createElement(iy,null))}var ly=40,sy=Jd(Bl),zn=function(o){return se.createElement(oy,C({rowHeight:ly,columnHeaderHeight:sy},o),se.createElement(ay,{children:o.children}))};zn.Header=am;zn.Body=lm;zn.HScrollSyncContent=rm;zn.Footer=()=>se.createElement(ws,null);var uy={key:"*",when:o=>{let{activeCellIndex:e}=o.getState();if(e){let[t,n]=e,r=o.api.getColumnAtIndex(n);return r?o.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(o,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:n}=o.getState();if(n){let[r,i]=n,a=o.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},cy={instantEdit:uy};import{useEffect as ML}from"react";function dy(o,e){let{set:t,delete:n,clear:r}=o;return e.set&&(o.set=(i,a)=>(t.call(o,i,a),e.set(i,a),o)),e.delete&&(o.delete=i=>{let a=n.call(o,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(o.clear=()=>{e.beforeClear&&e.beforeClear(o);let i=r.call(o);return e.clear&&e.clear(),i}),()=>{t&&(o.set=t),n&&(o.delete=n),r&&(o.clear=r)}}var _a=class{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t!=null?t:_a.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.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[n]=this.orderRefs.splice(0,1);n&&this.currentSet.delete(n)}return this.orderRefs.push(e),this.currentSet.add(e),this}},Or=_a;Or.DEFAULT_SIZE=10;var Oa=class{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t!=null?t:Oa.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.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[n]=this.orderRefs.splice(0,1),r=n.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}},Vr=Oa;Vr.DEFAULT_SIZE=10;var GL={CheckBox:zt,LoadMask:pr,MenuIcon:oo,StringFilterEditor:bn,NumberFilterEditor:er};export{Ae as CellSelectionState,N1 as DataSource,Bg as DataSourceActionType,le as DeepMap,Or as FixedSizeSet,qe as GroupRowsState,zn as InfiniteTable,Ot as InfiniteTableClassName,iy as InfiniteTableComponent,gt as Menu,uo as RowDetailCache,Ze as RowDetailState,pe as RowSelectionState,Vr as WeakFixedSizeSet,GL as components,St as debounce,yt as debug,Zt as defaultFilterTypes,Ra as eventMatchesKeyboardShortcut,Zt as filterTypes,hg as flatten,bt as getComponentStateRoot,Yi as group,dy as interceptMap,cy as keyboardShortcuts,It as multisort,ve as useComponentState,un as useDataSource,Dn as useEffectWithChanges,BE as useEffectWithObject,Aa as useGridScroll,tc as useInfiniteColumnCell,zi as useInfiniteColumnEditor,Jn as useInfiniteColumnFilterEditor,Qo as useInfiniteHeaderCell,k1 as useMasterRowInfo,Dt as useOverlay,SS as useOverlayPortal,K1 as useRowInfoReducers,ty as useVisibleColumnSizes};
3
+ `,`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},qC=o=>{let e="",t=o.split("|").map(l=>{let[s,u]=l.split("=");return s==="C"&&(e=u),{name:s,value:u}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let u=t[s];if(Ta(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Ta(a)!==r)throw"Invalid license";return t=t.map(l=>D(C({},l),{value:decodeURI(l.value)})),YC(t)};var ZC=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,JC=/(https):\/\/\S+(\.csb\.app)/g,Xd=typeof window!="undefined"?window.location.origin:"",QC=()=>{let[o,e,t]=Array.from(ZC.exec(Xd)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},eS=()=>{let[o,e,t]=Array.from(JC.exec(Xd)||[]);return e==="https"&&t===".csb.app"},tS=eS()||QC(),Zd=(o="")=>{let t=!!ze();return XC(()=>{if(t)return!0;let r=qd(o,{publishedAt:1624970570587,version:"4.2.0"});return!o&&!r&&tS?!0:r},[o,t])};import{useRef as Jd,useEffect as Qd}from"react";var nS=10;function ep(o,e,t){let n=Jd(!1),r=Jd(null);Qd(()=>{o!=null&&(n.current=!1,nt(r.current))},[o]),Qd(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,nt(r.current),r.current=be(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<nS&&a(l)})};var i=a;a()}return()=>{nt(r.current)}},[o,e])}import{useRef as tp,useEffect as np}from"react";var oS=10;function op(o,e,t){let n=tp(!1),r=tp(null);np(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),np(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<oS&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}var rp=o=>`--infinite-${o}`;import{useCallback as gS,useMemo as CS,useEffect as SS}from"react";function ip(o,e){var t,n;ba(o,e),iS(o,e),e.detail===2&&rS(o,e),(n=(t=o.getState()).onCellClick)==null||n.call(t,o,e)}function rS(o,e){let n=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:n.id})}function iS(o,e){let{getDataSourceState:t,getComputed:n,rowIndex:r,colIndex:i,dataSourceActions:a}=o,l=t(),{selectionMode:s,cellSelection:u}=l;if(!u||s!=="multi-cell")return;let{multiCellSelector:c}=n(),d=new Ae(u);c.cellSelectionState=d;let p={rowIndex:r,colIndex:i};e.metaKey||e.ctrlKey?c.singleAddClick(p):e.shiftKey?c.multiSelectClick(p):c.resetClick(p),a.cellSelection=d}function ba(o,e){let{rowIndex:t,getDataSourceState:n,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=o,{multiRowSelector:s,renderSelectionCheckBox:u}=r(),c=n(),{selectionMode:d,groupBy:p,dataArray:f}=c;if(p.length)return!1;if(d==="multi-row"){if(u&&!e.key)return!1;let{rowSelection:m}=c;if(m=l(m),s.rowSelectionState=m,m&&typeof m=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=m,!0}else if(d==="single-row"){let m=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(m):a.rowSelectionApi.selectRow(m)}return!1}function ap(o,e){e.detail!==2&&void 0}function Pt(o,e,t){return Math.min(Math.max(o,e),t)}function aS(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i}=o,{key:a}=e,l=n().dataArray,s=l.length,u=t(),{brain:c}=u,{activeRowIndex:d}=u;if(d==null)return!1;let{start:[p],end:[f]}=c.getRenderRange(),m=d,h=f-p-1,g=0,y=s-1,S={ArrowDown:()=>{d=Pt(d+1,g,y)},ArrowUp:()=>{d=Pt(d-1,g,y)},ArrowLeft:()=>{let b=l[d];return b&&b.isGroupRow?i.collapseGroupRow(b.groupKeys):b&&i.rowDetailApi.isRowDetailEnabledForRow(b.id)?i.rowDetailApi.collapseRowDetail(b.id):!1},ArrowRight:()=>{let b=l[d];return b&&b.isGroupRow?i.expandGroupRow(b.groupKeys):b&&i.rowDetailApi.isRowDetailEnabledForRow(b.id)?i.rowDetailApi.expandRowDetail(b.id):!1},Enter:()=>{let b=l[d];return b&&b.isGroupRow?i.toggleGroupRow(b.groupKeys):i.rowDetailApi.isRowDetailEnabledForRow(b.id)?i.rowDetailApi.toggleRowDetail(b.id):!1},PageDown:()=>{d=Math.min(d+h,s-1)},PageUp:()=>{d=Math.max(d-h,g)},End:()=>{d=y},Home:()=>{d=g}}[a];return S?(S(),m!==d?(r.activeRowIndex=d,!0):!1):!1}function lS(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,actions:a}=o,{key:l,shiftKey:s}=e,u=i().dataArray,c=n(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[h,g],end:[y,T]}=p.getRenderRange(),S=y-h-1,b=T-g-1,w=i().dataArray.length-1,v=r().computedVisibleColumns.length-1,I=0,R=0;f=Pt(f,0,w),m=Pt(m,0,v),a.activeCellIndex=[f,m];let x={ArrowDown:()=>{f=Pt(f+1,I,w)},ArrowUp:()=>{f=Pt(f-1,I,w)},ArrowLeft:()=>{m===R?(f!==I&&(m=v),x.ArrowUp()):m=Pt(m-1,R,v)},ArrowRight:()=>{m===v?(f!==w&&(m=R),x.ArrowDown()):m=Pt(m+1,R,v)},Enter:()=>{let P=u[f];return P&&P.isGroupRow?t.toggleGroupRow(P.groupKeys):P&&t.rowDetailApi.isRowDetailEnabledForRow(P.id)?t.rowDetailApi.toggleRowDetail(P.id):!1},PageDown:()=>{s?m=Math.min(m+b,v):f=Math.min(f+S,w)},PageUp:()=>{s?m=Math.max(m-b,R):f=Math.max(f-S,I)},End:()=>{s?m=v:f=w},Home:()=>{s?m=R:f=I}},E=x[l];return E?(E(),a.activeCellIndex=[f,m],!0):!1}var sS={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function lp(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!sS[t]?!1:i!=null&&l==="row"?aS(o,e):a!=null&&l==="cell"?lS(o,e):!1}var uS={Enter:!0," ":!0,a:!0};function sp(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,api:i,cloneRowSelection:a}=o,{key:l,ctrlKey:s,metaKey:u}=e;if(!uS[l])return!1;let c=t(),d=n(),{activeRowIndex:p,activeCellIndex:f,keyboardNavigation:m,keyboardSelection:h}=c,{selectionMode:g,groupBy:y,rowSelection:T}=d;if(h===!1)return!1;let S=m==="row"&&p!=null?p:m==="cell"&&f!=null?f[0]:null,b=S!=null?d.dataArray[S]:null;if(!b||S==null)return!1;if(g==="single-row"&&l===" ")return i.rowSelectionApi.toggleRowSelection(b.id),!0;if(g!=="multi-row")return!1;if(l==="a"&&(s||u)){let w=a(T);return w.selectAll(),r.rowSelection=w,!0}if(l===" "){if(y.length)return b.isGroupRow&&b.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(b.groupKeys):i.rowSelectionApi.toggleRowSelection(b.id),!0;{let w=C({},e),{renderSelectionCheckBox:v}=o.getComputed();return v&&(w.metaKey=!1,w.ctrlKey=!0),ba(D(C({},o),{rowIndex:S}),w)}}return!1}var up=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),cp=o=>Array.from(o.querySelectorAll(up)).filter(t=>!!t.offsetParent),vr=o=>o.querySelector(up);var pp=jr(Oo());function dp(o,e=10,t=300){return _e(this,null,function*(){return new Promise((n,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!o()){setTimeout(a,e);return}n(!0)}a()})})}var cS=10,dS=(o,e)=>o-e;function Pr(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=n(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",h=Ne(p.id,e);return p.contentFocusable(D(C({column:p},wn({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext),{columnApi:h,api:i,dataSourceApi:a}))}function Ra(o,e,t){let n=t.getState().editingCell;return pS(o,e,t,{isCellFocusable:Pr,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function mp(o,e,t){var r;let n=(0,pp.default)(t,o+e,dS);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:(r=t[n])!=null?r:null}globalThis.getNextCol=mp;function pS(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),u=o.rowIndex,c=o.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:mp(c,e,a),c===null){if(u+=e,u<0||u>=s.length)return null;continue}if(i({colIndex:c,rowIndex:u},t))return{colIndex:c,rowIndex:u}}return null}function fp(o){return _e(this,null,function*(){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=Pr(e,o)?e:Ra(e,-1,o);if(t){yield wa([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;let r=vr(n);r==null||r.focus()}})}function wa(n,r){return _e(this,arguments,function*([o,e],t){let{api:i}=t;return new Promise((a,l)=>{let s=cS,u=null,c=!1;function d(p=0){p++,nt(u),u=be(()=>_e(this,null,function*(){if(c=i.scrollCellIntoView(o,e,{offset:30}),!c&&p<s&&d(p),c){try{yield dp(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(f){l(f);return}a(!0)}}))}d()})})}var mS=`.${Qt}`;function hp(o,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,n=e.target,r=o.getState().scrollerDOMRef.current,i=document.activeElement===r||n===r;if(!r||i&&t===-1)return!1;let a=i?null:cn(n,mS),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:c}=o.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&Pr({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:Ra({rowIndex:l,colIndex:s},t,o);if(!u){if(t===-1)r.focus();else{let c=cp(document.body),d=o.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d),f=c[p+1];f==null||f.focus()}return!0}return wa([u.rowIndex,u.colIndex],o).then(()=>{let c=o.getState().getDOMNodeForCell(u);if(!c)return;let d=vr(c);d==null||d.focus()}),!0}var gp={control:"ctrl"},Cp={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},fS={esc:"escape"},yp={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},Tp=Object.keys(yp),Ia=new Set(Tp),hS=new Set(["shift","alt"]);function xa(o,e){return Array.isArray(e)?e.some(t=>Sp(o,t)):Sp(o,e)}function Sp(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>Cp[p]),i=n.map(p=>gp[p]||Cp[p]||fS[p]||p),a=i.filter(p=>Ia.has(p)),l=i.filter(p=>!Ia.has(p)),s=Tp.reduce((p,f)=>(p[f]=yp[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let u=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(u.length<a.length||u.filter(f=>!hS.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||Ia.has(t)||t==="meta"||gp[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}function bp(o,e){return _e(this,null,function*(){var r,i;let t=D(C({},o),{cloneRowSelection:c=>gr(c,o.getDataSourceState)});if(sp(t,e)&&e.preventDefault(),(hp(t,e)||!o.getState().focusedWithin&&lp(t,e))&&e.preventDefault(),e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:c}=o.getState();if(c){let[d,p]=c,f=o.getComputed().computedVisibleColumns[p];f.computedEditable&&o.api.startEdit({rowIndex:d,columnId:f.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&e.preventDefault()),(i=(r=o.getState()).onKeyDown)==null||i.call(r,o,e);let{keyboardShortcuts:n}=o.getState();if(n)try{for(var a=Tl(n),l,s,u;l=!(s=yield a.next()).done;l=!1){let c=s.value;if(!xa(e,c.key)||c.when&&!(yield c.when(o)))continue;let d=yield c.handler(o,e);if(d&&d.stopNext)break}}catch(s){u=[s]}finally{try{l&&(s=a.return)&&(yield s.call(a))}finally{if(u)throw u[0]}}})}function yS(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=oe(),{getState:i,componentActions:a,api:l}=me();return CS(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneRowSelection:c=>gr(c,i)}),[o,e,i,a,t,l,n])}function TS(){let o=yS();SS(()=>{let e=o.getState().keyDown.onChange(a=>{bp(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],u=Ne(s.id,o);ip(D(C({},o),{rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u}),D(C({},l),{key:""}))}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=o.getComputed().computedVisibleColumns[u],d=Ne(c.id,o);ap(D(C({},o),{rowIndex:s,colIndex:u,column:c,columnApi:d}),l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function bS(){let{getState:o}=oe();return{onKeyDown:gS(t=>{o().keyDown(t)},[])}}function Rp(){return TS(),bS()}import{useEffect as Yp}from"react";import*as Pe from"react";import{useCallback as Pa,useEffect as xS,useLayoutEffect as vS,useState as Mr}from"react";import{createPortal as PS}from"react-dom";var Ee=class{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new Ee(e)}static from(e){return new Ee(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,n=e.left-this.left;return{top:t,left:n}}};function wp(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Ip(o,e){return Math.sqrt(Wr(e.top-o.top,2)+Wr(e.left-o.left,2))}function RS(o,e,t){let n=wp(o,t),r=wp(e,t);return n===r?Ip(t,e)-Ip(t,o):n-r}function wS(o){if(o.length<3)return o;let[...e]=o,t={top:0,left:0};return o.forEach(n=>{t.top+=n.top,t.left+=n.left}),t.top/=o.length,t.left/=o.length,e.sort((n,r)=>RS(n,r,t)),e}function xp(o,e){o=wS(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(IS([t,i,a],e))return!0}return!1}function IS(o,e){let[t,n,r]=o,i=e,a=(n.left-t.left)*(r.top-t.top)-(n.top-t.top)*(r.left-t.left);return a*((n.left-t.left)*(i.top-t.top)-(n.top-t.top)*(i.left-t.left))>=0&&a*((r.left-n.left)*(i.top-n.top)-(r.top-n.top)*(i.left-n.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var _n=class{containsPoint(e){return xp(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let n=0,r=t.length;n<r;n++)if(!this.containsPoint(t[n]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let n=e.getPoints();for(let r=0,i=n.length;r<i;r++)if(this.containsPoint(n[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var Kt=class extends _n{constructor(t){super();this.points=t.map(Ee.clone)}static clone(t){return new Kt(t)}getPoints(){return this.points}shift(t){return this.points.forEach(n=>{n.shift(t)}),this}};var Re=class extends _n{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 Re(t)}static clone(t){return new Re(t)}static from(t){return Re.clone(t)}static fromPoint(t){return Re.from({top:t.top,left:t.left,width:0,height:0})}containsPoint(t){return new Kt(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}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Ee.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};function va(o){return!!o.tagName}function Dp(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=Re.from(va(e)?e.getBoundingClientRect():e),a=Re.from(va(t)?t.getBoundingClientRect():t),l=n?Re.from(va(n)?n.getBoundingClientRect():n):null;if(!l){let u=vp({anchorRect:a,targetRect:i,position:r[0]});return D(C({},u),{index:0})}let s=null;for(let u=0,c=r.length;u<c;u++){let d=vp({anchorRect:a,targetRect:i,position:r[u],constrainRect:l});if(u===0&&(s=D(C({},d),{index:0})),d.valid)return D(C({},d),{index:u})}return s}function vp(o){let e=Re.from(o.targetRect),t=Re.from(o.anchorRect),n=o.constrainRect?Re.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=Pp(e,i),s=Pp(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function Pp(o,e){return e==="TopLeft"?Ee.from({top:o.top,left:o.left}):e==="TopCenter"?Ee.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?Ee.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?Ee.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?Ee.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?Ee.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?Ee.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?Ee.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Ee.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}var Dr="__is_infinite_menu_component";function DS(o){return o&&typeof o.then=="function"||o instanceof Promise}function Ap(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}function Mp(o){return _e(this,null,function*(){return typeof o=="function"&&(o=o()),DS(o)&&(o=yield o),typeof o=="string"&&(o=document.querySelector(o)),o&&Ap(o)&&(o=o.getBoundingClientRect()),o?Re.from(o):null})}function MS(o){return _e(this,null,function*(){let e=null;typeof o=="function"?e=o():e=o;function t(n){let r=null;return typeof n=="string"&&(r=document.querySelector(n)),Ap(n)&&(r=n),r||null}return t(yield e)})}function ES(o){return Pe.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function AS(o){let e=Pe.useRef(null);return xS(()=>o.realign.onChange(t=>{e.current&&t&&Ep(e.current,t)}),[o.realign]),Pe.createElement("div",{style:{position:"absolute",top:0,left:0},ref:Pa(t=>{t&&Ep(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}function Ep(o,e){return _e(this,null,function*(){let{constrainTo:t,alignTo:n,alignPosition:r}=e;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n=D(C({},n),{width:0,height:0})),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&(yield Mp(t))||void 0,a=n?yield Mp(n):void 0,l=Re.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Dp({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=o.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=o.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,h=s.top-f;o.style.transform=`translate3d(${m}px,${h}px, 0px)`}}})}function FS(o,e){let[t,n]=Mr(null);return vS(()=>{function r(){return _e(this,null,function*(){let i=e?yield MS(e):null;i!=null&&n(i)})}e&&r()},[e]),e?t?PS(o,t):Pe.createElement(Pe.Fragment,null):e===null||e===!1?o:Pe.createElement(ES,null,o)}function _S(o){if(Pe.Children.count(o)===1){let e=Pe.Children.only(o);if(Pe.isValidElement(e))return e.props.id||e.key}return null}function OS(o,e,t){if(Pe.Children.count(o)===1){let n=Pe.Children.only(o);if(Pe.isValidElement(n)&&n.type[Dr]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Pe.cloneElement(n,r)}}return o}globalThis.allhandles={};globalThis.thehandles={};function Dt(o){let e=o,[t]=Mr(()=>new Map),[n,r]=Mr(null),[i,a]=Mr(0),l=Pa(()=>{let m=[];for(let[h,g]of t)m.push(Pe.createElement(AS,D(C({},g),{key:g.key})));return m},[]),[s,u]=mt(),c=FS(l(),o.portalContainer),d=Pa((m,h)=>{let y=`${h.id||_S(m)||it()}`,T=t.get(y),S=()=>{var w;let b=typeof m=="function"?m():m;return OS(b,e.portalContainer,(w=h.constrainTo)!=null?w:e.constrainTo)};if(T){Object.assign(T,h,{children:S}),u(),r(T.key),a(Date.now());return}return T={key:y,children:S,alignPosition:h.alignPosition,alignTo:h.alignTo,constrainTo:h.constrainTo,realign:we()},t.set(T.key,T),u(),()=>u()},[t,e.portalContainer,u]);Pe.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return Pe.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}import*as $p from"react";import*as Vn from"react";import*as On from"react";import*as fo from"react";function Er(o){return null}Er.defaultProps={__is_menu_item:!0};var Fp="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw16 _16lm1iw1m _16lm1iw8",_p=Se({defaultClassName:"db3arf2 _16lm1iwz _16lm1iw1q _16lm1iw17",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwj _16lm1iw17",false:"_16lm1iwi"},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"]]}),Op="db3arf1",Vp="db3arfd";var VS="-";function zS(){return fo.createElement("hr",{className:Vp})}var Ar=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===VS?fo.createElement(zS,null):r:null;return i!=null?{type:"item",parentMenuId:n,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:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}};function zp(o,e){return fo.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Er)){let n=C({},t.props);return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),Ar(o,n)}return Ar(o,t)})||[]}var Lp="submenu";function Gp(){let o=On.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:it(),focused:!1,destroyed:!1,domRef:o}}var Hp=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),LS=[{name:"label"}],Np=o=>{let{props:e,state:t}=o,{activeItemKey:n,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,u=e.id||t.generatedId;s&&(u=`${s}-${u}`);let c=[...e.columns||LS],d={columns:c,keyboardActiveItemKey:r,activeItemKey:n,menuId:u},p=[];i?p=i.map(Ar.bind(null,d)):!i&&typeof a!="function"&&(p=zp(d,a)),l&&p.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!c.find(h=>h.name==Lp)&&c.push({name:Lp,render:({domProps:h,item:g})=>g.menu?On.createElement("div",C({},h),On.createElement(Rn,{expanded:!1})):On.createElement("div",C({},h))});let f=p.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:p,runtimeSelectableItems:f,columns:c,menuId:u}};import*as at from"react";import{useCallback as sn,useLayoutEffect as $S,useRef as US,useState as Ea}from"react";var ho=class extends Kt{constructor(e){super(e.slice(0,3))}};var GS=250;function HS(o,e=100){let t=Date.now();return new Promise(n=>{let r,i=()=>{if(r=o(),r!==void 0){n(r);return}if(Date.now()-t>e){n(void 0);return}be(i)};be(()=>{i()})})}var NS=xe(),Fr=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||GS;this.getPointerMoveTarget=()=>document.documentElement||NS;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 Ee({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,c=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(c-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=c,(s?new ho([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new ho([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,HS(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(n=>{this.activeItem==e&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(e,t,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Ee({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,n.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 KS,useContext as kS}from"react";var Da=KS(null);function Ma(){return kS(Da)}import{useCallback as BS,useEffect as WS,useRef as jS}from"react";function Kp(){let o=jS(!0);return WS(()=>(o.current=!0,()=>{o.current=!1}),[]),BS(()=>o.current,[])}function YS(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,u=`${t}-submenu`,c=o.menu;return c?(typeof c=="function"&&(c=c()),at.createElement(Ct,D(C({key:u,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a},c),{autoFocus:!1,onShow:(d,p)=>{var f;(f=c==null?void 0:c.onShow)==null||f.call(c,d,p),n(p)},onHideIntent:d=>{var p;(p=c==null?void 0:c.onHideIntent)==null||p.call(c,d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}}))):null}function qS(o,e){var a;let t=kp(o,e);if(!t.length)return null;let n=Re.from((a=t[0])==null?void 0:a.getBoundingClientRect()),r=Re.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function kp(o,e){let t=cn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${o}"]`);if(!t)return[];let n=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(n)}function XS(o,e){let t=kp(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}function ZS({onItemActivate:o}){let{getState:e}=Ma(),[{onItemEnter:t,onItemLeave:n}]=Ea(()=>new Fr({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){o(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];o(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:sn(t,[]),onItemLeave:sn(n,[])}}function Bp(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:u,wrapLabels:c,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:h},componentActions:g,getState:y}=Ma(),T=sn(N=>{g.keyboardActiveItemKey=N},[]),S=sn(N=>{g.activeItemKey=N},[]),b=Kp(),[w,v]=Ea(null),I=null;$S(()=>{let{runtimeItems:N}=y(),k=N.filter(Y=>Y.type==="item"&&i===Y.key)[0];if(!k||!k.menu){v(null),P();return}if(k){let Y=qS(r,k.key);Y&&x(()=>YS(k,{constrainTo:l,setSubmenuApi:v,setActiveItemKey:S,setKeyboardActiveItemKey:T,parentMenuId:r,onHideIntent:J,api:U}),{id:`${r}-submenu`,alignTo:Y,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let R=(N,k)=>{T(k.key),S(k.key),k.originalMenuItem.onClick&&k.originalMenuItem.onClick(N);let Y={key:k.key,item:k.originalMenuItem,hideMenu:J};k.originalMenuItem.onAction&&k.originalMenuItem.onAction(Y),u&&u(Y),k.originalMenuItem.hideMenuOnAction&&J()},{showOverlay:x,portal:E,clearAll:P}=Dt({portalContainer:!1}),{onItemEnter:V,onItemLeave:z}=ZS({onItemActivate:N=>{if(!b())return;let k=N?N.key:null;S(k)}});I=n.map((N,k)=>at.createElement(JS,{key:N.type==="item"?N.key:k,onItemEnter:(Y,O)=>{V(Y.key,O)},onItemLeave:(Y,O)=>{z(Y.key,O)},columns:t,active:N.type==="item"&&N.key===i,keyboardActive:N.type==="item"&&N.key===a,item:N,index:k,onClick:R}));let F=t.map(N=>N.width||(typeof N.flex=="number"?`${N.flex}fr`:N.flex)||"auto").join(" "),M=D(C({},e.style),{gridTemplateColumns:F,gridTemplateRows:n.map(()=>"auto").join(" ")});c||(M.whiteSpace="nowrap");function A(N){let{runtimeItems:k,runtimeSelectableItems:Y}=y(),O=k.findIndex(X=>X.type==="item"&&X.key===a),B=a,L=k[O],W={ArrowUp:()=>{let X=k.slice(0,O).filter(ne=>ne.type==="item"&&!ne.disabled).pop();X&&X.type==="item"&&X.key&&(B=X.key)},ArrowDown:()=>{let X=k.slice(O+1).filter(ne=>ne.type==="item"&&!ne.disabled)[0];X&&X.type==="item"&&X.key&&(B=X.key)},Home:()=>{W.PageUp()},End:()=>{W.PageDown()},PageUp:()=>{B=Y[0].key},PageDown:()=>{B=Y[Y.length-1].key},ArrowLeft:()=>{S(null),y().parentMenuId&&(g.destroyed=!0)},ArrowRight:()=>{L&&(S(L.key),be(()=>{b()&&w&&w.getParentMenuId()===y().menuId&&w.focus()}))},Enter:()=>{var X;if(L)if((X=L.originalMenuItem)!=null&&X.menu){if(L&&L.originalMenuItem.menu&&w){W.ArrowLeft();return}L&&S(L.key)}else R(N,L)}," ":()=>{if(!L)return;L.originalMenuItem.menu||R(N,L);let X=XS(r,L.key);X&&X.click()},Escape:()=>{var ne;W.ArrowLeft();let X=y();X.parentMenuId||(ne=X.onHideIntent)==null||ne.call(X,X)}},te=W[N.key];te&&(te(),N.preventDefault()),B!=a&&T(B)}function _(){g.focused=!1}let H=sn(function(){g.focused=!0,setTimeout(()=>{var N,k;G.current&&h.current&&h.current===document.activeElement&&y().keyboardActiveItemKey==null&&T((k=(N=y().runtimeSelectableItems[0])==null?void 0:N.key)!=null?k:null)})},[]),G=US(!0),J=sn(()=>{var k;let N=y();(k=N.onHideIntent)==null||k.call(N,N)},[y]),[U]=Ea(()=>({hideMenu:J,focus:()=>{h.current&&(h.current.focus(),setTimeout(()=>{h.current&&h.current!==document.activeElement&&h.current.focus()},10),H())},getMenuId:()=>y().menuId,getParentMenuId:()=>y().parentMenuId})),$=sn(N=>{N?(h.current=N,d==null||d(y(),U),f&&U.focus()):(p==null||p(y()),h.current=N)},[]),ee=at.createElement("div",{className:gn.contents},at.createElement("div",D(C({},e),{"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:$,onKeyDown:N=>{var k;(k=e.onKeyDown)==null||k.call(e,N),A(N)},onMouseDown:N=>{var k;G.current=!1,(k=e.onMouseDown)==null||k.call(e,N)},onMouseUp:N=>{var k;G.current=!0,(k=e.onMouseUp)==null||k.call(e,N)},onFocus:H,onBlur:_,className:Q(Fp,e.className,"InfiniteMenu"),style:M}),I),E);return s?null:ee}function JS(o){let[e,t]=at.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,u=null;if(r.type==="decoration")u=at.createElement("div",{style:r.style},r.value);else{let c=0;u=n.map((d,p)=>{let f=r.value,m=d.field||d.name,h=p+1,g=h+r.span;if(h<c)return null;c=g;let T={style:D(C(C({},d.style),r.style),{gridColumnStart:h,gridColumnEnd:g}),"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(_p({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:S=>{var b;r.disabled||(b=o.onItemEnter)==null||b.call(o,r,S)},onPointerLeave:S=>{var b;r.disabled||(b=o.onItemLeave)==null||b.call(o,r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||o.onClick(S,r)}};return d.render?at.createElement(no,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:T}}):at.createElement("div",C({key:`${s}-${m}`},T),f[m])}).filter(Boolean)}return at.createElement("div",{className:Op},u)}var QS=bt({initSetupState:Gp,forwardProps:Hp,mapPropsToState:Np,layoutEffect:!0});function ey(o){let{componentActions:e,componentState:t}=ve(),n=Oe(t);return Vn.createElement(Da.Provider,{value:{componentActions:e,componentState:t,getState:n}},Vn.createElement(Bp,{domProps:o.domProps}))}function Ct(o){let b=o,{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:u=!1,onAction:c,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:h,onHideIntent:g,__is_infinite_menu_component:y}=b,T=At(b,["children","portalContainer","items","parentMenuId","addSubmenuColumnIfNeeded","bubbleActionsFromSubmenus","onShow","onHide","wrapLabels","onAction","constrainTo","columns","parentMenuItemKey","autoFocus","id","onHideIntent","__is_infinite_menu_component"]);return Vn.createElement(QS,C({addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u},o),Vn.createElement(ey,{domProps:T}))}Ct[Dr]=!0;import*as Wp from"react";function jp(o,e){let{columnApi:t,column:n,getComputed:r,api:i}=e,l=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{i.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{i.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{i.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...l,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{i.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{i.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{i.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((d,p)=>{let f=Xo(d,e);u.push({key:p,label:f,check:Wp.createElement(zt,{key:d.id,disabled:d.computedVisible&&i.getVisibleColumnsCount()===1,checked:d.computedVisible,onChange:m=>{let h=!!m;i.setVisibilityForColumn(d.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function Up(o,e,t){var m;if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=(m=i==null?void 0:i.Menu)!=null?m:Ct,s=n().computedColumnsMap.get(o);if(!s)return null;let u=C({column:s,columnApi:Ne(s.id,e)},e),c=jp([],u),d=a?a(c,u):c,p=h=>{h.__insideMenu=!0},f=h=>{var g,y;(y=(g=h.domRef.current)==null?void 0:g.parentNode)==null||y.removeEventListener("mousedown",p)};return!d||!d.length?null:$p.createElement(l,{autoFocus:!0,items:d,onShow:h=>{var g,y;(y=(g=h.domRef.current)==null?void 0:g.parentNode)==null||y.addEventListener("mousedown",p)},onHide:f,onHideIntent:h=>{f(h),t==null||t()}})}var ty=`[${ki["data-name"]}="${Bi["data-name"]}"]`;function ny(o){var d;let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){n(),a.columnMenuVisibleForColumnId=null}let c=o.target;if(c||(c=(d=l.current)!=null?d:void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let p=`[${gc["data-column-id"]}="${e}"] ${ty}`;c=i().domRef.current.querySelector(p)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Up(e,t,u),{constrainTo:s.current,id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function qp(){let o=oe(),e=ze(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=Dt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});Yp(()=>{let{actions:u,getState:c}=o,d=c();return d.onColumnMenuClick.onChange(p=>{p&&(d.columnMenuTargetRef.current=p.target,u.contextMenuVisibleFor=null,u.cellContextMenuVisibleFor=null,u.filterOperatorMenuVisibleForColumnId=null,u.columnMenuVisibleForColumnId=p.column.id)})},[]);let{columnMenuVisibleForColumnId:l,columnMenuVisibleKey:s}=t();return Yp(()=>{let{columnMenuVisibleForColumnId:u,columnMenuTargetRef:c}=t();if(u){let p=function(f){f.__insideMenu!==!0&&(a(),n.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),ny({columnId:u,context:o,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else c.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}import*as Xp from"react";import{useCallback as oy}from"react";var ry={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function Zp(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=oe(),{getState:a,getDataSourceMasterContext:l}=me(),{focusDetectDOMRef:s}=o(),u=oy(()=>_e(this,null,function*(){fp({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})}),[]);return Xp.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:ry})}import{useEffect as go}from"react";function iy(){let o=oe(),{getState:e}=o,{editingCell:t}=e(),n=t&&!t.active?t.cancelled:void 0;go(()=>{if(n){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l==null||l(D(C({},qe(C({rowIndex:r,columnId:i},o))),{initialValue:a}))}},[n])}function ay(){let o=oe(),{getState:e,state:{editingCell:t}}=o,n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;go(()=>{if(n){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s==null||s(D(C({},qe(C({rowIndex:r,columnId:i},o))),{value:a,error:n,initialValue:l}))}},[n])}function ly(){let o=oe(),{state:{editingCell:e}}=o,t=e==null?void 0:e.active,n=ko(t);go(()=>{!t&&n&&o.api.focus()},[t,n])}function sy(){let o=oe(),{state:{editingCell:e},getState:t}=o,n=e&&!e.active&&!e.cancelled&&e.accepted===!0;go(()=>{var r,i;if(n){let{editingCell:a}=t(),{value:l,rowIndex:s,columnId:u,initialValue:c}=a,d=D(C({},qe(C({rowIndex:s,columnId:u},o))),{value:l,initialValue:c});(i=(r=t()).onEditAccepted)==null||i.call(r,d),o.api.persistEdit({value:l})}},[n])}function uy(){let o=oe(),{state:{editingCell:e},getState:t}=o,n=e?e.persisted:void 0;go(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:u,initialValue:c}=r,d=D(C({},qe(C({rowIndex:l,columnId:s},o))),{value:u,initialValue:c});n instanceof Error?i==null||i(D(C({},d),{error:n})):a==null||a(d)}},[n])}function Jp(){iy(),ay(),sy(),uy(),ly()}import{useEffect as nm}from"react";import*as kt from"react";import*as Aa from"react";var Qp=o=>Aa.createElement(Me,C({},o),Aa.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 Fa from"react";var em=o=>Fa.createElement(Me,C({},o),Fa.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 tm(o,e,t){var I;if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:u}=e,{components:c,getFilterOperatorMenuItems:d}=r(),p=(I=c==null?void 0:c.Menu)!=null?I:Ct,f=n().computedColumnsMap.get(o);if(!f)return null;let m=R=>{R.__insideMenu=!0},h=R=>{var x,E;(E=(x=R.domRef.current)==null?void 0:x.parentNode)==null||E.removeEventListener("mousedown",m)},{filterTypes:g}=i(),y=g[f.computedFilterType];if(!y)return null;let T=y.operators.map(R=>{var V,z,F;let x=R.name,E=f.computedFilterValue?f.computedFilterValue.filter.operator===x:x===y.defaultOperator,P=(z=(V=R.components)==null?void 0:V.Icon)!=null?z:yn;return{key:x,icon:kt.createElement(P,null),label:kt.createElement(kt.Fragment,null,(F=R.label)!=null?F:R.name),onAction:()=>{u.setColumnFilterOperator(o,x)},checked:E?kt.createElement(em,{size:16}):null}}),b=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{u.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:kt.createElement(Qp,null),disabled:!f.computedFiltered,onAction:()=>{u.clearColumnFilter(o)}},"-"],...T],w={column:f,api:u,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:g},v=d?d(b,w):b;return kt.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:v,onShow:R=>{var x,E;(E=(x=R.domRef.current)==null?void 0:x.parentNode)==null||E.addEventListener("mousedown",m)},onHide:h,onHideIntent:R=>{h(R),t==null||t()}})}var _r=10;function om(){let o=oe(),e=ze(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=Dt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return nm(()=>{let{actions:l,getState:s}=o;return s().onFilterOperatorMenuClick.onChange(c=>{if(!c)return;let{target:d,column:p}=c;function f(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=(d==null?void 0:d.parentElement)||d,h=Re.from(m.getBoundingClientRect());h.top-=_r,h.left-=_r,h.width+=2*_r,h.height+=2*_r,r(()=>tm(p.id,o,f),{constrainTo:s().domRef.current,id:"filter-operator-menu",alignTo:h,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),l.contextMenuVisibleFor=null,l.cellContextMenuVisibleFor=null,l.columnMenuVisibleForColumnId=null,l.filterOperatorMenuVisibleForColumnId=p.id})},[]),nm(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}import{useEffect as Or}from"react";import*as _a from"react";function rm(o,e,t){var S;let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:u}=l(),c=(S=s==null?void 0:s.Menu)!=null?S:Ct,{computedColumnsMap:d}=a(),p=d.get(n),f=D(C({},qe(D(C({},e),{rowIndex:r,columnId:p.id}))),{event:i});if(!p||!u)return{cellContext:f,menu:null,preventDefault:!1};let m=u(f,e),h=m?Array.isArray(m)?m:m.items:null,g=m&&!Array.isArray(m)?m.columns:void 0,y=b=>{b.__insideMenu=!0},T=b=>{var w,v;(v=(w=b.domRef.current)==null?void 0:w.parentNode)==null||v.removeEventListener("mousedown",y)};return!h||!h.length?{cellContext:f,menu:null,preventDefault:Array.isArray(h)}:{preventDefault:!0,menu:_a.createElement(c,{columns:g,autoFocus:!0,items:h,onShow:b=>{var w,v;(v=(w=b.domRef.current)==null?void 0:w.parentNode)==null||v.addEventListener("mousedown",y)},onHide:T,onHideIntent:b=>{T(b),t==null||t()}}),cellContext:f}}function im(o,e,t){var g;let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=(g=i==null?void 0:i.Menu)!=null?g:Ct,{computedColumnsMap:s}=r(),u=o.columnId?s.get(o.columnId):void 0,c=u?C(C({},o),qe(D(C({},e),{rowIndex:o.rowIndex,columnId:u.id}))):o;if(!a)return{cellContext:c,menu:null,preventDefault:!1};let d=a(c,e),p=d?Array.isArray(d)?d:d.items:null,f=d&&!Array.isArray(d)?d.columns:void 0,m=y=>{y.__insideMenu=!0},h=y=>{var T,S;(S=(T=y.domRef.current)==null?void 0:T.parentNode)==null||S.removeEventListener("mousedown",m)};return!p||!p.length?{cellContext:c,menu:null,preventDefault:Array.isArray(p)}:{preventDefault:!0,menu:_a.createElement(l,{columns:f,autoFocus:!0,items:p,onShow:y=>{var T,S;(S=(T=y.domRef.current)==null?void 0:T.parentNode)==null||S.addEventListener("mousedown",m)},onHide:h,onHideIntent:y=>{h(y),t==null||t()}}),cellContext:c}}var Vr=5,am=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function lm(){let o=oe(),e=ze(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=Dt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Or(()=>{let{actions:l,getState:s,getDataSourceState:u}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:h,preventDefault:g}=rm(d,o,f),y=Re.fromPoint({top:p.clientY,left:p.clientX});y.width+=Vr,y.height+=Vr,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:am}),g&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:T}=s();T&&T(D(C({},h),{getState:s,getDataSourceState:u}),p)})},[]),Or(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function sm(){let o=oe(),e=ze(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=Dt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Or(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(c=>{if(!c)return;let{event:d}=c;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:h}=im(c,o,p),g={top:d.clientY,left:d.clientX},y=Re.fromPoint(g);y.width+=Vr,y.height+=Vr,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:am}),h&&d.preventDefault(),l.contextMenuVisibleFor=C({point:g},c);let{onContextMenu:T}=s();T&&T(C(C({},o),m),d)})},[]),Or(()=>{let{contextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}import{useRef as py}from"react";import*as um from"react";import{useCallback as cy,useEffect as dy}from"react";function Oa(o,e){let{state:{brain:t}}=oe(),n=cy(o,e);dy(()=>t.onScroll(n),[t,n])}var Va="yzx0vj0";function cm(o){let s=o,{width:e,maxWidth:t,minWidth:n,scrollable:r}=s,i=At(s,["width","maxWidth","minWidth","scrollable"]),a=py(null);Oa(u=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-u.scrollLeft}px, 0px, 0px)`)},[r]);let l=C({},i.style);return e==="column"?l.width=fe.runtime.totalVisibleColumnsWidth:e==="viewport"&&(l.width=fe.runtime.bodyWidth),n==="column"?l.minWidth=fe.runtime.totalVisibleColumnsWidth:n==="viewport"&&(l.minWidth=fe.runtime.bodyWidth),t==="column"?l.maxWidth=fe.runtime.totalVisibleColumnsWidth:t==="viewport"&&(l.maxWidth=fe.runtime.bodyWidth),um.createElement("div",D(C({ref:a},i),{className:i.className?Q(i.className,Va):Va,style:l}),i.children)}var my=Z(j.columnWidthAtIndex),fy=Z(j.columnOffsetAtIndex);function hy(){return oe().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${my}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${fy}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var Ot=Ie.rootClassName,gy=[Ku,"InfiniteColumnCell--hovered"],Cy=bt({initSetupState:Vd,forwardProps:zd,mapPropsToState:Nd,cleanup:Ld,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Hd(),getParentState:()=>un(),debugName:"InfiniteTable"});function pm(){let o=oe(),{state:e,getComputed:t}=o,{header:n,brain:r,headerBrain:i}=e,{scrollbars:a}=t();return n?se.createElement(Ec,{bodyBrain:r,headerBrain:i,scrollbars:a}):null}var dm=Q(`${ot}Body`,Zn.relative,Wo[1],bs);function Sy(o){return se.createElement("div",D(C({},o),{className:o.className?Q(dm,o.className):dm}))}function mm(){var P;let o=oe(),e=ze(),{state:t,getComputed:n,api:r}=o,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:u,loadingText:c,scrollStopDelay:d,brain:p,scrollerDOMRef:f,components:m,bodySize:h,activeCellIndex:g,rowDetailRenderer:y}=t,T=(P=m==null?void 0:m.LoadMask)!=null?P:pr,S=n(),{computedRowHeight:b,computedRowSizeCacheForDetails:w}=S,v=(w==null?void 0:w.getRowHeight)||b,{componentState:{loading:I}}=me(),R=se.useCallback(V=>{let z=o.getState(),F=V.target;if(!e&&V._from_row_detail)return;e&&(V._from_row_detail=!0);let M=jl(F,ga(),z.domRef.current),A,_,H,G;M&&(_=Number(M.dataset.colIndex),G=Number(M.dataset.rowIndex),A=o.getComputed().computedVisibleColumns[_].id,H=o.dataSourceApi.getRowInfoArray()[G].id);let J={columnId:A,colIndex:_,rowId:H,rowIndex:G,event:V,target:M!=null?M:V.target};M&&z.cellContextMenu(J),z.contextMenu(J)},[]),{renderCell:x,renderDetailRow:E}=Dd({imperativeApi:r,getComputed:n,domRef:t.domRef,bodySize:h,computed:S});return se.createElement(Sy,{onContextMenu:R},se.createElement(us,{debugId:l,tabIndex:0,activeRowIndex:t.ready&&s==="row"?u:null,activeCellIndex:t.ready&&s==="cell"&&!t.columnReorderDragColumnId?g:null,scrollStopDelay:d,renderer:i,onRenderUpdater:a,brain:p,activeCellRowHeight:v,renderCell:x,renderDetailRow:y?E:void 0,cellHoverClassNames:gy,scrollerDOMRef:f}),se.createElement(T,{visible:I},c))}var yy=se.memo(function(){let e=oe(),t=ze(),{state:n,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=me(),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onRowDetailHeightCSSVarChange:p,onColumnHeaderHeightCSSVarChange:f,rowHeightCSSVar:m,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:g,scrollStopDelay:y,brain:T,activeRowIndex:S,activeCellIndex:b}=n,{licenseKey:w}=n;!w&&zn.licenseKey&&(w=zn.licenseKey),op(S,a.length,r),ep(b,a.length,r);let{onKeyDown:v}=Rp();se.useEffect(()=>{let F=l(),M=yt(A=>{F.notifyRenderRangeChange({renderStartIndex:A[0],renderEndIndex:A[1]})},{wait:y});return T.onVerticalRenderRangeChange(M)},[T,y]);let I=Zd(w),R=Du(n.domProps);se.useEffect(()=>{T.setScrollStopDelay(y),s.scrollStopDelayUpdatedByTable=y},[y]),Rd(),Jp();let{menuPortal:x}=qp(),{menuPortal:E}=lm(),{menuPortal:P}=sm(),{menuPortal:V}=om();se.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(n.id,n.ready,e.api,e)},[n.ready]),se.useEffect(()=>{t&&(c.current=t.getMasterState().portalDOMRef.current)},[]);let z=i!=null?i:se.createElement(se.Fragment,null,se.createElement(pm,null),se.createElement(mm,null));return se.createElement("div",C({onKeyDown:v,ref:u},R),z,se.createElement("div",{ref:c,className:Q(`${ot}Portal`,Is[1e7],Zn.absolute,Ts[0],Cs[0])},x,E,P,V),m?se.createElement(xo,{varName:m,onChange:d}):null,h?se.createElement(xo,{varName:h,onChange:p}):null,g?se.createElement(xo,{varName:g,onChange:f}):null,I?null:se.createElement(Oc,null),se.createElement(Zp,null))});function Ty({children:o}){let{componentActions:e,componentState:t}=ve(),{scrollerDOMRef:n,scrollTopKey:r}=t,i=Ud(),a=Oe(i),l=Oe(t),s=ze(),{getState:u,componentActions:c,getDataSourceMasterContext:d,api:p}=me(),[f]=se.useState(()=>Td({getComputed:a,getState:l,getDataSourceState:u,getDataSourceMasterContext:d,dataSourceApi:p,actions:e,dataSourceActions:c})),m={actions:e,state:t,computed:i,dataSourceActions:c,getDataSourceMasterContext:d,getDataSourceState:u,getComputed:a,getState:l,api:f,dataSourceApi:p,children:o};Io(n,g=>{let y={width:g.width,height:g.height};e.bodySize=y},{earlyAttach:!0,debounce:50}),se.useEffect(()=>{n.current&&(n.current.scrollTop=0)},[r,n]);let h=Cn();return se.createElement(h.Provider,{value:m},se.createElement(yy,null))}var by=40,Ry=rp($l),zn=function(o){return se.createElement(Cy,C({rowHeight:by,columnHeaderHeight:Ry},o),se.createElement(Ty,{children:o.children}))};zn.Header=pm;zn.Body=mm;zn.HScrollSyncContent=cm;zn.Footer=()=>se.createElement(vs,null);var wy={key:"*",when:o=>{let{activeCellIndex:e}=o.getState();if(e){let[t,n]=e,r=o.api.getColumnAtIndex(n);return r?o.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(o,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:n}=o.getState();if(n){let[r,i]=n,a=o.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},Iy={instantEdit:wy};import{useEffect as Z0}from"react";function xy(o,e){let{set:t,delete:n,clear:r}=o;return e.set&&(o.set=(i,a)=>(t.call(o,i,a),e.set(i,a),o)),e.delete&&(o.delete=i=>{let a=n.call(o,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(o.clear=()=>{e.beforeClear&&e.beforeClear(o);let i=r.call(o);return e.clear&&e.clear(),i}),()=>{t&&(o.set=t),n&&(o.delete=n),r&&(o.clear=r)}}var za=class{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t!=null?t:za.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.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[n]=this.orderRefs.splice(0,1);n&&this.currentSet.delete(n)}return this.orderRefs.push(e),this.currentSet.add(e),this}},zr=za;zr.DEFAULT_SIZE=10;var La=class{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t!=null?t:La.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.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[n]=this.orderRefs.splice(0,1),r=n.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}},Lr=La;Lr.DEFAULT_SIZE=10;var iH={CheckBox:zt,LoadMask:pr,MenuIcon:oo,StringFilterEditor:bn,NumberFilterEditor:er};export{Ae as CellSelectionState,sF as DataSource,oC as DataSourceActionType,ae as DeepMap,zr as FixedSizeSet,Xe as GroupRowsState,zn as InfiniteTable,Ot as InfiniteTableClassName,yy as InfiniteTableComponent,Ct as Menu,uo as RowDetailCache,Je as RowDetailState,pe as RowSelectionState,Lr as WeakFixedSizeSet,iH as components,yt as debounce,tt as debug,Zt as defaultFilterTypes,xa as eventMatchesKeyboardShortcut,Zt as filterTypes,Tg as flatten,bt as getComponentStateRoot,Xi as group,xy as interceptMap,Iy as keyboardShortcuts,It as multisort,ve as useComponentState,un as useDataSource,Dn as useEffectWithChanges,oA as useEffectWithObject,Oa as useGridScroll,rc as useInfiniteColumnCell,Gi as useInfiniteColumnEditor,Jn as useInfiniteColumnFilterEditor,Qo as useInfiniteHeaderCell,cF as useMasterRowInfo,Dt as useOverlay,FS as useOverlayPortal,uF as useRowInfoReducers,hy as useVisibleColumnSizes};
4
4
  //!collapsed || lazyLoad;