@infinite-table/infinite-react 7.0.1 → 7.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/README.md +1 -1
- package/index.css +1 -1
- package/index.d.ts +2210 -2141
- package/index.dev.js +3123 -1410
- package/index.dev.mjs +14854 -13148
- package/index.js +9 -9
- package/index.mjs +9 -9
- package/package.json +2 -2
- package/theme/default.css +57 -1
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var $m=Object.create;var Jl=Object.defineProperty;var Um=Object.getOwnPropertyDescriptor;var Ym=Object.getOwnPropertyNames;var qm=Object.getPrototypeOf,Xm=Object.prototype.hasOwnProperty;var Zm=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Qm=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ym(e))!Xm.call(n,r)&&r!==t&&Jl(n,r,{get:()=>e[r],enumerable:!(o=Um(e,r))||o.enumerable});return n};var tn=(n,e,t)=>(t=n!=null?$m(qm(n)):{},Qm(e||!n||!n.__esModule?Jl(t,"default",{value:n,enumerable:!0}):t,n));var vo=Zm((WR,As)=>{As.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});function Dt(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}import*as me from"react";var J=(...n)=>n.filter(e=>!!`${e}`).join(" ");import*as ao from"react";import{useRef as ss}from"react";function pe(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=null;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function Ye(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var es=(n,e)=>n-e;var zi=(n,e)=>es(n.revision,e.revision),q=class{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),u=!a;if(i!==void 0){if(i<0)return;i--}let c=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,h=p===this.emptyKey;if(h&&!u)return;let g=h?[]:[...e,p],y=m?()=>this.visitWithNext(g,t,o,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let C=t(f.value,g,l,y,f);if(o&&C===!0)return!0;l++}else y?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(p,d);if(o&&f===!0)return f}};this.fill(e)}static clone(e){let t=new q;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t,o){let r=[];return this.getStartingWith(e,(i,a)=>{r.push(a)},t,o),r}getEntriesStartingWith(e,t,o){let r=[];return this.getStartingWith(e,(i,a)=>{r.push([i,a])},t,o),r}getUnnestedKeysStartingWith(e,t,o){let r=[],i=u=>{r.push(u)},a=this.map,l,s=!1;if(e.length)for(let u=0,c=e.length;u<c;u++){let d=e[u];if(l=a.get(d),!l||!l.map)if(s=!0,u===c-1){s=!0;break}else return[];a=l.map}else if(!t&&a.has(this.emptyKey))return[[]];return l&&l.value!==void 0&&(t||(i({...l,keys:e}),s=!0)),s?r.sort(zi).map(u=>u.keys):(this.visitWithNext(e,(u,c,d,p,f)=>{i({...f,keys:c})},!1,a,o,t),r.sort(zi).map(u=>u.keys))}getKeysStartingWith(e,t,o){let r=[];return this.getStartingWith(e,i=>{r.push(i)},t,o),r}getStartingWith(e,t,o,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&&(o||t(e,a.value)),!l&&this.visitWithNext(e,(s,u,c,d)=>{t(u,s),d?.()},!1,i,r,o)}getMapAt(e){let t=this.map,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let o=this.map;e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((o,r)=>{let{map:i}=o;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0}delete(e){let t=this.map;e.length?e=[...e]:e=[this.emptyKey];let o=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],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,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.length-1],u=e[e.length-1],c=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 o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],u=Ye(()=>{if(l)for(let[c]of l){let d=this.visitKey(c,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let c=r(a,s,u);if(i&&c===!0)return!0}u()}getArray(e){let t=[];return this.visit((o,r)=>{let i=e({...o,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(zi);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};function Ee(){return globalThis}var Jn=["#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"],ts=Symbol("color"),Qn=new WeakMap,Gi=pe();function Ki(n=Jn){Qn.set(n,n.map(e=>0))}Ki();var Jm=(n=Jn)=>{let e=[];Qn.has(n)?e=Qn.get(n):(e=n.map(o=>0),Qn.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??Jn[0]},nn=":",Hi="*",os="-",eh=",",th="debug",oh="diffdebug",rs=!1,on=new q,rn=new Map;function Bi(n,e){let t=n.split(nn),o=new q;o.set(t,!0);let r=e.split(nn),i=new Set(r).has(Hi),a=r.indexOf(Hi),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,i).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(nn)):!0}}function nh(n,e){let t=`channel=${n}_permissions=${e}`;if(rn.has(t))return rn.get(t);let o=e.split(eh);function r(l){return rn.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(Hi)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(os);if(u&&(s=s.substring(os.length)),Bi(n,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)),Bi(n,s))return r(!u)}return r(!1)}var ki=()=>Ge.enable??(Ee()&&Ee().localStorage?.getItem(th))??"",rh=()=>Ge.diffenable??(Ee()&&Ee().localStorage?.getItem(oh))??`${rs}`,Wi="",is=rs;function ji(n){is=`${rh()}`=="true",Wi!==n&&(Wi=n,rn.clear())}function as(n){ji(ki()),typeof Ee()<"u"&&Ee().addEventListener&&Ee().addEventListener("storage",function(){ji(ki())});function e(t,o){let r=o?`${o}${nn}${t}`:t,i=r.split(nn),a=on.get(i);if(a)return a;let l=on.get(i.slice(0,-1)),s=(l?l.logFn:Ge.logFn)??ls,u=s,c,d=0,p=()=>c??nh(r,Wi),f=Jm(Ge.colors),m=Object.defineProperties((...h)=>{let g=Gi.getListenersCount(),y;if(g>0&&(y=y??Date.now(),Gi({color:f,channel:r,args:h,timestamp:y})),p()){if(y=y??Date.now(),d&&is){let b=y-d;u(`%c[${r}]`,`color: ${f}`,`+${b}ms:`)}d=y;let C=[],S;if(h.forEach(b=>{if(b[ts])S===void 0&&(S=!0),C.push(...b);else{if(typeof b!="string"&&typeof b!="number"){S=!1;return}C.push(`${b}%s`)}}),S){let b=[`%c[${r}]%c %s`,`color: ${f}`,"",...C,""];u(...b)}else u(`%c[${r}]%c %s`,`color: ${f}`,"",...h)}},{channel:{value:r},color:{value:(h,...g)=>{let y=[`%c${g.join(" ")}%c%s`,`color: ${h}`,""];return y.toString=()=>g.join(" "),y[ts]=!0,y}},extend:{value:h=>e(h,r)},enabled:{get:()=>p(),set:h=>{c=h}},logFn:{configurable:!1,get:()=>u,set:h=>{u=h??s}},destroy:{value:()=>{on.delete(i)}}});return on.set(i,m),m}return e(n)}var ls=console.log.bind(console),ns;Object.defineProperty(as,"enable",{get:()=>ns,set:n=>{ns=n,ji(ki())}});var Ge=as;Ge.colors=Jn;Ge.logFn=ls;var ih=(n,e)=>Gi.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;Bi(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});Ge.onLogIntent=ih;Ge.destroyAll=()=>{Ki(),Ki(Ge.colors),on.clear(),rn.clear()};var rt=n=>{let e=Ge(n?`${n}:TYPE=debug`:"TYPE=debug");return e.logFn=console.log.bind(console),e},Ht=n=>{let e=Ge(n?`${n}:TYPE=error`:"TYPE=error");return e.logFn=console.error.bind(console),e},an=()=>an;an.extend=()=>an;var Je=class{constructor(e){this.debug=an,this.error=an}};import*as ah from"react";import{useMemo as Hb,useRef as lh,useEffect as sh,useLayoutEffect as uh,useCallback as Bb}from"react";var ln=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?Dt(e,{wait:o}):e,a=new r(l=>{let s=l[0],{width:u,height:c}=s.contentRect;if(s.borderBoxSize?.[0])c=s.borderBoxSize[0].blockSize,u=s.borderBoxSize[0].inlineSize;else{let d=n.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(n),()=>{a.disconnect()}},er=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=lh({width:0,height:0}),r=i=>{let a;return n.current&&(a=ln(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};sh(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),uh(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};var ch=Ht("CSSVariableWatch"),dh=rt("CSSVariableWatch"),ph={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},fh=n=>{let e=ss(0),t=ao.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);er(n.ref,t,{earlyAttach:!0}),ao.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o)return e.current=o,dh(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);ch(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},sn=n=>{let e=ss(null);fh({...n,ref:e});let t=n.varName.startsWith("var(")?n.varName:`var(${n.varName})`,{allowInts:o=!1}=n;return ao.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:ph},ao.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};import*as or from"react";import*as us from"react";var $i;function un(){return $i||($i=us.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}import*as cs from"react";var Ui;function tr(){return Ui||(Ui=cs.createContext(void 0))}function Po(){let n=un();return or.useContext(n).componentState}function Ie(){let n=un();return or.useContext(n)}function Le(){let n=tr();return or.useContext(n)}import*as uo from"react";import{useCallback as Qs,useEffect as sa,useRef as tg,useState as og}from"react";import*as nr from"react";function mh(n){let{height:e,width:t,count:o}=n;return nr.createElement("div",{"data-count":o,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var ds=nr.memo(mh);var ps="mlx2t3";import*as rr from"react";import{useRef as gh}from"react";import{useEffect as hh}from"react";var fs=(n,e)=>{hh(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var ms={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},hs={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},gs={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Yi="_1ueijco1",ys="_1ueijco0 _16lm1iw0";var Cs=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=ms[`${n}`]:e=J(hs[`${n.horizontal}`],gs[`${n.vertical}`]),e};var yh="InfiniteVirtualScrollContainer";var Ts=rr.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??gh(null);return fs(c,i),rr.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:J(a,yh,ys,Cs(r))},o)});import*as fr from"react";import{useEffect as la,useLayoutEffect as Eh,useMemo as Mh}from"react";import*as Ss from"react";import{useEffect as Ch,useRef as Th,useState as Sh}from"react";function bh(n){let[e,t]=Sh(n.updater.get),o=Th(null);return Ch(()=>{function r(a){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=n.updater.onChange(r);return()=>{o.current!=null&&cancelAnimationFrame(o.current),i()}},[n.updater,n.useraf]),e??null}var Bt=Ss.memo(bh);function xo(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function bs(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}function Y(n){return n.slice(4,-1)}var et="Infinite",De={rootClassName:et};var U={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnZIndexAtIndex:"var(--_16hkbkch)",pinnedStartWidth:"var(--_16hkbkci)",pinnedEndWidth:"var(--_16hkbkcj)",pinnedEndOffset:"var(--_16hkbkck)",computedVisibleColumnsCount:"var(--_16hkbkcl)",baseZIndexForCells:"var(--_16hkbkcm)",bodyWidth:"var(--_16hkbkcn)",bodyHeight:"var(--_16hkbkco)",scrollbarWidthHorizontal:"var(--_16hkbkcp)",scrollbarWidthVertical:"var(--_16hkbkcq)",scrollLeft:"var(--_16hkbkcr)",scrollTop:"var(--_16hkbkcs)"};var Rs="true",le={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},Is="column-header-height";var ws=`.${De.rootClassName}`;function qi(n){return xo(n,ws)}var Ps=Y(U.scrollLeft),Rh=Y(U.scrollTop),Ih=Y(U.columnWidthAtIndex),Xi=Y(U.columnOffsetAtIndex),xs=Y(U.columnReorderEffectDurationAtIndex),wh=Y(U.columnOffsetAtIndexWhileReordering),Ph=Y(U.columnZIndexAtIndex);function vt(n,e,t){let o=t?qi(t):document.querySelector(ws);xh(n,e,o)}function xh(n,e,t){if(t){let o=n,r=U[o]?Y(U[o]):n;t.style.setProperty(r,`${e}`)}}function Do(n,e){if(e)for(var t in n){let o=U[t]?Y(U[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function Zi(n,e,t){vt(`${Xi}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${Ps}))`:`${n.computedAbsoluteOffset+e}px`,t)}function Qi(n,e,t){vt(`${Ph}-${n}`,`${e}`,t)}function cn(n,e,t){vt(`${wh}-${n}`,typeof e=="number"?`calc( var(${Xi}-${n}) + ${e}px )`:e,t)}function ir(n,e,t){vt(`${xs}-${n}`,t??"",e)}function Ds(n,e){let t=`${xs}-${n}`;vt(t,le.components.Cell.reorderEffectDuration,e)}var Ce={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${Ih}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,vt(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${Xi}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,vt(this.varName.get(n),e,t)}}};function vs(n,e){Do({[Ps]:`${n.scrollLeft}px`,[Rh]:`${n.scrollTop}px`},e)}var ve=Ee().requestAnimationFrame||(n=>setTimeout(n,16)),gt=Ee().cancelAnimationFrame||(n=>clearTimeout(n));var Es=tn(vo());var Ji=(n,e)=>n-e,At={horizontal:!0,vertical:!0};function ar(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var ea="DebugID=";function kt(n,e){return e&&e.startsWith(ea)?e:e?`${ea}${n}:${e}`:`${ea}${n}`}var lr={start:0,end:0},ta=n=>{n()},oa=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},Ms=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},dn=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function Dh(n){return n.horizontalChange||n.verticalChange}var lo=class extends Je{constructor(t){let o=kt(t,`${t}:MatrixBrain`);super(o);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=lr;this.verticalExtendRangeBy=lr;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{dn(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?ta:dn;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?ta:dn;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let 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:o);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:o}=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:o);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 o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=At)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=At)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.startIndex,s=t.startIndex,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=o.startIndex,u=o.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=At)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof o!="function",u=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,c=this.getItemAt(l,t),d=u.start||0,p=u.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(c=Math.max(0,c-d),r+=d),p&&(r+=p);let f=c+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,c=Math.max(a,f-r)),{startIndex:c,endIndex:f}};this.getItemAt=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,o),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,Es.default)(a,t,Ji);return p>=0?p:~p-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],u=i[t-1];s==null&&console.error(`Offset was not available for ${o==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let 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:o};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,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,u=Math.min(t,r-1);for(;s<=u;s++)this.computeCacheFor(s,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=oa;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=o,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=At){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}getVirtualColIndex(t,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:u}=t,c=typeof s=="number",d=typeof u=="number",p=c&&s!==this.availableWidth,f=d&&u!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=u,this.availableRenderHeight=u),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",h=typeof i=="number",g=m&&r!==this.rows,y=h&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),h&&(this.cols=i);let C=a!=null,S=l!=null,b=C&&a!==this.rowHeight,T=S&&l!==this.colWidth;C&&(this.rowHeight=a),S&&(this.colWidth=l);let I=t.rowspan!=null,R=t.colspan!=null,w=I&&t.rowspan!=this.rowspan,P=R&&t.colspan!=this.colspan;w&&(this.rowspan=t.rowspan),P&&(this.colspan=t.colspan);let x=y||T||p||P,D=g||b||f||w;(o||Dh)({horizontalChange:x,verticalChange:D,colsChanged:y,colWidthChanged:T,widthChanged:p,colspanChanged:P,rowsChanged:g,rowHeightChanged:b,heightChanged:f,rowspanChanged:w})&&this.updateRenderCount({horizontal:x,vertical:D})}extendRenderRange(t){let{direction:o}=t,r=o==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:o})}}updateRenderCount(t=At){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=At){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?ta:dn;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof o=="function"){let c=[],d=0,p=r;d+=s,p-=u;for(let f=d;f<p;f++)c.push(this.getItemSize(f,t));a=ar(l,c)}else a=(o?Math.ceil(l/o):0)+1;return a+=s+u,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{dn(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let o=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=lr,this.verticalExtendRangeBy=lr,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var ra=tn(vo());function _s(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function Fs(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function pn(n,e){for(let t of n)if(e(t))return t}import*as Ns from"react";var Os=new Map,vh=()=>{},na=class{constructor(e,t){this.element=null;this.mounted=!1;this.mountSubscription=pe();let o=Os.get(e)??0,r=`${e}:GridCellReact:${o}`;Os.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=pe(),this.node=Ns.createElement(Bt,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=vh,this.element=null,this.node=null}getNode(){return this.node}update(e,t){this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},mn=class extends Je{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=pe();this.cellAttachmentChangeSubscription=pe();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=new na(this.debugId);return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,o=t.values().next().value;return o||(this.poolSize+=mn.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No cells available in the pool!"),o}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}set poolSize(t){t=Math.ceil(t/mn.POOL_SIZE_INCREMENT)*mn.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}},fn=mn;fn.POOL_SIZE_INCREMENT=1;var sr=(n,e)=>n-e,ur=class extends Je{constructor(t){super(`${t}:GridCellManager`);this.matrix=new q;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,u=new Set;return this.matrix.visit(({value:c},d)=>{if(!c)return;let[p,f]=d,m=p<i,h=p>=l,g=f<a,y=f>=s;(m||h||g||y)&&u.add(c)}),u};this.debugId=t,this.pool=new fn(t),this.offRemoveCell=this.pool.onRemoveCell(o=>this.onRemoveCell(o))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=pn(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=pn(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+1},(s,u)=>{let c=[a,u],d=this.getCellAt(c);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(sr)}getColumnsWithCells(){let t=this.matrix.getUnnestedKeysStartingWith([],!0);return[...new Set(t.map(r=>r[1])).values()].sort(sr)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((o,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,ra.default)(o,t,sr);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,ra.default)(o,t,sr);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;(l>=o||s>=r)&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return pn(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return pn(t,r=>this.getCellPosition(r)?.[1]===o)}getCellCountInMatrix(){return this.matrix.size}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var zs=tn(vo());import*as Vs from"react";var Ls=new Map,Ah=()=>{},ia=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=pe();let t=Ls.get(e)??0,o=`${e}:ListRowReact:${t}`;Ls.set(e,t+1),this.debugId=o,this.updater=pe(),this.node=Vs.createElement(Bt,{key:`detail-row-${o}`,name:`detail-row-${o}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Ah,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},gn=class extends Je{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=pe();this.rowAttachmentChangeSubscription=pe();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=new ia(this.debugId);return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,o=t.values().next().value;return o||(this.poolSize+=gn.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/gn.POOL_SIZE_INCREMENT)*gn.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}},hn=gn;hn.POOL_SIZE_INCREMENT=1;var cr=class extends Je{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new hn(t),this.offRemoveRow=this.pool.onRemoveRow(o=>this.onRemoveRow(o))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,zs.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Gs=!0,so=Y(U.y),Ks=Y(U.scrollTop),EI=Y(U.columnOffsetAtIndex),aa=Y(U.columnOffsetAtIndexWhileReordering),Ao=class extends Je{constructor(t,o){o=o||"ReactHeadlessTableRenderer";super(o);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,o,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(so,i?`calc( ${r}px + var(${Ks}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${so}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=Ce.columnOffsets.get(r),d=`${aa}-${r}`,p=s?`calc( ${a}px + var(${Ks}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(so,p));let f=`translate3d(var(${d}, ${c}), var(${so}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),u!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let u=r.getItemOffsetFor(t,"vertical"),c=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let h=f+m.height;l||(l=u>h-p?"end":u<f+d?"start":"end");let g=i.scrollTop;if(l==="center"?g=u-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,g+=u-f+s-d):(s+=c,g+=u-h+s+p),this.brain.isHorizontalLayoutBrain){let y=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),C=this.getScrollPositionForScrollColumnIntoView(y,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});C&&(a=C.scrollLeft)}return{scrollLeft:a,scrollTop:g}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let u=r.getItemOffsetFor(t,"horizontal"),c=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let h=f+m.width;l||(l=u>h-p?"end":u<f+d?"start":"end");let g=i.scrollLeft;return l==="center"?g=u-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,g+=u-f+s-d):(s+=c,g+=u-h+s+p),{...i,scrollLeft:g}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-o,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=u}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,u]}=i.getRenderRange();if(t<l||t>=u)return!1;let c=Math.floor((l+u)/2);if(t>=c){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:u,end:c}=t,[d,p]=u,[f,m]=c,h=[];if(i&&(o&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,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&&(o&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,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]})),o){let g={start:[0,p],end:[o,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,o)=>{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(o<a&&(d=!0,p="start"),l&&!d){let f=s-l;o>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};ve(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:u,y:c}=s;if(r){this.updateHoverClassNamesForRow(a);let d=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=d.rowIndex,r.dataset.colIndex=d.colIndex,Gs){this.setTransform(r,a,l,{x:u,y:c},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let f=(o?o.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==f&&(r.__zIndex=f,r.style.zIndex=f)}else r.style.display="",r.style.left=`${u}px`,r.style.top=`${c}px`}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let o=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;o&&(o.dataset.detailRowIndex=r,Gs&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:o,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:u,fixedRowsStart:c,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(E=>{let F=i.getRowIndex(E);if(F!=null){let v=this.brain.getItemOffsetFor(F,"vertical");if(v==null)return;let M=E.getElement();if(!M)return;this.setDetailTransform(M,F,{y:v,scrollLeft:t.scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&vs(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:g}=this.brain.getRenderRange(),[y,C]=h,[S,b]=g;function T(E,F,v){let M=r.getCellAt([E,F]);if(M==null)return;let N=o.getCellOffset(E,F),G=M.getElement();G&&N&&v(E,F,G,N)}let I=(E,F,v,{x:M,y:N})=>{this.setTransform(v,E,F,{x:M,y:N,scrollLeft:!0},s-F)},R=(E,F,v,M)=>{this.setTransform(v,E,F,{x:M.x,y:M.y,scrollTop:!0},c-E)},w=(E,F,v,{y:M})=>{let N=f[F];this.setTransform(v,E,F,{x:N,y:M,scrollLeft:!0},a-F)},P=(E,F,v,M)=>{this.setTransform(v,E,F,{x:M.x,y:m[E],scrollTop:!0},l-E)},x=(E,F,v,{x:M,y:N})=>{this.setTransform(v,E,F,{x:M,scrollLeft:!0,y:N,scrollTop:!0},1e5)},D=(E,F,v,{x:M})=>{this.setTransform(v,E,F,{x:M,scrollLeft:!0,y:m[E],scrollTop:!0},2e5)},A=(E,F,v,M)=>{this.setTransform(v,E,F,{x:f[F],y:M.y,scrollLeft:!0,scrollTop:!0},3e5)},_=(E,F,v)=>{this.setTransform(v,E,F,{x:f[F],y:m[E],scrollLeft:!0,scrollTop:!0},4e5)};if(s||u)for(let E=y;E<S;E++){for(let F=0;F<s;F++)T(E,F,I);if(u){let F=a-u;for(let v=F;v<a;v++)T(E,v,w)}}if(c||d)for(let E=C;E<b;E++){for(let F=0;F<c;F++)T(F,E,R);if(d){let F=l-d;for(let v=F;v<l;v++)T(v,E,P)}}if(s&&c)for(let E=0;E<c;E++)for(let F=0;F<s;F++)T(E,F,x);if(s&&d){let E=l-d;for(let F=E;F<l;F++)for(let v=0;v<s;v++)T(F,v,D)}if(u&&c){let E=a-u;for(let F=0;F<c;F++)for(let v=E;v<a;v++)T(F,v,A)}if(u&&d){let E=l-d,F=a-u;for(let v=E;v<l;v++)for(let M=F;M<a;M++)T(v,M,_)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=o,this.cellManager=new ur(o),this.cellManager.onCellAttachmentChange((s,u)=>{u?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new cr(o),this.rowManager.onRowAttachmentChange((s,u)=>{u?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),ve(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),a=t.onScrollStart(this.onScrollStart),l=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),i(),a(),l()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=qi(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:o,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,u=this.brain.isHorizontalLayoutBrain,{rowManager:c,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let x=t.start[1],D=t.end[1];m.forEach(A=>{x<=A&&A<D||f.push({start:[t.start[0],A],end:[t.end[0],A+1]})})}let h=new Map,g=f.map(this.getExtraSpanCellsForRange).flat();g&&g.forEach(([x,D])=>{h.set(`${x}:${D}`,!0)});let y=f.reduce((x,D)=>x+oa(D),0),C=r?f.reduce((x,D)=>x+Ms(D),0):0,S=this.brain.getRowCount(),b=this.brain.getColCount();d.detachCellsStartingAt([S,b]);let T=Math.min(S*b,y);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>C&&(c.poolSize=C));let I=_s(...f.map(x=>d.getCellsOutsideRenderRange(x)));I=Fs(I,x=>{let D=d.getCellPosition(x);return!(D&&h.has(`${D[0]}:${D[1]}`))}),d.detachCells(I),d.poolSize=T;let R=new Map,w=new Map;f.forEach(x=>{let{start:D,end:A}=x,[_,E]=D,[F,v]=A;for(let M=_;M<F;M++){for(let G=E;G<v;G++){let $=`${M}:${G}`;if(R.has($))continue;R.set($,!0);let{rendered:te,mapped:he}=this.isCellRenderedAndMappedCorrectly(M,G);if(M===_||G===E){let z=this.isCellCovered(M,G);if(z&&h.has(`${z[0]}:${z[1]}`)){let k=d.getCellAt([M,G]);k!=null&&d.detachCell(k);continue}}if(te&&!i&&he)continue;let ue;te?ue=d.getCellAt([M,G]):ue=d.getCellFor([M,G],u?"row":"column"),ue==null&&(ue=d.getDetachedCell()),this.renderCellAt(M,G,ue,o)}!r||w.has(M)||(w.set(M,!0),c.isRowAttachedAt(M)&&!i)||this.renderDetailRowAtElement(M,this.rowManager.getRowFor(M),r)}}),g.forEach(([x,D])=>{let{rendered:A,mapped:_}=this.isCellRenderedAndMappedCorrectly(x,D);if(A){if(i||!_){let F=[x,D],v=d.getCellAt(F);this.renderCellAt(x,D,v,o)}return}let E=d.getCellFor([x,D],u?"row":"column");E!=null&&this.renderCellAt(x,D,E,o)});let P=d.getAllCells().map(x=>x.getNode());return r&&c.getAllRows().forEach(x=>{P.push(x.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(P),P}renderDetailRowAtElement(t,o,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:o.ref});if(o.isMounted()||o.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(u,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),u=this.brain.getRowspan(t,o),c=this.brain.getColspan(t,o),d=u===1?l:this.brain.getRowHeightWithSpan(t,o,u),p=c===1?s:this.brain.getColWidthWithSpan(t,o,c),{row:f,col:m}=this.isCellFixed(t,o),h=!!a,{rowIndex:g,colIndex:y}=this.getCellRealCoordinates(t,o),C=i({rowIndex:g,colIndex:y,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:r.ref});r.isMounted()||r.onMount(b=>{let T=b.getElement();T&&(T.style.position="absolute",T.style.left="0px",T.style.top="0px"),this.updateElementPosition(b)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:g,renderColIndex:y}:void 0;if(!C){this.brain.isHorizontalLayoutBrain?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(C,r,[t,o],S),this.updateElementPosition(r,{hidden:h,rowspan:u,colspan:c})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var dr=class extends Ao{constructor(t,o){super(t,o);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage),c=le.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=Ce.columnOffsets.get(l.colIndex),f=`${aa}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(so,m));let h=`calc(var(${f}, ${p}) + ${d})`,g=`var(${so})`,y=`translate3d(${h}, ${g}, 0px)`;t.__transformValue!==y&&(t.__transformValue=y,t.style.transform=y)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function pr(n){let e=n.isHorizontalLayoutBrain?new dr(n,`${n.name}:HorizontalLayoutTableRenderer`):new Ao(n,`${n.name}:ReactHeadlessTableRenderer`),t=pe();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function _h(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=Mh(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:pr(e),[e,n.onRenderUpdater,n.renderer]);return la(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),la(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),Eh(()=>{let l=e.getRenderRange();i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o})},[i,e,t,o,a,r]),la(()=>e.onRenderRangeChange(s=>{i.renderRange(s,{force:!1,onRender:u=>{let c=a.get();c&&u&&c.length===u.length||a(u)},renderCell:t,renderDetailRow:o})}),[t,o,e,a]),fr.createElement(Bt,{updater:a})}var mr=fr.memo(_h);import*as yn from"react";import{useEffect as Gh,useLayoutEffect as Kh,useRef as Hh}from"react";import{useCallback as Fh,useState as Oh}from"react";var Rt=()=>{let[n,e]=Oh(0);return[n,Fh(()=>{e(t=>t+1)},[e])]};function Nh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Lh(n){var e=Nh(n,"string");return typeof e=="symbol"?e:String(e)}function Vh(n,e,t){return e=Lh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function Bs(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hs(Object(t),!0).forEach(function(o){Vh(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hs(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function ks(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var zh=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},ye=n=>{var e=t=>{var o=n.defaultClassName,r=Bs(Bs({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=n.variantClassNames[i][s];u&&(o+=" "+u)}}for(var[c,d]of n.compoundVariants)zh(c,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return ks(n.variantClassNames,t=>ks(t,o=>o.split(" ")[0]))}},e};var Ws=ye({defaultClassName:"nxbq1c1 _16lm1iwl _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),hr="nxbq1c0 _16lm1iwl _16lm1iw4 _16lm1iw1f _16lm1iw1d _16lm1iw18 _16lm1iwu";var js=ye({defaultClassName:"j26lrx0 _16lm1iwl _16lm1iw2 _16lm1iw1d _16lm1iw1f",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Bh}=De,kh=`${Bh}-ActiveRowIndicator`,Wh=`calc(${U.activeCellRowOffsetX} + var(${Y(U.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,jh={[Y(U.activeCellOffsetY)]:U.activeCellRowOffset,transform:`translate3d(${Wh}, calc( ${U.activeCellOffsetY} + var(${Y(U.scrollTopForActiveRow)}, 0px)), 0px)`,height:U.activeCellRowHeight,maxWidth:le.runtime.totalVisibleColumnsWidthVar},$h=n=>{let{brain:e}=n,t=Hh(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=Rt();return Kh(()=>{if(n.activeRowIndex==null)return;let a="0px",l=n.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${le.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),u=e.getItemOffsetFor(l,"vertical"),c=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${u}px`,activeCellRowOffsetX:a};Do(d,c)},[n.activeRowIndex,e]),Gh(()=>{let a=u=>{Do({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),yn.createElement("div",{className:hr,"data-name":"active-row"},yn.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${kh} ${js({active:o})}`,style:o?jh:void 0}))},$s=yn.memo($h);import*as Cn from"react";import{useEffect as Uh,useLayoutEffect as Yh,useRef as qh}from"react";var{rootClassName:Xh}=De,Zh=`${Xh}-ActiveCellIndicator`,Qh=Y(U.columnZIndexAtIndex),Jh=(n,e,t,o)=>{if(e==null)return;let[r]=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(r=r%n.rowsPerPage);let i=typeof t=="function"?t(r):t??n.getRowHeight(r),a=n.getItemOffsetFor(r,"vertical"),l=o.current;Do({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},eg=n=>{let{brain:e}=n,[t,o]=Rt(),r=qh(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];return Yh(()=>{Jh(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]),Uh(()=>{let a=e.onRenderCountChange(()=>{o()});return()=>{a()}},[e]),Cn.createElement("div",{className:hr,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${Qh}-${n.activeCellIndex[1]})`}:void 0},Cn.createElement("div",{"data-name":"active-cell-indicator",className:`${Zh} ${Ws({visible:i})}`}))},Us=Cn.memo(eg);var Ys="_1eexc2a7 _1eexc2a6",qs=ye({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),Xs=ye({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var Zs="_1eexc2a5",gr=ye({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),yr="_1eexc2a8";var Cr=[Zs,`${et}DetachedCell`];function Tr(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var ng=J(ps,Yi);function Js(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...h}=n,{autoFocus:g}=h,y=tg(null),[C,S]=og({width:0,height:0});sa(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),sa(()=>{let I=y.current?.parentNode;return I?(g&&document.activeElement!==I&&I.focus(),ln(I,()=>{let P={height:I.clientHeight,width:I.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let b=Qs(I=>{requestAnimationFrame(()=>{y.current&&y.current.style.setProperty("transform",`translate3d(${-I.scrollLeft}px, ${-I.scrollTop}px, 0px)`)})},[]),T=Qs(I=>{e.setScrollPosition(I,b)},[e,b]);return sa(()=>{let I=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),b(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),I},[e]),uo.createElement(Ts,{onContainerScroll:T,...h,ref:t},uo.createElement("div",{ref:y,className:ng,"data-name":"scroll-transform-target"},uo.createElement(mr,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:Cr}),c!=null?uo.createElement(Us,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?uo.createElement($s,{brain:e,activeRowIndex:u}):null,uo.createElement(ds,{width:C.width,height:C.height}))}import*as Eo from"react";import{useReducer as cg,createContext as dg,useMemo as pa,useEffect as pg,useState as tu,useRef as ou,useLayoutEffect as fg}from"react";function ua(n,e){let t=new Set;function o(...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 n.apply(this,s)}return{fn:o,propertyReads:t}}var ca=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function Tn(n){return n!==void 0}function Wt(n,e){let t=e[n];return Tn(t)}import{useCallback as rg,useEffect as ig,useRef as da}from"react";var eu=n=>{let e=rg(n,[]),t=da(!1),o=da(!1),r=da(),[i,a]=Rt();t.current&&(o.current=!0),ig(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};import{useCallback as ag,useRef as lg}from"react";function _e(n){let e=lg(n);return e.current=n,ag(()=>e.current,[])}import{useRef as sg,useLayoutEffect as ug}from"react";var co=(n,e)=>{let t=sg(e===void 0?n:e);return ug(()=>{t.current=n}),t.current};var mg=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)},fa;function nu(){return fa||(fa=dg(null))}function hg(n,e,t,o,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${ca(u)}Change`;if(a&&a[c]){let T=a[c](p,m);b=T.callbackName||b,S=T.callbackParams}mg(f,b,S)}let y=o[c];typeof y=="function"&&(p=y(p));let C=!!r?.[c];Wt(u,f)&&!C||n({payload:{updatedProps:null,mappedState:{[u]:p}}})}}),s},{})}function gg(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=Wt(r,e)?e[r]:e[`default${ca(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function Et(n){let e=n.getParentState||(()=>null);function t(r){let[i]=tu(()=>n.initSetupState?n.initSetupState(r):{}),a=ou(new Set),l=pa(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),u=_e(s);function c(){let w={};l&&(w=gg(l,r,i));let P={...i,...w};if(n.mapPropsToState){let{fn:x,propertyReads:D}=ua(n.mapPropsToState,{getProxyTargetFromArgs:_=>_.props,putProxyToArgs:(_,E)=>[{...E,props:_}]}),A=x({props:r,state:P,oldState:null,parentState:s});return a.current=new Set([...a.current,...D]),{...P,...A}}return P}let[d]=tu(c),p=_e(r),f=(w,P)=>{if(P.type==="REPLACE_STATE")return P.payload;let x=u?.()??null,D=P.payload.mappedState,A=P.payload.updatedPropsToState,_={...w};if(D&&Object.assign(_,D),n.mapPropsToState){let{fn:F,propertyReads:v}=ua(n.mapPropsToState,{getProxyTargetFromArgs:N=>N.props,putProxyToArgs:(N,G)=>[{...G,props:N}]}),M=F({props:p(),state:_,oldState:w,parentState:x});a.current=new Set([...a.current,...v]),Object.assign(_,M)}return P.type==="ASSIGN_STATE"&&Object.assign(_,P.payload),n.concludeReducer?n.concludeReducer({previousState:w,state:_,updatedProps:A,parentState:x}):_},[m,h]=cg(f,d),g=_e(m),{allowedControlledPropOverrides:y}=n,C=pa(()=>hg(h,g,p,l,y,n.interceptActions,n.mappedCallbacks),[h,l,y]),S=nu(),b=pa(()=>({componentState:m,componentActions:C,getComponentState:g,replaceState:w=>{h({type:"REPLACE_STATE",payload:w})},assignState:w=>{h({type:"ASSIGN_STATE",payload:w})}}),[m,C,g]),T=co(r),I=ou(!1);I.current=!1;let R=n.layoutEffect?fg:pg;return R(()=>{let w=r,P={},x=0,D={},A=0,_={},E=0;if(new Set([...Object.keys(w),...Object.keys(T)]).forEach(M=>{let N=M,G=T[N],$=w[N];if(N!=="children"&&G!==$&&(_[N]={newValue:$,oldValue:G},E++,Wt(N,r)||Wt(N,T)))if(l.hasOwnProperty(M)){let te=$,he=l[M];typeof he=="function"&&(te=he($)),m[N]!==te&&(P[N]=te,x++)}else a.current.has(M)&&(D[N]=w[N],A++)}),A>0||x>0){(n.debugName?rt(typeof n.debugName=="function"?`${n.debugName(w)}:rerender`:`${n.debugName}:rerender`):rt("rerender"))("Triggered by new values for the following props",...Object.keys(P??{}),...Object.keys(D??{}));let N={payload:{mappedState:x?P:null,updatedPropsToState:A?D:null}};if(I.current=!0,h(N),n.onPropChange){for(var v in _)if(_.hasOwnProperty(v)){let{newValue:G,oldValue:$}=_[v];n.onPropChange({name:v,newValue:G,oldValue:$},r,C,m)}}n.onPropsChange&&E&&n.onPropsChange(_,r,C,m)}}),R(()=>{s!=null&&!I.current&&h({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),eu(()=>()=>{n.cleanup?.(g())}),{contextValue:b,ContextComponent:S}}return{ManagedComponentContextProvider:Eo.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return Eo.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Ke(){let n=nu();return Eo.useContext(n)}import*as yu from"react";var Sr=()=>De;var ru="_16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",iu={center:"_16lm1iw1r",stretch:"_16lm1iw1s"};var It="_16lm1iw24 _16lm1iw25 _16lm1iw1y",au={pointer:"_16lm1iwi",default:"_16lm1iwj",colResize:"_16lm1iwk"},Mo={flex:"_16lm1iwz",contents:"_16lm1iw10",none:"_16lm1iw11",block:"_16lm1iw12",grid:"_16lm1iw13",inlineBlock:"_16lm1iw14",inlineFlex:"_16lm1iw15",inlineGrid:"_16lm1iw16"};var br={1:"_16lm1iwm",none:"_16lm1iwn"},Sn={column:"_16lm1iw1n",columnReverse:"_16lm1iw1o",row:"_16lm1iw1p",rowReverse:"_16lm1iw1q"},lu={0:"_16lm1iw18","100%":"_16lm1iw19","50%":"_16lm1iw1a"},su={center:"_16lm1iw1t",spaceBetween:"_16lm1iw1u",spaceAround:"_16lm1iw1v",start:"_16lm1iw1w",end:"_16lm1iw1x"},uu={0:"_16lm1iw1f","100%":"_16lm1iw1g",auto:"_16lm1iw1h"};var cu={none:"_16lm1iwd"},du={hidden:"_16lm1iw1y",auto:"_16lm1iw1z",visible:"_16lm1iw20"};var bn={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var pu={0:"_16lm1iw1d","100%":"_16lm1iw1e"};var fu="_16lm1iwe",mu={none:"_16lm1iw17"};var hu={visible:"_16lm1iw21",hidden:"_16lm1iw22"};var gu={1:"_16lm1iwo",10:"_16lm1iwp",100:"_16lm1iwq",1e3:"_16lm1iwr",1e4:"_16lm1iws",1e5:"_16lm1iwt",1e6:"_16lm1iwu",1e7:"_16lm1iwv","1k":"_16lm1iww","10k":"_16lm1iwx","100k":"_16lm1iwy"};function Cu(n){let{rootClassName:e}=Sr();return yu.createElement("div",{...n,className:J(`${e}Footer`,bn.relative,Mo.flex,Sn.row,n.className)})}import*as Re from"react";import{useCallback as Iy,useContext as wy,useEffect as Py,useRef as xy}from"react";import{createPortal as Dy}from"react-dom";function Rr(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}import*as Tu from"react";var Fe=n=>{let e=n.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...n.style};return Tu.createElement("svg",{viewBox:"0 0 24 24",...n,style:t},n.children)};import*as Rn from"react";var Su=n=>Rn.createElement(Fe,{...n},Rn.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29"}),Rn.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Rn.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));import*as ma from"react";var bu=n=>ma.createElement(Fe,{...n},ma.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 ha from"react";var ga=n=>ha.createElement(Fe,{...n},ha.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));import*as ya from"react";var Ru=n=>ya.createElement(Fe,{...n},ya.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));import*as Ca from"react";var Iu=n=>Ca.createElement(Fe,{...n},Ca.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));import*as Ta from"react";var wu=n=>Ta.createElement(Fe,{...n},Ta.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 Sa from"react";var Pu=n=>Sa.createElement(Fe,{...n},Sa.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));import*as ba from"react";var xu=n=>ba.createElement(Fe,{...n},ba.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));import*as Ra from"react";var Du=n=>Ra.createElement(Fe,{...n},Ra.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 _a from"react";import*as $e from"react";import{useEffect as Eg,useState as oc}from"react";import{useContext as Cg}from"react";import{createContext as yg}from"react";var Ia;function _o(){return Ia||(Ia=yg(null))}var X=()=>{let n=_o();return Cg(n)};import{useContext as Tg}from"react";var vu=()=>{let n=_o(),{state:e}=Tg(n);return e};import*as Fo from"react";import{useEffect as Sg,useLayoutEffect as bg,useState as $u}from"react";var Au="_1eexc2a6";var Eu=ye({defaultClassName:"_12zfob129 _16lm1iw19 _16lm1iw1c _16lm1iwz _16lm1iw1p _16lm1iw1r _16lm1iw1w",variantClassNames:{filtered:{false:"_12zfob12a",true:"_12zfob12b"},verticalAlign:{start:"_12zfob12c",end:"_12zfob12d",center:"_12zfob12e"},align:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"}},defaultVariants:{},compoundVariants:[]}),Mu="_12zfob1n _16lm1iw24 _16lm1iw25 _16lm1iw1y",_u=ye({defaultClassName:"_12zfob1o",variantClassNames:{rowActive:{false:"_12zfob1p",true:"_12zfob1q"},cellSelected:{false:"_12zfob1r",true:"_12zfob1s"},rowSelected:{false:"_12zfob1t",true:"_12zfob1u",null:"_12zfob1v"},rowDisabled:{false:"_12zfob1w",true:"_12zfob1x"},firstRow:{false:"_12zfob1y",true:"_12zfob1z"},treeNode:{parent:"_12zfob110",leaf:"_12zfob111",false:"_12zfob112"},firstRowInHorizontalLayoutPage:{false:"_12zfob113",true:"_12zfob114"},groupRow:{false:"_12zfob115",true:"_12zfob116"},groupCell:{false:"_12zfob117",true:"_12zfob118"},align:{start:"_12zfob119",end:"_12zfob11a",center:"_12zfob11b"},verticalAlign:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},zebra:{false:"_12zfob11f",even:"_12zfob11g",odd:"_12zfob11h"},dragging:{true:"_12zfob11i",false:"_12zfob11j"},insideDisabledDraggingPage:{true:"_12zfob11k",false:"_12zfob11l"},first:{true:"_12zfob11m",false:"_12zfob11n"},last:{true:"_12zfob11o",false:"_12zfob11p"},groupByField:{true:"_12zfob11q",false:"_12zfob11r"},firstInCategory:{true:"_12zfob11s",false:"_12zfob11t"},lastInCategory:{true:"_12zfob11u",false:"_12zfob11v"},pinned:{start:"_12zfob11w",end:"_12zfob11x",false:"_12zfob11y"},filtered:{true:"_12zfob11z",false:"_12zfob120"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob121"],[{pinned:"end",firstInCategory:!0},"_12zfob122"],[{pinned:!1,lastInCategory:!0},"_12zfob123"]]}),Fu=ye({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"]]}),Ou="_12zfob12r _16lm1iw1c _16lm1iw19";var Nu="_12zfob17",Lu="_12zfob12n _16lm1iwz _16lm1iw1p _16lm1iw1r _16lm1iw1",Vu=ye({defaultClassName:"_12zfob12o _16lm1iw1 _16lm1iw1d",variantClassNames:{disabled:{true:"_12zfob12p",false:"_12zfob12q"}},defaultVariants:{},compoundVariants:[]}),wa=ye({defaultClassName:"_12zfob12k _16lm1iwz _16lm1iw1p _16lm1iw1s _16lm1iw1",variantClassNames:{active:{true:"_12zfob12l",false:"_12zfob12m"}},defaultVariants:{},compoundVariants:[]}),zu="_12zfob12j _16lm1iwz _16lm1iw1p _16lm1iw1r",Gu=ye({defaultClassName:"_12zfob124 _16lm1iw1 _16lm1iwz _16lm1iw1n _16lm1iw1v _16lm1iw22",variantClassNames:{menuVisible:{true:"_12zfob125"},reserveSpaceWhenHidden:{true:"_12zfob126",false:"_12zfob127"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob128"]]}),Ku="_12zfob18 _16lm1iw2",Hu="_16lm1iw1",Bu="_12zfob16",ku=ye({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Wu="_12zfob12i _16lm1iw1y _16lm1iw1 _16lm1iwz _16lm1iw1p";var it="InfiniteIcon";var ju="_6aunoi0 _16lm1iwz _16lm1iw1n _16lm1iw1 _16lm1iw1v _16lm1iw1r";var Rg={transition:"width 0.25s, opacity 0.25s"};function Oo(n){let[e,t]=$u(!0),[o,r]=$u(0),{lineWidth:i=1,style:a,className:l,index:s}=n,u=s!=null&&s>0,c=n.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...Rg,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if(Sg(()=>{if(!e)return;let h=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(h)}},[e]),bg(()=>{t(!0)},[]),!e)return null;let m={};return Fo.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:J(l,it,ju,`${it}-filter`)},u?Fo.createElement("div",{"data-name":"index",style:m,className:Nu},s):null,Fo.createElement("div",{style:{width:p[0],...f}}),Fo.createElement("div",{style:{width:p[1],...f}}),Fo.createElement("div",{style:{width:p[2],...f}}))}var Pa=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],u=[];t.forEach((R,w)=>{let P=R.maxSize??r??void 0,x=R.minSize??o??void 0;s.push(x),u.push(P),R.size!=null&&(P!=null&&R.size>P&&(R.size=P),x!=null&&R.size<x&&(R.size=x));let D=R.flex==0?null:R.flex;if(R.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??0,i+=R.size??0});let c=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((R,w)=>{if(R.flex!=null){let P=d*R.flex,x=R.maxSize??r??void 0,D=R.minSize??o??void 0,A=!1,_=0;x!=null&&P>x&&(p[w]=!0,A=!0,_=x),D!=null&&P<D&&(f[w]=!0,A=!0,_=D),A&&(m+=1,l-=1,a-=R.flex,c-=_)}}),m&&(d=c/a);let h=[],g=0,y=c,C=a,S=0,b=0,T=[];return{items:t.map((R,w)=>{let P={...R},x=R.maxSize??r??void 0,D=R.minSize??o??void 0,A=0,_=p[w],E=f[w],F=_||E,v=R.size??0;if(R.flex!=null){if(F)E&&(A=D),_&&(A=x);else{g+=1;let M=N=>(x!=null&&N>x&&(N=x),D!=null&&N<D&&(N=D),N);g===l?A=M(y):(A=M(Math.round(R.flex*d)),b+=A,y=c-b,C-=R.flex,d=y/C)}v=A,P.flexSize=A}return h.push(A),T.push(v),P.computedSize=v,S+=v,P}),flexSizes:h,minSizes:s,maxSizes:u,computedSizes:T,remainingSize:Math.round(e-S)}};function Ir(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}var xa=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((x,D)=>(x[D]={...n.columnSizing[D]},x),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],u=l.id,c=s?.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",h=s?.computedWidth,g=s?.computedMinWidth,y=s?.computedMaxWidth,C=s?.computedFlex?"flex":"width",S=!1,b=!1,T=r>0?1:-1,{value:I,clamped:R,diff:w}=Ir(d+r,p,f,T);if(n.shareSpaceOnResize){if(s==null)return o[u]={...o[u],[m]:I},b=R==="min",S=R==="max",{adjustedDiff:I-d,reservedWidth:t,columnSizing:o,minReached:b,maxReached:S,constrained:b||S};let{value:x,clamped:D,diff:A}=Ir(h-r,g,y,T);if(R&&D&&(Math.abs(w)>Math.abs(A)?D=!1:R=!1),!(!R&&!D)){if(R){let _=Ir(h-r-w,g,y,T);x=_.value,D=_.clamped,A=_.diff}else if(D){let _=Ir(d+r+A,p,f,T);I=_.value,R=_.clamped,w=_.diff}}o[u]={...o[u],[m]:I},o[c]={...o[c],[C]:x},b=R==="min"||D==="min",S=R==="max"||D==="max"}else o[u]={...o[u],[m]:I},b=R==="min",S=R==="max";let P=I-d;return{adjustedDiff:P,reservedWidth:n.shareSpaceOnResize?t:t-P,columnSizing:o,minReached:b,maxReached:S,constrained:b||S}};function Uu(n,e){return n+e}function Ig(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var Yu=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((y,C)=>(y[C]={...n.columnSizing[C]},y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((y,C)=>n.dragHandlePositionAfter-C).reverse(),a=i.map(y=>n.items[y]),l=a.map(y=>y.computedWidth),s=a.map(y=>y.computedFlex?"flex":"width"),u=0,{computedSizes:c}=Pa({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(Uu,0)+r-u,0)}),d=a.map((y,C)=>c[C]-y.computedWidth),p=!0,f=!0,m=!0,h=[];d.forEach((y,C)=>{let S=a[C];if(!S.resizable){h.push(0);return}let b=s[C],T=l[C],I=Ig(o),{maxReached:R,minReached:w,constrained:P,adjustedDiff:x}=xa({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[C],shareSpaceOnResize:!1,items:n.items,columnSizing:I});o[S.id]={...I[S.id],[b]:T+x},h.push(x),R||(f=!1),w||(p=!1),P||(m=!1)});let g=h.reduce(Uu,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:h,adjustedDiff:g,columnSizing:o,reservedWidth:t-g}};var wr;function jt(){if(wr!=null)return wr;let n=Ee().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),wr=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),wr}var qu=["start",void 0,"end"],Xu=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:qu.indexOf(r)-qu.indexOf(i)}),n);function Zu(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function Da(n,...e){return Zu(t=>t!=null,n,...e)}function Qu(n,e,...t){return Zu((o,r)=>!(r in n),e,...t)}var Pr=Object.freeze({}),wg={string:Pr,number:{}};function va(n,e){let t=e.default||Pr;return n.type===void 0?t:n.type===null?Pr:typeof n.type=="string"?e[n.type]||wg[n.type]||Pr:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var xr=!0,Pg=!0,xg=!0,Dg="string",No="unknown",vg=Ht("getComputedVisibleColumns"),Ag=(n,e,t)=>n[t]!==!1,Aa=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1},Ju=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:u,pinnedEndMaxWidth:c,filterValue:d,sortable:p,sortInfo:f,multiSort:m,filterTypes:h=po,viewportReservedWidth:g,resizableColumns:y,draggableColumns:C,columnDefaultDraggable:S,columnOrder:b,columnPinning:T,editable:I,columnDefaultEditable:R,columnDefaultFilterable:w,columnDefaultSortable:P,columnSizing:x,columnTypes:D,columnVisibility:A,columnVisibilityAssumeVisible:_})=>{let E=0,F=(d||[]).reduce((H,ne)=>{let{id:K,field:re}=ne;return re&&(H[re]=ne),K&&(H[K]=ne),H},{}),v=Xu(b===!0?Object.keys(n):b,T),M=v.filter(H=>n[H]?Ag(A,_,H):(vg(`Column with id "${H}" specified in columnOrder array cannot be found in the columns map.`),!1)),N=new Map,G=M.map((H,ne)=>{let K=n[H];return N.set(H,ne),K}),$=(f??[]).reduce((H,ne,K)=>(ne.id?H[ne.id]={sortInfo:ne,index:K}:ne.field&&(H[ne.field]={sortInfo:ne,index:K}),H),{});function te(H){let ne=n[H],K=va(ne,D),re={minWidth:K?.minWidth,maxWidth:K?.maxWidth,width:K?.defaultWidth,flex:K?.defaultFlex},ge=Da({width:ne?.defaultWidth,flex:ne?.defaultFlex,minWidth:ne?.minWidth,maxWidth:ne?.maxWidth},x[H]);ge.width!=null&&delete re.flex,ge.flex!=null&&delete re.width,ge=Da(re,ge);let ie=ge.flex??void 0,We=ge.minWidth??ne?.minWidth??t,dt=ge.maxWidth??ne?.maxWidth??o,bt=ie!=null?void 0:ge.width??(i?void 0:r);return!bt&&ie==null&&(i?ie=i:bt=We),{size:bt,flex:ie,minSize:We,maxSize:dt}}let he=Pa({availableSize:Math.max(e.width-(g??0)-(a??jt()),0),maxSize:o,minSize:t,items:M.map(te)}),{computedSizes:ue,flexSizes:z,minSizes:k,maxSizes:ae}=he,oe=[],W=[],V=[],L=[];L.length=M.length;let Z=new Map,j=new Map,se=0,Q=0,O=0,be=null,Te=[],B=0,ee=0,ce=0;G.forEach((H,ne)=>{let K=M[ne],re=ue[ne],ge=Te[ne]=Aa(K,T);ge==="start"?B+=re:ge==="end"?ce+=re:ee+=re});let xe=e.width-ce,we=[],Ne=new Map;M.forEach((H,ne)=>{let K=G[ne];Ne.set(H,K)});let Ae=[];Object.keys(n).forEach(H=>{let ne=n[H];Ae.push(H),Ne.has(H)||Ne.set(H,ne)});let He=new Map;Ne.forEach((H,ne)=>{let K=N.get(ne);K==null&&(K=-1);let re=K!=-1,ge=M[K+1],ie=va(H,D),We=K,dt=$[ne]?$[ne]:H.field?$[H.field]??null:null,bt=dt?.sortInfo??null,io=!!bt,wo=io&&bt.dir===1,Yn=io&&!wo,qn=dt?.index??-1,Jo=re?{}:te(ne),Xn=re?ue[K]:Jo.size||0,_i=re&&z[K]||null,Fi=re?k[K]||0:Jo.minSize||0,Oi=re?ae[K]||1e4:Jo.maxSize||1e4,de=re?Aa(ne,T):!1,je=re?K===M.length-1:!1,pt=We,ht=re?de==="start"?Q:de==="end"?O:E-Q:0;de=="start"?pt=re?We:-1:de==="end"?pt=re?We-(oe.length+V.length):-1:pt=re?We-oe.length:-1;let en=re?de==="start"||de===!1?E:xe+O:-1,zm=re?de!==be:!1,Gm=re?je||de!==Aa(ge,T):!1,Yl=H.cssEllipsis??ie.cssEllipsis??l,Km=H.headerCssEllipsis??ie.cssEllipsis??H.cssEllipsis??ie.headerCssEllipsis??s??Yl,Zn=re&&(F[ne]||H.field||H.groupByForColumn)&&(F[ne]||F[H.field||H.groupByForColumn])||null,Hm=H.defaultFilterable??ie.defaultFilterable??w??!0,Bm=I??H.defaultEditable??ie.defaultEditable??R??!1,Ni=H.dataType||ie.dataType||(Array.isArray(H.type)?H.type[0]:H.type)||Dg,km=H.sortType||ie.sortType||Ni,ql=H.filterType||ie.filterType||Ni,Xl=!1;if(Zn!=null&&!Zn.disabled){let Vi=h[ql];Vi&&(!Vi.emptyValues||!Vi.emptyValues.includes(Zn.filter.value))&&(Xl=!0)}let Zl=H.field??ie.field,Ql=H.valueGetter??ie.valueGetter,Li=H.defaultSortable??ie.defaultSortable;Li==null&&!H.groupByForColumn&&Zl==null&&Ql==null&&(Li=!1);let Wm=p??Li??P??xr,jm=H.resizable??ie.resizable??y??Pg,ze={colType:ie,align:ie.align,headerAlign:ie.headerAlign,computedVisible:re,verticalAlign:ie.verticalAlign,defaultHiddenWhenGroupedBy:ie.defaultHiddenWhenGroupedBy,valueGetter:Ql,valueFormatter:ie.valueFormatter,renderValue:ie.renderValue,render:ie.render,style:ie.style,contentFocusable:ie.contentFocusable,renderMenuIcon:ie.renderMenuIcon,renderSortIcon:ie.renderSortIcon,renderRowDetailIcon:ie.renderRowDetailIcon,renderSelectionCheckBox:ie.renderSelectionCheckBox,renderHeaderSelectionCheckBox:ie.renderHeaderSelectionCheckBox,headerStyle:ie.headerStyle,headerClassName:ie.headerClassName,columnGroup:ie.columnGroup,getValueToEdit:ie.getValueToEdit,getValueToPersist:ie.getValueToPersist,shouldAcceptEdit:ie.shouldAcceptEdit,field:Zl,...H,components:{...ie.components,...H.components},computedResizable:jm,computedMinWidth:Fi,computedMaxWidth:Oi,computedFlex:_i,computedDataType:Ni,computedEditable:Bm,computedSortType:km,computedFilterType:ql,cssEllipsis:Yl,headerCssEllipsis:Km,computedFilterValue:Zn,computedFiltered:Xl,computedFilterable:Hm,computedWidth:Xn,computedAbsoluteOffset:en,computedPinningOffset:ht,computedVisibleIndexInCategory:pt,computedOffset:E,computedSortable:Wm,computedSortInfo:bt,computedSortIndex:qn,computedMultiSort:m,computedSorted:io,computedSortedAsc:wo,computedSortedDesc:Yn,computedVisibleIndex:We,computedPinned:de,computedDraggable:C??H.defaultDraggable??S??xg,computedFirstInCategory:zm,computedLastInCategory:Gm,computedFirst:K===0,computedLast:je,id:ne,header:H.header??ie.header??H.name??H.field};re&&(E+=Xn,Z.set(ze.id,ze),L[K]=ze,de==="start"&&(oe.push(ze),Q+=ze.computedWidth),de==="end"&&(W.push(ze),O+=ze.computedWidth),de||(V.push(ze),se+=ze.computedWidth),be=de),ze.groupByForColumn&&(ze.computedSortType=H.sortType||ie.sortType||No,we.push(ze)),j.set(ze.id,ze),ze.field&&!ze.groupByForColumn&&!He.has(ze.field)&&He.set(ze.field,ze)}),we.forEach(H=>{H.computedSortable=ec(H,{fieldsToColumn:He,sortable:p,columnDefaultSortable:P})});let Ue=new Map;Ae.forEach(H=>{let ne=j.get(H);ne&&Ue.set(H,ne)}),j.forEach(H=>{Ue.has(H.id)||Ue.set(H.id,H)});let ke=u!=null?Math.min(u,Q):Q,nt=c!=null?Math.min(c,O):O;return{computedRemainingSpace:e.width-(B+ce+ee),computedPinnedStartColumnsWidth:Q,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:se,computedColumnOrder:v,computedPinnedStartColumns:oe,computedPinnedEndColumns:W,computedUnpinnedOffset:Q,computedPinnedEndOffset:Q+se,computedUnpinnedColumns:V,computedVisibleColumns:L,computedColumnsMap:j,computedColumnsMapInInitialOrder:Ue,computedVisibleColumnsMap:Z,computedPinnedEndWidth:nt,computedPinnedStartWidth:ke,renderSelectionCheckBox:L.reduce((H,ne)=>H||!!ne.renderSelectionCheckBox,!1),fieldsToColumn:He}};function ec(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r}=e;if(t)return t;let i=n.defaultSortable??n.colType.defaultSortable;if(i!=null)return i;let a=r??xr;return n.computedSortType!==No&&a?!0:s=>{let{column:u,api:c}=s,d=u.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((p,f)=>{if(!p)return!1;let m=f.field||f.groupField,h;if(m){let g=o.get(m),y=g?c.getColumnApi(g.id):void 0;g&&y?h=y.isSortable():h=!1}return h===void 0&&f.valueGetter&&(h=!0),h??r??xr},!0)}}function qe(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},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 Dr(n,e){let t=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,{api:o,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 h=qe(t.id,{...e,actions:a,dataSourceActions:l,dataSourceApi:s});m=t.header({horizontalLayoutPageIndex:null,column:t,columnApi:h,dataSourceApi:s,insideColumnMenu:!0,dragging:!1,columnsMap:f.computedColumnsMap,columnSortInfo:t.computedSortInfo,columnFilterValue:t.computedFilterValue,filtered:t.computedFiltered,allRowsSelected:c,someRowsSelected:d,selectionMode:p,api:o,renderBag:{header:m}})??null}return m}import*as tc from"react";var vr=`${et}HeaderCell__filter`,Ea=`${et}HeaderCell__filterOperator`,Ma=tc.createContext(null);var Mg=`${vr}__input`,Ar=n=>n.stopPropagation();function nc(n){let{filterOperatorMenuVisibleForColumnId:e}=vu(),{column:t}=Er(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=oc(!1),l=$e.useCallback(()=>{a(!0)},[]),s=$e.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return $e.createElement("div",{onPointerUp:Ar,onPointerDown:Ar,onFocus:l,onBlur:s,className:`${vr} ${wa({active:u})}`,style:{height:n.columnHeaderHeight}},$e.createElement(Ma.Provider,{value:n},$e.createElement(r,null),$e.createElement(o,null)))}function rc(){let{columnApi:n,disabled:e,operator:t}=In(),o=t?.components?.Icon??Oo;return $e.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:J(Ea,Lu,e?`${Ea}--disabled`:"")},$e.createElement(o,{size:20,className:`${Vu({disabled:e})}`}))}function ic(){return $e.createElement("div",{onPointerUp:Ar,onPointerDown:Ar,className:`${vr} ${wa({active:!1})} ${lu["50%"]}`})}function In(){let n=X(),{column:e,columnApi:t}=Er(),o=Dr(e,n),r=$e.useContext(Ma),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=oc(l?.filter.value??""),d=$e.useCallback(g=>{c(g),r.onChange(g)},[r.onChange]),p=$e.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),f=$e.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);Eg(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let g=[...s.emptyValues][0];g!==u&&c(g)}},[l?.filter.value]);let m=r.operator,h=m?.name;return{api:n.api,column:e,columnFilterValue:l,columnApi:t,operatorName:h,operator:m,value:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${o}`,className:`${Ou} ${Mg}`}}function Lo(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=In();return _a.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function Mr(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=In();return _a.createElement("input",{"aria-label":n,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:o})}function _g(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:Lo},operators:[{name:"includes",components:{Icon:Su},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:ga},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:Du},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:bu},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Mr},operators:[{label:"Equals",components:{Icon:ga},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:xu},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:Iu},fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>t},{name:"gte",components:{Icon:Ru},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>=t},{name:"lt",components:{Icon:Pu},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<t},{name:"lte",components:{Icon:wu},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<=t}]}}}var po=_g();function _r(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as wc,useState as jg}from"react";var ac="_16lm1iw1",lc="_1yeub2v0 _16lm1iw1 _16lm1iwz _16lm1iw1n _16lm1iw0",sc="_1yeub2vs",uc="_1yeub2vr",cc=ye({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var Fa="_1yeub2vp";var zD=ye({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Oa=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};var wn={bodyWidth:{name:Y(le.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Y(le.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Y(le.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Y(le.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Y(le.runtime.browserScrollbarWidth),value:""}},Fg=Y(U.scrollbarWidthHorizontal),dc=Y(U.scrollbarWidthVertical),Og=Y(U.columnWidthAtIndex),Ng=Y(U.columnZIndexAtIndex),pc=Y(U.scrollLeft),Lg=Y(U.activeCellColWidth),fc=Y(U.activeCellColOffset),yc=Y(U.baseZIndexForCells),Vg=Y(U.pinnedStartWidth),mc=Y(U.bodyWidth),zg=Y(U.bodyHeight),hc=Y(U.pinnedEndOffset),gc=Y(U.pinnedEndWidth),Gg=Y(U.computedVisibleColumnsCount);function Na(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${yc}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Cc(n){let e=jt(),{computed:t,state:o,actions:r,getState:i}=X(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:u,onBlurWithin:c,onFocusWithin:d,onSelfFocus:p,onSelfBlur:f,bodySize:m,activeCellIndex:h,wrapRowsHorizontally:g}=o,{computedPinnedStartColumnsWidth:y,computedPinnedEndColumnsWidth:C,computedPinnedStartColumns:S,computedPinnedEndColumns:b,computedVisibleColumns:T,computedUnpinnedColumnsWidth:I,scrollbars:R}=t,w=[],P=T.reduce((v,M)=>{let N=M.computedVisibleIndex;v[Ce.columnWidths.varName.get(N)]=M.computedWidth+"px",v[Ce.columnOffsets.varName.get(N)]=M.computedPinned==="start"?`calc( ${M.computedOffset}px + var(${pc}) )`:M.computedPinned==="end"?`calc( var(${hc}) ${w.length?"+":""} ${w.map($=>Ce.columnWidths.get($.computedVisibleIndex)).join(" + ")} + var(${pc}) )`:`${M.computedOffset}px`;let G=Na(M,{pinnedStartColsCount:S.length,visibleColsCount:T.length});return v[`${Ng}-${N}`]=`${G}`,M.computedPinned==="end"&&w.push(M),v},{});if(m.width&&(P[wn.browserScrollbarWidth.name]=`${jt()}px`),P[wn.bodyWidth.name]=`calc(${U.bodyWidth} - ${U.scrollbarWidthVertical})`,P[wn.totalVisibleColumnsWidthValue.name]=`${y+C+I}px`,P[wn.totalVisibleColumnsWidthVar.name]=`calc(${T.map((v,M)=>`var(${Og}-${M})`).join(" + ")})`,P[wn.visibleColumnsCount.name]=T.length,h!=null){P[Lg]=Ce.columnWidths.get(h[1]);let v=Ce.columnOffsets.get(h[1]);if(o.brain.isHorizontalLayoutBrain){let M=o.brain.getPageIndexForRow(h[0]);P[fc]=M?`calc( ${le.runtime.totalVisibleColumnsWidthVar} * ${M} + ${v})`:v}else P[fc]=v}P[Gg]=T.length,P[Fg]=R.horizontal?`${e}px`:"0px",P[dc]=R.vertical?`${e}px`:"0px",P[Vg]="calc( "+S.map(v=>Ce.columnWidths.get(v.computedVisibleIndex)).join(" + ")+")",P[gc]="calc( "+b.map(v=>Ce.columnWidths.get(v.computedVisibleIndex)).join(" + ")+")",P[yc]=T.length*10,P[hc]=`calc( var(${mc}) - var(${gc}) - var(${dc}) )`,P[mc]=`${m.width}px`,P[zg]=`${m.height}px`;let x=Oa(v=>{r.focused=v}),D=Oa(v=>{r.focusedWithin=v}),E={...n,onFocus:v=>{if(n?.onFocus?.(v),v.target===s.current||v.target===u.current){if(i().focused)return;x(!0),p?.(v),l&&(D(!1),c?.(v));return}l||(D(!0),d?.(v))},onBlur:v=>{if(n?.onBlur?.(v),v.target===s.current||v.target===u.current){if(!i().focused)return;x(!1),f?.(v),l&&(D(!1),c?.(v));return}s.current?.contains(v.relatedTarget)||(D(!1),c?.(v))}},F=J(Mt,lc,g?`${Mt}--horizontal-layout`:null,E?.className,y?`${Mt}--has-pinned-start ${uc}`:null,C?`${Mt}--has-pinned-end ${sc}`:null,a?`${Mt}--focused`:null,l?`${Mt}--focused-within`:null,a&&o.focusedClassName?o.focusedClassName:null,l&&o.focusedWithinClassName?o.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${Mt}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${Mt}--has-pinned-end-overflow`:null,cc({horizontalLayout:!!g,hasPinnedStart:!!y,hasPinnedEnd:!!C,focused:a,focusedWithin:l}));return E.className=F,E.style={...n?.style,...P},a&&o.focusedStyle&&Object.assign(E.style,o.focusedStyle),l&&o.focusedWithinStyle&&Object.assign(E.style,o.focusedWithinStyle),E}var Rc=tn(vo());function Fr(n){return n.map(e=>e instanceof at?e:new at(null,[e]))}var at=class{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new at("+",[this,...e])}subtract(...e){return new at("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new at("*",[this,...e])}divide(...e){return new at("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>Kg(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function Kg(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var Hg=(...n)=>new at("+",Fr(n)),Tc=(...n)=>new at("-",Fr(n)),Bg=(...n)=>new at("*",Fr(n)),kg=(...n)=>new at("/",Fr(n)),Or={add:Hg,subtract:Tc,minus:Tc,multiply:Bg,divide:kg};var Pn=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var Sc=n=>{let e=null,t=null;return{stop(){e!==null&>(e),t!=null&>(t)},scroll(o){e!==null&>(e),t!=null&>(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let 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 o.scrollLeft=o.scrollLeft-p,e=ve(()=>{i.scroll(o)}),!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 o.scrollLeft=o.scrollLeft+p,t=ve(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var bc=10,Wg=Y(U.pinnedStartWidth);function Ic(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,setProxyPosition:d,api:p,horizontalLayoutPageIndex:f,pageWidth:m}=n;function h(W){let V=W==="start"?E:F;return D===_?V:_===W?V+P.computedWidth:D===W?V-P.computedWidth:V}function g(W){if(W.columnIndex===x||f!=null)return!0;let V=e[W.columnIndex];if(V.computedPinned)return!0;let L=l.getScrollPosition().scrollLeft,Z=V.computedOffset+(f!=null&&m!=null?m*f:0);return Z>=L+h("start")&&Z+V.computedWidth<=L+c.width-h("end")}let y=(W,V)=>{let{restrictToParentGroup:L,dragColumn:Z}=V,j=[];if(W.forEach(Q=>{if(Q.computedVisibleIndex===x)return;let O={columnId:Q.id,columnIndex:Q.computedVisibleIndex,offsetX:Q.computedOffset+Math.round(Q.computedWidth/2)};g(O)&&j.push(O)}),L){let O=function(Te,B,ee){let ce=W[Te];ce&&(ce.columnGroup!==Z.columnGroup&&ee.add(ce.id),O(Te+B,B,ee))};var se=O;let Q=Z.computedVisibleIndex,be=new Set;O(Q-1,-1,be),O(Q+1,1,be),j=j.filter(Te=>!be.has(Te.columnId))}return j},S=r.length,b={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},T={left:b.clientX-c.left-(b.clientX-s.left)+bc,top:b.clientY-c.top-(b.clientY-s.top)+bc},I=l.getScrollPosition(),R=e.map(W=>W.computedVisibleIndex),w=R,P=t.get(i),x=P.computedVisibleIndex,D=P?.computedPinned,A=x,_=D,E=l.getFixedStartColsWidth(),F=l.getFixedEndColsWidth(),v=b,M={x:0,y:0},N=1,G=0;function $(W){let V=Math.round(W.clientX),L=Math.round(W.clientY);if(V===v.clientX&&L===v.clientY)return;v={clientX:V,clientY:L};let j=l.getScrollPosition().scrollLeft-I.scrollLeft;M.x=v.clientX-b.clientX,M.y=v.clientY-b.clientY,G=M.x+j,N=G<0?-1:1,d({left:T.left+M.x,top:T.top+M.y})}function te(W){let V=0;D?D==="start"&&W.forEach((L,Z)=>{V||e[L]?.computedPinned!=="start"&&(V=Z)}):W.forEach((L,Z)=>{e[L]?.computedPinned==="start"&&(V=Z+1)}),S=V,he("start",W,V)}function he(W,V,L){if(W==="start"){let Z=0;for(let j=0;j<L;j++){let se=V[j],Q=e[se];Z+=Q.computedWidth}vt(Wg,`${Z}px`,a)}}function ue(W){if(W==null||W===A)return;A=W;let V=Pn(R,x,A>x?A-1:A);S=0;let Z=new Set;return V.forEach((j,se)=>{let Q=w[se];j!==Q&&Z.add(j),te(V)}),w=V,z(Z),{newColumnIndexes:V,indexesWithTransition:Z,pinnedStartCount:S}}function z(W){e.forEach(V=>{let L=V.computedVisibleIndex;W.has(L)?Ds(L,a):ir(L,a);let Z=L===x,j=N===-1?L<A||L>x:L<x||L>=A,se="";N===-1?se=Z?Ce.columnOffsets.get(A):j?Ce.columnOffsets.get(L):Or.add(Ce.columnOffsets.get(L),Ce.columnWidths.get(x)).done():se=j?Ce.columnOffsets.get(L):Z?Or.add(Ce.columnOffsets.get(A-1),Ce.columnWidths.get(A-1)).minus(Ce.columnWidths.get(x)).done():Or.minus(Ce.columnOffsets.get(L),Ce.columnWidths.get(x)).done(),cn(L,se,a)})}let k=c.left+h("start"),ae=c.right-h("end"),oe=Sc({scrollOffsetStart:k,scrollOffsetEnd:ae});return $(b),{speedScroller:oe,stop(){oe.stop()},onMove(W){$(W),oe.scroll({mousePosition:v,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(Q){p.scrollLeft=Q}});let V=y(e,{dragColumn:P,restrictToParentGroup:u==="group"}),L=N===-1?P.computedOffset+G:P.computedOffset+P.computedWidth+G,Z=(0,Rc.default)(V,L,({offsetX:Q},O)=>Q<O?-1:Q>O?1:0);Z<0&&(Z=~Z),V.length?Z=V[Z]?V[Z].columnIndex:V[V.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),Z=0),Z===x+1&&(Z=x),ue(Z);let j={};o.forEach(Q=>{j[Q.id]="end"});for(let Q=0;Q<S;Q++){let O=w[Q],be=e[O];j[be.id]="start"}let se=w.map(Q=>e[Q].id);return{columnPinning:j,columnOrder:se}}}}function $t(n,e,t){if(n===e)return!0;if(!n||!e)return!1;var o=Object.keys(n),r=Object.keys(e);t&&(o=o.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=o.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=o[a];if(!(t&&t.has(l))&&(n[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function La(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return o;if(a>i){let l=e.indexOf(r),s=e[l-1],u=o.indexOf(s),c=o.indexOf(r);return Pn(o,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=o.indexOf(s),c=o.indexOf(r);return Pn(o,c,u)}return e}var $g=Y(U.baseZIndexForCells),Ug=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:$t(n,e)},Pc=({columnId:n,domRef:e,horizontalLayoutPageIndex:t})=>{let[o,r]=jg(null),{actions:i,computed:a,getComputed:l,getState:s,api:u,state:{domRef:c}}=X(),d=wc(f=>{let m=l().computedVisibleColumnsMap.get(n);if(!m||!m.computedSortable)return;let{multiSortBehavior:h}=s();u.toggleSortingForColumn(n,{multiSortBehavior:h==="replace"&&(f.ctrlKey||f.metaKey)?"append":h})},[]),p=wc(f=>{let m=f.target?.tagName;if(m==="INPUT"||m==="BUTTON")return;let{brain:h,draggableColumnsRestrictTo:g}=s(),{computedVisibleColumns:y,computedVisibleColumnsMap:C,computedPinnedStartColumns:S,computedUnpinnedColumns:b,computedPinnedEndColumns:T}=l(),I=C.get(n);if(!I.computedDraggable){d(f);return}let R=e.current,w=R.getBoundingClientRect(),P=c.current.getBoundingClientRect(),x=h.getAvailableSize(),D=I.computedVisibleIndex,A=h.getVirtualColIndex(I.computedVisibleIndex,{pageIndex:t||0}),_=h.isHorizontalLayoutBrain?h.getPageWidth():null,E=R.style.cursor??"auto",F=!1,v=Ic({brain:h,horizontalLayoutPageIndex:t,pageWidth:_,draggableColumnsRestrictTo:g,computedPinnedEndColumns:T,computedPinnedStartColumns:S,computedUnpinnedColumns:b,computedVisibleColumns:y,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:w,dragColumnId:n,api:u,infiniteDOMNode:c.current,setProxyPosition:r,tableRect:P,initialMousePosition:{clientX:f.clientX,clientY:f.clientY}}),M=null,N,G;function $(ue){let{columnPinning:z,columnOrder:k}=ue;Ug(s().columnPinning,z)||(i.columnPinning=z);let ae=l().computedColumnOrder;JSON.stringify(k,ae)&&(y.forEach(oe=>{cn(oe.computedVisibleIndex,"",c.current)}),i.columnOrder=La({newColumnOrder:k,visibleColumnOrder:l().computedVisibleColumns.map(oe=>oe.id),existingColumnOrder:ae,dragColumnId:n}))}let te=ue=>{let{headerBrain:z,brain:k}=s();if(!F){F=!0;let ae=k.keepColumnRendered(A),oe=z.keepColumnRendered(A);if(k.isHorizontalLayoutBrain){let V=k.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),L=z.extendRenderRange({start:!0,end:!0,direction:"horizontal"});G=()=>{V(),L()}}N=()=>{ae(),oe()},i.columnReorderDragColumnId=I.id,t!=null&&(i.columnReorderInPageIndex=t),Qi(D,`calc( var(${$g}) + 10000 )`,c.current),c.current?.classList.add(Fa),R.style.cursor="grabbing"}M=v.onMove(ue)},he=ue=>{let{multiSortBehavior:z}=s(),k=e.current;c.current?.classList.remove(Fa),v.stop(),h.update({...x}),N?.(),G?.(),y.forEach(oe=>{ir(oe.computedVisibleIndex,c.current),cn(oe.computedVisibleIndex,"",c.current)}),Qi(D,Na(I,{pinnedStartColsCount:S.length,visibleColsCount:y.length}),c.current),k.style.cursor=E,k.releasePointerCapture(ue.pointerId),k.removeEventListener("pointermove",te),k.removeEventListener("pointerup",he),r(null);let ae=u.getColumnApi(I.id)?.isSortable()??!1;!F&&ae&&u.toggleSortingForColumn(I.id,{multiSortBehavior:z==="replace"&&(ue.ctrlKey||ue.metaKey)?"append":z}),M&&$(M),i.columnReorderDragColumnId=!1,t!=null&&(i.columnReorderInPageIndex=null)};R.addEventListener("pointermove",te),R.addEventListener("pointerup",he),R.setPointerCapture(f.pointerId)},[n,t]);return{onPointerDown:a.computedVisibleColumnsMap.get(n)?.computedDraggable?p:d,proxyPosition:o}};import*as zo from"react";import*as fe from"react";import{useCallback as ot,useContext as ly,useMemo as sy}from"react";import*as mo from"react";var xc=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;import*as xn from"react";import{useState as Yg}from"react";var Dc="_6rdmyg0 _16lm1iwn _16lm1iwi _16lm1iw9",vc=ye({defaultClassName:"_6rdmyg1",variantClassNames:{expanded:{true:"_16lm1iwg",false:"_6rdmyg3"},direction:{end:"_6rdmyg4",start:"_6rdmyg5"},disabled:{true:"_6rdmyg6",false:"_6rdmyg7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwh"]]});var Nr=`${it}-expand-collapse`;function fo(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=Yg(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),Wt("expanded",n)||i(!r)};xn.useEffect(()=>{Wt("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return xn.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:J(n.className,Dc,vc({direction:t||"start",expanded:r,disabled:o}),`${it}`,`${Nr}`,`${Nr}--${l}`,`${Nr}--${t==="end"?"end":"start"}`,o?`${Nr}--disabled`:"")},xn.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}import*as Lr from"react";var Ac="_16lm1iwb _16lm1iwn _16lm1iwi";var Ec=n=>Lr.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(n.className,Ac,"InfiniteIcon","InfiniteIcon-loading")},Lr.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},Lr.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var Mc=ye({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),_c="_7pupv00",Fc=ye({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function Oc({rowInfo:n}){return{[Y(le.components.Row.groupNesting)]:n.dataSourceHasGrouping?n.isGroupRow?n.groupNesting-1:n.groupNesting:0}}function Vr({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=o,d=J(Mo.flex,i.align==="end"?Sn.rowReverse:Sn.row,iu.center,`${ho}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||u)?Mc({align:a}):null);if(e==="multi-column"){if(n+1!==c.groupNesting&&c.isGroupRow)return u?mo.createElement("div",{className:d},u):null}else e==="single-column"&&c.isGroupRow;return mo.createElement("div",{className:d},s,u,mo.createElement("div",{className:It},l??null))}}function zr({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===n&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&n+1!==c.groupNesting)return null;let p=c.groupKeys,f=null,m=s?(c.groupKeys?.length||0)<l?.length:(c.groupKeys?.length||0)<=l?.length;return xc(c)?f=mo.createElement(Ec,null):m&&(f=mo.createElement(fo,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),o&&(r.renderBag.groupIcon=f,f=mo.createElement(tt,{render:o,renderParam:r})),f}}function Nc(n,e,t){let{groupByForColumn:o,groupIndexForColumn:r,groupRenderStrategy:i}=n,a=o.column?{...o.column}:{},l={header:`Group by ${o.field||o.groupField}`,groupByForColumn:o,render:Vr({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:zr({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(n,e)}:l={...l,...t}),l}function Lc(n,e,t){let o=typeof t=="function"?t(n,e):t,r={};return n.sortable!=null&&(r.sortable=n.sortable),{...r,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:Vr({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...o,renderGroupIcon:zr({initialRenderGroupIcon:o?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function Vc(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}import*as Gr from"react";import{useEffect as qg,useRef as Xg}from"react";var zc="qz8ht90 _16lm1iwi";function Zg(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:Qg}=Et({forwardProps:Zg,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function Jg(){let{componentState:n,componentActions:e}=Ke(),{checked:t,domProps:o,disabled:r}=n,i=Xg(null);return qg(()=>{i.current.indeterminate=t==null},[t]),Gr.createElement("input",{...o,className:J("InfiniteCheckBox",zc,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function Ut(n){return Gr.createElement(Qg,{...n},Gr.createElement(Jg,null))}function ey(n){return typeof n.field=="string"}function Gc(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?o.get(i.field||i.groupField):void 0}!r&&e.field&&(r=o.get(e.field))}return r}function lt(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:h}=o(),g=r===f&&m==="row",y=!h||typeof h=="function"&&!h(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:C,formattedValueContext:{rawValue:S}}=Vo({column:p,rowInfo:u,rowDetailState:y,columnsMap:e().computedColumnsMap,context:n}),b=qe(p.id,n);return c?{api:a,dataSourceApi:l,column:p,columnApi:b,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,rowDetailState:!1,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:S}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:y,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:S}:{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:y,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:S}:{api:a,dataSourceApi:l,columnApi:b,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,rowDetailState:y,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:S}}function Kc(n){return Bc(n.column,n.rowInfo)}function Hc(n){let{column:e,context:t,rowInfo:o,visibleColumnsIds:r}=n,i=Gc({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Vo(n),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:c,rowHasSelectedCells:!1},u,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:c,stylingParam:d,formattedValueContext:u,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:ty({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnsIds:n.visibleColumnsIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function ty(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=n,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:h}=f(),{indexInAll:g}=o,y=p(),{selectionMode:C,cellSelection:S}=y,b=Gc({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),T=d.toggleGroupRow,I=S?.isCellSelected(o.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:I,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...u,editError:h&&h.primaryKey===o.id&&h.columnId===e.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:b,selectionMode:C,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof c=="boolean"?`${c}`:c,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:g,toggleGroupRow:T,toggleCurrentGroupRow:()=>{o.isGroupRow&&T(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:y.groupBy,pivotBy:y.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),R}function Bc(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:ey(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function oy(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.getState(),u=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}}function Vo(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=Bc(e,t),a=oy(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}import*as _t from"react";var{rootClassName:kc}=De,go=`${kc}Cell`,Va=`${kc}Cell_content`,ny=Y(U.columnWidthAtIndex),ry=Y(U.columnReorderEffectDurationAtIndex);function iy(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:u,afterChildren:c,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:h,...g}=n,y=m(),C={width:`var(${ny}-${i.computedVisibleIndex})`,transition:`transform var(${ry}-${i.computedVisibleIndex}, 0s)`,...g.style},S={...g,style:C,"data-column-id":i.id,"data-z-index":C.zIndex,className:J(g.className,go,Ys),children:_t.createElement(_t.Fragment,null,d,_t.createElement("div",{className:J(Va,e?It:du.hidden,s),style:r},y),c)};u!=null&&(S["data-row-id"]=`${u}`);let b=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return b?_t.createElement(b,{...S,ref:a}):_t.createElement("div",{...S,ref:a})}var Kr=_t.memo(iy);import*as yo from"react";import{useCallback as Wc,useRef as ay}from"react";function jc(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=za(),i=ay(),a=yo.useCallback(s=>{i.current=s,s&&s.focus()},[]),l=Wc(s=>{let{key:u}=s;u==="Enter"||u==="Tab"?t():u==="Escape"?o():s.stopPropagation()},[]);return yo.createElement(yo.Fragment,null,yo.createElement("input",{readOnly:r,ref:a,onKeyDown:l,onBlur:()=>t(),className:J(ru,cu.none),type:"text",defaultValue:n,onChange:Wc(s=>{e(s.target.value)},[])}))}var{rootClassName:uy}=De,cy=Y(U.columnZIndexAtIndex);function dy({rowInfo:n}){return{[Y(le.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}var Dn=fe.createContext(null),ho=`${uy}ColumnCell`,py=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return fe.createElement(fo,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},fy={display:"inline-block",visibility:"visible"},Ga=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return fe.createElement(fo,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:fy,expanded:o,onChange:t})},my=n=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:o,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=n;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),u=l.getDataSourceState().isNodeSelectable,c=s?.CheckBox||Ut;return fe.createElement(c,{domProps:{className:yr},disabled:e.isTreeNode?!u(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():o()},checked:e.rowSelected})};function Ka(n,e){return n?typeof n=="function"?n(e):n:void 0}function Ha(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function hy(n){let{rowInfo:e,rowStyle:t,rowClassName:o,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:i,getData:a,cellStyle:l,cellClassName:s,rowDetailState:u,width:c,column:d,onMouseLeave:p,onMouseEnter:f,onRowMouseEnter:m,onRowMouseLeave:h,rowIndex:g,rowHeight:y,columnsMap:C,fieldsToColumn:S,domRef:b,hidden:T,showZebraRows:I}=n,R=fe.useRef(null),w=ot(de=>{R.current=de,b&&b(de)},[b]);if(!d)return fe.createElement("div",{ref:w},"no column");let{rowSelected:P}=e,{getState:x,actions:D,computed:A,api:_,getDataSourceMasterContext:E}=X(),{componentState:F,getState:v,api:M,componentActions:N}=Ie(),{activeRowIndex:G,keyboardNavigation:$,columnReorderInPageIndex:te}=x(),he=g===G&&$==="row",ue={getState:x,getDataSourceState:v,getDataSourceMasterContext:E,actions:D,dataSourceActions:N,api:_,dataSourceApi:M},z=e.rowDisabled,k=A.computedVisibleColumns.map(de=>de.id),ae=Hc({horizontalLayoutPageIndex:i,rowIndexInHorizontalLayoutPage:r,column:d,rowInfo:e,rowDetailState:u,columnsMap:C,visibleColumnsIds:k,fieldsToColumn:S,context:ue}),{stylingParam:oe,renderParams:W,formattedValueContext:V,renderFunctions:L,groupByColumnReference:Z,inEdit:j}=ae,{align:se,verticalAlign:Q}=W,O=W,be=fe.useRef(O),Te=m&&f?de=>{let pt={...V,rowIndex:g};m(pt,de),f(de)}:f,B=h&&p?de=>{let je={...V,rowIndex:g,rowInfo:e};h(je,de),p(de)}:p,ee=ot(de=>{let je=d.computedVisibleIndex;x().cellClick({rowIndex:g,colIndex:je,event:de})},[g,d.computedVisibleIndex,$]),ce=ot(de=>{let je=d.computedVisibleIndex;if(x().cellMouseDown({rowIndex:g,colIndex:je,event:de}),$==="row"){z||(D.activeRowIndex=g);return}$==="cell"&&(D.activeCellIndex=[g,je])},[g,z,d.computedVisibleIndex,$]),{selectionMode:xe,cellSelection:we,isNodeReadOnly:Ne}=F,Ae=O.cellSelected;O.domRef=w,O.htmlElementRef=R,O.toggleCurrentTreeNode=ot(O.toggleCurrentTreeNode,[e]),O.selectCell=ot(O.selectCell,[e]),O.deselectCell=ot(O.deselectCell,[e]),O.selectCurrentRow=ot(O.selectCurrentRow,[e]),O.deselectCurrentRow=ot(O.deselectCurrentRow,[e]),O.toggleCurrentGroupRow=ot(O.toggleCurrentGroupRow,[e]),O.toggleCurrentRowSelection=ot(O.toggleCurrentRowSelection,[e]),O.toggleCurrentGroupRowSelection=ot(O.toggleCurrentGroupRowSelection,[e]),O.toggleCurrentTreeNodeSelection=ot(O.toggleCurrentTreeNodeSelection,[e]);let He=d.components?.Editor??jc,Ue=j?fe.createElement(Uc,{contextValue:O},fe.createElement(He,null)):null,ke=ot(Ye(()=>{if(T||j)return null;if(be.current=O,L.renderGroupIcon&&(O.renderBag.groupIcon=fe.createElement(tt,{render:L.renderGroupIcon,renderParam:{...O,renderBag:{...O.renderBag}}})),L.renderSelectionCheckBox&&xe=="multi-row"&&(O.renderBag.selectionCheckBox=fe.createElement(tt,{render:my,renderParam:O}),L.renderSelectionCheckBox!==!0&&(O.renderBag.selectionCheckBox=fe.createElement(tt,{render:L.renderSelectionCheckBox,renderParam:{...O,renderBag:{...O.renderBag}}}))),e.isTreeNode){let{isParentNode:pt}=e,ht;ht=(pt?L.renderTreeIconForParentNode:L.renderTreeIconForLeafNode)||typeof L.renderTreeIcon=="function"?L.renderTreeIcon:pt&&L.renderTreeIcon===!0?Ga:void 0,ht===!0?ht=Ga:ht&&(O.renderBag.treeIcon=fe.createElement(tt,{render:Ga,renderParam:O})),ht&&(O.renderBag.treeIcon=fe.createElement(tt,{render:ht,renderParam:{...O,renderBag:{...O.renderBag}}}))}L.renderRowDetailIcon&&(O.renderBag.rowDetailsIcon=fe.createElement(tt,{render:py,renderParam:{...O,renderBag:{...O.renderBag}}}),typeof L.renderRowDetailIcon=="function"&&(O.renderBag.rowDetailsIcon=fe.createElement(tt,{render:L.renderRowDetailIcon,renderParam:{...O,renderBag:{...O.renderBag}}}))),L.renderValue&&(O.renderBag.value=fe.createElement(tt,{render:L.renderValue,renderParam:{...O,renderBag:{...O.renderBag}}})),e.isGroupRow&&L.renderGroupValue&&(O.renderBag.value=fe.createElement(tt,{render:L.renderGroupValue,renderParam:{...O,renderBag:{...O.renderBag}}})),!e.isGroupRow&&L.renderLeafValue&&(O.renderBag.value=fe.createElement(tt,{render:L.renderLeafValue,renderParam:{...O,renderBag:{...O.renderBag}}})),be.current=O;let de=O.renderBag.value;de instanceof Date&&(de=de.toLocaleDateString());let je=fe.createElement(fe.Fragment,null,se!=="end"?O.renderBag.treeIcon:null,se!=="end"?O.renderBag.groupIcon:null,se!=="end"?O.renderBag.rowDetailsIcon:null,se!=="end"?O.renderBag.selectionCheckBox:null,de,se==="end"?O.renderBag.selectionCheckBox:null,se==="end"?O.renderBag.rowDetailsIcon:null,se==="end"?O.renderBag.groupIcon:null,se==="end"?O.renderBag.treeIcon:null);return d.render?fe.createElement(tt,{render:d.render,renderParam:{...O,renderBag:{...O.renderBag,all:je}}}):je}),[d,T,j,u,d.renderTreeIcon||d.renderTreeIconForParentNode?Ne:!1,...Vc(O,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),nt=A.computedVisibleColumns.map(de=>de.id),Qe=A.computedColumnOrder,H={...V,visibleColumnIds:nt,allColumnIds:Qe,rowIndex:g,rowHasSelectedCells:!1};Object.defineProperty(H,"rowHasSelectedCells",{get(){return e.hasSelectedCells(nt)}});let ne=e.isTreeNode&&(d.renderTreeIcon||d.renderTreeIconForLeafNode||d.renderTreeIconForParentNode),K=typeof o=="function"?o(H):o,re;Z?.className&&(re=Ka(Z.className,oe)),s&&(re=J(re,Ka(s,oe))),d.className&&(re=J(re,Ka(d.className,oe))),ne&&(re=J(re,Fc({align:se})));let ge;e.dataSourceHasGrouping&&d.groupByForColumn&&(ge=Oc({rowInfo:e})),ne&&(ge=dy({rowInfo:e})),t&&(ge=typeof t=="function"?{...ge,...t(H)}:{...ge,...t}),l&&(ge=Ha(ge,l,oe)),Z?.style&&(ge=Ha(ge,Z.style,oe)),d.style&&(ge=Ha(ge,d.style,oe)),ge=ge||{},ge.height=y,ge.zIndex=`var(${cy}-${d.computedVisibleIndex})`;let ie=sy(()=>ge,[ge?JSON.stringify(ge):null]),We=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:g)%2===1,dt=I?We?"odd":"even":!1,bt=!1,io=!1,wo=!1,Yn=!1;if(we&&Ae){let de=a(),je=de[e.indexInAll-1],pt=de[e.indexInAll+1],ht=A.computedVisibleColumns[d.computedVisibleIndex+1],en=A.computedVisibleColumns[d.computedVisibleIndex-1];bt=je?!we.isCellSelected(je.id,d.id):!0,d.computedPinned==="end"&&d.computedFirstInCategory?io=!0:io=en?!we.isCellSelected(e.id,en.id):!0,d.computedPinned==="start"&&d.computedLastInCategory?wo=!0:wo=ht?!we.isCellSelected(e.id,ht.id):!0,Yn=pt?!we.isCellSelected(pt.id,d.id):!0}let qn=we&&Ae?{top:bt,left:io,right:wo,bottom:Yn}:null,Jo=te!=null?i!==te:!1,Xn=Ue,_i=ke(),Fi={domRef:w,cellType:"body",column:d,width:c,rowId:e.id,horizontalLayoutPageIndex:i,style:ie,onMouseLeave:B,onMouseEnter:Te,onClick:ee,afterChildren:Xn,onMouseDown:ce,cssEllipsis:d.cssEllipsis??!0,className:J(qn?Xs(qn):"",_r(d,[ho,go],qs,{dragging:!1,insideDisabledDraggingPage:Jo,zebra:dt,align:se,verticalAlign:Q,rowDisabled:z,rowActive:he,cellSelected:Ae,rowSelected:P,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!d.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),re,K),renderChildren:ot(()=>_i,[ke])},Oi=Dn.Provider;return fe.createElement(Oi,{value:be.current},fe.createElement(Kr,{...Fi}))}var $c=fe.memo(hy);function Hr(){return ly(Dn)}function za(){let{api:n,state:{editingValueRef:e,editingCell:t}}=X(),{column:o,rowInfo:r}=Hr(),[i]=fe.useState(()=>t?.value),[a,l]=fe.useState(i),s=t?!t.active&&!!t.waiting:!1,u=fe.useCallback(f=>{e.current=f,l(f)},[]);fe.useLayoutEffect(()=>{e.current=i},[]);let c=n.confirmEdit,d=n.cancelEdit,p=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function vn(n){return n.render(n.renderParam)??null}function tt(n){let e=Dn.Provider;return zo.createElement(e,{value:n.renderParam},zo.createElement(vn,{render:n.render,renderParam:n.renderParam}))}function Uc(n){let e=Dn.Provider;return zo.createElement(e,{value:n.contextValue},n.children)}function Yt(n){let e=Br.Provider;return zo.createElement(e,{value:n.renderParam},zo.createElement(vn,{render:n.render,renderParam:n.renderParam}))}import*as qt from"react";var gy={width:"100%",pointerEvents:"none"},Ba=`${it}-menu`,ka=Rr({"data-name":""}),Wa={[ka["data-name"]]:"menu-icon"};function An(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...gy,borderTop:`${le.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return qt.createElement("div",{...o,style:e,...Wa,onPointerDown:s=>s.stopPropagation(),className:J(t,Gu({menuVisible:i,reserveSpaceWhenHidden:r}),it,`${it}-menu`)},a??qt.createElement(qt.Fragment,null,qt.createElement("div",{className:Ba,style:l}),qt.createElement("div",{className:Ba,style:l}),qt.createElement("div",{className:Ba,style:l})))}import*as Go from"react";import{useEffect as yy,useState as qc}from"react";var Yc="_1ek6mqy0 _16lm1iwz _16lm1iw1n _16lm1iw1 _16lm1iw1v";var Cy={transition:"width 0.25s, opacity 0.25s"};function Xc(n){let[e,t]=qc(!0),[o,r]=qc(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=n,c=u!=null&&u>0,d=n.size??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={...Cy,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};yy(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==o){let C=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(C)}}return()=>{}},[i,e]);let h=()=>{let C=!(o===0&&i===0);C!==e&&t(C)};if(!e)return null;let g={};return i===-1&&(g.top="100%"),Go.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:J(s,it,Yc,`${it}-sort`)},c?Go.createElement("div",{"data-name":"index",style:g,className:Bu},u):null,Go.createElement("div",{style:{width:f[0],...m},onTransitionEnd:h}),Go.createElement("div",{style:{width:f[1],...m}}),Go.createElement("div",{style:{width:f[2],...m}}))}import*as od from"react";import{useCallback as td}from"react";import{useRef as Jc,useState as Ty}from"react";import*as En from"react";function Zc(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){Ce.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;Ce.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?Zi(l,i,o.current):Ce.columnOffsets.set(a,l.computedOffset+i,o.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let u=e[l];if(u.computedPinned==="start"){Zi(u,i,o.current);continue}u.computedPinned!=="end"&&Ce.columnOffsets.set(l,u.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||Ce.columnOffsets.set(l,u.computedOffset+i,o.current)}}}}}function Qc(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,u=i.current;if(o.forEach((c,d)=>{s+=c;let p=n[d],f=r[p],m=f.computedWidth+c;Ce.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&Ce.columnOffsets.set(p,l,u),l+=m)}),a.computedPinned!=="end")for(let c=t+1;c<r.length;c++){let d=r[c];d.computedPinned!=="end"&&Ce.columnOffsets.set(c,d.computedOffset+s,u)}}}}var kr="zneyzh0 _16lm1iw2 _16lm1iw1d _16lm1iw1k _16lm1iw1i _16lm1iwk _16lm1iw1y",Wr=ye({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw1d _16lm1iw1i",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"]]}),jr=ye({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw1f _16lm1iw1m",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:Sy}=De,by=`${Sy}HeaderCell_ResizeHandle`;function Ry(n){let{state:{brain:e,headerBrain:t}}=X(),o=Jc(null),[r,i]=Ty(!1),a=Jc(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=h=>{h.stopPropagation();let g=!!h.shiftKey,y=h.pointerId,C=h.clientX,S=h.target;if(e.isHorizontalLayoutBrain){let w=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),P=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{w(),P()}}S.setPointerCapture(y);let b=Zc(n.columnIndex,{columns:n.columns,shareSpaceOnResize:g,domRef:o}),T=(w,{done:P}={})=>{s&&(w=w/(s+1),P&&(w=Math.round(w))),u==="end"&&(w*=-1);let{adjustedDiff:x,constrained:D}=n.computeResize({diff:w,shareSpaceOnResize:g});return a.current!==D&&i(D),b.resize(x),x},I=w=>{T(Math.round(w.clientX-C))},R=w=>{S.releasePointerCapture(y),S.removeEventListener("pointermove",I),S.removeEventListener("pointerup",R);let P=Math.round(w.clientX-C),x=T(P,{done:!0});p(),n.onResize({diff:x,shareSpaceOnResize:g})};S.addEventListener("pointermove",I),S.addEventListener("pointerup",R)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return En.createElement("div",{ref:o,className:`${by} ${kr} ${jr({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},En.createElement("div",{style:m,className:Wr({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var ed=En.memo(Ry);function nd(n,e){let{computed:{computedVisibleColumns:t},getState:o,getComputed:r,actions:i}=X(),a=td(({diff:u,shareSpaceOnResize:c})=>{let d=o(),{columnSizing:p,viewportReservedWidth:f,bodySize:m}=d,h=r().computedVisibleColumns,g=!1,y=h.reduce((b,T)=>(T.computedFlex&&(b[T.id]={...p[T.id],flex:T.computedWidth},g=!0),b),{}),C=g?{...p,...y}:p;return xa({shareSpaceOnResize:c,availableSize:m.width,reservedWidth:f||0,dragHandleOffset:u,dragHandlePositionAfter:n.computedVisibleIndex,columnSizing:C,items:h.map(b=>({id:b.id,computedFlex:b.computedFlex,computedWidth:b.computedWidth,computedMinWidth:b.computedMinWidth,computedMaxWidth:b.computedMaxWidth}))})},[n]),l=td(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a]);return n.computedResizable?od.createElement(ed,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}var Co=`${et}HeaderCell`,rd=`${et}HeaderWrapper`;var vy=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||Ut;return Re.createElement(s,{domProps:{className:yr},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},Br=Re.createContext(null);var Ay=Y(U.columnZIndexAtIndex),ja=Re.createElement("div",{className:br[1]}),id=Rr({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":""});function ad(n){let e=n.column,{api:t,getComputed:o,getState:r,actions:i,state:{showColumnFilters:a,components:l,portalDOMRef:s,columnHeaderHeight:u,columnReorderDragColumnId:c,columnMenuVisibleForColumnId:d,columnReorderInPageIndex:p},getDataSourceMasterContext:f}=X(),{api:m,componentActions:h,getState:g,componentState:{filterDelay:y,filterTypes:C}}=Ie(),{allRowsSelected:S,someRowsSelected:b,selectionMode:T}=Po(),I=n.horizontalLayoutPageIndex,R=c===e.id,w=p!=null?I!==p:!1,{onResize:P,height:x,width:D,headerOptions:A,columnsMap:_}=n,E=e.computedSortInfo,F=e.header,v=Iy(K=>{L.current=K,n.domRef?.(K)},[n.domRef]),M=A.alwaysReserveSpaceForSortIcon,N=e.headerAlign??e.align,G=(typeof N=="function"?N({isHeader:!0,column:e}):N)??"start",$=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",te=qe(e,{actions:i,api:t,dataSourceActions:h,dataSourceApi:m,getComputed:o,getDataSourceState:g,getDataSourceMasterContext:f,getState:r}),he=te.isSortable(),ue=he&&(e.computedSorted||M)?Re.createElement(Xc,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:le.spacing[2],marginInlineEnd:le.spacing[2]},className:`${Co}__sort-icon ${Hu} ${ku({align:G})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,k=e.computedFilterable&&e.computedFiltered?Re.createElement(Oo,null):null,ae=e.headerCssEllipsis??e.cssEllipsis??!0,oe={reserveSpaceWhenHidden:G==="center",menuVisible:d===e.id,style:G==="end"?{marginInlineStart:`calc(${le.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:le.spacing[2]}:{marginInlineEnd:`calc(${le.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:le.spacing[2]},domProps:{onMouseDown:K=>{K.stopPropagation(),te.toggleContextMenu(K.target)}}},W=e.components?.MenuIcon||l?.MenuIcon||An,V=Re.createElement(W,{...oe}),L=xy(null),Z={horizontalLayoutPageIndex:I,dragging:R,domRef:v,htmlElementRef:L,insideColumnMenu:!1,column:e,columnsMap:_,columnSortInfo:E,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:b,allRowsSelected:S,selectionMode:T,api:t,dataSourceApi:m,columnApi:te,renderBag:{sortIcon:ue,filterIcon:k,menuIcon:V,menuIconProps:oe,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},j=Z,se=()=>{let K={...Z,renderBag:{...Z.renderBag}};if(e.renderSortIcon&&(K.renderBag.sortIcon=Re.createElement(Yt,{render:e.renderSortIcon,renderParam:{...K,renderBag:{...K.renderBag}}})),e.renderFilterIcon&&(K.renderBag.filterIcon=Re.createElement(Yt,{render:e.renderFilterIcon,renderParam:{...K,renderBag:{...K.renderBag}}})),typeof e.renderMenuIcon=="function"&&(K.renderBag.menuIcon=Re.createElement(Yt,{render:We=>{if(typeof e.renderMenuIcon!="function")return null;let dt=e.renderMenuIcon(We);return dt?dt.type===W||dt.type===An?dt:Re.createElement(W,{...oe},dt):null},renderParam:{...K,renderBag:{...K.renderBag}}})),e.renderSelectionCheckBox&&T==="multi-row"){K.renderBag.selectionCheckBox=Re.createElement(Yt,{render:vy,renderParam:{...K,renderBag:{...K.renderBag}}});let We=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;We&&We!==!0&&(K.renderBag.selectionCheckBox=Re.createElement(Yt,{render:We,renderParam:{...K,renderBag:{...K.renderBag}}}))}F instanceof Function&&(K.renderBag.header=Re.createElement(Yt,{render:F,renderParam:{...K,renderBag:{...K.renderBag}}}));let re=e.renderMenuIcon===!1?null:K.renderBag.menuIcon,ge=ae?Re.createElement("div",{className:It},K.renderBag.header):K.renderBag.header,ie=Re.createElement(Re.Fragment,null,G==="center"?ja:null,K.renderBag.selectionCheckBox,ge,K.renderBag.sortIcon,K.renderBag.filterIcon,G==="center"?ja:null,G!=="center"?ja:null,re);return e.renderHeader?Re.createElement(Yt,{render:e.renderHeader,renderParam:{...K,renderBag:{...K.renderBag,all:ie}}}):ie};Py(()=>{let K=null,re=L.current;return P&&re&&(K=ln(re,P)),()=>{K?.()}},[L.current,n.onResize]);let Q={height:x};e.headerStyle&&(Q=typeof e.headerStyle=="function"?{...Q,...e.headerStyle(j)||{}}:{...Q,...e.headerStyle});let O=typeof e.headerClassName=="function"?e.headerClassName(j):e.headerClassName,{onPointerDown:be,proxyPosition:Te}=Pc({columnId:e.id,domRef:L,horizontalLayoutPageIndex:I}),B=null;R&&Te&&(B=Re.createElement("div",{key:e.id,className:`${Co}Proxy ${Mu}`,style:{position:"absolute",height:x,width:D,left:Te.left??0,top:Te.top??0,zIndex:1e9}},j.renderBag.header),B=Dy(B,s.current));let ee=Br.Provider,ce={filtered:e.computedFiltered,verticalAlign:$,align:G},xe=Re.useMemo(()=>{let K=re=>{t.setColumnFilter(e.id,re)};return y>0?Dt(K,{wait:y}):K},[y,e.id]),we=e.computedFilterType,Ne=C[we],Ae=e.computedFilterable?e.computedFilterValue?.filter.operator??Ne?.defaultOperator:void 0,He=e.computedFilterable&&Ne?Ne.operators.find(K=>K.name===Ae):void 0,Ue=He?.components?.FilterEditor||Ne?.components?.FilterEditor||e.components?.FilterEditor||Lo,ke=Ne?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,nt=nd(e,{horizontalLayoutPageIndex:I}),Qe=`var(${Ay}-${e.computedVisibleIndex})`;Q.zIndex=Qe;let H={"data-field":`${e.field||""}`,"data-column-id":e.id,"data-header-align":G,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},ne=e.computedFilterable?Re.createElement(nc,{horizontalLayoutPageIndex:I,filterEditor:Ue,filterOperatorSwitch:ke??rc,operator:He,filterTypes:C,onChange:xe,columnFilterType:we,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:u}):Re.createElement(ic,null);return j.renderBag.filterEditor=ne,Re.createElement(ee,{value:j},Re.createElement(Kr,{domRef:v,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",column:e,...H,"data-z-index":Qe,style:Q,width:D,onPointerDown:be,contentClassName:J(Eu(ce),su[G]),contentStyle:a?{height:x/2}:void 0,className:J(Co,mu.none,he?au.pointer:"",O,_r(e,[Co,go],_u,{dragging:R,insideDisabledDraggingPage:w,align:G,verticalAlign:$,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Au),cssEllipsis:ae,afterChildren:Re.createElement(Re.Fragment,null,a?ne:null,nt),renderChildren:se}),B)}function Er(){return wy(Br)}import*as yt from"react";function ld(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((c,d)=>{let p=c.id,f=n[d-1],m=f?.id??"",h=new Set,g=f?.computedPinned!==c.computedPinned?new Set:a.get(m)??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?(t.get(c.columnGroup)??0)+1:0};r.set([p],y);let C=c.columnGroup,S,b=y;for(;C;){let T=e[C];if(T){h.add(C);let I=[p,...h];S=g.has(C)?i.get(C):void 0,S||(S={id:C,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[C],computedWidth:0,computedPinned:y.computedPinned,depth:t.get(C)??0},r.set(I,S),i.set(C,S)),S.columnItems.push(y),S.uniqueGroupId.push(y.id),b&&!g.has(b.id)&&S.children.push(b),b=S,C=T.columnGroup}else break}});let l=[],s=new q,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"&&sd(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<=o+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function sd(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&sd(t.children),e+=o})}import*as To from"react";import{useCallback as yd,useEffect as Ny,useRef as Ly}from"react";import*as $a from"react";import*as pd from"react";import{useCallback as dd}from"react";import{useRef as ud,useState as Ey}from"react";import*as Mn from"react";var{rootClassName:My}=De,_y=`${My}HeaderCell_ResizeHandle`;function Fy(n){let e=ud(null),[t,o]=Ey(!1),r=ud(t);r.current=t;let i=n.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=Qc(n.groupColumns.map(b=>b.computedVisibleIndex),{columns:n.columns,domRef:e}),y=b=>{a==="end"&&(b*=-1);let{constrained:T,adjustedDiffs:I,adjustedDiff:R}=n.computeResize(b);return r.current!==T&&o(T),g.resize(I),R},C=b=>{if(h){let T=n.groupColumns.reduce((w,P)=>w+P.computedWidth-P.computedMinWidth,0),I=n.brain.getAvailableSize(),R={width:I.width+T,height:I.height};n.brain.update(R),h=!1}y(Math.round(b.clientX-f))},S=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",C),m.removeEventListener("pointerup",S);let T=Math.round(b.clientX-f),I=y(T);n.onResize(I)};m.addEventListener("pointermove",C),m.addEventListener("pointerup",S)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:le.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Mn.createElement("div",{ref:e,className:`${_y} ${kr} ${jr({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},Mn.createElement("div",{style:{...c,...n.style},className:Wr({constrained:t})}))}var cd=Mn.memo(Fy);function fd(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:u}=X(),c=n[n.length-1],d=dd(h=>{let g=l(),{columnSizing:y,viewportReservedWidth:C,bodySize:S}=g,b=s().computedVisibleColumns,T=!1,I=b.reduce((P,x)=>(x.computedFlex&&(P[x.id]={...y[x.id],flex:x.computedWidth},T=!0),P),{}),R=T?{...y,...I}:y;return Yu({availableSize:S.width,reservedWidth:C||0,dragHandleOffset:h,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:R,columnGroupSize:n.length,items:b.map(P=>({id:P.id,resizable:P.computedResizable,computedFlex:P.computedFlex,computedWidth:P.computedWidth,computedMinWidth:P.computedMinWidth,computedMaxWidth:P.computedMaxWidth}))})},[c]),p=dd(h=>{let{columnSizing:g,reservedWidth:y}=d(h);u.viewportReservedWidth=y,u.columnSizing=g},[d]);return n.some(h=>h.computedResizable)?pd.createElement(cd,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:p}):null}var md=`${et}HeaderGroup`,hd=Y(U.columnWidthAtIndex),Oy=Y(U.columnZIndexAtIndex);function gd(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=fd(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),u=o[0],c=o.length>1?"calc( "+o.map(f=>`var(${hd}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${hd}-${u.computedVisibleIndex})`,d=`calc(var(${Oy}-${u.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=c,p.height=t,$a.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,className:J(zu,md),style:p,"data-z-index":d},$a.createElement("div",{className:J(`${md}__header-content`,It)},a),s)}var{rootClassName:Vy}=De,zy=[],Cd=`${Vy}Header`,Gy=Fu({overflow:!1});function Ky(n){let{bodyBrain:e,columns:t,style:o,className:r,columnHeaderHeight:i,columnAndGroupTreeInfo:a,columnGroupsMaxDepth:l}=n,{computed:s,getState:u,state:{headerBrain:c,headerOptions:d,showColumnFilters:p}}=X(),{computedColumnsMap:f}=s,m=Ly(null),h=yd(C=>{m.current&&(m.current.style.transform=`translate3d(-${C.scrollLeft}px, 0px, 0px)`)},[]);Ny(()=>{let C=c.onScroll(h);return h(c.getScrollPosition()||{scrollLeft:0,scrollTop:0}),C},[c]);let g={ref:m,className:J(Cd,`${Cd}--virtualized`,r,Gy),style:{...o,height:i}},y=yd(C=>{let{rowIndex:S,colIndex:b,domRef:T,height:I,widthWithColspan:R,heightWithRowspan:w,hidden:P}=C,x=t[b];if(!x||P)return null;let D=c.isHorizontalLayoutBrain?c.getPageIndexForRow(S):null,A=a?a.pathsToCells.get([S,b]):null;if(A&&A.type==="group"){let _=A.columnItems.map(v=>v.ref),E={...A.ref,id:A.id,uniqueGroupId:A.uniqueGroupId,depth:A.depth,columns:_.map(v=>v.id),computedWidth:A.computedWidth,groupOffset:A.groupOffset};return u().columnGroupVisibility[A.id]!==!1?To.createElement(gd,{horizontalLayoutPageIndex:D,bodyBrain:e,columnGroupsMaxDepth:l,domRef:T,columns:_,width:R,height:I,columnGroup:E}):null}return To.createElement(ad,{domRef:T,column:x,horizontalLayoutPageIndex:D,headerOptions:d,width:R,height:w,columnsMap:f})},[d,t,i,a,l,p,c]);return To.createElement("div",{...g},To.createElement(mr,{name:"header",renderCell:y,brain:c,cellHoverClassNames:zy,cellDetachedClassNames:Cr}))}var Td=To.memo(Ky);function Sd(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,r=X(),{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=yt.useMemo(()=>{if(!(!p||!Object.keys(p).length))return ld(l,p,c,d)},[l,p,c]),y=yt.useCallback(({rowIndex:R,colIndex:w})=>{let P=l[w],x=1,D=1;if(!P||!g)return{rowspan:x,colspan:D};let A=g.pathsToCells.get([R,w]);if(!A)return{rowspan:x,colspan:D};if(A.type==="column")return{colspan:D,rowspan:m-A.depth};let _=A.columnItems.findIndex(E=>E.id===P.id);return{rowspan:x,colspan:_===0?A.columnItems.length:1}},[p,d,l,g,m,c]),C=yt.useCallback(({rowIndex:R,colIndex:w})=>y({rowIndex:R,colIndex:w}).rowspan,[y]),S=yt.useCallback(({rowIndex:R,colIndex:w})=>y({rowIndex:R,colIndex:w}).colspan,[y]),b=yt.useCallback(R=>f?R<m-1?u:2*u:u,[m,f,u]);Tr(e,{colWidth:s,rowHeight:b,rows:m,cols:l.length,height:h,rowspan:C,colspan:S},{fixedColsEnd:a.length,fixedColsStart:i.length});let T=yt.createElement(Td,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:h,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:g}),I=o.vertical&&jt()?yt.createElement("div",{className:Ku,style:{zIndex:1e3,width:jt()}}):null;return yt.createElement("div",{className:`${rd} ${Wu}`,style:{height:h}},T,I)}import*as Ft from"react";import{useEffect as Hy}from"react";function bd(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Rd={padding:le.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},By={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},Id=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(bd(t),o,"important")},wd=Ft.forwardRef(function(e,t){let{rootClassName:o}=Sr(),r=Ft.useRef(null),i=Ft.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return Hy(()=>{let a=()=>{setTimeout(()=>{Id(r.current,Rd),Id(r.current?.firstElementChild,By)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),Ft.createElement("div",{ref:i,...e,className:J(`${o}-Footer`,ac,e.className),style:Rd},"Powered by"," ",Ft.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});import*as Ko from"react";var Pd={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i"},xd="qy58ya3 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",Dd="qy58ya4";var{rootClassName:ky}=De,Ua=`${ky}-LoadMask`;function Wy(n){let{visible:e,children:t="Loading"}=n;return Ko.createElement("div",{className:`${Pd[e?"visible":"hidden"]} ${Ua}`},Ko.createElement("div",{className:`${xd} ${Ua}-Overlay`}),Ko.createElement("div",{className:`${Dd} ${Ua}-Text`},t))}var $r=Ko.memo(Wy);function Ya(n){return n.map(wt)}function wt(n){if(Ee().structuredClone)return Ee().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return Ya(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(Ya(Array.from(n)));if(n instanceof Map)return new Map(Ya(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=wt(n[t]));return e}function _n(n){return n}var So=Object.seal({data:null,field:null});var Zt="____root____",Ad="____not_loaded_yet____";function Xt(){return!1}function qa(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function Ur(n,e,t,o,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function Ed(n,e){let{reducers:t={},pivot:o,groupBy:r,indexer:i,toPrimaryKey:a,cache:l,mappings:s}=n,u=new q;function c(g,y,C,S=0,b=[]){let T=!C.length||S===C.length-1,I=y[s?.values||"values"]||{};for(let R in I)if(I.hasOwnProperty(R)){let w=R;b.push(w),d.set(b,!0),g.set(b,{reducerResults:I[R][s?.totals||"totals"]||{},items:[]}),T||c(g,I[R],C,S+1,b),b.pop()}}let d=o?new q:void 0,p=[],f=qa(t),m=wt(f);e.visitDepthFirst((g,y,C,S)=>{let[b,...T]=y,I=g.children,R=u.get(T);if(R&&(R.cache=g.cache,R.childrenLoading=g.childrenLoading,R.childrenAvailable=g.childrenAvailable,R.error=g.error),T.length==r.length&&r.length){if(R){R.items=I;for(let P=0,x=T.length;P<x;P++){let D=T.slice(0,P),A=u.get(D);A&&(A.items=A.items||[],A.items=A.items.concat(I))}I=i.indexArray(I,{toPrimaryKey:a,cache:l,nodesKey:void 0})}return S?.()}for(let w=0,P=I.length;w<P;w++){if(!I[w]){let _={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...T,`${Ad}${w}`],_);continue}let x=I[w].data,D=I[w].keys||[];if(D.length){let _=D[D.length-1];T.push(_)}let A={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:I[w].totalChildrenCount,reducerResults:I[w].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(T,A),o){let _=A.pivotDeepMap=new q,E=I[w].pivot;c(_,E,o,0,p)}D.length&&T.pop()}S?.()});let h={deepMap:u,groupParams:n,initialData:e,reducerResults:m};return o&&(h.topLevelPivotColumns=d,h.pivot=o),h}function vd(n,e,t,o,r,i,a,l,s,u=_n){let{items:c,reducerResults:d,pivotDeepMap:p}=n.get(e);if(c.push(o),a&&Ur(o,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:h,valueGetter:g,toKey:y}=i[f],C=h?o[h]:null;g&&(So.data=o,So.field=h,C=g(So));let S=(y||u)(C,o);t.push(S),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:wt(s),items:[]}));let{reducerResults:b,items:T}=p.get(t);T.push(o),a&&Ur(o,r,a,b,e)}t.length=0}}function Md(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=n,d=c(r),p=[...o,d],f=s(r);if(t.set(p,!0),f){for(let y=0,C=o.length;y<=C;y++){let S=o.slice(0,y),b=e.get(S),{reducerResults:T,items:I}=b;I.push(r),b.leavesAvailableCount++,b.totalLeafNodesCount++,a&&Ur(r,i,a,T,S)}return}let m=wt(l),h=[];e.set(p,{items:h,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:o.length});let g=u(r);if(!(!g||!Array.isArray(g))){for(let y=0,C=g.length;y<C;y++){let S=g[y];Md(n,e,t,p,S,y,a,l)}a&&Fn(a,m,h)}}function _d(n,e){let{reducers:t}=n,o=qa(t),r=wt(o),i=new q,a=new q;i.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let s=0,u=e.length;s<u;s++)Md(n,i,a,[],e[s],s,t,o);return t&&Fn(t,r,e),{deepMap:i,treeParams:n,treePaths:a,initialData:e,reducerResults:r}}function Xa(n,e){let{groupBy:t,defaultToKey:o=_n,pivot:r,reducers:i}=n,a=t.length,l=r?new q:void 0,s=new q,u=[],c=[],d=qa(i),p=wt(d);if(!a){let m={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:wt(d)};r&&(m.pivotDeepMap=new q),s.set(u,m)}for(let m=0,h=e.length;m<h;m++){let g=e[m],y={};for(let C=0;C<a;C++){let{field:S,groupField:b,valueGetter:T,toKey:I}=t[C],R=S?g[S]:null;T&&(So.data=g,So.field=S,R=T(So));let w=(I||o)(R,g);if(y[S||b]=w,u.push(w),!s.has(u)){let P={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:wt(d)};r&&(P.pivotDeepMap=new q),s.set(u,P)}vd(s,u,c,g,m,r,i,l,d,o)}a||vd(s,u,c,g,m,r,i,l,d,o),i&&Ur(g,m,i,p,u),u.length=0}i&&(s.visitDepthFirst((m,h,g,y)=>{Fn(i,m.reducerResults,m.items),r&&m.pivotDeepMap.visitDepthFirst(({items:C,reducerResults:S},b,T,I)=>{Fn(i,S,C),I?.()}),y?.()}),Fn(i,p,e));let f={deepMap:s,groupParams:n,initialData:e,reducerResults:p};return r&&(f.topLevelPivotColumns=l,f.pivot=r),f}function jy(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function $y(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.length,{items:s,reducerResults:u,pivotDeepMap:c,commonData:d}=e,p=d??null,f;if(Object.keys(u).length>0){p={...d},f={};for(let C in i)if(i.hasOwnProperty(C)){let b=i[C].field;b&&(f[b]=u[C]),b&&p[b]==null&&(p[b]=u[C])}}let m=!0,h=o[o.length-1],g=h;if(p!=null){let C=t[o.length-1];C&&C.field&&(g=p[C.field]),C&&C.toKey&&(g=C.toKey(g,p)),g=g??h}return typeof g=="string"&&g.startsWith(Ad)&&(m=!1,g=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Xt,hasSelectedCells:Xt,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:g,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function Yr(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function Fn(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function Fd(n,e,t,o,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:u,treeResult:c,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:h,repeatWrappedGroupRows:g,rowsPerPage:y}=r,{deepMap:C}=c,S=n.length,b=t[t.length-1],T=b?b.nodeExpanded:!0;for(let I=0;I<S;I++){let R=n[I],w=u(R,I),P=[...e,w];if(l(R)){let v={id:w,nodePath:P,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Xt,hasSelectedCells:Xt,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,I],indexInParent:I,indexInAll:T?i.length:-1};p&&(v.rowSelected=p(v)),d&&(v.rowDisabled=d(v)),f&&f(v);let M=g&&y!=null&&y>0&&v.indexInAll%y===0?v.indexInAll/y:null;for(let N=0,G=t.length;N<G;N++){let $=t[N];if(T||($.collapsedLeafNodesCount+=1),$.deepRowInfoArray.push(v),M!=null&&T){if(typeof g=="function"&&g($)!==!0)continue;let te=Yr($,v.indexInAll,M);i[te.indexInAll]=te,v.indexInAll++}}T&&(i[v.indexInAll]=v);continue}let A=C.get(P)?.totalLeafNodesCount??0,_={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:P,id:w,data:R,indexInAll:i.length,indexInParent:I,indexInParentNodes:[...o,I],totalLeafNodesCount:A,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Xt,hasSelectedCells:Xt,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(_.rowSelected=p(_),h)){let v=h.getSelectionCountFor(_.nodePath);_.selectedLeafNodesCount=v.selectedCount,_.deselectedLeafNodesCount=v.deselectedCount}d&&(_.rowDisabled=d(_)),f&&f(_);let E=!0;if(m&&(_.selfExpanded=E=m(_)),T||(E=!1),_.nodeExpanded=E,T&&g&&y!=null&&y>0){let v=_.indexInAll,M=_.parentNodes;if(M.length>0&&v%y===0){let N=v/y,G=0;M.forEach($=>{typeof g=="function"&&g($)!==!0||(i.push(Yr($,v+G,N)),G++,_.indexInAll++)})}}T&&(i[_.indexInAll]=_);let F=s(R);Array.isArray(F)&&Fd(F,P,[...t,_],_.indexInParentNodes,r,i)}return i}function Od(n){let{dataArray:e}=n,t=[];return Fd(e,[],[],[],n,t),{data:t}}function Nd(n){let{lazyLoad:e,groupResult:t,rowsPerPage:o,repeatWrappedGroupRows:r,withRowInfo:i,toPrimaryKey:a,groupRowsState:l,isRowDisabled:s,isRowSelected:u,rowSelectionState:c,generateGroupRows:d,reducers:p={}}=n,{groupParams:f,deepMap:m,pivot:h}=t,{groupBy:g}=f,y=[],C=[],S=[],b=[];return m.visitDepthFirst((T,I,R,w)=>{let P=T.items,x=I.length,D=l?.isGroupRowCollapsed(I)??!1;b.push(R);let A=$y({lazyLoad:e,groupBy:g,parents:Array.from(S),reducers:p,indexInGroup:R,indexInParentGroups:Array.from(b),indexInAll:y.length,groupKeys:I,error:T.error,totalChildrenCount:T.totalChildrenCount,childrenLoading:(T.childrenLoading||!D&&!T.childrenAvailable)&&e,childrenAvailable:T.childrenAvailable,directChildrenCount:I.length===g.length?T.items.length:m.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},T);if(u&&(A.rowSelected=u(A),c)){let M=c.getSelectionCountFor(A.groupKeys);A.selectedChildredCount=M.selectedCount,A.deselectedChildredCount=M.deselectedCount}s&&(A.rowDisabled=s(A));let _=S[S.length-1],E=_?.collapsed??!1;E&&(D=!0),A.collapsed=D;let F=d||D;if(E&&(F=!1),F){if(r&&o!=null&&o>0){let M=A.indexInAll,N=A.parents;if(N.length>0&&M%o===0){let G=M/o,$=0;N.forEach(te=>{typeof r=="function"&&r(te)!==!0||(y.push(Yr(te,M+$,G)),$++,A.indexInAll++)})}}y.push(A),C.push(y.length-1)}A.collapsedChildrenCount=0,S.forEach(M=>{M.deepRowInfoArray.push(A),M.collapsedGroupsCount+=D?1:0}),_&&A.selfLoaded&&e&&(_.directChildrenLoadedCount+=1),i&&i(A),S.push(A);let v=!0;if(v){if(w)w();else if(!h){let M=y.length;D||(y.length+=P.length);let N=0;for(let G=0,$=P.length;G<$;G++){let te=P[G];if(!D&&r&&o!=null&&o>0){let k=M+G+N;if(k%o===0){let ae=k/o;S.forEach(oe=>{if(typeof r=="function"&&r(oe)!==!0)return;let W=M+G+N;y[W]=Yr(oe,W,ae),N++,y.length++})}}let he=M+G+N,z={id:te?a(te,he):`${I}-${G}`,data:te,isCellSelected:Xt,hasSelectedCells:Xt,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!te,rowSelected:!1,rowDisabled:!1,rootGroupBy:g,collapsed:D,groupKeys:I,parents:Array.from(S),indexInParentGroups:[...b,G],indexInGroup:G,indexInAll:he,groupBy:g,groupNesting:x+1,groupCount:A.groupCount};u&&(z.rowSelected=u(z)),s&&(z.rowDisabled=s(z)),i&&i(z),S.forEach((k,ae)=>{ae===S.length-1&&te&&(k.directChildrenLoadedCount+=1),D&&(k.collapsedChildrenCount+=1),k.deepRowInfoArray.push(z)}),D||(y[M+G+N]=z)}}}S.pop(),b.pop()}),{data:y,groupRowsIndexes:C}}import*as Ip from"react";var Uy=()=>{};function Yy(n,e){let t=new q,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){let s=i(l);for(let u=0;u<s.length;u++){let c=s.slice(0,u);t.has(c)||t.set(c,void 0)}t.set(s,l)}function a(l,s){let u=t.getKeysStartingWith(l,!0,1);for(let c of u){let d=[...l,c[c.length-1]],p=t.get(d),f=p?p[o]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[o]=f),s.push(p)}return s}return a([],[])}function Ld(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(o),d=[...t,c],p=r(o),f=Ye(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let h=0,g=m.length;h<g;h++){let y=m[h];Ld(n,e,d,y)}});p?(u?.(o),s?.(o,Uy)):(l?.(o,f,i(o)),s?.(o,f))}function Vd(n,e,t){for(let o=0,r=t.length;o<r;o++)Ld(n,e,[],t[o])}var qy=function(n,e){return n-e},Xy=function(n,e){return n=`${n}`,e=`${e}`,n.localeCompare(e)},Zy=function(n,e){return n-e},Qy={number:qy,string:Xy,date:Zy},On=Qy;function zd(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var Ot=(n,e,t)=>{let o=typeof t=="function"?t:t?.get;return e.sort(Gd(zd(n),o)),e},Za=(n,e,t)=>{let o=Gd(zd(n),t.get),r=t.depthFirst??!1,i=t.inplace??!1;r||(i?e.sort(o):e=[...e].sort(o));let{nodesKey:a,toKey:l}=t,s=c=>c[a],u=c=>c[a]===void 0;return Vd({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??s,toKey:l},{onParentNode:(c,d,p)=>{if(r&&d(),Array.isArray(p)){let f=i?p.sort(o):[...p].sort(o);c[a]=f}r||d()}},e),r&&(i?e.sort(o):e=[...e].sort(o)),e};Ot.knownTypes=On;var Jy=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=Ot.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys(Ot.knownTypes).join(", ")}`)}return r||(r=On.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:o*u}},eC=n=>n.map(Jy).filter(e=>e instanceof Function),Gd=(n,e)=>{let t=eC(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};var qr=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new q(o.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new q(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var st=class extends qr{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};function Ho(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||_n)(l,n);return t.push(s),t},[])}var Se=class{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new q;this.deselectedMap=new q;this.onlyUsePrimaryKeys=!1;this.selectionCache=new q;this.selectionCountCache=new q;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Ho(r,o):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let o=this.getGroupDeepMap()?.get(e);return o?o.totalChildrenCount??(o.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,!0,1)||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],!0,1)||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let o=t?.get(e);return o?o.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new Se(e,t,o)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}this.selectedMap.getKeysStartingWith(e,!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 o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getGroupByLength();if(e.length>r){let u=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,u),u}if(r&&this.onlyUsePrimaryKeys){let u=this.getAllPrimaryKeysInsideGroup(e),c=0,d=0;u.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}c++}else{if(this.selectedMap.has([f])){c++;return}d++}});let p={selectedCount:c,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let u=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,c=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,!0,1).length,p=this.deselectedMap.getKeysStartingWith(e,!0,1).length,f=c-(d+p),m={selectedCount:d+(u?f:0),deselectedCount:p+(u?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let u=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=u,l=this.deselectedMap.getAllChildrenSizeFor(e),l===u&&(a=0)):(l=u,a=this.selectedMap.getAllChildrenSizeFor(e),a===u&&(l=0))}i.forEach(u=>{let c=this.selectedMap.get(u),d=this.deselectedMap.get(u),p=c?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(u,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var tC="*",Ve=class{constructor(e){this.wildcard=tC;this.cache=new q;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)return;let l=[];if(r){let u=this.deselectedColumnsToRows.get(t),c=this.selectedColumnsToRows.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),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?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),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),o)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?.has(t)||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)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let c=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(c?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,o){if(o){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(o){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(o){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,o=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),o&&o.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let o=this.selectedRowsToColumns.get(e);if(o){if(o.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>o.has(r)):!1}return!1}error(e){Ht(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),u=this.deselectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||u?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():c?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var oC=Ge("InfiniteTable"),nC="#dc3545",rC="#eb9316";var Hd="Warn",Bd="Error",iC="Info",aC="Success",lC="Logs",Xr=oC.extend(lC),eF=Xr.extend(iC),sC=Xr.extend(Hd),uC=Xr.extend(Bd),tF=Xr.extend(aC);var cC=rC,dC=nC;var pC=(n,e)=>{e=e?e.extend?e.extend(Hd):e:sC,e(typeof e.color=="function"?e.color(cC,n):n)},fC=(n,e)=>{e=e?e.extend?e.extend(Bd):e:uC,e(typeof e.color=="function"?e.color(dC,n):n)};var Kd=new q,kd=(n,...e)=>{Kd.has(e)||(Kd.set(e,!0),n())};var Bo=(n,e=n,t)=>{kd(()=>pC(n,t),e,"warn")},Wd=(n,e=n,t)=>{kd(()=>fC(n,t),e,"error")};function Zr(n,e){return new Se(n,Xe(e))}function Xe(n){return()=>{let e=typeof n=="function"?n():n;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function jd(n){let{getDataSourceState:e,dataSourceActions:t}=n;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Se))throw"Invalid row selection";let a=new Se(r,Xe(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 Se))throw"Invalid row selection";let a=new Se(r,Xe(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 Se))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?Ho(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 Se))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Ho(d,u):[]}let c=new Se(a,Xe(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 Se))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Ho(d,u):[]}let c=new Se(l,Xe(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 Se))throw"Invalid row selection";let s=new Se(a,Xe(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 Se))throw"Invalid row selection";let s=new Se(a,Xe(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 Se))throw"Invalid row selection";let s=new Se(a,Xe(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new Se(i,Xe(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof Se))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Se(r,Xe(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 Qa=new WeakMap,mC=n=>n;function $d(n,e=50,t){Qa.set(n,{lastCallTime:0,lastCallArg:null});let o=t??mC;return r=>{let{lastCallTime:i,lastCallArg:a}=Qa.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=$t(o(a),o(r));s<e&&u||(Qa.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var Qr=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new q;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let u=o&&!o.isEmpty();if(u&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let c=[...o.getMutationsArray(),...o.getTreeMutationsArray()];for(let d=0,p=c.length;d<p;d++){let f=c[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}o?.removeInfo(void 0)}}else{let c=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];u&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let h=!1;if(m!=null){let g=r(m),y=s?[...p,g]:void 0,C=s&&!!y,S=C?o?.getMutationsForNodePath(y):o?.getMutationsForPrimaryKey(g);if(S&&S.length){for(let b=0,T=S.length;b<T;b++){let I=S[b];if(I.type==="delete"&&!h&&(C?this.removeNodePath(y,t):this.remove(g),h=!0,d.splice(f,1),f--),I.type==="update"&&!h&&(m={...m,...I.data},d[f]=m),I.type==="update-children"&&!h){let R=I.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}I.type==="insert"&&(I.position==="before"?(d.splice(f,0,I.data),f--):d.splice(f+1,0,I.data))}C?o?.removeNodePathInfo(y):o?.removeInfo(g)}if(!h)if(C){this.addNodePath(y,m);let b=a(m),T=b?null:i(m);!b&&Array.isArray(T)&&(p.push(g),u&&(m[l]=T=T.concat()),c(T,p),p.pop())}else this.add(g,m)}}};c(e,[])}return e}}};import{useEffect as $o,useMemo as ap,useRef as ai,useState as PC}from"react";import{useEffect as Ud,useRef as Ja}from"react";function ko(n,e){let t=Ja({}),o=Ja({}),r=o.current,i=Ja({}),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,Ud(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=n(s,r)),i.current={},o.current={},u},l)}function mF(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);Ud(n,t)}function el(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function tl(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function ol(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function Yd({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},u={},c=Ye(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=tl({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>h.isGroupRow?h.reducerResults?.[f.id]:null})})});(!a&&t==="start"||o==="start")&&c();let d=!i&&l.length===1;return n.visitDepthFirst((f,m,h,g)=>{if(m=[...m],t==="end"&&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 T=m[m.length-1];u[S]=ol({header:`${T}`,columnGroup:b,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:y,pivotIndex:m.length-1,pivotGroupKey:T})}l.forEach((b,T)=>{let I=d?`${m[m.length-1]}`:b.name||b.id,R=tl({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:b,pivotAggregatorIndex:T,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:y,defaultSortable:!1,columnGroup:S,header:I,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[b.id]:null}),w=`${b.id}:${m.join("/")}`;s[w]=R})}else{let y=m.join("/"),C=m.slice(0,-1);if(u[y]=ol({columnGroup:C.length?C.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=C.length?C.join("/"):void 0;if(!d){let T=b;b=`total:${m.join("/")}`,u[b]=ol({header:`${m[m.length-1]} total`,columnGroup:T,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((T,I)=>{let R=d?`${m[m.length-1]} total `:`${T.name||T.id} total`,w=tl({columnGroup:b,header:R,pivotAggregator:T,pivotAggregatorIndex:I,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[T.id]:null});s[`total:${T.id}:${m.join("/")}`]=w})}}(t==="start"||t===!1)&&g?.()}),(!a&&t==="end"||o==="end")&&c(),{columns:s,columnGroups:u}}var qd=Symbol("CLEAR"),Nt=class{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new q;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=qd,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(qd);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>q.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let o=new Nt({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:q.clone(e.nodePathToData),o}};function Qt(n,e){return e().dataArray[n]}function Jr(n){return n().dataArray}var Ze=class{constructor(e){this.collapsedPathsMap=new q;this.expandedPathsMap=new q;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:o,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?o.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?o.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var hC=(n,e)=>n.length-e.length,Be=class{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new q;this.cache=new q;let o=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.setConfigFn(t),this.update(o)}getTreeDeepMap(){return this.getConfig().treeDeepMap}isLeafNode(e){return!this.getTreeDeepMap().has(e)}getLeafNodesCount(e){let o=this.getTreeDeepMap().get(e);return o?o.items.length:1}static from(e,t){return new Be(e,t)}setConfigFn(e){this.getConfig=e,this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let o=this.cache.get(e);if(o)return o;if(this.isLeafNode(e)){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getUnnestedKeysStartingWith(e,!0).sort(hC);if(!l.length){if(i!==null){let p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,u=0,c=this.getNodeBooleanSelectionStateFromParent(e);c?s+=r:u+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:h}=this.getSelectionStateForNode(f);if(c?(s-=h,u+=h):(u-=m,s+=m),t&&m>0&&h>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:u})}if(!s&&!u)return this.cacheIt(e,{selected:c,selectedCount:c?r:0,deselectedCount:c?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:u,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.getSelectionStateForNode(e,!0).selected}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.getConfig=null,this.xcache(),this.selectionMap.clear()}};function ti(n,e){return new Be(n,Wo(e))}function Wo(n){return()=>({treeDeepMap:(typeof n=="function"?n():n).treeDeepMap})}var ei=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof Be))throw"Invalid tree selection";let a=new Be(r,Wo(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current=e,this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new Ze({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new Ze({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new Ze(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new Ze(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new Ze(o.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){let{treeDeepMap:t}=this.getState();if(!t||!e.length)return null;let o=this.getRowInfoByPath(e);return o?o.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?Qt(o,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Be))throw"Invalid node selection";let o=new Be(e,Wo(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Be))throw"Invalid node selection";let o=new Be(e,Wo(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Be))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};var jo=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var ut=class extends jo{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var nl=1e3;function Xd(n){return new rl(n)}var rl=class{constructor(e){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>Jr(this.getState);this.getRowInfoByIndex=e=>Qt(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),o=t.getDataForNodePath(e);return o||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?nl:r;return isNaN(a)||(a=nl),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let u=c=>t.position==="start"?[...e,...c||[]]:[...c||[],...e];return this.updateChildrenByNodePath(u,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=o?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let o=this.getState().rowDisabledState,r=o?new ut(o):new ut({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new ut({enabledRows:!0,disabledRows:[]});return}let t=new ut(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new ut({disabledRows:!0,enabledRows:[]});return}let t=new ut(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new ei({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(o=>{this.resolvePendingPromise=o});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:o,nodesKey:r}=this.getState(),i=t?Nt.clone(t,{light:!0}):new Nt({nodesKey:o?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((c,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],c,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof c=="function"?i.updateChildren(a.nodePaths[d],c,p,a.metadata):i.updateNodePath(a.nodePaths[d],c,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(c=>{let d=this.getDataByPrimaryKey(c);d&&i.delete(c,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(c=>{let d=this.getDataByNodePath(c);d&&i.deleteNodePath(c,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,u=a.nodePath;u?a.array.forEach(c=>{i.insertNodePath([...u],c,s,a.metadata),l=this.toPrimaryKey(c),u.pop(),u.push(l),s="after"}):a.array.forEach(c=>{i.insert(l,c,s,a.metadata),l=this.toPrimaryKey(c),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??nl,i=o.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(u=>{let c,d;l=p=>{clearTimeout(d),c=p,o.waitForNodePathPromises.delete(e),u(p)},d=setTimeout(()=>{c===void 0&&l(!1)},r)});return o.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function Zd(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:u,filterValue:c,aggregationReducers:d,nodesKey:p,isTree:f}=n;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let h=m.field;if(h&&(h=Array.isArray(h)?h:[h],t=h.reduce((g,y)=>g||typeof y!="function"?l.has(y):!1,!1),t))break}if(u&&u.length){if(l===!0)o=!0;else for(let m of u)if(m.field&&l.has(m.field)){o=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),c&&c.length)if(l===!0)i=!0;else for(let m of c){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let h=d[m];if(h.field){if(l.has(h.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:o,filterValue:i,aggregationReducers:a,tree:r}}function oi(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function ni(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function ri(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function al(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var Pt=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function il(){return!1}function gC(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:il,hasSelectedCells:il};return o&&(a.rowSelected=o(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var yC=Ye(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
1
|
+
var Qg=Object.create;var _s=Object.defineProperty;var Jg=Object.getOwnPropertyDescriptor;var eh=Object.getOwnPropertyNames;var th=Object.getPrototypeOf,nh=Object.prototype.hasOwnProperty;var oh=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var rh=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of eh(e))!nh.call(o,r)&&r!==t&&_s(o,r,{get:()=>e[r],enumerable:!(n=Jg(e,r))||n.enumerable});return o};var jn=(o,e,t)=>(t=o!=null?Qg(th(o)):{},rh(e||!o||!o.__esModule?_s(t,"default",{value:o,enumerable:!0}):t,o));var Cn=oh((fI,lc)=>{"use strict";lc.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 zt(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 be from"react";var Z=(...o)=>o.filter(e=>!!`${e}`).join(" ");import*as Tn from"react";import{useRef as Hs}from"react";function ge(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,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function Qe(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Fs=(o,e)=>o-e;var la=(o,e)=>Fs(o.revision,e.revision),J=class o{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,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,n,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),c=!a;if(i!==void 0){if(i<0)return;i--}let u=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!c)return;let h=g?[]:[...e,p],b=m?()=>this.visitWithNext(h,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let T=t(f.value,h,l,b,f);if(n&&T===!0)return!0;l++}else b?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,p]of r){let f=u(p,d);if(n&&f===!0)return f}};this.fill(e)}static clone(e){let t=new o;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}getEntriesStartingWith(e,t,n){let r=[];return this.getStartingWith(e,(i,a)=>{r.push([i,a])},t,n),r}getUnnestedKeysStartingWith(e,t,n){let r=[],i=c=>{r.push(c)},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return[];a=l.map}else if(!t&&a.has(this.emptyKey))return[[]];return l&&l.value!==void 0&&(t||(i({...l,keys:e}),s=!0)),s?r.sort(la).map(c=>c.keys):(this.visitWithNext(e,(c,u,d,p,f)=>{i({...f,keys:u})},!1,a,n,t),r.sort(la).map(c=>c.keys))}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,c=e.length;s<c;s++){let u=e[s];if(a=i.get(u),!a||!a.map)if(l=!0,s===c-1){l=!0;break}else return;i=a.map}a&&a.value!==void 0&&(n||t(e,a.value)),!l&&this.visitWithNext(e,(s,c,u,d)=>{t(c,s),d?.()},!1,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){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(!l||!l.map)return 0;if(t=l.map,a)return t?.size??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],c=a===l-1,u=t.get(s);if(c){u&&(u.hasOwnProperty("value")&&(delete u.value,delete u.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),u.map&&u.map.size===0&&delete u.map,u.map||t.delete(s));break}else{if(!u||!u.map){i=!1;break}r.push(u),t=u.map,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=n[n.length-1],c=e[e.length-1],u=s?.get(c);u&&(delete u.map,u.hasOwnProperty("value")||s.delete(c))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let 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,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...n,e],c=Qe(()=>{if(l)for(let[u]of l){let d=this.visitKey(u,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let u=r(a,s,c);if(i&&u===!0)return!0}c()}getArray(e){let t=[];return this.visit((n,r)=>{let i=e({...n,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let 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({...r,keys:i})}),t.sort(la);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};function we(){return globalThis}var br=["#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"],Os=Symbol("color"),hr=new WeakMap,sa=ge();function ca(o=br){hr.set(o,o.map(e=>0))}ca();var ih=(o=br)=>{let e=[];hr.has(o)?e=hr.get(o):(e=o.map(n=>0),hr.set(o,e));let t=e.reduce((n,r,i,a)=>r<a[n]?i:n,0);return e[t]!=null&&e[t]++,o[t]??o[0]??br[0]},Do=":",ua="*",Ns="-",ah=",",lh="debug",sh="diffdebug",ks=!1,xo=new J,Po=new Map;function da(o,e){let t=o.split(Do),n=new J;n.set(t,!0);let r=e.split(Do),i=new Set(r).has(ua),a=r.indexOf(ua),l=i?r.slice(0,a):r;if(n.getKeysStartingWith(l,i).length>0){let s=r.slice(a+1);return s.length?o.endsWith(s.join(Do)):!0}}function ch(o,e){let t=`channel=${o}_permissions=${e}`;if(Po.has(t))return Po.get(t);let n=e.split(ah);function r(l){return Po.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(ua)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(Ns);if(c&&(s=s.substring(Ns.length)),da(o,s))return r(!c)}for(let l=0;l<a.length;l++){let s=a[l],c=s.startsWith("-");if(c&&(s=s.substring(1)),da(o,s))return r(!c)}return r(!1)}var pa=()=>Be.enable??(we()&&we().localStorage?.getItem(lh))??"",uh=()=>Be.diffenable??(we()&&we().localStorage?.getItem(sh))??`${ks}`,fa="",zs=ks;function ma(o){zs=`${uh()}`=="true",fa!==o&&(fa=o,Po.clear())}function Vs(o){ma(pa()),typeof we()<"u"&&we().addEventListener&&we().addEventListener("storage",function(){ma(pa())});function e(t,n){let r=n?`${n}${Do}${t}`:t,i=r.split(Do),a=xo.get(i);if(a)return a;let l=xo.get(i.slice(0,-1)),s=(l?l.logFn:Be.logFn)??Gs,c=s,u,d=0,p=()=>u??ch(r,fa),f=ih(Be.colors),m=Object.defineProperties((...g)=>{let h=sa.getListenersCount(),b;if(h>0&&(b=b??Date.now(),sa({color:f,channel:r,args:g,timestamp:b})),p()){if(b=b??Date.now(),d&&zs){let S=b-d;c(`%c[${r}]`,`color: ${f}`,`+${S}ms:`)}d=b;let T=[],C;if(g.forEach(S=>{if(S[Os])C===void 0&&(C=!0),T.push(...S);else{if(typeof S!="string"&&typeof S!="number"){C=!1;return}T.push(`${S}%s`)}}),C){let S=[`%c[${r}]%c %s`,`color: ${f}`,"",...T,""];c(...S)}else c(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let b=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return b.toString=()=>h.join(" "),b[Os]=!0,b}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{xo.delete(i)}}});return xo.set(i,m),m}return e(o)}var Gs=console.log.bind(console),Ls;Object.defineProperty(Vs,"enable",{get:()=>Ls,set:o=>{Ls=o,ma(pa())}});var Be=Vs;Be.colors=br;Be.logFn=Gs;var dh=(o,e)=>sa.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;da(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});Be.onLogIntent=dh;Be.destroyAll=()=>{ca(),ca(Be.colors),xo.clear(),Po.clear()};var ut=o=>{let e=Be(o?`${o}:TYPE=debug`:"TYPE=debug");return e.logFn=console.log.bind(console),e},Qt=o=>{let e=Be(o?`${o}:TYPE=error`:"TYPE=error");return e.logFn=console.error.bind(console),e},Eo=()=>Eo;Eo.extend=()=>Eo;var rt=class{constructor(e){this.debug=Eo,this.error=Eo}};import*as ph from"react";import{useMemo as uv,useRef as fh,useEffect as mh,useLayoutEffect as gh,useCallback as dv}from"react";var Mo=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?zt(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(o),()=>{a.disconnect()}},yr=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=fh({width:0,height:0}),r=i=>{let a;return o.current&&(a=Mo(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()}};mh(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),gh(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};var hh=Qt("CSSVariableWatch"),bh=ut("CSSVariableWatch"),yh={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},Th=o=>{let e=Hs(0),t=Tn.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);yr(o.ref,t,{earlyAttach:!0}),Tn.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n)return e.current=n,bh(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);hh(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},Ao=o=>{let e=Hs(null);Th({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return Tn.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:yh},Tn.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};import*as Cr from"react";import*as Ks from"react";var ga;function _o(){return ga||(ga=Ks.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}import*as Bs from"react";var ha;function Tr(){return ha||(ha=Bs.createContext(void 0))}function Jt(){let o=_o();return Cr.useContext(o).componentState}function De(){let o=_o();return Cr.useContext(o)}function ke(){let o=Tr();return Cr.useContext(o)}import*as vn from"react";import{useCallback as Mc,useEffect as _a,useRef as lb,useState as sb}from"react";import*as Sr from"react";function Ch(o){let{height:e,width:t,count:n}=o;return Sr.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 Ws=Sr.memo(Ch);var js="mlx2t3";import*as wr from"react";import{useRef as wh}from"react";import{useEffect as Sh}from"react";var $s=(o,e)=>{Sh(()=>{let t=o?.current,n=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",n,r),()=>{t?.removeEventListener("scroll",n)}},[e,o?.current])};var Us={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Ys={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},qs={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},ba="_1ueijco1",Xs="_1ueijco0 _16lm1iw0";var Zs=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=Us[`${o}`]:e=Z(Ys[`${o.horizontal}`],qs[`${o.vertical}`]),e};var vh="InfiniteVirtualScrollContainer";var Qs=wr.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??wh(null);return $s(u,i),wr.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:Z(a,vh,Xs,Zs(r))},n)});import*as _r from"react";import{useLayoutEffect as Aa,useMemo as kh}from"react";import*as Js from"react";import{useLayoutEffect as Ih,useRef as Rh,useState as xh}from"react";function Dh(o){let[e,t]=xh(o.updater.get),n=Rh(null);return Ih(()=>{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}var en=Js.memo(Dh);function tn(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 ec(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}function q(o){return o.slice(4,-1)}var Je="Infinite",Me={rootClassName:Je};var $={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var tc="true",ae={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},nc="column-header-height";var oc=`.${Me.rootClassName}`;function ya(o){return tn(o,oc)}var rc=q($.scrollLeft),Ph=q($.scrollTop),Eh=q($.columnWidthAtIndex),Ta=q($.columnOffsetAtIndex),ic=q($.columnReorderEffectDurationAtIndex),Mh=q($.columnOffsetAtIndexWhileReordering),Ah=q($.columnVisibilityAtIndex),_h=q($.columnZIndexAtIndex);function At(o,e,t){let n=t?ya(t):document.querySelector(oc);Fh(o,e,n)}function Fh(o,e,t){if(t){let n=o,r=$[n]?q($[n]):o;t.style.setProperty(r,`${e}`)}}function $n(o,e){if(e)for(var t in o){let n=$[t]?q($[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function Ca(o,e,t){At(`${Ta}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${rc}))`:`${o.computedAbsoluteOffset+e}px`,t)}function Sa(o,e,t){At(`${_h}-${o}`,`${e}`,t)}function Un(o,e,t){At(`${Mh}-${o}`,typeof e=="number"?`calc( var(${Ta}-${o}) + ${e}px )`:e,t)}function Fo(o,e,t){At(`${Ah}-${o}`,e,t)}function vr(o,e,t){At(`${ic}-${o}`,t??"",e)}function wa(o,e){let t=`${ic}-${o}`;At(t,ae.components.Cell.reorderEffectDuration,e)}var Te={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Eh}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,At(this.varName.get(o),e,t)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Ta}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,At(this.varName.get(o),e,t)}}};function ac(o,e){$n({[rc]:`${o.scrollLeft}px`,[Ph]:`${o.scrollTop}px`},e)}var Ae=we().requestAnimationFrame||(o=>setTimeout(o,16)),vt=we().cancelAnimationFrame||(o=>clearTimeout(o));var sc=jn(Cn());var va=(o,e)=>o-e,Vt={horizontal:!0,vertical:!0};function Ir(o,e){let t=e.length;if(!t)return 0;let n=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=n)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>o){a>n&&(n=a);break}}return n<0?t:Math.min(n,t)}var Ia="DebugID=";function nn(o,e){return e&&e.startsWith(Ia)?e:e?`${Ia}${o}:${e}`:`${Ia}${o}`}var Rr={start:0,end:0},Ra=o=>{o()},xa=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},cc=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},Oo=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function Oh(o){return o.horizontalChange||o.verticalChange}var Sn=class extends rt{constructor(t){let n=nn(t,`${t}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Rr;this.verticalExtendRangeBy=Rr;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let 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.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,n=this.getAvailableSize();t.forEach(r=>{Oo(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Ra:Oo;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Ra:Oo;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let 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 u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=this.getColWidth(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=this.getRowHeight(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let 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=Vt)=>{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.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{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=Vt)=>{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,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,u])}}}if(r){let l=t.startIndex,s=n.startIndex,c=n.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([u,p])}}}return a};this.computeRenderRange=(t=Vt)=>{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.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof n!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,p=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),p&&(r+=p);let f=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,u=Math.max(a,f-r)),{startIndex:u,endIndex:f}};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,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,n),d=u,u=a[c],d===u&&d!=0))return i-1;let p=(0,sc.default)(a,t,va);return p>=0?p:~p-1};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],c=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};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 c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),p=u.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:n};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let h=s(g);d[f]=f,p[f]=h;let b=f;for(;h>1;)b+=1,d[b]=f,p[b]=0,h-=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,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[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,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[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,c=Math.min(t,r-1);for(;s<=c;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);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=xa;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(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.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=Vt){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",p=u&&s!==this.availableWidth,f=d&&c!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=c,this.availableRenderHeight=c),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",h=m&&r!==this.rows,b=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let T=a!=null,C=l!=null,S=T&&a!==this.rowHeight,y=C&&l!==this.colWidth;T&&(this.rowHeight=a),C&&(this.colWidth=l);let I=t.rowspan!=null,w=t.colspan!=null,v=I&&t.rowspan!=this.rowspan,R=w&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),R&&(this.colspan=t.colspan);let x=b||y||p||R,D=h||S||f||v;(n||Oh)({horizontalChange:x,verticalChange:D,colsChanged:b,colWidthChanged:y,widthChanged:p,colspanChanged:R,rowsChanged:h,rowHeightChanged:S,heightChanged:f,rowspanChanged:v})&&this.updateRenderCount({horizontal:x,vertical:D})}extendRenderRange(t){let{direction:n}=t,r=n==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(t=Vt){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=Vt){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}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?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Ra:Oo;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a(r)})})}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)}computeDirectionalRenderCount(t,n,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let u=[],d=0,p=r;d+=s,p-=c;for(let f=d;f<p;f++)u.push(this.getItemSize(f,t));a=Ir(l,u)}else a=(n?Math.ceil(l/n):0)+1;return a+=s+c,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{Oo(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}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}getItemSizeCacheFor(t,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let 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,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Rr,this.verticalExtendRangeBy=Rr,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Pa=jn(Cn());function uc(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function dc(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function No(o,e){for(let t of o)if(e(t))return t}import*as fc from"react";var pc=new Map,Nh=()=>{},Da=class{constructor(e,t){this.element=null;this.mounted=!1;this.mountSubscription=ge();let n=pc.get(e)??0,r=`${e}:GridCellReact:${n}`;pc.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=ge(),this.node=fc.createElement(en,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Nh,this.element=null,this.node=null}getNode(){return this.node}update(e,t){this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Yn=class Yn extends rt{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=ge();this.cellAttachmentChangeSubscription=ge();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=new Da(this.debugId);return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,n=t.values().next().value;return n||(this.poolSize+=Yn.POOL_SIZE_INCREMENT,n=t.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}set poolSize(t){t=Math.ceil(t/Yn.POOL_SIZE_INCREMENT)*Yn.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedCells:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};Yn.POOL_SIZE_INCREMENT=1;var xr=Yn;var Dr=(o,e)=>o-e,Pr=class extends rt{constructor(t){super(`${t}:GridCellManager`);this.matrix=new J;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,b=f>=s;(m||g||h||b)&&c.add(u)}),c};this.debugId=t,this.pool=new xr(t),this.offRemoveCell=this.pool.onRemoveCell(n=>this.onRemoveCell(n))}onRemoveCell(t){let n=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),n&&this.clearCellFromMatrix(t,n,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,n,r){if(this.matrix.delete(n),r.skipHistory)return;let[i,a]=n,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,n){let[r,i]=n;this.matrix.set(n,t),this.cellToMatrixPosition.set(t,n);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,n){let r=this.cellToMatrixPosition.get(t);if(n==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=n,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,n)}renderNodeAtCell(t,n,r,i){let a=this.getCellAt(r);return a&&a!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i),n}getCellPosition(t){let n=this.cellToMatrixPosition.get(t);return!n||this.getCellAt(n)!=t?null:n}getCellAt(t){return this.matrix.get(t)}getCellFor(t,n){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(n==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=No(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=No(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let n=this.getCellAt(t);return n?this.isCellAttached(n):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:n+1},(s,c)=>{let u=[a,c],d=this.getCellAt(u);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Dr)}getColumnsWithCells(){let t=this.matrix.getUnnestedKeysStartingWith([],!0);return[...new Set(t.map(r=>r[1])).values()].sort(Dr)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((n,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(n=>this.detachCell(n))}detachRowsStartingWith(t){let n=this.getRowsWithCells().sort(),r=(0,Pa.default)(n,t,Dr);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,Pa.default)(n,t,Dr);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[n,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>n&&this.detachCellAt(a),l===n&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let n=this.getCellAt(t);return n?this.detachCell(n):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,n){return No(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return No(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var hc=jn(Cn());import*as gc from"react";var mc=new Map,Lh=()=>{},Ea=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=ge();let t=mc.get(e)??0,n=`${e}:ListRowReact:${t}`;mc.set(e,t+1),this.debugId=n,this.updater=ge(),this.node=gc.createElement(en,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Lh,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},qn=class qn extends rt{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=ge();this.rowAttachmentChangeSubscription=ge();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=new Ea(this.debugId);return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,n=t.values().next().value;return n||(this.poolSize+=qn.POOL_SIZE_INCREMENT),n=t.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/qn.POOL_SIZE_INCREMENT)*qn.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedRows:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};qn.POOL_SIZE_INCREMENT=1;var Er=qn;var Mr=class extends rt{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new Er(t),this.offRemoveRow=this.pool.onRemoveRow(n=>this.onRemoveRow(n))}onRemoveRow(t){let n=this.rowToIndex.get(t);n!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(n))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,n){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),n==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,n),this.indexToRow.set(n,t))}detachStartingWith(t){let n=this.getAttachedIndexes(),r=(0,hc.default)(n,t,(a,l)=>a-l);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let n=this.getRowAt(t);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(t){let n=this.getRowIndex(t);n!=null&&this.detachRowAt(n)}renderNodeAtRow(t,n,r){let i=this.getRowAt(r);return i&&i!==n&&this.detachRowAt(r),this.pool.attachRow(n),this.setRowIndexInList(n,r),n.update(t),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var bc=!0,wn=q($.y),yc=q($.scrollTop),JI=q($.columnOffsetAtIndex),Ma=q($.columnOffsetAtIndexWhileReordering),Xn=class extends rt{constructor(t,n){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(wn,i?`calc( ${r}px + var(${yc}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${wn}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=Te.columnOffsets.get(r),d=`${Ma}-${r}`,p=s?`calc( ${a}px + var(${yc}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(wn,p));let f=`translate3d(var(${d}, ${u}), var(${wn}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),c!=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(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollTop;if(l==="center"?h=c-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),this.brain.isHorizontalLayoutBrain){let b=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),T=this.getScrollPositionForScrollColumnIntoView(b,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});T&&(a=T.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let c=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollLeft;return l==="center"?h=c-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),{...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;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let c=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let n=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n,void 0,r);this.isColumnFullyVisible=(t,n=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n,r);this.isColumnVisible=(t,n=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,c]}=i.getRenderRange();if(t<l||t>=c)return!1;let u=Math.floor((l+c)/2);if(t>=u){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+n+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,n,r)=>this.isRowRendered(t)&&this.isColumnRendered(n,r);this.isColumnRendered=(t,n)=>{let{start:[r]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};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.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:c,end:u}=t,[d,p]=c,[f,m]=u,g=[];if(i&&(n&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let h={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(h)}if(r){let h={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(h)}return g};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,p=!1;if(t<r&&(u=!0,p="start"),i&&!u){let f=c-i;t>=f&&(u=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:u?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.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ae(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:c,y:u}=s;if(r){this.updateHoverClassNamesForRow(a);let d=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=d.rowIndex,r.dataset.colIndex=d.colIndex,bc){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let f=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==f&&(r.__zIndex=f,r.style.zIndex=f)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let n=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;n&&(n.dataset.detailRowIndex=r,bc&&(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.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:n,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:c,fixedRowsStart:u,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(E=>{let _=i.getRowIndex(E);if(_!=null){let P=this.brain.getItemOffsetFor(_,"vertical");if(P==null)return;let F=E.getElement();if(!F)return;this.setDetailTransform(F,_,{y:P,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&ac(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:h}=this.brain.getRenderRange(),[b,T]=g,[C,S]=h;function y(E,_,P){let F=r.getCellAt([E,_]);if(F==null)return;let N=n.getCellOffset(E,_),G=F.getElement();G&&N&&P(E,_,G,N)}let I=(E,_,P,{x:F,y:N})=>{this.setTransform(P,E,_,{x:F,y:N,scrollLeft:!0},s-_)},w=(E,_,P,F)=>{this.setTransform(P,E,_,{x:F.x,y:F.y,scrollTop:!0},u-E)},v=(E,_,P,{y:F})=>{let N=f[_];this.setTransform(P,E,_,{x:N,y:F,scrollLeft:!0},a-_)},R=(E,_,P,F)=>{this.setTransform(P,E,_,{x:F.x,y:m[E],scrollTop:!0},l-E)},x=(E,_,P,{x:F,y:N})=>{this.setTransform(P,E,_,{x:F,scrollLeft:!0,y:N,scrollTop:!0},1e5)},D=(E,_,P,{x:F})=>{this.setTransform(P,E,_,{x:F,scrollLeft:!0,y:m[E],scrollTop:!0},2e5)},M=(E,_,P,F)=>{this.setTransform(P,E,_,{x:f[_],y:F.y,scrollLeft:!0,scrollTop:!0},3e5)},A=(E,_,P)=>{this.setTransform(P,E,_,{x:f[_],y:m[E],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let E=b;E<C;E++){for(let _=0;_<s;_++)y(E,_,I);if(c){let _=a-c;for(let P=_;P<a;P++)y(E,P,v)}}if(u||d)for(let E=T;E<S;E++){for(let _=0;_<u;_++)y(_,E,w);if(d){let _=l-d;for(let P=_;P<l;P++)y(P,E,R)}}if(s&&u)for(let E=0;E<u;E++)for(let _=0;_<s;_++)y(E,_,x);if(s&&d){let E=l-d;for(let _=E;_<l;_++)for(let P=0;P<s;P++)y(_,P,D)}if(c&&u){let E=a-c;for(let _=0;_<u;_++)for(let P=E;P<a;P++)y(_,P,M)}if(c&&d){let E=l-d,_=a-c;for(let P=E;P<l;P++)for(let F=_;F<a;F++)y(P,F,A)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=n,this.cellManager=new Pr(n),this.cellManager.onCellAttachmentChange((s,c)=>{c?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new Mr(n),this.rowManager.onRowAttachmentChange((s,c)=>{c?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ae(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),a=t.onScrollStart(this.onScrollStart),l=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),i(),a(),l()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=ya(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,n){let r=!!this.cellManager.getCellAt([t,n]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let x=t.start[1],D=t.end[1];m.forEach(M=>{x<=M&&M<D||f.push({start:[t.start[0],M],end:[t.end[0],M+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([x,D])=>{g.set(`${x}:${D}`,!0)});let b=f.reduce((x,D)=>x+xa(D),0),T=r?f.reduce((x,D)=>x+cc(D),0):0,C=this.brain.getRowCount(),S=this.brain.getColCount();d.detachCellsStartingAt([C,S]);let y=Math.min(C*S,b);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>T&&(u.poolSize=T));let I=uc(...f.map(x=>d.getCellsOutsideRenderRange(x)));I=dc(I,x=>{let D=d.getCellPosition(x);return!(D&&g.has(`${D[0]}:${D[1]}`))}),d.detachCells(I),d.poolSize=y;let w=new Map,v=new Map;f.forEach(x=>{let{start:D,end:M}=x,[A,E]=D,[_,P]=M;for(let F=A;F<_;F++){for(let G=E;G<P;G++){let H=`${F}:${G}`;if(w.has(H))continue;w.set(H,!0);let{rendered:B,mapped:pe}=this.isCellRenderedAndMappedCorrectly(F,G);if(F===A||G===E){let k=this.isCellCovered(F,G);if(k&&g.has(`${k[0]}:${k[1]}`)){let W=d.getCellAt([F,G]);W!=null&&d.detachCell(W);continue}}if(B&&!i&&pe)continue;let de;B?de=d.getCellAt([F,G]):de=d.getCellFor([F,G],c?"row":"column"),de==null&&(de=d.getDetachedCell()),this.renderCellAt(F,G,de,n)}!r||v.has(F)||(v.set(F,!0),u.isRowAttachedAt(F)&&!i)||this.renderDetailRowAtElement(F,this.rowManager.getRowFor(F),r)}}),h.forEach(([x,D])=>{let{rendered:M,mapped:A}=this.isCellRenderedAndMappedCorrectly(x,D);if(M){if(i||!A){let _=[x,D],P=d.getCellAt(_);this.renderCellAt(x,D,P,n)}return}let E=d.getCellFor([x,D],c?"row":"column");E!=null&&this.renderCellAt(x,D,E,n)});let R=d.getAllCells().map(x=>x.getNode());return r&&u.getAllRows().forEach(x=>{R.push(x.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(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,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(c,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),c=this.brain.getRowspan(t,n),u=this.brain.getColspan(t,n),d=c===1?l:this.brain.getRowHeightWithSpan(t,n,c),p=u===1?s:this.brain.getColWidthWithSpan(t,n,u),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:h,colIndex:b}=this.getCellRealCoordinates(t,n),T=i({rowIndex:h,colIndex:b,height:l,width:s,rowspan:c,colspan:u,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnter.bind(null,t),onMouseLeave:this.onMouseLeave.bind(null,t),domRef:r.ref});r.isMounted()||r.onMount(S=>{let y=S.getElement();y&&(y.style.position="absolute",y.style.left="0px",y.style.top="0px"),this.updateElementPosition(S)});let C=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:b}:void 0;if(!T){this.brain.isHorizontalLayoutBrain?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(T,r,[t,n],C),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Ar=class extends Xn{constructor(t,n){super(t,n);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=ae.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",p=Te.columnOffsets.get(l.colIndex),f=`${Ma}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(wn,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${wn})`,b=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==b&&(t.__transformValue=b,t.style.transform=b)};this.brain=t}getCellRealCoordinates(t,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:n})}isCellRenderedAndMappedCorrectly(t,n){let r=this.cellManager.getCellAt([t,n]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,n),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function Lo(o){let e=o.isHorizontalLayoutBrain?new Ar(o,`${o.name}:HorizontalLayoutTableRenderer`):new Xn(o,`${o.name}:ReactHeadlessTableRenderer`),t=ge();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function zh(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=kh(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:Lo(e),[e,o.onRenderUpdater,o.renderer]);return Aa(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),Aa(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),Aa(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),_r.createElement(en,{updater:a})}var Fr=_r.memo(zh);import*as ko from"react";import{useEffect as jh,useLayoutEffect as $h,useRef as Uh}from"react";import{useCallback as Vh,useState as Gh}from"react";var _t=()=>{let[o,e]=Gh(0);return[o,Vh(()=>{e(t=>t+1)},[e])]};function Hh(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 Kh(o){var e=Hh(o,"string");return typeof e=="symbol"?e:String(e)}function Bh(o,e,t){return e=Kh(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Tc(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 Cc(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tc(Object(t),!0).forEach(function(n){Bh(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Tc(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function Sc(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var Wh=(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},ue=o=>{var e=t=>{var n=o.defaultClassName,r=Cc(Cc({},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 c=o.variantClassNames[i][s];c&&(n+=" "+c)}}for(var[u,d]of o.compoundVariants)Wh(u,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 Sc(o.variantClassNames,t=>Sc(t,n=>n.split(" ")[0]))}},e};var wc=ue({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Or="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var vc=ue({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Yh}=Me,qh=`${Yh}-ActiveRowIndicator`,Xh=`calc(${$.activeCellRowOffsetX} + var(${q($.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,Zh={[q($.activeCellOffsetY)]:$.activeCellRowOffset,transform:`translate3d(${Xh}, calc( ${$.activeCellOffsetY} + var(${q($.scrollTopForActiveRow)}, 0px)), 0px)`,height:$.activeCellRowHeight,maxWidth:ae.runtime.totalVisibleColumnsWidthVar},Qh=o=>{let{brain:e}=o,t=Uh(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=_t();return $h(()=>{if(o.activeRowIndex==null)return;let a="0px",l=o.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${ae.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),c=e.getItemOffsetFor(l,"vertical"),u=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`,activeCellRowOffsetX:a};$n(d,u)},[o.activeRowIndex,e]),jh(()=>{let a=c=>{$n({scrollTopForActiveRow:`${-c.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-c.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),ko.createElement("div",{className:Or,"data-name":"active-row"},ko.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${qh} ${vc({active:n})}`,style:n?Zh:void 0}))},Ic=ko.memo(Qh);import*as zo from"react";import{useEffect as Jh,useLayoutEffect as eb,useRef as tb}from"react";var{rootClassName:nb}=Me,ob=`${nb}-ActiveCellIndicator`,rb=q($.columnZIndexAtIndex),ib=(o,e,t,n)=>{if(e==null)return;let[r]=e;o.isHorizontalLayoutBrain&&o.rowsPerPage&&(r=r%o.rowsPerPage);let i=typeof t=="function"?t(r):t??o.getRowHeight(r),a=o.getItemOffsetFor(r,"vertical"),l=n.current;$n({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},ab=o=>{let{brain:e}=o,[t,n]=_t(),r=tb(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return eb(()=>{ib(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),Jh(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),zo.createElement("div",{className:Or,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${rb}-${o.activeCellIndex[1]})`}:void 0},zo.createElement("div",{"data-name":"active-cell-indicator",className:`${ob} ${wc({visible:i})}`}))},Rc=zo.memo(ab);var xc="_1eexc2a7 _1eexc2a6",Dc=ue({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),Pc=ue({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var Ec="_1eexc2a5",Nr=ue({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Lr="_1eexc2a8";var kr=[Ec,`${Je}DetachedCell`];function zr(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 cb=Z(js,ba);function Ac(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:h}=g,b=lb(null),[T,C]=sb({width:0,height:0});_a(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),_a(()=>{let I=b.current?.parentNode;return I?(h&&document.activeElement!==I&&I.focus(),Mo(I,()=>{let R={height:I.clientHeight,width:I.clientWidth};e.update(R)},{debounce:50})):void 0},[p,e]);let S=Mc(I=>{requestAnimationFrame(()=>{b.current&&b.current.style.setProperty("transform",`translate3d(${-I.scrollLeft}px, ${-I.scrollTop}px, 0px)`)})},[]),y=Mc(I=>{e.setScrollPosition(I,S)},[e,S]);return _a(()=>{let I=e.onRenderCountChange(()=>{C(e.getVirtualizedContentSize())});return C(e.getVirtualizedContentSize()),S(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),I},[e]),vn.createElement(Qs,{onContainerScroll:y,...g,ref:t},vn.createElement("div",{ref:b,className:cb,"data-name":"scroll-transform-target"},vn.createElement(Fr,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:kr}),u!=null?vn.createElement(Rc,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?vn.createElement(Ic,{brain:e,activeRowIndex:c}):null,vn.createElement(Ws,{width:T.width,height:T.height}))}import*as Zn from"react";import{useReducer as hb,createContext as bb,useMemo as La,useEffect as yb,useState as Fc,useRef as Oc,useLayoutEffect as Tb}from"react";function Fa(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(c,u){return t.add(u),c[u]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var Oa=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function Vo(o){return o!==void 0}function on(o,e){let t=e[o];return Vo(t)}import{useCallback as ub,useEffect as db,useRef as Na}from"react";var _c=o=>{let e=ub(o,[]),t=Na(!1),n=Na(!1),r=Na(void 0),[i,a]=_t();t.current&&(n.current=!0),db(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};import{useCallback as pb,useRef as fb}from"react";function Ie(o){let e=fb(o);return e.current=o,pb(()=>e.current,[])}import{useRef as mb,useLayoutEffect as gb}from"react";var In=(o,e)=>{let t=mb(e===void 0?o:e);return gb(()=>{t.current=o}),t.current};var Cb=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)},ka;function Nc(){return ka||(ka=bb(null))}function Sb(o,e,t,n,r,i,a){let l=e();return Object.keys(l).reduce((s,c)=>{let u=c;return Object.defineProperty(s,c,{set:p=>{let f=t(),m=e(),g=m[u],h=!0;if(i&&typeof i[u]=="function"&&i[u](p,{actions:s,state:m})===!1&&(h=!1),h){let C=[p],S=`on${Oa(c)}Change`;if(a&&a[u]){let y=a[u](p,m);S=y.callbackName||S,C=y.callbackParams}Cb(f,S,C)}let b=n[u];typeof b=="function"&&(p=b(p));let T=!!r?.[u];on(c,f)&&!T||o({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function wb(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=on(r,e)?e[r]:e[`default${Oa(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function It(o){let e=o.getParentState||(()=>null);function t(r){let[i]=Fc(()=>o.initSetupState?o.initSetupState(r):{}),a=Oc(new Set),l=La(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),c=Ie(s);function u(){let v={};l&&(v=wb(l,r,i));let R={...i,...v};if(o.mapPropsToState){let{fn:x,propertyReads:D}=Fa(o.mapPropsToState,{getProxyTargetFromArgs:A=>A.props,putProxyToArgs:(A,E)=>[{...E,props:A}]}),M=x({props:r,state:R,oldState:null,parentState:s});return a.current=new Set([...a.current,...D]),{...R,...M}}return R}let[d]=Fc(u),p=Ie(r),f=(v,R)=>{if(R.type==="REPLACE_STATE")return R.payload;let x=c?.()??null,D=R.payload.mappedState,M=R.payload.updatedPropsToState,A={...v};if(D&&Object.assign(A,D),o.mapPropsToState){let{fn:_,propertyReads:P}=Fa(o.mapPropsToState,{getProxyTargetFromArgs:N=>N.props,putProxyToArgs:(N,G)=>[{...G,props:N}]}),F=_({props:p(),state:A,oldState:v,parentState:x});a.current=new Set([...a.current,...P]),Object.assign(A,F)}return R.type==="ASSIGN_STATE"&&Object.assign(A,R.payload),o.concludeReducer?o.concludeReducer({previousState:v,state:A,updatedProps:M,parentState:x}):A},[m,g]=hb(f,d),h=Ie(m),{allowedControlledPropOverrides:b}=o,T=La(()=>Sb(g,h,p,l,b,o.interceptActions,o.mappedCallbacks),[g,l,b]),C=o.Context??Nc(),S=La(()=>({componentState:m,componentActions:T,getComponentState:h,replaceState:v=>{g({type:"REPLACE_STATE",payload:v})},assignState:v=>{g({type:"ASSIGN_STATE",payload:v})}}),[m,T,h]),y=In(r),I=Oc(!1);I.current=!1;let w=o.layoutEffect?Tb:yb;return w(()=>{let v=r,R={},x=0,D={},M=0,A={},E=0;if(new Set([...Object.keys(v),...Object.keys(y)]).forEach(F=>{let N=F,G=y[N],H=v[N];if(N!=="children"&&G!==H&&(A[N]={newValue:H,oldValue:G},E++,on(N,r)||on(N,y)))if(l.hasOwnProperty(F)){let B=H,pe=l[F];typeof pe=="function"&&(B=pe(H)),m[N]!==B&&(R[N]=B,x++)}else a.current.has(F)&&(D[N]=v[N],M++)}),M>0||x>0){(o.debugName?ut(typeof o.debugName=="function"?`${o.debugName(v)}:rerender`:`${o.debugName}:rerender`):ut("rerender"))("Triggered by new values for the following props",...Object.keys(R??{}),...Object.keys(D??{}));let N={payload:{mappedState:x?R:null,updatedPropsToState:M?D:null}};if(I.current=!0,g(N),o.onPropChange){for(var P in A)if(A.hasOwnProperty(P)){let{newValue:G,oldValue:H}=A[P];o.onPropChange({name:P,newValue:G,oldValue:H},r,T,m)}}o.onPropsChange&&E&&o.onPropsChange(A,r,T,m)}}),w(()=>{s!=null&&!I.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),_c(()=>()=>{o.cleanup?.(h())}),{contextValue:S,ContextComponent:C}}return{ManagedComponentContextProvider:Zn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return Zn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function je(o){return o=o??Nc(),Zn.useContext(o)}import*as qc from"react";var Vr=()=>Me;var Lc="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Gr={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Ft="_16lm1iw3b _16lm1iw3c _16lm1iw35",kc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},rn={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var zc={1:"_16lm1iw1c",none:"_16lm1iw1d"},Rn={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"},Vc={0:"_16lm1iw2o",1:"_16lm1iw2p",2:"_16lm1iw2q",3:"_16lm1iw2r",4:"_16lm1iw2s",5:"_16lm1iw2t",6:"_16lm1iw2u",7:"_16lm1iw2v",8:"_16lm1iw2w",9:"_16lm1iw2x",10:"_16lm1iw2y",none:"_16lm1iw2z"},Gc={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Hc={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Kc={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Bc={none:"_16lm1iwd"},Wc={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Hr={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var jc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var $c={none:"_16lm1iw1x"};var Uc={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Yc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function Xc(o){let{rootClassName:e}=Vr();return qc.createElement("div",{...o,className:Z(`${e}Footer`,Hr.relative,rn.flex,Rn.row,o.className)})}import*as ve from"react";import{useCallback as yp,useContext as oT,useEffect as rT,useRef as iT}from"react";import{createPortal as aT}from"react-dom";function Kr(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}import*as Zc from"react";var _e=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return Zc.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};import*as Go from"react";var Qc=o=>Go.createElement(_e,{...o},Go.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29"}),Go.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Go.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));import*as za from"react";var Jc=o=>za.createElement(_e,{...o},za.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 Va from"react";var Ga=o=>Va.createElement(_e,{...o},Va.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));import*as Ha from"react";var eu=o=>Ha.createElement(_e,{...o},Ha.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 Ka from"react";var tu=o=>Ka.createElement(_e,{...o},Ka.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));import*as Ba from"react";var nu=o=>Ba.createElement(_e,{...o},Ba.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 Wa from"react";var ou=o=>Wa.createElement(_e,{...o},Wa.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));import*as ja from"react";var ru=o=>ja.createElement(_e,{...o},ja.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));import*as $a from"react";var iu=o=>$a.createElement(_e,{...o},$a.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 nl from"react";import*as qe from"react";import{useEffect as Lb,useState as Nu}from"react";import{useContext as Ib}from"react";import{createContext as vb}from"react";var Ua;function Qn(){return Ua||(Ua=vb(null))}var Q=()=>{let o=Qn();return Ib(o)};import{useContext as Rb}from"react";var au=()=>{let o=Qn(),{state:e}=Rb(o);return e};import*as Jn from"react";import{useEffect as xb,useLayoutEffect as Db,useState as Ru}from"react";var lu="_1eexc2a6";var su=ue({defaultClassName:"_12zfob12c _16lm1iw1z _16lm1iw22 _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw33",variantClassNames:{filtered:{false:"_12zfob12d",true:"_12zfob12e"},verticalAlign:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"},align:{start:"_12zfob12i",end:"_12zfob12j",center:"_12zfob12k"}},defaultVariants:{},compoundVariants:[]}),cu="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",uu=ue({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),du=ue({defaultClassName:"_12zfob1r",variantClassNames:{rowActive:{false:"_12zfob1s",true:"_12zfob1t"},cellSelected:{false:"_12zfob1u",true:"_12zfob1v"},rowSelected:{false:"_12zfob1w",true:"_12zfob1x",null:"_12zfob1y"},rowDisabled:{false:"_12zfob1z",true:"_12zfob110"},firstRow:{false:"_12zfob111",true:"_12zfob112"},treeNode:{parent:"_12zfob113",leaf:"_12zfob114",false:"_12zfob115"},firstRowInHorizontalLayoutPage:{false:"_12zfob116",true:"_12zfob117"},groupRow:{false:"_12zfob118",true:"_12zfob119"},groupCell:{false:"_12zfob11a",true:"_12zfob11b"},align:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},verticalAlign:{start:"_12zfob11f",end:"_12zfob11g",center:"_12zfob11h"},zebra:{false:"_12zfob11i",even:"_12zfob11j",odd:"_12zfob11k"},dragging:{true:"_12zfob11l",false:"_12zfob11m"},insideDisabledDraggingPage:{true:"_12zfob11n",false:"_12zfob11o"},first:{true:"_12zfob11p",false:"_12zfob11q"},last:{true:"_12zfob11r",false:"_12zfob11s"},groupByField:{true:"_12zfob11t",false:"_12zfob11u"},firstInCategory:{true:"_12zfob11v",false:"_12zfob11w"},lastInCategory:{true:"_12zfob11x",false:"_12zfob11y"},pinned:{start:"_12zfob11z",end:"_12zfob120",false:"_12zfob121"},filtered:{true:"_12zfob122",false:"_12zfob123"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob124"],[{pinned:"end",firstInCategory:!0},"_12zfob125"],[{pinned:!1,lastInCategory:!0},"_12zfob126"]]}),pu=ue({defaultClassName:"_12zfob1c _16lm1iw1s _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1d",end:"_12zfob1e",false:"_12zfob1f"},firstInCategory:{true:"_12zfob1g",false:"_12zfob1h"},lastInCategory:{true:"_12zfob1i",false:"_12zfob1j"},overflow:{true:"_12zfob1k",false:"_12zfob1l"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1m"],[{pinned:"start",firstInCategory:!0},"_12zfob1n"],[{overflow:!0,pinned:"end"},"_12zfob1o"],[{pinned:"end",lastInCategory:!0},"_12zfob1p"]]}),fu="_12zfob12u _16lm1iw22 _16lm1iw1z";var mu="_12zfob17",gu="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",hu=ue({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Ya=ue({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),bu="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",yu=ue({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Tu="_12zfob1b _16lm1iw2",Cu="_16lm1iw1",Su="_12zfob16",wu=ue({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),vu="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var dt="InfiniteIcon";var Iu="_6aunoi0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Pb={transition:"width 0.25s, opacity 0.25s"};function eo(o){let[e,t]=Ru(!0),[n,r]=Ru(0),{lineWidth:i=1,style:a,className:l,index:s}=o,c=s!=null&&s>0,u=o.size??16,d=Math.floor(u/4),p=[u-1*d,u-2*d,u-3*d],f={...Pb,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if(xb(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),Db(()=>{t(!0)},[]),!e)return null;let m={};return Jn.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:Z(l,dt,Iu,`${dt}-filter`)},c?Jn.createElement("div",{"data-name":"index",style:m,className:mu},s):null,Jn.createElement("div",{style:{width:p[0],...f}}),Jn.createElement("div",{style:{width:p[1],...f}}),Jn.createElement("div",{style:{width:p[2],...f}}))}var qa=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=[],c=[];t.forEach((w,v)=>{let R=w.maxSize??r??void 0,x=w.minSize??n??void 0;s.push(x),c.push(R),w.size!=null&&(R!=null&&w.size>R&&(w.size=R),x!=null&&w.size<x&&(w.size=x));let D=w.flex==0?null:w.flex;if(w.size==null&&D==null)throw`Items must specify either a size or a flex property. Item at index ${v} doesn't have either of those.`;D!=null&&(l+=1),a+=D??0,i+=w.size??0});let u=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,p={},f={},m=0;t.forEach((w,v)=>{if(w.flex!=null){let R=d*w.flex,x=w.maxSize??r??void 0,D=w.minSize??n??void 0,M=!1,A=0;x!=null&&R>x&&(p[v]=!0,M=!0,A=x),D!=null&&R<D&&(f[v]=!0,M=!0,A=D),M&&(m+=1,l-=1,a-=w.flex,u-=A)}}),m&&(d=u/a);let g=[],h=0,b=u,T=a,C=0,S=0,y=[];return{items:t.map((w,v)=>{let R={...w},x=w.maxSize??r??void 0,D=w.minSize??n??void 0,M=0,A=p[v],E=f[v],_=A||E,P=w.size??0;if(w.flex!=null){if(_)E&&(M=D),A&&(M=x);else{h+=1;let F=N=>(x!=null&&N>x&&(N=x),D!=null&&N<D&&(N=D),N);h===l?M=F(b):(M=F(Math.round(w.flex*d)),S+=M,b=u-S,T-=w.flex,d=b/T)}P=M,R.flexSize=M}return g.push(M),y.push(P),R.computedSize=P,C+=P,R}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:y,remainingSize:Math.round(e-C)}};function Br(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 Xa=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((x,D)=>(x[D]={...o.columnSizing[D]},x),{});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],c=l.id,u=s?.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,h=s?.computedMinWidth,b=s?.computedMaxWidth,T=s?.computedFlex?"flex":"width",C=!1,S=!1,y=r>0?1:-1,{value:I,clamped:w,diff:v}=Br(d+r,p,f,y);if(o.shareSpaceOnResize){if(s==null)return n[c]={...n[c],[m]:I},S=w==="min",C=w==="max",{adjustedDiff:I-d,reservedWidth:t,columnSizing:n,minReached:S,maxReached:C,constrained:S||C};let{value:x,clamped:D,diff:M}=Br(g-r,h,b,y);if(w&&D&&(Math.abs(v)>Math.abs(M)?D=!1:w=!1),!(!w&&!D)){if(w){let A=Br(g-r-v,h,b,y);x=A.value,D=A.clamped,M=A.diff}else if(D){let A=Br(d+r+M,p,f,y);I=A.value,w=A.clamped,v=A.diff}}n[c]={...n[c],[m]:I},n[u]={...n[u],[T]:x},S=w==="min"||D==="min",C=w==="max"||D==="max"}else n[c]={...n[c],[m]:I},S=w==="min",C=w==="max";let R=I-d;return{adjustedDiff:R,reservedWidth:o.shareSpaceOnResize?t:t-R,columnSizing:n,minReached:S,maxReached:C,constrained:S||C}};function xu(o,e){return o+e}function Eb(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var Du=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((b,T)=>(b[T]={...o.columnSizing[T]},b),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((b,T)=>o.dragHandlePositionAfter-T).reverse(),a=i.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),s=a.map(b=>b.computedFlex?"flex":"width"),c=0,{computedSizes:u}=qa({items:a.map(b=>(b.resizable===!1&&(c+=b.computedWidth),{maxSize:b.computedMaxWidth,minSize:b.computedMinWidth,flex:b.resizable?b.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(xu,0)+r-c,0)}),d=a.map((b,T)=>u[T]-b.computedWidth),p=!0,f=!0,m=!0,g=[];d.forEach((b,T)=>{let C=a[T];if(!C.resizable){g.push(0);return}let S=s[T],y=l[T],I=Eb(n),{maxReached:w,minReached:v,constrained:R,adjustedDiff:x}=Xa({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:i[T],shareSpaceOnResize:!1,items:o.items,columnSizing:I});n[C.id]={...I[C.id],[S]:y+x},g.push(x),w||(f=!1),v||(p=!1),R||(m=!1)});let h=g.reduce(xu,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:g,adjustedDiff:h,columnSizing:n,reservedWidth:t-h}};var Wr;function an(){if(Wr!=null)return Wr;let o=we().document??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),Wr=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Wr}var Pu=["start",void 0,"end"],Eu=(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:Pu.indexOf(r)-Pu.indexOf(i)}),o);function Mu(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 Za(o,...e){return Mu(t=>t!=null,o,...e)}function Au(o,e,...t){return Mu((n,r)=>!(r in o),e,...t)}var jr=Object.freeze({}),Mb={string:jr,number:{}};function Qa(o,e){let t=e.default||jr;return o.type===void 0?t:o.type===null?jr:typeof o.type=="string"?e[o.type]||Mb[o.type]||jr:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var $r=!0,Ab=!0,_b=!0,Fb="string",to="unknown",Ob=Qt("getComputedVisibleColumns"),Nb=(o,e,t)=>o[t]!==!1,Ja=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1},_u=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:c,pinnedEndMaxWidth:u,filterValue:d,sortable:p,sortInfo:f,multiSort:m,filterTypes:g=xn,viewportReservedWidth:h,resizableColumns:b,draggableColumns:T,columnDefaultDraggable:C,columnOrder:S,columnPinning:y,editable:I,columnDefaultEditable:w,columnDefaultFilterable:v,columnDefaultGroupable:R,columnDefaultSortable:x,columnSizing:D,columnTypes:M,columnVisibility:A,columnVisibilityAssumeVisible:E,groupBy:_})=>{let P=0,F={};_.forEach((z,X)=>{z.field&&(F[z.field]=X)});let N=(d||[]).reduce((z,X)=>{let{id:ye,field:Se}=X;return Se&&(z[Se]=X),ye&&(z[ye]=X),z},{}),G=Eu(S===!0?Object.keys(o):S,y),H=G.filter(z=>o[z]?Nb(A,E,z):(Ob(`Column with id "${z}" specified in columnOrder array cannot be found in the columns map.`),!1)),B=new Map,pe=H.map((z,X)=>{let ye=o[z];return B.set(z,X),ye}),de=(f??[]).reduce((z,X,ye)=>(X.id?z[X.id]={sortInfo:X,index:ye}:X.field&&(z[X.field]={sortInfo:X,index:ye}),z),{});function k(z){let X=o[z],ye=Qa(X,M),Se={minWidth:ye?.minWidth,maxWidth:ye?.maxWidth,width:ye?.defaultWidth,flex:ye?.defaultFlex},$e=Za({width:X?.defaultWidth,flex:X?.defaultFlex,minWidth:X?.minWidth,maxWidth:X?.maxWidth},D[z]);$e.width!=null&&delete Se.flex,$e.flex!=null&&delete Se.width,$e=Za(Se,$e);let L=$e.flex??void 0,He=$e.minWidth??X?.minWidth??t,Et=$e.maxWidth??X?.maxWidth??n,ct=L!=null?void 0:$e.width??(i?void 0:r);return!ct&&L==null&&(i?L=i:ct=He),{size:ct,flex:L,minSize:He,maxSize:Et}}let W=qa({availableSize:Math.max(e.width-(h??0)-(a??an()),0),maxSize:n,minSize:t,items:H.map(k)}),{computedSizes:se,flexSizes:ce,minSizes:ie,maxSizes:oe}=W,te=[],fe=[],ne=[],V=[];V.length=H.length;let U=new Map,O=new Map,re=0,j=0,K=0,ee=null,Y=[],le=0,me=0,Ve=0;pe.forEach((z,X)=>{let ye=H[X],Se=se[X],$e=Y[X]=Ja(ye,y);$e==="start"?le+=Se:$e==="end"?Ve+=Se:me+=Se});let Ee=e.width-Ve,Ge=[],Ue=new Map;H.forEach((z,X)=>{let ye=pe[X];Ue.set(z,ye)});let Le=[];Object.keys(o).forEach(z=>{let X=o[z];Le.push(z),Ue.has(z)||Ue.set(z,X)});let Ye=new Map;Ue.forEach((z,X)=>{let ye=B.get(X);ye==null&&(ye=-1);let Se=ye!=-1,$e=H[ye+1],L=Qa(z,M),He=ye,Et=de[X]?de[X]:z.field?de[z.field]??null:null,ct=Et?.sortInfo??null,yt=!!ct,Mt=yt&&ct.dir===1,na=yt&&!Mt,oa=Et?.index??-1,Ro=Se?{}:k(X),fr=Se?se[ye]:Ro.size||0,Pe=Se&&ce[ye]||null,Ze=Se?ie[ye]||0:Ro.minSize||0,kt=Se?oe[ye]||1e4:Ro.maxSize||1e4,Fe=Se?Ja(X,y):!1,Bn=Se?ye===H.length-1:!1,mr=He,Hg=Se?Fe==="start"?j:Fe==="end"?K:P-j:0;Fe=="start"?mr=Se?He:-1:Fe==="end"?mr=Se?He-(te.length+ne.length):-1:mr=Se?He-te.length:-1;let Kg=Se?Fe==="start"||Fe===!1?P:Ee+K:-1,Bg=Se?Fe!==ee:!1,Wg=Se?Bn||Fe!==Ja($e,y):!1,xs=z.cssEllipsis??L.cssEllipsis??l,jg=z.headerCssEllipsis??L.cssEllipsis??z.cssEllipsis??L.headerCssEllipsis??s??xs,gr=Se&&(N[X]||z.field||z.groupByForColumn)&&(N[X]||N[z.field||z.groupByForColumn])||null,$g=z.defaultFilterable??L.defaultFilterable??v??!0,Ug=I??z.defaultEditable??L.defaultEditable??w??!1,ra=z.dataType||L.dataType||(Array.isArray(z.type)?z.type[0]:z.type)||Fb,Yg=z.sortType||L.sortType||ra,Ds=z.filterType||L.filterType||ra,Ps=!1;if(gr!=null&&!gr.disabled){let aa=g[Ds];aa&&(!aa.emptyValues||!aa.emptyValues.includes(gr.filter.value))&&(Ps=!0)}let Wn=z.field??L.field,Es=z.valueGetter??L.valueGetter,Ms=z.defaultGroupable??L.defaultGroupable??R??!!Wn;z.groupByForColumn&&(Ms=!1);let ia=z.defaultSortable??L.defaultSortable;ia==null&&!z.groupByForColumn&&Wn==null&&Es==null&&(ia=!1);let As=Wn?F[Wn]!==void 0:!1,qg=As?F[Wn]:void 0,Xg=p??ia??x??$r,Zg=z.resizable??L.resizable??b??Ab,Ke={colType:L,align:L.align,headerAlign:L.headerAlign,computedVisible:Se,verticalAlign:L.verticalAlign,defaultHiddenWhenGroupedBy:L.defaultHiddenWhenGroupedBy,valueGetter:Es,valueFormatter:L.valueFormatter,renderValue:L.renderValue,render:L.render,style:L.style,contentFocusable:L.contentFocusable,renderMenuIcon:L.renderMenuIcon,renderSortIcon:L.renderSortIcon,renderRowDetailIcon:L.renderRowDetailIcon,renderSelectionCheckBox:L.renderSelectionCheckBox,renderHeaderSelectionCheckBox:L.renderHeaderSelectionCheckBox,headerStyle:L.headerStyle,headerClassName:L.headerClassName,columnGroup:L.columnGroup,getValueToEdit:L.getValueToEdit,getValueToPersist:L.getValueToPersist,shouldAcceptEdit:L.shouldAcceptEdit,field:Wn,...z,components:{...L.components,...z.components},computedResizable:Zg,computedMinWidth:Ze,computedMaxWidth:kt,computedFlex:Pe,computedDataType:ra,computedEditable:Ug,computedSortType:Yg,computedFilterType:Ds,cssEllipsis:xs,headerCssEllipsis:jg,computedFilterValue:gr,computedFiltered:Ps,computedFilterable:$g,computedGroupable:Ms,computedGroupedBy:As,computedGroupedByIndex:qg,computedWidth:fr,computedAbsoluteOffset:Kg,computedPinningOffset:Hg,computedVisibleIndexInCategory:mr,computedOffset:P,computedSortable:Xg,computedSortInfo:ct,computedSortIndex:oa,computedMultiSort:m,computedSorted:yt,computedSortedAsc:Mt,computedSortedDesc:na,computedVisibleIndex:He,computedPinned:Fe,computedDraggable:T??z.defaultDraggable??C??_b,computedFirstInCategory:Bg,computedLastInCategory:Wg,computedFirst:ye===0,computedLast:Bn,id:X,header:z.header??L.header??z.name??z.field};Se&&(P+=fr,U.set(Ke.id,Ke),V[ye]=Ke,Fe==="start"&&(te.push(Ke),j+=Ke.computedWidth),Fe==="end"&&(fe.push(Ke),K+=Ke.computedWidth),Fe||(ne.push(Ke),re+=Ke.computedWidth),ee=Fe),Ke.groupByForColumn&&(Ke.computedSortType=z.sortType||L.sortType||to,Ge.push(Ke)),O.set(Ke.id,Ke),Ke.field&&!Ke.groupByForColumn&&!Ye.has(Ke.field)&&Ye.set(Ke.field,Ke)}),Ge.forEach(z=>{z.computedSortable=Fu(z,{fieldsToColumn:Ye,sortable:p,columnDefaultSortable:x})});let We=new Map;Le.forEach(z=>{let X=O.get(z);X&&We.set(z,X)}),O.forEach(z=>{We.has(z.id)||We.set(z.id,z)});let bt=c!=null?Math.min(c,j):j,yn=u!=null?Math.min(u,K):K;return{computedRemainingSpace:e.width-(le+Ve+me),computedPinnedStartColumnsWidth:j,computedPinnedEndColumnsWidth:K,computedUnpinnedColumnsWidth:re,computedColumnOrder:G,computedPinnedStartColumns:te,computedPinnedEndColumns:fe,computedUnpinnedOffset:j,computedPinnedEndOffset:j+re,computedUnpinnedColumns:ne,computedVisibleColumns:V,computedColumnsMap:O,computedColumnsMapInInitialOrder:We,computedVisibleColumnsMap:U,computedPinnedEndWidth:yn,computedPinnedStartWidth:bt,renderSelectionCheckBox:V.reduce((z,X)=>z||!!X.renderSelectionCheckBox,!1),fieldsToColumn:Ye}};function Fu(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r}=e;if(t)return t;let i=o.defaultSortable??o.colType.defaultSortable;if(i!=null)return i;let a=r??$r;return o.computedSortType!==to&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((p,f)=>{if(!p)return!1;let m=f.field||f.groupField,g;if(m){let h=n.get(m),b=h?u.getColumnApi(h.id):void 0;h&&b?g=b.isSortable():g=!1}return g===void 0&&f.valueGetter&&(g=!0),g??r??$r},!0)}}function et(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){return l.getCellValuesByPrimaryKey(s)?.value??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)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)}};return l}function Dn(o,e,t){let n=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=u,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let h=et(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:h,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:d,someRowsSelected:p,selectionMode:f,api:r,renderBag:{header:g}})??null}return g}import*as Ou from"react";var Ur=`${Je}HeaderCell__filter`,el=`${Je}HeaderCell__filterOperator`,tl=Ou.createContext(null);var kb=`${Ur}__input`,Yr=o=>o.stopPropagation();function Lu(o){let{filterOperatorMenuVisibleForColumnId:e}=au(),{column:t}=qr(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=Nu(!1),l=qe.useCallback(()=>{a(!0)},[]),s=qe.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return qe.createElement("div",{onPointerUp:Yr,onPointerDown:Yr,onFocus:l,onBlur:s,className:`${Ur} ${Ya({active:c})}`,style:{height:o.columnHeaderHeight}},qe.createElement(tl.Provider,{value:o},qe.createElement(r,null),qe.createElement(n,null)))}function ku(){let{columnApi:o,disabled:e,operator:t}=Ho(),n=t?.components?.Icon??eo;return qe.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:Z(el,gu,e?`${el}--disabled`:"")},qe.createElement(n,{size:20,className:`${hu({disabled:e})}`}))}function zu(){return qe.createElement("div",{onPointerUp:Yr,onPointerDown:Yr,className:`${Ur} ${Ya({active:!1})} ${Gc["50%"]}`})}function Ho(){let o=Q(),{column:e,columnApi:t}=qr(),n=Dn(e,o,"column-filter"),r=qe.useContext(tl),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=Nu(l?.filter.value??""),d=qe.useCallback(h=>{u(h),r.onChange(h)},[r.onChange]),p=qe.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=qe.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);Lb(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let h=[...s.emptyValues][0];h!==c&&u(h)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:c,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${fu} ${kb}`}}function no(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Ho();return nl.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function Xr(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Ho();return nl.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 zb(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:no},operators:[{name:"includes",components:{Icon:Qc},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:Ga},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:iu},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Jc},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Xr},operators:[{label:"Equals",components:{Icon:Ga},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:ru},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:tu},fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>t},{name:"gte",components:{Icon:eu},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>=t},{name:"lt",components:{Icon:ou},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<t},{name:"lte",components:{Icon:nu},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<=t}]}}}var xn=zb();function Zr(o,e,t,n){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:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=t(i);return r.push(a),o.computedFirst&&r.push(...e.map(l=>`${l}--first`)),o.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),o.computedLast&&r.push(...e.map(l=>`${l}--last`)),o.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),n.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),n.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),n.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),n.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?r.push(...e.map(l=>`${l}--pinned-${o.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as md,useState as gd}from"react";var Vu="_16lm1iw1",Gu="_16lm1iw1 _16lm1iw1c _16lm1iwe",Hu="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Ku="_1yeub2vt",Bu="_1yeub2vs",Wu=ue({defaultClassName:"_1yeub2v3",variantClassNames:{horizontalLayout:{true:"_1yeub2v4",false:"_1yeub2v5"},focused:{true:"_1yeub2v6",false:"_1yeub2v7"},focusedWithin:{true:"_1yeub2v8",false:"_1yeub2v9"},hasPinnedStart:{true:"_1yeub2va",false:"_1yeub2vb"},hasPinnedEnd:{true:"_1yeub2vc",false:"_1yeub2vd"},hasPinnedStartOverflow:{true:"_1yeub2ve",false:"_1yeub2vf"},hasPinnedEndOverflow:{true:"_1yeub2vg",false:"_1yeub2vh"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vi"]]});var ol="_1yeub2vq";var a1=ue({defaultClassName:"_1yeub2vm",variantClassNames:{pinned:{start:"_1yeub2vn",end:"_1yeub2vo",false:"_1yeub2vp"}},defaultVariants:{},compoundVariants:[]});var rl=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};var Ko={bodyWidth:{name:q(ae.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:q(ae.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:q(ae.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:q(ae.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:q(ae.runtime.browserScrollbarWidth),value:""}},Vb=q($.scrollbarWidthHorizontal),ju=q($.scrollbarWidthVertical),Gb=q($.columnWidthAtIndex),Hb=q($.columnZIndexAtIndex),$u=q($.scrollLeft),Kb=q($.activeCellColWidth),Uu=q($.activeCellColOffset),Zu=q($.baseZIndexForCells),Bb=q($.pinnedStartWidth),Yu=q($.bodyWidth),Wb=q($.bodyHeight),qu=q($.pinnedEndOffset),Xu=q($.pinnedEndWidth),jb=q($.computedVisibleColumnsCount);function il(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(${Zu}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Qu(o){let e=an(),{computed:t,state:n,actions:r,getState:i}=Q(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:c,onBlurWithin:u,onFocusWithin:d,onSelfFocus:p,onSelfBlur:f,bodySize:m,activeCellIndex:g,wrapRowsHorizontally:h}=n,{computedPinnedStartColumnsWidth:b,computedPinnedEndColumnsWidth:T,computedPinnedStartColumns:C,computedPinnedEndColumns:S,computedVisibleColumns:y,computedUnpinnedColumnsWidth:I,scrollbars:w}=t,v=[],R=y.reduce((P,F)=>{let N=F.computedVisibleIndex;P[Te.columnWidths.varName.get(N)]=F.computedWidth+"px",P[Te.columnOffsets.varName.get(N)]=F.computedPinned==="start"?`calc( ${F.computedOffset}px + var(${$u}) )`:F.computedPinned==="end"?`calc( var(${qu}) ${v.length?"+":""} ${v.map(H=>Te.columnWidths.get(H.computedVisibleIndex)).join(" + ")} + var(${$u}) )`:`${F.computedOffset}px`;let G=il(F,{pinnedStartColsCount:C.length,visibleColsCount:y.length});return P[`${Hb}-${N}`]=`${G}`,F.computedPinned==="end"&&v.push(F),P},{});if(m.width&&(R[Ko.browserScrollbarWidth.name]=`${an()}px`),R[Ko.bodyWidth.name]=`calc(${$.bodyWidth} - ${$.scrollbarWidthVertical})`,R[Ko.totalVisibleColumnsWidthValue.name]=`${b+T+I}px`,R[Ko.totalVisibleColumnsWidthVar.name]=`calc(${y.map((P,F)=>`var(${Gb}-${F})`).join(" + ")})`,R[Ko.visibleColumnsCount.name]=y.length,g!=null){R[Kb]=Te.columnWidths.get(g[1]);let P=Te.columnOffsets.get(g[1]);if(n.brain.isHorizontalLayoutBrain){let F=n.brain.getPageIndexForRow(g[0]);R[Uu]=F?`calc( ${ae.runtime.totalVisibleColumnsWidthVar} * ${F} + ${P})`:P}else R[Uu]=P}R[jb]=y.length,R[Vb]=w.horizontal?`${e}px`:"0px",R[ju]=w.vertical?`${e}px`:"0px",R[Bb]="calc( "+C.map(P=>Te.columnWidths.get(P.computedVisibleIndex)).join(" + ")+")",R[Xu]="calc( "+S.map(P=>Te.columnWidths.get(P.computedVisibleIndex)).join(" + ")+")",R[Zu]=y.length*10,R[qu]=`calc( var(${Yu}) - var(${Xu}) - var(${ju}) )`,R[Yu]=`${m.width}px`,R[Wb]=`${m.height}px`;let x=rl(P=>{r.focused=P}),D=rl(P=>{r.focusedWithin=P}),E={...o,onFocus:P=>{if(o?.onFocus?.(P),P.target===s.current||P.target===c.current){if(i().focused)return;x(!0),p?.(P),l&&(D(!1),u?.(P));return}l||(D(!0),d?.(P))},onBlur:P=>{if(o?.onBlur?.(P),P.target===s.current||P.target===c.current){if(!i().focused)return;x(!1),f?.(P),l&&(D(!1),u?.(P));return}s.current?.contains(P.relatedTarget)||(D(!1),u?.(P))}},_=Z(Gt,Hu,h?`${Gt}--horizontal-layout`:null,E?.className,b?`${Gt}--has-pinned-start ${Bu}`:null,T?`${Gt}--has-pinned-end ${Ku}`:null,a?`${Gt}--focused`:null,l?`${Gt}--focused-within`:null,a&&n.focusedClassName?n.focusedClassName:null,l&&n.focusedWithinClassName?n.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${Gt}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${Gt}--has-pinned-end-overflow`:null,Wu({horizontalLayout:!!h,hasPinnedStart:!!b,hasPinnedEnd:!!T,focused:a,focusedWithin:l}));return E.className=_,E.style={...o?.style,...R},a&&n.focusedStyle&&Object.assign(E.style,n.focusedStyle),l&&n.focusedWithinStyle&&Object.assign(E.style,n.focusedWithinStyle),E}var ad=jn(Cn());function Qr(o){return o.map(e=>e instanceof ln?e:new ln(null,[e]))}var ln=class o{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new o("+",[this,...e])}subtract(...e){return new o("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new o("*",[this,...e])}divide(...e){return new o("/",[this,...e])}__get(e){let{__operation:t,__operands:n}=this,r=n.map(a=>$b(a,this)).join(` ${t} `);return(n.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function $b(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var Ub=(...o)=>new ln("+",Qr(o)),Ju=(...o)=>new ln("-",Qr(o)),Yb=(...o)=>new ln("*",Qr(o)),qb=(...o)=>new ln("/",Qr(o)),Bo={add:Ub,subtract:Ju,minus:Ju,multiply:Yb,divide:qb};var Pn=(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 ed=o=>{let e=null,t=null;return{stop(){e!==null&&vt(e),t!=null&&vt(t)},scroll(n){e!==null&&vt(e),t!=null&&vt(t);let r={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 u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=Ae(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=Ae(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var Ne=class o{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new o(e)}static from(e){return new o(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 td(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function nd(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function Xb(o,e,t){let n=td(o,t),r=td(e,t);return n===r?nd(t,e)-nd(t,o):n-r}function od(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)=>Xb(n,r,t)),e}function Zb(o){if(o.length<2)return!1;let e=o[0].left,t=o[0].top,n={left:!1,top:!1};for(let r=1,i=o.length;r<i;r++){if(n.left&&n.top)return!1;o[r].left!==e&&(n.left=!0),o[r].top!==t&&(n.top=!0)}return!(n.left&&n.top)}function Qb(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=od(o);let t=o[0],n=o[o.length-1];return t.left===n.left?e.left===t.left&&e.top>=Math.min(t.top,n.top)&&e.top<=Math.max(t.top,n.top):e.top===t.top&&e.left>=Math.min(t.left,n.left)&&e.left<=Math.max(t.left,n.left)}function rd(o,e){if(Zb(o))return Qb(o,e);o=od(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(Jb([t,i,a],e))return!0}return!1}function Jb(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 oo=class{containsPoint(e){return rd(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 ro=class o extends oo{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(Ne.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function ey(o,e){let t=Math.min(o.left,e.left),n=Math.min(o.top,e.top),r=o.left+o.width,i=e.left+e.width,a=Math.max(r,i),l=o.top+o.height,s=e.top+e.height,c=Math.max(l,s);return new Ce({top:n,left:t,width:a-t,height:c-n})}var Ce=class o extends oo{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 o(t)}static clone(t){return new o(t)}static from(t){return o.clone(t)}static fromPoint(t){return o.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let n=this;for(let r of t)n=ey(n,r);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new ro(this.getPoints()).containsPoint(t)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Ne.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var id=10,ty=q($.pinnedStartWidth);function ld(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:h,horizontalLayoutPageIndex:b,pageWidth:T}=o;function C(V){let U=V==="start"?N:G;return _===F?U:F===V?U+A.computedWidth:_===V?U-A.computedWidth:U}function S(V){if(V.columnIndex===E||b!=null)return!0;let U=e[V.columnIndex];if(U.computedPinned)return!0;let O=l.getScrollPosition().scrollLeft,re=U.computedOffset+(b!=null&&T!=null?T*b:0);return re>=O+C("start")&&re+U.computedWidth<=O+u.width-C("end")}let y=(V,U)=>{let{restrictToParentGroup:O,dragColumn:re}=U,j=[];if(V.forEach(ee=>{if(ee.computedVisibleIndex===E)return;let Y={columnId:ee.id,columnIndex:ee.computedVisibleIndex,offsetX:ee.computedOffset+Math.round(ee.computedWidth/2)};S(Y)&&j.push(Y)}),O){let Y=function(me,Ve,Ee){let Ge=V[me];Ge&&(Ge.columnGroup!==re.columnGroup&&Ee.add(Ge.id),Y(me+Ve,Ve,Ee))};var K=Y;let ee=re.computedVisibleIndex,le=new Set;Y(ee-1,-1,le),Y(ee+1,1,le),j=j.filter(me=>!le.has(me.columnId))}return j},w=r.length,v={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},R={left:v.clientX-u.left-(v.clientX-s.left)+id,top:v.clientY-u.top-(v.clientY-s.top)+id},x=l.getScrollPosition(),D=e.map(V=>V.computedVisibleIndex),M=D,A=t.get(i),E=A.computedVisibleIndex,_=A?.computedPinned,P=E,F=_,N=l.getFixedStartColsWidth(),G=l.getFixedEndColsWidth(),H=v,B={x:0,y:0},pe=1,de=0;function k(V){let U=Math.round(V.clientX),O=Math.round(V.clientY);if(U===H.clientX&&O===H.clientY)return Ce.from(s).shift({left:B.x,top:B.y});H={clientX:U,clientY:O};let j=l.getScrollPosition().scrollLeft-x.scrollLeft;return B.x=H.clientX-v.clientX,B.y=H.clientY-v.clientY,de=B.x+j,pe=de<0?-1:1,f({left:R.left+B.x,top:R.top+B.y}),Ce.from(s).shift({left:B.x,top:B.y})}function W(V){let U=0;_?_==="start"&&V.forEach((O,re)=>{U||e[O]?.computedPinned!=="start"&&(U=re)}):V.forEach((O,re)=>{e[O]?.computedPinned==="start"&&(U=re+1)}),w=U,se("start",V,U)}function se(V,U,O){if(V==="start"){let re=0;for(let j=0;j<O;j++){let K=U[j],ee=e[K];re+=ee.computedWidth}At(ty,`${re}px`,a)}}function ce(V){if(V==null||V===P)return;if(P===-1&&V!==-1&&(Fo(E,"",a),m(!1)),P=V,V===-1){ie(E);return}let U=Pn(D,E,P>E?P-1:P);w=0;let re=new Set;return U.forEach((j,K)=>{let ee=M[K];j!==ee&&re.add(j),W(U)}),M=U,oe(re),{newColumnIndexes:U,indexesWithTransition:re,pinnedStartCount:w}}function ie(V){M=M.filter(O=>O!==V),e.forEach(O=>{let re=O.computedVisibleIndex,j=re>V;wa(re,a);let K="";j&&(K=Bo.minus(Te.columnOffsets.get(re),Te.columnWidths.get(V)).done()),Un(re,K,a)}),Fo(V,"hidden",a),m(!0)}function oe(V){e.forEach(U=>{let O=U.computedVisibleIndex;V.has(O)?wa(O,a):vr(O,a);let re=O===E,j=pe===-1?O<P||O>E:O<E||O>=P,K="";pe===-1?K=re?Te.columnOffsets.get(P):j?Te.columnOffsets.get(O):Bo.add(Te.columnOffsets.get(O),Te.columnWidths.get(E)).done():K=j?Te.columnOffsets.get(O):re?Bo.add(Te.columnOffsets.get(P-1),Te.columnWidths.get(P-1)).minus(Te.columnWidths.get(E)).done():Bo.minus(Te.columnOffsets.get(O),Te.columnWidths.get(E)).done(),Un(O,K,a)})}let te=u.left+C("start"),fe=u.right-C("end"),ne=ed({scrollOffsetStart:te,scrollOffsetEnd:fe});return k(v),{speedScroller:ne,stop(){ne.stop()},onMove(V){let U=k(V);if(g().dropTargetListId==="grouping-toolbar"||p&&!d.containsPoint(U.getCenter()))return p&&ce(-1),null;ne.scroll({mousePosition:H,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(Y){h.scrollLeft=Y}});let O=y(e,{dragColumn:A,restrictToParentGroup:c==="group"}),re=pe===-1?A.computedOffset+de:A.computedOffset+A.computedWidth+de,j=(0,ad.default)(O,re,({offsetX:Y},le)=>Y<le?-1:Y>le?1:0);j<0&&(j=~j),O.length?j=O[j]?O[j].columnIndex:O[O.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),j=0),j===E+1&&(j=E),ce(j);let K={};n.forEach(Y=>{K[Y.id]="end"});for(let Y=0;Y<w;Y++){let le=M[Y],me=e[le];K[me.id]="start"}let ee=M.map(Y=>e[Y].id);return{columnPinning:K,columnOrder:ee}}}}function Tt(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 al(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],c=n.indexOf(s),u=n.indexOf(r);return Pn(n,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=n.indexOf(s),u=n.indexOf(r);return Pn(n,u,c)}return e}import*as it from"react";var En=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let n=((...r)=>{this.off(e,n),t(...r)});return this.on(e,n)}off(e,t){let n=this.listeners[e];if(!n)return;let r=n.indexOf(t);r!==-1&&n.splice(r,1)}emit(e,...t){let n=this.listeners[e];n&&n.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var sd=jn(Cn());var cd=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=n,p=c===a,f=Ne.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),h=e.breakpoints,b=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),T=(0,sd.default)(h,b,(w,v)=>w-v);T<0&&(T=~T),m===1&&T===u+1&&p&&T--;let C=Math.min(u,T),S=Math.max(u,T),y=p?i.map((w,v)=>{if(v===u&&p)return t;if(v<C||v>=S)return{left:0,top:0};let R=T<=v?1:-1;return r==="horizontal"?{left:Math.round(R*g.width),top:0}:{left:0,top:Math.round(R*g.height)}}):i.map((w,v)=>{let R=T<=v?1:0;return r==="horizontal"?{left:Math.round(R*g.width),top:0}:{left:0,top:Math.round(R*g.height)}}),I={offset:t,dropIndex:T,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:y,dragRect:g,status:"accepted"};return e.acceptsDrop(I)?{event:I,error:null,success:!0}:(I.status="rejected",{event:I,error:"rejected by interaction target",success:!1})},ud=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=n,d=Ne.from(s.getCenter()),p=u===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?n.dragIndex:-1,g=s.toDOMRect(),h={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!f,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:p?l.map((b,T)=>b.id===c.id?t:f?{left:0,top:0}:T>m?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(b=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(h)?{event:h,error:null,success:!0}:(h.status="rejected",{event:h,error:"rejected by interaction target",success:!1})};var Re=class Re{static startDrag(e,t){let n=e instanceof io?e:new io(e),r=new ll({activeDragSource:n,startPoint:t});return r.on("start",Re.onDragStart),r.on("move",Re.onDragMove),r.on("drop",Re.onDragDrop),r.start(),r}static emit(e,...t){Re.emitter.emit(e,...t)}static on(e,t){return Re.emitter.on(e,t)}static registerDragInteractionTarget(e){if(Re.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return Re.dragInteractionTargetsMap.set(e.listId,e),Re.emit("register",e),()=>{Re.unregisterDragInteractionTarget(e)}}static unregisterAll(){Re.dragInteractionTargetsMap.forEach(e=>{Re.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!Re.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}Re.dragInteractionTargetsMap.delete(e.listId),e.unregister(),Re.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=Re.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;Re.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),Re.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:n})}static withDragMove(e,t){let{activeDragSource:n}=e,{listId:r}=n,i=[],a=!0,l=Re.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(Re.dragInteractionTargetsMap.get(r))),Re.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=cd(e,s);if(c){t(s,c),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let c=ud(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];Re.withDragMove(e,(c,{event:u})=>{c.move(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null,s=l?.dropTargetListId??null;Re.emit("drag-move",{dragSourceListId:n,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];Re.withDragMove(e,(s,{event:c})=>{s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;Re.emit("drag-drop",{dragSourceListId:n,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),Re.unregisterAll()}};Re.dragInteractionTargetsMap=new Map,Re.emitter=new En;var pt=Re,io=class o{static clone(e){let t=e.getData();return new o(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){Tt(this.data,e)||(this.data=e,this.dragRectangle=new Ce(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=Ce.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},ll=class extends En{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=io.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:n}=this.activeDragSource,r={dragSourceListId:t,dragItemId:n.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let n={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=io.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=pt;import{useEffect as ny}from"react";var dd=it.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),Mn=()=>it.useContext(dd),sl=o=>{let[e,t]=it.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=it.useRef(e);n.current=e;let r=it.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=it.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return ny(()=>{let a=pt.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),l=pt.on("drag-move",c=>{let u=n.current,d={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(u)!==JSON.stringify(d)&&t(d)}),s=pt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[pt,t]),it.createElement(dd.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var cl=`${Je}Body`,pd=o=>o.querySelector(`.${cl}`);var An=`${Je}HeaderCell`,ul=`${Je}HeaderWrapper`,fd=o=>Array.from(o.querySelectorAll(`.${ul}`));var oy=q($.baseZIndexForCells),ry=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:Tt(o,e)},hd=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=gd(null),[a,l]=gd(!1),{getCurrentDragSourceAndTarget:s}=Mn(),{actions:c,computed:u,getComputed:d,getState:p,api:f,state:{domRef:m}}=Q(),g=md(b=>{let T=d().computedVisibleColumnsMap.get(o);if(!T||!T.computedSortable)return;let{multiSortBehavior:C}=p();f.toggleSortingForColumn(o,{multiSortBehavior:C==="replace"&&(b.ctrlKey||b.metaKey)?"append":C})},[]),h=md(b=>{let T=b.target?.tagName;if(T==="INPUT"||T==="BUTTON")return;let{brain:C,draggableColumnsRestrictTo:S}=p(),{computedVisibleColumns:y,computedVisibleColumnsMap:I,computedPinnedStartColumns:w,computedUnpinnedColumns:v,computedPinnedEndColumns:R}=d(),x=I.get(o);if(!x.computedDraggable){g(b);return}let D=e.current,M=D.getBoundingClientRect(),A=m.current.getBoundingClientRect(),E=C.getAvailableSize(),_=x.computedVisibleIndex,P=C.getVirtualColIndex(x.computedVisibleIndex,{pageIndex:t||0}),F=C.isHorizontalLayoutBrain?C.getPageWidth():null,N=D.style.cursor??"auto",G=!1,H=m.current,B=Ce.from(pd(H).getBoundingClientRect()),pe=fd(H).map(fe=>Ce.from(fe.getBoundingClientRect())),de=B.getMinimumBoundingRectangle(...pe),k=ld({brain:C,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:F,draggableColumnsRestrictTo:S,computedPinnedEndColumns:R,computedPinnedStartColumns:w,computedUnpinnedColumns:v,computedVisibleColumns:y,computedVisibleColumnsMap:I,dragColumnHeaderTargetRect:M,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:f,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:A,acceptDropToReorderRect:de,initialMousePosition:{clientX:b.clientX,clientY:b.clientY}}),W=null,se,ce;function ie(fe){let{columnPinning:ne,columnOrder:V}=fe;ry(p().columnPinning,ne)||(c.columnPinning=ne);let U=d().computedColumnOrder;JSON.stringify(V,U)&&(y.forEach(O=>{Un(O.computedVisibleIndex,"",m.current)}),c.columnOrder=al({newColumnOrder:V,visibleColumnOrder:d().computedVisibleColumns.map(O=>O.id),existingColumnOrder:U,dragColumnId:o}))}let oe=fe=>{let{headerBrain:ne,brain:V}=p();if(!G){G=!0;let U=V.keepColumnRendered(P),O=ne.keepColumnRendered(P);if(V.isHorizontalLayoutBrain){let j=V.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),K=ne.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ce=()=>{j(),K()}}se=()=>{U(),O()},c.columnReorderDragColumnId=x.id,t!=null&&(c.columnReorderInPageIndex=t),Sa(_,`calc( var(${oy}) + 10000 )`,m.current),m.current?.classList.add(ol),D.style.cursor="grabbing"}W=k.onMove(fe)},te=fe=>{let{multiSortBehavior:ne}=p(),V=e.current;m.current?.classList.remove(ol),k.stop(),C.update({...E}),se?.(),ce?.(),y.forEach(O=>{vr(O.computedVisibleIndex,m.current),Un(O.computedVisibleIndex,"",m.current)}),Fo(_,"",m.current),Sa(_,il(x,{pinnedStartColsCount:w.length,visibleColsCount:y.length}),m.current),V.style.cursor=N,V.releasePointerCapture(fe.pointerId),V.removeEventListener("pointermove",oe),V.removeEventListener("pointerup",te),i(null);let U=f.getColumnApi(x.id)?.isSortable()??!1;!G&&U&&f.toggleSortingForColumn(x.id,{multiSortBehavior:ne==="replace"&&(fe.ctrlKey||fe.metaKey)?"append":ne}),W?ie(W):G&&n&&f.setVisibilityForColumn(x.id,!1),c.columnReorderDragColumnId=!1,t!=null&&(c.columnReorderInPageIndex=null)};D.addEventListener("pointermove",oe),D.addEventListener("pointerup",te),D.setPointerCapture(b.pointerId)},[o,t]);return{onPointerDown:u.computedVisibleColumnsMap.get(o)?.computedDraggable?h:g,dragColumnOutside:a,proxyPosition:r}};import*as lo from"react";import*as he from"react";import{useCallback as lt,useContext as yy,useMemo as Ty}from"react";import*as Fn from"react";var bd=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;import*as Wo from"react";import{useState as iy}from"react";var yd="_6rdmyg0 _16lm1iw1d _16lm1iwk _16lm1iw9",Td=ue({defaultClassName:"_6rdmyg1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_6rdmyg3"},direction:{end:"_6rdmyg4",start:"_6rdmyg5"},disabled:{true:"_6rdmyg6",false:"_6rdmyg7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var Jr=`${dt}-expand-collapse`;function _n(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=iy(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),on("expanded",o)||i(!r)};Wo.useEffect(()=>{on("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return Wo.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":n,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:n?void 0:a,className:Z(o.className,yd,Td({direction:t||"start",expanded:r,disabled:n}),`${dt}`,`${Jr}`,`${Jr}--${l}`,`${Jr}--${t==="end"?"end":"start"}`,n?`${Jr}--disabled`:"")},Wo.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}import*as ei from"react";var Cd="_16lm1iwb _16lm1iw1d _16lm1iwk";var Sd=o=>ei.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",display:"block",shapeRendering:"auto"},width:"24px",height:"24px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:Z(o.className,Cd,"InfiniteIcon","InfiniteIcon-loading")},ei.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},ei.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var wd=ue({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),vd="_7pupv00",Id=ue({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function Rd({rowInfo:o}){return{[q(ae.components.Row.groupNesting)]:o.dataSourceHasGrouping?o.isGroupRow?o.groupNesting-1:o.groupNesting:0}}function ti({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=n,d=Z(rn.flex,i.align==="end"?Rn.rowReverse:Rn.row,Gr.center,`${On}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||c)?wd({align:a}):null);if(e==="multi-column"){if(o+1!==u.groupNesting&&u.isGroupRow)return c?Fn.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return Fn.createElement("div",{className:d},s,c,Fn.createElement("div",{className:Ft},l??null))}}function ni({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===o&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&o+1!==u.groupNesting)return null;let p=u.groupKeys,f=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return bd(u)?f=Fn.createElement(Sd,null):m&&(f=Fn.createElement(_n,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=Fn.createElement(at,{render:n,renderParam:r})),f}}function xd(o,e,t){let{groupByForColumn:n,groupIndexForColumn:r,groupRenderStrategy:i}=o,a=n.column?{...n.column}:{},l={header:`Group by ${n.field||n.groupField}`,groupByForColumn:n,render:ti({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:ni({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(o,e)}:l={...l,...t}),l}function Dd(o,e,t){let n=typeof t=="function"?t(o,e):t,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:ti({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...n,renderGroupIcon:ni({initialRenderGroupIcon:n?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function Pd(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}import*as oi from"react";import{useEffect as ay,useRef as ly}from"react";var Ed="qz8ht90 _16lm1iwk";function sy(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:cy}=It({forwardProps:sy,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function uy(){let{componentState:o,componentActions:e}=je(),{checked:t,domProps:n,disabled:r}=o,i=ly(null);return ay(()=>{i.current.indeterminate=t==null},[t]),oi.createElement("input",{...n,className:Z("InfiniteCheckBox",Ed,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function Ht(o){return oi.createElement(cy,{...o},oi.createElement(uy,null))}function dy(o){return typeof o.field=="string"}function Md(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 ft(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),h=r===f&&m==="row",b=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:T,formattedValueContext:{rawValue:C}}=ao({column:p,rowInfo:c,rowDetailState:b,columnsMap:e().computedColumnsMap,context:o}),S=et(p.id,o);return u?{api:a,dataSourceApi:l,column:p,columnApi:S,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,rowDetailState:!1,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:T,rawValue:C}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:S,column:p,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:b,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:T,rawValue:C}:{api:a,dataSourceApi:l,columnApi:S,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:b,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:T,rawValue:C}:{api:a,dataSourceApi:l,columnApi:S,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,rowDetailState:b,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:T,rawValue:C}}function Ad(o){return Fd(o.column,o.rowInfo)}function _d(o){let{column:e,context:t,rowInfo:n,visibleColumnsIds:r}=o,i=Md({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=ao(o),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:u,rowHasSelectedCells:!1},c,{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({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:u,stylingParam:d,formattedValueContext:c,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:py({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnsIds:o.visibleColumnsIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:c}),groupByColumnReference:i}}function py(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=o,{value:u}=c,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=n,b=p(),{selectionMode:T,cellSelection:C}=b,S=Md({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),y=d.toggleGroupRow,I=C?.isCellSelected(n.id,e.id)??!1,w={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:I,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:S,selectionMode:T,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(n.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&m.treeApi.toggleNodeSelection(n.nodePath)},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 u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:h,toggleGroupRow:y,toggleCurrentGroupRow:()=>{n.isGroupRow&&y(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:b.groupBy,pivotBy:b.pivotBy};return Object.defineProperty(w,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),w}function Fd(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:dy(o)?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 fy(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}}function ao(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=Fd(e,t),a=fy(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}import*as Kt from"react";var{rootClassName:Od}=Me,Nn=`${Od}Cell`,dl=`${Od}Cell_content`,my=q($.columnWidthAtIndex),gy=q($.columnReorderEffectDurationAtIndex);function hy(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...h}=o,b=typeof m=="function"?m():m,T={width:`var(${my}-${i.computedVisibleIndex})`,transition:`transform var(${gy}-${i.computedVisibleIndex}, 0s)`,...h.style},C={...h,style:T,"data-column-id":i.id,"data-z-index":T.zIndex,className:Z(h.className,Nn,xc),children:Kt.createElement(Kt.Fragment,null,d,Kt.createElement("div",{className:Z(dl,e?Ft:Wc.hidden,s),style:r},b),u)};c!=null&&(C["data-row-id"]=`${c}`);let S=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return S?Kt.createElement(S,{...C,ref:a}):Kt.createElement("div",{...C,ref:a})}var ri=Kt.memo(hy);import*as Ln from"react";import{useCallback as Nd,useRef as by}from"react";function Ld(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=pl(),i=by(null),a=Ln.useCallback(s=>{i.current=s,s&&s.focus()},[]),l=Nd(s=>{let{key:c}=s;c==="Enter"||c==="Tab"?t():c==="Escape"?n():s.stopPropagation()},[]);return Ln.createElement(Ln.Fragment,null,Ln.createElement("input",{readOnly:r,ref:a,onKeyDown:l,onBlur:()=>t(),className:Z(Lc,Bc.none),type:"text",defaultValue:o,onChange:Nd(s=>{e(s.target.value)},[])}))}var{rootClassName:Cy}=Me,Sy=q($.columnZIndexAtIndex),wy=q($.columnVisibilityAtIndex);function vy({rowInfo:o}){return{[q(ae.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}var jo=he.createContext(null),On=`${Cy}ColumnCell`,Iy=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return he.createElement(_n,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},Ry={display:"inline-block",visibility:"visible"},fl=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return he.createElement(_n,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:Ry,expanded:n,onChange:t})},xy=o=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:n,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=o;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),c=l.getDataSourceState().isNodeSelectable,u=s?.CheckBox||Ht;return he.createElement(u,{domProps:{className:Lr},disabled:e.isTreeNode?!c(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():n()},checked:e.rowSelected})};function ml(o,e){return o?typeof o=="function"?o(e):o:void 0}function gl(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function Dy(o){let{rowInfo:e,rowStyle:t,rowClassName:n,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:i,getData:a,cellStyle:l,cellClassName:s,rowDetailState:c,width:u,column:d,onMouseLeave:p,onMouseEnter:f,onRowMouseEnter:m,onRowMouseLeave:g,rowIndex:h,rowHeight:b,columnsMap:T,fieldsToColumn:C,domRef:S,hidden:y,showZebraRows:I}=o,w=he.useRef(null),v=lt(Pe=>{w.current=Pe,S&&S(Pe)},[S]);if(!d)return he.createElement("div",{ref:v},"no column");let{rowSelected:R}=e,{getState:x,actions:D,computed:M,api:A,getDataSourceMasterContext:E}=Q(),{componentState:_,getState:P,api:F,componentActions:N}=De(),{activeRowIndex:G,keyboardNavigation:H,columnReorderInPageIndex:B}=x(),pe=h===G&&H==="row",de={getState:x,getDataSourceState:P,getDataSourceMasterContext:E,actions:D,dataSourceActions:N,api:A,dataSourceApi:F},k=e.rowDisabled,W=M.computedVisibleColumns.map(Pe=>Pe.id),se=_d({horizontalLayoutPageIndex:i,rowIndexInHorizontalLayoutPage:r,column:d,rowInfo:e,rowDetailState:c,columnsMap:T,visibleColumnsIds:W,fieldsToColumn:C,context:de}),{stylingParam:ce,renderParams:ie,formattedValueContext:oe,renderFunctions:te,groupByColumnReference:fe,inEdit:ne}=se,{align:V,verticalAlign:U}=ie,O=ie,re=he.useRef(O),j=m&&f?Pe=>{let kt={...oe,rowIndex:h};m(kt,Pe),f(Pe)}:f,K=g&&p?Pe=>{let Ze={...oe,rowIndex:h,rowInfo:e};g(Ze,Pe),p(Pe)}:p,ee=lt(Pe=>{let Ze=d.computedVisibleIndex;x().cellClick({rowIndex:h,colIndex:Ze,event:Pe})},[h,d.computedVisibleIndex,H]),Y=lt(Pe=>{let Ze=d.computedVisibleIndex;if(x().cellMouseDown({rowIndex:h,colIndex:Ze,event:Pe}),H==="row"){k||(D.activeRowIndex=h);return}H==="cell"&&(D.activeCellIndex=[h,Ze])},[h,k,d.computedVisibleIndex,H]),{selectionMode:le,cellSelection:me,isNodeReadOnly:Ve}=_,Ee=O.cellSelected;O.domRef=v,O.htmlElementRef=w,O.toggleCurrentTreeNode=lt(O.toggleCurrentTreeNode,[e]),O.selectCell=lt(O.selectCell,[e]),O.deselectCell=lt(O.deselectCell,[e]),O.selectCurrentRow=lt(O.selectCurrentRow,[e]),O.deselectCurrentRow=lt(O.deselectCurrentRow,[e]),O.toggleCurrentGroupRow=lt(O.toggleCurrentGroupRow,[e]),O.toggleCurrentRowSelection=lt(O.toggleCurrentRowSelection,[e]),O.toggleCurrentGroupRowSelection=lt(O.toggleCurrentGroupRowSelection,[e]),O.toggleCurrentTreeNodeSelection=lt(O.toggleCurrentTreeNodeSelection,[e]);let Ge=d.components?.Editor??Ld,Ue=ne?he.createElement(zd,{contextValue:O},he.createElement(Ge,null)):null,Le=lt(Qe(()=>{if(y||ne)return null;if(re.current=O,te.renderGroupIcon&&(O.renderBag.groupIcon=he.createElement(at,{render:te.renderGroupIcon,renderParam:{...O,renderBag:{...O.renderBag}}})),te.renderSelectionCheckBox&&le=="multi-row"&&(O.renderBag.selectionCheckBox=he.createElement(at,{render:xy,renderParam:O}),te.renderSelectionCheckBox!==!0&&(O.renderBag.selectionCheckBox=he.createElement(at,{render:te.renderSelectionCheckBox,renderParam:{...O,renderBag:{...O.renderBag}}}))),e.isTreeNode){let{isParentNode:kt}=e,Fe;Fe=(kt?te.renderTreeIconForParentNode:te.renderTreeIconForLeafNode)||typeof te.renderTreeIcon=="function"?te.renderTreeIcon:kt&&te.renderTreeIcon===!0?fl:void 0,Fe===!0?Fe=fl:Fe&&(O.renderBag.treeIcon=he.createElement(at,{render:fl,renderParam:O})),Fe&&(O.renderBag.treeIcon=he.createElement(at,{render:Fe,renderParam:{...O,renderBag:{...O.renderBag}}}))}te.renderRowDetailIcon&&(O.renderBag.rowDetailsIcon=he.createElement(at,{render:Iy,renderParam:{...O,renderBag:{...O.renderBag}}}),typeof te.renderRowDetailIcon=="function"&&(O.renderBag.rowDetailsIcon=he.createElement(at,{render:te.renderRowDetailIcon,renderParam:{...O,renderBag:{...O.renderBag}}}))),te.renderValue&&(O.renderBag.value=he.createElement(at,{render:te.renderValue,renderParam:{...O,renderBag:{...O.renderBag}}})),e.isGroupRow&&te.renderGroupValue&&(O.renderBag.value=he.createElement(at,{render:te.renderGroupValue,renderParam:{...O,renderBag:{...O.renderBag}}})),!e.isGroupRow&&te.renderLeafValue&&(O.renderBag.value=he.createElement(at,{render:te.renderLeafValue,renderParam:{...O,renderBag:{...O.renderBag}}})),re.current=O;let Pe=O.renderBag.value;Pe instanceof Date&&(Pe=Pe.toLocaleDateString());let Ze=he.createElement(he.Fragment,null,V!=="end"?O.renderBag.treeIcon:null,V!=="end"?O.renderBag.groupIcon:null,V!=="end"?O.renderBag.rowDetailsIcon:null,V!=="end"?O.renderBag.selectionCheckBox:null,Pe,V==="end"?O.renderBag.selectionCheckBox:null,V==="end"?O.renderBag.rowDetailsIcon:null,V==="end"?O.renderBag.groupIcon:null,V==="end"?O.renderBag.treeIcon:null);return d.render?he.createElement(at,{render:d.render,renderParam:{...O,renderBag:{...O.renderBag,all:Ze}}}):Ze}),[d,y,ne,c,d.renderTreeIcon||d.renderTreeIconForParentNode?Ve:!1,...Pd(O,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),Ye=M.computedVisibleColumns.map(Pe=>Pe.id),We=M.computedColumnOrder,bt={...oe,visibleColumnIds:Ye,allColumnIds:We,rowIndex:h,rowHasSelectedCells:!1};Object.defineProperty(bt,"rowHasSelectedCells",{get(){return e.hasSelectedCells(Ye)}});let yn=e.isTreeNode&&(d.renderTreeIcon||d.renderTreeIconForLeafNode||d.renderTreeIconForParentNode),st=typeof n=="function"?n(bt):n,z;fe?.className&&(z=ml(fe.className,ce)),s&&(z=Z(z,ml(s,ce))),d.className&&(z=Z(z,ml(d.className,ce))),yn&&(z=Z(z,Id({align:V})));let X;e.dataSourceHasGrouping&&d.groupByForColumn&&(X=Rd({rowInfo:e})),yn&&(X=vy({rowInfo:e})),t&&(X=typeof t=="function"?{...X,...t(bt)}:{...X,...t}),l&&(X=gl(X,l,ce)),fe?.style&&(X=gl(X,fe.style,ce)),d.style&&(X=gl(X,d.style,ce)),X=X||{},X.height=b,X.zIndex=`var(${Sy}-${d.computedVisibleIndex})`,X.visibility=`var(${wy}-${d.computedVisibleIndex}, visible)`;let ye=Ty(()=>X,[X?JSON.stringify(X):null]),Se=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:h)%2===1,$e=I?Se?"odd":"even":!1,L=!1,He=!1,Et=!1,ct=!1;if(me&&Ee){let Pe=a(),Ze=Pe[e.indexInAll-1],kt=Pe[e.indexInAll+1],Fe=M.computedVisibleColumns[d.computedVisibleIndex+1],Bn=M.computedVisibleColumns[d.computedVisibleIndex-1];L=Ze?!me.isCellSelected(Ze.id,d.id):!0,d.computedPinned==="end"&&d.computedFirstInCategory?He=!0:He=Bn?!me.isCellSelected(e.id,Bn.id):!0,d.computedPinned==="start"&&d.computedLastInCategory?Et=!0:Et=Fe?!me.isCellSelected(e.id,Fe.id):!0,ct=kt?!me.isCellSelected(kt.id,d.id):!0}let yt=me&&Ee?{top:L,left:He,right:Et,bottom:ct}:null,Mt=B!=null?i!==B:!1,na=Ue,oa=Le(),Ro={domRef:v,cellType:"body",column:d,width:u,rowId:e.id,horizontalLayoutPageIndex:i,style:ye,onMouseLeave:K,onMouseEnter:j,onClick:ee,afterChildren:na,onMouseDown:Y,cssEllipsis:d.cssEllipsis??!0,className:Z(yt?Pc(yt):"",Zr(d,[On,Nn],Dc,{dragging:!1,insideDisabledDraggingPage:Mt,zebra:$e,align:V,verticalAlign:U,rowDisabled:k,rowActive:pe,cellSelected:Ee,rowSelected:R,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!d.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),z,st),renderChildren:lt(()=>oa,[Le])},fr=jo.Provider;return he.createElement(fr,{value:re.current},he.createElement(ri,{...Ro}))}var kd=he.memo(Dy);function ii(){return yy(jo)}function pl(){let{api:o,state:{editingValueRef:e,editingCell:t}}=Q(),{column:n,rowInfo:r}=ii(),[i]=he.useState(()=>t?.value),[a,l]=he.useState(i),s=t?!t.active&&!!t.waiting:!1,c=he.useCallback(f=>{e.current=f,l(f)},[]);he.useLayoutEffect(()=>{e.current=i},[]);let u=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:p}}function $o(o){return o.render(o.renderParam)??null}function at(o){let e=jo.Provider;return lo.createElement(e,{value:o.renderParam},lo.createElement($o,{render:o.render,renderParam:o.renderParam}))}function zd(o){let e=jo.Provider;return lo.createElement(e,{value:o.contextValue},o.children)}function sn(o){let e=ai.Provider;return lo.createElement(e,{value:o.renderParam},lo.createElement($o,{render:o.render,renderParam:o.renderParam}))}import*as cn from"react";var Py={width:"100%",pointerEvents:"none"},hl=`${dt}-menu`,bl=Kr({"data-name":""}),yl={[bl["data-name"]]:"menu-icon"};function Uo(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...Py,borderTop:`${ae.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return cn.createElement("div",{...n,style:e,...yl,onPointerDown:s=>s.stopPropagation(),className:Z(t,yu({menuVisible:i,reserveSpaceWhenHidden:r}),dt,`${dt}-menu`)},a??cn.createElement(cn.Fragment,null,cn.createElement("div",{className:hl,style:l}),cn.createElement("div",{className:hl,style:l}),cn.createElement("div",{className:hl,style:l})))}import*as so from"react";import{useEffect as Ey,useState as Gd}from"react";var Vd="_1ek6mqy0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var My={transition:"width 0.25s, opacity 0.25s"};function li(o){let[e,t]=Gd(!0),[n,r]=Gd(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=o,u=c!=null&&c>0,d=o.size??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={...My,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};Ey(()=>{let b=i!=0?1:0;if(!e&&b&&t(!0),b!==n){let T=requestAnimationFrame(()=>{r(b)});return()=>{cancelAnimationFrame(T)}}return()=>{}},[i,e]);let g=()=>{let T=!(n===0&&i===0);T!==e&&t(T)};if(!e&&!o.forceSize)return null;let h={};return i===-1&&(h.top="100%"),so.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:Z(s,dt,Vd,`${dt}-sort`)},u?so.createElement("div",{"data-name":"index",style:h,className:Su},c):null,so.createElement("div",{style:{width:f[0],...m},onTransitionEnd:g}),so.createElement("div",{style:{width:f[1],...m}}),so.createElement("div",{style:{width:f[2],...m}}))}import*as $d from"react";import{useCallback as jd}from"react";import{useRef as Bd,useState as Ay}from"react";import*as Yo from"react";function Hd(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){Te.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;Te.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?Ca(l,i,n.current):Te.columnOffsets.set(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 c=e[l];if(c.computedPinned==="start"){Ca(c,i,n.current);continue}c.computedPinned!=="end"&&Te.columnOffsets.set(l,c.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||Te.columnOffsets.set(l,c.computedOffset+i,n.current)}}}}}function Kd(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,c=i.current;if(n.forEach((u,d)=>{s+=u;let p=o[d],f=r[p],m=f.computedWidth+u;Te.columnWidths.set(p,m,c),f.computedPinned!=="end"&&(l&&Te.columnOffsets.set(p,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&Te.columnOffsets.set(u,d.computedOffset+s,c)}}}}var si="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",ci=ue({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw23 _16lm1iw2a",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0},"zneyzhn"]]}),ui=ue({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw26 _16lm1iw2e",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:_y}=Me,Fy=`${_y}HeaderCell_ResizeHandle`;function Oy(o){let{state:{brain:e,headerBrain:t}}=Q(),n=Bd(null),[r,i]=Ay(!1),a=Bd(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,b=g.pointerId,T=g.clientX,C=g.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),R=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{v(),R()}}C.setPointerCapture(b);let S=Hd(o.columnIndex,{columns:o.columns,shareSpaceOnResize:h,domRef:n}),y=(v,{done:R}={})=>{s&&(v=v/(s+1),R&&(v=Math.round(v))),c==="end"&&(v*=-1);let{adjustedDiff:x,constrained:D}=o.computeResize({diff:v,shareSpaceOnResize:h});return a.current!==D&&i(D),S.resize(x),x},I=v=>{y(Math.round(v.clientX-T))},w=v=>{C.releasePointerCapture(b),C.removeEventListener("pointermove",I),C.removeEventListener("pointerup",w);let R=Math.round(v.clientX-T),x=y(R,{done:!0});p(),o.onResize({diff:x,shareSpaceOnResize:h})};C.addEventListener("pointermove",I),C.addEventListener("pointerup",w)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return Yo.createElement("div",{ref:n,className:`${Fy} ${si} ${ui({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:f},Yo.createElement("div",{style:m,className:ci({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var Wd=Yo.memo(Oy);function Ud(o,e){let{computed:{computedVisibleColumns:t},getState:n,getComputed:r,actions:i}=Q(),a=jd(({diff:c,shareSpaceOnResize:u})=>{let d=n(),{columnSizing:p,viewportReservedWidth:f,bodySize:m}=d,g=r().computedVisibleColumns,h=!1,b=g.reduce((S,y)=>(y.computedFlex&&(S[y.id]={...p[y.id],flex:y.computedWidth},h=!0),S),{}),T=h?{...p,...b}:p;return Xa({shareSpaceOnResize:u,availableSize:m.width,reservedWidth:f||0,dragHandleOffset:c,dragHandlePositionAfter:o.computedVisibleIndex,columnSizing:T,items:g.map(S=>({id:S.id,computedFlex:S.computedFlex,computedWidth:S.computedWidth,computedMinWidth:S.computedMinWidth,computedMaxWidth:S.computedMaxWidth}))})},[o]),l=jd(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:p}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=p),i.columnSizing=d},[a]);return o.computedResizable?$d.createElement(Wd,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}import*as Xe from"react";import{useCallback as Tl,useEffect as Cl}from"react";var Yd=ue({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),qd=ue({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Xd(o,e){return Tt(o,e)}var di=class extends En{constructor(t){super();this.dragIndex=-1;this.breakpoints=[];this.activeDragSourcePosition="outside";this.previousAcceptsDropResult=!0;this.setData(t)}get listId(){return this.data.listId}setData(t){return Xd(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Xd(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let n=!0;return typeof this.data.shouldAcceptDrop=="function"&&(n=this.data.shouldAcceptDrop(t)),n=!!n,n!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=n,n?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),n}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let n=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>n||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=n?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:n,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=u.filter(f=>f!==r):d=Pn(u,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",p)}};var Qd=Xe.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),qo=()=>Xe.useContext(Qd),Ny=o=>{let{node:e,offset:t}=o;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},Ly=o=>`${o.getAttribute(un)}`;function ky(o){let e=o.current?.querySelectorAll(pi)??[];return!e||e.length,Array.from(e).map(n=>{let r=Ly(n),i=n.getBoundingClientRect();return{id:r,rect:i}})}function zy(o){let{domRef:e,orientation:t,dragListId:n}=o,r=Ce.from(e.current.getBoundingClientRect());return{draggableItems:ky(e),orientation:t,listId:n,listRectangle:r,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial}}function Jd(o){return new di(zy(o))}function Vy(o,e){let t=Ie(e),[n,r]=Xe.useState(null),i=Tl(l=>{if(l)pt.registerDragInteractionTarget(l);else{let s=a();s&&pt.unregisterDragInteractionTarget(s)}r(l)},[]),a=Ie(n);return Cl(()=>pt.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),p=l.getData();if(p.initial&&p.listId!==s&&c?.includes(p.listId)){let f=Jd({domRef:o,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(f)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}var kn=o=>{let e=Xe.useRef(null),{dropTargetListId:t,dragSourceListId:n}=Mn(),{updateDragOperationSourceAndTarget:r,dragItemId:i,status:a}=Mn(),l=Ie(o.onDrop),s=Ie(o.onAcceptDrop),c=Ie(o.onRemove),u=Ie(o.updatePosition??Ny),{interactionTarget:d,setInteractionTarget:p}=Vy(e,o);Cl(()=>{let y=document.querySelector(`[${Zd}="${o.dragListId}"]`);y?e.current=y:console.warn(`DragList with id "${o.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[o.dragListId]),Cl(()=>{if(d){let y=o.dragListId,I=d.on("start",({dragItem:R,dragSourceListId:x,dropTargetListId:D})=>{r({dragSourceListId:x,dropTargetListId:D,dragItemId:R.id,status:"accepted"})}),w=d.on("move",({offsetsForItems:R,items:x,status:D})=>{if(D==="rejected")return;let M=m(),A=u();x.forEach((E,_)=>{let P=R[_],F=M[_];F&&A({id:E.id,node:F,offset:P})})}),v=d.on("drop",R=>{let{sortedIndexes:x,dragIndex:D,dropIndex:M,dragItem:A,items:E,dragSourceListId:_,dropTargetListId:P,outside:F,status:N}=R,G=m();f.current=[];let H=s(),B=c(),pe=l(),de=u();E.forEach((se,ce)=>{let ie=G[ce];ie&&de({id:se.id,node:ie,offset:null})}),y===P&&_!==y&&H&&N==="accepted"&&H({dragItemId:A.id,dragSourceListId:_,dropTargetListId:P,dragIndex:D,dropIndex:M,dropItemId:E[M]?.id});let W=null;M===-1&&_===y&&P===y&&F&&(W=B),M!==-1&&P===y&&_===y&&(W=pe),W&&W?.(x,{dragIndex:D,dropIndex:M,dragItemId:E[D].id,dropItemId:E[M]?.id})});return()=>{I(),w(),v()}}},[d,o.dragListId]);let f=Xe.useRef([]),m=Tl(()=>{let y=f.current;return(!y||y.length===0)&&(y=Array.from(e.current?.querySelectorAll(pi)??[]),f.current=y),y},[]),g=Tl(y=>{let I=y.currentTarget,w=I.getAttribute(un);if(w==null){let F=tn(I,pi);F&&(w=F.getAttribute(un))}if(w==null){console.warn("Could not find drag item id for element",I,`Make sure you have a parent element with a ${un} attribute`);return}w=`${w}`;let v=null,R=Array.from(e.current?.querySelectorAll(pi)??[]);f.current=R;let x=Jd({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0}),D=x.getData().draggableItems,M=D.findIndex(F=>F.id===w),A=D[M];p(x);let E={left:y.clientX,top:y.clientY},_=F=>{v||(v=pt.startDrag({listId:o.dragListId,dragItem:A,dragIndex:M},E)),v.move({left:F.clientX,top:F.clientY})},P=()=>{if(we().removeEventListener("pointermove",_),!v){p(null);return}v.drop(),v=null};we().addEventListener("pointermove",_),we().addEventListener("pointerup",P,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside]),h=y=>y===void 0?i!=null:`${y}`===i,b=!!i,T=Xe.useMemo(()=>({dragItemId:i,onDragItemPointerDown:g,dragSourceListId:n,dropTargetListId:t,status:a,dragListId:o.dragListId,draggingInProgress:b}),[i,g,h,b,n,t,o.dragListId]),C={className:Z("DragList",b?"DragList--dragging":"",Yd({dragging:b})),[Zd]:o.dragListId},S=typeof o.children=="function"?o.children(C,T):o.children;return Xe.createElement(Qd,{value:T},S)},Zd="data-drag-list-id",un="data-drag-item-id",pi=`[${un}]`,Gy=Xe.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),Hy=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=qo(),l=i===n&&r===`${o.id}`,s=Xe.useMemo(()=>({dragItemId:o.id,active:l,dragListId:n,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,l,t,i,a]),c={"data-drag-item-id":`${o.id}`,onPointerDown:e,className:Z("DraggableItem",l?"DraggableItem--active":"",qd({active:l,draggingInProgress:t}))},u=typeof o.children=="function"?o.children(c,s):o.children;return Xe.createElement(Gy.Provider,{value:s},u)};kn.DraggableItem=Hy;import*as Sl from"react";var ep=o=>Sl.createElement(_e,{...o,viewBox:"0 -960 960 960"},Sl.createElement("path",{d:"m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"}));import*as Zo from"react";function tp(){return{}}var np=o=>({allowColumnHideWhileDragging:e=>e??!0});import{createContext as Ky}from"react";var By=Ky(null);function wl(){return By}import*as Rt from"react";function op(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((u,d)=>{let p=u.id,f=o[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let b={type:"column",id:p,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([p],b);let T=u.columnGroup,C,S=b;for(;T;){let y=e[T];if(y){g.add(T);let I=[p,...g];C=h.has(T)?i.get(T):void 0,C||(C={id:T,type:"group",ref:y,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[T],computedWidth:0,computedPinned:b.computedPinned,depth:t.get(T)??0},r.set(I,C),i.set(T,C)),C.columnItems.push(b),C.uniqueGroupId.push(b.id),S&&!h.has(S.id)&&C.children.push(S),S=C,T=y.columnGroup}else break}});let l=[],s=new J,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&rp(u.children),l.push(u),c+=d}if(u.type==="group")u.columnItems.forEach(d=>{s.set([u.depth,d.ref.computedVisibleIndex],u)});else for(let d=u.depth;d<=n+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function rp(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"&&rp(t.children),e+=n})}import*as dn from"react";import{useCallback as Il,useEffect as qy,useRef as Xy}from"react";import*as vl from"react";import*as sp from"react";import{useCallback as lp}from"react";import{useRef as ip,useState as Wy}from"react";import*as Xo from"react";var{rootClassName:jy}=Me,$y=`${jy}HeaderCell_ResizeHandle`;function Uy(o){let e=ip(null),[t,n]=Wy(!1),r=ip(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,h=Kd(o.groupColumns.map(S=>S.computedVisibleIndex),{columns:o.columns,domRef:e}),b=S=>{a==="end"&&(S*=-1);let{constrained:y,adjustedDiffs:I,adjustedDiff:w}=o.computeResize(S);return r.current!==y&&n(y),h.resize(I),w},T=S=>{if(g){let y=o.groupColumns.reduce((v,R)=>v+R.computedWidth-R.computedMinWidth,0),I=o.brain.getAvailableSize(),w={width:I.width+y,height:I.height};o.brain.update(w),g=!1}b(Math.round(S.clientX-f))},C=S=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",T),m.removeEventListener("pointerup",C);let y=Math.round(S.clientX-f),I=b(y);o.onResize(I)};m.addEventListener("pointermove",T),m.addEventListener("pointerup",C)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:ae.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Xo.createElement("div",{ref:e,className:`${$y} ${si} ${ui({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},Xo.createElement("div",{style:{...u,...o.style},className:ci({constrained:t})}))}var ap=Xo.memo(Uy);function cp(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:c}=Q(),u=o[o.length-1],d=lp(g=>{let h=l(),{columnSizing:b,viewportReservedWidth:T,bodySize:C}=h,S=s().computedVisibleColumns,y=!1,I=S.reduce((R,x)=>(x.computedFlex&&(R[x.id]={...b[x.id],flex:x.computedWidth},y=!0),R),{}),w=y?{...b,...I}:b;return Du({availableSize:C.width,reservedWidth:T||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:w,columnGroupSize:o.length,items:S.map(R=>({id:R.id,resizable:R.computedResizable,computedFlex:R.computedFlex,computedWidth:R.computedWidth,computedMinWidth:R.computedMinWidth,computedMaxWidth:R.computedMaxWidth}))})},[u]),p=lp(g=>{let{columnSizing:h,reservedWidth:b}=d(g);c.viewportReservedWidth=b,c.columnSizing=h},[d]);return o.some(g=>g.computedResizable)?sp.createElement(ap,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var up=`${Je}HeaderGroup`,dp=q($.columnWidthAtIndex),Yy=q($.columnZIndexAtIndex);function pp(o){let{columnGroup:e,height:t,columns:n,bodyBrain:r,columnGroupsMaxDepth:i}=o,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let s=cp(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=n[0],u=n.length>1?"calc( "+n.map(f=>`var(${dp}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${dp}-${c.computedVisibleIndex})`,d=`calc(var(${Yy}-${c.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=u,p.height=t,vl.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:Z(bu,up),style:p,"data-z-index":d},vl.createElement("div",{className:Z(`${up}__header-content`,Ft)},a),s)}var{rootClassName:Zy}=Me,Qy=[],fp=`${Zy}Header`,Jy=pu({overflow:!1}),eT=o=>{};function tT(o){let{bodyBrain:e,columns:t,style:n,className:r,columnHeaderHeight:i,columnAndGroupTreeInfo:a,columnGroupsMaxDepth:l}=o,{computed:s,getState:c,state:{headerBrain:u,headerOptions:d,showColumnFilters:p,headerRenderer:f,headerOnRenderUpdater:m}}=Q(),{computedColumnsMap:g}=s,h=Xy(null),b=Il(y=>{h.current&&(h.current.style.transform=`translate3d(-${y.scrollLeft}px, 0px, 0px)`)},[]);qy(()=>{let y=u.onScroll(b);return b(u.getScrollPosition()||{scrollLeft:0,scrollTop:0}),y},[u]);let T={ref:h,className:Z(fp,`${fp}--virtualized`,r,Jy),style:{...n,height:i}},C=Il(y=>{let{rowIndex:I,colIndex:w,domRef:v,height:R,widthWithColspan:x,heightWithRowspan:D,hidden:M}=y,A=t[w];if(!A||M)return null;let E=u.isHorizontalLayoutBrain?u.getPageIndexForRow(I):null,_=a?a.pathsToCells.get([I,w]):null;if(_&&_.type==="group"){let P=_.columnItems.map(G=>G.ref),F={..._.ref,id:_.id,uniqueGroupId:_.uniqueGroupId,depth:_.depth,columns:P.map(G=>G.id),computedWidth:_.computedWidth,groupOffset:_.groupOffset};return c().columnGroupVisibility[_.id]!==!1?dn.createElement(pp,{horizontalLayoutPageIndex:E,bodyBrain:e,columnGroupsMaxDepth:l,domRef:v,columns:P,width:x,height:R,columnGroup:F}):null}return dn.createElement(gp,{domRef:v,column:A,horizontalLayoutPageIndex:E,headerOptions:d,width:x,height:D,columnsMap:g})},[d,t,i,a,l,p,u]),S=Il(y=>{},[]);return dn.createElement(kn,{orientation:"horizontal",dragListId:"header",onDrop:S,updatePosition:eT},y=>dn.createElement("div",{...y,...T,className:Z(y.className,T.className)},dn.createElement(Fr,{name:"header",renderCell:C,brain:u,renderer:f,onRenderUpdater:m,cellHoverClassNames:Qy,cellDetachedClassNames:kr})))}var mp=dn.memo(tT);function hp(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,r=Q(),{computedPinnedStartColumns:i,computedPinnedEndColumns:a,computedVisibleColumns:l,columnSize:s}=r.computed,{state:{columnHeaderHeight:c,columnGroupsDepthsMap:u,columnGroupsMaxDepth:d,computedColumnGroups:p,showColumnFilters:f}}=r,m=!p||!Object.keys(p).length?1:d+2,g=m*c+(f?c:0),h=Rt.useMemo(()=>{if(!(!p||!Object.keys(p).length))return op(l,p,u,d)},[l,p,u]),b=Rt.useCallback(({rowIndex:w,colIndex:v})=>{let R=l[v],x=1,D=1;if(!R||!h)return{rowspan:x,colspan:D};let M=h.pathsToCells.get([w,v]);if(!M)return{rowspan:x,colspan:D};if(M.type==="column")return{colspan:D,rowspan:m-M.depth};let A=M.columnItems.findIndex(E=>E.id===R.id);return{rowspan:x,colspan:A===0?M.columnItems.length:1}},[p,d,l,h,m,u]),T=Rt.useCallback(({rowIndex:w,colIndex:v})=>b({rowIndex:w,colIndex:v}).rowspan,[b]),C=Rt.useCallback(({rowIndex:w,colIndex:v})=>b({rowIndex:w,colIndex:v}).colspan,[b]),S=Rt.useCallback(w=>f?w<m-1?c:2*c:c,[m,f,c]);zr(e,{colWidth:s,rowHeight:S,rows:m,cols:l.length,height:g,rowspan:T,colspan:C},{fixedColsEnd:a.length,fixedColsStart:i.length});let y=Rt.createElement(mp,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:g,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:h}),I=n.vertical&&an()?Rt.createElement("div",{className:Tu,style:{zIndex:1e3,width:an()}}):null;return Rt.createElement("div",{className:`${ul} ${vu}`,style:{height:g}},y,I)}var{ManagedComponentContextProvider:nT}=It({initSetupState:tp,forwardProps:np,Context:wl()});function Rl(o){let e=Q(),{state:t,getComputed:n}=e,{header:r,brain:i,headerBrain:a,wrapRowsHorizontally:l}=t,{scrollbars:s}=n();return r?Zo.createElement(nT,{...o},Zo.createElement(hp,{wrapRowsHorizontally:!!l,bodyBrain:i,headerBrain:a,scrollbars:s})):null}function bp(){return Zo.useContext(wl()).componentState}var lT=o=>{let{allRowsSelected:e,someRowsSelected:t,api:n,dataSourceApi:r}=o,i=e?!0:t?null:!1,{components:a,isTree:l}=n.getState(),s=a?.CheckBox||Ht;return ve.createElement(s,{domProps:{className:Lr},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},ai=ve.createContext(null);var sT=q($.columnZIndexAtIndex),cT=q($.columnVisibilityAtIndex),xl=ve.createElement("div",{className:zc[1]}),Tp=Kr({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[un]:""});function gp(o){let e=o.column,{allowColumnHideWhileDragging:t}=bp(),{onDragItemPointerDown:n}=qo(),{api:r,getComputed:i,getState:a,actions:l,state:{showColumnFilters:s,components:c,portalDOMRef:u,columnHeaderHeight:d,columnReorderDragColumnId:p,columnMenuVisibleForColumnId:f,columnReorderInPageIndex:m},getDataSourceMasterContext:g}=Q(),{api:h,componentActions:b,getState:T,componentState:{filterDelay:C,filterTypes:S}}=De(),{allRowsSelected:y,someRowsSelected:I,selectionMode:w}=Jt(),v=o.horizontalLayoutPageIndex,R=p===e.id,x=m!=null?v!==m:!1,{onResize:D,height:M,width:A,headerOptions:E,columnsMap:_}=o,P=e.computedSortInfo,F=e.header,N=yp(L=>{ne.current=L,o.domRef?.(L)},[o.domRef]),G=E.alwaysReserveSpaceForSortIcon,H=e.headerAlign??e.align,B=(typeof H=="function"?H({isHeader:!0,column:e}):H)??"start",pe=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",de=et(e,{actions:l,api:r,dataSourceActions:b,dataSourceApi:h,getComputed:i,getDataSourceState:T,getDataSourceMasterContext:g,getState:a}),k=de.isSortable(),W=k&&(e.computedSorted||G)?ve.createElement(li,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:ae.spacing[2],marginInlineEnd:ae.spacing[2]},className:`${An}__sort-icon ${Cu} ${wu({align:B})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,ce=e.computedFilterable&&e.computedFiltered?ve.createElement(eo,null):null,ie=e.headerCssEllipsis??e.cssEllipsis??!0,oe={reserveSpaceWhenHidden:B==="center",menuVisible:f===e.id,style:B==="end"?{marginInlineStart:`calc(${ae.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:ae.spacing[2]}:{marginInlineEnd:`calc(${ae.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:ae.spacing[2]},domProps:{onMouseDown:L=>{L.stopPropagation(),de.toggleContextMenu(L.target)}}},te=e.components?.MenuIcon||c?.MenuIcon||Uo,fe=ve.createElement(te,{...oe}),ne=iT(null),V={horizontalLayoutPageIndex:v,dragging:R,domRef:N,htmlElementRef:ne,renderLocation:"column-header",column:e,columnsMap:_,columnSortInfo:P,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:I,allRowsSelected:y,selectionMode:w,api:r,dataSourceApi:h,columnApi:de,renderBag:{sortIcon:W,filterIcon:ce,menuIcon:fe,menuIconProps:oe,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},U=V,O=U.renderBag.header,re=()=>{let L={...V,renderBag:{...V.renderBag}};if(e.renderSortIcon&&(L.renderBag.sortIcon=ve.createElement(sn,{render:e.renderSortIcon,renderParam:{...L,renderBag:{...L.renderBag}}})),e.renderFilterIcon&&(L.renderBag.filterIcon=ve.createElement(sn,{render:e.renderFilterIcon,renderParam:{...L,renderBag:{...L.renderBag}}})),typeof e.renderMenuIcon=="function"&&(L.renderBag.menuIcon=ve.createElement(sn,{render:yt=>{if(typeof e.renderMenuIcon!="function")return null;let Mt=e.renderMenuIcon(yt);return Mt?Mt.type===te||Mt.type===Uo?Mt:ve.createElement(te,{...oe},Mt):null},renderParam:{...L,renderBag:{...L.renderBag}}})),e.renderSelectionCheckBox&&w==="multi-row"){L.renderBag.selectionCheckBox=ve.createElement(sn,{render:lT,renderParam:{...L,renderBag:{...L.renderBag}}});let yt=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;yt&&yt!==!0&&(L.renderBag.selectionCheckBox=ve.createElement(sn,{render:yt,renderParam:{...L,renderBag:{...L.renderBag}}}))}F instanceof Function&&(L.renderBag.header=O=ve.createElement(sn,{render:F,renderParam:{...L,renderBag:{...L.renderBag}}}));let He=e.renderMenuIcon===!1?null:L.renderBag.menuIcon,Et=ie?ve.createElement("div",{className:Ft},L.renderBag.header):L.renderBag.header,ct=ve.createElement(ve.Fragment,null,B==="center"?xl:null,L.renderBag.selectionCheckBox,Et,L.renderBag.sortIcon,L.renderBag.filterIcon,B==="center"?xl:null,B!=="center"?xl:null,He);return e.renderHeader?ve.createElement(sn,{render:e.renderHeader,renderParam:{...L,renderBag:{...L.renderBag,all:ct}}}):ct};rT(()=>{let L=null,He=ne.current;return D&&He&&(L=Mo(He,D)),()=>{L?.()}},[ne.current,o.onResize]);let j={height:M};e.headerStyle&&(j=typeof e.headerStyle=="function"?{...j,...e.headerStyle(U)||{}}:{...j,...e.headerStyle});let K=typeof e.headerClassName=="function"?e.headerClassName(U):e.headerClassName,{onPointerDown:ee,proxyPosition:Y,dragColumnOutside:le}=hd({columnId:e.id,domRef:ne,horizontalLayoutPageIndex:v,allowColumnHideOnDrag:t}),me=null,Ve=ai.Provider,Ee={filtered:e.computedFiltered,verticalAlign:pe,align:B},Ge=ve.useMemo(()=>{let L=He=>{r.setColumnFilter(e.id,He)};return C>0?zt(L,{wait:C}):L},[C,e.id]),Ue=e.computedFilterType,Le=S[Ue],Ye=e.computedFilterable?e.computedFilterValue?.filter.operator??Le?.defaultOperator:void 0,We=e.computedFilterable&&Le?Le.operators.find(L=>L.name===Ye):void 0,bt=We?.components?.FilterEditor||Le?.components?.FilterEditor||e.components?.FilterEditor||no,yn=Le?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,st=Ud(e,{horizontalLayoutPageIndex:v}),z=`var(${sT}-${e.computedVisibleIndex})`;j.zIndex=z,j.visibility=`var(${cT}-${e.computedVisibleIndex}, visible)`;let X={"data-field":`${e.field||""}`,"data-column-id":e.id,[un]:e.id,"data-header-align":B,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},ye=e.computedFilterable?ve.createElement(Lu,{horizontalLayoutPageIndex:v,filterEditor:bt,filterOperatorSwitch:yn??ku,operator:We,filterTypes:S,onChange:Ge,columnFilterType:Ue,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:d}):ve.createElement(zu,null);U.renderBag.filterEditor=ye;let Se=yp(L=>{ee(L),n(L)},[ee,n]),$e=re();return R&&Y&&(me=ve.createElement("div",{key:e.id,className:`${An}Proxy ${cu}`,style:{height:M,width:A,left:Y.left??0,top:Y.top??0}},ve.createElement("div",{className:uu({visible:le})},ve.createElement(ep,{size:16})),O),me=aT(me,u.current)),ve.createElement(Ve,{value:U},ve.createElement(ri,{domRef:N,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...X,"data-z-index":z,style:j,width:A,onPointerDown:Se,contentClassName:Z(su(Ee),Hc[B]),contentStyle:s?{height:M/2}:void 0,className:Z(An,$c.none,k?kc.pointer:"",K,Zr(e,[An,Nn],du,{dragging:R,insideDisabledDraggingPage:x,align:B,verticalAlign:pe,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),lu),cssEllipsis:ie,afterChildren:ve.createElement(ve.Fragment,null,s?ye:null,st),renderChildren:$e}),me)}function qr(){return oT(ai)}import*as Bt from"react";import{useEffect as uT}from"react";function Cp(o,e){let{separator:t}=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 Sp={padding:ae.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},dT={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},wp=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(Cp(t),n,"important")},vp=Bt.forwardRef(function(e,t){let{rootClassName:n}=Vr(),r=Bt.useRef(null),i=Bt.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return uT(()=>{let a=()=>{setTimeout(()=>{wp(r.current,Sp),wp(r.current?.firstElementChild,dT)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),Bt.createElement("div",{ref:i,...e,className:Z(`${n}-Footer`,Vu,e.className),style:Sp},"Powered by"," ",Bt.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});import*as co from"react";var Ip={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},Rp="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",xp="qy58ya4";var{rootClassName:pT}=Me,Dl=`${pT}-LoadMask`;function fT(o){let{visible:e,children:t="Loading"}=o;return co.createElement("div",{className:`${Ip[e?"visible":"hidden"]} ${Dl}`},co.createElement("div",{className:`${Rp} ${Dl}-Overlay`}),co.createElement("div",{className:`${xp} ${Dl}-Text`},t))}var fi=co.memo(fT);function Pl(o){return o.map(Ot)}function Ot(o){if(we().structuredClone)return we().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Pl(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Pl(Array.from(o)));if(o instanceof Map)return new Map(Pl(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=Ot(o[t]));return e}function Qo(o){return o}var zn=Object.seal({data:null,field:null});var fn="____root____",Pp="____not_loaded_yet____";function pn(){return!1}function El(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 mi(o,e,t,n,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=n[i],s=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[i]=a.reducer(l,s,o,e,r)}}}function Ep(o,e){let{reducers:t={},pivot:n,groupBy:r,indexer:i,toPrimaryKey:a,cache:l,mappings:s}=o,c=new J;function u(h,b,T,C=0,S=[]){let y=!T.length||C===T.length-1,I=b[s?.values||"values"]||{};for(let w in I)if(I.hasOwnProperty(w)){let v=w;S.push(v),d.set(S,!0),h.set(S,{reducerResults:I[w][s?.totals||"totals"]||{},items:[]}),y||u(h,I[w],T,C+1,S),S.pop()}}let d=n?new J:void 0,p=[],f=El(t),m=Ot(f);e.visitDepthFirst((h,b,T,C)=>{let[S,...y]=b,I=h.children,w=c.get(y);if(w&&(w.cache=h.cache,w.childrenLoading=h.childrenLoading,w.childrenAvailable=h.childrenAvailable,w.error=h.error),y.length==r.length&&r.length){if(w){w.items=I;for(let R=0,x=y.length;R<x;R++){let D=y.slice(0,R),M=c.get(D);M&&(M.items=M.items||[],M.items=M.items.concat(I))}I=i.indexArray(I,{toPrimaryKey:a,cache:l,nodesKey:void 0})}return C?.()}for(let v=0,R=I.length;v<R;v++){if(!I[v]){let A={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...y,`${Pp}${v}`],A);continue}let x=I[v].data,D=I[v].keys||[];if(D.length){let A=D[D.length-1];y.push(A)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:I[v].totalChildrenCount,reducerResults:I[v].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(y,M),n){let A=M.pivotDeepMap=new J,E=I[v].pivot;u(A,E,n,0,p)}D.length&&y.pop()}C?.()});let g={deepMap:c,groupParams:o,initialData:e,reducerResults:m};return n&&(g.topLevelPivotColumns=d,g.pivot=n),g}function Dp(o,e,t,n,r,i,a,l,s,c=Qo){let{items:u,reducerResults:d,pivotDeepMap:p}=o.get(e);if(u.push(n),a&&mi(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:b}=i[f],T=g?n[g]:null;h&&(zn.data=n,zn.field=g,T=h(zn));let C=(b||c)(T,n);t.push(C),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:Ot(s),items:[]}));let{reducerResults:S,items:y}=p.get(t);y.push(n),a&&mi(n,r,a,S,e)}t.length=0}}function Mp(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=o,d=u(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let b=0,T=n.length;b<=T;b++){let C=n.slice(0,b),S=e.get(C),{reducerResults:y,items:I}=S;I.push(r),S.leavesAvailableCount++,S.totalLeafNodesCount++,a&&mi(r,i,a,y,C)}return}let m=Ot(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let h=c(r);if(!(!h||!Array.isArray(h))){for(let b=0,T=h.length;b<T;b++){let C=h[b];Mp(o,e,t,p,C,b,a,l)}a&&Jo(a,m,g)}}function Ap(o,e){let{reducers:t}=o,n=El(t),r=Ot(n),i=new J,a=new J;i.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let s=0,c=e.length;s<c;s++)Mp(o,i,a,[],e[s],s,t,n);return t&&Jo(t,r,e),{deepMap:i,treeParams:o,treePaths:a,initialData:e,reducerResults:r}}function Ml(o,e){let{groupBy:t,defaultToKey:n=Qo,pivot:r,reducers:i}=o,a=t.length,l=r?new J:void 0,s=new J,c=[],u=[],d=El(i),p=Ot(d);if(!a){let m={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Ot(d)};r&&(m.pivotDeepMap=new J),s.set(c,m)}for(let m=0,g=e.length;m<g;m++){let h=e[m],b={};for(let T=0;T<a;T++){let{field:C,groupField:S,valueGetter:y,toKey:I}=t[T],w=C?h[C]:null;y&&(zn.data=h,zn.field=C,w=y(zn));let v=(I||n)(w,h);if(b[C||S]=v,c.push(v),!s.has(c)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:Ot(d)};r&&(R.pivotDeepMap=new J),s.set(c,R)}Dp(s,c,u,h,m,r,i,l,d,n)}a||Dp(s,c,u,h,m,r,i,l,d,n),i&&mi(h,m,i,p,c),c.length=0}i&&(s.visitDepthFirst((m,g,h,b)=>{Jo(i,m.reducerResults,m.items),r&&m.pivotDeepMap.visitDepthFirst(({items:T,reducerResults:C},S,y,I)=>{Jo(i,C,T),I?.()}),b?.()}),Jo(i,p,e));let f={deepMap:s,groupParams:o,initialData:e,reducerResults:p};return r&&(f.topLevelPivotColumns=l,f.pivot=r),f}function mT(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 gT(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,p=d??null,f;if(Object.keys(c).length>0){p={...d},f={};for(let T in i)if(i.hasOwnProperty(T)){let S=i[T].field;S&&(f[S]=c[T]),S&&p[S]==null&&(p[S]=c[T])}}let m=!0,g=n[n.length-1],h=g;if(p!=null){let T=t[n.length-1];T&&T.field&&(h=p[T.field]),T&&T.toKey&&(h=T.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(Pp)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:pn,hasSelectedCells:pn,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:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function gi(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function Jo(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 _p(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:h,rowsPerPage:b}=r,{deepMap:T}=u,C=o.length,S=t[t.length-1],y=S?S.nodeExpanded:!0;for(let I=0;I<C;I++){let w=o[I],v=c(w,I),R=[...e,v];if(l(w)){let P={id:v,nodePath:R,isGroupRow:!1,data:w,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:pn,hasSelectedCells:pn,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,I],indexInParent:I,indexInAll:y?i.length:-1};p&&(P.rowSelected=p(P)),d&&(P.rowDisabled=d(P)),f&&f(P);let F=h&&b!=null&&b>0&&P.indexInAll%b===0?P.indexInAll/b:null;for(let N=0,G=t.length;N<G;N++){let H=t[N];if(y||(H.collapsedLeafNodesCount+=1),H.deepRowInfoArray.push(P),F!=null&&y){if(typeof h=="function"&&h(H)!==!0)continue;let B=gi(H,P.indexInAll,F);i[B.indexInAll]=B,P.indexInAll++}}y&&(i[P.indexInAll]=P);continue}let M=T.get(R)?.totalLeafNodesCount??0,A={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:R,id:v,data:w,indexInAll:i.length,indexInParent:I,indexInParentNodes:[...n,I],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:pn,hasSelectedCells:pn,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(A.rowSelected=p(A),g)){let P=g.getSelectionCountFor(A.nodePath);A.selectedLeafNodesCount=P.selectedCount,A.deselectedLeafNodesCount=P.deselectedCount}d&&(A.rowDisabled=d(A)),f&&f(A);let E=!0;if(m&&(A.selfExpanded=E=m(A)),y||(E=!1),A.nodeExpanded=E,y&&h&&b!=null&&b>0){let P=A.indexInAll,F=A.parentNodes;if(F.length>0&&P%b===0){let N=P/b,G=0;F.forEach(H=>{typeof h=="function"&&h(H)!==!0||(i.push(gi(H,P+G,N)),G++,A.indexInAll++)})}}y&&(i[A.indexInAll]=A);let _=s(w);Array.isArray(_)&&_p(_,R,[...t,A],A.indexInParentNodes,r,i)}return i}function Fp(o){let{dataArray:e}=o,t=[];return _p(e,[],[],[],o,t),{data:t}}function Op(o){let{lazyLoad:e,groupResult:t,rowsPerPage:n,repeatWrappedGroupRows:r,withRowInfo:i,toPrimaryKey:a,groupRowsState:l,isRowDisabled:s,isRowSelected:c,rowSelectionState:u,generateGroupRows:d,reducers:p={}}=o,{groupParams:f,deepMap:m,pivot:g}=t,{groupBy:h}=f,b=[],T=[],C=[],S=[];return m.visitDepthFirst((y,I,w,v)=>{let R=y.items,x=I.length,D=l?.isGroupRowCollapsed(I)??!1;S.push(w);let M=gT({lazyLoad:e,groupBy:h,parents:Array.from(C),reducers:p,indexInGroup:w,indexInParentGroups:Array.from(S),indexInAll:b.length,groupKeys:I,error:y.error,totalChildrenCount:y.totalChildrenCount,childrenLoading:(y.childrenLoading||!D&&!y.childrenAvailable)&&e,childrenAvailable:y.childrenAvailable,directChildrenCount:I.length===h.length?y.items.length:m.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},y);if(c&&(M.rowSelected=c(M),u)){let F=u.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=F.selectedCount,M.deselectedChildredCount=F.deselectedCount}s&&(M.rowDisabled=s(M));let A=C[C.length-1],E=A?.collapsed??!1;E&&(D=!0),M.collapsed=D;let _=d||D;if(E&&(_=!1),_){if(r&&n!=null&&n>0){let F=M.indexInAll,N=M.parents;if(N.length>0&&F%n===0){let G=F/n,H=0;N.forEach(B=>{typeof r=="function"&&r(B)!==!0||(b.push(gi(B,F+H,G)),H++,M.indexInAll++)})}}b.push(M),T.push(b.length-1)}M.collapsedChildrenCount=0,C.forEach(F=>{F.deepRowInfoArray.push(M),F.collapsedGroupsCount+=D?1:0}),A&&M.selfLoaded&&e&&(A.directChildrenLoadedCount+=1),i&&i(M),C.push(M);let P=!0;if(P){if(v)v();else if(!g){let F=b.length;D||(b.length+=R.length);let N=0;for(let G=0,H=R.length;G<H;G++){let B=R[G];if(!D&&r&&n!=null&&n>0){let W=F+G+N;if(W%n===0){let se=W/n;C.forEach(ce=>{if(typeof r=="function"&&r(ce)!==!0)return;let ie=F+G+N;b[ie]=gi(ce,ie,se),N++,b.length++})}}let pe=F+G+N,k={id:B?a(B,pe):`${I}-${G}`,data:B,isCellSelected:pn,hasSelectedCells:pn,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!B,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:D,groupKeys:I,parents:Array.from(C),indexInParentGroups:[...S,G],indexInGroup:G,indexInAll:pe,groupBy:h,groupNesting:x+1,groupCount:M.groupCount};c&&(k.rowSelected=c(k)),s&&(k.rowDisabled=s(k)),i&&i(k),C.forEach((W,se)=>{se===C.length-1&&B&&(W.directChildrenLoadedCount+=1),D&&(W.collapsedChildrenCount+=1),W.deepRowInfoArray.push(k)}),D||(b[F+G+N]=k)}}}C.pop(),S.pop()}),{data:b,groupRowsIndexes:T}}import*as If from"react";var hT=()=>{};function bT(o,e){let t=new J,n=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of o){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,!0,1);for(let u of c){let d=[...l,u[u.length-1]],p=t.get(d),f=p?p[n]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[n]=f),s.push(p)}return s}return a([],[])}function Np(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(n),d=[...t,u],p=r(n),f=Qe(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let b=m[g];Np(o,e,d,b)}});p?(c?.(n),s?.(n,hT)):(l?.(n,f,i(n)),s?.(n,f))}function Lp(o,e,t){for(let n=0,r=t.length;n<r;n++)Np(o,e,[],t[n])}var yT=function(o,e){return o-e},TT=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},CT=function(o,e){return o-e},ST={number:yT,string:TT,date:CT},er=ST;function kp(o){return o.map(t=>Array.isArray(t.field)?t.field.map((n,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof n=="function"?{...t,valueGetter:n,field:void 0,type:i}:{...t,type:i,field:n}}):t).flat()}var Wt=(o,e,t)=>{let n=typeof t=="function"?t:t?.get;return e.sort(zp(kp(o),n)),e},Al=(o,e,t)=>{let n=zp(kp(o),t.get),r=t.depthFirst??!1,i=t.inplace??!1;r||(i?e.sort(n):e=[...e].sort(n));let{nodesKey:a,toKey:l}=t,s=u=>u[a],c=u=>u[a]===void 0;return Lp({isLeafNode:t.isLeafNode??c,getNodeChildren:t.getNodeChildren??s,toKey:l},{onParentNode:(u,d,p)=>{if(r&&d(),Array.isArray(p)){let f=i?p.sort(n):[...p].sort(n);u[a]=f}r||d()}},e),r&&(i?e.sort(n):e=[...e].sort(n)),e};Wt.knownTypes=er;var wT=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=Wt.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(Wt.knownTypes).join(", ")}`)}return r||(r=er.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,c=r(l,s);return c===0?c:n*c}},vT=o=>o.map(wT).filter(e=>e instanceof Function),zp=(o,e)=>{let t=vT(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 hi=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(){this.positiveMap?.clear(),this.negativeMap?.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 J(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 J(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var mt=class extends hi{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};function uo(o,e){return e.reduce((t,n)=>{let{field:r,valueGetter:i,toKey:a}=n,l=r?o[r]:i?.({data:o,field:r}),s=(a||Qo)(l,o);return t.push(s),t},[])}var xe=class o{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new J;this.deselectedMap=new J;this.onlyUsePrimaryKeys=!1;this.selectionCache=new J;this.selectionCountCache=new J;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?uo(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let n=this.getGroupDeepMap()?.get(e);return n?n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,!0,1)||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],!0,1)||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let n=t?.get(e);return n?n.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,n){return new o(e,t,n)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),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){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let c=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,c),c}if(r&&this.onlyUsePrimaryKeys){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}u++}else{if(this.selectedMap.has([f])){u++;return}d++}});let p={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,!0,1).length,p=this.deselectedMap.getKeysStartingWith(e,!0,1).length,f=u-(d+p),m={selectedCount:d+(c?f:0),deselectedCount:p+(c?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let c=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=c,l=this.deselectedMap.getAllChildrenSizeFor(e),l===c&&(a=0)):(l=c,a=this.selectedMap.getAllChildrenSizeFor(e),a===c&&(l=0))}i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),p=u?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(c,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var IT="*",ze=class{constructor(e){this.wildcard=IT;this.cache=new J;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),n)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,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}error(e){Qt(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let 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),c=this.deselectedRowsToColumns.get(this.wildcard),u=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((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 RT=Be("InfiniteTable"),xT="#dc3545",DT="#eb9316";var Gp="Warn",Hp="Error",PT="Info",ET="Success",MT="Logs",bi=RT.extend(MT),HO=bi.extend(PT),AT=bi.extend(Gp),_T=bi.extend(Hp),KO=bi.extend(ET);var FT=DT,OT=xT;var NT=(o,e)=>{e=e?e.extend?e.extend(Gp):e:AT,e(typeof e.color=="function"?e.color(FT,o):o)},LT=(o,e)=>{e=e?e.extend?e.extend(Hp):e:_T,e(typeof e.color=="function"?e.color(OT,o):o)};var Vp=new J,Kp=(o,...e)=>{Vp.has(e)||(Vp.set(e,!0),o())};var po=(o,e=o,t)=>{Kp(()=>NT(o,t),e,"warn")},Bp=(o,e=o,t)=>{Kp(()=>LT(o,t),e,"error")};function yi(o,e){return new xe(o,tt(e))}function tt(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 Wp(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 xe))throw"Invalid row selection";let a=new xe(r,tt(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 xe))throw"Invalid row selection";let a=new xe(r,tt(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof xe))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?uo(u,c):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof xe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?uo(d,c):[]}let u=new xe(a,tt(e));u.selectRow(r,i),t.rowSelection=u},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:c}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof xe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?uo(d,c):[]}let u=new xe(l,tt(e));u.deselectRow(r,i),t.rowSelection=u}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof xe))throw"Invalid row selection";let s=new xe(a,tt(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 xe))throw"Invalid row selection";let s=new xe(a,tt(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 xe))throw"Invalid row selection";let s=new xe(a,tt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new xe(i,tt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof xe))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new xe(r,tt(i)):i.rowSelection,l=[];return i.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),i.originalDataArray.forEach(s=>{let c=i.toPrimaryKey(s);a.isRowSelected(c)&&l.push(c)}),l}}}var _l=new WeakMap,kT=o=>o;function jp(o,e=50,t){_l.set(o,{lastCallTime:0,lastCallArg:null});let n=t??kT;return r=>{let{lastCallTime:i,lastCallArg:a}=_l.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=Tt(n(a),n(r));s<e&&c||(_l.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var Ti=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new J;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let n=this.nodePathsToData.get(e);if(n){let r=t.getNodeChildren?t.getNodeChildren(n):t.nodesKey?n[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,n)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!n)return;let r=n.getNodeChildren?n.getNodeChildren(t):n.nodesKey?t[n.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,n.toPrimaryKey(l)];this.addNodePath(s,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:n,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),e=[]);let c=n&&!n.isEmpty();if(c&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let u=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,p=u.length;d<p;d++){let f=u[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}n?.removeInfo(void 0)}}else{let u=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];c&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let h=r(m),b=s?[...p,h]:void 0,T=s&&!!b,C=T?n?.getMutationsForNodePath(b):n?.getMutationsForPrimaryKey(h);if(C&&C.length){for(let S=0,y=C.length;S<y;S++){let I=C[S];if(I.type==="delete"&&!g&&(T?this.removeNodePath(b,t):this.remove(h),g=!0,d.splice(f,1),f--),I.type==="update"&&!g&&(m={...m,...I.data},d[f]=m),I.type==="update-children"&&!g){let w=I.children(m[l],m);m={...m},w!==void 0?m[l]=w:delete m[l],d[f]=m}I.type==="insert"&&(I.position==="before"?(d.splice(f,0,I.data),f--):d.splice(f+1,0,I.data))}T?n?.removeNodePathInfo(b):n?.removeInfo(h)}if(!g)if(T){this.addNodePath(b,m);let S=a(m),y=S?null:i(m);!S&&Array.isArray(y)&&(p.push(h),c&&(m[l]=y=y.concat()),u(y,p),p.pop())}else this.add(h,m)}}};u(e,[])}return e}}};import{useEffect as bo,useMemo as lf,useRef as Di,useState as YT}from"react";import{useEffect as $p,useLayoutEffect as zT,useRef as fo}from"react";function mo(o,e){let t=fo({}),n=fo({}),r=n.current,i=fo({}),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,$p(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function tN(o,e){let t=fo({}),n=fo({}),r=n.current,i=fo({}),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,zT(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function nN(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);$p(o,t)}function Fl(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function Ol(o){let{pivotByAtIndex:e,pivotAggregator:t}=o;return e?.column&&(typeof e.column=="function"?Object.assign(o,e.column({column:o})):Object.assign(o,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(o,t.pivotColumn({column:o})):Object.assign(o,t.pivotColumn)),o}function Nl(o){let{pivotByAtIndex:e}=o;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(o,e.columnGroup({columnGroup:o})):Object.assign(o,e.columnGroup)),o}function Up({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...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={},c={},u=Qe(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Ol({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||n==="start")&&u();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let b=e[m.length-1],C=m.slice(0,-1).join("/");if(!d){let S=C;C=m.join("/");let y=m[m.length-1];c[C]=Nl({header:`${y}`,columnGroup:S,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:b,pivotIndex:m.length-1,pivotGroupKey:y})}l.forEach((S,y)=>{let I=d?`${m[m.length-1]}`:S.name||S.id,w=Ol({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:S,pivotAggregatorIndex:y,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:b,defaultSortable:!1,columnGroup:C,header:I,valueFormatter:({rowInfo:R})=>R.isGroupRow?R.pivotValuesMap?.get(m)?.reducerResults[S.id]:null}),v=`${S.id}:${m.join("/")}`;s[v]=w})}else{let b=m.join("/"),T=m.slice(0,-1);if(c[b]=Nl({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 C=e[m.length-1],S=T.length?T.join("/"):void 0;if(!d){let y=S;S=`total:${m.join("/")}`,c[S]=Nl({header:`${m[m.length-1]} total`,columnGroup:y,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:C,pivotGroupKey:m[m.length-1]})}l.forEach((y,I)=>{let w=d?`${m[m.length-1]} total `:`${y.name||y.id} total`,v=Ol({columnGroup:S,header:w,pivotAggregator:y,pivotAggregatorIndex:I,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:C,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:R})=>R.isGroupRow?R.pivotValuesMap?.get(m)?.reducerResults[y.id]:null});s[`total:${y.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||n==="end")&&u(),{columns:s,columnGroups:c}}var Yp=Symbol("CLEAR"),Vn=class o{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new J;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.deleteNodePath=(e,t,n)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:n}),this.nodePathToData.set(e,r)};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.insertNodePath=(e,t,n,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:n,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:n,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,n,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Yp,n=this.primaryKeyToData.get(t)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Yp);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>J.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let n=new o({nodesKey:e.nodesKey});return n.allFieldsAffected=e.allFieldsAffected,n.affectedFields=new Set(e.affectedFields),n.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),n.nodePathToData=t?e.nodePathToData:J.clone(e.nodePathToData),n}};function mn(o,e){return e().dataArray[o]}function Ci(o){return o().dataArray}var nt=class{constructor(e){this.collapsedPathsMap=new J;this.expandedPathsMap=new J;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:n,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?n.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?n.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,n=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(n)for(let r=0,i=n.length;r<i;r++)this.collapsedIdsMap.set(n[r],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var VT=(o,e)=>o.length-e.length,ot=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new J;this.cache=new J;let n=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.setConfigFn(t),this.update(n)}getTreeDeepMap(){return this.getConfig().treeDeepMap}isLeafNode(e){return!this.getTreeDeepMap().has(e)}getLeafNodesCount(e){let n=this.getTreeDeepMap().get(e);return n?n.items.length:1}static from(e,t){return new o(e,t)}setConfigFn(e){this.getConfig=e,this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:n,deselectedPaths:r}=this;t.clear(),n?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([n,r])=>{r?e.push(n):t.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let n=this.cache.get(e);if(n)return n;if(this.isLeafNode(e)){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getUnnestedKeysStartingWith(e,!0).sort(VT);if(!l.length){if(i!==null){let p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(u?(s-=g,c+=g):(c-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.getSelectionStateForNode(e,!0).selected}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:n}=this;if(!e.length)return t;let r=[...e];do{let i=n.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:n}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:n}}destroy(){this.getConfig=null,this.xcache(),this.selectionMap.clear()}};function wi(o,e){return new ot(o,go(e))}function go(o){return()=>({treeDeepMap:(typeof o=="function"?o():o).treeDeepMap})}var Si=class{constructor(e){this.setNodeSelection=(e,t,n)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!n?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof ot))throw"Invalid tree selection";let a=new ot(r,go(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current=e,this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&n?n(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeSelectable;return t&&t.isTreeNode?n(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:n,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!n(a,i);if(n)return n(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new nt({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new nt({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new nt(n.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,n.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new nt(n.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,n.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let n=this.getState(),r=new nt(n.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?n.onNodeExpand?.(e,this.getCallbackParam(e)):n.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){let{treeDeepMap:t}=this.getState();if(!t||!e.length)return null;let n=this.getRowInfoByPath(e);return n?n.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),n=t.get(e);return n!==void 0?mn(n,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof ot))throw"Invalid node selection";let n=new ot(e,go(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof ot))throw"Invalid node selection";let n=new ot(e,go(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(e){let{treeSelectionState:t,treeSelection:n,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(n)?treeSelection.join(",")===e.join(","):n===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof ot))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};var ho=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(){this.positiveMap?.clear(),this.negativeMap?.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){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var gt=class extends ho{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:n}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,n){return this.setItemValue(t,n)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var Ll=1e3;function qp(o){return new kl(o)}var kl=class{constructor(e){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>Ci(this.getState);this.getRowInfoByIndex=e=>mn(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),n=t.getDataForNodePath(e);return n||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let n=this.getState().isTree,r=n?void 0:e.map(l=>this.toPrimaryKey(l)),i=n?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,n)=>{let r=n?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Ll:r;return isNaN(a)||(a=Ll),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,n)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,n),n);this.updateChildrenByNodePath_Internal=(e,t,n)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],n)};this.updateDataByNodePath=(e,t,n)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n),n);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let n=e.map(i=>i.nodePath);return Promise.allSettled(n.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let n=[],r=[];e.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:n,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let n=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),n};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let n=this.getState().isTree,r="before",i,a=t.nodePath;if(n&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let c=u=>t.position==="start"?[...e,...u||[]]:[...u||[],...e];return this.updateChildrenByNodePath(c,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=n?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,n,r)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let n=this.getState().rowDisabledState,r=n?new gt(n):new gt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let n=this.getRowInfoByPrimaryKey(e);n&&this.setRowEnabledAt(n.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new gt({enabledRows:!0,disabledRows:[]});return}let t=new gt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new gt({disabledRows:!0,enabledRows:[]});return}let t=new gt(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new Si({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:n,nodesKey:r}=this.getState(),i=t?Vn.clone(t,{light:!0}):new Vn({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],u,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,p,a.metadata):i.updateNodePath(a.nodePaths[d],u,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let n=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Ll,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=p=>{clearTimeout(d),u=p,n.waitForNodePathPromises.delete(e),c(p)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return n.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function Xp(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:p,isTree:f}=o;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((h,b)=>h||typeof b!="function"?l.has(b):!1,!1),t))break}if(c&&c.length){if(l===!0)n=!0;else for(let m of c)if(m.field&&l.has(m.field)){n=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),u&&u.length)if(l===!0)i=!0;else for(let m of u){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:n,filterValue:i,aggregationReducers:a,tree:r}}function vi(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 Ii(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 Ri(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 Vl(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var Nt=(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 zl(){return!1}function GT(o,e,t,n,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:zl,hasSelectedCells:zl};return n&&(a.rowSelected=n(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var HT=Qe(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
2
2
|
|
|
3
3
|
Your filtering function probably looks like this:
|
|
4
4
|
|
|
@@ -10,21 +10,21 @@ function treeFilterFunction({ data }) {
|
|
|
10
10
|
|
|
11
11
|
Make sure you avoid mutations.
|
|
12
12
|
|
|
13
|
-
`)});function
|
|
13
|
+
`)});function Zp(o){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:n,getNodeChildren:r,isLeafNode:i,nodesKey:a}=o,l=[],s=c=>{let u=r(c);if(i(c)||!Array.isArray(u))return c;let d=Zp({...o,dataArray:u});return d.length===0?!1:(c={...c,[a]:d},c)};for(let c=0,u=e.length;c<u;c++){let d=e[c],p=r(d),f=t({data:d,index:c,dataArray:e,primaryKey:n(d,c),filterTreeNode:s});f&&(f===!0?f=d:typeof f=="object"&&f===d&&p!==r(f)&&HT(),l.push(f))}return l}function Qp(o){let{filterTypes:e,operatorsByFilterType:t,filterFunction:n,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=o,{dataArray:c}=o;n&&(c=c.filter((d,p,f)=>n({data:d,index:p,dataArray:f,primaryKey:r(d,p)}))),i&&(c=Zp({...o,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}));let u=Vl(o.filterValue,e)||[];return u&&u.length?c.filter((d,p,f)=>{let m={data:d,index:p,dataArray:f,primaryKey:r(d,p),field:void 0};for(let g=0,h=u.length;g<h;g++){let b=u[g],{disabled:T,field:C,valueGetter:S,filter:{type:y,value:I,operator:w}}=b,v=e[y];if(T||!v)continue;let R=t[y]?.[w];if(!R)continue;let D=S||v.valueGetter||(({data:A,field:E})=>E?A[E]:A);m.field=C;let M=m;if(M.filterValue=I,M.currentValue=D(M),M.emptyValues=v.emptyValues,!R.fn(M))return!1}return!0}):c}function Jp(o){let{state:e,previousState:t}=o,n=Xp(e),r=e.sortInfo,i=e.sortMode,a=r?.length?i==="local":!1;(e.lazyLoad||e.livePagination)&&(a=!1);let l=Nt(t,e,["refetchKey"]),s=Nt(t,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&l&&(s=!0),!1&&(e.originalLazyGroupData=new J,s=!0);let u=e.cache?Vn.clone(e.cache):void 0;u&&!u.isEmpty()&&(s=!0);let d=e.toPrimaryKey,p=e.nodesKey,f=e.isTree,m=p?K=>K[p]:void 0,g=p?K=>K[p]===void 0:void 0,h,b;s&&(e.indexer.clear(),e.lazyLoad||(h=u?.getMutations(),b=u?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:d,cache:u,getNodeChildren:m,isLeafNode:g,nodesKey:p}),f&&e.waitForNodePathPromises.visit(({value:K},ee)=>{K&&e.indexer.getDataForNodePath(ee)!==void 0&&K.resolve(!0)}))),u&&(u.clear(),e.cache=void 0);let{filterFunction:C,treeFilterFunction:S,filterValue:y,filterTypes:I,operatorsByFilterType:w}=e,v=!!C||!!S||Array.isArray(y)&&y.length,R=v&&e.filterMode==="local",x=Nt(t,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),D=s||x,M=Nt(t,e,["sortInfo"]),A=s||x||M,E=e.filterMode==="local"&&(D||!e.lastFilterDataArray),_=a&&(A||!e.lastSortDataArray||n.sortInfo),P=e.groupBy,F=e.pivotBy,N=!f&&(P.length>0||!!F),G=f,H=Nt(t,e,["rowDisabledState","isRowDisabled"]),B=Nt(t,e,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),pe=Nt(t,e,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),de=s||A||Nt(t,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),k=s||A||Nt(t,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),W=Nt(t,e,["rowInfoReducers"]),se=N&&(de||!e.lastGroupDataArray||n.groupBy)||B||H||W,ce=G&&(k||n.tree||!e.lastTreeDataArray)||pe||H||W,ie=Date.now(),oe=e.originalDataArray;if(v||(e.unfilteredCount=oe.length),R){e.unfilteredCount=oe.length;let K=ie;E?(e.devToolsDetected&&(K=Date.now()),oe=Qp({getNodeChildren:m,isLeafNode:g,nodesKey:p,treeFilterFunction:S,dataArray:oe,toPrimaryKey:d,filterTypes:I,operatorsByFilterType:w,filterFunction:C,filterValue:y}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-K)):oe=e.lastFilterDataArray,e.lastFilterDataArray=oe,e.filteredAt=ie}if(e.filteredCount=oe.length,e.postFilterDataArray=oe,a){let K=Wt.knownTypes;if(Wt.knownTypes={...K,...e.sortTypes},_){let ee=ie;if(e.devToolsDetected&&(ee=Date.now()),e.sortFunction?oe=e.sortFunction(r,[...oe]):f?oe=Al(r,oe,{inplace:!1,isLeafNode:g,getNodeChildren:m,toKey:d,nodesKey:p}):oe=Wt(r,[...oe]),e.devToolsDetected){let Y=Date.now()-ee;e.debugTimings.set("sort",Y)}}else oe=e.lastSortDataArray;Wt.knownTypes=K,e.lastSortDataArray=oe,e.sortedAt=ie}e.postSortDataArray=oe;let te=e.dataArray,fe=e.rowSelection instanceof xe?e.rowSelection:void 0,ne=e.treeExpandState instanceof nt?e.treeExpandState:void 0,V=e.cellSelection instanceof ze?e.cellSelection:void 0;fe?.xcache();let U=e.selectionMode==="single-row"?K=>K.id===e.rowSelection:e.selectionMode==="multi-row"?K=>{let ee=fe;return K.isGroupRow?ee.getGroupRowSelectionState(K.groupKeys):ee.isRowSelected(K.id,K.dataSourceHasGrouping?K.groupKeys:void 0)}:void 0,O=e.isRowDisabled||zl;e.isRowSelected&&e.selectionMode==="multi-row"&&(U=K=>e.isRowSelected(K,fe,e.selectionMode));let re;e.isNodeExpanded&&(re=K=>e.isNodeExpanded(K,ne)),e.isNodeCollapsed&&(re=K=>!e.isNodeExpanded(K,ne)),re||(re=ee=>ne.isNodeExpanded(ee.nodePath));let j=e.rowInfoReducers;if(N){if(se){let K=ie;e.devToolsDetected&&(K=Date.now());let ee=e.aggregationReducers,Y=e.lazyLoad?Ep({groupBy:P,pivot:F,mappings:e.pivotMappings,reducers:ee,indexer:e.indexer,toPrimaryKey:d,cache:u},e.originalLazyGroupData):Ml({groupBy:P,pivot:F,reducers:ee},oe);e.groupDeepMap=Y.deepMap,fe&&(fe.getConfig=tt(e));let le=Object.keys(j||{}),me=vi(j),Ve={reducers:j,results:me,reducerKeys:le,rowInfo:{}},Ee=me?We=>{Ve.rowInfo=We,Ii(Ve)}:void 0,Ge=V?We=>{We.isCellSelected=bt=>V.isCellSelected(We.id,bt)}:void 0,Ue=Ee||Ge?Fl(Ee,Ge):void 0,Le=Op({groupResult:Y,lazyLoad:!!e.lazyLoad,reducers:ee,toPrimaryKey:d,isRowSelected:U,rowSelectionState:fe,withRowInfo:Ue,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});te=Le.data,e.rowInfoReducerResults=Ri({reducers:j,results:me,array:te}),e.groupRowsIndexesInDataArray=Le.groupRowsIndexes,e.reducerResults=Y.reducerResults;let Ye=F?Up({deepMap:Y.topLevelPivotColumns,pivotBy:F,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=Ye?.columns,e.pivotColumnGroups=Ye?.columnGroups,e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-K)}else te=e.lastGroupDataArray;e.lastGroupDataArray=te,e.groupedAt=ie}else if(G){if(ce){let K=ie;e.devToolsDetected&&(K=Date.now());let ee=e.aggregationReducers,Y={isLeafNode:g,getNodeChildren:m,toKey:d,reducers:ee},le=Ap(Y,oe);e.treeDeepMap=le.deepMap,e.treePaths=le.treePaths;let me=e.selectionMode==="multi-row"?ef(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=me;let Ve=Object.keys(j||{}),Ee=vi(j),Ge={reducers:j,results:Ee,reducerKeys:Ve,rowInfo:{}},Ue=Ee?st=>{Ge.rowInfo=st,Ii(Ge)}:void 0,Le=V?st=>{st.isCellSelected=z=>V.isCellSelected(st.id,z)}:void 0,Ye=Ue||Le?Fl(Ue,Le):void 0,We=e.selectionMode==="single-row"?st=>st.id===e.treeSelection:e.selectionMode==="multi-row"?st=>me.isNodeSelected(st.nodePath):void 0,bt=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;te=Fp({treeResult:le,treeParams:Y,dataArray:oe,reducers:ee,toPrimaryKey:d,isNodeSelected:We,isNodeExpanded:re,treeSelectionState:me,withRowInfo:Ye,repeatWrappedGroupRows:bt,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=Ri({reducers:j,results:Ee,array:te}),e.reducerResults=le.reducerResults,e.totalLeafNodesCount=le.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=ie,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-K)}else te=e.lastTreeDataArray;e.lastTreeDataArray=te}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,t.postSortDataArray!=e.postSortDataArray||de||B||H||W){let ee=Object.keys(j||{}),Y=vi(j),le={reducers:j,results:Y,reducerKeys:ee,rowInfo:{}};te=oe.map((me,Ve)=>{let Ee=GT(me,me?d(me):Ve,Ve,U,O,V);return Y&&(le.rowInfo=Ee,Ii(le)),Ee}),e.rowInfoReducerResults=Ri({reducers:j,results:Y,array:te})}if(e.postGroupDataArray=te,te!==e.dataArray&&(e.updatedAt=ie),e.dataArray=te,e.reducedAt=ie,e.selectionMode==="multi-row")if(N&&e.lazyLoad){let K=!0,ee=!1;e.dataArray.forEach(Y=>{if(!Y.isTreeNode&&Y.isGroupRow&&Y.groupKeys.length===1){let{rowSelected:le}=Y;le!==!0&&(K=!1),(le===!0||le===null)&&(ee=!0)}}),e.allRowsSelected=K,e.someRowsSelected=ee}else{let K=e.isTree?e.totalLeafNodesCount:e.filteredCount,ee=e.isTree?e.treeSelectionState?e.treeSelectionState.getSelectedCount():0:e.rowSelection.getSelectedCount();e.allRowsSelected=K===ee,e.someRowsSelected=ee>0}return e.originalDataArrayChanged=s,s&&(e.originalDataArrayChangedInfo={timestamp:ie,mutations:h?.size?h:void 0,treeMutations:b?.size?b:void 0}),e}function xt(){let o=we().performance?.now();return`${Date.now()}:${o}`}function KT(o,e,t){return e=e.replaceAll("$ERR_CODE",o),e=`${e}
|
|
14
14
|
|
|
15
|
-
ERROR_CODE = ${
|
|
15
|
+
ERROR_CODE = ${o}
|
|
16
16
|
|
|
17
|
-
See http://infinite-table.com/docs/reference/error-codes#${
|
|
18
|
-
Make sure you don't pass a new reference on every render.`})
|
|
17
|
+
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:e,type:t??"error"}}function tf(o){return Object.entries(o).reduce((e,[t,n])=>{let r=t,i=KT(r,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return e[r]=i,e},{})}function BT(o){return{message:o.join(""),type:"warning"}}function WT(o){return{message:o.join(""),type:"error"}}var jT=tf({DS001:BT`The "data" prop of your DataSource seems to be updating too frequently.
|
|
18
|
+
Make sure you don't pass a new reference on every render.`}),$T=tf({CSS001_CSS:WT`It appears you have not loaded the CSS file for InfiniteTable.
|
|
19
19
|
In most environments, you should be able to fix this by adding the following line:
|
|
20
20
|
|
|
21
21
|
import '@infinite-table/infinite-react/index.css'
|
|
22
|
-
`}),
|
|
22
|
+
`}),nf={...jT,...$T};var jt=new Map,$t=new Map,gn=new Map,Ut=new Map;var Ct=new Map,of=o=>{Ct.delete(o),gn.delete(o),jt.delete(o),Ut.delete(o),$t.delete(o)};function Gl(o,e,t){let n=Ct.get(o);if(!n)return;let r=gn.get(o);(!r||!Object.hasOwn(r,e))&&gn.set(o,{...r||{},[e]:n.getState()[e]}),jt.set(o,{...jt.get(o)||{},[e]:t}),n.actions[e]=t}function xi(o,e,t){let n=Ct.get(o);if(!n)return;let r=Ut.get(o);(!r||!Object.hasOwn(r,e))&&Ut.set(o,{...r||{},[e]:n.getDataSourceState()[e]}),$t.set(o,{...$t.get(o)||{},[e]:t}),n.dataSourceActions[e]=t}var UT=o=>{let e=o.type==="error"?Qt(o.debugId):ut(o.debugId),t=o.type==="error"?Bp:po,n=o.debugId?`${o.code}-${o.debugId}`:o.code,r=o.message;o.debugId&&(r=`${r}
|
|
23
23
|
|
|
24
|
-
Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},Nn=n=>{let{debugId:e,key:t}=n,o=op[t];if(o&&(wC({...o,debugId:e}),e&&t)){let r=ft.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),Ln(e))}};globalThis.logDevToolsWarning=Nn;var Ln=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=ft.get(n);t&&e(n,t)};var rp=!0,xC=()=>new Promise(n=>{ve(n)}),DC={originalDataArray:!0,changes:!0},vC={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function Gt(n,e,t){let o=n.multiSort?n.sortInfo:n.sortInfo?.[0]??null,r={append:!1,originalDataArray:n.originalDataArray,sortInfo:o,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(r.livePaginationCursor=n.livePaginationCursor,r.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=n.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=lp(r.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=n.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!DC[l]){let s=l,u=vC[s],c=r[s],d=a[s];(u?u(c,d):c===d)||(i[s]=!0)}return r.changes=i,r}function bo(n,e,t,o,r){let i=Gt(e,o,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,u=[Zt,...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:rp,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=Ct()}typeof n=="function"&&(n=n(i));let l=typeof n=="object"&&typeof n.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(n).then(s=>{let 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){let C=[Zt,...h],S=g.data,b={cache:g.cache??rp,childrenLoading:!1,childrenAvailable:!0,totalCount:g.totalCount??S.length,totalCountUnfiltered:g.totalCount??S.length,children:S,error:g.error},T=[];if(i.lazyLoadBatchSize&&!y){let R=f.get(C),w=!R,P=Qu({children:!0},R||{},b);w&&(P.chidren=[]),P.children.length=P.totalCount;let x=i.lazyLoadStartIndex??0,D=Math.min(g.totalCount??S.length,x+i.lazyLoadBatchSize);for(let A=x;A<D;A++){let _=b.children[A-x];if(!_)throw`lazily loaded item not found at index ${A-x}`;P.children[A]=_,_.dataset&&T.push({keys:_.keys,dataset:_.dataset})}w&&f.set(C,P)}else b.children.forEach(R=>{R&&R.dataset&&T.push({keys:R.keys,dataset:R.dataset})}),b.children.length=b.totalCount,f.set(C,b);let I=!1;if(!h||!h.length){let R=f.get([Zt]);t.originalDataArray=[...R.children],I=!0}if(I||(t.originalLazyGroupDataChangeDetect=Ct()),T.length){let R=h;T.forEach(({keys:w,dataset:P})=>{m(w,P,R)})}};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||e.lazyLoad&&!a)&&(t.loading=!1)})}function lp(n,{filterTypes:e,filterMode:t}){return t==="local"?n:(al(n,e)||[]).map(o=>{let r={...o};return delete r.valueGetter,r})}function ip(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function sp(n){let{getComponentState:e,componentActions:t,componentState:o}=n,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:u,groupBy:c,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:h,filterTypes:g,cursorId:y}=o,[C,S]=PC({vertical:!1,horizontal:!1}),b=ai(C);$o(()=>(a.onChange(x=>{x&&(b.current=x,S(x))}),()=>a.destroy()),[a]),$o(()=>{if(!m)return;let x=requestAnimationFrame(()=>{b.current?.vertical||h&&(t.cursorId=h)});return()=>cancelAnimationFrame(x)},[h]),$o(()=>{if(!m||h!==void 0)return;let x=requestAnimationFrame(()=>{b.current?.vertical||y!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(x)},[i.length,h]),$o(()=>{let x=e(),{livePaginationCursor:D,livePagination:A,dataArray:_}=x;!C.vertical&&A&&(D?t.cursorId=D:D===void 0&&_.length&&(t.cursorId=_.length))},[C.vertical]);let T=ap(()=>lp(p,{filterTypes:g,filterMode:f}),[p,f,g]),I={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?T:null,cursorId:m?y:null},R=ai(!0);AC(n,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?y:null});let w=_e(Le()),P=ai([]);ko(()=>{let x=e(),D=w(),{isDetail:A,isDetailReady:_}=ip(D,e);if(A&&!_)return;let E=Date.now(),F=P.current;F.length>=10&&F.splice(0,1),F.push(E),E-F[0]<200&&F.length>=10&&Nn({debugId:x.debugId,key:"DS001"}),typeof x.data!="function"&&bo(x.data,x,t,void 0,D)},{data:r}),ko(x=>{let D=Object.keys(x),A=!1;if(D.length===1){if(A=!!x.cursorId,x.filterValue&&e().filterMode==="local")return;let M=e().data;if(Array.isArray(M)&&x.refetchKey){t.originalDataArray=M;return}}let _=w(),{isDetail:E,isDetailReady:F}=ip(_,e);if(E&&!F)return;let v=e();typeof v.data=="function"&&bo(v.data,v,t,{append:A},_)},{...I,data:r}),ko(()=>{let x=e();if(R.current){R.current=!1;let D=Gt(x,void 0,w());t.dataParams=D}},I)}function AC(n,e){let{getComponentState:t,componentActions:o,componentState:r}=n;$o(()=>{o.lazyLoadCacheOfLoadedBatches=new q},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:u,groupRowsState:c,scrollStopDelayUpdatedByTable:d}=r,p=ai(null),f=(h,g,y=t().lazyLoadCacheOfLoadedBatches)=>{let C=t();if(h=h||p.current,!h)return;let{renderStartIndex:S,renderEndIndex:b}=h,{lazyLoadBatchSize:T,lazyLoad:I}=C;I&&((!T||T<=0)&&(!C.groupBy||C.groupBy.length===0)||EC({startIndex:S,endIndex:b,lazyLoadBatchSize:T,componentState:C,componentActions:o,dismissLoadedRows:g?.dismissLoadedRows??!1},y))},m=ap(()=>Dt(f,{wait:d}),[d]);ko(h=>{if(a)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),f(s.get(),{dismissLoadedRows:!0})):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&f(s.get()),s.onChange(g=>{p.current=g,f(g)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,groupRowsState:c}),$o(()=>{i&&i>0&&m()},[u])}function EC(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,u=l?()=>!1:h=>s[h].data!=null,c=!l,d=new q,p=["_______xxx______"];for(let h=t;h<=o;h++){let g=s[h];if(!g)continue;let y=u(h),C=g.dataSourceHasGrouping&&g.groupKeys?[...g.groupKeys]:[];g.isGroupRow&&g.dataSourceHasGrouping&&g.groupKeys&&C.pop();let S=C.length?C:p,b=g.dataSourceHasGrouping?g.indexInGroup:g.indexInAll;if(g.isGroupRow&&!g.collapsed&&!g.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:g.groupKeys,append:c},I=g.groupKeys,R=d.get(I);if(!R?.[g.id]){let w=!R;R=R||{},R[g.id]||(R[g.id]=T),w&&d.set(I,R)}}if(!y&&r!=null){let T=d.get(S),I=Math.floor(b/r)*r,R=b-I,w=s[g.indexInAll-R].indexInAll,P=u(w),x=s[w].id;if(P||T?.[x])continue;let D=!T;T=T||{};let A={lazyLoadStartIndex:I,lazyLoadBatchSize:r,groupKeys:C,append:c};T[x]||(T[x]=A),D&&d.set(S,T)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(h=>{m.push(...Object.values(h))}),m.reduce((h,g)=>{let y=[...g.groupKeys,g.lazyLoadStartIndex];if(e&&e.has(y))return h;e?.set(y,!0);let C=[i.data,i,a,g];return h.then(()=>xC()).then(()=>bo(...C))},f)}var MC=Object.freeze([]),up=(n,e)=>{let t=n??MC,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};var _C=Symbol("cursorId"),cp=n=>n.totalLeafNodesCount===0,FC=n=>n.isParentNode?!cp(n):!0;function dp(n){let e=Date.now(),t=[],o=[],r=new q;return{logger:rt(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,indexer:new Qr,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new q,waitForNodePathPromises:new q,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new q,dataParams:void 0,onCleanup:pe(),notifyScrollbarsChange:pe(),notifyScrollStop:pe(),notifyRenderRangeChange:pe(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:_C,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:o,unfilteredCount:o.length,filteredCount:o.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function OC(n){let e={...n};return delete e.originalDataArray,e}var NC=[],pp=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear()},fp=(n,e)=>({onDataParamsChange:t=>t?$d(t,100,OC):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??cp,isNodeSelectable:t=>t??FC,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,filterDelay:t=>t??200,filterTypes:t=>({...po,...t}),sortTypes:t=>({...On,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugId&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof ut)return t;let o=n.propsCache.get("rowDisabledState")??Tt,r=o.get(t);return r||(r=new ut(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>up(t,n.propsCache.get("sortInfo")),groupBy:t=>t??NC});function LC(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}var Tt=new WeakMap;function VC(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var zC={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function ep(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
24
|
+
Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},tr=o=>{let{debugId:e,key:t}=o,n=nf[t];if(n&&(UT({...n,debugId:e}),e&&t)){let r=Ct.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),nr(e))}};globalThis.logDevToolsWarning=tr;var nr=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=Ct.get(o);t&&e(o,t)};var rf=!0,qT=()=>new Promise(o=>{Ae(o)}),XT={originalDataArray:!0,changes:!0},ZT={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function Yt(o,e,t){let n=o.multiSort?o.sortInfo:o.sortInfo?.[0]??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 l=sf(r.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=o.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!XT[l]){let s=l,c=ZT[s],u=r[s],d=a[s];(c?c(u,d):u===d)||(i[s]=!0)}return r.changes=i,r}function Gn(o,e,t,n,r){let i=Yt(e,n,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,c=[fn,...i.groupKeys||[]],u=s.get(c);if(!u){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(u&&u.cache&&c.length>1){let d=u.children,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)}u?u.childrenLoading||(u.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:rf,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=xt()}typeof o=="function"&&(o=o(i));let l=typeof o=="object"&&typeof o.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(o).then(s=>{let c=[],u=!1;if(Array.isArray(s.data)){let p=s;if(c=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(g,h,b){let T=[fn,...g],C=h.data,S={cache:h.cache??rf,childrenLoading:!1,childrenAvailable:!0,totalCount:h.totalCount??C.length,totalCountUnfiltered:h.totalCount??C.length,children:C,error:h.error},y=[];if(i.lazyLoadBatchSize&&!b){let w=f.get(T),v=!w,R=Au({children:!0},w||{},S);v&&(R.chidren=[]),R.children.length=R.totalCount;let x=i.lazyLoadStartIndex??0,D=Math.min(h.totalCount??C.length,x+i.lazyLoadBatchSize);for(let M=x;M<D;M++){let A=S.children[M-x];if(!A)throw`lazily loaded item not found at index ${M-x}`;R.children[M]=A,A.dataset&&y.push({keys:A.keys,dataset:A.dataset})}v&&f.set(T,R)}else S.children.forEach(w=>{w&&w.dataset&&y.push({keys:w.keys,dataset:w.dataset})}),S.children.length=S.totalCount,f.set(T,S);let I=!1;if(!g||!g.length){let w=f.get([fn]);t.originalDataArray=[...w.children],I=!0}if(I||(t.originalLazyGroupDataChangeDetect=xt()),y.length){let w=g;y.forEach(({keys:v,dataset:R})=>{m(v,R,w)})}};var d=m;let f=e.originalLazyGroupData;u=!0,m(i.groupKeys||[],p)}}else c=s;u||(t.originalDataArray=a?e.originalDataArray.concat(c):c),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function sf(o,{filterTypes:e,filterMode:t}){return t==="local"?o:(Vl(o,e)||[]).map(n=>{let r={...n};return delete r.valueGetter,r})}function af(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function cf(o){let{getComponentState:e,componentActions:t,componentState:n}=o,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:h,cursorId:b}=n,[T,C]=YT({vertical:!1,horizontal:!1}),S=Di(T);bo(()=>(a.onChange(x=>{x&&(S.current=x,C(x))}),()=>a.destroy()),[a]),bo(()=>{if(!m)return;let x=requestAnimationFrame(()=>{S.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(x)},[g]),bo(()=>{if(!m||g!==void 0)return;let x=requestAnimationFrame(()=>{S.current?.vertical||b!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(x)},[i.length,g]),bo(()=>{let x=e(),{livePaginationCursor:D,livePagination:M,dataArray:A}=x;!T.vertical&&M&&(D?t.cursorId=D:D===void 0&&A.length&&(t.cursorId=A.length))},[T.vertical]);let y=lf(()=>sf(p,{filterTypes:h,filterMode:f}),[p,f,h]),I={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?y:null,cursorId:m?b:null},w=Di(!0);QT(o,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?b:null});let v=Ie(ke()),R=Di([]);mo(()=>{let x=e(),D=v(),{isDetail:M,isDetailReady:A}=af(D,e);if(M&&!A)return;let E=Date.now(),_=R.current;_.length>=10&&_.splice(0,1),_.push(E),E-_[0]<200&&_.length>=10&&tr({debugId:x.debugId,key:"DS001"}),typeof x.data!="function"&&Gn(x.data,x,t,void 0,D)},{data:r}),mo(x=>{let D=Object.keys(x),M=!1;if(D.length===1){if(M=!!x.cursorId,x.filterValue&&e().filterMode==="local")return;let F=e().data;if(Array.isArray(F)&&x.refetchKey){t.originalDataArray=F;return}}let A=v(),{isDetail:E,isDetailReady:_}=af(A,e);if(E&&!_)return;let P=e();typeof P.data=="function"&&Gn(P.data,P,t,{append:M},A)},{...I,data:r}),mo(()=>{let x=e();if(w.current){w.current=!1;let D=Yt(x,void 0,v());t.dataParams=D}},I)}function QT(o,e){let{getComponentState:t,componentActions:n,componentState:r}=o;bo(()=>{n.lazyLoadCacheOfLoadedBatches=new J},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:c,groupRowsState:u,scrollStopDelayUpdatedByTable:d}=r,p=Di(null),f=(g,h,b=t().lazyLoadCacheOfLoadedBatches)=>{let T=t();if(g=g||p.current,!g)return;let{renderStartIndex:C,renderEndIndex:S}=g,{lazyLoadBatchSize:y,lazyLoad:I}=T;I&&((!y||y<=0)&&(!T.groupBy||T.groupBy.length===0)||JT({startIndex:C,endIndex:S,lazyLoadBatchSize:y,componentState:T,componentActions:n,dismissLoadedRows:h?.dismissLoadedRows??!1},b))},m=lf(()=>zt(f,{wait:d}),[d]);mo(g=>{if(a)return g.sortInfo||g.filterValue||g.groupBy||g.pivotBy||g.refetchKey||g.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),f(s.get(),{dismissLoadedRows:!0})):(g.originalLazyGroupDataChangeDetect||g.groupRowsState)&&f(s.get()),s.onChange(h=>{p.current=h,f(h)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,groupRowsState:u}),bo(()=>{i&&i>0&&m()},[c])}function JT(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=o,{dataArray:s}=i,c=l?()=>!1:g=>s[g].data!=null,u=!l,d=new J,p=["_______xxx______"];for(let g=t;g<=n;g++){let h=s[g];if(!h)continue;let b=c(g),T=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&T.pop();let C=T.length?T:p,S=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let y={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:u},I=h.groupKeys,w=d.get(I);if(!w?.[h.id]){let v=!w;w=w||{},w[h.id]||(w[h.id]=y),v&&d.set(I,w)}}if(!b&&r!=null){let y=d.get(C),I=Math.floor(S/r)*r,w=S-I,v=s[h.indexInAll-w].indexInAll,R=c(v),x=s[v].id;if(R||y?.[x])continue;let D=!y;y=y||{};let M={lazyLoadStartIndex:I,lazyLoadBatchSize:r,groupKeys:T,append:u};y[x]||(y[x]=M),D&&d.set(C,y)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,h)=>{let b=[...h.groupKeys,h.lazyLoadStartIndex];if(e&&e.has(b))return g;e?.set(b,!0);let T=[i.data,i,a,h];return g.then(()=>qT()).then(()=>Gn(...T))},f)}var eC=Object.freeze([]),uf=(o,e)=>{let t=o??eC,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 tC=Symbol("cursorId"),df=o=>o.totalLeafNodesCount===0,nC=o=>o.isParentNode?!df(o):!0;function pf(o){let e=Date.now(),t=[],n=[],r=new J;return{logger:ut(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,indexer:new Ti,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new J,waitForNodePathPromises:new J,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new J,dataParams:void 0,onCleanup:ge(),notifyScrollbarsChange:ge(),notifyScrollStop:ge(),notifyRenderRangeChange:ge(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:tC,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function oC(o){let e={...o};return delete e.originalDataArray,e}var rC=[],ff=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear()},mf=(o,e)=>({onDataParamsChange:t=>t?jp(t,100,oC):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??df,isNodeSelectable:t=>t??nC,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,filterDelay:t=>t??200,filterTypes:t=>({...xn,...t}),sortTypes:t=>({...er,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,n)=>{let r={initialValue:()=>{n.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&n.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),n.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{n.idToPathMap.clear(),n.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(n.idToPathMap.set(s.id,s.nodePath),e.debugId&&n.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),n.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof gt)return t;let n=o.propsCache.get("rowDisabledState")??Dt,r=n.get(t);return r||(r=new gt(t),n.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>uf(t,o.propsCache.get("sortInfo")),groupBy:t=>t??rC});function iC(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}var Dt=new WeakMap;function aC(o){if(typeof o=="boolean")return{filterValue:o,sortInfo:o,groupBy:o,pivotBy:o};let e={};return o.filterValue!=null&&(e.filterValue=o.filterValue),o.sortInfo!=null&&(e.sortInfo=o.sortInfo),o.groupBy!=null&&(e.groupBy=o.groupBy),o.pivotBy!=null&&(e.pivotBy=o.pivotBy),e}var lC={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function ef(o,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
`);let o=Wo(t);if(n instanceof Be)return n.setConfigFn(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??zC,i=Tt.get(r);return i&&i.setConfigFn(o),i=i??new Be(r,o),Tt.set(r,i),i}function mp(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=Tn(e.sortInfo),a=Tn(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((E,F)=>{let v=l[F].operators;E[F]=E[F]||{};let M=E[F];return v.forEach(N=>{M[N.name]=N}),E},{}),u=e,c=e.selectionMode;if(c===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)c="multi-cell";else{let E=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(E!==void 0&&(E&&typeof E=="object"?c="multi-row":c="single-row"),!c){let F=u.treeSelection??u.defaultTreeSelection;F!==void 0&&(c=typeof F=="object"?"multi-row":"single-row")}c=c??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(c!==!1&&(c==="single-row"||c==="multi-row")&&(f===null?d=c==="single-row"?null:new Se({selectedRows:[],deselectedRows:[],defaultSelection:!1},Xe(t)):c==="single-row"||f instanceof Se?d=f:d=new Se(f,Xe(t))),c==="single-cell"||c==="multi-cell"))if(m===null)p=c==="single-cell"?null:new Ve;else if(m instanceof Ve)p=m;else{let E=Tt.get(m)??new Ve(m);Tt.set(m,E),p=E}let h=t.primaryKey,g=typeof h=="function"?E=>h(E):E=>E[h],y=u.treeExpandState||t.treeExpandState||u.defaultTreeExpandState;if(y&&!(y instanceof Ze)){let E=Tt.get(y)??new Ze(y);Tt.set(y,E),y=E}y=y||new Ze({defaultExpanded:!0,collapsedPaths:[]});let C=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(C&&!(C instanceof st)){let E=Tt.get(C)??new st(C);Tt.set(C,E),C=E}C=C||new st(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=VC(e.shouldReloadData||{}),b=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),T=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,I=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&Bo('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&Bo('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&Bo('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let R=typeof e.data=="function"?b??"local":"local",w=e.sortFunction?"local":T??(i?"remote":"local"),P=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":I??(typeof e.data=="function"?"remote":"local"),x=S.pivotBy?"remote":"local",D=t.rowDisabledState,A=e.isRowDisabled;if(!A&&D){let E=Tt.get(D);E?A=E:(A=F=>D.isRowDisabled(F.id),Tt.set(D,A))}let _={debugId:t.debugId??e.debugId,isTree:r,selectionMode:c,groupRowsState:C,treeExpandState:y,treeExpandMode:y.mode,shouldReloadData:{filterValue:S?.filterValue??P==="remote",sortInfo:S?.sortInfo??w==="remote",groupBy:S?.groupBy??R==="remote",pivotBy:S?.pivotBy??x==="remote"},isRowDisabled:A,rowSelection:d,cellSelection:p,groupMode:R,sortMode:w,filterMode:P,pivotMode:x,toPrimaryKey:g,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let E=!o||o.originalDataArray!==t.originalDataArray,F=typeof e.livePaginationCursor=="function"?E?LC(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;_.livePaginationCursor=F}if(t.devToolsDetected&&t.debugId){let E=Vt.get(t.debugId);E&&(_={..._,...E})}return _}var GC=rt("DataSource:fullLazyLoad");function hp(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&GC('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new st({collapsedRows:!0,expandedRows:[]})))}function gp(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,{selectionMode:"single-row"}]}:{callbackParams:[n.getState(),{selectionMode:"multi-row",lastUpdatedNodePath:e.lastSelectionUpdatedNodePathRef.current,dataSourceApi:e.__apiRef.current}]},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof Ve?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function yp(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Gt(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ve(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Gt(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ve(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Gt(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ve(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Gt(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&ve(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Gt(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Gt(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>$t(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(rt(kt(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function Cp(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}import Tp,{useCallback as KC,useEffect as Sp,useLayoutEffect as bp,useState as HC}from"react";function Vn(n){let e=Le(),t=_e(e),o=!!e,r=o?e.masterRowInfo.id:"master",{contextValue:i,ContextComponent:a}=Rp(n),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=_e(s),[d]=HC(()=>Xd({getState:c,actions:l})),p={componentState:s,componentActions:l,getDataSourceMasterContext:t,getState:c,assignState:u,api:d},f=_e(i),m=_e(p),h=un(),g=KC(({children:y})=>(typeof y=="function"&&(y=y(c())),Tp.createElement(a.Provider,{key:r,value:f()},Tp.createElement(h.Provider,{value:m()},y))),[a,o,r]);return bp(()=>{e&&e.registerDetail(p)},[]),bp(()=>()=>{let y=c();y.onCleanup(y)},[]),sp({componentState:s,componentActions:l,getComponentState:c}),Sp(()=>{s.onDataArrayChange?.(s.originalDataArray,s.originalDataArrayChangedInfo),s.onDataMutations&&s.originalDataArrayChangedInfo.mutations&&s.originalDataArrayChangedInfo.mutations.size&&s.onDataMutations({primaryKeyField:typeof s.primaryKey=="string"?s.primaryKey:void 0,dataArray:s.originalDataArray,mutations:s.originalDataArrayChangedInfo.mutations,timestamp:s.originalDataArrayChangedInfo.timestamp}),s.onTreeDataMutations&&s.originalDataArrayChangedInfo.treeMutations&&s.originalDataArrayChangedInfo.treeMutations.size&&s.onTreeDataMutations({nodesKey:s.nodesKey?s.nodesKey:void 0,dataArray:s.originalDataArray,treeMutations:s.originalDataArrayChangedInfo.treeMutations,timestamp:s.originalDataArrayChangedInfo.timestamp})},[s.originalDataArrayChangedInfo]),Sp(()=>{s.onReady?.(d)},[]),{DataSource:g,state:p.componentState}}var mt=class extends jo{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var sl=class{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??sl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}},zn=sl;zn.DEFAULT_SIZE=10;var ul=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},li=class{constructor(e){this.storage=new zn(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)}},cl=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)}},Gn=class{constructor(e){this.cacheStorage=e===!1?new ul:e===!0?new cl:typeof e=="number"?new li(e):new li(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 BC=(e=>(e.INIT="INIT",e))(BC||{});var{useManagedComponent:Rp}=Et({debugName:"DataSource",initSetupState:dp,forwardProps:fp,concludeReducer:Jd,mapPropsToState:mp,onPropChange:hp,cleanup:pp,interceptActions:yp(),mappedCallbacks:gp()});function t1(n){let{DataSource:e}=Vn(n);return Ip.createElement(e,null,n.children??null)}function o1(){let{rowInfoReducerResults:n}=Po();return n}function n1(){let n=Le();if(n)return n.masterRowInfo}function dl(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(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&&(o.columnMenuVisibleForColumnId=p),p}function pl(n){if(n==null)return!1;let e=n;return!0}function si(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function fl(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function wp(n,e,t){if(fl(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:u,colIndex:c}=a,d=Math.floor(l/o),p=Math.floor(u/o),f=l%o,m=u%o,h=Math.min(f,m),g=Math.max(f,m),y=[];for(let C=d;C<=p;C++)for(let S=h;S<=g;S++){let b=C*o+S;if(C===d)for(let T=s;T<r;T++)y.push({rowIndex:b,colIndex:T});else if(C===p)for(let T=0;T<=c;T++)y.push({rowIndex:b,colIndex:T});else for(let T=0;T<r;T++)y.push({rowIndex:b,colIndex:T})}return y}function kC(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var ml=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Qt(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new Ve(i);a.debugId=r.debugId??"";let[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=Qt(l,this.getDataSourceState),g=Qt(u,this.getDataSourceState);if(!h||!g)return;let y=h.indexInAll,C=g.indexInAll,[S,b]=si({rowIndex:y,colIndex:f},{rowIndex:C,colIndex:m});for(let T=S.rowIndex;T<=b.rowIndex;T++)for(let I=S.colIndex;I<=b.colIndex;I++){let R={rowIndex:T,colIndex:I},[w,P]=this.getCellSelectionPosition(R);o?a.selectCell(w,P):a.deselectCell(w,P)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=Jr(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.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=kC(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 e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ve(t);o.debugId=e.debugId??"",o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ve(t);o.debugId=e.debugId??"",o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new Ve:new Ve(o);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=new Ve(o);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState(),r=o.cellSelection;if(!r)return;let i=new Ve(r);i.debugId=o.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let r=new Ve(o);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function Pp(n){return new ml(n)}function xp(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new mt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.rowDetailState=new mt({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 mt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,o.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new mt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function eo(n,e,t){return Math.min(Math.max(n,e),t)}function ui(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return eo(a,r,i)}function WC(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().dataArray,u=s.length,c=t(),{brain:d}=c,{activeRowIndex:p}=c;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),h=p,g=m-f-1,y=0,C=u-1,S={ArrowDown:()=>{p=ui(o,p,1)},ArrowUp:()=>{p=ui(o,p,-1)},ArrowLeft:()=>{let T=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p-I>=y?p=p-I:S.ArrowUp();return}return T&&T.isGroupRow?i.collapseGroupRow(T.groupKeys):T&&i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p+I<=C?p=p+I:S.ArrowDown();return}return T&&T.isGroupRow?i.expandGroupRow(T.groupKeys):T&&i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=s[p];return T&&T.isGroupRow?i.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{p=Math.min(p+g,u-1)},PageUp:()=>{p=Math.max(p-g,y)},End:()=>{p=C},Home:()=>{p=y}},b=S[l];return b?(b(),h!==p?(r.activeRowIndex=p,!0):!1):!1}function hl(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,u=i().dataArray,c=o(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[h,g],end:[y,C]}=p.getRenderRange(),S=y-h-1,b=C-g-1,T=i().dataArray.length-1,I=r().computedVisibleColumns.length-1,R=0,w=0;f=eo(f,0,T),m=eo(m,0,I);let P={ArrowDown:()=>{f=eo(f+1,R,T)},ArrowUp:()=>{f=eo(f-1,R,T)},ArrowLeft:()=>{if(m===w)if(f!==R&&(m=I),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f-D>=R?f=f-D:P.ArrowUp()}else P.ArrowUp();else m=eo(m-1,w,I)},ArrowRight:()=>{if(m===I)if(f!==T&&(m=w),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f+D<=T?f=f+D:P.ArrowDown()}else P.ArrowDown();else m=eo(m+1,w,I)},Enter:()=>{let D=u[f];return D&&D.isGroupRow?t.toggleGroupRow(D.groupKeys):D&&D.isTreeNode&&D.isParentNode?a.treeApi.toggleNode(D.nodePath):D&&t.rowDetailApi.isRowDetailEnabledForRow(D.id)?t.rowDetailApi.toggleRowDetail(D.id):!1},PageDown:()=>{s?m=Math.min(m+b,I):f=Math.min(f+S,T)},PageUp:()=>{s?m=Math.max(m-b,w):f=Math.max(f-S,R)},End:()=>{s?m=I:f=T},Home:()=>{s?m=w:f=R}},x=P[l];return x?(x(),[f,m]):!1}function jC(n,e){let t=hl(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var $C={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Dp(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!$C[t]?!1:i!=null&&l==="row"?WC(n,e):a!=null&&l==="cell"?jC(n,e):!1}var gl=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=ui(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=hl(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function vp(n){return new gl(n)}function Ap(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var yl=class{constructor(e){this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(d=>requestAnimationFrame(d));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a={...lt({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;o.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,p=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(p)}),u;try{u=await s(a)}catch(d){u=d}let c=u instanceof Error?u:!0;return this.actions.editingCell={...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:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...lt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let u=l.computedEditable(lt({...this.context,api:this,columnId:r,rowIndex:i}));return typeof u=="boolean"?Promise.resolve(u):u};this.getColumnApi=e=>qe(e,{...this.context,api:this});this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),u=l.get(r),c=i.getRowInfoByIndex(s),d=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=Vo({column:u,rowInfo:c,columnsMap:l,context:{...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.setVisibilityForColumnGroup=(e,t)=>{let o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new st(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),o=new st(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[Zt,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||bo(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=q.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Ct())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,o={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let h=i.computedVisibleColumnsMap.get(t);if(!h)return!1;a=h.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){o=o||{};let h=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=h||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);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+(o.offset||0),m=u.scrollTop>p+(o.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=jd({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=vp({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=xp({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Pp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(dl(t),e?.()),setTimeout(()=>{this.isDestroyed()||(dl(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Kc({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(lt({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,o);return}let l=i.groupByForColumn,s=i.field,u=l?Array.isArray(l)?l:[l]:[],c=u.map(f=>f.valueGetter?m=>f.valueGetter({data:m,field:f.field}):f.field?f.field:f.groupField??void 0).filter(pl);c.length&&(s=c);let d=i.computedSortType;u.length&&d===No&&(d=u.flatMap(m=>{let h=m.field??m.groupField,g=h?r.get(h):null;return g?g.computedSortType:No}));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,o)}setSortInfoForColumn(e,t,o){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!Ap(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:Ap(d,l)?(u=!0,t):d),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 o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),u=s.name,c;o.computedFilterValue?(c={...o.computedFilterValue,filter:{...o.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:o.valueGetter},o.field&&(c.field=o.field)),c.id=o.id,this.setFilterValueForColumn(e,c)}setFilterValueForColumn(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],u=o.filterTypes[l];if(i=!0,!u)return null;let c=a.filter.operator??u?.defaultOperator,p=s[c].defaultFilterValue??(u.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:c,value:p}}}return a}).filter(pl),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){let t=this.getState();t.scrollerDOMRef.current.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 o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let u=o.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&(o.scrollerDOMRef.current.scrollTop=s.scrollTop),c&&(o.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),u=o.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(o.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function Ep(n){return new yl(n)}import{useEffect as Mp,useRef as UC,useState as YC}from"react";var qC=10;function XC(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${go} > .${Va}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${Co}`);if(t===!1&&d)return;let p=c.getAttribute("data-column-id"),f=u.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...It.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let h=Ee().getComputedStyle(c);s[p]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+qC}if(m+=s[p],d){let h=0;c.childNodes.forEach(g=>{if(g!==u){let y=g,C=Math.max(y.offsetWidth,parseInt(y.style.width,10));if(isNaN(C)&&(C=0),h+=C,C>0){let S=Ee().getComputedStyle(y);h+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=h}r&&r.has(p)||o&&!o.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function _p(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=Ke(),[a,l]=YC(0),s=typeof r=="object"?r.key:r,u=_e(s),c=UC(null);Mp(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),Mp(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),c.current=s;let h=XC(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),g=Object.keys(h);if(!g.length)return;let y=n().columnSizing,C={...y},S=!1;g.forEach(b=>{C[b]={width:h[b]},S=S||C[b].width!==y[b]?.width}),S&&(e.columnSizing=C)},[s,o,a])}import{useMemo as rT}from"react";import{useCallback as iT,useEffect as Uo,useRef as aT}from"react";import*as ci from"react";function Fp(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return Tr(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}import*as Kn from"react";var Op=ye({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as Np,useRef as ZC}from"react";function QC(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function JC(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=Cp(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(n,l),r.detailDataSourcesStateToRestore=a}function eT(n,e){let t=ZC(!1);return{currentRowCache:Np(()=>({getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)}),[e,n]),cacheCalledByRowDetailRenderer:t}}function Lp(n){let{rowDetailsCache:e,rowInfo:t}=n,{getState:o,componentActions:r}=Ie(),{getState:i}=X(),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=eT(t.id,e),s=Np(()=>{let u=o().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:Ye(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)});return}QC(t.id,{masterState:o(),detailContext:d}),requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)}),d.componentState.onCleanup.onChange(()=>{let p=a.get();p&&JC(t.id,{detailState:d.getState(),masterActions:r,masterState:o(),cacheEntryForRow:p})})}),shouldRestoreState:u}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}var{rootClassName:tT}=De,oT=`${tT}RowDetail`;function nT(n){let e=tr(),{domRef:t,rowDetailRenderer:o,rowDetailHeight:r,rowInfo:i,detailOffset:a,rowDetailsCache:l}=n,{masterDetailContextValue:s,currentRowCache:u}=Lp({rowDetailsCache:l,rowInfo:i});return Kn.createElement(e.Provider,{value:s},Kn.createElement("div",{ref:t,className:J(oT,Op({})),style:{position:"absolute",top:`${a}px`,left:0,width:`calc(${U.bodyWidth} - ${U.scrollbarWidthVertical})`,height:r}},o(i,u)))}var Vp=Kn.memo(nT);var lT=1;function zp(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{actions:r,state:i,getState:a}=X(),{computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:u,computedColumnsMap:c,computedRowHeight:d,computedRowSizeCacheForDetails:p,fieldsToColumn:f,rowspan:m,toggleGroupRow:h,columnSize:g}=e,{componentState:y,getState:C,componentActions:S,api:b}=Ie(),{dataArray:T,isNodeReadOnly:I}=y,R=_e(T),{rowHeight:w,rowDetailHeight:P,onRowMouseEnter:x,onRowMouseLeave:D,groupRenderStrategy:A,brain:_,showZebraRows:E,rowDetailRenderer:F,isRowDetailExpanded:v,isRowDetailEnabled:M,cellClassName:N,cellStyle:G,rowStyle:$,rowDetailCache:te,rowClassName:he,onScrollToTop:ue,onScrollToBottom:z,onScrollStop:k,scrollToBottomOffset:ae,wrapRowsHorizontally:oe,ready:W}=i,V=y.updatedAt;Fp({columnSize:g,brain:_,computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:u,computedRowHeight:d,dataArray:T,bodySize:t,rowspan:m});let L=aT(0);Uo(()=>_.onRenderCountChange(()=>{L.current=_.scrollTopMax}),[_]),Uo(()=>_.onRenderRangeChange(Q=>{a().onRenderRangeChange?.(Q)}),[_]),Uo(()=>_.onScrollStop(Q=>{let{scrollTop:O,scrollLeft:be}=Q;if(O===0&&ue?.(),O+(ae??lT)>=L.current){z?.();let{livePagination:ee,livePaginationCursor:ce,dataArray:xe}=C();ee&&(S.cursorId=ce!==void 0?Date.now():xe.length)}if(k){let ee=_.getRenderRange();k({scrollTop:O,scrollLeft:be,renderRange:ee,viewportSize:a().bodySize,firstVisibleRowIndex:ee.start[0],lastVisibleRowIndex:ee.end[0],firstVisibleColIndex:ee.start[1],lastVisibleColIndex:ee.end[1]})}}),[_,ue,z,k]),Uo(()=>{t.height&&(r.ready=!0)},[!!t.height]),Uo(()=>{let{onReady:Q}=a();Q&&Q({api:o,dataSourceApi:b})},[W]);let[,Z]=Rt();Uo(()=>{Z()},[y]);let j=iT(Q=>{let{rowIndex:O,colIndex:be,heightWithRowspan:Te,domRef:B,hidden:ee,width:ce,onMouseLeave:xe,onMouseEnter:we}=Q,Ae=R()[O],He=u[be];if(!Ae)return null;let Ue=p?p.getRowHeight(O):Te,ke=!1;!M||typeof M=="function"&&!M(Ae)?ke=!1:v&&(ke=v(Ae)?"expanded":"collapsed");let nt=oe?_.getRowIndexInPage(O):null,Qe=oe?_.getPageIndexForRow(O):null;return ci.createElement($c,{...{getData:R,virtualized:!0,showZebraRows:E,groupRenderStrategy:A,rowIndexInHorizontalLayoutPage:nt,horizontalLayoutPageIndex:Qe,rowIndex:O,rowInfo:Ae,hidden:ee,toggleGroupRow:h,rowHeight:Ue,rowDetailState:ke,onMouseEnter:we,onMouseLeave:xe,onRowMouseEnter:x,onRowMouseLeave:D,domRef:B,width:ce,column:He,columnsMap:c,fieldsToColumn:f,rowStyle:$,rowClassName:he,cellStyle:G,cellClassName:N}})},[w,P,x,D,p,d,v,R,u,c,f,A,oe,h,E,_,V,I,$,he,N,G]),se=rT(()=>{if(v)return Q=>{let{rowIndex:O,domRef:be}=Q,B=R()[O];if(!B||!v(B)||!p)return ci.createElement("div",{ref:be,className:hu.hidden});let{rowDetailHeight:ee,rowHeight:ce}=p.getSize(O);return ci.createElement(Vp,{rowInfo:B,rowDetailsCache:te,rowIndex:O,domRef:be,detailOffset:ce,rowDetailHeight:ee,rowDetailRenderer:F})}},[W,j,F,P,v,te]);return{renderCell:j,renderDetailRow:se}}import{useEffect as DT,useState as Rl}from"react";var di=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,o,r){if(r.horizontalLayout&&!fl(e,t,r)){wp(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=si(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let u=i.rowIndex;u<=a.rowIndex;u++)for(let c=i.colIndex;c<=a.colIndex;c++){let d=this.getCellSelectionPosition({rowIndex:u,colIndex:c});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function Gp(n,e){return n<e?[n,e]:[e,n]}var pi=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[o,r]=Gp(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[o,r]=Gp(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let o;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))o=r;else break}this.multiSelectEndIndex=o}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};import{useMemo as sT}from"react";function Kp(n){let{getState:e}=Ie();return sT(()=>n.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,u=n[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}import{useCallback as uT}from"react";var HL=rt("useColumnSizeFn");function Hp(n){return uT(t=>{let o=n[t];return o?o.computedWidth:0},[n])}import{useEffect as Yo,useLayoutEffect as fT,useMemo as mT}from"react";import{createRef as Ro}from"react";var cT={scrollLeft:0,scrollTop:0},Hn=class{constructor(){this.scrollPosition=cT;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let o=0,r=t.length;o<r;o++)t[o](e)}};function Bp(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}import*as kp from"react";function Wp(n){return(e,t)=>kp.createElement(n,{key:e.id,rowInfo:e,cache:t})}var Bn=class extends lo{constructor(t,o){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.options=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let u=l-s*this.pageWidth,c=[];for(let d=0;d<this.initialCols;d++)c.push(this.getItemSize(d,t));return a+=ar(u,c.concat(c)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,u=typeof l=="number",c=typeof s=="number",d=u&&l!==this.availableWidth,p=c&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof o=="number",m=typeof r=="number",h=f&&o!==this.initialRows,g=m&&r!==this.initialCols;f&&h&&(this.initialRows=o,this.rows=o),m&&g&&(this.initialCols=r,this.cols=r);let y=i!=null,C=a!=null,S=y&&i!==this.rowHeight,b=C&&a!==this.initialColWidth;y&&(this.rowHeight=i),C&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=h||S||p,I=g||b||d||T;(I||T)&&this.updateRenderCount({horizontal:I,vertical:T})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=At){let o=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/o);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*o,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(o=>{ve(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var jp={};function Cl(n){return`.${ho}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function Tl(n,e){let t=kt(n),o=e?new Bn(t,{isHeader:!1}):new lo(t),r=e?new Bn(t,{isHeader:!0,masterBrain:o}):new lo(t);o.onScroll(l=>{r.setScrollPosition({scrollLeft:l.scrollLeft,scrollTop:0})});let{renderer:i,onRenderUpdater:a}=pr(o);return o.onAvailableSizeChange(l=>{r.update({width:l.width})}),{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a}}function $p({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a}=Tl(n,!!e),l=Ro();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:s=>{if(!l.current)return null;let u=Cl(s);return l.current.querySelector(u)||null},brain:o,headerBrain:r,domRef:l,columnMenuTargetRef:Ro(),editingValueRef:Ro(),scrollerDOMRef:Ro(),portalDOMRef:Ro(),focusDetectDOMRef:Ro(),activeCellIndicatorDOMRef:Ro(),onColumnMenuClick:pe(),cellContextMenu:pe(),contextMenu:pe(),onFilterOperatorMenuClick:pe(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:pe(),onRowHeightCSSVarChange:pe(),onRowDetailHeightCSSVarChange:pe(),onColumnHeaderHeightCSSVarChange:pe(),cellClick:pe(),cellMouseDown:pe(),keyDown:pe(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:t,columnVisibilityForGrouping:{},pinnedStartScrollListener:new Hn,pinnedEndScrollListener:new Hn,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Up=n=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new Gn(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e||"",keyboardSelection:e=>e??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??jp,columnGroupVisibility:e=>e??jp,columnSizing:e=>e||{},columnTypes:e=>e||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:e=>e??"replace",collapsedColumnGroups:e=>e??new Map,columnGroups:1});function dT(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Yp=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.onRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function qp(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var fi=new WeakMap;function Xp(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Zp=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=o?.pivotColumnGroups?Bp(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=dT({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let g=fi.get(d);g||(g=Wp(d),fi.set(d,g)),c=g}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof mt)&&(u=new mt(u)),u=u||new mt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=fi.get(u),f||(f=g=>u.isRowDetailsExpanded(g.id),typeof u=="object"&&fi.set(u,f)));let m=c?e.isRowDetailEnabled||!0:!1,h={isTree:r.isTree,rowDetailRenderer:c,rowDetailState:u,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||le.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let g=Lt.get(t.debugId);g&&(h={...h,...g})}return h};function Qp(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function Jp(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,u=0,c=r.length;for(let d=0;d<c;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(u=Math.max(u,f.groupNesting-1),u===s-1))break}return Object.keys(o).forEach(d=>{let p=o[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 pT}from"react";function Sl(){let{getState:n,componentActions:e,getDataSourceMasterContext:t}=Ie();return pT(r=>{let i=n(),a=new st(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Zt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||bo(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=q.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Ct())}},[])}function hT(n){return mT(()=>qp(n),[n])}function ef(){let{componentState:{groupBy:n},componentActions:e}=Ie(),{componentState:{groupRenderStrategy:t,pivotTotalColumnPosition:o,pivotGrandTotalColumnPosition:r}}=Ke();Yo(()=>{e.generateGroupRows=t!=="inline"},[t]),Yo(()=>{e.pivotTotalColumnPosition=o},[o]),Yo(()=>{r!=null&&(e.pivotGrandTotalColumnPosition=r)},[r]);let i=hT(n);gT(i);let{toggleGroupRow:a}=yT();return CT(i),{toggleGroupRow:a}}function gT(n){let e=Sl(),{componentActions:t,componentState:{columns:o,groupRenderStrategy:r,isTree:i}}=Ke();function a(l,s,u,c){let d={};if(u==="inline")return Object.keys(l).forEach(p=>{let f=l[p],m={},h=s.get(f.field);if(h&&u==="inline"){let{groupIndex:y}=h;m={groupByForColumn:h.groupBy,field:h.groupBy?.field,valueGetter:h.groupBy?.valueGetter,valueFormatter:({rowInfo:C})=>C.isGroupRow?C.groupKeys?.[y]:C.value,rowspan:({rowInfo:C,dataArray:S})=>{if(C.isTreeNode||!C.isGroupRow)return 1;let b=S[C.indexInAll-1]||{indexInParentGroups:[]};if(!b||!b.dataSourceHasGrouping)return 1;let T=b.indexInParentGroups||[],I=C.indexInParentGroups||[],R=!1;for(let x=0;x<=y;x++){let D=T[x];if(I[x]!==D){R=!0;break}}if(!R)return 1;let w=C.parents[y];return w?w.groupCount-(w.collapsedChildrenCount||0)+(w.collapsedGroupsCount||0):1},renderGroupIcon:zr({groupIndexForColumn:y,groupRenderStrategy:u,toggleGroupRow:c,initialRenderGroupIcon:f.renderGroupIcon}),render:Vr({groupIndexForColumn:y,groupRenderStrategy:u})}}let g={...m,...f};d[p]=g}),Object.keys(d).length===0?void 0:d}Yo(()=>{(()=>{t.columnsWhenInlineGroupRenderStrategy=i?void 0:a(o,n,r,e)})()},[o,n,r,e])}function yT(){let{componentState:{groupBy:n,pivotBy:e,selectionMode:t}}=Ie(),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=Ke(),f=Sl();return Yo(()=>{(()=>{let{columns:h,groupColumnIds:g}=TT({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});o.columnsWhenGrouping=h;let y=p().columnOrder;if(g.length&&Array.isArray(y)){let C=new Set(y),S=!1;g.forEach(b=>{C.has(b)||(S=!0,y=[b,...y])}),S&&(o.columnOrder=y)}})()},[r,n,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function CT(n){let{componentState:{dataArray:e,groupRowsIndexesInDataArray:t,groupBy:o,groupRowsState:r,originalLazyGroupDataChangeDetect:i},getState:a}=Ie(),{getComponentState:l,componentActions:s,componentState:{columnTypes:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}}=Ke();fT(()=>{if(f!=="multi-column")return;let m=l(),h=Qp(c,n),g=Jp({computedGroupColumns:h,columnVisibility:m.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:t,dataArray:e,groupBy:o,groupByMap:n});$t(m.columnVisibility,g)||(s.columnVisibility=g)},[a,f,i,o,n,c,p?e:null,p?r:null,p?t:null,p]),Yo(()=>{let m=o.length>0,h=l(),{columnVisibility:g,columnVisibilityForGrouping:y,hideColumnWhenGrouped:C}=h,S={...g},b={...y},T=!1,I=new Set,R=new Set;Object.keys(c).forEach(w=>{let P=c[w];if(P.defaultHiddenWhenGroupedBy||C!=null)if(P.defaultHiddenWhenGroupedBy==="*"&&m||(P.defaultHiddenWhenGroupedBy===!0||C)&&P.field&&n.get(P.field)||typeof P.defaultHiddenWhenGroupedBy=="string"&&n.get(P.defaultHiddenWhenGroupedBy)||typeof P.defaultHiddenWhenGroupedBy=="object"&&Object.keys(P.defaultHiddenWhenGroupedBy).reduce((D,A)=>D||n.has(A),!1)){if(b[w]!==!1){if(g[w]===!1)return;b[w]=!1,T=!0,I.add(w)}}else b[w]===!1&&(delete b[w],T=!0,R.add(w))}),T&&(s.columnVisibilityForGrouping=b,R.forEach(w=>{delete S[w]}),I.forEach(w=>{S[w]=!1}),s.columnVisibility=S)},[c,u,o,n,d])}function TT(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=n;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,h,g)=>{let y=Nc({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:h,groupCount:g.length,groupRenderStrategy:u,selectionMode:r},c,i),C=y.id||`group-by-${m.field||m.groupField}`;f.push(C),p[C]=y});else if(u==="single-column"&&t.length){let m=Lc({groupCount:t.length,groupBy:t,pivotBy:o,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=>{let g=e[h],y=g.pivotTotalColumn&&g.columnGroup,C=g.pivotTotalColumn&&!g.columnGroup;if(y&&a===!1||C&&l===!1)return;let S={...g};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:o,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?m[S.pivotAggregator?.field]:void 0,...S}),!S.render&&S.renderValue&&(S.render=b=>S.renderValue(b)),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 ST}from"react";var tf=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:u,columnDefaultDraggable:c,sortInfo:d,multiSort:p,filterValue:f,filterTypes:m,columnOrder:h,columnPinning:g,editable:y,columnDefaultEditable:C,columnDefaultFilterable:S,columnDefaultSortable:b,scrollbarWidth:T,columnTypes:I,pinnedEndMaxWidth:R,pinnedStartMaxWidth:w,viewportReservedWidth:P,resizableColumns:x,columnVisibility:D,columnVisibilityAssumeVisible:A,columnSizing:_})=>{let{computedRemainingSpace:F,computedColumnOrder:v,computedVisibleColumns:M,computedVisibleColumnsMap:N,computedPinnedStartColumns:G,computedPinnedEndColumns:$,computedUnpinnedColumns:te,computedPinnedStartColumnsWidth:he,computedPinnedEndColumnsWidth:ue,computedUnpinnedColumnsWidth:z,computedUnpinnedOffset:k,computedPinnedEndOffset:ae,computedPinnedEndWidth:oe,computedPinnedStartWidth:W,renderSelectionCheckBox:V,computedColumnsMap:L,computedColumnsMapInInitialOrder:Z,fieldsToColumn:j}=ST(()=>Ju({columns:n,scrollbarWidth:T,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:P,resizableColumns:x,filterValue:f,filterTypes:m,sortable:a,sortInfo:d,multiSort:p,pinnedEndMaxWidth:R,pinnedStartMaxWidth:w,draggableColumns:u,columnDefaultDraggable:c,columnOrder:h,columnPinning:g,columnDefaultEditable:C,columnDefaultFilterable:S,columnDefaultSortable:b,editable:y,columnSizing:_,columnTypes:I,columnVisibility:D,columnVisibilityAssumeVisible:A??!0}),[n,e.width,t,o,r,P,T,a,d,p,f,m,h,D,A,c,u,x,R,w,_,I,g,C,S,y,1]);return{renderSelectionCheckBox:V,columns:n,computedColumnsMap:L,computedPinnedEndWidth:oe,computedPinnedStartWidth:W,computedRemainingSpace:F,computedUnpinnedOffset:k,computedPinnedEndOffset:ae,computedPinnedStartColumnsWidth:he,computedPinnedEndColumnsWidth:ue,computedUnpinnedColumnsWidth:z,computedPinnedStartColumns:G,computedPinnedEndColumns:$,computedUnpinnedColumns:te,computedVisibleColumns:M,computedVisibleColumnsMap:N,computedColumnOrder:v,computedColumnsMapInInitialOrder:Z,fieldsToColumn:j}};import{useMemo as bT}from"react";var bl=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function RT(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?o(d):0;return e&&e.rowHeight.set(c,p),p}:o;let l=typeof o=="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?o(d):o;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 of(n){return bT(()=>{let e=new bl;return{computedRowHeight:RT(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}},[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}import{useState as IT,useEffect as wT,useLayoutEffect as PT}from"react";var xT={vertical:!1,horizontal:!1};function nf(n){let{getComponentState:e}=Ke(),{getState:t}=Ie(),[o,r]=IT(xT);return wT(()=>n.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=n;r({vertical:i>0,horizontal:a>0})}),[n]),PT(()=>{let i=t(),{onScrollbarsChange:a}=e(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function rf(){let{componentActions:n,componentState:e}=Ke(),{componentActions:t,componentState:o,getState:r,api:i}=Ie(),{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:C,bodySize:S,showSeparatePivotColumnForSingleAggregation:b}=e;Rl(()=>{e.onRowHeightCSSVarChange.onChange(B=>{B&&(n.rowHeight=B)}),e.onFlashingDurationCSSVarChange.onChange(B=>{let ee=B?B*1:null;ee!=null&&!isNaN(ee)&&(n.flashingDurationCSSVarValue=ee)}),e.onRowDetailHeightCSSVarChange.onChange(B=>{B&&(n.rowDetailHeight=B)}),e.onColumnHeaderHeightCSSVarChange.onChange(B=>{B&&(n.columnHeaderHeight=B)})}),DT(()=>{t.showSeparatePivotColumnForSingleAggregation=b},[b]);let{multiSort:T,filterValue:I,filterTypes:R}=o,{toggleGroupRow:w}=ef(),P=e.computedColumns,{computedColumnOrder:x,computedVisibleColumns:D,computedVisibleColumnsMap:A,computedPinnedStartColumns:_,computedPinnedEndColumns:E,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:v,computedPinnedEndColumnsWidth:M,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:G,computedPinnedEndOffset:$,computedRemainingSpace:te,computedPinnedStartWidth:he,computedPinnedEndWidth:ue,renderSelectionCheckBox:z,computedColumnsMap:k,computedColumnsMapInInitialOrder:ae,fieldsToColumn:oe}=tf({columns:P,scrollbarWidth:void 0,columnCssEllipsis:e.columnCssEllipsis,columnHeaderCssEllipsis:e.columnHeaderCssEllipsis,columnMinWidth:e.columnMinWidth,columnMaxWidth:e.columnMaxWidth,columnDefaultWidth:e.columnDefaultWidth,columnDefaultFlex:e.columnDefaultFlex,columnDefaultSortable:e.columnDefaultSortable,columnDefaultDraggable:e.columnDefaultDraggable,pinnedStartMaxWidth:e.pinnedStartMaxWidth,pinnedEndMaxWidth:e.pinnedEndMaxWidth,bodySize:S,viewportReservedWidth:e.viewportReservedWidth,resizableColumns:e.resizableColumns,sortable:e.sortable,draggableColumns:e.draggableColumns,sortInfo:o.sortInfo??void 0,multiSort:T,columnOrder:a,columnVisibility:l,columnVisibilityAssumeVisible:!0,columnPinning:s,editable:c,columnDefaultEditable:d,columnDefaultFilterable:p,filterValue:I,filterTypes:R,columnSizing:u,columnTypes:f}),W=Kp(D),V=Hp(D),L=nf(C),Z=he?v>he:!1,j=ue?M>ue:!1,[se]=Rl(()=>new pi({isRowDisabledAt:ee=>r().dataArray[ee]?.rowDisabled??!1,getIdForIndex:ee=>r().dataArray[ee]?.id??-1})),Q=_e(D),[O]=Rl(()=>new di({getPrimaryKeyByIndex:i.getPrimaryKeyByIndex,getColumnIdByIndex:B=>Q()[B]?.id||""})),{computedRowHeight:be,computedRowSizeCacheForDetails:Te}=of({rowDetailHeight:h,rowHeight:m,isRowDetailsExpanded:g,isRowDetailsEnabled:y,getDataSourceState:r});return{multiRowSelector:se,multiCellSelector:O,computedRowSizeCacheForDetails:Te,computedRowHeight:be,scrollbars:L,columnSize:V,rowspan:W,toggleGroupRow:w,computedColumnsMap:k,computedColumnsMapInInitialOrder:ae,renderSelectionCheckBox:z,computedPinnedStartOverflow:Z,computedPinnedEndOverflow:j,computedPinnedStartWidth:he,computedPinnedEndWidth:ue,computedVisibleColumns:D,computedColumnOrder:x,computedRemainingSpace:te,computedVisibleColumnsMap:A,computedPinnedStartColumns:_,computedPinnedEndColumns:E,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:v,computedPinnedEndColumnsWidth:M,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:G,computedPinnedEndOffset:$,fieldsToColumn:oe}}import{useMemo as OT}from"react";function vT(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function AT(){return 4294967295}function ET(n,e,t){return e=e>>>8^n[t^e&255],e}function MT(n){return n=~n,n=n<0?4294967295+n+1:n,n}function Il(n,e=3988292384){var t=vT(e),o=0,r;for(o=AT(),r=0;r<n.length;r++)o=ET(t,o,n.charCodeAt(r));return o=MT(o),`${o}`}var _T=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},af=(n,e=console.error.bind(console))=>{n=["* * * infinite-table.com * * *",...n];let t=Math.max(Math.max(...n.map(o=>o.length))+4*2,60);n.forEach(o=>{let r=(t-o.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+o+" "+"*".repeat(l))}),e("*".repeat(t))},lf=(n="",e,t)=>{let o;try{o=FT(n)}catch{return af(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(o.end);return i<r?(af([`
|
|
27
|
+
`);let n=go(t);if(o instanceof ot)return o.setConfigFn(n),o;(o==null||typeof o!="object")&&(o=void 0);let r=o??lC,i=Dt.get(r);return i&&i.setConfigFn(n),i=i??new ot(r,n),Dt.set(r,i),i}function gf(o){let{props:e,state:t,oldState:n}=o,r=!!t.nodesKey,i=Vo(e.sortInfo),a=Vo(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((E,_)=>{let P=l[_].operators;E[_]=E[_]||{};let F=E[_];return P.forEach(N=>{F[N.name]=N}),E},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let E=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(E!==void 0&&(E&&typeof E=="object"?u="multi-row":u="single-row"),!u){let _=c.treeSelection??c.defaultTreeSelection;_!==void 0&&(u=typeof _=="object"?"multi-row":"single-row")}u=u??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(u!==!1&&(u==="single-row"||u==="multi-row")&&(f===null?d=u==="single-row"?null:new xe({selectedRows:[],deselectedRows:[],defaultSelection:!1},tt(t)):u==="single-row"||f instanceof xe?d=f:d=new xe(f,tt(t))),u==="single-cell"||u==="multi-cell"))if(m===null)p=u==="single-cell"?null:new ze;else if(m instanceof ze)p=m;else{let E=Dt.get(m)??new ze(m);Dt.set(m,E),p=E}let g=t.primaryKey,h=typeof g=="function"?E=>g(E):E=>E[g],b=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(b&&!(b instanceof nt)){let E=Dt.get(b)??new nt(b);Dt.set(b,E),b=E}b=b||new nt({defaultExpanded:!0,collapsedPaths:[]});let T=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(T&&!(T instanceof mt)){let E=Dt.get(T)??new mt(T);Dt.set(T,E),T=E}T=T||new mt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let C=aC(e.shouldReloadData||{}),S=e.groupMode??(C.groupBy!=null?C.groupBy?"remote":"local":void 0),y=e.sortMode??C.sortInfo!=null?C.sortInfo?"remote":"local":void 0,I=e.filterMode??C.filterValue!=null?C.filterValue?"remote":"local":void 0;e.groupMode&&po('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&po('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&po('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let w=typeof e.data=="function"?S??"local":"local",v=e.sortFunction?"local":y??(i?"remote":"local"),R=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":I??(typeof e.data=="function"?"remote":"local"),x=C.pivotBy?"remote":"local",D=t.rowDisabledState,M=e.isRowDisabled;if(!M&&D){let E=Dt.get(D);E?M=E:(M=_=>D.isRowDisabled(_.id),Dt.set(D,M))}let A={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:T,treeExpandState:b,treeExpandMode:b.mode,shouldReloadData:{filterValue:C?.filterValue??R==="remote",sortInfo:C?.sortInfo??v==="remote",groupBy:C?.groupBy??w==="remote",pivotBy:C?.pivotBy??x==="remote"},isRowDisabled:M,rowSelection:d,cellSelection:p,groupMode:w,sortMode:v,filterMode:R,pivotMode:x,toPrimaryKey:h,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let E=!n||n.originalDataArray!==t.originalDataArray,_=typeof e.livePaginationCursor=="function"?E?iC(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;A.livePaginationCursor=_}if(t.devToolsDetected&&t.debugId){let E=$t.get(t.debugId);E&&(A={...A,...E})}return A}var sC=ut("DataSource:fullLazyLoad");function hf(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&sC('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new mt({collapsedRows:!0,expandedRows:[]})))}function bf(){return{rowSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,{selectionMode:"single-row"}]}:{callbackParams:[o.getState(),{selectionMode:"multi-row",lastUpdatedNodePath:e.lastSelectionUpdatedNodePathRef.current,dataSourceApi:e.__apiRef.current}]},treeExpandState:(o,e)=>({callbackParams:[o.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(o,e)=>e.selectionMode==="single-cell"?{callbackParams:[o instanceof ze?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function yf(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Yt(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ae(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Yt(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ae(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Yt(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ae(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Yt(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ae(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Yt(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Yt(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>Tt(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(ut(nn(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function Tf(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}import Cf,{useCallback as cC,useEffect as Sf,useLayoutEffect as wf,useState as uC}from"react";function or(o){let e=ke(),t=Ie(e),n=!!e,r=n?e.masterRowInfo.id:"master",{contextValue:i,ContextComponent:a}=vf(o),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Ie(s),[d]=uC(()=>qp({getState:u,actions:l})),p={componentState:s,componentActions:l,getDataSourceMasterContext:t,getState:u,assignState:c,api:d},f=Ie(i),m=Ie(p),g=_o(),h=cC(({children:b})=>(typeof b=="function"&&(b=b(u())),Cf.createElement(a.Provider,{key:r,value:f()},Cf.createElement(g.Provider,{value:m()},b))),[a,n,r]);return wf(()=>{e&&e.registerDetail(p)},[]),wf(()=>()=>{let b=u();b.onCleanup(b)},[]),cf({componentState:s,componentActions:l,getComponentState:u}),Sf(()=>{s.onDataArrayChange?.(s.originalDataArray,s.originalDataArrayChangedInfo),s.onDataMutations&&s.originalDataArrayChangedInfo.mutations&&s.originalDataArrayChangedInfo.mutations.size&&s.onDataMutations({primaryKeyField:typeof s.primaryKey=="string"?s.primaryKey:void 0,dataArray:s.originalDataArray,mutations:s.originalDataArrayChangedInfo.mutations,timestamp:s.originalDataArrayChangedInfo.timestamp}),s.onTreeDataMutations&&s.originalDataArrayChangedInfo.treeMutations&&s.originalDataArrayChangedInfo.treeMutations.size&&s.onTreeDataMutations({nodesKey:s.nodesKey?s.nodesKey:void 0,dataArray:s.originalDataArray,treeMutations:s.originalDataArrayChangedInfo.treeMutations,timestamp:s.originalDataArrayChangedInfo.timestamp})},[s.originalDataArrayChangedInfo]),Sf(()=>{s.onReady?.(d)},[]),{DataSource:h,state:p.componentState}}var St=class extends ho{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];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 Ei=class Ei{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??Ei.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}};Ei.DEFAULT_SIZE=10;var Pi=Ei;var Hl=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},Mi=class{constructor(e){this.storage=new Pi(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)}},Kl=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)}},rr=class{constructor(e){this.cacheStorage=e===!1?new Hl:e===!0?new Kl:typeof e=="number"?new Mi(e):new Mi(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 dC=(e=>(e.INIT="INIT",e))(dC||{});var{useManagedComponent:vf}=It({debugName:"DataSource",initSetupState:pf,forwardProps:mf,concludeReducer:Jp,mapPropsToState:gf,onPropChange:hf,cleanup:ff,interceptActions:yf(),mappedCallbacks:bf()});function B0(o){let{DataSource:e}=or(o);return If.createElement(e,null,o.children??null)}function W0(){let{rowInfoReducerResults:o}=Jt();return o}function j0(){let o=ke();if(o)return o.masterRowInfo}function Bl(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 g=l[c+f*m],h=a.get(g);if(h&&h.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,p;for(;!p&&u<l.length&&(u++,p=s(u,d),p||(d*=-1,p=s(u,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function Wl(o){if(o==null)return!1;let e=o;return!0}function Ai(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function jl(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function Rf(o,e,t){if(jl(o,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:r}=t;if(n===0)throw"rowsPerPage cannot be 0";let i=o,a=e;Math.floor(o.rowIndex/n)>Math.floor(e.rowIndex/n)&&(i=e,a=o);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/n),p=Math.floor(c/n),f=l%n,m=c%n,g=Math.min(f,m),h=Math.max(f,m),b=[];for(let T=d;T<=p;T++)for(let C=g;C<=h;C++){let S=T*n+C;if(T===d)for(let y=s;y<r;y++)b.push({rowIndex:S,colIndex:y});else if(T===p)for(let y=0;y<=u;y++)b.push({rowIndex:S,colIndex:y});else for(let y=0;y<r;y++)b.push({rowIndex:S,colIndex:y})}return b}function pC(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var $l=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??mn(e.rowIndex,this.getDataSourceState)?.id,n=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,n]};this.setRangeSelected=(e,t,n)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new ze(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=mn(l,this.getDataSourceState),h=mn(c,this.getDataSourceState);if(!g||!h)return;let b=g.indexInAll,T=h.indexInAll,[C,S]=Ai({rowIndex:b,colIndex:f},{rowIndex:T,colIndex:m});for(let y=C.rowIndex;y<=S.rowIndex;y++)for(let I=C.colIndex;I<=S.colIndex;I++){let w={rowIndex:y,colIndex:I},[v,R]=this.getCellSelectionPosition(w);n?a.selectCell(v,R):a.deselectCell(v,R)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=Ci(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 c=pC(Array.from(a),i),u=l.map(d=>c.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:c,positions:u}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new ze(t);n.debugId=e.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new ze(t);n.debugId=e.debugId??"",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=>{let[t,n]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,n)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new ze:new ze(n);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=new ze(n);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let n=this.getDataSourceState(),r=n.cellSelection;if(!r)return;let i=new ze(r);i.debugId=n.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let r=new ze(n);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function xf(o){return new $l(o)}function Df(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new St({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new St({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 St(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 St(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 hn(o,e,t){return Math.min(Math.max(o,e),t)}function _i(o,e,t){let n=o().dataArray,r=0,i=n.length-1,a=e;do{a+=t;let l=n[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return hn(a,r,i)}function fC(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:p}=u;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,h=m-f-1,b=0,T=c-1,C={ArrowDown:()=>{p=_i(n,p,1)},ArrowUp:()=>{p=_i(n,p,-1)},ArrowLeft:()=>{let y=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p-I>=b?p=p-I:C.ArrowUp();return}return y&&y.isGroupRow?i.collapseGroupRow(y.groupKeys):y&&i.rowDetailApi.isRowDetailEnabledForRow(y.id)?i.rowDetailApi.collapseRowDetail(y.id):!1},ArrowRight:()=>{let y=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p+I<=T?p=p+I:C.ArrowDown();return}return y&&y.isGroupRow?i.expandGroupRow(y.groupKeys):y&&i.rowDetailApi.isRowDetailEnabledForRow(y.id)?i.rowDetailApi.expandRowDetail(y.id):!1},Enter:()=>{let y=s[p];return y&&y.isGroupRow?i.toggleGroupRow(y.groupKeys):y&&y.isTreeNode&&y.isParentNode?a.treeApi.toggleNode(y.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(y.id)?i.rowDetailApi.toggleRowDetail(y.id):!1},PageDown:()=>{p=Math.min(p+h,c-1)},PageUp:()=>{p=Math.max(p-h,b)},End:()=>{p=T},Home:()=>{p=b}},S=C[l];return S?(S(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Ul(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,c=i().dataArray,u=n(),{activeCellIndex:d,brain:p}=u;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[b,T]}=p.getRenderRange(),C=b-g-1,S=T-h-1,y=i().dataArray.length-1,I=r().computedVisibleColumns.length-1,w=0,v=0;f=hn(f,0,y),m=hn(m,0,I);let R={ArrowDown:()=>{f=hn(f+1,w,y)},ArrowUp:()=>{f=hn(f-1,w,y)},ArrowLeft:()=>{if(m===v)if(f!==w&&(m=I),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f-D>=w?f=f-D:R.ArrowUp()}else R.ArrowUp();else m=hn(m-1,v,I)},ArrowRight:()=>{if(m===I)if(f!==y&&(m=v),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f+D<=y?f=f+D:R.ArrowDown()}else R.ArrowDown();else m=hn(m+1,v,I)},Enter:()=>{let D=c[f];return D&&D.isGroupRow?t.toggleGroupRow(D.groupKeys):D&&D.isTreeNode&&D.isParentNode?a.treeApi.toggleNode(D.nodePath):D&&t.rowDetailApi.isRowDetailEnabledForRow(D.id)?t.rowDetailApi.toggleRowDetail(D.id):!1},PageDown:()=>{s?m=Math.min(m+S,I):f=Math.min(f+C,y)},PageUp:()=>{s?m=Math.max(m-S,v):f=Math.max(f-C,w)},End:()=>{s?m=I:f=y},Home:()=>{s?m=v:f=w}},x=R[l];return x?(x(),[f,m]):!1}function mC(o,e){let t=Ul(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var gC={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Pf(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!gC[t]?!1:i!=null&&l==="row"?fC(o,e):a!=null&&l==="cell"?mC(o,e):!1}var Yl=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:n}=this.param,{activeRowIndex:r,keyboardNavigation:i}=n();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=_i(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,n=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Ul(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function Ef(o){return new Yl(o)}function Mf(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var ql=class{constructor(e){this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(n=>t.has(n))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(d=>requestAnimationFrame(d));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a={...ft({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;n.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,p=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(p)}),c;try{c=await s(a)}catch(d){c=d}let u=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:u},Promise.resolve(u)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId: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=async e=>{let t=this.getState(),{editingCell:n,editingValueRef:r}=t;if(!n)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),c=s.get(l),u=t.shouldAcceptEdit??c.shouldAcceptEdit,d=u?u({...ft({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&n?.active?(this.actions.editingCell={...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=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,i=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 c=l.computedEditable(ft({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>et(e,{...this.context,api:this});this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),c=l.get(r),u=i.getRowInfoByIndex(s),d=u?.id;if(!u||!c)return c||console.warn(`No column found with id: "${r}"`),u||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=ao({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:g.formattedValueContext.value,formattedValue:g.formattedValue,rawValue:g.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let n={...this.getState().columnGroupVisibility};t?delete n[e]:n[e]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new mt(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 mt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[fn,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||Gn(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=J.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=xt())}};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 g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){n=n||{};let g=r.brain.getPageIndexForRow(e);n.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,n),s=r.renderer.getScrollPositionForScrollRowIntoView(e,n);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=c.scrollLeft>d+(n.offset||0),m=c.scrollTop>p+(n.offset||0);return f&&m?!1:(c.scrollLeft!==u.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=c.scrollLeft),c.scrollTop!==u.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=c.scrollTop),!0)};this.context=e,this.rowSelectionApi=Wp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=Ef({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=Df({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=xf({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(Bl(t),e?.()),setTimeout(()=>{this.isDestroyed()||(Bl(t),e?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,u=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Ad({column:u,rowInfo:d}),f=p;u.getValueToEdit&&(p=await u.getValueToEdit(ft({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.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,c=l?Array.isArray(l)?l:[l]:[],u=c.map(f=>f.valueGetter?m=>f.valueGetter({data:m,field:f.field}):f.field?f.field:f.groupField??void 0).filter(Wl);u.length&&(s=u);let d=i.computedSortType;c.length&&d===to&&(d=c.flatMap(m=>{let g=m.field??m.groupField,h=g?r.get(g):null;return h?h.computedSortType:to}));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){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!Mf(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:Mf(d,l)?(c=!0,t):d),c||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let n={...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={...n.computedFilterValue,filter:{...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){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=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;n.computedFilterValue?(u={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:c}},s.defaultFilterValue!==void 0&&(u.filter.value=s.defaultFilterValue)):(u={filter:{operator:c,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(u.field=n.field)),u.id=n.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===n.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let n=this.getDataSourceState(),r=n.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=n.operatorsByFilterType[l],c=n.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,p=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:p}}}return a}).filter(Wl),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let n={...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 scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){let t=this.getState();t.scrollerDOMRef.current.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=this.getComputed(),i=n.brain.getScrollPosition(),a=t.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=n.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=n.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&(n.scrollerDOMRef.current.scrollTop=s.scrollTop),u&&(n.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!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(),c=n.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function Af(o){return new ql(o)}import{useEffect as _f,useRef as hC,useState as bC}from"react";var yC=10;function TC(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${Nn} > .${dl}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${An}`);if(t===!1&&d)return;let p=u.getAttribute("data-column-id"),f=c.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Ft.split(" ")),f.style.position="absolute",f.style.width="auto",u.appendChild(f);let m=f.offsetWidth;if(u.removeChild(f),!s[p]){let g=we().getComputedStyle(u);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+yC}if(m+=s[p],d){let g=0;u.childNodes.forEach(h=>{if(h!==c){let b=h,T=Math.max(b.offsetWidth,parseInt(b.style.width,10));if(isNaN(T)&&(T=0),g+=T,T>0){let C=we().getComputedStyle(b);g+=parseInt(C.marginLeft,10)+parseInt(C.marginRight,10)}}}),m+=g}r&&r.has(p)||n&&!n.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function Ff(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=je(),[a,l]=bC(0),s=typeof r=="object"?r.key:r,c=Ie(s),u=hC(null);_f(()=>{if(c()==null)return;let{current:p}=u,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),_f(()=>{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=d.includeHeader??m),u.current=s;let g=TC(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let b=o().columnSizing,T={...b},C=!1;h.forEach(S=>{T[S]={width:g[S]},C=C||T[S].width!==b[S]?.width}),C&&(e.columnSizing=T)},[s,n,a])}import{useMemo as DC}from"react";import{useCallback as PC,useEffect as yo,useRef as EC}from"react";import*as Fi from"react";function Of(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return zr(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}import*as ir from"react";var Nf=ue({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as Lf,useRef as CC}from"react";function SC(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 wC(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=Tf(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 vC(o,e){let t=CC(!1);return{currentRowCache:Lf(()=>({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 kf(o){let{rowDetailsCache:e,rowInfo:t}=o,{getState:n,componentActions:r}=De(),{getState:i}=Q(),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=vC(t.id,e),s=Lf(()=>{let c=n().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:Qe(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)});return}SC(t.id,{masterState:n(),detailContext:d}),requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)}),d.componentState.onCleanup.onChange(()=>{let p=a.get();p&&wC(t.id,{detailState:d.getState(),masterActions:r,masterState:n(),cacheEntryForRow:p})})}),shouldRestoreState:c}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}var{rootClassName:IC}=Me,RC=`${IC}RowDetail`;function xC(o){let e=Tr(),{domRef:t,rowDetailRenderer:n,rowDetailHeight:r,rowInfo:i,detailOffset:a,rowDetailsCache:l}=o,{masterDetailContextValue:s,currentRowCache:c}=kf({rowDetailsCache:l,rowInfo:i});return ir.createElement(e.Provider,{value:s},ir.createElement("div",{ref:t,className:Z(RC,Nf({})),style:{position:"absolute",top:`${a}px`,left:0,width:`calc(${$.bodyWidth} - ${$.scrollbarWidthVertical})`,height:r}},n(i,c)))}var zf=ir.memo(xC);var MC=1;function Vf(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,state:i,getState:a}=Q(),{computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:c,computedColumnsMap:u,computedRowHeight:d,computedRowSizeCacheForDetails:p,fieldsToColumn:f,rowspan:m,toggleGroupRow:g,columnSize:h}=e,{componentState:b,getState:T,componentActions:C,api:S}=De(),{dataArray:y,isNodeReadOnly:I}=b,w=Ie(y),{rowHeight:v,rowDetailHeight:R,onRowMouseEnter:x,onRowMouseLeave:D,groupRenderStrategy:M,brain:A,showZebraRows:E,rowDetailRenderer:_,isRowDetailExpanded:P,isRowDetailEnabled:F,cellClassName:N,cellStyle:G,rowStyle:H,rowDetailCache:B,rowClassName:pe,onScrollToTop:de,onScrollToBottom:k,onScrollStop:W,scrollToBottomOffset:se,wrapRowsHorizontally:ce,ready:ie}=i,oe=b.updatedAt;Of({columnSize:h,brain:A,computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:c,computedRowHeight:d,dataArray:y,bodySize:t,rowspan:m});let te=EC(0);yo(()=>A.onRenderCountChange(()=>{te.current=A.scrollTopMax}),[A]),yo(()=>A.onRenderRangeChange(U=>{a().onRenderRangeChange?.(U)}),[A]),yo(()=>A.onScrollStop(U=>{let{scrollTop:O,scrollLeft:re}=U;if(O===0&&de?.(),O+(se??MC)>=te.current){k?.();let{livePagination:ee,livePaginationCursor:Y,dataArray:le}=T();ee&&(C.cursorId=Y!==void 0?Date.now():le.length)}if(W){let ee=A.getRenderRange();W({scrollTop:O,scrollLeft:re,renderRange:ee,viewportSize:a().bodySize,firstVisibleRowIndex:ee.start[0],lastVisibleRowIndex:ee.end[0],firstVisibleColIndex:ee.start[1],lastVisibleColIndex:ee.end[1]})}}),[A,de,k,W]),yo(()=>{t.height&&(r.ready=!0)},[!!t.height]),yo(()=>{let{onReady:U}=a();U&&U({api:n,dataSourceApi:S})},[ie]);let[,fe]=_t();yo(()=>{fe()},[b]);let ne=PC(U=>{let{rowIndex:O,colIndex:re,heightWithRowspan:j,domRef:K,hidden:ee,width:Y,onMouseLeave:le,onMouseEnter:me}=U,Ee=w()[O],Ge=c[re];if(!Ee||!Ge)return null;let Ue=p?p.getRowHeight(O):j,Le=!1;!F||typeof F=="function"&&!F(Ee)?Le=!1:P&&(Le=P(Ee)?"expanded":"collapsed");let Ye=ce?A.getRowIndexInPage(O):null,We=ce?A.getPageIndexForRow(O):null;return Fi.createElement(kd,{...{getData:w,virtualized:!0,showZebraRows:E,groupRenderStrategy:M,rowIndexInHorizontalLayoutPage:Ye,horizontalLayoutPageIndex:We,rowIndex:O,rowInfo:Ee,hidden:ee,toggleGroupRow:g,rowHeight:Ue,rowDetailState:Le,onMouseEnter:me,onMouseLeave:le,onRowMouseEnter:x,onRowMouseLeave:D,domRef:K,width:Y,column:Ge,columnsMap:u,fieldsToColumn:f,rowStyle:H,rowClassName:pe,cellStyle:G,cellClassName:N}})},[v,R,x,D,p,d,P,w,c,u,f,M,ce,g,E,A,oe,I,H,pe,N,G]),V=DC(()=>{if(P)return U=>{let{rowIndex:O,domRef:re}=U,K=w()[O];if(!K||!P(K)||!p)return Fi.createElement("div",{ref:re,className:Uc.hidden});let{rowDetailHeight:ee,rowHeight:Y}=p.getSize(O);return Fi.createElement(zf,{rowInfo:K,rowDetailsCache:B,rowIndex:O,domRef:re,detailOffset:Y,rowDetailHeight:ee,rowDetailRenderer:_})}},[ie,ne,_,R,P,B]);return{renderCell:ne,renderDetailRow:V}}import{useEffect as XC,useState as es}from"react";var Oi=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,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,n,r){if(r.horizontalLayout&&!jl(e,t,r)){Rf(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=Ai(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let c=i.rowIndex;c<=a.rowIndex;c++)for(let u=i.colIndex;u<=a.colIndex;u++){let d=this.getCellSelectionPosition({rowIndex:c,colIndex:u});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,n){this.setRangeSelected(e,t,!1,n)}selectRange(e,t,n){this.setRangeSelected(e,t,!0,n)}};function Gf(o,e){return o<e?[o,e]:[e,o]}var Ni=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[n,r]=Gf(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[n,r]=Gf(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let 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 AC}from"react";function Hf(o){let{getState:e}=De();return AC(()=>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,c=o[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}import{useCallback as _C}from"react";var Ez=ut("useColumnSizeFn");function Kf(o){return _C(t=>{let n=o[t];return n?n.computedWidth:0},[o])}import{useEffect as To,useLayoutEffect as LC,useMemo as kC}from"react";import{createRef as Hn}from"react";var FC={scrollLeft:0,scrollTop:0},ar=class{constructor(){this.scrollPosition=FC;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 Bf(o,e){let t=new Map;function n(r){return e[r]!==!1}return Object.keys(o).forEach(r=>{let a=o[r].columnGroup,l=0;for(n(r)||(l=-1);a;){let s=o[a];if(!s)break;n(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}import*as Wf from"react";function jf(o){return(e,t)=>Wf.createElement(o,{key:e.id,rowInfo:e,cache:t})}var lr=class extends Sn{constructor(t,n){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,n,r,i){if(t==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(t,n,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let c=l-s*this.pageWidth,u=[];for(let d=0;d<this.initialCols;d++)u.push(this.getItemSize(d,t));return a+=Ir(c,u.concat(u)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let n=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:n,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let n=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,n=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(t){let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,p=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof n=="number",m=typeof r=="number",g=f&&n!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=n,this.rows=n),m&&h&&(this.initialCols=r,this.cols=r);let b=i!=null,T=a!=null,C=b&&i!==this.rowHeight,S=T&&a!==this.initialColWidth;b&&(this.rowHeight=i),T&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let y=g||C||p,I=h||S||d||y;(I||y)&&this.updateRenderCount({horizontal:I,vertical:y})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=Vt){let n=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/n);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(n=>{Ae(()=>{this.destroyed||t.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(t,n){return this.initialCols*(n?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var $f={};function Xl(o){return`.${On}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Zl(o,e){let t=nn(o),n=e?new lr(t,{isHeader:!1}):new Sn(t),r=`${t}:header`,i=e?new lr(r,{isHeader:!0,masterBrain:n}):new Sn(r);n.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=Lo(n),{renderer:s,onRenderUpdater:c}=Lo(i);return n.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function Uf({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Zl(o,!!e),c=Hn();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:u=>{if(!c.current)return null;let d=Xl(u);return c.current.querySelector(d)||null},brain:n,headerBrain:r,domRef:c,columnMenuTargetRef:Hn(),editingValueRef:Hn(),scrollerDOMRef:Hn(),portalDOMRef:Hn(),focusDetectDOMRef:Hn(),activeCellIndicatorDOMRef:Hn(),onColumnMenuClick:ge(),cellContextMenu:ge(),contextMenu:ge(),onFilterOperatorMenuClick:ge(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:ge(),onRowHeightCSSVarChange:ge(),onRowDetailHeightCSSVarChange:ge(),onColumnHeaderHeightCSSVarChange:ge(),cellClick:ge(),cellMouseDown:ge(),keyDown:ge(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:t,columnVisibilityForGrouping:{},pinnedStartScrollListener:new ar,pinnedEndScrollListener:new ar,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Yf=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new rr(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e||"",keyboardSelection:e=>e??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??$f,columnGroupVisibility:e=>e??$f,columnSizing:e=>e||{},columnTypes:e=>e||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:e=>e??"replace",collapsedColumnGroups:e=>e??new Map,columnGroups:1});function OC(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 qf=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.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 Xf(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 Li=new WeakMap;function Zf(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Qf=o=>{let{props:e,state:t,oldState:n,parentState:r}=o,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=n?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=n?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=n?.pivotColumnGroups?Bf(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=OC({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let h=Li.get(d);h||(h=jf(d),Li.set(d,h)),u=h}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof St)&&(c=new St(c)),c=c||new St({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=c?e.isRowDetailExpanded:void 0;!f&&c&&(f=Li.get(c),f||(f=h=>c.isRowDetailsExpanded(h.id),typeof c=="object"&&Li.set(c,f)));let m=u?e.isRowDetailEnabled||!0:!1,g={isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||ae.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=jt.get(t.debugId);h&&(g={...g,...h})}return g};function Jf(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 em(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l={...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,c=0,u=r.length;for(let d=0;d<u;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(c=Math.max(c,f.groupNesting-1),c===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>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}import{useCallback as NC}from"react";function Ql(){let{getState:o,componentActions:e,getDataSourceMasterContext:t}=De();return NC(r=>{let i=o(),a=new mt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[fn,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||Gn(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=J.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=xt())}},[])}function zC(o){return kC(()=>Xf(o),[o])}function tm(){let{componentState:{groupBy:o},componentActions:e}=De(),{componentState:{groupRenderStrategy:t,pivotTotalColumnPosition:n,pivotGrandTotalColumnPosition:r}}=je();To(()=>{e.generateGroupRows=t!=="inline"},[t]),To(()=>{e.pivotTotalColumnPosition=n},[n]),To(()=>{r!=null&&(e.pivotGrandTotalColumnPosition=r)},[r]);let i=zC(o);VC(i);let{toggleGroupRow:a}=GC();return HC(i),{toggleGroupRow:a}}function VC(o){let e=Ql(),{componentActions:t,componentState:{columns:n,groupRenderStrategy:r,isTree:i}}=je();function a(l,s,c,u){let d={};if(c==="inline")return Object.keys(l).forEach(p=>{let f=l[p],m={},g=s.get(f.field);if(g&&c==="inline"){let{groupIndex:b}=g;m={groupByForColumn:g.groupBy,field:g.groupBy?.field,valueGetter:g.groupBy?.valueGetter,valueFormatter:({rowInfo:T})=>T.isGroupRow?T.groupKeys?.[b]:T.value,rowspan:({rowInfo:T,dataArray:C})=>{if(T.isTreeNode||!T.isGroupRow)return 1;let S=C[T.indexInAll-1]||{indexInParentGroups:[]};if(!S||!S.dataSourceHasGrouping)return 1;let y=S.indexInParentGroups||[],I=T.indexInParentGroups||[],w=!1;for(let x=0;x<=b;x++){let D=y[x];if(I[x]!==D){w=!0;break}}if(!w)return 1;let v=T.parents[b];return v?v.groupCount-(v.collapsedChildrenCount||0)+(v.collapsedGroupsCount||0):1},renderGroupIcon:ni({groupIndexForColumn:b,groupRenderStrategy:c,toggleGroupRow:u,initialRenderGroupIcon:f.renderGroupIcon}),render:ti({groupIndexForColumn:b,groupRenderStrategy:c})}}let h={...m,...f};d[p]=h}),Object.keys(d).length===0?void 0:d}To(()=>{(()=>{t.columnsWhenInlineGroupRenderStrategy=i?void 0:a(n,o,r,e)})()},[n,o,r,e])}function GC(){let{componentState:{groupBy:o,pivotBy:e,selectionMode:t}}=De(),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:p}=je(),f=Ql();return To(()=>{(()=>{let{columns:g,groupColumnIds:h}=KC({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=g;let b=p().columnOrder;if(h.length&&Array.isArray(b)){let T=new Set(b),C=!1;h.forEach(S=>{T.has(S)||(C=!0,b=[S,...b])}),C&&(n.columnOrder=b)}})()},[r,o,e,t,a,i,l,s,u,c]),{toggleGroupRow:f}}function HC(o){let{componentState:{dataArray:e,groupRowsIndexesInDataArray:t,groupBy:n,groupRowsState:r,originalLazyGroupDataChangeDetect:i},getState:a}=De(),{getComponentState:l,componentActions:s,componentState:{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}}=je();LC(()=>{if(f!=="multi-column")return;let m=l(),g=Jf(u,o),h=em({computedGroupColumns:g,columnVisibility:m.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:t,dataArray:e,groupBy:n,groupByMap:o});Tt(m.columnVisibility,h)||(s.columnVisibility=h)},[a,f,i,n,o,u,p?e:null,p?r:null,p?t:null,p]),To(()=>{let m=n.length>0,g=l(),{columnVisibility:h,columnVisibilityForGrouping:b,hideColumnWhenGrouped:T}=g,C={...h},S={...b},y=!1,I=new Set,w=new Set;Object.keys(u).forEach(v=>{let R=u[v];if(R.defaultHiddenWhenGroupedBy||T!=null)if(R.defaultHiddenWhenGroupedBy==="*"&&m||(R.defaultHiddenWhenGroupedBy===!0||T)&&R.field&&o.get(R.field)||typeof R.defaultHiddenWhenGroupedBy=="string"&&o.get(R.defaultHiddenWhenGroupedBy)||typeof R.defaultHiddenWhenGroupedBy=="object"&&Object.keys(R.defaultHiddenWhenGroupedBy).reduce((D,M)=>D||o.has(M),!1)){if(S[v]!==!1){if(h[v]===!1)return;S[v]=!1,y=!0,I.add(v)}}else S[v]===!1&&(delete S[v],y=!0,w.add(v))}),y&&(s.columnVisibilityForGrouping=S,w.forEach(v=>{delete C[v]}),I.forEach(v=>{C[v]=!1}),s.columnVisibility=C)},[u,c,n,o,d])}function KC(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=o;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(c==="multi-column")t.forEach((m,g,h)=>{let b=xd({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:c,selectionMode:r},u,i),T=b.id||`group-by-${m.field||m.groupField}`;f.push(T),p[T]=b});else if(c==="single-column"&&t.length){let m=Dd({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";f.push(g),p[g]=m}if(e){let m={};Object.keys(d).forEach(g=>{let h=d[g];h.field&&(m[h.field]=h)}),Object.keys(e).forEach(g=>{let h=e[g],b=h.pivotTotalColumn&&h.columnGroup,T=h.pivotTotalColumn&&!h.columnGroup;if(b&&a===!1||T&&l===!1)return;let C={...h};s&&(typeof s=="function"?C={...C,...s({column:C,pivotBy:n,groupBy:t})}:C={...C,...s}),C.inheritFromColumn!==!1&&(C={...typeof C.inheritFromColumn=="string"?d[C.inheritFromColumn]:C.pivotAggregator?.field?m[C.pivotAggregator?.field]:void 0,...C}),!C.render&&C.renderValue&&(C.render=S=>C.renderValue(S)),p[g]=C})}else Object.keys(d).forEach(m=>{let g=d[m];p[m]=g});return{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}import{useMemo as BC}from"react";var nm=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:c,columnDefaultDraggable:u,sortInfo:d,multiSort:p,filterValue:f,filterTypes:m,columnOrder:g,columnPinning:h,editable:b,columnDefaultEditable:T,columnDefaultFilterable:C,columnDefaultGroupable:S,columnDefaultSortable:y,scrollbarWidth:I,columnTypes:w,pinnedEndMaxWidth:v,pinnedStartMaxWidth:R,viewportReservedWidth:x,resizableColumns:D,columnVisibility:M,columnVisibilityAssumeVisible:A,columnSizing:E,groupBy:_})=>{let{computedRemainingSpace:F,computedColumnOrder:N,computedVisibleColumns:G,computedVisibleColumnsMap:H,computedPinnedStartColumns:B,computedPinnedEndColumns:pe,computedUnpinnedColumns:de,computedPinnedStartColumnsWidth:k,computedPinnedEndColumnsWidth:W,computedUnpinnedColumnsWidth:se,computedUnpinnedOffset:ce,computedPinnedEndOffset:ie,computedPinnedEndWidth:oe,computedPinnedStartWidth:te,renderSelectionCheckBox:fe,computedColumnsMap:ne,computedColumnsMapInInitialOrder:V,fieldsToColumn:U}=BC(()=>_u({columns:o,scrollbarWidth:I,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:x,resizableColumns:D,filterValue:f,filterTypes:m,sortable:a,sortInfo:d,multiSort:p,pinnedEndMaxWidth:v,pinnedStartMaxWidth:R,draggableColumns:c,columnDefaultDraggable:u,columnOrder:g,columnPinning:h,columnDefaultEditable:T,columnDefaultFilterable:C,columnDefaultGroupable:S,columnDefaultSortable:y,editable:b,columnSizing:E,columnTypes:w,columnVisibility:M,columnVisibilityAssumeVisible:A??!0,groupBy:_}),[o,e.width,t,n,r,x,I,a,d,p,f,m,g,M,A,u,c,D,v,R,E,w,h,T,C,S,b,_,1]);return{renderSelectionCheckBox:fe,columns:o,computedColumnsMap:ne,computedPinnedEndWidth:oe,computedPinnedStartWidth:te,computedRemainingSpace:F,computedUnpinnedOffset:ce,computedPinnedEndOffset:ie,computedPinnedStartColumnsWidth:k,computedPinnedEndColumnsWidth:W,computedUnpinnedColumnsWidth:se,computedPinnedStartColumns:B,computedPinnedEndColumns:pe,computedUnpinnedColumns:de,computedVisibleColumns:G,computedVisibleColumnsMap:H,computedColumnOrder:N,computedColumnsMapInInitialOrder:V,fieldsToColumn:U}};import{useMemo as WC}from"react";var Jl=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),n=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:n,totalRowHeight:t+n}}};function jC(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],p=d?n(d):0;return e&&e.rowHeight.set(u,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return u=>{if(e&&e.rowHeight.has(u)&&e.rowDetailHeight.has(u))return e.rowHeight.get(u)+e.rowDetailHeight.get(u);let d=a().dataArray[u];if(!d)return e&&(e.rowHeight.set(u,0),e.rowDetailHeight.set(u,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,m)),p+m}}function om(o){return WC(()=>{let e=new Jl;return{computedRowHeight:jC(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}},[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}import{useState as $C,useEffect as UC,useLayoutEffect as YC}from"react";var qC={vertical:!1,horizontal:!1};function rm(o){let{getComponentState:e}=je(),{getState:t}=De(),[n,r]=$C(qC);return UC(()=>o.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=o;r({vertical:i>0,horizontal:a>0})}),[o]),YC(()=>{let i=t(),{onScrollbarsChange:a}=e(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function im(){let{componentActions:o,componentState:e}=je(),{componentActions:t,componentState:n,getState:r,api:i}=De(),{columnOrder:a,columnVisibility:l,columnPinning:s,columnSizing:c,editable:u,columnDefaultEditable:d,columnDefaultFilterable:p,columnDefaultGroupable:f,columnTypes:m,rowHeight:g,rowDetailHeight:h,isRowDetailExpanded:b,isRowDetailEnabled:T,brain:C,bodySize:S,showSeparatePivotColumnForSingleAggregation:y}=e;es(()=>{e.onRowHeightCSSVarChange.onChange(Y=>{Y&&(o.rowHeight=Y)}),e.onFlashingDurationCSSVarChange.onChange(Y=>{let le=Y?Y*1:null;le!=null&&!isNaN(le)&&(o.flashingDurationCSSVarValue=le)}),e.onRowDetailHeightCSSVarChange.onChange(Y=>{Y&&(o.rowDetailHeight=Y)}),e.onColumnHeaderHeightCSSVarChange.onChange(Y=>{Y&&(o.columnHeaderHeight=Y)})}),XC(()=>{t.showSeparatePivotColumnForSingleAggregation=y},[y]);let{multiSort:I,filterValue:w,filterTypes:v,groupBy:R}=n,{toggleGroupRow:x}=tm(),D=e.computedColumns,{computedColumnOrder:M,computedVisibleColumns:A,computedVisibleColumnsMap:E,computedPinnedStartColumns:_,computedPinnedEndColumns:P,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:N,computedPinnedEndColumnsWidth:G,computedUnpinnedColumnsWidth:H,computedUnpinnedOffset:B,computedPinnedEndOffset:pe,computedRemainingSpace:de,computedPinnedStartWidth:k,computedPinnedEndWidth:W,renderSelectionCheckBox:se,computedColumnsMap:ce,computedColumnsMapInInitialOrder:ie,fieldsToColumn:oe}=nm({columns:D,scrollbarWidth:void 0,columnCssEllipsis:e.columnCssEllipsis,columnHeaderCssEllipsis:e.columnHeaderCssEllipsis,columnMinWidth:e.columnMinWidth,columnMaxWidth:e.columnMaxWidth,columnDefaultWidth:e.columnDefaultWidth,columnDefaultFlex:e.columnDefaultFlex,columnDefaultSortable:e.columnDefaultSortable,columnDefaultDraggable:e.columnDefaultDraggable,pinnedStartMaxWidth:e.pinnedStartMaxWidth,pinnedEndMaxWidth:e.pinnedEndMaxWidth,bodySize:S,viewportReservedWidth:e.viewportReservedWidth,resizableColumns:e.resizableColumns,sortable:e.sortable,draggableColumns:e.draggableColumns,sortInfo:n.sortInfo??void 0,multiSort:I,groupBy:R,columnOrder:a,columnVisibility:l,columnVisibilityAssumeVisible:!0,columnPinning:s,editable:u,columnDefaultEditable:d,columnDefaultFilterable:p,columnDefaultGroupable:f,filterValue:w,filterTypes:v,columnSizing:c,columnTypes:m}),te=Hf(A),fe=Kf(A),ne=rm(C),V=k?N>k:!1,U=W?G>W:!1,[O]=es(()=>new Ni({isRowDisabledAt:le=>r().dataArray[le]?.rowDisabled??!1,getIdForIndex:le=>r().dataArray[le]?.id??-1})),re=Ie(A),[j]=es(()=>new Oi({getPrimaryKeyByIndex:i.getPrimaryKeyByIndex,getColumnIdByIndex:Y=>re()[Y]?.id||""})),{computedRowHeight:K,computedRowSizeCacheForDetails:ee}=om({rowDetailHeight:h,rowHeight:g,isRowDetailsExpanded:b,isRowDetailsEnabled:T,getDataSourceState:r});return{multiRowSelector:O,multiCellSelector:j,computedRowSizeCacheForDetails:ee,computedRowHeight:K,scrollbars:ne,columnSize:fe,rowspan:te,toggleGroupRow:x,computedColumnsMap:ce,computedColumnsMapInInitialOrder:ie,renderSelectionCheckBox:se,computedPinnedStartOverflow:V,computedPinnedEndOverflow:U,computedPinnedStartWidth:k,computedPinnedEndWidth:W,computedVisibleColumns:A,computedColumnOrder:M,computedRemainingSpace:de,computedVisibleColumnsMap:E,computedPinnedStartColumns:_,computedPinnedEndColumns:P,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:N,computedPinnedEndColumnsWidth:G,computedUnpinnedColumnsWidth:H,computedUnpinnedOffset:B,computedPinnedEndOffset:pe,fieldsToColumn:oe}}import{useMemo as oS}from"react";function ZC(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 QC(){return 4294967295}function JC(o,e,t){return e=e>>>8^o[t^e&255],e}function eS(o){return o=~o,o=o<0?4294967295+o+1:o,o}function ts(o,e=3988292384){var t=ZC(e),n=0,r;for(n=QC(),r=0;r<o.length;r++)n=JC(t,n,o.charCodeAt(r));return n=eS(n),`${n}`}var tS=o=>{let e=o.reduce((n,r)=>(n.set(r.name,r.value),n),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},am=(o,e=console.error.bind(console))=>{o=["* * * infinite-table.com * * *",...o];let t=Math.max(Math.max(...o.map(n=>n.length))+8,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))},lm=(o="",e,t)=>{let n;try{n=nS(o)}catch{return am(["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?(am([`
|
|
28
28
|
Your Infinite Table license has expired on ${i.toDateString()}.
|
|
29
|
-
`,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),!1):!0},FT=n=>{let e="",t=n.split("|").map(l=>{let[s,u]=l.split("=");return s==="C"&&(e=u),{name:s,value:u}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let u=t[s];if(Il(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Il(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),_T(t)};var NT=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,LT=/(https):\/\/\S+(\.csb\.app)/g,sf=typeof window<"u"?window.location.origin:"",VT=()=>{let[n,e,t]=Array.from(NT.exec(sf)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},zT=()=>{let[n,e,t]=Array.from(LT.exec(sf)||[]);return e==="https"&&t===".csb.app"},GT=zT()||VT(),uf=(n="")=>{let t=!!Le();return OT(()=>{if(t)return!0;let r=lf(n,{publishedAt:1624970570587,version:"7.0.1"});return!n&&!r&>?!0:r},[n,t])};import{useRef as cf,useEffect as df}from"react";var KT=10;function pf(n,e,t){let o=cf(!1),r=cf(null);df(()=>{n!=null&&(o.current=!1,gt(r.current))},[n]),df(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,gt(r.current),r.current=ve(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<KT&&a(l)})};var i=a;a()}return()=>{gt(r.current)}},[n,e])}import{useRef as ff,useEffect as mf}from"react";var HT=10;function hf(n,e,t){let o=ff(!1),r=ff(null);mf(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),mf(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<HT&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}var gf=n=>`--infinite-${n}`;import{useCallback as ZT,useMemo as QT,useEffect as JT}from"react";function yf(n,e){wl(n,e),kT(n,e),e.detail===2&&BT(n,e),n.getState().onCellClick?.(n,e)}function BT(n,e){let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function kT(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=o(),{rowsPerPage:h}=f,g=p.length,y=new Ve(c);y.debugId=m??"",d.cellSelectionState=y;let C={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(C);else if(e.shiftKey){let S=!!o().wrapRowsHorizontally;d.multiSelectClick(C,S?{horizontalLayout:S,rowsPerPage:h,columnsPerSet:g}:{horizontalLayout:S})}else d.resetClick(C);l.cellSelection=y}function wl(n,e){let{rowIndex:t,getDataSourceState:o,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=n,{multiRowSelector:s,renderSelectionCheckBox:u}=r(),c=o(),{selectionMode:d,groupBy:p,dataArray:f,isTree:m}=c;if(p.length||m||f[t]?.rowDisabled)return!1;if(d==="multi-row"){if(u&&!e.key)return!1;let{rowSelection:g}=c;if(g=l(g),s.rowSelectionState=g,g&&typeof g=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=g,!0}else if(d==="single-row"){let y=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(y):a.rowSelectionApi.selectRow(y)}return!1}function Cf(n,e){e.detail!==2&&void 0}var WT={Enter:!0," ":!0,a:!0};function Tf(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=n,{key:u,ctrlKey:c,metaKey:d}=e;if(!WT[u])return!1;let p=t(),f=o(),{activeRowIndex:m,activeCellIndex:h,keyboardNavigation:g,keyboardSelection:y}=p,{selectionMode:C,groupBy:S,rowSelection:b,treeSelectionState:T,isTree:I}=f;if(y===!1)return!1;let R=g==="row"&&m!=null?m:g==="cell"&&h!=null?h[0]:null,w=R!=null?f.dataArray[R]:null;if(!w||R==null)return!1;if(C==="single-row"&&u===" ")return i.rowSelectionApi.toggleRowSelection(w.id),!0;if(C!=="multi-row")return!1;if(u==="a"&&(c||d)){if(I&&T){let x=s(T);return x.selectAll(),r.treeSelection=x,!0}let P=l(b);return P.selectAll(),r.rowSelection=P,!0}if(u===" "){if(S.length)return w.isGroupRow&&w.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(w.groupKeys):i.rowSelectionApi.toggleRowSelection(w.id),!0;if(I){if(w.isTreeNode&&w.nodePath)return a.treeApi.toggleNodeSelection(w.nodePath),!0}else{let P={...e},{renderSelectionCheckBox:x}=n.getComputed();return x&&(P.metaKey=!1,P.ctrlKey=!0),wl({...n,rowIndex:R},P)}}return!1}var Sf=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),bf=n=>Array.from(n.querySelectorAll(Sf)).filter(t=>!!t.offsetParent),mi=n=>n.querySelector(Sf);var If=tn(vo());async function Rf(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var jT=10,$T=(n,e)=>n-e;function hi(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=o(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[n.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===n.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[n.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",h=qe(p.id,e);return p.contentFocusable({column:p,...Vo({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:h,api:i,dataSourceApi:a})}function Pl(n,e,t){let o=t.getState().editingCell;return UT(n,e,t,{isCellFocusable:hi,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function wf(n,e,t){let o=(0,If.default)(t,n+e,$T);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=wf;function UT(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,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=n.rowIndex,c=n.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:wf(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}async function Pf(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=hi(e,n)?e:Pl(e,-1,n);if(t){await xl([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;mi(o)?.focus()}}async function xl([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=jT,l=null,s=!1;function u(c=0){c++,gt(l),l=ve(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&c<a&&u(c),s){try{await Rf(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var YT=`.${ho}`;function xf(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r||i&&t===-1)return!1;let a=i?null:xo(o,YT),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}=n.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&hi({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:Pl({rowIndex:l,colIndex:s},t,n);if(!u){if(t===-1)r.focus();else{let c=bf(document.body),d=n.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return xl([u.rowIndex,u.colIndex],n).then(()=>{let c=n.getState().getDOMNodeForCell(u);if(!c)return;mi(c)?.focus()}),!0}var Df={control:"ctrl"},vf={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},qT={esc:"escape"},Ef={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},Mf=Object.keys(Ef),Dl=new Set(Mf),XT=new Set(["shift","alt"]);function vl(n,e){return Array.isArray(e)?e.some(t=>Af(n,t)):Af(n,e)}function Af(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(p=>p.toLowerCase().trim()),r=o.find(p=>vf[p]),i=o.map(p=>Df[p]||vf[p]||qT[p]||p),a=i.filter(p=>Dl.has(p)),l=i.filter(p=>!Dl.has(p)),s=Mf.reduce((p,f)=>(p[f]=Ef[f](n),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=>!XT.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||Dl.has(t)||t==="meta"||Df[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function _f(n,e){let t={...n,cloneRowSelection:a=>Zr(a,n.getDataSourceState),cloneTreeSelection:a=>ti(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&Tf(t,e)&&e.preventDefault(),(xf(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&Dp(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,u=n.getComputed().computedVisibleColumns[s];u.computedEditable&&n.api.startEdit({rowIndex:l,columnId:u.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!vl(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function eS(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=X(),{getState:i,componentActions:a,api:l}=Ie();return QT(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>ti(c,i),cloneRowSelection:c=>Zr(c,i)}),[n,e,i,a,t,l,o])}function tS(){let n=eS();JT(()=>{let e=n.getState().keyDown.onChange(a=>{_f(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],u=qe(s.id,n);yf({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=n.getComputed().computedVisibleColumns[u],d=qe(c.id,n);Cf({...n,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function oS(){let{getState:n}=X();return{onKeyDown:ZT(t=>{n().keyDown(t)},[])}}function Ff(){return tS(),oS()}import{useEffect as im}from"react";import*as Me from"react";import{useCallback as El,useEffect as aS,useLayoutEffect as lS,useState as yi}from"react";import{createPortal as sS}from"react-dom";var Oe=class{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new Oe(e)}static from(e){return new Oe(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,o=e.left-this.left;return{top:t,left:o}}};function Of(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Nf(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function nS(n,e,t){let o=Of(n,t),r=Of(e,t);return o===r?Nf(t,e)-Nf(t,n):o-r}function rS(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>nS(o,r,t)),e}function Lf(n,e){n=rS(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(iS([t,i,a],e))return!0}return!1}function iS(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var qo=class{containsPoint(e){return Lf(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var to=class extends qo{constructor(t){super();this.points=t.map(Oe.clone)}static clone(t){return new to(t)}getPoints(){return this.points}shift(t){return this.points.forEach(o=>{o.shift(t)}),this}};var Pe=class extends qo{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 Pe(t)}static clone(t){return new Pe(t)}static from(t){return Pe.clone(t)}static fromPoint(t){return Pe.from({top:t.top,left:t.left,width:0,height:0})}containsPoint(t){return new to(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(Oe.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};function Al(n){return!!n.tagName}function Gf(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=Pe.from(Al(e)?e.getBoundingClientRect():e),a=Pe.from(Al(t)?t.getBoundingClientRect():t),l=o?Pe.from(Al(o)?o.getBoundingClientRect():o):null;if(!l)return{...Vf({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=Vf({anchorRect:a,targetRect:i,position:r[u],constrainRect:l});if(u===0&&(s={...d,index:0}),d.valid)return{...d,index:u}}return s}function Vf(n){let e=Pe.from(n.targetRect),t=Pe.from(n.anchorRect),o=n.constrainRect?Pe.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=zf(e,i),s=zf(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function zf(n,e){return e==="TopLeft"?Oe.from({top:n.top,left:n.left}):e==="TopCenter"?Oe.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?Oe.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?Oe.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?Oe.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?Oe.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?Oe.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?Oe.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):Oe.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}var gi="__is_infinite_menu_component";function uS(n){return n&&typeof n.then=="function"||n instanceof Promise}function Bf(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function Kf(n){return typeof n=="function"&&(n=n()),uS(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&Bf(n)&&(n=n.getBoundingClientRect()),n?Pe.from(n):null}async function cS(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),Bf(o)&&(r=o),r||null}return t(await e)}function dS(n){return Me.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function pS(n){let e=Me.useRef(null);return aS(()=>n.realign.onChange(t=>{e.current&&t&&Hf(e.current,t)}),[n.realign]),Me.createElement("div",{style:{position:"absolute",top:0,left:0},ref:El(t=>{t&&Hf(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}async function Hf(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await Kf(t)||void 0,a=o?await Kf(o):void 0,l=Pe.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Gf({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=n.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=n.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,h=s.top-f;n.style.transform=`translate3d(${m}px,${h}px, 0px)`}}}function fS(n,e){let[t,o]=yi(null);return lS(()=>{async function r(){let i=e?await cS(e):null;i!=null&&o(i)}e&&r()},[e]),e?t?sS(n,t):Me.createElement(Me.Fragment,null):e===null||e===!1?n:Me.createElement(dS,null,n)}function mS(n){if(Me.Children.count(n)===1){let e=Me.Children.only(n);if(Me.isValidElement(e))return e.props.id||e.key}return null}function hS(n,e,t){if(Me.Children.count(n)===1){let o=Me.Children.only(n);if(Me.isValidElement(o)&&o.type[gi]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),Me.cloneElement(o,r)}}return n}globalThis.allhandles={};globalThis.thehandles={};function Kt(n){let e=n,[t]=yi(()=>new Map),[o,r]=yi(null),[i,a]=yi(0),l=El(()=>{let m=[];for(let[h,g]of t)m.push(Me.createElement(pS,{...g,key:g.key}));return m},[]),[s,u]=Rt(),c=fS(l(),n.portalContainer),d=El((m,h)=>{let y=`${h.id||mS(m)||Ct()}`,C=t.get(y),S=I=>()=>{let R=typeof I=="function"?I():I;return hS(R,e.portalContainer,h.constrainTo??e.constrainTo)},b=S(m),T=(I,R)=>{if(!C)return;let w=S(I);Object.assign(C,{children:w}),u(),!!!R?.skipRealign&&(r(C.key),a(Date.now()))};return C?(Object.assign(C,h),T(m),T):(C={key:y,children:b,alignPosition:h.alignPosition,alignTo:h.alignTo,constrainTo:h.constrainTo,realign:pe()},t.set(C.key,C),u(),T)},[t,e.portalContainer,u]);Me.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return Me.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}import*as nm from"react";import*as Zo from"react";import*as Xo from"react";import*as kn from"react";function Ci(n){return null}Ci.defaultProps={__is_menu_item:!0};var kf="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw16 _16lm1iw1n _16lm1iw8",Wf=ye({defaultClassName:"db3arf2 _16lm1iwz _16lm1iw1r _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"]]}),jf="db3arf1",$f="db3arfd";var gS="-";function yS(){return kn.createElement("hr",{className:$f})}var Ti=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===gS?kn.createElement(yS,null):r:null;return i!=null?{type:"item",parentMenuId:o,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}};function Uf(n,e){return kn.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Ci)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),Ti(n,o)}return Ti(n,t)})||[]}var Yf="submenu";function qf(){let n=Xo.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Ct(),focused:!1,destroyed:!1,domRef:n}}var Xf=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),CS=[{name:"label"}],Zf=n=>{let{props:e,state:t}=n,{activeItemKey:o,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||CS],d={columns:c,keyboardActiveItemKey:r,activeItemKey:o,menuId:u},p=[];i?p=i.map(Ti.bind(null,d)):!i&&typeof a!="function"&&(p=Uf(d,a)),l&&p.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!c.find(h=>h.name==Yf)&&c.push({name:Yf,render:({domProps:h,item:g})=>g.menu?Xo.createElement("div",{...h},Xo.createElement(fo,{expanded:!1})):Xo.createElement("div",{...h})});let f=p.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:p,runtimeSelectableItems:f,columns:c,menuId:u}};import*as St from"react";import{useCallback as Io,useLayoutEffect as DS,useRef as vS,useState as Fl}from"react";var Wn=class extends to{constructor(e){super(e.slice(0,3))}};var TS=250;function SS(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}ve(i)};ve(()=>{i()})})}var bS=Ee(),Si=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||TS;this.getPointerMoveTarget=()=>document.documentElement||bS;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 Oe({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 Wn([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Wn([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,SS(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Oe({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};import{createContext as RS,useContext as IS}from"react";var Ml=RS(null);function _l(){return IS(Ml)}import{useCallback as wS,useEffect as PS,useRef as xS}from"react";function Qf(){let n=xS(!0);return PS(()=>(n.current=!0,()=>{n.current=!1}),[]),wS(()=>n.current,[])}function AS(n,e){let{parentMenuId:t,setSubmenuApi:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,u=`${t}-submenu`,c=n.menu;return c?(typeof c=="function"&&(c=c()),St.createElement(xt,{key:u,parentMenuItemKey:n.key,parentMenuId:t,constrainTo:a,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),o(p)},onHideIntent:d=>{c?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(n.key),s.focus())}})):null}function ES(n,e){let t=Jf(n,e);if(!t.length)return null;let o=Pe.from(t[0]?.getBoundingClientRect()),r=Pe.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function Jf(n,e){let t=xo(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function MS(n,e){let t=Jf(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function _S({onItemActivate:n}){let{getState:e}=_l(),[{onItemEnter:t,onItemLeave:o}]=Fl(()=>new Si({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?Pe.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:Io(t,[]),onItemLeave:Io(o,[])}}function em(n){let{domProps:e}=n,{componentState:{columns:t,runtimeItems:o,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}=_l(),C=Io(z=>{g.keyboardActiveItemKey=z},[]),S=Io(z=>{g.activeItemKey=z},[]),b=Qf(),[T,I]=Fl(null),R=null;DS(()=>{let{runtimeItems:z}=y(),k=z.filter(ae=>ae.type==="item"&&i===ae.key)[0];if(!k||!k.menu){I(null),D();return}if(k){let ae=ES(r,k.key);ae&&P(()=>AS(k,{constrainTo:l,setSubmenuApi:I,setActiveItemKey:S,setKeyboardActiveItemKey:C,parentMenuId:r,onHideIntent:$,api:te}),{id:`${r}-submenu`,alignTo:ae,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let w=(z,k)=>{C(k.key),S(k.key),k.originalMenuItem.onClick&&k.originalMenuItem.onClick(z);let ae={key:k.key,item:k.originalMenuItem,hideMenu:$};k.originalMenuItem.onAction&&k.originalMenuItem.onAction(ae),u&&u(ae),k.originalMenuItem.hideMenuOnAction&&$()},{showOverlay:P,portal:x,clearAll:D}=Kt({portalContainer:!1}),{onItemEnter:A,onItemLeave:_}=_S({onItemActivate:z=>{if(!b())return;let k=z?z.key:null;S(k)}});R=o.map((z,k)=>St.createElement(FS,{key:z.type==="item"?z.key:k,onItemEnter:(ae,oe)=>{A(ae.key,oe)},onItemLeave:(ae,oe)=>{_(ae.key,oe)},columns:t,active:z.type==="item"&&z.key===i,keyboardActive:z.type==="item"&&z.key===a,item:z,index:k,onClick:w}));let E=t.map(z=>z.width||(typeof z.flex=="number"?`${z.flex}fr`:z.flex)||"auto").join(" "),F={...e.style,gridTemplateColumns:E,gridTemplateRows:o.map(()=>"auto").join(" ")};c||(F.whiteSpace="nowrap");function v(z){let{runtimeItems:k,runtimeSelectableItems:ae}=y(),oe=k.findIndex(j=>j.type==="item"&&j.key===a),W=a,V=k[oe],L={ArrowUp:()=>{let j=k.slice(0,oe).filter(se=>se.type==="item"&&!se.disabled).pop();j&&j.type==="item"&&j.key&&(W=j.key)},ArrowDown:()=>{let j=k.slice(oe+1).filter(se=>se.type==="item"&&!se.disabled)[0];j&&j.type==="item"&&j.key&&(W=j.key)},Home:()=>{L.PageUp()},End:()=>{L.PageDown()},PageUp:()=>{W=ae[0].key},PageDown:()=>{W=ae[ae.length-1].key},ArrowLeft:()=>{S(null),y().parentMenuId&&(g.destroyed=!0)},ArrowRight:()=>{V&&(S(V.key),ve(()=>{b()&&T&&T.getParentMenuId()===y().menuId&&T.focus()}))},Enter:()=>{if(V)if(V.originalMenuItem?.menu){if(V&&V.originalMenuItem.menu&&T){L.ArrowLeft();return}V&&S(V.key)}else w(z,V)}," ":()=>{if(!V)return;V.originalMenuItem.menu||w(z,V);let j=MS(r,V.key);j&&j.click()},Escape:()=>{L.ArrowLeft();let j=y();j.parentMenuId||j.onHideIntent?.(j)}},Z=L[z.key];Z&&(Z(),z.preventDefault()),W!=a&&C(W)}function M(){g.focused=!1}let N=Io(function(){g.focused=!0,setTimeout(()=>{G.current&&h.current&&h.current===document.activeElement&&y().keyboardActiveItemKey==null&&C(y().runtimeSelectableItems[0]?.key??null)})},[]),G=vS(!0),$=Io(()=>{let z=y();z.onHideIntent?.(z)},[y]),[te]=Fl(()=>({hideMenu:$,focus:()=>{h.current&&(h.current.focus(),setTimeout(()=>{h.current&&h.current!==document.activeElement&&h.current.focus()},10),N())},getMenuId:()=>y().menuId,getParentMenuId:()=>y().parentMenuId})),he=Io(z=>{z?(h.current=z,d?.(y(),te),f&&te.focus()):(p?.(y()),h.current=z)},[]),ue=St.createElement("div",{className:Mo.contents},St.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:he,onKeyDown:z=>{e.onKeyDown?.(z),v(z)},onMouseDown:z=>{G.current=!1,e.onMouseDown?.(z)},onMouseUp:z=>{G.current=!0,e.onMouseUp?.(z)},onFocus:N,onBlur:M,className:J(kf,e.className,"InfiniteMenu"),style:F},R),x);return s?null:ue}function FS(n){let[e,t]=St.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=r.type==="item"?r.value.key:i,u=null;if(r.type==="decoration")u=St.createElement("div",{style:r.style},r.value);else{let c=0;u=o.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 C={style:{...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(Wf({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||n.active}),r.className),onPointerEnter:S=>{r.disabled||n.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||n.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||n.onClick(S,r)}};return d.render?St.createElement(vn,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:C}}):St.createElement("div",{key:`${s}-${m}`,...C},f[m])}).filter(Boolean)}return St.createElement("div",{className:jf},u)}var{ManagedComponentContextProvider:OS}=Et({initSetupState:qf,forwardProps:Xf,mapPropsToState:Zf,layoutEffect:!0});function NS(n){let{componentActions:e,componentState:t}=Ke(),o=_e(t);return Zo.createElement(Ml.Provider,{value:{componentActions:e,componentState:t,getState:o}},Zo.createElement(em,{domProps:n.domProps}))}function xt(n){let{children:e,portalContainer:t,items:o,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,...C}=n;return Zo.createElement(OS,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...n},Zo.createElement(NS,{domProps:C}))}xt[gi]=!0;import*as tm from"react";function om(n,e){let{columnApi:t,column:o,getComputed:r,api:i}=e,l=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...l,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((d,p)=>{let f=Dr(d,e);u.push({key:p,label:f,check:tm.createElement(Ut,{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 rm(n,e,t){if(n==null)return null;let{getComputed:o,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??xt,s=o().computedColumnsMap.get(n);if(!s)return null;let u={column:s,columnApi:qe(s.id,e),...e},c=om([],u),d=a?a(c,u):c,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:nm.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var LS=`[${ka["data-name"]}="${Wa["data-name"]}"]`;function VS(n){let{columnId:e,context:t,clearAll:o,showOverlay:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){o(),a.columnMenuVisibleForColumnId=null}let c=n.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[${id["data-column-id"]}="${e}"] ${LS}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>rm(e,t,u),{constrainTo:s.current,id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function am(){let n=X(),e=Le(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});im(()=>{let{actions:u,getState:c}=n,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 im(()=>{let{columnMenuVisibleForColumnId:u,columnMenuTargetRef:c}=t();if(u){let p=function(f){f.__insideMenu!==!0&&(a(),o.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),VS({columnId:u,context:n,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else c.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}import*as lm from"react";import{useCallback as zS}from"react";var GS={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function sm(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=X(),{getState:a,getDataSourceMasterContext:l}=Ie(),{focusDetectDOMRef:s}=n(),u=zS(async()=>{Pf({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return lm.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:GS})}import{useEffect as jn}from"react";function KS(){let n=X(),{getState:e}=n,{editingCell:t}=e(),o=t&&!t.active?t.cancelled:void 0;jn(()=>{if(o){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...lt({rowIndex:r,columnId:i,...n}),initialValue:a})}},[o])}function HS(){let n=X(),{getState:e,state:{editingCell:t}}=n,o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;jn(()=>{if(o){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...lt({rowIndex:r,columnId:i,...n}),value:a,error:o,initialValue:l})}},[o])}function BS(){let n=X(),{state:{editingCell:e}}=n,t=e?.active,o=co(t);jn(()=>{!t&&o&&n.api.focus()},[t,o])}function kS(){let n=X(),{state:{editingCell:e},getState:t}=n,o=e&&!e.active&&!e.cancelled&&e.accepted===!0;jn(()=>{if(o){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,u={...lt({rowIndex:a,columnId:l,...n}),value:i,initialValue:s};t().onEditAccepted?.(u),n.api.persistEdit({value:i})}},[o])}function WS(){let n=X(),{state:{editingCell:e},getState:t}=n,o=e?e.persisted:void 0;jn(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:u,initialValue:c}=r,d={...lt({rowIndex:l,columnId:s,...n}),value:u,initialValue:c};o instanceof Error?i?.({...d,error:o}):a?.(d)}},[o])}function um(){KS(),HS(),kS(),WS(),BS()}import{useEffect as fm}from"react";import*as oo from"react";import*as Ol from"react";var cm=n=>Ol.createElement(Fe,{...n},Ol.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 Nl from"react";var dm=n=>Nl.createElement(Fe,{...n},Nl.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 pm(n,e,t){if(n==null)return null;let{getComputed:o,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:u}=e,{components:c,getFilterOperatorMenuItems:d}=r(),p=c?.Menu??xt,f=o().computedColumnsMap.get(n);if(!f)return null;let m=R=>{R.__insideMenu=!0},h=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:g}=i(),y=g[f.computedFilterType];if(!y)return null;let C=y.operators.map(R=>{let w=R.name,P=f.computedFilterValue?f.computedFilterValue.filter.operator===w:w===y.defaultOperator,x=R.components?.Icon??Oo;return{key:w,icon:oo.createElement(x,null),label:oo.createElement(oo.Fragment,null,R.label??R.name),onAction:()=>{u.setColumnFilterOperator(n,w)},checked:P?oo.createElement(dm,{size:16}):null}}),b=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{u.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:oo.createElement(cm,null),disabled:!f.computedFiltered,onAction:()=>{u.clearColumnFilter(n)}},"-"],...C],T={column:f,api:u,getState:r,getDataSourceState:i,getComputed:o,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:g},I=d?d(b,T):b;return oo.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:I,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:h,onHideIntent:R=>{h(R),t?.()}})}var bi=10;function mm(){let n=X(),e=Le(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return fm(()=>{let{actions:l,getState:s}=n;return s().onFilterOperatorMenuClick.onChange(c=>{if(!c)return;let{target:d,column:p}=c;function f(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=d?.parentElement||d,h=Pe.from(m.getBoundingClientRect());h.top-=bi,h.left-=bi,h.width+=2*bi,h.height+=2*bi,r(()=>pm(p.id,n,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})},[]),fm(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),o.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 Ii}from"react";import*as Gl from"react";import*as Ll from"react";function Ri(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function Vl(n){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),n.onHideIntent?.()}}}function zl(n,e,t){if(!n)return null;let o=pe();return n.then(r=>{let{items:i,columns:a}=Ri(r);i&&i.length&&o(Ll.createElement(t,{...e,items:i||[],columns:a}))}),Ll.createElement(Bt,{updater:o})}function hm(n,e,t){let{columnId:o,rowIndex:r,event:i}=n,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:u}=l(),c=s?.Menu??xt,{computedColumnsMap:d}=a(),p=d.get(o),f={...lt({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!u)return{cellContext:f,menu:null,preventDefault:!1};let m=Vl({onHideIntent:t}),h=u(f,e),g=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:f,menu:zl(h,m,c),preventDefault:g};let{items:y,columns:C}=Ri(h);return!y||!y.length?{cellContext:f,menu:null,preventDefault:Array.isArray(y)}:{preventDefault:g,menu:Gl.createElement(c,{...m,columns:C,items:y}),cellContext:f}}function gm(n,e,t){let{getState:o,getComputed:r}=e,{components:i,getContextMenuItems:a}=o(),l=i?.Menu??xt,{computedColumnsMap:s}=r(),u=n.columnId?s.get(n.columnId):void 0,c=u?{...n,...lt({...e,rowIndex:n.rowIndex,columnId:u.id})}:n;if(!a)return{cellContext:c,menu:null,preventDefault:!1};let d=Vl({onHideIntent:t}),p=a(c,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:c,menu:zl(p,d,l),preventDefault:f};let{items:m,columns:h}=Ri(p);return!m||!m.length?{cellContext:c,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:Gl.createElement(l,{...d,columns:h,items:m}),cellContext:c}}var wi=5,ym=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function Cm(){let n=X(),e=Le(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Ii(()=>{let{actions:l,getState:s,getDataSourceState:u}=n;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}=hm(d,n,f),y=Pe.fromPoint({top:p.clientY,left:p.clientX});y.width+=wi,y.height+=wi,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:ym}),g&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:C}=s();C&&C({...h,getState:s,getDataSourceState:u},p)})},[]),Ii(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),o.cellContextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function Tm(){let n=X(),e=Le(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Ii(()=>{let{actions:l,getState:s}=n;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}=gm(c,n,p),g={top:d.clientY,left:d.clientX},y=Pe.fromPoint(g);y.width+=wi,y.height+=wi,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:ym}),h&&d.preventDefault(),l.contextMenuVisibleFor={point:g,...c};let{onContextMenu:C}=s();C&&C({...n,...m},d)})},[]),Ii(()=>{let{contextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),o.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 US}from"react";import*as Sm from"react";import{useCallback as jS,useEffect as $S}from"react";function Kl(n,e){let{state:{brain:t}}=X(),o=jS(n,e);$S(()=>t.onScroll(o),[t,o])}var Hl="yzx0vj0";function bm(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=US(null);Kl(s=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-s.scrollLeft}px, 0px, 0px)`)},[r]);let l={...i.style};return e==="column"?l.width=le.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=le.runtime.bodyWidth),o==="column"?l.minWidth=le.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=le.runtime.bodyWidth),t==="column"?l.maxWidth=le.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=le.runtime.bodyWidth),Sm.createElement("div",{ref:a,...i,className:i.className?J(i.className,Hl):Hl,style:l},i.children)}var YS=Y(U.columnWidthAtIndex),qS=Y(U.columnOffsetAtIndex);function XS(){return X().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${YS}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${qS}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var Pi="InfiniteTable";import{useEffect as ZS}from"react";function Rm(){let{state:n,getState:e,actions:t}=X(),{wrapRowsHorizontally:o}=n,r=co(o);ZS(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=Tl(Pi,!!o);t.brain=u.brain,t.headerBrain=u.headerBrain,t.renderer=u.renderer,t.onRenderUpdater=u.onRenderUpdater}},[r,o])}import{useEffect as QS}from"react";function Im(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=X(),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),QS(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=o(),h=!1,g=l.rowsPerPage,y=(r&&r.length>0||i)&&g>0?g:null;return f!=y&&(t.rowsPerPage=y,h=!0),m!=u&&(t.repeatWrappedGroupRows=u??!1,h=!0),h};c();let d,p=l.onVerticalRenderRangeChange(()=>{c()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,u])}import{useEffect as xi,useRef as JS}from"react";var $n=ye({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),wm="_143ofgf5",Pm="_143ofgf3";var eb=Y(le.loaded),Bl={source:"infinite-table-page",target:"infinite-table-devtools-background"};function xm(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{...Bl,url:kl(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Bl,url:kl(),type:t,payload:{debugId:o,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(u=>u.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(u=>[u.id,{field:u.field,dataType:u.computedDataType,sortType:u.computedSortType,filtered:u.computedFiltered,sorted:u.computedSorted,width:u.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(u=>u.field?`${u.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(u=>typeof u.field=="string").map(u=>({field:`${u.field}`,dir:u.dir,type:Array.isArray(u.type)?u.type[0]:u.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)}}}}var kl=Ye(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function tb(n){window.postMessage(n)}var ob=Ye(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){ft.set(e,t);let{devToolsDetected:o}=t.getState();o||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(xm({type:"update",debugId:e},t))}else np(e),window.postMessage(xm({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,Ge.onLogIntent("*",e=>{tb({...Bl,url:kl(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>typeof t=="object"&&t!==null?JSON.stringify(t):String(t)),timestamp:e.timestamp}})}),n});function Dm(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=X(),o=n(),{domRef:r,debugId:i}=o;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(eb)!==`${Rs}`&&Nn({debugId:i,key:"CSS001_CSS"}),xi(()=>{e().debugId!==i&&(t.debugId=i)},[i]),ib()}var Di=pe(),nb={revertAll:n=>{let e=ft.get(n.debugId);if(e){let t=Jt.get(n.debugId);Jt.delete(n.debugId),Lt.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=zt.get(n.debugId);zt.delete(n.debugId),Vt.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=ft.get(n.debugId);if(e){let t=n.property,o=Lt.get(n.debugId),r=Jt.get(n.debugId),i=Vt.get(n.debugId),a=zt.get(n.debugId),l=t;r&&o&&o[l]!==void 0&&(delete o[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let u=zt.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=u[s],delete u[s]}}},discardWarning:n=>{let e=ft.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),Ln(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Ln(n.debugId))}}},discardAllWarnings:n=>{let e=ft.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Ln(n.debugId))},setColumnVisibility:n=>{ll(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{ii(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{ll(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{ii(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{ii(n.debugId,"multiSort",n.multiSort)},highlight:n=>{let e=ft.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${$n.classNames.base}`);r||(r=document.createElement("div"),r.classList.add($n.classNames.base),r.innerHTML=[`<div class="${Pm}"></div>`,`<div class="${wm}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${o.left}px`,r.style.top=`${o.top}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,i.innerHTML=n.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove($n.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add($n.classNames.variants.active.true)}}}}};function rb(){typeof window<"u"&&window.addEventListener("message",n=>{if(n&&n.data&&typeof n.data.source=="string"&&n.data.source.startsWith("infinite-table-devtools-contentscript")&&n.data.target==="infinite-table-page"&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(ob(),Di(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=nb[e];t&&t(n.data.payload)}})}rb();function ib(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,actions:r,dataSourceApi:i,api:a}=X(),s=n().debugId,u=JS(s);return u.current=s,xi(()=>{let c=u.current;if(!c)return;let d=f=>{f(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},p=Di.get();if(p){d(p);return}return Di.onChange(f=>{f&&d(f)})},[]),xi(()=>{let c=u.current;if(!c)return;let d=Di.get();d&&d(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),xi(()=>{if(s)return()=>{let c=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;c&&c(s,null)}},[s]),s}function ab(){let n=Le(),e=n?n.getMasterState():null,t=X().getState();return(e||t).portalDOMRef.current}var Mt=De.rootClassName,lb=[_c,"InfiniteColumnCell--hovered"],{ManagedComponentContextProvider:sb}=Et({initSetupState:$p,forwardProps:Up,mapPropsToState:Zp,cleanup:Yp,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Xp(),getParentState:()=>Po(),debugName:n=>kt(n.debugId,Pi)});function Am(){let n=X(),{state:e,getComputed:t}=n,{header:o,brain:r,headerBrain:i,wrapRowsHorizontally:a}=e,{scrollbars:l}=t();return o?me.createElement(Sd,{wrapRowsHorizontally:!!a,bodyBrain:r,headerBrain:i,scrollbars:l}):null}var vm=J(`${et}Body`,bn.relative,br[1],fu);function ub(n){return me.createElement("div",{...n,className:n.className?J(vm,n.className):vm})}function Em(){let n=X(),e=Le(),{state:t,getComputed:o,api:r}=n,{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,showHoverRows:C,wrapRowsHorizontally:S,domProps:b,domRef:T}=t,I=m?.LoadMask??$r,R=o(),{computedRowHeight:w,computedRowSizeCacheForDetails:P}=R,x=P?.getRowHeight||w,{componentState:{loading:D}}=Ie(),A=me.useCallback(M=>{let N=n.getState(),G=M.target;if(!e&&M._from_row_detail)return;e&&(M._from_row_detail=!0);let $=bs(G,Cl(),N.domRef.current),te,he,ue,z;$&&(he=Number($.dataset.colIndex),z=Number($.dataset.rowIndex),te=n.getComputed().computedVisibleColumns[he].id,ue=n.dataSourceApi.getRowInfoArray()[z].id);let k={columnId:te,colIndex:he,rowId:ue,rowIndex:z,event:M,target:$??M.target};$&&N.cellContextMenu(k),N.contextMenu(k)},[]),{renderCell:_,renderDetailRow:E}=zp({imperativeApi:r,getComputed:o,domRef:T,bodySize:h,computed:R}),{autoFocus:F,tabIndex:v}=b??{};return Rm(),me.createElement(ub,{onContextMenu:A},me.createElement(Js,{forceRerenderTimestamp:t.forceBodyRerenderTimestamp,debugId:l,tabIndex:v??0,autoFocus:F??void 0,activeRowIndex:t.ready&&s==="row"?u:null,activeCellIndex:t.ready&&s==="cell"&&!t.columnReorderDragColumnId?g:null,scrollStopDelay:d,renderer:i,wrapRowsHorizontally:S,onRenderUpdater:a,brain:p,activeCellRowHeight:x,renderCell:_,renderDetailRow:y?E:void 0,cellHoverClassNames:C?lb:void 0,scrollerDOMRef:f,scrollVarHostRef:T}),me.createElement(I,{visible:D},c))}var cb=me.memo(function(){let e=X(),t=Le(),{state:o,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=Ie(),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:h,rowDetailHeightCSSVar:g,columnHeaderHeightCSSVar:y,scrollStopDelay:C,brain:S,activeRowIndex:b,activeCellIndex:T}=o,{licenseKey:I}=o;!I&&no.licenseKey&&(I=no.licenseKey),hf(b,a.length,r),pf(T,a.length,r);let{onKeyDown:R}=Ff();me.useEffect(()=>{let G=l(),$=Dt(te=>{G.notifyRenderRangeChange({renderStartIndex:te[0],renderEndIndex:te[1]})},{wait:C});return S.onVerticalRenderRangeChange($)},[S,C]);let w=uf(I),{autoFocus:P,tabIndex:x,...D}=o.domProps??{},A=Cc(D);me.useEffect(()=>{S.setScrollStopDelay(C),s.scrollStopDelayUpdatedByTable=C},[C]),_p(),Im(),um();let{menuPortal:_}=am(),{menuPortal:E}=Cm(),{menuPortal:F}=Tm(),{menuPortal:v}=mm();me.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(o.id,o.ready,e.api,e)},[o.ready]);let M=Dm();me.useEffect(()=>{t&&(c.current=t.getMasterState().portalDOMRef.current)},[]);let N=i??me.createElement(me.Fragment,null,me.createElement(Am,null),me.createElement(Em,null));return me.createElement("div",{"data-debug-id":M,onKeyDown:R,ref:u,...A},N,me.createElement("div",{ref:c,className:J(`${et}Portal`,gu[1e7],bn.absolute,pu[0],uu[0])},_,E,F,v),h?me.createElement(sn,{key:"row-height",varName:h,onChange:d}):null,me.createElement(sn,{key:"flashing-duration",allowInts:!0,varName:le.components.Cell.flashingDuration,onChange:p}),g?me.createElement(sn,{key:"row-detail-height",varName:g,onChange:f}):null,y?me.createElement(sn,{key:"column-header-height",varName:y,onChange:m}):null,w?null:me.createElement(wd,null),me.createElement(sm,null))});function db({children:n}){let{componentActions:e,componentState:t}=Ke(),{scrollerDOMRef:o,scrollTopKey:r}=t,i=rf(),a=_e(i),l=_e(t),s=Le(),{getState:u,componentActions:c,getDataSourceMasterContext:d,api:p}=Ie(),[f]=me.useState(()=>Ep({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:n};er(o,g=>{let y={width:g.width,height:g.height};e.bodySize=y},{earlyAttach:!0,debounce:50}),me.useEffect(()=>{o.current&&(o.current.scrollTop=0)},[r,o]);let h=_o();return me.createElement(h.Provider,{value:m},me.createElement(cb,null))}var pb=40,fb=gf(Is),no=function(n){return me.createElement(sb,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:pb,columnHeaderHeight:fb,...n},me.createElement(db,{children:n.children}))};no.Header=Am;no.Body=Em;no.HScrollSyncContent=bm;no.Footer=()=>me.createElement(Cu,null);import*as Mm from"react";function RB(n){let{DataSource:e}=Vn({nodesKey:"children",...n});return Mm.createElement(e,null,n.children??null)}import*as _m from"react";function mb(n){return _m.createElement(no,{...n})}var vi=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let o=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,o(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Ge(`${e}:DataQuery`)}};function Qo(n){if(Array.isArray(n))return n.map(Qo);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=Qo(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var ro=class{constructor(e){this.queryCache=new q;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Qo(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new vi(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Qo(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Qo(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Qo(e);this.queryCache.delete(t)};if(this.options=e,ro.clients.has(e.name)){let t=`There's already a DataClient with name "${e.name}". Specify a different name for the client`;throw new Error(t)}ro.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=ro.clients.get(e);t&&t.destroy()}static destroyAll(){ro.clients.forEach(e=>{ro.destroy(e.name)})}destroy(){ro.clients.delete(this.options.name)}},Wl=ro;Wl.clients=new Map;var hb={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},gb={instantEdit:hb};import{useEffect as WB}from"react";function yb(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var jl=class{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??jl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}},Ai=jl;Ai.DEFAULT_SIZE=10;var $l=class{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??$l.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}},Ei=$l;Ei.DEFAULT_SIZE=10;import{useEffect as Cb,useRef as Mi}from"react";var Tb=(n,e)=>n.every((t,o)=>t===e[o]),Sb=(n,e)=>{let t=Mi(e),o=Tb(e,t.current),r=Mi(!0);t.current=e;let i=Mi(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=Mi(n);l.current=n,Cb(()=>{if(r.current){r.current=!1;return}return l.current()},a)};import{useEffect as bb,useRef as Un}from"react";var Fm=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),Ul=(n,e)=>{let{same:t,different:o,compare:r}=e,i=Un(t),a=Un(o),l=Fm(t,i.current,r),s=!Fm(o,a.current,r),u=Un(!0);i.current=t,a.current=o;let c=Un(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=Un(n);p.current=n,l&&s&&(u.current=!1),bb(()=>{if(!u.current)return p.current()},d)};import*as ct from"react";var Om=Y(U.currentFlashingDuration),Rb=({children:n})=>ct.createElement(ct.Fragment,null,n),Nm=1e3,Lm={up:gr({direction:"up"}).split(" "),down:gr({direction:"down"}).split(" "),neutral:gr({direction:"neutral"}).split(" ")},Vm=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=Rb}=n;return ct.forwardRef((i,a)=>{let l=Hr(),{state:{flashingDurationCSSVarValue:s}}=X(),u=typeof s=="number"?s??e??Nm:e??Nm,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,h=f.id,g=p.id,y=ct.useRef(!0),C=ct.useRef(d),S=y.current?null:C.current;y.current=!1;let b=ct.useRef(),T=ct.useRef(),I=ct.useRef();return Ul(()=>{if(d===C.current)return;let R=()=>{let D=m.current;if(b.current&&(clearTimeout(b.current),b.current=void 0),I.current&&(clearTimeout(I.current),I.current=void 0),T.current&&D){let A=T.current,_=Lm[A];D.classList.remove(...t?[t,..._]:_),D.style.removeProperty(Om),T.current=void 0}};C.current=d;let w=m.current;if(!w)return;R();let P=typeof d=="number"?d>S?"up":"down":"neutral",x=Lm[P];return w.style.setProperty(Om,`${u}`),w.classList.add(...t?[t,...x]:x),T.current=P,b.current=setTimeout(R,u),R},{same:[g,h],different:[d]}),ct.createElement("div",{ref:c,...i,className:J(i.className)},o({children:i.children,oldValue:S}))})},Ib=Vm();var mk={CheckBox:Ut,LoadMask:$r,MenuIcon:An,StringFilterEditor:Lo,NumberFilterEditor:Mr};export{Ve as CellSelectionState,Wl as DataClient,t1 as DataSource,BC as DataSourceActionType,q as DeepMap,Ai as FixedSizeSet,Ib as FlashingColumnCell,st as GroupRowsState,no as InfiniteTable,Mt as InfiniteTableClassName,cb as InfiniteTableComponent,xt as Menu,Gn as RowDetailCache,mt as RowDetailState,ut as RowDisabledState,Se as RowSelectionState,RB as TreeDataSource,Ze as TreeExpandState,mb as TreeGrid,Be as TreeSelectionState,Ei as WeakFixedSizeSet,Hf as alignNode,mk as components,Vm as createFlashingColumnCellComponent,Dt as debounce,Ge as debug,po as defaultFilterTypes,vl as eventMatchesKeyboardShortcut,po as filterTypes,jy as flatten,Et as getComponentStateRoot,Xa as group,yb as interceptMap,gb as keyboardShortcuts,Ot as multisort,Za as multisortNested,Qo as queryKeyToCacheKey,Yy as toTreeDataArray,Ke as useComponentState,Vn as useDataSourceInternal,Po as useDataSourceState,Ul as useEffectWhen,Sb as useEffectWhenSameDeps,ko as useEffectWithChanges,mF as useEffectWithObject,Kl as useGridScroll,Hr as useInfiniteColumnCell,za as useInfiniteColumnEditor,In as useInfiniteColumnFilterEditor,Er as useInfiniteHeaderCell,ab as useInfinitePortalContainer,Rp as useManagedDataSource,n1 as useMasterRowInfo,Kt as useOverlay,fS as useOverlayPortal,co as usePrevious,o1 as useRowInfoReducers,XS as useVisibleColumnSizes};
|
|
29
|
+
`,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),!1):!0},nS=o=>{let e="",t=o.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let c=t[s];if(ts(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(ts(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),tS(t)};var rS=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,iS=/(https):\/\/\S+(\.csb\.app)/g,sm=typeof window<"u"?window.location.origin:"",aS=()=>{let[o,e,t]=Array.from(rS.exec(sm)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},lS=()=>{let[o,e,t]=Array.from(iS.exec(sm)||[]);return e==="https"&&t===".csb.app"},sS=lS()||aS(),cm=(o="")=>{let t=!!ke();return oS(()=>{if(t)return!0;let r=lm(o,{publishedAt:1624970570587,version:"7.2.0"});return!o&&!r&&sS?!0:r},[o,t])};import{useRef as um,useEffect as dm}from"react";var cS=10;function pm(o,e,t){let n=um(!1),r=um(null);dm(()=>{o!=null&&(n.current=!1,vt(r.current))},[o]),dm(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,vt(r.current),r.current=Ae(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<cS&&a(l)})};var i=a;a()}return()=>{vt(r.current)}},[o,e])}import{useRef as fm,useEffect as mm}from"react";var uS=10;function gm(o,e,t){let n=fm(!1),r=fm(null);mm(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),mm(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<uS&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}var hm=o=>`--infinite-${o}`;import{useCallback as CS,useMemo as SS,useEffect as wS}from"react";function bm(o,e){ns(o,e),pS(o,e),e.detail===2&&dS(o,e),o.getState().onCellClick?.(o,e)}function dS(o,e){let{onCellDoubleClick:t}=o.getState(),n={preventEdit:!1};if(t){let a=t(o,e);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let i=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:i.id})}function pS(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,h=p.length,b=new ze(u);b.debugId=m??"",d.cellSelectionState=b;let T={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(T);else if(e.shiftKey){let C=!!n().wrapRowsHorizontally;d.multiSelectClick(T,C?{horizontalLayout:C,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:C})}else d.resetClick(T);l.cellSelection=b}function ns(o,e){let{rowIndex:t,getDataSourceState:n,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=o,{multiRowSelector:s,renderSelectionCheckBox:c}=r(),u=n(),{selectionMode:d,groupBy:p,dataArray:f,isTree:m}=u;if(p.length||m||f[t]?.rowDisabled)return!1;if(d==="multi-row"){if(c&&!e.key)return!1;let{rowSelection:h}=u;if(h=l(h),s.rowSelectionState=h,h&&typeof h=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=h,!0}else if(d==="single-row"){let b=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(b):a.rowSelectionApi.selectRow(b)}return!1}function ym(o,e){e.detail!==2&&void 0}var fS={Enter:!0," ":!0,a:!0};function Tm(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=o,{key:c,ctrlKey:u,metaKey:d}=e;if(!fS[c])return!1;let p=t(),f=n(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:h,keyboardSelection:b}=p,{selectionMode:T,groupBy:C,rowSelection:S,treeSelectionState:y,isTree:I}=f;if(b===!1)return!1;let w=h==="row"&&m!=null?m:h==="cell"&&g!=null?g[0]:null,v=w!=null?f.dataArray[w]:null;if(!v||w==null)return!1;if(T==="single-row"&&c===" ")return i.rowSelectionApi.toggleRowSelection(v.id),!0;if(T!=="multi-row")return!1;if(c==="a"&&(u||d)){if(I&&y){let x=s(y);return x.selectAll(),r.treeSelection=x,!0}let R=l(S);return R.selectAll(),r.rowSelection=R,!0}if(c===" "){if(C.length)return v.isGroupRow&&v.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(v.groupKeys):i.rowSelectionApi.toggleRowSelection(v.id),!0;if(I){if(v.isTreeNode&&v.nodePath)return a.treeApi.toggleNodeSelection(v.nodePath),!0}else{let R={...e},{renderSelectionCheckBox:x}=o.getComputed();return x&&(R.metaKey=!1,R.ctrlKey=!0),ns({...o,rowIndex:w},R)}}return!1}var Cm=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Sm=o=>Array.from(o.querySelectorAll(Cm)).filter(t=>!!t.offsetParent),ki=o=>o.querySelector(Cm);var vm=jn(Cn());async function wm(o,e=10,t=300){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 mS=10,gS=(o,e)=>o-e;function zi(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=n(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),p=u[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=c[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=et(p.id,e);return p.contentFocusable({column:p,...ao({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function os(o,e,t){let n=t.getState().editingCell;return hS(o,e,t,{isCellFocusable:zi,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function Im(o,e,t){let n=(0,vm.default)(t,o+e,gS);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=Im;function hS(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(),c=o.rowIndex,u=o.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:Im(u,e,a),u===null){if(c+=e,c<0||c>=s.length)return null;continue}if(i({colIndex:u,rowIndex:c},t))return{colIndex:u,rowIndex:c}}return null}async function Rm(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=zi(e,o)?e:os(e,-1,o);if(t){await rs([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;ki(n)?.focus()}}async function rs([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=mS,l=null,s=!1;function c(u=0){u++,vt(l),l=Ae(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&u<a&&c(u),s){try{await wm(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var bS=`.${On}`;function xm(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:tn(n,bS),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:u}=o.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&zi({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:os({rowIndex:l,colIndex:s},t,o);if(!c){if(t===-1)r.focus();else{let u=Sm(document.body),d=o.getState().focusDetectDOMRef.current,p=u.findIndex(m=>m===d);u[p+1]?.focus()}return!0}return rs([c.rowIndex,c.colIndex],o).then(()=>{let u=o.getState().getDOMNodeForCell(c);if(!u)return;ki(u)?.focus()}),!0}var Dm={control:"ctrl"},Pm={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},yS={esc:"escape"},Mm={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},Am=Object.keys(Mm),is=new Set(Am),TS=new Set(["shift","alt"]);function as(o,e){return Array.isArray(e)?e.some(t=>Em(o,t)):Em(o,e)}function Em(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>Pm[p]),i=n.map(p=>Dm[p]||Pm[p]||yS[p]||p),a=i.filter(p=>is.has(p)),l=i.filter(p=>!is.has(p)),s=Am.reduce((p,f)=>(p[f]=Mm[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(f=>!TS.has(f)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||is.has(t)||t==="meta"||Dm[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function _m(o,e){let t={...o,cloneRowSelection:a=>yi(a,o.getDataSourceState),cloneTreeSelection:a=>wi(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&Tm(t,e)&&e.preventDefault(),(xm(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&Pf(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,c=o.getComputed().computedVisibleColumns[s];c.computedEditable&&o.api.startEdit({rowIndex:l,columnId:c.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=o.getState();if(i)for await(let a of i){if(!as(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function vS(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=Q(),{getState:i,componentActions:a,api:l}=De();return SS(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>wi(u,i),cloneRowSelection:u=>yi(u,i)}),[o,e,i,a,t,l,n])}function IS(){let o=vS();wS(()=>{let e=o.getState().keyDown.onChange(a=>{_m(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],c=et(s.id,o);bm({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=o.getComputed().computedVisibleColumns[c],d=et(u.id,o);ym({...o,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function RS(){let{getState:o}=Q();return{onKeyDown:CS(t=>{o().keyDown(t)},[])}}function Fm(){return IS(),RS()}import{useEffect as tg}from"react";import*as Oe from"react";import{useCallback as ss,useEffect as xS,useLayoutEffect as DS,useState as Gi}from"react";import{createPortal as PS}from"react-dom";function ls(o){return!!o.tagName}function Lm(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=Ce.from(ls(e)?e.getBoundingClientRect():e),a=Ce.from(ls(t)?t.getBoundingClientRect():t),l=n?Ce.from(ls(n)?n.getBoundingClientRect():n):null;if(!l)return{...Om({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=Om({anchorRect:a,targetRect:i,position:r[c],constrainRect:l});if(c===0&&(s={...d,index:0}),d.valid)return{...d,index:c}}return s}function Om(o){let e=Ce.from(o.targetRect),t=Ce.from(o.anchorRect),n=o.constrainRect?Ce.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=Nm(e,i),s=Nm(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function Nm(o,e){return e==="TopLeft"?Ne.from({top:o.top,left:o.left}):e==="TopCenter"?Ne.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?Ne.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?Ne.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?Ne.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?Ne.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?Ne.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?Ne.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Ne.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 Vi="__is_infinite_menu_component";function ES(o){return o&&typeof o.then=="function"||o instanceof Promise}function Vm(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function km(o){return typeof o=="function"&&(o=o()),ES(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&Vm(o)&&(o=o.getBoundingClientRect()),o?Ce.from(o):null}async function MS(o){let e=null;typeof o=="function"?e=o():e=o;function t(n){let r=null;return typeof n=="string"&&(r=document.querySelector(n)),Vm(n)&&(r=n),r||null}return t(await e)}function AS(o){return Oe.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function _S(o){let e=Oe.useRef(null);return xS(()=>o.realign.onChange(t=>{e.current&&t&&zm(e.current,t)}),[o.realign]),Oe.createElement("div",{style:{position:"absolute",top:0,left:0},ref:ss(t=>{t&&zm(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}async function zm(o,e){let{constrainTo:t,alignTo:n,alignPosition:r}=e;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await km(t)||void 0,a=n?await km(n):void 0,l=Ce.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Lm({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=o.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=o.offsetParent;if(u){let d=u.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function FS(o,e){let[t,n]=Gi(null);return DS(()=>{async function r(){let i=e?await MS(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?PS(o,t):Oe.createElement(Oe.Fragment,null):e===null||e===!1?o:Oe.createElement(AS,null,o)}function OS(o){if(Oe.Children.count(o)===1){let e=Oe.Children.only(o);if(Oe.isValidElement(e))return e.props.id||e.key}return null}function NS(o,e,t){if(Oe.Children.count(o)===1){let n=Oe.Children.only(o);if(Oe.isValidElement(n)&&n.type[Vi]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Oe.cloneElement(n,r)}}return o}globalThis.allhandles={};globalThis.thehandles={};function qt(o){let e=o,[t]=Gi(()=>new Map),[n,r]=Gi(null),[i,a]=Gi(0),l=ss(()=>{let m=[];for(let[g,h]of t)m.push(Oe.createElement(_S,{...h,key:h.key}));return m},[]),[s,c]=_t(),u=FS(l(),o.portalContainer),d=ss((m,g)=>{let b=`${g.id||OS(m)||xt()}`,T=t.get(b),C=I=>()=>{let w=typeof I=="function"?I():I;return NS(w,e.portalContainer,g.constrainTo??e.constrainTo)},S=C(m),y=(I,w)=>{if(!T)return;let v=C(I);Object.assign(T,{children:v}),c(),!!!w?.skipRealign&&(r(T.key),a(Date.now()))};return T?(Object.assign(T,g),y(m),y):(T={key:b,children:S,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:ge()},t.set(T.key,T),c(),y)},[t,e.portalContainer,c]);Oe.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),c())},f=()=>{t.clear(),c()};return Oe.useEffect(()=>{},[]),{portal:u,hideOverlay:p,clearAll:f,rerenderOverlays:c,showOverlay:d}}import*as Jm from"react";import*as So from"react";import*as Co from"react";import*as sr from"react";function Hi(o){return null}Hi.defaultProps={__is_menu_item:!0};var Gm="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Hm=ue({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),Km="db3arf1",Bm="db3arfd";var LS="-";function kS(){return sr.createElement("hr",{className:Bm})}var Ki=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===LS?sr.createElement(kS,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 Wm(o,e){return sr.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Hi)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),Ki(o,n)}return Ki(o,t)})||[]}var jm="submenu";function $m(){let o=Co.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:xt(),focused:!1,destroyed:!1,domRef:o}}var Um=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),zS=[{name:"label"}],Ym=o=>{let{props:e,state:t}=o,{activeItemKey:n,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,c=e.id||t.generatedId;s&&(c=`${s}-${c}`);let u=[...e.columns||zS],d={columns:u,keyboardActiveItemKey:r,activeItemKey:n,menuId:c},p=[];i?p=i.map(Ki.bind(null,d)):!i&&typeof a!="function"&&(p=Wm(d,a)),l&&p.filter(g=>g.type==="item"&&g.menu!=null).length>0&&!u.find(g=>g.name==jm)&&u.push({name:jm,render:({domProps:g,item:h})=>h.menu?Co.createElement("div",{...g},Co.createElement(_n,{expanded:!1})):Co.createElement("div",{...g})});let f=p.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:p,runtimeSelectableItems:f,columns:u,menuId:c}};import*as Pt from"react";import{useCallback as Kn,useLayoutEffect as US,useRef as YS,useState as ds}from"react";var cr=class extends ro{constructor(e){super(e.slice(0,3))}};var VS=250;function GS(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}Ae(i)};Ae(()=>{i()})})}var HS=we(),Bi=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||VS;this.getPointerMoveTarget=()=>document.documentElement||HS;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 Ne({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,u=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(u-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=u,(s?new cr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new cr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(e,t)=>{if(e!==this.activeItem){if(e==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=e,this.params.onItemActivate(e,t),this.activeItemMenuRect=null,GS(()=>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 Ne({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 BS}from"react";var cs=KS(null);function us(){return BS(cs)}import{useCallback as WS,useEffect as jS,useRef as $S}from"react";function qm(){let o=$S(!0);return jS(()=>(o.current=!0,()=>{o.current=!1}),[]),WS(()=>o.current,[])}function qS(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=o.menu;return u?(typeof u=="function"&&(u=u()),Pt.createElement(Lt,{key:c,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,p)=>{u?.onShow?.(d,p),n(p)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function XS(o,e){let t=Xm(o,e);if(!t.length)return null;let n=Ce.from(t[0]?.getBoundingClientRect()),r=Ce.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function Xm(o,e){let t=tn(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=Xm(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 QS({onItemActivate:o}){let{getState:e}=us(),[{onItemEnter:t,onItemLeave:n}]=ds(()=>new Bi({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?Ce.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:Kn(t,[]),onItemLeave:Kn(n,[])}}function Zm(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:h,getState:b}=us(),T=Kn(k=>{h.keyboardActiveItemKey=k},[]),C=Kn(k=>{h.activeItemKey=k},[]),S=qm(),[y,I]=ds(null),w=null;US(()=>{let{runtimeItems:k}=b(),W=k.filter(se=>se.type==="item"&&i===se.key)[0];if(!W||!W.menu){I(null),D();return}if(W){let se=XS(r,W.key);se&&R(()=>qS(W,{constrainTo:l,setSubmenuApi:I,setActiveItemKey:C,setKeyboardActiveItemKey:T,parentMenuId:r,onHideIntent:H,api:B}),{id:`${r}-submenu`,alignTo:se,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let v=(k,W)=>{T(W.key),C(W.key),W.originalMenuItem.onClick&&W.originalMenuItem.onClick(k);let se={key:W.key,item:W.originalMenuItem,hideMenu:H};W.originalMenuItem.onAction&&W.originalMenuItem.onAction(se),c&&c(se),W.originalMenuItem.hideMenuOnAction&&H()},{showOverlay:R,portal:x,clearAll:D}=qt({portalContainer:!1}),{onItemEnter:M,onItemLeave:A}=QS({onItemActivate:k=>{if(!S())return;let W=k?k.key:null;C(W)}});w=n.map((k,W)=>Pt.createElement(JS,{key:k.type==="item"?k.key:W,onItemEnter:(se,ce)=>{M(se.key,ce)},onItemLeave:(se,ce)=>{A(se.key,ce)},columns:t,active:k.type==="item"&&k.key===i,keyboardActive:k.type==="item"&&k.key===a,item:k,index:W,onClick:v}));let E=t.map(k=>k.width||(typeof k.flex=="number"?`${k.flex}fr`:k.flex)||"auto").join(" "),_={...e.style,gridTemplateColumns:E,gridTemplateRows:n.map(()=>"auto").join(" ")};u||(_.whiteSpace="nowrap");function P(k){let{runtimeItems:W,runtimeSelectableItems:se}=b(),ce=W.findIndex(ne=>ne.type==="item"&&ne.key===a),ie=a,oe=W[ce],te={ArrowUp:()=>{let ne=W.slice(0,ce).filter(V=>V.type==="item"&&!V.disabled).pop();ne&&ne.type==="item"&&ne.key&&(ie=ne.key)},ArrowDown:()=>{let ne=W.slice(ce+1).filter(V=>V.type==="item"&&!V.disabled)[0];ne&&ne.type==="item"&&ne.key&&(ie=ne.key)},Home:()=>{te.PageUp()},End:()=>{te.PageDown()},PageUp:()=>{ie=se[0].key},PageDown:()=>{ie=se[se.length-1].key},ArrowLeft:()=>{C(null),b().parentMenuId&&(h.destroyed=!0)},ArrowRight:()=>{oe&&(C(oe.key),Ae(()=>{S()&&y&&y.getParentMenuId()===b().menuId&&y.focus()}))},Enter:()=>{if(oe)if(oe.originalMenuItem?.menu){if(oe&&oe.originalMenuItem.menu&&y){te.ArrowLeft();return}oe&&C(oe.key)}else v(k,oe)}," ":()=>{if(!oe)return;oe.originalMenuItem.menu||v(k,oe);let ne=ZS(r,oe.key);ne&&ne.click()},Escape:()=>{te.ArrowLeft();let ne=b();ne.parentMenuId||ne.onHideIntent?.(ne)}},fe=te[k.key];fe&&(fe(),k.preventDefault()),ie!=a&&T(ie)}function F(){h.focused=!1}let N=Kn(function(){h.focused=!0,setTimeout(()=>{G.current&&g.current&&g.current===document.activeElement&&b().keyboardActiveItemKey==null&&T(b().runtimeSelectableItems[0]?.key??null)})},[]),G=YS(!0),H=Kn(()=>{let k=b();k.onHideIntent?.(k)},[b]),[B]=ds(()=>({hideMenu:H,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),N())},getMenuId:()=>b().menuId,getParentMenuId:()=>b().parentMenuId})),pe=Kn(k=>{k?(g.current=k,d?.(b(),B),f&&B.focus()):(p?.(b()),g.current=k)},[]),de=Pt.createElement("div",{className:rn.contents},Pt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:pe,onKeyDown:k=>{e.onKeyDown?.(k),P(k)},onMouseDown:k=>{G.current=!1,e.onMouseDown?.(k)},onMouseUp:k=>{G.current=!0,e.onMouseUp?.(k)},onFocus:N,onBlur:F,className:Z(Gm,e.className,"InfiniteMenu"),style:_},w),x);return s?null:de}function JS(o){let[e,t]=Pt.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=Pt.createElement("div",{style:r.style},r.value);else{let u=0;c=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,h=g+r.span;if(g<u)return null;u=h;let T={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:h},"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:Z(Hm({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:C=>{r.disabled||o.onItemEnter?.(r,C)},onPointerLeave:C=>{r.disabled||o.onItemLeave?.(r,C)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:C=>{r.disabled||o.onClick(C,r)}};return d.render?Pt.createElement($o,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:T}}):Pt.createElement("div",{key:`${s}-${m}`,...T},f[m])}).filter(Boolean)}return Pt.createElement("div",{className:Km},c)}var{ManagedComponentContextProvider:ew}=It({initSetupState:$m,forwardProps:Um,mapPropsToState:Ym,layoutEffect:!0});function tw(o){let{componentActions:e,componentState:t}=je(),n=Ie(t);return So.createElement(cs.Provider,{value:{componentActions:e,componentState:t,getState:n}},So.createElement(Zm,{domProps:o.domProps}))}function Lt(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:h,__is_infinite_menu_component:b,...T}=o;return So.createElement(ew,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...o},So.createElement(tw,{domProps:T}))}Lt[Vi]=!0;import*as ps from"react";function Qm(o,e){let{columnApi:t,column:n,getComputed:r,api:i,dataSourceApi:a}=e,s=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()}},"-"]:[],...s,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((p,f)=>{let m=Dn(p,e,"column-menu");u.push({key:f,label:m,check:ps.createElement(Ht,{key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let h=!!g;i.setVisibilityForColumn(p.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}},"-",{key:"group-by",label:"Group by",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{if(p.groupByForColumn)return;let m=Dn(p,e,"column-menu");u.push({key:f,label:m,check:ps.createElement(Ht,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function eg(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??Lt,s=n().computedColumnsMap.get(o);if(!s)return null;let c={column:s,columnApi:et(s.id,e),...e},u=Qm([],c),d=a?a(u,c):u,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:Jm.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var nw=`[${bl["data-name"]}="${yl["data-name"]}"]`;function ow(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){n(),a.columnMenuVisibleForColumnId=null}let u=o.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${Tp["data-column-id"]}="${e}"] ${nw}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>eg(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function ng(){let o=Q(),e=ke(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});tg(()=>{let{actions:c,getState:u}=o,d=u();return d.onColumnMenuClick.onChange(p=>{p&&(d.columnMenuTargetRef.current=p.target,c.contextMenuVisibleFor=null,c.cellContextMenuVisibleFor=null,c.filterOperatorMenuVisibleForColumnId=null,c.columnMenuVisibleForColumnId=p.column.id)})},[]);let{columnMenuVisibleForColumnId:l,columnMenuVisibleKey:s}=t();return tg(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=t();if(c){let p=function(f){f.__insideMenu!==!0&&(a(),n.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),ow({columnId:c,context:o,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else u.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}import*as og from"react";import{useCallback as rw}from"react";var iw={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function rg(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=Q(),{getState:a,getDataSourceMasterContext:l}=De(),{focusDetectDOMRef:s}=o(),c=rw(async()=>{Rm({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return og.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:iw})}import{useEffect as ur}from"react";function aw(){let o=Q(),{getState:e}=o,{editingCell:t}=e(),n=t&&!t.active?t.cancelled:void 0;ur(()=>{if(n){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...ft({rowIndex:r,columnId:i,...o}),initialValue:a})}},[n])}function lw(){let o=Q(),{getState:e,state:{editingCell:t}}=o,n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;ur(()=>{if(n){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...ft({rowIndex:r,columnId:i,...o}),value:a,error:n,initialValue:l})}},[n])}function sw(){let o=Q(),{state:{editingCell:e}}=o,t=e?.active,n=In(t);ur(()=>{!t&&n&&o.api.focus()},[t,n])}function cw(){let o=Q(),{state:{editingCell:e},getState:t}=o,n=e&&!e.active&&!e.cancelled&&e.accepted===!0;ur(()=>{if(n){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...ft({rowIndex:a,columnId:l,...o}),value:i,initialValue:s};t().onEditAccepted?.(c),o.api.persistEdit({value:i})}},[n])}function uw(){let o=Q(),{state:{editingCell:e},getState:t}=o,n=e?e.persisted:void 0;ur(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:c,initialValue:u}=r,d={...ft({rowIndex:l,columnId:s,...o}),value:c,initialValue:u};n instanceof Error?i?.({...d,error:n}):a?.(d)}},[n])}function ig(){aw(),lw(),cw(),uw(),sw()}import{useEffect as sg}from"react";import*as bn from"react";import*as fs from"react";var Wi=o=>fs.createElement(_e,{...o},fs.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 ms from"react";var ag=o=>ms.createElement(_e,{...o},ms.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 lg(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),p=u?.Menu??Lt,f=n().computedColumnsMap.get(o);if(!f)return null;let m=w=>{w.__insideMenu=!0},g=w=>{w.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:h}=i(),b=h[f.computedFilterType];if(!b)return null;let T=b.operators.map(w=>{let v=w.name,R=f.computedFilterValue?f.computedFilterValue.filter.operator===v:v===b.defaultOperator,x=w.components?.Icon??eo;return{key:v,icon:bn.createElement(x,null),label:bn.createElement(bn.Fragment,null,w.label??w.name),onAction:()=>{c.setColumnFilterOperator(o,v)},checked:R?bn.createElement(ag,{size:16}):null}}),S=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:bn.createElement(Wi,null),disabled:!f.computedFiltered,onAction:()=>{c.clearColumnFilter(o)}},"-"],...T],y={column:f,api:c,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:h},I=d?d(S,y):S;return bn.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:I,onShow:w=>{w.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:w=>{g(w),t?.()}})}var ji=10;function cg(){let o=Q(),e=ke(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return sg(()=>{let{actions:l,getState:s}=o;return s().onFilterOperatorMenuClick.onChange(u=>{if(!u)return;let{target:d,column:p}=u;function f(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=d?.parentElement||d,g=Ce.from(m.getBoundingClientRect());g.top-=ji,g.left-=ji,g.width+=2*ji,g.height+=2*ji,r(()=>lg(p.id,o,f),{constrainTo:s().domRef.current,id:"filter-operator-menu",alignTo:g,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),l.contextMenuVisibleFor=null,l.cellContextMenuVisibleFor=null,l.columnMenuVisibleForColumnId=null,l.filterOperatorMenuVisibleForColumnId=p.id})},[]),sg(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}import{useEffect as Ui}from"react";import*as ys from"react";import*as gs from"react";function $i(o){let e=o?Array.isArray(o)?o:o.items:null,t=o&&!Array.isArray(o)?o.columns:void 0;return{items:e,columns:t}}function hs(o){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),o.onHideIntent?.()}}}function bs(o,e,t){if(!o)return null;let n=ge();return o.then(r=>{let{items:i,columns:a}=$i(r);i&&i.length&&n(gs.createElement(t,{...e,items:i||[],columns:a}))}),gs.createElement(en,{updater:n})}function ug(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??Lt,{computedColumnsMap:d}=a(),p=d.get(n),f={...ft({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!c)return{cellContext:f,menu:null,preventDefault:!1};let m=hs({onHideIntent:t}),g=c(f,e),h=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:bs(g,m,u),preventDefault:h};let{items:b,columns:T}=$i(g);return!b||!b.length?{cellContext:f,menu:null,preventDefault:Array.isArray(b)}:{preventDefault:h,menu:ys.createElement(u,{...m,columns:T,items:b}),cellContext:f}}function dg(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??Lt,{computedColumnsMap:s}=r(),c=o.columnId?s.get(o.columnId):void 0,u=c?{...o,...ft({...e,rowIndex:o.rowIndex,columnId:c.id})}:o;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=hs({onHideIntent:t}),p=a(u,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:u,menu:bs(p,d,l),preventDefault:f};let{items:m,columns:g}=$i(p);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:ys.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var Yi=5,pg=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function fg(){let o=Q(),e=ke(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Ui(()=>{let{actions:l,getState:s,getDataSourceState:c}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:h}=ug(d,o,f),b=Ce.fromPoint({top:p.clientY,left:p.clientX});b.width+=Yi,b.height+=Yi,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:b,alignPosition:pg}),h&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:T}=s();T&&T({...g,getState:s,getDataSourceState:c},p)})},[]),Ui(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function mg(){let o=Q(),e=ke(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Ui(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=dg(u,o,p),h={top:d.clientY,left:d.clientX},b=Ce.fromPoint(h);b.width+=Yi,b.height+=Yi,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:b,alignPosition:pg}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:h,...u};let{onContextMenu:T}=s();T&&T({...o,...m},d)})},[]),Ui(()=>{let{contextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}import{useRef as fw}from"react";import*as gg from"react";import{useCallback as dw,useEffect as pw}from"react";function Ts(o,e){let{state:{brain:t}}=Q(),n=dw(o,e);pw(()=>t.onScroll(n),[t,n])}var Cs="yzx0vj0";function hg(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=fw(null);Ts(s=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-s.scrollLeft}px, 0px, 0px)`)},[r]);let l={...i.style};return e==="column"?l.width=ae.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=ae.runtime.bodyWidth),n==="column"?l.minWidth=ae.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=ae.runtime.bodyWidth),t==="column"?l.maxWidth=ae.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=ae.runtime.bodyWidth),gg.createElement("div",{ref:a,...i,className:i.className?Z(i.className,Cs):Cs,style:l},i.children)}var mw=q($.columnWidthAtIndex),gw=q($.columnOffsetAtIndex);function hw(){return Q().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${mw}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${gw}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var qi="InfiniteTable";import{useEffect as bw}from"react";function bg(){let{state:o,getState:e,actions:t}=Q(),{wrapRowsHorizontally:n}=o,r=In(n);bw(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=Zl(qi,!!n);t.brain=c.brain,t.headerBrain=c.headerBrain,t.renderer=c.renderer,t.onRenderUpdater=c.onRenderUpdater,t.headerRenderer=c.headerRenderer,t.headerOnRenderUpdater=c.headerOnRenderUpdater}},[r,n])}import{useEffect as yw}from"react";function yg(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=Q(),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),yw(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,h=l.rowsPerPage,b=(r&&r.length>0||i)&&h>0?h:null;return f!=b&&(t.rowsPerPage=b,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,p=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,c])}import{useEffect as Xi,useRef as Tw}from"react";var dr=ue({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),Tg="_143ofgf5",Cg="_143ofgf3";var Cw=q(ae.loaded),Ss={source:"infinite-table-page",target:"infinite-table-devtools-background"};function Sg(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...Ss,url:ws(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Ss,url:ws(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)}}}}var ws=Qe(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function Sw(o){window.postMessage(o)}var ww=Qe(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){Ct.set(e,t);let{devToolsDetected:n}=t.getState();n||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(Sg({type:"update",debugId:e},t))}else of(e),window.postMessage(Sg({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,Be.onLogIntent("*",e=>{Sw({...Ss,url:ws(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>typeof t=="object"&&t!==null?JSON.stringify(t):String(t)),timestamp:e.timestamp}})}),o});function wg(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=Q(),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(Cw)!==`${tc}`&&tr({debugId:i,key:"CSS001_CSS"}),Xi(()=>{e().debugId!==i&&(t.debugId=i)},[i]),Rw()}var Zi=ge(),vw={revertAll:o=>{let e=Ct.get(o.debugId);if(e){let t=gn.get(o.debugId);gn.delete(o.debugId),jt.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=Ut.get(o.debugId);Ut.delete(o.debugId),$t.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=Ct.get(o.debugId);if(e){let t=o.property,n=jt.get(o.debugId),r=gn.get(o.debugId),i=$t.get(o.debugId),a=Ut.get(o.debugId),l=t;r&&n&&n[l]!==void 0&&(delete n[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=Ut.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:o=>{let e=Ct.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),nr(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),nr(o.debugId))}}},discardAllWarnings:o=>{let e=Ct.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),nr(o.debugId))},setColumnVisibility:o=>{Gl(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{xi(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{Gl(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{xi(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{xi(o.debugId,"multiSort",o.multiSort)},highlight:o=>{let e=Ct.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${dr.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(dr.classNames.base),r.innerHTML=[`<div class="${Cg}"></div>`,`<div class="${Tg}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${n.left}px`,r.style.top=`${n.top}px`,r.style.width=`${n.width}px`,r.style.height=`${n.height}px`,i.innerHTML=o.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(dr.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(dr.classNames.variants.active.true)}}}}};function Iw(){typeof window<"u"&&window.addEventListener("message",o=>{if(o&&o.data&&typeof o.data.source=="string"&&typeof o.data.target=="string"&&o.data.target==="infinite-table-page"&&o.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(ww(),Zi(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=vw[e];t&&t(o.data.payload)}})}Iw();function Rw(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=Q(),s=o().debugId,c=Tw(s);return c.current=s,Xi(()=>{let u=c.current;if(!u)return;let d=f=>{f(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=Zi.get();if(p){d(p);return}return Zi.onChange(f=>{f&&d(f)})},[]),Xi(()=>{let u=c.current;if(!u)return;let d=Zi.get();d&&d(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),Xi(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function xw(){let o=ke(),e=o?o.getMasterState():null,t=Q().getState();return(e||t).portalDOMRef.current}import*as wt from"react";import{useCallback as Dw}from"react";var vg="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",Ig=ue({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p _16lm1iw31",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),Rg="hs68h81",xg=ue({defaultClassName:"hs68h80 _16lm1iw1p",variantClassNames:{orientation:{horizontal:"_16lm1iw2h _16lm1iw2j",vertical:"_16lm1iw2f"},draggingInProgress:{true:"_16lm1iw1h",false:"hs68h86"},dropRejected:{true:"hs68h87",false:"hs68h88"},active:{true:"hs68h89",false:"hs68h8a"}},defaultVariants:{},compoundVariants:[[{dropRejected:!0,active:!0},"hs68h8b"],[{dropRejected:!1,active:!0},"hs68h8c"],[{active:!1,dropRejected:!1},"hs68h8d"]]});import*as wo from"react";function Dg(o){return wo.createElement("div",{...o.domProps})}function Pg(o){let{active:e}=o;return wo.createElement("div",{className:Rg},e?"Drop to group":"Drag columns to group")}function Eg(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return wo.createElement("div",{...o.domProps},o.label,wo.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:vg,onKeyDown:e,onMouseDown:o.onClear},wo.createElement(Wi,{size:20})))}var Pw=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};we().addEventListener("mousemove",i,{once:!0}),we().addEventListener("mouseup",()=>{r||(we().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function Ew(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=qo(),c=l===vo,u=Q(),d=(e?Dn(e.id,u,"grouping-toolbar"):r)??i,p=e?wt.createElement(li,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,f=wt.createElement("div",{className:Z(rn.flex,Rn.row,Vc[2],Gr.end)},d,p),m=s===i&&l===vo,g=Z(Ig({draggingInProgress:c,active:m}),o.domProps?.className),h=Pw(a,o.domProps?.onMouseDown),b={...o.domProps,className:g,onMouseDown:h},T=n?.ToolbarItem??Eg;return wt.createElement(T,{active:m,domProps:b,column:e,field:r,label:f,onClear:t})}var vo="grouping-toolbar";function Mg(o){let{groupBy:e}=Jt(),{getComputed:t,dataSourceApi:n,api:r}=Q(),{dropTargetListId:i,dragSourceListId:a}=Mn(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===vo,u=a===vo,d=o.components?.Placeholder??Pg,p=o.components?.Host??Dg,f=e.length?wt.createElement(wt.Fragment,null,e.map((C,S)=>{let y=C.field?l.get(C.field):void 0,I=`${C.field??`idx-${S}`}`;return wt.createElement(kn.DraggableItem,{key:I,id:I},w=>wt.createElement(Ew,{id:I,components:o.components,domProps:w,field:C.field,column:y,toggleSorting:()=>{y&&r.toggleSortingForColumn(y.id)},onClear:()=>{n.setGroupBy(e.filter(v=>v!==C))}}))})):wt.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=C=>{let S=C.map(y=>e[y]);n.setGroupBy(S)},g=C=>{let{dragItemId:S}=C,y=S,I=s.get(y);if(!I||!I.field||!I.computedGroupable)return;let w=[...e];w.splice(C.dropIndex,0,{field:I.field}),n.setGroupBy(w)},h=Dw(C=>{let{computedColumnsMap:S}=t(),y=C.dragItem.id,I=S.get(y);return!(!I||!I.computedGroupable||e.some(w=>w.field===I.field))},[e]),b=o.orientation??"horizontal",{domProps:T}=o;return wt.createElement(kn,{orientation:b,dragListId:vo,acceptDropsFrom:["header",vo],onDrop:m,onAcceptDrop:g,shouldAcceptDrop:h},(C,{draggingInProgress:S,status:y})=>{let I=Z(xg({active:c,orientation:b,draggingInProgress:S,dropRejected:y==="rejected"}),C.className,T?.className),w={...C,...T,className:I,children:f};return wt.createElement(p,{active:c,rejectDrop:y==="rejected",domProps:w,orientation:b})})}var Gt=Me.rootClassName,Mw=[vd,"InfiniteColumnCell--hovered"],{ManagedComponentContextProvider:Aw}=It({initSetupState:Uf,forwardProps:Yf,mapPropsToState:Qf,cleanup:qf,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Zf(),getParentState:()=>Jt(),debugName:o=>nn(o.debugId,qi)}),Ag=Z(Gu,cl);function _w(o){return be.createElement("div",{...o,className:o.className?Z(Ag,o.className):Ag})}function _g(){let o=Q(),e=ke(),{state:t,getComputed:n,api:r}=o,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,scrollStopDelay:d,brain:p,scrollerDOMRef:f,components:m,bodySize:g,activeCellIndex:h,rowDetailRenderer:b,showHoverRows:T,wrapRowsHorizontally:C,domProps:S,domRef:y}=t,I=m?.LoadMask??fi,w=n(),{computedRowHeight:v,computedRowSizeCacheForDetails:R}=w,x=R?.getRowHeight||v,{componentState:{loading:D}}=De(),M=be.useCallback(F=>{let N=o.getState(),G=F.target;if(!e&&F._from_row_detail)return;e&&(F._from_row_detail=!0);let H=ec(G,Xl(),N.domRef.current),B,pe,de,k;H&&(pe=Number(H.dataset.colIndex),k=Number(H.dataset.rowIndex),B=o.getComputed().computedVisibleColumns[pe].id,de=o.dataSourceApi.getRowInfoArray()[k].id);let W={columnId:B,colIndex:pe,rowId:de,rowIndex:k,event:F,target:H??F.target};H&&N.cellContextMenu(W),N.contextMenu(W)},[]),{renderCell:A,renderDetailRow:E}=Vf({imperativeApi:r,getComputed:n,domRef:y,bodySize:g,computed:w}),{autoFocus:_,tabIndex:P}=S??{};return bg(),be.createElement(_w,{onContextMenu:M},be.createElement(Ac,{forceRerenderTimestamp:t.forceBodyRerenderTimestamp,debugId:l,tabIndex:P??0,autoFocus:_??void 0,activeRowIndex:t.ready&&s==="row"?c:null,activeCellIndex:t.ready&&s==="cell"&&!t.columnReorderDragColumnId?h:null,scrollStopDelay:d,renderer:i,wrapRowsHorizontally:C,onRenderUpdater:a,brain:p,activeCellRowHeight:x,renderCell:A,renderDetailRow:b?E:void 0,cellHoverClassNames:T?Mw:void 0,scrollerDOMRef:f,scrollVarHostRef:y}),be.createElement(I,{visible:D},u))}var Fw=be.memo(function(){let e=Q(),t=ke(),{state:n,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=De(),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:b,scrollStopDelay:T,brain:C,activeRowIndex:S,activeCellIndex:y}=n,{licenseKey:I}=n;!I&&Xt.licenseKey&&(I=Xt.licenseKey),gm(S,a.length,r),pm(y,a.length,r);let{onKeyDown:w}=Fm();be.useEffect(()=>{let G=l(),H=zt(B=>{G.notifyRenderRangeChange({renderStartIndex:B[0],renderEndIndex:B[1]})},{wait:T});return C.onVerticalRenderRangeChange(H)},[C,T]);let v=cm(I),{autoFocus:R,tabIndex:x,...D}=n.domProps??{},M=Qu(D);be.useEffect(()=>{C.setScrollStopDelay(T),s.scrollStopDelayUpdatedByTable=T},[T]),Ff(),yg(),ig();let{menuPortal:A}=ng(),{menuPortal:E}=fg(),{menuPortal:_}=mg(),{menuPortal:P}=cg();be.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]);let F=wg();be.useEffect(()=>{t&&(u.current=t.getMasterState().portalDOMRef.current)},[]);let N=i??be.createElement(be.Fragment,null,be.createElement(Rl,null),be.createElement(_g,null));return be.createElement("div",{"data-debug-id":F,onKeyDown:w,ref:c,...M},N,be.createElement("div",{ref:u,className:Z(`${Je}Portal`,Yc[1e7],Hr.absolute,jc[0],Kc[0])},A,E,_,P),g?be.createElement(Ao,{key:"row-height",varName:g,onChange:d}):null,be.createElement(Ao,{key:"flashing-duration",allowInts:!0,varName:ae.components.Cell.flashingDuration,onChange:p}),h?be.createElement(Ao,{key:"row-detail-height",varName:h,onChange:f}):null,b?be.createElement(Ao,{key:"column-header-height",varName:b,onChange:m}):null,v?null:be.createElement(vp,null),be.createElement(rg,null))});function Ow({children:o}){let{componentActions:e,componentState:t}=je(),{scrollerDOMRef:n,scrollTopKey:r}=t,i=im(),a=Ie(i),l=Ie(t),s=ke(),{getState:c,componentActions:u,getDataSourceMasterContext:d,api:p}=De(),[f]=be.useState(()=>Af({getComputed:a,getState:l,getDataSourceState:c,getDataSourceMasterContext:d,dataSourceApi:p,actions:e,dataSourceActions:u})),m={actions:e,state:t,computed:i,dataSourceActions:u,getDataSourceMasterContext:d,getDataSourceState:c,getComputed:a,getState:l,api:f,dataSourceApi:p,children:o};yr(n,h=>{let b={width:h.width,height:h.height};e.bodySize=b},{earlyAttach:!0,debounce:50}),be.useEffect(()=>{n.current&&(n.current.scrollTop=0)},[r,n]);let g=Qn();return be.createElement(g.Provider,{value:m},be.createElement(Fw,null))}var Nw=40,Lw=hm(nc),Xt=function(o){return be.createElement(Aw,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:Nw,columnHeaderHeight:Lw,...o},be.createElement(sl,null,be.createElement(Ow,{children:o.children})))};Xt.Header=Rl;Xt.Body=_g;Xt.HScrollSyncContent=hg;Xt.Footer=()=>be.createElement(Xc,null);Xt.GroupingToolbar=Mg;import*as Fg from"react";function xW(o){let{DataSource:e}=or({nodesKey:"children",...o});return Fg.createElement(e,null,o.children??null)}import*as Og from"react";function kw(o){return Og.createElement(Xt,{...o})}var Qi=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let n=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{n=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,n(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Be(`${e}:DataQuery`)}};function Io(o){if(Array.isArray(o))return o.map(Io);if(typeof o=="object"){if(o===null)return o;let e=o,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),n={};return t.forEach(r=>{let i=e[r];i!==void 0&&(n[r]=Io(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var Zt=class Zt{constructor(e){this.queryCache=new J;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let n=this.queryCache.get(t);if(e===n)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Io(e.key),n=this.options.cache?this.queryCache.get(t):null;if(n!=null){let i=n.getCurrentSnapshot();if(i.state==="success")return{query:n,fromCache:!0};if(i.state==="loading")return{query:n,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(n,t)}let r=new Qi(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:n}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&n)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Io(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Io(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Io(e);this.queryCache.delete(t)};if(this.options=e,Zt.clients.has(e.name)){let t=`There's already a DataClient with name "${e.name}". Specify a different name for the client`;throw new Error(t)}Zt.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=Zt.clients.get(e);t&&t.destroy()}static destroyAll(){Zt.clients.forEach(e=>{Zt.destroy(e.name)})}destroy(){Zt.clients.delete(this.options.name)}};Zt.clients=new Map;var Ng=Zt;var zw={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})})}}}},Vw={instantEdit:zw};import{useEffect as YW}from"react";function Gw(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 Ji=class Ji{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Ji.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}};Ji.DEFAULT_SIZE=10;var vs=Ji;var ea=class ea{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??ea.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}};ea.DEFAULT_SIZE=10;var Is=ea;import{useEffect as Hw,useRef as ta}from"react";var Kw=(o,e)=>o.every((t,n)=>t===e[n]),Bw=(o,e)=>{let t=ta(e),n=Kw(e,t.current),r=ta(!0);t.current=e;let i=ta(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=ta(o);l.current=o,Hw(()=>{if(r.current){r.current=!1;return}return l.current()},a)};import{useEffect as Ww,useRef as pr}from"react";var Lg=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),Rs=(o,e)=>{let{same:t,different:n,compare:r}=e,i=pr(t),a=pr(n),l=Lg(t,i.current,r),s=!Lg(n,a.current,r),c=pr(!0);i.current=t,a.current=n;let u=pr(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let p=pr(o);p.current=o,l&&s&&(c.current=!1),Ww(()=>{if(!c.current)return p.current()},d)};import*as ht from"react";var kg=q($.currentFlashingDuration),jw=({children:o})=>ht.createElement(ht.Fragment,null,o),zg=1e3,Vg={up:Nr({direction:"up"}).split(" "),down:Nr({direction:"down"}).split(" "),neutral:Nr({direction:"neutral"}).split(" ")},Gg=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=jw}=o;return ht.forwardRef((i,a)=>{let l=ii(),{state:{flashingDurationCSSVarValue:s}}=Q(),c=typeof s=="number"?s??e??zg:e??zg,{domRef:u,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,b=ht.useRef(!0),T=ht.useRef(d),C=b.current?null:T.current;b.current=!1;let S=ht.useRef(void 0),y=ht.useRef(void 0),I=ht.useRef(void 0);return Rs(()=>{if(d===T.current)return;let w=()=>{let D=m.current;if(S.current&&(clearTimeout(S.current),S.current=void 0),I.current&&(clearTimeout(I.current),I.current=void 0),y.current&&D){let M=y.current,A=Vg[M];D.classList.remove(...t?[t,...A]:A),D.style.removeProperty(kg),y.current=void 0}};T.current=d;let v=m.current;if(!v)return;w();let R=typeof d=="number"?d>C?"up":"down":"neutral",x=Vg[R];return v.style.setProperty(kg,`${c}`),v.classList.add(...t?[t,...x]:x),y.current=R,S.current=setTimeout(w,c),w},{same:[h,g],different:[d]}),ht.createElement("div",{ref:u,...i,className:Z(i.className)},n({children:i.children,oldValue:C}))})},$w=Gg();var y6={CheckBox:Ht,LoadMask:fi,MenuIcon:Uo,StringFilterEditor:no,NumberFilterEditor:Xr};export{ze as CellSelectionState,Ng as DataClient,B0 as DataSource,dC as DataSourceActionType,J as DeepMap,vs as FixedSizeSet,$w as FlashingColumnCell,mt as GroupRowsState,Xt as InfiniteTable,Gt as InfiniteTableClassName,Fw as InfiniteTableComponent,Lt as Menu,rr as RowDetailCache,St as RowDetailState,gt as RowDisabledState,xe as RowSelectionState,xW as TreeDataSource,nt as TreeExpandState,kw as TreeGrid,ot as TreeSelectionState,Is as WeakFixedSizeSet,zm as alignNode,y6 as components,Gg as createFlashingColumnCellComponent,zt as debounce,Be as debug,xn as defaultFilterTypes,as as eventMatchesKeyboardShortcut,Qp as filterDataArray,xn as filterTypes,mT as flatten,It as getComponentStateRoot,Ml as group,Gw as interceptMap,Vw as keyboardShortcuts,Wt as multisort,Al as multisortNested,Io as queryKeyToCacheKey,bT as toTreeDataArray,je as useComponentState,or as useDataSourceInternal,Jt as useDataSourceState,Rs as useEffectWhen,Bw as useEffectWhenSameDeps,mo as useEffectWithChanges,nN as useEffectWithObject,Ts as useGridScroll,ii as useInfiniteColumnCell,pl as useInfiniteColumnEditor,Ho as useInfiniteColumnFilterEditor,qr as useInfiniteHeaderCell,xw as useInfinitePortalContainer,tN as useLayoutEffectWithChanges,vf as useManagedDataSource,j0 as useMasterRowInfo,qt as useOverlay,FS as useOverlayPortal,In as usePrevious,W0 as useRowInfoReducers,hw as useVisibleColumnSizes};
|
|
30
30
|
//!collapsed || lazyLoad;
|