@keenmate/web-grid 1.0.0-rc04 → 1.0.0-rc06

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/web-grid.js CHANGED
@@ -1,7 +1,7 @@
1
- var Ye = Object.defineProperty;
2
- var Ne = (t, e, o) => e in t ? Ye(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
- var w = (t, e, o) => Ne(t, typeof e != "symbol" ? e + "" : e, o);
4
- class Ue {
1
+ var Ne = Object.defineProperty;
2
+ var Ue = (t, e, o) => e in t ? Ne(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
+ var w = (t, e, o) => Ue(t, typeof e != "symbol" ? e + "" : e, o);
4
+ class je {
5
5
  constructor() {
6
6
  // ==========================================================================
7
7
  // Configuration Props
@@ -27,10 +27,15 @@ class Ue {
27
27
  w(this, "_invalidCells", []);
28
28
  w(this, "_showRowToolbar", !1);
29
29
  w(this, "_rowToolbar", ["add", "delete", "duplicate"]);
30
- w(this, "_toolbarAlign", "center");
31
- w(this, "_toolbarTopPosition", "center");
30
+ w(this, "_toolbarVerticalAlign", "bottom");
31
+ w(this, "_toolbarHorizontalAlign", "center");
32
32
  w(this, "_toolbarTrigger", "hover");
33
+ w(this, "_toolbarPosition", "auto");
33
34
  w(this, "_contextMenu");
35
+ w(this, "_rowShortcuts");
36
+ w(this, "_showShortcutsHelp", !1);
37
+ w(this, "_shortcutsHelpPosition", "top-right");
38
+ w(this, "_shortcutsHelpContentCallback");
34
39
  // ==========================================================================
35
40
  // Callbacks
36
41
  // ==========================================================================
@@ -244,17 +249,30 @@ class Ue {
244
249
  set rowToolbar(e) {
245
250
  this._rowToolbar = e, this.requestUpdate();
246
251
  }
252
+ get toolbarVerticalAlign() {
253
+ return this._toolbarVerticalAlign;
254
+ }
255
+ set toolbarVerticalAlign(e) {
256
+ this._toolbarVerticalAlign = e, this.requestUpdate();
257
+ }
258
+ get toolbarHorizontalAlign() {
259
+ return this._toolbarHorizontalAlign;
260
+ }
261
+ set toolbarHorizontalAlign(e) {
262
+ this._toolbarHorizontalAlign = e, this.requestUpdate();
263
+ }
264
+ // Deprecated aliases
247
265
  get toolbarAlign() {
248
- return this._toolbarAlign;
266
+ return this._toolbarVerticalAlign;
249
267
  }
250
268
  set toolbarAlign(e) {
251
- this._toolbarAlign = e, this.requestUpdate();
269
+ this.toolbarVerticalAlign = e;
252
270
  }
253
271
  get toolbarTopPosition() {
254
- return this._toolbarTopPosition;
272
+ return this._toolbarHorizontalAlign;
255
273
  }
256
274
  set toolbarTopPosition(e) {
257
- this._toolbarTopPosition = e;
275
+ this.toolbarHorizontalAlign = e;
258
276
  }
259
277
  get toolbarTrigger() {
260
278
  return this._toolbarTrigger;
@@ -262,12 +280,43 @@ class Ue {
262
280
  set toolbarTrigger(e) {
263
281
  this._toolbarTrigger = e, this.requestUpdate();
264
282
  }
283
+ get toolbarPosition() {
284
+ return this._toolbarPosition;
285
+ }
286
+ set toolbarPosition(e) {
287
+ this._toolbarPosition = e, this.requestUpdate();
288
+ }
265
289
  get contextMenu() {
266
290
  return this._contextMenu;
267
291
  }
268
292
  set contextMenu(e) {
269
293
  this._contextMenu = e, this.requestUpdate();
270
294
  }
295
+ // Row keyboard shortcuts
296
+ get rowShortcuts() {
297
+ return this._rowShortcuts;
298
+ }
299
+ set rowShortcuts(e) {
300
+ this._rowShortcuts = e, this.requestUpdate();
301
+ }
302
+ get showShortcutsHelp() {
303
+ return this._showShortcutsHelp;
304
+ }
305
+ set showShortcutsHelp(e) {
306
+ this._showShortcutsHelp = e, this.requestUpdate();
307
+ }
308
+ get shortcutsHelpPosition() {
309
+ return this._shortcutsHelpPosition;
310
+ }
311
+ set shortcutsHelpPosition(e) {
312
+ this._shortcutsHelpPosition = e, this.requestUpdate();
313
+ }
314
+ get shortcutsHelpContentCallback() {
315
+ return this._shortcutsHelpContentCallback;
316
+ }
317
+ set shortcutsHelpContentCallback(e) {
318
+ this._shortcutsHelpContentCallback = e, this.requestUpdate();
319
+ }
271
320
  // Sorting (multi-column)
272
321
  get sort() {
273
322
  return this._sort;
@@ -652,7 +701,7 @@ class Ue {
652
701
  * Commit edit with validation
653
702
  */
654
703
  async commitEdit(e, o, i) {
655
- var g, h;
704
+ var l, h;
656
705
  const r = this._columns.find((u) => String(u.field) === o);
657
706
  if (!r) return;
658
707
  const s = this.displayItems[e];
@@ -678,15 +727,15 @@ class Ue {
678
727
  c = !1, a = u instanceof Error ? u.message : "Validation failed";
679
728
  }
680
729
  this._isValidating = !1;
681
- let l = this._draftRows.get(e);
682
- l || (l = { ...s }, this._draftRows.set(e, l)), l[o] = d, c ? (this.removeInvalidCell(e, o), this._currentCellError = null) : (this.addInvalidCell(e, o, a || "Invalid value"), this._currentCellError = a, (g = this._onvalidationerror) == null || g.call(this, {
730
+ let g = this._draftRows.get(e);
731
+ g || (g = { ...s }, this._draftRows.set(e, g)), g[o] = d, c ? (this.removeInvalidCell(e, o), this._currentCellError = null) : (this.addInvalidCell(e, o, a || "Invalid value"), this._currentCellError = a, (l = this._onvalidationerror) == null || l.call(this, {
683
732
  row: s,
684
733
  rowIndex: e,
685
734
  field: o,
686
735
  error: a || "Invalid value"
687
736
  })), (h = this._onrowchange) == null || h.call(this, {
688
737
  row: s,
689
- draftRow: l,
738
+ draftRow: g,
690
739
  rowIndex: e,
691
740
  field: o,
692
741
  oldValue: n,
@@ -741,12 +790,12 @@ class Ue {
741
790
  this._focusedCell = null;
742
791
  }
743
792
  }
744
- const je = ':host{--wg-rem: 10px;font-family:var(--wg-font-family, var(--base-font-family, system-ui, -apple-system, sans-serif));display:block;--wg-accent-color: var(--base-accent-color, #0078d4);--wg-accent-color-hover: var(--base-accent-color-hover, #106ebe);--wg-accent-color-active: var(--base-accent-color-active, #005a9e);--wg-accent-color-light: var(--base-accent-color-light, #e6f2ff);--wg-text-color-1: var(--base-text-color-1, #242424);--wg-text-color-2: var(--base-text-color-2, #424242);--wg-text-color-3: var(--base-text-color-3, #707070);--wg-text-on-accent: var(--base-text-color-on-accent, #ffffff);--wg-surface-1: var(--base-main-bg, #ffffff);--wg-surface-2: var(--base-elevated-bg, #f5f5f5);--wg-surface-3: var(--base-hover-bg, #ebebeb);--wg-surface-floating: var(--base-dropdown-bg, var(--base-main-bg, #ffffff));--wg-border-color: var(--base-border-color, #e0e0e0);--wg-border-color-hover: var(--base-border-color, #d1d1d1);--wg-input-bg: var(--base-input-bg, #ffffff);--wg-input-color: var(--base-input-color, var(--wg-text-color-1));--wg-input-border: var(--base-input-border, 1px solid #d1d1d1);--wg-input-border-hover: var(--base-input-border-hover, 1px solid #0078d4);--wg-input-border-focus: var(--base-input-border-focus, 1px solid #0078d4);--wg-input-placeholder-color: var(--base-input-placeholder-color, #707070);--wg-danger-color: var(--base-danger-color, #d13438);--wg-danger-bg-light: var(--base-danger-bg-light, #fde7e9);--wg-hover-bg: var(--base-hover-bg, #f0f0f0);--wg-active-bg: var(--base-hover-bg, #e0e0e0);--wg-font-size-base: calc(var(--base-font-size-base, 1.4) * var(--wg-rem));--wg-font-size-sm: calc(var(--base-font-size-sm, 1.2) * var(--wg-rem));--wg-font-size-xs: calc(var(--base-font-size-xs, 1.1) * var(--wg-rem));--wg-font-size-lg: calc(var(--base-font-size-lg, 1.6) * var(--wg-rem));--wg-line-height-base: calc(var(--base-line-height-normal, 2) * var(--wg-rem));--wg-font-weight-normal: var(--base-font-weight-normal, 400);--wg-font-weight-semibold: var(--base-font-weight-semibold, 600);--wg-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--wg-rem));--wg-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--wg-rem));--wg-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--wg-rem));--wg-spacing-xs: calc(.4 * var(--wg-rem));--wg-spacing-sm: calc(.8 * var(--wg-rem));--wg-spacing-md: calc(1.2 * var(--wg-rem));--wg-spacing-lg: calc(1.6 * var(--wg-rem));--wg-spacing-xl: calc(2.4 * var(--wg-rem));--wg-table-bg: var(--wg-surface-1);--wg-table-border: 1px solid var(--wg-border-color);--wg-header-bg: var(--wg-surface-2);--wg-header-bg-hover: var(--wg-surface-3);--wg-header-bg-sorted: var(--wg-surface-3);--wg-header-color: var(--wg-text-color-1);--wg-header-border: 2px solid var(--wg-border-color);--wg-header-padding: var(--wg-spacing-sm) var(--wg-spacing-md);--wg-header-font-weight: var(--wg-font-weight-semibold);--wg-cell-padding: var(--wg-spacing-sm) var(--wg-spacing-md);--wg-cell-color: var(--wg-text-color-1);--wg-cell-border: 1px solid var(--wg-border-color);--wg-cell-bg-hover: var(--wg-hover-bg);--wg-cell-bg-editing: var(--wg-surface-1);--wg-cell-readonly-bg: var(--wg-surface-2);--wg-row-border: 1px solid var(--wg-border-color);--wg-row-bg-even: var(--wg-surface-2);--wg-row-bg-hover: var(--wg-surface-3);--wg-filter-bg: var(--wg-surface-1);--wg-filter-border: 1px solid var(--wg-border-color);--wg-filter-padding: var(--wg-spacing-xs) var(--wg-spacing-sm);--wg-filter-input-padding: calc(.4 * var(--wg-rem)) calc(.8 * var(--wg-rem));--wg-filter-input-bg: var(--wg-input-bg);--wg-filter-input-border: var(--wg-input-border);--wg-filter-input-border-focus: var(--wg-input-border-focus);--wg-filter-input-border-radius: var(--wg-border-radius-sm);--wg-filter-input-font-size: var(--wg-font-size-sm);--wg-sort-indicator-size: calc(1.4 * var(--wg-rem));--wg-sort-indicator-opacity: .9;--wg-sort-placeholder-opacity: .3;--wg-sort-priority-size: calc(1.1 * var(--wg-rem));--wg-pagination-padding: var(--wg-spacing-md);--wg-pagination-gap: calc(1.6 * var(--wg-rem));--wg-pagination-bg: var(--wg-surface-1);--wg-pagination-border: 1px solid var(--wg-border-color);--wg-pagination-btn-padding: calc(.6 * var(--wg-rem)) calc(1.6 * var(--wg-rem));--wg-pagination-btn-bg: var(--wg-surface-1);--wg-pagination-btn-bg-hover: var(--wg-surface-2);--wg-pagination-btn-bg-active: var(--wg-surface-3);--wg-pagination-btn-border: 1px solid var(--wg-border-color);--wg-pagination-btn-border-hover: 1px solid var(--wg-border-color-hover);--wg-pagination-btn-border-radius: var(--wg-border-radius-sm);--wg-pagination-btn-disabled-opacity: .4;--wg-empty-padding: var(--wg-spacing-xl);--wg-empty-color: var(--wg-text-color-3);--wg-error-cell-bg: var(--wg-danger-bg-light);--wg-error-cell-border: 1px solid var(--wg-danger-color);--wg-error-message-color: var(--wg-danger-color);--wg-error-message-font-size: var(--wg-font-size-xs);--wg-error-indicator-color: var(--wg-danger-color);--wg-editor-bg: var(--wg-surface-1);--wg-editor-outline: 2px solid var(--wg-accent-color);--wg-editor-outline-offset: -2px;--wg-editor-validating-opacity: .7;--wg-dropdown-toggle-right: var(--wg-spacing-md);--wg-dropdown-toggle-size: calc(1.2 * var(--wg-rem));--wg-dropdown-toggle-hitbox: calc(2.4 * var(--wg-rem));--wg-toolbar-bg: var(--wg-surface-floating);--wg-toolbar-border: 1px solid var(--wg-border-color);--wg-toolbar-border-radius: var(--wg-border-radius-sm);--wg-toolbar-shadow: var(--base-dropdown-box-shadow, 0 2px 8px rgba(0, 0, 0, .15));--wg-toolbar-divider-color: var(--wg-border-color);--wg-toolbar-btn-min-width: calc(2.4 * var(--wg-rem));--wg-toolbar-btn-padding: 0 calc(.4 * var(--wg-rem));--wg-toolbar-btn-border-radius: var(--wg-border-radius-sm);--wg-toolbar-btn-bg-hover: var(--wg-hover-bg);--wg-toolbar-btn-bg-active: var(--wg-active-bg);--wg-toolbar-btn-color: var(--wg-text-color-1);--wg-toolbar-trigger-color: var(--wg-text-color-3);--wg-toolbar-trigger-color-hover: var(--wg-text-color-1);--wg-toolbar-trigger-bg-hover: var(--wg-hover-bg);--wg-tooltip-bg: var(--base-tooltip-bg, #333);--wg-context-menu-z-index: 1001;--wg-context-menu-min-width: calc(16 * var(--wg-rem));--wg-focus-outline: 2px solid var(--wg-accent-color);--wg-focus-outline-offset: -2px;--wg-focus-bg: var(--wg-hover-bg);--wg-transition-fast: .1s ease;--wg-transition-normal: .15s ease;--wg-z-dropdown: 9999;--wg-z-toolbar: 1000;--wg-z-context-menu: 1001}web-grid:not(:defined){display:block;min-height:calc(10 * var(--wg-rem));color:transparent!important;background:transparent}.wg{position:relative;width:100%;max-height:inherit;overflow:auto;overscroll-behavior:contain;border:var(--wg-table-border)}.wg__table{width:max-content;min-width:100%;border-collapse:collapse;table-layout:fixed;background:var(--wg-table-bg);font-size:var(--wg-font-size-base);line-height:var(--wg-line-height-base)}.wg__table tbody tr{border-bottom:var(--wg-row-border)}.wg__row-number-header,.wg__row-number{width:40px;min-width:40px;max-width:40px;text-align:center;color:var(--wg-text-color-secondary);background:var(--wg-header-bg);-webkit-user-select:none;user-select:none;font-size:var(--wg-font-size-sm)}.wg__row-number{border-right:var(--wg-cell-border)}.wg__actions-column{width:32px;min-width:32px;max-width:32px;padding:0!important;text-align:center}thead .wg__actions-column{background:var(--wg-header-bg);border-bottom:var(--wg-header-border)}.wg__filter-row .wg__actions-column{background:var(--wg-filter-bg);border-bottom:var(--wg-filter-border)}.wg__header{position:sticky;top:0;z-index:1;background:var(--wg-header-bg);color:var(--wg-header-color);font-weight:var(--wg-header-font-weight);padding:var(--wg-header-padding);border-bottom:var(--wg-header-border);text-align:left;-webkit-user-select:none;user-select:none}.wg__header--sortable{cursor:pointer}.wg__header--sortable:hover{background:var(--wg-header-bg-hover)}.wg__header--sorted{background:var(--wg-header-bg-sorted)}.wg__header-content{display:flex;align-items:center;gap:4px;justify-content:space-between}.wg__header-title{flex:1}.wg__sort-indicator{font-size:var(--wg-sort-indicator-size);opacity:var(--wg-sort-indicator-opacity);min-width:16px;text-align:center;display:inline-flex;align-items:center}.wg__sort-placeholder{opacity:var(--wg-sort-placeholder-opacity)}.wg__sort-priority{font-size:var(--wg-sort-priority-size);font-weight:600;margin-left:2px;vertical-align:super;line-height:1}.wg__header-info{display:inline-flex;align-items:center;color:var(--wg-accent-color);cursor:help;opacity:.7;margin-left:4px;vertical-align:middle}.wg__header-info:hover{opacity:1}.wg__filter-row th{padding:var(--wg-filter-padding);background:var(--wg-filter-bg);border-bottom:var(--wg-filter-border)}.wg__filter-input{width:100%;padding:var(--wg-filter-input-padding);border:var(--wg-filter-input-border);border-radius:var(--wg-filter-input-border-radius);background:var(--wg-surface-1);color:var(--wg-text-color-1);font-size:var(--wg-filter-input-font-size);box-sizing:border-box}.wg__filter-input:focus{outline:none;border:var(--wg-filter-input-border-focus);box-shadow:0 0 0 1px var(--wg-accent-color)}.wg__cell{padding:var(--wg-cell-padding);color:var(--wg-cell-color);scroll-margin-top:3rem;scroll-margin-bottom:.5rem}.wg__cell-text{-webkit-user-select:none;user-select:none}.wg__cell--ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wg__cell--editable{cursor:pointer;position:relative}.wg__cell--editable:hover{background:var(--wg-cell-bg-hover)}.wg__cell--editable:hover:after{content:"";position:absolute;top:2px;right:2px;bottom:2px;left:2px;border:1px dashed var(--wg-border-color);border-radius:2px;pointer-events:none}.wg__cell--editing{position:relative;background:var(--wg-surface-1);outline:2px solid var(--wg-accent-color);outline-offset:-2px}.wg__cell--editing:after{display:none}.wg__cell--invalid{background:var(--wg-danger-bg-light, #fee);box-shadow:inset 0 0 0 2px var(--wg-danger-color, #c00)}.wg--navigate-mode .wg__cell:not(.wg__cell--editable){background:var(--wg-cell-readonly-bg, #f5f5f5)}.wg__editor{position:absolute;top:0;left:0;right:0;width:100%;padding:var(--wg-cell-padding);border:none;background:transparent;color:var(--wg-text-color-1);font-size:var(--wg-font-size-base);font-family:inherit;line-height:inherit;box-sizing:border-box}.wg__editor:focus,.wg__editor:focus-visible{outline:none;box-shadow:none}.wg__editor--text{text-align:inherit}.wg__editor--number{text-align:right}.wg__editor--date{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:var(--wg-editor-bg)}.wg__date-input{flex:1;min-width:0;height:100%;border:none;background:transparent;font:inherit;padding:var(--wg-cell-padding-block) var(--wg-cell-padding-inline);outline:none;color:inherit}.wg__date-trigger{width:var(--wg-date-trigger-size, 28px);height:100%;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--wg-text-secondary, #666);cursor:pointer;padding:0;flex-shrink:0}.wg__date-trigger:hover{color:var(--wg-accent-color, #0078d4);background:var(--wg-hover-bg, rgba(0, 0, 0, .05))}.wg__editor--checkbox{width:auto;height:auto;margin:0 auto}.wg__editor--custom{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:var(--wg-editor-bg);padding:var(--wg-cell-padding-block) var(--wg-cell-padding-inline);cursor:pointer}.wg__editor--custom:focus{outline:none}.wg__custom-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;cursor:pointer}.wg__editor--combobox,.wg__editor--autocomplete{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;padding:var(--wg-cell-padding);padding-right:0;background:transparent;box-sizing:border-box}.wg__combobox-input,.wg__autocomplete-input{flex:1;width:100%;height:100%;padding:0 24px 0 0;border:none;background:transparent;color:var(--wg-text-color-1);font-size:var(--wg-font-size-base);font-family:inherit;line-height:var(--wg-line-height-base);outline:none;box-sizing:border-box;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wg__combobox-input:focus,.wg__autocomplete-input:focus{outline:none}.wg__combobox-toggle{position:absolute;right:var(--wg-dropdown-toggle-right);top:50%;transform:translateY(-50%);font-size:var(--wg-dropdown-toggle-size);color:var(--wg-text-color-2);pointer-events:auto;cursor:pointer}.wg__combobox-toggle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__loading-indicator{position:absolute;right:var(--wg-dropdown-toggle-right);top:50%;transform:translateY(-50%);font-size:12px;animation:wg-pulse 1s infinite}@keyframes wg-pulse{0%,to{opacity:1}50%{opacity:.4}}.wg__select-trigger{display:flex;align-items:center;justify-content:space-between;cursor:pointer;background:transparent}.wg__select-trigger:focus,.wg__select-trigger:focus-visible{outline:none;box-shadow:none}.wg__select-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wg__select-toggle{position:relative;font-size:var(--wg-dropdown-toggle-size);opacity:.6;margin-left:4px;flex-shrink:0;pointer-events:auto;cursor:pointer}.wg__select-toggle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__cell-dropdown-display{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}.wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle{opacity:0}.wg__cell:hover .wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle,.wg__cell--focused .wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle{opacity:.6}.wg__cell-date-display{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}.wg__cell-date-display .wg__date-trigger{position:relative;background:none;border:none;padding:0;margin:0;cursor:pointer;opacity:.6;display:flex;align-items:center;justify-content:center;color:inherit}.wg__cell-date-display .wg__date-trigger:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__cell-date-display--toggle-on-focus .wg__date-trigger{opacity:0}.wg__cell:hover .wg__cell-date-display--toggle-on-focus .wg__date-trigger,.wg__cell--focused .wg__cell-date-display--toggle-on-focus .wg__date-trigger{opacity:.6}.wg__dropdown{background:var(--wg-surface-floating, #fff);border:1px solid var(--wg-border-color, #d1d1d1);border-radius:4px;box-shadow:var(--wg-toolbar-shadow);max-height:200px;overflow-y:auto;font-size:var(--wg-font-size-base);font-family:inherit;line-height:var(--wg-line-height-base)}.wg__dropdown-option{display:flex;align-items:center;gap:var(--wg-spacing-sm);padding:6px 12px;cursor:pointer;color:var(--wg-text-color-1)}.wg__dropdown-option:hover,.wg__dropdown-option--highlighted{background:var(--wg-hover-bg, #f0f0f0)}.wg__dropdown-option--selected{background:var(--wg-accent-color-light, #e6f2ff)}.wg__dropdown-option--disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.wg__dropdown-option-icon{flex-shrink:0;width:1.5em;text-align:center}.wg__dropdown-option-content{flex:1;min-width:0;overflow:hidden}.wg__dropdown-option-label{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wg__dropdown-option-subtitle{display:block;font-size:var(--wg-font-size-sm);color:var(--wg-text-color-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wg__dropdown-empty{padding:8px 12px;color:var(--wg-text-color-2);font-style:italic;text-align:center}.wg--navigate-mode .wg__cell{cursor:cell}.wg--navigate-mode .wg__cell:focus{outline:none}.wg--navigate-mode .wg__cell.wg__cell--focused{outline:2px solid var(--wg-focus-border-color, #217346);outline-offset:-2px}.wg__cell--focused:after{display:none}.wg__pagination{display:flex;align-items:center;justify-content:center;gap:var(--wg-pagination-gap);padding:var(--wg-pagination-padding);border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg)}.wg__pagination-btn{padding:var(--wg-pagination-btn-padding);background:var(--wg-pagination-btn-bg);border:var(--wg-pagination-btn-border);border-radius:var(--wg-pagination-btn-border-radius);color:var(--wg-cell-color);font-size:var(--wg-font-size-base);cursor:pointer;transition:all var(--wg-transition-fast)}.wg__pagination-btn:hover:not(:disabled){background:var(--wg-pagination-btn-bg-hover);border:var(--wg-pagination-btn-border-hover)}.wg__pagination-btn:active:not(:disabled){background:var(--wg-pagination-btn-bg-active)}.wg__pagination-btn:disabled{opacity:var(--wg-pagination-btn-disabled-opacity);cursor:not-allowed}.wg__pagination-info{font-size:var(--wg-font-size-base);color:var(--wg-cell-color)}.wg__pagination-count{font-size:var(--wg-font-size-sm);color:var(--wg-text-color-3);margin-left:4px}.wg__pagination-pagesize{display:flex;align-items:center;gap:6px}.wg__pagination-select{padding:4px 8px;background:var(--wg-pagination-btn-bg);border:var(--wg-pagination-btn-border);border-radius:var(--wg-pagination-btn-border-radius);color:var(--wg-cell-color);font-size:var(--wg-font-size-base);cursor:pointer}.wg__pagination-select:hover{background:var(--wg-pagination-btn-bg-hover);border:var(--wg-pagination-btn-border-hover)}.wg__pagination-select:focus{outline:2px solid var(--wg-accent-color);outline-offset:-2px}.wg__pagination-label{font-size:var(--wg-font-size-sm);color:var(--wg-text-color-3)}.wg__pagination--left{justify-content:flex-start}.wg__pagination--right{justify-content:flex-end}.wg__pagination--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__summary{display:flex;align-items:center;padding:var(--wg-pagination-padding);border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg);font-size:var(--wg-font-size-base);color:var(--wg-cell-color)}.wg__summary--left{justify-content:flex-start}.wg__summary--right{justify-content:flex-end}.wg__summary--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__footer{display:flex;align-items:center;justify-content:space-between;border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg)}.wg__footer--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__footer .wg__summary,.wg__footer .wg__pagination{border:none}.wg__footer .wg__summary{flex:0 0 auto}.wg__footer .wg__pagination{flex:0 0 auto;margin-left:auto}.wg__toolbar-container{position:fixed;z-index:var(--wg-z-toolbar, 1000)}.wg__toolbar{display:flex;flex-direction:column-reverse;gap:0;padding:0;background:var(--wg-toolbar-bg);border:var(--wg-toolbar-border);border-radius:var(--wg-toolbar-border-radius);box-shadow:var(--wg-toolbar-shadow)}.wg__toolbar-row{display:flex;gap:2px;align-items:center;height:calc(var(--wg-design-unit, 4) * 4px + 21px);padding:0 4px}.wg__toolbar-row+.wg__toolbar-row{border-top:1px solid var(--wg-toolbar-divider-color)}.wg__toolbar-divider{width:1px;height:16px;background:var(--wg-toolbar-divider-color);margin:0 4px;flex-shrink:0}.wg__toolbar-btn{min-width:var(--wg-toolbar-btn-min-width);height:100%;border:none;border-radius:var(--wg-toolbar-btn-border-radius);background:transparent;color:var(--wg-toolbar-btn-color);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:4px;font-size:var(--wg-font-size-base);font-weight:500;padding:var(--wg-toolbar-btn-padding);transition:background .1s ease}.wg__toolbar-btn:hover{background:var(--wg-toolbar-btn-bg-hover)}.wg__toolbar-btn:active{background:var(--wg-toolbar-btn-bg-active)}.wg__toolbar-btn:disabled{opacity:.5;cursor:not-allowed}.wg__toolbar-btn:disabled:hover{background:transparent}.wg__toolbar-btn--danger:hover{background:var(--wg-danger-bg-light);color:var(--wg-danger-color)}.wg__toolbar-label{font-size:12px;white-space:nowrap}.wg__actions-column{width:24px;min-width:24px;max-width:24px;padding:0!important;text-align:center}.wg__header .wg__actions-column{background:var(--wg-header-bg)}.wg__filter-row .wg__actions-column{background:var(--wg-filter-bg)}.wg__toolbar-trigger{position:relative;padding:0;background:transparent;border:none;border-radius:var(--wg-border-radius-sm);cursor:pointer;font-size:var(--wg-font-size-base);line-height:1;color:var(--wg-toolbar-trigger-color)}.wg__toolbar-trigger:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__toolbar-trigger:hover,.wg__toolbar-trigger--active{color:var(--wg-toolbar-trigger-color-hover);background:var(--wg-toolbar-trigger-bg-hover)}.wg--striped tbody tr:nth-child(2n){background:var(--wg-row-bg-even)}.wg--hoverable tbody tr:hover{background:var(--wg-row-bg-hover)}.wg__empty{text-align:center;padding:var(--wg-empty-padding);color:var(--wg-empty-color);font-style:italic}.wg__loading-more{text-align:center;padding:var(--wg-cell-padding);color:var(--wg-text-color-2);font-size:var(--wg-font-size-sm)}.wg__tooltip{position:fixed;z-index:var(--wg-z-tooltip, 10000);max-width:300px;padding:6px 10px;background:var(--wg-tooltip-bg, #333);color:var(--wg-tooltip-color, #fff);font-size:var(--wg-font-size-sm);line-height:1.4;border-radius:var(--wg-border-radius-sm);box-shadow:0 2px 8px #0003;pointer-events:none;opacity:0;transition:opacity var(--wg-transition-fast)}.wg__tooltip--visible{opacity:1}.wg__tooltip-arrow{position:absolute;width:8px;height:8px;background:var(--wg-tooltip-bg, #333);transform:rotate(45deg)}.wg__tooltip[data-placement^=top] .wg__tooltip-arrow{bottom:-4px}.wg__tooltip[data-placement^=bottom] .wg__tooltip-arrow{top:-4px}.wg__tooltip[data-placement^=left] .wg__tooltip-arrow{right:-4px}.wg__tooltip[data-placement^=right] .wg__tooltip-arrow{left:-4px}.wg__goto-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.wg__goto-dialog{background:var(--wg-surface-1);border-radius:var(--wg-border-radius);padding:var(--wg-spacing-lg);box-shadow:0 4px 20px #00000026;min-width:250px}.wg__goto-label{display:block;margin-bottom:var(--wg-spacing-sm);font-size:var(--wg-font-size-base);color:var(--wg-text-color-1)}.wg__goto-input{width:100%;padding:var(--wg-spacing-sm) var(--wg-spacing-md);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm);font-size:var(--wg-font-size-base);margin-bottom:var(--wg-spacing-md);box-sizing:border-box}.wg__goto-input:focus{outline:none;border-color:var(--wg-accent-color);box-shadow:0 0 0 2px #0078d433}.wg__goto-buttons{display:flex;gap:var(--wg-spacing-sm);justify-content:flex-end}.wg__goto-btn{padding:var(--wg-spacing-sm) var(--wg-spacing-md);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm);font-size:var(--wg-font-size-sm);cursor:pointer;background:var(--wg-surface-1);color:var(--wg-text-color-1)}.wg__goto-btn:hover{background:var(--wg-surface-2)}.wg__goto-btn--go{background:var(--wg-accent-color);border-color:var(--wg-accent-color);color:#fff}.wg__goto-btn--go:hover{background:var(--wg-accent-color-hover, #106ebe)}.wg__spacer-top td,.wg__spacer-bottom td{padding:0;border:none;background:transparent;height:inherit;line-height:0}@media (prefers-color-scheme: dark){:host{--wg-surface-1: #1f1f1f;--wg-surface-2: #2b2b2b;--wg-surface-3: #333333;--wg-surface-floating: #2b2b2b;--wg-text-color-1: #e0e0e0;--wg-text-color-2: #c0c0c0;--wg-text-color-3: #a0a0a0;--wg-border-color: #3d3d3d;--wg-border-color-hover: #5a5a5a;--wg-input-bg: #1f1f1f;--wg-input-border: 1px solid #5a5a5a;--wg-hover-bg: #3a3a3a;--wg-active-bg: #4a4a4a;--wg-danger-bg-light: #442726;--wg-danger-color: #f87c86}}:host([data-theme="dark"]),[data-theme=dark] :host,:host([data-bs-theme="dark"]),[data-bs-theme=dark] :host,.dark :host{--wg-surface-1: #1f1f1f;--wg-surface-2: #2b2b2b;--wg-surface-3: #333333;--wg-surface-floating: #2b2b2b;--wg-text-color-1: #e0e0e0;--wg-text-color-2: #c0c0c0;--wg-text-color-3: #a0a0a0;--wg-border-color: #3d3d3d;--wg-border-color-hover: #5a5a5a;--wg-input-bg: #1f1f1f;--wg-input-border: 1px solid #5a5a5a;--wg-hover-bg: #3a3a3a;--wg-active-bg: #4a4a4a;--wg-danger-bg-light: #442726;--wg-danger-color: #f87c86}';
793
+ const Be = ':host{--wg-rem: 10px;font-family:var(--wg-font-family, var(--base-font-family, inherit));display:block;--wg-accent-color: var(--base-accent-color, #0078d4);--wg-accent-color-hover: var(--base-accent-color-hover, #106ebe);--wg-accent-color-active: var(--base-accent-color-active, #005a9e);--wg-accent-color-light: var(--base-accent-color-light, #e6f2ff);--wg-text-color-1: var(--base-text-color-1, #242424);--wg-text-color-2: var(--base-text-color-2, #424242);--wg-text-color-3: var(--base-text-color-3, #707070);--wg-text-on-accent: var(--base-text-color-on-accent, #ffffff);--wg-surface-1: var(--base-main-bg, #ffffff);--wg-surface-2: var(--base-elevated-bg, #f5f5f5);--wg-surface-3: var(--base-hover-bg, #ebebeb);--wg-surface-floating: var(--base-dropdown-bg, var(--base-main-bg, #ffffff));--wg-border-color: var(--base-border-color, #e0e0e0);--wg-border-color-hover: var(--base-border-color, #d1d1d1);--wg-input-bg: var(--base-input-bg, #ffffff);--wg-input-color: var(--base-input-color, var(--wg-text-color-1));--wg-input-border: var(--base-input-border, 1px solid #d1d1d1);--wg-input-border-hover: var(--base-input-border-hover, 1px solid #0078d4);--wg-input-border-focus: var(--base-input-border-focus, 1px solid #0078d4);--wg-input-placeholder-color: var(--base-input-placeholder-color, #707070);--wg-danger-color: var(--base-danger-color, #d13438);--wg-danger-bg-light: var(--base-danger-bg-light, #fde7e9);--wg-hover-bg: var(--base-hover-bg, #f0f0f0);--wg-active-bg: var(--base-hover-bg, #e0e0e0);--wg-font-size-base: calc(var(--base-font-size-sm, 1.4) * var(--wg-rem));--wg-font-size-sm: calc(var(--base-font-size-xs, 1.2) * var(--wg-rem));--wg-font-size-xs: calc(var(--base-font-size-2xs, 1.1) * var(--wg-rem));--wg-font-size-lg: calc(var(--base-font-size-base, 1.6) * var(--wg-rem));--wg-line-height-base: var(--base-line-height-normal, 1.5);--wg-font-weight-normal: var(--base-font-weight-normal, 400);--wg-font-weight-semibold: var(--base-font-weight-semibold, 600);--wg-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--wg-rem));--wg-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--wg-rem));--wg-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--wg-rem));--wg-spacing-xs: calc(.4 * var(--wg-rem));--wg-spacing-sm: calc(.8 * var(--wg-rem));--wg-spacing-md: calc(1.2 * var(--wg-rem));--wg-spacing-lg: calc(1.6 * var(--wg-rem));--wg-spacing-xl: calc(2.4 * var(--wg-rem));--wg-table-bg: var(--wg-surface-1);--wg-table-border: 1px solid var(--wg-border-color);--wg-header-bg: var(--wg-surface-2);--wg-header-bg-hover: var(--wg-surface-3);--wg-header-bg-sorted: var(--wg-surface-3);--wg-header-color: var(--wg-text-color-1);--wg-header-border: 2px solid var(--wg-border-color);--wg-header-padding: var(--wg-spacing-sm) var(--wg-spacing-md);--wg-header-font-weight: var(--wg-font-weight-semibold);--wg-cell-padding: var(--wg-spacing-sm) var(--wg-spacing-md);--wg-cell-color: var(--wg-text-color-1);--wg-cell-border: 1px solid var(--wg-border-color);--wg-cell-bg-hover: var(--wg-hover-bg);--wg-cell-bg-editing: var(--wg-surface-1);--wg-cell-readonly-bg: var(--base-disabled-bg, var(--wg-surface-2));--wg-row-border: 1px solid var(--wg-border-color);--wg-row-bg-even: var(--wg-surface-2);--wg-row-bg-hover: var(--wg-surface-3);--wg-filter-bg: var(--wg-surface-1);--wg-filter-border: 1px solid var(--wg-border-color);--wg-filter-padding: var(--wg-spacing-xs) var(--wg-spacing-sm);--wg-filter-input-padding: calc(.4 * var(--wg-rem)) calc(.8 * var(--wg-rem));--wg-filter-input-bg: var(--wg-input-bg);--wg-filter-input-border: var(--wg-input-border);--wg-filter-input-border-focus: var(--wg-input-border-focus);--wg-filter-input-border-radius: var(--wg-border-radius-sm);--wg-filter-input-font-size: var(--wg-font-size-sm);--wg-sort-indicator-size: calc(1.4 * var(--wg-rem));--wg-sort-indicator-opacity: .9;--wg-sort-placeholder-opacity: .3;--wg-sort-priority-size: calc(1.1 * var(--wg-rem));--wg-pagination-padding: var(--wg-spacing-md);--wg-pagination-gap: calc(1.6 * var(--wg-rem));--wg-pagination-bg: var(--wg-surface-1);--wg-pagination-border: 1px solid var(--wg-border-color);--wg-pagination-btn-padding: calc(.6 * var(--wg-rem)) calc(1.6 * var(--wg-rem));--wg-pagination-btn-bg: var(--wg-surface-1);--wg-pagination-btn-bg-hover: var(--wg-surface-2);--wg-pagination-btn-bg-active: var(--wg-surface-3);--wg-pagination-btn-border: 1px solid var(--wg-border-color);--wg-pagination-btn-border-hover: 1px solid var(--wg-border-color-hover);--wg-pagination-btn-border-radius: var(--wg-border-radius-sm);--wg-pagination-btn-disabled-opacity: .4;--wg-empty-padding: var(--wg-spacing-xl);--wg-empty-color: var(--wg-text-color-3);--wg-error-cell-bg: var(--wg-danger-bg-light);--wg-error-cell-border: 1px solid var(--wg-danger-color);--wg-error-message-color: var(--wg-danger-color);--wg-error-message-font-size: var(--wg-font-size-xs);--wg-error-indicator-color: var(--wg-danger-color);--wg-editor-bg: var(--wg-surface-1);--wg-editor-outline: 2px solid var(--wg-accent-color);--wg-editor-outline-offset: -2px;--wg-editor-validating-opacity: .7;--wg-dropdown-toggle-right: var(--wg-spacing-md);--wg-dropdown-toggle-size: calc(1.2 * var(--wg-rem));--wg-dropdown-toggle-hitbox: calc(2.4 * var(--wg-rem));--wg-toolbar-bg: var(--wg-surface-floating);--wg-toolbar-border: 1px solid var(--wg-border-color);--wg-toolbar-border-radius: var(--wg-border-radius-sm);--wg-toolbar-shadow: var(--base-dropdown-box-shadow, 0 2px 8px rgba(0, 0, 0, .15));--wg-toolbar-divider-color: var(--wg-border-color);--wg-toolbar-btn-min-width: calc(2.4 * var(--wg-rem));--wg-toolbar-btn-padding: 0 calc(.4 * var(--wg-rem));--wg-toolbar-btn-border-radius: var(--wg-border-radius-sm);--wg-toolbar-btn-bg-hover: var(--wg-hover-bg);--wg-toolbar-btn-bg-active: var(--wg-active-bg);--wg-toolbar-btn-color: var(--wg-text-color-1);--wg-toolbar-trigger-color: var(--wg-text-color-3);--wg-toolbar-trigger-color-hover: var(--wg-text-color-1);--wg-toolbar-trigger-bg-hover: var(--wg-hover-bg);--wg-tooltip-bg: var(--base-tooltip-bg, #333);--wg-context-menu-z-index: 1001;--wg-context-menu-min-width: calc(16 * var(--wg-rem));--wg-focus-outline: 2px solid var(--wg-accent-color);--wg-focus-outline-offset: -2px;--wg-focus-bg: var(--wg-hover-bg);--wg-transition-fast: .1s ease;--wg-transition-normal: .15s ease;--wg-z-dropdown: 9999;--wg-z-toolbar: 1000;--wg-z-context-menu: 1001}web-grid:not(:defined){display:block;min-height:calc(10 * var(--wg-rem));color:transparent!important;background:transparent}.wg{position:relative;width:100%;max-height:inherit;overflow:auto;overscroll-behavior:contain;border:var(--wg-table-border)}.wg__table{width:max-content;min-width:100%;border-collapse:collapse;table-layout:fixed;background:var(--wg-table-bg);font-size:var(--wg-font-size-base);line-height:var(--wg-line-height-base)}.wg__table tbody tr{border-bottom:var(--wg-row-border)}.wg__row-number-header,.wg__row-number{width:40px;min-width:40px;max-width:40px;text-align:center;color:var(--wg-text-color-secondary);background:var(--wg-header-bg);-webkit-user-select:none;user-select:none;font-size:var(--wg-font-size-sm)}.wg__row-number{border-right:var(--wg-cell-border)}.wg__actions-column{width:32px;min-width:32px;max-width:32px;padding:0!important;text-align:center}thead .wg__actions-column{background:var(--wg-header-bg);border-bottom:var(--wg-header-border)}.wg__filter-row .wg__actions-column{background:var(--wg-filter-bg);border-bottom:var(--wg-filter-border)}.wg__header{position:sticky;top:0;z-index:1;background:var(--wg-header-bg);color:var(--wg-header-color);font-weight:var(--wg-header-font-weight);padding:var(--wg-header-padding);border-bottom:var(--wg-header-border);text-align:left;-webkit-user-select:none;user-select:none}.wg__header--sortable{cursor:pointer}.wg__header--sortable:hover{background:var(--wg-header-bg-hover)}.wg__header--sorted{background:var(--wg-header-bg-sorted)}.wg__header-content{display:flex;align-items:center;gap:4px;justify-content:space-between}.wg__header-title{flex:1}.wg__sort-indicator{font-size:var(--wg-sort-indicator-size);opacity:var(--wg-sort-indicator-opacity);min-width:16px;text-align:center;display:inline-flex;align-items:center}.wg__sort-placeholder{opacity:var(--wg-sort-placeholder-opacity)}.wg__sort-priority{font-size:var(--wg-sort-priority-size);font-weight:600;margin-left:2px;vertical-align:super;line-height:1}.wg__header-info{display:inline-flex;align-items:center;color:var(--wg-accent-color);cursor:help;opacity:.7;margin-left:4px;vertical-align:middle}.wg__header-info:hover{opacity:1}.wg__filter-row th{padding:var(--wg-filter-padding);background:var(--wg-filter-bg);border-bottom:var(--wg-filter-border)}.wg__filter-input{width:100%;padding:var(--wg-filter-input-padding);border:var(--wg-filter-input-border);border-radius:var(--wg-filter-input-border-radius);background:var(--wg-surface-1);color:var(--wg-text-color-1);font-family:inherit;font-size:var(--wg-filter-input-font-size);box-sizing:border-box}.wg__filter-input:focus{outline:none;border:var(--wg-filter-input-border-focus);box-shadow:0 0 0 1px var(--wg-accent-color)}.wg__cell{padding:var(--wg-cell-padding);color:var(--wg-cell-color);scroll-margin-top:3rem;scroll-margin-bottom:.5rem}.wg__cell-text{-webkit-user-select:none;user-select:none}.wg__cell--ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wg__cell--editable{cursor:pointer;position:relative}.wg__cell--editable:hover{background:var(--wg-cell-bg-hover)}.wg__cell--editable:hover:after{content:"";position:absolute;top:2px;right:2px;bottom:2px;left:2px;border:1px dashed var(--wg-border-color);border-radius:2px;pointer-events:none}.wg__cell--editing{position:relative;background:var(--wg-surface-1);outline:2px solid var(--wg-accent-color);outline-offset:-2px}.wg__cell--editing:after{display:none}.wg__cell--invalid{background:var(--wg-danger-bg-light, #fee);box-shadow:inset 0 0 0 2px var(--wg-danger-color, #c00)}.wg--navigate-mode .wg__cell:not(.wg__cell--editable){background:var(--wg-cell-readonly-bg, #f5f5f5)}.wg__editor{position:absolute;top:0;left:0;right:0;width:100%;padding:var(--wg-cell-padding);border:none;background:transparent;color:var(--wg-text-color-1);font-size:var(--wg-font-size-base);font-family:inherit;line-height:inherit;box-sizing:border-box}.wg__editor:focus,.wg__editor:focus-visible{outline:none;box-shadow:none}.wg__editor--text{text-align:inherit}.wg__editor--number{text-align:right}.wg__editor--date{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:var(--wg-editor-bg)}.wg__date-input{flex:1;min-width:0;height:100%;border:none;background:transparent;font:inherit;padding:var(--wg-cell-padding-block) var(--wg-cell-padding-inline);outline:none;color:inherit}.wg__date-trigger{width:var(--wg-date-trigger-size, 28px);height:100%;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--wg-text-secondary, #666);cursor:pointer;padding:0;flex-shrink:0}.wg__date-trigger:hover{color:var(--wg-accent-color, #0078d4);background:var(--wg-hover-bg, rgba(0, 0, 0, .05))}.wg__editor--checkbox{width:auto;height:auto;margin:0 auto}.wg__editor--custom{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:var(--wg-editor-bg);padding:var(--wg-cell-padding-block) var(--wg-cell-padding-inline);cursor:pointer}.wg__editor--custom:focus{outline:none}.wg__custom-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;cursor:pointer}.wg__editor--combobox,.wg__editor--autocomplete{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;padding:var(--wg-cell-padding);padding-right:0;background:transparent;box-sizing:border-box}.wg__combobox-input,.wg__autocomplete-input{flex:1;width:100%;height:100%;padding:0 24px 0 0;border:none;background:transparent;color:var(--wg-text-color-1);font-size:var(--wg-font-size-base);font-family:inherit;line-height:var(--wg-line-height-base);outline:none;box-sizing:border-box;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wg__combobox-input:focus,.wg__autocomplete-input:focus{outline:none}.wg__combobox-toggle{position:absolute;right:var(--wg-dropdown-toggle-right);top:50%;transform:translateY(-50%);font-size:var(--wg-dropdown-toggle-size);color:var(--wg-text-color-2);pointer-events:auto;cursor:pointer}.wg__combobox-toggle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__loading-indicator{position:absolute;right:var(--wg-dropdown-toggle-right);top:50%;transform:translateY(-50%);font-size:12px;animation:wg-pulse 1s infinite}@keyframes wg-pulse{0%,to{opacity:1}50%{opacity:.4}}.wg__select-trigger{display:flex;align-items:center;justify-content:space-between;cursor:pointer;background:transparent}.wg__select-trigger:focus,.wg__select-trigger:focus-visible{outline:none;box-shadow:none}.wg__select-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wg__select-toggle{position:relative;font-size:var(--wg-dropdown-toggle-size);opacity:.6;margin-left:4px;flex-shrink:0;pointer-events:auto;cursor:pointer}.wg__select-toggle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__cell-dropdown-display{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}.wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle{opacity:0}.wg__cell:hover .wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle,.wg__cell--focused .wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle{opacity:.6}.wg__cell-date-display{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}.wg__cell-date-display .wg__date-trigger{position:relative;background:none;border:none;padding:0;margin:0;cursor:pointer;opacity:.6;display:flex;align-items:center;justify-content:center;color:inherit}.wg__cell-date-display .wg__date-trigger:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__cell-date-display--toggle-on-focus .wg__date-trigger{opacity:0}.wg__cell:hover .wg__cell-date-display--toggle-on-focus .wg__date-trigger,.wg__cell--focused .wg__cell-date-display--toggle-on-focus .wg__date-trigger{opacity:.6}.wg__dropdown{background:var(--wg-surface-floating, #fff);border:1px solid var(--wg-border-color, #d1d1d1);border-radius:4px;box-shadow:var(--wg-toolbar-shadow);max-height:200px;overflow-y:auto;font-size:var(--wg-font-size-base);font-family:inherit;line-height:var(--wg-line-height-base)}.wg__dropdown-option{display:flex;align-items:center;gap:var(--wg-spacing-sm);padding:6px 12px;cursor:pointer;color:var(--wg-text-color-1)}.wg__dropdown-option:hover,.wg__dropdown-option--highlighted{background:var(--wg-hover-bg, #f0f0f0)}.wg__dropdown-option--selected{background:var(--wg-accent-color-light, #e6f2ff)}.wg__dropdown-option--disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.wg__dropdown-option-icon{flex-shrink:0;width:1.5em;text-align:center}.wg__dropdown-option-content{flex:1;min-width:0;overflow:hidden}.wg__dropdown-option-label{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wg__dropdown-option-subtitle{display:block;font-size:var(--wg-font-size-sm);color:var(--wg-text-color-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wg__dropdown-empty{padding:8px 12px;color:var(--wg-text-color-2);font-style:italic;text-align:center}.wg--navigate-mode .wg__cell{cursor:cell}.wg--navigate-mode .wg__cell:focus{outline:none}.wg--navigate-mode .wg__cell.wg__cell--focused{outline:2px solid var(--wg-focus-border-color, #217346);outline-offset:-2px}.wg__cell--focused:after{display:none}.wg__pagination{display:flex;align-items:center;justify-content:center;gap:var(--wg-pagination-gap);padding:var(--wg-pagination-padding);border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg)}.wg__pagination-btn{padding:var(--wg-pagination-btn-padding);background:var(--wg-pagination-btn-bg);border:var(--wg-pagination-btn-border);border-radius:var(--wg-pagination-btn-border-radius);color:var(--wg-cell-color);font-family:inherit;font-size:var(--wg-font-size-base);cursor:pointer;transition:all var(--wg-transition-fast)}.wg__pagination-btn:hover:not(:disabled){background:var(--wg-pagination-btn-bg-hover);border:var(--wg-pagination-btn-border-hover)}.wg__pagination-btn:active:not(:disabled){background:var(--wg-pagination-btn-bg-active)}.wg__pagination-btn:disabled{opacity:var(--wg-pagination-btn-disabled-opacity);cursor:not-allowed}.wg__pagination-info{font-size:var(--wg-font-size-base);color:var(--wg-cell-color)}.wg__pagination-count{font-size:var(--wg-font-size-sm);color:var(--wg-text-color-3);margin-left:4px}.wg__pagination-pagesize{display:flex;align-items:center;gap:6px}.wg__pagination-select{padding:4px 8px;background:var(--wg-pagination-btn-bg);border:var(--wg-pagination-btn-border);border-radius:var(--wg-pagination-btn-border-radius);color:var(--wg-cell-color);font-family:inherit;font-size:var(--wg-font-size-base);cursor:pointer}.wg__pagination-select:hover{background:var(--wg-pagination-btn-bg-hover);border:var(--wg-pagination-btn-border-hover)}.wg__pagination-select:focus{outline:2px solid var(--wg-accent-color);outline-offset:-2px}.wg__pagination-label{font-size:var(--wg-font-size-sm);color:var(--wg-text-color-3)}.wg__pagination--left{justify-content:flex-start}.wg__pagination--right{justify-content:flex-end}.wg__pagination--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__summary{display:flex;align-items:center;padding:var(--wg-pagination-padding);border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg);font-size:var(--wg-font-size-base);color:var(--wg-cell-color)}.wg__summary--left{justify-content:flex-start}.wg__summary--right{justify-content:flex-end}.wg__summary--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__footer{display:flex;align-items:center;justify-content:space-between;border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg)}.wg__footer--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__footer .wg__summary,.wg__footer .wg__pagination{border:none}.wg__footer .wg__summary{flex:0 0 auto}.wg__footer .wg__pagination{flex:0 0 auto;margin-left:auto}.wg__toolbar-container{position:fixed;z-index:var(--wg-z-toolbar, 1000)}.wg__toolbar{display:flex;flex-direction:column-reverse;gap:0;padding:0;background:var(--wg-toolbar-bg);border:var(--wg-toolbar-border);border-radius:var(--wg-toolbar-border-radius);box-shadow:var(--wg-toolbar-shadow)}.wg__toolbar-row{display:flex;gap:2px;align-items:center;height:calc(var(--wg-design-unit, 4) * 4px + 21px);padding:0 4px}.wg__toolbar-row+.wg__toolbar-row{border-top:1px solid var(--wg-toolbar-divider-color)}.wg__toolbar-divider{width:1px;height:16px;background:var(--wg-toolbar-divider-color);margin:0 4px;flex-shrink:0}.wg__toolbar-btn{min-width:var(--wg-toolbar-btn-min-width);height:100%;border:none;border-radius:var(--wg-toolbar-btn-border-radius);background:transparent;color:var(--wg-toolbar-btn-color);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:4px;font-family:inherit;font-size:var(--wg-font-size-base);font-weight:500;padding:var(--wg-toolbar-btn-padding);transition:background .1s ease}.wg__toolbar-btn:hover{background:var(--wg-toolbar-btn-bg-hover)}.wg__toolbar-btn:active{background:var(--wg-toolbar-btn-bg-active)}.wg__toolbar-btn:disabled{opacity:.5;cursor:not-allowed}.wg__toolbar-btn:disabled:hover{background:transparent}.wg__toolbar-btn--danger:hover{background:var(--wg-danger-bg-light);color:var(--wg-danger-color)}.wg__toolbar-label{font-size:12px;white-space:nowrap}.wg__actions-column{width:24px;min-width:24px;max-width:24px;padding:0!important;text-align:center}.wg__header .wg__actions-column{background:var(--wg-header-bg)}.wg__filter-row .wg__actions-column{background:var(--wg-filter-bg)}.wg__toolbar-trigger{position:relative;padding:0;background:transparent;border:none;border-radius:var(--wg-border-radius-sm);cursor:pointer;font-size:var(--wg-font-size-base);line-height:1;color:var(--wg-toolbar-trigger-color)}.wg__toolbar-trigger:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__toolbar-trigger:hover,.wg__toolbar-trigger--active{color:var(--wg-toolbar-trigger-color-hover);background:var(--wg-toolbar-trigger-bg-hover)}.wg__shortcuts-help{position:absolute;top:var(--wg-spacing-xs);right:var(--wg-spacing-sm);z-index:5}.wg__shortcuts-help--left{right:auto;left:var(--wg-spacing-sm)}.wg__shortcuts-help-icon{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:50%;background:var(--wg-layer-01);color:var(--wg-text-color-2);cursor:pointer;opacity:.7}.wg__shortcuts-help-icon:hover{opacity:1;background:var(--wg-layer-02)}.wg__shortcuts-help-icon svg{width:16px;height:16px}.wg__shortcuts-help-overlay{display:none;position:absolute;top:100%;right:0;margin-top:var(--wg-spacing-xs);padding:var(--wg-spacing-md);background:var(--wg-layer-01);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-md);box-shadow:0 4px 16px #00000026;min-width:200px;max-width:300px;z-index:100}.wg__shortcuts-help--left .wg__shortcuts-help-overlay{right:auto;left:0}.wg__shortcuts-help:hover .wg__shortcuts-help-overlay,.wg__shortcuts-help:focus-within .wg__shortcuts-help-overlay{display:block}.wg__shortcuts-help-title{font-weight:var(--wg-font-weight-semibold);font-size:var(--wg-font-size-base);color:var(--wg-text-color-1);margin-bottom:var(--wg-spacing-sm);padding-bottom:var(--wg-spacing-xs);border-bottom:1px solid var(--wg-border-color)}.wg__shortcuts-help-custom{margin-bottom:var(--wg-spacing-sm);padding-bottom:var(--wg-spacing-sm);border-bottom:1px solid var(--wg-border-color);font-size:var(--wg-font-size-sm);color:var(--wg-text-color-2)}.wg__shortcuts-help-list{display:flex;flex-direction:column;gap:var(--wg-spacing-xs)}.wg__shortcuts-help-item{display:flex;align-items:center;gap:var(--wg-spacing-md)}.wg__shortcuts-help-key{display:inline-flex;align-items:center;justify-content:center;min-width:28px;padding:2px 6px;font-family:var(--wg-font-family-mono, ui-monospace, monospace);font-size:var(--wg-font-size-xs);font-weight:var(--wg-font-weight-medium);color:var(--wg-text-color-1);background:var(--wg-layer-02);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm)}.wg__shortcuts-help-label{flex:1;font-size:var(--wg-font-size-sm);color:var(--wg-text-color-2)}.wg--striped tbody tr:nth-child(2n){background:var(--wg-row-bg-even)}.wg--hoverable tbody tr:hover{background:var(--wg-row-bg-hover)}.wg__empty{text-align:center;padding:var(--wg-empty-padding);color:var(--wg-empty-color);font-style:italic}.wg__loading-more{text-align:center;padding:var(--wg-cell-padding);color:var(--wg-text-color-2);font-size:var(--wg-font-size-sm)}.wg__tooltip{position:fixed;z-index:var(--wg-z-tooltip, 10000);max-width:300px;padding:6px 10px;background:var(--wg-tooltip-bg, #333);color:var(--wg-tooltip-color, #fff);font-size:var(--wg-font-size-sm);line-height:1.4;border-radius:var(--wg-border-radius-sm);box-shadow:0 2px 8px #0003;pointer-events:none;opacity:0;transition:opacity var(--wg-transition-fast)}.wg__tooltip--visible{opacity:1}.wg__tooltip-arrow{position:absolute;width:8px;height:8px;background:var(--wg-tooltip-bg, #333);transform:rotate(45deg)}.wg__tooltip[data-placement^=top] .wg__tooltip-arrow{bottom:-4px}.wg__tooltip[data-placement^=bottom] .wg__tooltip-arrow{top:-4px}.wg__tooltip[data-placement^=left] .wg__tooltip-arrow{right:-4px}.wg__tooltip[data-placement^=right] .wg__tooltip-arrow{left:-4px}.wg__goto-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.wg__goto-dialog{background:var(--wg-surface-1);border-radius:var(--wg-border-radius);padding:var(--wg-spacing-lg);box-shadow:0 4px 20px #00000026;min-width:250px}.wg__goto-label{display:block;margin-bottom:var(--wg-spacing-sm);font-size:var(--wg-font-size-base);color:var(--wg-text-color-1)}.wg__goto-input{width:100%;padding:var(--wg-spacing-sm) var(--wg-spacing-md);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm);font-family:inherit;font-size:var(--wg-font-size-base);margin-bottom:var(--wg-spacing-md);box-sizing:border-box}.wg__goto-input:focus{outline:none;border-color:var(--wg-accent-color);box-shadow:0 0 0 2px #0078d433}.wg__goto-buttons{display:flex;gap:var(--wg-spacing-sm);justify-content:flex-end}.wg__goto-btn{padding:var(--wg-spacing-sm) var(--wg-spacing-md);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm);font-family:inherit;font-size:var(--wg-font-size-sm);cursor:pointer;background:var(--wg-surface-1);color:var(--wg-text-color-1)}.wg__goto-btn:hover{background:var(--wg-surface-2)}.wg__goto-btn--go{background:var(--wg-accent-color);border-color:var(--wg-accent-color);color:#fff}.wg__goto-btn--go:hover{background:var(--wg-accent-color-hover, #106ebe)}.wg__spacer-top td,.wg__spacer-bottom td{padding:0;border:none;background:transparent;height:inherit;line-height:0}@media (prefers-color-scheme: dark){:host{--wg-surface-1: #1f1f1f;--wg-surface-2: #2b2b2b;--wg-surface-3: #333333;--wg-surface-floating: #2b2b2b;--wg-text-color-1: #e0e0e0;--wg-text-color-2: #c0c0c0;--wg-text-color-3: #a0a0a0;--wg-border-color: #3d3d3d;--wg-border-color-hover: #5a5a5a;--wg-input-bg: #1f1f1f;--wg-input-border: 1px solid #5a5a5a;--wg-hover-bg: #3a3a3a;--wg-active-bg: #4a4a4a;--wg-danger-bg-light: #442726;--wg-danger-color: #f87c86}}:host([data-theme="dark"]),[data-theme=dark] :host,:host([data-bs-theme="dark"]),[data-bs-theme=dark] :host,.dark :host{--wg-surface-1: #1f1f1f;--wg-surface-2: #2b2b2b;--wg-surface-3: #333333;--wg-surface-floating: #2b2b2b;--wg-text-color-1: #e0e0e0;--wg-text-color-2: #c0c0c0;--wg-text-color-3: #a0a0a0;--wg-border-color: #3d3d3d;--wg-border-color-hover: #5a5a5a;--wg-input-bg: #1f1f1f;--wg-input-border: 1px solid #5a5a5a;--wg-hover-bg: #3a3a3a;--wg-active-bg: #4a4a4a;--wg-danger-bg-light: #442726;--wg-danger-color: #f87c86}';
745
794
  function Jt(t, e, o) {
746
795
  const i = o.valueMember || "value", r = o.displayMember || "label", s = e.find((n) => n[i] === t);
747
796
  return s ? String(s[r] ?? "") : t != null ? String(t) : "";
748
797
  }
749
- function yt(t, e) {
798
+ function Ct(t, e) {
750
799
  if (e.getDisplayCallback) return e.getDisplayCallback(t);
751
800
  const o = e.displayMember || "label";
752
801
  return String(t[o] ?? t.label ?? "");
@@ -756,87 +805,87 @@ function at(t, e) {
756
805
  const o = e.valueMember || "value";
757
806
  return t[o] ?? t.value;
758
807
  }
759
- function Be(t, e) {
808
+ function Ke(t, e) {
760
809
  return e.getIconCallback ? e.getIconCallback(t) : e.iconMember && t[e.iconMember] || null;
761
810
  }
762
- function Ke(t, e) {
811
+ function We(t, e) {
763
812
  return e.getSubtitleCallback ? e.getSubtitleCallback(t) : e.subtitleMember && t[e.subtitleMember] || null;
764
813
  }
765
- function mt(t, e) {
814
+ function bt(t, e) {
766
815
  return e.getDisabledCallback ? e.getDisabledCallback(t) : e.disabledMember ? !!t[e.disabledMember] : !1;
767
816
  }
768
- const it = Math.min, q = Math.max, xt = Math.round, St = Math.floor, G = (t) => ({
817
+ const it = Math.min, N = Math.max, Tt = Math.round, Dt = Math.floor, G = (t) => ({
769
818
  x: t,
770
819
  y: t
771
- }), We = {
820
+ }), Xe = {
772
821
  left: "right",
773
822
  right: "left",
774
823
  bottom: "top",
775
824
  top: "bottom"
776
- }, Xe = {
825
+ }, Qe = {
777
826
  start: "end",
778
827
  end: "start"
779
828
  };
780
829
  function Ut(t, e, o) {
781
- return q(t, it(e, o));
830
+ return N(t, it(e, o));
782
831
  }
783
- function pt(t, e) {
832
+ function ft(t, e) {
784
833
  return typeof t == "function" ? t(e) : t;
785
834
  }
786
835
  function rt(t) {
787
836
  return t.split("-")[0];
788
837
  }
789
- function ft(t) {
838
+ function wt(t) {
790
839
  return t.split("-")[1];
791
840
  }
792
- function Se(t) {
841
+ function ke(t) {
793
842
  return t === "x" ? "y" : "x";
794
843
  }
795
844
  function Zt(t) {
796
845
  return t === "y" ? "height" : "width";
797
846
  }
798
- const Qe = /* @__PURE__ */ new Set(["top", "bottom"]);
847
+ const Ge = /* @__PURE__ */ new Set(["top", "bottom"]);
799
848
  function tt(t) {
800
- return Qe.has(rt(t)) ? "y" : "x";
849
+ return Ge.has(rt(t)) ? "y" : "x";
801
850
  }
802
851
  function te(t) {
803
- return Se(tt(t));
852
+ return ke(tt(t));
804
853
  }
805
- function Ge(t, e, o) {
854
+ function Je(t, e, o) {
806
855
  o === void 0 && (o = !1);
807
- const i = ft(t), r = te(t), s = Zt(r);
856
+ const i = wt(t), r = te(t), s = Zt(r);
808
857
  let n = r === "x" ? i === (o ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
809
- return e.reference[s] > e.floating[s] && (n = kt(n)), [n, kt(n)];
858
+ return e.reference[s] > e.floating[s] && (n = Et(n)), [n, Et(n)];
810
859
  }
811
- function Je(t) {
812
- const e = kt(t);
860
+ function Ze(t) {
861
+ const e = Et(t);
813
862
  return [jt(t), e, jt(e)];
814
863
  }
815
864
  function jt(t) {
816
- return t.replace(/start|end/g, (e) => Xe[e]);
865
+ return t.replace(/start|end/g, (e) => Qe[e]);
817
866
  }
818
- const ae = ["left", "right"], le = ["right", "left"], Ze = ["top", "bottom"], to = ["bottom", "top"];
819
- function eo(t, e, o) {
867
+ const le = ["left", "right"], de = ["right", "left"], to = ["top", "bottom"], eo = ["bottom", "top"];
868
+ function oo(t, e, o) {
820
869
  switch (t) {
821
870
  case "top":
822
871
  case "bottom":
823
- return o ? e ? le : ae : e ? ae : le;
872
+ return o ? e ? de : le : e ? le : de;
824
873
  case "left":
825
874
  case "right":
826
- return e ? Ze : to;
875
+ return e ? to : eo;
827
876
  default:
828
877
  return [];
829
878
  }
830
879
  }
831
- function oo(t, e, o, i) {
832
- const r = ft(t);
833
- let s = eo(rt(t), o === "start", i);
880
+ function io(t, e, o, i) {
881
+ const r = wt(t);
882
+ let s = oo(rt(t), o === "start", i);
834
883
  return r && (s = s.map((n) => n + "-" + r), e && (s = s.concat(s.map(jt)))), s;
835
884
  }
836
- function kt(t) {
837
- return t.replace(/left|right|bottom|top/g, (e) => We[e]);
885
+ function Et(t) {
886
+ return t.replace(/left|right|bottom|top/g, (e) => Xe[e]);
838
887
  }
839
- function io(t) {
888
+ function ro(t) {
840
889
  return {
841
890
  top: 0,
842
891
  right: 0,
@@ -845,15 +894,15 @@ function io(t) {
845
894
  ...t
846
895
  };
847
896
  }
848
- function xe(t) {
849
- return typeof t != "number" ? io(t) : {
897
+ function De(t) {
898
+ return typeof t != "number" ? ro(t) : {
850
899
  top: t,
851
900
  right: t,
852
901
  bottom: t,
853
902
  left: t
854
903
  };
855
904
  }
856
- function Dt(t) {
905
+ function $t(t) {
857
906
  const {
858
907
  x: e,
859
908
  y: o,
@@ -871,36 +920,36 @@ function Dt(t) {
871
920
  y: o
872
921
  };
873
922
  }
874
- function de(t, e, o) {
923
+ function ce(t, e, o) {
875
924
  let {
876
925
  reference: i,
877
926
  floating: r
878
927
  } = t;
879
- const s = tt(e), n = te(e), d = Zt(n), a = rt(e), c = s === "y", l = i.x + i.width / 2 - r.width / 2, g = i.y + i.height / 2 - r.height / 2, h = i[d] / 2 - r[d] / 2;
928
+ const s = tt(e), n = te(e), d = Zt(n), a = rt(e), c = s === "y", g = i.x + i.width / 2 - r.width / 2, l = i.y + i.height / 2 - r.height / 2, h = i[d] / 2 - r[d] / 2;
880
929
  let u;
881
930
  switch (a) {
882
931
  case "top":
883
932
  u = {
884
- x: l,
933
+ x: g,
885
934
  y: i.y - r.height
886
935
  };
887
936
  break;
888
937
  case "bottom":
889
938
  u = {
890
- x: l,
939
+ x: g,
891
940
  y: i.y + i.height
892
941
  };
893
942
  break;
894
943
  case "right":
895
944
  u = {
896
945
  x: i.x + i.width,
897
- y: g
946
+ y: l
898
947
  };
899
948
  break;
900
949
  case "left":
901
950
  u = {
902
951
  x: i.x - r.width,
903
- y: g
952
+ y: l
904
953
  };
905
954
  break;
906
955
  default:
@@ -909,7 +958,7 @@ function de(t, e, o) {
909
958
  y: i.y
910
959
  };
911
960
  }
912
- switch (ft(e)) {
961
+ switch (wt(e)) {
913
962
  case "start":
914
963
  u[n] -= h * (o && c ? -1 : 1);
915
964
  break;
@@ -919,7 +968,7 @@ function de(t, e, o) {
919
968
  }
920
969
  return u;
921
970
  }
922
- const ro = async (t, e, o) => {
971
+ const no = async (t, e, o) => {
923
972
  const {
924
973
  placement: i = "bottom",
925
974
  strategy: r = "absolute",
@@ -931,21 +980,21 @@ const ro = async (t, e, o) => {
931
980
  floating: e,
932
981
  strategy: r
933
982
  }), {
934
- x: l,
935
- y: g
936
- } = de(c, i, a), h = i, u = {}, p = 0;
983
+ x: g,
984
+ y: l
985
+ } = ce(c, i, a), h = i, u = {}, p = 0;
937
986
  for (let m = 0; m < d.length; m++) {
938
987
  const {
939
- name: f,
940
- fn: v
988
+ name: b,
989
+ fn: f
941
990
  } = d[m], {
942
- x: b,
943
- y: _,
991
+ x: _,
992
+ y: v,
944
993
  data: S,
945
- reset: y
946
- } = await v({
947
- x: l,
948
- y: g,
994
+ reset: C
995
+ } = await f({
996
+ x: g,
997
+ y: l,
949
998
  initialPlacement: i,
950
999
  placement: h,
951
1000
  strategy: r,
@@ -957,24 +1006,24 @@ const ro = async (t, e, o) => {
957
1006
  floating: e
958
1007
  }
959
1008
  });
960
- l = b ?? l, g = _ ?? g, u = {
1009
+ g = _ ?? g, l = v ?? l, u = {
961
1010
  ...u,
962
- [f]: {
963
- ...u[f],
1011
+ [b]: {
1012
+ ...u[b],
964
1013
  ...S
965
1014
  }
966
- }, y && p <= 50 && (p++, typeof y == "object" && (y.placement && (h = y.placement), y.rects && (c = y.rects === !0 ? await n.getElementRects({
1015
+ }, C && p <= 50 && (p++, typeof C == "object" && (C.placement && (h = C.placement), C.rects && (c = C.rects === !0 ? await n.getElementRects({
967
1016
  reference: t,
968
1017
  floating: e,
969
1018
  strategy: r
970
- }) : y.rects), {
971
- x: l,
972
- y: g
973
- } = de(c, h, a)), m = -1);
1019
+ }) : C.rects), {
1020
+ x: g,
1021
+ y: l
1022
+ } = ce(c, h, a)), m = -1);
974
1023
  }
975
1024
  return {
976
- x: l,
977
- y: g,
1025
+ x: g,
1026
+ y: l,
978
1027
  placement: h,
979
1028
  strategy: r,
980
1029
  middlewareData: u
@@ -992,40 +1041,40 @@ async function ee(t, e) {
992
1041
  strategy: a
993
1042
  } = t, {
994
1043
  boundary: c = "clippingAncestors",
995
- rootBoundary: l = "viewport",
996
- elementContext: g = "floating",
1044
+ rootBoundary: g = "viewport",
1045
+ elementContext: l = "floating",
997
1046
  altBoundary: h = !1,
998
1047
  padding: u = 0
999
- } = pt(e, t), p = xe(u), f = d[h ? g === "floating" ? "reference" : "floating" : g], v = Dt(await s.getClippingRect({
1000
- element: (o = await (s.isElement == null ? void 0 : s.isElement(f))) == null || o ? f : f.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(d.floating)),
1048
+ } = ft(e, t), p = De(u), b = d[h ? l === "floating" ? "reference" : "floating" : l], f = $t(await s.getClippingRect({
1049
+ element: (o = await (s.isElement == null ? void 0 : s.isElement(b))) == null || o ? b : b.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(d.floating)),
1001
1050
  boundary: c,
1002
- rootBoundary: l,
1051
+ rootBoundary: g,
1003
1052
  strategy: a
1004
- })), b = g === "floating" ? {
1053
+ })), _ = l === "floating" ? {
1005
1054
  x: i,
1006
1055
  y: r,
1007
1056
  width: n.floating.width,
1008
1057
  height: n.floating.height
1009
- } : n.reference, _ = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(d.floating)), S = await (s.isElement == null ? void 0 : s.isElement(_)) ? await (s.getScale == null ? void 0 : s.getScale(_)) || {
1058
+ } : n.reference, v = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(d.floating)), S = await (s.isElement == null ? void 0 : s.isElement(v)) ? await (s.getScale == null ? void 0 : s.getScale(v)) || {
1010
1059
  x: 1,
1011
1060
  y: 1
1012
1061
  } : {
1013
1062
  x: 1,
1014
1063
  y: 1
1015
- }, y = Dt(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
1064
+ }, C = $t(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
1016
1065
  elements: d,
1017
- rect: b,
1018
- offsetParent: _,
1066
+ rect: _,
1067
+ offsetParent: v,
1019
1068
  strategy: a
1020
- }) : b);
1069
+ }) : _);
1021
1070
  return {
1022
- top: (v.top - y.top + p.top) / S.y,
1023
- bottom: (y.bottom - v.bottom + p.bottom) / S.y,
1024
- left: (v.left - y.left + p.left) / S.x,
1025
- right: (y.right - v.right + p.right) / S.x
1071
+ top: (f.top - C.top + p.top) / S.y,
1072
+ bottom: (C.bottom - f.bottom + p.bottom) / S.y,
1073
+ left: (f.left - C.left + p.left) / S.x,
1074
+ right: (C.right - f.right + p.right) / S.x
1026
1075
  };
1027
1076
  }
1028
- const no = (t) => ({
1077
+ const so = (t) => ({
1029
1078
  name: "arrow",
1030
1079
  options: t,
1031
1080
  async fn(e) {
@@ -1039,30 +1088,30 @@ const no = (t) => ({
1039
1088
  middlewareData: a
1040
1089
  } = e, {
1041
1090
  element: c,
1042
- padding: l = 0
1043
- } = pt(t, e) || {};
1091
+ padding: g = 0
1092
+ } = ft(t, e) || {};
1044
1093
  if (c == null)
1045
1094
  return {};
1046
- const g = xe(l), h = {
1095
+ const l = De(g), h = {
1047
1096
  x: o,
1048
1097
  y: i
1049
- }, u = te(r), p = Zt(u), m = await n.getDimensions(c), f = u === "y", v = f ? "top" : "left", b = f ? "bottom" : "right", _ = f ? "clientHeight" : "clientWidth", S = s.reference[p] + s.reference[u] - h[u] - s.floating[p], y = h[u] - s.reference[u], D = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(c));
1050
- let x = D ? D[_] : 0;
1051
- (!x || !await (n.isElement == null ? void 0 : n.isElement(D))) && (x = d.floating[_] || s.floating[p]);
1052
- const C = S / 2 - y / 2, T = x / 2 - m[p] / 2 - 1, k = it(g[v], T), I = it(g[b], T), M = k, Q = x - m[p] - I, A = x / 2 - m[p] / 2 + C, O = Ut(M, A, Q), U = !a.arrow && ft(r) != null && A !== O && s.reference[p] / 2 - (A < M ? k : I) - m[p] / 2 < 0, P = U ? A < M ? A - M : A - Q : 0;
1098
+ }, u = te(r), p = Zt(u), m = await n.getDimensions(c), b = u === "y", f = b ? "top" : "left", _ = b ? "bottom" : "right", v = b ? "clientHeight" : "clientWidth", S = s.reference[p] + s.reference[u] - h[u] - s.floating[p], C = h[u] - s.reference[u], x = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(c));
1099
+ let D = x ? x[v] : 0;
1100
+ (!D || !await (n.isElement == null ? void 0 : n.isElement(x))) && (D = d.floating[v] || s.floating[p]);
1101
+ const y = S / 2 - C / 2, T = D / 2 - m[p] / 2 - 1, k = it(l[f], T), E = it(l[_], T), A = k, I = D - m[p] - E, O = D / 2 - m[p] / 2 + y, H = Ut(A, O, I), z = !a.arrow && wt(r) != null && O !== H && s.reference[p] / 2 - (O < A ? k : E) - m[p] / 2 < 0, V = z ? O < A ? O - A : O - I : 0;
1053
1102
  return {
1054
- [u]: h[u] + P,
1103
+ [u]: h[u] + V,
1055
1104
  data: {
1056
- [u]: O,
1057
- centerOffset: A - O - P,
1058
- ...U && {
1059
- alignmentOffset: P
1105
+ [u]: H,
1106
+ centerOffset: O - H - V,
1107
+ ...z && {
1108
+ alignmentOffset: V
1060
1109
  }
1061
1110
  },
1062
- reset: U
1111
+ reset: z
1063
1112
  };
1064
1113
  }
1065
- }), so = function(t) {
1114
+ }), ao = function(t) {
1066
1115
  return t === void 0 && (t = {}), {
1067
1116
  name: "flip",
1068
1117
  options: t,
@@ -1076,102 +1125,102 @@ const no = (t) => ({
1076
1125
  platform: a,
1077
1126
  elements: c
1078
1127
  } = e, {
1079
- mainAxis: l = !0,
1080
- crossAxis: g = !0,
1128
+ mainAxis: g = !0,
1129
+ crossAxis: l = !0,
1081
1130
  fallbackPlacements: h,
1082
1131
  fallbackStrategy: u = "bestFit",
1083
1132
  fallbackAxisSideDirection: p = "none",
1084
1133
  flipAlignment: m = !0,
1085
- ...f
1086
- } = pt(t, e);
1134
+ ...b
1135
+ } = ft(t, e);
1087
1136
  if ((o = s.arrow) != null && o.alignmentOffset)
1088
1137
  return {};
1089
- const v = rt(r), b = tt(d), _ = rt(d) === d, S = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), y = h || (_ || !m ? [kt(d)] : Je(d)), D = p !== "none";
1090
- !h && D && y.push(...oo(d, m, p, S));
1091
- const x = [d, ...y], C = await ee(e, f), T = [];
1138
+ const f = rt(r), _ = tt(d), v = rt(d) === d, S = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), C = h || (v || !m ? [Et(d)] : Ze(d)), x = p !== "none";
1139
+ !h && x && C.push(...io(d, m, p, S));
1140
+ const D = [d, ...C], y = await ee(e, b), T = [];
1092
1141
  let k = ((i = s.flip) == null ? void 0 : i.overflows) || [];
1093
- if (l && T.push(C[v]), g) {
1094
- const A = Ge(r, n, S);
1095
- T.push(C[A[0]], C[A[1]]);
1142
+ if (g && T.push(y[f]), l) {
1143
+ const O = Je(r, n, S);
1144
+ T.push(y[O[0]], y[O[1]]);
1096
1145
  }
1097
1146
  if (k = [...k, {
1098
1147
  placement: r,
1099
1148
  overflows: T
1100
- }], !T.every((A) => A <= 0)) {
1101
- var I, M;
1102
- const A = (((I = s.flip) == null ? void 0 : I.index) || 0) + 1, O = x[A];
1103
- if (O && (!(g === "alignment" ? b !== tt(O) : !1) || // We leave the current main axis only if every placement on that axis
1149
+ }], !T.every((O) => O <= 0)) {
1150
+ var E, A;
1151
+ const O = (((E = s.flip) == null ? void 0 : E.index) || 0) + 1, H = D[O];
1152
+ if (H && (!(l === "alignment" ? _ !== tt(H) : !1) || // We leave the current main axis only if every placement on that axis
1104
1153
  // overflows the main axis.
1105
- k.every((H) => tt(H.placement) === b ? H.overflows[0] > 0 : !0)))
1154
+ k.every((F) => tt(F.placement) === _ ? F.overflows[0] > 0 : !0)))
1106
1155
  return {
1107
1156
  data: {
1108
- index: A,
1157
+ index: O,
1109
1158
  overflows: k
1110
1159
  },
1111
1160
  reset: {
1112
- placement: O
1161
+ placement: H
1113
1162
  }
1114
1163
  };
1115
- let U = (M = k.filter((P) => P.overflows[0] <= 0).sort((P, H) => P.overflows[1] - H.overflows[1])[0]) == null ? void 0 : M.placement;
1116
- if (!U)
1164
+ let z = (A = k.filter((V) => V.overflows[0] <= 0).sort((V, F) => V.overflows[1] - F.overflows[1])[0]) == null ? void 0 : A.placement;
1165
+ if (!z)
1117
1166
  switch (u) {
1118
1167
  case "bestFit": {
1119
- var Q;
1120
- const P = (Q = k.filter((H) => {
1121
- if (D) {
1122
- const R = tt(H.placement);
1123
- return R === b || // Create a bias to the `y` side axis due to horizontal
1168
+ var I;
1169
+ const V = (I = k.filter((F) => {
1170
+ if (x) {
1171
+ const R = tt(F.placement);
1172
+ return R === _ || // Create a bias to the `y` side axis due to horizontal
1124
1173
  // reading directions favoring greater width.
1125
1174
  R === "y";
1126
1175
  }
1127
1176
  return !0;
1128
- }).map((H) => [H.placement, H.overflows.filter((R) => R > 0).reduce((R, z) => R + z, 0)]).sort((H, R) => H[1] - R[1])[0]) == null ? void 0 : Q[0];
1129
- P && (U = P);
1177
+ }).map((F) => [F.placement, F.overflows.filter((R) => R > 0).reduce((R, q) => R + q, 0)]).sort((F, R) => F[1] - R[1])[0]) == null ? void 0 : I[0];
1178
+ V && (z = V);
1130
1179
  break;
1131
1180
  }
1132
1181
  case "initialPlacement":
1133
- U = d;
1182
+ z = d;
1134
1183
  break;
1135
1184
  }
1136
- if (r !== U)
1185
+ if (r !== z)
1137
1186
  return {
1138
1187
  reset: {
1139
- placement: U
1188
+ placement: z
1140
1189
  }
1141
1190
  };
1142
1191
  }
1143
1192
  return {};
1144
1193
  }
1145
1194
  };
1146
- }, ao = /* @__PURE__ */ new Set(["left", "top"]);
1147
- async function lo(t, e) {
1195
+ }, lo = /* @__PURE__ */ new Set(["left", "top"]);
1196
+ async function co(t, e) {
1148
1197
  const {
1149
1198
  placement: o,
1150
1199
  platform: i,
1151
1200
  elements: r
1152
- } = t, s = await (i.isRTL == null ? void 0 : i.isRTL(r.floating)), n = rt(o), d = ft(o), a = tt(o) === "y", c = ao.has(n) ? -1 : 1, l = s && a ? -1 : 1, g = pt(e, t);
1201
+ } = t, s = await (i.isRTL == null ? void 0 : i.isRTL(r.floating)), n = rt(o), d = wt(o), a = tt(o) === "y", c = lo.has(n) ? -1 : 1, g = s && a ? -1 : 1, l = ft(e, t);
1153
1202
  let {
1154
1203
  mainAxis: h,
1155
1204
  crossAxis: u,
1156
1205
  alignmentAxis: p
1157
- } = typeof g == "number" ? {
1158
- mainAxis: g,
1206
+ } = typeof l == "number" ? {
1207
+ mainAxis: l,
1159
1208
  crossAxis: 0,
1160
1209
  alignmentAxis: null
1161
1210
  } : {
1162
- mainAxis: g.mainAxis || 0,
1163
- crossAxis: g.crossAxis || 0,
1164
- alignmentAxis: g.alignmentAxis
1211
+ mainAxis: l.mainAxis || 0,
1212
+ crossAxis: l.crossAxis || 0,
1213
+ alignmentAxis: l.alignmentAxis
1165
1214
  };
1166
1215
  return d && typeof p == "number" && (u = d === "end" ? p * -1 : p), a ? {
1167
- x: u * l,
1216
+ x: u * g,
1168
1217
  y: h * c
1169
1218
  } : {
1170
1219
  x: h * c,
1171
- y: u * l
1220
+ y: u * g
1172
1221
  };
1173
1222
  }
1174
- const co = function(t) {
1223
+ const go = function(t) {
1175
1224
  return t === void 0 && (t = 0), {
1176
1225
  name: "offset",
1177
1226
  options: t,
@@ -1182,7 +1231,7 @@ const co = function(t) {
1182
1231
  y: s,
1183
1232
  placement: n,
1184
1233
  middlewareData: d
1185
- } = e, a = await lo(e, t);
1234
+ } = e, a = await co(e, t);
1186
1235
  return n === ((o = d.offset) == null ? void 0 : o.placement) && (i = d.arrow) != null && i.alignmentOffset ? {} : {
1187
1236
  x: r + a.x,
1188
1237
  y: s + a.y,
@@ -1193,7 +1242,7 @@ const co = function(t) {
1193
1242
  };
1194
1243
  }
1195
1244
  };
1196
- }, go = function(t) {
1245
+ }, uo = function(t) {
1197
1246
  return t === void 0 && (t = {}), {
1198
1247
  name: "shift",
1199
1248
  options: t,
@@ -1206,35 +1255,35 @@ const co = function(t) {
1206
1255
  mainAxis: s = !0,
1207
1256
  crossAxis: n = !1,
1208
1257
  limiter: d = {
1209
- fn: (f) => {
1258
+ fn: (b) => {
1210
1259
  let {
1211
- x: v,
1212
- y: b
1213
- } = f;
1260
+ x: f,
1261
+ y: _
1262
+ } = b;
1214
1263
  return {
1215
- x: v,
1216
- y: b
1264
+ x: f,
1265
+ y: _
1217
1266
  };
1218
1267
  }
1219
1268
  },
1220
1269
  ...a
1221
- } = pt(t, e), c = {
1270
+ } = ft(t, e), c = {
1222
1271
  x: o,
1223
1272
  y: i
1224
- }, l = await ee(e, a), g = tt(rt(r)), h = Se(g);
1225
- let u = c[h], p = c[g];
1273
+ }, g = await ee(e, a), l = tt(rt(r)), h = ke(l);
1274
+ let u = c[h], p = c[l];
1226
1275
  if (s) {
1227
- const f = h === "y" ? "top" : "left", v = h === "y" ? "bottom" : "right", b = u + l[f], _ = u - l[v];
1228
- u = Ut(b, u, _);
1276
+ const b = h === "y" ? "top" : "left", f = h === "y" ? "bottom" : "right", _ = u + g[b], v = u - g[f];
1277
+ u = Ut(_, u, v);
1229
1278
  }
1230
1279
  if (n) {
1231
- const f = g === "y" ? "top" : "left", v = g === "y" ? "bottom" : "right", b = p + l[f], _ = p - l[v];
1232
- p = Ut(b, p, _);
1280
+ const b = l === "y" ? "top" : "left", f = l === "y" ? "bottom" : "right", _ = p + g[b], v = p - g[f];
1281
+ p = Ut(_, p, v);
1233
1282
  }
1234
1283
  const m = d.fn({
1235
1284
  ...e,
1236
1285
  [h]: u,
1237
- [g]: p
1286
+ [l]: p
1238
1287
  });
1239
1288
  return {
1240
1289
  ...m,
@@ -1243,13 +1292,13 @@ const co = function(t) {
1243
1292
  y: m.y - i,
1244
1293
  enabled: {
1245
1294
  [h]: s,
1246
- [g]: n
1295
+ [l]: n
1247
1296
  }
1248
1297
  }
1249
1298
  };
1250
1299
  }
1251
1300
  };
1252
- }, uo = function(t) {
1301
+ }, ho = function(t) {
1253
1302
  return t === void 0 && (t = {}), {
1254
1303
  name: "size",
1255
1304
  options: t,
@@ -1264,22 +1313,22 @@ const co = function(t) {
1264
1313
  apply: a = () => {
1265
1314
  },
1266
1315
  ...c
1267
- } = pt(t, e), l = await ee(e, c), g = rt(r), h = ft(r), u = tt(r) === "y", {
1316
+ } = ft(t, e), g = await ee(e, c), l = rt(r), h = wt(r), u = tt(r) === "y", {
1268
1317
  width: p,
1269
1318
  height: m
1270
1319
  } = s.floating;
1271
- let f, v;
1272
- g === "top" || g === "bottom" ? (f = g, v = h === (await (n.isRTL == null ? void 0 : n.isRTL(d.floating)) ? "start" : "end") ? "left" : "right") : (v = g, f = h === "end" ? "top" : "bottom");
1273
- const b = m - l.top - l.bottom, _ = p - l.left - l.right, S = it(m - l[f], b), y = it(p - l[v], _), D = !e.middlewareData.shift;
1274
- let x = S, C = y;
1275
- if ((o = e.middlewareData.shift) != null && o.enabled.x && (C = _), (i = e.middlewareData.shift) != null && i.enabled.y && (x = b), D && !h) {
1276
- const k = q(l.left, 0), I = q(l.right, 0), M = q(l.top, 0), Q = q(l.bottom, 0);
1277
- u ? C = p - 2 * (k !== 0 || I !== 0 ? k + I : q(l.left, l.right)) : x = m - 2 * (M !== 0 || Q !== 0 ? M + Q : q(l.top, l.bottom));
1320
+ let b, f;
1321
+ l === "top" || l === "bottom" ? (b = l, f = h === (await (n.isRTL == null ? void 0 : n.isRTL(d.floating)) ? "start" : "end") ? "left" : "right") : (f = l, b = h === "end" ? "top" : "bottom");
1322
+ const _ = m - g.top - g.bottom, v = p - g.left - g.right, S = it(m - g[b], _), C = it(p - g[f], v), x = !e.middlewareData.shift;
1323
+ let D = S, y = C;
1324
+ if ((o = e.middlewareData.shift) != null && o.enabled.x && (y = v), (i = e.middlewareData.shift) != null && i.enabled.y && (D = _), x && !h) {
1325
+ const k = N(g.left, 0), E = N(g.right, 0), A = N(g.top, 0), I = N(g.bottom, 0);
1326
+ u ? y = p - 2 * (k !== 0 || E !== 0 ? k + E : N(g.left, g.right)) : D = m - 2 * (A !== 0 || I !== 0 ? A + I : N(g.top, g.bottom));
1278
1327
  }
1279
1328
  await a({
1280
1329
  ...e,
1281
- availableWidth: C,
1282
- availableHeight: x
1330
+ availableWidth: y,
1331
+ availableHeight: D
1283
1332
  });
1284
1333
  const T = await n.getDimensions(d.floating);
1285
1334
  return p !== T.width || m !== T.height ? {
@@ -1290,49 +1339,49 @@ const co = function(t) {
1290
1339
  }
1291
1340
  };
1292
1341
  };
1293
- function Mt() {
1342
+ function Ot() {
1294
1343
  return typeof window < "u";
1295
1344
  }
1296
- function wt(t) {
1297
- return ke(t) ? (t.nodeName || "").toLowerCase() : "#document";
1345
+ function mt(t) {
1346
+ return Te(t) ? (t.nodeName || "").toLowerCase() : "#document";
1298
1347
  }
1299
- function Y(t) {
1348
+ function U(t) {
1300
1349
  var e;
1301
1350
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
1302
1351
  }
1303
1352
  function Z(t) {
1304
1353
  var e;
1305
- return (e = (ke(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
1354
+ return (e = (Te(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
1306
1355
  }
1307
- function ke(t) {
1308
- return Mt() ? t instanceof Node || t instanceof Y(t).Node : !1;
1356
+ function Te(t) {
1357
+ return Ot() ? t instanceof Node || t instanceof U(t).Node : !1;
1309
1358
  }
1310
- function W(t) {
1311
- return Mt() ? t instanceof Element || t instanceof Y(t).Element : !1;
1359
+ function X(t) {
1360
+ return Ot() ? t instanceof Element || t instanceof U(t).Element : !1;
1312
1361
  }
1313
1362
  function J(t) {
1314
- return Mt() ? t instanceof HTMLElement || t instanceof Y(t).HTMLElement : !1;
1363
+ return Ot() ? t instanceof HTMLElement || t instanceof U(t).HTMLElement : !1;
1315
1364
  }
1316
- function ce(t) {
1317
- return !Mt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof Y(t).ShadowRoot;
1365
+ function ge(t) {
1366
+ return !Ot() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof U(t).ShadowRoot;
1318
1367
  }
1319
- const ho = /* @__PURE__ */ new Set(["inline", "contents"]);
1320
- function Ct(t) {
1368
+ const po = /* @__PURE__ */ new Set(["inline", "contents"]);
1369
+ function St(t) {
1321
1370
  const {
1322
1371
  overflow: e,
1323
1372
  overflowX: o,
1324
1373
  overflowY: i,
1325
1374
  display: r
1326
- } = X(t);
1327
- return /auto|scroll|overlay|hidden|clip/.test(e + i + o) && !ho.has(r);
1375
+ } = Q(t);
1376
+ return /auto|scroll|overlay|hidden|clip/.test(e + i + o) && !po.has(r);
1328
1377
  }
1329
- const po = /* @__PURE__ */ new Set(["table", "td", "th"]);
1330
- function fo(t) {
1331
- return po.has(wt(t));
1378
+ const fo = /* @__PURE__ */ new Set(["table", "td", "th"]);
1379
+ function wo(t) {
1380
+ return fo.has(mt(t));
1332
1381
  }
1333
- const wo = [":popover-open", ":modal"];
1334
- function At(t) {
1335
- return wo.some((e) => {
1382
+ const mo = [":popover-open", ":modal"];
1383
+ function Ht(t) {
1384
+ return mo.some((e) => {
1336
1385
  try {
1337
1386
  return t.matches(e);
1338
1387
  } catch {
@@ -1340,17 +1389,17 @@ function At(t) {
1340
1389
  }
1341
1390
  });
1342
1391
  }
1343
- const mo = ["transform", "translate", "scale", "rotate", "perspective"], bo = ["transform", "translate", "scale", "rotate", "perspective", "filter"], vo = ["paint", "layout", "strict", "content"];
1392
+ const bo = ["transform", "translate", "scale", "rotate", "perspective"], vo = ["transform", "translate", "scale", "rotate", "perspective", "filter"], _o = ["paint", "layout", "strict", "content"];
1344
1393
  function oe(t) {
1345
- const e = ie(), o = W(t) ? X(t) : t;
1346
- return mo.some((i) => o[i] ? o[i] !== "none" : !1) || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || bo.some((i) => (o.willChange || "").includes(i)) || vo.some((i) => (o.contain || "").includes(i));
1394
+ const e = ie(), o = X(t) ? Q(t) : t;
1395
+ return bo.some((i) => o[i] ? o[i] !== "none" : !1) || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || vo.some((i) => (o.willChange || "").includes(i)) || _o.some((i) => (o.contain || "").includes(i));
1347
1396
  }
1348
- function _o(t) {
1397
+ function yo(t) {
1349
1398
  let e = nt(t);
1350
- for (; J(e) && !ht(e); ) {
1399
+ for (; J(e) && !pt(e); ) {
1351
1400
  if (oe(e))
1352
1401
  return e;
1353
- if (At(e))
1402
+ if (Ht(e))
1354
1403
  return null;
1355
1404
  e = nt(e);
1356
1405
  }
@@ -1359,15 +1408,15 @@ function _o(t) {
1359
1408
  function ie() {
1360
1409
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1361
1410
  }
1362
- const yo = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1363
- function ht(t) {
1364
- return yo.has(wt(t));
1411
+ const Co = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1412
+ function pt(t) {
1413
+ return Co.has(mt(t));
1365
1414
  }
1366
- function X(t) {
1367
- return Y(t).getComputedStyle(t);
1415
+ function Q(t) {
1416
+ return U(t).getComputedStyle(t);
1368
1417
  }
1369
- function Ot(t) {
1370
- return W(t) ? {
1418
+ function Rt(t) {
1419
+ return X(t) ? {
1371
1420
  scrollLeft: t.scrollLeft,
1372
1421
  scrollTop: t.scrollTop
1373
1422
  } : {
@@ -1376,38 +1425,38 @@ function Ot(t) {
1376
1425
  };
1377
1426
  }
1378
1427
  function nt(t) {
1379
- if (wt(t) === "html")
1428
+ if (mt(t) === "html")
1380
1429
  return t;
1381
1430
  const e = (
1382
1431
  // Step into the shadow DOM of the parent of a slotted node.
1383
1432
  t.assignedSlot || // DOM Element detected.
1384
1433
  t.parentNode || // ShadowRoot detected.
1385
- ce(t) && t.host || // Fallback.
1434
+ ge(t) && t.host || // Fallback.
1386
1435
  Z(t)
1387
1436
  );
1388
- return ce(e) ? e.host : e;
1437
+ return ge(e) ? e.host : e;
1389
1438
  }
1390
- function De(t) {
1439
+ function Ee(t) {
1391
1440
  const e = nt(t);
1392
- return ht(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : J(e) && Ct(e) ? e : De(e);
1441
+ return pt(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : J(e) && St(e) ? e : Ee(e);
1393
1442
  }
1394
- function vt(t, e, o) {
1443
+ function _t(t, e, o) {
1395
1444
  var i;
1396
1445
  e === void 0 && (e = []), o === void 0 && (o = !0);
1397
- const r = De(t), s = r === ((i = t.ownerDocument) == null ? void 0 : i.body), n = Y(r);
1446
+ const r = Ee(t), s = r === ((i = t.ownerDocument) == null ? void 0 : i.body), n = U(r);
1398
1447
  if (s) {
1399
1448
  const d = Bt(n);
1400
- return e.concat(n, n.visualViewport || [], Ct(r) ? r : [], d && o ? vt(d) : []);
1449
+ return e.concat(n, n.visualViewport || [], St(r) ? r : [], d && o ? _t(d) : []);
1401
1450
  }
1402
- return e.concat(r, vt(r, [], o));
1451
+ return e.concat(r, _t(r, [], o));
1403
1452
  }
1404
1453
  function Bt(t) {
1405
1454
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
1406
1455
  }
1407
- function Te(t) {
1408
- const e = X(t);
1456
+ function $e(t) {
1457
+ const e = Q(t);
1409
1458
  let o = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
1410
- const r = J(t), s = r ? t.offsetWidth : o, n = r ? t.offsetHeight : i, d = xt(o) !== s || xt(i) !== n;
1459
+ const r = J(t), s = r ? t.offsetWidth : o, n = r ? t.offsetHeight : i, d = Tt(o) !== s || Tt(i) !== n;
1411
1460
  return d && (o = s, i = n), {
1412
1461
  width: o,
1413
1462
  height: i,
@@ -1415,7 +1464,7 @@ function Te(t) {
1415
1464
  };
1416
1465
  }
1417
1466
  function re(t) {
1418
- return W(t) ? t : t.contextElement;
1467
+ return X(t) ? t : t.contextElement;
1419
1468
  }
1420
1469
  function ut(t) {
1421
1470
  const e = re(t);
@@ -1425,112 +1474,112 @@ function ut(t) {
1425
1474
  width: i,
1426
1475
  height: r,
1427
1476
  $: s
1428
- } = Te(e);
1429
- let n = (s ? xt(o.width) : o.width) / i, d = (s ? xt(o.height) : o.height) / r;
1477
+ } = $e(e);
1478
+ let n = (s ? Tt(o.width) : o.width) / i, d = (s ? Tt(o.height) : o.height) / r;
1430
1479
  return (!n || !Number.isFinite(n)) && (n = 1), (!d || !Number.isFinite(d)) && (d = 1), {
1431
1480
  x: n,
1432
1481
  y: d
1433
1482
  };
1434
1483
  }
1435
- const Co = /* @__PURE__ */ G(0);
1436
- function Ee(t) {
1437
- const e = Y(t);
1438
- return !ie() || !e.visualViewport ? Co : {
1484
+ const So = /* @__PURE__ */ G(0);
1485
+ function Me(t) {
1486
+ const e = U(t);
1487
+ return !ie() || !e.visualViewport ? So : {
1439
1488
  x: e.visualViewport.offsetLeft,
1440
1489
  y: e.visualViewport.offsetTop
1441
1490
  };
1442
1491
  }
1443
- function So(t, e, o) {
1444
- return e === void 0 && (e = !1), !o || e && o !== Y(t) ? !1 : e;
1492
+ function xo(t, e, o) {
1493
+ return e === void 0 && (e = !1), !o || e && o !== U(t) ? !1 : e;
1445
1494
  }
1446
1495
  function lt(t, e, o, i) {
1447
1496
  e === void 0 && (e = !1), o === void 0 && (o = !1);
1448
1497
  const r = t.getBoundingClientRect(), s = re(t);
1449
1498
  let n = G(1);
1450
- e && (i ? W(i) && (n = ut(i)) : n = ut(t));
1451
- const d = So(s, o, i) ? Ee(s) : G(0);
1452
- let a = (r.left + d.x) / n.x, c = (r.top + d.y) / n.y, l = r.width / n.x, g = r.height / n.y;
1499
+ e && (i ? X(i) && (n = ut(i)) : n = ut(t));
1500
+ const d = xo(s, o, i) ? Me(s) : G(0);
1501
+ let a = (r.left + d.x) / n.x, c = (r.top + d.y) / n.y, g = r.width / n.x, l = r.height / n.y;
1453
1502
  if (s) {
1454
- const h = Y(s), u = i && W(i) ? Y(i) : i;
1503
+ const h = U(s), u = i && X(i) ? U(i) : i;
1455
1504
  let p = h, m = Bt(p);
1456
1505
  for (; m && i && u !== p; ) {
1457
- const f = ut(m), v = m.getBoundingClientRect(), b = X(m), _ = v.left + (m.clientLeft + parseFloat(b.paddingLeft)) * f.x, S = v.top + (m.clientTop + parseFloat(b.paddingTop)) * f.y;
1458
- a *= f.x, c *= f.y, l *= f.x, g *= f.y, a += _, c += S, p = Y(m), m = Bt(p);
1506
+ const b = ut(m), f = m.getBoundingClientRect(), _ = Q(m), v = f.left + (m.clientLeft + parseFloat(_.paddingLeft)) * b.x, S = f.top + (m.clientTop + parseFloat(_.paddingTop)) * b.y;
1507
+ a *= b.x, c *= b.y, g *= b.x, l *= b.y, a += v, c += S, p = U(m), m = Bt(p);
1459
1508
  }
1460
1509
  }
1461
- return Dt({
1462
- width: l,
1463
- height: g,
1510
+ return $t({
1511
+ width: g,
1512
+ height: l,
1464
1513
  x: a,
1465
1514
  y: c
1466
1515
  });
1467
1516
  }
1468
- function Rt(t, e) {
1469
- const o = Ot(t).scrollLeft;
1517
+ function Pt(t, e) {
1518
+ const o = Rt(t).scrollLeft;
1470
1519
  return e ? e.left + o : lt(Z(t)).left + o;
1471
1520
  }
1472
- function $e(t, e) {
1473
- const o = t.getBoundingClientRect(), i = o.left + e.scrollLeft - Rt(t, o), r = o.top + e.scrollTop;
1521
+ function Ae(t, e) {
1522
+ const o = t.getBoundingClientRect(), i = o.left + e.scrollLeft - Pt(t, o), r = o.top + e.scrollTop;
1474
1523
  return {
1475
1524
  x: i,
1476
1525
  y: r
1477
1526
  };
1478
1527
  }
1479
- function xo(t) {
1528
+ function ko(t) {
1480
1529
  let {
1481
1530
  elements: e,
1482
1531
  rect: o,
1483
1532
  offsetParent: i,
1484
1533
  strategy: r
1485
1534
  } = t;
1486
- const s = r === "fixed", n = Z(i), d = e ? At(e.floating) : !1;
1535
+ const s = r === "fixed", n = Z(i), d = e ? Ht(e.floating) : !1;
1487
1536
  if (i === n || d && s)
1488
1537
  return o;
1489
1538
  let a = {
1490
1539
  scrollLeft: 0,
1491
1540
  scrollTop: 0
1492
1541
  }, c = G(1);
1493
- const l = G(0), g = J(i);
1494
- if ((g || !g && !s) && ((wt(i) !== "body" || Ct(n)) && (a = Ot(i)), J(i))) {
1542
+ const g = G(0), l = J(i);
1543
+ if ((l || !l && !s) && ((mt(i) !== "body" || St(n)) && (a = Rt(i)), J(i))) {
1495
1544
  const u = lt(i);
1496
- c = ut(i), l.x = u.x + i.clientLeft, l.y = u.y + i.clientTop;
1545
+ c = ut(i), g.x = u.x + i.clientLeft, g.y = u.y + i.clientTop;
1497
1546
  }
1498
- const h = n && !g && !s ? $e(n, a) : G(0);
1547
+ const h = n && !l && !s ? Ae(n, a) : G(0);
1499
1548
  return {
1500
1549
  width: o.width * c.x,
1501
1550
  height: o.height * c.y,
1502
- x: o.x * c.x - a.scrollLeft * c.x + l.x + h.x,
1503
- y: o.y * c.y - a.scrollTop * c.y + l.y + h.y
1551
+ x: o.x * c.x - a.scrollLeft * c.x + g.x + h.x,
1552
+ y: o.y * c.y - a.scrollTop * c.y + g.y + h.y
1504
1553
  };
1505
1554
  }
1506
- function ko(t) {
1555
+ function Do(t) {
1507
1556
  return Array.from(t.getClientRects());
1508
1557
  }
1509
- function Do(t) {
1510
- const e = Z(t), o = Ot(t), i = t.ownerDocument.body, r = q(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), s = q(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
1511
- let n = -o.scrollLeft + Rt(t);
1558
+ function To(t) {
1559
+ const e = Z(t), o = Rt(t), i = t.ownerDocument.body, r = N(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), s = N(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
1560
+ let n = -o.scrollLeft + Pt(t);
1512
1561
  const d = -o.scrollTop;
1513
- return X(i).direction === "rtl" && (n += q(e.clientWidth, i.clientWidth) - r), {
1562
+ return Q(i).direction === "rtl" && (n += N(e.clientWidth, i.clientWidth) - r), {
1514
1563
  width: r,
1515
1564
  height: s,
1516
1565
  x: n,
1517
1566
  y: d
1518
1567
  };
1519
1568
  }
1520
- const ge = 25;
1521
- function To(t, e) {
1522
- const o = Y(t), i = Z(t), r = o.visualViewport;
1569
+ const ue = 25;
1570
+ function Eo(t, e) {
1571
+ const o = U(t), i = Z(t), r = o.visualViewport;
1523
1572
  let s = i.clientWidth, n = i.clientHeight, d = 0, a = 0;
1524
1573
  if (r) {
1525
1574
  s = r.width, n = r.height;
1526
- const l = ie();
1527
- (!l || l && e === "fixed") && (d = r.offsetLeft, a = r.offsetTop);
1575
+ const g = ie();
1576
+ (!g || g && e === "fixed") && (d = r.offsetLeft, a = r.offsetTop);
1528
1577
  }
1529
- const c = Rt(i);
1578
+ const c = Pt(i);
1530
1579
  if (c <= 0) {
1531
- const l = i.ownerDocument, g = l.body, h = getComputedStyle(g), u = l.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, p = Math.abs(i.clientWidth - g.clientWidth - u);
1532
- p <= ge && (s -= p);
1533
- } else c <= ge && (s += c);
1580
+ const g = i.ownerDocument, l = g.body, h = getComputedStyle(l), u = g.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, p = Math.abs(i.clientWidth - l.clientWidth - u);
1581
+ p <= ue && (s -= p);
1582
+ } else c <= ue && (s += c);
1534
1583
  return {
1535
1584
  width: s,
1536
1585
  height: n,
@@ -1538,8 +1587,8 @@ function To(t, e) {
1538
1587
  y: a
1539
1588
  };
1540
1589
  }
1541
- const Eo = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1542
- function $o(t, e) {
1590
+ const $o = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1591
+ function Mo(t, e) {
1543
1592
  const o = lt(t, !0, e === "fixed"), i = o.top + t.clientTop, r = o.left + t.clientLeft, s = J(t) ? ut(t) : G(1), n = t.clientWidth * s.x, d = t.clientHeight * s.y, a = r * s.x, c = i * s.y;
1544
1593
  return {
1545
1594
  width: n,
@@ -1548,16 +1597,16 @@ function $o(t, e) {
1548
1597
  y: c
1549
1598
  };
1550
1599
  }
1551
- function ue(t, e, o) {
1600
+ function he(t, e, o) {
1552
1601
  let i;
1553
1602
  if (e === "viewport")
1554
- i = To(t, o);
1603
+ i = Eo(t, o);
1555
1604
  else if (e === "document")
1556
- i = Do(Z(t));
1557
- else if (W(e))
1558
- i = $o(e, o);
1605
+ i = To(Z(t));
1606
+ else if (X(e))
1607
+ i = Mo(e, o);
1559
1608
  else {
1560
- const r = Ee(t);
1609
+ const r = Me(t);
1561
1610
  i = {
1562
1611
  x: e.x - r.x,
1563
1612
  y: e.y - r.y,
@@ -1565,36 +1614,36 @@ function ue(t, e, o) {
1565
1614
  height: e.height
1566
1615
  };
1567
1616
  }
1568
- return Dt(i);
1617
+ return $t(i);
1569
1618
  }
1570
- function Me(t, e) {
1619
+ function Oe(t, e) {
1571
1620
  const o = nt(t);
1572
- return o === e || !W(o) || ht(o) ? !1 : X(o).position === "fixed" || Me(o, e);
1621
+ return o === e || !X(o) || pt(o) ? !1 : Q(o).position === "fixed" || Oe(o, e);
1573
1622
  }
1574
- function Mo(t, e) {
1623
+ function Ao(t, e) {
1575
1624
  const o = e.get(t);
1576
1625
  if (o)
1577
1626
  return o;
1578
- let i = vt(t, [], !1).filter((d) => W(d) && wt(d) !== "body"), r = null;
1579
- const s = X(t).position === "fixed";
1627
+ let i = _t(t, [], !1).filter((d) => X(d) && mt(d) !== "body"), r = null;
1628
+ const s = Q(t).position === "fixed";
1580
1629
  let n = s ? nt(t) : t;
1581
- for (; W(n) && !ht(n); ) {
1582
- const d = X(n), a = oe(n);
1583
- !a && d.position === "fixed" && (r = null), (s ? !a && !r : !a && d.position === "static" && !!r && Eo.has(r.position) || Ct(n) && !a && Me(t, n)) ? i = i.filter((l) => l !== n) : r = d, n = nt(n);
1630
+ for (; X(n) && !pt(n); ) {
1631
+ const d = Q(n), a = oe(n);
1632
+ !a && d.position === "fixed" && (r = null), (s ? !a && !r : !a && d.position === "static" && !!r && $o.has(r.position) || St(n) && !a && Oe(t, n)) ? i = i.filter((g) => g !== n) : r = d, n = nt(n);
1584
1633
  }
1585
1634
  return e.set(t, i), i;
1586
1635
  }
1587
- function Ao(t) {
1636
+ function Oo(t) {
1588
1637
  let {
1589
1638
  element: e,
1590
1639
  boundary: o,
1591
1640
  rootBoundary: i,
1592
1641
  strategy: r
1593
1642
  } = t;
1594
- const n = [...o === "clippingAncestors" ? At(e) ? [] : Mo(e, this._c) : [].concat(o), i], d = n[0], a = n.reduce((c, l) => {
1595
- const g = ue(e, l, r);
1596
- return c.top = q(g.top, c.top), c.right = it(g.right, c.right), c.bottom = it(g.bottom, c.bottom), c.left = q(g.left, c.left), c;
1597
- }, ue(e, d, r));
1643
+ const n = [...o === "clippingAncestors" ? Ht(e) ? [] : Ao(e, this._c) : [].concat(o), i], d = n[0], a = n.reduce((c, g) => {
1644
+ const l = he(e, g, r);
1645
+ return c.top = N(l.top, c.top), c.right = it(l.right, c.right), c.bottom = it(l.bottom, c.bottom), c.left = N(l.left, c.left), c;
1646
+ }, he(e, d, r));
1598
1647
  return {
1599
1648
  width: a.right - a.left,
1600
1649
  height: a.bottom - a.top,
@@ -1602,11 +1651,11 @@ function Ao(t) {
1602
1651
  y: a.top
1603
1652
  };
1604
1653
  }
1605
- function Oo(t) {
1654
+ function Ho(t) {
1606
1655
  const {
1607
1656
  width: e,
1608
1657
  height: o
1609
- } = Te(t);
1658
+ } = $e(t);
1610
1659
  return {
1611
1660
  width: e,
1612
1661
  height: o
@@ -1620,53 +1669,53 @@ function Ro(t, e, o) {
1620
1669
  };
1621
1670
  const a = G(0);
1622
1671
  function c() {
1623
- a.x = Rt(r);
1672
+ a.x = Pt(r);
1624
1673
  }
1625
1674
  if (i || !i && !s)
1626
- if ((wt(e) !== "body" || Ct(r)) && (d = Ot(e)), i) {
1675
+ if ((mt(e) !== "body" || St(r)) && (d = Rt(e)), i) {
1627
1676
  const u = lt(e, !0, s, e);
1628
1677
  a.x = u.x + e.clientLeft, a.y = u.y + e.clientTop;
1629
1678
  } else r && c();
1630
1679
  s && !i && r && c();
1631
- const l = r && !i && !s ? $e(r, d) : G(0), g = n.left + d.scrollLeft - a.x - l.x, h = n.top + d.scrollTop - a.y - l.y;
1680
+ const g = r && !i && !s ? Ae(r, d) : G(0), l = n.left + d.scrollLeft - a.x - g.x, h = n.top + d.scrollTop - a.y - g.y;
1632
1681
  return {
1633
- x: g,
1682
+ x: l,
1634
1683
  y: h,
1635
1684
  width: n.width,
1636
1685
  height: n.height
1637
1686
  };
1638
1687
  }
1639
- function Ht(t) {
1640
- return X(t).position === "static";
1688
+ function It(t) {
1689
+ return Q(t).position === "static";
1641
1690
  }
1642
- function he(t, e) {
1643
- if (!J(t) || X(t).position === "fixed")
1691
+ function pe(t, e) {
1692
+ if (!J(t) || Q(t).position === "fixed")
1644
1693
  return null;
1645
1694
  if (e)
1646
1695
  return e(t);
1647
1696
  let o = t.offsetParent;
1648
1697
  return Z(t) === o && (o = o.ownerDocument.body), o;
1649
1698
  }
1650
- function Ae(t, e) {
1651
- const o = Y(t);
1652
- if (At(t))
1699
+ function He(t, e) {
1700
+ const o = U(t);
1701
+ if (Ht(t))
1653
1702
  return o;
1654
1703
  if (!J(t)) {
1655
1704
  let r = nt(t);
1656
- for (; r && !ht(r); ) {
1657
- if (W(r) && !Ht(r))
1705
+ for (; r && !pt(r); ) {
1706
+ if (X(r) && !It(r))
1658
1707
  return r;
1659
1708
  r = nt(r);
1660
1709
  }
1661
1710
  return o;
1662
1711
  }
1663
- let i = he(t, e);
1664
- for (; i && fo(i) && Ht(i); )
1665
- i = he(i, e);
1666
- return i && ht(i) && Ht(i) && !oe(i) ? o : i || _o(t) || o;
1712
+ let i = pe(t, e);
1713
+ for (; i && wo(i) && It(i); )
1714
+ i = pe(i, e);
1715
+ return i && pt(i) && It(i) && !oe(i) ? o : i || yo(t) || o;
1667
1716
  }
1668
- const Lo = async function(t) {
1669
- const e = this.getOffsetParent || Ae, o = this.getDimensions, i = await o(t.floating);
1717
+ const Po = async function(t) {
1718
+ const e = this.getOffsetParent || He, o = this.getDimensions, i = await o(t.floating);
1670
1719
  return {
1671
1720
  reference: Ro(t.reference, await e(t.floating), t.strategy),
1672
1721
  floating: {
@@ -1677,25 +1726,25 @@ const Lo = async function(t) {
1677
1726
  }
1678
1727
  };
1679
1728
  };
1680
- function Io(t) {
1681
- return X(t).direction === "rtl";
1729
+ function Lo(t) {
1730
+ return Q(t).direction === "rtl";
1682
1731
  }
1683
- const Po = {
1684
- convertOffsetParentRelativeRectToViewportRelativeRect: xo,
1732
+ const Io = {
1733
+ convertOffsetParentRelativeRectToViewportRelativeRect: ko,
1685
1734
  getDocumentElement: Z,
1686
- getClippingRect: Ao,
1687
- getOffsetParent: Ae,
1688
- getElementRects: Lo,
1689
- getClientRects: ko,
1690
- getDimensions: Oo,
1735
+ getClippingRect: Oo,
1736
+ getOffsetParent: He,
1737
+ getElementRects: Po,
1738
+ getClientRects: Do,
1739
+ getDimensions: Ho,
1691
1740
  getScale: ut,
1692
- isElement: W,
1693
- isRTL: Io
1741
+ isElement: X,
1742
+ isRTL: Lo
1694
1743
  };
1695
- function Oe(t, e) {
1744
+ function Re(t, e) {
1696
1745
  return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1697
1746
  }
1698
- function Ho(t, e) {
1747
+ function zo(t, e) {
1699
1748
  let o = null, i;
1700
1749
  const r = Z(t);
1701
1750
  function s() {
@@ -1705,43 +1754,43 @@ function Ho(t, e) {
1705
1754
  function n(d, a) {
1706
1755
  d === void 0 && (d = !1), a === void 0 && (a = 1), s();
1707
1756
  const c = t.getBoundingClientRect(), {
1708
- left: l,
1709
- top: g,
1757
+ left: g,
1758
+ top: l,
1710
1759
  width: h,
1711
1760
  height: u
1712
1761
  } = c;
1713
1762
  if (d || e(), !h || !u)
1714
1763
  return;
1715
- const p = St(g), m = St(r.clientWidth - (l + h)), f = St(r.clientHeight - (g + u)), v = St(l), _ = {
1716
- rootMargin: -p + "px " + -m + "px " + -f + "px " + -v + "px",
1717
- threshold: q(0, it(1, a)) || 1
1764
+ const p = Dt(l), m = Dt(r.clientWidth - (g + h)), b = Dt(r.clientHeight - (l + u)), f = Dt(g), v = {
1765
+ rootMargin: -p + "px " + -m + "px " + -b + "px " + -f + "px",
1766
+ threshold: N(0, it(1, a)) || 1
1718
1767
  };
1719
1768
  let S = !0;
1720
- function y(D) {
1721
- const x = D[0].intersectionRatio;
1722
- if (x !== a) {
1769
+ function C(x) {
1770
+ const D = x[0].intersectionRatio;
1771
+ if (D !== a) {
1723
1772
  if (!S)
1724
1773
  return n();
1725
- x ? n(!1, x) : i = setTimeout(() => {
1774
+ D ? n(!1, D) : i = setTimeout(() => {
1726
1775
  n(!1, 1e-7);
1727
1776
  }, 1e3);
1728
1777
  }
1729
- x === 1 && !Oe(c, t.getBoundingClientRect()) && n(), S = !1;
1778
+ D === 1 && !Re(c, t.getBoundingClientRect()) && n(), S = !1;
1730
1779
  }
1731
1780
  try {
1732
- o = new IntersectionObserver(y, {
1733
- ..._,
1781
+ o = new IntersectionObserver(C, {
1782
+ ...v,
1734
1783
  // Handle <iframe>s
1735
1784
  root: r.ownerDocument
1736
1785
  });
1737
1786
  } catch {
1738
- o = new IntersectionObserver(y, _);
1787
+ o = new IntersectionObserver(C, v);
1739
1788
  }
1740
1789
  o.observe(t);
1741
1790
  }
1742
1791
  return n(!0), s;
1743
1792
  }
1744
- function zo(t, e, o, i) {
1793
+ function Vo(t, e, o, i) {
1745
1794
  i === void 0 && (i = {});
1746
1795
  const {
1747
1796
  ancestorScroll: r = !0,
@@ -1749,43 +1798,43 @@ function zo(t, e, o, i) {
1749
1798
  elementResize: n = typeof ResizeObserver == "function",
1750
1799
  layoutShift: d = typeof IntersectionObserver == "function",
1751
1800
  animationFrame: a = !1
1752
- } = i, c = re(t), l = r || s ? [...c ? vt(c) : [], ...vt(e)] : [];
1753
- l.forEach((v) => {
1754
- r && v.addEventListener("scroll", o, {
1801
+ } = i, c = re(t), g = r || s ? [...c ? _t(c) : [], ..._t(e)] : [];
1802
+ g.forEach((f) => {
1803
+ r && f.addEventListener("scroll", o, {
1755
1804
  passive: !0
1756
- }), s && v.addEventListener("resize", o);
1805
+ }), s && f.addEventListener("resize", o);
1757
1806
  });
1758
- const g = c && d ? Ho(c, o) : null;
1807
+ const l = c && d ? zo(c, o) : null;
1759
1808
  let h = -1, u = null;
1760
- n && (u = new ResizeObserver((v) => {
1761
- let [b] = v;
1762
- b && b.target === c && u && (u.unobserve(e), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
1763
- var _;
1764
- (_ = u) == null || _.observe(e);
1809
+ n && (u = new ResizeObserver((f) => {
1810
+ let [_] = f;
1811
+ _ && _.target === c && u && (u.unobserve(e), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
1812
+ var v;
1813
+ (v = u) == null || v.observe(e);
1765
1814
  })), o();
1766
1815
  }), c && !a && u.observe(c), u.observe(e));
1767
1816
  let p, m = a ? lt(t) : null;
1768
- a && f();
1769
- function f() {
1770
- const v = lt(t);
1771
- m && !Oe(m, v) && o(), m = v, p = requestAnimationFrame(f);
1817
+ a && b();
1818
+ function b() {
1819
+ const f = lt(t);
1820
+ m && !Re(m, f) && o(), m = f, p = requestAnimationFrame(b);
1772
1821
  }
1773
1822
  return o(), () => {
1774
- var v;
1775
- l.forEach((b) => {
1776
- r && b.removeEventListener("scroll", o), s && b.removeEventListener("resize", o);
1777
- }), g == null || g(), (v = u) == null || v.disconnect(), u = null, a && cancelAnimationFrame(p);
1823
+ var f;
1824
+ g.forEach((_) => {
1825
+ r && _.removeEventListener("scroll", o), s && _.removeEventListener("resize", o);
1826
+ }), l == null || l(), (f = u) == null || f.disconnect(), u = null, a && cancelAnimationFrame(p);
1778
1827
  };
1779
1828
  }
1780
- const Lt = co, Re = go, It = so, Fo = uo, Vo = no, Pt = (t, e, o) => {
1829
+ const Lt = go, ne = uo, xt = ao, Fo = ho, qo = so, kt = (t, e, o) => {
1781
1830
  const i = /* @__PURE__ */ new Map(), r = {
1782
- platform: Po,
1831
+ platform: Io,
1783
1832
  ...o
1784
1833
  }, s = {
1785
1834
  ...r.platform,
1786
1835
  _c: i
1787
1836
  };
1788
- return ro(t, e, {
1837
+ return no(t, e, {
1789
1838
  ...r,
1790
1839
  platform: s
1791
1840
  });
@@ -1806,30 +1855,30 @@ function dt(t, e, o, i) {
1806
1855
  else {
1807
1856
  const n = t.grid.editingCell, d = n ? (s = t.grid.displayItems[n.rowIndex]) == null ? void 0 : s[n.field] : void 0;
1808
1857
  r.innerHTML = o.map((a, c) => {
1809
- const l = c === t.highlightedIndex, g = at(a, i) === d, h = mt(a, i);
1858
+ const g = c === t.highlightedIndex, l = at(a, i) === d, h = bt(a, i);
1810
1859
  if (i.renderOptionCallback) {
1811
- const _ = { index: c, isHighlighted: l, isSelected: g, isDisabled: h };
1812
- return i.renderOptionCallback(a, _);
1860
+ const v = { index: c, isHighlighted: g, isSelected: l, isDisabled: h };
1861
+ return i.renderOptionCallback(a, v);
1813
1862
  }
1814
- const u = yt(a, i), p = Be(a, i), m = Ke(a, i), f = ["wg__dropdown-option"];
1815
- l && f.push("wg__dropdown-option--highlighted"), g && f.push("wg__dropdown-option--selected"), h && f.push("wg__dropdown-option--disabled");
1816
- const v = p ? `<span class="wg__dropdown-option-icon">${t.escapeHtml(p)}</span>` : "", b = m ? `<span class="wg__dropdown-option-subtitle">${t.escapeHtml(m)}</span>` : "";
1817
- return `<div class="${f.join(" ")}" data-index="${c}" ${h ? 'data-disabled="true"' : ""}>
1818
- ${v}
1863
+ const u = Ct(a, i), p = Ke(a, i), m = We(a, i), b = ["wg__dropdown-option"];
1864
+ g && b.push("wg__dropdown-option--highlighted"), l && b.push("wg__dropdown-option--selected"), h && b.push("wg__dropdown-option--disabled");
1865
+ const f = p ? `<span class="wg__dropdown-option-icon">${t.escapeHtml(p)}</span>` : "", _ = m ? `<span class="wg__dropdown-option-subtitle">${t.escapeHtml(m)}</span>` : "";
1866
+ return `<div class="${b.join(" ")}" data-index="${c}" ${h ? 'data-disabled="true"' : ""}>
1867
+ ${f}
1819
1868
  <div class="wg__dropdown-option-content">
1820
1869
  <span class="wg__dropdown-option-label">${t.escapeHtml(u)}</span>
1821
- ${b}
1870
+ ${_}
1822
1871
  </div>
1823
1872
  </div>`;
1824
1873
  }).join("");
1825
1874
  }
1826
- return t.shadow.appendChild(r), t.dropdownOpen = !0, Pt(e, r, {
1875
+ return t.shadow.appendChild(r), t.dropdownOpen = !0, kt(e, r, {
1827
1876
  strategy: "fixed",
1828
1877
  placement: "bottom-start",
1829
1878
  middleware: [
1830
1879
  // Add 1px gap to prevent sub-pixel overlap with cell border
1831
1880
  Lt(1),
1832
- It({ fallbackPlacements: ["top-start"] }),
1881
+ xt({ fallbackPlacements: ["top-start"] }),
1833
1882
  Fo({
1834
1883
  apply({ rects: n }) {
1835
1884
  Object.assign(r.style, {
@@ -1849,13 +1898,13 @@ function L(t) {
1849
1898
  const e = t.shadow.querySelector(".wg__dropdown");
1850
1899
  e == null || e.remove(), t.dropdownOpen = !1, t.highlightedIndex = -1, t.filterText = "";
1851
1900
  }
1852
- function Le(t, e, o = !0) {
1901
+ function Pe(t, e, o = !0) {
1853
1902
  const i = t.dropdownOptions[e];
1854
1903
  if (!i) return;
1855
1904
  const r = t.grid.editingCell;
1856
1905
  if (!r) return;
1857
1906
  const s = t.getCurrentEditorOptions();
1858
- if (mt(i, s)) return;
1907
+ if (bt(i, s)) return;
1859
1908
  const n = at(i, s), d = t.grid.columns.findIndex((c) => String(c.field) === r.field), a = t.grid.displayItems[r.rowIndex];
1860
1909
  if (s.onselect && a && s.onselect(i, a), t.justSelected = !0, t.isCommittingFromKeyboard = !0, L(t), t.grid.commitEdit(r.rowIndex, r.field, n), o)
1861
1910
  t.moveFocusAfterCommit(r.rowIndex, r.field, "down");
@@ -1876,17 +1925,17 @@ function et(t) {
1876
1925
  i.classList.toggle("wg__dropdown-option--highlighted", r === t.highlightedIndex);
1877
1926
  });
1878
1927
  }
1879
- function pe(t) {
1928
+ function fe(t) {
1880
1929
  const e = t.shadow.querySelector(".wg__dropdown-option--highlighted");
1881
1930
  e == null || e.scrollIntoView({ block: "nearest" });
1882
1931
  }
1883
- function fe(t, e) {
1932
+ function we(t, e) {
1884
1933
  const o = t.shadow.querySelector(".wg__loading-indicator");
1885
1934
  o && (o.style.display = e ? "inline" : "none");
1886
1935
  const i = t.shadow.querySelector(".wg__editor--autocomplete .wg__combobox-toggle");
1887
1936
  i && (i.style.display = e ? "none" : "inline");
1888
1937
  }
1889
- function K(t) {
1938
+ function W(t) {
1890
1939
  if (t.justSelected) return;
1891
1940
  const e = t.getCurrentEditingColumn();
1892
1941
  if (!e) return;
@@ -1896,15 +1945,15 @@ function K(t) {
1896
1945
  const n = o.options || [];
1897
1946
  if (t.filterText) {
1898
1947
  const d = t.filterText.toLowerCase();
1899
- t.dropdownOptions = n.filter((a) => yt(a, o).toLowerCase().includes(d)), r = t.dropdownOptions.length > 0 ? 0 : -1;
1948
+ t.dropdownOptions = n.filter((a) => Ct(a, o).toLowerCase().includes(d)), r = t.dropdownOptions.length > 0 ? 0 : -1;
1900
1949
  } else {
1901
1950
  t.dropdownOptions = n;
1902
1951
  const d = t.grid.editingCell;
1903
1952
  if (d) {
1904
- const a = t.grid.displayItems[d.rowIndex], c = a ? a[d.field] : void 0, l = t.dropdownOptions.findIndex(
1905
- (g) => at(g, o) === c
1953
+ const a = t.grid.displayItems[d.rowIndex], c = a ? a[d.field] : void 0, g = t.dropdownOptions.findIndex(
1954
+ (l) => at(l, o) === c
1906
1955
  );
1907
- r = l >= 0 ? l : 0;
1956
+ r = g >= 0 ? g : 0;
1908
1957
  } else
1909
1958
  r = t.dropdownOptions.length > 0 ? 0 : -1;
1910
1959
  }
@@ -1912,22 +1961,22 @@ function K(t) {
1912
1961
  const n = i === "autocomplete" ? o.initialOptions || o.options || [] : o.options || [], d = t.grid.editingCell;
1913
1962
  let a;
1914
1963
  if (d) {
1915
- const l = t.grid.displayItems[d.rowIndex];
1916
- a = l ? l[d.field] : void 0;
1964
+ const g = t.grid.displayItems[d.rowIndex];
1965
+ a = g ? g[d.field] : void 0;
1917
1966
  }
1918
1967
  const c = n.findIndex(
1919
- (l) => at(l, o) === a
1968
+ (g) => at(g, o) === a
1920
1969
  );
1921
1970
  if (c >= 0)
1922
1971
  t.dropdownOptions = n, r = c;
1923
1972
  else if (a != null && a !== "") {
1924
- const l = o.valueMember || "value", g = o.displayMember || "label", h = String(a), u = {
1973
+ const g = o.valueMember || "value", l = o.displayMember || "label", h = String(a), u = {
1925
1974
  // Required base properties
1926
1975
  value: a,
1927
1976
  label: h,
1928
1977
  // Custom member properties (may override above if different)
1929
- [l]: a,
1930
- [g]: h
1978
+ [g]: a,
1979
+ [l]: h
1931
1980
  };
1932
1981
  t.dropdownOptions = [u, ...n], r = 0;
1933
1982
  } else
@@ -1939,14 +1988,14 @@ function K(t) {
1939
1988
  t.isOpeningDropdown = !0;
1940
1989
  const d = dt(t, s, t.dropdownOptions, o);
1941
1990
  ct(t, d), t.filterText = n, t.highlightedIndex = r, et(t);
1942
- const a = t.shadow.querySelector(".wg__select-trigger"), c = t.shadow.querySelector(".wg__combobox-input, .wg__autocomplete-input"), l = a || c;
1943
- l && l.focus(), requestAnimationFrame(() => {
1991
+ const a = t.shadow.querySelector(".wg__select-trigger"), c = t.shadow.querySelector(".wg__combobox-input, .wg__autocomplete-input"), g = a || c;
1992
+ g && g.focus(), requestAnimationFrame(() => {
1944
1993
  t.isOpeningDropdown = !1;
1945
1994
  });
1946
1995
  }
1947
1996
  }
1948
- function we(t) {
1949
- t.dropdownOpen ? L(t) : K(t);
1997
+ function me(t) {
1998
+ t.dropdownOpen ? L(t) : W(t);
1950
1999
  }
1951
2000
  function ct(t, e) {
1952
2001
  e.addEventListener("mousedown", (o) => {
@@ -1954,16 +2003,16 @@ function ct(t, e) {
1954
2003
  const i = o.target.closest(".wg__dropdown-option");
1955
2004
  if (i && !i.hasAttribute("data-disabled")) {
1956
2005
  const r = parseInt(i.getAttribute("data-index") || "0", 10);
1957
- Le(t, r, !1);
2006
+ Pe(t, r, !1);
1958
2007
  }
1959
2008
  }), e.addEventListener("mouseover", (o) => {
1960
2009
  const i = o.target.closest(".wg__dropdown-option");
1961
2010
  i && !i.hasAttribute("data-disabled") && (t.highlightedIndex = parseInt(i.getAttribute("data-index") || "0", 10), et(t));
1962
2011
  });
1963
2012
  }
1964
- function me(t, e) {
2013
+ function be(t, e) {
1965
2014
  const o = e.options || [], i = t.filterText.toLowerCase(), r = t.filterText;
1966
- t.dropdownOptions = o.filter((n) => yt(n, e).toLowerCase().includes(i)), t.highlightedIndex = t.dropdownOptions.length > 0 ? 0 : -1;
2015
+ t.dropdownOptions = o.filter((n) => Ct(n, e).toLowerCase().includes(i)), t.highlightedIndex = t.dropdownOptions.length > 0 ? 0 : -1;
1967
2016
  const s = t.shadow.querySelector(".wg__editor--select");
1968
2017
  if (s)
1969
2018
  if (t.dropdownOptions.length > 0) {
@@ -1972,7 +2021,7 @@ function me(t, e) {
1972
2021
  } else
1973
2022
  L(t);
1974
2023
  }
1975
- function qo(t, e) {
2024
+ function Yo(t, e) {
1976
2025
  const o = e.target;
1977
2026
  t.filterText = o.value, t.isUserFiltering = !0;
1978
2027
  const i = t.getCurrentEditingColumn();
@@ -1980,7 +2029,7 @@ function qo(t, e) {
1980
2029
  const r = i.editorOptions || {}, s = r.options || [];
1981
2030
  if (t.filterText.trim()) {
1982
2031
  const d = t.filterText.toLowerCase();
1983
- t.dropdownOptions = s.filter((a) => yt(a, r).toLowerCase().includes(d));
2032
+ t.dropdownOptions = s.filter((a) => Ct(a, r).toLowerCase().includes(d));
1984
2033
  } else
1985
2034
  t.dropdownOptions = s;
1986
2035
  t.highlightedIndex = t.dropdownOptions.length > 0 ? 0 : -1;
@@ -1990,7 +2039,7 @@ function qo(t, e) {
1990
2039
  ct(t, d), t.highlightedIndex = t.dropdownOptions.length > 0 ? 0 : -1, et(t);
1991
2040
  }
1992
2041
  }
1993
- function Yo(t, e) {
2042
+ function No(t, e) {
1994
2043
  const o = e.target;
1995
2044
  t.filterText = o.value;
1996
2045
  const i = t.getCurrentEditingColumn();
@@ -2011,15 +2060,15 @@ function Yo(t, e) {
2011
2060
  return;
2012
2061
  }
2013
2062
  t.searchDebounceTimer = setTimeout(() => {
2014
- No(t, t.filterText, i);
2063
+ Uo(t, t.filterText, i);
2015
2064
  }, s);
2016
2065
  }
2017
- async function No(t, e, o) {
2066
+ async function Uo(t, e, o) {
2018
2067
  const i = o.editorOptions || {};
2019
2068
  if (!i.onSearchCallback) return;
2020
2069
  t.searchAbortController && t.searchAbortController.abort(), t.searchAbortController = new AbortController();
2021
2070
  const r = t.searchAbortController.signal;
2022
- t.isSearching = !0, fe(t, !0);
2071
+ t.isSearching = !0, we(t, !0);
2023
2072
  try {
2024
2073
  const s = t.grid.editingCell;
2025
2074
  if (!s) return;
@@ -2042,16 +2091,16 @@ async function No(t, e, o) {
2042
2091
  ct(t, d);
2043
2092
  }
2044
2093
  } finally {
2045
- r.aborted || (t.isSearching = !1, fe(t, !1));
2094
+ r.aborted || (t.isSearching = !1, we(t, !1));
2046
2095
  }
2047
2096
  }
2048
- function be(t, e, o, i, r) {
2097
+ function ve(t, e, o, i, r) {
2049
2098
  const s = i ?? t.tooltipShowDelay;
2050
2099
  t.tooltipHideTimer && (clearTimeout(t.tooltipHideTimer), t.tooltipHideTimer = null), !(t.tooltipElement && t.tooltipAnchor === e) && (t.tooltipShowTimer && clearTimeout(t.tooltipShowTimer), t.tooltipShowTimer = setTimeout(() => {
2051
- jo(t, e, o, r);
2100
+ Bo(t, e, o, r);
2052
2101
  }, s));
2053
2102
  }
2054
- function Uo(t, e) {
2103
+ function jo(t, e) {
2055
2104
  const o = e ?? t.tooltipHideDelay;
2056
2105
  t.tooltipShowTimer && (clearTimeout(t.tooltipShowTimer), t.tooltipShowTimer = null), t.tooltipElement && (t.tooltipHideTimer = setTimeout(() => {
2057
2106
  t.tooltipElement && (t.tooltipElement.classList.remove("wg__tooltip--visible"), setTimeout(() => {
@@ -2060,7 +2109,7 @@ function Uo(t, e) {
2060
2109
  }, 100));
2061
2110
  }, o));
2062
2111
  }
2063
- function jo(t, e, o, i) {
2112
+ function Bo(t, e, o, i) {
2064
2113
  var d;
2065
2114
  (d = t.tooltipElement) == null || d.remove();
2066
2115
  const r = document.createElement("div");
@@ -2068,17 +2117,17 @@ function jo(t, e, o, i) {
2068
2117
  const s = document.createElement("div");
2069
2118
  s.className = "wg__tooltip-content", i ? s.innerHTML = o : s.textContent = o, r.appendChild(s);
2070
2119
  const n = document.createElement("div");
2071
- n.className = "wg__tooltip-arrow", r.appendChild(n), t.shadow.appendChild(r), t.tooltipElement = r, t.tooltipArrowElement = n, t.tooltipAnchor = e, Pt(e, r, {
2120
+ n.className = "wg__tooltip-arrow", r.appendChild(n), t.shadow.appendChild(r), t.tooltipElement = r, t.tooltipArrowElement = n, t.tooltipAnchor = e, kt(e, r, {
2072
2121
  strategy: "fixed",
2073
2122
  placement: "top",
2074
2123
  middleware: [
2075
2124
  Lt(8),
2076
- It({ fallbackPlacements: ["bottom", "left", "right"] }),
2077
- Vo({ element: n })
2125
+ xt({ fallbackPlacements: ["bottom", "left", "right"] }),
2126
+ qo({ element: n })
2078
2127
  ]
2079
- }).then(({ x: a, y: c, placement: l, middlewareData: g }) => {
2080
- if (r.style.left = `${a}px`, r.style.top = `${c}px`, r.setAttribute("data-placement", l), g.arrow) {
2081
- const { x: h, y: u } = g.arrow;
2128
+ }).then(({ x: a, y: c, placement: g, middlewareData: l }) => {
2129
+ if (r.style.left = `${a}px`, r.style.top = `${c}px`, r.setAttribute("data-placement", g), l.arrow) {
2130
+ const { x: h, y: u } = l.arrow;
2082
2131
  h != null && (n.style.left = `${h}px`), u != null && (n.style.top = `${u}px`);
2083
2132
  }
2084
2133
  requestAnimationFrame(() => {
@@ -2086,9 +2135,9 @@ function jo(t, e, o, i) {
2086
2135
  });
2087
2136
  });
2088
2137
  }
2089
- function Bo(t, e, o) {
2138
+ function Ko(t, e, o) {
2090
2139
  if (t.grid.shouldUseVirtualScroll()) {
2091
- Ko(t, e);
2140
+ Wo(t, e);
2092
2141
  const n = t.shadow.querySelector(
2093
2142
  `[data-row="${e}"][data-col="${o}"]`
2094
2143
  );
@@ -2109,11 +2158,11 @@ function Bo(t, e, o) {
2109
2158
  }
2110
2159
  }
2111
2160
  }
2112
- function Ko(t, e) {
2161
+ function Wo(t, e) {
2113
2162
  const o = t.shadow.querySelector(".wg");
2114
2163
  if (!o) return;
2115
- const i = t.grid.virtualScrollRowHeight, r = o.scrollTop, s = o.clientHeight, n = t.shadow.querySelector(".wg__header"), d = (n == null ? void 0 : n.offsetHeight) || 0, a = e * i, c = a + i, l = r + d, g = r + s;
2116
- a < l ? o.scrollTop = a - d : c > g && (o.scrollTop = c - s);
2164
+ const i = t.grid.virtualScrollRowHeight, r = o.scrollTop, s = o.clientHeight, n = t.shadow.querySelector(".wg__header"), d = (n == null ? void 0 : n.offsetHeight) || 0, a = e * i, c = a + i, g = r + d, l = r + s;
2165
+ a < g ? o.scrollTop = a - d : c > l && (o.scrollTop = c - s);
2117
2166
  }
2118
2167
  function st(t, e) {
2119
2168
  const o = t.shadow.querySelector(".wg");
@@ -2121,7 +2170,7 @@ function st(t, e) {
2121
2170
  const i = t.grid.virtualScrollRowHeight, r = Math.max(0, (e - 1) * i), s = Math.max(0, o.scrollHeight - o.clientHeight);
2122
2171
  o.scrollTop = Math.min(r, s);
2123
2172
  }
2124
- function B(t, e, o) {
2173
+ function K(t, e, o) {
2125
2174
  if (e) {
2126
2175
  const i = t.shadow.querySelector(
2127
2176
  `[data-row="${e.rowIndex}"][data-col="${e.colIndex}"]`
@@ -2135,7 +2184,7 @@ function B(t, e, o) {
2135
2184
  i == null || i.classList.add("wg__cell--focused");
2136
2185
  }
2137
2186
  }
2138
- function F(t) {
2187
+ function Y(t) {
2139
2188
  const e = t.grid.editingCell;
2140
2189
  if (e) {
2141
2190
  const o = t.grid.columns.findIndex((r) => String(r.field) === e.field), i = t.shadow.querySelector(
@@ -2144,16 +2193,16 @@ function F(t) {
2144
2193
  i && i.classList.remove("wg__cell--editing");
2145
2194
  }
2146
2195
  }
2147
- function Wo(t, e, o) {
2196
+ function Xo(t, e, o) {
2148
2197
  if (!t.grid.isNavigateMode) return;
2149
2198
  const i = t.grid.focusedCell, r = { rowIndex: e, colIndex: o };
2150
- t.grid.setFocusedCell(e, o), B(t, i, r);
2199
+ t.grid.setFocusedCell(e, o), K(t, i, r);
2151
2200
  }
2152
- function E(t, e, o) {
2201
+ function $(t, e, o) {
2153
2202
  const i = t.grid.focusedCell, r = { rowIndex: e, colIndex: o };
2154
- t.grid.setFocusedCell(e, o), B(t, i, r), Bo(t, e, o);
2203
+ t.grid.setFocusedCell(e, o), K(t, i, r), Ko(t, e, o);
2155
2204
  }
2156
- function j(t, e, o, i) {
2205
+ function B(t, e, o, i) {
2157
2206
  const s = t.grid.columns[o];
2158
2207
  if (!s || !t.grid.isCellEditable(s))
2159
2208
  return;
@@ -2174,27 +2223,27 @@ function zt(t, e) {
2174
2223
  let a = 0, c = i.length;
2175
2224
  try {
2176
2225
  for (; a < c; ) {
2177
- const l = Math.floor((a + c) / 2);
2178
- d.setStart(n, 0), d.setEnd(n, l), d.getBoundingClientRect().right < r ? a = l + 1 : c = l;
2226
+ const g = Math.floor((a + c) / 2);
2227
+ d.setStart(n, 0), d.setEnd(n, g), d.getBoundingClientRect().right < r ? a = g + 1 : c = g;
2179
2228
  }
2180
2229
  if (a > 0 && a < i.length) {
2181
2230
  d.setStart(n, a - 1), d.setEnd(n, a);
2182
- const l = d.getBoundingClientRect(), g = l.left + l.width / 2;
2183
- r < g && a--;
2231
+ const g = d.getBoundingClientRect(), l = g.left + g.width / 2;
2232
+ r < l && a--;
2184
2233
  }
2185
2234
  } catch {
2186
2235
  return i.length;
2187
2236
  }
2188
2237
  return a;
2189
2238
  }
2190
- function Xo(t, e) {
2239
+ function Qo(t, e) {
2191
2240
  const o = e.relatedTarget, i = t.shadow.querySelector(".wg__table");
2192
2241
  if (!o || !(i != null && i.contains(o))) {
2193
2242
  const r = t.grid.focusedCell;
2194
- t.grid.clearFocusedCell(), B(t, r, null);
2243
+ t.grid.clearFocusedCell(), K(t, r, null);
2195
2244
  }
2196
2245
  }
2197
- function Qo(t, e) {
2246
+ function Go(t, e) {
2198
2247
  if (!t) return null;
2199
2248
  const [o, i, r] = t.split("-").map(Number), s = new Date(o, i - 1, r);
2200
2249
  if (isNaN(s.getTime())) return null;
@@ -2208,36 +2257,36 @@ function Qo(t, e) {
2208
2257
  return t;
2209
2258
  }
2210
2259
  }
2211
- function Tt(t, e) {
2260
+ function Mt(t, e) {
2212
2261
  const o = parseInt(e.dataset.row || "0", 10), i = e.dataset.field || "";
2213
2262
  let r;
2214
2263
  if (e instanceof HTMLInputElement)
2215
2264
  if (e.type === "checkbox") {
2216
2265
  const s = JSON.parse(e.dataset.trueValue || "true"), n = JSON.parse(e.dataset.falseValue || "false");
2217
2266
  r = e.checked ? s : n;
2218
- } else e.classList.contains("wg__editor--number") ? r = e.value === "" ? null : parseFloat(e.value) : e.type === "date" ? r = Qo(e.value, e.dataset.outputFormat || "iso") : r = e.value;
2267
+ } else e.classList.contains("wg__editor--number") ? r = e.value === "" ? null : parseFloat(e.value) : e.type === "date" ? r = Go(e.value, e.dataset.outputFormat || "iso") : r = e.value;
2219
2268
  else e instanceof HTMLSelectElement && (r = e.value);
2220
2269
  t.grid.commitEdit(o, i, r);
2221
2270
  }
2222
- function Go(t, e) {
2223
- Tt(t, e);
2271
+ function Jo(t, e) {
2272
+ Mt(t, e);
2224
2273
  }
2225
- function Jo(t, e, o) {
2274
+ function Zo(t, e, o) {
2226
2275
  const i = t.grid.columns[o];
2227
2276
  if (!i) return;
2228
2277
  const r = String(i.field), s = t.grid.displayItems[e];
2229
2278
  if (!s) return;
2230
- const n = i.editorOptions || {}, d = n.trueValue ?? !0, a = n.falseValue ?? !1, l = s[r] === d ? a : d;
2231
- t.grid.commitEdit(e, r, l);
2232
- const g = t.grid.displayItems;
2233
- e < g.length - 1 && requestAnimationFrame(() => {
2234
- E(t, e + 1, o);
2279
+ const n = i.editorOptions || {}, d = n.trueValue ?? !0, a = n.falseValue ?? !1, g = s[r] === d ? a : d;
2280
+ t.grid.commitEdit(e, r, g);
2281
+ const l = t.grid.displayItems;
2282
+ e < l.length - 1 && requestAnimationFrame(() => {
2283
+ $(t, e + 1, o);
2235
2284
  });
2236
2285
  }
2237
- function Zo(t, e) {
2238
- t.isCommittingFromKeyboard || t.grid.editingCell && Tt(t, e);
2286
+ function ti(t, e) {
2287
+ t.isCommittingFromKeyboard || t.grid.editingCell && Mt(t, e);
2239
2288
  }
2240
- function Ft(t, e, o, i) {
2289
+ function Vt(t, e, o, i) {
2241
2290
  const s = t.grid.columns.findIndex((c) => String(c.field) === o), n = t.grid.displayItems;
2242
2291
  let d = e, a = s;
2243
2292
  if (i === "down")
@@ -2245,42 +2294,42 @@ function Ft(t, e, o, i) {
2245
2294
  else if (i === "up")
2246
2295
  d = Math.max(e - 1, 0);
2247
2296
  else {
2248
- const c = t.grid.getEditableColumns(), l = c.findIndex((g) => g.index === s);
2249
- i === "next" ? l >= 0 && l < c.length - 1 ? a = c[l + 1].index : e < n.length - 1 && (d = e + 1, a = c[0].index) : l > 0 ? a = c[l - 1].index : e > 0 && (d = e - 1, a = c[c.length - 1].index);
2297
+ const c = t.grid.getEditableColumns(), g = c.findIndex((l) => l.index === s);
2298
+ i === "next" ? g >= 0 && g < c.length - 1 ? a = c[g + 1].index : e < n.length - 1 && (d = e + 1, a = c[0].index) : g > 0 ? a = c[g - 1].index : e > 0 && (d = e - 1, a = c[c.length - 1].index);
2250
2299
  }
2251
2300
  requestAnimationFrame(() => {
2252
- E(t, d, a), t.isCommittingFromKeyboard = !1;
2301
+ $(t, d, a), t.isCommittingFromKeyboard = !1;
2253
2302
  });
2254
2303
  }
2255
- function ti(t, e, o) {
2304
+ function ei(t, e, o) {
2256
2305
  const r = t.grid.columns.findIndex((s) => String(s.field) === o);
2257
2306
  r >= 0 && requestAnimationFrame(() => {
2258
- E(t, e, r), t.isCommittingFromKeyboard = !1;
2307
+ $(t, e, r), t.isCommittingFromKeyboard = !1;
2259
2308
  });
2260
2309
  }
2261
- function Ie(t, e, o, i) {
2310
+ function Le(t, e, o, i) {
2262
2311
  const r = String(i.field), s = t.grid.displayItems[e], n = t.grid.getCellRawValue(s, e, r);
2263
2312
  switch (i.editor || "text") {
2264
2313
  case "checkbox":
2265
- return ni(t, e, r, n, i);
2314
+ return si(t, e, r, n, i);
2266
2315
  case "number":
2267
- return oi(t, e, r, n, i);
2268
- case "date":
2269
2316
  return ii(t, e, r, n, i);
2317
+ case "date":
2318
+ return ri(t, e, r, n, i);
2270
2319
  case "select":
2271
- return si(t, e, r, n, i);
2272
- case "combobox":
2273
2320
  return ai(t, e, r, n, i);
2274
- case "autocomplete":
2321
+ case "combobox":
2275
2322
  return li(t, e, r, n, i);
2276
- case "custom":
2323
+ case "autocomplete":
2277
2324
  return di(t, e, r, n, i);
2325
+ case "custom":
2326
+ return ci(t, e, r, n, i);
2278
2327
  case "text":
2279
2328
  default:
2280
- return ei(t, e, r, n, i);
2329
+ return oi(t, e, r, n, i);
2281
2330
  }
2282
2331
  }
2283
- function ei(t, e, o, i, r) {
2332
+ function oi(t, e, o, i, r) {
2284
2333
  var a;
2285
2334
  const s = r.editorOptions || {}, n = (a = t.grid.editingCell) == null ? void 0 : a.initialSearchQuery, d = n !== void 0 ? n : i != null ? String(i) : "";
2286
2335
  return `
@@ -2296,7 +2345,7 @@ function ei(t, e, o, i, r) {
2296
2345
  />
2297
2346
  `;
2298
2347
  }
2299
- function oi(t, e, o, i, r) {
2348
+ function ii(t, e, o, i, r) {
2300
2349
  var d;
2301
2350
  r.editorOptions;
2302
2351
  const s = (d = t.grid.editingCell) == null ? void 0 : d.initialSearchQuery;
@@ -2311,9 +2360,9 @@ function oi(t, e, o, i, r) {
2311
2360
  />
2312
2361
  `;
2313
2362
  }
2314
- function ii(t, e, o, i, r) {
2363
+ function ri(t, e, o, i, r) {
2315
2364
  var c;
2316
- const s = r.editorOptions || {}, n = (c = t.grid.editingCell) == null ? void 0 : c.initialSearchQuery, d = Vt(i), a = n !== void 0 ? n : ri(i, s.dateFormat);
2365
+ const s = r.editorOptions || {}, n = (c = t.grid.editingCell) == null ? void 0 : c.initialSearchQuery, d = Ft(i), a = n !== void 0 ? n : ni(i, s.dateFormat);
2317
2366
  return `
2318
2367
  <div class="wg__editor wg__editor--date" data-row="${e}" data-field="${o}">
2319
2368
  <input
@@ -2325,8 +2374,8 @@ function ii(t, e, o, i, r) {
2325
2374
  data-date-value="${d}"
2326
2375
  data-output-format="${s.outputFormat || "iso"}"
2327
2376
  data-date-format="${s.dateFormat || "YYYY-MM-DD"}"
2328
- ${s.minDate ? `data-min-date="${Vt(s.minDate)}"` : ""}
2329
- ${s.maxDate ? `data-max-date="${Vt(s.maxDate)}"` : ""}
2377
+ ${s.minDate ? `data-min-date="${Ft(s.minDate)}"` : ""}
2378
+ ${s.maxDate ? `data-max-date="${Ft(s.maxDate)}"` : ""}
2330
2379
  placeholder="${t.escapeHtml(s.dateFormat || "YYYY-MM-DD")}"
2331
2380
  />
2332
2381
  <button type="button" class="wg__date-trigger" tabindex="-1">
@@ -2335,21 +2384,21 @@ function ii(t, e, o, i, r) {
2335
2384
  </div>
2336
2385
  `;
2337
2386
  }
2338
- function ri(t, e) {
2387
+ function ni(t, e) {
2339
2388
  if (!t) return "";
2340
2389
  let o = null;
2341
2390
  if (t instanceof Date ? o = t : typeof t == "number" ? o = new Date(t) : typeof t == "string" && (o = new Date(t)), !o || isNaN(o.getTime())) return "";
2342
2391
  const i = e || "YYYY-MM-DD", r = o.getFullYear(), s = String(o.getMonth() + 1).padStart(2, "0"), n = String(o.getDate()).padStart(2, "0");
2343
2392
  return i.replace("YYYY", String(r)).replace("YY", String(r).slice(-2)).replace("MM", s).replace("DD", n);
2344
2393
  }
2345
- function Vt(t) {
2394
+ function Ft(t) {
2346
2395
  if (!t) return "";
2347
2396
  let e = null;
2348
2397
  if (t instanceof Date ? e = t : typeof t == "number" ? e = new Date(t) : typeof t == "string" && (e = new Date(t)), !e || isNaN(e.getTime())) return "";
2349
2398
  const o = e.getFullYear(), i = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
2350
2399
  return `${o}-${i}-${r}`;
2351
2400
  }
2352
- function ni(t, e, o, i, r) {
2401
+ function si(t, e, o, i, r) {
2353
2402
  const s = r.editorOptions || {}, n = s.trueValue !== void 0 ? s.trueValue : !0;
2354
2403
  return `
2355
2404
  <input
@@ -2363,10 +2412,10 @@ function ni(t, e, o, i, r) {
2363
2412
  />
2364
2413
  `;
2365
2414
  }
2366
- function si(t, e, o, i, r) {
2415
+ function ai(t, e, o, i, r) {
2367
2416
  var c;
2368
2417
  const s = r.editorOptions || {}, n = s.options || [], d = Jt(i, n, s), a = (c = t.grid.editingCell) == null ? void 0 : c.initialSearchQuery;
2369
- return t.dropdownOptions = n, t.filterText = a || "", t.highlightedIndex = n.findIndex((l) => at(l, s) === i), t.highlightedIndex < 0 && n.length > 0 && (t.highlightedIndex = 0), `
2418
+ return t.dropdownOptions = n, t.filterText = a || "", t.highlightedIndex = n.findIndex((g) => at(g, s) === i), t.highlightedIndex < 0 && n.length > 0 && (t.highlightedIndex = 0), `
2370
2419
  <div
2371
2420
  class="wg__editor wg__editor--select wg__select-trigger"
2372
2421
  tabindex="0"
@@ -2380,9 +2429,9 @@ function si(t, e, o, i, r) {
2380
2429
  </div>
2381
2430
  `;
2382
2431
  }
2383
- function ai(t, e, o, i, r) {
2384
- var l;
2385
- const s = r.editorOptions || {}, n = s.options || [], d = Jt(i, n, s), a = (l = t.grid.editingCell) == null ? void 0 : l.initialSearchQuery, c = a !== void 0 ? a : d;
2432
+ function li(t, e, o, i, r) {
2433
+ var g;
2434
+ const s = r.editorOptions || {}, n = s.options || [], d = Jt(i, n, s), a = (g = t.grid.editingCell) == null ? void 0 : g.initialSearchQuery, c = a !== void 0 ? a : d;
2386
2435
  return t.dropdownOptions = n, t.filterText = c, t.highlightedIndex = n.length > 0 ? 0 : -1, `
2387
2436
  <div class="wg__editor wg__editor--combobox" data-row="${e}" data-field="${o}">
2388
2437
  <input
@@ -2396,9 +2445,9 @@ function ai(t, e, o, i, r) {
2396
2445
  </div>
2397
2446
  `;
2398
2447
  }
2399
- function li(t, e, o, i, r) {
2400
- var l;
2401
- const s = r.editorOptions || {}, n = s.initialOptions || s.options || [], d = Jt(i, n, s), a = (l = t.grid.editingCell) == null ? void 0 : l.initialSearchQuery, c = a !== void 0 ? a : d;
2448
+ function di(t, e, o, i, r) {
2449
+ var g;
2450
+ const s = r.editorOptions || {}, n = s.initialOptions || s.options || [], d = Jt(i, n, s), a = (g = t.grid.editingCell) == null ? void 0 : g.initialSearchQuery, c = a !== void 0 ? a : d;
2402
2451
  return t.dropdownOptions = n, t.filterText = c, t.highlightedIndex = n.length > 0 ? 0 : -1, `
2403
2452
  <div class="wg__editor wg__editor--autocomplete" data-row="${e}" data-field="${o}">
2404
2453
  <input
@@ -2414,7 +2463,7 @@ function li(t, e, o, i, r) {
2414
2463
  </div>
2415
2464
  `;
2416
2465
  }
2417
- function di(t, e, o, i, r) {
2466
+ function ci(t, e, o, i, r) {
2418
2467
  const s = r.formatCallback ? r.formatCallback(i, t.grid.displayItems[e]) : i != null ? String(i) : "";
2419
2468
  return `
2420
2469
  <div
@@ -2427,7 +2476,7 @@ function di(t, e, o, i, r) {
2427
2476
  </div>
2428
2477
  `;
2429
2478
  }
2430
- function Pe(t, e, o, i, r, s) {
2479
+ function Ie(t, e, o, i, r, s) {
2431
2480
  const n = i.editor === "select" || i.editor === "combobox" || i.editor === "autocomplete", d = i.editor === "date", a = String(i.field);
2432
2481
  return n ? `
2433
2482
  <div class="wg__cell-dropdown-display ${t.grid.getEffectiveToggleVisibility(i) === "on-focus" ? "wg__cell-dropdown-display--toggle-on-focus" : ""}" data-row="${e}" data-field="${a}">
@@ -2443,22 +2492,22 @@ function Pe(t, e, o, i, r, s) {
2443
2492
  </div>
2444
2493
  ` : i.templateCallback ? `<span class="wg__cell-text">${r}</span>` : `<span class="wg__cell-text">${t.escapeHtml(r)}</span>`;
2445
2494
  }
2446
- let V = {
2495
+ let P = {
2447
2496
  path: null,
2448
2497
  arrowPos: null,
2449
2498
  arrowDir: "right"
2450
2499
  };
2451
- const ci = {
2500
+ const gi = {
2452
2501
  add: { icon: "+", title: "Add row" },
2453
2502
  delete: { icon: "−", title: "Delete row", danger: !0 },
2454
2503
  duplicate: { icon: "⧉", title: "Duplicate row" },
2455
2504
  moveUp: { icon: "↑", title: "Move up" },
2456
2505
  moveDown: { icon: "↓", title: "Move down" }
2457
2506
  };
2458
- function gi(t) {
2507
+ function ui(t) {
2459
2508
  return t.map((e, o) => {
2460
2509
  if (typeof e == "string") {
2461
- const i = ci[e];
2510
+ const i = gi[e];
2462
2511
  return i ? {
2463
2512
  id: e,
2464
2513
  icon: i.icon,
@@ -2483,7 +2532,7 @@ function gi(t) {
2483
2532
  };
2484
2533
  }).filter((e) => e !== null);
2485
2534
  }
2486
- function ui(t) {
2535
+ function hi(t) {
2487
2536
  const e = /* @__PURE__ */ new Map();
2488
2537
  for (const r of t) {
2489
2538
  const s = r.row;
@@ -2507,146 +2556,179 @@ function ui(t) {
2507
2556
  }
2508
2557
  return o;
2509
2558
  }
2510
- function hi(t, e, o) {
2511
- return `<div class="wg__toolbar">${ui(t).map(({ groups: s }) => `<div class="wg__toolbar-row">${s.map(({ items: d }, a) => {
2512
- const c = a > 0 ? '<div class="wg__toolbar-divider"></div>' : "", l = d.map((g) => {
2513
- const h = typeof g.disabled == "function" ? g.disabled(e, o) : g.disabled, u = [
2559
+ function pi(t, e, o, i = !1) {
2560
+ let r = hi(t);
2561
+ return i && (r = r.reverse()), `<div class="wg__toolbar">${r.map(({ groups: n }) => `<div class="wg__toolbar-row">${n.map(({ items: a }, c) => {
2562
+ const g = c > 0 ? '<div class="wg__toolbar-divider"></div>' : "", l = a.map((h) => {
2563
+ const u = typeof h.disabled == "function" ? h.disabled(e, o) : h.disabled, p = [
2514
2564
  "wg__toolbar-btn",
2515
- g.danger ? "wg__toolbar-btn--danger" : ""
2516
- ].filter(Boolean).join(" "), p = g.label ? `<span class="wg__toolbar-label">${g.label}</span>` : "";
2565
+ h.danger ? "wg__toolbar-btn--danger" : ""
2566
+ ].filter(Boolean).join(" "), m = h.label ? `<span class="wg__toolbar-label">${h.label}</span>` : "";
2517
2567
  return `<button
2518
- class="${u}"
2519
- data-toolbar-item="${g.id}"
2520
- title="${g.title}"
2521
- ${h ? "disabled" : ""}
2522
- >${g.icon}${p}</button>`;
2568
+ class="${p}"
2569
+ data-toolbar-item="${h.id}"
2570
+ title="${h.title}"
2571
+ ${u ? "disabled" : ""}
2572
+ >${h.icon}${m}</button>`;
2523
2573
  }).join("");
2524
- return c + l;
2574
+ return g + l;
2525
2575
  }).join("")}</div>`).join("")}</div>`;
2526
2576
  }
2527
- let $ = null;
2528
- function pi(t, e, o, i, r, s, n) {
2529
- Et();
2530
- const d = hi(i, r, o), a = document.createElement("div");
2531
- a.className = "wg__toolbar-container", a.innerHTML = d, t.shadow.appendChild(a);
2532
- const c = a.querySelector(".wg__toolbar");
2577
+ let M = null;
2578
+ function fi(t, e, o, i, r, s, n) {
2579
+ At();
2580
+ const d = t.grid.toolbarVerticalAlign !== "top", a = pi(i, r, o, d), c = document.createElement("div");
2581
+ c.className = "wg__toolbar-container", c.innerHTML = a, t.shadow.appendChild(c);
2582
+ const g = c.querySelector(".wg__toolbar");
2533
2583
  let l = "left";
2534
- requestAnimationFrame(() => {
2535
- const h = t.shadow.querySelector(`tr[data-row-index="${o}"]`);
2536
- if (!h) {
2537
- Et();
2584
+ g.style.position = "fixed", g.style.visibility = "hidden", requestAnimationFrame(() => {
2585
+ const u = t.shadow.querySelector(`tr[data-row-index="${o}"]`);
2586
+ if (!u) {
2587
+ At();
2538
2588
  return;
2539
2589
  }
2540
- const u = h.getBoundingClientRect(), p = c.getBoundingClientRect(), m = t.shadow.querySelector(".wg__table"), f = m == null ? void 0 : m.getBoundingClientRect(), v = 100;
2541
- f && (f.left >= v ? l = "left" : window.innerWidth - f.right >= v ? l = "right" : l = "top");
2542
- let b, _;
2543
- if (l === "left")
2544
- b = u.left - p.width, _ = u.top + (u.height - p.height) / 2;
2545
- else if (l === "right")
2546
- b = u.right, _ = u.top + (u.height - p.height) / 2;
2547
- else {
2548
- _ = u.top - p.height;
2549
- const S = t.grid.toolbarTopPosition;
2550
- S === "start" ? b = u.left : S === "end" ? b = u.right - p.width : S === "cursor" && n !== void 0 ? b = n - p.width / 2 : b = u.left + (u.width - p.width) / 2;
2590
+ const p = t.grid.toolbarPosition, m = t.grid.toolbarVerticalAlign, b = t.grid.toolbarHorizontalAlign;
2591
+ let f, _, v = "";
2592
+ m === "top" ? v = "-end" : m === "bottom" && (v = "-start");
2593
+ const S = () => b === "start" ? "top-start" : b === "end" ? "top-end" : "top";
2594
+ p === "left" ? (f = `left${v}`, _ = [`right${v}`, S()]) : p === "right" ? (f = `right${v}`, _ = [`left${v}`, S()]) : p === "top" ? (f = S(), _ = [`left${v}`, `right${v}`]) : (f = `left${v}`, _ = [`right${v}`, S()]);
2595
+ let C = u;
2596
+ if (b === "cursor" && n !== void 0 && p === "top") {
2597
+ const x = u.getBoundingClientRect();
2598
+ C = {
2599
+ getBoundingClientRect: () => ({
2600
+ x: n,
2601
+ y: x.top,
2602
+ top: x.top,
2603
+ left: n,
2604
+ bottom: x.bottom,
2605
+ right: n,
2606
+ width: 0,
2607
+ height: x.height,
2608
+ toJSON: () => ({})
2609
+ })
2610
+ };
2551
2611
  }
2552
- l !== "top" && t.grid.toolbarAlign === "top" && (_ = u.top), b + p.width > window.innerWidth - 8 && (b = window.innerWidth - p.width - 8), b < 8 && (b = 8), _ + p.height > window.innerHeight - 8 && (_ = window.innerHeight - p.height - 8), _ < 8 && (_ = 8), Object.assign(c.style, {
2553
- position: "fixed",
2554
- left: `${b}px`,
2555
- top: `${_}px`
2556
- }), $ && ($.position = l);
2612
+ kt(C, g, {
2613
+ strategy: "fixed",
2614
+ placement: f,
2615
+ middleware: [
2616
+ xt({ fallbackPlacements: _ }),
2617
+ ne({ padding: 8 })
2618
+ // Keep within viewport
2619
+ ]
2620
+ }).then(({ x, y: D, placement: y }) => {
2621
+ Object.assign(g.style, {
2622
+ left: `${x}px`,
2623
+ top: `${D}px`,
2624
+ visibility: "visible"
2625
+ // Show now that it's positioned
2626
+ }), l = y.split("-")[0], M && (M.position = l);
2627
+ }).catch(() => {
2628
+ g.style.visibility = "visible";
2629
+ });
2557
2630
  });
2558
- const g = (h) => {
2559
- const u = h.target.closest(".wg__toolbar-btn");
2560
- if (u && !u.disabled) {
2561
- const p = u.dataset.toolbarItem || "", m = i.find((f) => f.id === p);
2562
- m && s(m);
2631
+ const h = (u) => {
2632
+ const p = u.target.closest(".wg__toolbar-btn");
2633
+ if (p && !p.disabled) {
2634
+ const m = p.dataset.toolbarItem || "", b = i.find((f) => f.id === m);
2635
+ b && s(b);
2563
2636
  }
2564
2637
  };
2565
- a.addEventListener("click", g), $ = {
2566
- container: a,
2567
- toolbar: c,
2638
+ c.addEventListener("click", h), M = {
2639
+ container: c,
2640
+ toolbar: g,
2568
2641
  rowIndex: o,
2569
2642
  rowItem: r,
2570
2643
  position: l,
2571
2644
  hasRowMoved: !1,
2572
2645
  cursorX: n,
2573
2646
  cleanup: () => {
2574
- a.removeEventListener("click", g), a.remove();
2647
+ c.removeEventListener("click", h), c.remove();
2575
2648
  }
2576
- }, V = { path: null, arrowPos: null, arrowDir: "right" };
2649
+ }, P = { path: null, arrowPos: null, arrowDir: "right" };
2577
2650
  }
2578
- function Et() {
2579
- $ && ($.cleanup(), $ = null), V = { path: null, arrowPos: null, arrowDir: "right" };
2651
+ function At() {
2652
+ M && (M.cleanup(), M = null), P = { path: null, arrowPos: null, arrowDir: "right" };
2580
2653
  }
2581
- function $t() {
2582
- return ($ == null ? void 0 : $.rowIndex) ?? null;
2654
+ function vt() {
2655
+ return (M == null ? void 0 : M.rowIndex) ?? null;
2583
2656
  }
2584
- function fi(t) {
2585
- return ($ == null ? void 0 : $.container.getRootNode()) === t;
2657
+ function wi(t) {
2658
+ return (M == null ? void 0 : M.container.getRootNode()) === t;
2586
2659
  }
2587
2660
  function qt(t) {
2588
- return ($ == null ? void 0 : $.rowIndex) === t;
2661
+ return (M == null ? void 0 : M.rowIndex) === t;
2589
2662
  }
2590
- function wi() {
2591
- return V;
2663
+ function mi() {
2664
+ return P;
2592
2665
  }
2593
- function mi(t, e) {
2594
- if (!$) {
2595
- V = { path: null, arrowPos: null, arrowDir: "right" };
2666
+ function _e(t, e) {
2667
+ if (!M) {
2668
+ P = { path: null, arrowPos: null, arrowDir: "right" };
2596
2669
  return;
2597
2670
  }
2598
- const { toolbar: o, rowItem: i, position: r } = $, s = e.findIndex((b) => b === i);
2671
+ const { toolbar: o, rowItem: i, position: r } = M, s = e.findIndex((C) => C === i);
2599
2672
  if (s === -1) {
2600
- V = { path: null, arrowPos: null, arrowDir: "right" };
2673
+ P = { path: null, arrowPos: null, arrowDir: "right" };
2601
2674
  return;
2602
2675
  }
2603
2676
  const n = t.shadow.querySelector(`tr[data-row-index="${s}"]`);
2604
2677
  if (!n) {
2605
- V = { path: null, arrowPos: null, arrowDir: "right" };
2678
+ P = { path: null, arrowPos: null, arrowDir: "right" };
2606
2679
  return;
2607
2680
  }
2608
- if (s === $.rowIndex || ($.hasRowMoved = !0), !$.hasRowMoved) {
2609
- V = { path: null, arrowPos: null, arrowDir: "right" };
2681
+ if (s === M.rowIndex || (M.hasRowMoved = !0), !M.hasRowMoved) {
2682
+ P = { path: null, arrowPos: null, arrowDir: "right" };
2610
2683
  return;
2611
2684
  }
2612
- const a = o.getBoundingClientRect(), c = n.getBoundingClientRect(), l = t.shadow.querySelector(".wg__table"), g = l == null ? void 0 : l.getBoundingClientRect();
2613
- if (!g) {
2614
- V = { path: null, arrowPos: null, arrowDir: "right" };
2685
+ const a = o.getBoundingClientRect(), c = n.getBoundingClientRect(), g = t.shadow.querySelector(".wg__table"), l = g == null ? void 0 : g.getBoundingClientRect(), h = t.shadow.querySelector(".wg"), u = h == null ? void 0 : h.getBoundingClientRect();
2686
+ if (!l || !u) {
2687
+ P = { path: null, arrowPos: null, arrowDir: "right" };
2615
2688
  return;
2616
2689
  }
2617
- const h = document.dir === "rtl" || document.documentElement.dir === "rtl";
2618
- c.bottom < a.top || c.top > a.bottom;
2619
- const u = h ? g.right + 15 : g.left - 15, p = h ? c.right + 8 : c.left - 8, m = c.top + c.height / 2;
2620
- let f, v = h ? "left" : "right";
2621
- if (r === "left") {
2622
- const b = a.right, _ = a.top + a.height / 2;
2623
- f = `M ${b} ${_} H ${u} V ${m} H ${p}`;
2690
+ const p = document.dir === "rtl" || document.documentElement.dir === "rtl", m = c.top + c.height / 2, b = c.bottom <= u.top, f = c.top >= u.bottom, _ = !b && !f;
2691
+ let v, S = "right";
2692
+ if (b ? (v = u.top + 8, S = "up") : f ? (v = u.bottom - 8, S = "down") : v = m, r === "left") {
2693
+ const C = a.right, x = a.top + a.height / 2, D = p ? u.right + 15 : u.left - 15;
2694
+ if (!_) {
2695
+ P = { path: `M ${C} ${x} H ${D} V ${v}`, arrowPos: { x: D, y: v }, arrowDir: S };
2696
+ return;
2697
+ }
2698
+ const y = p ? u.right - 8 : u.left + 8;
2699
+ S = p ? "left" : "right", P = { path: `M ${C} ${x} H ${D} V ${v} H ${y}`, arrowPos: { x: y, y: v }, arrowDir: S };
2700
+ return;
2624
2701
  } else if (r === "right") {
2625
- const b = a.left, _ = a.top + a.height / 2;
2626
- f = `M ${b} ${_} H ${u} V ${m} H ${p}`;
2702
+ const C = a.left, x = a.top + a.height / 2, D = p ? u.left - 15 : u.right + 15;
2703
+ if (!_) {
2704
+ P = { path: `M ${C} ${x} H ${D} V ${v}`, arrowPos: { x: D, y: v }, arrowDir: S };
2705
+ return;
2706
+ }
2707
+ const y = p ? u.left + 8 : u.right - 8;
2708
+ S = p ? "right" : "left", P = { path: `M ${C} ${x} H ${D} V ${v} H ${y}`, arrowPos: { x: y, y: v }, arrowDir: S };
2709
+ return;
2627
2710
  } else {
2628
- const _ = a.right, S = a.top + a.height / 2, y = _ + 48, D = s - $.rowIndex, x = 8;
2629
- if (D === 0) {
2630
- const C = c.top - x;
2631
- f = `M ${_} ${S} H ${y} V ${C}`, V = { path: f, arrowPos: { x: y, y: C }, arrowDir: "down" };
2711
+ const x = a.right, D = a.top + a.height / 2, y = x + 48, T = s - M.rowIndex, k = 8;
2712
+ if (T === 0) {
2713
+ let E = c.top - k;
2714
+ f && (E = u.bottom - k), P = { path: `M ${x} ${D} H ${y} V ${E}`, arrowPos: { x: y, y: E }, arrowDir: "down" };
2632
2715
  return;
2633
- } else if (D === -1) {
2634
- const T = a.top + a.height * 0.25, k = a.top + a.height * 0.75, I = a.right + 24, M = a.right + x;
2635
- f = `M ${a.right} ${T} H ${I} V ${k} H ${M}`, V = { path: f, arrowPos: { x: M, y: k }, arrowDir: "left" };
2716
+ } else if (T === -1) {
2717
+ const A = a.top + a.height * 0.25, I = a.top + a.height * 0.75, O = a.right + 24, H = a.right + k;
2718
+ P = { path: `M ${a.right} ${A} H ${O} V ${I} H ${H}`, arrowPos: { x: H, y: I }, arrowDir: "left" };
2636
2719
  return;
2637
- } else if (D < 0) {
2638
- const C = c.bottom + x;
2639
- f = `M ${_} ${S} H ${y} V ${C}`, V = { path: f, arrowPos: { x: y, y: C }, arrowDir: "up" };
2720
+ } else if (T < 0) {
2721
+ let E = c.bottom + k;
2722
+ b && (E = u.top + k), P = { path: `M ${x} ${D} H ${y} V ${E}`, arrowPos: { x: y, y: E }, arrowDir: "up" };
2640
2723
  return;
2641
2724
  } else {
2642
- const C = c.top - x;
2643
- f = `M ${_} ${S} H ${y} V ${C}`, V = { path: f, arrowPos: { x: y, y: C }, arrowDir: "down" };
2725
+ let E = c.top - k;
2726
+ f && (E = u.bottom - k), P = { path: `M ${x} ${D} H ${y} V ${E}`, arrowPos: { x: y, y: E }, arrowDir: "down" };
2644
2727
  return;
2645
2728
  }
2646
2729
  }
2647
- V = { path: f, arrowPos: { x: p, y: m }, arrowDir: v };
2648
2730
  }
2649
- function He(t, e) {
2731
+ function ze(t, e) {
2650
2732
  return `<button
2651
2733
  class="wg__toolbar-trigger ${e ? "wg__toolbar-trigger--active" : ""}"
2652
2734
  data-toolbar-trigger="${t}"
@@ -2661,27 +2743,27 @@ function vi(t) {
2661
2743
  const e = t.grid.columns;
2662
2744
  if (e.length === 0) return "";
2663
2745
  const o = t.grid.showRowNumbers ? '<th class="wg__header wg__row-number-header">#</th>' : "", r = t.grid.showRowToolbar && t.grid.toolbarTrigger === "button" ? '<th class="wg__header wg__actions-column"></th>' : "", s = e.map((n) => {
2664
- const d = String(n.field), a = n.sortable !== !1 && t.grid.sortMode !== "none", c = t.grid.getColumnSortState(d), l = t.grid.getColumnSortPriority(d), g = c !== void 0, h = ["wg__header"];
2665
- a && h.push("wg__header--sortable"), g && h.push("wg__header--sorted");
2746
+ const d = String(n.field), a = n.sortable !== !1 && t.grid.sortMode !== "none", c = t.grid.getColumnSortState(d), g = t.grid.getColumnSortPriority(d), l = c !== void 0, h = ["wg__header"];
2747
+ a && h.push("wg__header--sortable"), l && h.push("wg__header--sorted");
2666
2748
  const u = n.width || n.maxWidth, m = `style="${[
2667
2749
  u ? `width: ${u}` : "",
2668
2750
  n.minWidth ? `min-width: ${n.minWidth}` : "",
2669
2751
  `text-align: ${n.align || "left"}`
2670
2752
  ].filter(Boolean).join("; ")}"`;
2671
- let f = "";
2753
+ let b = "";
2672
2754
  if (a)
2673
- if (g) {
2674
- const b = c.direction === "asc" ? "▲" : "▼", _ = t.grid.sort.length > 1 ? `<sup class="wg__sort-priority">${l}</sup>` : "";
2675
- f = `<span class="wg__sort-indicator">${b}${_}</span>`;
2755
+ if (l) {
2756
+ const _ = c.direction === "asc" ? "▲" : "▼", v = t.grid.sort.length > 1 ? `<sup class="wg__sort-priority">${g}</sup>` : "";
2757
+ b = `<span class="wg__sort-indicator">${_}${v}</span>`;
2676
2758
  } else
2677
- f = '<span class="wg__sort-indicator wg__sort-placeholder">⬍</span>';
2678
- let v = "";
2679
- return n.headerInfo && (v = `<span class="wg__header-info" data-tooltip="${t.escapeHtml(n.headerInfo)}"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg></span>`), `
2759
+ b = '<span class="wg__sort-indicator wg__sort-placeholder">⬍</span>';
2760
+ let f = "";
2761
+ return n.headerInfo && (f = `<span class="wg__header-info" data-tooltip="${t.escapeHtml(n.headerInfo)}"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg></span>`), `
2680
2762
  <th class="${h.join(" ")}" ${m} data-field="${d}">
2681
2763
  <div class="wg__header-content">
2682
2764
  <span class="wg__header-title">${t.escapeHtml(n.title)}</span>
2683
- ${v}
2684
2765
  ${f}
2766
+ ${b}
2685
2767
  </div>
2686
2768
  </th>
2687
2769
  `;
@@ -2698,63 +2780,63 @@ function _i(t) {
2698
2780
  </td>
2699
2781
  </tr>
2700
2782
  `;
2701
- const n = $t();
2783
+ const n = vt();
2702
2784
  return e.map((d, a) => {
2703
2785
  const c = i ? `<td class="wg__cell wg__row-number">${a + 1}</td>` : "";
2704
- let l = "";
2705
- r && (l = `
2786
+ let g = "";
2787
+ r && (g = `
2706
2788
  <td class="wg__cell wg__actions-column">
2707
- ${He(a, n === a)}
2789
+ ${ze(a, n === a)}
2708
2790
  </td>
2709
2791
  `);
2710
- const g = o.map((u, p) => {
2711
- const m = String(u.field), f = t.grid.getCellValue(d, u, a), v = u.align || "left", b = t.grid.isCellEditable(u), _ = t.grid.isCellFocused(a, p), S = ["wg__cell"], y = t.grid.isEditing(a, m);
2712
- if (b && S.push("wg__cell--editable"), _ && !y && S.push("wg__cell--focused"), u.textOverflow === "ellipsis" && S.push("wg__cell--ellipsis"), y && S.push("wg__cell--editing"), t.grid.isCellInvalid(a, m) && S.push("wg__cell--invalid"), u.cellClass && S.push(u.cellClass), u.cellClassCallback) {
2792
+ const l = o.map((u, p) => {
2793
+ const m = String(u.field), b = t.grid.getCellValue(d, u, a), f = u.align || "left", _ = t.grid.isCellEditable(u), v = t.grid.isCellFocused(a, p), S = ["wg__cell"], C = t.grid.isEditing(a, m);
2794
+ if (_ && S.push("wg__cell--editable"), v && !C && S.push("wg__cell--focused"), u.textOverflow === "ellipsis" && S.push("wg__cell--ellipsis"), C && S.push("wg__cell--editing"), t.grid.isCellInvalid(a, m) && S.push("wg__cell--invalid"), u.cellClass && S.push(u.cellClass), u.cellClassCallback) {
2713
2795
  const T = t.grid.getCellRawValue(d, a, m), k = u.cellClassCallback(T, d);
2714
2796
  k && S.push(k);
2715
2797
  }
2716
- const D = [
2717
- `text-align: ${v}`,
2798
+ const x = [
2799
+ `text-align: ${f}`,
2718
2800
  u.width ? `width: ${u.width}` : "",
2719
2801
  u.minWidth ? `min-width: ${u.minWidth}` : "",
2720
2802
  u.maxWidth ? `max-width: ${u.maxWidth}` : ""
2721
- ].filter(Boolean).join("; "), x = t.grid.isNavigateMode ? 'tabindex="0"' : "";
2722
- let C = "";
2803
+ ].filter(Boolean).join("; "), D = t.grid.isNavigateMode ? 'tabindex="0"' : "";
2804
+ let y = "";
2723
2805
  if (u.tooltipCallback) {
2724
2806
  const T = t.grid.getCellRawValue(d, a, m), k = u.tooltipCallback(T, d);
2725
- k && (C = `data-tooltip="${t.escapeHtml(k)}"`);
2807
+ k && (y = `data-tooltip="${t.escapeHtml(k)}"`);
2726
2808
  } else if (u.tooltipMember) {
2727
2809
  const T = d[u.tooltipMember];
2728
- T && typeof T == "string" && (C = `data-tooltip="${t.escapeHtml(T)}"`);
2810
+ T && typeof T == "string" && (y = `data-tooltip="${t.escapeHtml(T)}"`);
2729
2811
  }
2730
- if (!C && t.grid.isCellInvalid(a, m)) {
2812
+ if (!y && t.grid.isCellInvalid(a, m)) {
2731
2813
  const T = t.grid.getCellValidationError(a, m);
2732
2814
  if (T) {
2733
2815
  const k = u.validationTooltipCallback || t.grid.validationTooltipCallback;
2734
2816
  if (k) {
2735
- const I = t.grid.getCellRawValue(d, a, m), M = k({
2817
+ const E = t.grid.getCellRawValue(d, a, m), A = k({
2736
2818
  field: m,
2737
2819
  error: T,
2738
- value: I,
2820
+ value: E,
2739
2821
  row: d,
2740
2822
  rowIndex: a
2741
2823
  });
2742
- M && (C = `data-tooltip-html="${t.escapeHtml(M)}"`);
2824
+ A && (y = `data-tooltip-html="${t.escapeHtml(A)}"`);
2743
2825
  }
2744
- C || (C = `data-tooltip="${t.escapeHtml(T)}"`);
2826
+ y || (y = `data-tooltip="${t.escapeHtml(T)}"`);
2745
2827
  }
2746
2828
  }
2747
2829
  return `
2748
2830
  <td
2749
2831
  class="${S.join(" ")}"
2750
- style="${D}"
2832
+ style="${x}"
2751
2833
  data-row="${a}"
2752
2834
  data-col="${p}"
2753
2835
  data-field="${m}"
2754
- ${x}
2755
- ${C}
2836
+ ${D}
2837
+ ${y}
2756
2838
  >
2757
- ${t.grid.isEditing(a, m) ? Ie(t, a, p, u) : Pe(t, a, p, u, f)}
2839
+ ${t.grid.isEditing(a, m) ? Le(t, a, p, u) : Ie(t, a, p, u, b)}
2758
2840
  </td>
2759
2841
  `;
2760
2842
  }).join(""), h = ["wg__row"];
@@ -2762,87 +2844,87 @@ function _i(t) {
2762
2844
  const u = t.grid.rowClassCallback(d, a);
2763
2845
  u && h.push(u);
2764
2846
  }
2765
- return `<tr class="${h.join(" ")}" data-row-index="${a}">${c}${l}${g}</tr>`;
2847
+ return `<tr class="${h.join(" ")}" data-row-index="${a}">${c}${g}${l}</tr>`;
2766
2848
  }).join("");
2767
2849
  }
2768
- function ve(t, e) {
2769
- const o = t.grid.displayItems, i = t.grid.columns, { startIndex: r, endIndex: s, rowHeight: n, totalItems: d } = e, a = t.grid.showRowNumbers, c = t.grid.showRowToolbar && t.grid.toolbarTrigger === "button", l = i.length + (c ? 1 : 0) + (a ? 1 : 0);
2850
+ function ye(t, e) {
2851
+ const o = t.grid.displayItems, i = t.grid.columns, { startIndex: r, endIndex: s, rowHeight: n, totalItems: d } = e, a = t.grid.showRowNumbers, c = t.grid.showRowToolbar && t.grid.toolbarTrigger === "button", g = i.length + (c ? 1 : 0) + (a ? 1 : 0);
2770
2852
  if (o.length === 0)
2771
2853
  return `
2772
2854
  <tr>
2773
- <td class="wg__empty" colspan="${l}">
2855
+ <td class="wg__empty" colspan="${g}">
2774
2856
  No items to display
2775
2857
  </td>
2776
2858
  </tr>
2777
2859
  `;
2778
- const g = $t(), h = r * n, u = (d - s) * n, p = h > 0 ? `<tr class="wg__spacer-top"><td colspan="${l}" style="height: ${h}px"></td></tr>` : "", m = [];
2779
- for (let v = r; v < s && v < o.length; v++) {
2780
- const b = o[v], _ = v, S = a ? `<td class="wg__cell wg__row-number">${_ + 1}</td>` : "";
2781
- let y = "";
2782
- c && (y = `
2860
+ const l = vt(), h = r * n, u = (d - s) * n, p = h > 0 ? `<tr class="wg__spacer-top"><td colspan="${g}" style="height: ${h}px"></td></tr>` : "", m = [];
2861
+ for (let f = r; f < s && f < o.length; f++) {
2862
+ const _ = o[f], v = f, S = a ? `<td class="wg__cell wg__row-number">${v + 1}</td>` : "";
2863
+ let C = "";
2864
+ c && (C = `
2783
2865
  <td class="wg__cell wg__actions-column">
2784
- ${He(_, g === _)}
2866
+ ${ze(v, l === v)}
2785
2867
  </td>
2786
2868
  `);
2787
- const D = i.map((C, T) => {
2788
- const k = String(C.field), I = t.grid.getCellValue(b, C, _), M = C.align || "left", Q = t.grid.isCellEditable(C), A = t.grid.isCellFocused(_, T), O = ["wg__cell"], U = t.grid.isEditing(_, k);
2789
- if (Q && O.push("wg__cell--editable"), A && !U && O.push("wg__cell--focused"), C.textOverflow === "ellipsis" && O.push("wg__cell--ellipsis"), U && O.push("wg__cell--editing"), t.grid.isCellInvalid(_, k) && O.push("wg__cell--invalid"), C.cellClass && O.push(C.cellClass), C.cellClassCallback) {
2790
- const z = t.grid.getCellRawValue(b, _, k), ot = C.cellClassCallback(z, b);
2791
- ot && O.push(ot);
2869
+ const x = i.map((y, T) => {
2870
+ const k = String(y.field), E = t.grid.getCellValue(_, y, v), A = y.align || "left", I = t.grid.isCellEditable(y), O = t.grid.isCellFocused(v, T), H = ["wg__cell"], z = t.grid.isEditing(v, k);
2871
+ if (I && H.push("wg__cell--editable"), O && !z && H.push("wg__cell--focused"), y.textOverflow === "ellipsis" && H.push("wg__cell--ellipsis"), z && H.push("wg__cell--editing"), t.grid.isCellInvalid(v, k) && H.push("wg__cell--invalid"), y.cellClass && H.push(y.cellClass), y.cellClassCallback) {
2872
+ const q = t.grid.getCellRawValue(_, v, k), ot = y.cellClassCallback(q, _);
2873
+ ot && H.push(ot);
2792
2874
  }
2793
- const P = [
2794
- `text-align: ${M}`,
2795
- C.width ? `width: ${C.width}` : "",
2796
- C.minWidth ? `min-width: ${C.minWidth}` : "",
2797
- C.maxWidth ? `max-width: ${C.maxWidth}` : ""
2798
- ].filter(Boolean).join("; "), H = t.grid.isNavigateMode ? 'tabindex="0"' : "";
2875
+ const V = [
2876
+ `text-align: ${A}`,
2877
+ y.width ? `width: ${y.width}` : "",
2878
+ y.minWidth ? `min-width: ${y.minWidth}` : "",
2879
+ y.maxWidth ? `max-width: ${y.maxWidth}` : ""
2880
+ ].filter(Boolean).join("; "), F = t.grid.isNavigateMode ? 'tabindex="0"' : "";
2799
2881
  let R = "";
2800
- if (C.tooltipCallback) {
2801
- const z = t.grid.getCellRawValue(b, _, k), ot = C.tooltipCallback(z, b);
2882
+ if (y.tooltipCallback) {
2883
+ const q = t.grid.getCellRawValue(_, v, k), ot = y.tooltipCallback(q, _);
2802
2884
  ot && (R = `data-tooltip="${t.escapeHtml(ot)}"`);
2803
- } else if (C.tooltipMember) {
2804
- const z = b[C.tooltipMember];
2805
- z && typeof z == "string" && (R = `data-tooltip="${t.escapeHtml(z)}"`);
2885
+ } else if (y.tooltipMember) {
2886
+ const q = _[y.tooltipMember];
2887
+ q && typeof q == "string" && (R = `data-tooltip="${t.escapeHtml(q)}"`);
2806
2888
  }
2807
- if (!R && t.grid.isCellInvalid(_, k)) {
2808
- const z = t.grid.getCellValidationError(_, k);
2809
- if (z) {
2810
- const ot = C.validationTooltipCallback || t.grid.validationTooltipCallback;
2889
+ if (!R && t.grid.isCellInvalid(v, k)) {
2890
+ const q = t.grid.getCellValidationError(v, k);
2891
+ if (q) {
2892
+ const ot = y.validationTooltipCallback || t.grid.validationTooltipCallback;
2811
2893
  if (ot) {
2812
- const qe = t.grid.getCellRawValue(b, _, k), se = ot({
2894
+ const Ye = t.grid.getCellRawValue(_, v, k), ae = ot({
2813
2895
  field: k,
2814
- error: z,
2815
- value: qe,
2816
- row: b,
2817
- rowIndex: _
2896
+ error: q,
2897
+ value: Ye,
2898
+ row: _,
2899
+ rowIndex: v
2818
2900
  });
2819
- se && (R = `data-tooltip-html="${t.escapeHtml(se)}"`);
2901
+ ae && (R = `data-tooltip-html="${t.escapeHtml(ae)}"`);
2820
2902
  }
2821
- R || (R = `data-tooltip="${t.escapeHtml(z)}"`);
2903
+ R || (R = `data-tooltip="${t.escapeHtml(q)}"`);
2822
2904
  }
2823
2905
  }
2824
2906
  return `
2825
2907
  <td
2826
- class="${O.join(" ")}"
2827
- style="${P}"
2828
- data-row="${_}"
2908
+ class="${H.join(" ")}"
2909
+ style="${V}"
2910
+ data-row="${v}"
2829
2911
  data-col="${T}"
2830
2912
  data-field="${k}"
2831
- ${H}
2913
+ ${F}
2832
2914
  ${R}
2833
2915
  >
2834
- ${t.grid.isEditing(_, k) ? Ie(t, _, T, C) : Pe(t, _, T, C, I)}
2916
+ ${t.grid.isEditing(v, k) ? Le(t, v, T, y) : Ie(t, v, T, y, E)}
2835
2917
  </td>
2836
2918
  `;
2837
- }).join(""), x = ["wg__row"];
2919
+ }).join(""), D = ["wg__row"];
2838
2920
  if (t.grid.rowClassCallback) {
2839
- const C = t.grid.rowClassCallback(b, _);
2840
- C && x.push(C);
2921
+ const y = t.grid.rowClassCallback(_, v);
2922
+ y && D.push(y);
2841
2923
  }
2842
- m.push(`<tr class="${x.join(" ")}" data-row-index="${_}">${S}${y}${D}</tr>`);
2924
+ m.push(`<tr class="${D.join(" ")}" data-row-index="${v}">${S}${C}${x}</tr>`);
2843
2925
  }
2844
- const f = u > 0 ? `<tr class="wg__spacer-bottom"><td colspan="${l}" style="height: ${u}px"></td></tr>` : "";
2845
- return p + m.join("") + f;
2926
+ const b = u > 0 ? `<tr class="wg__spacer-bottom"><td colspan="${g}" style="height: ${u}px"></td></tr>` : "";
2927
+ return p + m.join("") + b;
2846
2928
  }
2847
2929
  function Yt(t, e = "bottom-center") {
2848
2930
  const o = t.grid.showPagination;
@@ -2855,47 +2937,47 @@ function Yt(t, e = "bottom-center") {
2855
2937
  pageInfo: `Page ${i} of ${r}`,
2856
2938
  itemCount: `(${d} item${d !== 1 ? "s" : ""})`,
2857
2939
  perPage: "per page"
2858
- }, c = t.grid.paginationLabelsCallback, l = c ? c({ currentPage: i, totalPages: r, totalItems: d, pageSize: s }) : {}, g = { ...a, ...l }, h = e.startsWith("top-"), u = e.replace("top-", "").replace("bottom-", ""), p = ["wg__pagination"];
2940
+ }, c = t.grid.paginationLabelsCallback, g = c ? c({ currentPage: i, totalPages: r, totalItems: d, pageSize: s }) : {}, l = { ...a, ...g }, h = e.startsWith("top-"), u = e.replace("top-", "").replace("bottom-", ""), p = ["wg__pagination"];
2859
2941
  u === "left" ? p.push("wg__pagination--left") : u === "right" && p.push("wg__pagination--right"), h && p.push("wg__pagination--top");
2860
2942
  const m = {
2861
2943
  first: `
2862
2944
  <button class="wg__pagination-btn" data-action="first" ${i === 1 ? "disabled" : ""}>
2863
- ${g.first}
2945
+ ${l.first}
2864
2946
  </button>
2865
2947
  `,
2866
2948
  previous: `
2867
2949
  <button class="wg__pagination-btn" data-action="prev" ${i === 1 ? "disabled" : ""}>
2868
- ${g.previous}
2950
+ ${l.previous}
2869
2951
  </button>
2870
2952
  `,
2871
2953
  next: `
2872
2954
  <button class="wg__pagination-btn" data-action="next" ${i === r ? "disabled" : ""}>
2873
- ${g.next}
2955
+ ${l.next}
2874
2956
  </button>
2875
2957
  `,
2876
2958
  last: `
2877
2959
  <button class="wg__pagination-btn" data-action="last" ${i === r ? "disabled" : ""}>
2878
- ${g.last}
2960
+ ${l.last}
2879
2961
  </button>
2880
2962
  `,
2881
2963
  pageInfo: `
2882
2964
  <div class="wg__pagination-info">
2883
- ${g.pageInfo}
2884
- <span class="wg__pagination-count">${g.itemCount}</span>
2965
+ ${l.pageInfo}
2966
+ <span class="wg__pagination-count">${l.itemCount}</span>
2885
2967
  </div>
2886
2968
  `,
2887
2969
  pageSize: n.length > 0 ? `
2888
2970
  <div class="wg__pagination-pagesize">
2889
2971
  <select class="wg__pagination-select" data-action="pagesize">
2890
2972
  ${n.map(
2891
- (b) => `<option value="${b}" ${b === s ? "selected" : ""}>${b}</option>`
2973
+ (_) => `<option value="${_}" ${_ === s ? "selected" : ""}>${_}</option>`
2892
2974
  ).join("")}
2893
2975
  </select>
2894
- <span class="wg__pagination-label">${g.perPage}</span>
2976
+ <span class="wg__pagination-label">${l.perPage}</span>
2895
2977
  </div>
2896
2978
  ` : ""
2897
- }, v = t.grid.paginationLayout.split("|").map((b) => b.trim()).map((b) => m[b] || "").join("");
2898
- return `<div class="${p.join(" ")}">${v}</div>`;
2979
+ }, f = t.grid.paginationLayout.split("|").map((_) => _.trim()).map((_) => m[_] || "").join("");
2980
+ return `<div class="${p.join(" ")}">${f}</div>`;
2899
2981
  }
2900
2982
  function Nt(t, e) {
2901
2983
  const o = t.grid.summaryContentCallback;
@@ -2907,10 +2989,10 @@ function Nt(t, e) {
2907
2989
  currentPage: i,
2908
2990
  pageSize: r,
2909
2991
  metadata: t.grid.summaryMetadata
2910
- }), c = e.startsWith("top-"), l = e.replace("top-", "").replace("bottom-", ""), g = ["wg__summary"];
2911
- return l === "left" ? g.push("wg__summary--left") : l === "right" && g.push("wg__summary--right"), c && g.push("wg__summary--top"), `<div class="${g.join(" ")}">${a}</div>`;
2992
+ }), c = e.startsWith("top-"), g = e.replace("top-", "").replace("bottom-", ""), l = ["wg__summary"];
2993
+ return g === "left" ? l.push("wg__summary--left") : g === "right" && l.push("wg__summary--right"), c && l.push("wg__summary--top"), `<div class="${l.join(" ")}">${a}</div>`;
2912
2994
  }
2913
- const ze = {
2995
+ const Ve = {
2914
2996
  today: "Today",
2915
2997
  clear: "Clear",
2916
2998
  monthNames: [
@@ -2975,17 +3057,17 @@ function yi(t, e) {
2975
3057
  if (!t) return null;
2976
3058
  const { separator: o, parts: i } = e, r = t.split(o);
2977
3059
  let s = null, n = null, d = null;
2978
- if (r.forEach((c, l) => {
3060
+ if (r.forEach((c, g) => {
2979
3061
  if (c) {
2980
- if (i.year && i.year.index === l) {
2981
- const g = parseInt(c, 10);
2982
- i.year.length === 4 && c.length === 4 ? s = g : i.year.length === 2 && c.length === 2 && (s = g < 100 ? g + 2e3 : g);
2983
- } else if (i.month && i.month.index === l) {
2984
- const g = parseInt(c, 10);
2985
- c.length === 2 && g >= 1 && g <= 12 && (n = g);
2986
- } else if (i.day && i.day.index === l) {
2987
- const g = parseInt(c, 10);
2988
- c.length === 2 && g >= 1 && g <= 31 && (d = g);
3062
+ if (i.year && i.year.index === g) {
3063
+ const l = parseInt(c, 10);
3064
+ i.year.length === 4 && c.length === 4 ? s = l : i.year.length === 2 && c.length === 2 && (s = l < 100 ? l + 2e3 : l);
3065
+ } else if (i.month && i.month.index === g) {
3066
+ const l = parseInt(c, 10);
3067
+ c.length === 2 && l >= 1 && l <= 12 && (n = l);
3068
+ } else if (i.day && i.day.index === g) {
3069
+ const l = parseInt(c, 10);
3070
+ c.length === 2 && l >= 1 && l <= 31 && (d = l);
2989
3071
  }
2990
3072
  }
2991
3073
  }), s === null || n === null || d === null)
@@ -2993,7 +3075,7 @@ function yi(t, e) {
2993
3075
  const a = new Date(s, n - 1, d);
2994
3076
  return a.getMonth() !== n - 1 || a.getDate() !== d ? null : a;
2995
3077
  }
2996
- function N(t) {
3078
+ function j(t) {
2997
3079
  if (!t) return null;
2998
3080
  let e;
2999
3081
  if (typeof t == "string") {
@@ -3007,11 +3089,11 @@ function Wt(t) {
3007
3089
  const e = t.getFullYear(), o = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0");
3008
3090
  return `${e}-${o}-${i}`;
3009
3091
  }
3010
- function _t(t, e) {
3092
+ function yt(t, e) {
3011
3093
  return !t || !e ? !1 : t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
3012
3094
  }
3013
3095
  function Ci(t) {
3014
- return _t(t, /* @__PURE__ */ new Date());
3096
+ return yt(t, /* @__PURE__ */ new Date());
3015
3097
  }
3016
3098
  function gt(t, e) {
3017
3099
  return new Date(t, e + 1, 0).getDate();
@@ -3029,7 +3111,7 @@ function xi(t, e) {
3029
3111
  const o = parseInt(t, 10);
3030
3112
  return { min: o, max: o };
3031
3113
  }
3032
- function ki(t, e, o = ze) {
3114
+ function ki(t, e, o = Ve) {
3033
3115
  const i = Di(t, o), r = Ti(t, e, o), s = Ei(t, e, o), n = e.showTodayButton !== !1 ? Ai(o) : "";
3034
3116
  return `
3035
3117
  <div class="wg-datepicker">
@@ -3083,7 +3165,7 @@ function Ti(t, e, o) {
3083
3165
  `;
3084
3166
  }
3085
3167
  function Ei(t, e, o) {
3086
- const i = $i(o), r = Ve(t, e);
3168
+ const i = $i(o), r = qe(t, e);
3087
3169
  return `
3088
3170
  <div class="wg-datepicker__weekdays">
3089
3171
  ${i}
@@ -3096,35 +3178,35 @@ function Ei(t, e, o) {
3096
3178
  function $i(t) {
3097
3179
  return t.weekdayNamesShort.map((e) => `<div class="wg-datepicker__weekday">${e}</div>`).join("");
3098
3180
  }
3099
- function Ve(t, e) {
3100
- const { viewYear: o, viewMonth: i, selectedDate: r, focusedDate: s } = t, n = e.minDate ? N(e.minDate) : null, d = e.maxDate ? N(e.maxDate) : null, a = Si(o, i), c = gt(o, i), l = gt(o, i - 1), g = new Date(o, i - 1, 1), h = g.getFullYear(), u = g.getMonth(), p = new Date(o, i + 1, 1), m = p.getFullYear(), f = p.getMonth(), v = [];
3101
- for (let y = a - 1; y >= 0; y--) {
3102
- const D = l - y;
3103
- v.push({
3104
- date: new Date(h, u, D),
3105
- day: D,
3181
+ function qe(t, e) {
3182
+ const { viewYear: o, viewMonth: i, selectedDate: r, focusedDate: s } = t, n = e.minDate ? j(e.minDate) : null, d = e.maxDate ? j(e.maxDate) : null, a = Si(o, i), c = gt(o, i), g = gt(o, i - 1), l = new Date(o, i - 1, 1), h = l.getFullYear(), u = l.getMonth(), p = new Date(o, i + 1, 1), m = p.getFullYear(), b = p.getMonth(), f = [];
3183
+ for (let C = a - 1; C >= 0; C--) {
3184
+ const x = g - C;
3185
+ f.push({
3186
+ date: new Date(h, u, x),
3187
+ day: x,
3106
3188
  isOtherMonth: !0
3107
3189
  });
3108
3190
  }
3109
- for (let y = 1; y <= c; y++)
3110
- v.push({
3111
- date: new Date(o, i, y),
3112
- day: y,
3191
+ for (let C = 1; C <= c; C++)
3192
+ f.push({
3193
+ date: new Date(o, i, C),
3194
+ day: C,
3113
3195
  isOtherMonth: !1
3114
3196
  });
3115
- const _ = Math.ceil((a + c) / 7) * 7 - v.length;
3116
- for (let y = 1; y <= _; y++)
3117
- v.push({
3118
- date: new Date(m, f, y),
3119
- day: y,
3197
+ const v = Math.ceil((a + c) / 7) * 7 - f.length;
3198
+ for (let C = 1; C <= v; C++)
3199
+ f.push({
3200
+ date: new Date(m, b, C),
3201
+ day: C,
3120
3202
  isOtherMonth: !0
3121
3203
  });
3122
3204
  let S = "";
3123
- for (const y of v) {
3124
- const D = ["wg-datepicker__day"];
3125
- y.isOtherMonth && D.push("wg-datepicker__day--other-month"), Mi(y.date, n, d) && D.push("wg-datepicker__day--disabled"), Ci(y.date) && D.push("wg-datepicker__day--today"), _t(y.date, r) && D.push("wg-datepicker__day--selected"), _t(y.date, s) && D.push("wg-datepicker__day--focused");
3126
- const C = Wt(y.date);
3127
- S += `<div class="${D.join(" ")}" data-date="${C}">${y.day}</div>`;
3205
+ for (const C of f) {
3206
+ const x = ["wg-datepicker__day"];
3207
+ C.isOtherMonth && x.push("wg-datepicker__day--other-month"), Mi(C.date, n, d) && x.push("wg-datepicker__day--disabled"), Ci(C.date) && x.push("wg-datepicker__day--today"), yt(C.date, r) && x.push("wg-datepicker__day--selected"), yt(C.date, s) && x.push("wg-datepicker__day--focused");
3208
+ const y = Wt(C.date);
3209
+ S += `<div class="${x.join(" ")}" data-date="${y}">${C.day}</div>`;
3128
3210
  }
3129
3211
  return S;
3130
3212
  }
@@ -3142,20 +3224,20 @@ function Ai(t) {
3142
3224
  }
3143
3225
  function Oi(t, e, o) {
3144
3226
  const i = t.querySelector(".wg-datepicker__days");
3145
- i && (i.innerHTML = Ve(e, o));
3227
+ i && (i.innerHTML = qe(e, o));
3146
3228
  }
3147
- function Ri(t, e, o) {
3229
+ function Hi(t, e, o) {
3148
3230
  const i = t.querySelector(".wg-datepicker__month-year");
3149
3231
  if (i) {
3150
3232
  const r = o.monthNames[e.viewMonth];
3151
3233
  i.textContent = `${r} ${e.viewYear}`;
3152
3234
  }
3153
3235
  }
3154
- function Li(t, e) {
3236
+ function Ri(t, e) {
3155
3237
  const o = t.querySelector(".wg-datepicker__rolling-selector"), i = t.querySelector(".wg-datepicker__calendar");
3156
3238
  o && o.classList.toggle("wg-datepicker__rolling-selector--visible", e), i && i.classList.toggle("wg-datepicker__calendar--hidden", e);
3157
3239
  }
3158
- function Ii(t, e) {
3240
+ function Pi(t, e) {
3159
3241
  t.querySelectorAll("[data-year]").forEach((r) => {
3160
3242
  const s = parseInt(r.dataset.year || "0", 10);
3161
3243
  r.classList.toggle("wg-datepicker__rolling-item--selected", s === e.viewYear);
@@ -3164,7 +3246,7 @@ function Ii(t, e) {
3164
3246
  r.classList.toggle("wg-datepicker__rolling-item--selected", s === e.viewMonth);
3165
3247
  });
3166
3248
  }
3167
- function _e(t) {
3249
+ function Ce(t) {
3168
3250
  const e = t.querySelector("[data-year].wg-datepicker__rolling-item--selected"), o = t.querySelector("[data-month].wg-datepicker__rolling-item--selected");
3169
3251
  if (e) {
3170
3252
  const i = e.parentElement;
@@ -3187,7 +3269,7 @@ function Xt(t) {
3187
3269
  function Qt(t) {
3188
3270
  t.viewMonth === 11 ? (t.viewMonth = 0, t.viewYear++) : t.viewMonth++;
3189
3271
  }
3190
- function Pi(t, e, o, i) {
3272
+ function Li(t, e, o, i) {
3191
3273
  var s, n, d, a;
3192
3274
  const { key: r } = t;
3193
3275
  if (r === "Escape")
@@ -3202,18 +3284,18 @@ function Pi(t, e, o, i) {
3202
3284
  return !0;
3203
3285
  }
3204
3286
  if (["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(r))
3205
- return t.preventDefault(), Hi(e, r, o), !0;
3287
+ return t.preventDefault(), Ii(e, r, o), !0;
3206
3288
  if (r === "Enter")
3207
- return t.preventDefault(), e.focusedDate && ((n = i.onSelect) == null || n.call(i, e.focusedDate, "down")), !0;
3289
+ return t.preventDefault(), t.stopPropagation(), e.focusedDate && ((n = i.onSelect) == null || n.call(i, e.focusedDate, "down")), !0;
3208
3290
  if (r === "Tab")
3209
3291
  return e.focusedDate ? (d = i.onSelect) == null || d.call(i, e.focusedDate, "next") : (a = i.onClose) == null || a.call(i), !1;
3210
3292
  if (r === "Home") {
3211
3293
  if (t.preventDefault(), t.ctrlKey || t.metaKey) {
3212
3294
  let c = e.viewYear;
3213
- const l = new Date(c, 0, 1);
3214
- if (e.focusedDate && _t(e.focusedDate, l) && c--, o.minDate) {
3215
- const g = N(o.minDate);
3216
- g && c < g.getFullYear() && (c = g.getFullYear());
3295
+ const g = new Date(c, 0, 1);
3296
+ if (e.focusedDate && yt(e.focusedDate, g) && c--, o.minDate) {
3297
+ const l = j(o.minDate);
3298
+ l && c < l.getFullYear() && (c = l.getFullYear());
3217
3299
  }
3218
3300
  e.viewMonth = 0, e.viewYear = c, e.focusedDate = new Date(c, 0, 1);
3219
3301
  } else
@@ -3223,10 +3305,10 @@ function Pi(t, e, o, i) {
3223
3305
  if (r === "End") {
3224
3306
  if (t.preventDefault(), t.ctrlKey || t.metaKey) {
3225
3307
  let c = e.viewYear;
3226
- const l = new Date(c, 11, 31);
3227
- if (e.focusedDate && _t(e.focusedDate, l) && c++, o.maxDate) {
3228
- const g = N(o.maxDate);
3229
- g && c > g.getFullYear() && (c = g.getFullYear());
3308
+ const g = new Date(c, 11, 31);
3309
+ if (e.focusedDate && yt(e.focusedDate, g) && c++, o.maxDate) {
3310
+ const l = j(o.maxDate);
3311
+ l && c > l.getFullYear() && (c = l.getFullYear());
3230
3312
  }
3231
3313
  e.viewMonth = 11, e.viewYear = c, e.focusedDate = new Date(c, 11, 31);
3232
3314
  } else {
@@ -3251,12 +3333,12 @@ function Pi(t, e, o, i) {
3251
3333
  }
3252
3334
  return !1;
3253
3335
  }
3254
- function Hi(t, e, o) {
3336
+ function Ii(t, e, o) {
3255
3337
  if (!t.focusedDate) {
3256
3338
  t.focusedDate = t.selectedDate ? new Date(t.selectedDate) : new Date(t.viewYear, t.viewMonth, 1);
3257
3339
  return;
3258
3340
  }
3259
- const i = new Date(t.focusedDate), r = o.minDate ? N(o.minDate) : null, s = o.maxDate ? N(o.maxDate) : null;
3341
+ const i = new Date(t.focusedDate), r = o.minDate ? j(o.minDate) : null, s = o.maxDate ? j(o.maxDate) : null;
3260
3342
  switch (e) {
3261
3343
  case "ArrowLeft":
3262
3344
  i.setDate(i.getDate() - 1);
@@ -3287,7 +3369,7 @@ function zi(t, e) {
3287
3369
  }
3288
3370
  return o === "ArrowLeft" || o === "ArrowRight" ? (t.preventDefault(), e.rollingSelectorMode = e.rollingSelectorMode === "month" ? "year" : "month", !0) : o === "Enter" || o === "Escape" ? (t.preventDefault(), e.rollingSelectorOpen = !1, !0) : !1;
3289
3371
  }
3290
- function Fi(t) {
3372
+ function Vi(t) {
3291
3373
  if (t.selectedDate)
3292
3374
  t.focusedDate = new Date(t.selectedDate), t.viewYear = t.selectedDate.getFullYear(), t.viewMonth = t.selectedDate.getMonth();
3293
3375
  else {
@@ -3295,17 +3377,17 @@ function Fi(t) {
3295
3377
  t.focusedDate = new Date(t.viewYear, t.viewMonth, e.getDate());
3296
3378
  }
3297
3379
  }
3298
- function Vi(t, e, o) {
3380
+ function Fi(t, e, o) {
3299
3381
  const i = t.dataset.date;
3300
3382
  if (!i || t.classList.contains("wg-datepicker__day--disabled"))
3301
3383
  return null;
3302
- const [r, s, n] = i.split("-").map(Number), d = new Date(r, s - 1, n), a = o.minDate ? N(o.minDate) : null, c = o.maxDate ? N(o.maxDate) : null;
3384
+ const [r, s, n] = i.split("-").map(Number), d = new Date(r, s - 1, n), a = o.minDate ? j(o.minDate) : null, c = o.maxDate ? j(o.maxDate) : null;
3303
3385
  return a && d < a || c && d > c ? null : (e.selectedDate = d, e.focusedDate = d, d);
3304
3386
  }
3305
3387
  function qi(t, e) {
3306
3388
  const o = /* @__PURE__ */ new Date();
3307
3389
  o.setHours(0, 0, 0, 0);
3308
- const i = e.minDate ? N(e.minDate) : null, r = e.maxDate ? N(e.maxDate) : null;
3390
+ const i = e.minDate ? j(e.minDate) : null, r = e.maxDate ? j(e.maxDate) : null;
3309
3391
  return i && o < i || r && o > r ? null : (t.selectedDate = o, t.focusedDate = o, t.viewYear = o.getFullYear(), t.viewMonth = o.getMonth(), o);
3310
3392
  }
3311
3393
  function Yi(t, e) {
@@ -3317,17 +3399,17 @@ function Ni(t, e) {
3317
3399
  o !== void 0 && (e.viewYear = parseInt(o, 10));
3318
3400
  }
3319
3401
  function Gt(t, e) {
3320
- var g, h, u, p;
3321
- const { separator: o, parts: i, maxLength: r } = e, s = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = t.replace(new RegExp(s, "g"), ""), d = ((g = i.year) == null ? void 0 : g.length) ?? 4, a = [
3402
+ var l, h, u, p;
3403
+ const { separator: o, parts: i, maxLength: r } = e, s = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = t.replace(new RegExp(s, "g"), ""), d = ((l = i.year) == null ? void 0 : l.length) ?? 4, a = [
3322
3404
  { type: "year", pos: ((h = i.year) == null ? void 0 : h.index) ?? 0, length: d },
3323
3405
  { type: "month", pos: ((u = i.month) == null ? void 0 : u.index) ?? 1, length: 2 },
3324
3406
  { type: "day", pos: ((p = i.day) == null ? void 0 : p.index) ?? 2, length: 2 }
3325
- ].sort((m, f) => m.pos - f.pos);
3326
- let c = "", l = 0;
3407
+ ].sort((m, b) => m.pos - b.pos);
3408
+ let c = "", g = 0;
3327
3409
  for (let m = 0; m < a.length; m++) {
3328
- const f = a[m], v = n.substring(l, l + f.length);
3329
- if (!v) break;
3330
- c += v, l += v.length, m < a.length - 1 && v.length === f.length && (c += o);
3410
+ const b = a[m], f = n.substring(g, g + b.length);
3411
+ if (!f) break;
3412
+ c += f, g += f.length, m < a.length - 1 && f.length === b.length && (c += o);
3331
3413
  }
3332
3414
  return c.substring(0, r);
3333
3415
  }
@@ -3335,16 +3417,16 @@ function Ui(t, e, o) {
3335
3417
  const i = t.value, r = t.selectionStart || 0, s = i.length < o.length, { separator: n } = e, d = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = i.replace(new RegExp(`[^0-9${d}]`, "g"), ""), c = Gt(a, e);
3336
3418
  if (c !== i) {
3337
3419
  t.value = c;
3338
- let l = r;
3420
+ let g = r;
3339
3421
  if (s)
3340
- l = r;
3422
+ g = r;
3341
3423
  else if (c.length > i.length && c[r] === n)
3342
- l = r + 1;
3424
+ g = r + 1;
3343
3425
  else if (c.length > i.length) {
3344
- const g = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), h = (i.substring(0, r).match(new RegExp(g, "g")) || []).length, p = (c.substring(0, r).match(new RegExp(g, "g")) || []).length - h;
3345
- l = r + p;
3426
+ const l = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), h = (i.substring(0, r).match(new RegExp(l, "g")) || []).length, p = (c.substring(0, r).match(new RegExp(l, "g")) || []).length - h;
3427
+ g = r + p;
3346
3428
  }
3347
- t.setSelectionRange(l, l);
3429
+ t.setSelectionRange(g, g);
3348
3430
  }
3349
3431
  return c;
3350
3432
  }
@@ -3366,18 +3448,18 @@ function ji(t, e) {
3366
3448
  return !1;
3367
3449
  if (o === s) {
3368
3450
  const d = t.target, a = d.selectionStart || 0, c = d.value;
3369
- let l = 0;
3451
+ let g = 0;
3370
3452
  for (let h = a - 1; h >= 0; h--)
3371
3453
  if (c[h] === s) {
3372
- l = h + 1;
3454
+ g = h + 1;
3373
3455
  break;
3374
3456
  }
3375
- const g = c.substring(l, a);
3376
- if (/^\d$/.test(g)) {
3457
+ const l = c.substring(g, a);
3458
+ if (/^\d$/.test(l)) {
3377
3459
  t.preventDefault();
3378
- const h = c.substring(0, l) + "0" + g + s + c.substring(a);
3460
+ const h = c.substring(0, g) + "0" + l + s + c.substring(a);
3379
3461
  d.value = h;
3380
- const u = l + 2 + s.length;
3462
+ const u = g + 2 + s.length;
3381
3463
  return d.setSelectionRange(u, u), !0;
3382
3464
  }
3383
3465
  }
@@ -3386,8 +3468,8 @@ function ji(t, e) {
3386
3468
  function Bi(t, e, o) {
3387
3469
  var u;
3388
3470
  t.preventDefault();
3389
- const i = ((u = t.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: r } = o, s = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = i.replace(new RegExp(`[^0-9${s}]`, "g"), ""), d = Gt(n, o), a = e.selectionStart || 0, c = e.selectionEnd || 0, l = e.value, g = l.substring(0, a) + d + l.substring(c);
3390
- e.value = Gt(g, o);
3471
+ const i = ((u = t.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: r } = o, s = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = i.replace(new RegExp(`[^0-9${s}]`, "g"), ""), d = Gt(n, o), a = e.selectionStart || 0, c = e.selectionEnd || 0, g = e.value, l = g.substring(0, a) + d + g.substring(c);
3472
+ e.value = Gt(l, o);
3391
3473
  const h = a + d.length;
3392
3474
  e.setSelectionRange(h, h);
3393
3475
  }
@@ -3396,7 +3478,7 @@ function Ki(t, e, o, i) {
3396
3478
  return !1;
3397
3479
  const r = yi(t, e);
3398
3480
  if (!r) return !1;
3399
- const s = i.minDate ? N(i.minDate) : null, n = i.maxDate ? N(i.maxDate) : null;
3481
+ const s = i.minDate ? j(i.minDate) : null, n = i.maxDate ? j(i.maxDate) : null;
3400
3482
  return s && r < s || n && r > n ? !1 : (o.selectedDate = r, o.focusedDate = r, o.viewYear = r.getFullYear(), o.viewMonth = r.getMonth(), !0);
3401
3483
  }
3402
3484
  const Wi = `
@@ -3405,31 +3487,31 @@ const Wi = `
3405
3487
  z-index: var(--wg-dp-z-index, 9999);
3406
3488
 
3407
3489
  /* Colors */
3408
- --wg-dp-background: var(--base-layer-01, #fff);
3409
- --wg-dp-border-color: var(--base-stroke-default, #e0e0e0);
3410
- --wg-dp-text-color: var(--base-text-color-primary, #1a1a1a);
3411
- --wg-dp-text-secondary: var(--base-text-color-secondary, #666);
3412
- --wg-dp-text-muted: var(--base-text-color-muted, #ccc);
3413
- --wg-dp-text-disabled: var(--base-text-color-disabled, #999);
3490
+ --wg-dp-background: var(--base-main-bg, #fff);
3491
+ --wg-dp-border-color: var(--base-border-color, #e0e0e0);
3492
+ --wg-dp-text-color: var(--base-text-color-1, #1a1a1a);
3493
+ --wg-dp-text-secondary: var(--base-text-color-3, #666);
3494
+ --wg-dp-text-muted: var(--base-text-color-4, #ccc);
3495
+ --wg-dp-text-disabled: var(--base-text-color-4, #999);
3414
3496
  --wg-dp-accent-color: var(--base-accent-color, #0078d4);
3415
3497
  --wg-dp-accent-hover: var(--base-accent-color-hover, #006cbd);
3416
- --wg-dp-hover-bg: var(--base-layer-hover, #f5f5f5);
3417
- --wg-dp-hover-border: var(--base-stroke-hover, #ccc);
3418
- --wg-dp-selected-text: var(--base-text-on-accent, #fff);
3498
+ --wg-dp-hover-bg: var(--base-hover-bg, #f5f5f5);
3499
+ --wg-dp-hover-border: var(--base-border-color, #ccc);
3500
+ --wg-dp-selected-text: var(--base-text-color-on-accent, #fff);
3419
3501
 
3420
3502
  /* Typography */
3421
- --wg-dp-font-family: var(--base-font-family, inherit);
3422
- --wg-dp-font-size: var(--base-font-size-sm, 13px);
3423
- --wg-dp-font-size-sm: var(--base-font-size-xs, 12px);
3424
- --wg-dp-font-size-xs: 10px;
3425
- --wg-dp-font-weight-normal: var(--base-font-weight-normal, 400);
3426
- --wg-dp-font-weight-medium: var(--base-font-weight-medium, 500);
3427
- --wg-dp-font-weight-semibold: var(--base-font-weight-semibold, 600);
3503
+ --wg-dp-font-family: var(--wg-font-family, var(--base-font-family, inherit));
3504
+ --wg-dp-font-size: var(--wg-font-size-base, 14px);
3505
+ --wg-dp-font-size-sm: var(--wg-font-size-sm, 12px);
3506
+ --wg-dp-font-size-xs: var(--wg-font-size-xs, 11px);
3507
+ --wg-dp-font-weight-normal: var(--wg-font-weight-normal, 400);
3508
+ --wg-dp-font-weight-medium: 500;
3509
+ --wg-dp-font-weight-semibold: var(--wg-font-weight-semibold, 600);
3428
3510
 
3429
3511
  /* Sizing */
3430
3512
  --wg-dp-padding: 8px;
3431
3513
  --wg-dp-min-width: 220px;
3432
- --wg-dp-border-radius: var(--base-border-radius-sm, 4px);
3514
+ --wg-dp-border-radius: var(--wg-border-radius-sm, 4px);
3433
3515
  --wg-dp-nav-size: 24px;
3434
3516
  --wg-dp-nav-icon-size: 14px;
3435
3517
  --wg-dp-rolling-list-height: 180px;
@@ -3440,7 +3522,7 @@ const Wi = `
3440
3522
  --wg-dp-gap-xs: 1px;
3441
3523
 
3442
3524
  /* Shadow */
3443
- --wg-dp-shadow: var(--base-shadow-lg, 0 4px 16px rgba(0, 0, 0, 0.15));
3525
+ --wg-dp-shadow: var(--wg-shadow-lg, 0 4px 16px rgba(0, 0, 0, 0.15));
3444
3526
  }
3445
3527
 
3446
3528
  .wg-datepicker {
@@ -3650,8 +3732,8 @@ const Wi = `
3650
3732
  background-color: color-mix(in srgb, var(--wg-dp-accent-color) 10%, transparent);
3651
3733
  }
3652
3734
  `;
3653
- let ye = !1;
3654
- class ne {
3735
+ let Se = !1;
3736
+ class se {
3655
3737
  constructor(e = {}) {
3656
3738
  w(this, "options");
3657
3739
  w(this, "state");
@@ -3687,16 +3769,16 @@ class ne {
3687
3769
  const o = e || navigator.language || "en";
3688
3770
  try {
3689
3771
  const i = new Intl.DateTimeFormat(o, { month: "long" }), r = new Intl.DateTimeFormat(o, { month: "short" }), s = new Intl.DateTimeFormat(o, { weekday: "long" }), n = new Intl.DateTimeFormat(o, { weekday: "short" }), d = [], a = [];
3690
- for (let g = 0; g < 12; g++) {
3691
- const h = new Date(2024, g, 1);
3772
+ for (let l = 0; l < 12; l++) {
3773
+ const h = new Date(2024, l, 1);
3692
3774
  d.push(i.format(h)), a.push(r.format(h));
3693
3775
  }
3694
- const c = [], l = [];
3695
- for (let g = 0; g < 7; g++) {
3696
- const h = new Date(2024, 0, 7 + g);
3776
+ const c = [], g = [];
3777
+ for (let l = 0; l < 7; l++) {
3778
+ const h = new Date(2024, 0, 7 + l);
3697
3779
  c.push(s.format(h));
3698
3780
  const u = n.format(h);
3699
- l.push(u.substring(0, 2));
3781
+ g.push(u.substring(0, 2));
3700
3782
  }
3701
3783
  return {
3702
3784
  today: "Today",
@@ -3705,33 +3787,33 @@ class ne {
3705
3787
  monthNames: d,
3706
3788
  monthNamesShort: a,
3707
3789
  weekdayNames: c,
3708
- weekdayNamesShort: l
3790
+ weekdayNamesShort: g
3709
3791
  };
3710
3792
  } catch {
3711
- return ze;
3793
+ return Ve;
3712
3794
  }
3713
3795
  }
3714
3796
  /**
3715
3797
  * Inject datepicker styles into document head (once)
3716
3798
  */
3717
3799
  static injectStyles() {
3718
- if (ye) return;
3800
+ if (Se) return;
3719
3801
  const e = document.createElement("style");
3720
- e.id = "wg-datepicker-styles", e.textContent = Wi, document.head.appendChild(e), ye = !0;
3802
+ e.id = "wg-datepicker-styles", e.textContent = Wi, document.head.appendChild(e), Se = !0;
3721
3803
  }
3722
3804
  /**
3723
3805
  * Open the date picker
3724
3806
  */
3725
3807
  open(e, o = null) {
3726
- ne.injectStyles(), this.state.isOpen && this.close(), this.anchor = e;
3727
- const i = N(o);
3808
+ se.injectStyles(), this.state.isOpen && this.close(), this.anchor = e;
3809
+ const i = j(o);
3728
3810
  if (i)
3729
3811
  this.state.selectedDate = i, this.state.viewYear = i.getFullYear(), this.state.viewMonth = i.getMonth();
3730
3812
  else {
3731
3813
  const r = /* @__PURE__ */ new Date();
3732
3814
  this.state.viewYear = r.getFullYear(), this.state.viewMonth = r.getMonth();
3733
3815
  }
3734
- Fi(this.state), this.element = document.createElement("div"), this.element.className = "wg-datepicker-container", this.element.innerHTML = ki(this.state, this.options, this.localeStrings), document.body.appendChild(this.element), this.position(), this.attachListeners(), this.state.isOpen = !0, this.state.rollingSelectorOpen && _e(this.element);
3816
+ Vi(this.state), this.element = document.createElement("div"), this.element.className = "wg-datepicker-container", this.element.innerHTML = ki(this.state, this.options, this.localeStrings), document.body.appendChild(this.element), this.position(), this.attachListeners(), this.state.isOpen = !0, this.state.rollingSelectorOpen && Ce(this.element);
3735
3817
  }
3736
3818
  /**
3737
3819
  * Close the date picker
@@ -3765,13 +3847,13 @@ class ne {
3765
3847
  position() {
3766
3848
  if (!this.element || !this.anchor) return;
3767
3849
  const e = this.element.querySelector(".wg-datepicker");
3768
- e && (this.cleanupAutoUpdate = zo(this.anchor, e, () => {
3769
- Pt(this.anchor, e, {
3850
+ e && (this.cleanupAutoUpdate = Vo(this.anchor, e, () => {
3851
+ kt(this.anchor, e, {
3770
3852
  placement: "bottom-start",
3771
3853
  middleware: [
3772
3854
  Lt(4),
3773
- It({ fallbackPlacements: ["top-start", "bottom-end", "top-end"] }),
3774
- Re({ padding: 8 })
3855
+ xt({ fallbackPlacements: ["top-start", "bottom-end", "top-end"] }),
3856
+ ne({ padding: 8 })
3775
3857
  ]
3776
3858
  }).then(({ x: o, y: i }) => {
3777
3859
  Object.assign(e.style, {
@@ -3804,7 +3886,7 @@ class ne {
3804
3886
  return;
3805
3887
  }
3806
3888
  if (i === "toggle-rolling") {
3807
- e.preventDefault(), this.state.rollingSelectorOpen = !this.state.rollingSelectorOpen, this.render(), this.state.rollingSelectorOpen && this.element && _e(this.element);
3889
+ e.preventDefault(), this.state.rollingSelectorOpen = !this.state.rollingSelectorOpen, this.render(), this.state.rollingSelectorOpen && this.element && Ce(this.element);
3808
3890
  return;
3809
3891
  }
3810
3892
  if (i === "today") {
@@ -3816,7 +3898,7 @@ class ne {
3816
3898
  const r = o.closest(".wg-datepicker__day");
3817
3899
  if (r) {
3818
3900
  e.preventDefault();
3819
- const a = Vi(r, this.state, this.options);
3901
+ const a = Fi(r, this.state, this.options);
3820
3902
  a && this.selectDate(a);
3821
3903
  return;
3822
3904
  }
@@ -3843,7 +3925,7 @@ class ne {
3843
3925
  * Handle keyboard events
3844
3926
  */
3845
3927
  handleKeyDown(e) {
3846
- Pi(e, this.state, this.options, {
3928
+ Li(e, this.state, this.options, {
3847
3929
  onSelect: (i, r) => this.selectDate(i, r),
3848
3930
  onClose: () => this.close()
3849
3931
  }) && this.render();
@@ -3861,7 +3943,7 @@ class ne {
3861
3943
  render() {
3862
3944
  if (!this.element) return;
3863
3945
  const e = this.element.querySelector(".wg-datepicker");
3864
- e && (Ri(e, this.state, this.localeStrings), Li(e, this.state.rollingSelectorOpen), this.state.rollingSelectorOpen ? Ii(e, this.state) : Oi(e, this.state, this.options));
3946
+ e && (Hi(e, this.state, this.localeStrings), Ri(e, this.state.rollingSelectorOpen), this.state.rollingSelectorOpen ? Pi(e, this.state) : Oi(e, this.state, this.options));
3865
3947
  }
3866
3948
  /**
3867
3949
  * Connect an input field for masked input
@@ -3961,27 +4043,34 @@ const Xi = `
3961
4043
  flex: 1;
3962
4044
  }
3963
4045
 
4046
+ .wg-context-menu__shortcut {
4047
+ margin-left: auto;
4048
+ padding-left: 16px;
4049
+ color: var(--wg-cm-text-secondary);
4050
+ font-size: 0.9em;
4051
+ }
4052
+
3964
4053
  .wg-context-menu__divider {
3965
4054
  height: 1px;
3966
4055
  background: var(--wg-cm-border-color);
3967
4056
  margin: var(--wg-cm-padding) 0;
3968
4057
  }
3969
4058
  `;
3970
- let Ce = !1;
4059
+ let xe = !1;
3971
4060
  function Qi() {
3972
- if (Ce) return;
4061
+ if (xe) return;
3973
4062
  const t = document.createElement("style");
3974
- t.id = "wg-context-menu-styles", t.textContent = Xi, document.head.appendChild(t), Ce = !0;
4063
+ t.id = "wg-context-menu-styles", t.textContent = Xi, document.head.appendChild(t), xe = !0;
3975
4064
  }
3976
4065
  function Gi(t, e) {
3977
4066
  const o = t.filter((r) => r.visible === void 0 ? !0 : typeof r.visible == "function" ? r.visible(e) : r.visible);
3978
4067
  return o.length === 0 ? "" : `<div class="wg-context-menu">${o.map((r, s) => {
3979
- const n = typeof r.label == "function" ? r.label(e) : r.label, d = typeof r.icon == "function" ? r.icon(e) : r.icon, a = typeof r.disabled == "function" ? r.disabled(e) : r.disabled, c = r.danger === !0, l = [
4068
+ const n = typeof r.label == "function" ? r.label(e) : r.label, d = typeof r.icon == "function" ? r.icon(e) : r.icon, a = r.shortcut, c = typeof r.disabled == "function" ? r.disabled(e) : r.disabled, g = r.danger === !0, l = [
3980
4069
  "wg-context-menu__item",
3981
- a ? "wg-context-menu__item--disabled" : "",
3982
- c ? "wg-context-menu__item--danger" : ""
3983
- ].filter(Boolean).join(" "), g = r.dividerBefore && s > 0 ? '<div class="wg-context-menu__divider"></div>' : "", h = d ? `<span class="wg-context-menu__icon">${d}</span>` : "";
3984
- return `${g}<div class="${l}" data-item-id="${r.id}" data-disabled="${a ? "true" : "false"}">${h}<span class="wg-context-menu__label">${n}</span></div>`;
4070
+ c ? "wg-context-menu__item--disabled" : "",
4071
+ g ? "wg-context-menu__item--danger" : ""
4072
+ ].filter(Boolean).join(" "), h = r.dividerBefore && s > 0 ? '<div class="wg-context-menu__divider"></div>' : "", u = d ? `<span class="wg-context-menu__icon">${d}</span>` : "", p = a ? `<span class="wg-context-menu__shortcut">${a}</span>` : "";
4073
+ return `${h}<div class="${l}" data-item-id="${r.id}" data-disabled="${c ? "true" : "false"}" data-shortcut="${a || ""}">${u}<span class="wg-context-menu__label">${n}</span>${p}</div>`;
3985
4074
  }).join("")}</div>`;
3986
4075
  }
3987
4076
  function Ji(t, e, o, i, r, s, n) {
@@ -3991,7 +4080,7 @@ function Ji(t, e, o, i, r, s, n) {
3991
4080
  const a = document.createElement("div");
3992
4081
  a.className = "wg-context-menu-container", a.innerHTML = d, document.body.appendChild(a);
3993
4082
  const c = a.querySelector(".wg-context-menu");
3994
- Pt({
4083
+ kt({
3995
4084
  getBoundingClientRect: () => ({
3996
4085
  width: 0,
3997
4086
  height: 0,
@@ -4006,8 +4095,8 @@ function Ji(t, e, o, i, r, s, n) {
4006
4095
  placement: "bottom-start",
4007
4096
  middleware: [
4008
4097
  Lt(4),
4009
- It({ fallbackPlacements: ["top-start", "bottom-end", "top-end"] }),
4010
- Re({ padding: 8 })
4098
+ xt({ fallbackPlacements: ["top-start", "bottom-end", "top-end"] }),
4099
+ ne({ padding: 8 })
4011
4100
  ]
4012
4101
  }).then(({ x: u, y: p }) => {
4013
4102
  Object.assign(c.style, {
@@ -4021,21 +4110,60 @@ function Ji(t, e, o, i, r, s, n) {
4021
4110
  s(m);
4022
4111
  }
4023
4112
  });
4024
- const g = (u) => {
4025
- a.contains(u.target) || (bt(a, g, h), n());
4113
+ const l = (u) => {
4114
+ a.contains(u.target) || (ht(a, l, h), n());
4026
4115
  }, h = (u) => {
4027
- u.key === "Escape" && (u.preventDefault(), bt(a, g, h), n());
4116
+ if (u.key === "Escape") {
4117
+ u.preventDefault(), ht(a, l, h), n();
4118
+ return;
4119
+ }
4120
+ const p = u.key.toLowerCase(), m = a.querySelectorAll(".wg-context-menu__item");
4121
+ for (const b of m) {
4122
+ const f = b.dataset.shortcut;
4123
+ if (b.dataset.disabled === "true" || !f) continue;
4124
+ if (f.toLowerCase() === p || f === u.key) {
4125
+ u.preventDefault();
4126
+ const S = b.dataset.itemId || "";
4127
+ s(S), ht(a, l, h), n();
4128
+ return;
4129
+ }
4130
+ }
4028
4131
  };
4029
4132
  return setTimeout(() => {
4030
- document.addEventListener("mousedown", g), document.addEventListener("keydown", h);
4031
- }, 0), a._cleanup = { handleOutsideClick: g, handleKeyDown: h }, a;
4133
+ document.addEventListener("mousedown", l), document.addEventListener("keydown", h);
4134
+ }, 0), a._cleanup = { handleOutsideClick: l, handleKeyDown: h }, a;
4032
4135
  }
4033
- function bt(t, e, o) {
4136
+ function ht(t, e, o) {
4034
4137
  e && document.removeEventListener("mousedown", e), o && document.removeEventListener("keydown", o);
4035
4138
  const i = t._cleanup;
4036
4139
  i && (i.handleOutsideClick && document.removeEventListener("mousedown", i.handleOutsideClick), i.handleKeyDown && document.removeEventListener("keydown", i.handleKeyDown)), t.remove();
4037
4140
  }
4038
- class Zi extends HTMLElement {
4141
+ function Zi(t) {
4142
+ const e = t.split("+").map((i) => i.trim()), o = {
4143
+ key: "",
4144
+ ctrl: !1,
4145
+ shift: !1,
4146
+ alt: !1,
4147
+ meta: !1
4148
+ };
4149
+ for (const i of e) {
4150
+ const r = i.toLowerCase();
4151
+ r === "ctrl" || r === "control" ? o.ctrl = !0 : r === "shift" ? o.shift = !0 : r === "alt" ? o.alt = !0 : r === "meta" || r === "cmd" || r === "command" ? o.meta = !0 : o.key = i;
4152
+ }
4153
+ return o;
4154
+ }
4155
+ function tr(t, e) {
4156
+ if (e.ctrl !== t.ctrlKey || e.shift !== t.shiftKey || e.alt !== t.altKey || e.meta !== t.metaKey) return !1;
4157
+ const o = t.key.toLowerCase(), i = e.key.toLowerCase();
4158
+ return o === i;
4159
+ }
4160
+ function er(t) {
4161
+ return t.split("+").map((e) => {
4162
+ const o = e.trim();
4163
+ return ["ctrl", "control", "shift", "alt", "meta", "cmd", "command"].includes(o.toLowerCase()) ? o.charAt(0).toUpperCase() + o.slice(1).toLowerCase() : o;
4164
+ }).join("+");
4165
+ }
4166
+ class or extends HTMLElement {
4039
4167
  constructor() {
4040
4168
  super();
4041
4169
  // Core grid logic (composition)
@@ -4106,13 +4234,13 @@ class Zi extends HTMLElement {
4106
4234
  o.preventDefault();
4107
4235
  let d = ((c = o.clipboardData) == null ? void 0 : c.getData("text")) || "";
4108
4236
  if (s.beforePasteCallback) {
4109
- const l = s.beforePasteCallback(d, n);
4110
- d = l != null ? String(l) : "";
4237
+ const g = s.beforePasteCallback(d, n);
4238
+ d = g != null ? String(g) : "";
4111
4239
  }
4112
4240
  const a = String(s.field);
4113
4241
  this.grid.commitEdit(i, a, d), this.render();
4114
4242
  });
4115
- this.shadow = this.attachShadow({ mode: "open" }), this.grid = new Ue(), this.styleElement = document.createElement("style"), this.styleElement.textContent = je, this.shadow.appendChild(this.styleElement), this.grid.requestUpdate = () => this.requestUpdate();
4243
+ this.shadow = this.attachShadow({ mode: "open" }), this.grid = new je(), this.styleElement = document.createElement("style"), this.styleElement.textContent = Be, this.shadow.appendChild(this.styleElement), this.grid.requestUpdate = () => this.requestUpdate();
4116
4244
  }
4117
4245
  get tooltipShowDelay() {
4118
4246
  return this._tooltipShowDelay;
@@ -4133,7 +4261,7 @@ class Zi extends HTMLElement {
4133
4261
  this.render(), this.addEventListener("paste", this.handlePaste);
4134
4262
  }
4135
4263
  disconnectedCallback() {
4136
- this.removeEventListener("paste", this.handlePaste), this.datepicker && (this.datepicker.destroy(), this.datepicker = null), this.contextMenuElement && (bt(this.contextMenuElement), this.contextMenuElement = null), Et();
4264
+ this.removeEventListener("paste", this.handlePaste), this.datepicker && (this.datepicker.destroy(), this.datepicker = null), this.contextMenuElement && (ht(this.contextMenuElement), this.contextMenuElement = null), At();
4137
4265
  }
4138
4266
  // ==========================================================================
4139
4267
  // Public API - Proxy to WebGrid
@@ -4264,17 +4392,30 @@ class Zi extends HTMLElement {
4264
4392
  set rowToolbar(o) {
4265
4393
  this.grid.rowToolbar = o;
4266
4394
  }
4395
+ get toolbarVerticalAlign() {
4396
+ return this.grid.toolbarVerticalAlign;
4397
+ }
4398
+ set toolbarVerticalAlign(o) {
4399
+ this.grid.toolbarVerticalAlign = o;
4400
+ }
4401
+ get toolbarHorizontalAlign() {
4402
+ return this.grid.toolbarHorizontalAlign;
4403
+ }
4404
+ set toolbarHorizontalAlign(o) {
4405
+ this.grid.toolbarHorizontalAlign = o;
4406
+ }
4407
+ // Deprecated aliases
4267
4408
  get toolbarAlign() {
4268
- return this.grid.toolbarAlign;
4409
+ return this.grid.toolbarVerticalAlign;
4269
4410
  }
4270
4411
  set toolbarAlign(o) {
4271
- this.grid.toolbarAlign = o;
4412
+ this.grid.toolbarVerticalAlign = o;
4272
4413
  }
4273
4414
  get toolbarTopPosition() {
4274
- return this.grid.toolbarTopPosition;
4415
+ return this.grid.toolbarHorizontalAlign;
4275
4416
  }
4276
4417
  set toolbarTopPosition(o) {
4277
- this.grid.toolbarTopPosition = o;
4418
+ this.grid.toolbarHorizontalAlign = o;
4278
4419
  }
4279
4420
  get toolbarTrigger() {
4280
4421
  return this.grid.toolbarTrigger;
@@ -4282,12 +4423,43 @@ class Zi extends HTMLElement {
4282
4423
  set toolbarTrigger(o) {
4283
4424
  this.grid.toolbarTrigger = o;
4284
4425
  }
4426
+ get toolbarPosition() {
4427
+ return this.grid.toolbarPosition;
4428
+ }
4429
+ set toolbarPosition(o) {
4430
+ this.grid.toolbarPosition = o;
4431
+ }
4285
4432
  get contextMenu() {
4286
4433
  return this.grid.contextMenu;
4287
4434
  }
4288
4435
  set contextMenu(o) {
4289
4436
  this.grid.contextMenu = o;
4290
4437
  }
4438
+ // Row keyboard shortcuts
4439
+ get rowShortcuts() {
4440
+ return this.grid.rowShortcuts;
4441
+ }
4442
+ set rowShortcuts(o) {
4443
+ this.grid.rowShortcuts = o;
4444
+ }
4445
+ get showShortcutsHelp() {
4446
+ return this.grid.showShortcutsHelp;
4447
+ }
4448
+ set showShortcutsHelp(o) {
4449
+ this.grid.showShortcutsHelp = o;
4450
+ }
4451
+ get shortcutsHelpPosition() {
4452
+ return this.grid.shortcutsHelpPosition;
4453
+ }
4454
+ set shortcutsHelpPosition(o) {
4455
+ this.grid.shortcutsHelpPosition = o;
4456
+ }
4457
+ get shortcutsHelpContentCallback() {
4458
+ return this.grid.shortcutsHelpContentCallback;
4459
+ }
4460
+ set shortcutsHelpContentCallback(o) {
4461
+ this.grid.shortcutsHelpContentCallback = o;
4462
+ }
4291
4463
  // Legacy aliases
4292
4464
  get showRowActions() {
4293
4465
  return this.grid.showRowActions;
@@ -4503,6 +4675,26 @@ class Zi extends HTMLElement {
4503
4675
  getCellValidationError(o, i) {
4504
4676
  return this.grid.getCellValidationError(o, i);
4505
4677
  }
4678
+ // Public methods for focus and editing
4679
+ /**
4680
+ * Programmatically focus a cell. Updates state and focuses the DOM element.
4681
+ * State is updated immediately so pending renders use the correct position.
4682
+ */
4683
+ focusCell(o, i) {
4684
+ const r = this.grid.columns, s = this.grid.displayItems;
4685
+ o < 0 || o >= s.length || i < 0 || i >= r.length || (this.grid.setFocusedCell(o, i), requestAnimationFrame(() => {
4686
+ $(this, o, i);
4687
+ }));
4688
+ }
4689
+ /**
4690
+ * Programmatically start editing a cell.
4691
+ */
4692
+ startEditing(o, i) {
4693
+ const r = this.grid.columns;
4694
+ if (i < 0 || i >= r.length) return;
4695
+ const s = r[i], n = String(s.field);
4696
+ this.grid.startEdit(o, n);
4697
+ }
4506
4698
  // ==========================================================================
4507
4699
  // GridContext Implementation - Required by module functions
4508
4700
  // ==========================================================================
@@ -4520,7 +4712,7 @@ class Zi extends HTMLElement {
4520
4712
  }
4521
4713
  // Delegate to module function - needed for lifecycle module
4522
4714
  moveFocusAfterCommit(o, i, r) {
4523
- Ft(this, o, i, r);
4715
+ Vt(this, o, i, r);
4524
4716
  }
4525
4717
  // ==========================================================================
4526
4718
  // Update Mechanism
@@ -4547,50 +4739,71 @@ class Zi extends HTMLElement {
4547
4739
  * Handle keyboard navigation in cells
4548
4740
  */
4549
4741
  handleCellKeyDown(o, i, r) {
4550
- var c;
4742
+ var g;
4551
4743
  if (!this.grid.isNavigateMode)
4552
4744
  return;
4553
4745
  const s = this.grid.columns, n = this.grid.displayItems, d = this.grid.getEditableColumns(), a = d.findIndex((l) => l.index === r);
4554
4746
  if ((o.ctrlKey || o.metaKey) && o.key === "c") {
4555
- const l = s[r], g = n[i];
4556
- if (l && g) {
4557
- let h = this.grid.getCellRawValue(g, i, String(l.field));
4558
- l.beforeCopyCallback && (h = l.beforeCopyCallback(h, g));
4559
- const u = h != null ? String(h) : "";
4560
- navigator.clipboard.writeText(u);
4747
+ const l = s[r], h = n[i];
4748
+ if (l && h) {
4749
+ let u = this.grid.getCellRawValue(h, i, String(l.field));
4750
+ l.beforeCopyCallback && (u = l.beforeCopyCallback(u, h));
4751
+ const p = u != null ? String(u) : "";
4752
+ navigator.clipboard.writeText(p);
4561
4753
  }
4562
4754
  return;
4563
4755
  }
4756
+ const c = this.grid.rowShortcuts;
4757
+ if (c && c.length > 0) {
4758
+ const l = s[r], h = n[i];
4759
+ if (l && h)
4760
+ for (const u of c) {
4761
+ const p = Zi(u.key);
4762
+ if (tr(o, p)) {
4763
+ const m = {
4764
+ row: h,
4765
+ rowIndex: i,
4766
+ colIndex: r,
4767
+ column: l,
4768
+ cellValue: this.grid.getCellRawValue(h, i, String(l.field))
4769
+ };
4770
+ if (!(typeof u.disabled == "function" ? u.disabled(m) : u.disabled === !0)) {
4771
+ o.preventDefault(), u.action(m);
4772
+ return;
4773
+ }
4774
+ }
4775
+ }
4776
+ }
4564
4777
  switch (o.key) {
4565
4778
  case "ArrowUp":
4566
- o.preventDefault(), i > 0 && E(this, i - 1, r);
4779
+ o.preventDefault(), i > 0 && $(this, i - 1, r);
4567
4780
  break;
4568
4781
  case "ArrowDown":
4569
- o.preventDefault(), i < n.length - 1 && E(this, i + 1, r);
4782
+ o.preventDefault(), i < n.length - 1 && $(this, i + 1, r);
4570
4783
  break;
4571
4784
  case "ArrowLeft":
4572
- o.preventDefault(), r > 0 && E(this, i, r - 1);
4785
+ o.preventDefault(), r > 0 && $(this, i, r - 1);
4573
4786
  break;
4574
4787
  case "ArrowRight":
4575
- o.preventDefault(), r < s.length - 1 && E(this, i, r + 1);
4788
+ o.preventDefault(), r < s.length - 1 && $(this, i, r + 1);
4576
4789
  break;
4577
4790
  case "Tab":
4578
4791
  if (o.preventDefault(), o.shiftKey) {
4579
4792
  if (a > 0) {
4580
4793
  const l = d[a - 1].index;
4581
- E(this, i, l);
4794
+ $(this, i, l);
4582
4795
  } else if (i > 0) {
4583
4796
  const l = d[d.length - 1].index;
4584
- E(this, i - 1, l);
4797
+ $(this, i - 1, l);
4585
4798
  }
4586
4799
  } else if (a >= 0 && a < d.length - 1) {
4587
4800
  const l = d[a + 1].index;
4588
- E(this, i, l);
4801
+ $(this, i, l);
4589
4802
  } else if (a === -1 && d.length > 0)
4590
- E(this, i, d[0].index);
4803
+ $(this, i, d[0].index);
4591
4804
  else if (i < n.length - 1) {
4592
4805
  const l = d[0].index;
4593
- E(this, i + 1, l);
4806
+ $(this, i + 1, l);
4594
4807
  }
4595
4808
  break;
4596
4809
  case "Home":
@@ -4598,65 +4811,65 @@ class Zi extends HTMLElement {
4598
4811
  if (this.grid.shouldUseVirtualScroll()) {
4599
4812
  const l = this.grid.focusedCell;
4600
4813
  this.grid.setFocusedCell(0, 0), st(this, 0);
4601
- const g = this.shadow.querySelector('td[data-row="0"][data-col="0"]');
4602
- g && (g.focus({ preventScroll: !0 }), B(this, l, { rowIndex: 0, colIndex: 0 }));
4814
+ const h = this.shadow.querySelector('td[data-row="0"][data-col="0"]');
4815
+ h && (h.focus({ preventScroll: !0 }), K(this, l, { rowIndex: 0, colIndex: 0 }));
4603
4816
  } else
4604
- E(this, 0, 0);
4817
+ $(this, 0, 0);
4605
4818
  else
4606
- E(this, i, 0);
4819
+ $(this, i, 0);
4607
4820
  break;
4608
4821
  case "End":
4609
4822
  if (o.preventDefault(), o.ctrlKey) {
4610
- const l = n.length - 1, g = s.length - 1;
4823
+ const l = n.length - 1, h = s.length - 1;
4611
4824
  if (this.grid.shouldUseVirtualScroll()) {
4612
- const h = this.grid.focusedCell;
4613
- this.grid.setFocusedCell(l, g), st(this, l);
4614
- const u = this.shadow.querySelector(`td[data-row="${l}"][data-col="${g}"]`);
4615
- u && (u.focus({ preventScroll: !0 }), B(this, h, { rowIndex: l, colIndex: g }));
4825
+ const u = this.grid.focusedCell;
4826
+ this.grid.setFocusedCell(l, h), st(this, l);
4827
+ const p = this.shadow.querySelector(`td[data-row="${l}"][data-col="${h}"]`);
4828
+ p && (p.focus({ preventScroll: !0 }), K(this, u, { rowIndex: l, colIndex: h }));
4616
4829
  } else
4617
- E(this, l, g);
4830
+ $(this, l, h);
4618
4831
  } else
4619
- E(this, i, s.length - 1);
4832
+ $(this, i, s.length - 1);
4620
4833
  break;
4621
4834
  case "PageUp":
4622
4835
  if (o.preventDefault(), o.ctrlKey)
4623
4836
  if (this.grid.shouldUseVirtualScroll()) {
4624
4837
  const l = this.grid.focusedCell;
4625
4838
  this.grid.setFocusedCell(0, r), st(this, 0);
4626
- const g = this.shadow.querySelector(`td[data-row="0"][data-col="${r}"]`);
4627
- g && (g.focus({ preventScroll: !0 }), B(this, l, { rowIndex: 0, colIndex: r }));
4839
+ const h = this.shadow.querySelector(`td[data-row="0"][data-col="${r}"]`);
4840
+ h && (h.focus({ preventScroll: !0 }), K(this, l, { rowIndex: 0, colIndex: r }));
4628
4841
  } else
4629
- E(this, 0, r);
4842
+ $(this, 0, r);
4630
4843
  else {
4631
4844
  const l = Math.max(0, i - 10);
4632
4845
  if (this.grid.shouldUseVirtualScroll()) {
4633
- const g = this.grid.focusedCell;
4846
+ const h = this.grid.focusedCell;
4634
4847
  this.grid.setFocusedCell(l, r), st(this, l);
4635
- const h = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
4636
- h && (h.focus({ preventScroll: !0 }), B(this, g, { rowIndex: l, colIndex: r }));
4848
+ const u = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
4849
+ u && (u.focus({ preventScroll: !0 }), K(this, h, { rowIndex: l, colIndex: r }));
4637
4850
  } else
4638
- E(this, l, r);
4851
+ $(this, l, r);
4639
4852
  }
4640
4853
  break;
4641
4854
  case "PageDown":
4642
4855
  if (o.preventDefault(), o.ctrlKey) {
4643
4856
  const l = n.length - 1;
4644
4857
  if (this.grid.shouldUseVirtualScroll()) {
4645
- const g = this.grid.focusedCell;
4858
+ const h = this.grid.focusedCell;
4646
4859
  this.grid.setFocusedCell(l, r), st(this, l);
4647
- const h = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
4648
- h && (h.focus({ preventScroll: !0 }), B(this, g, { rowIndex: l, colIndex: r }));
4860
+ const u = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
4861
+ u && (u.focus({ preventScroll: !0 }), K(this, h, { rowIndex: l, colIndex: r }));
4649
4862
  } else
4650
- E(this, l, r);
4863
+ $(this, l, r);
4651
4864
  } else {
4652
4865
  const l = Math.min(n.length - 1, i + 10);
4653
4866
  if (this.grid.shouldUseVirtualScroll()) {
4654
- const g = this.grid.focusedCell;
4867
+ const h = this.grid.focusedCell;
4655
4868
  this.grid.setFocusedCell(l, r), st(this, l);
4656
- const h = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
4657
- h && (h.focus({ preventScroll: !0 }), B(this, g, { rowIndex: l, colIndex: r }));
4869
+ const u = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
4870
+ u && (u.focus({ preventScroll: !0 }), K(this, h, { rowIndex: l, colIndex: r }));
4658
4871
  } else
4659
- E(this, l, r);
4872
+ $(this, l, r);
4660
4873
  }
4661
4874
  break;
4662
4875
  case "g":
@@ -4666,59 +4879,59 @@ class Zi extends HTMLElement {
4666
4879
  case "Enter": {
4667
4880
  o.preventDefault();
4668
4881
  const l = s[r];
4669
- ((l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete") && this.grid.getEffectiveOpenDropdownOnEnter(l) ? (j(this, i, r), requestAnimationFrame(() => {
4670
- this.dropdownOpen || K(this);
4671
- })) : i < n.length - 1 && E(this, i + 1, r);
4882
+ ((l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete") && this.grid.getEffectiveOpenDropdownOnEnter(l) ? (B(this, i, r), requestAnimationFrame(() => {
4883
+ this.dropdownOpen || W(this);
4884
+ })) : i < n.length - 1 && $(this, i + 1, r);
4672
4885
  break;
4673
4886
  }
4674
4887
  case "F2": {
4675
4888
  o.preventDefault();
4676
- const l = s[r], g = (l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete", h = (l == null ? void 0 : l.editor) === "custom";
4677
- j(this, i, r), g ? requestAnimationFrame(() => {
4678
- this.dropdownOpen || K(this);
4679
- }) : h && requestAnimationFrame(() => {
4889
+ const l = s[r], h = (l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete", u = (l == null ? void 0 : l.editor) === "custom";
4890
+ B(this, i, r), h ? requestAnimationFrame(() => {
4891
+ this.dropdownOpen || W(this);
4892
+ }) : u && requestAnimationFrame(() => {
4680
4893
  this.openCustomEditor(i, r);
4681
4894
  });
4682
4895
  break;
4683
4896
  }
4684
4897
  case " ": {
4685
4898
  o.preventDefault();
4686
- const l = s[r], g = (l == null ? void 0 : l.editor) === "checkbox", h = (l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete", u = (l == null ? void 0 : l.editor) === "date", p = (l == null ? void 0 : l.editor) === "custom";
4687
- g ? Jo(this, i, r) : h ? (j(this, i, r), requestAnimationFrame(() => {
4688
- this.dropdownOpen || K(this);
4689
- })) : u ? (j(this, i, r), requestAnimationFrame(() => {
4690
- var b;
4691
- const m = (b = this.shadowRoot) == null ? void 0 : b.querySelector(
4899
+ const l = s[r], h = (l == null ? void 0 : l.editor) === "checkbox", u = (l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete", p = (l == null ? void 0 : l.editor) === "date", m = (l == null ? void 0 : l.editor) === "custom";
4900
+ h ? Zo(this, i, r) : u ? (B(this, i, r), requestAnimationFrame(() => {
4901
+ this.dropdownOpen || W(this);
4902
+ })) : p ? (B(this, i, r), requestAnimationFrame(() => {
4903
+ var v;
4904
+ const b = (v = this.shadowRoot) == null ? void 0 : v.querySelector(
4692
4905
  `.wg__cell[data-row="${i}"][data-col="${r}"]`
4693
- ), f = m == null ? void 0 : m.querySelector(".wg__date-input"), v = m == null ? void 0 : m.querySelector(".wg__editor--date");
4694
- f && v && this.openDatePicker(f, v);
4695
- })) : p && (j(this, i, r), requestAnimationFrame(() => {
4906
+ ), f = b == null ? void 0 : b.querySelector(".wg__date-input"), _ = b == null ? void 0 : b.querySelector(".wg__editor--date");
4907
+ f && _ && this.openDatePicker(f, _);
4908
+ })) : m && (B(this, i, r), requestAnimationFrame(() => {
4696
4909
  this.openCustomEditor(i, r);
4697
4910
  }));
4698
4911
  break;
4699
4912
  }
4700
4913
  case "Escape":
4701
4914
  if (o.preventDefault(), this.grid.editingCell)
4702
- F(this), this.grid.cancelEdit();
4915
+ Y(this), this.grid.cancelEdit();
4703
4916
  else {
4704
4917
  const l = this.grid.focusedCell;
4705
- this.grid.clearFocusedCell(), B(this, l, null), (c = o.target) == null || c.blur();
4918
+ this.grid.clearFocusedCell(), K(this, l, null), (g = o.target) == null || g.blur();
4706
4919
  }
4707
4920
  break;
4708
4921
  case "Delete": {
4709
4922
  o.preventDefault();
4710
- const l = s[r], g = n[i];
4923
+ const l = s[r], h = n[i];
4711
4924
  if (o.ctrlKey) {
4712
- if (g) {
4713
- const h = { rowIndex: i, row: g };
4714
- this.grid.onrowdelete && this.grid.onrowdelete(h), this.dispatchEvent(new CustomEvent("rowdelete", { detail: h }));
4925
+ if (h) {
4926
+ const u = { rowIndex: i, row: h };
4927
+ this.grid.onrowdelete && this.grid.onrowdelete(u), this.dispatchEvent(new CustomEvent("rowdelete", { detail: u }));
4715
4928
  }
4716
4929
  } else
4717
4930
  l && this.grid.isCellEditable(l) && (this.grid.commitEdit(i, String(l.field), null), this.render(), requestAnimationFrame(() => {
4718
- const h = this.shadow.querySelector(
4931
+ const u = this.shadow.querySelector(
4719
4932
  `td[data-row="${i}"][data-col="${r}"]`
4720
4933
  );
4721
- h == null || h.focus();
4934
+ u == null || u.focus();
4722
4935
  }));
4723
4936
  break;
4724
4937
  }
@@ -4727,7 +4940,7 @@ class Zi extends HTMLElement {
4727
4940
  const l = s[r];
4728
4941
  if ((l == null ? void 0 : l.editor) === "number" && !/[\d.\-]/.test(o.key))
4729
4942
  return;
4730
- j(this, i, r, { initialSearchQuery: o.key }), o.preventDefault();
4943
+ B(this, i, r, { initialSearchQuery: o.key }), o.preventDefault();
4731
4944
  }
4732
4945
  break;
4733
4946
  }
@@ -4739,39 +4952,39 @@ class Zi extends HTMLElement {
4739
4952
  * Handle keydown in editor inputs
4740
4953
  */
4741
4954
  handleEditorKeyDown(o, i) {
4742
- const r = parseInt(i.dataset.row || "0", 10), s = i.dataset.field || "", n = this.grid.columns.find((l) => l.field === s), d = (n == null ? void 0 : n.editor) || "text", a = d === "select" || d === "combobox" || d === "autocomplete", c = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Home", "End"];
4955
+ const r = parseInt(i.dataset.row || "0", 10), s = i.dataset.field || "", n = this.grid.columns.find((g) => g.field === s), d = (n == null ? void 0 : n.editor) || "text", a = d === "select" || d === "combobox" || d === "autocomplete", c = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Home", "End"];
4743
4956
  if (a && !this.dropdownOpen && c.includes(o.key)) {
4744
4957
  o.preventDefault(), o.stopPropagation();
4745
- const l = this.grid.columns.findIndex((v) => v.field === s), g = this.grid.columns.map((v, b) => ({ index: b, column: v })).filter((v) => v.column.editable !== !1), h = g.findIndex((v) => v.index === l), u = this.grid.displayItems;
4746
- let p = r, m = l, f = !1;
4958
+ const g = this.grid.columns.findIndex((f) => f.field === s), l = this.grid.columns.map((f, _) => ({ index: _, column: f })).filter((f) => f.column.editable !== !1), h = l.findIndex((f) => f.index === g), u = this.grid.displayItems;
4959
+ let p = r, m = g, b = !1;
4747
4960
  switch (o.key) {
4748
4961
  case "ArrowUp":
4749
- r > 0 && (p = r - 1, f = !0);
4962
+ r > 0 && (p = r - 1, b = !0);
4750
4963
  break;
4751
4964
  case "ArrowDown":
4752
- r < u.length - 1 && (p = r + 1, f = !0);
4965
+ r < u.length - 1 && (p = r + 1, b = !0);
4753
4966
  break;
4754
4967
  case "ArrowLeft":
4755
- h > 0 && (m = g[h - 1].index, f = !0);
4968
+ h > 0 && (m = l[h - 1].index, b = !0);
4756
4969
  break;
4757
4970
  case "ArrowRight":
4758
- h < g.length - 1 && (m = g[h + 1].index, f = !0);
4971
+ h < l.length - 1 && (m = l[h + 1].index, b = !0);
4759
4972
  break;
4760
4973
  case "PageUp":
4761
- p = Math.max(0, r - 10), f = !0;
4974
+ p = Math.max(0, r - 10), b = !0;
4762
4975
  break;
4763
4976
  case "PageDown":
4764
- p = Math.min(u.length - 1, r + 10), f = !0;
4977
+ p = Math.min(u.length - 1, r + 10), b = !0;
4765
4978
  break;
4766
4979
  case "Home":
4767
- o.ctrlKey && (p = 0), m = 0, f = !0;
4980
+ o.ctrlKey && (p = 0), m = 0, b = !0;
4768
4981
  break;
4769
4982
  case "End":
4770
- o.ctrlKey ? (p = u.length - 1, m = this.grid.columns.length - 1) : m = this.grid.columns.length - 1, f = !0;
4983
+ o.ctrlKey ? (p = u.length - 1, m = this.grid.columns.length - 1) : m = this.grid.columns.length - 1, b = !0;
4771
4984
  break;
4772
4985
  }
4773
- f && (F(this), this.grid.cancelEdit(), queueMicrotask(() => {
4774
- E(this, p, m);
4986
+ b && (Y(this), this.grid.cancelEdit(), queueMicrotask(() => {
4987
+ $(this, p, m);
4775
4988
  }));
4776
4989
  return;
4777
4990
  }
@@ -4779,53 +4992,53 @@ class Zi extends HTMLElement {
4779
4992
  case "ArrowDown":
4780
4993
  if (this.dropdownOpen) {
4781
4994
  o.preventDefault(), o.stopPropagation();
4782
- const l = this.getCurrentEditorOptions();
4783
- let g = this.highlightedIndex + 1;
4784
- for (; g < this.dropdownOptions.length && mt(this.dropdownOptions[g], l); )
4785
- g++;
4786
- g < this.dropdownOptions.length && (this.highlightedIndex = g, et(this), pe(this));
4995
+ const g = this.getCurrentEditorOptions();
4996
+ let l = this.highlightedIndex + 1;
4997
+ for (; l < this.dropdownOptions.length && bt(this.dropdownOptions[l], g); )
4998
+ l++;
4999
+ l < this.dropdownOptions.length && (this.highlightedIndex = l, et(this), fe(this));
4787
5000
  }
4788
5001
  break;
4789
5002
  case "ArrowUp":
4790
5003
  if (this.dropdownOpen) {
4791
5004
  o.preventDefault(), o.stopPropagation();
4792
- const l = this.getCurrentEditorOptions();
4793
- let g = this.highlightedIndex - 1;
4794
- for (; g >= 0 && mt(this.dropdownOptions[g], l); )
4795
- g--;
4796
- g >= 0 && (this.highlightedIndex = g, et(this), pe(this));
5005
+ const g = this.getCurrentEditorOptions();
5006
+ let l = this.highlightedIndex - 1;
5007
+ for (; l >= 0 && bt(this.dropdownOptions[l], g); )
5008
+ l--;
5009
+ l >= 0 && (this.highlightedIndex = l, et(this), fe(this));
4797
5010
  }
4798
5011
  break;
4799
5012
  case "Enter":
4800
5013
  if (this.datepicker)
4801
5014
  return;
4802
- o.preventDefault(), o.stopPropagation(), this.dropdownOpen && this.highlightedIndex >= 0 ? Le(this, this.highlightedIndex) : a && !this.dropdownOpen ? K(this) : (this.isCommittingFromKeyboard = !0, L(this), d === "date" && i instanceof HTMLInputElement ? this.commitDateEditor(i) : Tt(this, i), Ft(this, r, s, "down"));
5015
+ o.preventDefault(), o.stopPropagation(), this.dropdownOpen && this.highlightedIndex >= 0 ? Pe(this, this.highlightedIndex) : a && !this.dropdownOpen ? W(this) : (this.isCommittingFromKeyboard = !0, L(this), d === "date" && i instanceof HTMLInputElement ? this.commitDateEditor(i) : Mt(this, i), Vt(this, r, s, "down"));
4803
5016
  break;
4804
5017
  case "Tab":
4805
5018
  if (this.datepicker)
4806
5019
  return;
4807
5020
  if (o.preventDefault(), o.stopPropagation(), this.isCommittingFromKeyboard = !0, this.dropdownOpen && this.highlightedIndex >= 0 && a) {
4808
- const l = this.dropdownOptions[this.highlightedIndex], g = this.getCurrentEditorOptions();
4809
- if (l && !mt(l, g)) {
4810
- const h = at(l, g);
5021
+ const g = this.dropdownOptions[this.highlightedIndex], l = this.getCurrentEditorOptions();
5022
+ if (g && !bt(g, l)) {
5023
+ const h = at(g, l);
4811
5024
  this.grid.commitEdit(r, s, h);
4812
5025
  }
4813
5026
  L(this);
4814
5027
  } else
4815
- L(this), d === "date" && i instanceof HTMLInputElement ? this.commitDateEditor(i) : a || Tt(this, i);
4816
- Ft(this, r, s, o.shiftKey ? "prev" : "next");
5028
+ L(this), d === "date" && i instanceof HTMLInputElement ? this.commitDateEditor(i) : a || Mt(this, i);
5029
+ Vt(this, r, s, o.shiftKey ? "prev" : "next");
4817
5030
  break;
4818
5031
  case "Escape":
4819
- o.preventDefault(), o.stopPropagation(), this.dropdownOpen && L(this), this.datepicker && (this.datepicker.close(!0), this.datepicker = null), this.isCommittingFromKeyboard = !0, F(this), this.grid.cancelEdit(), ti(this, r, s);
5032
+ o.preventDefault(), o.stopPropagation(), this.dropdownOpen && L(this), this.datepicker && (this.datepicker.close(!0), this.datepicker = null), this.isCommittingFromKeyboard = !0, Y(this), this.grid.cancelEdit(), ei(this, r, s);
4820
5033
  break;
4821
5034
  case "F2":
4822
- o.preventDefault(), o.stopPropagation(), a && !this.dropdownOpen && K(this);
5035
+ o.preventDefault(), o.stopPropagation(), a && !this.dropdownOpen && W(this);
4823
5036
  break;
4824
5037
  case "Backspace":
4825
- d === "select" && (o.preventDefault(), o.stopPropagation(), this.filterText.length > 0 && (this.filterText = this.filterText.slice(0, -1), me(this, n.editorOptions || {})));
5038
+ d === "select" && (o.preventDefault(), o.stopPropagation(), this.filterText.length > 0 && (this.filterText = this.filterText.slice(0, -1), be(this, n.editorOptions || {})));
4826
5039
  break;
4827
5040
  default:
4828
- d === "select" && o.key.length === 1 && !o.ctrlKey && !o.altKey && !o.metaKey && (o.preventDefault(), o.stopPropagation(), this.filterText += o.key, me(this, n.editorOptions || {}));
5041
+ d === "select" && o.key.length === 1 && !o.ctrlKey && !o.altKey && !o.metaKey && (o.preventDefault(), o.stopPropagation(), this.filterText += o.key, be(this, n.editorOptions || {}));
4829
5042
  break;
4830
5043
  }
4831
5044
  }
@@ -4840,11 +5053,11 @@ class Zi extends HTMLElement {
4840
5053
  const n = s.target;
4841
5054
  if (n.matches(".wg__cell")) {
4842
5055
  const a = parseInt(n.dataset.row || "0", 10), c = parseInt(n.dataset.col || "0", 10);
4843
- Wo(this, a, c);
5056
+ Xo(this, a, c);
4844
5057
  }
4845
5058
  if (n.matches(".wg__select-trigger, .wg__combobox-input, .wg__autocomplete-input") && !this.justSelected && !this.dropdownOpen) {
4846
- const a = n.dataset.field || "", c = this.grid.columns.find((h) => h.field === a), l = (c == null ? void 0 : c.editorOptions) || {};
4847
- (((d = this.grid.editingCell) == null ? void 0 : d.initialSearchQuery) !== void 0 || l.showOnFocus !== !1) && K(this);
5059
+ const a = n.dataset.field || "", c = this.grid.columns.find((h) => h.field === a), g = (c == null ? void 0 : c.editorOptions) || {};
5060
+ (((d = this.grid.editingCell) == null ? void 0 : d.initialSearchQuery) !== void 0 || g.showOnFocus !== !1) && W(this);
4848
5061
  }
4849
5062
  }, !0), o.addEventListener("keydown", (s) => {
4850
5063
  const n = s.target;
@@ -4857,20 +5070,20 @@ class Zi extends HTMLElement {
4857
5070
  this.handleCellKeyDown(s, d, a);
4858
5071
  }
4859
5072
  }), o.addEventListener("focusout", (s) => {
4860
- Xo(this, s);
5073
+ Qo(this, s);
4861
5074
  }), o.addEventListener("dblclick", (s) => {
4862
5075
  s.preventDefault();
4863
5076
  const d = s.target.closest(".wg__cell");
4864
5077
  if (d) {
4865
- const a = parseInt(d.dataset.row || "0", 10), c = parseInt(d.dataset.col || "0", 10), l = this.grid.columns[c];
4866
- if (l) {
4867
- const g = l.editTrigger || this.grid.editTrigger;
4868
- if (g === "dblclick" || g === "navigate") {
5078
+ const a = parseInt(d.dataset.row || "0", 10), c = parseInt(d.dataset.col || "0", 10), g = this.grid.columns[c];
5079
+ if (g) {
5080
+ const l = g.editTrigger || this.grid.editTrigger;
5081
+ if (l === "dblclick" || l === "navigate") {
4869
5082
  const h = zt(s, d);
4870
- j(this, a, c, { cursorPosition: h ?? void 0 });
4871
- const u = l.editor;
5083
+ B(this, a, c, { cursorPosition: h ?? void 0 });
5084
+ const u = g.editor;
4872
5085
  u === "select" || u === "combobox" || u === "autocomplete" ? requestAnimationFrame(() => {
4873
- this.dropdownOpen || K(this);
5086
+ this.dropdownOpen || W(this);
4874
5087
  }) : u === "custom" && requestAnimationFrame(() => {
4875
5088
  this.openCustomEditor(a, c);
4876
5089
  });
@@ -4880,14 +5093,14 @@ class Zi extends HTMLElement {
4880
5093
  }), o.addEventListener("click", (s) => {
4881
5094
  const d = s.target.closest(".wg__cell");
4882
5095
  if (d && !d.classList.contains("wg__cell--editing")) {
4883
- const a = parseInt(d.dataset.row || "0", 10), c = parseInt(d.dataset.col || "0", 10), l = this.grid.columns[c];
4884
- if (l && (l.editTrigger || this.grid.editTrigger) === "click") {
5096
+ const a = parseInt(d.dataset.row || "0", 10), c = parseInt(d.dataset.col || "0", 10), g = this.grid.columns[c];
5097
+ if (g && (g.editTrigger || this.grid.editTrigger) === "click") {
4885
5098
  s.preventDefault();
4886
5099
  const h = zt(s, d);
4887
- j(this, a, c, { cursorPosition: h ?? void 0 });
4888
- const u = l.editor;
5100
+ B(this, a, c, { cursorPosition: h ?? void 0 });
5101
+ const u = g.editor;
4889
5102
  u === "select" || u === "combobox" || u === "autocomplete" ? requestAnimationFrame(() => {
4890
- this.dropdownOpen || K(this);
5103
+ this.dropdownOpen || W(this);
4891
5104
  }) : u === "custom" && requestAnimationFrame(() => {
4892
5105
  this.openCustomEditor(a, c);
4893
5106
  });
@@ -4899,15 +5112,15 @@ class Zi extends HTMLElement {
4899
5112
  s.preventDefault(), s.stopPropagation();
4900
5113
  const a = n.closest(".wg__cell-date-display"), c = n.closest(".wg__editor--date");
4901
5114
  if (c) {
4902
- const l = c.querySelector(".wg__date-input");
4903
- l && this.openDatePicker(l, c);
5115
+ const g = c.querySelector(".wg__date-input");
5116
+ g && this.openDatePicker(g, c);
4904
5117
  } else if (a) {
4905
- const l = parseInt(a.dataset.row || "0", 10), g = a.dataset.field || "", h = this.grid.columns.findIndex((u) => String(u.field) === g);
4906
- h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), F(this), this.grid.cancelEdit()), j(this, l, h), requestAnimationFrame(() => {
4907
- var f;
5118
+ const g = parseInt(a.dataset.row || "0", 10), l = a.dataset.field || "", h = this.grid.columns.findIndex((u) => String(u.field) === l);
5119
+ h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, g, h), requestAnimationFrame(() => {
5120
+ var b;
4908
5121
  this.isTransitioningCells = !1;
4909
- const u = (f = this.shadowRoot) == null ? void 0 : f.querySelector(
4910
- `.wg__cell[data-row="${l}"][data-field="${g}"]`
5122
+ const u = (b = this.shadowRoot) == null ? void 0 : b.querySelector(
5123
+ `.wg__cell[data-row="${g}"][data-field="${l}"]`
4911
5124
  ), p = u == null ? void 0 : u.querySelector(".wg__date-input"), m = u == null ? void 0 : u.querySelector(".wg__editor--date");
4912
5125
  p && m && this.openDatePicker(p, m);
4913
5126
  }));
@@ -4917,20 +5130,20 @@ class Zi extends HTMLElement {
4917
5130
  if (this.dropdownOpen || this.grid.editingCell) {
4918
5131
  const a = n.closest(".wg__cell");
4919
5132
  if (a && !n.closest(".wg__editor--select, .wg__editor--combobox, .wg__editor--autocomplete, .wg__editor--date")) {
4920
- const c = parseInt(a.dataset.row || "0", 10), l = parseInt(a.dataset.col || "0", 10), g = this.grid.editingCell, h = n.matches(".wg__combobox-toggle, .wg__select-toggle, .wg__date-trigger");
4921
- if (g && !h) {
4922
- const u = this.grid.columns.findIndex((p) => String(p.field) === g.field);
4923
- if (c !== g.rowIndex || l !== u) {
4924
- s.preventDefault(), this.isTransitioningCells = !0, L(this), F(this), this.grid.cancelEdit();
4925
- const p = this.grid.columns[l], m = (p == null ? void 0 : p.editTrigger) || this.grid.editTrigger, v = s.clientX;
5133
+ const c = parseInt(a.dataset.row || "0", 10), g = parseInt(a.dataset.col || "0", 10), l = this.grid.editingCell, h = n.matches(".wg__combobox-toggle, .wg__select-toggle, .wg__date-trigger");
5134
+ if (l && !h) {
5135
+ const u = this.grid.columns.findIndex((p) => String(p.field) === l.field);
5136
+ if (c !== l.rowIndex || g !== u) {
5137
+ s.preventDefault(), this.isTransitioningCells = !0, L(this), Y(this), this.grid.cancelEdit();
5138
+ const p = this.grid.columns[g], m = (p == null ? void 0 : p.editTrigger) || this.grid.editTrigger, f = s.clientX;
4926
5139
  requestAnimationFrame(() => {
4927
5140
  if (this.isTransitioningCells = !1, m === "click" && p && this.grid.isCellEditable(p)) {
4928
- const b = this.shadow.querySelector(
4929
- `td[data-row="${c}"][data-col="${l}"]`
4930
- ), _ = b ? zt({ clientX: v }, b) : void 0;
4931
- j(this, c, l, { cursorPosition: _ ?? void 0 });
5141
+ const _ = this.shadow.querySelector(
5142
+ `td[data-row="${c}"][data-col="${g}"]`
5143
+ ), v = _ ? zt({ clientX: f }, _) : void 0;
5144
+ B(this, c, g, { cursorPosition: v ?? void 0 });
4932
5145
  } else
4933
- E(this, c, l);
5146
+ $(this, c, g);
4934
5147
  });
4935
5148
  return;
4936
5149
  }
@@ -4941,11 +5154,11 @@ class Zi extends HTMLElement {
4941
5154
  s.preventDefault(), s.stopPropagation();
4942
5155
  const a = n.closest(".wg__cell-dropdown-display");
4943
5156
  if (n.closest(".wg__editor--select, .wg__editor--combobox, .wg__editor--autocomplete"))
4944
- we(this);
5157
+ me(this);
4945
5158
  else if (a) {
4946
- const l = parseInt(a.dataset.row || "0", 10), g = a.dataset.field || "", h = this.grid.columns.findIndex((u) => String(u.field) === g);
4947
- h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), F(this), this.grid.cancelEdit()), j(this, l, h), requestAnimationFrame(() => {
4948
- this.isTransitioningCells = !1, this.dropdownOpen || K(this);
5159
+ const g = parseInt(a.dataset.row || "0", 10), l = a.dataset.field || "", h = this.grid.columns.findIndex((u) => String(u.field) === l);
5160
+ h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, g, h), requestAnimationFrame(() => {
5161
+ this.isTransitioningCells = !1, this.dropdownOpen || W(this);
4949
5162
  }));
4950
5163
  }
4951
5164
  }
@@ -4953,66 +5166,66 @@ class Zi extends HTMLElement {
4953
5166
  s.preventDefault(), s.stopPropagation();
4954
5167
  const a = n.closest(".wg__cell-dropdown-display");
4955
5168
  if (a) {
4956
- const c = parseInt(a.dataset.row || "0", 10), l = a.dataset.field || "", g = this.grid.columns.findIndex((h) => String(h.field) === l);
4957
- g >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), F(this), this.grid.cancelEdit()), j(this, c, g), requestAnimationFrame(() => {
4958
- this.isTransitioningCells = !1, this.dropdownOpen || K(this);
5169
+ const c = parseInt(a.dataset.row || "0", 10), g = a.dataset.field || "", l = this.grid.columns.findIndex((h) => String(h.field) === g);
5170
+ l >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, c, l), requestAnimationFrame(() => {
5171
+ this.isTransitioningCells = !1, this.dropdownOpen || W(this);
4959
5172
  }));
4960
5173
  }
4961
5174
  }
4962
5175
  }), o.addEventListener("click", (s) => {
4963
- s.target.matches(".wg__select-trigger, .wg__select-value") && (s.preventDefault(), s.stopPropagation(), we(this));
5176
+ s.target.matches(".wg__select-trigger, .wg__select-value") && (s.preventDefault(), s.stopPropagation(), me(this));
4964
5177
  }), o.addEventListener("click", (s) => {
4965
5178
  const n = s, a = n.target.closest(".wg__header--sortable");
4966
5179
  if (a) {
4967
5180
  const c = a.dataset.field;
4968
5181
  if (!c) return;
4969
- const l = [...this.grid.sort], g = l.findIndex((u) => u.column === c);
4970
- (n.ctrlKey || n.metaKey) && this.grid.sortMode === "multi" ? g >= 0 ? l[g].direction === "asc" ? l[g] = { column: c, direction: "desc" } : l.splice(g, 1) : l.push({ column: c, direction: "asc" }) : g >= 0 && l.length === 1 ? l[0].direction === "asc" ? l[0] = { column: c, direction: "desc" } : l.length = 0 : (l.length = 0, l.push({ column: c, direction: "asc" })), this.grid.sort = l, this.grid.pageable && (this.grid.currentPage = 1), this.grid.fireDataRequest("sort"), this.render();
5182
+ const g = [...this.grid.sort], l = g.findIndex((u) => u.column === c);
5183
+ (n.ctrlKey || n.metaKey) && this.grid.sortMode === "multi" ? l >= 0 ? g[l].direction === "asc" ? g[l] = { column: c, direction: "desc" } : g.splice(l, 1) : g.push({ column: c, direction: "asc" }) : l >= 0 && g.length === 1 ? g[0].direction === "asc" ? g[0] = { column: c, direction: "desc" } : g.length = 0 : (g.length = 0, g.push({ column: c, direction: "asc" })), this.grid.sort = g, this.grid.pageable && (this.grid.currentPage = 1), this.grid.fireDataRequest("sort"), this.render();
4971
5184
  }
4972
5185
  }), o.addEventListener("contextmenu", (s) => {
4973
5186
  this.handleContextMenu(s);
4974
5187
  }), o.addEventListener("change", (s) => {
4975
5188
  const n = s.target;
4976
- n.matches(".wg__editor--checkbox") && Go(this, n);
5189
+ n.matches(".wg__editor--checkbox") && Jo(this, n);
4977
5190
  }), o.addEventListener("input", (s) => {
4978
5191
  const n = s.target;
4979
- n.matches(".wg__combobox-input") ? qo(this, s) : n.matches(".wg__autocomplete-input") && Yo(this, s);
5192
+ n.matches(".wg__combobox-input") ? Yo(this, s) : n.matches(".wg__autocomplete-input") && No(this, s);
4980
5193
  }), o.addEventListener("blur", (s) => {
4981
5194
  const n = s.target;
4982
- if (n.matches(".wg__editor--text, .wg__editor--number") && Zo(this, n), n.matches(".wg__date-input") && !this.datepicker && !this.isCommittingFromKeyboard && !this.isTransitioningCells && this.commitDateEditor(n), n.matches(".wg__select-trigger") && !this.isCommittingFromKeyboard && !this.isTransitioningCells && !this.dropdownOpen && !this.isOpeningDropdown && (L(this), F(this), this.grid.cancelEdit()), n.matches(".wg__combobox-input, .wg__autocomplete-input")) {
5195
+ if (n.matches(".wg__editor--text, .wg__editor--number") && ti(this, n), n.matches(".wg__date-input") && !this.datepicker && !this.isCommittingFromKeyboard && !this.isTransitioningCells && this.commitDateEditor(n), n.matches(".wg__select-trigger") && !this.isCommittingFromKeyboard && !this.isTransitioningCells && !this.dropdownOpen && !this.isOpeningDropdown && (L(this), Y(this), this.grid.cancelEdit()), n.matches(".wg__combobox-input, .wg__autocomplete-input")) {
4983
5196
  if (this.isCommittingFromKeyboard || this.isTransitioningCells)
4984
5197
  return;
4985
5198
  if (L(this), this.grid.editingCell) {
4986
5199
  const d = n, a = this.getCurrentEditingColumn();
4987
5200
  if (a) {
4988
- const c = a.editorOptions || {}, g = (c.options || c.initialOptions || []).find(
4989
- (h) => yt(h, c).toLowerCase() === d.value.toLowerCase()
5201
+ const c = a.editorOptions || {}, l = (c.options || c.initialOptions || []).find(
5202
+ (h) => Ct(h, c).toLowerCase() === d.value.toLowerCase()
4990
5203
  );
4991
- g ? this.grid.commitEdit(this.grid.editingCell.rowIndex, this.grid.editingCell.field, at(g, c)) : this.grid.commitEdit(this.grid.editingCell.rowIndex, this.grid.editingCell.field, d.value);
5204
+ l ? this.grid.commitEdit(this.grid.editingCell.rowIndex, this.grid.editingCell.field, at(l, c)) : this.grid.commitEdit(this.grid.editingCell.rowIndex, this.grid.editingCell.field, d.value);
4992
5205
  }
4993
5206
  }
4994
5207
  }
4995
5208
  }, !0);
4996
5209
  const i = this.shadow.querySelector(".wg");
4997
5210
  i && i.addEventListener("scroll", () => {
4998
- this.dropdownOpen && !this.isTransitioningCells && !this.isOpeningDropdown && (L(this), F(this), this.grid.cancelEdit()), this.grid.shouldUseVirtualScroll() && this.handleVirtualScroll(i), this.grid.infiniteScroll && this.grid.hasMoreItems && !this.isLoadingMoreItems && this.handleInfiniteScroll(i);
5211
+ this.dropdownOpen && !this.isTransitioningCells && !this.isOpeningDropdown && (L(this), Y(this), this.grid.cancelEdit()), this.grid.shouldUseVirtualScroll() && this.handleVirtualScroll(i), this.grid.infiniteScroll && this.grid.hasMoreItems && !this.isLoadingMoreItems && this.handleInfiniteScroll(i), vt() !== null && (_e(this, this.grid.displayItems), this.renderConnector());
4999
5212
  }), this.wheelListenerAdded || (this.wheelListenerAdded = !0, window.addEventListener("scroll", () => {
5000
- this.dropdownOpen && !this.isTransitioningCells && (L(this), F(this), this.grid.cancelEdit());
5213
+ this.dropdownOpen && !this.isTransitioningCells && (L(this), Y(this), this.grid.cancelEdit());
5001
5214
  }, { passive: !0, capture: !0 })), o.addEventListener("mouseenter", (s) => {
5002
5215
  const n = s.target, d = n.closest("[data-tooltip-html]");
5003
5216
  if (d) {
5004
5217
  const c = d.getAttribute("data-tooltip-html");
5005
- be(this, d, c, this._tooltipShowDelay, !0);
5218
+ ve(this, d, c, this._tooltipShowDelay, !0);
5006
5219
  return;
5007
5220
  }
5008
5221
  const a = n.closest("[data-tooltip]");
5009
5222
  if (a) {
5010
5223
  const c = a.getAttribute("data-tooltip");
5011
- be(this, a, c, this._tooltipShowDelay, !1);
5224
+ ve(this, a, c, this._tooltipShowDelay, !1);
5012
5225
  }
5013
5226
  }, !0), o.addEventListener("mouseleave", (s) => {
5014
5227
  const n = s, d = n.target, a = n.relatedTarget, c = d.closest("[data-tooltip], [data-tooltip-html]");
5015
- c && (a == null ? void 0 : a.closest("[data-tooltip], [data-tooltip-html]")) === c || c && Uo(this, this._tooltipHideDelay);
5228
+ c && (a == null ? void 0 : a.closest("[data-tooltip], [data-tooltip-html]")) === c || c && jo(this, this._tooltipHideDelay);
5016
5229
  }, !0), o.addEventListener("click", (s) => {
5017
5230
  const d = s.target.closest(".wg__toolbar-trigger");
5018
5231
  if (d && this.grid.toolbarTrigger === "button") {
@@ -5033,8 +5246,8 @@ class Zi extends HTMLElement {
5033
5246
  if (s.target.closest(".wg__row")) {
5034
5247
  if (this.toolbarMoveInProgress) return;
5035
5248
  this.toolbarHideTimeout && clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = setTimeout(() => {
5036
- const c = this.shadow.querySelector(".wg__toolbar-container"), l = c == null ? void 0 : c.matches(":hover"), g = o.matches(":hover");
5037
- !l && !g && (this.closeToolbarAndReset(), this.grid.editingCell || this.render());
5249
+ const c = this.shadow.querySelector(".wg__toolbar-container"), g = c == null ? void 0 : c.matches(":hover"), l = o.matches(":hover");
5250
+ !g && !l && (this.closeToolbarAndReset(), this.grid.editingCell || this.render());
5038
5251
  }, 150);
5039
5252
  }
5040
5253
  }, !0), o.addEventListener("click", (s) => {
@@ -5045,25 +5258,25 @@ class Zi extends HTMLElement {
5045
5258
  qt(c) ? (this.closeToolbarAndReset(), this.render()) : this.showToolbarForRow(a, c, n.clientX);
5046
5259
  }
5047
5260
  }), this.toolbarOutsideClickAdded || (this.toolbarOutsideClickAdded = !0, document.addEventListener("click", (s) => {
5048
- if (!fi(this.shadow))
5261
+ if (!wi(this.shadow))
5049
5262
  return;
5050
- const n = s.composedPath(), d = n.some((l) => {
5051
- var g;
5052
- return (g = l.classList) == null ? void 0 : g.contains("wg__toolbar-container");
5053
- }), a = n.some((l) => {
5054
- var g;
5055
- return (g = l.classList) == null ? void 0 : g.contains("wg__toolbar-trigger");
5263
+ const n = s.composedPath(), d = n.some((g) => {
5264
+ var l;
5265
+ return (l = g.classList) == null ? void 0 : l.contains("wg__toolbar-container");
5266
+ }), a = n.some((g) => {
5267
+ var l;
5268
+ return (l = g.classList) == null ? void 0 : l.contains("wg__toolbar-trigger");
5056
5269
  });
5057
- d || a || n.includes(this) && (this.grid.toolbarTrigger === "hover" || this.grid.toolbarTrigger === "click") || $t() !== null && (this.closeToolbarAndReset(), this.render());
5270
+ d || a || n.includes(this) && (this.grid.toolbarTrigger === "hover" || this.grid.toolbarTrigger === "click") || vt() !== null && (this.closeToolbarAndReset(), this.render());
5058
5271
  })), this.toolbarScrollListenerAdded || (this.toolbarScrollListenerAdded = !0, window.addEventListener("scroll", () => {
5059
- $t() !== null && (this.closeToolbarAndReset(), this.render());
5272
+ vt() !== null && (this.closeToolbarAndReset(), this.render());
5060
5273
  }, !0)), this.shadow.querySelectorAll(".wg__pagination").forEach((s) => {
5061
5274
  s.addEventListener("click", (d) => {
5062
5275
  const c = d.target.closest(".wg__pagination-btn");
5063
5276
  if (!c || c.hasAttribute("disabled")) return;
5064
- const l = c.dataset.action;
5065
- let g = !1;
5066
- l === "first" && this.grid.currentPage !== 1 ? (this.grid.currentPage = 1, g = !0) : l === "prev" && this.grid.currentPage > 1 ? (this.grid.currentPage--, g = !0) : l === "next" && this.grid.currentPage < this.grid.totalPages ? (this.grid.currentPage++, g = !0) : l === "last" && this.grid.currentPage !== this.grid.totalPages && (this.grid.currentPage = this.grid.totalPages, g = !0), g && (this.grid.fireDataRequest("page"), this.render());
5277
+ const g = c.dataset.action;
5278
+ let l = !1;
5279
+ g === "first" && this.grid.currentPage !== 1 ? (this.grid.currentPage = 1, l = !0) : g === "prev" && this.grid.currentPage > 1 ? (this.grid.currentPage--, l = !0) : g === "next" && this.grid.currentPage < this.grid.totalPages ? (this.grid.currentPage++, l = !0) : g === "last" && this.grid.currentPage !== this.grid.totalPages && (this.grid.currentPage = this.grid.totalPages, l = !0), l && (this.grid.fireDataRequest("page"), this.render());
5067
5280
  });
5068
5281
  const n = s.querySelector(".wg__pagination-select");
5069
5282
  n && n.addEventListener("change", () => {
@@ -5082,13 +5295,13 @@ class Zi extends HTMLElement {
5082
5295
  const i = this.grid.displayItems, r = this.grid.virtualScrollRowHeight, s = this.grid.virtualScrollBuffer, n = o.scrollTop, d = o.clientHeight;
5083
5296
  let a = Math.max(0, Math.floor(n / r) - s);
5084
5297
  const c = Math.ceil(d / r) + s * 2;
5085
- let l = Math.min(i.length, a + c);
5086
- const g = this.grid.editingCell;
5087
- if (g) {
5088
- const h = g.rowIndex;
5089
- h < a && (a = h), h >= l && (l = h + 1);
5298
+ let g = Math.min(i.length, a + c);
5299
+ const l = this.grid.editingCell;
5300
+ if (l) {
5301
+ const h = l.rowIndex;
5302
+ h < a && (a = h), h >= g && (g = h + 1);
5090
5303
  }
5091
- (a !== this.virtualScrollStart || l !== this.virtualScrollEnd) && (this.virtualScrollStart = a, this.virtualScrollEnd = l, this.renderVirtualRows(o));
5304
+ (a !== this.virtualScrollStart || g !== this.virtualScrollEnd) && (this.virtualScrollStart = a, this.virtualScrollEnd = g, this.renderVirtualRows(o));
5092
5305
  }
5093
5306
  /**
5094
5307
  * Render only the tbody with virtual rows (fast update, no full re-render)
@@ -5103,12 +5316,12 @@ class Zi extends HTMLElement {
5103
5316
  rowHeight: this.grid.virtualScrollRowHeight,
5104
5317
  totalItems: r.length
5105
5318
  }, n = this.grid.focusedCell;
5106
- if (i.innerHTML = ve(this, s), n) {
5319
+ if (i.innerHTML = ye(this, s), n) {
5107
5320
  this.grid.setFocusedCell(n.rowIndex, n.colIndex);
5108
5321
  const d = i.querySelector(
5109
5322
  `td[data-row="${n.rowIndex}"][data-col="${n.colIndex}"]`
5110
5323
  );
5111
- d && (d.focus({ preventScroll: !0 }), B(this, null, n));
5324
+ d && (d.focus({ preventScroll: !0 }), K(this, null, n));
5112
5325
  }
5113
5326
  }
5114
5327
  /**
@@ -5121,45 +5334,76 @@ class Zi extends HTMLElement {
5121
5334
  // ==========================================================================
5122
5335
  // Rendering
5123
5336
  // ==========================================================================
5337
+ /**
5338
+ * Render the shortcuts help icon and overlay
5339
+ */
5340
+ renderShortcutsHelpIcon() {
5341
+ var n, d, a;
5342
+ if (!this.grid.showShortcutsHelp || !((n = this.grid.rowShortcuts) != null && n.length))
5343
+ return "";
5344
+ const i = this.grid.shortcutsHelpPosition === "top-left" ? "wg__shortcuts-help--left" : "", r = this.grid.rowShortcuts.map((c) => `<div class="wg__shortcuts-help-item">
5345
+ <span class="wg__shortcuts-help-key">${er(c.key)}</span>
5346
+ <span class="wg__shortcuts-help-label">${c.label}</span>
5347
+ </div>`).join(""), s = ((a = (d = this.grid).shortcutsHelpContentCallback) == null ? void 0 : a.call(d)) || "";
5348
+ return `
5349
+ <div class="wg__shortcuts-help ${i}">
5350
+ <button class="wg__shortcuts-help-icon" type="button" title="Keyboard shortcuts">
5351
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
5352
+ <circle cx="12" cy="12" r="10"></circle>
5353
+ <path d="M12 16v-4"></path>
5354
+ <path d="M12 8h.01"></path>
5355
+ </svg>
5356
+ </button>
5357
+ <div class="wg__shortcuts-help-overlay">
5358
+ ${s ? `<div class="wg__shortcuts-help-custom">${s}</div>` : ""}
5359
+ <div class="wg__shortcuts-help-title">Keyboard Shortcuts</div>
5360
+ <div class="wg__shortcuts-help-list">
5361
+ ${r}
5362
+ </div>
5363
+ </div>
5364
+ </div>
5365
+ `;
5366
+ }
5124
5367
  render() {
5125
- var m;
5368
+ var b;
5126
5369
  const o = this.shadow.querySelector(".wg"), i = (o == null ? void 0 : o.scrollTop) || 0, r = (o == null ? void 0 : o.scrollLeft) || 0, s = this.grid.focusedCell;
5127
5370
  o && o.remove();
5128
5371
  const n = document.createElement("div");
5129
5372
  n.className = bi(this);
5130
- const d = this.grid.paginationPosition.split("|").map((f) => f.trim()), a = this.grid.summaryPosition ? this.grid.summaryPosition.split("|").map((f) => f.trim()) : [], c = (f, v) => {
5131
- const b = d.filter(
5132
- (x) => v ? x.startsWith("top-") : x.startsWith("bottom-")
5133
- ), _ = a.filter(
5134
- (x) => v ? x.startsWith("top-") : x.startsWith("bottom-")
5135
- ), S = b.length > 0, y = _.length > 0;
5136
- return !S && !y ? "" : y && S && this.grid.summaryInline ? `<div class="wg__footer${v ? " wg__footer--top" : ""}">
5137
- ${Nt(this, _[0])}
5138
- ${Yt(this, b[0])}
5139
- </div>` : [.../* @__PURE__ */ new Set([...b, ..._])].map((x) => {
5140
- const C = b.includes(x), T = _.includes(x);
5141
- return T && C ? `<div class="wg__footer${v ? " wg__footer--top" : ""}">
5142
- ${Nt(this, x)}
5143
- ${Yt(this, x)}
5144
- </div>` : T ? Nt(this, x) : Yt(this, x);
5373
+ const d = this.grid.paginationPosition.split("|").map((f) => f.trim()), a = this.grid.summaryPosition ? this.grid.summaryPosition.split("|").map((f) => f.trim()) : [], c = (f, _) => {
5374
+ const v = d.filter(
5375
+ (y) => _ ? y.startsWith("top-") : y.startsWith("bottom-")
5376
+ ), S = a.filter(
5377
+ (y) => _ ? y.startsWith("top-") : y.startsWith("bottom-")
5378
+ ), C = v.length > 0, x = S.length > 0;
5379
+ return !C && !x ? "" : x && C && this.grid.summaryInline ? `<div class="wg__footer${_ ? " wg__footer--top" : ""}">
5380
+ ${Nt(this, S[0])}
5381
+ ${Yt(this, v[0])}
5382
+ </div>` : [.../* @__PURE__ */ new Set([...v, ...S])].map((y) => {
5383
+ const T = v.includes(y), k = S.includes(y);
5384
+ return k && T ? `<div class="wg__footer${_ ? " wg__footer--top" : ""}">
5385
+ ${Nt(this, y)}
5386
+ ${Yt(this, y)}
5387
+ </div>` : k ? Nt(this, y) : Yt(this, y);
5145
5388
  }).join("");
5146
- }, l = c(d, !0), g = c(d, !1), h = this.grid.shouldUseVirtualScroll();
5389
+ }, g = c(d, !0), l = c(d, !1), h = this.grid.shouldUseVirtualScroll();
5147
5390
  let u;
5148
5391
  if (h) {
5149
- const f = this.grid.displayItems, v = this.grid.virtualScrollRowHeight, b = this.grid.virtualScrollBuffer, _ = (o == null ? void 0 : o.clientHeight) || 400, S = Math.max(0, Math.floor(i / v) - b), y = Math.ceil(_ / v) + b * 2, D = Math.min(f.length, S + y);
5150
- this.virtualScrollStart = S, this.virtualScrollEnd = D;
5151
- const x = {
5152
- startIndex: S,
5392
+ const f = this.grid.displayItems, _ = this.grid.virtualScrollRowHeight, v = this.grid.virtualScrollBuffer, S = (o == null ? void 0 : o.clientHeight) || 400, C = Math.max(0, Math.floor(i / _) - v), x = Math.ceil(S / _) + v * 2, D = Math.min(f.length, C + x);
5393
+ this.virtualScrollStart = C, this.virtualScrollEnd = D;
5394
+ const y = {
5395
+ startIndex: C,
5153
5396
  endIndex: D,
5154
- rowHeight: v,
5397
+ rowHeight: _,
5155
5398
  totalItems: f.length
5156
5399
  };
5157
- u = ve(this, x);
5400
+ u = ye(this, y);
5158
5401
  } else
5159
5402
  u = _i(this);
5160
5403
  h && n.classList.add("wg--virtual-scroll");
5161
- const p = `
5162
- ${l}
5404
+ const m = `
5405
+ ${this.renderShortcutsHelpIcon()}
5406
+ ${g}
5163
5407
  <table class="wg__table">
5164
5408
  <thead>
5165
5409
  ${vi(this)}
@@ -5168,9 +5412,9 @@ class Zi extends HTMLElement {
5168
5412
  ${u}
5169
5413
  </tbody>
5170
5414
  </table>
5171
- ${g}
5415
+ ${l}
5172
5416
  `;
5173
- if (n.innerHTML = p, this.shadow.appendChild(n), h) {
5417
+ if (n.innerHTML = m, this.shadow.appendChild(n), h) {
5174
5418
  const f = Math.max(0, this.grid.displayItems.length * this.grid.virtualScrollRowHeight - n.clientHeight);
5175
5419
  n.scrollTop = Math.min(i, f);
5176
5420
  } else
@@ -5178,16 +5422,16 @@ class Zi extends HTMLElement {
5178
5422
  if (n.scrollLeft = r, this.attachEventListeners(), this.grid.editingCell) {
5179
5423
  let f = this.shadow.querySelector(".wg__combobox-input, .wg__autocomplete-input, .wg__select-trigger, .wg__date-input");
5180
5424
  if (f || (f = this.shadow.querySelector(".wg__editor")), f && (f.focus(), f instanceof HTMLInputElement && f.type === "text")) {
5181
- const v = this.grid.editingCell.cursorPosition, b = this.getCurrentEditingColumn(), _ = ((m = b == null ? void 0 : b.editorOptions) == null ? void 0 : m.editStartSelection) || this.grid.editStartSelection;
5425
+ const _ = this.grid.editingCell.cursorPosition, v = this.getCurrentEditingColumn(), S = ((b = v == null ? void 0 : v.editorOptions) == null ? void 0 : b.editStartSelection) || this.grid.editStartSelection;
5182
5426
  if (this.grid.editingCell.initialSearchQuery !== void 0) {
5183
- const S = f.value.length;
5184
- f.setSelectionRange(S, S);
5427
+ const C = f.value.length;
5428
+ f.setSelectionRange(C, C);
5185
5429
  } else
5186
- switch (_) {
5430
+ switch (S) {
5187
5431
  case "mousePosition":
5188
- if (v !== void 0) {
5189
- const S = Math.min(v, f.value.length);
5190
- f.setSelectionRange(S, S);
5432
+ if (_ !== void 0) {
5433
+ const C = Math.min(_, f.value.length);
5434
+ f.setSelectionRange(C, C);
5191
5435
  } else
5192
5436
  f.setSelectionRange(f.value.length, f.value.length);
5193
5437
  break;
@@ -5221,7 +5465,7 @@ class Zi extends HTMLElement {
5221
5465
  renderConnector() {
5222
5466
  const o = this.shadow.querySelector(".wg__connector");
5223
5467
  o && o.remove();
5224
- const i = wi();
5468
+ const i = mi();
5225
5469
  if (!i.path || !i.arrowPos)
5226
5470
  return;
5227
5471
  const r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
@@ -5237,7 +5481,7 @@ class Zi extends HTMLElement {
5237
5481
  openDatePicker(o, i) {
5238
5482
  this.datepicker && (this.datepicker.close(!0), this.datepicker = null);
5239
5483
  const r = o.dataset.dateFormat || "YYYY-MM-DD", s = o.dataset.minDate, n = o.dataset.maxDate, d = o.dataset.dateValue || "";
5240
- this.datepicker = new ne({
5484
+ this.datepicker = new se({
5241
5485
  dateFormat: r,
5242
5486
  minDate: s || void 0,
5243
5487
  maxDate: n || void 0,
@@ -5245,7 +5489,7 @@ class Zi extends HTMLElement {
5245
5489
  this.handleDatePickerSelect(o, a, c);
5246
5490
  },
5247
5491
  onClose: () => {
5248
- this.datepicker = null, F(this), this.grid.cancelEdit();
5492
+ this.datepicker = null, Y(this), this.grid.cancelEdit();
5249
5493
  }
5250
5494
  }), this.datepicker.open(i, d || null);
5251
5495
  }
@@ -5254,7 +5498,7 @@ class Zi extends HTMLElement {
5254
5498
  */
5255
5499
  handleDatePickerSelect(o, i, r) {
5256
5500
  const s = o.dataset.dateFormat || "YYYY-MM-DD", n = Kt(s);
5257
- o.value = Fe(i, n), o.dataset.dateValue = Wt(i), this.isCommittingFromKeyboard = !0, this.commitDateEditor(o);
5501
+ o.value = Fe(i, n), o.dataset.dateValue = Wt(i), this.datepicker = null, this.isCommittingFromKeyboard = !0, this.commitDateEditor(o);
5258
5502
  const d = parseInt(o.dataset.row || "0", 10), a = o.dataset.field || "";
5259
5503
  this.moveFocusAfterCommit(d, a, r || "down");
5260
5504
  }
@@ -5287,11 +5531,11 @@ class Zi extends HTMLElement {
5287
5531
  if (!o) return null;
5288
5532
  const r = o.split(i.separator);
5289
5533
  let s = null, n = null, d = null;
5290
- if (r.forEach((c, l) => {
5534
+ if (r.forEach((c, g) => {
5291
5535
  var h, u, p;
5292
5536
  if (!c) return;
5293
- const g = parseInt(c, 10);
5294
- ((h = i.parts.year) == null ? void 0 : h.index) === l ? s = g < 100 ? g + 2e3 : g : ((u = i.parts.month) == null ? void 0 : u.index) === l ? n = g : ((p = i.parts.day) == null ? void 0 : p.index) === l && (d = g);
5537
+ const l = parseInt(c, 10);
5538
+ ((h = i.parts.year) == null ? void 0 : h.index) === g ? s = l < 100 ? l + 2e3 : l : ((u = i.parts.month) == null ? void 0 : u.index) === g ? n = l : ((p = i.parts.day) == null ? void 0 : p.index) === g && (d = l);
5295
5539
  }), s === null || n === null || d === null) return null;
5296
5540
  const a = new Date(s, n - 1, d);
5297
5541
  return a.getMonth() !== n - 1 || a.getDate() !== d ? null : a;
@@ -5316,33 +5560,33 @@ class Zi extends HTMLElement {
5316
5560
  const s = r.querySelector(".wg__goto-input"), n = r.querySelector(".wg__goto-btn--go"), d = r.querySelector(".wg__goto-btn--cancel"), a = () => {
5317
5561
  r.remove();
5318
5562
  }, c = () => {
5319
- const l = parseInt(s.value, 10);
5320
- if (isNaN(l) || l < 1 || l > i.length) {
5563
+ const g = parseInt(s.value, 10);
5564
+ if (isNaN(g) || g < 1 || g > i.length) {
5321
5565
  s.focus(), s.select();
5322
5566
  return;
5323
5567
  }
5324
5568
  a();
5325
- const g = l - 1, h = this.grid.focusedCell;
5326
- if (this.grid.setFocusedCell(g, o), this.grid.shouldUseVirtualScroll())
5327
- st(this, g), requestAnimationFrame(() => {
5569
+ const l = g - 1, h = this.grid.focusedCell;
5570
+ if (this.grid.setFocusedCell(l, o), this.grid.shouldUseVirtualScroll())
5571
+ st(this, l), requestAnimationFrame(() => {
5328
5572
  requestAnimationFrame(() => {
5329
5573
  const u = this.shadow.querySelector(
5330
- `td[data-row="${g}"][data-col="${o}"]`
5574
+ `td[data-row="${l}"][data-col="${o}"]`
5331
5575
  );
5332
5576
  u == null || u.focus();
5333
5577
  });
5334
5578
  });
5335
5579
  else {
5336
5580
  const u = this.shadow.querySelector(
5337
- `td[data-row="${g}"][data-col="${o}"]`
5581
+ `td[data-row="${l}"][data-col="${o}"]`
5338
5582
  );
5339
- u && (u.scrollIntoView({ block: "nearest", behavior: "auto" }), u.focus(), B(this, h, { rowIndex: g, colIndex: o }));
5583
+ u && (u.scrollIntoView({ block: "nearest", behavior: "auto" }), u.focus(), K(this, h, { rowIndex: l, colIndex: o }));
5340
5584
  }
5341
5585
  };
5342
- n.addEventListener("click", c), d.addEventListener("click", a), r.addEventListener("click", (l) => {
5343
- l.target === r && a();
5344
- }), s.addEventListener("keydown", (l) => {
5345
- l.key === "Enter" ? (l.preventDefault(), c()) : l.key === "Escape" && (l.preventDefault(), a());
5586
+ n.addEventListener("click", c), d.addEventListener("click", a), r.addEventListener("click", (g) => {
5587
+ g.target === r && a();
5588
+ }), s.addEventListener("keydown", (g) => {
5589
+ g.key === "Enter" ? (g.preventDefault(), c()) : g.key === "Escape" && (g.preventDefault(), a());
5346
5590
  }), this.shadow.appendChild(r), s.focus(), s.select();
5347
5591
  }
5348
5592
  /**
@@ -5360,13 +5604,13 @@ class Zi extends HTMLElement {
5360
5604
  rowIndex: o,
5361
5605
  field: s,
5362
5606
  commit: (c) => {
5363
- this.grid.commitEdit(o, s, c), F(this), requestAnimationFrame(() => {
5364
- E(this, o, i);
5607
+ this.grid.commitEdit(o, s, c), Y(this), requestAnimationFrame(() => {
5608
+ $(this, o, i);
5365
5609
  });
5366
5610
  },
5367
5611
  cancel: () => {
5368
- F(this), this.grid.cancelEdit(), requestAnimationFrame(() => {
5369
- E(this, o, i);
5612
+ Y(this), this.grid.cancelEdit(), requestAnimationFrame(() => {
5613
+ $(this, o, i);
5370
5614
  });
5371
5615
  }
5372
5616
  };
@@ -5382,17 +5626,17 @@ class Zi extends HTMLElement {
5382
5626
  const s = o.target.closest(".wg__cell");
5383
5627
  if (!s)
5384
5628
  return;
5385
- o.preventDefault(), this.contextMenuElement && (bt(this.contextMenuElement), this.contextMenuElement = null);
5629
+ o.preventDefault(), this.contextMenuElement && (ht(this.contextMenuElement), this.contextMenuElement = null);
5386
5630
  const n = parseInt(s.dataset.row || "0", 10), d = parseInt(s.dataset.col || "0", 10), a = this.grid.columns[d];
5387
5631
  if (!a) return;
5388
5632
  const c = this.grid.displayItems[n];
5389
5633
  if (!c) return;
5390
- const l = String(a.field), g = this.grid.getCellRawValue(c, n, l), h = {
5634
+ const g = String(a.field), l = this.grid.getCellRawValue(c, n, g), h = {
5391
5635
  row: c,
5392
5636
  rowIndex: n,
5393
5637
  colIndex: d,
5394
5638
  column: a,
5395
- cellValue: g
5639
+ cellValue: l
5396
5640
  };
5397
5641
  this.grid.oncontextmenuopen && this.grid.oncontextmenuopen(h), this.contextMenuElement = Ji(
5398
5642
  this,
@@ -5402,7 +5646,7 @@ class Zi extends HTMLElement {
5402
5646
  h,
5403
5647
  (u) => {
5404
5648
  const p = i.find((m) => m.id === u);
5405
- p != null && p.onclick && p.onclick(h), this.contextMenuElement && (bt(this.contextMenuElement), this.contextMenuElement = null);
5649
+ p != null && p.onclick && p.onclick(h), this.contextMenuElement && (ht(this.contextMenuElement), this.contextMenuElement = null);
5406
5650
  },
5407
5651
  () => {
5408
5652
  this.contextMenuElement = null;
@@ -5415,10 +5659,10 @@ class Zi extends HTMLElement {
5415
5659
  showToolbarForRow(o, i, r) {
5416
5660
  if (!this.grid.showRowToolbar || !this.grid.rowToolbar.length)
5417
5661
  return;
5418
- const s = gi(this.grid.rowToolbar), n = this.grid.displayItems[i];
5662
+ const s = ui(this.grid.rowToolbar), n = this.grid.displayItems[i];
5419
5663
  if (!n)
5420
5664
  return;
5421
- if (this.toolbarHideTimeout && (clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = null), pi(
5665
+ if (this.toolbarHideTimeout && (clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = null), fi(
5422
5666
  this,
5423
5667
  o,
5424
5668
  i,
@@ -5434,8 +5678,8 @@ class Zi extends HTMLElement {
5434
5678
  this.toolbarHovered = !0, this.toolbarHideTimeout && (clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = null);
5435
5679
  }), a.addEventListener("mouseleave", () => {
5436
5680
  this.toolbarHovered = !1, !this.toolbarMoveInProgress && (this.toolbarHideTimeout = setTimeout(() => {
5437
- const c = this.shadow.querySelector(".wg__table"), l = c == null ? void 0 : c.matches(":hover"), g = a.matches(":hover");
5438
- !l && !g && (this.closeToolbarAndReset(), this.render());
5681
+ const c = this.shadow.querySelector(".wg__table"), g = c == null ? void 0 : c.matches(":hover"), l = a.matches(":hover");
5682
+ !g && !l && (this.closeToolbarAndReset(), this.render());
5439
5683
  }, 150));
5440
5684
  }));
5441
5685
  }
@@ -5448,7 +5692,7 @@ class Zi extends HTMLElement {
5448
5692
  * Close toolbar and reset move flag
5449
5693
  */
5450
5694
  closeToolbarAndReset() {
5451
- this.toolbarMoveInProgress = !1, this.toolbarHovered = !1, this.toolbarHideTimeout && (clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = null), Et();
5695
+ this.toolbarMoveInProgress = !1, this.toolbarHovered = !1, this.toolbarHideTimeout && (clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = null), At();
5452
5696
  }
5453
5697
  /**
5454
5698
  * Handle toolbar item click
@@ -5468,12 +5712,12 @@ class Zi extends HTMLElement {
5468
5712
  this.closeToolbarAndReset(), this.render();
5469
5713
  return;
5470
5714
  }
5471
- n ? (this.render(), mi(this, this.grid.displayItems), this.renderConnector()) : this.render();
5715
+ n ? (this.render(), _e(this, this.grid.displayItems), this.renderConnector()) : this.render();
5472
5716
  }
5473
5717
  }
5474
- typeof customElements < "u" && !customElements.get("web-grid") && customElements.define("web-grid", Zi);
5718
+ typeof customElements < "u" && !customElements.get("web-grid") && customElements.define("web-grid", or);
5475
5719
  export {
5476
- Zi as GridElement,
5477
- Ue as WebGrid,
5478
- Zi as default
5720
+ or as GridElement,
5721
+ je as WebGrid,
5722
+ or as default
5479
5723
  };