jquery.dgtable 2.0.38 → 2.0.39

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/dist/lib.cjs.js CHANGED
@@ -3459,7 +3459,7 @@ const getSupportedTransform = () => {
3459
3459
  return _isTransformSupported;
3460
3460
  };
3461
3461
 
3462
- function u(e, t) {for (let l = 0, i = e.length; l >= 0 && l < i; l += 1) if (t(e[l], l, e)) return e[l];}function h(e) {return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&#39;").replace(/"/g, "&quot;").replace(/\n/g, "<br />");}const c = Symbol("safe"),m = Symbol("hover_in"),f = Symbol("hover_out"),p = Symbol("row_click"),g = Symbol("preview_cell"),v = Symbol("cell"),C = Symbol("related_touch"),b = Symbol("original_row_index"),w = Symbol("destroyed");class W extends Array {constructor(e) {var _e$sortColumn, _e$onComparatorRequir, _e$customSortingProvi;super(), _defineProperty(this, "sortColumn", void 0), _defineProperty(this, "onComparatorRequired", null), _defineProperty(this, "customSortingProvider", null), e = e || {}, this.sortColumn = (_e$sortColumn = e.sortColumn) !== null && _e$sortColumn !== void 0 ? _e$sortColumn : [], this.onComparatorRequired = (_e$onComparatorRequir = e.onComparatorRequired) !== null && _e$onComparatorRequir !== void 0 ? _e$onComparatorRequir : null, this.customSortingProvider = (_e$customSortingProvi = e.customSortingProvider) !== null && _e$customSortingProvi !== void 0 ? _e$customSortingProvi : null;}add(e, t) {if (Array.isArray(e)) {const l = e;if ("number" == typeof t) {const e = l.length,i = this.length;t = t < 0 ? Math.max(i + t, 0) : Math.min(t, i), this.length = i + e;for (let l = i - 1; l >= t; l--) this[l + e] = this[l];for (let i = 0; i < e; i++) this[t + i] = l[i];} else for (let e = 0, t = l.length; e < t; e++) this.push(l[e]);} else {const l = e;"number" == typeof t ? this.splice(t, 0, l) : this.push(l);}}reset(e) {this.length = 0, e && this.add(e);}filteredCollection(e, t) {if (e && t) {const l = new W({ sortColumn: this.sortColumn, onComparatorRequired: this.onComparatorRequired, customSortingProvider: this.customSortingProvider });for (let i = 0, o = this.length; i < o; i++) {const o = this[i];e(o, t) && (o[b] = i, l.push(o));}return l;}return null;}sort(e) {let t;if ("function" == typeof e) return super.sort(e);if (this.sortColumn.length) {const e = [];for (let t = 0; t < this.sortColumn.length; t++) {const l = y(this.sortColumn[t], this.sortColumn[t].descending);let i = null;this.onComparatorRequired && (i = this.onComparatorRequired(this.sortColumn[t].column, this.sortColumn[t].descending, l)), i || (i = l), e.push(i.bind(this));}if (1 === e.length) t = e[0];else {const l = e.length;t = (t, i) => {let o = 0;for (let r = 0; r < l; r++) if (o = e[r](t, i), 0 !== o) return o;return o;};}const l = (e) => (e.sort(t), e);if (this.customSortingProvider) {const e = this.customSortingProvider(this, l);if (e !== this) {this.length = e.length;for (let t = 0, l = e.length; t < l; t++) this[t] = e[t];}} else l(this);}return this;}}function y(e, t) {let l = e.comparePath;"string" == typeof l && (l = l.split("."));const i = l.length,o = i > 1,r = t ? 1 : -1,n = t ? -1 : 1;return function (e, t) {let s = e[l[0]],a = t[l[0]];if (o) for (let e = 1; e < i; e++) s = s && s[l[e]], a = a && a[l[e]];return s === a || null == s && null == a ? 0 : null == s ? r : null == a ? n : s < a ? r : n;};}class S extends Array {constructor() {super();}get(e) {for (let t = 0, l = this.length; t < l; t++) if (this[t].name === e) return this[t];return null;}indexOf(e) {const t = "string" == typeof e ? e : e.name;for (let e = 0, l = this.length; e < l; e++) if (this[e].name === t) return e;return -1;}getByOrder(e) {for (let t = 0, l = this.length; t < l; t++) if (this[t].order === e) return this[t];return null;}normalizeOrder() {const e = [];for (let t = 0; t < this.length; t++) e.push(this[t]);e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0);for (let t = 0; t < e.length; t++) e[t].order = t;return this;}getColumns() {const e = [];for (let t = 0; t < this.length; t++) e.push(this[t]);return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}getVisibleColumns() {const e = [];for (let t = 0; t < this.length; t++) {const l = this[t];l.visible && e.push(l);}return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}getMaxOrder() {let e = 0;for (let t = 0; t < this.length; t++) {const l = this[t];l.order > e && (e = l.order);}return e;}moveColumn(e, t) {if (e && t) {const l = e.order,i = t.order;if (l < i) for (let e = l + 1; e <= i; e++) {const t = this.getByOrder(e);t && t.order--;} else for (let e = l - 1; e >= i; e--) {const t = this.getByOrder(e);t && t.order++;}e.order = i;}return this;}}function R(e, t) {const l = t.column,i = null == t.keyword ? "" : t.keyword.toString();if (!i || !l) return true;let o = e[l];if (null == o) return false;let r = o.toString(),n = i;return t.caseSensitive || (r = r.toLowerCase(), n = n.toLowerCase()), -1 !== r.indexOf(n);}const _ = { NONE: "none", AUTO: "auto", SCROLL: "scroll" };class x {static saveSelection(e) {const t = window.getSelection();if (!t || 0 === t.rangeCount) return null;const l = t.getRangeAt(0);if (e !== l.commonAncestorContainer && !function (e, t) {let l = e;for (; (l = (_l$parentNode = (_l = l) === null || _l === void 0 ? void 0 : _l.parentNode) !== null && _l$parentNode !== void 0 ? _l$parentNode : null) && l !== t;) {var _l$parentNode, _l;}return !!l;}(l.commonAncestorContainer, e)) return null;const i = l.cloneRange();i.selectNodeContents(e), i.setEnd(l.startContainer, l.startOffset);const o = i.toString().length;return { start: o, end: o + l.toString().length };}static restoreSelection(e, t) {let l = 0;const i = [e];let o,r = false,n = false;const s = document.createRange();for (s.setStart(e, 0), s.collapse(true); !n && (o = i.pop());) if (o.nodeType === Node.TEXT_NODE) {const e = l + o.length;!r && t.start >= l && t.start <= e && (s.setStart(o, t.start - l), r = true), r && t.end >= l && t.end <= e && (s.setEnd(o, t.end - l), n = true), l = e;} else {let e = o.childNodes.length;for (; e--;) i.push(o.childNodes[e]);}const a = window.getSelection();a && (a.removeAllRanges(), a.addRange(s));}}const N = Array.prototype.indexOf,k = document.createElement.bind(document);function z(e) {const t = e._p;if (t.cellPreviewCell) {var _l$rowIndex;const l = t.cellPreviewCell,i = l[v];let o;try {o = x.saveSelection(l);} catch {}t.cellPreviewCell.remove(), i && t._unbindCellHoverOut(i), t._unbindCellHoverOut(l);try {o && i && x.restoreSelection(i, o);} catch {}e.emit("cellpreviewdestroy", { el: l.firstChild, name: l.columnName, rowIndex: (_l$rowIndex = l.rowIndex) !== null && _l$rowIndex !== void 0 ? _l$rowIndex : null, rowData: null == l.rowIndex ? null : t.rows[l.rowIndex], cell: i, cellEl: i === null || i === void 0 ? void 0 : i.firstChild }), i && delete i[g], delete l[v], t.cellPreviewCell = null, t.abortCellPreview = false;} else t.abortCellPreview = true;return e;}const M = document.createElement.bind(document);function T(e) {var _ref, _e$C, _t$changedTouches;const t = e;return (_ref = (_e$C = e[C]) !== null && _e$C !== void 0 ? _e$C : (_t$changedTouches = t.changedTouches) === null || _t$changedTouches === void 0 ? void 0 : _t$changedTouches[0]) !== null && _ref !== void 0 ? _ref : e;}function L(e) {var _t$lastResizeAreaClic;const t = e._p;if (null == t.columnResizeStartTimeout) return;clearTimeout(t.columnResizeStartTimeout), t.columnResizeStartTimeout = null;const n = (_t$lastResizeAreaClic = t.lastResizeAreaClick) === null || _t$lastResizeAreaClic === void 0 ? void 0 : _t$lastResizeAreaClic.columnName;t.lastResizeAreaClick = null, n && function (e, t) {const n = e._o,s = e._p,a = s.columns.get(t);if (!n.resizableColumns || !a || !a.resizable) return void A(e);const d = ve(e);s.resizer = M("div"), s.resizer.className = n.resizerClassName, setCssProps(s.resizer, { position: "absolute", display: "block", zIndex: "-1", visibility: "hidden", width: "2px", background: "#000", opacity: "0.7" }), e.el.appendChild(s.resizer);const u = a.element,h = s.resizer.parentNode,c = getComputedStyle(h),m = getComputedStyle(u),f = getElementOffset(u),p = getElementOffset(h);p.left += parseFloat(c.borderLeftWidth) || 0, p.top += parseFloat(c.borderTopWidth) || 0, f.left -= p.left, f.top -= p.top, f.top -= parseFloat(m.borderTopWidth) || 0;const g = getElementWidth(s.resizer, true, true, true);d ? (f.left -= Math.ceil((parseFloat(m.borderLeftWidth) || 0) / 2), f.left -= Math.ceil(g / 2)) : (f.left += getElementWidth(u, true, true, true), f.left += Math.ceil((parseFloat(m.borderRightWidth) || 0) / 2), f.left -= Math.ceil(g / 2)), setCssProps(s.resizer, { "z-index": "10", visibility: "visible", left: f.left + "px", top: f.top + "px", height: getElementHeight(e.el, false, false, false) + "px" }), s.resizer.columnName = u.columnName;try {s.resizer.style.zIndex = "";} catch {}}(e, n);}function F(e, t) {const l = e._o,i = ve(e);let n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!n) return null;n[v] && (n = n[v]);let s = n.previousSibling;for (; s && 1 !== s.nodeType;) s = s.previousSibling;const a = !s,d = T(t),u = (d.pageX || d.clientX || 0) - getElementOffset(n).left;if (i) {var _s$columnName, _s, _n$columnName;if (!a && getElementWidth(n, true, true, true) - u <= l.resizeAreaWidth / 2) return (_s$columnName = (_s = s) === null || _s === void 0 ? void 0 : _s.columnName) !== null && _s$columnName !== void 0 ? _s$columnName : null;if (u <= l.resizeAreaWidth / 2) return (_n$columnName = n.columnName) !== null && _n$columnName !== void 0 ? _n$columnName : null;} else {var _s$columnName2, _s2, _n$columnName2;if (!a && u <= l.resizeAreaWidth / 2) return (_s$columnName2 = (_s2 = s) === null || _s2 === void 0 ? void 0 : _s2.columnName) !== null && _s$columnName2 !== void 0 ? _s$columnName2 : null;if (getElementWidth(n, true, true, true) - u <= l.resizeAreaWidth / 2) return (_n$columnName2 = n.columnName) !== null && _n$columnName2 !== void 0 ? _n$columnName2 : null;}return null;}function A(e) {const t = e._p;return null != t.columnResizeStartTimeout && (clearTimeout(t.columnResizeStartTimeout), t.columnResizeStartTimeout = null), t.resizer && (t.resizer.remove(), t.resizer = null), t.eventsSink.remove(document, ".colresize"), e;}function P(e, t) {const l = t;if ("mousedown" === t.type && 0 !== l.button) return;const i = e._o,o = e._p,r = F(e, t);if (r) {const l = o.columns.get(r);return !!(i.resizableColumns && l && l.resizable) && (function (e, t, l) {const i = e._p,o = e._o,r = T(t),n = Date.now(),s = function (e) {return e.type.startsWith("touch") ? "touch" : "mouse";}(t),a = i.lastResizeAreaClick;if (i.lastResizeAreaClick = { columnName: l, time: n, pageX: r.pageX || r.clientX || 0, pageY: r.pageY || 0, pointerType: s }, !a || a.columnName !== l || a.pointerType !== s) return false;const d = n - a.time;return !(d < 0 || d > o.resizeAreaDoubleClickDuration) && Math.sqrt(Math.pow(i.lastResizeAreaClick.pageX - a.pageX, 2) + Math.pow(i.lastResizeAreaClick.pageY - a.pageY, 2)) <= Math.max(o.resizeAreaWidth, 12);}(e, t, l.name) ? (A(e), function (e, t, l, _o$lastResizeAreaDoub) {const i = e._o,o = e._p,r = o.columns.get(l);if (!i.resizableColumns || !r || !r.resizable) return false;const n = Date.now();return ((_o$lastResizeAreaDoub = o.lastResizeAreaDoubleClick) === null || _o$lastResizeAreaDoub === void 0 ? void 0 : _o$lastResizeAreaDoub.columnName) === r.name && n - o.lastResizeAreaDoubleClick.time < 100 ? (t.preventDefault(), true) : (o.lastResizeAreaClick = null, o.lastResizeAreaDoubleClick = { columnName: r.name, time: n }, e.emit("columnresizeareadoubleclick", { name: r.name, columnName: r.name, event: t }), i.autoFitColumnOnResizeDoubleClick && e.autoFitColumn(r.name), t.preventDefault(), true);}(e, t, l.name)) : (A(e), o.columnResizeStartTimeout = setTimeout(() => L(e), i.resizeAreaDoubleClickDuration), o.eventsSink.add(document, "mousemove.colresize", (t) => H(e, t)).add(document, "touchmove.colresize", (t) => H(e, t)).add(document, "mouseup.colresize", (t) => E(e, t)).add(document, "touchend.colresize", (t) => E(e, t)), t.preventDefault(), true));}}function H(e, t) {const l = e._p;if (null != l.columnResizeStartTimeout && !function (e, t) {const l = e._p.lastResizeAreaClick;if (!l) return false;const i = T(t),o = i.pageX || i.clientX || 0,r = i.pageY || 0;return Math.sqrt(Math.pow(o - l.pageX, 2) + Math.pow(r - l.pageY, 2)) > 4;}(e, t)) return;if (L(e), !l.resizer) return;const i = l.columns.get(l.resizer.columnName);if (!i) return;const n = ve(e),s = i.element,a = l.resizer.parentNode,d = getComputedStyle(a),u = getComputedStyle(s),h = getElementOffset(s),c = getElementOffset(a);c.left += parseFloat(d.borderLeftWidth) || 0, h.left -= c.left;const m = getElementWidth(l.resizer, true, true, true),f = "border-box" === u.boxSizing;let p = T(t).pageX - c.left,g = h.left;g -= Math.ceil(m / 2), n ? (g += getElementWidth(s, true, true, true), g -= i.ignoreMin ? 0 : e._o.minColumnWidth, f || (g -= Math.ceil((parseFloat(u.borderLeftWidth) || 0) / 2), g -= ce(s)), p > g && (p = g)) : (g += i.ignoreMin ? 0 : e._o.minColumnWidth, f || (g += Math.ceil((parseFloat(u.borderRightWidth) || 0) / 2), g += ce(s)), p < g && (p = g)), l.resizer.style.left = p + "px";}function E(e, t) {var _ref2, _t$C, _v$changedTouches;const l = e._o,i = e._p;if (null != i.columnResizeStartTimeout) return void A(e);if (!i.resizer) return;i.eventsSink.remove(document, ".colresize");const n = i.columns.get(i.resizer.columnName);if (!n) return i.resizer.remove(), void (i.resizer = null);const s = ve(e),a = n.element,d = a.firstChild,u = i.resizer.parentNode,h = getComputedStyle(u),c = getComputedStyle(a),m = getElementOffset(a),f = getElementOffset(u);f.left += parseFloat(h.borderLeftWidth) || 0, m.left -= f.left;const p = getElementWidth(i.resizer, true, true, true),g = "border-box" === c.boxSizing,v = t;let b = ((_ref2 = (_t$C = t[C]) !== null && _t$C !== void 0 ? _t$C : (_v$changedTouches = v.changedTouches) === null || _v$changedTouches === void 0 ? void 0 : _v$changedTouches[0]) !== null && _ref2 !== void 0 ? _ref2 : t).pageX - f.left,w = m.left,W = 0;if (s) {if (!g) {b += ce(a);const e = getComputedStyle(d || a);b += parseFloat(e.borderLeftWidth) || 0, b += parseFloat(e.borderRightWidth) || 0;}b += n.arrowProposedWidth || 0, w += Math.ceil(p / 2), w += getElementWidth(a, true, true, true);const t = w - (n.ignoreMin ? 0 : e._o.minColumnWidth);b > t && (b = t), W = w - b;} else {if (!g) {b -= ce(a);const e = getComputedStyle(d || a);b -= parseFloat(e.borderLeftWidth) || 0, b -= parseFloat(e.borderRightWidth) || 0;}b -= n.arrowProposedWidth || 0, w -= Math.ceil(p / 2);const t = w + (n.ignoreMin ? 0 : e._o.minColumnWidth);b < t && (b = t), W = b - w;}i.resizer.remove(), i.resizer = null;let y = W;if (2 === n.widthMode) {let t = pe(e),o = 0,r = 0;for (let e = 0; e < i.visibleColumns.length; e++) {var _l$actualWidth;const l = i.visibleColumns[e];l.name !== n.name && (2 === l.widthMode ? (o += l.width, r++) : t -= (_l$actualWidth = l.actualWidth) !== null && _l$actualWidth !== void 0 ? _l$actualWidth : 0);}if (t <= 0 && i.table && (t = i.table.clientWidth), t > Math.max(l.minColumnWidth, 1)) {if (y = W / t, r > 0) {const e = y / ((1 - y) / o);o += y, (o < 1 && l.relativeWidthGrowsToFillWidth || o > 1 && l.relativeWidthShrinksToFillWidth) && (y = e);}y *= 100, y += "%";}}e.setColumnWidth(n.name, y);}function O(e, t) {var _i$columns$get;const l = e._o,i = e._p;if (!l.resizableColumns) return;const o = F(e, t),r = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);r && (o && (_i$columns$get = i.columns.get(o)) !== null && _i$columns$get !== void 0 && _i$columns$get.resizable ? r.style.cursor = "e-resize" : r.style.cursor = "");}function I(e, t) {var _ref3, _t$C2, _n$changedTouches;const i = e._o,n = t,s = t,a = (_ref3 = (_t$C2 = t[C]) !== null && _t$C2 !== void 0 ? _t$C2 : (_n$changedTouches = n.changedTouches) === null || _n$changedTouches === void 0 ? void 0 : _n$changedTouches[0]) !== null && _ref3 !== void 0 ? _ref3 : { pageX: s.pageX, pageY: s.pageY },d = t.target.closest(`div.${i.tableClassName}-header-cell,div.${i.cellPreviewClassName}`);if (!d) return;const u = getElementOffset(d);u.width = getElementWidth(d, true, true, true), u.height = getElementHeight(d, true, true, true), e.emit("headercontextmenu", { columnName: d.columnName, pageX: a.pageX, pageY: a.pageY, bounds: u });}function D(e, t) {if (he(t)) return;if (F(e, t)) return;const l = e._o,i = e._p,o = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!o) return;if (!l.sortableColumns) return;const r = i.columns.get(o.columnName),n = i.rows.sortColumn;if (r && r.sortable) {let t = true;const i = n.length ? n[n.length - 1] : null;i && i.column === r.name && (i.descending && l.allowCancelSort ? (t = false, n.splice(n.length - 1, 1)) : i.descending = !i.descending);const o = e;t ? o.sort(r.name, void 0, true).render() : o.setSortedColumns(n.map((e) => ({ column: e.column, descending: e.descending })));}}function B(e, t) {const l = e._p,i = l.visibleColumns.findIndex((e) => e.movable),o = l.visibleColumns.findLastIndex((e) => e.movable),r = l.visibleColumns.findIndex((e) => e === t);return t.movable || -1 !== i && r >= i && r <= o;}const $ = Array.prototype.indexOf,q = document.createElement.bind(document);function X(e, t) {const l = t[p];l && (t.removeEventListener("click", l), t[p] = null, function (e, t) {const l = e._p;for (let e = 0, i = t.childNodes, o = i.length; e < o; e++) l._unbindCellHoverIn(i[e]);}(e, t), e.emit("rowdestroy", t));}function V(e) {const t = e._p.tbody;if (t) for (let l = t.firstElementChild; l; l = l.nextElementSibling) X(e, l);}function j(e) {const t = e._p,i = e._o;if (!t.table || !t.header) return e;if (!i.height) return t.table.style.height = "auto", e;const o = getComputedStyle(t.table);let r = i.height - getElementHeight(t.header, true, true, true);return "border-box" !== o.boxSizing && (r -= parseFloat(o.borderTopWidth) || 0, r -= parseFloat(o.borderBottomWidth) || 0, r -= parseFloat(o.paddingTop) || 0, r -= parseFloat(o.paddingBottom) || 0), t.table.style.height = Math.max(r, 0) + "px", e;}function Y(e) {const t = e._p;return t.headerRow && (t.headerRow = void 0), e;}function U(e) {const t = e._o,l = e._p;if (!l.tbody) return e;if (t.virtualTable && l.virtualListHelper) {const e = l.virtualListHelper.estimateFullHeight();l._lastVirtualScrollHeight = e, l.tbody.style.height = e + "px";} else l.tbody.style.height = "";return e;}function G(e, t) {const l = e._p;if (!l.table) return e;const i = l.table.offsetWidth - l.table.clientWidth;if (i !== l.scrollbarWidth || t) {var _l$notifyRendererOfCo;l.scrollbarWidth = i;for (let e = 0; e < l.columns.length; e++) l.columns[e].actualWidthConsideringScrollbarWidth = null;if (l.visibleColumns.length > 0 && l.tbody && l.headerRow) {var _t$actualWidth, _ref4, _t$actualWidthConside;const e = l.visibleColumns.length - 1,t = l.visibleColumns[e];t.actualWidthConsideringScrollbarWidth = l.scrollbarWidth > 0 ? ((_t$actualWidth = t.actualWidth) !== null && _t$actualWidth !== void 0 ? _t$actualWidth : 0) - l.scrollbarWidth : null;const i = ((_ref4 = (_t$actualWidthConside = t.actualWidthConsideringScrollbarWidth) !== null && _t$actualWidthConside !== void 0 ? _t$actualWidthConside : t.actualWidth) !== null && _ref4 !== void 0 ? _ref4 : 0) + "px",o = l.tbody.childNodes;for (let t = 0, l = o.length; t < l; t++) {const l = o[t];1 === l.nodeType && (l.childNodes[e].style.width = i);}l.headerRow.childNodes[e].style.width = i;}K(e), (_l$notifyRendererOfCo = l.notifyRendererOfColumnsConfig) === null || _l$notifyRendererOfCo === void 0 ? void 0 : _l$notifyRendererOfCo.call(l);}return e;}function J(e, t) {const l = e._o,i = e._p;if (!i.tbody || !i.table || !i.headerRow) return e;const o = ge(e);if (i.tbody.style.minWidth = o + "px", i.headerRow.style.minWidth = o + (i.scrollbarWidth || 0) + "px", i.eventsSink.remove(i.table, "scroll"), l.width === _.AUTO) setElementWidth(i.table, getElementWidth(i.tbody, true, true, true)), setElementWidth(e.el, getElementWidth(i.table, true, true, true));else if (l.width === _.SCROLL) {if (t) {const t = i.table ? i.table.scrollTop : 0,l = i.table ? i.table.scrollLeft : 0;!function (e) {const t = e.style.display;e.style.display = "none", e.offsetHeight, e.style.display = t;}(e.el), i.table.scrollTop = t, i.table.scrollLeft = l, i.header && (i.header.scrollLeft = l);}const l = () => function (e) {const t = e._p;t.header.scrollLeft = t.table.scrollLeft, Q(e);}(e);i.eventsSink.add(i.table, "scroll", l);}return e;}function K(e) {var _t$scrollbarWidth;const t = e._p,l = e._o;if (!t.headerRow) return;const i = l.tableClassName + "-sticky",o = t.headerRow,r = ve(e);t.lastIsRtl = r;const n = (_t$scrollbarWidth = t.scrollbarWidth) !== null && _t$scrollbarWidth !== void 0 ? _t$scrollbarWidth : 0,s = t.lastDetectedWidth,a = l.maxStickyColumnRelativeWidth,d = "number" == typeof a && s ? s * a : null;let u = 0,h = 0,c = null;const m = [],f = [];let p = null,g = [],v = null,C = 0,b = [];for (let e = o.firstElementChild; e; e = e.nextElementSibling) {var _o$actualWidth, _p;const l = e.getAttribute("data-column");if (!l) continue;const o = t.columns.get(l);if (!o) continue;o.headerScrollbarCompensation = 0;let s = "start" === o.sticky || "end" === o.sticky;if (s && null !== d && C + ((_o$actualWidth = o.actualWidth) !== null && _o$actualWidth !== void 0 ? _o$actualWidth : 0) > d && (s = false), s) {var _o$actualWidth2, _o$actualWidth3, _o$stickyPos, _o$stickyPos2, _o$stickyPos3;let l = (_o$actualWidth2 = o.actualWidth) !== null && _o$actualWidth2 !== void 0 ? _o$actualWidth2 : 0;C += 0, e.className += " " + i, e.style.position = "sticky";let s,a = null;null === c && (a = getComputedStyle(e), c = a.boxSizing), "content-box" === c && (null === a && (a = getComputedStyle(e)), l += (parseFloat(a.paddingLeft) || 0) + (parseFloat(a.paddingRight) || 0) + (parseFloat(a.borderLeftWidth) || 0) + (parseFloat(a.borderRightWidth) || 0)), "start" === o.sticky ? (s = { direction: "start", absDirection: r ? "right" : "left", offset: u }, e.style[s.absDirection] = u + "px", u += l, g.length = 0, p = [e], m.push(p)) : (v = e, s = { direction: "end", absDirection: r ? "left" : "right", offset: h }, e.style[s.absDirection] = h + n + "px", e.style.width = ((_o$actualWidth3 = o.actualWidth) !== null && _o$actualWidth3 !== void 0 ? _o$actualWidth3 : 0) + "px", h += l, f.push([e, ...g]), g.length = 0), s.direction === ((_o$stickyPos = o.stickyPos) === null || _o$stickyPos === void 0 ? void 0 : _o$stickyPos.direction) && s.offset === ((_o$stickyPos2 = o.stickyPos) === null || _o$stickyPos2 === void 0 ? void 0 : _o$stickyPos2.offset) && s.absDirection === ((_o$stickyPos3 = o.stickyPos) === null || _o$stickyPos3 === void 0 ? void 0 : _o$stickyPos3.absDirection) || b.push(t.visibleColumns.indexOf(o)), o.stickyPos = s;} else o.stickyPos && b.push(t.visibleColumns.indexOf(o)), delete o.stickyPos, (_p = p) !== null && _p !== void 0 && _p.push(e), g !== null && g !== void 0 && g.push(e), "sticky" === e.style.position && (e.classList.remove(i), e.style.position = "", e.style.left = "", e.style.right = "");}v && (v.style[r ? "left" : "right"] = "0px"), t.stickiesStart = m, t.stickiesEnd = f, b.length > 0 && e.refreshAllVirtualRows(), t.lastStickyScrollLeft = void 0, Q(e);}function Q(e) {const t = e._p;if (!t.table || !t.headerRow || !t.tbody) return;const l = t.stickiesStart,i = t.stickiesEnd,o = t.stickiesSetStart,r = t.stickiesSetEnd,n = t.stickiesSetStart = new Set(),s = t.stickiesSetEnd = new Set();if (l !== null && l !== void 0 && l.length || i !== null && i !== void 0 && i.length) {const e = t.table.scrollLeft;if (e === t.lastStickyScrollLeft) return;t.lastStickyScrollLeft = e;const o = t.headerRow.children,r = 1.5,a = t.lastIsRtl;let d = null;const u = (e, l, i) => {if (e && e.length) {for (const t of e) {l || (d = t);const e = t[0],n = t.slice(1),s = n[0],u = n[n.length - 1];if (!e || !e.getBoundingClientRect) continue;const h = e.getBoundingClientRect(),c = l !== a;let m = false;if (s && u) {const e = s.getBoundingClientRect(),t = u.getBoundingClientRect();m = l ? a ? h.right - r > t.left && h.left + r < e.right : h.right - r > e.left && h.left + r < t.right : a ? h.left + r < e.right && h.right - r > t.left : h.left + r < t.right && h.right - r > e.left;}e.classList.toggle(c ? "is-sticky-left" : "is-sticky-right", m), m && i.add($.call(o, e));}if (d) {var _ref5, _l$actualWidthConside, _ref6, _l$actualWidthConside2;const e = d[0],l = t.columns.get(e.getAttribute("data-column")),i = a ? "marginRight" : "marginLeft";e.style[i] = "", e.style.width = ((_ref5 = (_l$actualWidthConside = l.actualWidthConsideringScrollbarWidth) !== null && _l$actualWidthConside !== void 0 ? _l$actualWidthConside : l.actualWidth) !== null && _ref5 !== void 0 ? _ref5 : 0) + "px";let o = 0;if (t.scrollbarWidth > 0) {const l = e.getBoundingClientRect(),r = e.offsetParent.getBoundingClientRect(),n = a ? l.left - r.left : r.right - l.right;n <= t.scrollbarWidth && (o = Math.min(t.scrollbarWidth, Math.max(0, t.scrollbarWidth - n + 1)), o < t.scrollbarWidth && (e.style[i] = -o + "px"));}l.headerScrollbarCompensation = o, e.style.width = ((_ref6 = (_l$actualWidthConside2 = l.actualWidthConsideringScrollbarWidth) !== null && _l$actualWidthConside2 !== void 0 ? _l$actualWidthConside2 : l.actualWidth) !== null && _ref6 !== void 0 ? _ref6 : 0) + o + "px";}}};u(l, true, n), u(i, false, s);}const a = [],d = [];for (const e of n) (o === null || o === void 0 ? void 0 : o.has(e)) || a.push({ index: e, start: true });for (const e of s) (r === null || r === void 0 ? void 0 : r.has(e)) || a.push({ index: e, start: false });if (o) for (const e of o) n.has(e) || d.push({ index: e, start: true });if (r) for (const e of r) s.has(e) || d.push({ index: e, start: false });if (!a.length && !d.length) return;let u = t.tbody.firstElementChild;for (; u;) {const e = u.children;for (const l of d) {var _e$l$index;(_e$l$index = e[l.index]) === null || _e$l$index === void 0 || _e$l$index.classList.remove(l.start !== t.lastIsRtl ? "is-sticky-left" : "is-sticky-right");}for (const l of a) {var _e$l$index2;(_e$l$index2 = e[l.index]) === null || _e$l$index2 === void 0 || _e$l$index2.classList.add(l.start !== t.lastIsRtl ? "is-sticky-left" : "is-sticky-right");}u = u.nextElementSibling;}t.isStickyColumns = new Map();for (const e of n) t.isStickyColumns.set(e, "start");for (const e of s) t.isStickyColumns.set(e, "end");}function Z(e, t) {const l = e._p,i = e._o;if (!l.headerRow || !l.tbody) return e;const o = l.headerRow.querySelectorAll(`div.${i.tableClassName}-header-cell`)[t];if (!o) return e;const r = l.columns.get(o.columnName);if (r) {var _r$headerScrollbarCom, _ref7, _r$actualWidthConside;const e = (_r$headerScrollbarCom = r.headerScrollbarCompensation) !== null && _r$headerScrollbarCom !== void 0 ? _r$headerScrollbarCom : 0;o.style.width = ((_ref7 = (_r$actualWidthConside = r.actualWidthConsideringScrollbarWidth) !== null && _r$actualWidthConside !== void 0 ? _r$actualWidthConside : r.actualWidth) !== null && _ref7 !== void 0 ? _ref7 : 0) + e + "px";const i = (r.actualWidthConsideringScrollbarWidth || r.actualWidth || 0) + "px",n = l.tbody.childNodes;for (let e = 0, l = n.length; e < l; e++) {const l = n[e];1 === l.nodeType && (l.childNodes[t].style.width = i);}}return e;}function ee(e) {const t = e._p,l = e._o;if (t.table && t.headerRow) {const e = l.tableClassName,i = scopedSelectorAll(t.headerRow, `>div.${e}-header-cell.sorted`),o = Array.prototype.slice.call(i, 0).map((e) => e.querySelector(":scope>div>.sort-arrow")).filter((e) => !!e);for (const e of o) {var _e$parentNode;const l = (_e$parentNode = e.parentNode) === null || _e$parentNode === void 0 ? void 0 : _e$parentNode.parentNode;if (l) {const e = t.columns.get(l.columnName);e && (e.arrowProposedWidth = 0);}e.remove();}for (const e of i) e.classList.remove("sorted", "desc");}return e;}function te(e, t, l) {var _r$element$firstChild;const i = e._p,o = e._o,r = i.columns.get(t);if (!r) return false;const n = q("span");return n.className = "sort-arrow", r.element && (r.element.className += l ? " sorted desc" : " sorted", (_r$element$firstChild = r.element.firstChild) !== null && _r$element$firstChild !== void 0 && _r$element$firstChild.insertBefore(n, r.element.firstChild.firstChild)), 2 !== r.widthMode && o.adjustColumnWidthForSortArrow && (r.arrowProposedWidth = n.scrollWidth + (parseFloat(getComputedStyle(n).marginRight) || 0) + (parseFloat(getComputedStyle(n).marginLeft) || 0)), true;}function le(e, t) {t.firstChild, t.addEventListener("mousedown", (t) => P(e, t)), t.addEventListener("mousemove", (t) => O(e, t)), t.addEventListener("mouseup", (t) => function (e, t) {2 === t.button && I(e, t);}(e, t)), t.addEventListener("mouseleave", (t) => function (e, t) {const l = e._o,i = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);i && (i.style.cursor = "");}(e, t)), t.addEventListener("touchstart", (t) => function (e, t) {const l = e._p;if (l.currentTouchId) return;const i = t.changedTouches[0];l.currentTouchId = i.identifier;const o = t.currentTarget,r = { x: i.pageX, y: i.pageY };let n = r;const s = function () {l.currentTouchId = null, l.eventsSink.remove(o, ".colheader"), clearTimeout(l.tapAndHoldTimeout), l.tapAndHoldTimeout = null;};t[C] = t.changedTouches[0], true !== P(e, t) ? (l.tapAndHoldTimeout = setTimeout(() => {s(), l.eventsSink.add(o, "touchend.colheader", (e) => {he(e) || e.preventDefault(), l.eventsSink.remove(o, ".colheader");}, { once: true }).add(o, "touchcancel.colheader", (e) => {l.eventsSink.remove(o, ".colheader");}, { once: true }), Math.sqrt(Math.pow(Math.abs(n.x - r.x), 2) + Math.pow(Math.abs(n.y - r.y), 2)) < 9 && (A(e), I(e, t));}, 500), l.eventsSink.add(o, "touchend.colheader", (t) => {const i = t,o = u(Array.from(i.changedTouches), (e) => e.identifier === l.currentTouchId);o && (s(), he(t) || t.preventDefault(), n = { x: o.pageX, y: o.pageY }, (Math.sqrt(Math.pow(Math.abs(n.x - r.x), 2) + Math.pow(Math.abs(n.y - r.y), 2)) < 9 || l.resizer) && (i[C] = o, D(e, i)));}).add(o, "touchcancel.colheader", s).add(o, "touchmove.colheader", (t) => {const i = t,o = u(Array.from(i.changedTouches), (e) => e.identifier === l.currentTouchId);o && (n = { x: o.pageX, y: o.pageY }, l.resizer && (t.preventDefault(), i[C] = o, O(e, i)));})) : l.currentTouchId = null;}(e, t)), t.addEventListener("dragstart", (t) => function (e, t) {const l = e._o,i = e._p;if (l.movableColumns) {var _t$dataTransfer;const e = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!e) return void t.preventDefault();const o = i.columns.get(e.columnName);o && o.movable ? (e.style.opacity = "0.35", i.dragId = 161061273 * Math.random(), (_t$dataTransfer = t.dataTransfer) === null || _t$dataTransfer === void 0 ? void 0 : _t$dataTransfer.setData("text", JSON.stringify({ dragId: i.dragId, column: o.name }))) : t.preventDefault();} else t.preventDefault();}(e, t)), t.addEventListener("click", (t) => D(e, t)), t.addEventListener("contextmenu", (e) => e.preventDefault()), t.addEventListener("dragenter", (t) => function (e, t) {const l = e._o,i = e._p;if (l.movableColumns) {var _t$dataTransfer2;let o = null;const r = (_t$dataTransfer2 = t.dataTransfer) === null || _t$dataTransfer2 === void 0 ? void 0 : _t$dataTransfer2.getData("text");if (r) try {o = JSON.parse(r);} catch {o = null;}const n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!n) return;if (!o || i.dragId === o.dragId && n.columnName !== o.column) {const t = i.columns.get(n.columnName);t && B(e, t) && n.classList.add("drag-over");}}}(e, t)), t.addEventListener("dragover", (e) => {e.preventDefault();}), t.addEventListener("dragleave", (t) => function (e, t) {const l = e._o,i = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!i) return;const o = t.relatedTarget;o === i || i.contains(o) || i.classList.remove("drag-over");}(e, t)), t.addEventListener("drop", (t) => function (e, t, _t$dataTransfer3) {t.preventDefault();const l = e._o,i = e._p,o = (_t$dataTransfer3 = t.dataTransfer) === null || _t$dataTransfer3 === void 0 ? void 0 : _t$dataTransfer3.getData("text");if (!o) return;let r;try {r = JSON.parse(o);} catch {return;}const n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (n) {if (l.movableColumns && r.dragId === i.dragId) {const t = r.column,l = n.columnName,o = i.columns.get(t),s = i.columns.get(l);o && s && o.movable && B(e, s) && e.moveColumn(t, l);}n.classList.remove("drag-over");}}(e, t));}function ie(e, t) {let l = 0;if ("string" == typeof e) {const t = e.trim().toLowerCase();if ("rest" === t) return { width: 0, mode: 3 };if ("auto" === t) return { width: 0, mode: 0 };}let i = parseFloat(e);return Number.isFinite(i) || (i = 0), i = Math.max(0, i), i > 0 && ("string" == typeof e && e.trim().endsWith("%") ? (l = 2, i /= 100) : i > 0 && i < 1 ? l = 2 : (i < t && (i = t), l = 1)), { width: i, mode: l };}function oe(e, t) {var _t$allowPreview;let l = ie(t.width, t.ignoreMin ? 0 : e.minColumnWidth),i = { name: t.name, label: void 0 === t.label ? t.name : t.label, width: l.width, widthMode: l.mode, resizable: void 0 === t.resizable || t.resizable, sortable: void 0 === t.sortable || t.sortable, movable: void 0 === t.movable || t.movable, visible: void 0 === t.visible || t.visible, cellClasses: void 0 === t.cellClasses ? e.cellClasses : t.cellClasses, ignoreMin: void 0 !== t.ignoreMin && !!t.ignoreMin, sticky: void 0 === t.sticky ? null : t.sticky || null, allowPreview: !!((_t$allowPreview = t.allowPreview) !== null && _t$allowPreview !== void 0 ? _t$allowPreview : true), dataPath: [], comparePath: [], order: 0 };const o = void 0 === t.dataPath ? i.name : t.dataPath,r = void 0 === t.comparePath ? o : t.comparePath;return i.dataPath = "string" == typeof o ? o.split(".") : o, i.comparePath = "string" == typeof r ? r.split(".") : r, i;}function re(e) {const t = e._p;0 === t.visibleColumns.length && t.columns.length && (t.columns[0].visible = true, t.visibleColumns.push(t.columns[0]), e.emit("showcolumn", t.columns[0].name));}function ne(e) {const t = e._p;if (t.filteredRows && t.filterArgs) {let l = e._o.filter || R;t.filteredRows = t.rows.filteredCollection(l, t.filterArgs);}}function se(e) {const t = e._p;if (!t.filteredRows) return;const l = new Set(t.filteredRows),i = new W({ sortColumn: t.rows.sortColumn, onComparatorRequired: t.rows.onComparatorRequired, customSortingProvider: t.rows.customSortingProvider });for (let e = 0, o = t.rows.length; e < o; e++) {const o = t.rows[e];l.has(o) && (o[b] = e, i.push(o));}t.filteredRows = i;}function ae(e, t, l) {let i = l.dataPath,o = t[i[0]];for (let e = 1; e < i.length && null != o; e++) o = o && o[i[e]];const r = e.cellFormatter;let n;if (r[c]) n = r(o, l.name, t);else try {n = r(o, l.name, t);} catch (e) {n = "[ERROR]", console.error("Failed to generate content for cell " + l.name, e);}return null == n && (n = ""), n;}const de = document.createElement.bind(document);function ue(e) {["relative", "absolute", "fixed"].includes(getComputedStyle(e).position) || (e.style.position = "relative");}function he(e) {const t = e.target;return /^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(t.tagName);}function ce(e) {const t = getComputedStyle(e);return (parseFloat(t.paddingLeft) || 0) + (parseFloat(t.paddingRight) || 0);}function me(e) {const t = e.style;t["-webkit-touch-callout"] = "none", t["-webkit-user-select"] = "none", t["-moz-user-select"] = "none", t["-ms-user-select"] = "none", t["-o-user-select"] = "none", t["user-select"] = "none";}function fe(e, t, l = null) {const o = e._o,n = o.tableClassName,s = de("div");s.className = e.el.className, setCssProps(s, { position: "absolute", top: "-9999px", left: "0", visibility: "hidden", width: "auto", overflow: "visible" });const a = de("div");a.className = `${n}-header`;const d = de("div");d.className = `${n}-header-row`;const u = de("div");u.className = `${n}-header-cell ${t.cellClasses || ""}`, u.style.width = "auto";const h = u.cloneNode(true),c = u.cloneNode(true);u.appendChild(de("div")).innerHTML = o.headerCellFormatter(t.label, t.name), d.appendChild(h), d.appendChild(u), d.appendChild(c), a.appendChild(d), s.appendChild(a), document.body.appendChild(s);let m = getElementWidth(u, true, true, true) + o.columnAutoWidthExtraSize;if (l) {const e = de("div");e.className = `${n}-body`;const i = de("div");i.className = `${n}-row`;const a = de("div");a.className = `${n}-cell ${t.cellClasses || ""}`, a.style.width = "auto";const d = a.appendChild(de("div"));i.appendChild(a), e.appendChild(i), s.appendChild(e);for (let e = 0; e < l.length; e++) d.innerHTML = ae(o, l[e], t), m = Math.max(m, getElementWidth(a, true, true, true));}return s.remove(), m += t.arrowProposedWidth || 0, !t.ignoreMin && m < o.minColumnWidth && (m = o.minColumnWidth), Math.ceil(m);}function pe(e) {const t = e._o,l = e._p;let o,n = 0,s = 0;l.table && (n = l.table ? l.table.scrollTop : 0, s = l.table ? l.table.scrollLeft : 0, t.virtualTable && (o = l.table.style.display, l.table.style.display = "none"));let a = getElementWidth(e.el);l.table && (t.virtualTable && void 0 !== o && (l.table.style.display = o), l.table.scrollTop = n, l.table.scrollLeft = s, l.header && (l.header.scrollLeft = s));const d = t.tableClassName,u = de("div");u.className = e.el.className, setCssProps(u, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px" });const h = de("div");h.className = `${d}-header`, u.appendChild(h);const c = de("div");c.index = null, c.vIndex = null, c.className = `${d}-header-row`, h.appendChild(c);for (let e = 0; e < l.visibleColumns.length; e++) {const t = l.visibleColumns[e],i = de("div");i.className = `${d}-header-cell ${t.cellClasses || ""}`, i.columnName = t.name, i.appendChild(de("div")), c.appendChild(i);}document.body.appendChild(u), a -= function (e) {const t = getComputedStyle(e);return (parseFloat(t.borderLeftWidth) || 0) + (parseFloat(t.borderRightWidth) || 0);}(c);const m = c.querySelectorAll(`div.${d}-header-cell`);for (const e of m) {const t = getComputedStyle(e);if ("border-box" !== t.boxSizing) {a -= (parseFloat(t.borderRightWidth) || 0) + (parseFloat(t.borderLeftWidth) || 0) + ce(e);const i = e.columnName,o = l.columns.get(i);o && (a -= o.arrowProposedWidth || 0);}}return u.remove(), Math.max(0, a);}function ge(e) {const t = e._p,l = e._o.tableClassName,o = l + "-row",n = l + "-cell",s = t.visibleColumns,a = s.length,d = de("div");d.className = o, d.style.float = "left";let u = 0;for (let e = 0; e < a; e++) {var _t$actualWidth2, _t$actualWidth3;const t = s[e],l = de("div");l.className = n, l.style.width = ((_t$actualWidth2 = t.actualWidth) !== null && _t$actualWidth2 !== void 0 ? _t$actualWidth2 : 0) + "px", t.cellClasses && (l.className += " " + t.cellClasses), l.appendChild(de("div")), d.appendChild(l), u += (_t$actualWidth3 = t.actualWidth) !== null && _t$actualWidth3 !== void 0 ? _t$actualWidth3 : 0;}const h = de("div");h.className = e.el.className, setCssProps(h, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px", float: "left", width: "1px", overflow: "hidden" });const c = de("div");c.className = l, h.appendChild(c);const m = de("div");m.className = l + "-body", m.style.width = u + 1e4 + "px", c.appendChild(m), m.appendChild(d), document.body.appendChild(h);const f = de("div");setCssProps(f, { border: "1.5px solid #000", width: "0", height: "0", position: "absolute", left: "0", top: "-9999px" }), document.body.appendChild(f);const p = parseFloat(getComputedStyle(f).borderWidth),g = Math.round(p) !== p;f.remove();let v = getElementWidth(d, true, true, true);return v -= t.scrollbarWidth || 0, g && v++, h.remove(), v;}function ve(e) {const t = e._p;return !!t.table && "rtl" === getComputedStyle(t.table).direction;}function Ce(e) {var _e$unconvertedWidthMo;const t = null != e.unconvertedWidth ? e.unconvertedWidth : e.width,l = null != e.unconvertedWidth ? (_e$unconvertedWidthMo = e.unconvertedWidthMode) !== null && _e$unconvertedWidthMo !== void 0 ? _e$unconvertedWidthMo : e.widthMode : e.widthMode;return 0 === l ? "auto" : 2 === l ? parseFloat((100 * t).toPrecision(12)) + "%" : 3 === l ? "rest" : t;}const be = Object.prototype.hasOwnProperty,we = Symbol("once_original_handler");document.createElement.bind(document);class We {constructor(e) {var _e$rowsBufferSize, _e$minColumnWidth, _e$resizeAreaWidth, _e$resizeAreaDoubleCl, _e$maxColumnsSortCoun, _e$sortedColumns;_defineProperty(this, "VERSION", void 0);_defineProperty(this, "el", void 0);_defineProperty(this, "_o", void 0);_defineProperty(this, "_p", void 0);_defineProperty(this, w, void 0);e = e || {}, this.VERSION = We.VERSION;const t = this._o = {},n = this._p = { eventsSink: new DomEventsSink(), mitt: { all: s = s || new Map(), on: function (e, t) {var l = s.get(e);l ? l.push(t) : s.set(e, [t]);}, off: function (e, t) {var l = s.get(e);l && (t ? l.splice(l.indexOf(t) >>> 0, 1) : s.set(e, []));}, emit: function (e, t) {var l = s.get(e);l && l.slice().map(function (e) {e(t);}), (l = s.get("*")) && l.slice().map(function (l) {l(e, t);});} }, tableSkeletonNeedsRendering: true };var s;if (this.el = e.el && e.el instanceof HTMLElement ? e.el : document.createElement("div"), this.el !== e.el) {const t = (e.className || "dgtable-wrapper").split(/\s+/).filter(Boolean);this.el.classList.add(...t);}n.eventsSink.add(this.el, "dragend.colresize", (e) => {return t = e, void (this._p.resizer || (t.target.style.opacity = ""));var t;}), n.isWheelScrolling = false, n.eventsSink.add(this.el, "wheel", (e) => {if (n.cellPreviewCell) {let t = false,l = e.target;for (; l && l !== n.cellPreviewCell;) {const e = getComputedStyle(l),i = e.overflowY,o = e.overflowX,r = ("auto" === i || "scroll" === i) && l.scrollHeight > l.clientHeight,n = ("auto" === o || "scroll" === o) && l.scrollWidth > l.clientWidth;if (r || n) {t = true;break;}l = l.parentElement;}if (t) return;}n.isWheelScrolling = true, z(this), n.wheelScrollTimeout && clearTimeout(n.wheelScrollTimeout), n.wheelScrollTimeout = setTimeout(() => {n.isWheelScrolling = false, n.wheelScrollTimeout = void 0;}, 100);}, { passive: true }), t.virtualTable = void 0 === e.virtualTable || !!e.virtualTable, t.estimatedRowHeight = e.estimatedRowHeight || void 0, t.rowsBufferSize = Math.max((_e$rowsBufferSize = e.rowsBufferSize) !== null && _e$rowsBufferSize !== void 0 ? _e$rowsBufferSize : 3, 0), t.minColumnWidth = Math.max((_e$minColumnWidth = e.minColumnWidth) !== null && _e$minColumnWidth !== void 0 ? _e$minColumnWidth : 35, 0), t.maxStickyColumnRelativeWidth = e.maxStickyColumnRelativeWidth || null, t.columnAutoWidthExtraSize = e.columnAutoWidthExtraSize || 0, t.resizeAreaWidth = Math.max((_e$resizeAreaWidth = e.resizeAreaWidth) !== null && _e$resizeAreaWidth !== void 0 ? _e$resizeAreaWidth : 8, 0), t.resizeAreaDoubleClickDuration = Math.max((_e$resizeAreaDoubleCl = e.resizeAreaDoubleClickDuration) !== null && _e$resizeAreaDoubleCl !== void 0 ? _e$resizeAreaDoubleCl : 300, 0), t.autoFitColumnOnResizeDoubleClick = void 0 !== e.autoFitColumnOnResizeDoubleClick && !!e.autoFitColumnOnResizeDoubleClick, t.resizableColumns = void 0 === e.resizableColumns || !!e.resizableColumns, t.movableColumns = void 0 === e.movableColumns || !!e.movableColumns;const d = (_e$maxColumnsSortCoun = e.maxColumnsSortCount) !== null && _e$maxColumnsSortCoun !== void 0 ? _e$maxColumnsSortCoun : e.sortableColumns,u = Number(d !== null && d !== void 0 ? d : 1);t.sortableColumns = Number.isFinite(u) ? Math.max(u, 0) : 1, t.adjustColumnWidthForSortArrow = void 0 === e.adjustColumnWidthForSortArrow || !!e.adjustColumnWidthForSortArrow, t.convertColumnWidthsToRelative = void 0 !== e.convertColumnWidthsToRelative && !!e.convertColumnWidthsToRelative, t.autoFillTableWidth = void 0 !== e.autoFillTableWidth && !!e.autoFillTableWidth, t.autoFillLastColumn = void 0 === e.autoFillLastColumn || !!e.autoFillLastColumn, t.allowCancelSort = void 0 === e.allowCancelSort || !!e.allowCancelSort, t.cellClasses = void 0 === e.cellClasses ? "" : e.cellClasses, t.resizerClassName = void 0 === e.resizerClassName ? "dgtable-resize" : e.resizerClassName, t.tableClassName = void 0 === e.tableClassName ? "dgtable" : e.tableClassName, t.allowCellPreview = void 0 === e.allowCellPreview || e.allowCellPreview, t.allowHeaderCellPreview = void 0 === e.allowHeaderCellPreview || e.allowHeaderCellPreview, t.cellPreviewClassName = void 0 === e.cellPreviewClassName ? "dgtable-cell-preview" : e.cellPreviewClassName, t.cellPreviewAutoBackground = void 0 === e.cellPreviewAutoBackground || e.cellPreviewAutoBackground, t.onComparatorRequired = void 0 === e.onComparatorRequired ? null : e.onComparatorRequired, t.customSortingProvider = void 0 === e.customSortingProvider ? null : e.customSortingProvider, t.width = void 0 === e.width ? _.NONE : e.width, t.relativeWidthGrowsToFillWidth = void 0 === e.relativeWidthGrowsToFillWidth || !!e.relativeWidthGrowsToFillWidth, t.relativeWidthShrinksToFillWidth = void 0 !== e.relativeWidthShrinksToFillWidth && !!e.relativeWidthShrinksToFillWidth, this.setCellFormatter(e.cellFormatter), this.setHeaderCellFormatter(e.headerCellFormatter), this.setFilter(e.filter), t.height = e.height, this.setColumns(e.columns || [], false);let h = [];const c = (_e$sortedColumns = e.sortedColumns) !== null && _e$sortedColumns !== void 0 ? _e$sortedColumns : e.sortColumn;if (c) {let e = Array.isArray(c) ? c : [c];for (let t = 0, l = e.length; t < l; t++) {var _l$descending;let l = e[t];"string" == typeof l && (l = { column: l, descending: false });let i = n.columns.get(l.column);i && h.push({ column: l.column, comparePath: i.comparePath || i.dataPath, descending: (_l$descending = l.descending) !== null && _l$descending !== void 0 ? _l$descending : false });}}n.rows = new W({ sortColumn: h }), n.rows.onComparatorRequired = (e, l, i) => {if (t.onComparatorRequired) return t.onComparatorRequired(e, l, i);}, n.rows.customSortingProvider = (e, l) => t.customSortingProvider ? t.customSortingProvider(e, l) : l(e), n.filteredRows = null, n.scrollbarWidth = 0, n._lastVirtualScrollHeight = 0, function (e) {const t = e._p,n = (t) => {let n = t.currentTarget,s = t.relatedTarget;s === n || n.contains(s) || n[g] && (s === n[g] || n[g].contains(s)) || function (e, t, _s$visibleColumns$N$c, _P$right) {const n = e._o,s = e._p;if (s.isWheelScrolling) return;const a = t.firstElementChild;if (!a) return;if (!(a.scrollWidth - a.clientWidth > 1 || a.scrollHeight - a.clientHeight > 1)) return;z(e), s.abortCellPreview = false;const d = t.parentElement;if (!d) return;const u = (_s$visibleColumns$N$c = s.visibleColumns[N.call(d.childNodes, t)]) === null || _s$visibleColumns$N$c === void 0 ? void 0 : _s$visibleColumns$N$c.name,h = u ? s.columns.get(u) : null;if (!h) return;const c = d.index;if (e.emit("cellhoveroverflow", { name: u, rowIndex: c !== null && c !== void 0 ? c : null, rowData: null == c ? null : s.rows[c], cell: t, cellEl: a }), false === h.allowPreview) return;const m = t.classList.contains(`${n.tableClassName}-header-cell`);if (m ? !n.allowHeaderCellPreview : !n.allowCellPreview) return;const f = k("div");f.innerHTML = t.innerHTML, f.className = n.cellPreviewClassName + " " + (h.cellClasses || ""), m && (f.classList.add("header"), t.classList.contains("sortable") && f.classList.add("sortable"), f.draggable = true, le(e, f));const p = getComputedStyle(t),C = getComputedStyle(a),b = "right" === p.float,w = b ? "right" : "left",W = parseFloat(p.paddingLeft) || 0,y = parseFloat(p.paddingRight) || 0,S = parseFloat(p.paddingTop) || 0,R = parseFloat(p.paddingBottom) || 0;let _ = a.scrollWidth + (t.clientWidth - a.offsetWidth);const M = "border-box" === p.boxSizing;if (M ? f.style.boxSizing = "border-box" : (_ -= W + y, f.style.marginTop = (parseFloat(p.borderTopWidth) || 0) + "px"), !s.transparentBgColor1) {const e = document.createElement("div");document.body.appendChild(e), e.style.backgroundColor = "transparent", s.transparentBgColor1 = getComputedStyle(e).backgroundColor, e.style.backgroundColor = "rgba(0,0,0,0)", s.transparentBgColor2 = getComputedStyle(e).backgroundColor, e.remove();}const T = { "box-sizing": M ? "border-box" : "content-box", width: _ + "px", "min-height": Math.max(getElementHeight(t), /%/.test(p.minHeight) ? 0 : parseFloat(p.minHeight) || 0) + "px", "padding-left": W + "px", "padding-right": y + "px", "padding-top": S + "px", "padding-bottom": R + "px", overflow: "hidden", position: "absolute", "z-index": "-1", [w]: "0", top: "0", cursor: p.cursor };if (n.cellPreviewAutoBackground) {let e = p.backgroundColor;e !== s.transparentBgColor1 && e !== s.transparentBgColor2 || (e = getComputedStyle(d).backgroundColor), e !== s.transparentBgColor1 && e !== s.transparentBgColor2 || (e = "#fff"), T["background-color"] = e;}setCssProps(f, T), f.firstChild && setCssProps(f.firstChild, { direction: C.direction, "white-space": C.whiteSpace, "min-height": C.minHeight, "line-height": C.lineHeight, font: C.font }), e.el.appendChild(f), m && me(f), f.rowVIndex = d.vIndex, f.rowIndex = c, f.columnName = u;try {const e = x.saveSelection(t);e && x.restoreSelection(f, e);} catch {}if (e.emit("cellpreview", { el: f.firstElementChild, name: f.columnName, rowIndex: c !== null && c !== void 0 ? c : null, rowData: null == c ? null : s.rows[c], cell: t, cellEl: a }), s.abortCellPreview) return void f.remove();null != c && f.addEventListener("click", (t) => {e.emit("rowclick", { event: t, filteredRowIndex: d.vIndex, rowIndex: c, rowEl: d, rowData: s.rows[c] });});const L = e.el,F = L === window ? document : L,A = getComputedStyle(L),P = getElementOffset(t),H = getElementOffset(L);if (b) {const e = window.innerWidth;P.right = e - (P.left + getElementWidth(t, true, true, true)), H.right = e - (H.left + getElementWidth(L, true, true, true));}P.left -= parseFloat(A.borderLeftWidth) || 0, "right" === w && void 0 !== P.right && void 0 !== H.right && (P.right -= parseFloat(A.borderRightWidth) || 0), P.top -= parseFloat(A.borderTopWidth) || 0, "left" === w ? P.left += parseFloat(p.borderLeftWidth) || 0 : void 0 !== P.right && (P.right += parseFloat(p.borderRightWidth) || 0), P.top += parseFloat(p.borderTopWidth) || parseFloat(p.borderBottomWidth) || 0, P.left -= H.left, "right" === w && void 0 !== P.right && void 0 !== H.right && (P.right -= H.right), P.top -= H.top;const E = getElementWidth(L, false, false, false) - getElementWidth(f, true, true, true),O = "left" === w ? P.left : (_P$right = P.right) !== null && _P$right !== void 0 ? _P$right : 0,I = Math.max(0, Math.min(E, O));"left" === w ? P.left = I : P.right = I;const D = getElementHeight(t, true, true, true),B = ("scrollTop" in F ? F.scrollTop : 0) + getElementHeight(L, true) - D;P.top > B && (P.top = Math.max(0, B));const $ = { top: P.top + "px", "z-index": 9999 };$[w] = ("left" === w ? P.left : P.right) + "px", setCssProps(f, $), f[v] = t, s.cellPreviewCell = f, t[g] = f, s._bindCellHoverOut(t), s._bindCellHoverOut(f);}(e, n);},s = (t) => {let l = t.currentTarget[v] || t.currentTarget,i = t.relatedTarget;i === e.el || l.contains(i) || l[g] && (i === l[g] || l[g].contains(i)) || function (e) {z(e);}(e);};t._bindCellHoverIn = (e) => {e[m] || e.addEventListener("mouseover", e[m] = n);}, t._unbindCellHoverIn = (e) => {e[m] && (e.removeEventListener("mouseover", e[m]), e[m] = null);}, t._bindCellHoverOut = (e) => {e[f] || e.addEventListener("mouseout", e[f] = s);}, t._unbindCellHoverOut = (e) => {e[f] && (e.removeEventListener("mouseout", e[f]), e[f] = null);};}(this);}on(e, t) {return this[w] || this._p.mitt.on(e, t), this;}once(e, t) {if (this[w]) return this;const l = (i) => {this._p.mitt.off(e, l), t(i);};return l[we] = t, this._p.mitt.on(e, l), this;}off(e, t) {if (this[w]) return this;if (e || t) {if (this._p.mitt.off(e, t), t) {var _this$_p$mitt$all$get;const l = (_this$_p$mitt$all$get = this._p.mitt.all.get(e)) !== null && _this$_p$mitt$all$get !== void 0 ? _this$_p$mitt$all$get : [];for (const i of l.slice()) i[we] === t && this._p.mitt.off(e, i);}} else this._p.mitt.all.clear();return this;}emit(e, t) {return this[w] || this._p.mitt.emit(e, t), this;}destroy() {var _e$virtualListHelper, _e$table, _e$tbody;const e = this._p,t = this.el;if (this[w] || !e) return this;if (A(this), V(this), (_e$virtualListHelper = e.virtualListHelper) !== null && _e$virtualListHelper !== void 0 && _e$virtualListHelper.destroy(), e.virtualListHelper = null, Y(this), (_e$table = e.table) !== null && _e$table !== void 0 && _e$table.remove(), (_e$tbody = e.tbody) !== null && _e$tbody !== void 0 && _e$tbody.remove(), e.workerListeners) {for (let t = 0; t < e.workerListeners.length; t++) {let l = e.workerListeners[t];l.worker.removeEventListener("message", l.listener, false);}e.workerListeners.length = 0;}e.rows.length = e.columns.length = 0, e._deferredRender && clearTimeout(e._deferredRender), e.wheelScrollTimeout && clearTimeout(e.wheelScrollTimeout), e.tapAndHoldTimeout && clearTimeout(e.tapAndHoldTimeout), e.eventsSink.remove();for (let e in this) be.call(this, e) && (this[e] = null);return this[w] = true, t && t.remove(), this;}close() {this.destroy();}remove() {this.destroy();}render() {const o = this._o,r = this._p;if (!this.el.offsetParent) return r._deferredRender || (r._deferredRender = setTimeout(() => {r._deferredRender = null, !this[w] && this.el.offsetParent && this.render();})), this;if (true === r.tableSkeletonNeedsRendering) {var _r$filteredRows;r.tableSkeletonNeedsRendering = false, o.width === _.AUTO && ee(this);let n = r.table && r.table.parentNode ? r.table.scrollTop : NaN,s = r.table && r.table.parentNode ? getScrollHorz(r.table) : NaN;!function (e, _t$virtualListHelper) {const t = e._p,i = e._o;V(e), (_t$virtualListHelper = t.virtualListHelper) !== null && _t$virtualListHelper !== void 0 && _t$virtualListHelper.destroy(), t.virtualListHelper = null, t.table && i.virtualTable && (t.table.remove(), t.table = void 0, t.tbody = void 0), Y(e), t.currentTouchId = null, t.header && t.header.remove();const o = i.tableClassName,r = q("div"),n = q("div");r.className = `${o}-header`, n.className = `${o}-header-row`, t.header = r, t.headerRow = n, r.appendChild(n), e.el.prepend(r), ue(e.el), i.width === _.SCROLL ? e.el.style.overflow = "hidden" : e.el.style.overflow = "", !i.height && i.virtualTable && (i.height = getElementHeight(e.el, true));}(this), function (e) {const t = e._p,o = e._o,r = o.tableClassName;if (o.virtualTable && !t.virtualRowHeight) {const o = () => {const e = q("div"),t = e.appendChild(q("div")),l = t.appendChild(q("div"));return e.className = `${r}-row`, t.className = `${r}-cell`, l.innerHTML = "0", e.style.visibility = "hidden", e.style.position = "absolute", e;},n = q("div");n.className = e.el.className, setCssProps(n, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px", width: "1px", overflow: "hidden" });const s = q("div");s.className = r, n.appendChild(s);const a = q("div");a.className = `${r}-body`, a.style.width = "99999px", s.appendChild(a), document.body.appendChild(n);const d = o(),u = o(),h = o();a.appendChild(d), a.appendChild(u), a.appendChild(h), t.virtualRowHeight = getElementHeight(u, true, true, true), n.remove();}if (!t.table) {var _o$height;const n = document.createDocumentFragment(),s = q("div");s.className = r, o.virtualTable && (s.className += " virtual");const a = getComputedStyle(s);let d = ((_o$height = o.height) !== null && _o$height !== void 0 ? _o$height : 0) - getElementHeight(t.header, true, true, true);"border-box" !== a.boxSizing && (d -= parseFloat(a.borderTopWidth) || 0, d -= parseFloat(a.borderBottomWidth) || 0, d -= parseFloat(a.paddingTop) || 0, d -= parseFloat(a.paddingBottom) || 0), setCssProps(s, { height: o.height ? d + "px" : "auto", display: "block", overflowY: "auto", overflowX: o.width === _.SCROLL ? "auto" : "hidden" }), n.appendChild(s);const u = q("div");u.className = o.tableClassName + "-body", u.style.minHeight = "1px", t.table = s, t.tbody = u, ue(u), ue(s), s.appendChild(u), e.el.appendChild(n);}t.virtualListHelper || function (e, _t$filteredRows) {const t = e._p,l = e._o,i = l.tableClassName,o = i + "-row",r = i + "-row-alt",n = i + "-cell",s = i + "-sticky";let a = t.visibleColumns,u = a.length;t.notifyRendererOfColumnsConfig = () => {a = t.visibleColumns, u = a.length;for (let e = 0; e < u; e++) {const t = a[e];t._finalWidth = t.actualWidthConsideringScrollbarWidth || t.actualWidth;}}, t.virtualListHelper = new VirtualListHelper({ list: t.table, itemsParent: t.tbody, autoVirtualWrapperWidth: false, virtual: l.virtualTable, buffer: l.rowsBufferSize, estimatedItemHeight: l.estimatedRowHeight ? l.estimatedRowHeight : t.virtualRowHeight || 40, itemElementCreatorFn: () => q("div"), onItemRender: (i, d) => {const h = i,c = t.filteredRows || t.rows,m = !!t.filteredRows,f = t.isStickyColumns;h.className = o, d % 2 == 1 && (h.className += " " + r);const g = c[d],v = m ? g[b] : d;h.vIndex = d, h.index = v;for (let e = 0; e < u; e++) {var _i$_finalWidth;const i = a[e],o = q("div");if (o.columnName = i.name, o.setAttribute("data-column", i.name), o.className = n, o.style.width = ((_i$_finalWidth = i._finalWidth) !== null && _i$_finalWidth !== void 0 ? _i$_finalWidth : 0) + "px", i.cellClasses && (o.className += " " + i.cellClasses), i.stickyPos) {o.className += " " + s, o.style.position = "sticky", o.style[i.stickyPos.absDirection] = i.stickyPos.offset + "px";const l = f === null || f === void 0 ? void 0 : f.get(e);"start" === l && !t.lastIsRtl || "end" === l && t.lastIsRtl ? o.classList.add("is-sticky-left") : ("start" === l && t.lastIsRtl || "end" === l && !t.lastIsRtl) && o.classList.add("is-sticky-right");}t._bindCellHoverIn(o), o.appendChild(q("div")).innerHTML = ae(l, g, i), h.appendChild(o);}h.addEventListener("click", h[p] = (t) => {e.emit("rowclick", { event: t, filteredRowIndex: d, rowIndex: v, rowEl: h, rowData: g });}), e.emit("rowcreate", { filteredRowIndex: d, rowIndex: v, rowEl: h, rowData: g });}, onItemUnrender: (t) => X(e, t), onScrollHeightChange: (l) => {l > t._lastVirtualScrollHeight && !t.scrollbarWidth && G(e), t._lastVirtualScrollHeight = l;} }), t.virtualListHelper.setCount(((_t$filteredRows = t.filteredRows) !== null && _t$filteredRows !== void 0 ? _t$filteredRows : t.rows).length), t.notifyRendererOfColumnsConfig();}(e);}(this), this.tableWidthChanged(true, false), function (e) {const t = e._p,l = e._o,i = l.tableClassName + "-header-cell",o = t.headerRow;for (let r = 0; r < t.visibleColumns.length; r++) {const n = t.visibleColumns[r];if (n.visible) {var _n$actualWidth;const s = q("div");s.draggable = true, s.className = i, s.style.width = ((_n$actualWidth = n.actualWidth) !== null && _n$actualWidth !== void 0 ? _n$actualWidth : 0) + "px", l.sortableColumns && n.sortable && (s.className += " sortable"), s.columnName = n.name, s.setAttribute("data-column", n.name);const a = q("div");a.innerHTML = l.headerCellFormatter(n.label, n.name), s.appendChild(a), t._bindCellHoverIn(s), o.appendChild(s), t.visibleColumns[r].element = s, le(e, s), me(s);}}K(e), e.emit("headerrowcreate", o);}(this), r.virtualListHelper.setCount(((_r$filteredRows = r.filteredRows) !== null && _r$filteredRows !== void 0 ? _r$filteredRows : r.rows).length), U(this), G(this, true), J(this, true), j(this), G(this);for (let e = 0; e < r.rows.sortColumn.length; e++) te(this, r.rows.sortColumn[e].column, r.rows.sortColumn[e].descending);o.adjustColumnWidthForSortArrow && r.rows.sortColumn.length ? this.tableWidthChanged(true) : o.virtualTable || this.tableWidthChanged(), isNaN(n) || (r.table.scrollTop = n), isNaN(s) || (setScrollHorz(r.table, s), setScrollHorz(r.header, s)), K(this), this.emit("renderskeleton");}r.virtualListHelper.render();const n = r.scrollbarWidth;return G(this), r.scrollbarWidth !== n && J(this, false), this.emit("render"), this;}clearAndRender(e) {var _t$notifyRendererOfCo;let t = this._p;return t.tableSkeletonNeedsRendering = true, (_t$notifyRendererOfCo = t.notifyRendererOfColumnsConfig) !== null && _t$notifyRendererOfCo !== void 0 && _t$notifyRendererOfCo.call(t), (void 0 === e || e) && this.render(), this;}setColumns(e, t) {const l = this._p;e = e || [];let i = new S();for (let t = 0, l = 0; t < e.length; t++) {let o = e[t],r = oe(this._o, o);void 0 !== o.order ? (o.order > l && (l = o.order + 1), r.order = o.order) : r.order = l++, i.push(r);}return i.normalizeOrder(), l.columns = i, l.visibleColumns = i.getVisibleColumns(), re(this), this.clearAndRender(t), this;}addColumn(e, t, l) {const i = this._p;let o = i.columns;if (e && !o.get(e.name)) {let r = null;void 0 !== t && (r = "string" == typeof t ? o.get(t) : o.getByOrder(t));let n = oe(this._o, e);n.order = r ? r.order : o.getMaxOrder() + 1;for (let e = o.getMaxOrder(), t = n.order; e >= t; e--) {let t = o.getByOrder(e);t && t.order++;}o.push(n), o.normalizeOrder(), i.visibleColumns = o.getVisibleColumns(), re(this), this.clearAndRender(l), this.emit("addcolumn", n.name);}return this;}removeColumn(e, t) {const l = this._p;let i = l.columns,o = i.indexOf(e);return o > -1 && (i.splice(o, 1), i.normalizeOrder(), l.visibleColumns = i.getVisibleColumns(), re(this), this.clearAndRender(t), this.emit("removecolumn", e)), this;}setColumnLabel(e, t) {let l = this._p.columns.get(e);if (l && (l.label = void 0 === t ? l.name : t, l.element)) {const e = l.element.firstChild,t = e.querySelector(":scope > .sort-arrow");e.innerHTML = this._o.headerCellFormatter(l.label, l.name), t && e.insertBefore(t, e.firstChild);}return this;}moveColumn(e, t, l = true) {const i = this._o,o = this._p;let r,n,a = o.columns,d = l ? o.visibleColumns : a.getColumns();if ("string" == typeof e ? r = a.get(e) : "number" == typeof e && (r = d[e]), "string" == typeof t ? n = a.get(t) : "number" == typeof t && (n = d[t]), r && n && e !== t) {let e = r.order,t = n.order,l = a.moveColumn(r, n).getVisibleColumns();if (o.visibleColumns.length !== l.length || o.visibleColumns.some((e, t) => e !== l[t])) {const e = o.visibleColumns.indexOf(r),t = o.visibleColumns.indexOf(n);if (o.visibleColumns = l, re(this), !i.virtualTable && -1 !== e && -1 !== t && o.headerRow && o.tbody) {var _ref8, _ref9;const l = scopedSelectorAll(o.headerRow, `>div.${i.tableClassName}-header-cell`),r = e < t ? t + 1 : t;l[0].parentNode.insertBefore(l[e], l[r]);const n = o.visibleColumns[t],a = ((_ref8 = n.actualWidthConsideringScrollbarWidth || n.actualWidth) !== null && _ref8 !== void 0 ? _ref8 : 0) + "px",d = o.visibleColumns[e],u = ((_ref9 = d.actualWidthConsideringScrollbarWidth || d.actualWidth) !== null && _ref9 !== void 0 ? _ref9 : 0) + "px",h = o.tbody.childNodes;for (let l = 0, i = h.length; l < i; l++) {const i = h[l];1 === i.nodeType && (i.insertBefore(i.childNodes[e], i.childNodes[r]), i.childNodes[t].firstChild.style.width = a, i.childNodes[e].firstChild.style.width = u);}this.tableWidthChanged(true);} else this.clearAndRender();}this.emit("movecolumn", { name: r.name, src: e, dest: t });}return this;}setColumnVisible(e, t) {const l = this._p;let i = l.columns.get(e);return t = !!t, i && !!i.visible !== t && (i.visible = t, l.visibleColumns = l.columns.getVisibleColumns(), this.emit(t ? "showcolumn" : "hidecolumn", e), re(this), this.clearAndRender()), this;}isColumnVisible(e) {let t = this._p.columns.get(e);return !!t && t.visible;}setMinColumnWidth(e) {let t = this._o;return e = Math.max(e, 0), t.minColumnWidth !== e && (t.minColumnWidth = e, this.tableWidthChanged(true)), this;}getMinColumnWidth() {return this._o.minColumnWidth;}setColumnAutoWidthExtraSize(e) {let t = this._o;return e = Math.max(e, 0), t.columnAutoWidthExtraSize !== e && (t.columnAutoWidthExtraSize = e, this.tableWidthChanged(true)), this;}getColumnAutoWidthExtraSize() {return this._o.columnAutoWidthExtraSize;}setResizeAreaWidth(e) {let t = this._o;return e = Math.max(e, 0), t.resizeAreaWidth !== e && (t.resizeAreaWidth = e, this.tableWidthChanged(true)), this;}getResizeAreaWidth() {return this._o.resizeAreaWidth;}setResizeAreaDoubleClickDuration(e) {let t = this._o;return e = Math.max(e, 0), t.resizeAreaDoubleClickDuration !== e && (t.resizeAreaDoubleClickDuration = e, this.tableWidthChanged(true)), this;}getResizeAreaDoubleClickDuration() {return this._o.resizeAreaDoubleClickDuration;}setMaxStickyColumnRelativeWidth(e) {let t = this._o;return e = e || null, t.maxStickyColumnRelativeWidth !== e && (t.maxStickyColumnRelativeWidth = e, this.tableWidthChanged(true)), this;}getMaxStickyColumnRelativeWidth() {return this._o.maxStickyColumnRelativeWidth;}setColumnWidth(e, t) {let l = this._p.columns.get(e);if (l) {let e = ie(t, l.ignoreMin ? 0 : this._o.minColumnWidth),i = Ce(l);l.width = e.width, l.widthMode = e.mode, l.unconvertedWidth = null, l.unconvertedWidthMode = null;let o = Ce(l);i !== o && this.tableWidthChanged(true), this.emit("columnwidth", { name: l.name, width: o, oldWidth: i });}return this;}autoFitColumn(e) {const t = this._p,l = t.filteredRows || t.rows,i = t.columns.get(e);if (!i || l.length < 1) return this;const o = fe(this, i, l);return o > 0 && this.setColumnWidth(e, o), this;}getColumnWidth(e) {let t = this._p.columns.get(e);return t ? Ce(t) : null;}getColumnConfig(e) {let t = this._p.columns.get(e);if (t) {var _t$unconvertedWidthMo, _t$dataPath, _t$comparePath;const e = t.width,l = t.widthMode;null != t.unconvertedWidth && (t.width = t.unconvertedWidth, t.widthMode = (_t$unconvertedWidthMo = t.unconvertedWidthMode) !== null && _t$unconvertedWidthMo !== void 0 ? _t$unconvertedWidthMo : t.widthMode);const i = Ce(t);return null != t.unconvertedWidth && (t.width = e, t.widthMode = l), { name: t.name, label: t.label, width: i, dataPath: (_t$dataPath = t.dataPath) === null || _t$dataPath === void 0 ? void 0 : _t$dataPath.join("."), comparePath: (_t$comparePath = t.comparePath) === null || _t$comparePath === void 0 ? void 0 : _t$comparePath.join("."), resizable: t.resizable, movable: t.movable, sortable: t.sortable, visible: t.visible, cellClasses: t.cellClasses, ignoreMin: t.ignoreMin, sticky: t.sticky, order: t.order, allowPreview: t.allowPreview };}return null;}getColumnsConfig() {const e = this._p;let t = {};for (let l = 0; l < e.columns.length; l++) t[e.columns[l].name] = this.getColumnConfig(e.columns[l].name);return t;}setMaxColumnSortCount(e) {const t = this._p,l = this._o;if (l.sortableColumns !== e && (l.sortableColumns = e, t.table)) {const e = scopedSelectorAll(t.headerRow, `>div.${l.tableClassName}-header-cell`);for (let i = 0, o = e.length; i < o; i++) e[i].classList[l.sortableColumns > 0 && t.visibleColumns[i].sortable ? "add" : "remove"]("sortable");}return this;}getMaxColumnSortCount() {return this._o.sortableColumns;}setSortableColumns(e) {return this.setMaxColumnSortCount(e);}getSortableColumns() {return this.getMaxColumnSortCount();}setMovableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.movableColumns !== e && (t.movableColumns = e), this;}getMovableColumns() {return this._o.movableColumns;}setResizableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.resizableColumns !== e && (t.resizableColumns = e), this;}getResizableColumns() {return this._o.resizableColumns;}getConvertColumnWidthsToRelative() {return this._o.convertColumnWidthsToRelative;}setConvertColumnWidthsToRelative(e, t = true) {let l = this._o;return e = !!e, l.convertColumnWidthsToRelative !== e && (l.convertColumnWidthsToRelative = e, t && this.tableWidthChanged(true)), this;}setOnComparatorRequired(e) {let t = this._o;return t.onComparatorRequired !== e && (t.onComparatorRequired = e), this;}setCustomSortingProvider(e) {let t = this._o;return t.customSortingProvider !== e && (t.customSortingProvider = e), this;}sort(e, t, l) {const i = this._o,o = this._p;let r = o.columns.get(e),n = o.rows.sortColumn.map((e) => ({ column: e.column, descending: e.descending }));if (r) {if (l) {for (let e = 0; e < n.length; e++) if (n[e].column === r.name) {e < n.length - 1 ? n.length = 0 : (t = n[n.length - 1].descending, n.splice(n.length - 1, 1));break;}(i.sortableColumns > 0 && n.length >= i.sortableColumns || n.length >= o.visibleColumns.length) && (n.length = 0);} else n.length = 0;t = void 0 !== t && t, n.push({ column: r.name, descending: !!t });} else n.length = 0;return this.setSortedColumns(n);}resort() {const e = this._p;let t = e.columns,l = e.rows.sortColumn;if (l.length) {var _e$virtualListHelper2;for (let e = 0; e < l.length; e++) t.get(l[e].column) || l.splice(e--, 1);e.rows.sortColumn = l, l.length && (e.rows.sort(), se(this)), (_e$virtualListHelper2 = e.virtualListHelper) === null || _e$virtualListHelper2 === void 0 ? void 0 : _e$virtualListHelper2.invalidate();let i = [];for (let e = 0; e < l.length; e++) i.push({ column: l[e].column, descending: l[e].descending });this.emit("sort", { sorts: i, resort: true });}return this;}setSortedColumns(e, t = { immediate: true, render: true }) {var _i$virtualListHelper;const l = this._o,i = this._p;let o = i.columns,r = e.filter((e) => o.get(e.column)).map((e) => {let t = o.get(e.column);return { column: t.name, comparePath: t.comparePath || t.dataPath, descending: !!e.descending };});l.sortableColumns > 0 && r.length > l.sortableColumns && (r.length = l.sortableColumns), ee(this);for (let e = 0; e < r.length; e++) te(this, r[e].column, r[e].descending);l.adjustColumnWidthForSortArrow && !i.tableSkeletonNeedsRendering && this.tableWidthChanged(true), i.rows.sortColumn = r, r.length && t.immediate && (i.rows.sort(), se(this), (_i$virtualListHelper = i.virtualListHelper) !== null && _i$virtualListHelper !== void 0 && _i$virtualListHelper.invalidate(), i.virtualListHelper && t.render && i.virtualListHelper.render());let n = [];for (let e = 0; e < r.length; e++) n.push({ column: r[e].column, descending: r[e].descending });return this.emit("sort", { sorts: n }), this;}getSortedColumns() {const e = this._p;let t = [];for (let l = 0; l < e.rows.sortColumn.length; l++) {let i = e.rows.sortColumn[l];t.push({ column: i.column, descending: i.descending });}return t;}setCellFormatter(e) {if (!e) {const t = (e) => "string" == typeof e ? h(e) : e;t[c] = true, e = t;}return this._o.cellFormatter = e, this;}setHeaderCellFormatter(e) {return this._o.headerCellFormatter = e || function (e) {return "string" == typeof e ? h(e) : e;}, this;}setFilter(e) {return this._o.filter = e, this;}filter(e) {const t = this._p;let l = this._o.filter || R,i = !!t.filteredRows;return t.filteredRows && (t.filteredRows = null), t.filterArgs = null == e ? null : "object" != typeof e || Array.isArray(e) ? e : Object.assign({}, e), null !== t.filterArgs ? (t.filteredRows = t.rows.filteredCollection(l, t.filterArgs), (i || t.filteredRows) && (this.clearAndRender(), this.emit("filter", e))) : (t.filterArgs = null, t.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}clearFilter() {const e = this._p;return e.filteredRows && (e.filterArgs = null, e.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}getHtmlForRowCell(e, t) {const l = this._p;if (e < 0 || e > l.rows.length - 1) return null;let i = l.columns.get(t);if (!i) return null;let o = l.rows[e];return ae(this._o, o, i);}getHtmlForRowDataCell(e, t) {let l = this._p.columns.get(t);return l ? ae(this._o, e, l) : null;}getRowYPos(e) {var _t$virtualListHelper$, _t$virtualListHelper2;const t = this._p;if (e < 0 || e > t.rows.length - 1) return null;let l = e;return t.filteredRows && -1 === (l = t.filteredRows.indexOf(t.rows[e])) ? null : (_t$virtualListHelper$ = (_t$virtualListHelper2 = t.virtualListHelper) === null || _t$virtualListHelper2 === void 0 ? void 0 : _t$virtualListHelper2.getItemPosition(l)) !== null && _t$virtualListHelper$ !== void 0 ? _t$virtualListHelper$ : null;}getDataForRow(e) {const t = this._p;return e < 0 || e > t.rows.length - 1 ? null : t.rows[e];}getRowCount() {const e = this._p;return e.rows ? e.rows.length : 0;}getIndexForRow(e) {return this._p.rows.indexOf(e);}getFilteredRowCount() {const e = this._p;return (e.filteredRows || e.rows).length;}getIndexForFilteredRow(e) {const t = this._p;return (t.filteredRows || t.rows).indexOf(e);}getDataForFilteredRow(e) {const t = this._p;return e < 0 || e > (t.filteredRows || t.rows).length - 1 ? null : (t.filteredRows || t.rows)[e];}getHeaderRowElement() {return this._p.headerRow;}addRows(e, t, l, i) {let o = this._p;"boolean" == typeof t && (i = l, l = t, t = -1), "number" != typeof t && (t = -1), (t < 0 || t > o.rows.length) && (t = o.rows.length), i = void 0 === i || !!i;const r = (Array.isArray(e) ? e : [e]).length;if (e) {if (o.rows.add(e, t), o.filteredRows || l && o.rows.sortColumn.length) ne(this), l && o.rows.sortColumn.length && this.resort(), o.tableSkeletonNeedsRendering = true, i && this.render();else if (i && o.virtualListHelper) {if (o.virtualListHelper.addItemsAt(r, t), this._o.virtualTable) U(this), G(this), this.render(), J(this, false);else if (o.tbody) {for (let e = t + r, l = o.virtualListHelper.getCount(); e < l; e++) o.virtualListHelper.refreshItemAt(e);this.render(), G(this), J(this, true);}} else o.tableSkeletonNeedsRendering = true;this.emit("addrows", { count: r, clear: false });}return this;}removeRows(e, t, l) {let i = this._p;if ("number" != typeof t || t <= 0) return this;if (e < 0 || e > i.rows.length - 1) return this;if (i.rows.splice(e, t), l = void 0 === l || !!l, i.filteredRows) ne(this), i.tableSkeletonNeedsRendering = true, l && this.render();else if (l && i.virtualListHelper) {if (i.virtualListHelper.removeItemsAt(t, e), this._o.virtualTable) U(this), G(this), this.render(), J(this, false);else {for (let t = e, l = i.virtualListHelper.getCount(); t < l; t++) i.virtualListHelper.refreshItemAt(t);this.render(), G(this), J(this, true);}} else i.tableSkeletonNeedsRendering = true;return this;}removeRow(e, t) {return this.removeRows(e, 1, t);}refreshRow(e, t = true) {let l = this._p;if (e < 0 || e > l.rows.length - 1) return this;let i = -1;return l.filteredRows && -1 === (i = l.filteredRows.indexOf(l.rows[e])) ? this : (-1 === i && (i = e), l.virtualListHelper ? (l.virtualListHelper.refreshItemAt(i), t && l.virtualListHelper.render(), this) : this);}getRowElement(e) {var _t$virtualListHelper3;let t = this._p;if (e < 0 || e > t.rows.length - 1) return null;let l = -1;return t.filteredRows && -1 === (l = t.filteredRows.indexOf(t.rows[e])) ? null : (-1 === l && (l = e), ((_t$virtualListHelper3 = t.virtualListHelper) === null || _t$virtualListHelper3 === void 0 ? void 0 : _t$virtualListHelper3.getItemElementAt(l)) || null);}refreshAllVirtualRows() {var _e$virtualListHelper3;const e = this._p;return (_e$virtualListHelper3 = e.virtualListHelper) !== null && _e$virtualListHelper3 !== void 0 && _e$virtualListHelper3.invalidate().render(), this;}setRows(e, t) {let l = this._p;return l.rows.reset(e), ne(this), t && l.rows.sortColumn.length && this.resort(), this.clearAndRender().emit("addrows", { count: e.length, clear: true }), this;}tableWidthChanged(e, t) {let l = this._o,i = this._p,o = pe(this),r = o,n = 0;if (!i.table) return this;t = void 0 === t || t;let s = 0;if (i.tbody || (t = false), t && (s = parseFloat(i.tbody.style.minWidth) || 0), r !== i.lastDetectedWidth || e) {var _i$notifyRendererOfCo;i.lastDetectedWidth = o;let e = 0,a = [],d = 0,u = 0;for (let e = 0; e < i.columns.length; e++) i.columns[e].actualWidthConsideringScrollbarWidth = null;for (let t = 0; t < i.visibleColumns.length; t++) {var _o$unconvertedWidthMo;let o = i.visibleColumns[t];if (null != o.unconvertedWidth && (o.width = o.unconvertedWidth, o.widthMode = (_o$unconvertedWidthMo = o.unconvertedWidthMode) !== null && _o$unconvertedWidthMo !== void 0 ? _o$unconvertedWidthMo : o.widthMode, o.unconvertedWidth = null, o.unconvertedWidthMode = null), 1 === o.widthMode) {let i = o.width;i += o.arrowProposedWidth || 0, !o.ignoreMin && i < l.minColumnWidth && (i = l.minColumnWidth), r -= i, e += i, i !== o.actualWidth && (o.actualWidth = i, a.push(t));} else if (0 === o.widthMode) {let n = fe(this, o);o === i.visibleColumns[i.visibleColumns.length - 1] && (n += i.scrollbarWidth), r -= n, e += n, n !== o.actualWidth && (o.actualWidth = n, l.convertColumnWidthsToRelative || a.push(t));} else 2 === o.widthMode ? (d += o.width, n++) : 3 === o.widthMode && u++;}if (l.convertColumnWidthsToRelative) for (let t = 0; t < i.visibleColumns.length; t++) {let l = i.visibleColumns[t];if (0 === l.widthMode) {const t = l.width,i = l.widthMode;null == l.unconvertedWidth && (l.unconvertedWidth = t, l.unconvertedWidthMode = i), l.widthMode = 2, r += l.actualWidth, l.width = l.actualWidth / e, d += l.width, n++;}}if (n && (d < 1 && !u && l.relativeWidthGrowsToFillWidth || d > 1 && l.relativeWidthShrinksToFillWidth)) for (let e = 0; e < i.visibleColumns.length; e++) {let t = i.visibleColumns[e];2 === t.widthMode && (null == t.unconvertedWidth && (t.unconvertedWidth = t.width, t.unconvertedWidthMode = t.widthMode), t.width /= d);}let h = Math.max(0, r);0 === h && (h = i.table.clientWidth);let c = l.minColumnWidth / h;if (Number.isFinite(c) || (c = 0), c > 0) {let e,t = 0;for (let e = 0; e < i.visibleColumns.length; e++) {let l = i.visibleColumns[e];2 === l.widthMode && !l.ignoreMin && l.width < c && (t += c - l.width, l.width = c);}for (let l = 0; l < i.visibleColumns.length; l++) {let o = i.visibleColumns[l];2 === o.widthMode && !o.ignoreMin && o.width > c && t > 0 && (null == o.unconvertedWidth && (o.unconvertedWidth = o.width, o.unconvertedWidthMode = o.widthMode), e = Math.min(t, o.width - c), o.width -= e, t -= e);}}if (!u && l.autoFillTableWidth && r > 0) {let e = 0,t = r;for (let l = 0; l < i.visibleColumns.length; l++) {let o = i.visibleColumns[l];o.resizable || 1 !== o.widthMode || (e += o.width), 2 === o.widthMode && (t -= Math.round(h * o.width));}let l = (o - e) / (o - t - e) || NaN;for (let e = 0; e < i.visibleColumns.length && t > 0; e++) {let t = i.visibleColumns[e];if (t.resizable || 1 !== t.widthMode) if (2 === t.widthMode) null == t.unconvertedWidth && (t.unconvertedWidth = t.width, t.unconvertedWidthMode = t.widthMode), t.width *= l;else {let i = t.actualWidth * l;t.actualWidth !== i && (t.actualWidth = i, -1 === a.indexOf(e) && a.push(e));}}}for (let e = 0; e < i.visibleColumns.length; e++) {let t = i.visibleColumns[e];if (2 === t.widthMode) {let l = Math.round(h * t.width);r -= l, n--, 0 === n && 1 === r && (l++, r--), -1 === r && (l--, r++), l !== t.actualWidth && (t.actualWidth = l, a.push(e));}}if (u) {let e = Math.max(0, r),t = u;for (let o = 0; o < i.visibleColumns.length; o++) {let r = i.visibleColumns[o];if (3 === r.widthMode) {let i = Math.max(0, Math.floor(e / t));!r.ignoreMin && i < l.minColumnWidth && (i = l.minColumnWidth), e -= i, t--, i !== r.actualWidth && (r.actualWidth = i, a.push(o));}}}if (l.autoFillLastColumn && i.visibleColumns.length) {var _l$actualWidth2;let e = 0;for (let t = 0; t < i.visibleColumns.length; t++) {var _i$visibleColumns$t$a;e += (_i$visibleColumns$t$a = i.visibleColumns[t].actualWidth) !== null && _i$visibleColumns$t$a !== void 0 ? _i$visibleColumns$t$a : 0;}const t = i.visibleColumns.length - 1,l = i.visibleColumns[t],r = o - e;r > 0 && (l.actualWidth = ((_l$actualWidth2 = l.actualWidth) !== null && _l$actualWidth2 !== void 0 ? _l$actualWidth2 : 0) + r, -1 === a.indexOf(t) && a.push(t));}if (i.visibleColumns.length && (i.visibleColumns[i.visibleColumns.length - 1].actualWidthConsideringScrollbarWidth = i.visibleColumns[i.visibleColumns.length - 1].actualWidth - (i.scrollbarWidth || 0)), (_i$notifyRendererOfCo = i.notifyRendererOfColumnsConfig) !== null && _i$notifyRendererOfCo !== void 0 && _i$notifyRendererOfCo.call(i), t) {let e = ge(this);s < e && J(this, false);for (let e = 0; e < a.length; e++) Z(this, a[e]);s > e && J(this, false);}K(this);}return this;}tableHeightChanged() {let e = this._o;if (!this._p.table) return this;let t = getElementHeight(this.el, true);return t !== e.height && (e.height = t, j(this), e.virtualTable && this.clearAndRender()), this;}hideCellPreview() {return z(this), this;}abortCellPreview() {return this.hideCellPreview(), this;}cancelColumnResize() {return A(this), this;}getUrlForElementContent(e) {let t,l = document.getElementById(e);if (l) {let e = l.textContent;if ("function" == typeof Blob) t = new Blob([e || ""]);else {const l = window,i = l.BlobBuilder || l.WebKitBlobBuilder || l.MozBlobBuilder || l.MSBlobBuilder;if (!i) return null;const o = new i();o.append(e || ""), t = o.getBlob();}return (window.URL || window.webkitURL).createObjectURL(t);}return null;}isWorkerSupported() {return window.Worker instanceof Function;}createWebWorker(e, t, l) {if (this.isWorkerSupported()) {let i = this._p,o = new Worker(e),r = (e) => {e.data.append ? this.addRows(e.data.rows, l) : this.setRows(e.data.rows, l);};return o.addEventListener("message", r, false), i.workerListeners || (i.workerListeners = []), i.workerListeners.push({ worker: o, listener: r }), (t || void 0 === t) && o.postMessage(null), o;}return null;}unbindWebWorker(e) {let t = this._p;if (t.workerListeners) for (let l = 0; l < t.workerListeners.length; l++) t.workerListeners[l].worker === e && (e.removeEventListener("message", t.workerListeners[l].listener, false), t.workerListeners.splice(l, 1), l--);return this;}}_defineProperty(We, "VERSION", "2.0.38");_defineProperty(We, "Width", _);
3462
+ function u(e, t) {for (let l = 0, i = e.length; l >= 0 && l < i; l += 1) if (t(e[l], l, e)) return e[l];}function h(e) {return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&#39;").replace(/"/g, "&quot;").replace(/\n/g, "<br />");}const c = Symbol("safe"),m = Symbol("hover_in"),f = Symbol("hover_out"),p = Symbol("row_click"),g = Symbol("preview_cell"),v = Symbol("cell"),C = Symbol("related_touch"),b = Symbol("original_row_index"),w = Symbol("destroyed");class W extends Array {constructor(e) {var _e$sortColumn, _e$onComparatorRequir, _e$customSortingProvi;super(), _defineProperty(this, "sortColumn", void 0), _defineProperty(this, "onComparatorRequired", null), _defineProperty(this, "customSortingProvider", null), e = e || {}, this.sortColumn = (_e$sortColumn = e.sortColumn) !== null && _e$sortColumn !== void 0 ? _e$sortColumn : [], this.onComparatorRequired = (_e$onComparatorRequir = e.onComparatorRequired) !== null && _e$onComparatorRequir !== void 0 ? _e$onComparatorRequir : null, this.customSortingProvider = (_e$customSortingProvi = e.customSortingProvider) !== null && _e$customSortingProvi !== void 0 ? _e$customSortingProvi : null;}add(e, t) {if (Array.isArray(e)) {const l = e;if ("number" == typeof t) {const e = l.length,i = this.length;t = t < 0 ? Math.max(i + t, 0) : Math.min(t, i), this.length = i + e;for (let l = i - 1; l >= t; l--) this[l + e] = this[l];for (let i = 0; i < e; i++) this[t + i] = l[i];} else for (let e = 0, t = l.length; e < t; e++) this.push(l[e]);} else {const l = e;"number" == typeof t ? this.splice(t, 0, l) : this.push(l);}}reset(e) {this.length = 0, e && this.add(e);}filteredCollection(e, t) {if (e && t) {const l = new W({ sortColumn: this.sortColumn, onComparatorRequired: this.onComparatorRequired, customSortingProvider: this.customSortingProvider });for (let i = 0, o = this.length; i < o; i++) {const o = this[i];e(o, t) && (o[b] = i, l.push(o));}return l;}return null;}sort(e) {let t;if ("function" == typeof e) return super.sort(e);if (this.sortColumn.length) {const e = [];for (let t = 0; t < this.sortColumn.length; t++) {const l = y(this.sortColumn[t], this.sortColumn[t].descending);let i = null;this.onComparatorRequired && (i = this.onComparatorRequired(this.sortColumn[t].column, this.sortColumn[t].descending, l)), i || (i = l), e.push(i.bind(this));}if (1 === e.length) t = e[0];else {const l = e.length;t = (t, i) => {let o = 0;for (let r = 0; r < l; r++) if (o = e[r](t, i), 0 !== o) return o;return o;};}const l = (e) => (e.sort(t), e);if (this.customSortingProvider) {const e = this.customSortingProvider(this, l);if (e !== this) {this.length = e.length;for (let t = 0, l = e.length; t < l; t++) this[t] = e[t];}} else l(this);}return this;}}function y(e, t) {let l = e.comparePath;"string" == typeof l && (l = l.split("."));const i = l.length,o = i > 1,r = t ? 1 : -1,n = t ? -1 : 1;return function (e, t) {let s = e[l[0]],a = t[l[0]];if (o) for (let e = 1; e < i; e++) s = s && s[l[e]], a = a && a[l[e]];return s === a || null == s && null == a ? 0 : null == s ? r : null == a ? n : s < a ? r : n;};}class S extends Array {constructor() {super();}get(e) {for (let t = 0, l = this.length; t < l; t++) if (this[t].name === e) return this[t];return null;}indexOf(e) {const t = "string" == typeof e ? e : e.name;for (let e = 0, l = this.length; e < l; e++) if (this[e].name === t) return e;return -1;}getByOrder(e) {for (let t = 0, l = this.length; t < l; t++) if (this[t].order === e) return this[t];return null;}normalizeOrder() {const e = [];for (let t = 0; t < this.length; t++) e.push(this[t]);e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0);for (let t = 0; t < e.length; t++) e[t].order = t;return this;}getColumns() {const e = [];for (let t = 0; t < this.length; t++) e.push(this[t]);return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}getVisibleColumns() {const e = [];for (let t = 0; t < this.length; t++) {const l = this[t];l.visible && e.push(l);}return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}getMaxOrder() {let e = 0;for (let t = 0; t < this.length; t++) {const l = this[t];l.order > e && (e = l.order);}return e;}moveColumn(e, t) {if (e && t) {const l = e.order,i = t.order;if (l < i) for (let e = l + 1; e <= i; e++) {const t = this.getByOrder(e);t && t.order--;} else for (let e = l - 1; e >= i; e--) {const t = this.getByOrder(e);t && t.order++;}e.order = i;}return this;}}function R(e, t) {const l = t.column,i = null == t.keyword ? "" : t.keyword.toString();if (!i || !l) return true;let o = e[l];if (null == o) return false;let r = o.toString(),n = i;return t.caseSensitive || (r = r.toLowerCase(), n = n.toLowerCase()), -1 !== r.indexOf(n);}const _ = { NONE: "none", AUTO: "auto", SCROLL: "scroll" };class x {static saveSelection(e) {const t = window.getSelection();if (!t || 0 === t.rangeCount) return null;const l = t.getRangeAt(0);if (e !== l.commonAncestorContainer && !function (e, t) {let l = e;for (; (l = (_l$parentNode = (_l = l) === null || _l === void 0 ? void 0 : _l.parentNode) !== null && _l$parentNode !== void 0 ? _l$parentNode : null) && l !== t;) {var _l$parentNode, _l;}return !!l;}(l.commonAncestorContainer, e)) return null;const i = l.cloneRange();i.selectNodeContents(e), i.setEnd(l.startContainer, l.startOffset);const o = i.toString().length;return { start: o, end: o + l.toString().length };}static restoreSelection(e, t) {let l = 0;const i = [e];let o,r = false,n = false;const s = document.createRange();for (s.setStart(e, 0), s.collapse(true); !n && (o = i.pop());) if (o.nodeType === Node.TEXT_NODE) {const e = l + o.length;!r && t.start >= l && t.start <= e && (s.setStart(o, t.start - l), r = true), r && t.end >= l && t.end <= e && (s.setEnd(o, t.end - l), n = true), l = e;} else {let e = o.childNodes.length;for (; e--;) i.push(o.childNodes[e]);}const a = window.getSelection();a && (a.removeAllRanges(), a.addRange(s));}}const N = Array.prototype.indexOf,k = document.createElement.bind(document);function z(e) {const t = e._p;if (t.cellPreviewCell) {var _l$rowIndex;const l = t.cellPreviewCell,i = l[v];let o;try {o = x.saveSelection(l);} catch {}t.cellPreviewCell.remove(), i && t._unbindCellHoverOut(i), t._unbindCellHoverOut(l);try {o && i && x.restoreSelection(i, o);} catch {}e.emit("cellpreviewdestroy", { el: l.firstChild, name: l.columnName, rowIndex: (_l$rowIndex = l.rowIndex) !== null && _l$rowIndex !== void 0 ? _l$rowIndex : null, rowData: null == l.rowIndex ? null : t.rows[l.rowIndex], cell: i, cellEl: i === null || i === void 0 ? void 0 : i.firstChild }), i && delete i[g], delete l[v], t.cellPreviewCell = null, t.abortCellPreview = false;} else t.abortCellPreview = true;return e;}const M = document.createElement.bind(document);function T(e) {var _ref, _e$C, _t$changedTouches;const t = e;return (_ref = (_e$C = e[C]) !== null && _e$C !== void 0 ? _e$C : (_t$changedTouches = t.changedTouches) === null || _t$changedTouches === void 0 ? void 0 : _t$changedTouches[0]) !== null && _ref !== void 0 ? _ref : e;}function L(e) {var _t$lastResizeAreaClic;const t = e._p;if (null == t.columnResizeStartTimeout) return;clearTimeout(t.columnResizeStartTimeout), t.columnResizeStartTimeout = null;const n = (_t$lastResizeAreaClic = t.lastResizeAreaClick) === null || _t$lastResizeAreaClic === void 0 ? void 0 : _t$lastResizeAreaClic.columnName;t.lastResizeAreaClick = null, n && function (e, t) {const n = e._o,s = e._p,a = s.columns.get(t);if (!n.resizableColumns || !a || !a.resizable) return void A(e);const d = ve(e);s.resizer = M("div"), s.resizer.className = n.resizerClassName, setCssProps(s.resizer, { position: "absolute", display: "block", zIndex: "-1", visibility: "hidden", width: "2px", background: "#000", opacity: "0.7" }), e.el.appendChild(s.resizer);const u = a.element,h = s.resizer.parentNode,c = getComputedStyle(h),m = getComputedStyle(u),f = getElementOffset(u),p = getElementOffset(h);p.left += parseFloat(c.borderLeftWidth) || 0, p.top += parseFloat(c.borderTopWidth) || 0, f.left -= p.left, f.top -= p.top, f.top -= parseFloat(m.borderTopWidth) || 0;const g = getElementWidth(s.resizer, true, true, true);d ? (f.left -= Math.ceil((parseFloat(m.borderLeftWidth) || 0) / 2), f.left -= Math.ceil(g / 2)) : (f.left += getElementWidth(u, true, true, true), f.left += Math.ceil((parseFloat(m.borderRightWidth) || 0) / 2), f.left -= Math.ceil(g / 2)), setCssProps(s.resizer, { "z-index": "10", visibility: "visible", left: f.left + "px", top: f.top + "px", height: getElementHeight(e.el, false, false, false) + "px" }), s.resizer.columnName = u.columnName;try {s.resizer.style.zIndex = "";} catch {}}(e, n);}function F(e, t) {const l = e._o,i = ve(e);let n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!n) return null;n[v] && (n = n[v]);let s = n.previousSibling;for (; s && 1 !== s.nodeType;) s = s.previousSibling;const a = !s,d = T(t),u = (d.pageX || d.clientX || 0) - getElementOffset(n).left;if (i) {var _s$columnName, _s, _n$columnName;if (!a && getElementWidth(n, true, true, true) - u <= l.resizeAreaWidth / 2) return (_s$columnName = (_s = s) === null || _s === void 0 ? void 0 : _s.columnName) !== null && _s$columnName !== void 0 ? _s$columnName : null;if (u <= l.resizeAreaWidth / 2) return (_n$columnName = n.columnName) !== null && _n$columnName !== void 0 ? _n$columnName : null;} else {var _s$columnName2, _s2, _n$columnName2;if (!a && u <= l.resizeAreaWidth / 2) return (_s$columnName2 = (_s2 = s) === null || _s2 === void 0 ? void 0 : _s2.columnName) !== null && _s$columnName2 !== void 0 ? _s$columnName2 : null;if (getElementWidth(n, true, true, true) - u <= l.resizeAreaWidth / 2) return (_n$columnName2 = n.columnName) !== null && _n$columnName2 !== void 0 ? _n$columnName2 : null;}return null;}function A(e) {const t = e._p;return null != t.columnResizeStartTimeout && (clearTimeout(t.columnResizeStartTimeout), t.columnResizeStartTimeout = null), t.resizer && (t.resizer.remove(), t.resizer = null), t.eventsSink.remove(document, ".colresize"), e;}function P(e, t) {const l = t;if ("mousedown" === t.type && 0 !== l.button) return;const i = e._o,o = e._p,r = F(e, t);if (r) {const l = o.columns.get(r);return !!(i.resizableColumns && l && l.resizable) && (function (e, t, l) {const i = e._p,o = e._o,r = T(t),n = Date.now(),s = function (e) {return e.type.startsWith("touch") ? "touch" : "mouse";}(t),a = i.lastResizeAreaClick;if (i.lastResizeAreaClick = { columnName: l, time: n, pageX: r.pageX || r.clientX || 0, pageY: r.pageY || 0, pointerType: s }, !a || a.columnName !== l || a.pointerType !== s) return false;const d = n - a.time;return !(d < 0 || d > o.resizeAreaDoubleClickDuration) && Math.sqrt(Math.pow(i.lastResizeAreaClick.pageX - a.pageX, 2) + Math.pow(i.lastResizeAreaClick.pageY - a.pageY, 2)) <= Math.max(o.resizeAreaWidth, 12);}(e, t, l.name) ? (A(e), function (e, t, l, _o$lastResizeAreaDoub) {const i = e._o,o = e._p,r = o.columns.get(l);if (!i.resizableColumns || !r || !r.resizable) return false;const n = Date.now();return ((_o$lastResizeAreaDoub = o.lastResizeAreaDoubleClick) === null || _o$lastResizeAreaDoub === void 0 ? void 0 : _o$lastResizeAreaDoub.columnName) === r.name && n - o.lastResizeAreaDoubleClick.time < 100 ? (t.preventDefault(), true) : (o.lastResizeAreaClick = null, o.lastResizeAreaDoubleClick = { columnName: r.name, time: n }, e.emit("columnresizeareadoubleclick", { name: r.name, columnName: r.name, event: t }), i.autoFitColumnOnResizeDoubleClick && e.autoFitColumn(r.name), t.preventDefault(), true);}(e, t, l.name)) : (A(e), o.columnResizeStartTimeout = setTimeout(() => L(e), i.resizeAreaDoubleClickDuration), o.eventsSink.add(document, "mousemove.colresize", (t) => H(e, t)).add(document, "touchmove.colresize", (t) => H(e, t)).add(document, "mouseup.colresize", (t) => E(e, t)).add(document, "touchend.colresize", (t) => E(e, t)), t.preventDefault(), true));}}function H(e, t) {const l = e._p;if (null != l.columnResizeStartTimeout && !function (e, t) {const l = e._p.lastResizeAreaClick;if (!l) return false;const i = T(t),o = i.pageX || i.clientX || 0,r = i.pageY || 0;return Math.sqrt(Math.pow(o - l.pageX, 2) + Math.pow(r - l.pageY, 2)) > 4;}(e, t)) return;if (L(e), !l.resizer) return;const i = l.columns.get(l.resizer.columnName);if (!i) return;const n = ve(e),s = i.element,a = l.resizer.parentNode,d = getComputedStyle(a),u = getComputedStyle(s),h = getElementOffset(s),c = getElementOffset(a);c.left += parseFloat(d.borderLeftWidth) || 0, h.left -= c.left;const m = getElementWidth(l.resizer, true, true, true),f = "border-box" === u.boxSizing;let p = T(t).pageX - c.left,g = h.left;g -= Math.ceil(m / 2), n ? (g += getElementWidth(s, true, true, true), g -= i.ignoreMin ? 0 : e._o.minColumnWidth, f || (g -= Math.ceil((parseFloat(u.borderLeftWidth) || 0) / 2), g -= ce(s)), p > g && (p = g)) : (g += i.ignoreMin ? 0 : e._o.minColumnWidth, f || (g += Math.ceil((parseFloat(u.borderRightWidth) || 0) / 2), g += ce(s)), p < g && (p = g)), l.resizer.style.left = p + "px";}function E(e, t) {var _ref2, _t$C, _v$changedTouches;const l = e._o,i = e._p;if (null != i.columnResizeStartTimeout) return void A(e);if (!i.resizer) return;i.eventsSink.remove(document, ".colresize");const n = i.columns.get(i.resizer.columnName);if (!n) return i.resizer.remove(), void (i.resizer = null);const s = ve(e),a = n.element,d = a.firstChild,u = i.resizer.parentNode,h = getComputedStyle(u),c = getComputedStyle(a),m = getElementOffset(a),f = getElementOffset(u);f.left += parseFloat(h.borderLeftWidth) || 0, m.left -= f.left;const p = getElementWidth(i.resizer, true, true, true),g = "border-box" === c.boxSizing,v = t;let b = ((_ref2 = (_t$C = t[C]) !== null && _t$C !== void 0 ? _t$C : (_v$changedTouches = v.changedTouches) === null || _v$changedTouches === void 0 ? void 0 : _v$changedTouches[0]) !== null && _ref2 !== void 0 ? _ref2 : t).pageX - f.left,w = m.left,W = 0;if (s) {if (!g) {b += ce(a);const e = getComputedStyle(d || a);b += parseFloat(e.borderLeftWidth) || 0, b += parseFloat(e.borderRightWidth) || 0;}b += n.arrowProposedWidth || 0, w += Math.ceil(p / 2), w += getElementWidth(a, true, true, true);const t = w - (n.ignoreMin ? 0 : e._o.minColumnWidth);b > t && (b = t), W = w - b;} else {if (!g) {b -= ce(a);const e = getComputedStyle(d || a);b -= parseFloat(e.borderLeftWidth) || 0, b -= parseFloat(e.borderRightWidth) || 0;}b -= n.arrowProposedWidth || 0, w -= Math.ceil(p / 2);const t = w + (n.ignoreMin ? 0 : e._o.minColumnWidth);b < t && (b = t), W = b - w;}i.resizer.remove(), i.resizer = null;let y = W;if (2 === n.widthMode) {let t = pe(e),o = 0,r = 0;for (let e = 0; e < i.visibleColumns.length; e++) {var _l$actualWidth;const l = i.visibleColumns[e];l.name !== n.name && (2 === l.widthMode ? (o += l.width, r++) : t -= (_l$actualWidth = l.actualWidth) !== null && _l$actualWidth !== void 0 ? _l$actualWidth : 0);}if (t <= 0 && i.table && (t = i.table.clientWidth), t > Math.max(l.minColumnWidth, 1)) {if (y = W / t, r > 0) {const e = y / ((1 - y) / o);o += y, (o < 1 && l.relativeWidthGrowsToFillWidth || o > 1 && l.relativeWidthShrinksToFillWidth) && (y = e);}y *= 100, y += "%";}}e.setColumnWidth(n.name, y);}function O(e, t) {var _i$columns$get;const l = e._o,i = e._p;if (!l.resizableColumns) return;const o = F(e, t),r = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);r && (o && (_i$columns$get = i.columns.get(o)) !== null && _i$columns$get !== void 0 && _i$columns$get.resizable ? r.style.cursor = "e-resize" : r.style.cursor = "");}function I(e, t) {var _ref3, _t$C2, _n$changedTouches;const i = e._o,n = t,s = t,a = (_ref3 = (_t$C2 = t[C]) !== null && _t$C2 !== void 0 ? _t$C2 : (_n$changedTouches = n.changedTouches) === null || _n$changedTouches === void 0 ? void 0 : _n$changedTouches[0]) !== null && _ref3 !== void 0 ? _ref3 : { pageX: s.pageX, pageY: s.pageY },d = t.target.closest(`div.${i.tableClassName}-header-cell,div.${i.cellPreviewClassName}`);if (!d) return;const u = getElementOffset(d);u.width = getElementWidth(d, true, true, true), u.height = getElementHeight(d, true, true, true), e.emit("headercontextmenu", { columnName: d.columnName, pageX: a.pageX, pageY: a.pageY, bounds: u });}function D(e, t) {if (he(t)) return;if (F(e, t)) return;const l = e._o,i = e._p,o = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!o) return;if (!l.sortableColumns) return;const r = i.columns.get(o.columnName),n = i.rows.sortColumn;if (r && r.sortable) {let t = true;const i = n.length ? n[n.length - 1] : null;i && i.column === r.name && (i.descending && l.allowCancelSort ? (t = false, n.splice(n.length - 1, 1)) : i.descending = !i.descending);const o = e;t ? o.sort(r.name, void 0, true).render() : o.setSortedColumns(n.map((e) => ({ column: e.column, descending: e.descending })));}}function B(e, t) {const l = e._p,i = l.visibleColumns.findIndex((e) => e.movable),o = l.visibleColumns.findLastIndex((e) => e.movable),r = l.visibleColumns.findIndex((e) => e === t);return t.movable || -1 !== i && r >= i && r <= o;}const $ = Array.prototype.indexOf,q = document.createElement.bind(document);function X(e, t) {const l = t[p];l && (t.removeEventListener("click", l), t[p] = null, function (e, t) {const l = e._p;for (let e = 0, i = t.childNodes, o = i.length; e < o; e++) l._unbindCellHoverIn(i[e]);}(e, t), e.emit("rowdestroy", t));}function V(e) {const t = e._p.tbody;if (t) for (let l = t.firstElementChild; l; l = l.nextElementSibling) X(e, l);}function j(e) {const t = e._p,i = e._o;if (!t.table || !t.header) return e;if (!i.height) return t.table.style.height = "auto", e;const o = getComputedStyle(t.table);let r = i.height - getElementHeight(t.header, true, true, true);return "border-box" !== o.boxSizing && (r -= parseFloat(o.borderTopWidth) || 0, r -= parseFloat(o.borderBottomWidth) || 0, r -= parseFloat(o.paddingTop) || 0, r -= parseFloat(o.paddingBottom) || 0), t.table.style.height = Math.max(r, 0) + "px", e;}function Y(e) {const t = e._p;return t.headerRow && (t.headerRow = void 0), e;}function U(e) {const t = e._o,l = e._p;if (!l.tbody) return e;if (t.virtualTable && l.virtualListHelper) {const e = l.virtualListHelper.estimateFullHeight();l._lastVirtualScrollHeight = e, l.tbody.style.height = e + "px";} else l.tbody.style.height = "";return e;}function G(e, t) {const l = e._p;if (!l.table) return e;const i = l.table.offsetWidth - l.table.clientWidth;if (i !== l.scrollbarWidth || t) {var _l$notifyRendererOfCo;l.scrollbarWidth = i;for (let e = 0; e < l.columns.length; e++) l.columns[e].actualWidthConsideringScrollbarWidth = null;if (l.visibleColumns.length > 0 && l.tbody && l.headerRow) {var _t$actualWidth, _ref4, _t$actualWidthConside;const e = l.visibleColumns.length - 1,t = l.visibleColumns[e];t.actualWidthConsideringScrollbarWidth = l.scrollbarWidth > 0 ? ((_t$actualWidth = t.actualWidth) !== null && _t$actualWidth !== void 0 ? _t$actualWidth : 0) - l.scrollbarWidth : null;const i = ((_ref4 = (_t$actualWidthConside = t.actualWidthConsideringScrollbarWidth) !== null && _t$actualWidthConside !== void 0 ? _t$actualWidthConside : t.actualWidth) !== null && _ref4 !== void 0 ? _ref4 : 0) + "px",o = l.tbody.childNodes;for (let t = 0, l = o.length; t < l; t++) {const l = o[t];1 === l.nodeType && (l.childNodes[e].style.width = i);}l.headerRow.childNodes[e].style.width = i;}K(e), (_l$notifyRendererOfCo = l.notifyRendererOfColumnsConfig) === null || _l$notifyRendererOfCo === void 0 ? void 0 : _l$notifyRendererOfCo.call(l);}return e;}function J(e, t) {const l = e._o,i = e._p;if (!i.tbody || !i.table || !i.headerRow) return e;const o = ge(e);if (i.tbody.style.minWidth = o + "px", i.headerRow.style.minWidth = o + (i.scrollbarWidth || 0) + "px", i.eventsSink.remove(i.table, "scroll"), l.width === _.AUTO) setElementWidth(i.table, getElementWidth(i.tbody, true, true, true)), setElementWidth(e.el, getElementWidth(i.table, true, true, true));else if (l.width === _.SCROLL) {if (t) {const t = i.table ? i.table.scrollTop : 0,l = i.table ? i.table.scrollLeft : 0;!function (e) {const t = e.style.display;e.style.display = "none", e.offsetHeight, e.style.display = t;}(e.el), i.table.scrollTop = t, i.table.scrollLeft = l, i.header && (i.header.scrollLeft = l);}const l = () => function (e) {const t = e._p;t.header.scrollLeft = t.table.scrollLeft, Q(e);}(e);i.eventsSink.add(i.table, "scroll", l);}return e;}function K(e) {var _t$scrollbarWidth;const t = e._p,l = e._o;if (!t.headerRow) return;const i = l.tableClassName + "-sticky",o = t.headerRow,r = ve(e);t.lastIsRtl = r;const n = (_t$scrollbarWidth = t.scrollbarWidth) !== null && _t$scrollbarWidth !== void 0 ? _t$scrollbarWidth : 0,s = t.lastDetectedWidth,a = l.maxStickyColumnRelativeWidth,d = "number" == typeof a && s ? s * a : null;let u = 0,h = 0,c = null;const m = [],f = [];let p = null,g = [],v = null,C = 0,b = [];for (let e = o.firstElementChild; e; e = e.nextElementSibling) {var _o$actualWidth, _p;const l = e.getAttribute("data-column");if (!l) continue;const o = t.columns.get(l);if (!o) continue;o.headerScrollbarCompensation = 0;let s = "start" === o.sticky || "end" === o.sticky;if (s && null !== d && C + ((_o$actualWidth = o.actualWidth) !== null && _o$actualWidth !== void 0 ? _o$actualWidth : 0) > d && (s = false), s) {var _o$actualWidth2, _o$actualWidth3, _o$stickyPos, _o$stickyPos2, _o$stickyPos3;let l = (_o$actualWidth2 = o.actualWidth) !== null && _o$actualWidth2 !== void 0 ? _o$actualWidth2 : 0;C += 0, e.className += " " + i, e.style.position = "sticky";let s,a = null;null === c && (a = getComputedStyle(e), c = a.boxSizing), "content-box" === c && (null === a && (a = getComputedStyle(e)), l += (parseFloat(a.paddingLeft) || 0) + (parseFloat(a.paddingRight) || 0) + (parseFloat(a.borderLeftWidth) || 0) + (parseFloat(a.borderRightWidth) || 0)), "start" === o.sticky ? (s = { direction: "start", absDirection: r ? "right" : "left", offset: u }, e.style[s.absDirection] = u + "px", u += l, g.length = 0, p = [e], m.push(p)) : (v = e, s = { direction: "end", absDirection: r ? "left" : "right", offset: h }, e.style[s.absDirection] = h + n + "px", e.style.width = ((_o$actualWidth3 = o.actualWidth) !== null && _o$actualWidth3 !== void 0 ? _o$actualWidth3 : 0) + "px", h += l, f.push([e, ...g]), g.length = 0), s.direction === ((_o$stickyPos = o.stickyPos) === null || _o$stickyPos === void 0 ? void 0 : _o$stickyPos.direction) && s.offset === ((_o$stickyPos2 = o.stickyPos) === null || _o$stickyPos2 === void 0 ? void 0 : _o$stickyPos2.offset) && s.absDirection === ((_o$stickyPos3 = o.stickyPos) === null || _o$stickyPos3 === void 0 ? void 0 : _o$stickyPos3.absDirection) || b.push(t.visibleColumns.indexOf(o)), o.stickyPos = s;} else o.stickyPos && b.push(t.visibleColumns.indexOf(o)), delete o.stickyPos, (_p = p) !== null && _p !== void 0 && _p.push(e), g !== null && g !== void 0 && g.push(e), "sticky" === e.style.position && (e.classList.remove(i), e.style.position = "", e.style.left = "", e.style.right = "");}v && (v.style[r ? "left" : "right"] = "0px"), t.stickiesStart = m, t.stickiesEnd = f, b.length > 0 && e.refreshAllVirtualRows(), t.lastStickyScrollLeft = void 0, Q(e);}function Q(e) {const t = e._p;if (!t.table || !t.headerRow || !t.tbody) return;const l = t.stickiesStart,i = t.stickiesEnd,o = t.stickiesSetStart,r = t.stickiesSetEnd,n = t.stickiesSetStart = new Set(),s = t.stickiesSetEnd = new Set();if (l !== null && l !== void 0 && l.length || i !== null && i !== void 0 && i.length) {const e = t.table.scrollLeft;if (e === t.lastStickyScrollLeft) return;t.lastStickyScrollLeft = e;const o = t.headerRow.children,r = 1.5,a = t.lastIsRtl;let d = null;const u = (e, l, i) => {if (e && e.length) {for (const t of e) {l || (d = t);const e = t[0],n = t.slice(1),s = n[0],u = n[n.length - 1];if (!e || !e.getBoundingClientRect) continue;const h = e.getBoundingClientRect(),c = l !== a;let m = false;if (s && u) {const e = s.getBoundingClientRect(),t = u.getBoundingClientRect();m = l ? a ? h.right - r > t.left && h.left + r < e.right : h.right - r > e.left && h.left + r < t.right : a ? h.left + r < e.right && h.right - r > t.left : h.left + r < t.right && h.right - r > e.left;}e.classList.toggle(c ? "is-sticky-left" : "is-sticky-right", m), m && i.add($.call(o, e));}if (d) {var _ref5, _l$actualWidthConside, _ref6, _l$actualWidthConside2;const e = d[0],l = t.columns.get(e.getAttribute("data-column")),i = a ? "marginRight" : "marginLeft";e.style[i] = "", e.style.width = ((_ref5 = (_l$actualWidthConside = l.actualWidthConsideringScrollbarWidth) !== null && _l$actualWidthConside !== void 0 ? _l$actualWidthConside : l.actualWidth) !== null && _ref5 !== void 0 ? _ref5 : 0) + "px";let o = 0;if (t.scrollbarWidth > 0) {const l = e.getBoundingClientRect(),r = e.offsetParent.getBoundingClientRect(),n = a ? l.left - r.left : r.right - l.right;n <= t.scrollbarWidth && (o = Math.min(t.scrollbarWidth, Math.max(0, t.scrollbarWidth - n + 1)), o < t.scrollbarWidth && (e.style[i] = -o + "px"));}l.headerScrollbarCompensation = o, e.style.width = ((_ref6 = (_l$actualWidthConside2 = l.actualWidthConsideringScrollbarWidth) !== null && _l$actualWidthConside2 !== void 0 ? _l$actualWidthConside2 : l.actualWidth) !== null && _ref6 !== void 0 ? _ref6 : 0) + o + "px";}}};u(l, true, n), u(i, false, s);}const a = [],d = [];for (const e of n) (o === null || o === void 0 ? void 0 : o.has(e)) || a.push({ index: e, start: true });for (const e of s) (r === null || r === void 0 ? void 0 : r.has(e)) || a.push({ index: e, start: false });if (o) for (const e of o) n.has(e) || d.push({ index: e, start: true });if (r) for (const e of r) s.has(e) || d.push({ index: e, start: false });if (!a.length && !d.length) return;let u = t.tbody.firstElementChild;for (; u;) {const e = u.children;for (const l of d) {var _e$l$index;(_e$l$index = e[l.index]) === null || _e$l$index === void 0 || _e$l$index.classList.remove(l.start !== t.lastIsRtl ? "is-sticky-left" : "is-sticky-right");}for (const l of a) {var _e$l$index2;(_e$l$index2 = e[l.index]) === null || _e$l$index2 === void 0 || _e$l$index2.classList.add(l.start !== t.lastIsRtl ? "is-sticky-left" : "is-sticky-right");}u = u.nextElementSibling;}t.isStickyColumns = new Map();for (const e of n) t.isStickyColumns.set(e, "start");for (const e of s) t.isStickyColumns.set(e, "end");}function Z(e, t) {const l = e._p,i = e._o;if (!l.headerRow || !l.tbody) return e;const o = l.headerRow.querySelectorAll(`div.${i.tableClassName}-header-cell`)[t];if (!o) return e;const r = l.columns.get(o.columnName);if (r) {var _r$headerScrollbarCom, _ref7, _r$actualWidthConside;const e = (_r$headerScrollbarCom = r.headerScrollbarCompensation) !== null && _r$headerScrollbarCom !== void 0 ? _r$headerScrollbarCom : 0;o.style.width = ((_ref7 = (_r$actualWidthConside = r.actualWidthConsideringScrollbarWidth) !== null && _r$actualWidthConside !== void 0 ? _r$actualWidthConside : r.actualWidth) !== null && _ref7 !== void 0 ? _ref7 : 0) + e + "px";const i = (r.actualWidthConsideringScrollbarWidth || r.actualWidth || 0) + "px",n = l.tbody.childNodes;for (let e = 0, l = n.length; e < l; e++) {const l = n[e];1 === l.nodeType && (l.childNodes[t].style.width = i);}}return e;}function ee(e) {const t = e._p,l = e._o;if (t.table && t.headerRow) {const e = l.tableClassName,i = scopedSelectorAll(t.headerRow, `>div.${e}-header-cell.sorted`),o = Array.prototype.slice.call(i, 0).map((e) => e.querySelector(":scope>div>.sort-arrow")).filter((e) => !!e);for (const e of o) {var _e$parentNode;const l = (_e$parentNode = e.parentNode) === null || _e$parentNode === void 0 ? void 0 : _e$parentNode.parentNode;if (l) {const e = t.columns.get(l.columnName);e && (e.arrowProposedWidth = 0);}e.remove();}for (const e of i) e.classList.remove("sorted", "desc");}return e;}function te(e, t, l) {var _r$element$firstChild;const i = e._p,o = e._o,r = i.columns.get(t);if (!r) return false;const n = q("span");return n.className = "sort-arrow", r.element && (r.element.className += l ? " sorted desc" : " sorted", (_r$element$firstChild = r.element.firstChild) !== null && _r$element$firstChild !== void 0 && _r$element$firstChild.insertBefore(n, r.element.firstChild.firstChild)), 2 !== r.widthMode && o.adjustColumnWidthForSortArrow && (r.arrowProposedWidth = n.scrollWidth + (parseFloat(getComputedStyle(n).marginRight) || 0) + (parseFloat(getComputedStyle(n).marginLeft) || 0)), true;}function le(e, t) {t.firstChild, t.addEventListener("mousedown", (t) => P(e, t)), t.addEventListener("mousemove", (t) => O(e, t)), t.addEventListener("mouseup", (t) => function (e, t) {2 === t.button && I(e, t);}(e, t)), t.addEventListener("mouseleave", (t) => function (e, t) {const l = e._o,i = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);i && (i.style.cursor = "");}(e, t)), t.addEventListener("touchstart", (t) => function (e, t) {const l = e._p;if (l.currentTouchId) return;const i = t.changedTouches[0];l.currentTouchId = i.identifier;const o = t.currentTarget,r = { x: i.pageX, y: i.pageY };let n = r;const s = function () {l.currentTouchId = null, l.eventsSink.remove(o, ".colheader"), clearTimeout(l.tapAndHoldTimeout), l.tapAndHoldTimeout = null;};t[C] = t.changedTouches[0], true !== P(e, t) ? (l.tapAndHoldTimeout = setTimeout(() => {s(), l.eventsSink.add(o, "touchend.colheader", (e) => {he(e) || e.preventDefault(), l.eventsSink.remove(o, ".colheader");}, { once: true }).add(o, "touchcancel.colheader", (e) => {l.eventsSink.remove(o, ".colheader");}, { once: true }), Math.sqrt(Math.pow(Math.abs(n.x - r.x), 2) + Math.pow(Math.abs(n.y - r.y), 2)) < 9 && (A(e), I(e, t));}, 500), l.eventsSink.add(o, "touchend.colheader", (t) => {const i = t,o = u(Array.from(i.changedTouches), (e) => e.identifier === l.currentTouchId);o && (s(), he(t) || t.preventDefault(), n = { x: o.pageX, y: o.pageY }, (Math.sqrt(Math.pow(Math.abs(n.x - r.x), 2) + Math.pow(Math.abs(n.y - r.y), 2)) < 9 || l.resizer) && (i[C] = o, D(e, i)));}).add(o, "touchcancel.colheader", s).add(o, "touchmove.colheader", (t) => {const i = t,o = u(Array.from(i.changedTouches), (e) => e.identifier === l.currentTouchId);o && (n = { x: o.pageX, y: o.pageY }, l.resizer && (t.preventDefault(), i[C] = o, O(e, i)));})) : l.currentTouchId = null;}(e, t)), t.addEventListener("dragstart", (t) => function (e, t) {const l = e._o,i = e._p;if (l.movableColumns) {var _t$dataTransfer;const e = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!e) return void t.preventDefault();const o = i.columns.get(e.columnName);o && o.movable ? (e.style.opacity = "0.35", i.dragId = 161061273 * Math.random(), (_t$dataTransfer = t.dataTransfer) === null || _t$dataTransfer === void 0 ? void 0 : _t$dataTransfer.setData("text", JSON.stringify({ dragId: i.dragId, column: o.name }))) : t.preventDefault();} else t.preventDefault();}(e, t)), t.addEventListener("click", (t) => D(e, t)), t.addEventListener("contextmenu", (e) => e.preventDefault()), t.addEventListener("dragenter", (t) => function (e, t) {const l = e._o,i = e._p;if (l.movableColumns) {var _t$dataTransfer2;let o = null;const r = (_t$dataTransfer2 = t.dataTransfer) === null || _t$dataTransfer2 === void 0 ? void 0 : _t$dataTransfer2.getData("text");if (r) try {o = JSON.parse(r);} catch {o = null;}const n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!n) return;if (!o || i.dragId === o.dragId && n.columnName !== o.column) {const t = i.columns.get(n.columnName);t && B(e, t) && n.classList.add("drag-over");}}}(e, t)), t.addEventListener("dragover", (e) => {e.preventDefault();}), t.addEventListener("dragleave", (t) => function (e, t) {const l = e._o,i = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!i) return;const o = t.relatedTarget;o === i || i.contains(o) || i.classList.remove("drag-over");}(e, t)), t.addEventListener("drop", (t) => function (e, t, _t$dataTransfer3) {t.preventDefault();const l = e._o,i = e._p,o = (_t$dataTransfer3 = t.dataTransfer) === null || _t$dataTransfer3 === void 0 ? void 0 : _t$dataTransfer3.getData("text");if (!o) return;let r;try {r = JSON.parse(o);} catch {return;}const n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (n) {if (l.movableColumns && r.dragId === i.dragId) {const t = r.column,l = n.columnName,o = i.columns.get(t),s = i.columns.get(l);o && s && o.movable && B(e, s) && e.moveColumn(t, l);}n.classList.remove("drag-over");}}(e, t));}function ie(e, t) {let l = 0;if ("string" == typeof e) {const t = e.trim().toLowerCase();if ("rest" === t) return { width: 0, mode: 3 };if ("auto" === t) return { width: 0, mode: 0 };}let i = parseFloat(e);return Number.isFinite(i) || (i = 0), i = Math.max(0, i), i > 0 && ("string" == typeof e && e.trim().endsWith("%") ? (l = 2, i /= 100) : i > 0 && i < 1 ? l = 2 : (i < t && (i = t), l = 1)), { width: i, mode: l };}function oe(e, t) {var _t$allowPreview;let l = ie(t.width, t.ignoreMin ? 0 : e.minColumnWidth),i = { name: t.name, label: void 0 === t.label ? t.name : t.label, width: l.width, widthMode: l.mode, resizable: void 0 === t.resizable || t.resizable, sortable: void 0 === t.sortable || t.sortable, movable: void 0 === t.movable || t.movable, visible: void 0 === t.visible || t.visible, cellClasses: void 0 === t.cellClasses ? e.cellClasses : t.cellClasses, ignoreMin: void 0 !== t.ignoreMin && !!t.ignoreMin, sticky: void 0 === t.sticky ? null : t.sticky || null, allowPreview: !!((_t$allowPreview = t.allowPreview) !== null && _t$allowPreview !== void 0 ? _t$allowPreview : true), dataPath: [], comparePath: [], order: 0 };const o = void 0 === t.dataPath ? i.name : t.dataPath,r = void 0 === t.comparePath ? o : t.comparePath;return i.dataPath = "string" == typeof o ? o.split(".") : o, i.comparePath = "string" == typeof r ? r.split(".") : r, i;}function re(e) {const t = e._p;0 === t.visibleColumns.length && t.columns.length && (t.columns[0].visible = true, t.visibleColumns.push(t.columns[0]), e.emit("showcolumn", t.columns[0].name));}function ne(e) {const t = e._p;if (t.filteredRows && t.filterArgs) {let l = e._o.filter || R;t.filteredRows = t.rows.filteredCollection(l, t.filterArgs);}}function se(e) {const t = e._p;if (!t.filteredRows) return;const l = new Set(t.filteredRows),i = new W({ sortColumn: t.rows.sortColumn, onComparatorRequired: t.rows.onComparatorRequired, customSortingProvider: t.rows.customSortingProvider });for (let e = 0, o = t.rows.length; e < o; e++) {const o = t.rows[e];l.has(o) && (o[b] = e, i.push(o));}t.filteredRows = i;}function ae(e, t, l) {let i = l.dataPath,o = t[i[0]];for (let e = 1; e < i.length && null != o; e++) o = o && o[i[e]];const r = e.cellFormatter;let n;if (r[c]) n = r(o, l.name, t);else try {n = r(o, l.name, t);} catch (e) {n = "[ERROR]", console.error("Failed to generate content for cell " + l.name, e);}return null == n && (n = ""), n;}const de = document.createElement.bind(document);function ue(e) {["relative", "absolute", "fixed"].includes(getComputedStyle(e).position) || (e.style.position = "relative");}function he(e) {const t = e.target;return /^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(t.tagName);}function ce(e) {const t = getComputedStyle(e);return (parseFloat(t.paddingLeft) || 0) + (parseFloat(t.paddingRight) || 0);}function me(e) {const t = e.style;t["-webkit-touch-callout"] = "none", t["-webkit-user-select"] = "none", t["-moz-user-select"] = "none", t["-ms-user-select"] = "none", t["-o-user-select"] = "none", t["user-select"] = "none";}function fe(e, t, l = null) {const o = e._o,n = o.tableClassName,s = de("div");s.className = e.el.className, setCssProps(s, { position: "absolute", top: "-9999px", left: "0", visibility: "hidden", width: "auto", overflow: "visible" });const a = de("div");a.className = `${n}-header`;const d = de("div");d.className = `${n}-header-row`;const u = de("div");u.className = `${n}-header-cell ${t.cellClasses || ""}`, u.style.width = "auto";const h = u.cloneNode(true),c = u.cloneNode(true);u.appendChild(de("div")).innerHTML = o.headerCellFormatter(t.label, t.name), d.appendChild(h), d.appendChild(u), d.appendChild(c), a.appendChild(d), s.appendChild(a), document.body.appendChild(s);let m = getElementWidth(u, true, true, true) + o.columnAutoWidthExtraSize;if (l) {const e = de("div");e.className = `${n}-body`;const i = de("div");i.className = `${n}-row`;const a = de("div");a.className = `${n}-cell ${t.cellClasses || ""}`, a.style.width = "auto";const d = a.appendChild(de("div"));i.appendChild(a), e.appendChild(i), s.appendChild(e);for (let e = 0; e < l.length; e++) d.innerHTML = ae(o, l[e], t), m = Math.max(m, getElementWidth(a, true, true, true));}return s.remove(), m += t.arrowProposedWidth || 0, !t.ignoreMin && m < o.minColumnWidth && (m = o.minColumnWidth), Math.ceil(m);}function pe(e) {const t = e._o,l = e._p;let o,n = 0,s = 0;l.table && (n = l.table ? l.table.scrollTop : 0, s = l.table ? l.table.scrollLeft : 0, t.virtualTable && (o = l.table.style.display, l.table.style.display = "none"));let a = getElementWidth(e.el);l.table && (t.virtualTable && void 0 !== o && (l.table.style.display = o), l.table.scrollTop = n, l.table.scrollLeft = s, l.header && (l.header.scrollLeft = s));const d = t.tableClassName,u = de("div");u.className = e.el.className, setCssProps(u, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px" });const h = de("div");h.className = `${d}-header`, u.appendChild(h);const c = de("div");c.index = null, c.vIndex = null, c.className = `${d}-header-row`, h.appendChild(c);for (let e = 0; e < l.visibleColumns.length; e++) {const t = l.visibleColumns[e],i = de("div");i.className = `${d}-header-cell ${t.cellClasses || ""}`, i.columnName = t.name, i.appendChild(de("div")), c.appendChild(i);}document.body.appendChild(u), a -= function (e) {const t = getComputedStyle(e);return (parseFloat(t.borderLeftWidth) || 0) + (parseFloat(t.borderRightWidth) || 0);}(c);const m = c.querySelectorAll(`div.${d}-header-cell`);for (const e of m) {const t = getComputedStyle(e);if ("border-box" !== t.boxSizing) {a -= (parseFloat(t.borderRightWidth) || 0) + (parseFloat(t.borderLeftWidth) || 0) + ce(e);const i = e.columnName,o = l.columns.get(i);o && (a -= o.arrowProposedWidth || 0);}}return u.remove(), Math.max(0, a);}function ge(e) {const t = e._p,l = e._o.tableClassName,o = l + "-row",n = l + "-cell",s = t.visibleColumns,a = s.length,d = de("div");d.className = o, d.style.float = "left";let u = 0;for (let e = 0; e < a; e++) {var _t$actualWidth2, _t$actualWidth3;const t = s[e],l = de("div");l.className = n, l.style.width = ((_t$actualWidth2 = t.actualWidth) !== null && _t$actualWidth2 !== void 0 ? _t$actualWidth2 : 0) + "px", t.cellClasses && (l.className += " " + t.cellClasses), l.appendChild(de("div")), d.appendChild(l), u += (_t$actualWidth3 = t.actualWidth) !== null && _t$actualWidth3 !== void 0 ? _t$actualWidth3 : 0;}const h = de("div");h.className = e.el.className, setCssProps(h, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px", float: "left", width: "1px", overflow: "hidden" });const c = de("div");c.className = l, h.appendChild(c);const m = de("div");m.className = l + "-body", m.style.width = u + 1e4 + "px", c.appendChild(m), m.appendChild(d), document.body.appendChild(h);const f = de("div");setCssProps(f, { border: "1.5px solid #000", width: "0", height: "0", position: "absolute", left: "0", top: "-9999px" }), document.body.appendChild(f);const p = parseFloat(getComputedStyle(f).borderWidth),g = Math.round(p) !== p;f.remove();let v = getElementWidth(d, true, true, true);return v -= t.scrollbarWidth || 0, g && v++, h.remove(), v;}function ve(e) {const t = e._p;return !!t.table && "rtl" === getComputedStyle(t.table).direction;}function Ce(e) {var _e$unconvertedWidthMo;const t = null != e.unconvertedWidth ? e.unconvertedWidth : e.width,l = null != e.unconvertedWidth ? (_e$unconvertedWidthMo = e.unconvertedWidthMode) !== null && _e$unconvertedWidthMo !== void 0 ? _e$unconvertedWidthMo : e.widthMode : e.widthMode;return 0 === l ? "auto" : 2 === l ? parseFloat((100 * t).toPrecision(12)) + "%" : 3 === l ? "rest" : t;}const be = Object.prototype.hasOwnProperty,we = Symbol("once_original_handler");document.createElement.bind(document);class We {constructor(e) {var _e$rowsBufferSize, _e$minColumnWidth, _e$resizeAreaWidth, _e$resizeAreaDoubleCl, _e$maxColumnsSortCoun, _e$sortedColumns;_defineProperty(this, "VERSION", void 0);_defineProperty(this, "el", void 0);_defineProperty(this, "_o", void 0);_defineProperty(this, "_p", void 0);_defineProperty(this, w, void 0);e = e || {}, this.VERSION = We.VERSION;const t = this._o = {},n = this._p = { eventsSink: new DomEventsSink(), mitt: { all: s = s || new Map(), on: function (e, t) {var l = s.get(e);l ? l.push(t) : s.set(e, [t]);}, off: function (e, t) {var l = s.get(e);l && (t ? l.splice(l.indexOf(t) >>> 0, 1) : s.set(e, []));}, emit: function (e, t) {var l = s.get(e);l && l.slice().map(function (e) {e(t);}), (l = s.get("*")) && l.slice().map(function (l) {l(e, t);});} }, tableSkeletonNeedsRendering: true };var s;if (this.el = e.el && e.el instanceof HTMLElement ? e.el : document.createElement("div"), this.el !== e.el) {const t = (e.className || "dgtable-wrapper").split(/\s+/).filter(Boolean);this.el.classList.add(...t);}n.eventsSink.add(this.el, "dragend.colresize", (e) => {return t = e, void (this._p.resizer || (t.target.style.opacity = ""));var t;}), n.isWheelScrolling = false, n.eventsSink.add(this.el, "wheel", (e) => {if (n.cellPreviewCell) {let t = false,l = e.target;for (; l && l !== n.cellPreviewCell;) {const e = getComputedStyle(l),i = e.overflowY,o = e.overflowX,r = ("auto" === i || "scroll" === i) && l.scrollHeight > l.clientHeight,n = ("auto" === o || "scroll" === o) && l.scrollWidth > l.clientWidth;if (r || n) {t = true;break;}l = l.parentElement;}if (t) return;}n.isWheelScrolling = true, z(this), n.wheelScrollTimeout && clearTimeout(n.wheelScrollTimeout), n.wheelScrollTimeout = setTimeout(() => {n.isWheelScrolling = false, n.wheelScrollTimeout = void 0;}, 100);}, { passive: true }), t.virtualTable = void 0 === e.virtualTable || !!e.virtualTable, t.estimatedRowHeight = e.estimatedRowHeight || void 0, t.rowsBufferSize = Math.max((_e$rowsBufferSize = e.rowsBufferSize) !== null && _e$rowsBufferSize !== void 0 ? _e$rowsBufferSize : 3, 0), t.minColumnWidth = Math.max((_e$minColumnWidth = e.minColumnWidth) !== null && _e$minColumnWidth !== void 0 ? _e$minColumnWidth : 35, 0), t.maxStickyColumnRelativeWidth = e.maxStickyColumnRelativeWidth || null, t.columnAutoWidthExtraSize = e.columnAutoWidthExtraSize || 0, t.resizeAreaWidth = Math.max((_e$resizeAreaWidth = e.resizeAreaWidth) !== null && _e$resizeAreaWidth !== void 0 ? _e$resizeAreaWidth : 8, 0), t.resizeAreaDoubleClickDuration = Math.max((_e$resizeAreaDoubleCl = e.resizeAreaDoubleClickDuration) !== null && _e$resizeAreaDoubleCl !== void 0 ? _e$resizeAreaDoubleCl : 300, 0), t.autoFitColumnOnResizeDoubleClick = void 0 !== e.autoFitColumnOnResizeDoubleClick && !!e.autoFitColumnOnResizeDoubleClick, t.resizableColumns = void 0 === e.resizableColumns || !!e.resizableColumns, t.movableColumns = void 0 === e.movableColumns || !!e.movableColumns;const d = (_e$maxColumnsSortCoun = e.maxColumnsSortCount) !== null && _e$maxColumnsSortCoun !== void 0 ? _e$maxColumnsSortCoun : e.sortableColumns,u = Number(d !== null && d !== void 0 ? d : 1);t.sortableColumns = Number.isFinite(u) ? Math.max(u, 0) : 1, t.adjustColumnWidthForSortArrow = void 0 === e.adjustColumnWidthForSortArrow || !!e.adjustColumnWidthForSortArrow, t.convertColumnWidthsToRelative = void 0 !== e.convertColumnWidthsToRelative && !!e.convertColumnWidthsToRelative, t.autoFillTableWidth = void 0 !== e.autoFillTableWidth && !!e.autoFillTableWidth, t.autoFillLastColumn = void 0 === e.autoFillLastColumn || !!e.autoFillLastColumn, t.allowCancelSort = void 0 === e.allowCancelSort || !!e.allowCancelSort, t.cellClasses = void 0 === e.cellClasses ? "" : e.cellClasses, t.resizerClassName = void 0 === e.resizerClassName ? "dgtable-resize" : e.resizerClassName, t.tableClassName = void 0 === e.tableClassName ? "dgtable" : e.tableClassName, t.allowCellPreview = void 0 === e.allowCellPreview || e.allowCellPreview, t.allowHeaderCellPreview = void 0 === e.allowHeaderCellPreview || e.allowHeaderCellPreview, t.cellPreviewClassName = void 0 === e.cellPreviewClassName ? "dgtable-cell-preview" : e.cellPreviewClassName, t.cellPreviewAutoBackground = void 0 === e.cellPreviewAutoBackground || e.cellPreviewAutoBackground, t.onComparatorRequired = void 0 === e.onComparatorRequired ? null : e.onComparatorRequired, t.customSortingProvider = void 0 === e.customSortingProvider ? null : e.customSortingProvider, t.width = void 0 === e.width ? _.NONE : e.width, t.relativeWidthGrowsToFillWidth = void 0 === e.relativeWidthGrowsToFillWidth || !!e.relativeWidthGrowsToFillWidth, t.relativeWidthShrinksToFillWidth = void 0 !== e.relativeWidthShrinksToFillWidth && !!e.relativeWidthShrinksToFillWidth, this.setCellFormatter(e.cellFormatter), this.setHeaderCellFormatter(e.headerCellFormatter), this.setFilter(e.filter), t.height = e.height, this.setColumns(e.columns || [], false);let h = [];const c = (_e$sortedColumns = e.sortedColumns) !== null && _e$sortedColumns !== void 0 ? _e$sortedColumns : e.sortColumn;if (c) {let e = Array.isArray(c) ? c : [c];for (let t = 0, l = e.length; t < l; t++) {var _l$descending;let l = e[t];"string" == typeof l && (l = { column: l, descending: false });let i = n.columns.get(l.column);i && h.push({ column: l.column, comparePath: i.comparePath || i.dataPath, descending: (_l$descending = l.descending) !== null && _l$descending !== void 0 ? _l$descending : false });}}n.rows = new W({ sortColumn: h }), n.rows.onComparatorRequired = (e, l, i) => {if (t.onComparatorRequired) return t.onComparatorRequired(e, l, i);}, n.rows.customSortingProvider = (e, l) => t.customSortingProvider ? t.customSortingProvider(e, l) : l(e), n.filteredRows = null, n.scrollbarWidth = 0, n._lastVirtualScrollHeight = 0, function (e) {const t = e._p,n = (t) => {let n = t.currentTarget,s = t.relatedTarget;s === n || n.contains(s) || n[g] && (s === n[g] || n[g].contains(s)) || function (e, t, _s$visibleColumns$N$c, _P$right) {const n = e._o,s = e._p;if (s.isWheelScrolling) return;const a = t.firstElementChild;if (!a) return;if (!(a.scrollWidth - a.clientWidth > 1 || a.scrollHeight - a.clientHeight > 1)) return;z(e), s.abortCellPreview = false;const d = t.parentElement;if (!d) return;const u = (_s$visibleColumns$N$c = s.visibleColumns[N.call(d.childNodes, t)]) === null || _s$visibleColumns$N$c === void 0 ? void 0 : _s$visibleColumns$N$c.name,h = u ? s.columns.get(u) : null;if (!h) return;const c = d.index;if (e.emit("cellhoveroverflow", { name: u, rowIndex: c !== null && c !== void 0 ? c : null, rowData: null == c ? null : s.rows[c], cell: t, cellEl: a }), false === h.allowPreview) return;const m = t.classList.contains(`${n.tableClassName}-header-cell`);if (m ? !n.allowHeaderCellPreview : !n.allowCellPreview) return;const f = k("div");f.innerHTML = t.innerHTML, f.className = n.cellPreviewClassName + " " + (h.cellClasses || ""), m && (f.classList.add("header"), t.classList.contains("sortable") && f.classList.add("sortable"), f.draggable = true, le(e, f));const p = getComputedStyle(t),C = getComputedStyle(a),b = "right" === p.float,w = b ? "right" : "left",W = parseFloat(p.paddingLeft) || 0,y = parseFloat(p.paddingRight) || 0,S = parseFloat(p.paddingTop) || 0,R = parseFloat(p.paddingBottom) || 0;let _ = a.scrollWidth + (t.clientWidth - a.offsetWidth);const M = "border-box" === p.boxSizing;if (M ? f.style.boxSizing = "border-box" : (_ -= W + y, f.style.marginTop = (parseFloat(p.borderTopWidth) || 0) + "px"), !s.transparentBgColor1) {const e = document.createElement("div");document.body.appendChild(e), e.style.backgroundColor = "transparent", s.transparentBgColor1 = getComputedStyle(e).backgroundColor, e.style.backgroundColor = "rgba(0,0,0,0)", s.transparentBgColor2 = getComputedStyle(e).backgroundColor, e.remove();}const T = { "box-sizing": M ? "border-box" : "content-box", width: _ + "px", "min-height": Math.max(getElementHeight(t), /%/.test(p.minHeight) ? 0 : parseFloat(p.minHeight) || 0) + "px", "padding-left": W + "px", "padding-right": y + "px", "padding-top": S + "px", "padding-bottom": R + "px", overflow: "hidden", position: "absolute", "z-index": "-1", [w]: "0", top: "0", cursor: p.cursor };if (n.cellPreviewAutoBackground) {let e = p.backgroundColor;e !== s.transparentBgColor1 && e !== s.transparentBgColor2 || (e = getComputedStyle(d).backgroundColor), e !== s.transparentBgColor1 && e !== s.transparentBgColor2 || (e = "#fff"), T["background-color"] = e;}setCssProps(f, T), f.firstChild && setCssProps(f.firstChild, { direction: C.direction, "white-space": C.whiteSpace, "min-height": C.minHeight, "line-height": C.lineHeight, font: C.font }), e.el.appendChild(f), m && me(f), f.rowVIndex = d.vIndex, f.rowIndex = c, f.columnName = u;try {const e = x.saveSelection(t);e && x.restoreSelection(f, e);} catch {}if (e.emit("cellpreview", { el: f.firstElementChild, name: f.columnName, rowIndex: c !== null && c !== void 0 ? c : null, rowData: null == c ? null : s.rows[c], cell: t, cellEl: a }), s.abortCellPreview) return void f.remove();null != c && f.addEventListener("click", (t) => {e.emit("rowclick", { event: t, filteredRowIndex: d.vIndex, rowIndex: c, rowEl: d, rowData: s.rows[c] });});const L = e.el,F = L === window ? document : L,A = getComputedStyle(L),P = getElementOffset(t),H = getElementOffset(L);if (b) {const e = window.innerWidth;P.right = e - (P.left + getElementWidth(t, true, true, true)), H.right = e - (H.left + getElementWidth(L, true, true, true));}P.left -= parseFloat(A.borderLeftWidth) || 0, "right" === w && void 0 !== P.right && void 0 !== H.right && (P.right -= parseFloat(A.borderRightWidth) || 0), P.top -= parseFloat(A.borderTopWidth) || 0, "left" === w ? P.left += parseFloat(p.borderLeftWidth) || 0 : void 0 !== P.right && (P.right += parseFloat(p.borderRightWidth) || 0), P.top += parseFloat(p.borderTopWidth) || parseFloat(p.borderBottomWidth) || 0, P.left -= H.left, "right" === w && void 0 !== P.right && void 0 !== H.right && (P.right -= H.right), P.top -= H.top;const E = getElementWidth(L, false, false, false) - getElementWidth(f, true, true, true),O = "left" === w ? P.left : (_P$right = P.right) !== null && _P$right !== void 0 ? _P$right : 0,I = Math.max(0, Math.min(E, O));"left" === w ? P.left = I : P.right = I;const D = getElementHeight(t, true, true, true),B = ("scrollTop" in F ? F.scrollTop : 0) + getElementHeight(L, true) - D;P.top > B && (P.top = Math.max(0, B));const $ = { top: P.top + "px", "z-index": 9999 };$[w] = ("left" === w ? P.left : P.right) + "px", setCssProps(f, $), f[v] = t, s.cellPreviewCell = f, t[g] = f, s._bindCellHoverOut(t), s._bindCellHoverOut(f);}(e, n);},s = (t) => {let l = t.currentTarget[v] || t.currentTarget,i = t.relatedTarget;i === e.el || l.contains(i) || l[g] && (i === l[g] || l[g].contains(i)) || function (e) {z(e);}(e);};t._bindCellHoverIn = (e) => {e[m] || e.addEventListener("mouseover", e[m] = n);}, t._unbindCellHoverIn = (e) => {e[m] && (e.removeEventListener("mouseover", e[m]), e[m] = null);}, t._bindCellHoverOut = (e) => {e[f] || e.addEventListener("mouseout", e[f] = s);}, t._unbindCellHoverOut = (e) => {e[f] && (e.removeEventListener("mouseout", e[f]), e[f] = null);};}(this);}on(e, t) {return this[w] || this._p.mitt.on(e, t), this;}once(e, t) {if (this[w]) return this;const l = (i) => {this._p.mitt.off(e, l), t(i);};return l[we] = t, this._p.mitt.on(e, l), this;}off(e, t) {if (this[w]) return this;if (e || t) {if (this._p.mitt.off(e, t), t) {var _this$_p$mitt$all$get;const l = (_this$_p$mitt$all$get = this._p.mitt.all.get(e)) !== null && _this$_p$mitt$all$get !== void 0 ? _this$_p$mitt$all$get : [];for (const i of l.slice()) i[we] === t && this._p.mitt.off(e, i);}} else this._p.mitt.all.clear();return this;}emit(e, t) {return this[w] || this._p.mitt.emit(e, t), this;}destroy() {var _e$virtualListHelper, _e$table, _e$tbody;const e = this._p,t = this.el;if (this[w] || !e) return this;if (A(this), V(this), (_e$virtualListHelper = e.virtualListHelper) !== null && _e$virtualListHelper !== void 0 && _e$virtualListHelper.destroy(), e.virtualListHelper = null, Y(this), (_e$table = e.table) !== null && _e$table !== void 0 && _e$table.remove(), (_e$tbody = e.tbody) !== null && _e$tbody !== void 0 && _e$tbody.remove(), e.workerListeners) {for (let t = 0; t < e.workerListeners.length; t++) {let l = e.workerListeners[t];l.worker.removeEventListener("message", l.listener, false);}e.workerListeners.length = 0;}e.rows.length = e.columns.length = 0, e._deferredRender && clearTimeout(e._deferredRender), e.wheelScrollTimeout && clearTimeout(e.wheelScrollTimeout), e.tapAndHoldTimeout && clearTimeout(e.tapAndHoldTimeout), e.eventsSink.remove();for (let e in this) be.call(this, e) && (this[e] = null);return this[w] = true, t && t.remove(), this;}close() {this.destroy();}remove() {this.destroy();}render() {const o = this._o,r = this._p;if (!this.el.offsetParent) return r._deferredRender || (r._deferredRender = setTimeout(() => {r._deferredRender = null, !this[w] && this.el.offsetParent && this.render();})), this;if (true === r.tableSkeletonNeedsRendering) {var _r$filteredRows;r.tableSkeletonNeedsRendering = false, o.width === _.AUTO && ee(this);let n = r.table && r.table.parentNode ? r.table.scrollTop : NaN,s = r.table && r.table.parentNode ? getScrollHorz(r.table) : NaN;!function (e, _t$virtualListHelper) {const t = e._p,i = e._o;V(e), (_t$virtualListHelper = t.virtualListHelper) !== null && _t$virtualListHelper !== void 0 && _t$virtualListHelper.destroy(), t.virtualListHelper = null, t.table && i.virtualTable && (t.table.remove(), t.table = void 0, t.tbody = void 0), Y(e), t.currentTouchId = null, t.header && t.header.remove();const o = i.tableClassName,r = q("div"),n = q("div");r.className = `${o}-header`, n.className = `${o}-header-row`, t.header = r, t.headerRow = n, r.appendChild(n), e.el.prepend(r), ue(e.el), i.width === _.SCROLL ? e.el.style.overflow = "hidden" : e.el.style.overflow = "", !i.height && i.virtualTable && (i.height = getElementHeight(e.el, true));}(this), function (e) {const t = e._p,o = e._o,r = o.tableClassName;if (o.virtualTable && !t.virtualRowHeight) {const o = () => {const e = q("div"),t = e.appendChild(q("div")),l = t.appendChild(q("div"));return e.className = `${r}-row`, t.className = `${r}-cell`, l.innerHTML = "0", e.style.visibility = "hidden", e.style.position = "absolute", e;},n = q("div");n.className = e.el.className, setCssProps(n, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px", width: "1px", overflow: "hidden" });const s = q("div");s.className = r, n.appendChild(s);const a = q("div");a.className = `${r}-body`, a.style.width = "99999px", s.appendChild(a), document.body.appendChild(n);const d = o(),u = o(),h = o();a.appendChild(d), a.appendChild(u), a.appendChild(h), t.virtualRowHeight = getElementHeight(u, true, true, true), n.remove();}if (!t.table) {var _o$height;const n = document.createDocumentFragment(),s = q("div");s.className = r, o.virtualTable && (s.className += " virtual");const a = getComputedStyle(s);let d = ((_o$height = o.height) !== null && _o$height !== void 0 ? _o$height : 0) - getElementHeight(t.header, true, true, true);"border-box" !== a.boxSizing && (d -= parseFloat(a.borderTopWidth) || 0, d -= parseFloat(a.borderBottomWidth) || 0, d -= parseFloat(a.paddingTop) || 0, d -= parseFloat(a.paddingBottom) || 0), setCssProps(s, { height: o.height ? d + "px" : "auto", display: "block", overflowY: "auto", overflowX: o.width === _.SCROLL ? "auto" : "hidden" }), n.appendChild(s);const u = q("div");u.className = o.tableClassName + "-body", u.style.minHeight = "1px", t.table = s, t.tbody = u, ue(u), ue(s), s.appendChild(u), e.el.appendChild(n);}t.virtualListHelper || function (e, _t$filteredRows) {const t = e._p,l = e._o,i = l.tableClassName,o = i + "-row",r = i + "-row-alt",n = i + "-cell",s = i + "-sticky";let a = t.visibleColumns,u = a.length;t.notifyRendererOfColumnsConfig = () => {a = t.visibleColumns, u = a.length;for (let e = 0; e < u; e++) {const t = a[e];t._finalWidth = t.actualWidthConsideringScrollbarWidth || t.actualWidth;}}, t.virtualListHelper = new VirtualListHelper({ list: t.table, itemsParent: t.tbody, autoVirtualWrapperWidth: false, virtual: l.virtualTable, buffer: l.rowsBufferSize, estimatedItemHeight: l.estimatedRowHeight ? l.estimatedRowHeight : t.virtualRowHeight || 40, itemElementCreatorFn: () => q("div"), onItemRender: (i, d) => {const h = i,c = t.filteredRows || t.rows,m = !!t.filteredRows,f = t.isStickyColumns;h.className = o, d % 2 == 1 && (h.className += " " + r);const g = c[d],v = m ? g[b] : d;h.vIndex = d, h.index = v;for (let e = 0; e < u; e++) {var _i$_finalWidth;const i = a[e],o = q("div");if (o.columnName = i.name, o.setAttribute("data-column", i.name), o.className = n, o.style.width = ((_i$_finalWidth = i._finalWidth) !== null && _i$_finalWidth !== void 0 ? _i$_finalWidth : 0) + "px", i.cellClasses && (o.className += " " + i.cellClasses), i.stickyPos) {o.className += " " + s, o.style.position = "sticky", o.style[i.stickyPos.absDirection] = i.stickyPos.offset + "px";const l = f === null || f === void 0 ? void 0 : f.get(e);"start" === l && !t.lastIsRtl || "end" === l && t.lastIsRtl ? o.classList.add("is-sticky-left") : ("start" === l && t.lastIsRtl || "end" === l && !t.lastIsRtl) && o.classList.add("is-sticky-right");}t._bindCellHoverIn(o), o.appendChild(q("div")).innerHTML = ae(l, g, i), h.appendChild(o);}h.addEventListener("click", h[p] = (t) => {e.emit("rowclick", { event: t, filteredRowIndex: d, rowIndex: v, rowEl: h, rowData: g });}), e.emit("rowcreate", { filteredRowIndex: d, rowIndex: v, rowEl: h, rowData: g });}, onItemUnrender: (t) => X(e, t), onScrollHeightChange: (l) => {l > t._lastVirtualScrollHeight && !t.scrollbarWidth && G(e), t._lastVirtualScrollHeight = l;} }), t.virtualListHelper.setCount(((_t$filteredRows = t.filteredRows) !== null && _t$filteredRows !== void 0 ? _t$filteredRows : t.rows).length), t.notifyRendererOfColumnsConfig();}(e);}(this), this.tableWidthChanged(true, false), function (e) {const t = e._p,l = e._o,i = l.tableClassName + "-header-cell",o = t.headerRow;for (let r = 0; r < t.visibleColumns.length; r++) {const n = t.visibleColumns[r];if (n.visible) {var _n$actualWidth;const s = q("div");s.draggable = true, s.className = i, s.style.width = ((_n$actualWidth = n.actualWidth) !== null && _n$actualWidth !== void 0 ? _n$actualWidth : 0) + "px", l.sortableColumns && n.sortable && (s.className += " sortable"), s.columnName = n.name, s.setAttribute("data-column", n.name);const a = q("div");a.innerHTML = l.headerCellFormatter(n.label, n.name), s.appendChild(a), t._bindCellHoverIn(s), o.appendChild(s), t.visibleColumns[r].element = s, le(e, s), me(s);}}K(e), e.emit("headerrowcreate", o);}(this), r.virtualListHelper.setCount(((_r$filteredRows = r.filteredRows) !== null && _r$filteredRows !== void 0 ? _r$filteredRows : r.rows).length), U(this), G(this, true), J(this, true), j(this), G(this);for (let e = 0; e < r.rows.sortColumn.length; e++) te(this, r.rows.sortColumn[e].column, r.rows.sortColumn[e].descending);o.adjustColumnWidthForSortArrow && r.rows.sortColumn.length ? this.tableWidthChanged(true) : o.virtualTable || this.tableWidthChanged(), isNaN(n) || (r.table.scrollTop = n), isNaN(s) || (setScrollHorz(r.table, s), setScrollHorz(r.header, s)), K(this), this.emit("renderskeleton");}r.virtualListHelper.render();const n = r.scrollbarWidth;return G(this), r.scrollbarWidth !== n && J(this, false), this.emit("render"), this;}clearAndRender(e) {var _t$notifyRendererOfCo;let t = this._p;return t.tableSkeletonNeedsRendering = true, (_t$notifyRendererOfCo = t.notifyRendererOfColumnsConfig) !== null && _t$notifyRendererOfCo !== void 0 && _t$notifyRendererOfCo.call(t), (void 0 === e || e) && this.render(), this;}setColumns(e, t) {const l = this._p;e = e || [];let i = new S();for (let t = 0, l = 0; t < e.length; t++) {let o = e[t],r = oe(this._o, o);void 0 !== o.order ? (o.order > l && (l = o.order + 1), r.order = o.order) : r.order = l++, i.push(r);}return i.normalizeOrder(), l.columns = i, l.visibleColumns = i.getVisibleColumns(), re(this), this.clearAndRender(t), this;}addColumn(e, t, l) {const i = this._p;let o = i.columns;if (e && !o.get(e.name)) {let r = null;void 0 !== t && (r = "string" == typeof t ? o.get(t) : o.getByOrder(t));let n = oe(this._o, e);n.order = r ? r.order : o.getMaxOrder() + 1;for (let e = o.getMaxOrder(), t = n.order; e >= t; e--) {let t = o.getByOrder(e);t && t.order++;}o.push(n), o.normalizeOrder(), i.visibleColumns = o.getVisibleColumns(), re(this), this.clearAndRender(l), this.emit("addcolumn", n.name);}return this;}removeColumn(e, t) {const l = this._p;let i = l.columns,o = i.indexOf(e);return o > -1 && (i.splice(o, 1), i.normalizeOrder(), l.visibleColumns = i.getVisibleColumns(), re(this), this.clearAndRender(t), this.emit("removecolumn", e)), this;}setColumnLabel(e, t) {let l = this._p.columns.get(e);if (l && (l.label = void 0 === t ? l.name : t, l.element)) {const e = l.element.firstChild,t = e.querySelector(":scope > .sort-arrow");e.innerHTML = this._o.headerCellFormatter(l.label, l.name), t && e.insertBefore(t, e.firstChild);}return this;}moveColumn(e, t, l = true) {const i = this._o,o = this._p;let r,n,a = o.columns,d = l ? o.visibleColumns : a.getColumns();if ("string" == typeof e ? r = a.get(e) : "number" == typeof e && (r = d[e]), "string" == typeof t ? n = a.get(t) : "number" == typeof t && (n = d[t]), r && n && e !== t) {let e = r.order,t = n.order,l = a.moveColumn(r, n).getVisibleColumns();if (o.visibleColumns.length !== l.length || o.visibleColumns.some((e, t) => e !== l[t])) {const e = o.visibleColumns.indexOf(r),t = o.visibleColumns.indexOf(n);if (o.visibleColumns = l, re(this), !i.virtualTable && -1 !== e && -1 !== t && o.headerRow && o.tbody) {var _ref8, _ref9;const l = scopedSelectorAll(o.headerRow, `>div.${i.tableClassName}-header-cell`),r = e < t ? t + 1 : t;l[0].parentNode.insertBefore(l[e], l[r]);const n = o.visibleColumns[t],a = ((_ref8 = n.actualWidthConsideringScrollbarWidth || n.actualWidth) !== null && _ref8 !== void 0 ? _ref8 : 0) + "px",d = o.visibleColumns[e],u = ((_ref9 = d.actualWidthConsideringScrollbarWidth || d.actualWidth) !== null && _ref9 !== void 0 ? _ref9 : 0) + "px",h = o.tbody.childNodes;for (let l = 0, i = h.length; l < i; l++) {const i = h[l];1 === i.nodeType && (i.insertBefore(i.childNodes[e], i.childNodes[r]), i.childNodes[t].firstChild.style.width = a, i.childNodes[e].firstChild.style.width = u);}this.tableWidthChanged(true);} else this.clearAndRender();}this.emit("movecolumn", { name: r.name, src: e, dest: t });}return this;}setColumnVisible(e, t) {const l = this._p;let i = l.columns.get(e);return t = !!t, i && !!i.visible !== t && (i.visible = t, l.visibleColumns = l.columns.getVisibleColumns(), this.emit(t ? "showcolumn" : "hidecolumn", e), re(this), this.clearAndRender()), this;}isColumnVisible(e) {let t = this._p.columns.get(e);return !!t && t.visible;}setMinColumnWidth(e) {let t = this._o;return e = Math.max(e, 0), t.minColumnWidth !== e && (t.minColumnWidth = e, this.tableWidthChanged(true)), this;}getMinColumnWidth() {return this._o.minColumnWidth;}setColumnAutoWidthExtraSize(e) {let t = this._o;return e = Math.max(e, 0), t.columnAutoWidthExtraSize !== e && (t.columnAutoWidthExtraSize = e, this.tableWidthChanged(true)), this;}getColumnAutoWidthExtraSize() {return this._o.columnAutoWidthExtraSize;}setResizeAreaWidth(e) {let t = this._o;return e = Math.max(e, 0), t.resizeAreaWidth !== e && (t.resizeAreaWidth = e, this.tableWidthChanged(true)), this;}getResizeAreaWidth() {return this._o.resizeAreaWidth;}setResizeAreaDoubleClickDuration(e) {let t = this._o;return e = Math.max(e, 0), t.resizeAreaDoubleClickDuration !== e && (t.resizeAreaDoubleClickDuration = e, this.tableWidthChanged(true)), this;}getResizeAreaDoubleClickDuration() {return this._o.resizeAreaDoubleClickDuration;}setMaxStickyColumnRelativeWidth(e) {let t = this._o;return e = e || null, t.maxStickyColumnRelativeWidth !== e && (t.maxStickyColumnRelativeWidth = e, this.tableWidthChanged(true)), this;}getMaxStickyColumnRelativeWidth() {return this._o.maxStickyColumnRelativeWidth;}setColumnWidth(e, t) {let l = this._p.columns.get(e);if (l) {let e = ie(t, l.ignoreMin ? 0 : this._o.minColumnWidth),i = Ce(l);l.width = e.width, l.widthMode = e.mode, l.unconvertedWidth = null, l.unconvertedWidthMode = null;let o = Ce(l);i !== o && this.tableWidthChanged(true), this.emit("columnwidth", { name: l.name, width: o, oldWidth: i });}return this;}autoFitColumn(e) {const t = this._p,l = t.filteredRows || t.rows,i = t.columns.get(e);if (!i || l.length < 1) return this;const o = fe(this, i, l);return o > 0 && this.setColumnWidth(e, o), this;}getColumnWidth(e) {let t = this._p.columns.get(e);return t ? Ce(t) : null;}getColumnConfig(e) {let t = this._p.columns.get(e);if (t) {var _t$unconvertedWidthMo, _t$dataPath, _t$comparePath;const e = t.width,l = t.widthMode;null != t.unconvertedWidth && (t.width = t.unconvertedWidth, t.widthMode = (_t$unconvertedWidthMo = t.unconvertedWidthMode) !== null && _t$unconvertedWidthMo !== void 0 ? _t$unconvertedWidthMo : t.widthMode);const i = Ce(t);return null != t.unconvertedWidth && (t.width = e, t.widthMode = l), { name: t.name, label: t.label, width: i, dataPath: (_t$dataPath = t.dataPath) === null || _t$dataPath === void 0 ? void 0 : _t$dataPath.join("."), comparePath: (_t$comparePath = t.comparePath) === null || _t$comparePath === void 0 ? void 0 : _t$comparePath.join("."), resizable: t.resizable, movable: t.movable, sortable: t.sortable, visible: t.visible, cellClasses: t.cellClasses, ignoreMin: t.ignoreMin, sticky: t.sticky, order: t.order, allowPreview: t.allowPreview };}return null;}getColumnsConfig() {const e = this._p;let t = {};for (let l = 0; l < e.columns.length; l++) t[e.columns[l].name] = this.getColumnConfig(e.columns[l].name);return t;}setMaxColumnSortCount(e) {const t = this._p,l = this._o;if (l.sortableColumns !== e && (l.sortableColumns = e, t.table)) {const e = scopedSelectorAll(t.headerRow, `>div.${l.tableClassName}-header-cell`);for (let i = 0, o = e.length; i < o; i++) e[i].classList[l.sortableColumns > 0 && t.visibleColumns[i].sortable ? "add" : "remove"]("sortable");}return this;}getMaxColumnSortCount() {return this._o.sortableColumns;}setSortableColumns(e) {return this.setMaxColumnSortCount(e);}getSortableColumns() {return this.getMaxColumnSortCount();}setMovableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.movableColumns !== e && (t.movableColumns = e), this;}getMovableColumns() {return this._o.movableColumns;}setResizableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.resizableColumns !== e && (t.resizableColumns = e), this;}getResizableColumns() {return this._o.resizableColumns;}getConvertColumnWidthsToRelative() {return this._o.convertColumnWidthsToRelative;}setConvertColumnWidthsToRelative(e, t = true) {let l = this._o;return e = !!e, l.convertColumnWidthsToRelative !== e && (l.convertColumnWidthsToRelative = e, t && this.tableWidthChanged(true)), this;}setOnComparatorRequired(e) {let t = this._o;return t.onComparatorRequired !== e && (t.onComparatorRequired = e), this;}setCustomSortingProvider(e) {let t = this._o;return t.customSortingProvider !== e && (t.customSortingProvider = e), this;}sort(e, t, l) {const i = this._o,o = this._p;let r = o.columns.get(e),n = o.rows.sortColumn.map((e) => ({ column: e.column, descending: e.descending }));if (r) {if (l) {for (let e = 0; e < n.length; e++) if (n[e].column === r.name) {e < n.length - 1 ? n.length = 0 : (t = n[n.length - 1].descending, n.splice(n.length - 1, 1));break;}(i.sortableColumns > 0 && n.length >= i.sortableColumns || n.length >= o.visibleColumns.length) && (n.length = 0);} else n.length = 0;t = void 0 !== t && t, n.push({ column: r.name, descending: !!t });} else n.length = 0;return this.setSortedColumns(n);}resort() {const e = this._p;let t = e.columns,l = e.rows.sortColumn;if (l.length) {var _e$virtualListHelper2;for (let e = 0; e < l.length; e++) t.get(l[e].column) || l.splice(e--, 1);e.rows.sortColumn = l, l.length && (e.rows.sort(), se(this)), (_e$virtualListHelper2 = e.virtualListHelper) === null || _e$virtualListHelper2 === void 0 ? void 0 : _e$virtualListHelper2.invalidate();let i = [];for (let e = 0; e < l.length; e++) i.push({ column: l[e].column, descending: l[e].descending });this.emit("sort", { sorts: i, resort: true });}return this;}setSortedColumns(e, t = { immediate: true, render: true }) {var _i$virtualListHelper;const l = this._o,i = this._p;let o = i.columns,r = e.filter((e) => o.get(e.column)).map((e) => {let t = o.get(e.column);return { column: t.name, comparePath: t.comparePath || t.dataPath, descending: !!e.descending };});l.sortableColumns > 0 && r.length > l.sortableColumns && (r.length = l.sortableColumns), ee(this);for (let e = 0; e < r.length; e++) te(this, r[e].column, r[e].descending);l.adjustColumnWidthForSortArrow && !i.tableSkeletonNeedsRendering && this.tableWidthChanged(true), i.rows.sortColumn = r, r.length && t.immediate && (i.rows.sort(), se(this), (_i$virtualListHelper = i.virtualListHelper) !== null && _i$virtualListHelper !== void 0 && _i$virtualListHelper.invalidate(), i.virtualListHelper && t.render && i.virtualListHelper.render());let n = [];for (let e = 0; e < r.length; e++) n.push({ column: r[e].column, descending: r[e].descending });return this.emit("sort", { sorts: n }), this;}getSortedColumns() {const e = this._p;let t = [];for (let l = 0; l < e.rows.sortColumn.length; l++) {let i = e.rows.sortColumn[l];t.push({ column: i.column, descending: i.descending });}return t;}setCellFormatter(e) {if (!e) {const t = (e) => "string" == typeof e ? h(e) : e;t[c] = true, e = t;}return this._o.cellFormatter = e, this;}setHeaderCellFormatter(e) {return this._o.headerCellFormatter = e || function (e) {return "string" == typeof e ? h(e) : e;}, this;}setFilter(e) {return this._o.filter = e, this;}filter(e) {const t = this._p;let l = this._o.filter || R,i = !!t.filteredRows;return t.filteredRows && (t.filteredRows = null), t.filterArgs = null == e ? null : "object" != typeof e || Array.isArray(e) ? e : Object.assign({}, e), null !== t.filterArgs ? (t.filteredRows = t.rows.filteredCollection(l, t.filterArgs), (i || t.filteredRows) && (this.clearAndRender(), this.emit("filter", e))) : (t.filterArgs = null, t.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}clearFilter() {const e = this._p;return e.filteredRows && (e.filterArgs = null, e.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}getHtmlForRowCell(e, t) {const l = this._p;if (e < 0 || e > l.rows.length - 1) return null;let i = l.columns.get(t);if (!i) return null;let o = l.rows[e];return ae(this._o, o, i);}getHtmlForRowDataCell(e, t) {let l = this._p.columns.get(t);return l ? ae(this._o, e, l) : null;}getRowYPos(e) {var _t$virtualListHelper$, _t$virtualListHelper2;const t = this._p;if (e < 0 || e > t.rows.length - 1) return null;let l = e;return t.filteredRows && -1 === (l = t.filteredRows.indexOf(t.rows[e])) ? null : (_t$virtualListHelper$ = (_t$virtualListHelper2 = t.virtualListHelper) === null || _t$virtualListHelper2 === void 0 ? void 0 : _t$virtualListHelper2.getItemPosition(l)) !== null && _t$virtualListHelper$ !== void 0 ? _t$virtualListHelper$ : null;}getDataForRow(e) {const t = this._p;return e < 0 || e > t.rows.length - 1 ? null : t.rows[e];}getRowCount() {const e = this._p;return e.rows ? e.rows.length : 0;}getIndexForRow(e) {return this._p.rows.indexOf(e);}getFilteredRowCount() {const e = this._p;return (e.filteredRows || e.rows).length;}getIndexForFilteredRow(e) {const t = this._p;return (t.filteredRows || t.rows).indexOf(e);}getDataForFilteredRow(e) {const t = this._p;return e < 0 || e > (t.filteredRows || t.rows).length - 1 ? null : (t.filteredRows || t.rows)[e];}getHeaderRowElement() {return this._p.headerRow;}addRows(e, t, l, i) {let o = this._p;"boolean" == typeof t && (i = l, l = t, t = -1), "number" != typeof t && (t = -1), (t < 0 || t > o.rows.length) && (t = o.rows.length), i = void 0 === i || !!i;const r = (Array.isArray(e) ? e : [e]).length;if (e) {if (o.rows.add(e, t), o.filteredRows || l && o.rows.sortColumn.length) ne(this), l && o.rows.sortColumn.length && this.resort(), o.tableSkeletonNeedsRendering = true, i && this.render();else if (i && o.virtualListHelper) {if (o.virtualListHelper.addItemsAt(r, t), this._o.virtualTable) U(this), G(this), this.render(), J(this, false);else if (o.tbody) {for (let e = t + r, l = o.virtualListHelper.getCount(); e < l; e++) o.virtualListHelper.refreshItemAt(e);this.render(), G(this), J(this, true);}} else o.tableSkeletonNeedsRendering = true;this.emit("addrows", { count: r, clear: false });}return this;}removeRows(e, t, l) {let i = this._p;if ("number" != typeof t || t <= 0) return this;if (e < 0 || e > i.rows.length - 1) return this;if (i.rows.splice(e, t), l = void 0 === l || !!l, i.filteredRows) ne(this), i.tableSkeletonNeedsRendering = true, l && this.render();else if (l && i.virtualListHelper) {if (i.virtualListHelper.removeItemsAt(t, e), this._o.virtualTable) U(this), G(this), this.render(), J(this, false);else {for (let t = e, l = i.virtualListHelper.getCount(); t < l; t++) i.virtualListHelper.refreshItemAt(t);this.render(), G(this), J(this, true);}} else i.tableSkeletonNeedsRendering = true;return this;}removeRow(e, t) {return this.removeRows(e, 1, t);}refreshRow(e, t = true) {let l = this._p;if (e < 0 || e > l.rows.length - 1) return this;let i = -1;return l.filteredRows && -1 === (i = l.filteredRows.indexOf(l.rows[e])) ? this : (-1 === i && (i = e), l.virtualListHelper ? (l.virtualListHelper.refreshItemAt(i), t && l.virtualListHelper.render(), this) : this);}getRowElement(e) {var _t$virtualListHelper3;let t = this._p;if (e < 0 || e > t.rows.length - 1) return null;let l = -1;return t.filteredRows && -1 === (l = t.filteredRows.indexOf(t.rows[e])) ? null : (-1 === l && (l = e), ((_t$virtualListHelper3 = t.virtualListHelper) === null || _t$virtualListHelper3 === void 0 ? void 0 : _t$virtualListHelper3.getItemElementAt(l)) || null);}refreshAllVirtualRows() {var _e$virtualListHelper3;const e = this._p;return (_e$virtualListHelper3 = e.virtualListHelper) !== null && _e$virtualListHelper3 !== void 0 && _e$virtualListHelper3.invalidate().render(), this;}setRows(e, t) {let l = this._p;return l.rows.reset(e), ne(this), t && l.rows.sortColumn.length && this.resort(), this.clearAndRender().emit("addrows", { count: e.length, clear: true }), this;}tableWidthChanged(e, t) {let l = this._o,i = this._p,o = pe(this),r = o,n = 0;if (!i.table) return this;t = void 0 === t || t;let s = 0;if (i.tbody || (t = false), t && (s = parseFloat(i.tbody.style.minWidth) || 0), r !== i.lastDetectedWidth || e) {var _i$notifyRendererOfCo;i.lastDetectedWidth = o;let e = 0,a = [],d = 0,u = 0;for (let e = 0; e < i.columns.length; e++) i.columns[e].actualWidthConsideringScrollbarWidth = null;for (let t = 0; t < i.visibleColumns.length; t++) {var _o$unconvertedWidthMo;let o = i.visibleColumns[t];if (null != o.unconvertedWidth && (o.width = o.unconvertedWidth, o.widthMode = (_o$unconvertedWidthMo = o.unconvertedWidthMode) !== null && _o$unconvertedWidthMo !== void 0 ? _o$unconvertedWidthMo : o.widthMode, o.unconvertedWidth = null, o.unconvertedWidthMode = null), 1 === o.widthMode) {let i = o.width;i += o.arrowProposedWidth || 0, !o.ignoreMin && i < l.minColumnWidth && (i = l.minColumnWidth), r -= i, e += i, i !== o.actualWidth && (o.actualWidth = i, a.push(t));} else if (0 === o.widthMode) {let n = fe(this, o);o === i.visibleColumns[i.visibleColumns.length - 1] && (n += i.scrollbarWidth), r -= n, e += n, n !== o.actualWidth && (o.actualWidth = n, l.convertColumnWidthsToRelative || a.push(t));} else 2 === o.widthMode ? (d += o.width, n++) : 3 === o.widthMode && u++;}if (l.convertColumnWidthsToRelative) for (let t = 0; t < i.visibleColumns.length; t++) {let l = i.visibleColumns[t];if (0 === l.widthMode) {const t = l.width,i = l.widthMode;null == l.unconvertedWidth && (l.unconvertedWidth = t, l.unconvertedWidthMode = i), l.widthMode = 2, r += l.actualWidth, l.width = l.actualWidth / e, d += l.width, n++;}}if (n && (d < 1 && !u && l.relativeWidthGrowsToFillWidth || d > 1 && l.relativeWidthShrinksToFillWidth)) for (let e = 0; e < i.visibleColumns.length; e++) {let t = i.visibleColumns[e];2 === t.widthMode && (null == t.unconvertedWidth && (t.unconvertedWidth = t.width, t.unconvertedWidthMode = t.widthMode), t.width /= d);}let h = Math.max(0, r);0 === h && (h = i.table.clientWidth);let c = l.minColumnWidth / h;if (Number.isFinite(c) || (c = 0), c > 0) {let e,t = 0;for (let e = 0; e < i.visibleColumns.length; e++) {let l = i.visibleColumns[e];2 === l.widthMode && !l.ignoreMin && l.width < c && (t += c - l.width, l.width = c);}for (let l = 0; l < i.visibleColumns.length; l++) {let o = i.visibleColumns[l];2 === o.widthMode && !o.ignoreMin && o.width > c && t > 0 && (null == o.unconvertedWidth && (o.unconvertedWidth = o.width, o.unconvertedWidthMode = o.widthMode), e = Math.min(t, o.width - c), o.width -= e, t -= e);}}if (!u && l.autoFillTableWidth && r > 0) {let e = 0,t = r;for (let l = 0; l < i.visibleColumns.length; l++) {let o = i.visibleColumns[l];o.resizable || 1 !== o.widthMode || (e += o.width), 2 === o.widthMode && (t -= Math.round(h * o.width));}let l = (o - e) / (o - t - e) || NaN;for (let e = 0; e < i.visibleColumns.length && t > 0; e++) {let t = i.visibleColumns[e];if (t.resizable || 1 !== t.widthMode) if (2 === t.widthMode) null == t.unconvertedWidth && (t.unconvertedWidth = t.width, t.unconvertedWidthMode = t.widthMode), t.width *= l;else {let i = t.actualWidth * l;t.actualWidth !== i && (t.actualWidth = i, -1 === a.indexOf(e) && a.push(e));}}}for (let e = 0; e < i.visibleColumns.length; e++) {let t = i.visibleColumns[e];if (2 === t.widthMode) {let l = Math.round(h * t.width);r -= l, n--, 0 === n && 1 === r && (l++, r--), -1 === r && (l--, r++), l !== t.actualWidth && (t.actualWidth = l, a.push(e));}}if (u) {let e = Math.max(0, r),t = u;for (let o = 0; o < i.visibleColumns.length; o++) {let r = i.visibleColumns[o];if (3 === r.widthMode) {let i = Math.max(0, Math.floor(e / t));!r.ignoreMin && i < l.minColumnWidth && (i = l.minColumnWidth), e -= i, t--, i !== r.actualWidth && (r.actualWidth = i, a.push(o));}}}if (l.autoFillLastColumn && i.visibleColumns.length) {var _l$actualWidth2;let e = 0;for (let t = 0; t < i.visibleColumns.length; t++) {var _i$visibleColumns$t$a;e += (_i$visibleColumns$t$a = i.visibleColumns[t].actualWidth) !== null && _i$visibleColumns$t$a !== void 0 ? _i$visibleColumns$t$a : 0;}const t = i.visibleColumns.length - 1,l = i.visibleColumns[t],r = o - e;r > 0 && (l.actualWidth = ((_l$actualWidth2 = l.actualWidth) !== null && _l$actualWidth2 !== void 0 ? _l$actualWidth2 : 0) + r, -1 === a.indexOf(t) && a.push(t));}if (i.visibleColumns.length && (i.visibleColumns[i.visibleColumns.length - 1].actualWidthConsideringScrollbarWidth = i.visibleColumns[i.visibleColumns.length - 1].actualWidth - (i.scrollbarWidth || 0)), (_i$notifyRendererOfCo = i.notifyRendererOfColumnsConfig) !== null && _i$notifyRendererOfCo !== void 0 && _i$notifyRendererOfCo.call(i), t) {let e = ge(this);s < e && J(this, false);for (let e = 0; e < a.length; e++) Z(this, a[e]);s > e && J(this, false);}K(this);}return this;}tableHeightChanged() {let e = this._o;if (!this._p.table) return this;let t = getElementHeight(this.el, true);return t !== e.height && (e.height = t, j(this), e.virtualTable && this.clearAndRender()), this;}hideCellPreview() {return z(this), this;}abortCellPreview() {return this.hideCellPreview(), this;}cancelColumnResize() {return A(this), this;}getUrlForElementContent(e) {let t,l = document.getElementById(e);if (l) {let e = l.textContent;if ("function" == typeof Blob) t = new Blob([e || ""]);else {const l = window,i = l.BlobBuilder || l.WebKitBlobBuilder || l.MozBlobBuilder || l.MSBlobBuilder;if (!i) return null;const o = new i();o.append(e || ""), t = o.getBlob();}return (window.URL || window.webkitURL).createObjectURL(t);}return null;}isWorkerSupported() {return window.Worker instanceof Function;}createWebWorker(e, t, l) {if (this.isWorkerSupported()) {let i = this._p,o = new Worker(e),r = (e) => {e.data.append ? this.addRows(e.data.rows, l) : this.setRows(e.data.rows, l);};return o.addEventListener("message", r, false), i.workerListeners || (i.workerListeners = []), i.workerListeners.push({ worker: o, listener: r }), (t || void 0 === t) && o.postMessage(null), o;}return null;}unbindWebWorker(e) {let t = this._p;if (t.workerListeners) for (let l = 0; l < t.workerListeners.length; l++) t.workerListeners[l].worker === e && (e.removeEventListener("message", t.workerListeners[l].listener, false), t.workerListeners.splice(l, 1), l--);return this;}}_defineProperty(We, "VERSION", "2.0.39");_defineProperty(We, "Width", _);
3463
3463
 
3464
3464
  class DGTableJQuery extends We {
3465
3465
  constructor(options) {