@coreui/data-grid 0.1.0-rc.0 → 0.2.0-rc.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 +5 -4
- package/dist/css/data-grid.css +149 -31
- package/dist/css/data-grid.css.map +1 -1
- package/dist/css/data-grid.min.css +2 -2
- package/dist/css/data-grid.min.css.map +1 -1
- package/dist/js/clipboard.cjs +56 -0
- package/dist/js/clipboard.cjs.map +1 -0
- package/dist/js/clipboard.mjs +54 -0
- package/dist/js/clipboard.mjs.map +1 -0
- package/dist/js/csv.cjs +36 -59
- package/dist/js/csv.cjs.map +1 -1
- package/dist/js/csv.mjs +35 -55
- package/dist/js/csv.mjs.map +1 -1
- package/dist/js/data-grid.esm.js +14078 -9332
- package/dist/js/data-grid.esm.js.map +1 -1
- package/dist/js/data-grid.esm.min.js +6 -6
- package/dist/js/data-grid.esm.min.js.map +1 -1
- package/dist/js/data-grid.js +14377 -9634
- package/dist/js/data-grid.js.map +1 -1
- package/dist/js/data-grid.lite.esm.js +10476 -0
- package/dist/js/data-grid.lite.esm.js.map +1 -0
- package/dist/js/data-grid.lite.esm.min.js +8 -0
- package/dist/js/data-grid.lite.esm.min.js.map +1 -0
- package/dist/js/data-grid.lite.js +10489 -0
- package/dist/js/data-grid.lite.js.map +1 -0
- package/dist/js/data-grid.lite.min.js +8 -0
- package/dist/js/data-grid.lite.min.js.map +1 -0
- package/dist/js/data-grid.lite.mjs +10476 -0
- package/dist/js/data-grid.lite.mjs.map +1 -0
- package/dist/js/data-grid.min.js +6 -6
- package/dist/js/data-grid.min.js.map +1 -1
- package/dist/js/data-grid.mjs +14078 -9332
- package/dist/js/data-grid.mjs.map +1 -1
- package/dist/js/drag.cjs +459 -0
- package/dist/js/drag.cjs.map +1 -0
- package/dist/js/drag.mjs +456 -0
- package/dist/js/drag.mjs.map +1 -0
- package/dist/js/export-table-CNAKStzj.mjs +26 -0
- package/dist/js/export-table-CNAKStzj.mjs.map +1 -0
- package/dist/js/export-table-doIwvE5U.cjs +55 -0
- package/dist/js/export-table-doIwvE5U.cjs.map +1 -0
- package/dist/js/filters.cjs +89 -132
- package/dist/js/filters.cjs.map +1 -1
- package/dist/js/filters.mjs +88 -128
- package/dist/js/filters.mjs.map +1 -1
- package/dist/js/labels.cjs +65 -70
- package/dist/js/labels.cjs.map +1 -1
- package/dist/js/labels.mjs +64 -66
- package/dist/js/labels.mjs.map +1 -1
- package/dist/js/print.cjs +66 -0
- package/dist/js/print.cjs.map +1 -0
- package/dist/js/print.mjs +64 -0
- package/dist/js/print.mjs.map +1 -0
- package/dist/js/validate.cjs +43 -0
- package/dist/js/validate.cjs.map +1 -0
- package/dist/js/validate.mjs +42 -0
- package/dist/js/validate.mjs.map +1 -0
- package/dist/js/xlsx.cjs +240 -0
- package/dist/js/xlsx.cjs.map +1 -0
- package/dist/js/xlsx.mjs +238 -0
- package/dist/js/xlsx.mjs.map +1 -0
- package/dist/types/base-component.d.ts +28 -18
- package/dist/types/data-grid.d.ts +26 -13
- package/dist/types/dom/data.d.ts +15 -0
- package/dist/types/dom/event-handler.d.ts +21 -10
- package/dist/types/dom/manipulator.d.ts +15 -8
- package/dist/types/engine/data-source.d.ts +1 -1
- package/dist/types/engine/features-lite.d.ts +25 -0
- package/dist/types/engine/features.d.ts +35 -0
- package/dist/types/engine/table.d.ts +3 -3
- package/dist/types/engine/validate.d.mts +1 -0
- package/dist/types/engine/validate.d.ts +20 -0
- package/dist/types/engine/virtualizer.d.ts +2 -0
- package/dist/types/icons.d.ts +6 -4
- package/dist/types/index-lite.d.mts +1 -0
- package/dist/types/index-lite.d.ts +19 -0
- package/dist/types/index.d.ts +11 -2
- package/dist/types/types.d.ts +53 -31
- package/dist/types/ui/body.d.ts +6 -3
- package/dist/types/ui/header.d.ts +3 -2
- package/dist/types/ui/loading.d.ts +1 -1
- package/dist/types/ui/pinning.d.ts +1 -1
- package/dist/types/ui/toolbar.d.ts +10 -2
- package/dist/types/util/clipboard.d.mts +1 -0
- package/dist/types/util/clipboard.d.ts +29 -0
- package/dist/types/util/config.d.ts +27 -10
- package/dist/types/util/csv.d.ts +5 -5
- package/dist/types/util/drag.d.mts +1 -0
- package/dist/types/util/drag.d.ts +48 -0
- package/dist/types/util/export-table.d.ts +47 -0
- package/dist/types/util/index.d.ts +66 -10
- package/dist/types/util/print.d.mts +1 -0
- package/dist/types/util/print.d.ts +32 -0
- package/dist/types/util/sanitizer.d.ts +15 -11
- package/dist/types/util/xlsx.d.mts +1 -0
- package/dist/types/util/xlsx.d.ts +17 -0
- package/dist/types/util/zip.d.ts +11 -0
- package/package.json +88 -10
- package/scss/data-grid.scss +204 -16
- package/src/{base-component.js → base-component.ts} +21 -17
- package/src/data-grid.ts +507 -200
- package/src/dom/{data.js → data.ts} +13 -10
- package/src/dom/event-handler.ts +380 -0
- package/src/dom/{manipulator.js → manipulator.ts} +11 -11
- package/src/engine/data-source.ts +7 -3
- package/src/engine/features-lite.ts +47 -0
- package/src/engine/features.ts +68 -0
- package/src/engine/table.ts +80 -47
- package/src/engine/validate.ts +64 -0
- package/src/engine/virtualizer.ts +17 -1
- package/src/icons.ts +11 -5
- package/src/index-lite.ts +85 -0
- package/src/index.ts +30 -2
- package/src/labels.ts +6 -4
- package/src/types.ts +87 -32
- package/src/ui/body.ts +73 -17
- package/src/ui/header.ts +51 -26
- package/src/ui/loading.ts +2 -2
- package/src/ui/pinning.ts +16 -16
- package/src/ui/toolbar.ts +27 -3
- package/src/util/clipboard.ts +112 -0
- package/src/util/{config.js → config.ts} +25 -11
- package/src/util/csv.ts +11 -30
- package/src/util/drag.ts +798 -0
- package/src/util/export-table.ts +86 -0
- package/src/util/{index.js → index.ts} +55 -35
- package/src/util/print.ts +125 -0
- package/src/util/{sanitizer.js → sanitizer.ts} +17 -13
- package/src/util/xlsx.ts +183 -0
- package/src/util/zip.ts +170 -0
- package/src/base-component.d.ts +0 -19
- package/src/dom/event-handler.d.ts +0 -11
- package/src/dom/event-handler.js +0 -331
- package/src/dom/manipulator.d.ts +0 -9
- package/src/util/config.d.ts +0 -11
- package/src/util/index.d.ts +0 -10
- package/src/util/sanitizer.d.ts +0 -11
package/dist/js/data-grid.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).coreui=e.coreui||{})}(this,function(e){"use strict";const t=new Map,n={set(e,n,o){t.has(e)||t.set(e,new Map);const l=t.get(e);l.has(n)||0===l.size?l.set(n,o):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(l.keys())[0]}.`)},get:(e,n)=>t.has(e)&&t.get(e).get(n)||null,remove(e,n){if(!t.has(e))return;const o=t.get(e);o.delete(n),0===o.size&&t.delete(e)}},o="transitionend",l=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),i=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),s=e=>{return i(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(((t=e)&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),t)):null;var t},r=()=>window.jQuery&&!document.body.hasAttribute("data-coreui-no-jquery")?window.jQuery:null,a=[],u=(e,t=[],n=e)=>"function"==typeof e?e.call(...t):n,d=/[^.]*(?=\..*)\.|.*/,c=/\..*/,g=/::\d+$/,h={};let m=1;const f={mouseenter:"mouseover",mouseleave:"mouseout"},p=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","gesturestart","gesturechange","gestureend","focus","blur","change","input","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function v(e,t){return t&&`${t}::${m++}`||e.uidEvent||m++}function b(e){const t=v(e);return e.uidEvent=t,h[t]=h[t]||{},h[t]}function _(e,t,n=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===n)}function w(e,t,n){const o="string"==typeof t,l=o?n:t||n;let i=E(e);return p.has(i)||(i=e),[o,l,i]}function S(e,t,n,o,l){if("string"!=typeof t||!e)return;let[i,s,r]=w(t,n,o);if(t in f){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};s=e(s)}const a=b(e),u=a[r]||(a[r]={}),c=_(u,s,i?n:null);if(c)return void(c.oneOff=c.oneOff&&l);const g=v(s,t.replace(d,"")),h=i?function(e,t,n){return function o(l){const i=e.querySelectorAll(t);for(let{target:s}=l;s&&s!==this;s=s.parentNode)for(const r of i)if(r===s)return I(l,{delegateTarget:s}),o.oneOff&&x.off(e,l.type,t,n),n.apply(s,[l])}}(e,n,s):function(e,t){return function n(o){return I(o,{delegateTarget:e}),n.oneOff&&x.off(e,o.type,t),t.apply(e,[o])}}(e,s);h.delegationSelector=i?n:null,h.callable=s,h.oneOff=l,h.uidEvent=g,u[g]=h,e.addEventListener(r,h,i)}function C(e,t,n,o,l){const i=_(t[n],o,l);i&&(e.removeEventListener(n,i,Boolean(l)),delete t[n][i.uidEvent])}function y(e,t,n,o){const l=t[n]||{};for(const[i,s]of Object.entries(l))i.includes(o)&&C(e,t,n,s.callable,s.delegationSelector)}function E(e){return e=e.replace(c,""),f[e]||e}const x={on(e,t,n,o){S(e,t,n,o,!1)},one(e,t,n,o){S(e,t,n,o,!0)},off(e,t,n,o){if("string"!=typeof t||!e)return;const[l,i,s]=w(t,n,o),r=s!==t,a=b(e),u=a[s]||{},d=t.startsWith(".");if(void 0===i){if(d)for(const n of Object.keys(a))y(e,a,n,t.slice(1));for(const[n,o]of Object.entries(u)){const l=n.replace(g,"");r&&!t.includes(l)||C(e,a,s,o.callable,o.delegationSelector)}}else{if(!Object.keys(u).length)return;C(e,a,s,i,l?n:null)}},trigger(e,t,n){if("string"!=typeof t||!e)return null;const o=r();let l=null,i=!0,s=!0,a=!1;t!==E(t)&&o&&(l=o.Event(t,n),o(e).trigger(l),i=!l.isPropagationStopped(),s=!l.isImmediatePropagationStopped(),a=l.isDefaultPrevented());const u=I(new Event(t,{bubbles:i,cancelable:!0}),n);return a&&u.preventDefault(),s&&e.dispatchEvent(u),u.defaultPrevented&&l&&l.preventDefault(),u}};function I(e,t={}){for(const[n,o]of Object.entries(t))try{e[n]=o}catch{Object.defineProperty(e,n,{configurable:!0,get:()=>o})}return e}function R(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function F(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const M={setDataAttribute(e,t,n){e.setAttribute(`data-coreui-${F(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-coreui-${F(t)}`)},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter(e=>e.startsWith("coreui")&&!e.startsWith("coreuiConfig"));for(const o of n){let n=o.replace(/^coreui/,"");n=n.charAt(0).toLowerCase()+n.slice(1),t[n]=R(e.dataset[o])}return t},getDataAttribute:(e,t)=>R(e.getAttribute(`data-coreui-${F(t)}`))};class A{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=i(t)?M.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...i(t)?M.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[n,o]of Object.entries(t)){const t=e[n],s=i(t)?"element":l(t);if(!new RegExp(o).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${s}" but expected type "${o}".`)}}}class L extends A{constructor(e,t){super(),(e=s(e))&&(this._element=e,this._config=this._getConfig(t),n.set(this._element,this.constructor.DATA_KEY,this))}dispose(){n.remove(this._element,this.constructor.DATA_KEY),x.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){((e,t,n=!0)=>{if(!n)return void u(e);const l=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const o=Number.parseFloat(t),l=Number.parseFloat(n);return o||l?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let i=!1;const s=({target:n})=>{n===t&&(i=!0,t.removeEventListener(o,s),u(e))};t.addEventListener(o,s),setTimeout(()=>{i||t.dispatchEvent(new Event(o))},l)})(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return n.get(s(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"0.1.0"}static get DATA_KEY(){return`coreui.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}function z(e,t){return"function"==typeof e?e(t):e}function V(e,t){return n=>{t.setState(t=>({...t,[e]:z(n,t[e])}))}}function P(e){return e instanceof Function}function O(e,t,n){let o,l=[];return i=>{let s;n.key&&n.debug&&(s=Date.now());const r=e(i);if(r.length===l.length&&!r.some((e,t)=>l[t]!==e))return o;let a;if(l=r,n.key&&n.debug&&(a=Date.now()),o=t(...r),null==n||null==n.onChange||n.onChange(o),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-s))/100,t=Math.round(100*(Date.now()-a))/100,o=t/16,l=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${l(t,5)} /${l(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==n?void 0:n.key)}return o}}function k(e,t,n,o){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:o}}const T="debugHeaders";function D(e,t,n){var o;let l={id:null!=(o=n.id)?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(l),e},getContext:()=>({table:e,header:l,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(l,e)}),l}const B={createTable:e=>{e.getHeaderGroups=O(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,l)=>{var i,s;const r=null!=(i=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?i:[],a=null!=(s=null==l?void 0:l.map(e=>n.find(t=>t.id===e)).filter(Boolean))?s:[];return H(t,[...r,...n.filter(e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id))),...a],e)},k(e.options,T)),e.getCenterHeaderGroups=O(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,l)=>H(t,n=n.filter(e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id))),e,"center"),k(e.options,T)),e.getLeftHeaderGroups=O(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var l;return H(t,null!=(l=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?l:[],e,"left")},k(e.options,T)),e.getRightHeaderGroups=O(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var l;return H(t,null!=(l=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?l:[],e,"right")},k(e.options,T)),e.getFooterGroups=O(()=>[e.getHeaderGroups()],e=>[...e].reverse(),k(e.options,T)),e.getLeftFooterGroups=O(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),k(e.options,T)),e.getCenterFooterGroups=O(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),k(e.options,T)),e.getRightFooterGroups=O(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),k(e.options,T)),e.getFlatHeaders=O(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),k(e.options,T)),e.getLeftFlatHeaders=O(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),k(e.options,T)),e.getCenterFlatHeaders=O(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),k(e.options,T)),e.getRightFlatHeaders=O(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),k(e.options,T)),e.getCenterLeafHeaders=O(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),k(e.options,T)),e.getLeftLeafHeaders=O(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),k(e.options,T)),e.getRightLeafHeaders=O(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),k(e.options,T)),e.getLeafHeaders=O(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var o,l,i,s,r,a;return[...null!=(o=null==(l=e[0])?void 0:l.headers)?o:[],...null!=(i=null==(s=t[0])?void 0:s.headers)?i:[],...null!=(r=null==(a=n[0])?void 0:a.headers)?r:[]].map(e=>e.getLeafHeaders()).flat()},k(e.options,T))}};function H(e,t,n,o){var l,i;let s=0;const r=function(e,t){void 0===t&&(t=1),s=Math.max(s,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;null!=(n=e.columns)&&n.length&&r(e.columns,t+1)},0)};r(e);let a=[];const u=(e,t)=>{const l={depth:t,id:[o,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach(e=>{const s=[...i].reverse()[0];let r,a=!1;if(e.column.depth===l.depth&&e.column.parent?r=e.column.parent:(r=e.column,a=!0),s&&(null==s?void 0:s.column)===r)s.subHeaders.push(e);else{const l=D(n,r,{id:[o,t,r.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:a,placeholderId:a?`${i.filter(e=>e.column===r).length}`:void 0,depth:t,index:i.length});l.subHeaders.push(e),i.push(l)}l.headers.push(e),e.headerGroup=l}),a.push(l),t>0&&u(i,t-1)},d=t.map((e,t)=>D(n,e,{depth:s,index:t}));u(d,s-1),a.reverse();const c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,o=[0];return e.subHeaders&&e.subHeaders.length?(o=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:l}=e;t+=n,o.push(l)})):t=1,n+=Math.min(...o),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(null!=(l=null==(i=a[0])?void 0:i.headers)?l:[]),a}const j=(e,t,n,o,l,i,s)=>{let r={id:t,index:o,original:n,depth:l,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(r._valuesCache.hasOwnProperty(t))return r._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(r._valuesCache[t]=n.accessorFn(r.original,o),r._valuesCache[t]):void 0},getUniqueValues:t=>{if(r._uniqueValuesCache.hasOwnProperty(t))return r._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(r._uniqueValuesCache[t]=n.columnDef.getUniqueValues(r.original,o),r._uniqueValuesCache[t]):(r._uniqueValuesCache[t]=[r.getValue(t)],r._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=r.getValue(t))?n:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>function(e){const t=[],n=e=>{e.forEach(e=>{t.push(e);const o=e.subRows;null!=o&&o.length&&n(o)})};return n(e),t}(r.subRows),getParentRow:()=>r.parentId?e.getRow(r.parentId,!0):void 0,getParentRows:()=>{let e=[],t=r;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:O(()=>[e.getAllLeafColumns()],t=>t.map(t=>function(e,t,n,o){const l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:()=>{var t;return null!=(t=l.getValue())?t:e.options.renderFallbackValue},getContext:O(()=>[e,n,t,l],(e,t,n,o)=>({table:e,column:t,row:n,cell:o,getValue:o.getValue,renderValue:o.renderValue}),k(e.options,"debugCells"))};return e._features.forEach(o=>{null==o.createCell||o.createCell(l,n,t,e)},{}),l}(e,r,t,t.id)),k(e.options,"debugRows")),_getAllCellsByColumnId:O(()=>[r.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),k(e.options,"debugRows"))};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(r,e)}return r},N={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},q=(e,t,n)=>{var o,l;const i=null==n||null==(o=n.toString())?void 0:o.toLowerCase();return Boolean(null==(l=e.getValue(t))||null==(l=l.toString())||null==(l=l.toLowerCase())?void 0:l.includes(i))};q.autoRemove=e=>Q(e);const G=(e,t,n)=>{var o;return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.includes(n))};G.autoRemove=e=>Q(e);const $=(e,t,n)=>{var o;return(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.toLowerCase())===(null==n?void 0:n.toLowerCase())};$.autoRemove=e=>Q(e);const K=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};K.autoRemove=e=>Q(e);const W=(e,t,n)=>!n.some(n=>{var o;return!(null!=(o=e.getValue(t))&&o.includes(n))});W.autoRemove=e=>Q(e)||!(null!=e&&e.length);const U=(e,t,n)=>n.some(n=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)});U.autoRemove=e=>Q(e)||!(null!=e&&e.length);const Z=(e,t,n)=>e.getValue(t)===n;Z.autoRemove=e=>Q(e);const J=(e,t,n)=>e.getValue(t)==n;J.autoRemove=e=>Q(e);const X=(e,t,n)=>{let[o,l]=n;const i=e.getValue(t);return i>=o&&i<=l};X.resolveFilterValue=e=>{let[t,n]=e,o="number"!=typeof t?parseFloat(t):t,l="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(o)?-1/0:o,s=null===n||Number.isNaN(l)?1/0:l;if(i>s){const e=i;i=s,s=e}return[i,s]},X.autoRemove=e=>Q(e)||Q(e[0])&&Q(e[1]);const Y={includesString:q,includesStringSensitive:G,equalsString:$,arrIncludes:K,arrIncludesAll:W,arrIncludesSome:U,equals:Z,weakEquals:J,inNumberRange:X};function Q(e){return null==e||""===e}const ee={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:V("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"string"==typeof o?Y.includesString:"number"==typeof o?Y.inNumberRange:"boolean"==typeof o||null!==o&&"object"==typeof o?Y.equals:Array.isArray(o)?Y.arrIncludes:Y.weakEquals},e.getFilterFn=()=>{var n,o;return P(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(o=t.options.filterFns)?void 0:o[e.columnDef.filterFn])?n:Y[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,l;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(o=t.options.enableColumnFilters)||o)&&(null==(l=t.options.enableFilters)||l)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find(t=>t.id===e.id))?void 0:n.value},e.getFilterIndex=()=>{var n,o;return null!=(n=null==(o=t.getState().columnFilters)?void 0:o.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{const o=e.getFilterFn(),l=null==t?void 0:t.find(t=>t.id===e.id),i=z(n,l?l.value:void 0);var s;if(te(o,i,e))return null!=(s=null==t?void 0:t.filter(t=>t.id!==e.id))?s:[];const r={id:e.id,value:i};var a;return l?null!=(a=null==t?void 0:t.map(t=>t.id===e.id?r:t))?a:[]:null!=t&&t.length?[...t,r]:[r]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var o;return null==(o=z(t,e))?void 0:o.filter(e=>{const t=n.find(t=>t.id===e.id);return!t||!te(t.getFilterFn(),e.value,t)})})},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function te(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const ne={sum:(e,t,n)=>n.reduce((t,n)=>{const o=n.getValue(e);return t+("number"==typeof o?o:0)},0),min:(e,t,n)=>{let o;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(o>n||void 0===o&&n>=n)&&(o=n)}),o},max:(e,t,n)=>{let o;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(o<n||void 0===o&&n>=n)&&(o=n)}),o},extent:(e,t,n)=>{let o,l;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(void 0===o?n>=n&&(o=l=n):(o>n&&(o=n),l<n&&(l=n)))}),[o,l]},mean:(e,t)=>{let n=0,o=0;if(t.forEach(t=>{let l=t.getValue(e);null!=l&&(l=+l)>=l&&(++n,o+=l)}),n)return o/n},median:(e,t)=>{if(!t.length)return;const n=t.map(t=>t.getValue(e));if(o=n,!Array.isArray(o)||!o.every(e=>"number"==typeof e))return;var o;if(1===n.length)return n[0];const l=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2!=0?i[l]:(i[l-1]+i[l])/2},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},oe={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:V("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var n,o;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(o=t.options.enableGrouping)||o)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"number"==typeof o?ne.sum:"[object Date]"===Object.prototype.toString.call(o)?ne.extent:void 0},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return P(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(o=t.options.aggregationFns)?void 0:o[e.columnDef.aggregationFn])?n:ne[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const o=t.getColumn(n);return null!=o&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}},le={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:V("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=O(e=>[de(t,e)],t=>t.findIndex(t=>t.id===e.id),k(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var o;return(null==(o=de(t,n)[0])?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const l=de(t,n);return(null==(o=l[l.length-1])?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=O(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>o=>{let l=[];if(null!=e&&e.length){const t=[...e],n=[...o];for(;n.length&&t.length;){const e=t.shift(),o=n.findIndex(t=>t.id===e);o>-1&&l.push(n.splice(o,1)[0])}l=[...l,...n]}else l=o;return function(e,t,n){if(null==t||!t.length||!n)return e;const o=e.filter(e=>!t.includes(e.id));return"remove"===n?o:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...o]}(l,t,n)},k(e.options,"debugTable"))}},ie={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:V("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,l,i,s,r,a;return"right"===n?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter(e=>!(null!=o&&o.includes(e))),right:[...(null!=(s=null==e?void 0:e.right)?s:[]).filter(e=>!(null!=o&&o.includes(e))),...o]}:"left"===n?{left:[...(null!=(r=null==e?void 0:e.left)?r:[]).filter(e=>!(null!=o&&o.includes(e))),...o],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter(e=>!(null!=o&&o.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=o&&o.includes(e))),right:(null!=(l=null==e?void 0:e.right)?l:[]).filter(e=>!(null!=o&&o.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,o,l;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(o=null!=(l=t.options.enableColumnPinning)?l:t.options.enablePinning)||o)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(e=>e.id),{left:o,right:l}=t.getState().columnPinning,i=n.some(e=>null==o?void 0:o.includes(e)),s=n.some(e=>null==l?void 0:l.includes(e));return i?"left":!!s&&"right"},e.getPinnedIndex=()=>{var n,o;const l=e.getIsPinned();return l?null!=(n=null==(o=t.getState().columnPinning)||null==(o=o[l])?void 0:o.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=O(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{const o=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!o.includes(e.column.id))},k(t.options,"debugRows")),e.getLeftVisibleCells=O(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"})),k(t.options,"debugRows")),e.getRightVisibleCells=O(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"})),k(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(o=e.initialState)?void 0:o.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;var l,i;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(l=o.left)?void 0:l.length)||(null==(i=o.right)?void 0:i.length))},e.getLeftLeafColumns=O(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),k(e.options,"debugColumns")),e.getRightLeafColumns=O(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),k(e.options,"debugColumns")),e.getCenterLeafColumns=O(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{const o=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!o.includes(e.id))},k(e.options,"debugColumns"))}},se={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},re={getDefaultColumnDef:()=>se,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:V("columnSizing",e),onColumnSizingInfoChange:V("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,l;const i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:se.minSize,null!=(o=null!=i?i:e.columnDef.size)?o:se.size),null!=(l=e.columnDef.maxSize)?l:se.maxSize)},e.getStart=O(e=>[e,de(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),k(t.options,"debugColumns")),e.getAfter=O(e=>[e,de(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),k(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...o}=t;return o})},e.getCanResize=()=>{var n,o;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(o=t.options.enableColumnResizing)||o)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var o;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(o=e.column.getSize())?o:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const o=t.getColumn(e.column.id),l=null==o?void 0:o.getCanResize();return i=>{if(!o||!l)return;if(null==i.persist||i.persist(),ue(i)&&i.touches&&i.touches.length>1)return;const s=e.getSize(),r=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[o.id,o.getSize()]],a=ue(i)?Math.round(i.touches[0].clientX):i.clientX,u={},d=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var o,l;const i="rtl"===t.options.columnResizeDirection?-1:1,s=(n-(null!=(o=null==e?void 0:e.startOffset)?o:0))*i,r=Math.max(s/(null!=(l=null==e?void 0:e.startSize)?l:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;u[t]=Math.round(100*Math.max(n+n*r,0))/100}),{...e,deltaOffset:s,deltaPercentage:r}}),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing(e=>({...e,...u})))},c=e=>d("move",e),g=e=>{d("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||("undefined"!=typeof document?document:null),m={moveHandler:e=>c(e.clientX),upHandler:e=>{null==h||h.removeEventListener("mousemove",m.moveHandler),null==h||h.removeEventListener("mouseup",m.upHandler),g(e.clientX)}},f={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),c(e.touches[0].clientX),!1),upHandler:e=>{var t;null==h||h.removeEventListener("touchmove",f.moveHandler),null==h||h.removeEventListener("touchend",f.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),g(null==(t=e.touches[0])?void 0:t.clientX)}},p=!!function(){if("boolean"==typeof ae)return ae;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return ae=e,ae}()&&{passive:!1};ue(i)?(null==h||h.addEventListener("touchmove",f.moveHandler,p),null==h||h.addEventListener("touchend",f.upHandler,p)):(null==h||h.addEventListener("mousemove",m.moveHandler,p),null==h||h.addEventListener("mouseup",m.upHandler,p)),t.setColumnSizingInfo(e=>({...e,startOffset:a,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}};let ae=null;function ue(e){return"touchstart"===e.type}function de(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const ce={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:V("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const o={...n},l=e.getPreGroupedRowModel().flatRows;return t?l.forEach(e=>{e.getCanSelect()&&(o[e.id]=!0)}):l.forEach(e=>{delete o[e.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const o=void 0!==t?t:!e.getIsAllPageRowsSelected(),l={...n};return e.getRowModel().rows.forEach(t=>{ge(l,t.id,o,!0,e)}),l}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=O(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?he(e,n):{rows:[],flatRows:[],rowsById:{}},k(e.options,"debugTable")),e.getFilteredSelectedRowModel=O(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?he(e,n):{rows:[],flatRows:[],rowsById:{}},k(e.options,"debugTable")),e.getGroupedSelectedRowModel=O(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?he(e,n):{rows:[],flatRows:[],rowsById:{}},k(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=Boolean(t.length&&Object.keys(n).length);return o&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some(e=>!n[e.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{const l=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=void 0!==n?n:!l,e.getCanSelect()&&l===n)return i;const r={...i};return ge(r,e.id,n,null==(s=null==o?void 0:o.selectChildren)||s,t),r})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return me(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===fe(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===fe(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var o;t&&e.toggleSelected(null==(o=n.target)?void 0:o.checked)}}}},ge=(e,t,n,o,l)=>{var i;const s=l.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),s.getCanSelect()&&(e[t]=!0)):delete e[t],o&&null!=(i=s.subRows)&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(t=>ge(e,t.id,n,o,l))};function he(e,t){const n=e.getState().rowSelection,o=[],l={},i=function(e,t){return e.map(e=>{var t;const s=me(e,n);if(s&&(o.push(e),l[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),s)return e}).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:l}}function me(e,t){var n;return null!=(n=t[e.id])&&n}function fe(e,t,n){var o;if(null==(o=e.subRows)||!o.length)return!1;let l=!0,i=!1;return e.subRows.forEach(e=>{if((!i||l)&&(e.getCanSelect()&&(me(e,t)?i=!0:l=!1),e.subRows&&e.subRows.length)){const n=fe(e,t);"all"===n?i=!0:"some"===n?(i=!0,l=!1):l=!1}}),l?"all":!!i&&"some"}const pe=/([0-9]+)/gm;function ve(e,t){return e===t?0:e>t?1:-1}function be(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function _e(e,t){const n=e.split(pe).filter(Boolean),o=t.split(pe).filter(Boolean);for(;n.length&&o.length;){const e=n.shift(),t=o.shift(),l=parseInt(e,10),i=parseInt(t,10),s=[l,i].sort();if(isNaN(s[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(s[1]))return isNaN(l)?-1:1;if(l>i)return 1;if(i>l)return-1}}return n.length-o.length}const we={alphanumeric:(e,t,n)=>_e(be(e.getValue(n)).toLowerCase(),be(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>_e(be(e.getValue(n)),be(t.getValue(n))),text:(e,t,n)=>ve(be(e.getValue(n)).toLowerCase(),be(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>ve(be(e.getValue(n)),be(t.getValue(n))),datetime:(e,t,n)=>{const o=e.getValue(n),l=t.getValue(n);return o>l?1:o<l?-1:0},basic:(e,t,n)=>ve(e.getValue(n),t.getValue(n))},Se=[B,{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:V("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;const l=e.columns;return null==(n=l.length?l.some(e=>e.getIsVisible()):null==(o=t.getState().columnVisibility)?void 0:o[e.id])||n},e.getCanHide=()=>{var n,o;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(o=t.options.enableHiding)||o)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=O(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),k(t.options,"debugRows")),e.getVisibleCells=O(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],k(t.options,"debugRows"))},createTable:e=>{const t=(t,n)=>O(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),k(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t(0,()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t(0,()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t(0,()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t(0,()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},le,ie,N,ee,{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:V("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof o||"number"==typeof o}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,l,i;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(o=t.options.enableGlobalFilter)||o)&&(null==(l=t.options.enableFilters)||l)&&(null==(i=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||i)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Y.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return P(o)?o:"auto"===o?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[o])?t:Y[o]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:V("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return we.datetime;if("string"==typeof n&&(o=!0,n.split(pe).length>1))return we.alphanumeric}return o?we.text:we.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return P(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(o=t.options.sortingFns)?void 0:o[e.columnDef.sortingFn])?n:we[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const l=e.getNextSortingOrder(),i=null!=n;t.setSorting(s=>{const r=null==s?void 0:s.find(t=>t.id===e.id),a=null==s?void 0:s.findIndex(t=>t.id===e.id);let u,d=[],c=i?n:"desc"===l;var g;return u=null!=s&&s.length&&e.getCanMultiSort()&&o?r?"toggle":"add":null!=s&&s.length&&a!==s.length-1?"replace":r?"toggle":"replace","toggle"===u&&(i||l||(u="remove")),"add"===u?(d=[...s,{id:e.id,desc:c}],d.splice(0,d.length-(null!=(g=t.options.maxMultiSortColCount)?g:Number.MAX_SAFE_INTEGER))):d="toggle"===u?s.map(t=>t.id===e.id?{...t,desc:c}:t):"remove"===u?s.filter(t=>t.id!==e.id):[{id:e.id,desc:c}],d})},e.getFirstSortDir=()=>{var n,o;return(null!=(n=null!=(o=e.columnDef.sortDescFirst)?o:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var o,l;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?!!(s===i||null!=(o=t.options.enableSortingRemoval)&&!o||n&&null!=(l=t.options.enableMultiRemove)&&!l)&&("desc"===s?"asc":"desc"):i},e.getCanSort=()=>{var n,o;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(o=t.options.enableSorting)||o)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return null!=(n=null!=(o=e.columnDef.enableMultiSort)?o:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!o&&(o.desc?"desc":"asc")},e.getSortIndex=()=>{var n,o;return null!=(n=null==(o=t.getState().sorting)?void 0:o.findIndex(t=>t.id===e.id))?n:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return o=>{n&&(null==o.persist||o.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(o))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},oe,{getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:V("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,l;if(t){if(null!=(o=null!=(l=e.options.autoResetAll)?l:e.options.autoResetExpanded)?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}}else e._queue(()=>{t=!0})},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,o;e.setExpanded(t?{}:null!=(n=null==(o=e.initialState)?void 0:o.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some(e=>!e.getIsExpanded())},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{const n=e.split(".");t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var l;const i=!0===o||!(null==o||!o[e.id]);let s={};if(!0===o?Object.keys(t.getRowModel().rowsById).forEach(e=>{s[e]=!0}):s=o,n=null!=(l=n)?l:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:t,...n}=s;return n}return o})},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===o||(null==o?void 0:o[e.id]))},e.getCanExpand=()=>{var n,o,l;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(o=t.options.enableExpanding)||o)&&!(null==(l=e.subRows)||!l.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:V("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,l;if(t){if(null!=(o=null!=(l=e.options.autoResetAll)?l:e.options.autoResetPageIndex)?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}}else e._queue(()=>{t=!0})},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>z(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination(n=>{let o=z(t,n.pageIndex);const l=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,l)),{...n,pageIndex:o}})},e.resetPageIndex=t=>{var n,o;e.setPageIndex(t?0:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageIndex)?n:0)},e.resetPageSize=t=>{var n,o;e.setPageSize(t?10:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{const n=Math.max(1,z(t,e.pageSize)),o=e.pageSize*e.pageIndex,l=Math.floor(o/n);return{...e,pageIndex:l,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var o;let l=z(t,null!=(o=e.options.pageCount)?o:-1);return"number"==typeof l&&(l=Math.max(-1,l)),{...n,pageCount:l}}),e.getPageOptions=O(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map((e,t)=>t)),t},k(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},{getInitialState:e=>({rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onRowPinningChange:V("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,l)=>{const i=o?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],s=l?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],r=new Set([...s,e.id,...i]);t.setRowPinning(e=>{var t,o,l,i,s,a;return"bottom"===n?{top:(null!=(l=null==e?void 0:e.top)?l:[]).filter(e=>!(null!=r&&r.has(e))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter(e=>!(null!=r&&r.has(e))),...Array.from(r)]}:"top"===n?{top:[...(null!=(s=null==e?void 0:e.top)?s:[]).filter(e=>!(null!=r&&r.has(e))),...Array.from(r)],bottom:(null!=(a=null==e?void 0:e.bottom)?a:[]).filter(e=>!(null!=r&&r.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=r&&r.has(e))),bottom:(null!=(o=null==e?void 0:e.bottom)?o:[]).filter(e=>!(null!=r&&r.has(e)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:l}=t.options;return"function"==typeof o?o(e):null==(n=null!=o?o:l)||n},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:l}=t.getState().rowPinning,i=n.some(e=>null==o?void 0:o.includes(e)),s=n.some(e=>null==l?void 0:l.includes(e));return i?"top":!!s&&"bottom"},e.getPinnedIndex=()=>{var n,o;const l=e.getIsPinned();if(!l)return-1;const i=null==(n="top"===l?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(o=null==i?void 0:i.indexOf(e.id))?o:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(o=e.initialState)?void 0:o.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;var l,i;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(l=o.top)?void 0:l.length)||(null==(i=o.bottom)?void 0:i.length))},e._getPinnedRows=(t,n,o)=>{var l;return(null==(l=e.options.keepPinnedRows)||l?(null!=n?n:[]).map(t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(null!=n?n:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:o}))},e.getTopRows=O(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),k(e.options,"debugRows")),e.getBottomRows=O(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),k(e.options,"debugRows")),e.getCenterRows=O(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{const o=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!o.has(e.id))},k(e.options,"debugRows"))}},ce,re];function Ce(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var o;const l=[],i={},s=null!=(o=n.options.maxLeafRowFilterDepth)?o:100,r=function(e,o){void 0===o&&(o=0);const a=[];for(let d=0;d<e.length;d++){var u;let c=e[d];const g=j(n,c.id,c.original,c.index,c.depth,0,c.parentId);if(g.columnFilters=c.columnFilters,null!=(u=c.subRows)&&u.length&&o<s){if(g.subRows=r(c.subRows,o+1),c=g,t(c)&&!g.subRows.length){a.push(c),i[c.id]=c,l.push(c);continue}if(t(c)||g.subRows.length){a.push(c),i[c.id]=c,l.push(c);continue}}else c=g,t(c)&&(a.push(c),i[c.id]=c,l.push(c))}return a};return{rows:r(e),flatRows:l,rowsById:i}}(e,t,n):function(e,t,n){var o;const l=[],i={},s=null!=(o=n.options.maxLeafRowFilterDepth)?o:100,r=function(e,o){void 0===o&&(o=0);const a=[];for(let d=0;d<e.length;d++){let c=e[d];if(t(c)){var u;if(null!=(u=c.subRows)&&u.length&&o<s){const e=j(n,c.id,c.original,c.index,c.depth,0,c.parentId);e.subRows=r(c.subRows,o+1),c=e}a.push(c),l.push(c),i[c.id]=c}}return a};return{rows:r(e),flatRows:l,rowsById:i}}(e,t,n)}const ye={text:["contains","notContains","equals","notEquals","startsWith","endsWith","blank","notBlank"],number:["equals","notEquals","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","between","blank","notBlank"],date:["equals","notEquals","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","between","blank","notBlank"]},Ee=new Set(["blank","notBlank"]),xe=e=>null==e||""===String(e).trim(),Ie=(e,t)=>{if("date"===t){const t=e instanceof Date?e.getTime():new Date(String(e)).getTime();return Number.isNaN(t)?null:t}const n="number"==typeof e?e:Number(e);return Number.isFinite(n)?n:null},Re=(e,t,n="text")=>{if("string"==typeof t)return String(null!=e?e:"").toLowerCase().includes(t.toLowerCase());if("conditions"in t){const o=t.conditions.map(t=>((e,t,n)=>{const{operator:o}=t;if("blank"===o)return xe(e);if("notBlank"===o)return!xe(e);if(xe(t.value))return!0;if("number"===n||"date"===n){const l=Ie(e,n),i=Ie(t.value,n);if(null===l||null===i)return!1;switch(o){case"equals":return l===i;case"notEquals":return l!==i;case"greaterThan":return l>i;case"greaterThanOrEqual":return l>=i;case"lessThan":return l<i;case"lessThanOrEqual":return l<=i;case"between":{const e=Ie(t.value2,n);return null===e?l>=i:l>=i&&l<=e}default:return!1}}const l=String(null!=e?e:"").toLowerCase(),i=String(t.value).toLowerCase();switch(o){case"contains":return l.includes(i);case"notContains":return!l.includes(i);case"equals":return l===i;case"notEquals":return l!==i;case"startsWith":return l.startsWith(i);case"endsWith":return l.endsWith(i);default:return!1}})(e,t,n));return"or"===t.join?o.some(Boolean):o.every(Boolean)}return t.value.some(t=>String(t)===String(e))},Fe=e=>{var t,n,o,l;const{toolbar:i}=e,s=Boolean(e.columnVisibility);if(!0===i)return{columns:s,export:!0,exportOptions:{},history:e.history,search:!0};if("object"==typeof i){const r=null!==(t=i.export)&&void 0!==t&&t;return{columns:null!==(n=i.columns)&&void 0!==n&&n&&s,export:Boolean(r),exportOptions:"object"==typeof r?r:{},history:null!==(o=i.history)&&void 0!==o&&o&&e.history,search:null!==(l=i.search)&&void 0!==l&&l||Boolean(e.globalFilter)}}return{columns:!1,export:!1,exportOptions:{},history:!1,search:Boolean(e.globalFilter)}},Me=e=>Fe(e).search,Ae=(e,t,n)=>{const o=document.createElement("button");o.type="button",o.classList.add("btn","btn-ghost","btn-sm"),o.innerHTML=e,o.setAttribute(n,""),o.setAttribute("data-coreui-tooltip",t);const l=document.createElement("span");return l.classList.add("visually-hidden"),l.textContent=t,o.append(l),o},Le=e=>{const{filterFn:t}=e;return t?(e,n,o)=>t(e.getValue(n),o,e.original):(t,n,o)=>Re(t.getValue(n),o,e.filterType)};function ze(e,t,n){let o,l=n.initialDeps??[],i=!0;function s(){const s=e();return s.length!==l.length||s.some((e,t)=>l[t]!==e)?(l=s,o=t(...s),!(null==n?void 0:n.onChange)||i&&n.skipInitialOnChange||n.onChange(o),i=!1,o):o}return s.updateDeps=e=>{l=e},s}function Ve(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const Pe=(e,t,n)=>{let o;return function(...l){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,l),n)}};let Oe;const ke=()=>{if(void 0!==Oe)return Oe;if("undefined"==typeof navigator)return Oe=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Oe=!0;const e=navigator.maxTouchPoints;return Oe="MacIntel"===navigator.platform&&void 0!==e&&e>0},Te=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},De=e=>e,Be=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,o=new Array(n);for(let e=0;e<n;e++)o[e]=t+e;return o},He=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;const l=e=>{const{width:n,height:o}=e;t({width:Math.round(n),height:Math.round(o)})};if(l(Te(n)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(t=>{const o=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void l({width:t.inlineSize,height:t.blockSize})}l(Te(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},je={passive:!0},Ne="undefined"==typeof window||"onscrollend"in window,qe=(e,t)=>((e,t,n)=>{const o=e.scrollElement;if(!o)return;const l=e.targetWindow;if(!l)return;const i=e.options.useScrollendEvent&&Ne;let s=0;const r=i?null:Pe(l,()=>t(s,!1),e.options.isScrollingResetDelay),a=e=>()=>{s=n(o),null==r||r(),t(s,e)},u=a(!0),d=a(!1);return o.addEventListener("scroll",u,je),i&&o.addEventListener("scrollend",d,je),()=>{o.removeEventListener("scroll",u),i&&o.removeEventListener("scrollend",d)}})(e,t,t=>{const{horizontal:n,isRtl:o}=e.options;return n?t.scrollLeft*(o?-1:1):t.scrollTop}),Ge=(e,t,n)=>{if(n.options.useCachedMeasurements){const t=n.indexFromElement(e),o=n.options.getItemKey(t);return n.itemSizeCache.get(o)??n.options.estimateSize(t)}if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const t=n.indexFromElement(e),o=n.options.getItemKey(t),l=n.itemSizeCache.get(o);if(void 0!==l)return l}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},$e=(e,{adjustments:t=0,behavior:n},o)=>{var l,i;null==(i=null==(l=o.scrollElement)?void 0:l.scrollTo)||i.call(l,{[o.options.horizontal?"left":"top"]:e+t,behavior:n})};class Ke{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e,t,n;return(null==(n=null==(t=null==(e=this.targetWindow)?void 0:e.performance)?void 0:t.now)?void 0:n.call(t))??Date.now()},this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{const t=()=>{const t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(const[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{var t,n;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:De,rangeExtractor:Be,onChange:()=>{},measureElement:Ge,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const t in e){const n=e[t];void 0!==n&&(o[t]=n)}const l=this.options;let i=null,s=null,r=!1;if(void 0!==l&&l.enabled&&o.enabled&&"end"===o.anchorTo&&null!==this.scrollElement){const e=l.count,a=o.count,u=this.getMeasurements(),d=e>0?(null==(t=u[0])?void 0:t.key)??l.getItemKey(0):null,c=e>0?(null==(n=u[e-1])?void 0:n.key)??l.getItemKey(e-1):null;if(a!==e||e>0&&a>0&&(o.getItemKey(0)!==d||o.getItemKey(a-1)!==c)){r=!0;const t=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??u[0]:null;t&&(i=[t.key,this.getScrollOffset()-t.start]);const n=!0===o.followOnAppend?"auto":o.followOnAppend||null;n&&a>e&&this.isAtEnd(l.scrollEndThreshold)&&(0===e||o.getItemKey(a-1)!==c)&&(s=n)}}this.options=o,r&&(this.pendingMin=0,this.itemSizeCacheVersion++);let a=!1,u=0;if(i&&null!==this.scrollOffset){const[e,t]=i,n=this.getMeasurements(),{count:o,getItemKey:l}=this.options;let s=0;for(;s<o&&l(s)!==e;)s++;if(s<o){const e=n[s];if(e){const n=e.start+t;n!==this.scrollOffset&&(u=n-this.scrollOffset,this.scrollOffset=n,a=!0)}}}(a||s)&&(this.pendingScrollAnchor=[a?i[0]:null,a?i[1]:0,s,u])},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=ze(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();if(this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&null===this._intendedScrollOffset&&e===this.scrollOffset)return;null!==this._intendedScrollOffset&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,null!==this._iosTouchEndTimerId&&null!=this.targetWindow&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,ke()&&null!=this.targetWindow&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener("touchstart",t,je),e.addEventListener("touchend",n,je),this.unsubs.push(()=>{e.removeEventListener("touchstart",t),e.removeEventListener("touchend",n),null!==this._iosTouchEndTimerId&&null!=this.targetWindow&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const n=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,n&&this.scrollElement&&this.options.enabled){const[e,t,o,l]=n;null===e||o||(ke()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?0!==l&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}},this._flushIosDeferredIfReady=()=>{if(0===this._iosDeferredAdjustment)return;if(this.isScrolling)return;if(this._iosTouching)return;if(this._iosJustTouchEnded)return;const e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;const n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=ze(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,o,l,i,s,r)=>(void 0!==this.prevLanes&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:o,enabled:l,lanes:i,laneAssignmentMode:s,gap:r}),{key:!1}),this.getMeasurements=ze(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:o,enabled:l,lanes:i,laneAssignmentMode:s,gap:r},a)=>{const u=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));const d=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),1===i){const l=2*e;let i,s=this._flatMeasurements;if(!s||s.length<l){const e=new Float64Array(l);s&&d>0&&e.set(s.subarray(0,2*d)),s=e,this._flatMeasurements=s}if(0===d)i=t+n;else{const e=d-1;i=s[2*e]+s[2*e+1]+r}for(let t=d;t<e;t++){const e=o(t),n=u.get(e),l="number"==typeof n?n:this.options.estimateSize(t);s[2*t]=i,s[2*t+1]=l,i+=l+r}const a=function(e,t,n){const o=new Array(e);return new Proxy(o,{get(o,l,i){if("string"==typeof l){const i=l.charCodeAt(0);if(i>=48&&i<=57){const i=+l;if(Number.isInteger(i)&&i>=0&&i<e){let e=o[i];if(!e){const l=t[2*i];e=o[i]={index:i,key:n(i),start:l,size:t[2*i+1],end:l+t[2*i+1],lane:0}}return e}}if("length"===l)return e}return Reflect.get(o,l,i)}})}(e,s,o);return this.measurementsCache=a,a}const c=this.measurementsCache.slice(0,d),g=new Array(i).fill(void 0),h=new Float64Array(i);let m=0;for(let e=0;e<d;e++){const t=c[e];t&&(void 0===g[t.lane]&&m++,g[t.lane]=e,h[t.lane]=t.end)}for(let l=d;l<e;l++){const e=o(l),a=this.laneAssignments.get(l);let d,f;const p="estimate"===s||u.has(e);if(void 0!==a&&this.options.lanes>1){d=a;const e=g[d],o=void 0!==e?c[e]:void 0;f=o?o.end+r:t+n}else if(m===i){let e=0,t=h[0],n=g[0];for(let o=1;o<i;o++){const l=h[o];(l<t||l===t&&g[o]<n)&&(e=o,t=l,n=g[o])}d=e,f=t+r,p&&this.laneAssignments.set(l,d)}else d=l%this.options.lanes,f=t+n,p&&this.laneAssignments.set(l,d);const v=u.get(e),b="number"==typeof v?v:this.options.estimateSize(l),_=f+b;c[l]={index:l,start:f,size:b,end:_,key:e,lane:d},void 0===g[d]&&m++,g[d]=l,h[d]=_}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ze(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,o)=>0===e.length||0===t?(this.range=null,null):(this.range=function(e,t,n,o,l){const i=e.length-1;if(e.length<=o)return{startIndex:0,endIndex:i};if(1===o&&null!==l){const e=function(e,t,n){let o=0;for(;o<=t;){const l=(o+t)/2|0,i=e[2*l];if(i<n)o=l+1;else{if(!(i>n))return l;t=l-1}}return o>0?o-1:0}(l,i,n);let o=e;const s=n+t;for(;o<i&&l[2*o]+l[2*o+1]<s;)o++;return{startIndex:e,endIndex:o}}let s=We(0,i,t=>e[t].start,n),r=s;if(1===o)for(;r<i&&e[r].end<n+t;)r++;else if(o>1){const l=Array(o).fill(0);for(;r<i&&l.some(e=>e<n+t);){const t=e[r];l[t.lane]=t.end,r++}const a=Array(o).fill(n+t);for(;s>=0&&a.some(e=>e>=n);){const t=e[s];a[t.lane]=t.start,s--}s=Math.max(0,s-s%o),r=Math.min(i,r+(o-1-r%o))}return{startIndex:s,endIndex:r}}(e,t,n,o,1===o&&null!=this._flatMeasurements?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ze(()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,o,l)=>null===o||null===l?[]:e({startIndex:o,endIndex:l,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t;if(!this.scrollState||"smooth"!==this.scrollState.behavior)return!0;const n=this.scrollState.index??(null==(t=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:t.index);if(void 0!==n&&this.range){const t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,n-t),l=Math.min(this.options.count-1,n+t);return e>=o&&e<=l}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});const t=this.indexFromElement(e),n=this.options.getItemKey(t),o=this.elementsCache.get(n);o!==e&&(o&&this.observer.unobserve(o),this.observer.observe(e),this.elementsCache.set(n,e)),this.isScrolling&&!this.scrollState||!this.shouldMeasureDuringScroll(t)||this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var n,o;if(e<0||e>=this.options.count)return;let l,i,s;const r=this._flatMeasurements;if(1===this.options.lanes&&null!==r)s=this.options.getItemKey(e),i=r[2*e],l=r[2*e+1];else{const t=this.measurementsCache[e];if(!t)return;s=t.key,i=t.start,l=t.size}const a=t-(this.itemSizeCache.get(s)??l);if(0!==a){const r="end"===this.options.anchorTo&&"smooth"!==(null==(n=this.scrollState)?void 0:n.behavior)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,u=r?this.getTotalSize():0,d="smooth"!==(null==(o=this.scrollState)?void 0:o.behavior)&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:s,start:i,size:l,end:i+l,lane:0},a,this):i<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(s)||"backward"!==this.scrollDirection));(null===this.pendingMin||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(s,t),this.itemSizeCacheVersion++,r?this.applyScrollAdjustment(this.getTotalSize()-u):d&&this.applyScrollAdjustment(a),this.notify(!1)}},this.getVirtualItems=ze(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const n=[];for(let o=0,l=e.length;o<l;o++){const l=t[e[o]];n.push(l)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0===t.length)return;const n=this._flatMeasurements,o=1===this.options.lanes&&null!=n,l=We(0,t.length-1,o?e=>n[2*e]:e=>Ve(t[e]).start,e);return Ve(t[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),l=this.getScrollOffset();"auto"===t&&(t=e>=l+o?"end":"start"),"center"===t?e+=(n-o)/2:"end"===t&&(e-=o);const i=this.getMaxScrollOffset();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.getSize(),o=this.getScrollOffset(),l=this.measurementsCache[e];if(!l)return;if("auto"===t)if(l.end>=o+n-this.options.scrollPaddingEnd)t="end";else{if(!(l.start<=o+this.options.scrollPaddingStart))return[o,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];const i="end"===t?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,t,l.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:n="auto"}={})=>{const o=this.getOffsetForAlignment(e,t),l=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t="auto",behavior:n="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));const o=this.getOffsetForIndex(e,t);if(!o)return;const[l,i]=o,s=this.now();this.scrollState={index:e,align:i,behavior:n,startedAt:s,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t="auto"}={})=>{const n=this.getScrollOffset()+e,o=this.now();this.scrollState={index:null,align:"start",behavior:t,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e="auto"}={})=>{this.options.count>0?this.scrollToIndex(this.options.count-1,{align:"end",behavior:e}):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;if(0===t.length)n=this.options.paddingStart;else if(1===this.options.lanes){const o=t.length-1,l=this._flatMeasurements;n=null!=l?l[2*o]+l[2*o+1]:(null==(e=t[o])?void 0:e.end)??0}else{const e=Array(this.options.lanes).fill(null);let o=t.length-1;for(;o>=0&&e.some(e=>null===e);){const n=t[o];null===e[n.lane]&&(e[n.lane]=n.end),o--}n=Math.max(...e.filter(e=>null!==e))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const e=[];if(0===this.itemSizeCache.size)return e;const t=this.getMeasurements();for(const n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){0!==e&&(ke()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),null!==this.scrollOffset&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){this.targetWindow?null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})):this.scrollState=null}reconcileScroll(){if(!this.scrollState)return;if(!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3)return void(this.scrollState=null);const e=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&(o=t,l=this.getScrollOffset(),Math.abs(o-l)<1.01)){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1)return this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:"auto"}),void(this.scrollState=null)}else if(this.scrollState.stableFrames=0,n){const e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),o="smooth"===this.scrollState.behavior&&n>e;this.scrollState.lastTargetOffset=t,o||(this.scrollState.behavior="auto"),this._scrollToOffset(t,{adjustments:void 0,behavior:o?"smooth":"auto"})}var o,l;this.scheduleScrollReconcile()}}const We=(e,t,n,o)=>{for(;e<=t;){const l=(e+t)/2|0,i=n(l);if(i<o)e=l+1;else{if(!(i>o))return l;t=l-1}}return e>0?e-1:0},Ue="m477.8 140.2-106-106a62.132 62.132 0 0 0-93.617 81.24l-4.913 5.533-97.654 42.9-42.611-23.026a24.04 24.04 0 0 0-28.86 4.638L62.6 189.487a23.88 23.88 0 0 0 .479 33.449l101.68 101.679L16 473.373V496h22.627l148.758-148.758L288.6 448.457a23.93 23.93 0 0 0 33.275.642l44.425-41.128a23.98 23.98 0 0 0 4.773-29.092l-23.344-42.858 42.131-90.515 8.6-10.318A62.134 62.134 0 0 0 477.8 140.2m-22.628 65.231a30.125 30.125 0 0 1-42.6 0l-16.885-16.886-33.08 39.678-50.7 108.933 28.087 51.566-34.209 31.669L91.2 205.806l32-33.89 50.969 27.543 118.386-52.008 29.177-32.863-15.158-15.161a30.126 30.126 0 0 1 42.6-42.6l106 106a30.126 30.126 0 0 1 0 42.6Z",Ze='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false">',Je=`${Ze}<path fill="currentColor" d="${Ue}"/></svg>`,Xe=`${Ze}<g transform="translate(512 0) scale(-1 1)"><path fill="currentColor" d="${Ue}"/></g></svg>`,Ye={addCondition:"Add condition",applyFilter:"Apply",clearFilter:"Clear filter",clearSort:"Unsort",columnMenu:"Column options for {column}",filterAction:"Filter…",filterColumn:"Filter {column}",firstPage:"First page",globalFilterLabel:"Search",globalFilterPlaceholder:"Search",hideColumn:"Hide column",itemsInfo:"{first}–{last} of {total}",joinAnd:"AND",joinOr:"OR",lastPage:"Last page",loadError:"Failed to load data",loading:"Loading…",moveLeft:"Move left",moveRight:"Move right",nextPage:"Next page",operatorBetween:"Between",operatorBlank:"Blank",operatorContains:"Contains",operatorEndsWith:"Ends with",operatorEquals:"Equals",operatorGreaterThan:"Greater than",operatorGreaterThanOrEqual:"Greater than or equal",operatorLessThan:"Less than",operatorLessThanOrEqual:"Less than or equal",operatorNotBlank:"Not blank",operatorNotContains:"Does not contain",operatorNotEquals:"Not equals",operatorStartsWith:"Starts with",pageSizeLabel:"Rows per page",paginationLabel:"Pagination",pinLeft:"Pin left",pinRight:"Pin right",previousPage:"Previous page",redoneAnnouncement:"Change redone",resetColumns:"Reset",resultsAnnouncement:"{count} results",searchValues:"Search values",selectAllRows:"Select all rows",selectAllValues:"Select all",selectRow:"Select row",showAllColumns:"Show all",sortAscending:"Sort ascending",sortDescending:"Sort descending",toolbarColumns:"Columns",toolbarExport:"Export",toolbarRedo:"Redo",toolbarUndo:"Undo",undoneAnnouncement:"Change undone",unpin:"Unpin"},Qe=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e),et="data-grid-cell-pinned-left",tt="data-grid-cell-pinned-right",nt="data-grid-cell-pinned-left-last",ot="data-grid-cell-pinned-right-first",lt=(e,t)=>{e.classList.remove(et,tt,nt,ot),e.style.left="",e.style.right="",t&&("left"===t.side?(e.classList.add(et),t.edge&&e.classList.add(nt),e.style.left=t.afterSelect?`calc(var(--cui-data-grid-select-cell-width) + ${t.offset}px)`:`${t.offset}px`):(e.classList.add(tt),t.edge&&e.classList.add(ot),e.style.right=`${t.offset}px`))},it=(e,t,n)=>{"string"!=typeof t?1===e.childNodes.length&&e.firstChild===t||e.replaceChildren(t):e.innerHTML=n(t)},st="data-grid-cell-editor",rt=e=>e?e.desc?"descending":"ascending":"neutral",at=(e,t)=>"ascending"===e?t.sortAscending:"descending"===e?t.sortDescending:t.sortNeutral,ut=()=>{const e=document.createElement("span");return e.classList.add("data-grid-resizer"),e.setAttribute("aria-hidden","true"),e.dataset.coreuiResizer="",e},dt=e=>{const t=document.createElement("thead");t.classList.add("data-grid-header");const n=new Map,o=new Map,l=new Map,i=new Map,s=[],r=new Map(e.columns.map(e=>[e.key,!1!==e.movable])),{row:a,selectAllInput:u,selectCell:d}=((e,t,n,o)=>{var l,i,s,r;const a=document.createElement("tr");let u=null,d=null;if(e.cellNavigation&&a.setAttribute("role","row"),e.selection){const{cell:t,input:n}=(e=>{const t=document.createElement("th");if(t.classList.add("data-grid-select-cell"),t.setAttribute("scope","col"),!e.selectAll)return{cell:t,input:null};const n=document.createElement("input");return n.type="checkbox",n.classList.add("form-check-input"),n.setAttribute("aria-label",e.labels.selectAllRows),n.dataset.coreuiSelectAll="",t.append(n),{cell:t,input:n}})(e);u=n,d=t,e.cellNavigation&&(t.setAttribute("role","columnheader"),n&&(n.tabIndex=-1)),a.append(t)}for(const u of e.columns){const d=document.createElement("th");d.setAttribute("scope","col"),d.dataset.coreuiColumn=u.key,e.cellNavigation&&(d.setAttribute("role","columnheader"),d.tabIndex=-1),u.style&&Object.assign(d.style,u.style),void 0!==u.width&&(d.style.width=`${u.width}px`);const c=document.createElement("div");if(c.classList.add("data-grid-header-cell"),e.isSortable(u)){d.classList.add("data-grid-sortable");const t=document.createElement("button");t.type="button",t.classList.add("data-grid-sort-button"),t.append(null!==(l=u.label)&&void 0!==l?l:u.key);const n=document.createElement("span");n.classList.add("data-grid-sort-icon"),n.setAttribute("aria-hidden","true"),n.innerHTML=e.icons.sortNeutral,n.dataset.coreuiSort="neutral",t.append(n),o.set(u.key,n),c.append(t)}else{const e=document.createElement("span");e.classList.add("data-grid-header-label"),e.textContent=null!==(i=u.label)&&void 0!==i?i:u.key,c.append(e)}if(e.hasFilterMenu(u)){const t=document.createElement("button");t.type="button",t.classList.add("btn","btn-ghost","btn-sm","data-grid-filter-button"),t.innerHTML=e.icons.filter,t.dataset.coreuiFilter=u.key,t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded","false");const n=Qe(e.labels.filterColumn,{column:null!==(s=u.label)&&void 0!==s?s:u.key});t.setAttribute("aria-label",n),t.setAttribute("data-coreui-tooltip",n),c.append(t)}if(e.hasMenu(u)){const t=document.createElement("button");t.type="button",t.classList.add("btn","btn-ghost","btn-sm","data-grid-menu-button"),t.innerHTML=e.icons.columnMenu,t.dataset.coreuiMenu=u.key,t.setAttribute("aria-haspopup","menu"),t.setAttribute("aria-expanded","false");const n=Qe(e.labels.columnMenu,{column:null!==(r=u.label)&&void 0!==r?r:u.key});t.setAttribute("aria-label",n),t.setAttribute("data-coreui-tooltip",n),c.append(t)}if(d.append(c),e.cellNavigation)for(const e of c.querySelectorAll("button"))e.tabIndex=-1;if(e.resizable&&e.isResizable(u)){const e=ut();n.set(u.key,e),d.append(e)}t.set(u.key,d),a.append(d)}return{row:a,selectAllInput:u,selectCell:d}})(e,n,o,l);t.append(a);let c=null,g=null;if(e.filterRow){const n=((e,t,n)=>{const o=document.createElement("tr");o.classList.add("data-grid-filter-row"),e.cellNavigation&&o.setAttribute("role","row");let l=null;e.selection&&(l=document.createElement("th"),o.append(l));for(const l of e.columns){const i=document.createElement("th"),s=e.table.getColumn(l.key);if(e.isFilterable(l)&&l.filter&&s){const t=l.filter({column:s,table:e.table,labels:e.labels});n.push(t),i.append(t.element)}t.set(l.key,i),o.append(i)}return{row:o,selectCell:l}})(e,i,s);g=n.selectCell,c=n.row,t.append(n.row)}let h=null;return{element:t,rowCount:e.filterRow?2:1,update(t){var m,f,p,v,b,_;const w=t.order.join("|");w!==h&&(h=w,(t=>{const o=new Set(t),l=(n,l,i)=>{const s=i?[i]:[];for(const e of t){const t=l.get(e);t&&s.push(t)}if(n.append(...s),e.cellNavigation)for(const[e,t]of s.entries())t.setAttribute("aria-colindex",String(e+1));for(const[e,t]of l)o.has(e)||t.remove()};l(a,n,d),c&&l(c,i,g)})(t.order));for(const[o,i]of n){const n=t.sorting.find(e=>e.id===o),s=rt(n);"neutral"===s?i.removeAttribute("aria-sort"):i.setAttribute("aria-sort",s);const r=l.get(o);r&&r.dataset.coreuiSort!==s&&(r.dataset.coreuiSort=s,r.innerHTML=at(s,e.icons)),t.sizes&&void 0!==t.sizes[o]&&(i.style.width=`${t.sizes[o]}px`),t.pinning&<(i,null!==(m=t.pinning.columns[o])&&void 0!==m?m:null)}if(e.draggable){const e=e=>{var n,o,l;return null!==(l=null===(o=null===(n=t.pinning)||void 0===n?void 0:n.columns[e])||void 0===o?void 0:o.side)&&void 0!==l?l:"center"},o=new Map;for(const n of t.order)if(r.get(n)){const t=e(n);o.set(t,(null!==(f=o.get(t))&&void 0!==f?f:0)+1)}for(const[t,l]of n){const n=Boolean(r.get(t))&&(null!==(p=o.get(e(t)))&&void 0!==p?p:0)>1;l.draggable=n,n?l.dataset.coreuiDraggable="":delete l.dataset.coreuiDraggable}}for(const[e,n]of o)n.classList.toggle("data-grid-resizer-active",t.resizingColumn===e);if(t.filteredColumns)for(const[e,o]of n)null===(v=o.querySelector("[data-coreui-filter]"))||void 0===v||v.classList.toggle("data-grid-filter-button-filtered",t.filteredColumns.includes(e));if(t.pinning){for(const[e,n]of i)lt(n,null!==(b=t.pinning.columns[e])&&void 0!==b?b:null);d&<(d,t.pinning.select),g&<(g,t.pinning.select)}u&&t.selectAll&&(u.checked=t.selectAll.checked,u.indeterminate=t.selectAll.indeterminate);for(const e of s)null===(_=e.update)||void 0===_||_.call(e)},dispose(){var e;for(const t of s)null===(e=t.dispose)||void 0===e||e.call(t)}}},ct={contains:"operatorContains",notContains:"operatorNotContains",equals:"operatorEquals",notEquals:"operatorNotEquals",startsWith:"operatorStartsWith",endsWith:"operatorEndsWith",blank:"operatorBlank",notBlank:"operatorNotBlank",greaterThan:"operatorGreaterThan",greaterThanOrEqual:"operatorGreaterThanOrEqual",lessThan:"operatorLessThan",lessThanOrEqual:"operatorLessThanOrEqual",between:"operatorBetween"};let gt=0;const ht=e=>"number"===e?"number":"date"===e?"date":"text",mt=e=>{const t=document.createElement("div");t.classList.add("data-grid-filter-menu"),t.setAttribute("role","dialog"),t.id="data-grid-filter-menu-"+ ++gt;let n=null;const o=(e=!1)=>{n&&(n.setAttribute("aria-expanded","false"),n.removeAttribute("aria-controls"),e&&n.focus(),n=null,t.remove(),document.removeEventListener("pointerdown",l,!0),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i))},l=e=>{const l=e.target;t.contains(l)||(null==n?void 0:n.contains(l))||o()},i=e=>{(null==e?void 0:e.target)instanceof Node&&t.contains(e.target)||o()},s=e=>{"Escape"===e.key&&(e.stopPropagation(),o(!0))};t.addEventListener("keydown",s);const r=(t,n)=>{var o;const l=document.createElement("div");l.classList.add("data-grid-filter-menu-condition");const i=document.createElement("select");i.classList.add("form-select","form-select-sm"),i.setAttribute("aria-label",e.labels.filterAction);for(const n of ye[t]){const t=document.createElement("option");t.value=n,t.textContent=e.labels[ct[n]],i.append(t)}i.value=null!==(o=null==n?void 0:n.operator)&&void 0!==o?o:ye[t][0];const s=document.createElement("input");s.type=ht(t),s.classList.add("form-control","form-control-sm"),s.dataset.coreuiFilterValue="",s.value=void 0===(null==n?void 0:n.value)?"":String(n.value);const r=document.createElement("input");r.type=ht(t),r.classList.add("form-control","form-control-sm"),r.dataset.coreuiFilterValue2="",r.value=void 0===(null==n?void 0:n.value2)?"":String(n.value2);const a=()=>{const e=i.value;s.hidden=Ee.has(e),r.hidden="between"!==e};return i.addEventListener("change",a),l.append(i,s,r),a(),l},a=(t,n)=>{const l=document.createElement("div");l.classList.add("data-grid-filter-menu-footer");const i=document.createElement("button");i.type="button",i.classList.add("btn","btn-primary","btn-sm"),i.textContent=e.labels.applyFilter,i.addEventListener("click",t);const s=document.createElement("button");return s.type="button",s.classList.add("btn","btn-outline-secondary","btn-sm"),s.textContent=e.labels.clearFilter,s.addEventListener("click",()=>{e.applyFilter(n),o(!0)}),l.append(i,s),l},u=(s,u)=>{var d,c,g;o();const h=e.getColumn(u);if(!h)return;t.setAttribute("aria-label",Qe(e.labels.filterColumn,{column:null!==(d=h.label)&&void 0!==d?d:h.key}));const m=null!==(c=h.filterType)&&void 0!==c?c:"text";t.replaceChildren("select"===m?(t=>{const n=e.getFacetedValues(t),l=e.getFilterValue(t),i=l&&"string"!=typeof l&&"operator"in l?new Set(l.value.map(String)):null,s=document.createElement("div"),r=document.createElement("div");r.classList.add("data-grid-filter-menu-values");const u=[],d=(e,t)=>{const n=document.createElement("label");n.classList.add("form-check");const o=document.createElement("input");o.type="checkbox",o.classList.add("form-check-input"),o.checked=t;const l=document.createElement("span");return l.classList.add("form-check-label"),l.textContent=e,n.append(o,l),r.append(n),o},c=d(e.labels.selectAllValues,null===i);c.dataset.coreuiSelectAllValues="";for(const e of n){const t=d(String(e),null===i||i.has(String(e)));t.dataset.coreuiFilterOption=String(e),u.push(t)}const g=()=>{c.checked=u.every(e=>e.checked)};if(c.addEventListener("change",()=>{for(const e of u)e.checked=c.checked}),r.addEventListener("change",e=>{e.target!==c&&g()}),g(),n.length>10){const t=document.createElement("input");t.type="text",t.classList.add("form-control","form-control-sm"),t.setAttribute("aria-label",e.labels.searchValues),t.placeholder=e.labels.searchValues,t.addEventListener("input",()=>{const e=t.value.toLowerCase();for(const t of u)t.closest("label").hidden=!t.dataset.coreuiFilterOption.toLowerCase().includes(e)}),s.append(t)}return s.append(r),s.append(a(()=>{const n=u.filter(e=>e.checked);e.applyFilter(t,n.length===u.length?void 0:{operator:"in",value:n.map(e=>e.dataset.coreuiFilterOption)}),o(!0)},t)),s})(u):((n,l)=>{var i;const s=e.getFilterValue(n),u=s&&"string"!=typeof s&&"conditions"in s?s.conditions:[],d=s&&"string"!=typeof s&&"conditions"in s?s.join:"and",c=[r(l,null!==(i=u[0])&&void 0!==i?i:null)],g=document.createElement("div");g.append(c[0]);const h=document.createElement("div");h.classList.add("data-grid-filter-menu-join");const m=`${t.id}-join`;for(const t of["and","or"]){const n=document.createElement("label"),o=document.createElement("input");o.type="radio",o.classList.add("form-check-input"),o.name=m,o.value=t,o.checked=d===t,n.append(o,` ${"and"===t?e.labels.joinAnd:e.labels.joinOr}`),h.append(n)}const f=document.createElement("button");f.type="button",f.classList.add("btn","btn-link","btn-sm"),f.textContent=e.labels.addCondition;const p=()=>{var e;c.length>=2||(c.push(r(l,null!==(e=u[1])&&void 0!==e?e:null)),f.before(h,c[1]),f.hidden=!0)};return f.addEventListener("click",p),g.append(f),u.length>1&&p(),g.append(a(()=>{var t,l;const i=c.map(e=>(e=>{const t=e.querySelector("select").value,{value:n}=e.querySelector("[data-coreui-filter-value]"),o=e.querySelector("[data-coreui-filter-value2]").value;return Ee.has(t)?{operator:t}:""===n.trim()?null:{operator:t,value:n,..."between"===t&&""!==o.trim()&&{value2:o}}})(e)).filter(e=>null!==e),s=null!==(l=null===(t=h.querySelector("input:checked"))||void 0===t?void 0:t.value)&&void 0!==l?l:"and";e.applyFilter(n,0===i.length?void 0:{conditions:i,join:s}),o(!0)},n)),g})(u,m)),n=s,s.setAttribute("aria-expanded","true"),s.setAttribute("aria-controls",t.id),e.root.append(t);const f=e.root.getBoundingClientRect(),p=s.getBoundingClientRect();t.style.top=p.bottom-f.top+"px",t.style.left=`${Math.max(p.right-f.left-t.offsetWidth,0)}px`,document.addEventListener("pointerdown",l,!0),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),null===(g=t.querySelector("select, input"))||void 0===g||g.focus()};return{toggle(e,t){n!==e?(o(),u(e,t)):o(!0)},close(){o()},dispose(){o(),t.removeEventListener("keydown",s)}}},ft="data-grid-menu-item";let pt=0;const vt=(e,t,n={})=>{const o=document.createElement("li");o.classList.add("page-item"),n.active&&(o.classList.add("active"),o.setAttribute("aria-current","page")),n.disabled&&o.classList.add("disabled");const l=document.createElement("button");return l.type="button",l.classList.add("page-link"),l.textContent=e,l.disabled=Boolean(n.disabled),l.dataset.coreuiPage=t,n.ariaLabel&&l.setAttribute("aria-label",n.ariaLabel),o.append(l),o};let bt=0;const _t="data-coreui-tooltip",wt=`[${_t}]`,St=(e,t={})=>{var n;const o=null!==(n=t.delimiter)&&void 0!==n?n:",",l=[...e.getLeftVisibleLeafColumns(),...e.getCenterVisibleLeafColumns(),...e.getRightVisibleLeafColumns()],i=e=>{return((e,t)=>/["\r\n]/.test(e)||e.includes(t)?`"${e.replace(/"/g,'""')}"`:e)(t.sanitize?/^[=+\-@\t\r]/.test(n=e)?`'${n}`:n:e,o);var n},s=e=>e.map(i).join(o),r=s(l.map(e=>{var t,n;return String(null!==(n=null===(t=e.columnDef.meta)||void 0===t?void 0:t.label)&&void 0!==n?n:e.id)})),a=((e,t)=>"all"===t?e.getCoreRowModel().rows:"selected"===t?e.getSelectedRowModel().rows:e.getSortedRowModel().rows)(e,t.scope).map(e=>s(l.map(t=>{var n;const o=e.getValue(t.id),l=t.columnDef.meta;return(null==l?void 0:l.formatter)?String(null!==(n=l.formatter(o,e.original))&&void 0!==n?n:""):String(null!=o?o:"")}))),u=[r,...a].join("\r\n");return t.bom?`\ufeff${u}`:u},Ct=(e,t={})=>{var n;const o=new Blob([St(e,t)],{type:"text/csv;charset=utf-8;"}),l=URL.createObjectURL(o),i=document.createElement("a");i.href=l,i.download=null!==(n=t.filename)&&void 0!==n?n:"export.csv",i.style.display="none",document.body.append(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(l))},yt=(e,t)=>{let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>e(...o),t)}},Et={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},xt={...Et,svg:["xmlns","version","baseprofile","width","height","viewbox","preserveaspectratio","aria-hidden","role","focusable","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin"],g:["id","class","transform","style"],path:["id","class","d","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","stroke-opacity"],circle:["id","class","cx","cy","r","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],rect:["id","class","x","y","width","height","rx","ry","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],ellipse:["id","class","cx","cy","rx","ry","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],line:["id","class","x1","y1","x2","y2","stroke","stroke-width","stroke-linecap","stroke-opacity"],polygon:["id","class","points","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],polyline:["id","class","points","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],text:["id","class","x","y","dx","dy","text-anchor","font-family","font-size","font-weight","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],tspan:["id","class","x","y","dx","dy","text-anchor","font-family","font-size","font-weight","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],defs:[],symbol:["id","class","viewbox","preserveaspectratio"],use:["id","class","x","y","width","height","href"],image:["id","class","x","y","width","height","href","preserveaspectratio","xlink:href"],pattern:["id","class","x","y","width","height","patternunits","patterncontentunits","patterntransform","preserveaspectratio"],lineargradient:["id","class","gradientunits","x1","y1","x2","y2","spreadmethod","gradienttransform"],radialgradient:["id","class","gradientunits","cx","cy","r","fx","fy","spreadmethod","gradienttransform"],mask:["id","class","x","y","width","height","maskunits","maskcontentunits","masktransform"],clippath:["id","class","clippathunits"],marker:["id","class","markerunits","markerwidth","markerheight","orient","preserveaspectratio","viewbox","refx","refy"],title:[],desc:[]},It=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Rt=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Ft=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?!It.has(n)||Boolean(Rt.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(n))};function Mt(e,t,n){if(!e.length)return e;if(n&&"function"==typeof n)return n(e);const o=(new window.DOMParser).parseFromString(e,"text/html"),l=[].concat(...o.body.querySelectorAll("*"));for(const e of l){const n=e.nodeName.toLowerCase();if(!Object.keys(t).includes(n)){e.remove();continue}const o=[].concat(...e.attributes),l=[].concat(t["*"]||[],t[n]||[]);for(const t of o)Ft(t,l)||e.removeAttribute(t.nodeName)}return o.body.innerHTML}const At=".coreui.data-grid",Lt=`change${At}`,zt=`click${At}`,Vt=`dataError${At}`,Pt=`dataLoad${At}`,Ot=`dblclick${At}`,kt=`editCancel${At}`,Tt=`editCommit${At}`,Dt=`editStart${At}`,Bt=`filterChange${At}`,Ht=`input${At}`,jt=`orderChange${At}`,Nt=`paginationChange${At}`,qt=`pinningChange${At}`,Gt=`selectionChange${At}`,$t=`sizingChange${At}`,Kt=`sortingChange${At}`,Wt=`visibilityChange${At}`,Ut=`focusin${At}`,Zt=`focusout${At}`,Jt=`keydown${At}`,Xt=`dragend${At}`,Yt=`dragleave${At}`,Qt=`dragover${At}`,en=`dragstart${At}`,tn=`drop${At}`,nn=`mousedown${At}`,on=`pointerdown${At}`,ln=`touchstart${At}`,sn="data-grid",rn="data-grid-dragging",an="data-grid-drop-target",un="th[data-coreui-draggable]",dn="input[data-coreui-global-filter]",cn="[data-coreui-resizer]",gn="button[data-coreui-toolbar-redo]",hn="button[data-coreui-toolbar-undo]",mn=[5,10,20,50];let fn=0;const pn="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]",vn=(e,t)=>{const n=t?0:-1;e.tabIndex!==n&&(e.tabIndex=n)},bn={cellNavigation:!1,columnFilters:!1,columnMenu:!1,columnMenuIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M204 148a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26M204 264a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26M204 380a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26"/></svg>',columnOrder:!1,columnPinning:!1,columnSizing:!1,columnVisibility:!1,columns:[],dataProvider:null,editing:!1,empty:"No items found",filterIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M96 197.333h320v32H96zm72 101.334h176v32H168zM216 400h80v32h-80zM48 96h416v32H48z"/></svg>',globalFilter:!1,hideColumnIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="m397.222 131.1-.218-.223c-63.173-63.17-158.534-75.015-233.776-35.531l23.938 23.939c61.571-27.691 136.573-16.327 187.105 34.115L464 246.683v3.107l-71.744 74.585 22.63 22.63L496 262.683V233.79Z"/><path fill="currentColor" d="M352.8 284.33a103.307 103.307 0 0 0-132.893-132.892L246.1 177.63a71.228 71.228 0 0 1 80.507 80.508Zm17.1 62.938-33.831-33.831c.088-.108.179-.212.266-.32l-22.805-22.806q-.126.168-.253.334l-99.681-99.681.334-.253-22.81-22.805c-.108.087-.213.179-.321.266L38.627 16H16v22.627l95.689 95.689L16 233.79v28.893l98.778 102.689.218.222A199.73 199.73 0 0 0 367.372 390l106 106H496v-22.627L392.537 369.911Zm-177.157-131.9 96.128 96.132a71.28 71.28 0 0 1-96.133-96.133Zm-55.014 127.705L48 249.79v-3.107l86.319-89.737 35.065 35.064a103.248 103.248 0 0 0 142.842 142.843l32.007 32.007c-64.51 40.015-150.522 32.095-206.504-23.787"/></svg>',history:!1,itemKey:null,items:[],labels:{},moveLeftIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M254.625 56h-38.632L16 256.2 216 456h38.623V336h144V176h-144Zm112 152v96h-144v113.384l-161.37-161.21 161.37-161.535V208Zm96-152h32v400h-32z"/></svg>',moveRightIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M296.007 56h-38.632v120h-144v160h144v120H296l200-199.8Zm-6.632 361.384V304h-144v-96h144V94.639l161.37 161.535ZM17.375 56h32v400h-32z"/></svg>',overscan:10,pagination:!1,pinLeftIcon:Je,pinRightIcon:Xe,rowHeight:44,rowSelection:!1,sanitize:!0,sanitizeFn:null,slots:{},sortAscendingIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M390.624 150.625 256 16 121.376 150.625l22.628 22.627 95.997-95.998v417.982h32V77.257l95.995 95.995z"/></svg>',sortDescendingIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="m367.997 338.75-95.998 95.997V17.503h-32v417.242l-95.996-95.995-22.627 22.627L256 496l134.624-134.623z"/></svg>',sortNeutralIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M384 433.373V160h-32v274.51l-69.823-69.823-22.627 22.626 107.882 107.883 107.881-107.883-22.626-22.626zM159.432 17.372 51.55 125.255l22.627 22.627L144 78.059V352h32V79.195l68.687 68.687 22.626-22.627z"/></svg>',sorterVisibility:!1,sorting:!0,stateKey:null,toolbar:!1,toolbarColumnsIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M16 64v384h480V64Zm304 32v320H192V96ZM48 96h112v320H48Zm416 320H352V96h112Z"/></svg>',toolbarExportIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M16 464h480v32H16zm379.313-164.687-22.626-22.626L280 369.373V16h-32v353.373l-92.687-92.686-22.626 22.626L264 430.627z"/></svg>',toolbarRedoIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M361.376 495.163 226.753 360.54l22.627-22.627 111.996 111.996 111.997-111.996L496 360.54z"/><path fill="currentColor" d="M377.377 472.52h-32V196.426C345.377 114.584 278.794 48 196.952 48c-83.229 0-148.426 63.106-148.426 143.667h-32c0-48.024 18.85-92.569 53.079-125.429C103.35 33.842 148.576 16 196.952 16c99.487 0 180.425 80.938 180.425 180.426Z"/></svg>',toolbarUndoIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M495.473 197.262c0-73.061-43.651-136.118-106.242-164.462q-2-.9-4.021-1.762-4.046-1.715-8.19-3.235-2.071-.761-4.167-1.47-4.19-1.422-8.468-2.64a180.95 180.95 0 0 0-98.675 0q-4.278 1.218-8.469 2.64-2.094.71-4.166 1.47-4.143 1.519-8.19 3.235-2.023.857-4.021 1.762c-62.592 28.344-106.242 91.4-106.242 164.462v237.483L38.627 338.75 16 361.377 150.623 496l134.623-134.623-22.627-22.627-96 96V197.263c0-72.891 52.814-133.678 122.186-146.1a149.4 149.4 0 0 1 52.479 0c69.371 12.426 122.186 73.213 122.186 146.1h32Z"/></svg>',unpinIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="m427.314 107.313-22.628-22.626L256 233.373 107.314 84.687l-22.628 22.626L233.373 256 84.686 404.687l22.628 22.626L256 278.627l148.686 148.686 22.628-22.626L278.627 256z"/></svg>',virtualization:!0},_n={cellNavigation:"boolean",columnFilters:"boolean",columnMenu:"(boolean|function)",columnMenuIcon:"string",columnOrder:"(boolean|array)",columnPinning:"(boolean|object)",columnSizing:"(boolean|object)",columnVisibility:"(boolean|object)",columns:"array",dataProvider:"(function|null)",editing:"boolean",empty:"(string|function)",filterIcon:"string",globalFilter:"boolean",hideColumnIcon:"string",history:"boolean",itemKey:"(function|null)",items:"array",labels:"object",moveLeftIcon:"string",moveRightIcon:"string",overscan:"number",pagination:"(boolean|object)",pinLeftIcon:"string",pinRightIcon:"string",rowHeight:"number",rowSelection:"(boolean|object)",sanitize:"boolean",sanitizeFn:"(function|null)",slots:"object",sortAscendingIcon:"string",sortDescendingIcon:"string",sortNeutralIcon:"string",sorterVisibility:"(string|boolean)",sorting:"(boolean|object)",stateKey:"(string|null)",toolbar:"(boolean|object)",toolbarColumnsIcon:"string",toolbarExportIcon:"string",toolbarRedoIcon:"string",toolbarUndoIcon:"string",unpinIcon:"string",virtualization:"boolean"};class wn extends L{constructor(e,t){super(e,t),this._virtualizer=null,this._toolbar=null,this._paginations=[],this._emptySlot=null,this._dataSource=null,this._loading=null,this._loadFailed=!1,this._dataVersion=0,this._liveRegion=null,this._selectionAnchorIndex=null,this._activeCell=null,this._containsFocus=!1,this._editingCell=null,this._undoStack=[],this._redoStack=[],this._persistState=null,this._editor=null,this._editorPointerdownHandler=null,this._editorPopup=null,this._editorErrorElement=null,this._editorFocusPending=!1,this._columnsByKey=new Map,this._dragColumn=null,this._menu=null,this._tooltip=null,this._filterMenu=null,this._columnChooser=null,this._toolbarConfig=null,this._element&&(this._labels={...Ye,...this._config.labels},this._scheduler=(e=>{let t=!1,n=!1;const o=()=>{t=!1,n||e()};return{schedule(){t||n||(t=!0,"function"!=typeof window.requestAnimationFrame?setTimeout(o,16):window.requestAnimationFrame(o))},dispose(){n=!0}}})(()=>this._update()),this._table=this._createTable(),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("visually-hidden"),this._liveRegion.setAttribute("aria-live","polite"),this._element.append(this._liveRegion),this._render(),this._addEventListeners(),this._tooltip=(e=>{const t=document.createElement("div");t.className="data-grid-tooltip",t.setAttribute("role","tooltip"),t.setAttribute("aria-hidden","true"),t.hidden=!0,e.append(t);let n,o=null;const l=e=>{const t=e instanceof Element?e.closest(wt):null;return t instanceof HTMLElement&&t.getAttribute(_t)?t:null},i=e=>{o=e,t.textContent=e.getAttribute(_t),t.style.visibility="hidden",t.hidden=!1,(()=>{if(!o)return;const e=o.getBoundingClientRect(),n=t.offsetWidth,l=t.offsetHeight,i=e.top-l-6,s=i>=0?i:e.bottom+6,r=Math.max(4,Math.min(e.left+(e.width-n)/2,window.innerWidth-n-4));t.style.top=`${s}px`,t.style.left=`${r}px`,t.style.visibility="visible"})()},s=()=>{clearTimeout(n),o=null,t.hidden=!0},r=e=>{const t=l(e.target);t&&t!==o&&(clearTimeout(n),n=setTimeout(()=>i(t),200))},a=e=>{o&&e.relatedTarget instanceof Node&&o.contains(e.relatedTarget)||s()},u=e=>{const t=l(e.target);t&&i(t)};return e.addEventListener("pointerover",r),e.addEventListener("pointerout",a),e.addEventListener("pointerdown",s),e.addEventListener("focusin",u),e.addEventListener("focusout",s),window.addEventListener("scroll",s,!0),{dispose(){clearTimeout(n),e.removeEventListener("pointerover",r),e.removeEventListener("pointerout",a),e.removeEventListener("pointerdown",s),e.removeEventListener("focusin",u),e.removeEventListener("focusout",s),window.removeEventListener("scroll",s,!0),t.remove()}}})(this._element),this._restorePersistedState(),this._initDataSource())}get table(){return this._table}static get Default(){return bn}static get DefaultType(){return _n}static get NAME(){return"data-grid"}static getInstance(e){return super.getInstance(e)}static getOrCreateInstance(e,t){return super.getOrCreateInstance(e,t)}getSelectedItems(){return this._table.getSelectedRowModel().rows.map(e=>e.original)}getCsv(e){return St(this._table,e)}downloadCsv(e){Ct(this._table,e)}getState(){var e;const t=this._table.getState();return{columnFilters:t.columnFilters,columnOrder:t.columnOrder,columnPinning:t.columnPinning,columnSizing:t.columnSizing,columnVisibility:t.columnVisibility,globalFilter:null!==(e=t.globalFilter)&&void 0!==e?e:"",pagination:t.pagination,rowSelection:t.rowSelection,sorting:t.sorting}}restoreState(e){if(this._table.setState(t=>({...t,...e})),void 0!==e.globalFilter){const t=this._element.querySelector(dn);t&&(t.value=e.globalFilter)}this._scheduler.schedule()}undo(){this._applyHistoryEntry(this._undoStack,this._redoStack,!0)}redo(){this._applyHistoryEntry(this._redoStack,this._undoStack,!1)}_applyHistoryEntry(e,t,n){const o=e.pop();if(!o)return;const l=this._table.getCoreRowModel().rowsById[o.rowId];l?(t.push(o),x.trigger(this._element,Tt,{item:l.original,columnId:o.columnId,value:n?o.previousValue:o.value,previousValue:n?o.value:o.previousValue}),this._announce(n?this._labels.undoneAnnouncement:this._labels.redoneAnnouncement),this._updateHistoryButtons()):this._updateHistoryButtons()}setItems(e){this._config.dataProvider||(this._stopEditing({commit:!1}),this._config.items=e,this._dataVersion++,this._table.setOptions(t=>({...t,data:e})),this._scheduler.schedule())}update(e){this._config=this._getConfig({...this._config,...e}),this._labels={...Ye,...this._config.labels},this._teardownUi(),this._selectionAnchorIndex=null,this._loadFailed=!1,this._dataVersion++,this._table=this._createTable(),this._render(),this._initDataSource()}dispose(){var e;this._teardownUi(),this._scheduler.dispose(),null===(e=this._tooltip)||void 0===e||e.dispose(),this._tooltip=null,this._liveRegion&&this._liveRegion.remove(),this._element.classList.remove(sn),this._element.removeAttribute("data-coreui-sorter-visibility"),super.dispose()}_configAfterMerge(e){return e.editing&&(e.cellNavigation=!0),e}_createTable(){return((e,t)=>{var n,o;const l="object"==typeof e.sorting?e.sorting:{},i="object"==typeof e.columnSizing?e.columnSizing:{},s="object"==typeof e.pagination?e.pagination:{},r=Boolean(e.dataProvider),a=Boolean(e.columnSizing),u=Boolean(e.columnPinning),d=a||u,c=Boolean(e.pagination)||r,g={...c&&{pagination:{pageIndex:0,pageSize:null!==(n=s.pageSize)&&void 0!==n?n:10}},..."object"==typeof e.columnPinning&&{columnPinning:e.columnPinning},...Array.isArray(e.columnOrder)&&{columnOrder:e.columnOrder},..."object"==typeof e.columnVisibility&&{columnVisibility:e.columnVisibility}},h=function(e){var t,n;const o=[...Se,...null!=(t=e._features)?t:[]];let l={_features:o};const i=l._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(l)),{});let s={...null!=(n=e.initialState)?n:{}};l._features.forEach(e=>{var t;s=null!=(t=null==e.getInitialState?void 0:e.getInitialState(s))?t:s});const r=[];let a=!1;const u={_features:o,options:{...i,...e},initialState:s,_queue:e=>{r.push(e),a||(a=!0,Promise.resolve().then(()=>{for(;r.length;)r.shift()();a=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{l.setState(l.initialState)},setOptions:e=>{const t=z(e,l.options);l.options=(e=>l.options.mergeOptions?l.options.mergeOptions(i,e):{...i,...e})(t)},getState:()=>l.options.state,setState:e=>{null==l.options.onStateChange||l.options.onStateChange(e)},_getRowId:(e,t,n)=>{var o;return null!=(o=null==l.options.getRowId?void 0:l.options.getRowId(e,t,n))?o:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?l.getPrePaginationRowModel():l.getRowModel()).rowsById[e];if(!n&&(n=l.getCoreRowModel().rowsById[e],!n))throw new Error;return n},_getDefaultColumnDef:O(()=>[l.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...l._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},k(e,"debugColumns")),_getColumnDefs:()=>l.options.columns,getAllColumns:O(()=>[l._getColumnDefs()],e=>{const t=function(e,n,o){return void 0===o&&(o=0),e.map(e=>{const i=function(e,t,n,o){var l,i;const s={...e._getDefaultColumnDef(),...t},r=s.accessorKey;let a,u=null!=(l=null!=(i=s.id)?i:r?"function"==typeof String.prototype.replaceAll?r.replaceAll(".","_"):r.replace(/\./g,"_"):void 0)?l:"string"==typeof s.header?s.header:void 0;if(s.accessorFn?a=s.accessorFn:r&&(a=r.includes(".")?e=>{let t=e;for(const e of r.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[s.accessorKey]),!u)throw new Error;let d={id:`${String(u)}`,accessorFn:a,parent:o,depth:n,columnDef:s,columns:[],getFlatColumns:O(()=>[!0],()=>{var e;return[d,...null==(e=d.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},k(e.options,"debugColumns")),getLeafColumns:O(()=>[e._getOrderColumnsFn()],e=>{var t;if(null!=(t=d.columns)&&t.length){let t=d.columns.flatMap(e=>e.getLeafColumns());return e(t)}return[d]},k(e.options,"debugColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(d,e);return d}(l,e,o,n),s=e;return i.columns=s.columns?t(s.columns,i,o+1):[],i})};return t(e)},k(e,"debugColumns")),getAllFlatColumns:O(()=>[l.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),k(e,"debugColumns")),_getAllFlatColumnsById:O(()=>[l.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),k(e,"debugColumns")),getAllLeafColumns:O(()=>[l.getAllColumns(),l._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),k(e,"debugColumns")),getColumn:e=>l._getAllFlatColumnsById()[e]};Object.assign(l,u);for(let e=0;e<l._features.length;e++){const t=l._features[e];null==t||null==t.createTable||t.createTable(l)}return l}({columns:e.columns.map(e=>{var t;const n=null!==(t=e.width)&&void 0!==t?t:null;return{accessorKey:e.key,enableColumnFilter:!1!==e.filterable,enableHiding:!1!==e.hideable,enableResizing:!1!==e.resizable,enableSorting:!1!==e.sortable,filterFn:Le(e),id:e.key,meta:{label:e.label,formatter:e.formatter},...d&&null!==n&&{size:n}}}),columnResizeMode:null!==(o=i.mode)&&void 0!==o?o:"onChange",data:r?[]:e.items,enableColumnFilters:Boolean(e.columnFilters),enableColumnPinning:u,enableColumnResizing:a,enableGlobalFilter:Me(e),enableHiding:Boolean(e.columnVisibility),enableMultiSort:!1!==l.multiple,enableRowSelection:Boolean(e.rowSelection),enableSorting:Boolean(e.sorting),enableSortingRemoval:Boolean(l.resetable),getCoreRowModel:e=>O(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,l,i){void 0===l&&(l=0);const s=[];for(let a=0;a<t.length;a++){const u=j(e,e._getRowId(t[a],a,i),t[a],a,l,0,null==i?void 0:i.id);var r;n.flatRows.push(u),n.rowsById[u.id]=u,s.push(u),e.options.getSubRows&&(u.originalSubRows=e.options.getSubRows(t[a],a),null!=(r=u.originalSubRows)&&r.length&&(u.subRows=o(u.originalSubRows,l+1,u)))}return s};return n.rows=o(t),n},k(e.options,"debugTable",0,()=>e._autoResetPageIndex())),getFacetedRowModel:(e,t)=>O(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,o,l)=>{if(!n.rows.length||(null==o||!o.length)&&!l)return n;const i=[...o.map(e=>e.id).filter(e=>e!==t),l?"__global__":void 0].filter(Boolean);return Ce(n.rows,e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0},e)},k(e.options,"debugTable")),getFacetedUniqueValues:(e,t)=>O(()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]},e=>{if(!e)return new Map;let n=new Map;for(let l=0;l<e.flatRows.length;l++){const i=e.flatRows[l].getUniqueValues(t);for(let e=0;e<i.length;e++){const t=i[e];var o;n.has(t)?n.set(t,(null!=(o=n.get(t))?o:0)+1):n.set(t,1)}}return n},k(e.options,"debugTable")),getFilteredRowModel:e=>O(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const l=[],i=[];(null!=n?n:[]).forEach(t=>{var n;const o=e.getColumn(t.id);if(!o)return;const i=o.getFilterFn();i&&l.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})});const s=(null!=n?n:[]).map(e=>e.id),r=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());let u,d;o&&r&&a.length&&(s.push("__global__"),a.forEach(e=>{var t;i.push({id:e.id,filterFn:r,resolvedValue:null!=(t=null==r.resolveFilterValue?void 0:r.resolveFilterValue(o))?t:o})}));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},l.length)for(let e=0;e<l.length;e++){u=l[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(i.length){for(let e=0;e<i.length;e++){d=i[e];const t=d.id;if(d.filterFn(n,t,d.resolvedValue,e=>{n.columnFiltersMeta[t]=e})){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return Ce(t.rows,e=>{for(let t=0;t<s.length;t++)if(!1===e.columnFilters[s[t]])return!1;return!0},e)},k(e.options,"debugTable",0,()=>e._autoResetPageIndex())),getSortedRowModel:e=>O(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,l=[],i=o.filter(t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()}),s={};i.forEach(t=>{const n=e.getColumn(t.id);n&&(s[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});const r=e=>{const t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let o=0;o<i.length;o+=1){var n;const l=i[o],r=s[l.id],a=r.sortUndefined,u=null!=(n=null==l?void 0:l.desc)&&n;let d=0;if(a){const n=void 0===e.getValue(l.id),o=void 0===t.getValue(l.id);if(n||o){if("first"===a)return n?-1:1;if("last"===a)return n?1:-1;d=n&&o?0:n?a:-a}}if(0===d&&(d=r.sortingFn(e,t,l.id)),0!==d)return u&&(d*=-1),r.invertSorting&&(d*=-1),d}return e.index-t.index}),t.forEach(e=>{var t;l.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=r(e.subRows))}),t};return{rows:r(n.rows),flatRows:l,rowsById:n.rowsById}},k(e.options,"debugTable",0,()=>e._autoResetPageIndex())),globalFilterFn:"includesString",...r&&{manualFiltering:!0,manualPagination:!0,manualSorting:!0,rowCount:0},...c&&{getPaginationRowModel:e=>O(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:l}=t;let{rows:i,flatRows:s,rowsById:r}=n;const a=o*l,u=a+o;let d;i=i.slice(a,u),d=e.options.paginateExpandedRows?{rows:i,flatRows:s,rowsById:r}:function(e){const t=[],n=e=>{var o;t.push(e),null!=(o=e.subRows)&&o.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}({rows:i,flatRows:s,rowsById:r}),d.flatRows=[];const c=e=>{d.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return d.rows.forEach(c),d},k(e.options,"debugTable"))},...e.itemKey&&{getRowId:e.itemKey},initialState:g,onStateChange(){},renderFallbackValue:null,state:{}});let m=h.initialState;return h.setOptions(e=>({...e,state:m,onStateChange(e){const n=m;m="function"==typeof e?e(m):e,h.setOptions(e=>({...e,state:m})),t(n,m)}})),h})(this._config,(e,t)=>{this._notifyStateChange(e,t),this._scheduler.schedule()})}_teardownUi(){var e,t,n,o,l,i;this._stopEditing({commit:!1}),this._dataSource&&(this._dataSource.dispose(),this._dataSource=null),null===(e=this._header)||void 0===e||e.dispose(),this._menu&&(this._menu.dispose(),this._menu=null),this._filterMenu&&(this._filterMenu.dispose(),this._filterMenu=null),this._columnChooser&&(this._columnChooser.dispose(),this._columnChooser=null),this._loading&&(this._loading.element.remove(),this._loading=null),this._virtualizer&&(this._virtualizer.destroy(),this._virtualizer=null),this._toolbar&&(null===(n=(t=this._toolbar).dispose)||void 0===n||n.call(t),this._toolbar.element.remove(),this._toolbar=null);for(const e of this._paginations)null===(o=e.dispose)||void 0===o||o.call(e),e.element.remove();this._paginations=[],this._emptySlot&&(null===(i=(l=this._emptySlot).dispose)||void 0===i||i.call(l),this._emptySlot=null),this._viewportElement&&this._viewportElement.remove()}_slotContext(){return{table:this._table,labels:this._labels}}_isColumnSortable(e){return Boolean(this._config.sorting)&&!1!==e.sortable}_isColumnFilterable(e){return this._config.columnFilters&&!1!==e.filterable}_isColumnResizable(e){return Boolean(this._config.columnSizing)&&!1!==e.resizable}_sanitizeIcon(e){return this._config.sanitize?Mt(e,xt,this._config.sanitizeFn):e}_hasColumnMenu(e){return!!this._config.columnMenu&&("function"==typeof this._config.columnMenu?this._getMenuActions(e.key).length>0:this._isColumnSortable(e)||Boolean(this._config.columnPinning)||Boolean(this._config.columnVisibility)&&!1!==e.hideable||Boolean(this._config.columnOrder)&&!1!==e.movable)}_renderToolbar(){const e=Fe(this._config);if(this._toolbarConfig=e,this._config.slots.toolbar)return this._toolbar=this._config.slots.toolbar(this._slotContext()),void this._element.append(this._toolbar.element);(e.columns||e.export||e.search||e.history)&&(this._toolbar=(e=>{const t=document.createElement("div");if(t.classList.add("data-grid-toolbar"),e.columns||e.export||e.history){const n=document.createElement("div");if(n.classList.add("data-grid-toolbar-actions"),e.columns&&n.append(Ae(e.icons.columns,e.labels.toolbarColumns,"data-coreui-toolbar-columns")),e.export&&n.append(Ae(e.icons.export,e.labels.toolbarExport,"data-coreui-toolbar-export")),e.history){const t=Ae(e.icons.undo,e.labels.toolbarUndo,"data-coreui-toolbar-undo"),o=Ae(e.icons.redo,e.labels.toolbarRedo,"data-coreui-toolbar-redo");t.disabled=!0,o.disabled=!0,n.append(t,o)}t.append(n)}if(e.search){const n=document.createElement("div");n.classList.add("data-grid-toolbar-search");const o=document.createElement("input");o.type="search",o.classList.add("form-control","form-control-sm"),o.placeholder=e.labels.globalFilterPlaceholder,o.setAttribute("aria-label",e.labels.globalFilterLabel),o.dataset.coreuiGlobalFilter="",n.append(o),t.append(n)}return{element:t}})({columns:e.columns,export:e.export,icons:{columns:this._sanitizeIcon(this._config.toolbarColumnsIcon),export:this._sanitizeIcon(this._config.toolbarExportIcon),redo:this._sanitizeIcon(this._config.toolbarRedoIcon),undo:this._sanitizeIcon(this._config.toolbarUndoIcon)},history:e.history,labels:this._labels,search:e.search}),this._element.append(this._toolbar.element),e.columns&&(this._columnChooser=(e=>{const t=document.createElement("div");t.classList.add("data-grid-column-chooser"),t.setAttribute("role","dialog"),t.setAttribute("aria-label",e.labels.toolbarColumns),t.id="data-grid-column-chooser-"+ ++bt;let n=null;const o=(e=!1)=>{n&&(n.setAttribute("aria-expanded","false"),n.removeAttribute("aria-controls"),e&&n.focus(),n=null,t.remove(),document.removeEventListener("pointerdown",l,!0),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i))},l=e=>{const l=e.target;t.contains(l)||(null==n?void 0:n.contains(l))||o()},i=e=>{(null==e?void 0:e.target)instanceof Node&&t.contains(e.target)||o()},s=e=>{"Escape"===e.key&&(e.stopPropagation(),o(!0))};t.addEventListener("keydown",s);const r=()=>{const n=document.createElement("div");for(const t of e.getColumns()){const o=document.createElement("label");o.classList.add("form-check","data-grid-column-chooser-option");const l=document.createElement("input");l.type="checkbox",l.classList.add("form-check-input"),l.checked=t.visible,l.dataset.coreuiColumnChooserOption=t.id,t.canHide||(l.disabled=!0,l.setAttribute("aria-disabled","true")),l.addEventListener("change",()=>{e.toggleVisibility(t.id,l.checked)});const i=document.createElement("span");i.classList.add("form-check-label"),i.textContent=t.label,o.append(l,i),n.append(o)}const o=document.createElement("div");o.classList.add("data-grid-column-chooser-footer");const l=document.createElement("button");l.type="button",l.classList.add("btn","btn-link","btn-sm"),l.textContent=e.labels.showAllColumns,l.dataset.coreuiColumnChooserShowAll="",l.addEventListener("click",()=>{e.showAll(),t.replaceChildren(r())});const i=document.createElement("button");i.type="button",i.classList.add("btn","btn-link","btn-sm"),i.textContent=e.labels.resetColumns,i.dataset.coreuiColumnChooserReset="",i.addEventListener("click",()=>{e.reset(),t.replaceChildren(r())}),o.append(l,i);const s=document.createDocumentFragment();return s.append(n,o),s};return{toggle(s){n!==s?(o(),(s=>{var a;o(),t.replaceChildren(r()),n=s,s.setAttribute("aria-expanded","true"),s.setAttribute("aria-controls",t.id),e.root.append(t);const u=e.root.getBoundingClientRect(),d=s.getBoundingClientRect();t.style.top=d.bottom-u.top+"px",t.style.left=`${Math.max(d.left-u.left,0)}px`,document.addEventListener("pointerdown",l,!0),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),null===(a=t.querySelector("input:not(:disabled)"))||void 0===a||a.focus()})(s)):o(!0)},close(){o()},dispose(){o(),t.removeEventListener("keydown",s)}}})({root:this._element,labels:this._labels,getColumns:()=>this._chooserColumns(),toggleVisibility:(e,t)=>{var n;null===(n=this._table.getColumn(e))||void 0===n||n.toggleVisibility(t)},showAll:()=>this._table.toggleAllColumnsVisible(!0),reset:()=>{var e;return this._table.setColumnVisibility(null!==(e=this._table.initialState.columnVisibility)&&void 0!==e?e:{})}})))}_render(){var e;this._columnsByKey=new Map(this._config.columns.map(e=>[e.key,e])),this._activeCell=this._config.cellNavigation?(e=>{let t=null,n=!1;return{get:()=>t,set(o,l={}){const i=!t||t.rowIndex!==o.rowIndex||t.columnId!==o.columnId;t=o,l.focus&&(n=!0),(i||l.focus)&&e()},clamp(n){const o=((e,t)=>{if(!e)return null;const n=((e,t)=>t.includes(e)?e:t.length>0?t[0]:null)(e.columnId,t.columnIds);if(null===n)return null;const o=t.rowCount-1,l=e.rowIndex<0?-1:Math.max(0,Math.min(e.rowIndex,Math.max(o,0)));return l>=0&&o<0?{rowIndex:-1,columnId:n}:{rowIndex:l,columnId:n}})(t,n),l=Boolean(t)!==Boolean(o)||t&&o&&(t.rowIndex!==o.rowIndex||t.columnId!==o.columnId);t=o,l&&e()},reset(){t&&(t=null,n=!1,e())},consumeFocusRequest:()=>!!n&&(n=!1,!0)}})(()=>this._scheduler.schedule()):null,this._element.classList.add(sn),this._element.classList.toggle("data-grid-resizable",Boolean(this._config.columnSizing)),this._element.classList.toggle("data-grid-pinned",Boolean(this._config.columnPinning)),this._config.sorterVisibility?this._element.setAttribute("data-coreui-sorter-visibility",this._config.sorterVisibility):this._element.removeAttribute("data-coreui-sorter-visibility");const{slots:t}=this._config;this._renderToolbar(),t.empty&&(this._emptySlot=t.empty(this._slotContext()));const n=Boolean(this._config.rowSelection),o="object"==typeof this._config.rowSelection?this._config.rowSelection:{},l=Boolean(this._config.pagination)||Boolean(this._config.dataProvider),i="object"==typeof this._config.pagination?this._config.pagination:{};if(this._config.columnMenu&&(this._menu=(e=>{const t=document.createElement("div");t.classList.add("data-grid-menu"),t.setAttribute("role","menu"),t.id="data-grid-menu-"+ ++pt;let n=null;const o=()=>[...t.querySelectorAll(`.${ft}`)],l=(e=!1)=>{n&&(n.setAttribute("aria-expanded","false"),n.removeAttribute("aria-controls"),e&&n.focus(),n=null,t.remove(),document.removeEventListener("pointerdown",i,!0),window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s))},i=e=>{const o=e.target;t.contains(o)||(null==n?void 0:n.contains(o))||l()},s=e=>{(null==e?void 0:e.target)instanceof Node&&t.contains(e.target)||l()},r=e=>{var t,n,i,s;const r=o(),a=r.indexOf(document.activeElement);switch(e.key){case"Escape":e.stopPropagation(),l(!0);break;case"Tab":l();break;case"ArrowDown":e.preventDefault(),null===(t=r[(a+1)%r.length])||void 0===t||t.focus();break;case"ArrowUp":e.preventDefault(),null===(n=r[(a-1+r.length)%r.length])||void 0===n||n.focus();break;case"Home":e.preventDefault(),null===(i=r[0])||void 0===i||i.focus();break;case"End":e.preventDefault(),null===(s=r[r.length-1])||void 0===s||s.focus()}};return t.addEventListener("keydown",r),{toggle(r,a){n!==r?(l(),((r,a)=>{var u;const d=e.getActions(a);if(0===d.length)return;const c=[];for(const[t,o]of d.entries()){if(t>0&&o.group!==d[t-1].group){const e=document.createElement("div");e.classList.add("data-grid-menu-divider"),e.setAttribute("role","separator"),c.push(e)}const i=document.createElement("button");if(i.type="button",i.classList.add(ft),i.setAttribute("role","menuitem"),o.icon){const e=document.createElement("span");e.classList.add("data-grid-menu-item-icon"),e.setAttribute("aria-hidden","true"),e.innerHTML=o.icon,i.append(e)}i.append(o.label),o.disabled&&i.setAttribute("aria-disabled","true"),i.addEventListener("click",()=>{if(o.disabled)return;const t=n;l(),o.run(),requestAnimationFrame(()=>{var n;const o=document.activeElement;o&&o!==document.body&&e.root.contains(o)||((null==t?void 0:t.isConnected)?t.focus():null===(n=e.root.querySelector("[data-coreui-menu]"))||void 0===n||n.focus())})}),c.push(i)}t.replaceChildren(...c),n=r,r.setAttribute("aria-expanded","true"),r.setAttribute("aria-controls",t.id),e.root.append(t);const g=e.root.getBoundingClientRect(),h=r.getBoundingClientRect();t.style.top=h.bottom-g.top+"px",t.style.left=`${Math.max(h.right-g.left-t.offsetWidth,0)}px`,document.addEventListener("pointerdown",i,!0),window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),null===(u=o()[0])||void 0===u||u.focus()})(r,a)):l(!0)},close(){l()},dispose(){l(),t.removeEventListener("keydown",r)}}})({root:this._element,getActions:e=>this._getMenuActions(e)})),this._config.columnFilters&&(this._filterMenu=mt({root:this._element,labels:this._labels,getColumn:e=>{var t;return null!==(t=this._columnsByKey.get(e))&&void 0!==t?t:null},getFacetedValues:e=>{var t,n;return[...null!==(n=null===(t=this._table.getColumn(e))||void 0===t?void 0:t.getFacetedUniqueValues().keys())&&void 0!==n?n:[]]},getFilterValue:e=>{var t;return null===(t=this._table.getColumn(e))||void 0===t?void 0:t.getFilterValue()},applyFilter:(e,t)=>{var n;null===(n=this._table.getColumn(e))||void 0===n||n.setFilterValue(t)}})),this._header=dt({cellNavigation:this._config.cellNavigation,columns:this._config.columns,draggable:Boolean(this._config.columnOrder),filterRow:this._config.columnFilters&&this._config.columns.some(e=>e.filter&&this._isColumnFilterable(e)),hasMenu:e=>this._hasColumnMenu(e),hasFilterMenu:e=>Boolean(this._filterMenu)&&this._isColumnFilterable(e)&&!e.filter,icons:{columnMenu:this._sanitizeIcon(this._config.columnMenuIcon),filter:this._sanitizeIcon(this._config.filterIcon),sortAscending:this._sanitizeIcon(this._config.sortAscendingIcon),sortDescending:this._sanitizeIcon(this._config.sortDescendingIcon),sortNeutral:this._sanitizeIcon(this._config.sortNeutralIcon)},isFilterable:e=>this._isColumnFilterable(e),isResizable:e=>this._isColumnResizable(e),isSortable:e=>this._isColumnSortable(e),labels:this._labels,resizable:Boolean(this._config.columnSizing),selection:n,selectAll:n&&!1!==o.selectAll,table:this._table}),this._body=(e=>{const t=document.createElement("tbody");let n=e.getVisibleColumns(),o=n.map(e=>e.key).join("|"),l=n.length+(e.selection?1:0);const i=t=>{t.replaceChildren(),e.cellNavigation&&t.setAttribute("role","row");const l=e.selection?1:0;if(e.selection){const n=document.createElement("td");n.classList.add("data-grid-select-cell");const o=document.createElement("input");o.type="checkbox",o.classList.add("form-check-input"),o.setAttribute("aria-label",e.labels.selectRow),o.dataset.coreuiRowSelect="",e.cellNavigation&&(n.setAttribute("role","gridcell"),n.setAttribute("aria-colindex","1"),o.tabIndex=-1),n.append(o),t.append(n)}for(const[o,i]of n.entries()){const n=document.createElement("td");e.cellNavigation&&(n.setAttribute("role","gridcell"),n.setAttribute("aria-colindex",String(l+o+1)),n.dataset.coreuiColumn=i.key,n.tabIndex=-1),t.append(n)}t.dataset.coreuiLayout=o},s=()=>{const e=document.createElement("tr");return i(e),e},r=(t,l,s)=>{var r;if(t.dataset.coreuiLayout!==o&&(i(t),delete t.dataset.coreuiRow),e.selection){const e=t.firstElementChild.firstElementChild,n=l.getIsSelected();e.checked=n,t.classList.toggle("table-active",n),t.setAttribute("aria-selected",String(n))}const a=`${e.getDataVersion()}:${l.id}`;if(t.dataset.coreuiRow===a&&t.dataset.coreuiIndex===String(s)||(((t,o,l)=>{const i=e.selection?1:0,s=e.getEditingCell();for(const[r,a]of n.entries()){const n=t.children[r+i];if(s&&s.rowId===o.id&&s.columnId===a.key){const t=e.getEditorElement();if(t){n.replaceChildren(t);continue}}if(a.render){if(it(n,a.render(o.original,l),e.sanitizeContent),e.cellNavigation)for(const e of n.querySelectorAll("a[href], button, input, select, textarea, [tabindex]"))e.tabIndex=-1;continue}const u=o.getValue(a.key);n.textContent=a.formatter?a.formatter(u,o.original):String(null!=u?u:"")}})(t,l,s),t.dataset.coreuiRow=a),t.dataset.coreuiIndex=String(s),t.setAttribute("aria-rowindex",String(e.headerRowCount+e.getRowIndexOffset()+s+1)),t.classList.toggle("data-grid-row-odd",s%2==1),f){const o=f,l=e.selection?1:0;e.selection&<(t.children[0],o.select);for(const[e,i]of n.entries())lt(t.children[e+l],null!==(r=o.columns[i.key])&&void 0!==r?r:null)}},a=()=>{const e=document.createElement("tr");e.classList.add("data-grid-spacer"),e.setAttribute("aria-hidden","true");const t=document.createElement("td");return t.colSpan=Math.max(l,1),e.append(t),e},u=(e,t)=>{e.style.height=`${t}px`,e.firstElementChild.style.height=`${t}px`,e.style.display=t>0?"":"none"},d=a(),c=a();let g=!1,h=null,m=[],f=null;const p=[];let v=null;return{element:t,update(){const i=e.getRows();f=e.getPinning();const a=e.getEditingCell(),b=a?`${a.rowId}:${a.columnId}`:null;if(b!==v){v=b;for(const e of m)delete e.dataset.coreuiRow}const _=e.getVisibleColumns(),w=_.map(e=>e.key).join("|");if(w!==o&&(n=_,o=w,l=n.length+(e.selection?1:0),d.firstElementChild.colSpan=Math.max(l,1),c.firstElementChild.colSpan=Math.max(l,1)),0===i.length)return void(()=>{g=!1,p.push(...m),m=[],h||(h=document.createElement("tr"),h.classList.add("data-grid-empty"),h.append(document.createElement("td")));const n=h.firstElementChild;n.colSpan=Math.max(l,1),it(n,e.renderEmpty(),e.sanitizeContent),t.replaceChildren(h)})();const S=e.getVirtualizer();S?((e,n)=>{var o;g||(t.replaceChildren(d,c),g=!0,m=[]);const l=n.getVirtualItems(),i=n.getTotalSize(),a=l.length>0?l[0].start:0,h=l.length>0?i-l[l.length-1].end:i;for(u(d,a),u(c,h);m.length>l.length;){const e=m.pop();e.remove(),p.push(e)}for(;m.length<l.length;){const e=null!==(o=p.pop())&&void 0!==o?o:s();c.before(e),m.push(e)}for(const[t,n]of l.entries())r(m[t],e[n.index],n.index)})(i,S):(e=>{var n;for(h&&h.remove();m.length>e.length;){const e=m.pop();e.remove(),p.push(e)}for(;m.length<e.length;){const e=null!==(n=p.pop())&&void 0!==n?n:s();t.append(e),m.push(e)}for(const[t,n]of e.entries())r(m[t],n,t)})(i)}}})({cellNavigation:this._config.cellNavigation,getDataVersion:()=>this._dataVersion,getEditingCell:()=>this._editingCell?{rowId:this._editingCell.rowId,columnId:this._editingCell.columnId}:null,getEditorElement:()=>this._editor&&!this._editor.popup?this._editor.element:null,getPinning:()=>this._config.columnPinning?this._getPinning():null,getRowIndexOffset:()=>{if(!this._config.pagination&&!this._config.dataProvider)return 0;const{pageIndex:e,pageSize:t}=this._table.getState().pagination;return e*t},getRows:()=>this._table.getRowModel().rows,getVisibleColumns:()=>this._visibleColumns(),getVirtualizer:()=>{var e,t;return null!==(t=null===(e=this._virtualizer)||void 0===e?void 0:e.instance)&&void 0!==t?t:null},headerRowCount:this._header.rowCount,labels:this._labels,renderEmpty:()=>this._emptySlot?this._emptySlot.element:this._loadFailed?this._labels.loadError:"function"==typeof this._config.empty?this._config.empty():this._config.empty,sanitizeContent:e=>this._config.sanitize?Mt(e,Et,this._config.sanitizeFn):e,selection:n}),this._tableElement=document.createElement("table"),this._tableElement.classList.add("table"),this._config.cellNavigation&&this._tableElement.setAttribute("role","grid"),this._tableElement.append(this._header.element,this._body.element),this._viewportElement=document.createElement("div"),this._viewportElement.classList.add("data-grid-viewport"),this._config.cellNavigation&&(this._viewportElement.tabIndex=-1),this._viewportElement.append(this._tableElement),this._config.dataProvider&&(this._loading=(e=>{const t=document.createElement("div");t.classList.add("data-grid-loading"),t.hidden=!0;const n=document.createElement("div");n.classList.add("spinner-border"),n.setAttribute("role","status");const o=document.createElement("span");return o.classList.add("visually-hidden"),o.textContent=e.loading,n.append(o),t.append(n),{element:t,setVisible(e){t.hidden=!e}}})(this._labels),this._viewportElement.append(this._loading.element)),this._element.append(this._viewportElement),l){const n=null!==(e=i.position)&&void 0!==e?e:"bottom",o=t.pagination,l=()=>{var e,t;if(o){const e=o(this._slotContext());return{element:e.element,refresh:()=>{var t;return null===(t=e.update)||void 0===t?void 0:t.call(e)},dispose:()=>{var t;return null===(t=e.dispose)||void 0===t?void 0:t.call(e)}}}const n=(e=>{const t=document.createElement("div");t.classList.add("data-grid-pagination");const n=document.createElement("nav");n.setAttribute("aria-label",e.labels.paginationLabel);const o=document.createElement("ul");o.classList.add("pagination","pagination-sm"),n.append(o);const l=!1===e.info?null:document.createElement("span");l&&l.classList.add("data-grid-pagination-info");const i=document.createElement("select");i.classList.add("form-select","form-select-sm"),i.setAttribute("aria-label",e.labels.pageSizeLabel),i.dataset.coreuiPageSize="";for(const t of e.pageSizeOptions){const e=document.createElement("option");e.value=String(t),e.textContent=String(t),i.append(e)}return t.append(n,...l?[l]:[],i),{element:t,update(t){var n;const s=Math.max(t.pageCount-1,0),r=Math.max(Math.min(t.pageIndex-Math.floor(2.5),t.pageCount-5),0),a=0===t.pageCount?-1:Math.min(r+5-1,s),u=[vt("«","first",{ariaLabel:e.labels.firstPage,disabled:0===t.pageIndex}),vt("‹","prev",{ariaLabel:e.labels.previousPage,disabled:0===t.pageIndex})];for(let e=r;e<=a;e++)u.push(vt(String(e+1),String(e),{active:e===t.pageIndex}));if(u.push(vt("›","next",{ariaLabel:e.labels.nextPage,disabled:t.pageIndex>=s}),vt("»","last",{ariaLabel:e.labels.lastPage,disabled:t.pageIndex>=s})),o.replaceChildren(...u),l)if("function"==typeof e.info)l.textContent=e.info(t);else{const n=0===t.totalRows?0:t.pageIndex*t.pageSize+1,o=Math.min((t.pageIndex+1)*t.pageSize,t.totalRows);l.textContent=Qe(e.labels.itemsInfo,{first:n,last:o,total:t.totalRows})}if(![...i.options].some(e=>e.value===String(t.pageSize))){const e=document.createElement("option");e.value=String(t.pageSize),e.textContent=String(t.pageSize),i.insertBefore(e,null!==(n=[...i.options].find(e=>Number(e.value)>t.pageSize))&&void 0!==n?n:null)}i.value=String(t.pageSize)}}})({info:null===(e=i.info)||void 0===e||e,labels:this._labels,pageSizeOptions:null!==(t=i.pageSizeOptions)&&void 0!==t?t:mn});return{element:n.element,refresh:()=>n.update(this._paginationState()),dispose:void 0}};if("top"===n||"both"===n){const e=l();o||e.element.classList.add("data-grid-pagination-top"),this._viewportElement.before(e.element),this._paginations.push(e)}if("bottom"===n||"both"===n){const e=l();this._element.append(e.element),this._paginations.push(e)}}else this._config.virtualization&&(this._virtualizer=(e=>{const t=new Ke({count:e.count,estimateSize:()=>e.rowHeight,getScrollElement:e.getScrollElement,observeElementOffset:qe,observeElementRect:He,onChange:e.onChange,overscan:e.overscan,scrollToFn:$e}),n=t._didMount();return t._willUpdate(),{instance:t,setCount(e){e!==t.options.count&&t.setOptions({...t.options,count:e})},destroy(){n()}}})({count:this._table.getRowModel().rows.length,getScrollElement:()=>this._viewportElement,onChange:()=>this._scheduler.schedule(),overscan:this._config.overscan,rowHeight:this._config.rowHeight}));this._update()}_addEventListeners(){x.on(this._element,Jt,e=>{this._onCellNavigationKeydown(e)}),x.on(this._element,Ut,e=>{this._containsFocus=!0,this._onCellFocusIn(e)}),x.on(this._element,Zt,e=>{const t=e.relatedTarget;t&&this._element.contains(t)||(this._containsFocus=!1)}),x.on(this._element,Ot,e=>{var t;if(!this._config.editing)return;const n=this._navigableCellFromTarget(e.target);n&&n.cell.rowIndex>=0&&(null===(t=this._activeCell)||void 0===t||t.set(n.cell),this._startEditing(n.cell))}),x.on(this._element,zt,".data-grid-sort-button",e=>{this._toggleColumnSorting(e)});const e=yt((e,t)=>{var n;this._table&&(null===(n=this._table.getColumn(e))||void 0===n||n.setFilterValue(""===t?void 0:t))},250);x.on(this._element,Ht,"input[data-coreui-column-filter]",t=>{var n;const o=null!==(n=t.delegateTarget)&&void 0!==n?n:t.target;e(o.dataset.coreuiColumnFilter,o.value)});const t=yt(e=>{this._table&&this._table.setGlobalFilter(""===e?void 0:e)},250);x.on(this._element,Ht,dn,e=>{var n;const o=null!==(n=e.delegateTarget)&&void 0!==n?n:e.target;t(o.value)}),x.on(this._element,zt,"button[data-coreui-menu]",e=>{var t,n;const o=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target;null===(n=this._menu)||void 0===n||n.toggle(o,o.dataset.coreuiMenu)}),x.on(this._element,zt,"button[data-coreui-filter]",e=>{var t,n;const o=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target;null===(n=this._filterMenu)||void 0===n||n.toggle(o,o.dataset.coreuiFilter)}),x.on(this._element,zt,"button[data-coreui-toolbar-columns]",e=>{var t,n;const o=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target;null===(n=this._columnChooser)||void 0===n||n.toggle(o)}),x.on(this._element,zt,"button[data-coreui-toolbar-export]",()=>{var e;this.downloadCsv({scope:"filtered",...null===(e=this._toolbarConfig)||void 0===e?void 0:e.exportOptions})}),x.on(this._element,zt,hn,()=>{this.undo()}),x.on(this._element,zt,gn,()=>{this.redo()}),x.on(this._element,en,un,e=>{this._onColumnDragStart(e)}),x.on(this._element,Qt,un,e=>{var t;if(!this._dragColumn)return;const n=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target,o=n.dataset.coreuiColumn,l=this._table.getColumn(this._dragColumn),i=o?this._table.getColumn(o):void 0;l&&i&&o!==this._dragColumn&&l.getIsPinned()===i.getIsPinned()&&(e.preventDefault(),n.classList.add(an))}),x.on(this._element,Yt,un,e=>{var t;(null!==(t=e.delegateTarget)&&void 0!==t?t:e.target).classList.remove(an)}),x.on(this._element,tn,un,e=>{this._onColumnDrop(e)}),x.on(this._element,Xt,un,()=>{this._endColumnDrag()}),x.on(this._element,nn,cn,e=>{this._startColumnResize(e)}),x.on(this._element,ln,cn,e=>{this._startColumnResize(e)}),x.on(this._element,zt,"input[data-coreui-row-select]",e=>{this._toggleRowSelection(e)}),x.on(this._element,Lt,"input[data-coreui-select-all]",e=>{var t;const n=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target;this._table.toggleAllRowsSelected(n.checked)}),x.on(this._element,zt,"button[data-coreui-page]",e=>{var t;const n=(null!==(t=e.delegateTarget)&&void 0!==t?t:e.target).dataset.coreuiPage;"first"!==n?"prev"!==n?"next"!==n?"last"!==n?this._table.setPageIndex(Number(n)):this._table.lastPage():this._table.nextPage():this._table.previousPage():this._table.firstPage()}),x.on(this._element,Lt,"select[data-coreui-page-size]",e=>{var t;const n=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target;this._table.setPageSize(Number(n.value))})}_toggleColumnSorting(e){var t,n,o;const l=null===(n=(null!==(t=e.delegateTarget)&&void 0!==t?t:e.target).closest("th"))||void 0===n?void 0:n.dataset.coreuiColumn;if(!l)return;const i=this._table.getColumn(l);null===(o=null==i?void 0:i.getToggleSortingHandler())||void 0===o||o(e)}_navigableCellFromTarget(e){const t=e.closest("td, th");if(!t||!this._tableElement.contains(t))return null;const n=t.dataset.coreuiColumn;if(!n)return null;const o=t.closest("tr");if(o.parentElement===this._body.element){const e=o.dataset.coreuiIndex;return void 0===e?null:{cellElement:t,cell:{rowIndex:Number(e),columnId:n}}}return o===this._header.element.firstElementChild?{cellElement:t,cell:{rowIndex:-1,columnId:n}}:null}_onCellFocusIn(e){if(!this._activeCell)return;const t=this._navigableCellFromTarget(e.target);t&&this._activeCell.set(t.cell)}_onCellNavigationKeydown(e){var t,n;if(!this._activeCell)return;const o=e.target;if(this._config.history&&(e.ctrlKey||e.metaKey)&&!this._editingCell&&!o.matches("input, textarea, select")){const t=e.key.toLowerCase();if("z"===t&&!e.shiftKey)return e.preventDefault(),void this.undo();if("z"===t&&e.shiftKey||"y"===t)return e.preventDefault(),void this.redo()}if(this._editingCell&&this._editScopeContains(o))return"Enter"===e.key?void(e.defaultPrevented||(e.preventDefault(),this._stopEditing({commit:!0}))):"Escape"===e.key?void(e.defaultPrevented||this._cancelEdit()):"Tab"===e.key?(e.preventDefault(),void this._moveEditing(e.shiftKey?-1:1)):void 0;if(o===this._viewportElement){const t=this._activeCell.get();return void(t&&"Tab"!==e.key&&(e.preventDefault(),this._setActiveCell(t)))}const l=this._navigableCellFromTarget(o);if(!l)return;if(o!==l.cellElement)return void("Escape"===e.key&&l.cellElement.focus({preventScroll:!0}));if("Enter"===e.key||"F2"===e.key){e.preventDefault();const o=this._columnsByKey.get(l.cell.columnId);return-1===l.cell.rowIndex?void("Enter"===e.key&&o&&this._isColumnSortable(o)&&(null===(n=null===(t=this._table.getColumn(l.cell.columnId))||void 0===t?void 0:t.getToggleSortingHandler())||void 0===n||n(e))):o&&this._isColumnEditable(o)?void this._startEditing(l.cell):void("Enter"===e.key&&this._descendIntoCell(l.cellElement))}if(" "===e.key){if(this._config.rowSelection&&l.cell.rowIndex>=0){e.preventDefault();const t=this._table.getRowModel().rows[l.cell.rowIndex];null==t||t.toggleSelected(),this._selectionAnchorIndex=l.cell.rowIndex}return}const i=((e,t,n,o)=>{const{columnIds:l,rowCount:i,pageStep:s,paginated:r}=o,a=l.indexOf(n.columnId);if(-1===a||0===l.length)return null;const u=i-1,d=l.length-1,c=(e,t)=>({cell:{rowIndex:e,columnId:l[t]}});switch(e){case"ArrowLeft":return c(n.rowIndex,Math.max(a-1,0));case"ArrowRight":return c(n.rowIndex,Math.min(a+1,d));case"ArrowUp":return c(Math.max(n.rowIndex-1,-1),a);case"ArrowDown":return c(Math.min(n.rowIndex+1,u),a);case"Home":return c(t?i>0?0:-1:n.rowIndex,0);case"End":return c(t?i>0?u:-1:n.rowIndex,d);case"PageUp":return r&&0===n.rowIndex?{...c(0,a),pageDelta:-1}:c(Math.max(n.rowIndex-s,0),a);case"PageDown":return r&&n.rowIndex===u?{...c(u,a),pageDelta:1}:c(Math.min(n.rowIndex+s,u),a);default:return null}})(e.key,e.ctrlKey||e.metaKey,l.cell,this._activeCellContext());i&&(e.preventDefault(),1===i.pageDelta&&this._table.getCanNextPage()?this._table.nextPage():-1===i.pageDelta&&this._table.getCanPreviousPage()&&this._table.previousPage(),this._setActiveCell(i.cell))}_descendIntoCell(e){var t;null===(t=e.querySelector(pn))||void 0===t||t.focus({preventScroll:!0})}_isColumnEditable(e){return!!this._config.editing&&(Boolean(e.editor)||!0===e.editable||"object"==typeof e.editable)}_startEditing(e){const t=this._columnsByKey.get(e.columnId);if(!t||!this._isColumnEditable(t))return;this._stopEditing({commit:!0,force:!0});const n=this._table.getRowModel().rows[e.rowIndex];if(!n)return;const o=n.getValue(e.columnId),l={item:n.original,column:t,value:o,commit:e=>this._commitEdit(e),cancel:()=>this._cancelEdit(),labels:this._labels},i="object"==typeof t.editable?t.editable:{},s=t.editor?t.editor(l):((e,t)=>"number"===e.type?((e,t)=>{const n=document.createElement("input");return n.type="number",n.classList.add("form-control","form-control-sm",st),void 0!==t.min&&(n.min=String(t.min)),void 0!==t.max&&(n.max=String(t.max)),void 0!==t.step&&(n.step=String(t.step)),n.value=void 0===e.value||null===e.value?"":String(e.value),{element:n,focus(){n.focus(),n.select()},getValue:()=>""===n.value?void 0:Number(n.value)}})(t,e):"select"===e.type?((e,t)=>{var n;const o=document.createElement("select");o.classList.add("form-select","form-select-sm",st);const l=[];for(const i of null!==(n=t.options)&&void 0!==n?n:[]){const t=document.createElement("option"),n="object"==typeof i&&null!==i?i.value:i;t.textContent="object"==typeof i&&null!==i?i.label:String(i),t.value=String(l.length),n===e.value&&(t.selected=!0),l.push(n),o.append(t)}return{element:o,focus:()=>o.focus(),getValue:()=>l[Number(o.value)]}})(t,e):(e=>{var t;const n=document.createElement("input");return n.type="text",n.classList.add("form-control","form-control-sm",st),n.value=String(null!==(t=e.value)&&void 0!==t?t:""),{element:n,focus(){n.focus(),n.select()},getValue:()=>n.value}})(t))(i,l);this._editingCell={rowId:n.id,columnId:e.columnId,rowIndex:e.rowIndex,item:n.original,previousValue:o},this._editor=s,this._editorFocusPending=!0,x.trigger(this._element,Dt,{item:n.original,columnId:e.columnId}),s.popup&&this._mountEditorPopup(e),this._editorPointerdownHandler=e=>{this._editScopeContains(e.target)||this._stopEditing({commit:!0})},x.on(document,on,this._editorPointerdownHandler),x.on(s.element,Zt,e=>{const t=e.relatedTarget;t&&!this._editScopeContains(t)&&this._stopEditing({commit:!0})}),this._scheduler.schedule()}_editScopeContains(e){var t,n,o;if(!e||!this._editingCell||!this._editor)return!1;if((null===(n=(t=this._editor).contains)||void 0===n?void 0:n.call(t,e))||this._editor.element.contains(e)||(null===(o=this._editorPopup)||void 0===o?void 0:o.contains(e)))return!0;const l=this._cellElementFor({rowIndex:this._editingCell.rowIndex,columnId:this._editingCell.columnId});return Boolean(null==l?void 0:l.contains(e))}_mountEditorPopup(e){const t=this._cellElementFor(e),n=document.createElement("div");if(n.classList.add("data-grid-editor-popup"),t){const e=this._element.getBoundingClientRect(),o=t.getBoundingClientRect();n.style.top=o.top-e.top+"px",n.style.left=o.left-e.left+"px",n.style.minWidth=`${o.width}px`}n.append(this._editor.element),this._element.append(n),this._editorPopup=n}_commitEdit(e){var t,n;const o=this._editingCell;if(!o)return;const l=null===(t=this._columnsByKey.get(o.columnId))||void 0===t?void 0:t.editValidate;if(l){const t=l(e,o.item);if(!0!==t)return void this._showEditorInvalid("string"==typeof t?t:"")}this._teardownEditor(),this._config.history&&(this._undoStack.push({rowId:o.rowId,columnId:o.columnId,value:e,previousValue:o.previousValue}),this._undoStack.length>100&&this._undoStack.shift(),this._redoStack=[],this._updateHistoryButtons()),x.trigger(this._element,Tt,{item:o.item,columnId:o.columnId,value:e,previousValue:o.previousValue}),null===(n=this._activeCell)||void 0===n||n.set({rowIndex:o.rowIndex,columnId:o.columnId},{focus:!0})}_cancelEdit(){var e;const t=this._editingCell;t&&(this._teardownEditor(),x.trigger(this._element,kt,{item:t.item,columnId:t.columnId}),null===(e=this._activeCell)||void 0===e||e.set({rowIndex:t.rowIndex,columnId:t.columnId},{focus:!0}))}_stopEditing(e){var t;if(this._editingCell)return e.commit&&(null===(t=this._editor)||void 0===t?void 0:t.getValue)?(this._commitEdit(this._editor.getValue()),void(this._editingCell&&e.force&&this._cancelEdit())):void this._cancelEdit()}_showEditorInvalid(e){const t=this._editor;if(!t)return;const n=t.element.matches("input, select, textarea")?t.element:t.element.querySelector("input, select, textarea");n&&(this._editorErrorElement||(this._editorErrorElement=document.createElement("div"),this._editorErrorElement.classList.add("visually-hidden"),this._editorErrorElement.id="data-grid-editor-error-"+ ++fn,this._element.append(this._editorErrorElement)),this._editorErrorElement.textContent=e,n.classList.add("is-invalid"),n.setAttribute("aria-invalid","true"),n.setAttribute("aria-errormessage",this._editorErrorElement.id))}_moveEditing(e){var t;const n=this._editingCell;if(!n)return;const o=this._visibleColumns();let l=null;for(let t=o.findIndex(e=>e.key===n.columnId)+e;t>=0&&t<o.length;t+=e)if(this._isColumnEditable(o[t])){l=o[t];break}if(this._stopEditing({commit:!0}),!this._editingCell&&l){const e={rowIndex:n.rowIndex,columnId:l.key};null===(t=this._activeCell)||void 0===t||t.set(e,{focus:!0}),this._startEditing(e)}}_teardownEditor(){var e,t;this._editorPointerdownHandler&&(x.off(document,on,this._editorPointerdownHandler),this._editorPointerdownHandler=null),this._editor&&(x.off(this._editor.element,Zt),null===(t=(e=this._editor).dispose)||void 0===t||t.call(e)),this._editorPopup&&(this._editorPopup.remove(),this._editorPopup=null),this._editorErrorElement&&(this._editorErrorElement.remove(),this._editorErrorElement=null),this._editor=null,this._editingCell=null,this._editorFocusPending=!1,this._scheduler.schedule()}_setActiveCell(e){var t;null===(t=this._activeCell)||void 0===t||t.set(e,{focus:!0}),this._virtualizer&&e.rowIndex>=0&&this._virtualizer.instance.scrollToIndex(e.rowIndex)}_activeCellContext(){var e,t;const n=this._table.getRowModel().rows.length,o=Boolean(this._config.pagination)||Boolean(this._config.dataProvider),l=Math.floor((null!==(t=null===(e=this._viewportElement)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0)/this._config.rowHeight);return{columnIds:this._visibleLeafColumns().map(e=>e.id),rowCount:n,pageStep:o?this._table.getState().pagination.pageSize:Math.max(1,l||n),paginated:o}}_cellElementFor(e){var t;if(-1===e.rowIndex)return this._header.element.querySelector(`tr:first-child th[data-coreui-column="${e.columnId}"]`);const n=this._body.element.querySelector(`tr[data-coreui-index="${e.rowIndex}"]`);return null!==(t=null==n?void 0:n.querySelector(`td[data-coreui-column="${e.columnId}"]`))&&void 0!==t?t:null}_applyCellNavigation(){if(!this._activeCell)return;const e=this._activeCellContext();this._activeCell.clamp(e),this._tableElement.setAttribute("aria-colcount",String(e.columnIds.length+(this._config.rowSelection?1:0)));const t=this._activeCell.get(),n=null!=t?t:e.columnIds.length>0?{rowIndex:e.rowCount>0?0:-1,columnId:e.columnIds[0]}:null;for(const e of this._header.element.querySelectorAll("tr:first-child th[data-coreui-column]"))vn(e,null!==n&&-1===n.rowIndex&&e.dataset.coreuiColumn===n.columnId);for(const e of this._body.element.querySelectorAll("tr[data-coreui-index]")){const t=null!==n&&e.dataset.coreuiIndex===String(n.rowIndex);for(const o of e.querySelectorAll("td[data-coreui-column]"))vn(o,t&&o.dataset.coreuiColumn===n.columnId)}if(!t)return;const o=this._cellElementFor(t);o?this._activeCell.consumeFocusRequest()&&o.focus({preventScroll:!0}):this._containsFocus&&!this._element.contains(document.activeElement)&&this._viewportElement.focus({preventScroll:!0})}_getMenuActions(e){const t=this._table.getColumn(e),n=this._columnsByKey.get(e);if(!t||!n)return[];const o=[];if(this._isColumnSortable(n)){const e=t.getIsSorted();o.push({key:"sort-asc",label:this._labels.sortAscending,disabled:"asc"===e,group:"sorting",icon:this._sanitizeIcon(this._config.sortAscendingIcon),run:()=>t.toggleSorting(!1)},{key:"sort-desc",label:this._labels.sortDescending,disabled:"desc"===e,group:"sorting",icon:this._sanitizeIcon(this._config.sortDescendingIcon),run:()=>t.toggleSorting(!0)}),e&&o.push({key:"clear-sort",label:this._labels.clearSort,group:"sorting",icon:this._sanitizeIcon(this._config.sortNeutralIcon),run:()=>t.clearSorting()})}if(this._config.columnPinning){const e=t.getIsPinned();"left"!==e&&o.push({key:"pin-left",label:this._labels.pinLeft,group:"pinning",icon:this._sanitizeIcon(this._config.pinLeftIcon),run:()=>t.pin("left")}),"right"!==e&&o.push({key:"pin-right",label:this._labels.pinRight,group:"pinning",icon:this._sanitizeIcon(this._config.pinRightIcon),run:()=>t.pin("right")}),e&&o.push({key:"unpin",label:this._labels.unpin,group:"pinning",icon:this._sanitizeIcon(this._config.unpinIcon),run:()=>t.pin(!1)})}if(this._config.columnOrder&&!1!==n.movable){const n=this._visibleLeafColumns().filter(e=>e.getIsPinned()===t.getIsPinned()),l=n.findIndex(t=>t.id===e);o.push({key:"move-left",label:this._labels.moveLeft,disabled:l<=0,group:"ordering",icon:this._sanitizeIcon(this._config.moveLeftIcon),run:()=>this._moveColumn(e,-1)},{key:"move-right",label:this._labels.moveRight,disabled:l===n.length-1,group:"ordering",icon:this._sanitizeIcon(this._config.moveRightIcon),run:()=>this._moveColumn(e,1)})}this._config.columnVisibility&&t.getCanHide()&&o.push({key:"hide",label:this._labels.hideColumn,group:"visibility",icon:this._sanitizeIcon(this._config.hideColumnIcon),run:()=>t.toggleVisibility(!1)});const l="function"==typeof this._config.columnMenu?this._config.columnMenu:null;return(l?l({column:n,defaultActions:o}):o).map(e=>e.icon?{...e,icon:this._sanitizeIcon(e.icon)}:e)}_orderedLeafIds(){const e=this._table.getAllLeafColumns().map(e=>e.id),t=this._table.getState().columnOrder;if(0===t.length)return e;const n=new Set(e),o=t.filter(e=>n.has(e)),l=new Set(o);return[...o,...e.filter(e=>!l.has(e))]}_moveColumn(e,t){const n=this._table.getColumn(e);if(!n)return;const o=n.getIsPinned(),l=this._orderedLeafIds(),i=this._visibleLeafColumns().filter(e=>e.getIsPinned()===o).map(e=>e.id),s=i[i.indexOf(e)+t];if(!s)return;const r=l.indexOf(e),a=l.indexOf(s);l[r]=s,l[a]=e,this._table.setColumnOrder(l)}_onColumnDragStart(e){var t,n,o,l,i;if(null===(n=(t=e.target).closest)||void 0===n?void 0:n.call(t,cn))return void e.preventDefault();const s=null!==(o=e.delegateTarget)&&void 0!==o?o:e.target;this._dragColumn=null!==(l=s.dataset.coreuiColumn)&&void 0!==l?l:null,s.classList.add(rn);const{dataTransfer:r}=e;r&&(r.effectAllowed="move",r.setData("text/plain",null!==(i=this._dragColumn)&&void 0!==i?i:""))}_onColumnDrop(e){var t;e.preventDefault();const n=(null!==(t=e.delegateTarget)&&void 0!==t?t:e.target).dataset.coreuiColumn,o=this._dragColumn;if(this._endColumnDrag(),!o||!n||o===n)return;const l=this._table.getColumn(o),i=this._table.getColumn(n);if(!l||!i||l.getIsPinned()!==i.getIsPinned())return;const s=this._orderedLeafIds(),r=s.indexOf(o),a=s.indexOf(n);-1!==r&&-1!==a&&(s.splice(r,1),s.splice(a,0,o),this._table.setColumnOrder(s))}_endColumnDrag(){this._dragColumn=null;for(const e of this._element.querySelectorAll(`.${rn}, .${an}`))e.classList.remove(rn,an)}_startColumnResize(e){var t,n,o;const l=null===(n=(null!==(t=e.delegateTarget)&&void 0!==t?t:e.target).closest("th"))||void 0===n?void 0:n.dataset.coreuiColumn;if(!l)return;"mousedown"===e.type&&e.preventDefault();const i=null===(o=this._table.getHeaderGroups()[0])||void 0===o?void 0:o.headers.find(e=>e.column.id===l);null==i||i.getResizeHandler()(e)}_toggleRowSelection(e){var t,n;const o=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target,l=o.closest("tr");if(!l)return;const i=Number(l.dataset.coreuiIndex),{rows:s}=this._table.getRowModel(),r=o.checked;if(e.shiftKey&&null!==this._selectionAnchorIndex){const e=Math.min(this._selectionAnchorIndex,i),t=Math.max(this._selectionAnchorIndex,i);this._table.setRowSelection(n=>{const o={...n};for(const n of s.slice(e,t+1))r?o[n.id]=!0:delete o[n.id];return o})}else null===(n=s[i])||void 0===n||n.toggleSelected(r);this._selectionAnchorIndex=i}_initDataSource(){const{dataProvider:e}=this._config;e&&(this._dataSource=(e=>{let t,n=0;return{load(){clearTimeout(t);const o=++n;t=setTimeout(async()=>{e.onLoadingChange(!0);try{const t=await e.provider(e.getRequest());if(o!==n)return;e.onLoad(t)}catch(t){if(o!==n)return;e.onError(t)}finally{o===n&&e.onLoadingChange(!1)}},100)},dispose(){clearTimeout(t),n++}}})({provider:t=>e(t),getRequest:()=>{var e;const t=this._table.getState();return{columnFilters:t.columnFilters,globalFilter:null!==(e=t.globalFilter)&&void 0!==e?e:"",pagination:t.pagination,sorting:t.sorting}},onLoad:e=>{this._stopEditing({commit:!1}),this._loadFailed=!1,this._dataVersion++,this._table.setOptions(t=>({...t,data:e.items,rowCount:e.totalRows})),x.trigger(this._element,Pt,{items:e.items,totalRows:e.totalRows}),this._announceResults(e.totalRows),this._scheduler.schedule()},onError:e=>{this._stopEditing({commit:!1}),this._loadFailed=!0,this._dataVersion++,this._table.setOptions(e=>({...e,data:[],rowCount:0})),x.trigger(this._element,Vt,{error:e}),this._scheduler.schedule()},onLoadingChange:e=>{this._loading&&this._loading.setVisible(e),this._viewportElement.setAttribute("aria-busy",String(e))}}),this._dataSource.load())}_visibleLeafColumns(){return[...this._table.getLeftVisibleLeafColumns(),...this._table.getCenterVisibleLeafColumns(),...this._table.getRightVisibleLeafColumns()]}_chooserColumns(){var e;const t=[];for(const n of this._orderedLeafIds()){const o=this._table.getColumn(n),l=this._columnsByKey.get(n);o&&l&&t.push({id:n,label:null!==(e=l.label)&&void 0!==e?e:l.key,canHide:o.getCanHide(),visible:o.getIsVisible()})}return t}_visibleColumns(){const e=[];for(const t of this._visibleLeafColumns()){const n=this._columnsByKey.get(t.id);n&&e.push(n)}return e}_getColumnSizes(){var e,t;const n={};for(const o of null!==(t=null===(e=this._table.getHeaderGroups()[0])||void 0===e?void 0:e.headers)&&void 0!==t?t:[])n[o.column.id]=o.getSize();return n}_getFilteredColumns(){return this._table.getState().columnFilters.map(e=>e.id)}_getPinning(){const e=this._table.getLeftLeafColumns().filter(e=>e.getIsVisible()),t=this._table.getRightLeafColumns().filter(e=>e.getIsVisible()),n=Boolean(this._config.rowSelection)&&e.length>0,o={};for(const[t,l]of e.entries())o[l.id]={side:"left",offset:l.getStart("left"),edge:t===e.length-1,afterSelect:n};for(const[e,n]of t.entries())o[n.id]={side:"right",offset:n.getAfter("right"),edge:0===e,afterSelect:!1};return{columns:o,select:n?{side:"left",offset:0,edge:!1,afterSelect:!1}:null}}_storageKey(){return this._config.stateKey?`coreui-data-grid:${this._config.stateKey}`:null}_restorePersistedState(){const e=this._storageKey();if(!e)return;let t=null;try{const n=window.localStorage.getItem(e);t=n?JSON.parse(n):null}catch(e){return}t&&this.restoreState(t)}_updateHistoryButtons(){const e=this._element.querySelector(hn);e&&(e.disabled=0===this._undoStack.length);const t=this._element.querySelector(gn);t&&(t.disabled=0===this._redoStack.length)}_announceResults(e){this._announce(Qe(this._labels.resultsAnnouncement,{count:e}))}_announce(e){this._liveRegion&&(this._liveRegion.textContent=e)}_getTotalRows(){var e;return this._config.dataProvider?null!==(e=this._table.options.rowCount)&&void 0!==e?e:0:this._table.getFilteredRowModel().rows.length}_notifyStateChange(e,t){var n,o;if(!this._element)return;this._config.stateKey&&(this._persistState||(this._persistState=yt(()=>{const e=this._storageKey();if(e)try{window.localStorage.setItem(e,JSON.stringify(this.getState()))}catch(e){}},250)),this._persistState()),e.sorting===t.sorting&&e.columnFilters===t.columnFilters&&e.globalFilter===t.globalFilter&&e.pagination.pageIndex===t.pagination.pageIndex&&e.pagination.pageSize===t.pagination.pageSize||(this._stopEditing({commit:!0,force:!0}),this._selectionAnchorIndex=null,null===(n=this._activeCell)||void 0===n||n.reset()),e.sorting!==t.sorting&&x.trigger(this._element,Kt,{sorting:t.sorting});const l=e.columnFilters!==t.columnFilters||e.globalFilter!==t.globalFilter;if(l&&(x.trigger(this._element,Bt,{columnFilters:t.columnFilters,globalFilter:null!==(o=t.globalFilter)&&void 0!==o?o:""}),this._config.dataProvider||this._announceResults(this._table.getFilteredRowModel().rows.length)),e.rowSelection!==t.rowSelection&&x.trigger(this._element,Gt,{rowSelection:t.rowSelection,selectedItems:this.getSelectedItems()}),e.pagination!==t.pagination&&x.trigger(this._element,Nt,{pagination:t.pagination}),e.columnSizing!==t.columnSizing&&x.trigger(this._element,$t,{columnSizing:t.columnSizing}),e.columnPinning!==t.columnPinning&&x.trigger(this._element,qt,{columnPinning:t.columnPinning}),e.columnOrder!==t.columnOrder&&x.trigger(this._element,jt,{columnOrder:t.columnOrder}),e.columnVisibility!==t.columnVisibility&&x.trigger(this._element,Wt,{columnVisibility:t.columnVisibility}),this._dataSource){const n=l||e.sorting!==t.sorting;if(n&&0!==t.pagination.pageIndex)return void this._table.setPageIndex(0);(n||e.pagination!==t.pagination)&&this._dataSource.load()}}_update(){var e,t,n,o,l,i;if(this._virtualizer&&(this._virtualizer.setCount(this._table.getRowModel().rows.length),this._virtualizer.instance._willUpdate()),this._editingCell&&this._virtualizer){const{rowIndex:e}=this._editingCell;this._virtualizer.instance.getVirtualItems().some(t=>t.index===e)||this._stopEditing({commit:!0,force:!0})}this._tableElement.setAttribute("aria-rowcount",String(this._header.rowCount+this._getTotalRows())),this._header.update({filteredColumns:this._config.columnFilters?this._getFilteredColumns():null,order:this._visibleLeafColumns().map(e=>e.id),pinning:this._config.columnPinning?this._getPinning():null,resizingColumn:!!this._config.columnSizing&&this._table.getState().columnSizingInfo.isResizingColumn,sizes:this._config.columnSizing||this._config.columnPinning?this._getColumnSizes():null,sorting:this._table.getState().sorting,selectAll:this._config.rowSelection?{checked:this._table.getIsAllRowsSelected(),indeterminate:this._table.getIsSomeRowsSelected()}:null}),this._body.update(),this._applyCellNavigation(),this._editorFocusPending&&(null===(e=this._editor)||void 0===e?void 0:e.element.isConnected)&&(this._editorFocusPending=!1,this._editor.focus?this._editor.focus():(null!==(t=this._editor.element.querySelector(pn))&&void 0!==t?t:this._editor.element).focus({preventScroll:!0})),null===(o=null===(n=this._toolbar)||void 0===n?void 0:n.update)||void 0===o||o.call(n),null===(i=null===(l=this._emptySlot)||void 0===l?void 0:l.update)||void 0===i||i.call(l);for(const e of this._paginations)e.refresh()}_paginationState(){const{pagination:e}=this._table.getState();return{pageCount:this._table.getPageCount(),pageIndex:e.pageIndex,pageSize:e.pageSize,totalRows:this._getTotalRows()}}static jQueryInterface(e){return this.each(function(){const t=wn.getOrCreateInstance(this,"string"==typeof e?void 0:e);if("string"!=typeof e)return;const n=t;if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);n[e]()})}}var Sn,Cn;Sn=wn,Cn=()=>{const e=r();if(e){const t=Sn.NAME,n=e.fn[t];e.fn[t]=Sn.jQueryInterface,e.fn[t].Constructor=Sn,e.fn[t].noConflict=()=>(e.fn[t]=n,Sn.jQueryInterface)}},"loading"===document.readyState?(a.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of a)e()}),a.push(Cn)):Cn(),e.DEFAULT_LABELS=Ye,e.DataGrid=wn,e.FILTER_OPERATORS=ye,e.VALUELESS_OPERATORS=Ee,e.downloadCsv=Ct,e.evaluateColumnFilter=Re,e.exportCsv=St,e.interpolate=Qe,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
+
* CoreUI PRO data-grid v0.2.0-rc.0 (https://coreui.io)
|
|
3
|
+
* Copyright 2026 The CoreUI Team (https://github.com/orgs/coreui/people)
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* Bundles @tanstack/table-core and @tanstack/virtual-core, MIT (https://github.com/TanStack/table/blob/main/LICENSE)
|
|
6
|
+
*/
|
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).coreui=e.coreui||{})}(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});let t=function(e){return e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e}({});function n({update:e,notify:n,unwatched:o}){return{link:function(e,t,n){const o=t.depsTail;if(void 0!==o&&o.dep===e)return;const i=void 0!==o?o.nextDep:t.deps;if(void 0!==i&&i.dep===e)return i.version=n,void(t.depsTail=i);const l=e.subsTail;if(void 0!==l&&l.version===n&&l.sub===t)return;const s=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:o,nextDep:i,prevSub:l,nextSub:void 0};void 0!==i&&(i.prevDep=s),void 0!==o?o.nextDep=s:t.deps=s,void 0!==l?l.nextSub=s:e.subs=s},unlink:function(e,t=e.sub){const n=e.dep,i=e.prevDep,l=e.nextDep,s=e.nextSub,r=e.prevSub;return void 0!==l?l.prevDep=i:t.depsTail=i,void 0!==i?i.nextDep=l:t.deps=l,void 0!==s?s.prevSub=r:n.subsTail=r,void 0!==r?r.nextSub=s:void 0===(n.subs=s)&&o(n),l},propagate:function(e){let o,i=e.nextSub;e:for(;;){const s=e.sub;let r=s.flags;if(r&(t.RecursedCheck|t.Recursed|t.Dirty|t.Pending)?r&(t.RecursedCheck|t.Recursed)?r&t.RecursedCheck?r&(t.Dirty|t.Pending)||!l(e,s)?r=t.None:(s.flags=r|t.Recursed|t.Pending,r&=t.Mutable):s.flags=r&~t.Recursed|t.Pending:r=t.None:s.flags=r|t.Pending,r&t.Watching&&n(s),r&t.Mutable){const t=s.subs;if(void 0!==t){const n=(e=t).nextSub;void 0!==n&&(o={value:i,prev:o},i=n);continue}}if(void 0===(e=i)){for(;void 0!==o;)if(e=o.value,o=o.prev,void 0!==e){i=e.nextSub;continue e}break}i=e.nextSub}},checkDirty:function(n,o){let l,s=0,r=!1;e:for(;;){const a=n.dep,c=a.flags;if(o.flags&t.Dirty)r=!0;else if((c&(t.Mutable|t.Dirty))===(t.Mutable|t.Dirty)){if(e(a)){const e=a.subs;void 0!==e.nextSub&&i(e),r=!0}}else if((c&(t.Mutable|t.Pending))===(t.Mutable|t.Pending)){void 0===n.nextSub&&void 0===n.prevSub||(l={value:n,prev:l}),n=a.deps,o=a,++s;continue}if(!r){const e=n.nextDep;if(void 0!==e){n=e;continue}}for(;s--;){const s=o.subs,a=void 0!==s.nextSub;if(a?(n=l.value,l=l.prev):n=s,r){if(e(o)){a&&i(s),o=n.sub;continue}r=!1}else o.flags&=~t.Pending;o=n.sub;const c=n.nextDep;if(void 0!==c){n=c;continue e}}return r}},shallowPropagate:i};function i(e){do{const o=e.sub,i=o.flags;(i&(t.Pending|t.Dirty))===t.Pending&&(o.flags=i|t.Dirty,(i&(t.Watching|t.RecursedCheck))===t.Watching&&n(o))}while(void 0!==(e=e.nextSub))}function l(e,t){let n=t.depsTail;for(;void 0!==n;){if(n===e)return!0;n=n.prevDep}return!1}}const o=[];let i=0;const{link:l,unlink:s,propagate:r,checkDirty:a,shallowPropagate:c}=n({update:e=>e._update(),notify(e){o[g++]=e,e.flags&=~t.Watching},unwatched(e){void 0!==e.depsTail&&(e.depsTail=void 0,e.flags=t.Mutable|t.Dirty,h(e))}});let u,d=0,g=0,m=0;function f(e){try{++m,e()}finally{--m||p()}}function h(e){const t=e.depsTail;let n=void 0!==t?t.nextDep:e.deps;for(;void 0!==n;)n=s(n,e)}function p(){if(!(m>0)){for(;d<g;){const e=o[d];o[d++]=void 0,e.notify()}d=0,g=0}}function b(e,n){const o="function"==typeof e,s=e,d={_snapshot:o?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:o?t.None:t.Mutable,get:()=>(void 0!==u&&l(d,u,i),d._snapshot),subscribe(e){const n=function(e){const t="object"==typeof e,n=t?e:void 0;return{next:(t?e.next:e)?.bind(n),error:(t?e.error:void 0)?.bind(n),complete:(t?e.complete:void 0)?.bind(n)}}(e),o={current:!1},l=function(){const e=()=>{const e=u;u=l,++i,l.depsTail=void 0,l.flags=t.Watching|t.RecursedCheck;try{return d.get(),void(o.current?n.next?.(d._snapshot):o.current=!0)}finally{u=e,l.flags&=~t.RecursedCheck,h(l)}},l={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:t.Watching|t.RecursedCheck,notify(){const n=this.flags;n&t.Dirty||n&t.Pending&&a(this.deps,this)?e():this.flags=t.Watching},stop(){this.flags=t.None,this.depsTail=void 0,h(this)}};return e(),l}();return{unsubscribe:()=>{l.stop()}}},_update(e){const l=u,r=n?.compare??Object.is;if(o)u=d,++i,d.depsTail=void 0;else if(void 0===e)return!1;o&&(d.flags=t.Mutable|t.RecursedCheck);try{const t=d._snapshot,n="function"==typeof e?e(t):void 0===e&&o?s(t):e;return!(void 0!==t&&r(t,n)||(d._snapshot=n,0))}finally{u=l,o&&(d.flags&=~t.RecursedCheck),h(d)}}};return o?(d.flags=t.Mutable|t.Dirty,d.get=function(){const e=d.flags;if(e&t.Dirty||e&t.Pending&&a(d.deps,d)){if(d._update()){const e=d.subs;void 0!==e&&c(e)}}else e&t.Pending&&(d.flags=e&~t.Pending);return void 0!==u&&l(d,u,i),d._snapshot}):d.set=function(e){if(d._update(e)){const e=d.subs;void 0!==e&&(r(e),c(e),p())}},d}function _(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,o]of e)if(!t.has(n)||!Object.is(o,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=w(e);if(n.length!==w(t).length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Object.is(e[n[o]],t[n[o]]))return!1;return!0}function w(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const v=new Map;var C={set(e,t,n){v.has(e)||v.set(e,new Map);const o=v.get(e);o.has(t)||0===o.size?o.set(t,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(o.keys())[0]}.`)},get:(e,t)=>v.has(e)&&v.get(e).get(t)||null,remove(e,t){if(!v.has(e))return;const n=v.get(e);n.delete(t),0===n.size&&v.delete(e)}};const S="transitionend",y=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),x=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),I=e=>{return x(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(((t=e)&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),t)):null;var t},R=()=>window.jQuery&&!document.body.hasAttribute("data-coreui-no-jquery")?window.jQuery:null,E=[],M=(e,t=[],n=e)=>"function"==typeof e?e.call(...t):n,F=/[^.]*(?=\..*)\.|.*/,A=/\..*/,D=/::\d+$/,L={};let P=1;const O={mouseenter:"mouseover",mouseleave:"mouseout"},z=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","beforeinput","copy","cut","paste","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","gesturestart","gesturechange","gestureend","focus","blur","change","input","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function V(e,t){return t&&`${t}::${P++}`||e.uidEvent||P++}function T(e){const t=V(e);return e.uidEvent=t,L[t]=L[t]||{},L[t]}function k(e){const{delegateTarget:t,relatedTarget:n}=e;return Boolean(n&&t.contains(n))}function B(e,t,n,o=null){return Object.values(e).find(e=>e.callable===t&&e.handlerTypeEvent===n&&e.delegationSelector===o)}function H(e,t,n){const o="string"==typeof t,i=o?n:t||n,l=e.replace(A,"");let s=O[l]||l;return z.has(s)||(s=e),{isDelegated:o,callable:i,typeEvent:s,handlerTypeEvent:l in O?l:s}}function j(e,t,n,o,i){if("string"!=typeof t||!e)return;const{isDelegated:l,callable:s,typeEvent:r,handlerTypeEvent:a}=H(t,n,o),c=T(e),u=c[r]||(c[r]={}),d=B(u,s,a,l?n:null);if(d)return void(d.oneOff=d.oneOff&&i);const g=V(s,t.replace(F,"")),m=l?function(e,t,n,o){const i=o in O;return function l(s){const r=e.querySelectorAll(t);for(let{target:a}=s;a&&a!==this;a=a.parentNode)for(const c of r){if(c!==a)continue;const r=G(s,{delegateTarget:a});if(i&&k(r))return;return l.oneOff&&q.off(e,o,t,n),n.apply(a,[r])}}}(e,n,s,a):function(e,t,n){const o=n in O;return function i(l){const s=G(l,{delegateTarget:e});if(!o||!k(s))return i.oneOff&&q.off(e,n,t),t.apply(e,[s])}}(e,s,a);m.delegationSelector=l?n:null,m.callable=s,m.handlerTypeEvent=a,m.oneOff=i,m.uidEvent=g,u[g]=m,e.addEventListener(r,m,l)}function N(e,t,n,o){e.removeEventListener(n,o,Boolean(o.delegationSelector)),delete t[n][o.uidEvent]}function $(e,t,n,o){const i=t[n]||{};for(const[l,s]of Object.entries(i))l.includes(o)&&N(e,t,n,s)}const q={on(e,t,n,o){j(e,t,n,o,!1)},one(e,t,n,o){j(e,t,n,o,!0)},off(e,t,n,o){if("string"!=typeof t||!e)return;const{isDelegated:i,callable:l,typeEvent:s,handlerTypeEvent:r}=H(t,n,o),a=s!==t&&r!==t,c=T(e),u=c[s]||{},d=t.startsWith(".");if(void 0!==l){if(!Object.keys(u).length)return;const t=B(u,l,r,i?n:null);return void(t&&N(e,c,s,t))}if(d)for(const n of Object.keys(c))$(e,c,n,t.slice(1));for(const[n,o]of Object.entries(u)){const i=n.replace(D,"");o.handlerTypeEvent!==r||a&&!t.includes(i)||N(e,c,s,o)}},trigger(e,t,n){if("string"!=typeof t||!e)return null;const o=R(),i=t!==function(e){return e=e.replace(A,""),O[e]||e}(t);let l=null,s=!0,r=!0,a=!1;i&&o&&(l=o.Event(t,n),o(e).trigger(l),s=!l.isPropagationStopped(),r=!l.isImmediatePropagationStopped(),a=l.isDefaultPrevented());const c=G(new Event(t,{bubbles:s,cancelable:!0}),n);return a&&c.preventDefault(),r&&e.dispatchEvent(c),c.defaultPrevented&&l&&l.preventDefault(),c}};function G(e,t={}){for(const[n,o]of Object.entries(t))try{e[n]=o}catch{Object.defineProperty(e,n,{configurable:!0,get:()=>o})}return e}function K(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function W(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const U={setDataAttribute(e,t,n){e.setAttribute(`data-coreui-${W(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-coreui-${W(t)}`)},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter(e=>e.startsWith("coreui")&&!e.startsWith("coreuiConfig"));for(const o of n){let n=o.replace(/^coreui/,"");n=n.charAt(0).toLowerCase()+n.slice(1),t[n]=K(e.dataset[o])}return t},getDataAttribute:(e,t)=>K(e.getAttribute(`data-coreui-${W(t)}`))};var Z=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=x(t)?U.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...x(t)?U.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[n,o]of Object.entries(t)){const t=e[n],i=x(t)?"element":y(t);if(!new RegExp(o).test(i))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${i}" but expected type "${o}".`)}}},X=class extends Z{constructor(e,t){super(),(e=I(e))&&(this._element=e,this._config=this._getConfig(t),C.set(this._element,this.constructor.DATA_KEY,this))}dispose(){C.remove(this._element,this.constructor.DATA_KEY),q.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){((e,t,n=!0)=>{if(!n)return void M(e);const o=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);return Number.parseFloat(t)||Number.parseFloat(n)?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let i=!1;const l=({target:n})=>{n===t&&(i=!0,t.removeEventListener(S,l),M(e))};t.addEventListener(S,l),setTimeout(()=>{i||t.dispatchEvent(new Event(S))},o)})(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return C.get(I(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"0.1.0"}static get DATA_KEY(){return`coreui.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}};const Y=e=>/[\t\n"]/.test(e)?`"${e.replace(/"/g,'""')}"`:e,J="data-grid-drop-indicator",Q="data-grid-dragging",ee="data-grid-drag-active",te="data-grid-drag-preview",ne=48,oe=e=>e.replace(/\s+/g," ").trim(),ie=e=>{e.preventDefault(),e.stopPropagation()},le=()=>{document.removeEventListener("click",ie,{capture:!0})},se={dispose(){}},re=e=>{if("undefined"==typeof document)return se;const{axis:t,root:n}=e,o="x"===t;let i=null,l=!1,s={x:0,y:0},r={x:0,y:0},a=null,c=null,u=null,d=0,g=-1,m="",f=null;const h=new Map,p=new Set,b=new Map,_=new Map,w=()=>{d=0;const t=e.getScrollElement();if(!t||!l)return;const n=t.getBoundingClientRect(),i=o?r.x:r.y,s=o?n.left:n.top,a=o?n.right:n.bottom;let c=0;i<s+ne?c=-18*Math.min(1,(s+ne-i)/ne):i>a-ne&&(c=18*Math.min(1,(i-(a-ne))/ne)),0!==c&&(o?t.scrollLeft+=c:t.scrollTop+=c,y(),d=requestAnimationFrame(w))},v=()=>{c&&(c.style.transform=`translate(${r.x+12}px, ${r.y+12}px)`)},C=()=>{const t=e.getScrollElement();if(!t)return 0;const n=t.getBoundingClientRect();return o?n.left-t.scrollLeft:n.top-t.scrollTop},S=(t,n)=>{const i=e.items.getElements(t)[0];if(!i)return!1;const l=i.getBoundingClientRect(),s=(o?l.left:l.top)-(h.get(t)??0);return b.set(t,s-n),_.set(t,o?l.width:l.height),!0},y=()=>{const t=o?r.x:r.y,l=C(),s=[];for(const t of e.items.getOrderedIds())(b.has(t)||S(t,l))&&s.push({id:t,start:l+b.get(t),size:_.get(t)});let c=null;const d=s[s.length-1],g=s.findIndex(e=>e.id===i.id);if(d&&t>d.start+d.size){f=null;for(let t=s.length-1;t>=0;t--)if(e.canDrop(i.id,s[t].id)){c={id:s[t].id,after:!0};break}}else if(d&&t<s[0].start){f=null;for(const t of s)if(e.canDrop(i.id,t.id)){c={id:t.id,after:!1};break}}else if(a&&f&&t>=f.lo-3&&t<=f.hi+3)c=a;else for(let n=0;n<s.length;n++){const o=s[n],l=s[n-1],r=s[n+1],a=l?(l.start+l.size+o.start)/2:o.start,u=r?(o.start+o.size+r.start)/2:o.start+o.size;if(!(t<a||t>u)){e.canDrop(i.id,o.id)&&(c={id:o.id,after:-1===g?t>o.start+o.size/2:n>g},f={lo:a,hi:u});break}}if(!c)return a=null,f=null,u&&(u.hidden=!0),void x();a=c,((e,t)=>{if(!u)return;const i=e.getBoundingClientRect(),l=n.getBoundingClientRect();u.hidden=!1,o?(u.style.left=`${t?i.right:i.left}px`,u.style.top=`${l.top}px`,u.style.height=`${l.height}px`):(u.style.left=`${l.left}px`,u.style.top=`${t?i.bottom:i.top}px`,u.style.width=`${l.width}px`)})(e.items.getElements(c.id)[0],c.after),x()},x=()=>{if(!e.preview||!i)return;const t=e.items.getOrderedIds(),n=t.indexOf(i.id),l=a?t.indexOf(a.id):-1,s=-1===n||-1===l?n:((e,t,n)=>t>e?n?t:t-1:n?t+1:t)(n,l,a.after),r=String(s);if(r===m)return;m=r;const c=new Map;if(-1!==n&&s!==n){const e=e=>_.get(t[e])??0,o=s>n,i=o?n+1:s,l=o?s:n-1,r=e(n);let a=0;for(let n=i;n<=l;n++)a+=e(n),c.set(t[n],o?-r:r);c.set(t[n],o?a:-a)}for(const t of h.keys())if(!c.has(t))for(const n of e.items.getElements(t))n.style.transform="";for(const[t,n]of c)if(h.get(t)!==n){for(const i of e.items.getElements(t))i.style.transform=o?`translateX(${n}px)`:`translateY(${n}px)`,i.classList.add(te);p.add(t)}h.clear();for(const[e,t]of c)h.set(e,t)},I=(e,t)=>{if(!c)return;const n=c;c=null,n.classList.add("data-grid-drag-ghost-settle"),n.style.transform=`translate(${e}px, ${t}px)`,n.style.opacity="0";let o=!1;const i=()=>{o||(o=!0,n.remove())};n.addEventListener("transitionend",i),setTimeout(i,400)},R=e=>{if(!i)return null;const t=i.element.getBoundingClientRect();if(e)return{x:t.left,y:t.top};const n=h.get(i.id)??0;return o?{x:t.left-n,y:t.top}:{x:t.left,y:t.top-n}},E=()=>{(()=>{for(const t of p)for(const n of e.items.getElements(t))n.style.transform="",n.classList.remove(te);m="",h.clear(),p.clear()})(),b.clear(),_.clear(),d&&(cancelAnimationFrame(d),d=0),n.classList.remove(ee),i?.element.classList.remove(Q),c?.remove(),u?.remove(),c=null,u=null,i=null,l=!1,a=null,f=null,g=-1,document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",D),document.removeEventListener("pointercancel",M),document.removeEventListener("keydown",F)};function M(){if(l){const e=R(!1);e&&I(e.x,e.y)}E()}function F(e){"Escape"===e.key&&(e.preventDefault(),M())}function A(o){if(o.pointerId===g&&i){if(r={x:o.clientX,y:o.clientY},!l){if(Math.max(Math.abs(r.x-s.x),Math.abs(r.y-s.y))<4)return;(()=>{l=!0;const o=document.activeElement;o instanceof HTMLElement&&n.contains(o)&&o.blur(),n.classList.add(ee),i.element.classList.add(Q);const s=i.element.getBoundingClientRect();c=document.createElement("div"),c.className="data-grid-drag-ghost",c.setAttribute("aria-hidden","true"),c.style.width=`${s.width}px`,c.style.height=`${s.height}px`,c.textContent=e.ghostLabel?e.ghostLabel(i):oe(i.element.textContent??""),e.preview||(u=document.createElement("div"),u.className=`${J} ${J}-${t}`,u.setAttribute("aria-hidden","true"),u.hidden=!0,n.append(u)),n.append(c),v(),(()=>{b.clear(),_.clear();const t=C();for(const n of e.items.getOrderedIds())S(n,t)})()})()}o.preventDefault(),v(),y(),d||(d=requestAnimationFrame(w))}}function D(t){if(t.pointerId!==g)return;const n=i?.id,o=i?.element,s=a,r=l;if(r){const e=Boolean(s&&s.id!==n),t=R(e);t&&I(t.x,t.y)}E(),r&&(o?.contains(t.target)&&(document.addEventListener("click",ie,{capture:!0,once:!0}),setTimeout(le,0)),n&&s&&s.id!==n&&e.onDrop(n,s))}const L=t=>{if(!t.isPrimary||"mouse"===t.pointerType&&0!==t.button||i)return;const n=t.target?.closest(e.handle);if(!n)return;const o=e.resolveSource(n,t.target);o&&(i=o,g=t.pointerId,s={x:t.clientX,y:t.clientY},r=s,document.addEventListener("pointermove",A),document.addEventListener("pointerup",D),document.addEventListener("pointercancel",M),document.addEventListener("keydown",F))};return n.addEventListener("pointerdown",L),{dispose(){n.removeEventListener("pointerdown",L),le(),E()}}},ae="tr[data-coreui-index]";function ce(e,t){return"function"==typeof e?e(t):e}function ue(e){if(Array.isArray(e))return e.map(ue);if(e&&"object"==typeof e){const t=Object.getPrototypeOf(e);if(t!==Object.prototype&&null!==t)return e;const n=null===t?ge():{},o=Object.keys(e);for(let t=0;t<o.length;t++){const i=o[t];Object.defineProperty(n,i,{configurable:!0,enumerable:!0,value:ue(e[i]),writable:!0})}return n}return e}function de(e,t){const n=Object.keys(t),o=e;for(let e=0;e<n.length;e++){const i=n[e];i.startsWith("_memo_")||"_cellsCache"===i||(o[i]=t[i])}return e}function ge(){return Object.create(null)}function me(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function fe(e,t){return n=>{(t.options.atoms?.[e]??t.baseAtoms[e]).set(e=>ce(n,e))}}function he(e){return e instanceof Function}function pe(e){let t=!1;return()=>{t?e():t=!0}}function be({feature:e,fnName:t,objectId:n,onAfterUpdate:o,table:i,...l}){return(({fn:e,memoDeps:t,onAfterCompare:n,onAfterUpdate:o,onBeforeCompare:i,onBeforeUpdate:l})=>{let s,r=[];return a=>{i?.();const c=t?.(a);let u=!c||c.length!==r?.length;if(!u&&c)for(let e=0;e<c.length;e++)if(c[e]!==r[e]){u=!0;break}return n?.(u),u?(r=c,l?.(),s=e(...c??[]),o?.(s),s):s}})({...l,onAfterUpdate:()=>{(()=>{if(!o)return;const{schedule:e,untrack:t}=i._reactivity;e(()=>t(()=>o()))})()}})}function _e(e,t="_"){const[n,o]=e.split(t);return{fnKey:o,fnName:`${n}.${o}`,parentName:n}}function we(e,t,n){for(const[o,{fn:i,memoDeps:l}]of Object.entries(n)){const{fnKey:n,fnName:s}=_e(o);t[n]=l?be({memoDeps:l,fn:i,fnName:s,table:t,feature:e}):i}}function ve(e,t,n,o){for(const[i,{fn:l,memoDeps:s}]of Object.entries(o)){const{fnKey:o,fnName:r}=_e(i);if(s){const i=`_memo_${o}`;t[o]=function(...t){if(!this[i]){const t=this;this[i]=be({memoDeps:e=>s(t,e),fn:(...e)=>l(t,...e),fnName:r,objectId:t.id,table:n,feature:e})}return this[i](...t)}}else t[o]=function(...e){return l(this,...e)}}}function Ce(e,t,n,...o){return e[t]?.(...o)??n(e,...o)}const Se={assignCellPrototype:(e,t)=>{ve("coreCellsFeature",e,t,{cell_getValue:{fn:e=>function(e){return e.row.getValue(e.column.id)}(e)},cell_renderValue:{fn:e=>function(e){return e.getValue()??e.table.options.renderFallbackValue}(e)},cell_getContext:{fn:e=>function(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}(e),memoDeps:e=>[e]}})}};function ye(e,t,n){const o=function(e){if(!e._headerPrototype){e._headerPrototype={table:e};const t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignHeaderPrototype?.(e._headerPrototype,e)}return e._headerPrototype}(e),i=Object.create(o);i.colSpan=0,i.column=t,i.depth=n.depth,i.headerGroup=null,i.id=n.id??t.id,i.index=n.index,i.isPlaceholder=!!n.isPlaceholder,i.placeholderId=n.placeholderId,i.rowSpan=0,i.subHeaders=[];const l=e._headerInstanceInitFns;for(let e=0;e<l.length;e++)l[e](i);return i}function xe(e){const t=e.getLeafColumns(),{start:n,end:o}=e.table.atoms.columnPinning?.get()??{start:[],end:[]};for(let e=0;e<t.length;e++)if(n.includes(t[e].id))return"start";for(let e=0;e<t.length;e++)if(o.includes(t[e].id))return"end";return!1}function Ie(e,t){e.options.onColumnPinningChange?.(t)}function Re(e){const t=e.getAllColumns(),n=e.getAllLeafColumnsById(),{start:o}=e.atoms.columnPinning?.get()??{start:[],end:[]},i=[];for(let e=0;e<o.length;e++){const t=n[o[e]];t&&Ce(t,"getIsVisible",He)&&i.push(t)}return et(t,i,e,"start")}function Ee(e){const t=e.getAllColumns(),n=e.getAllLeafColumnsById(),{end:o}=e.atoms.columnPinning?.get()??{start:[],end:[]},i=[];for(let e=0;e<o.length;e++){const t=n[o[e]];t&&Ce(t,"getIsVisible",He)&&i.push(t)}return et(t,i,e,"end")}function Me(e){const t=e.getAllColumns();let n=Ce(e,"getVisibleLeafColumns",qe);const{start:o,end:i}=e.atoms.columnPinning?.get()??{start:[],end:[]};if(o.length||i.length){const e=[...o,...i];n=n.filter(t=>!e.includes(t.id))}return et(t,n,e,"center")}function Fe(e){const t=Ce(e,"getStartHeaderGroups",Re),n=[];for(let e=0;e<t.length;e++){const o=t[e].headers;for(let e=0;e<o.length;e++)n.push(o[e])}return n}function Ae(e){const t=Ce(e,"getEndHeaderGroups",Ee),n=[];for(let e=0;e<t.length;e++){const o=t[e].headers;for(let e=0;e<o.length;e++)n.push(o[e])}return n}function De(e){const t=Ce(e,"getCenterHeaderGroups",Me),n=[];for(let e=0;e<t.length;e++){const o=t[e].headers;for(let e=0;e<o.length;e++)n.push(o[e])}return n}function Le(e){const{start:t}=e.atoms.columnPinning?.get()??{start:[],end:[]},n=e.getAllLeafColumnsById(),o=[];for(let e=0;e<t.length;e++){const i=n[t[e]];i&&o.push(i)}return o}function Pe(e){const{end:t}=e.atoms.columnPinning?.get()??{start:[],end:[]},n=e.getAllLeafColumnsById(),o=[];for(let e=0;e<t.length;e++){const i=n[t[e]];i&&o.push(i)}return o}function Oe(e){const{start:t,end:n}=e.atoms.columnPinning?.get()??{start:[],end:[]};if(!t.length&&!n.length)return e.getAllLeafColumns();const o=[...t,...n];return e.getAllLeafColumns().filter(e=>!o.includes(e.id))}function ze(e){return Ce(e,"getStartLeafColumns",Le).filter(e=>Ce(e,"getIsVisible",He))}function Ve(e){return Ce(e,"getEndLeafColumns",Pe).filter(e=>Ce(e,"getIsVisible",He))}function Te(e){return Ce(e,"getCenterLeafColumns",Oe).filter(e=>Ce(e,"getIsVisible",He))}function ke(e,t){return t?"start"===t?Ce(e,"getStartVisibleLeafColumns",ze):"end"===t?Ce(e,"getEndVisibleLeafColumns",Ve):Ce(e,"getCenterVisibleLeafColumns",Te):Ce(e,"getVisibleLeafColumns",qe)}function Be(e,t){je(e)&&Ge(e.table,n=>{const o=Object.assign(ge(),n),i=t??!Ce(e,"getIsVisible",He),l=e.getLeafColumns();for(let e=0;e<l.length;e++){const t=l[e];je(t)&&(o[t.id]=i)}return o})}function He(e){const t=e.table.atoms.columnVisibility?.get();if(!t)return!0;const n=e.columns;return n.length?n.some(e=>Ce(e,"getIsVisible",He)):(me(t,e.id)?t[e.id]:void 0)??!0}function je(e){return(e.columnDef.enableHiding??!0)&&(e.table.options.enableHiding??!0)}function Ne(e){const t=e.getAllCells(),n=[];for(let e=0;e<t.length;e++){const o=t[e];Ce(o.column,"getIsVisible",He)&&n.push(o)}const{start:o,end:i}=e.table.atoms.columnPinning?.get()??{start:[],end:[]};if(!o.length&&!i.length)return n;const l=Ce(e,"getVisibleCellsByColumnId",$e),s=[];for(let e=0;e<o.length;e++){const t=l[o[e]];t&&s.push(t)}const r=[];for(let e=0;e<i.length;e++){const t=l[i[e]];t&&r.push(t)}const a=[];for(let e=0;e<n.length;e++){const t=n[e],l=t.column.id;o.includes(l)||i.includes(l)||a.push(t)}return[...s,...a,...r]}function $e(e){const t=ge(),n=e.getAllCells();for(let e=0;e<n.length;e++){const o=n[e];Ce(o.column,"getIsVisible",He)&&(t[o.column.id]=o)}return t}function qe(e){return e.getAllLeafColumns().filter(e=>Ce(e,"getIsVisible",He))}function Ge(e,t){e.options.onColumnVisibilityChange?.(t)}function Ke(e,t){t=t??!We(e);const n=ge(),o=e.getAllLeafColumns();for(let e=0;e<o.length;e++){const i=o[e];n[i.id]=t||!je(i)}Ge(e,n)}function We(e){return!e.getAllLeafColumns().some(e=>!Ce(e,"getIsVisible",He))}function Ue(e,t=1){let n=t;for(let o=0;o<e.length;o++){const i=e[o];Ce(i,"getIsVisible",He)&&i.columns.length&&(n=Math.max(n,Ue(i.columns,t+1)))}return n}function Ze(e,t){return e?`${e}_${t}`:String(t)}function Xe(e,t,n,o){let i=e??"";return t&&(i=i?`${i}_${t}`:String(t)),n&&(i=i?`${i}_${n}`:n),o&&(i=i?`${i}_${o}`:o),i}function Ye(e,t){let n=0;for(let o=0;o<e.length;o++)e[o].column===t&&n++;return n}function Je(e,t,n,o,i,l){const s={depth:t,id:Ze(o,t),headers:[]},r=[];for(let i=0;i<e.length;i++){if(!(i in e))continue;const l=e[i],a=r[r.length-1];let c,u=!1;if(l.column.depth===s.depth&&l.column.parent?c=l.column.parent:(c=l.column,u=!0),a&&a.column===c)a.subHeaders.push(l);else{const e=ye(n,c,{id:Xe(o,t,c.id,l.id),isPlaceholder:u,placeholderId:u?String(Ye(r,c)):void 0,depth:t,index:r.length});e.subHeaders.push(l),r.push(e)}s.headers.push(l),l.headerGroup=s}for(let e=0;e<l.length;e++)l[e](s);i.push(s),t>0&&Je(r,t-1,n,o,i,l)}function Qe(e){for(let t=0;t<e.length;t++){const n=e[t];if(!Ce(n.column,"getIsVisible",He))continue;let o=0;if(n.subHeaders.length){Qe(n.subHeaders);for(let e=0;e<n.subHeaders.length;e++){const t=n.subHeaders[e];Ce(t.column,"getIsVisible",He)&&(o+=t.colSpan)}}else o=1;if(n.colSpan=o,n.isPlaceholder&&1===n.subHeaders.length&&n.subHeaders[0].column===n.column){let e=1,t=n.subHeaders[0];for(;t;)t.rowSpan=0,e++,t=1===t.subHeaders.length&&t.subHeaders[0].column===n.column?t.subHeaders[0]:void 0;n.rowSpan=e}else n.rowSpan=1}}function et(e,t,n,o){const i=Ue(e),l=[],s=n._headerGroupInstanceInitFns,r=new Array(t.length);for(let e=0;e<t.length;e++)e in t&&(r[e]=ye(n,t[e],{depth:i,index:e}));return Je(r,i-1,n,o,l,s),l.reverse(),Qe(l[0]?.headers??[]),l}function tt(e,t,n,o){const i={...e.getDefaultColumnDef(),...t},l=i.accessorKey,s=void 0===l?void 0:String(l),r=i.id??s?.replaceAll(".","_")??("string"==typeof i.header?i.header:void 0);let a;if(i.accessorFn)a=i.accessorFn;else if(void 0!==l)if("string"==typeof l&&l.includes(".")){const e=l.split(".");a=t=>{let n=t;for(let t=0;t<e.length;t++){const o=e[t];n=n?.[o]}return n}}else a=e=>e[i.accessorKey];if(!r)throw new Error;const c=function(e){if(!e._columnPrototype){e._columnPrototype={table:e};const t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignColumnPrototype?.(e._columnPrototype,e)}return e._columnPrototype}(e),u=Object.create(c);u.accessorFn=a,u.columnDef=i,u.columns=[],u.depth=n,u.id=`${String(r)}`,u.parent=o;const d=e._columnInstanceInitFns;for(let e=0;e<d.length;e++)d[e](u);return u}function nt(e){const t=e=>{const t=ge();for(let n=0;n<e.length;n++)t[e[n].id]=n;return t};return{all:t(ke(e)),center:t(ke(e,"center")),start:t(ke(e,"start")),end:t(ke(e,"end"))}}function ot(e,t){e.options.onColumnOrderChange?.(t)}function it(e){const t=e.atoms.columnOrder?.get();return n=>{let o=[];if(t?.length){const e=new Map;for(let t=0;t<n.length;t++){const o=n[t];e.set(o.id,o)}for(let n=0;n<t.length;n++){const i=t[n],l=e.get(i);l&&(o.push(l),e.delete(i))}for(let t=0;t<n.length;t++){const i=n[t];e.has(i.id)&&o.push(i)}}else o=n;return function(e,t){const n=e.atoms.grouping?.get()??[],{groupedColumnMode:o}=e.options;if(!n.length||!o)return t;const i=t.filter(e=>!n.includes(e.id));if("remove"===o)return i;const l=new Map;for(let e=0;e<t.length;e++){const n=t[e];l.set(n.id,n)}const s=[];for(let e=0;e<n.length;e++){const t=l.get(n[e]);t&&s.push(t)}return[...s,...i]}(e,o)}}function lt(e,t,n,o=0){const i=new Array(t.length);for(let l=0;l<t.length;l++){if(!(l in t))continue;const s=t[l],r=tt(e,s,o,n),a=s;r.columns=a.columns?lt(e,a.columns,r,o+1):[],i[l]=r}return i}function st(e){return lt(e,e.options.columns)}function rt(e,t){return e.getAllFlatColumnsById()[t]}const at={assignColumnPrototype:(e,t)=>{ve("coreColumnsFeature",e,t,{column_getFlatColumns:{fn:e=>function(e){return[e,...e.columns.flatMap(e=>e.getFlatColumns())]}(e),memoDeps:e=>[e.table.options.columns]},column_getLeafColumns:{fn:e=>function(e){if(e.columns.length){const t=e.columns.flatMap(e=>e.getLeafColumns());return Ce(e.table,"getOrderColumns",it)(t)}return[e]}(e),memoDeps:e=>[e.table.atoms.columnOrder?.get(),e.table.atoms.grouping?.get(),e.table.options.columns,e.table.options.groupedColumnMode]}})},constructTableAPIs:e=>{we("coreColumnsFeature",e,{table_getDefaultColumnDef:{fn:()=>function(e){return{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>e.renderValue()?.toString?.()??null,...Object.values(e._features).reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef?.()),{}),...e.options.defaultColumn}}(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>st(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>function(e){return e.getAllColumns().flatMap(e=>e.getFlatColumns())}(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>function(e){const t=ge(),n=e.getAllFlatColumns();for(let e=0;e<n.length;e++){const o=n[e];t[o.id]=o}return t}(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>function(e){const t=e.getAllColumns().flatMap(e=>e.getLeafColumns());return Ce(e,"getOrderColumns",it)(t)}(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getAllLeafColumnsById:{fn:()=>function(e){const t=ge(),n=e.getAllLeafColumns();for(let e=0;e<n.length;e++){const o=n[e];t[o.id]=o}return t}(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>rt(e,t)}})}};function ct(e,t){for(let n=0;n<e.subHeaders.length;n++)ct(e.subHeaders[n],t);t.push(e)}function ut(e){const t=[];return ct(e,t),t}const dt={assignHeaderPrototype:(e,t)=>{ve("coreHeadersFeature",e,t,{header_getLeafHeaders:{fn:e=>ut(e),memoDeps:e=>[e.column.table.options.columns]},header_getContext:{fn:e=>function(e){return{column:e.column,header:e,table:e.column.table}}(e),memoDeps:e=>[e.column.table.options.columns]}})},constructTableAPIs:e=>{we("coreHeadersFeature",e,{table_getHeaderGroups:{fn:()=>function(e){const{start:t,end:n}=e.atoms.columnPinning?.get()??{start:[],end:[]},o=e.getAllColumns(),i=Ce(e,"getVisibleLeafColumns",qe);if(!t.length&&!n.length)return et(o,i,e);const l=e.getAllLeafColumnsById(),s=[];for(let e=0;e<t.length;e++){const n=l[t[e]];n&&Ce(n,"getIsVisible",He)&&s.push(n)}const r=[];for(let e=0;e<n.length;e++){const t=l[n[e]];t&&Ce(t,"getIsVisible",He)&&r.push(t)}const a=i.filter(e=>!t.includes(e.id)&&!n.includes(e.id));return et(o,[...s,...a,...r],e)}(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.options.groupedColumnMode]},table_getFooterGroups:{fn:()=>function(e){return[...e.getHeaderGroups()].reverse()}(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>function(e){const t=e.getHeaderGroups(),n=[];for(let e=0;e<t.length;e++){const o=t[e].headers;for(let e=0;e<o.length;e++)n.push(o[e])}return n}(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>function(e){const t=e.getHeaderGroups()[0]?.headers??[],n=[];for(let e=0;e<t.length;e++){const o=t[e].getLeafHeaders();for(let e=0;e<o.length;e++)n.push(o[e])}return n}(e),memoDeps:()=>[e.getHeaderGroups()]}})}},gt=(e,t,n,o,i,l,s)=>{const r=function(e){if(!e._rowPrototype){e._rowPrototype={table:e};const t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignRowPrototype?.(e._rowPrototype,e)}return e._rowPrototype}(e),a=Object.create(r);a._displayIndexCache=-1,a._uniqueValuesCache=ge(),a._valuesCache=ge(),a.depth=i,a.id=t,a.index=o,a.original=n,a.parentId=s,a.subRows=l??[];const c=e._rowInstanceInitFns;for(let e=0;e<c.length;e++)c[e](a);return a},mt=/([0-9]+)/gm;function ft(e){const t=Object.assign((e,n,o)=>{let i=e.getValue(o),l=n.getValue(o);const s=t.resolveDataValue;return s&&(i=s(i),l=s(l)),t.sort(i,l,e,n,o)},e);return t}const ht=ft({resolveDataValue:e=>vt(e).toLowerCase(),sort:(e,t)=>Ct(e,t)});ft({resolveDataValue:e=>vt(e),sort:(e,t)=>Ct(e,t)});const pt=ft({resolveDataValue:e=>vt(e).toLowerCase(),sort:(e,t)=>wt(e,t)});ft({resolveDataValue:e=>vt(e),sort:(e,t)=>wt(e,t)});const bt=ft({resolveDataValue:e=>{return(t=e)instanceof Date?t.getTime():t;var t},sort:(e,t)=>e>t?1:e<t?-1:0}),_t=ft({sort:(e,t)=>wt(e,t)});function wt(e,t){return e===t?0:e>t?1:-1}function vt(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function Ct(e,t){let n=0,o=0;const i=e.length,l=t.length;for(;n<i&&o<l;){const i=St(e.charCodeAt(n)),l=St(t.charCodeAt(o)),s=yt(e,n,i),r=yt(t,o,l);if(!i&&!l){const i=xt(e,n,s,t,o,r);if(i)return i;n=s,o=r;continue}if(i!==l)return i?1:-1;const a=It(e,n,s,t,o,r);if(a)return a;n=s,o=r}return Et(e,n)-Et(t,o)}function St(e){return e>=48&&e<=57}function yt(e,t,n){let o=t+1;for(;o<e.length&&St(e.charCodeAt(o))===n;)o++;return o}function xt(e,t,n,o,i,l){const s=n-t,r=l-i,a=s<r?s:r;for(let n=0;n<a;n++){const l=e.charCodeAt(t+n),s=o.charCodeAt(i+n);if(l>s)return 1;if(s>l)return-1}return s>r?1:r>s?-1:0}function It(e,t,n,o,i,l){let s=t;for(;s<n&&48===e.charCodeAt(s);)s++;let r=i;for(;r<l&&48===o.charCodeAt(r);)r++;const a=n-s,c=l-r;if(0===a&&0===c)return 0;if(a<=15&&c<=15){const t=Rt(e,s,n),i=Rt(o,r,l);return t>i?1:i>t?-1:0}const u=parseInt(e.slice(t,n),10),d=parseInt(o.slice(i,l),10);return u>d?1:d>u?-1:0}function Rt(e,t,n){let o=0;for(let i=t;i<n;i++)o=10*o+e.charCodeAt(i)-48;return o}function Et(e,t){let n=0,o=t;for(;o<e.length;)n++,o=yt(e,o,St(e.charCodeAt(o)));return n}function Mt(e,t){return e.minRowIndex-t.minRowIndex||e.minColumnIndex-t.minColumnIndex||e.maxRowIndex-t.maxRowIndex||e.maxColumnIndex-t.maxColumnIndex}function Ft(e,t){const n={minRowIndex:Math.max(e.minRowIndex,t.minRowIndex),maxRowIndex:Math.min(e.maxRowIndex,t.maxRowIndex),minColumnIndex:Math.max(e.minColumnIndex,t.minColumnIndex),maxColumnIndex:Math.min(e.maxColumnIndex,t.maxColumnIndex)};return n.minRowIndex<=n.maxRowIndex&&n.minColumnIndex<=n.maxColumnIndex?n:void 0}function At(e,t){const n=Ft(e,t);if(!n)return[e];const o=[];return e.minRowIndex<n.minRowIndex&&o.push({...e,maxRowIndex:n.minRowIndex-1}),n.maxRowIndex<e.maxRowIndex&&o.push({...e,minRowIndex:n.maxRowIndex+1}),e.minColumnIndex<n.minColumnIndex&&o.push({minRowIndex:n.minRowIndex,maxRowIndex:n.maxRowIndex,minColumnIndex:e.minColumnIndex,maxColumnIndex:n.minColumnIndex-1}),n.maxColumnIndex<e.maxColumnIndex&&o.push({minRowIndex:n.minRowIndex,maxRowIndex:n.maxRowIndex,minColumnIndex:n.maxColumnIndex+1,maxColumnIndex:e.maxColumnIndex}),o}function Dt(e,t){return e.minRowIndex!==t.minRowIndex||e.maxRowIndex!==t.maxRowIndex||e.maxColumnIndex+1!==t.minColumnIndex&&t.maxColumnIndex+1!==e.minColumnIndex?e.minColumnIndex!==t.minColumnIndex||e.maxColumnIndex!==t.maxColumnIndex||e.maxRowIndex+1!==t.minRowIndex&&t.maxRowIndex+1!==e.minRowIndex?void 0:{minRowIndex:Math.min(e.minRowIndex,t.minRowIndex),maxRowIndex:Math.max(e.maxRowIndex,t.maxRowIndex),minColumnIndex:e.minColumnIndex,maxColumnIndex:e.maxColumnIndex}:{minRowIndex:e.minRowIndex,maxRowIndex:e.maxRowIndex,minColumnIndex:Math.min(e.minColumnIndex,t.minColumnIndex),maxColumnIndex:Math.max(e.maxColumnIndex,t.maxColumnIndex)}}function Lt(e){const t=e.slice();for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){const o=Dt(t[e],t[n]);if(o){t.splice(n,1),t[e]=o,e=-1;break}}return t.sort(Mt)}function Pt(e,t){let n=[t];for(const t of e)if(n=n.flatMap(e=>At(e,t)),!n.length)return e.slice();return Lt([...e,...n])}function Ot(e,t){let n=e,o=!0;for(;o;){o=!1;for(const e of t){if(!Ft(n,e))continue;const t={minRowIndex:Math.min(n.minRowIndex,e.minRowIndex),maxRowIndex:Math.max(n.maxRowIndex,e.maxRowIndex),minColumnIndex:Math.min(n.minColumnIndex,e.minColumnIndex),maxColumnIndex:Math.max(n.maxColumnIndex,e.maxColumnIndex)};t.minRowIndex===n.minRowIndex&&t.maxRowIndex===n.maxRowIndex&&t.minColumnIndex===n.minColumnIndex&&t.maxColumnIndex===n.maxColumnIndex||(n=t,o=!0)}}return n}function zt(e,t){e.options.onCellSelectionChange?.(t)}function Vt(e,t){zt(e,t?[]:ue(e.initialState.cellSelection)??[])}function Tt(e){e.atoms.cellSelection&&(e.options.autoResetAll??e.options.autoResetCellSelection??1)&&e._reactivity.schedule(()=>Vt(e))}function kt(e){const t=Ce(e,"getVisibleLeafColumns",qe),n=e.atoms.columnPinning?.get();if(!n||!n.start.length&&!n.end.length)return t;const o=ge();for(let e=0;e<t.length;e++)o[t[e].id]=t[e];const i=[];for(let e=0;e<n.start.length;e++){const t=o[n.start[e]];t&&i.push(t)}const l=[];for(let e=0;e<n.end.length;e++){const t=o[n.end[e]];t&&l.push(t)}const s=[];for(let e=0;e<t.length;e++){const o=t[e];n.start.includes(o.id)||n.end.includes(o.id)||s.push(o)}return[...i,...s,...l]}function Bt(e){const t=kt(e),n=ge();for(let e=0;e<t.length;e++)n[t[e].id]=e;return n}const Ht=[];function jt(e){const t=function(e){return e.getCellSpanIndex?.()}(e);if(!t)return Ht;const n=Ce(e,"getCellSelectionColumnIndexes",Bt),o=[];for(const e in t.rowSpans){const i=n[e];if(void 0===i)continue;const l=t.rowSpans[e],s=t.columnIndexes[e];for(let e=0;e<l.length;e++){const n=l[e];if(n<=1)continue;const r=t.rows[e].getDisplayIndex(),a=t.rows[e+n-1].getDisplayIndex();if(r<0||a-r!==n-1)continue;const c=void 0===s?1:Math.max(t.colSpans[e]?.[s]??1,1);o.push({minRowIndex:r,maxRowIndex:a,minColumnIndex:i,maxColumnIndex:i+c-1})}}if(t.colSpans.length){const e=[];for(const n in t.columnIndexes)e[t.columnIndexes[n]]=n;for(let i=0;i<t.colSpans.length;i++){const l=t.colSpans[i];if(!l)continue;const s=t.rows[i]?.getDisplayIndex()??-1;if(!(s<0))for(let r=0;r<l.length;r++){const a=l[r];if(a<=1)continue;const c=e[r];if(void 0===c)continue;const u=t.rowSpans[c];if(u&&1!==u[i])continue;const d=n[c];void 0!==d&&o.push({minRowIndex:s,maxRowIndex:s,minColumnIndex:d,maxColumnIndex:d+a-1})}}}return o}function Nt(e,t,n){for(let o=0;o<e.length;o++){const i=e[o];if(t>=i.minRowIndex&&t<=i.maxRowIndex&&n>=i.minColumnIndex&&n<=i.maxColumnIndex)return i}}function $t(e,t,n){const o=e.getPrePaginatedRowModel().rowsById[n]??e.getCoreRowModel().rowsById[n];if(!o)return-1;const i=o.getDisplayIndex();return i<0||i>=t.length||t[i]?.id!==n?-1:i}function qt(e){const t=e.atoms.cellSelection?.get();if(!t?.length)return[];const n=e.getRowsInDisplayOrder(),o=Ce(e,"getCellSelectionColumnIndexes",Bt),i=[];for(let l=0;l<t.length;l++){const s=t[l],r=$t(e,n,s.anchorRowId),a=$t(e,n,s.focusRowId),c=o[s.anchorColumnId]??-1,u=o[s.focusColumnId]??-1;r<0||a<0||c<0||u<0||i.push({minRowIndex:Math.min(r,a),maxRowIndex:Math.max(r,a),minColumnIndex:Math.min(c,u),maxColumnIndex:Math.max(c,u),operation:s.operation??"include"})}const l=Ce(e,"getCellSelectionMergeBounds",jt);if(l.length)for(let e=0;e<i.length;e++){const t=i[e],n=Ot(t,l);t.minRowIndex=n.minRowIndex,t.maxRowIndex=n.maxRowIndex,t.minColumnIndex=n.minColumnIndex,t.maxColumnIndex=n.maxColumnIndex}return function(e){let t=[];for(const n of e){const e={minRowIndex:n.minRowIndex,maxRowIndex:n.maxRowIndex,minColumnIndex:n.minColumnIndex,maxColumnIndex:n.maxColumnIndex};t="exclude"===n.operation?Lt(t.flatMap(t=>At(t,e))):Pt(t,e)}return t.sort(Mt)}(i)}function Gt(e,t,n){for(let o=0;o<e.length;o++){const i=e[o];if(t>=i.minRowIndex&&t<=i.maxRowIndex&&n>=i.minColumnIndex&&n<=i.maxColumnIndex)return!0}return!1}function Kt(e){if(!1===e.column.columnDef.enableCellSelection)return!1;const t=e.table.options.enableCellSelection;return"function"==typeof t?t(e):t??!0}function Wt(e){const t=e.table,n=Ce(t,"getCellSelectionBounds",qt);if(!n.length)return null;if(!Ce(e,"getCanSelect",Kt))return null;const o=e.row.getDisplayIndex();if(o<0)return null;const i=Ce(t,"getCellSelectionColumnIndexes",Bt)[e.column.id]??-1;return i<0?null:{bounds:n,rowIndex:o,columnIndex:i}}function Ut(e){const t=Wt(e);return!!t&&Gt(t.bounds,t.rowIndex,t.columnIndex)}function Zt(e){const t=e.table.atoms.cellSelection?.get(),n=t?.[t.length-1];return!!n&&n.anchorRowId===e.row.id&&n.anchorColumnId===e.column.id}function Xt(e,t,n,o,i){for(let l=n;l<=o;l++)if(!Gt(e,i?t:l,i?l:t))return!0;return!1}function Yt(e,t,n){Jt(e,{anchorRowId:t,anchorColumnId:n,focusRowId:t,focusColumnId:n})}function Jt(e,t,n){const o=n?.mode??(n?.additive?"include":"replace"),{operation:i,...l}=t,s="exclude"===o?{...l,operation:"exclude"}:l;zt(e,e=>"replace"===o?[s]:[...e,s])}function Qt(e){const t=kt(e);return!1===e.options.enableCellSelection?[]:t.filter(e=>!1!==e.columnDef.enableCellSelection)}function en(e,t,n,o){const i=e.getRowModel().rows,l=kt(e);if(!i.length||!l.length)return null;const{rowDelta:s,columnDelta:r}=function(e){switch(e){case"up":return{rowDelta:-1,columnDelta:0};case"down":return{rowDelta:1,columnDelta:0};case"left":return{rowDelta:0,columnDelta:-1};default:return{rowDelta:0,columnDelta:1}}}(o),a=i.findIndex(e=>e.id===t),c=l.findIndex(e=>e.id===n);if(a<0||c<0)return null;const u=Ce(e,"getCellSelectionMergeBounds",jt);let d=i[a].getDisplayIndex(),g=c;if(u.length){const e=Nt(u,a,c);e&&(s>0&&(d=e.maxRowIndex),s<0&&(d=e.minRowIndex),r>0&&(g=e.maxColumnIndex),r<0&&(g=e.minColumnIndex))}let m=a+s;if(s&&d!==i[a].getDisplayIndex()){const e=i.findIndex(e=>e.getDisplayIndex()===d);if(e<0)return null;m=e+s}if(m<0||m>=i.length)return null;const f=new Set(Qt(e).map(e=>e.id));if(!f.size)return null;let h=g;if(r)do{h+=r}while(h>=0&&h<l.length&&!f.has(l[h].id));else if(!f.has(n))for(let e=1;e<l.length;e++){const t=l[c-e],n=l[c+e];if(t&&f.has(t.id)){h=c-e;break}if(n&&f.has(n.id)){h=c+e;break}}if(h<0||h>=l.length||!f.has(l[h].id))return null;let p=m,b=h;if(u.length){const e=Nt(u,i[m].getDisplayIndex(),h);if(e){if(p=i.findIndex(t=>t.getDisplayIndex()===e.minRowIndex),p<0)return null;b=e.minColumnIndex}}const _=i[p],w=l[b];return _&&w?{rowId:_.id,columnId:w.id}:null}function tn(e,t){const n=e.atoms.cellSelection?.get(),o=n?.[n.length-1];if(!o){const t=e.getRowModel().rows,n=Qt(e);if(!t.length||!n.length)return;return void Yt(e,t[0].id,n[0].id)}const i=en(e,o.anchorRowId,o.anchorColumnId,t);i&&Yt(e,i.rowId,i.columnId)}function nn(e,t,n=!1){const o=Ce(e,"getCellSelectionBounds",qt);if(!o.length)return;const i=e.getRowsInDisplayOrder(),l=kt(e);for(let e=0;e<o.length;e++){const s=o[e];for(let o=s.minRowIndex;o<=s.maxRowIndex;o++){const r=i[o];if(!r)continue;const a=r.getAllCellsByColumnId();for(let i=s.minColumnIndex;i<=s.maxColumnIndex;i++){const r=l[i];if(!r)continue;const c=a[r.id];c&&Ce(c,"getCanSelect",Kt)&&(n&&c.getIsCovered?.()||t(c,e,o-s.minRowIndex,i-s.minColumnIndex))}}}}function on(e){(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination)&&rn(e,!0)}function ln(e,t){return e.options.onPaginationChange?.(e=>ce(t,e))}function sn(e,t){ln(e,n=>{let o=ce(t,n.pageIndex);const i=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,i)),{...n,pageIndex:o}})}function rn(e,t){const n=e.atoms.pagination?.get()?.pageIndex??0,o=t?0:e.initialState.pagination?.pageIndex??0;o!==n&&sn(e,o)}function an(e,t){ln(e,e=>{const n=Math.max(1,ce(t,e.pageSize)),o=e.pageSize*e.pageIndex,i=Math.floor(o/n);return{...e,pageIndex:i,pageSize:n}})}function cn(e){return e.options.pageCount??Math.ceil(un(e)/(e.atoms.pagination?.get()?.pageSize??10))}function un(e){return e.options.rowCount??e.getPrePaginatedRowModel().rows.length}function dn(e,t){e.options.onSortingChange?.(t)}function gn(e,t){dn(e,t?[]:ue(e.initialState.sorting??[]))}function mn(e){const t=e.table._rowModelFns.sortFns,n=e.table.getFilteredRowModel().flatRows.slice(0,10);let o,i=!1;for(let t=0;t<n.length;t++){const l=n[t].getValue(e.id);if("[object Date]"===Object.prototype.toString.call(l)){o="datetime";break}if("string"==typeof l&&(i=!0,l.split(mt).length>1)){o="alphanumeric";break}}if(!o&&i&&(o="text"),o){let e=t?.[o];if(e||"alphanumeric"===o&&(e=t?.text),e)return e}return _t}function fn(e){const t=e.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n<t.length;n++){const o=t[n].getValue(e.id);if(null!=o)return"string"==typeof o?"asc":"desc"}return"desc"}function hn(e){const t=e.table._rowModelFns.sortFns;return he(e.columnDef.sortFn)?e.columnDef.sortFn:"auto"===e.columnDef.sortFn?mn(e):t?.[e.columnDef.sortFn]??_t}function pn(e,t,n){const o=_n(e,n&&vn(e)),i=void 0!==t;dn(e.table,l=>{const s=l.findIndex(t=>t.id===e.id),r=-1===s?void 0:l[s];let a,c=[];const u=i?t:"desc"===o,d=!!(l.length&&vn(e)&&n);return a=d?r?"toggle":"add":r?"toggle":"replace","toggle"===a&&(i||o||(a="remove")),"add"===a?(c=[...l,{id:e.id,desc:u}],c.splice(0,c.length-(e.table.options.maxMultiSortColCount??Number.MAX_SAFE_INTEGER))):c="toggle"===a?d?l.map(t=>t.id===e.id?{...t,desc:u}:t):[{id:e.id,desc:u}]:"remove"===a?d?l.filter(t=>t.id!==e.id):[]:[{id:e.id,desc:u}],c})}function bn(e){return e.columnDef.sortDescFirst??e.table.options.sortDescFirst??"desc"===fn(e)?"desc":"asc"}function _n(e,t){const n=bn(e),o=Cn(e);return o?!(o!==n&&(e.table.options.enableSortingRemoval??1)&&(!t||(e.table.options.enableMultiRemove??1)))&&("desc"===o?"asc":"desc"):n}function wn(e){return(e.columnDef.enableSorting??!0)&&(e.table.options.enableSorting??!0)&&!!e.accessorFn}function vn(e){return e.columnDef.enableMultiSort??e.table.options.enableMultiSort??!!e.accessorFn}function Cn(e){const t=e.table.atoms.sorting?.get()?.find(t=>t.id===e.id);return!!t&&(t.desc?"desc":"asc")}function Sn(){return e=>be({feature:"coreRowModelsFeature",table:e,fnName:"table.getCoreRowModel",memoDeps:()=>[e.options.data],fn:()=>function(e,t){const n={rows:[],flatRows:[],rowsById:ge()};return n.rows=yn(e,n,t),n}(e,e.options.data),onAfterUpdate:pe(()=>{(function(e){e.atoms.expanded&&(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding)&&e._reactivity.schedule(()=>function(e){const t=e.initialState.expanded;!function(e,t){e.options.onExpandedChange?.(t)}(e,!0===t||Object.assign(ge(),ue(t??{})))}(e))})(e),on(e),function(e){e.atoms.sorting&&(e.options.autoResetAll??e.options.autoResetSorting)&&gn(e)}(e),Tt(e)})})}function yn(e,t,n,o=0,i){const l=[];for(let s=0;s<n.length;s++){const r=n[s],a=gt(e,e.getRowId(r,s,i),r,s,o,void 0,i?.id);t.flatRows.push(a),t.rowsById[a.id]=a,l.push(a),e.options.getSubRows&&(a.originalSubRows=e.options.getSubRows(r,s),a.originalSubRows?.length&&(a.subRows=yn(e,t,a.originalSubRows,o+1,a)))}return l}function xn(e,t,n){const o=function(e){if(!e._cellPrototype){e._cellPrototype={table:e};const t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignCellPrototype?.(e._cellPrototype,e)}return e._cellPrototype}(n),i=Object.create(o);i.column=e,i.id=`${t.id}_${e.id}`,i.row=t;const l=n._cellInstanceInitFns;for(let e=0;e<l.length;e++)l[e](i);return i}function In(e,t,n=(e,t)=>e===t){const o=void 0===t?e.options.state:t;e._reactivity.batch(()=>{if(o)for(const t in o){const i=e.baseAtoms[t];if(!i)continue;const l=o[t],s=void 0===l?e.initialState[t]:l;n(e._reactivity.untrack(()=>i.get()),s)||i.set(()=>s)}})}const Rn={coreCellsFeature:Se,coreColumnsFeature:at,coreHeadersFeature:dt,coreRowModelsFeature:{constructTableAPIs:e=>{we("coreRowModelsFeature",e,{table_getCoreRowModel:{fn:()=>function(e){return e._rowModels.coreRowModel||(e._rowModels.coreRowModel=e.options.features.coreRowModel?.(e)??Sn()(e)),e._rowModels.coreRowModel()}(e)},table_getPreFilteredRowModel:{fn:()=>function(e){return e.getCoreRowModel()}(e)},table_getFilteredRowModel:{fn:()=>function(e){return e._rowModels.filteredRowModel||(e._rowModels.filteredRowModel=e.options.features.filteredRowModel?.(e)),e.options.manualFiltering||!e._rowModels.filteredRowModel?e.getPreFilteredRowModel():e._rowModels.filteredRowModel()}(e)},table_getPreGroupedRowModel:{fn:()=>function(e){return e.getFilteredRowModel()}(e)},table_getGroupedRowModel:{fn:()=>function(e){return e._rowModels.groupedRowModel||(e._rowModels.groupedRowModel=e.options.features.groupedRowModel?.(e)),e.options.manualGrouping||!e._rowModels.groupedRowModel?e.getPreGroupedRowModel():e._rowModels.groupedRowModel()}(e)},table_getPreSortedRowModel:{fn:()=>function(e){return e.getGroupedRowModel()}(e)},table_getSortedRowModel:{fn:()=>function(e){return e._rowModels.sortedRowModel||(e._rowModels.sortedRowModel=e.options.features.sortedRowModel?.(e)),e.options.manualSorting||!e._rowModels.sortedRowModel?e.getPreSortedRowModel():e._rowModels.sortedRowModel()}(e)},table_getPreExpandedRowModel:{fn:()=>function(e){return e.getSortedRowModel()}(e)},table_getExpandedRowModel:{fn:()=>function(e){return e._rowModels.expandedRowModel||(e._rowModels.expandedRowModel=e.options.features.expandedRowModel?.(e)),e.options.manualExpanding||!e._rowModels.expandedRowModel?e.getPreExpandedRowModel():e._rowModels.expandedRowModel()}(e)},table_getPrePaginatedRowModel:{fn:()=>function(e){return e.getExpandedRowModel()}(e)},table_getPaginatedRowModel:{fn:()=>function(e){return e._rowModels.paginatedRowModel||(e._rowModels.paginatedRowModel=e.options.features.paginatedRowModel?.(e)),e.options.manualPagination||!e._rowModels.paginatedRowModel?e.getPrePaginatedRowModel():e._rowModels.paginatedRowModel()}(e)},table_getRowModel:{fn:()=>function(e){return e.getPaginatedRowModel()}(e)}})}},coreRowsFeature:{assignRowPrototype:(e,t)=>{ve("coreRowsFeature",e,t,{row_getDisplayIndex:{fn:e=>function(e){const t=e.table.getRowsInDisplayOrder(),n=e._displayIndexCache;return t[n]===e?n:-1}(e)},row_getAllCellsByColumnId:{fn:e=>function(e){const t=ge(),n=e.getAllCells();for(let e=0;e<n.length;e++){const o=n[e];t[o.column.id]=o}return t}(e),memoDeps:e=>[e.getAllCells()]},row_getAllCells:{fn:e=>function(e){const t=e.table.getAllLeafColumns();let n=e._cellsCache;n||(n=e._cellsCache=new WeakMap);const o=new Array(t.length);for(let i=0;i<t.length;i++){const l=t[i];let s=n.get(l);s||(s=xn(l,e,e.table),n.set(l,s)),o[i]=s}return o}(e),memoDeps:e=>[e.table.getAllLeafColumns()]},row_getLeafRows:{fn:e=>function(e){return function(e){const t=[],n=e=>{e.forEach(e=>{t.push(e);const o=e.subRows;o.length&&n(o)})};return n(e),t}(e.subRows)}(e),memoDeps:e=>[e.subRows]},row_getParentRow:{fn:e=>function(e){if(e.parentId)return e.table.getCoreRowModel().rowsById[e.parentId]??e.table.getRow(e.parentId,!0)}(e)},row_getParentRows:{fn:e=>function(e){const t=[];let n=e;for(;;){const e=n.getParentRow();if(!e)break;t.push(e),n=e}return t.reverse()}(e)},row_getUniqueValues:{fn:(e,t)=>function(e,t){if(me(e._uniqueValuesCache,t))return e._uniqueValuesCache[t];const n=e.table.getColumn(t);return n?.accessorFn?n.columnDef.getUniqueValues?(e._uniqueValuesCache[t]=n.columnDef.getUniqueValues(e.original,e.index),e._uniqueValuesCache[t]):(e._uniqueValuesCache[t]=[e.getValue(t)],e._uniqueValuesCache[t]):void 0}(e,t)},row_getValue:{fn:(e,t)=>function(e,t){if(me(e._valuesCache,t))return e._valuesCache[t];const n=e.table.getColumn(t);return n?.accessorFn?(e._valuesCache[t]=n.accessorFn(e.original,e.index),e._valuesCache[t]):void 0}(e,t)},row_renderValue:{fn:(e,t)=>function(e,t){return e.getValue(t)??e.table.options.renderFallbackValue}(e,t)}})},constructTableAPIs:e=>{we("coreRowsFeature",e,{table_getRowsInDisplayOrder:{fn:()=>function(e){const t=e.getPrePaginatedRowModel().rows;if(!1===e.options.paginateExpandedRows){const e=[],n=t=>{t._displayIndexCache=e.length,e.push(t),t.subRows.length&&t.getIsExpanded?.()&&t.subRows.forEach(n)};return t.forEach(n),e}for(let e=0;e<t.length;e++)t[e]._displayIndexCache=e;return t}(e),memoDeps:()=>[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,!1===e.options.paginateExpandedRows?e.atoms.expanded?.get():void 0]},table_getRowId:{fn:(t,n,o)=>function(e,t,n,o){return t.options.getRowId?.(e,n,o)??(o?`${o.id}.${n}`:String(n))}(t,e,n,o)},table_getRow:{fn:(t,n)=>function(e,t,n){let o=(n?e.getPrePaginatedRowModel():e.getRowModel()).rowsById[t];if(!o&&(o=e.getCoreRowModel().rowsById[t],!o))throw new Error;return o}(e,t,n)},table_getMaxSubRowDepth:{fn:()=>function(e){const t=e.getCoreRowModel().flatRows;let n=0;for(let e=0;e<t.length;e++)n=Math.max(n,t[e].depth);return n}(e),memoDeps:()=>[e.getCoreRowModel()]}})}},coreTablesFeature:{constructTableAPIs:e=>{we("coreTablesFeature",e,{table_reset:{fn:()=>function(e){const t=ue(e.initialState);e._reactivity.batch(()=>{const n=Object.keys(t);for(let o=0;o<n.length;o++){const i=n[o];e.baseAtoms[i].set(t[i])}});const n=Object.values(e._features);for(let t=0;t<n.length;t++)n[t].resetTableInstanceData?.(e)}(e)},table_setOptions:{fn:t=>function(e,t,n){const o=function(e,t){const{features:n,atoms:o,initialState:i}=e.options;if(!e.options.mergeOptions)return{...e.options,...t,features:n,atoms:o,initialState:i};const l=e.options.mergeOptions(e.options,t),s={...Object.getOwnPropertyDescriptors(l)};return Object.defineProperties(Object.create(Object.getPrototypeOf(l)),{...s,features:{value:n,enumerable:!0,configurable:!0,writable:!0},atoms:{value:o,enumerable:!0,configurable:!0,writable:!0},initialState:{value:i,enumerable:!0,configurable:!0,writable:!0}})}(e,ce(t,e.options));e.optionsStore?e.optionsStore.set(()=>o):e.options=o,!1!==n?.syncExternalState&&function(e,t,n=(e,t)=>e===t){e._reactivity.batch(()=>{In(e,t,n),e._reactivity.commit?.()})}(e,o.state??null)}(e,t)}})}}};const En={initTableInstanceData:e=>{e._isSelectingCells=!1},resetTableInstanceData:e=>{e._isSelectingCells=!1},getInitialState:e=>({cellSelection:[],...e}),getDefaultTableOptions:e=>({onCellSelectionChange:fe("cellSelection",e),autoResetCellSelection:!0,enableCellSelection:!0,enableCellRangeSelection:!0,enableMultiCellRangeSelection:!0,enableCellSelectionDrag:!0,isCellRangeSelectionEvent:e=>{const t=e;return Boolean(t.shiftKey||t.nativeEvent?.shiftKey)},isMultiCellRangeSelectionEvent:e=>{const t=e;return Boolean(t.ctrlKey||t.metaKey||t.nativeEvent?.ctrlKey||t.nativeEvent?.metaKey)}}),assignCellPrototype:(e,t)=>{ve("cellSelectionFeature",e,t,{cell_getCanSelect:{fn:e=>Kt(e)},cell_getIsSelected:{fn:e=>Ut(e)},cell_getIsFocused:{fn:e=>Zt(e)},cell_getTabIndex:{fn:e=>function(e){return Ce(e,"getIsFocused",Zt)?0:-1}(e)},cell_getSelectionEdges:{fn:e=>function(e){const t={top:!1,right:!1,bottom:!1,left:!1},n=Wt(e);if(!n)return t;const{bounds:o,rowIndex:i,columnIndex:l}=n;if(!Gt(o,i,l))return t;const s=Ce(e.table,"getCellSelectionMergeBounds",jt),r=s.length?Nt(s,i,l):void 0;return r?{top:Xt(o,r.minRowIndex-1,r.minColumnIndex,r.maxColumnIndex,!0),right:Xt(o,r.maxColumnIndex+1,r.minRowIndex,r.maxRowIndex,!1),bottom:Xt(o,r.maxRowIndex+1,r.minColumnIndex,r.maxColumnIndex,!0),left:Xt(o,r.minColumnIndex-1,r.minRowIndex,r.maxRowIndex,!1)}:{top:!Gt(o,i-1,l),right:!Gt(o,i,l+1),bottom:!Gt(o,i+1,l),left:!Gt(o,i,l-1)}}(e)},cell_getSelectionStartHandler:{fn:(e,t)=>function(e,t){const n=Kt(e);return o=>{if(!n)return;const i=e.table,l=i.options,s=t??("undefined"!=typeof document?document:null),r=!1!==l.enableCellRangeSelection&&(l.isCellRangeSelectionEvent?.(o)??!1),a=!1!==l.enableMultiCellRangeSelection&&(l.isMultiCellRangeSelectionEvent?.(o)??!1);if(!1!==l.enableCellSelectionDrag&&!1!==l.enableCellRangeSelection&&s){i._isSelectingCells=!0;const e=()=>{s.removeEventListener("mouseup",e),i._isSelectingCells=!1};s.addEventListener("mouseup",e)}const c=e.row.id,u=e.column.id,d=a&&Ce(e,"getIsSelected",Ut);zt(i,e=>{const t=e[e.length-1];if(r&&t){const n=e.slice(0,-1);return n.push({...t,focusRowId:c,focusColumnId:u}),n}const n={anchorRowId:c,anchorColumnId:u,focusRowId:c,focusColumnId:u,...d?{operation:"exclude"}:{}};return a?[...e,n]:[n]})}}(e,t)},cell_getSelectionExtendHandler:{fn:e=>function(e){const t=Kt(e);return n=>{if(!t)return;const o=e.table;if(!o._isSelectingCells)return;const i=o.atoms.cellSelection?.get(),l=i?.[i.length-1];if(!l)return;const s=e.row.id,r=e.column.id;l.focusRowId===s&&l.focusColumnId===r||zt(o,e=>{if(!e.length)return e;const t=e.slice(0,-1);return t.push({...e[e.length-1],focusRowId:s,focusColumnId:r}),t})}}(e)}})},constructTableAPIs:e=>{we("cellSelectionFeature",e,{table_setCellSelection:{fn:t=>zt(e,t)},table_resetCellSelection:{fn:t=>Vt(e,t)},table_autoResetCellSelection:{fn:()=>Tt(e)},table_getCellSelectionColumnIndexes:{fn:()=>Bt(e),memoDeps:()=>[e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.columnPinning?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getCellSelectionMergeBounds:{fn:()=>jt(e),memoDeps:()=>[e.getCellSpanIndex?.(),e.getRowsInDisplayOrder(),Ce(e,"getCellSelectionColumnIndexes",Bt)]},table_getCellSelectionBounds:{fn:()=>qt(e),memoDeps:()=>[e.atoms.cellSelection?.get(),e.getRowsInDisplayOrder(),Ce(e,"getCellSelectionColumnIndexes",Bt),Ce(e,"getCellSelectionMergeBounds",jt)]},table_selectCellRange:{fn:(t,n)=>Jt(e,t,n)},table_selectAllCells:{fn:()=>function(e){const t=e.getRowsInDisplayOrder(),n=Qt(e);t.length&&n.length&&Jt(e,{anchorRowId:t[0].id,anchorColumnId:n[0].id,focusRowId:t[t.length-1].id,focusColumnId:n[n.length-1].id})}(e)},table_setFocusedCell:{fn:(t,n)=>Yt(e,t,n)},table_getFocusedCell:{fn:()=>function(e){const t=e.atoms.cellSelection?.get(),n=t?.[t.length-1];if(n)return(e.getPrePaginatedRowModel().rowsById[n.anchorRowId]??e.getCoreRowModel().rowsById[n.anchorRowId])?.getAllCellsByColumnId()[n.anchorColumnId]}(e)},table_moveCellSelection:{fn:t=>tn(e,t)},table_extendCellSelection:{fn:t=>function(e,t){const n=e.atoms.cellSelection?.get(),o=n?.[n.length-1];if(!o)return void tn(e,t);const i=en(e,o.focusRowId,o.focusColumnId,t);i&&zt(e,e=>{if(!e.length)return e;const t=e.slice(0,-1);return t.push({...e[e.length-1],focusRowId:i.rowId,focusColumnId:i.columnId}),t})}(e,t)},table_getSelectedCellIds:{fn:()=>function(e){const t=[],n=new Set;return nn(e,e=>{n.has(e.id)||(n.add(e.id),t.push(e.id))},!0),t}(e),memoDeps:()=>[Ce(e,"getCellSelectionBounds",qt),Ce(e,"getCellSelectionMergeBounds",jt),e.getRowsInDisplayOrder(),e.options.enableCellSelection]},table_getSelectedCellRangesData:{fn:()=>function(e){const t=[];return nn(e,(e,n,o)=>{const i=t[n]??=[];(i[o]??=[]).push(e.getValue())}),t}(e),memoDeps:()=>[Ce(e,"getCellSelectionBounds",qt),e.getRowsInDisplayOrder(),e.options.enableCellSelection]},table_getSelectedCellCount:{fn:()=>function(e){if(!1===e.options.enableCellSelection)return 0;const t=Ce(e,"getCellSelectionBounds",qt);if(!t.length)return 0;const n=Ce(e,"getCellSelectionMergeBounds",jt);if("function"==typeof e.options.enableCellSelection||n.length){const t=new Set;return nn(e,e=>t.add(e.id),!0),t.size}const o=kt(e);let i=0;for(const e of t){let t=0;for(let n=e.minColumnIndex;n<=e.maxColumnIndex;n++){const e=o[n];e&&!1!==e.columnDef.enableCellSelection&&t++}i+=(e.maxRowIndex-e.minRowIndex+1)*t}return i}(e),memoDeps:()=>[Ce(e,"getCellSelectionBounds",qt),Ce(e,"getCellSelectionMergeBounds",jt),e.getRowsInDisplayOrder(),e.options.enableCellSelection]},table_getCellSelectionRowIds:{fn:()=>function(e){const t=Ce(e,"getCellSelectionBounds",qt);if(!t.length)return[];const n=e.getRowsInDisplayOrder(),o=new Set,i=[];for(let e=0;e<t.length;e++){const l=t[e];for(let e=l.minRowIndex;e<=l.maxRowIndex;e++){const t=n[e];t&&!o.has(t.id)&&(o.add(t.id),i.push(t.id))}}return i}(e),memoDeps:()=>[Ce(e,"getCellSelectionBounds",qt),e.getRowsInDisplayOrder()]},table_getCellSelectionColumnIds:{fn:()=>function(e){const t=Ce(e,"getCellSelectionBounds",qt);if(!t.length)return[];const n=kt(e),o=new Set,i=[];for(let e=0;e<t.length;e++){const l=t[e];for(let e=l.minColumnIndex;e<=l.maxColumnIndex;e++){const t=n[e];t&&!o.has(t.id)&&!1!==t.columnDef.enableCellSelection&&(o.add(t.id),i.push(t.id))}}return i}(e),memoDeps:()=>[Ce(e,"getCellSelectionBounds",qt)]}})}};function Mn(e,t){const n=e?.id??"",o=t._rowModels.facetedRowModels??=ge();let i=o[n];return i||(i=o[n]=t.options.features.facetedRowModel?.(t,n)??(()=>t.getPreFilteredRowModel())),i()}function Fn(){const e=new Map;return()=>e}function An(e){return e._rowModels.globalFacetedRowModel||(e._rowModels.globalFacetedRowModel=e.options.features.facetedRowModel?.(e,"__global__")??(()=>e.getPreFilteredRowModel())),(0,e._rowModels.globalFacetedRowModel)()}const Dn={assignColumnPrototype:(e,t)=>{ve("columnFacetingFeature",e,t,{column_getFacetedRowModel:{fn:e=>Mn(e,e.table)},column_getFacetedMinMaxValues:{fn:e=>function(e,t){const n=t._rowModels.facetedMinMaxValues??=ge();let o=n[e.id];return o||(o=n[e.id]=t.options.features.facetedMinMaxValues?.(t,e.id)??(()=>{})),o()}(e,e.table)},column_getFacetedUniqueValues:{fn:e=>function(e,t){const n=t._rowModels.facetedUniqueValues??=ge();let o=n[e.id];return o||(o=n[e.id]=t.options.features.facetedUniqueValues?.(t,e.id)??Fn()),o()}(e,e.table)}})},constructTableAPIs:e=>{we("columnFacetingFeature",e,{table_getGlobalFacetedRowModel:{fn:()=>An(e)},table_getGlobalFacetedMinMaxValues:{fn:()=>function(e){return e._rowModels.globalFacetedMinMaxValues||(e._rowModels.globalFacetedMinMaxValues=e.options.features.facetedMinMaxValues?.(e,"__global__")??(()=>{})),(0,e._rowModels.globalFacetedMinMaxValues)()}(e)},table_getGlobalFacetedUniqueValues:{fn:()=>function(e){return e._rowModels.globalFacetedUniqueValues||(e._rowModels.globalFacetedUniqueValues=e.options.features.facetedUniqueValues?.(e,"__global__")??Fn()),(0,e._rowModels.globalFacetedUniqueValues)()}(e)}})}};function Ln(e){const t=e.table._rowModelFns.filterFns,n=e.table.getCoreRowModel().flatRows;let o,i;for(let t=0;t<n.length;t++){const i=n[t].getValue(e.id);if(null!=i){o=i;break}}return i="string"==typeof o?"includesString":"number"==typeof o?"inNumberRange":"boolean"==typeof o?"equals":Array.isArray(o)?"arrIncludes":"[object Date]"===Object.prototype.toString.call(o)?"inDateRange":null!==o&&"object"==typeof o?"equals":"weakEquals",t?.[i]}function Pn(e){let t=null;const n=e.table._rowModelFns.filterFns;return t=he(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?Ln(e):n?.[e.columnDef.filterFn],t??void 0}function On(e){return e.table.atoms.columnFilters?.get()?.findIndex(t=>t.id===e.id)??-1}function zn(e,t){const n=e.getAllLeafColumnsById();e.options.onColumnFiltersChange?.(e=>ce(t,e).filter(e=>{const t=n[e.id];return!t||!Vn(Pn(t),e.value,t)}))}function Vn(e,t,n){return void 0===t||(e?.autoRemove?!!e.autoRemove(t,n):"string"==typeof t&&!t)}const Tn={getInitialState:e=>({columnFilters:[],...e}),getDefaultColumnDef:()=>({filterFn:"auto"}),getDefaultTableOptions:e=>({onColumnFiltersChange:fe("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),assignColumnPrototype:(e,t)=>{ve("columnFilteringFeature",e,t,{column_getAutoFilterFn:{fn:e=>Ln(e)},column_getFilterFn:{fn:e=>Pn(e)},column_getCanFilter:{fn:e=>function(e){return(e.columnDef.enableColumnFilter??!0)&&(e.table.options.enableColumnFilters??!0)&&(e.table.options.enableFilters??!0)&&!!e.accessorFn}(e)},column_getIsFiltered:{fn:e=>function(e){return On(e)>-1}(e)},column_getFilterValue:{fn:e=>function(e){return e.table.atoms.columnFilters?.get()?.find(t=>t.id===e.id)?.value}(e)},column_getFilterIndex:{fn:e=>On(e)},column_setFilterValue:{fn:(e,t)=>function(e,t){zn(e.table,n=>{const o=Pn(e),i=n.find(t=>t.id===e.id),l=ce(t,i?i.value:void 0);if(Vn(o,l,e))return n.filter(t=>t.id!==e.id);const s={id:e.id,value:l};return i?n.map(t=>t.id===e.id?s:t):n.length?[...n,s]:[s]})}(e,t)}})},initRowInstanceData:e=>{e.columnFilters=ge(),e.columnFiltersMeta=ge()},constructTableAPIs:e=>{we("columnFilteringFeature",e,{table_setColumnFilters:{fn:t=>zn(e,t)},table_resetColumnFilters:{fn:t=>function(e,t){zn(e,t?[]:ue(e.initialState.columnFilters??[]))}(e,t)}})}},kn={getInitialState:e=>({columnOrder:[],...e}),getDefaultTableOptions:e=>({onColumnOrderChange:fe("columnOrder",e)}),assignColumnPrototype:(e,t)=>{ve("columnOrderingFeature",e,t,{column_getIndex:{fn:(e,t)=>function(e,t){return Ce(e.table,"getColumnIndexes",nt)["start"===t?"start":"end"===t?"end":"center"===t?"center":"all"][e.id]??-1}(e,t)},column_getIsFirstColumn:{fn:(e,t)=>function(e,t){return ke(e.table,t)[0]?.id===e.id}(e,t)},column_getIsLastColumn:{fn:(e,t)=>function(e,t){const n=ke(e.table,t);return n[n.length-1]?.id===e.id}(e,t)}})},constructTableAPIs:e=>{we("columnOrderingFeature",e,{table_getColumnIndexes:{fn:()=>nt(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_setColumnOrder:{fn:t=>ot(e,t)},table_resetColumnOrder:{fn:t=>function(e,t){ot(e,t?[]:ue(e.initialState.columnOrder??[]))}(e,t)},table_getOrderColumnsFn:{fn:()=>it(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]}})}},Bn={getInitialState:e=>({columnPinning:{start:[],end:[],...e.columnPinning},...e}),getDefaultTableOptions:e=>({onColumnPinningChange:fe("columnPinning",e)}),assignColumnPrototype:(e,t)=>{ve("columnPinningFeature",e,t,{column_pin:{fn:(e,t)=>function(e,t){const n=e.getLeafColumns(),o=[];for(let e=0;e<n.length;e++){const t=n[e].id;t&&o.push(t)}Ie(e.table,e=>"end"===t?{start:e.start.filter(e=>!o.includes(e)),end:[...e.end.filter(e=>!o.includes(e)),...o]}:"start"===t?{start:[...e.start.filter(e=>!o.includes(e)),...o],end:e.end.filter(e=>!o.includes(e))}:{start:e.start.filter(e=>!o.includes(e)),end:e.end.filter(e=>!o.includes(e))})}(e,t)},column_getCanPin:{fn:e=>function(e){return e.getLeafColumns().some(t=>(t.columnDef.enablePinning??!0)&&(e.table.options.enableColumnPinning??!0))}(e)},column_getPinnedIndex:{fn:e=>function(e){const t=xe(e);return t?e.table.atoms.columnPinning?.get()?.[t].indexOf(e.id)??-1:0}(e)},column_getIsPinned:{fn:e=>xe(e)}})},assignRowPrototype:(e,t)=>{ve("columnPinningFeature",e,t,{row_getCenterVisibleCells:{fn:e=>function(e){const t=Ce(e,"getVisibleCells",Ne),{start:n,end:o}=e.table.atoms.columnPinning?.get()??{start:[],end:[]};if(!n.length&&!o.length)return t;const i=[...n,...o];return t.filter(e=>!i.includes(e.column.id))}(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get(),e.table.atoms.columnVisibility?.get()]},row_getStartVisibleCells:{fn:e=>function(e){const{start:t}=e.table.atoms.columnPinning?.get()??{start:[],end:[]};if(!t.length)return[];const n=Ce(e,"getVisibleCellsByColumnId",$e),o=[];for(let e=0;e<t.length;e++){const i=n[t[e]];i&&(i.position="start",o.push(i))}return o}(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get()?.start,e.table.atoms.columnVisibility?.get()]},row_getEndVisibleCells:{fn:e=>function(e){const{end:t}=e.table.atoms.columnPinning?.get()??{start:[],end:[]};if(!t.length)return[];const n=Ce(e,"getVisibleCellsByColumnId",$e),o=[];for(let e=0;e<t.length;e++){const i=n[t[e]];i&&(i.position="end",o.push(i))}return o}(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get()?.end,e.table.atoms.columnVisibility?.get()]}})},constructTableAPIs:e=>{we("columnPinningFeature",e,{table_setColumnPinning:{fn:t=>Ie(e,t)},table_resetColumnPinning:{fn:t=>function(e,t){Ie(e,t?{start:[],end:[]}:ue(e.initialState.columnPinning??{start:[],end:[]}))}(e,t)},table_getIsSomeColumnsPinned:{fn:t=>function(e,t){const n=e.atoms.columnPinning?.get();return t?Boolean(n?.[t].length):Boolean(n?.start.length||n?.end.length)}(e,t)},table_getStartHeaderGroups:{fn:()=>Re(e),memoDeps:()=>[e.getAllColumns(),Ce(e,"getVisibleLeafColumns",qe),e.atoms.columnPinning?.get()?.start,e.atoms.columnOrder?.get()]},table_getCenterHeaderGroups:{fn:()=>Me(e),memoDeps:()=>[e.getAllColumns(),Ce(e,"getVisibleLeafColumns",qe),e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get()]},table_getEndHeaderGroups:{fn:()=>Ee(e),memoDeps:()=>[e.getAllColumns(),Ce(e,"getVisibleLeafColumns",qe),e.atoms.columnPinning?.get()?.end,e.atoms.columnOrder?.get()]},table_getStartFooterGroups:{fn:()=>function(e){return[...Ce(e,"getStartHeaderGroups",Re)].reverse()}(e),memoDeps:()=>[Ce(e,"getStartHeaderGroups",Re)]},table_getCenterFooterGroups:{fn:()=>function(e){return[...Ce(e,"getCenterHeaderGroups",Me)].reverse()}(e),memoDeps:()=>[Ce(e,"getCenterHeaderGroups",Me)]},table_getEndFooterGroups:{fn:()=>function(e){return[...Ce(e,"getEndHeaderGroups",Ee)].reverse()}(e),memoDeps:()=>[Ce(e,"getEndHeaderGroups",Ee)]},table_getStartFlatHeaders:{fn:()=>Fe(e),memoDeps:()=>[Ce(e,"getStartHeaderGroups",Re)]},table_getEndFlatHeaders:{fn:()=>Ae(e),memoDeps:()=>[Ce(e,"getEndHeaderGroups",Ee)]},table_getCenterFlatHeaders:{fn:()=>De(e),memoDeps:()=>[Ce(e,"getCenterHeaderGroups",Me)]},table_getStartLeafHeaders:{fn:()=>function(e){return Ce(e,"getStartFlatHeaders",Fe).filter(e=>!e.subHeaders.length)}(e),memoDeps:()=>[Ce(e,"getStartHeaderGroups",Re)]},table_getEndLeafHeaders:{fn:()=>function(e){return Ce(e,"getEndFlatHeaders",Ae).filter(e=>!e.subHeaders.length)}(e),memoDeps:()=>[Ce(e,"getEndHeaderGroups",Ee)]},table_getCenterLeafHeaders:{fn:()=>function(e){return Ce(e,"getCenterFlatHeaders",De).filter(e=>!e.subHeaders.length)}(e),memoDeps:()=>[Ce(e,"getCenterHeaderGroups",Me)]},table_getStartLeafColumns:{fn:()=>Le(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getEndLeafColumns:{fn:()=>Pe(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getCenterLeafColumns:{fn:()=>Oe(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getPinnedLeafColumns:{fn:t=>function(e,t){return t?"start"===t?Ce(e,"getStartLeafColumns",Le):"end"===t?Ce(e,"getEndLeafColumns",Pe):Ce(e,"getCenterLeafColumns",Oe):e.getAllLeafColumns()}(e,t)},table_getStartVisibleLeafColumns:{fn:()=>ze(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getCenterVisibleLeafColumns:{fn:()=>Te(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getEndVisibleLeafColumns:{fn:()=>Ve(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getPinnedVisibleLeafColumns:{fn:t=>ke(e,t)}})}};function Hn(){return{size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER}}function jn(e){const t=Hn(),n=e.table.atoms.columnSizing?.get(),o=n&&me(n,e.id)?n[e.id]:void 0;return Math.min(Math.max(e.columnDef.minSize??t.minSize,o??e.columnDef.size??t.size),e.columnDef.maxSize??t.maxSize)}function Nn(e){const t=ge(),n=ge(),o=new Array(e.length);let i=0;for(let n=0;n<e.length;n++){const l=e[n],s=Ce(l,"getSize",jn);o[n]=s,t[l.id]=i,i+=s}let l=0;for(let t=e.length-1;t>=0;t--)n[e[t].id]=l,l+=o[t];return{starts:t,afters:n}}function $n(e){return{all:Nn(ke(e)),center:Nn(ke(e,"center")),start:Nn(ke(e,"start")),end:Nn(ke(e,"end"))}}function qn(e){return"start"===e?"start":"end"===e?"end":"center"===e?"center":"all"}function Gn(e){if(!e.subHeaders.length)return jn(e.column);let t=0;for(let n=0;n<e.subHeaders.length;n++)t+=Gn(e.subHeaders[n]);return t}function Kn(e){return Gn(e)}function Wn(e){if(e.index>0){const t=e.headerGroup?.headers[e.index-1];if(t)return Ce(t,"getStart",Wn)+Ce(t,"getSize",Kn)}return 0}function Un(e,t){e.options.onColumnSizingChange?.(t)}function Zn(e){return(e.columnDef.enableResizing??!0)&&(e.table.options.enableColumnResizing??!0)}function Xn(e,t){e.options.onColumnResizingChange?.(t)}let Yn=null;function Jn(e){return"touchstart"===e.type}const Qn={getInitialState:e=>({columnResizing:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultTableOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnResizingChange:fe("columnResizing",e)}),assignColumnPrototype:(e,t)=>{ve("columnResizingFeature",e,t,{column_getCanResize:{fn:e=>Zn(e)},column_getIsResizing:{fn:e=>function(e){return e.table.atoms.columnResizing?.get()?.isResizingColumn===e.id}(e)}})},assignHeaderPrototype:(e,t)=>{ve("columnResizingFeature",e,t,{header_getResizeHandler:{fn:(e,t)=>function(e,t){const n=e.table.getColumn(e.column.id),o=Zn(n);return i=>{if(!o)return;if(Jn(i)&&i.touches.length>1)return;const l=Kn(e),s=e.getLeafHeaders().map(e=>[e.column.id,jn(e.column)]),r=Jn(i)?Math.round(i.touches[0].clientX):i.clientX,a=ge(),c=(e,t)=>{if("number"!=typeof t)return;const o=n.table,i="onChange"===o.options.columnResizeMode||"end"===e;o._reactivity.batch(()=>{Xn(o,e=>{const n="rtl"===o.options.columnResizeDirection?-1:1,l=(t-(e.startOffset??0))*n,s=e.startSize??0,r=Math.max(s>0?l/s:0,-.999999);if(i){const t=e.columnSizingStart;for(let e=0;e<t.length;e++){const n=t[e],o=n[1];a[n[0]]=Math.round(100*Math.max(o>0?o+o*r:l/t.length,0))/100}}return{...e,deltaOffset:l,deltaPercentage:r}}),i&&Un(o,e=>Object.assign(ge(),e,a))})};let u,d=null,g=!1;const m=()=>{g?(g=!1,c("move",u),d=requestAnimationFrame(m)):d=null},f=e=>{u=e,"function"==typeof requestAnimationFrame?null===d?(c("move",e),d=requestAnimationFrame(m)):g=!0:c("move",e)},h=e=>{null!==d&&(cancelAnimationFrame(d),d=null,g=!1),n.table._reactivity.batch(()=>{c("end",e??u),Xn(n.table,e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))})},p=t||("undefined"!=typeof document?document:null),b={moveHandler:e=>f(e.clientX),upHandler:e=>{p?.removeEventListener("mousemove",b.moveHandler),p?.removeEventListener("mouseup",b.upHandler),h(e.clientX)}},_=e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0].clientX),!1),w=e=>{C(),e.cancelable&&(e.preventDefault(),e.stopPropagation()),h(e.touches[0]?.clientX)},v=()=>{C(),h()},C=()=>{p?.removeEventListener("touchmove",_),p?.removeEventListener("touchend",w),p?.removeEventListener("touchcancel",v)},S=!!function(){if("boolean"==typeof Yn)return Yn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return Yn=e,Yn}()&&{passive:!1};Jn(i)?(p?.addEventListener("touchmove",_,S),p?.addEventListener("touchend",w,S),p?.addEventListener("touchcancel",v,S)):(p?.addEventListener("mousemove",b.moveHandler,S),p?.addEventListener("mouseup",b.upHandler,S)),Xn(n.table,e=>({...e,startOffset:r,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:n.id}))}}(e,t)}})},constructTableAPIs:e=>{we("columnResizingFeature",e,{table_setColumnResizing:{fn:t=>Xn(e,t)},table_resetHeaderSizeInfo:{fn:t=>function(e,t){Xn(e,t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:ue(e.initialState.columnResizing??{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}))}(e,t)}})}},eo={getInitialState:e=>({columnSizing:ge(),...e}),getDefaultColumnDef:()=>Hn(),getDefaultTableOptions:e=>({onColumnSizingChange:fe("columnSizing",e)}),assignColumnPrototype:(e,t)=>{ve("columnSizingFeature",e,t,{column_getSize:{fn:e=>jn(e),memoDeps:e=>[t.options.columns,t.atoms.columnSizing?.get()?.[e.id]]},column_getStart:{fn:(e,t)=>function(e,t){return Ce(e.table,"getColumnOffsets",$n)[qn(t)].starts[e.id]??0}(e,t)},column_getAfter:{fn:(e,t)=>function(e,t){return Ce(e.table,"getColumnOffsets",$n)[qn(t)].afters[e.id]??0}(e,t)},column_resetSize:{fn:e=>function(e){Un(e.table,t=>{const n=ge(),o=Object.keys(t);for(let i=0;i<o.length;i++){const l=o[i];l!==e.id&&(n[l]=t[l])}return n})}(e)}})},assignHeaderPrototype:(e,t)=>{ve("columnSizingFeature",e,t,{header_getSize:{fn:e=>Kn(e),memoDeps:e=>[t.options.columns,e.column.columns.length>0?t.atoms.columnSizing?.get():t.atoms.columnSizing?.get()?.[e.column.id]]},header_getStart:{fn:e=>Wn(e),memoDeps:()=>[t.options.columns,t.atoms.columnSizing?.get(),t.atoms.columnOrder?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode]}})},constructTableAPIs:e=>{we("columnSizingFeature",e,{table_getColumnOffsets:{fn:()=>$n(e),memoDeps:()=>[e.options.columns,e.atoms.columnSizing?.get(),e.atoms.columnOrder?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_setColumnSizing:{fn:t=>Un(e,t)},table_resetColumnSizing:{fn:t=>function(e,t){Un(e,t?ge():Object.assign(ge(),ue(e.initialState.columnSizing??{})))}(e,t)},table_getTotalSize:{fn:()=>function(e){return e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+Kn(t),0)??0}(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getStartTotalSize:{fn:()=>function(e){return Ce(e,"getStartHeaderGroups",Re)[0]?.headers.reduce((e,t)=>e+Kn(t),0)??0}(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getCenterTotalSize:{fn:()=>function(e){return Ce(e,"getCenterHeaderGroups",Me)[0]?.headers.reduce((e,t)=>e+Kn(t),0)??0}(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getEndTotalSize:{fn:()=>function(e){return Ce(e,"getEndHeaderGroups",Ee)[0]?.headers.reduce((e,t)=>e+Kn(t),0)??0}(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]}})}},to={getInitialState:e=>({columnVisibility:ge(),...e}),getDefaultTableOptions:e=>({onColumnVisibilityChange:fe("columnVisibility",e)}),assignColumnPrototype:(e,t)=>{ve("columnVisibilityFeature",e,t,{column_getIsVisible:{fn:e=>He(e),memoDeps:e=>[t.options.columns,t.atoms.columnVisibility?.get(),e.columns]},column_getCanHide:{fn:e=>je(e)},column_getToggleVisibilityHandler:{fn:e=>function(e){return t=>{Be(e,t.target.checked)}}(e)},column_toggleVisibility:{fn:(e,t)=>Be(e,t)}})},assignRowPrototype:(e,t)=>{ve("columnVisibilityFeature",e,t,{row_getVisibleCells:{fn:e=>Ne(e),memoDeps:e=>[e.getAllCells(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get()]},row_getVisibleCellsByColumnId:{fn:e=>$e(e),memoDeps:e=>[e.getAllCells(),t.atoms.columnVisibility?.get()]}})},constructTableAPIs:e=>{we("columnVisibilityFeature",e,{table_getVisibleFlatColumns:{fn:()=>function(e){return e.getAllFlatColumns().filter(e=>Ce(e,"getIsVisible",He))}(e),memoDeps:()=>[e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getVisibleLeafColumns:{fn:()=>qe(e),memoDeps:()=>[e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_setColumnVisibility:{fn:t=>Ge(e,t)},table_resetColumnVisibility:{fn:t=>function(e,t){Ge(e,t?ge():Object.assign(ge(),ue(e.initialState.columnVisibility??{})))}(e,t)},table_toggleAllColumnsVisible:{fn:t=>Ke(e,t)},table_getIsAllColumnsVisible:{fn:()=>We(e)},table_getIsSomeColumnsVisible:{fn:()=>function(e){return e.getAllLeafColumns().some(e=>Ce(e,"getIsVisible",He))}(e)},table_getToggleAllColumnsVisibilityHandler:{fn:()=>function(e){return t=>{Ke(e,t.target.checked)}}(e)}})}};function no(e){const t=Object.assign((e,n,o,i)=>{const l=e.getValue(n),s=t.resolveDataValue?t.resolveDataValue(l):l;return t.filter(s,o,e,n,i)},e);return t}no({filter:(e,t)=>e===t,autoRemove:e=>io(e)}),no({filter:(e,t)=>e==t,autoRemove:e=>io(e)}),no({filter:(e,t)=>Boolean(e?.includes(t)),autoRemove:e=>io(e),resolveFilterValue:e=>String(e),resolveDataValue:e=>null==e?void 0:String(e)});const oo=no({filter:(e,t)=>Boolean(e?.includes(t)),autoRemove:e=>io(e),resolveFilterValue:e=>String(e).toLowerCase(),resolveDataValue:e=>null==e?void 0:String(e).toLowerCase()});function io(e){return null==e||""===e}function lo(e){return null==e||""===String(e).trim()}function so(e){return e instanceof Date?e.getTime():"number"==typeof e?e:null==e||""===e?NaN:new Date(e).getTime()}function ro(e,t){const n=null==e?0:+e,o=Number(t);return isNaN(o)||isNaN(n)?String(e??"").toLowerCase().trim()>String(t).toLowerCase().trim():n>o}function ao(e,t){return e===t||ro(e,t)}function co(e,t,n){const o=t[0],i=""!==o&&void 0!==o;if(i&&!(n?ao(e,o):ro(e,o)))return!1;const l=t[1];if(""===l||void 0===l)return!0;if(i){const e=Number(o),t=Number(l);if(!isNaN(e)&&!isNaN(t)&&e>t)return!0}return n?!ro(e,l):!ao(e,l)}function uo(e){return(e.columnDef.enableGlobalFilter??!0)&&(e.table.options.enableGlobalFilter??!0)&&(e.table.options.enableFilters??!0)&&(e.table.options.getColumnCanGlobalFilter?.(e)??!0)&&!!e.accessorFn}function go(){return oo}function mo(e){const{globalFilterFn:t}=e.options,n=e._rowModelFns.filterFns;return he(t)?t:"auto"===t?go():n?.[t]}function fo(e,t){e.options.onGlobalFilterChange?.(t)}no({filter:(e,t)=>e===t,autoRemove:e=>io(e),resolveFilterValue:e=>String(e).toLowerCase(),resolveDataValue:e=>null==e?void 0:String(e).toLowerCase()}),no({filter:(e,t)=>e===t,autoRemove:e=>io(e),resolveFilterValue:e=>String(e),resolveDataValue:e=>null==e?void 0:String(e)}),no({filter:(e,t)=>Boolean(e?.startsWith(t)),autoRemove:e=>io(e),resolveFilterValue:e=>String(e).toLowerCase(),resolveDataValue:e=>null==e?void 0:String(e).toLowerCase()}),no({filter:(e,t)=>Boolean(e?.endsWith(t)),autoRemove:e=>io(e),resolveFilterValue:e=>String(e).toLowerCase(),resolveDataValue:e=>null==e?void 0:String(e).toLowerCase()}),no({filter:e=>lo(e),autoRemove:e=>io(e)||!1===e}),no({filter:e=>!lo(e),autoRemove:e=>io(e)||!1===e}),no({filter:(e,t)=>ro(e,t),autoRemove:e=>io(e)}),no({filter:(e,t)=>ao(e,t),autoRemove:e=>io(e)}),no({filter:(e,t)=>!ao(e,t),autoRemove:e=>io(e)}),no({filter:(e,t)=>!ro(e,t),autoRemove:e=>io(e)}),no({filter:(e,t)=>co(e,t,!1),autoRemove:e=>io(e)||Array.isArray(e)&&io(e[0])&&io(e[1])}),no({filter:(e,t)=>co(e,t,!0),autoRemove:e=>io(e)||Array.isArray(e)&&io(e[0])&&io(e[1])}),no({filter:(e,t)=>{if("number"!=typeof e||Number.isNaN(e))return!1;const[n,o]=t;return e>=n&&e<=o},resolveFilterValue:e=>{const[t,n]=e,o="number"!=typeof t?parseFloat(t):t,i="number"!=typeof n?parseFloat(n):n;let l=null===t||Number.isNaN(o)?-1/0:o,s=null===n||Number.isNaN(i)?1/0:i;if(l>s){const e=l;l=s,s=e}return[l,s]},autoRemove:e=>io(e)||Array.isArray(e)&&io(e[0])&&io(e[1])}),no({filter:(e,t)=>{const[n,o]=t;return e>=n&&e<=o},resolveFilterValue:e=>{const[t,n]=e,o=so(t),i=so(n);let l=Number.isNaN(o)?-1/0:o,s=Number.isNaN(i)?1/0:i;if(l>s){const e=l;l=s,s=e}return[l,s]},resolveDataValue:e=>so(e),autoRemove:e=>io(e)||Array.isArray(e)&&io(e[0])&&io(e[1])}),no({filter:(e,t)=>{for(let n=0;n<t.length;n++)if(e===t[n])return!0;return!1},autoRemove:e=>io(e)||!e?.length}),no({filter:(e,t)=>{if("string"!=typeof e&&!Array.isArray(e))return!1;for(let n=0;n<t.length;n++)if(e.includes(t[n]))return!0;return!1},autoRemove:e=>io(e)||!e?.length}),no({filter:(e,t)=>{if(!Array.isArray(e))return!1;for(let n=0;n<t.length;n++)if(!e.includes(t[n]))return!1;return!0},autoRemove:e=>io(e)||!e?.length}),no({filter:(e,t)=>{if(!Array.isArray(e))return!1;for(let n=0;n<t.length;n++)if(e.includes(t[n]))return!0;return!1},autoRemove:e=>io(e)||!e?.length});const ho={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultTableOptions:e=>({onGlobalFilterChange:fe("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{if("enableGlobalFilter"in t.columnDef&&!0===t.columnDef.enableGlobalFilter)return!0;const n=e.getCoreRowModel().flatRows.find(e=>null!=e.getAllCellsByColumnId()[t.id]?.getValue())?.getAllCellsByColumnId()[t.id]?.getValue();return"string"==typeof n||"number"==typeof n}}),assignColumnPrototype:(e,t)=>{ve("globalFilteringFeature",e,t,{column_getCanGlobalFilter:{fn:e=>uo(e)}})},constructTableAPIs:e=>{we("globalFilteringFeature",e,{table_getGlobalAutoFilterFn:{fn:()=>go()},table_getGlobalFilterFn:{fn:()=>mo(e)},table_setGlobalFilter:{fn:t=>fo(e,t)},table_resetGlobalFilter:{fn:t=>function(e,t){fo(e,t?void 0:ue(e.initialState.globalFilter))}(e,t)}})}},po={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...e.pagination}}),getDefaultTableOptions:e=>({onPaginationChange:fe("pagination",e)}),constructTableAPIs:e=>{we("rowPaginationFeature",e,{table_autoResetPageIndex:{fn:()=>on(e)},table_setPagination:{fn:t=>ln(e,t)},table_resetPagination:{fn:t=>function(e,t){ln(e,t?{pageIndex:0,pageSize:10}:ue(e.initialState.pagination??{pageIndex:0,pageSize:10}))}(e,t)},table_setPageIndex:{fn:t=>sn(e,t)},table_resetPageIndex:{fn:t=>rn(e,t)},table_setPageSize:{fn:t=>an(e,t)},table_getPageCount:{fn:()=>cn(e)},table_resetPageSize:{fn:t=>function(e,t){const n=e.atoms.pagination?.get()?.pageSize??10,o=t?10:e.initialState.pagination?.pageSize??10;o!==n&&an(e,o)}(e,t)},table_getPageOptions:{fn:()=>function(e){const t=cn(e);let n=[];return t&&t>0&&(n=[...new Array(t)].fill(null).map((e,t)=>t)),n}(e)},table_getCanPreviousPage:{fn:()=>function(e){return(e.atoms.pagination?.get()?.pageIndex??0)>0}(e)},table_getCanNextPage:{fn:()=>function(e){const t=e.atoms.pagination?.get()?.pageIndex??0,n=cn(e);return-1===n||0!==n&&t<n-1}(e)},table_previousPage:{fn:()=>function(e){return sn(e,e=>e-1)}(e)},table_nextPage:{fn:()=>function(e){return sn(e,e=>e+1)}(e)},table_firstPage:{fn:()=>function(e){return sn(e,0)}(e)},table_lastPage:{fn:()=>function(e){return sn(e,cn(e)-1)}(e)},table_getRowCount:{fn:()=>un(e)}})}};function bo(e,t){e.options.onRowSelectionChange?.(t)}function _o(e,t,n){e._lastSelectedRowId=null,bo(e,o=>{if(t=void 0!==t?t:!Ce(e,"getIsAllRowsSelected",Co),n?.deselectAll&&!t)return ge();const i=Object.assign(ge(),o),l=e.getPreGroupedRowModel().flatRows;if(t){const e=new Map;l.forEach(t=>{Do(t,e)&&(i[t.id]=!0)})}else l.forEach(e=>{Eo(e)&&delete i[e.id]});return i})}function wo(e,t,n){e._lastSelectedRowId=null,bo(e,o=>{const i=void 0!==t?t:!Ce(e,"getIsAllPageRowsSelected",So);if(n?.deselectAll&&!i)return ge();const l=Object.assign(ge(),o);return e.getRowModel().rows.forEach(t=>{Ao(l,t.id,i,!0,e,!0)}),l})}function vo(e){return Object.keys(e.atoms.rowSelection?.get()??{})}function Co(e){const t=e.getFilteredRowModel().flatRows,n=e.atoms.rowSelection?.get()??{};let o=Boolean(t.length&&Object.keys(n).length);if(o){const e=new Map;t.some(t=>!zo(t,n)&&Do(t,e))&&(o=!1)}return o}function So(e){const t=e.getPaginatedRowModel().flatRows,n=e.atoms.rowSelection?.get()??{},o=new Map;let i=!1;for(let e=0;e<t.length;e++){const l=t[e];if(zo(l,n))!i&&Do(l,o)&&(i=!0);else if(Do(l,o))return!1}return i}function yo(e){return Ce(e,"getSelectedRowIds",vo).length>0}function xo(e,t,n){const o=Io(e);bo(e.table,i=>{t=void 0!==t?t:!o;const l=Object.assign(ge(),i);return Ao(l,e.id,t,(n?.selectChildren??!0)&&Fo(e),e.table),!t&&n?.deselectParents&&Lo(l,e),l})}function Io(e){return zo(e,e.table.atoms.rowSelection?.get()??{})}function Ro(e){return"some"===Vo(e)}function Eo(e){const t=e.table.options;return"function"==typeof t.enableRowSelection?t.enableRowSelection(e):t.enableRowSelection??!0}function Mo(e){const t=e.table.options;return"function"==typeof t.enableSubRowSelection?t.enableSubRowSelection(e):t.enableSubRowSelection??!0}function Fo(e){const t=e.table.options;return"function"==typeof t.enableMultiRowSelection?t.enableMultiRowSelection(e):t.enableMultiRowSelection??!0}function Ao(e,t,n,o,i,l){const s=i.getRow(t,!0);n?(Fo(s)||Object.keys(e).forEach(t=>delete e[t]),Eo(s)&&(e[t]=!0)):l&&!Eo(s)||delete e[t],o&&s.subRows.length&&Mo(s)&&s.subRows.forEach(t=>Ao(e,t.id,n,o,i,l))}function Do(e,t){if(!Eo(e))return!1;const n=e.table;if(!0===n.options.enableSubRowSelection)return!0;const o=e.parentId;if(void 0===o)return!0;const i=t.get(o);if(void 0!==i)return i;const l=n.getCoreRowModel().rowsById,s=[];let r=!0,a=o;for(;void 0!==a;){const e=t.get(a);if(void 0!==e){r=e;break}s.push(a);const o=l[a]??n.getRow(a,!0);if(!Mo(o)){r=!1;break}a=o.parentId}return s.forEach(e=>t.set(e,r)),r}function Lo(e,t){const n=t.table.getCoreRowModel().rowsById;let o=t.parentId;for(;void 0!==o;)delete e[o],o=(n[o]??t.table.getRow(o,!0)).parentId}function Po(e,t,n,o){const i=[];for(let l=0;l<e.length;l++){const s=e[l],r=zo(s,t);if(r&&(n.push(s),o[s.id]=s),s.subRows.length){const e=Po(s.subRows,t,n,o);if(r){const t=Object.create(Object.getPrototypeOf(s));de(t,s),t.subRows=e,i.push(t)}}else r&&i.push(s)}return i}function Oo(e,t){const n=[],o=ge(),i=t.atoms.rowSelection?.get()??{};return{rows:Po(e.rows,i,n,o),flatRows:n,rowsById:o}}function zo(e,t){return!(!me(t,e.id)||!t[e.id])}function Vo(e){if(!e.subRows.length)return!1;const t=e.table.atoms.rowSelection?.get()??{};let n=!1,o=!0,i=!1;for(let l=0;l<e.subRows.length;l++){const s=e.subRows[l];if(n&&!o)break;if(Eo(s)&&(i=!0,zo(s,t)?n=!0:o=!1),s.subRows.length){const e=Vo(s);"all"===e?(n=!0,i=!0):"some"===e?(n=!0,o=!1,i=!0):o=!1}}return!!i&&(o?"all":!!n&&"some")}const To={initTableInstanceData:e=>{e._lastSelectedRowId=null},resetTableInstanceData:e=>{e._lastSelectedRowId=null},getInitialState:e=>({rowSelection:ge(),...e}),getDefaultTableOptions:e=>({onRowSelectionChange:fe("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableRowRangeSelection:!0,enableSubRowSelection:!0,isRowRangeSelectionEvent:e=>{const t=e;return Boolean(t.shiftKey||t.nativeEvent?.shiftKey)}}),assignRowPrototype:(e,t)=>{ve("rowSelectionFeature",e,t,{row_toggleSelected:{fn:(e,t,n)=>xo(e,t,n)},row_getIsSelected:{fn:e=>Io(e)},row_getIsSomeSelected:{fn:e=>Ro(e),memoDeps:e=>[e.subRows,e.table.atoms.rowSelection?.get(),e.table.options.enableRowSelection]},row_getIsAllSubRowsSelected:{fn:e=>function(e){return"all"===Vo(e)}(e),memoDeps:e=>[e.subRows,e.table.atoms.rowSelection?.get(),e.table.options.enableRowSelection]},row_getCanSelect:{fn:e=>Eo(e)},row_getCanSelectSubRows:{fn:e=>Mo(e)},row_getCanMultiSelect:{fn:e=>Fo(e)},row_getToggleSelectedHandler:{fn:(e,t)=>function(e,t){const n=Eo(e);return o=>{if(!n)return;const i=o,l=e.table,s=i.target.checked,r=l._lastSelectedRowId;!1!==l.options.enableRowRangeSelection&&null!==r&&Fo(e)&&l.options.isRowRangeSelectionEvent?.(o)&&function(e,t,n,o){const i=o?.selectChildren??!0,l=e.table,s=l.getRowsInDisplayOrder(),r=l.getPrePaginatedRowModel().rowsById[t]??l.getCoreRowModel().rowsById[t];if(!r)return!1;const a=r.getDisplayIndex(),c=e.getDisplayIndex(),u=s[a],d=s[c];if(a<0||c<0||a>=s.length||c>=s.length||u?.id!==r.id||d?.id!==e.id||!Fo(r)||!Fo(e))return!1;const g=Math.min(a,c),m=Math.max(a,c);return bo(l,e=>{const t=Object.assign(ge(),e);for(let e=g;e<=m;e++){const r=s[e];Eo(r)&&Fo(r)&&(Ao(t,r.id,n,i,l),!n&&o?.deselectParents&&Lo(t,r))}return t}),!0}(e,r,s,t)||xo(e,s,t),l._lastSelectedRowId=e.id}}(e,t)}})},constructTableAPIs:e=>{we("rowSelectionFeature",e,{table_setRowSelection:{fn:t=>bo(e,t)},table_resetRowSelection:{fn:t=>function(e,t){e._lastSelectedRowId=null,bo(e,t?ge():Object.assign(ge(),ue(e.initialState.rowSelection??{})))}(e,t)},table_toggleAllRowsSelected:{fn:(t,n)=>_o(e,t,n)},table_toggleAllPageRowsSelected:{fn:(t,n)=>wo(e,t,n)},table_getPreSelectedRowModel:{fn:()=>function(e){return e.getCoreRowModel()}(e)},table_getSelectedRowModel:{fn:()=>function(e){const t=e.getCoreRowModel();return Ce(e,"getIsSomeRowsSelected",yo)?Oo(t,e):{rows:[],flatRows:[],rowsById:ge()}}(e),memoDeps:()=>[e.atoms.rowSelection?.get(),e.getCoreRowModel()]},table_getFilteredSelectedRowModel:{fn:()=>function(e){const t=e.getFilteredRowModel();return Ce(e,"getIsSomeRowsSelected",yo)?Oo(t,e):{rows:[],flatRows:[],rowsById:ge()}}(e),memoDeps:()=>[e.atoms.rowSelection?.get(),e.getFilteredRowModel()]},table_getGroupedSelectedRowModel:{fn:()=>function(e){const t=e.getSortedRowModel();return Ce(e,"getIsSomeRowsSelected",yo)?Oo(t,e):{rows:[],flatRows:[],rowsById:ge()}}(e),memoDeps:()=>[e.atoms.rowSelection?.get(),e.getSortedRowModel()]},table_getSelectedRowIds:{fn:()=>vo(e),memoDeps:()=>[e.atoms.rowSelection?.get()]},table_getIsAllRowsSelected:{fn:()=>Co(e),memoDeps:()=>[e.atoms.rowSelection?.get(),e.getFilteredRowModel(),e.options.enableRowSelection,e.options.enableSubRowSelection]},table_getIsAllPageRowsSelected:{fn:()=>So(e),memoDeps:()=>[e.atoms.rowSelection?.get(),e.getPaginatedRowModel(),e.options.enableRowSelection,e.options.enableSubRowSelection]},table_getIsSomeRowsSelected:{fn:()=>yo(e),memoDeps:()=>[e.atoms.rowSelection?.get()]},table_getIsSomePageRowsSelected:{fn:()=>function(e){return e.getPaginatedRowModel().flatRows.filter(e=>Eo(e)).some(e=>Io(e)||Ce(e,"getIsSomeSelected",Ro))}(e),memoDeps:()=>[e.atoms.rowSelection?.get(),e.getPaginatedRowModel(),e.options.enableRowSelection]},table_getToggleAllRowsSelectedHandler:{fn:()=>function(e){return t=>{_o(e,t.target.checked)}}(e)},table_getToggleAllPageRowsSelectedHandler:{fn:()=>function(e){return t=>{wo(e,t.target.checked)}}(e)}})}},ko={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortFn:"auto",sortUndefined:1}),getDefaultTableOptions:e=>({autoResetSorting:!1,onSortingChange:fe("sorting",e),isMultiSortEvent:e=>e.shiftKey}),assignColumnPrototype(e,t){ve("rowSortingFeature",e,t,{column_getAutoSortFn:{fn:e=>mn(e)},column_getAutoSortDir:{fn:e=>fn(e)},column_getSortFn:{fn:e=>hn(e)},column_toggleSorting:{fn:(e,t,n)=>pn(e,t,n)},column_getFirstSortDir:{fn:e=>bn(e)},column_getNextSortingOrder:{fn:(e,t)=>_n(e,t)},column_getCanSort:{fn:e=>wn(e)},column_getCanMultiSort:{fn:e=>vn(e)},column_getIsSorted:{fn:e=>Cn(e)},column_getSortIndex:{fn:e=>function(e){return e.table.atoms.sorting?.get()?.findIndex(t=>t.id===e.id)??-1}(e)},column_clearSorting:{fn:e=>function(e){dn(e.table,t=>t.length?t.filter(t=>t.id!==e.id):[])}(e)},column_getToggleSortingHandler:{fn:e=>function(e){const t=wn(e);return n=>{t&&pn(e,void 0,!!vn(e)&&e.table.options.isMultiSortEvent?.(n))}}(e)}})},constructTableAPIs(e){we("rowSortingFeature",e,{table_setSorting:{fn:t=>dn(e,t)},table_resetSorting:{fn:t=>gn(e,t)}})}};function Bo(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){const o=[],i=ge(),l=n.options.maxLeafRowFilterDepth??100,s=(e,r=0)=>{const a=[];for(let c of e){const e=gt(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(e.columnFilters=c.columnFilters,c.subRows.length&&r<l){if(e.subRows=s(c.subRows,r+1),c=e,t(c)&&!e.subRows.length){a.push(c),i[c.id]=c,o.push(c);continue}if(t(c)||e.subRows.length){a.push(c),i[c.id]=c,o.push(c);continue}}else c=e,t(c)&&(a.push(c),i[c.id]=c,o.push(c))}return a};return{rows:s(e),flatRows:o,rowsById:i}}(e,t,n):function(e,t,n){const o=[],i=ge(),l=n.options.maxLeafRowFilterDepth??100,s=(e,r=0)=>{const a=[];for(let c of e)if(t(c)){if(c.subRows.length&&r<l){const e=gt(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);e.subRows=s(c.subRows,r+1),c=e}a.push(c),o.push(c),i[c.id]=c,c.subRows.length&&r>=l&&Ho(c.subRows,o,i)}return a};return{rows:s(e),flatRows:o,rowsById:i}}(e,t,n)}function Ho(e,t,n){for(const o of e)t.push(o),n[o.id]=o,o.subRows.length&&Ho(o.subRows,t,n)}function jo(){return e=>{const t=e;return be({feature:"columnFilteringFeature",table:t,fnName:"table.getFilteredRowModel",memoDeps:()=>[t.getPreFilteredRowModel(),t.atoms.columnFilters?.get(),t.atoms.globalFilter?.get()],fn:()=>function(e){const t=e.getPreFilteredRowModel(),n=e.atoms.columnFilters?.get(),o=e.atoms.globalFilter?.get(),i=null!=o&&""!==o;if(!t.rows.length||!n?.length&&!i){const e=t.flatRows;for(let t=0;t<e.length;t++){const n=e[t];n.columnFilters=ge(),n.columnFiltersMeta=ge()}return t}const l=[],s=[];n?.forEach(t=>{const n=rt(e,t.id);if(!n)return;const o=Pn(n);o&&l.push({id:t.id,filterFn:o,resolvedValue:o.resolveFilterValue?.(t.value)??t.value})});const r=n?.map(e=>e.id)??[],a=mo(e),c=e.getAllLeafColumns().filter(e=>uo(e));i&&a&&c.length&&(r.push("__global__"),c.forEach(e=>{s.push({id:e.id,filterFn:a,resolvedValue:a.resolveFilterValue?.(o)??o})}));const u=t.flatRows;for(let e=0;e<u.length;e++){const t=u[e];if(t.columnFilters=ge(),t.columnFiltersMeta=ge(),l.length)for(let e=0;e<l.length;e++){const n=l[e],o=n.id;t.columnFilters[o]=n.filterFn(t,o,n.resolvedValue,e=>{t.columnFiltersMeta||(t.columnFiltersMeta=ge()),t.columnFiltersMeta[o]=e})}if(s.length){for(let e=0;e<s.length;e++){const n=s[e],o=n.id;if(n.filterFn(t,o,n.resolvedValue,e=>{t.columnFiltersMeta||(t.columnFiltersMeta=ge()),t.columnFiltersMeta[o]=e})){t.columnFilters.__global__=!0;break}}!0!==t.columnFilters.__global__&&(t.columnFilters.__global__=!1)}}return Bo(t.rows,e=>{for(let t=0;t<r.length;t++)if(!1===e.columnFilters[r[t]])return!1;return!0},e)}(t),onAfterUpdate:pe(()=>on(t))})}}function No(){return e=>{const t=e;return be({feature:"rowPaginationFeature",table:t,fnName:"table.getPaginatedRowModel",memoDeps:()=>[t.getPrePaginatedRowModel(),t.atoms.pagination?.get(),t.options.paginateExpandedRows?void 0:t.atoms.expanded?.get()],fn:()=>function(e){const t=e.getPrePaginatedRowModel(),n=e.atoms.pagination?.get();if(!t.rows.length)return t;const{pageSize:o,pageIndex:i}=n??{pageIndex:0,pageSize:10},{rows:l,flatRows:s,rowsById:r}=t,a=o*i,c=a+o,u=l.slice(a,c);let d;d=e.options.paginateExpandedRows?{rows:u,flatRows:s,rowsById:r}:function(e){const t=[],n=e=>{t.push(e),e.subRows.length&&function(e){const t=e.table.atoms.expanded?.get()??{};return!!(e.table.options.getIsRowExpanded?.(e)??(!0===t||function(e,t){return!!(e&&!0!==e&&me(e,t)&&e[t])}(t,e.id)))}(e)&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}({rows:u,flatRows:s,rowsById:r}),d.flatRows=[];const g=new Set,m=e=>{g.has(e.id)||(g.add(e.id),d.flatRows.push(e),e.subRows.length&&e.subRows.forEach(m))};return d.rows.forEach(m),d}(t)})}}function $o(){return e=>{const t=e;return be({feature:"rowSortingFeature",table:t,fnName:"table.getSortedRowModel",memoDeps:()=>[t.atoms.sorting?.get(),t.getPreSortedRowModel()],fn:()=>function(e){const t=e.getPreSortedRowModel(),n=e.atoms.sorting?.get();if(!t.rows.length||!n?.length)return t;const o=[],i=n.filter(t=>{const n=e.getColumn(t.id);return!!n&&wn(n)});if(!i.length)return t;const l=[];for(let t=0;t<i.length;t++){const n=i[t],o=e.getColumn(n.id);o&&l.push({id:n.id,desc:n.desc,sortUndefined:o.columnDef.sortUndefined,invertSorting:o.columnDef.invertSorting,sortFn:hn(o)})}const s=(e,t)=>{for(let n=0;n<l.length;n++){const o=l[n],i=o.sortUndefined,s=o.desc;let r=0;if(i){const n=void 0===e.getValue(o.id),l=void 0===t.getValue(o.id);if(n&&l)continue;if(n||l){if("first"===i)return n?-1:1;if("last"===i)return n?1:-1;r=n?i:-i}}if(0===r&&(r=o.sortFn(e,t,o.id)),0!==r)return s&&(r*=-1),o.invertSorting&&(r*=-1),r}return e.index-t.index},r=e=>{const t=e.slice();t.sort(s);let n=!1;for(let i=0;i<t.length;i++){const l=t[i];if(l!==e[i]&&(n=!0),l.subRows.length){const e=r(l.subRows);if(e.changed){const s=Object.create(Object.getPrototypeOf(l));de(s,l),s.subRows=e.rows,t[i]=s,o.push(s),n=!0}else o.push(l)}else o.push(l)}return{rows:t,changed:n}};return{rows:r(t.rows).rows,flatRows:o,rowsById:t.rowsById}}(t),onAfterUpdate:pe(()=>on(t))})}}const qo={text:["contains","notContains","equals","notEquals","startsWith","endsWith","blank","notBlank"],number:["equals","notEquals","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","between","blank","notBlank"],date:["equals","notEquals","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","between","blank","notBlank"]},Go=new Set(["blank","notBlank"]),Ko=e=>null==e||""===String(e).trim(),Wo=(e,t)=>{if("date"===t){const t=e instanceof Date?e.getTime():new Date(String(e)).getTime();return Number.isNaN(t)?null:t}const n="number"==typeof e?e:Number(e);return Number.isFinite(n)?n:null},Uo=(e,t,n="text")=>{if("string"==typeof t)return String(e??"").toLowerCase().includes(t.toLowerCase());if("conditions"in t){const o=t.conditions.map(t=>((e,t,n)=>{const{operator:o}=t;if("blank"===o)return Ko(e);if("notBlank"===o)return!Ko(e);if(Ko(t.value))return!0;if("number"===n||"date"===n){const i=Wo(e,n),l=Wo(t.value,n);if(null===i||null===l)return!1;switch(o){case"equals":return i===l;case"notEquals":return i!==l;case"greaterThan":return i>l;case"greaterThanOrEqual":return i>=l;case"lessThan":return i<l;case"lessThanOrEqual":return i<=l;case"between":{const e=Wo(t.value2,n);return null===e?i>=l:i>=l&&i<=e}default:return!1}}const i=String(e??"").toLowerCase(),l=String(t.value).toLowerCase();switch(o){case"contains":return i.includes(l);case"notContains":return!i.includes(l);case"equals":return i===l;case"notEquals":return i!==l;case"startsWith":return i.startsWith(l);case"endsWith":return i.endsWith(l);default:return!1}})(e,t,n));return"or"===t.join?o.some(Boolean):o.every(Boolean)}return t.value.some(t=>String(t)===String(e))},Zo=e=>{const{toolbar:t}=e,n=Boolean(e.columnVisibility);if(!0===t)return{columns:n,export:!0,exportOptions:{},history:e.history,print:!0,search:!0};if("object"==typeof t){const o=t.export??!1;return{columns:(t.columns??!1)&&n,export:Boolean(o),exportOptions:"object"==typeof o?o:{},history:(t.history??!1)&&e.history,print:t.print??!1,search:(t.search??!1)||Boolean(e.globalFilter)}}return{columns:!1,export:!1,exportOptions:{},history:!1,print:!1,search:Boolean(e.globalFilter)}},Xo=e=>Zo(e).search,Yo=(e,t,n)=>{const o=document.createElement("button");o.type="button",o.classList.add("btn","btn-ghost","btn-sm"),o.innerHTML=e,o.setAttribute(n,""),o.setAttribute("data-coreui-tooltip",t);const i=document.createElement("span");return i.classList.add("visually-hidden"),i.textContent=t,o.append(i),o},Jo=[["cellSelection",["cellSelectionFeature"]],["columnFilters",["columnFilteringFeature","filteredRowModel"]],["columnOrder",["columnOrderingFeature"]],["columnPinning",["columnPinningFeature","columnSizingFeature","columnVisibilityFeature"]],["columnSizing",["columnResizingFeature","columnSizingFeature"]],["columnVisibility",["columnVisibilityFeature"]],["globalFilter",["filteredRowModel","filterFns","globalFilteringFeature"]],["pagination",["paginatedRowModel","rowPaginationFeature"]],["rowSelection",["rowSelectionFeature"]],["selectFilters",["columnFacetingFeature","facetedRowModel","facetedUniqueValues"]],["sorting",["rowSortingFeature","sortedRowModel"]]],Qo=Number.MAX_SAFE_INTEGER,ei=e=>{const{filterFn:t}=e;return t?(e,n,o)=>t(e.getValue(n),o,e.original):(t,n,o)=>Uo(t.getValue(n),o,e.filterType)},ti=e=>{const t="object"==typeof e.sorting?e.sorting:{},n="object"==typeof e.columnSizing?e.columnSizing:{},o="object"==typeof e.pagination?e.pagination:{},i=Boolean(e.dataProvider),l=Boolean(e.columnSizing),s=Boolean(e.columnPinning),r=l||s,a=Boolean(e.pagination)||i,c="object"==typeof e.infiniteScroll?e.infiniteScroll:{};if(e.infiniteScroll){if(!i)throw new TypeError('DATA-GRID: Option "infiniteScroll" requires "dataProvider".');if(e.pagination)throw new TypeError('DATA-GRID: Option "infiniteScroll" cannot be combined with "pagination".');if(!e.virtualization)throw new TypeError('DATA-GRID: Option "infiniteScroll" requires "virtualization".')}const{features:u}=e;if(!u)throw new TypeError('DATA-GRID: Option "features" is required.');((e,t,n)=>{for(const[e,o]of Jo){if(!n[e])continue;const i="selectFilters"===e?'columnFilters (filterType "select")':e;for(const e of o)if(!(e in t))throw new TypeError(`${"data-grid".toUpperCase()}: Option "${i}" requires feature "${e}" in "features".`)}})(0,u,{cellSelection:e.cellSelection,columnFilters:e.columnFilters,columnOrder:Boolean(e.columnOrder),columnPinning:s,columnSizing:l,columnVisibility:Boolean(e.columnVisibility),globalFilter:Xo(e),pagination:a,rowSelection:Boolean(e.rowSelection),selectFilters:e.columnFilters&&e.columns.some(e=>"select"===e.filterType),sorting:Boolean(e.sorting)});const d={..."rowPaginationFeature"in u&&{pagination:{pageIndex:0,pageSize:e.infiniteScroll?c.pageSize??50:a?o.pageSize??10:Qo}},..."object"==typeof e.columnPinning&&{columnPinning:{start:[],end:[],...e.columnPinning}},...Array.isArray(e.columnOrder)&&{columnOrder:e.columnOrder},..."object"==typeof e.columnVisibility&&{columnVisibility:e.columnVisibility}};return function(e){const t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:o,coreRowModel:i,expandedRowModel:l,facetedMinMaxValues:s,facetedRowModel:r,facetedUniqueValues:a,filterFns:c,filterMeta:u,filteredRowModel:d,groupedRowModel:g,paginatedRowModel:m,sortFns:f,sortedRowModel:h,tableMeta:p,...b}=e.features,w={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...Rn,...b},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:c,sortFns:f},_rowModels:{},atoms:{},baseAtoms:{}},v=Object.values(w._features),C={...v.reduce((e,t)=>Object.assign(e,t.getDefaultTableOptions?.(w)),{}),...e};if(t.wrapExternalAtoms&&C.atoms)for(const[e,n]of Object.entries(C.atoms)){const o=n,i=t.createWritableAtom(o.get(),{debugName:`externalAtom/${e}`});C.atoms[e]=i;let l=!1;const s=o.subscribe(e=>{l||i.set(e)}),r=i.subscribe(e=>{l=!0,o.set(e),l=!1});t.addSubscription(s),t.addSubscription(r)}t.createOptionsStore?(w.optionsStore=t.createWritableAtom(C,{debugName:"table/optionsStore"}),Object.defineProperty(w,"options",{configurable:!0,enumerable:!0,get:()=>w.optionsStore.get(),set(e){w.optionsStore.set(()=>e)}})):w.options=C,w.initialState=function(e,t={}){return Object.values(e).forEach(e=>{t=e.getInitialState?.(t)??t}),ue(t)}(w._features,w.options.initialState);const S=Object.keys(w.initialState);for(let e=0;e<S.length;e++){const n=S[e];w.baseAtoms[n]=t.createWritableAtom(w.initialState[n],{debugName:`table/baseAtoms/${n}`}),w.atoms[n]=t.createReadonlyAtom(()=>{const e=w.options,t=e.atoms?.[n],o=t?t.get():w.baseAtoms[n].get();if(t)return o;const i=e.state;if(i&&me(i,n)){const e=i[n];return void 0===e?w.initialState[n]:e}return o},{debugName:`table/atoms/${n}`})}In(w),w.store=function(e){const t=e;return Object.defineProperty(e,"state",{get:()=>e.get()}),"set"in e&&(t.setState=e.set.bind(e)),t}(t.createReadonlyAtom(()=>{const e={};for(let t=0;t<S.length;t++){const n=S[t];e[n]=w.atoms[n].get()}return e},{compare:_,debugName:"table/store"}));for(let e=0;e<v.length;e++){const t=v[e];t.initTableInstanceData?.(w),t.initCellInstanceData&&w._cellInstanceInitFns.push(t.initCellInstanceData.bind(t)),t.initColumnInstanceData&&w._columnInstanceInitFns.push(t.initColumnInstanceData.bind(t)),t.initHeaderGroupInstanceData&&w._headerGroupInstanceInitFns.push(t.initHeaderGroupInstanceData.bind(t)),t.initHeaderInstanceData&&w._headerInstanceInitFns.push(t.initHeaderInstanceData.bind(t)),t.initRowInstanceData&&w._rowInstanceInitFns.push(t.initRowInstanceData.bind(t)),t.constructTableAPIs?.(w)}return w}({columns:e.columns.map(e=>{const t=e.width??null;return{accessorKey:e.key,enableColumnFilter:!1!==e.filterable,enableHiding:!1!==e.hideable,enableResizing:!1!==e.resizable,enableSorting:!1!==e.sortable,filterFn:ei(e),id:e.key,meta:{label:e.label,formatter:e.formatter,width:e.width},...r&&null!==t&&{size:t}}}),columnResizeMode:n.mode??"onChange",data:i?[]:e.items,enableCellSelection:Boolean(e.cellSelection),enableColumnFilters:Boolean(e.columnFilters),enableColumnPinning:s,enableColumnResizing:l,enableGlobalFilter:Xo(e),enableHiding:Boolean(e.columnVisibility),enableMultiSort:!1!==t.multiple,enableRowSelection:Boolean(e.rowSelection),enableSorting:Boolean(e.sorting),enableSortingRemoval:Boolean(t.resetable),features:u,globalFilterFn:"includesString",...i&&{manualFiltering:!0,manualPagination:!0,manualSorting:!0,rowCount:0},...e.itemKey&&{getRowId:e.itemKey},initialState:d,renderFallbackValue:null})};function ni(e,t,n){let o,i=n.initialDeps??[],l=!0;function s(){const s=e();return s.length!==i.length||s.some((e,t)=>i[t]!==e)?(i=s,o=t(...s),!(null==n?void 0:n.onChange)||l&&n.skipInitialOnChange||n.onChange(o),l=!1,o):o}return s.updateDeps=e=>{i=e},s}function oi(e,t){if(void 0===e)throw new Error("Unexpected undefined"+(t?`: ${t}`:""));return e}const ii=(e,t,n)=>{let o;return function(...i){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,i),n)}};let li;const si=()=>{if(void 0!==li)return li;if("undefined"==typeof navigator)return li=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return li=!0;const e=navigator.maxTouchPoints;return li="MacIntel"===navigator.platform&&void 0!==e&&e>0},ri=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ai=e=>e,ci=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,o=new Array(n);for(let e=0;e<n;e++)o[e]=t+e;return o},ui=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;const i=e=>{const{width:n,height:o}=e;t({width:Math.round(n),height:Math.round(o)})};if(i(ri(n)),!o.ResizeObserver)return()=>{};const l=new o.ResizeObserver(t=>{const o=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void i({width:t.inlineSize,height:t.blockSize})}i(ri(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return l.observe(n,{box:"border-box"}),()=>{l.unobserve(n)}},di={passive:!0},gi="undefined"==typeof window||"onscrollend"in window,mi=(e,t)=>((e,t,n)=>{const o=e.scrollElement;if(!o)return;const i=e.targetWindow;if(!i)return;const l=e.options.useScrollendEvent&&gi;let s=0;const r=l?null:ii(i,()=>t(s,!1),e.options.isScrollingResetDelay),a=e=>()=>{s=n(o),r?.(),t(s,e)},c=a(!0),u=a(!1);return o.addEventListener("scroll",c,di),l&&o.addEventListener("scrollend",u,di),()=>{o.removeEventListener("scroll",c),l&&o.removeEventListener("scrollend",u)}})(e,t,t=>{const{horizontal:n,isRtl:o}=e.options;return n?t.scrollLeft*(o?-1:1):t.scrollTop}),fi=(e,t,n)=>{if(n.options.useCachedMeasurements){const t=n.indexFromElement(e),o=n.options.getItemKey(t);return n.itemSizeCache.get(o)??n.options.estimateSize(t)}if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const t=n.indexFromElement(e),o=n.options.getItemKey(t),i=n.itemSizeCache.get(o);if(void 0!==i)return i}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},hi=(e,{adjustments:t=0,behavior:n},o)=>{var i,l;null==(l=null==(i=o.scrollElement)?void 0:i.scrollTo)||l.call(i,{[o.options.horizontal?"left":"top"]:e+t,behavior:n})};var pi=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e,t,n;return(null==(n=null==(t=null==(e=this.targetWindow)?void 0:e.performance)?void 0:t.now)?void 0:n.call(t))??Date.now()},this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{const t=()=>{const t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(const[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{var t,n;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ai,rangeExtractor:ci,onChange:()=>{},measureElement:fi,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const t in e){const n=e[t];void 0!==n&&(o[t]=n)}const i=this.options;let l=null,s=null,r=!1;if(void 0!==i&&i.enabled&&o.enabled&&"end"===o.anchorTo&&null!==this.scrollElement){const e=i.count,a=o.count,c=this.getMeasurements(),u=e>0?(null==(t=c[0])?void 0:t.key)??i.getItemKey(0):null,d=e>0?(null==(n=c[e-1])?void 0:n.key)??i.getItemKey(e-1):null;if(a!==e||e>0&&a>0&&(o.getItemKey(0)!==u||o.getItemKey(a-1)!==d)){r=!0;const t=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??c[0]:null;t&&(l=[t.key,this.getScrollOffset()-t.start]);const n=!0===o.followOnAppend?"auto":o.followOnAppend||null;n&&a>e&&this.isAtEnd(i.scrollEndThreshold)&&(0===e||o.getItemKey(a-1)!==d)&&(s=n)}}this.options=o,r&&(this.pendingMin=0,this.itemSizeCacheVersion++);let a=!1,c=0;if(l&&null!==this.scrollOffset){const[e,t]=l,n=this.getMeasurements(),{count:o,getItemKey:i}=this.options;let s=0;for(;s<o&&i(s)!==e;)s++;if(s<o){const e=n[s];if(e){const n=e.start+t;n!==this.scrollOffset&&(c=n-this.scrollOffset,this.scrollOffset=n,a=!0)}}}(a||s)&&(this.pendingScrollAnchor=[a?l[0]:null,a?l[1]:0,s,c])},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=ni(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();if(this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&null===this._intendedScrollOffset&&e===this.scrollOffset)return;null!==this._intendedScrollOffset&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,null!==this._iosTouchEndTimerId&&null!=this.targetWindow&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,si()&&null!=this.targetWindow&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener("touchstart",t,di),e.addEventListener("touchend",n,di),this.unsubs.push(()=>{e.removeEventListener("touchstart",t),e.removeEventListener("touchend",n),null!==this._iosTouchEndTimerId&&null!=this.targetWindow&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const n=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,n&&this.scrollElement&&this.options.enabled){const[e,t,o,i]=n;null===e||o||(si()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?0!==i&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}},this._flushIosDeferredIfReady=()=>{if(0===this._iosDeferredAdjustment)return;if(this.isScrolling)return;if(this._iosTouching)return;if(this._iosJustTouchEnded)return;const e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;const n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=ni(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,o,i,l,s,r)=>(void 0!==this.prevLanes&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:o,enabled:i,lanes:l,laneAssignmentMode:s,gap:r}),{key:!1}),this.getMeasurements=ni(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:o,enabled:i,lanes:l,laneAssignmentMode:s,gap:r},a)=>{const c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));const u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),1===l){const i=2*e;let l,s=this._flatMeasurements;if(!s||s.length<i){const e=new Float64Array(i);s&&u>0&&e.set(s.subarray(0,2*u)),s=e,this._flatMeasurements=s}if(0===u)l=t+n;else{const e=u-1;l=s[2*e]+s[2*e+1]+r}for(let t=u;t<e;t++){const e=o(t),n=c.get(e),i="number"==typeof n?n:this.options.estimateSize(t);s[2*t]=l,s[2*t+1]=i,l+=i+r}const a=function(e,t,n){const o=new Array(e);return new Proxy(o,{get(o,i,l){if("string"==typeof i){const l=i.charCodeAt(0);if(l>=48&&l<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&l<e){let e=o[l];if(!e){const i=t[2*l];e=o[l]={index:l,key:n(l),start:i,size:t[2*l+1],end:i+t[2*l+1],lane:0}}return e}}if("length"===i)return e}return Reflect.get(o,i,l)}})}(e,s,o);return this.measurementsCache=a,a}const d=this.measurementsCache.slice(0,u),g=new Array(l).fill(void 0),m=new Float64Array(l);let f=0;for(let e=0;e<u;e++){const t=d[e];t&&(void 0===g[t.lane]&&f++,g[t.lane]=e,m[t.lane]=t.end)}for(let i=u;i<e;i++){const e=o(i),a=this.laneAssignments.get(i);let u,h;const p="estimate"===s||c.has(e);if(void 0!==a&&this.options.lanes>1){u=a;const e=g[u],o=void 0!==e?d[e]:void 0;h=o?o.end+r:t+n}else if(f===l){let e=0,t=m[0],n=g[0];for(let o=1;o<l;o++){const i=m[o];(i<t||i===t&&g[o]<n)&&(e=o,t=i,n=g[o])}u=e,h=t+r,p&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,p&&this.laneAssignments.set(i,u);const b=c.get(e),_="number"==typeof b?b:this.options.estimateSize(i),w=h+_;d[i]={index:i,start:h,size:_,end:w,key:e,lane:u},void 0===g[u]&&f++,g[u]=i,m[u]=w}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ni(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,o)=>0===e.length||0===t?(this.range=null,null):(this.range=function(e,t,n,o,i){const l=e.length-1;if(e.length<=o)return{startIndex:0,endIndex:l};if(1===o&&null!==i){const e=function(e,t,n){let o=0;for(;o<=t;){const i=(o+t)/2|0,l=e[2*i];if(l<n)o=i+1;else{if(!(l>n))return i;t=i-1}}return o>0?o-1:0}(i,l,n);let o=e;const s=n+t;for(;o<l&&i[2*o]+i[2*o+1]<s;)o++;return{startIndex:e,endIndex:o}}let s=bi(0,l,t=>e[t].start,n),r=s;if(1===o)for(;r<l&&e[r].end<n+t;)r++;else if(o>1){const i=Array(o).fill(0);for(;r<l&&i.some(e=>e<n+t);){const t=e[r];i[t.lane]=t.end,r++}const a=Array(o).fill(n+t);for(;s>=0&&a.some(e=>e>=n);){const t=e[s];a[t.lane]=t.start,s--}s=Math.max(0,s-s%o),r=Math.min(l,r+(o-1-r%o))}return{startIndex:s,endIndex:r}}(e,t,n,o,1===o&&null!=this._flatMeasurements?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ni(()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,o,i)=>null===o||null===i?[]:e({startIndex:o,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t;if(!this.scrollState||"smooth"!==this.scrollState.behavior)return!0;const n=this.scrollState.index??(null==(t=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:t.index);if(void 0!==n&&this.range){const t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,n-t),i=Math.min(this.options.count-1,n+t);return e>=o&&e<=i}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});const t=this.indexFromElement(e),n=this.options.getItemKey(t),o=this.elementsCache.get(n);o!==e&&(o&&this.observer.unobserve(o),this.observer.observe(e),this.elementsCache.set(n,e)),this.isScrolling&&!this.scrollState||!this.shouldMeasureDuringScroll(t)||this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var n,o;if(e<0||e>=this.options.count)return;let i,l,s;const r=this._flatMeasurements;if(1===this.options.lanes&&null!==r)s=this.options.getItemKey(e),l=r[2*e],i=r[2*e+1];else{const t=this.measurementsCache[e];if(!t)return;s=t.key,l=t.start,i=t.size}const a=t-(this.itemSizeCache.get(s)??i);if(0!==a){const r="end"===this.options.anchorTo&&"smooth"!==(null==(n=this.scrollState)?void 0:n.behavior)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=r?this.getTotalSize():0,u="smooth"!==(null==(o=this.scrollState)?void 0:o.behavior)&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:s,start:l,size:i,end:l+i,lane:0},a,this):l<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(s)||"backward"!==this.scrollDirection));(null===this.pendingMin||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(s,t),this.itemSizeCacheVersion++,r?this.applyScrollAdjustment(this.getTotalSize()-c):u&&this.applyScrollAdjustment(a),this.notify(!1)}},this.getVirtualItems=ni(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const n=[];for(let o=0,i=e.length;o<i;o++){const i=t[e[o]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0===t.length)return;const n=this._flatMeasurements,o=1===this.options.lanes&&null!=n;return oi(t[bi(0,t.length-1,o?e=>n[2*e]:e=>oi(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();"auto"===t&&(t=e>=i+o?"end":"start"),"center"===t?e+=(n-o)/2:"end"===t&&(e-=o);const l=this.getMaxScrollOffset();return Math.max(Math.min(l,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.getSize(),o=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if("auto"===t)if(i.end>=o+n-this.options.scrollPaddingEnd)t="end";else{if(!(i.start<=o+this.options.scrollPaddingStart))return[o,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];const l="end"===t?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,t,i.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:n="auto"}={})=>{const o=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t="auto",behavior:n="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));const o=this.getOffsetForIndex(e,t);if(!o)return;const[i,l]=o,s=this.now();this.scrollState={index:e,align:l,behavior:n,startedAt:s,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t="auto"}={})=>{const n=this.getScrollOffset()+e,o=this.now();this.scrollState={index:null,align:"start",behavior:t,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e="auto"}={})=>{this.options.count>0?this.scrollToIndex(this.options.count-1,{align:"end",behavior:e}):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;if(0===t.length)n=this.options.paddingStart;else if(1===this.options.lanes){const o=t.length-1,i=this._flatMeasurements;n=null!=i?i[2*o]+i[2*o+1]:(null==(e=t[o])?void 0:e.end)??0}else{const e=Array(this.options.lanes).fill(null);let o=t.length-1;for(;o>=0&&e.some(e=>null===e);){const n=t[o];null===e[n.lane]&&(e[n.lane]=n.end),o--}n=Math.max(...e.filter(e=>null!==e))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const e=[];if(0===this.itemSizeCache.size)return e;const t=this.getMeasurements();for(const n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){0!==e&&(si()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),null!==this.scrollOffset&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){this.targetWindow?null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})):this.scrollState=null}reconcileScroll(){if(!this.scrollState)return;if(!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3)return void(this.scrollState=null);const e=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&(o=t,i=this.getScrollOffset(),Math.abs(o-i)<1.01)){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1)return this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:"auto"}),void(this.scrollState=null)}else if(this.scrollState.stableFrames=0,n){const e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),o="smooth"===this.scrollState.behavior&&n>e;this.scrollState.lastTargetOffset=t,o||(this.scrollState.behavior="auto"),this._scrollToOffset(t,{adjustments:void 0,behavior:o?"smooth":"auto"})}var o,i;this.scheduleScrollReconcile()}};const bi=(e,t,n,o)=>{for(;e<=t;){const i=(e+t)/2|0,l=n(i);if(l<o)e=i+1;else{if(!(l>o))return i;t=i-1}}return e>0?e-1:0},_i="m477.8 140.2-106-106a62.132 62.132 0 0 0-93.617 81.24l-4.913 5.533-97.654 42.9-42.611-23.026a24.04 24.04 0 0 0-28.86 4.638L62.6 189.487a23.88 23.88 0 0 0 .479 33.449l101.68 101.679L16 473.373V496h22.627l148.758-148.758L288.6 448.457a23.93 23.93 0 0 0 33.275.642l44.425-41.128a23.98 23.98 0 0 0 4.773-29.092l-23.344-42.858 42.131-90.515 8.6-10.318A62.134 62.134 0 0 0 477.8 140.2m-22.628 65.231a30.125 30.125 0 0 1-42.6 0l-16.885-16.886-33.08 39.678-50.7 108.933 28.087 51.566-34.209 31.669L91.2 205.806l32-33.89 50.969 27.543 118.386-52.008 29.177-32.863-15.158-15.161a30.126 30.126 0 0 1 42.6-42.6l106 106a30.126 30.126 0 0 1 0 42.6Z",wi='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false">',vi=`${wi}<path fill="currentColor" d="${_i}"/></svg>`,Ci=`${wi}<g transform="translate(512 0) scale(-1 1)"><path fill="currentColor" d="${_i}"/></g></svg>`,Si={addCondition:"Add condition",applyFilter:"Apply",clearFilter:"Clear filter",clearSort:"Unsort",columnMenu:"Column options for {column}",filterAction:"Filter…",filterColumn:"Filter {column}",firstPage:"First page",globalFilterLabel:"Search",globalFilterPlaceholder:"Search",hideColumn:"Hide column",itemsInfo:"{first}–{last} of {total}",joinAnd:"AND",joinOr:"OR",lastPage:"Last page",loadError:"Failed to load data",loading:"Loading…",moveEnd:"Move to end",moveStart:"Move to start",nextPage:"Next page",operatorBetween:"Between",operatorBlank:"Blank",operatorContains:"Contains",operatorEndsWith:"Ends with",operatorEquals:"Equals",operatorGreaterThan:"Greater than",operatorGreaterThanOrEqual:"Greater than or equal",operatorLessThan:"Less than",operatorLessThanOrEqual:"Less than or equal",operatorNotBlank:"Not blank",operatorNotContains:"Does not contain",operatorNotEquals:"Not equals",operatorStartsWith:"Starts with",pageSizeLabel:"Rows per page",paginationLabel:"Pagination",pinEnd:"Pin to end",pinStart:"Pin to start",previousPage:"Previous page",redoneAnnouncement:"Change redone",reorderRow:"Reorder row",resetColumns:"Reset",resultsAnnouncement:"{count} results",searchValues:"Search values",selectAllRows:"Select all rows",selectAllValues:"Select all",selectRow:"Select row",showAllColumns:"Show all",sortAscending:"Sort ascending",sortDescending:"Sort descending",toolbarColumns:"Columns",toolbarExport:"Export",toolbarPrint:"Print",toolbarRedo:"Redo",toolbarUndo:"Undo",undoneAnnouncement:"Change undone",unpin:"Unpin"},yi=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e),xi="data-grid-cell-pinned-start",Ii="data-grid-cell-pinned-end",Ri="data-grid-cell-pinned-start-last",Ei="data-grid-cell-pinned-end-first",Mi=(e,t)=>{e.classList.remove(xi,Ii,Ri,Ei),e.style.insetInlineStart="",e.style.insetInlineEnd="",t&&("start"===t.side?(e.classList.add(xi),t.edge&&e.classList.add(Ri),e.style.insetInlineStart=t.afterSelect?`calc(var(--cui-data-grid-select-cell-width) + ${t.offset}px)`:`${t.offset}px`):(e.classList.add(Ii),t.edge&&e.classList.add(Ei),e.style.insetInlineEnd=`${t.offset}px`))},Fi="data-grid-cell-selected",Ai=["top","right","bottom","left"],Di=(e,t,n)=>{"string"!=typeof t?1===e.childNodes.length&&e.firstChild===t||e.replaceChildren(t):e.innerHTML=n(t)},Li="data-grid-cell-editor",Pi=e=>e?e.desc?"descending":"ascending":"neutral",Oi=(e,t)=>"ascending"===e?t.sortAscending:"descending"===e?t.sortDescending:t.sortNeutral,zi=()=>{const e=document.createElement("span");return e.classList.add("data-grid-resizer"),e.setAttribute("aria-hidden","true"),e.dataset.coreuiResizer="",e},Vi=e=>{const t=document.createElement("thead");t.classList.add("data-grid-header");const n=new Map,o=new Map,i=new Map,l=new Map,s=[],r=new Map(e.columns.map(e=>[e.key,!1!==e.movable])),{row:a,selectAllInput:c,leadingCells:u}=((e,t,n,o)=>{const i=document.createElement("tr");let l=null;const s=[];if(e.cellNavigation&&i.setAttribute("role","row"),e.rowOrder){const t=(()=>{const e=document.createElement("th");return e.classList.add("data-grid-row-handle-cell"),e.setAttribute("scope","col"),e})();e.cellNavigation&&t.setAttribute("role","columnheader"),s.push(t),i.append(t)}if(e.selection){const{cell:t,input:n}=(e=>{const t=document.createElement("th");if(t.classList.add("data-grid-select-cell"),t.setAttribute("scope","col"),!e.selectAll)return{cell:t,input:null};const n=document.createElement("input");return n.type="checkbox",n.classList.add("form-check-input"),n.setAttribute("aria-label",e.labels.selectAllRows),n.dataset.coreuiSelectAll="",t.append(n),{cell:t,input:n}})(e);l=n,s.push(t),e.cellNavigation&&(t.setAttribute("role","columnheader"),n&&(n.tabIndex=-1)),i.append(t)}for(const l of e.columns){const s=document.createElement("th");s.setAttribute("scope","col"),s.dataset.coreuiColumn=l.key,e.cellNavigation&&(s.setAttribute("role","columnheader"),s.tabIndex=-1),l.style&&Object.assign(s.style,l.style),void 0!==l.width&&(s.style.width=`${l.width}px`);const r=document.createElement("div");if(r.classList.add("data-grid-header-cell"),e.isSortable(l)){s.classList.add("data-grid-sortable");const t=document.createElement("button");t.type="button",t.classList.add("data-grid-sort-button"),t.append(l.label??l.key);const n=document.createElement("span");n.classList.add("data-grid-sort-icon"),n.setAttribute("aria-hidden","true"),n.innerHTML=e.icons.sortNeutral,n.dataset.coreuiSort="neutral",t.append(n),o.set(l.key,n),r.append(t)}else{const e=document.createElement("span");e.classList.add("data-grid-header-label"),e.textContent=l.label??l.key,r.append(e)}if(e.hasFilterMenu(l)){const t=document.createElement("button");t.type="button",t.classList.add("btn","btn-ghost","btn-sm","data-grid-filter-button"),t.innerHTML=e.icons.filter,t.dataset.coreuiFilter=l.key,t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded","false");const n=yi(e.labels.filterColumn,{column:l.label??l.key});t.setAttribute("aria-label",n),t.setAttribute("data-coreui-tooltip",n),r.append(t)}if(e.hasMenu(l)){const t=document.createElement("button");t.type="button",t.classList.add("btn","btn-ghost","btn-sm","data-grid-menu-button"),t.innerHTML=e.icons.columnMenu,t.dataset.coreuiMenu=l.key,t.setAttribute("aria-haspopup","menu"),t.setAttribute("aria-expanded","false");const n=yi(e.labels.columnMenu,{column:l.label??l.key});t.setAttribute("aria-label",n),t.setAttribute("data-coreui-tooltip",n),r.append(t)}if(s.append(r),e.cellNavigation)for(const e of r.querySelectorAll("button"))e.tabIndex=-1;if(e.resizable&&e.isResizable(l)){const e=zi();n.set(l.key,e),s.append(e)}t.set(l.key,s),i.append(s)}return{row:i,selectAllInput:l,leadingCells:s}})(e,n,o,i);t.append(a);let d=null,g=[];if(e.filterRow){const n=((e,t,n)=>{const o=document.createElement("tr");o.classList.add("data-grid-filter-row"),e.cellNavigation&&o.setAttribute("role","row");const i=[];for(const t of[e.rowOrder,e.selection])if(t){const e=document.createElement("th");i.push(e),o.append(e)}for(const i of e.columns){const l=document.createElement("th"),s=e.table.getColumn(i.key);if(e.isFilterable(i)&&i.filter&&s){const t=i.filter({column:s,table:e.table,labels:e.labels});n.push(t),l.append(t.element)}t.set(i.key,l),o.append(l)}return{row:o,leadingCells:i}})(e,l,s);g=n.leadingCells,d=n.row,t.append(n.row)}let m=null;return{element:t,rowCount:e.filterRow?2:1,update(t){const f=t.order.join("|");f!==m&&(m=f,(t=>{const o=new Set(t),i=(n,i,l)=>{const s=[...l];for(const e of t){const t=i.get(e);t&&s.push(t)}if(n.append(...s),e.cellNavigation)for(const[e,t]of s.entries())t.setAttribute("aria-colindex",String(e+1));for(const[e,t]of i)o.has(e)||t.remove()};i(a,n,u),d&&i(d,l,g)})(t.order));for(const[o,l]of n){const n=t.sorting.find(e=>e.id===o),s=Pi(n);"neutral"===s?l.removeAttribute("aria-sort"):l.setAttribute("aria-sort",s);const r=i.get(o);r&&r.dataset.coreuiSort!==s&&(r.dataset.coreuiSort=s,r.innerHTML=Oi(s,e.icons)),t.sizes&&void 0!==t.sizes[o]&&(l.style.width=`${t.sizes[o]}px`),t.pinning&&Mi(l,t.pinning.columns[o]??null)}if(e.draggable){const e=e=>t.pinning?.columns[e]?.side??"center",o=new Map;for(const n of t.order)if(r.get(n)){const t=e(n);o.set(t,(o.get(t)??0)+1)}for(const[t,i]of n)Boolean(r.get(t))&&(o.get(e(t))??0)>1?(i.dataset.coreuiDraggable="",i.style.touchAction="none"):(delete i.dataset.coreuiDraggable,i.style.touchAction="")}for(const[e,n]of o)n.classList.toggle("data-grid-resizer-active",t.resizingColumn===e);if(t.filteredColumns)for(const[e,o]of n)o.querySelector("[data-coreui-filter]")?.classList.toggle("data-grid-filter-button-filtered",t.filteredColumns.includes(e));if(t.pinning){for(const[e,n]of l)Mi(n,t.pinning.columns[e]??null);for(const e of[...u,...g])Mi(e,t.pinning.select)}c&&t.selectAll&&(c.checked=t.selectAll.checked,c.indeterminate=t.selectAll.indeterminate);for(const e of s)e.update?.()},dispose(){for(const e of s)e.dispose?.()}}},Ti=(e,t="data-grid-loading")=>{const n=document.createElement("div");n.classList.add(t),n.hidden=!0;const o=document.createElement("div");o.classList.add("spinner-border"),o.setAttribute("role","status");const i=document.createElement("span");return i.classList.add("visually-hidden"),i.textContent=e.loading,o.append(i),n.append(o),{element:n,setVisible(e){n.hidden=!e}}},ki={contains:"operatorContains",notContains:"operatorNotContains",equals:"operatorEquals",notEquals:"operatorNotEquals",startsWith:"operatorStartsWith",endsWith:"operatorEndsWith",blank:"operatorBlank",notBlank:"operatorNotBlank",greaterThan:"operatorGreaterThan",greaterThanOrEqual:"operatorGreaterThanOrEqual",lessThan:"operatorLessThan",lessThanOrEqual:"operatorLessThanOrEqual",between:"operatorBetween"};let Bi=0;const Hi=e=>"number"===e?"number":"date"===e?"date":"text",ji=e=>{const t=document.createElement("div");t.classList.add("data-grid-filter-menu"),t.setAttribute("role","dialog"),t.id="data-grid-filter-menu-"+ ++Bi;let n=null;const o=(e=!1)=>{n&&(n.setAttribute("aria-expanded","false"),n.removeAttribute("aria-controls"),e&&n.focus(),n=null,t.remove(),document.removeEventListener("pointerdown",i,!0),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l))},i=e=>{const i=e.target;t.contains(i)||n?.contains(i)||o()},l=e=>{e?.target instanceof Node&&t.contains(e.target)||o()},s=e=>{"Escape"===e.key&&(e.stopPropagation(),o(!0))};t.addEventListener("keydown",s);const r=(t,n)=>{const o=document.createElement("div");o.classList.add("data-grid-filter-menu-condition");const i=document.createElement("select");i.classList.add("form-select","form-select-sm"),i.setAttribute("aria-label",e.labels.filterAction);for(const n of qo[t]){const t=document.createElement("option");t.value=n,t.textContent=e.labels[ki[n]],i.append(t)}i.value=n?.operator??qo[t][0];const l=document.createElement("input");l.type=Hi(t),l.classList.add("form-control","form-control-sm"),l.dataset.coreuiFilterValue="",l.value=void 0===n?.value?"":String(n.value);const s=document.createElement("input");s.type=Hi(t),s.classList.add("form-control","form-control-sm"),s.dataset.coreuiFilterValue2="",s.value=void 0===n?.value2?"":String(n.value2);const r=()=>{const e=i.value;l.hidden=Go.has(e),s.hidden="between"!==e};return i.addEventListener("change",r),o.append(i,l,s),r(),o},a=(t,n)=>{const i=document.createElement("div");i.classList.add("data-grid-filter-menu-footer");const l=document.createElement("button");l.type="button",l.classList.add("btn","btn-primary","btn-sm"),l.textContent=e.labels.applyFilter,l.addEventListener("click",t);const s=document.createElement("button");return s.type="button",s.classList.add("btn","btn-outline-secondary","btn-sm"),s.textContent=e.labels.clearFilter,s.addEventListener("click",()=>{e.applyFilter(n),o(!0)}),i.append(l,s),i},c=(s,c)=>{o();const u=e.getColumn(c);if(!u)return;t.setAttribute("aria-label",yi(e.labels.filterColumn,{column:u.label??u.key}));const d=u.filterType??"text";t.replaceChildren("select"===d?(t=>{const n=e.getFacetedValues(t),i=e.getFilterValue(t),l=i&&"string"!=typeof i&&"operator"in i?new Set(i.value.map(String)):null,s=document.createElement("div"),r=document.createElement("div");r.classList.add("data-grid-filter-menu-values");const c=[],u=(e,t)=>{const n=document.createElement("label");n.classList.add("form-check");const o=document.createElement("input");o.type="checkbox",o.classList.add("form-check-input"),o.checked=t;const i=document.createElement("span");return i.classList.add("form-check-label"),i.textContent=e,n.append(o,i),r.append(n),o},d=u(e.labels.selectAllValues,null===l);d.dataset.coreuiSelectAllValues="";for(const e of n){const t=u(String(e),null===l||l.has(String(e)));t.dataset.coreuiFilterOption=String(e),c.push(t)}const g=()=>{d.checked=c.every(e=>e.checked)};if(d.addEventListener("change",()=>{for(const e of c)e.checked=d.checked}),r.addEventListener("change",e=>{e.target!==d&&g()}),g(),n.length>10){const t=document.createElement("input");t.type="text",t.classList.add("form-control","form-control-sm"),t.setAttribute("aria-label",e.labels.searchValues),t.placeholder=e.labels.searchValues,t.addEventListener("input",()=>{const e=t.value.toLowerCase();for(const t of c)t.closest("label").hidden=!t.dataset.coreuiFilterOption.toLowerCase().includes(e)}),s.append(t)}return s.append(r),s.append(a(()=>{const n=c.filter(e=>e.checked);e.applyFilter(t,n.length===c.length?void 0:{operator:"in",value:n.map(e=>e.dataset.coreuiFilterOption)}),o(!0)},t)),s})(c):((n,i)=>{const l=e.getFilterValue(n),s=l&&"string"!=typeof l&&"conditions"in l?l.conditions:[],c=l&&"string"!=typeof l&&"conditions"in l?l.join:"and",u=[r(i,s[0]??null)],d=document.createElement("div");d.append(u[0]);const g=document.createElement("div");g.classList.add("data-grid-filter-menu-join");const m=`${t.id}-join`;for(const t of["and","or"]){const n=document.createElement("label"),o=document.createElement("input");o.type="radio",o.classList.add("form-check-input"),o.name=m,o.value=t,o.checked=c===t,n.append(o,` ${"and"===t?e.labels.joinAnd:e.labels.joinOr}`),g.append(n)}const f=document.createElement("button");f.type="button",f.classList.add("btn","btn-link","btn-sm"),f.textContent=e.labels.addCondition;const h=()=>{u.length>=2||(u.push(r(i,s[1]??null)),f.before(g,u[1]),f.hidden=!0)};return f.addEventListener("click",h),d.append(f),s.length>1&&h(),d.append(a(()=>{const t=u.map(e=>(e=>{const t=e.querySelector("select").value,{value:n}=e.querySelector("[data-coreui-filter-value]"),o=e.querySelector("[data-coreui-filter-value2]").value;return Go.has(t)?{operator:t}:""===n.trim()?null:{operator:t,value:n,..."between"===t&&""!==o.trim()&&{value2:o}}})(e)).filter(e=>null!==e),i=g.querySelector("input:checked")?.value??"and";e.applyFilter(n,0===t.length?void 0:{conditions:t,join:i}),o(!0)},n)),d})(c,d)),n=s,s.setAttribute("aria-expanded","true"),s.setAttribute("aria-controls",t.id),e.root.append(t);const g=e.root.getBoundingClientRect(),m=s.getBoundingClientRect();t.style.top=m.bottom-g.top+"px",t.style.left=`${Math.max(m.right-g.left-t.offsetWidth,0)}px`,document.addEventListener("pointerdown",i,!0),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),t.querySelector("select, input")?.focus()};return{toggle(e,t){n!==e?(o(),c(e,t)):o(!0)},close(){o()},dispose(){o(),t.removeEventListener("keydown",s)}}},Ni="data-grid-menu-item";let $i=0;const qi=(e,t,n={})=>{const o=document.createElement("li");o.classList.add("page-item"),n.active&&(o.classList.add("active"),o.setAttribute("aria-current","page")),n.disabled&&o.classList.add("disabled");const i=document.createElement("button");return i.type="button",i.classList.add("page-link"),i.textContent=e,i.disabled=Boolean(n.disabled),i.dataset.coreuiPage=t,n.ariaLabel&&i.setAttribute("aria-label",n.ariaLabel),o.append(i),o};let Gi=0;const Ki="data-coreui-tooltip",Wi=`[${Ki}]`,Ui=(e,t)=>"all"===t?e.getCoreRowModel().rows:"selected"===t?e.getSelectedRowModel?.().rows??[]:(e.getSortedRowModel??e.getFilteredRowModel??e.getCoreRowModel)().rows,Zi=(e,t={})=>{const n=t.delimiter??",",o=(e=>e.getCenterVisibleLeafColumns?[...e.getStartVisibleLeafColumns?.()??[],...e.getCenterVisibleLeafColumns(),...e.getEndVisibleLeafColumns?.()??[]]:e.getVisibleLeafColumns?.()??e.getAllLeafColumns())(e),i=e=>{return((e,t)=>/["\r\n]/.test(e)||e.includes(t)?`"${e.replace(/"/g,'""')}"`:e)(t.sanitize?/^[=+\-@\t\r]/.test(o=e)?`'${o}`:o:e,n);var o},l=e=>e.map(i).join(n),s=[l(o.map(e=>(e=>String(e.columnDef.meta?.label??e.id))(e))),...Ui(e,t.scope).map(e=>l(o.map(t=>{const n=e.getValue(t.id),o=(e=>e.columnDef.meta?.formatter)(t);return String(o?o(n,e.original)??"":n??"")})))].join("\r\n");return t.bom?`\ufeff${s}`:s},Xi=(e,t={})=>{const n=new Blob([Zi(e,t)],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(n),i=document.createElement("a");i.href=o,i.download=t.filename??"export.csv",i.style.display="none",document.body.append(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(o))},Yi=(e,t)=>{let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>e(...o),t)}},Ji={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Qi={...Ji,svg:["xmlns","version","baseprofile","width","height","viewbox","preserveaspectratio","aria-hidden","role","focusable","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin"],g:["id","class","transform","style"],path:["id","class","d","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","stroke-opacity"],circle:["id","class","cx","cy","r","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],rect:["id","class","x","y","width","height","rx","ry","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],ellipse:["id","class","cx","cy","rx","ry","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],line:["id","class","x1","y1","x2","y2","stroke","stroke-width","stroke-linecap","stroke-opacity"],polygon:["id","class","points","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],polyline:["id","class","points","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],text:["id","class","x","y","dx","dy","text-anchor","font-family","font-size","font-weight","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],tspan:["id","class","x","y","dx","dy","text-anchor","font-family","font-size","font-weight","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],defs:[],symbol:["id","class","viewbox","preserveaspectratio"],use:["id","class","x","y","width","height","href"],image:["id","class","x","y","width","height","href","preserveaspectratio","xlink:href"],pattern:["id","class","x","y","width","height","patternunits","patterncontentunits","patterntransform","preserveaspectratio"],lineargradient:["id","class","gradientunits","x1","y1","x2","y2","spreadmethod","gradienttransform"],radialgradient:["id","class","gradientunits","cx","cy","r","fx","fy","spreadmethod","gradienttransform"],mask:["id","class","x","y","width","height","maskunits","maskcontentunits","masktransform"],clippath:["id","class","clippathunits"],marker:["id","class","markerunits","markerwidth","markerheight","orient","preserveaspectratio","viewbox","refx","refy"],title:[],desc:[]},el=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),tl=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,nl=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?!el.has(n)||Boolean(tl.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(n))};function ol(e,t,n){if(!e.length)return e;if(n&&"function"==typeof n)return n(e);const o=(new window.DOMParser).parseFromString(e,"text/html"),i=[].concat(...o.body.querySelectorAll("*"));for(const e of i){const n=e.nodeName.toLowerCase();if(!Object.keys(t).includes(n)){e.remove();continue}const o=[].concat(...e.attributes),i=[].concat(t["*"]||[],t[n]||[]);for(const t of o)nl(t,i)||e.removeAttribute(t.nodeName)}return o.body.innerHTML}const il=".coreui.data-grid",ll=`change${il}`,sl=`click${il}`,rl=`dataError${il}`,al=`dataLoad${il}`,cl=`dblclick${il}`,ul=`editCancel${il}`,dl=`editCommit${il}`,gl=`editStart${il}`,ml=`filterChange${il}`,fl=`input${il}`,hl=`cellCopy${il}`,pl=`orderChange${il}`,bl=`rowOrderChange${il}`,_l=`paginationChange${il}`,wl=`pinningChange${il}`,vl=`selectionChange${il}`,Cl=`sizingChange${il}`,Sl=`sortingChange${il}`,yl=`visibilityChange${il}`,xl=`focusin${il}`,Il=`focusout${il}`,Rl=`keydown${il}`,El=`mousedown${il}`,Ml=`mouseenter${il}`,Fl=`pointerdown${il}`,Al=`touchstart${il}`,Dl="data-grid",Ll="tbody td[data-coreui-column]",Pl="input[data-coreui-global-filter]",Ol="[data-coreui-resizer]",zl="button[data-coreui-toolbar-redo]",Vl="button[data-coreui-toolbar-undo]",Tl=[5,10,20,50];let kl=0;const Bl={ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up"},Hl="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]",jl=(e,t)=>{const n=t?0:-1;e.tabIndex!==n&&(e.tabIndex=n)},Nl={autoRowHeight:!1,cellNavigation:!1,cellSelection:!1,columnFilters:!1,columnMenu:!1,columnMenuIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M204 148a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26M204 264a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26M204 380a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26"/></svg>',columnOrder:!1,columnPinning:!1,columnSizing:!1,columnVisibility:!1,columns:[],dataProvider:null,editing:!1,empty:"No items found",features:null,filterIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M96 197.333h320v32H96zm72 101.334h176v32H168zM216 400h80v32h-80zM48 96h416v32H48z"/></svg>',globalFilter:!1,hideColumnIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="m397.222 131.1-.218-.223c-63.173-63.17-158.534-75.015-233.776-35.531l23.938 23.939c61.571-27.691 136.573-16.327 187.105 34.115L464 246.683v3.107l-71.744 74.585 22.63 22.63L496 262.683V233.79Z"/><path fill="currentColor" d="M352.8 284.33a103.307 103.307 0 0 0-132.893-132.892L246.1 177.63a71.228 71.228 0 0 1 80.507 80.508Zm17.1 62.938-33.831-33.831c.088-.108.179-.212.266-.32l-22.805-22.806q-.126.168-.253.334l-99.681-99.681.334-.253-22.81-22.805c-.108.087-.213.179-.321.266L38.627 16H16v22.627l95.689 95.689L16 233.79v28.893l98.778 102.689.218.222A199.73 199.73 0 0 0 367.372 390l106 106H496v-22.627L392.537 369.911Zm-177.157-131.9 96.128 96.132a71.28 71.28 0 0 1-96.133-96.133Zm-55.014 127.705L48 249.79v-3.107l86.319-89.737 35.065 35.064a103.248 103.248 0 0 0 142.842 142.843l32.007 32.007c-64.51 40.015-150.522 32.095-206.504-23.787"/></svg>',history:!1,infiniteScroll:!1,itemKey:null,items:[],labels:{},moveEndIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M296.007 56h-38.632v120h-144v160h144v120H296l200-199.8Zm-6.632 361.384V304h-144v-96h144V94.639l161.37 161.535ZM17.375 56h32v400h-32z"/></svg>',moveStartIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M254.625 56h-38.632L16 256.2 216 456h38.623V336h144V176h-144Zm112 152v96h-144v113.384l-161.37-161.21 161.37-161.535V208Zm96-152h32v400h-32z"/></svg>',overscan:10,pagination:!1,pinEndIcon:Ci,pinStartIcon:vi,printTitle:null,rowHandleIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M160 96h64v64h-64zm0 128h64v64h-64zm0 128h64v64h-64zM288 96h64v64h-64zm0 128h64v64h-64zm0 128h64v64h-64z"/></svg>',rowHeight:44,rowOrder:!1,rowSelection:!1,sanitize:!0,sanitizeFn:null,slots:{},sortAscendingIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M390.624 150.625 256 16 121.376 150.625l22.628 22.627 95.997-95.998v417.982h32V77.257l95.995 95.995z"/></svg>',sortDescendingIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="m367.997 338.75-95.998 95.997V17.503h-32v417.242l-95.996-95.995-22.627 22.627L256 496l134.624-134.623z"/></svg>',sortNeutralIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M384 433.373V160h-32v274.51l-69.823-69.823-22.627 22.626 107.882 107.883 107.881-107.883-22.626-22.626zM159.432 17.372 51.55 125.255l22.627 22.627L144 78.059V352h32V79.195l68.687 68.687 22.626-22.627z"/></svg>',sorterVisibility:!1,sorting:!0,stateKey:null,toolbar:!1,toolbarColumnsIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M16 64v384h480V64Zm304 32v320H192V96ZM48 96h112v320H48Zm416 320H352V96h112Z"/></svg>',toolbarExportIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M16 464h480v32H16zm379.313-164.687-22.626-22.626L280 369.373V16h-32v353.373l-92.687-92.686-22.626 22.626L264 430.627z"/></svg>',toolbarPrintIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M400 144V16H112v128H16v256h96v96h288v-96h96V144ZM144 48h224v96H144Zm224 416H144V304h224Zm96-96h-64V272H112v96H48V176h416Z"/><path fill="currentColor" d="M384 208h32v32h-32z"/></svg>',toolbarRedoIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M361.376 495.163 226.753 360.54l22.627-22.627 111.996 111.996 111.997-111.996L496 360.54z"/><path fill="currentColor" d="M377.377 472.52h-32V196.426C345.377 114.584 278.794 48 196.952 48c-83.229 0-148.426 63.106-148.426 143.667h-32c0-48.024 18.85-92.569 53.079-125.429C103.35 33.842 148.576 16 196.952 16c99.487 0 180.425 80.938 180.425 180.426Z"/></svg>',toolbarUndoIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M495.473 197.262c0-73.061-43.651-136.118-106.242-164.462q-2-.9-4.021-1.762-4.046-1.715-8.19-3.235-2.071-.761-4.167-1.47-4.19-1.422-8.468-2.64a180.95 180.95 0 0 0-98.675 0q-4.278 1.218-8.469 2.64-2.094.71-4.166 1.47-4.143 1.519-8.19 3.235-2.023.857-4.021 1.762c-62.592 28.344-106.242 91.4-106.242 164.462v237.483L38.627 338.75 16 361.377 150.623 496l134.623-134.623-22.627-22.627-96 96V197.263c0-72.891 52.814-133.678 122.186-146.1a149.4 149.4 0 0 1 52.479 0c69.371 12.426 122.186 73.213 122.186 146.1h32Z"/></svg>',unpinIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="m427.314 107.313-22.628-22.626L256 233.373 107.314 84.687l-22.628 22.626L233.373 256 84.686 404.687l22.628 22.626L256 278.627l148.686 148.686 22.628-22.626L278.627 256z"/></svg>',virtualization:!0},$l={autoRowHeight:"boolean",cellNavigation:"boolean",cellSelection:"boolean",columnFilters:"boolean",columnMenu:"(boolean|function)",columnMenuIcon:"string",columnOrder:"(boolean|array)",columnPinning:"(boolean|object)",columnSizing:"(boolean|object)",columnVisibility:"(boolean|object)",columns:"array",dataProvider:"(function|null)",editing:"boolean",empty:"(string|function)",features:"(object|null)",filterIcon:"string",globalFilter:"boolean",hideColumnIcon:"string",history:"boolean",infiniteScroll:"(boolean|object)",itemKey:"(function|null)",items:"array",labels:"object",moveEndIcon:"string",moveStartIcon:"string",overscan:"number",pagination:"(boolean|object)",pinEndIcon:"string",pinStartIcon:"string",printTitle:"(string|null)",rowHandleIcon:"string",rowHeight:"number",rowOrder:"boolean",rowSelection:"(boolean|object)",sanitize:"boolean",sanitizeFn:"(function|null)",slots:"object",sortAscendingIcon:"string",sortDescendingIcon:"string",sortNeutralIcon:"string",sorterVisibility:"(string|boolean)",sorting:"(boolean|object)",stateKey:"(string|null)",toolbar:"(boolean|object)",toolbarColumnsIcon:"string",toolbarExportIcon:"string",toolbarPrintIcon:"string",toolbarRedoIcon:"string",toolbarUndoIcon:"string",unpinIcon:"string",virtualization:"boolean"};var ql=class e extends X{constructor(e,t){super(e,t),this._unsubscribeState=null,this._virtualizer=null,this._toolbar=null,this._paginations=[],this._emptySlot=null,this._dataSource=null,this._loading=null,this._loadingMore=null,this._loadFailed=!1,this._loadedItems=[],this._loadMorePending=!1,this._pageResetPending=!1,this._dataVersion=0,this._liveRegion=null,this._selectionAnchorIndex=null,this._activeCell=null,this._containsFocus=!1,this._editingCell=null,this._undoStack=[],this._redoStack=[],this._persistState=null,this._editor=null,this._editorPointerdownHandler=null,this._editorPopup=null,this._editorErrorElement=null,this._editorFocusPending=!1,this._columnsByKey=new Map,this._columnDrag=null,this._rowDrag=null,this._menu=null,this._tooltip=null,this._filterMenu=null,this._columnChooser=null,this._toolbarConfig=null,this._element&&(this._labels={...Si,...this._config.labels},this._scheduler=(e=>{let t=!1,n=!1;const o=()=>{t=!1,n||e()};return{schedule(){t||n||(t=!0,"function"!=typeof window.requestAnimationFrame?setTimeout(o,16):window.requestAnimationFrame(o))},dispose(){n=!0}}})(()=>this._update()),this._table=this._createTable(),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("visually-hidden"),this._liveRegion.setAttribute("aria-live","polite"),this._element.append(this._liveRegion),this._render(),this._addEventListeners(),this._tooltip=(e=>{const t=document.createElement("div");t.className="data-grid-tooltip",t.setAttribute("role","tooltip"),t.setAttribute("aria-hidden","true"),t.hidden=!0,e.append(t);let n,o=null;const i=e=>{const t=e instanceof Element?e.closest(Wi):null;return t instanceof HTMLElement&&t.getAttribute(Ki)?t:null},l=e=>{o=e,t.textContent=e.getAttribute(Ki),t.style.visibility="hidden",t.hidden=!1,(()=>{if(!o)return;const e=o.getBoundingClientRect(),n=t.offsetWidth,i=t.offsetHeight,l=e.top-i-6,s=l>=0?l:e.bottom+6,r=Math.max(4,Math.min(e.left+(e.width-n)/2,window.innerWidth-n-4));t.style.top=`${s}px`,t.style.left=`${r}px`,t.style.visibility="visible"})()},s=()=>{clearTimeout(n),o=null,t.hidden=!0},r=e=>{const t=i(e.target);t&&t!==o&&(clearTimeout(n),n=setTimeout(()=>l(t),200))},a=e=>{o&&e.relatedTarget instanceof Node&&o.contains(e.relatedTarget)||s()},c=e=>{const t=i(e.target);t&&l(t)};return e.addEventListener("pointerover",r),e.addEventListener("pointerout",a),e.addEventListener("pointerdown",s),e.addEventListener("focusin",c),e.addEventListener("focusout",s),window.addEventListener("scroll",s,!0),{dispose(){clearTimeout(n),e.removeEventListener("pointerover",r),e.removeEventListener("pointerout",a),e.removeEventListener("pointerdown",s),e.removeEventListener("focusin",c),e.removeEventListener("focusout",s),window.removeEventListener("scroll",s,!0),t.remove()}}})(this._element),this._restorePersistedState(),this._initDataSource())}get table(){return this._table}static get Default(){return Nl}static get DefaultType(){return $l}static get NAME(){return"data-grid"}getSelectedItems(){return"function"!=typeof this._table.getSelectedRowModel?[]:this._table.getSelectedRowModel().rows.map(e=>e.original)}print(){((e,t,n={})=>{const o=((e,t,n={})=>{const o=document.createElement("div");if(o.className="data-grid-print-root",n.title){const e=document.createElement("h1");e.textContent=n.title,o.append(e)}const i=document.createElement("table");i.classList.add("table");const l=document.createElement("thead"),s=document.createElement("tr");for(const e of t){const t=document.createElement("th");t.scope="col",t.textContent=e.label,s.append(t)}l.append(s);const r=document.createElement("tbody");for(const n of(e=>"function"==typeof e.getSortedRowModel?e.getSortedRowModel().rows:"function"==typeof e.getFilteredRowModel?e.getFilteredRowModel().rows:e.getCoreRowModel().rows)(e)){const e=document.createElement("tr");for(const o of t){const t=document.createElement("td"),i=n.getValue(o.id);t.textContent=o.formatter?o.formatter(i,n.original):String(i??""),e.append(t)}r.append(e)}return i.append(l,r),o.append(i),o})(e,t,n);document.body.append(o);const i=()=>{o.remove(),window.removeEventListener("afterprint",i)};window.addEventListener("afterprint",i);try{window.print()}finally{i()}})(this._table,this._printColumns(),{title:this._config.printTitle??void 0})}getCsv(e){return Zi(this._table,e)}downloadCsv(e){Xi(this._table,e)}getState(){const{state:e}=this._table.store;return{columnFilters:e.columnFilters??[],columnOrder:e.columnOrder??[],columnPinning:e.columnPinning??{start:[],end:[]},columnSizing:e.columnSizing??{},columnVisibility:e.columnVisibility??{},globalFilter:e.globalFilter??"",pagination:e.pagination??{pageIndex:0,pageSize:Number.MAX_SAFE_INTEGER},rowSelection:e.rowSelection??{},sorting:e.sorting??[]}}restoreState(e){if(f(()=>{void 0!==e.columnFilters&&"function"==typeof this._table.setColumnFilters&&this._table.setColumnFilters(e.columnFilters),void 0!==e.columnOrder&&"function"==typeof this._table.setColumnOrder&&this._table.setColumnOrder(e.columnOrder),void 0!==e.columnPinning&&"function"==typeof this._table.setColumnPinning&&this._table.setColumnPinning(e.columnPinning),void 0!==e.columnSizing&&"function"==typeof this._table.setColumnSizing&&this._table.setColumnSizing(e.columnSizing),void 0!==e.columnVisibility&&"function"==typeof this._table.setColumnVisibility&&this._table.setColumnVisibility(e.columnVisibility),void 0!==e.globalFilter&&"function"==typeof this._table.setGlobalFilter&&this._table.setGlobalFilter(e.globalFilter),void 0!==e.pagination&&"function"==typeof this._table.setPagination&&this._table.setPagination(e.pagination),void 0!==e.rowSelection&&"function"==typeof this._table.setRowSelection&&this._table.setRowSelection(e.rowSelection),void 0!==e.sorting&&"function"==typeof this._table.setSorting&&this._table.setSorting(e.sorting)}),void 0!==e.globalFilter){const t=this._element.querySelector(Pl);t&&(t.value=e.globalFilter)}this._scheduler.schedule()}undo(){this._applyHistoryEntry(this._undoStack,this._redoStack,!0)}redo(){this._applyHistoryEntry(this._redoStack,this._undoStack,!1)}_applyHistoryEntry(e,t,n){const o=e.pop();if(!o)return;const i=this._table.getCoreRowModel().rowsById[o.rowId];i?(t.push(o),q.trigger(this._element,dl,{item:i.original,columnId:o.columnId,value:n?o.previousValue:o.value,previousValue:n?o.value:o.previousValue}),this._announce(n?this._labels.undoneAnnouncement:this._labels.redoneAnnouncement),this._updateHistoryButtons()):this._updateHistoryButtons()}setItems(e){this._config.dataProvider||(this._stopEditing({commit:!1}),this._config.items=e,this._dataVersion++,this._virtualizer?.remeasure(),this._table.setOptions(t=>({...t,data:e})),this._scheduler.schedule())}update(e){this._config=this._getConfig({...this._config,...e}),this._labels={...Si,...this._config.labels},this._teardownUi(),this._selectionAnchorIndex=null,this._loadFailed=!1,this._pageResetPending=!1,this._loadedItems=[],this._loadMorePending=!1,this._dataVersion++,this._table=this._createTable(),this._render(),this._initDataSource()}dispose(){this._teardownUi(),this._unsubscribeState?.(),this._unsubscribeState=null,this._scheduler.dispose(),this._tooltip?.dispose(),this._tooltip=null,this._liveRegion&&this._liveRegion.remove(),this._element.classList.remove(Dl),this._element.removeAttribute("data-coreui-sorter-visibility"),super.dispose()}_configAfterMerge(e){return(e.editing||e.cellSelection)&&(e.cellNavigation=!0),e}_createTable(){this._unsubscribeState?.();const e=ti(this._config);return this._unsubscribeState=((e,t)=>{let n=e.store.state;const o=e.store.subscribe(e=>{const o=n;n=e,t(o,e)});return()=>o.unsubscribe()})(e,(e,t)=>{this._notifyStateChange(e,t),this._scheduler.schedule()}),e}_teardownUi(){this._stopEditing({commit:!1}),this._dataSource&&(this._dataSource.dispose(),this._dataSource=null),this._header?.dispose(),this._menu&&(this._menu.dispose(),this._menu=null),this._filterMenu&&(this._filterMenu.dispose(),this._filterMenu=null),this._columnChooser&&(this._columnChooser.dispose(),this._columnChooser=null),this._loading&&(this._loading.element.remove(),this._loading=null),this._loadingMore&&(this._loadingMore.element.remove(),this._loadingMore=null),this._columnDrag&&(this._columnDrag.dispose(),this._columnDrag=null),this._rowDrag&&(this._rowDrag.dispose(),this._rowDrag=null),this._virtualizer&&(this._virtualizer.destroy(),this._virtualizer=null),this._toolbar&&(this._toolbar.dispose?.(),this._toolbar.element.remove(),this._toolbar=null);for(const e of this._paginations)e.dispose?.(),e.element.remove();this._paginations=[],this._emptySlot&&(this._emptySlot.dispose?.(),this._emptySlot=null),this._viewportElement&&this._viewportElement.remove()}_slotContext(){return{table:this._table,labels:this._labels}}_isColumnSortable(e){return Boolean(this._config.sorting)&&!1!==e.sortable}_isColumnFilterable(e){return this._config.columnFilters&&!1!==e.filterable}_isColumnResizable(e){return Boolean(this._config.columnSizing)&&!1!==e.resizable}_sanitizeIcon(e){return this._config.sanitize?ol(e,Qi,this._config.sanitizeFn):e}_hasColumnMenu(e){return!!this._config.columnMenu&&("function"==typeof this._config.columnMenu?this._getMenuActions(e.key).length>0:this._isColumnSortable(e)||Boolean(this._config.columnPinning)||Boolean(this._config.columnVisibility)&&!1!==e.hideable||Boolean(this._config.columnOrder)&&!1!==e.movable)}_renderToolbar(){const e=Zo(this._config);if(this._toolbarConfig=e,this._config.slots.toolbar)return this._toolbar=this._config.slots.toolbar(this._slotContext()),void this._element.append(this._toolbar.element);(e.columns||e.export||e.print||e.search||e.history)&&(this._toolbar=(e=>{const t=document.createElement("div");if(t.classList.add("data-grid-toolbar"),e.columns||e.export||e.print||e.history){const n=document.createElement("div");if(n.classList.add("data-grid-toolbar-actions"),e.columns&&n.append(Yo(e.icons.columns,e.labels.toolbarColumns,"data-coreui-toolbar-columns")),e.export&&n.append(Yo(e.icons.export,e.labels.toolbarExport,"data-coreui-toolbar-export")),e.print&&n.append(Yo(e.icons.print,e.labels.toolbarPrint,"data-coreui-toolbar-print")),e.history){const t=Yo(e.icons.undo,e.labels.toolbarUndo,"data-coreui-toolbar-undo"),o=Yo(e.icons.redo,e.labels.toolbarRedo,"data-coreui-toolbar-redo");t.disabled=!0,o.disabled=!0,n.append(t,o)}t.append(n)}if(e.search){const n=document.createElement("div");n.classList.add("data-grid-toolbar-search");const o=document.createElement("input");o.type="search",o.classList.add("form-control","form-control-sm"),o.placeholder=e.labels.globalFilterPlaceholder,o.setAttribute("aria-label",e.labels.globalFilterLabel),o.dataset.coreuiGlobalFilter="",n.append(o),t.append(n)}return{element:t}})({columns:e.columns,export:e.export,icons:{columns:this._sanitizeIcon(this._config.toolbarColumnsIcon),export:this._sanitizeIcon(this._config.toolbarExportIcon),print:this._sanitizeIcon(this._config.toolbarPrintIcon),redo:this._sanitizeIcon(this._config.toolbarRedoIcon),undo:this._sanitizeIcon(this._config.toolbarUndoIcon)},history:e.history,labels:this._labels,print:e.print,search:e.search}),this._element.append(this._toolbar.element),e.columns&&(this._columnChooser=(e=>{const t=document.createElement("div");t.classList.add("data-grid-column-chooser"),t.setAttribute("role","dialog"),t.setAttribute("aria-label",e.labels.toolbarColumns),t.id="data-grid-column-chooser-"+ ++Gi;let n=null;const o=(e=!1)=>{n&&(n.setAttribute("aria-expanded","false"),n.removeAttribute("aria-controls"),e&&n.focus(),n=null,t.remove(),document.removeEventListener("pointerdown",i,!0),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l))},i=e=>{const i=e.target;t.contains(i)||n?.contains(i)||o()},l=e=>{e?.target instanceof Node&&t.contains(e.target)||o()},s=e=>{"Escape"===e.key&&(e.stopPropagation(),o(!0))};t.addEventListener("keydown",s);const r=()=>{const n=document.createElement("div");for(const t of e.getColumns()){const o=document.createElement("label");o.classList.add("form-check","data-grid-column-chooser-option");const i=document.createElement("input");i.type="checkbox",i.classList.add("form-check-input"),i.checked=t.visible,i.dataset.coreuiColumnChooserOption=t.id,t.canHide||(i.disabled=!0,i.setAttribute("aria-disabled","true")),i.addEventListener("change",()=>{e.toggleVisibility(t.id,i.checked)});const l=document.createElement("span");l.classList.add("form-check-label"),l.textContent=t.label,o.append(i,l),n.append(o)}const o=document.createElement("div");o.classList.add("data-grid-column-chooser-footer");const i=document.createElement("button");i.type="button",i.classList.add("btn","btn-link","btn-sm"),i.textContent=e.labels.showAllColumns,i.dataset.coreuiColumnChooserShowAll="",i.addEventListener("click",()=>{e.showAll(),t.replaceChildren(r())});const l=document.createElement("button");l.type="button",l.classList.add("btn","btn-link","btn-sm"),l.textContent=e.labels.resetColumns,l.dataset.coreuiColumnChooserReset="",l.addEventListener("click",()=>{e.reset(),t.replaceChildren(r())}),o.append(i,l);const s=document.createDocumentFragment();return s.append(n,o),s};return{toggle(s){n!==s?(o(),(s=>{o(),t.replaceChildren(r()),n=s,s.setAttribute("aria-expanded","true"),s.setAttribute("aria-controls",t.id),e.root.append(t);const a=e.root.getBoundingClientRect(),c=s.getBoundingClientRect();t.style.top=c.bottom-a.top+"px",t.style.left=`${Math.max(c.left-a.left,0)}px`,document.addEventListener("pointerdown",i,!0),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),t.querySelector("input:not(:disabled)")?.focus()})(s)):o(!0)},close(){o()},dispose(){o(),t.removeEventListener("keydown",s)}}})({root:this._element,labels:this._labels,getColumns:()=>this._chooserColumns(),toggleVisibility:(e,t)=>{this._table.getColumn(e)?.toggleVisibility(t)},showAll:()=>this._table.toggleAllColumnsVisible(!0),reset:()=>this._table.setColumnVisibility(this._table.initialState.columnVisibility??{})})))}_render(){this._columnsByKey=new Map(this._config.columns.map(e=>[e.key,e])),this._activeCell=this._config.cellNavigation?(e=>{let t=null,n=!1;return{get:()=>t,set(o,i={}){const l=!t||t.rowIndex!==o.rowIndex||t.columnId!==o.columnId;t=o,i.focus&&(n=!0),(l||i.focus)&&e()},clamp(n){const o=((e,t)=>{if(!e)return null;const n=((e,t)=>t.includes(e)?e:t.length>0?t[0]:null)(e.columnId,t.columnIds);if(null===n)return null;const o=t.rowCount-1,i=e.rowIndex<0?-1:Math.max(0,Math.min(e.rowIndex,Math.max(o,0)));return i>=0&&o<0?{rowIndex:-1,columnId:n}:{rowIndex:i,columnId:n}})(t,n),i=Boolean(t)!==Boolean(o)||t&&o&&(t.rowIndex!==o.rowIndex||t.columnId!==o.columnId);t=o,i&&e()},reset(){t&&(t=null,n=!1,e())},consumeFocusRequest:()=>!!n&&(n=!1,!0)}})(()=>this._scheduler.schedule()):null,this._element.classList.add(Dl),this._element.classList.toggle("data-grid-auto-row-height",Boolean(this._config.autoRowHeight)),this._element.classList.toggle("data-grid-resizable",Boolean(this._config.columnSizing)),this._element.classList.toggle("data-grid-pinned",Boolean(this._config.columnPinning)),this._config.sorterVisibility?this._element.setAttribute("data-coreui-sorter-visibility",this._config.sorterVisibility):this._element.removeAttribute("data-coreui-sorter-visibility");const{slots:e}=this._config;this._renderToolbar(),e.empty&&(this._emptySlot=e.empty(this._slotContext()));const t=Boolean(this._config.rowSelection),n="object"==typeof this._config.rowSelection?this._config.rowSelection:{},o=Boolean(this._config.pagination)||Boolean(this._config.dataProvider)&&!this._config.infiniteScroll,i="object"==typeof this._config.pagination?this._config.pagination:{};if(this._config.columnMenu&&(this._menu=(e=>{const t=document.createElement("div");t.classList.add("data-grid-menu"),t.setAttribute("role","menu"),t.id="data-grid-menu-"+ ++$i;let n=null;const o=()=>[...t.querySelectorAll(`.${Ni}`)],i=(e=!1)=>{n&&(n.setAttribute("aria-expanded","false"),n.removeAttribute("aria-controls"),e&&n.focus(),n=null,t.remove(),document.removeEventListener("pointerdown",l,!0),window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s))},l=e=>{const o=e.target;t.contains(o)||n?.contains(o)||i()},s=e=>{e?.target instanceof Node&&t.contains(e.target)||i()},r=e=>{const t=o(),n=t.indexOf(document.activeElement);switch(e.key){case"Escape":e.stopPropagation(),i(!0);break;case"Tab":i();break;case"ArrowDown":e.preventDefault(),t[(n+1)%t.length]?.focus();break;case"ArrowUp":e.preventDefault(),t[(n-1+t.length)%t.length]?.focus();break;case"Home":e.preventDefault(),t[0]?.focus();break;case"End":e.preventDefault(),t[t.length-1]?.focus()}};return t.addEventListener("keydown",r),{toggle(r,a){n!==r?(i(),((r,a)=>{const c=e.getActions(a);if(0===c.length)return;const u=[];for(const[t,o]of c.entries()){if(t>0&&o.group!==c[t-1].group){const e=document.createElement("div");e.classList.add("data-grid-menu-divider"),e.setAttribute("role","separator"),u.push(e)}const l=document.createElement("button");if(l.type="button",l.classList.add(Ni),l.setAttribute("role","menuitem"),o.icon){const e=document.createElement("span");e.classList.add("data-grid-menu-item-icon"),e.setAttribute("aria-hidden","true"),e.innerHTML=o.icon,l.append(e)}l.append(o.label),o.disabled&&l.setAttribute("aria-disabled","true"),l.addEventListener("click",()=>{if(o.disabled)return;const t=n;i(),o.run(),requestAnimationFrame(()=>{const n=document.activeElement;n&&n!==document.body&&e.root.contains(n)||(t?.isConnected?t.focus():e.root.querySelector("[data-coreui-menu]")?.focus())})}),u.push(l)}t.replaceChildren(...u),n=r,r.setAttribute("aria-expanded","true"),r.setAttribute("aria-controls",t.id),e.root.append(t);const d=e.root.getBoundingClientRect(),g=r.getBoundingClientRect();t.style.top=g.bottom-d.top+"px",t.style.left=`${Math.max(g.right-d.left-t.offsetWidth,0)}px`,document.addEventListener("pointerdown",l,!0),window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),o()[0]?.focus()})(r,a)):i(!0)},close(){i()},dispose(){i(),t.removeEventListener("keydown",r)}}})({root:this._element,getActions:e=>this._getMenuActions(e)})),this._config.columnFilters&&(this._filterMenu=ji({root:this._element,labels:this._labels,getColumn:e=>this._columnsByKey.get(e)??null,getFacetedValues:e=>{const t=this._table.getColumn(e);return"function"==typeof t?.getFacetedUniqueValues?[...t.getFacetedUniqueValues().keys()]:[]},getFilterValue:e=>this._table.getColumn(e)?.getFilterValue(),applyFilter:(e,t)=>{this._table.getColumn(e)?.setFilterValue(t)}})),this._header=Vi({cellNavigation:this._config.cellNavigation,columns:this._config.columns,draggable:Boolean(this._config.columnOrder),filterRow:this._config.columnFilters&&this._config.columns.some(e=>e.filter&&this._isColumnFilterable(e)),hasMenu:e=>this._hasColumnMenu(e),hasFilterMenu:e=>Boolean(this._filterMenu)&&this._isColumnFilterable(e)&&!e.filter,icons:{columnMenu:this._sanitizeIcon(this._config.columnMenuIcon),filter:this._sanitizeIcon(this._config.filterIcon),sortAscending:this._sanitizeIcon(this._config.sortAscendingIcon),sortDescending:this._sanitizeIcon(this._config.sortDescendingIcon),sortNeutral:this._sanitizeIcon(this._config.sortNeutralIcon)},isFilterable:e=>this._isColumnFilterable(e),isResizable:e=>this._isColumnResizable(e),isSortable:e=>this._isColumnSortable(e),labels:this._labels,resizable:Boolean(this._config.columnSizing),rowOrder:this._config.rowOrder,selection:t,selectAll:t&&!1!==n.selectAll,table:this._table}),this._body=(e=>{const t=document.createElement("tbody");let n=e.getVisibleColumns(),o=n.map(e=>e.key).join("|");const i=(e.rowOrder?1:0)+(e.selection?1:0);let l=n.length+i;const s=t=>{t.replaceChildren(),e.cellNavigation&&t.setAttribute("role","row");const l=i;if(e.rowOrder){const n=document.createElement("td");n.classList.add("data-grid-row-handle-cell");const o=document.createElement("span");o.classList.add("data-grid-row-handle"),o.dataset.coreuiRowHandle="",o.setAttribute("aria-hidden","true"),o.innerHTML=e.rowHandleIcon,n.append(o),e.cellNavigation&&(n.setAttribute("role","gridcell"),n.setAttribute("aria-colindex","1")),t.append(n)}if(e.selection){const n=document.createElement("td");n.classList.add("data-grid-select-cell");const o=document.createElement("input");o.type="checkbox",o.classList.add("form-check-input"),o.setAttribute("aria-label",e.labels.selectRow),o.dataset.coreuiRowSelect="",e.cellNavigation&&(n.setAttribute("role","gridcell"),n.setAttribute("aria-colindex",String(e.rowOrder?2:1)),o.tabIndex=-1),n.append(o),t.append(n)}for(const[o,i]of n.entries()){const n=document.createElement("td");e.cellNavigation&&(n.setAttribute("role","gridcell"),n.setAttribute("aria-colindex",String(l+o+1)),n.dataset.coreuiColumn=i.key,n.tabIndex=-1),t.append(n)}t.dataset.coreuiLayout=o},r=()=>{const e=document.createElement("tr");return s(e),e},a=(t,l,r)=>{if(t.dataset.coreuiLayout!==o&&(s(t),delete t.dataset.coreuiRow),e.selection){const e=t.children[i-1].firstElementChild,n=l.getIsSelected();e.checked=n,t.classList.toggle("table-active",n),t.setAttribute("aria-selected",String(n))}const a=`${e.getDataVersion()}:${l.id}`;if(t.dataset.coreuiRow===a&&t.dataset.coreuiIndex===String(r)||(((t,o,l)=>{const s=i,r=e.getEditingCell();for(const[i,a]of n.entries()){const n=t.children[i+s];if(r&&r.rowId===o.id&&r.columnId===a.key){const t=e.getEditorElement();if(t){n.replaceChildren(t);continue}}if(a.render){if(Di(n,a.render(o.original,l),e.sanitizeContent),e.cellNavigation)for(const e of n.querySelectorAll("a[href], button, input, select, textarea, [tabindex]"))e.tabIndex=-1;continue}const c=o.getValue(a.key);n.textContent=a.formatter?a.formatter(c,o.original):String(c??"")}})(t,l,r),t.dataset.coreuiRow=a),e.cellSelection){const e=new Map(l.getAllCells().map(e=>[e.column.id,e]));for(const[o,l]of n.entries()){const n=t.children[o+i],s=e.get(l.key),r=s?.getIsSelected()??!1;n.classList.toggle(Fi,r);const a=r&&s?s.getSelectionEdges():null;for(const e of Ai)n.classList.toggle(`${Fi}-${e}`,Boolean(a?.[e]))}}if(t.dataset.coreuiIndex=String(r),t.setAttribute("aria-rowindex",String(e.headerRowCount+e.getRowIndexOffset()+r+1)),t.classList.toggle("data-grid-row-odd",r%2==1),p){const e=p,o=i;for(let n=0;n<i;n++)Mi(t.children[n],e.select);for(const[i,l]of n.entries())Mi(t.children[i+o],e.columns[l.key]??null)}},c=()=>{const e=document.createElement("tr");e.classList.add("data-grid-spacer"),e.setAttribute("aria-hidden","true");const t=document.createElement("td");return t.colSpan=Math.max(l,1),e.append(t),e},u=(e,t)=>{e.style.height=`${t}px`,e.firstElementChild.style.height=`${t}px`,e.style.display=t>0?"":"none"},d=c(),g=c();let m=!1,f=null,h=[],p=null;const b=[];let _=null;return{element:t,update(){const s=e.getRows();p=e.getPinning();const c=e.getEditingCell(),w=c?`${c.rowId}:${c.columnId}`:null;if(w!==_){_=w;for(const e of h)delete e.dataset.coreuiRow}const v=e.getVisibleColumns(),C=v.map(e=>e.key).join("|");if(C!==o&&(n=v,o=C,l=n.length+i,d.firstElementChild.colSpan=Math.max(l,1),g.firstElementChild.colSpan=Math.max(l,1)),0===s.length)return void(()=>{m=!1,b.push(...h),h=[],f||(f=document.createElement("tr"),f.classList.add("data-grid-empty"),f.append(document.createElement("td")));const n=f.firstElementChild;n.colSpan=Math.max(l,1),Di(n,e.renderEmpty(),e.sanitizeContent),t.replaceChildren(f)})();const S=e.getVirtualizer();S?((n,o)=>{m||(t.replaceChildren(d,g),m=!0,h=[]);const i=o.getVirtualItems(),l=o.getTotalSize(),s=i.length>0?i[0].start:0,c=i.length>0?l-i[i.length-1].end:l;for(u(d,s),u(g,c);h.length>i.length;){const e=h.pop();e.remove(),b.push(e)}for(;h.length<i.length;){const e=b.pop()??r();g.before(e),h.push(e)}for(const[t,l]of i.entries()){const i=h[t];a(i,n[l.index],l.index),e.autoRowHeight&&(i.dataset.index=String(l.index),o.measureElement(i))}})(s,S):(e=>{for(f&&f.remove();h.length>e.length;){const e=h.pop();e.remove(),b.push(e)}for(;h.length<e.length;){const e=b.pop()??r();t.append(e),h.push(e)}for(const[t,n]of e.entries())a(h[t],n,t)})(s)}}})({autoRowHeight:this._config.autoRowHeight&&this._config.virtualization,cellNavigation:this._config.cellNavigation,cellSelection:this._config.cellSelection,getDataVersion:()=>this._dataVersion,getEditingCell:()=>this._editingCell?{rowId:this._editingCell.rowId,columnId:this._editingCell.columnId}:null,getEditorElement:()=>this._editor&&!this._editor.popup?this._editor.element:null,getPinning:()=>this._config.columnPinning?this._getPinning():null,getRowIndexOffset:()=>this._rowIndexOffset(),getRows:()=>this._table.getRowModel().rows,getVisibleColumns:()=>this._visibleColumns(),getVirtualizer:()=>this._virtualizer?.instance??null,headerRowCount:this._header.rowCount,labels:this._labels,renderEmpty:()=>this._emptySlot?this._emptySlot.element:this._loadFailed?this._labels.loadError:"function"==typeof this._config.empty?this._config.empty():this._config.empty,rowHandleIcon:this._sanitizeIcon(this._config.rowHandleIcon),rowOrder:this._config.rowOrder,sanitizeContent:e=>this._config.sanitize?ol(e,Ji,this._config.sanitizeFn):e,selection:t}),this._tableElement=document.createElement("table"),this._tableElement.classList.add("table"),this._config.cellNavigation&&this._tableElement.setAttribute("role","grid"),this._tableElement.append(this._header.element,this._body.element),this._viewportElement=document.createElement("div"),this._viewportElement.classList.add("data-grid-viewport"),this._config.cellNavigation&&(this._viewportElement.tabIndex=-1),this._viewportElement.append(this._tableElement),this._config.dataProvider&&(this._loading=Ti(this._labels),this._viewportElement.append(this._loading.element)),this._config.infiniteScroll&&(this._loadingMore=Ti(this._labels,"data-grid-loading-more"),this._viewportElement.append(this._loadingMore.element)),this._element.append(this._viewportElement),o){const t=i.position??"bottom",n=e.pagination,o=()=>{if(n){const e=n(this._slotContext());return{element:e.element,refresh:()=>e.update?.(),dispose:()=>e.dispose?.()}}const e=(e=>{const t=document.createElement("div");t.classList.add("data-grid-pagination");const n=document.createElement("nav");n.setAttribute("aria-label",e.labels.paginationLabel);const o=document.createElement("ul");o.classList.add("pagination","pagination-sm"),n.append(o);const i=!1===e.info?null:document.createElement("span");i&&i.classList.add("data-grid-pagination-info");const l=document.createElement("select");l.classList.add("form-select","form-select-sm"),l.setAttribute("aria-label",e.labels.pageSizeLabel),l.dataset.coreuiPageSize="";for(const t of e.pageSizeOptions){const e=document.createElement("option");e.value=String(t),e.textContent=String(t),l.append(e)}return t.append(n,...i?[i]:[],l),{element:t,update(t){const n=Math.max(t.pageCount-1,0),s=Math.max(Math.min(t.pageIndex-Math.floor(2.5),t.pageCount-5),0),r=0===t.pageCount?-1:Math.min(s+5-1,n),a=[qi("«","first",{ariaLabel:e.labels.firstPage,disabled:0===t.pageIndex}),qi("‹","prev",{ariaLabel:e.labels.previousPage,disabled:0===t.pageIndex})];for(let e=s;e<=r;e++)a.push(qi(String(e+1),String(e),{active:e===t.pageIndex}));if(a.push(qi("›","next",{ariaLabel:e.labels.nextPage,disabled:t.pageIndex>=n}),qi("»","last",{ariaLabel:e.labels.lastPage,disabled:t.pageIndex>=n})),o.replaceChildren(...a),i)if("function"==typeof e.info)i.textContent=e.info(t);else{const n=0===t.totalRows?0:t.pageIndex*t.pageSize+1,o=Math.min((t.pageIndex+1)*t.pageSize,t.totalRows);i.textContent=yi(e.labels.itemsInfo,{first:n,last:o,total:t.totalRows})}if(![...l.options].some(e=>e.value===String(t.pageSize))){const e=document.createElement("option");e.value=String(t.pageSize),e.textContent=String(t.pageSize),l.insertBefore(e,[...l.options].find(e=>Number(e.value)>t.pageSize)??null)}l.value=String(t.pageSize)}}})({info:i.info??!0,labels:this._labels,pageSizeOptions:i.pageSizeOptions??Tl});return{element:e.element,refresh:()=>e.update(this._paginationState()),dispose:void 0}};if("top"===t||"both"===t){const e=o();n||e.element.classList.add("data-grid-pagination-top"),this._viewportElement.before(e.element),this._paginations.push(e)}if("bottom"===t||"both"===t){const e=o();this._element.append(e.element),this._paginations.push(e)}}else this._config.virtualization&&(this._virtualizer=(e=>{const t=new pi({count:e.count,estimateSize:()=>e.rowHeight,getScrollElement:e.getScrollElement,observeElementOffset:mi,observeElementRect:ui,onChange:e.onChange,overscan:e.overscan,scrollToFn:hi,...e.autoRowHeight&&{measureElement:fi}}),n=t._didMount();return t._willUpdate(),{instance:t,setCount(e){e!==t.options.count&&t.setOptions({...t.options,count:e})},remeasure(){e.autoRowHeight&&t.measure()},destroy(){n()}}})({autoRowHeight:this._config.autoRowHeight,count:this._table.getRowModel().rows.length,getScrollElement:()=>this._viewportElement,onChange:()=>this._scheduler.schedule(),overscan:this._config.overscan,rowHeight:this._config.rowHeight}));this._initColumnDrag(),this._initRowDrag(),this._update()}_addEventListeners(){q.on(this._element,Rl,e=>{this._onCellNavigationKeydown(e)}),q.on(this._element,xl,e=>{this._containsFocus=!0,this._onCellFocusIn(e)}),q.on(this._element,Il,e=>{const t=e.relatedTarget;t&&this._element.contains(t)||(this._containsFocus=!1)}),q.on(this._element,El,Ll,e=>{this._tableCellFromTarget(e)?.getSelectionStartHandler()(e)}),q.on(this._element,Ml,Ll,e=>{this._tableCellFromTarget(e)?.getSelectionExtendHandler()(e)}),q.on(this._element,cl,e=>{if(!this._config.editing)return;const t=this._navigableCellFromTarget(e.target);t&&t.cell.rowIndex>=0&&(this._activeCell?.set(t.cell),this._startEditing(t.cell))}),q.on(this._element,sl,".data-grid-sort-button",e=>{this._toggleColumnSorting(e)});const e=Yi((e,t)=>{this._table&&this._table.getColumn(e)?.setFilterValue(""===t?void 0:t)},250);q.on(this._element,fl,"input[data-coreui-column-filter]",t=>{const n=t.delegateTarget??t.target;e(n.dataset.coreuiColumnFilter,n.value)});const t=Yi(e=>{this._table&&this._table.setGlobalFilter(""===e?void 0:e)},250);q.on(this._element,fl,Pl,e=>{const n=e.delegateTarget??e.target;t(n.value)}),q.on(this._element,sl,"button[data-coreui-menu]",e=>{const t=e.delegateTarget??e.target;this._menu?.toggle(t,t.dataset.coreuiMenu)}),q.on(this._element,sl,"button[data-coreui-filter]",e=>{const t=e.delegateTarget??e.target;this._filterMenu?.toggle(t,t.dataset.coreuiFilter)}),q.on(this._element,sl,"button[data-coreui-toolbar-columns]",e=>{const t=e.delegateTarget??e.target;this._columnChooser?.toggle(t)}),q.on(this._element,sl,"button[data-coreui-toolbar-export]",()=>{const{exporter:e,...t}=this._toolbarConfig?.exportOptions??{};(e??Xi)(this._table,{scope:"filtered",...t})}),q.on(this._element,sl,"button[data-coreui-toolbar-print]",()=>{this.print()}),q.on(this._element,sl,Vl,()=>{this.undo()}),q.on(this._element,sl,zl,()=>{this.redo()}),q.on(this._element,El,Ol,e=>{this._startColumnResize(e)}),q.on(this._element,Al,Ol,e=>{this._startColumnResize(e)}),q.on(this._element,sl,"input[data-coreui-row-select]",e=>{this._toggleRowSelection(e)}),q.on(this._element,ll,"input[data-coreui-select-all]",e=>{const t=e.delegateTarget??e.target;this._table.toggleAllRowsSelected(t.checked)}),q.on(this._element,sl,"button[data-coreui-page]",e=>{const t=(e.delegateTarget??e.target).dataset.coreuiPage;"first"!==t?"prev"!==t?"next"!==t?"last"!==t?this._table.setPageIndex(Number(t)):this._table.lastPage():this._table.nextPage():this._table.previousPage():this._table.firstPage()}),q.on(this._element,ll,"select[data-coreui-page-size]",e=>{const t=e.delegateTarget??e.target;this._table.setPageSize(Number(t.value))})}_toggleColumnSorting(e){const t=(e.delegateTarget??e.target).closest("th")?.dataset.coreuiColumn;t&&this._table.getColumn(t)?.getToggleSortingHandler()?.(e)}_navigableCellFromTarget(e){const t=e.closest("td, th");if(!t||!this._tableElement.contains(t))return null;const n=t.dataset.coreuiColumn;if(!n)return null;const o=t.closest("tr");if(o.parentElement===this._body.element){const e=o.dataset.coreuiIndex;return void 0===e?null:{cellElement:t,cell:{rowIndex:Number(e),columnId:n}}}return o===this._header.element.firstElementChild?{cellElement:t,cell:{rowIndex:-1,columnId:n}}:null}_onCellFocusIn(e){if(!this._activeCell)return;const t=this._navigableCellFromTarget(e.target);t&&this._activeCell.set(t.cell)}_onCellNavigationKeydown(e){if(!this._activeCell)return;const t=e.target;if(this._config.history&&(e.ctrlKey||e.metaKey)&&!this._editingCell&&!t.matches("input, textarea, select")){const t=e.key.toLowerCase();if("z"===t&&!e.shiftKey)return e.preventDefault(),void this.undo();if("z"===t&&e.shiftKey||"y"===t)return e.preventDefault(),void this.redo()}if(this._editingCell&&this._editScopeContains(t))return"Enter"===e.key?void(e.defaultPrevented||(e.preventDefault(),this._stopEditing({commit:!0}))):"Escape"===e.key?void(e.defaultPrevented||this._cancelEdit()):"Tab"===e.key?(e.preventDefault(),void this._moveEditing(e.shiftKey?-1:1)):void 0;if(t===this._viewportElement){const t=this._activeCell.get();return void(t&&"Tab"!==e.key&&(e.preventDefault(),this._setActiveCell(t)))}const n=this._navigableCellFromTarget(t);if(!n)return;if(t!==n.cellElement)return void("Escape"===e.key&&n.cellElement.focus({preventScroll:!0}));if("Enter"===e.key||"F2"===e.key){e.preventDefault();const t=this._columnsByKey.get(n.cell.columnId);return-1===n.cell.rowIndex?void("Enter"===e.key&&t&&this._isColumnSortable(t)&&this._table.getColumn(n.cell.columnId)?.getToggleSortingHandler()?.(e)):t&&this._isColumnEditable(t)?void this._startEditing(n.cell):void("Enter"===e.key&&this._descendIntoCell(n.cellElement))}if(" "===e.key)return void(this._config.rowSelection&&n.cell.rowIndex>=0&&(e.preventDefault(),this._table.getRowModel().rows[n.cell.rowIndex]?.toggleSelected(),this._selectionAnchorIndex=n.cell.rowIndex));if(this._config.cellSelection&&(e.ctrlKey||e.metaKey)&&n.cell.rowIndex>=0){const t=e.key.toLowerCase();if("a"===t)return e.preventDefault(),this._table.selectAllCells(),void this._scheduler.schedule();if("c"===t)return e.preventDefault(),void this._copyCellSelection()}const o=((e,t,n,o)=>{const{columnIds:i,rowCount:l,pageStep:s,paginated:r}=o,a=i.indexOf(n.columnId);if(-1===a||0===i.length)return null;const c=l-1,u=i.length-1,d=(e,t)=>({cell:{rowIndex:e,columnId:i[t]}});switch(e){case"ArrowLeft":return d(n.rowIndex,Math.max(a-1,0));case"ArrowRight":return d(n.rowIndex,Math.min(a+1,u));case"ArrowUp":return d(Math.max(n.rowIndex-1,-1),a);case"ArrowDown":return d(Math.min(n.rowIndex+1,c),a);case"Home":return d(t?l>0?0:-1:n.rowIndex,0);case"End":return d(t?l>0?c:-1:n.rowIndex,u);case"PageUp":return r&&0===n.rowIndex?{...d(0,a),pageDelta:-1}:d(Math.max(n.rowIndex-s,0),a);case"PageDown":return r&&n.rowIndex===c?{...d(c,a),pageDelta:1}:d(Math.min(n.rowIndex+s,c),a);default:return null}})(e.key,e.ctrlKey||e.metaKey,n.cell,this._activeCellContext());if(o){if(e.preventDefault(),this._config.cellSelection&&n.cell.rowIndex>=0&&o.cell.rowIndex>=0){const t=Bl[e.key];if(e.shiftKey&&t)return this._table.extendCellSelection(t),void this._scheduler.schedule()}1===o.pageDelta&&this._table.getCanNextPage()?this._table.nextPage():-1===o.pageDelta&&this._table.getCanPreviousPage()&&this._table.previousPage(),this._setActiveCell(o.cell)}}_tableCellFromTarget(e){if(!this._config.cellSelection)return null;const t=e.delegateTarget??e.target,n=t.dataset.coreuiColumn,o=Number(t.closest("tr")?.dataset.coreuiIndex??-1);return!n||o<0?null:this._table.getRowModel().rows[o]?.getAllCells().find(e=>e.column.id===n)??null}_descendIntoCell(e){e.querySelector(Hl)?.focus({preventScroll:!0})}_isColumnEditable(e){return!!this._config.editing&&(Boolean(e.editor)||!0===e.editable||"object"==typeof e.editable)}_startEditing(e){const t=this._columnsByKey.get(e.columnId);if(!t||!this._isColumnEditable(t))return;this._stopEditing({commit:!0,force:!0});const n=this._table.getRowModel().rows[e.rowIndex];if(!n)return;const o=n.getValue(e.columnId),i={item:n.original,column:t,value:o,commit:e=>this._commitEdit(e),cancel:()=>this._cancelEdit(),labels:this._labels},l="object"==typeof t.editable?t.editable:{},s=t.editor?t.editor(i):((e,t)=>"number"===e.type?((e,t)=>{const n=document.createElement("input");return n.type="number",n.classList.add("form-control","form-control-sm",Li),void 0!==t.min&&(n.min=String(t.min)),void 0!==t.max&&(n.max=String(t.max)),void 0!==t.step&&(n.step=String(t.step)),n.value=void 0===e.value||null===e.value?"":String(e.value),{element:n,focus(){n.focus(),n.select()},getValue:()=>""===n.value?void 0:Number(n.value)}})(t,e):"select"===e.type?((e,t)=>{const n=document.createElement("select");n.classList.add("form-select","form-select-sm",Li);const o=[];for(const i of t.options??[]){const t=document.createElement("option"),l="object"==typeof i&&null!==i?i.value:i;t.textContent="object"==typeof i&&null!==i?i.label:String(i),t.value=String(o.length),l===e.value&&(t.selected=!0),o.push(l),n.append(t)}return{element:n,focus:()=>n.focus(),getValue:()=>o[Number(n.value)]}})(t,e):(e=>{const t=document.createElement("input");return t.type="text",t.classList.add("form-control","form-control-sm",Li),t.value=String(e.value??""),{element:t,focus(){t.focus(),t.select()},getValue:()=>t.value}})(t))(l,i);this._editingCell={rowId:n.id,columnId:e.columnId,rowIndex:e.rowIndex,item:n.original,previousValue:o},this._editor=s,this._editorFocusPending=!0,q.trigger(this._element,gl,{item:n.original,columnId:e.columnId}),s.popup&&this._mountEditorPopup(e),this._editorPointerdownHandler=e=>{this._editScopeContains(e.target)||this._stopEditing({commit:!0})},q.on(document,Fl,this._editorPointerdownHandler),q.on(s.element,Il,e=>{const t=e.relatedTarget;t&&!this._editScopeContains(t)&&this._stopEditing({commit:!0})}),this._scheduler.schedule()}_editScopeContains(e){if(!e||!this._editingCell||!this._editor)return!1;if(this._editor.contains?.(e)||this._editor.element.contains(e)||this._editorPopup?.contains(e))return!0;const t=this._cellElementFor({rowIndex:this._editingCell.rowIndex,columnId:this._editingCell.columnId});return Boolean(t?.contains(e))}_mountEditorPopup(e){const t=this._cellElementFor(e),n=document.createElement("div");if(n.classList.add("data-grid-editor-popup"),t){const e=this._element.getBoundingClientRect(),o=t.getBoundingClientRect();n.style.top=o.top-e.top+"px",n.style.left=o.left-e.left+"px",n.style.minWidth=`${o.width}px`}n.append(this._editor.element),this._element.append(n),this._editorPopup=n}_commitEdit(e){const t=this._editingCell;if(!t)return;const n=this._columnsByKey.get(t.columnId)?.editValidate;if(n){const o=n(e,t.item);if(!0!==o)return void this._showEditorInvalid("string"==typeof o?o:"")}this._teardownEditor(),this._config.history&&(this._undoStack.push({rowId:t.rowId,columnId:t.columnId,value:e,previousValue:t.previousValue}),this._undoStack.length>100&&this._undoStack.shift(),this._redoStack=[],this._updateHistoryButtons()),q.trigger(this._element,dl,{item:t.item,columnId:t.columnId,value:e,previousValue:t.previousValue}),this._activeCell?.set({rowIndex:t.rowIndex,columnId:t.columnId},{focus:!0})}_cancelEdit(){const e=this._editingCell;e&&(this._teardownEditor(),q.trigger(this._element,ul,{item:e.item,columnId:e.columnId}),this._activeCell?.set({rowIndex:e.rowIndex,columnId:e.columnId},{focus:!0}))}_stopEditing(e){if(this._editingCell)return e.commit&&this._editor?.getValue?(this._commitEdit(this._editor.getValue()),void(this._editingCell&&e.force&&this._cancelEdit())):void this._cancelEdit()}_showEditorInvalid(e){const t=this._editor;if(!t)return;const n=t.element.matches("input, select, textarea")?t.element:t.element.querySelector("input, select, textarea");n&&(this._editorErrorElement||(this._editorErrorElement=document.createElement("div"),this._editorErrorElement.classList.add("visually-hidden"),this._editorErrorElement.id="data-grid-editor-error-"+ ++kl,this._element.append(this._editorErrorElement)),this._editorErrorElement.textContent=e,n.classList.add("is-invalid"),n.setAttribute("aria-invalid","true"),n.setAttribute("aria-errormessage",this._editorErrorElement.id))}_moveEditing(e){const t=this._editingCell;if(!t)return;const n=this._visibleColumns();let o=null;for(let i=n.findIndex(e=>e.key===t.columnId)+e;i>=0&&i<n.length;i+=e)if(this._isColumnEditable(n[i])){o=n[i];break}if(this._stopEditing({commit:!0}),!this._editingCell&&o){const e={rowIndex:t.rowIndex,columnId:o.key};this._activeCell?.set(e,{focus:!0}),this._startEditing(e)}}_teardownEditor(){this._editorPointerdownHandler&&(q.off(document,Fl,this._editorPointerdownHandler),this._editorPointerdownHandler=null),this._editor&&(q.off(this._editor.element,Il),this._editor.dispose?.()),this._editorPopup&&(this._editorPopup.remove(),this._editorPopup=null),this._editorErrorElement&&(this._editorErrorElement.remove(),this._editorErrorElement=null),this._editor=null,this._editingCell=null,this._editorFocusPending=!1,this._scheduler.schedule()}_setActiveCell(e){if(this._activeCell?.set(e,{focus:!0}),this._config.cellSelection&&e.rowIndex>=0){const t=this._table.getRowModel().rows[e.rowIndex];t&&this._table.setFocusedCell(t.id,e.columnId)}this._virtualizer&&e.rowIndex>=0&&this._virtualizer.instance.scrollToIndex(e.rowIndex)}_printColumns(){return this._visibleColumns().map(e=>({id:e.key,label:e.label??e.key,formatter:e.formatter}))}_clipboardColumns(){return this._visibleColumns().map(e=>({id:e.key,formatter:e.formatter}))}_copyCellSelection(){(async(e,t)=>{const n=((e,t)=>{const{rows:n}=e.getRowModel();return e.getCellSelectionBounds().map(e=>{const o=[];for(let i=e.minRowIndex;i<=e.maxRowIndex;i++){const l=n[i];if(!l)continue;const s=[];for(let n=e.minColumnIndex;n<=e.maxColumnIndex;n++){const e=t[n];if(!e)continue;const o=l.getValue(e.id);s.push(Y(e.formatter?e.formatter(o,l.original):String(o??"")))}o.push(s.join("\t"))}return o.join("\n")}).filter(e=>""!==e).join("\n\n")})(e,t);if(""===n)return n;try{await navigator.clipboard.writeText(n)}catch{const e=document.createElement("textarea");e.value=n,e.setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.opacity="0",document.body.append(e),e.select();try{document.execCommand("copy")}finally{e.remove()}}return n})(this._table,this._clipboardColumns()).then(e=>{""!==e&&q.trigger(this._element,hl,{text:e})},()=>{})}_activeCellContext(){const e=this._table.getRowModel().rows.length,t=Boolean(this._config.pagination)||Boolean(this._config.dataProvider),n=Math.floor((this._viewportElement?.clientHeight??0)/this._config.rowHeight);return{columnIds:this._visibleLeafColumns().map(e=>e.id),rowCount:e,pageStep:t?this._table.store.state.pagination.pageSize:Math.max(1,n||e),paginated:t}}_cellElementFor(e){return-1===e.rowIndex?this._header.element.querySelector(`tr:first-child th[data-coreui-column="${e.columnId}"]`):this._body.element.querySelector(`tr[data-coreui-index="${e.rowIndex}"]`)?.querySelector(`td[data-coreui-column="${e.columnId}"]`)??null}_applyCellNavigation(){if(!this._activeCell)return;const e=this._activeCellContext();this._activeCell.clamp(e),this._tableElement.setAttribute("aria-colcount",String(e.columnIds.length+(this._config.rowSelection?1:0)));const t=this._activeCell.get(),n=t??(e.columnIds.length>0?{rowIndex:e.rowCount>0?0:-1,columnId:e.columnIds[0]}:null);for(const e of this._header.element.querySelectorAll("tr:first-child th[data-coreui-column]"))jl(e,null!==n&&-1===n.rowIndex&&e.dataset.coreuiColumn===n.columnId);for(const e of this._body.element.querySelectorAll("tr[data-coreui-index]")){const t=null!==n&&e.dataset.coreuiIndex===String(n.rowIndex);for(const o of e.querySelectorAll("td[data-coreui-column]"))jl(o,t&&o.dataset.coreuiColumn===n.columnId)}if(!t)return;const o=this._cellElementFor(t);o?this._activeCell.consumeFocusRequest()&&o.focus({preventScroll:!0}):this._containsFocus&&!this._element.contains(document.activeElement)&&this._viewportElement.focus({preventScroll:!0})}_getMenuActions(e){const t=this._table.getColumn(e),n=this._columnsByKey.get(e);if(!t||!n)return[];const o=[];if(this._isColumnSortable(n)){const e=t.getIsSorted();o.push({key:"sort-asc",label:this._labels.sortAscending,disabled:"asc"===e,group:"sorting",icon:this._sanitizeIcon(this._config.sortAscendingIcon),run:()=>t.toggleSorting(!1)},{key:"sort-desc",label:this._labels.sortDescending,disabled:"desc"===e,group:"sorting",icon:this._sanitizeIcon(this._config.sortDescendingIcon),run:()=>t.toggleSorting(!0)}),e&&o.push({key:"clear-sort",label:this._labels.clearSort,group:"sorting",icon:this._sanitizeIcon(this._config.sortNeutralIcon),run:()=>t.clearSorting()})}if(this._config.columnPinning){const e=t.getIsPinned();"start"!==e&&o.push({key:"pin-start",label:this._labels.pinStart,group:"pinning",icon:this._sanitizeIcon(this._config.pinStartIcon),run:()=>t.pin("start")}),"end"!==e&&o.push({key:"pin-end",label:this._labels.pinEnd,group:"pinning",icon:this._sanitizeIcon(this._config.pinEndIcon),run:()=>t.pin("end")}),e&&o.push({key:"unpin",label:this._labels.unpin,group:"pinning",icon:this._sanitizeIcon(this._config.unpinIcon),run:()=>t.pin(!1)})}if(this._config.columnOrder&&!1!==n.movable){const n=this._visibleLeafColumns().filter(e=>this._pinnedRegion(e)===this._pinnedRegion(t)),i=n.findIndex(t=>t.id===e);o.push({key:"move-start",label:this._labels.moveStart,disabled:i<=0,group:"ordering",icon:this._sanitizeIcon(this._config.moveStartIcon),run:()=>this._moveColumn(e,-1)},{key:"move-end",label:this._labels.moveEnd,disabled:i===n.length-1,group:"ordering",icon:this._sanitizeIcon(this._config.moveEndIcon),run:()=>this._moveColumn(e,1)})}this._config.columnVisibility&&t.getCanHide()&&o.push({key:"hide",label:this._labels.hideColumn,group:"visibility",icon:this._sanitizeIcon(this._config.hideColumnIcon),run:()=>t.toggleVisibility(!1)});const i="function"==typeof this._config.columnMenu?this._config.columnMenu:null;return(i?i({column:n,defaultActions:o}):o).map(e=>e.icon?{...e,icon:this._sanitizeIcon(e.icon)}:e)}_orderedLeafIds(){const e=this._table.getAllLeafColumns().map(e=>e.id),t=this._table.store.state.columnOrder??[];if(0===t.length)return e;const n=new Set(e),o=t.filter(e=>n.has(e)),i=new Set(o);return[...o,...e.filter(e=>!i.has(e))]}_moveColumn(e,t){const n=this._table.getColumn(e);if(!n)return;const o=this._pinnedRegion(n),i=this._orderedLeafIds(),l=this._visibleLeafColumns().filter(e=>this._pinnedRegion(e)===o).map(e=>e.id),s=l[l.indexOf(e)+t];if(!s)return;const r=i.indexOf(e),a=i.indexOf(s);i[r]=s,i[a]=e,this._table.setColumnOrder(i)}_initColumnDrag(){var e,t;this._config.columnOrder&&(this._columnDrag=(e={root:this._element,getScrollElement:()=>this._viewportElement,canDrop:(e,t)=>{const n=this._table.getColumn(e),o=this._table.getColumn(t);return Boolean(n&&o)&&e!==t&&this._pinnedRegion(n)===this._pinnedRegion(o)},onReorder:(e,t,n)=>this._moveColumnTo(e,t,n)},re({axis:"x",root:e.root,handle:"th[data-coreui-draggable]",getScrollElement:e.getScrollElement,resolveSource(e,t){if(t.closest("[data-coreui-resizer]"))return null;const n=e.dataset.coreuiColumn;return n?{id:n,element:e}:null},items:(t=e.root,{getOrderedIds:()=>[...t.querySelectorAll("thead tr:first-child th[data-coreui-column]")].map(e=>e.dataset.coreuiColumn??""),getElements(e){const n=t.querySelector(`thead th[data-coreui-column="${e}"]`);if(!n)return[];const{cellIndex:o}=n,i=[];for(const e of t.querySelectorAll("thead tr, tbody tr:not(.data-grid-spacer):not(.data-grid-empty)")){const t=e.children[o];t&&i.push(t)}return i}}),canDrop:(t,n)=>t!==n&&Boolean(e.root.querySelector(`th[data-coreui-column="${n}"][data-coreui-draggable]`))&&e.canDrop(t,n),preview:!0,onDrop:(t,n)=>e.onReorder(t,n.id,n.after)})))}_rowIndexOffset(){if(this._config.infiniteScroll||!this._config.pagination&&!this._config.dataProvider)return 0;const{pageIndex:e,pageSize:t}=this._table.store.state.pagination;return e*t}_initRowDrag(){var e,t;this._config.rowOrder&&(this._rowDrag=(e={root:this._element,getScrollElement:()=>this._viewportElement,onReorder:(e,t,n)=>this._moveRowTo(e,t,n)},re({axis:"y",root:e.root,handle:"[data-coreui-row-handle]",getScrollElement:e.getScrollElement,resolveSource(e){const t=e.closest(ae),n=t?.dataset.coreuiIndex;return t&&n?{id:n,element:t}:null},items:(t=e.root,{getOrderedIds:()=>[...t.querySelectorAll(`tbody ${ae}`)].map(e=>e.dataset.coreuiIndex??""),getElements(e){const n=t.querySelector(`tbody tr[data-coreui-index="${e}"]`);return n?[n]:[]}}),canDrop:(e,t)=>e!==t,ghostLabel:e=>oe(e.element.querySelector("td:not(.data-grid-row-handle-cell):not(.data-grid-select-cell)")?.textContent??""),preview:!0,onDrop:(t,n)=>e.onReorder(Number(t),Number(n.id),n.after)})))}_moveRowTo(e,t,n){const o=this._rowIndexOffset(),i=[...this._config.items],l=o+e,[s]=i.splice(l,1);if(void 0===s)return;const r=o+t,a=r>l?r-1:r,c=n?a+1:a;i.splice(c,0,s),q.trigger(this._element,bl,{items:i,item:s,oldIndex:l,newIndex:c})}_moveColumnTo(e,t,n){const o=this._orderedLeafIds(),i=o.indexOf(e);if(-1===i)return;o.splice(i,1);const l=o.indexOf(t);-1!==l&&(o.splice(n?l+1:l,0,e),this._table.setColumnOrder(o))}_startColumnResize(e){const t=(e.delegateTarget??e.target).closest("th")?.dataset.coreuiColumn;t&&("mousedown"===e.type&&e.preventDefault(),(this._table.getHeaderGroups()[0]?.headers.find(e=>e.column.id===t))?.getResizeHandler()(e))}_toggleRowSelection(e){const t=e.delegateTarget??e.target,n=t.closest("tr");if(!n)return;const o=Number(n.dataset.coreuiIndex),{rows:i}=this._table.getRowModel(),l=t.checked;if(e.shiftKey&&null!==this._selectionAnchorIndex){const e=Math.min(this._selectionAnchorIndex,o),t=Math.max(this._selectionAnchorIndex,o);this._table.setRowSelection(n=>{const o={...n};for(const n of i.slice(e,t+1))l?o[n.id]=!0:delete o[n.id];return o})}else i[o]?.toggleSelected(l);this._selectionAnchorIndex=o}_initDataSource(){const{dataProvider:e}=this._config;e&&(this._dataSource=(e=>{let t,n=0;return{load(){clearTimeout(t);const o=++n;t=setTimeout(async()=>{e.onLoadingChange(!0);try{const t=e.getRequest(),i=await e.provider(t);if(o!==n)return;e.onLoad(i,t)}catch(t){if(o!==n)return;e.onError(t)}finally{o===n&&e.onLoadingChange(!1)}},100)},dispose(){clearTimeout(t),n++}}})({provider:t=>e(t),getRequest:()=>{const{state:e}=this._table.store;return{columnFilters:e.columnFilters,globalFilter:e.globalFilter??"",pagination:e.pagination,sorting:e.sorting}},onLoad:(e,t)=>{this._stopEditing({commit:!1}),this._loadFailed=!1,this._loadMorePending=!1,this._dataVersion++;let{items:n}=e;if(this._config.infiniteScroll){const o=0===t.pagination.pageIndex;n=o?e.items:[...this._loadedItems,...e.items],this._loadedItems=n,o&&(this._viewportElement.scrollTop=0,this._virtualizer?.remeasure())}this._table.setOptions(t=>({...t,data:n,rowCount:e.totalRows})),q.trigger(this._element,al,{items:e.items,totalRows:e.totalRows}),this._announceResults(e.totalRows),this._scheduler.schedule()},onError:e=>{this._stopEditing({commit:!1}),this._loadFailed=!0,this._loadMorePending=!1,this._loadedItems=[],this._dataVersion++,this._table.setOptions(e=>({...e,data:[],rowCount:0})),q.trigger(this._element,rl,{error:e}),this._scheduler.schedule()},onLoadingChange:e=>{const t=Boolean(this._config.infiniteScroll)&&this._loadedItems.length>0;this._loading?.setVisible(e&&!t),this._loadingMore?.setVisible(e&&t),this._viewportElement.setAttribute("aria-busy",String(e))}}),this._dataSource.load())}_maybeLoadMore(){if(!this._config.infiniteScroll||!this._dataSource||!this._virtualizer||this._loadMorePending)return;const e=this._table.getRowModel().rows.length;if(0===e||e>=this._getTotalRows())return;const t=("object"==typeof this._config.infiniteScroll?this._config.infiniteScroll:{}).threshold??this._config.overscan,n=this._virtualizer.instance.getVirtualItems(),o=n[n.length-1];!o||o.index<e-1-t||(this._loadMorePending=!0,this._table.setPageIndex(this._table.store.state.pagination.pageIndex+1))}_visibleLeafColumns(){return"function"==typeof this._table.getCenterVisibleLeafColumns?[...this._table.getStartVisibleLeafColumns(),...this._table.getCenterVisibleLeafColumns(),...this._table.getEndVisibleLeafColumns()]:"function"==typeof this._table.getVisibleLeafColumns?this._table.getVisibleLeafColumns():this._table.getAllLeafColumns()}_pinnedRegion(e){return"function"==typeof e.getIsPinned&&e.getIsPinned()}_chooserColumns(){const e=[];for(const t of this._orderedLeafIds()){const n=this._table.getColumn(t),o=this._columnsByKey.get(t);n&&o&&e.push({id:t,label:o.label??o.key,canHide:n.getCanHide(),visible:n.getIsVisible()})}return e}_visibleColumns(){const e=[];for(const t of this._visibleLeafColumns()){const n=this._columnsByKey.get(t.id);n&&e.push(n)}return e}_getColumnSizes(){const e={};for(const t of this._table.getHeaderGroups()[0]?.headers??[])e[t.column.id]=t.getSize();return e}_getFilteredColumns(){return this._table.store.state.columnFilters.map(e=>e.id)}_getPinning(){const e=this._table.getStartLeafColumns().filter(e=>e.getIsVisible()),t=this._table.getEndLeafColumns().filter(e=>e.getIsVisible()),n=Boolean(this._config.rowSelection)&&e.length>0,o={};for(const[t,i]of e.entries())o[i.id]={side:"start",offset:i.getStart("start"),edge:t===e.length-1,afterSelect:n};for(const[e,n]of t.entries())o[n.id]={side:"end",offset:n.getAfter("end"),edge:0===e,afterSelect:!1};return{columns:o,select:n?{side:"start",offset:0,edge:!1,afterSelect:!1}:null}}_storageKey(){return this._config.stateKey?`coreui-data-grid:${this._config.stateKey}`:null}_restorePersistedState(){const e=this._storageKey();if(!e)return;let t=null;try{const n=window.localStorage.getItem(e);t=n?JSON.parse(n):null}catch{return}t&&this.restoreState(t)}_updateHistoryButtons(){const e=this._element.querySelector(Vl);e&&(e.disabled=0===this._undoStack.length);const t=this._element.querySelector(zl);t&&(t.disabled=0===this._redoStack.length)}_announceResults(e){this._announce(yi(this._labels.resultsAnnouncement,{count:e}))}_announce(e){this._liveRegion&&(this._liveRegion.textContent=e)}_getTotalRows(){return this._config.dataProvider?this._table.options.rowCount??0:"function"!=typeof this._table.getFilteredRowModel?this._table.getCoreRowModel().rows.length:this._table.getFilteredRowModel().rows.length}_notifyStateChange(e,t){if(!this._element)return;this._config.stateKey&&(this._persistState||(this._persistState=Yi(()=>{const e=this._storageKey();if(e)try{window.localStorage.setItem(e,JSON.stringify(this.getState()))}catch{}},250)),this._persistState()),e.sorting===t.sorting&&e.columnFilters===t.columnFilters&&e.globalFilter===t.globalFilter&&(this._config.infiniteScroll||e.pagination?.pageIndex===t.pagination?.pageIndex&&e.pagination?.pageSize===t.pagination?.pageSize)||(this._stopEditing({commit:!0,force:!0}),this._selectionAnchorIndex=null,this._activeCell?.reset(),this._virtualizer?.remeasure()),e.sorting!==t.sorting&&q.trigger(this._element,Sl,{sorting:t.sorting});const n=e.columnFilters!==t.columnFilters||e.globalFilter!==t.globalFilter;if(n&&(q.trigger(this._element,ml,{columnFilters:t.columnFilters,globalFilter:t.globalFilter??""}),this._config.dataProvider||this._announceResults(this._table.getFilteredRowModel().rows.length)),e.rowSelection!==t.rowSelection&&q.trigger(this._element,vl,{rowSelection:t.rowSelection,selectedItems:this.getSelectedItems()}),e.pagination===t.pagination||this._config.infiniteScroll||q.trigger(this._element,_l,{pagination:t.pagination}),e.columnSizing!==t.columnSizing&&q.trigger(this._element,Cl,{columnSizing:t.columnSizing}),e.columnPinning!==t.columnPinning&&q.trigger(this._element,wl,{columnPinning:t.columnPinning}),e.columnOrder!==t.columnOrder&&q.trigger(this._element,pl,{columnOrder:t.columnOrder}),e.columnVisibility!==t.columnVisibility&&q.trigger(this._element,yl,{columnVisibility:t.columnVisibility}),this._dataSource){if(n||e.sorting!==t.sorting)return 0!==t.pagination.pageIndex&&(this._pageResetPending=!0,this._table.setPageIndex(0)),void this._dataSource.load();if(e.pagination!==t.pagination){const e=this._pageResetPending&&0===t.pagination.pageIndex;this._pageResetPending=!1,e||this._dataSource.load()}}}_update(){if(this._virtualizer&&(this._virtualizer.setCount(this._table.getRowModel().rows.length),this._virtualizer.instance._willUpdate()),this._editingCell&&this._virtualizer){const{rowIndex:e}=this._editingCell;this._virtualizer.instance.getVirtualItems().some(t=>t.index===e)||this._stopEditing({commit:!0,force:!0})}this._tableElement.setAttribute("aria-rowcount",String(this._header.rowCount+this._getTotalRows())),this._header.update({filteredColumns:this._config.columnFilters?this._getFilteredColumns():null,order:this._visibleLeafColumns().map(e=>e.id),pinning:this._config.columnPinning?this._getPinning():null,resizingColumn:!!this._config.columnSizing&&this._table.store.state.columnResizing.isResizingColumn,sizes:this._config.columnSizing||this._config.columnPinning?this._getColumnSizes():null,sorting:this._table.store.state.sorting??[],selectAll:this._config.rowSelection?{checked:this._table.getIsAllRowsSelected(),indeterminate:this._table.getIsSomeRowsSelected()&&!this._table.getIsAllRowsSelected()}:null}),this._body.update(),this._applyCellNavigation(),this._editorFocusPending&&this._editor?.element.isConnected&&(this._editorFocusPending=!1,this._editor.focus?this._editor.focus():(this._editor.element.querySelector(Hl)??this._editor.element).focus({preventScroll:!0})),this._toolbar?.update?.(),this._emptySlot?.update?.();for(const e of this._paginations)e.refresh();this._maybeLoadMore()}_paginationState(){const{pagination:e}=this._table.store.state;return{pageCount:this._table.getPageCount(),pageIndex:e.pageIndex,pageSize:e.pageSize,totalRows:this._getTotalRows()}}static jQueryInterface(t){return this.each(function(){const n=e.getOrCreateInstance(this,"string"==typeof t?void 0:t);if("string"!=typeof t)return;const o=n;if(void 0===o[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);o[t]()})}};function Gl(){return{createOptionsStore:!0,wrapExternalAtoms:!1,addSubscription:()=>{throw new Error("Feature not supported in current reactivity implementation")},unmount:()=>{throw new Error("Feature not supported in current reactivity implementation")},batch:f,schedule:e=>queueMicrotask(e),untrack:e=>e(),createReadonlyAtom:(e,t)=>b(()=>e(),{compare:t?.compare}),createWritableAtom:(e,t)=>b(e,{compare:t?.compare})}}const Kl={coreReactivityFeature:Gl(),cellSelectionFeature:En,columnFilteringFeature:Tn,globalFilteringFeature:ho,columnFacetingFeature:Dn,columnOrderingFeature:kn,columnPinningFeature:Bn,columnSizingFeature:eo,columnResizingFeature:Qn,columnVisibilityFeature:to,rowPaginationFeature:po,rowSelectionFeature:To,rowSortingFeature:ko,facetedRowModel:(e,t)=>{const n=e;return be({feature:"columnFacetingFeature",table:n,fnName:"createFacetedRowModel",memoDeps:()=>[n.getPreFilteredRowModel(),n.atoms.columnFilters?.get(),n.atoms.globalFilter?.get(),n.getFilteredRowModel()],fn:(e,o,i)=>function(e,t,n,o,i){const l=null!=i&&""!==i;if(!n.rows.length||!o?.length&&!l)return n;const s=[];if(o)for(let e=0;e<o.length;e++){const n=o[e].id;n!==t&&s.push(n)}if(l&&"__global__"!==t&&s.push("__global__"),!s.length)return n;return Bo(n.rows,e=>{for(let t=0;t<s.length;t++)if(!1===e.columnFilters?.[s[t]])return!1;return!0},e)}(n,t,e,o,i)})},facetedUniqueValues:(e,t)=>{const n=e;return be({feature:"columnFacetingFeature",table:n,fnName:"table.getFacetedUniqueValues",memoDeps:()=>{if("__global__"===t)return[Ce(n,"getGlobalFacetedRowModel",An).flatRows];const e=n.getColumn(t);return e?[Ce(e,"getFacetedRowModel",Mn,n).flatRows]:[n.getPreFilteredRowModel().flatRows]},fn:e=>function(e,t,n){const o="__global__"===t?e.getAllLeafColumns().filter(e=>uo(e)).map(e=>e.id):[t],i=new Map;for(let e=0;e<n.length;e++)for(let t=0;t<o.length;t++){const l=n[e].getUniqueValues(o[t]);if(l)for(let e=0;e<l.length;e++){const t=l[e],n=i.get(t);i.set(t,void 0===n?1:n+1)}}return i}(n,t,e)})},filteredRowModel:jo(),paginatedRowModel:No(),sortedRowModel:$o(),filterFns:{includesString:oo},sortFns:{alphanumeric:ht,datetime:bt,text:pt}},Wl={coreReactivityFeature:Gl(),columnFilteringFeature:Tn,globalFilteringFeature:ho,rowPaginationFeature:po,rowSortingFeature:ko,filteredRowModel:jo(),paginatedRowModel:No(),sortedRowModel:$o(),filterFns:{includesString:oo},sortFns:{alphanumeric:ht,datetime:bt,text:pt}};var Ul,Zl,Xl=class extends ql{static get Default(){return{...ql.Default,features:Kl}}};Ul=Xl,Zl=()=>{const e=R();if(e){const t=Ul.NAME,n=e.fn[t];e.fn[t]=Ul.jQueryInterface,e.fn[t].Constructor=Ul,e.fn[t].noConflict=()=>(e.fn[t]=n,Ul.jQueryInterface)}},"loading"===document.readyState?(E.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of E)e()}),E.push(Zl)):Zl(),e.DEFAULT_LABELS=Si,e.DataGrid=Xl,e.FILTER_OPERATORS=qo,e.VALUELESS_OPERATORS=Go,e.dataGridFeatures=Kl,e.dataGridLiteFeatures=Wl,e.downloadCsv=Xi,e.evaluateColumnFilter=Uo,e.exportCsv=Zi,e.interpolate=yi});
|
|
8
8
|
//# sourceMappingURL=data-grid.min.js.map
|