@sheetxl/utils-react 0.7.13 → 0.7.15

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.
@@ -1,52 +1,52 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(":root{--icon-size-sm: .875rem;--icon-size-md: 1rem;--icon-size-lg: 1.25rem;--icon-size-xl: 1.5rem}._Icon_1ld90_10{font-size:var(--icon-size, var(--icon-size-md));min-width:var(--icon-size, var(--icon-size-md));min-height:var(--icon-size, var(--icon-size-md));--icon-stroke-em: .085em;--icon-color: currentColor;--icon-secondary-color: color-mix(in oklab, currentColor 65%, transparent);--icon-tertiary-color: color-mix(in oklab, currentColor 40%, transparent);--icon-line-color: currentColor;--icon-main-opacity: 1;--icon-secondary-opacity: .45;--icon-tertiary-opacity: .25;--icon-line-opacity: 1;--icon-filter: none;filter:var(--icon-filter);display:inline-flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle;flex:0 0 auto}._Icon_1ld90_10 .sm{--font-size: var(--icon-size-sm)}._Icon_1ld90_10 .md{--font-size: var(--icon-size-md)}._Icon_1ld90_10 .lg{--font-size: var(--icon-size-lg)}._Icon_1ld90_10 .xl{--font-size: var(--icon-size-xl)}._Icon_1ld90_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_1ld90_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_1ld90_10 .fill,._Icon_1ld90_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_1ld90_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_1ld90_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_1ld90_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_1ld90_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_1ld90_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_1ld90_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_1ld90_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_1ld90_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_1ld90_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_1ld90_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_1ld90_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_1ld90_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_1ld90_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_1ld90_10 .fill:not(.fixed):not([fill]){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_1ld90_10 .line:not(.fixed):not([stroke]){fill:none;stroke:var(--layer-color, var(--icon-line-color));stroke-width:var(--icon-stroke-em);opacity:var(--layer-opacity, var(--icon-line-opacity));vector-effect:non-scaling-stroke;pointer-events:none;stroke-linecap:var(--icon-linecap, round);stroke-linejoin:var(--icon-linejoin, round);stroke-miterlimit:var(--icon-miter, 4)}@media (prefers-color-scheme: dark){._Icon_1ld90_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_1ld90_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_1ld90_1{to{stroke-dashoffset:0}}.icon.walking .walkable.line{stroke-dasharray:var(--walk-dash-length, 5px) var(--walk-dash-gap, 2px);stroke-dashoffset:calc(var(--walk-dash-length, 5px) + var(--walk-dash-gap, 2px));animation:_sxl-walk_1ld90_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}:root{--scrollbar-track-color: rgba(0,0,0,.06);--scrollbar-thumb-color: rgba(0,0,0,.35);--scrollbar-button-color: var(--scrollbar-thumb-color);--scrollbar-active-color: rgba(0,0,0,.55);--scrollbar-corner-color: transparent;--scrollbar-border-color: transparent;--scrollbar-size: 13px;--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size);--scrollbar-border-radius: 9999px;--scrollbar-border-width: 2px;--scrollbar-min-thumb-size: 24px}._scrollbar_1v478_17 ::-webkit-scrollbar-button{background:transparent}._scrollbar_1v478_17{display:flex;overflow:hidden;border-radius:var(--scrollbar-border-radius);align-items:center;border:var(--scrollbar-border-width) solid transparent}._scrollbar_1v478_17 ._vsb-track_1v478_27{background:var(--scrollbar-track-color);border-radius:var(--scrollbar-border-radius);position:relative;flex:1 1 100%;border:var(--scrollbar-border-width) solid transparent;touch-action:none;box-sizing:border-box;overflow:hidden}._scrollbar_1v478_17 ._vsb-thumb_1v478_39{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);transition:background .12s;touch-action:none}._scrollbar_1v478_17 ._vsb-thumb_1v478_39:hover{background:var(--scrollbar-active-color)}._scrollbar_1v478_17.vertical{flex-direction:column;min-width:var(--scrollbar-width, 0px)}._scrollbar_1v478_17.vertical ._vsb-thumb_1v478_39{min-height:var(--scrollbar-min-thumb-size)}._scrollbar_1v478_17.vertical ._vsb-track_1v478_27{width:100%}._scrollbar_1v478_17.horizontal{flex-direction:row;min-height:var(--scrollbar-height, 0px)}._scrollbar_1v478_17.horizontal ._vsb-thumb_1v478_39{min-width:var(--scrollbar-min-thumb-size)}._scrollbar_1v478_17.horizontal ._vsb-track_1v478_27{height:100%}._scrollbar_1v478_17.dragging ._vsb-thumb_1v478_39{background:var(--scrollbar-active-color)}._scrollbar-button_1v478_80{display:flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0}._scrollbar-button_1v478_80>*{fill:var(--scrollbar-button-color);transition:fill .12s ease}._scrollbar-button_1v478_80:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}._scrollbar-button_1v478_80[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}._scrollbar-button_1v478_80.vertical{width:var(--scrollbar-width)}._scrollbar-button_1v478_80.horizontal{height:var(--scrollbar-height)}._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- import { CommonUtils as q, DefaultNotifier as mn, Notifier as yt, InternalClipboard as Zt, ClipboardUtils as oe, MimeType as ie } from "@sheetxl/utils";
3
- import rt, { useRef as O, useReducer as He, useMemo as I, useEffect as $, useState as V, version as _n, memo as wt, forwardRef as kt, useCallback as W, useLayoutEffect as ge, createContext as We, useContext as Fe, createElement as gn, useImperativeHandle as yn, Component as vn } from "react";
4
- import { jsx as T, jsxs as Mt, Fragment as Ct } from "react/jsx-runtime";
5
- import { createRoot as wn } from "react-dom/client";
6
- import { unstable_batchedUpdates as bn, createPortal as xn } from "react-dom";
1
+ (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}:root{--icon-size-sm: calc(var(--icon-size, 1rem), * .875);--icon-size-md: var(--icon-size, 1rem);--icon-size-lg: calc(var(--icon-size, 1rem) * 1.25);--icon-size-xl: calc(var(--icon-size, 1rem) * 1.5)}._Icon_17dpm_10{font-size:var(--icon-size, var(--icon-size-md));min-width:var(--icon-size, var(--icon-size-md));min-height:var(--icon-size, var(--icon-size-md));--icon-stroke-em: .085em;--icon-color: currentColor;--icon-secondary-color: color-mix(in oklab, currentColor 65%, transparent);--icon-tertiary-color: color-mix(in oklab, currentColor 40%, transparent);--icon-line-color: currentColor;--icon-main-opacity: 1;--icon-secondary-opacity: .45;--icon-tertiary-opacity: .25;--icon-line-opacity: 1;--icon-filter: none;filter:var(--icon-filter);display:inline-flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle;flex:0 0 auto}._Icon_17dpm_10 .sm{--font-size: var(--icon-size-sm)}._Icon_17dpm_10 .md{--font-size: var(--icon-size-md)}._Icon_17dpm_10 .lg{--font-size: var(--icon-size-lg)}._Icon_17dpm_10 .xl{--font-size: var(--icon-size-xl)}._Icon_17dpm_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_17dpm_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_17dpm_10 .fill,._Icon_17dpm_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_17dpm_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_17dpm_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_17dpm_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_17dpm_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_17dpm_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_17dpm_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_17dpm_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_17dpm_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_17dpm_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_17dpm_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_17dpm_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_17dpm_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_17dpm_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_17dpm_10 .fill:not(.fixed):not([fill]){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_17dpm_10 .line:not(.fixed):not([stroke]){fill:none;stroke:var(--layer-color, var(--icon-line-color));stroke-width:var(--icon-stroke-em);opacity:var(--layer-opacity, var(--icon-line-opacity));vector-effect:non-scaling-stroke;pointer-events:none;stroke-linecap:var(--icon-linecap, round);stroke-linejoin:var(--icon-linejoin, round);stroke-miterlimit:var(--icon-miter, 4)}@media (prefers-color-scheme: dark){._Icon_17dpm_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_17dpm_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_17dpm_1{to{stroke-dashoffset:0}}.icon.walking .walkable.line{stroke-dasharray:var(--walk-dash-length, 5px) var(--walk-dash-gap, 2px);stroke-dashoffset:calc(var(--walk-dash-length, 5px) + var(--walk-dash-gap, 2px));animation:_sxl-walk_17dpm_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}:root{--scrollbar-track-color: rgba(0,0,0,.06);--scrollbar-thumb-color: rgba(0,0,0,.35);--scrollbar-button-color: var(--scrollbar-thumb-color);--scrollbar-active-color: rgba(0,0,0,.55);--scrollbar-corner-color: transparent;--scrollbar-border-color: transparent}:root .has-touch-thumb,:root .has-touch-thumb *{--scrollbar-size: 4px;--scrollbar-border-width: 0px;--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size)}:root{--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size);--scrollbar-border-radius: 9999px;--scrollbar-border-width: 2px;--scrollbar-min-thumb-size: 24px}._scrollbar_15caq_24 ::-webkit-scrollbar-button{background:transparent}._scrollbar_15caq_24{display:flex;overflow:hidden;border-radius:var(--scrollbar-border-radius);align-items:center;border:var(--scrollbar-border-width) solid transparent}._scrollbar_15caq_24 ._track_15caq_34{background:var(--scrollbar-track-color);border-radius:var(--scrollbar-border-radius);position:relative;flex:1 1 100%;border:var(--scrollbar-border-width) solid transparent;touch-action:none;box-sizing:border-box;overflow:hidden}._scrollbar_15caq_24 ._thumb_15caq_46{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);transition:background .12s;touch-action:none}._scrollbar_15caq_24 ._thumb_15caq_46:hover{background:var(--scrollbar-active-color)}._scrollbar_15caq_24.vertical{flex-direction:column;min-width:var(--scrollbar-width, 0px)}._scrollbar_15caq_24.vertical ._thumb_15caq_46{min-height:var(--scrollbar-min-thumb-size)}._scrollbar_15caq_24.vertical ._track_15caq_34{width:100%}._scrollbar_15caq_24.horizontal{flex-direction:row;min-height:var(--scrollbar-height, 0px)}._scrollbar_15caq_24.horizontal ._thumb_15caq_46{min-width:var(--scrollbar-min-thumb-size)}._scrollbar_15caq_24.horizontal ._track_15caq_34{height:100%}._scrollbar_15caq_24.dragging ._thumb_15caq_46{background:var(--scrollbar-active-color)}._scrollbar_15caq_24 ._scrollbar-button_15caq_86{display:flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0}._scrollbar_15caq_24 ._scrollbar-button_15caq_86>*{fill:var(--scrollbar-button-color);transition:fill .12s ease}._scrollbar_15caq_24 ._scrollbar-button_15caq_86:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}._scrollbar_15caq_24 ._scrollbar-button_15caq_86[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}._scrollbar_15caq_24 ._scrollbar-button_15caq_86.vertical{width:var(--scrollbar-width)}._scrollbar_15caq_24 ._scrollbar-button_15caq_86.horizontal{height:var(--scrollbar-height)}._touch-thumb_15caq_121{position:absolute;cursor:grab;pointer-events:all;transition-property:opacity;border-radius:9999px;will-change:opacity;opacity:.7}._touch-thumb_15caq_121:hover,._touch-thumb_15caq_121.dragging{opacity:1}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
+ import { CommonUtils as ee, DefaultNotifier as yn, Notifier as be, InternalClipboard as ot, ClipboardUtils as ht, MimeType as dt } from "@sheetxl/utils";
3
+ import ae, { useRef as I, useReducer as Ut, useMemo as K, useEffect as H, useState as Y, version as vn, memo as me, forwardRef as Ee, useCallback as U, useLayoutEffect as Et, createContext as Xt, useContext as Yt, createElement as wn, useImperativeHandle as bn, Component as xn } from "react";
4
+ import { jsx as P, jsxs as pe, Fragment as fe } from "react/jsx-runtime";
5
+ import { createRoot as Sn } from "react-dom/client";
6
+ import { unstable_batchedUpdates as En, createPortal as Mn } from "react-dom";
7
7
  /**
8
- * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.13
8
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.15
9
9
  *
10
10
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
11
11
  * License: The license can be found at https://www.sheetxl.com/license.
12
12
  */
13
- const Bo = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, Y = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, Oo = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219 }, Io = { Left: 1, Middle: 2, Right: 3 };
14
- class ue {
15
- constructor(t, e, n, i) {
16
- this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = t, this._target = e, this._applyProps(n || {}), this._callback = i, i === void 0 && (this._callback = () => {
13
+ const Io = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, Z = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, $o = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219 }, Ko = { Left: 1, Middle: 2, Right: 3 };
14
+ class yt {
15
+ constructor(e, t, n, r) {
16
+ this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = e, this._target = t, this._applyProps(n || {}), this._callback = r, r === void 0 && (this._callback = () => {
17
17
  console.log(`implement: ${this.label()} : ${this.description()}`);
18
18
  });
19
19
  }
20
20
  key() {
21
21
  return this._key;
22
22
  }
23
- _resolve(t, e) {
24
- if (typeof t == "function") {
25
- const n = e ?? this._context;
26
- return t(typeof n == "function" ? n() : n);
23
+ _resolve(e, t) {
24
+ if (typeof e == "function") {
25
+ const n = t ?? this._context;
26
+ return e(typeof n == "function" ? n() : n);
27
27
  }
28
- return t;
28
+ return e;
29
29
  }
30
30
  target() {
31
31
  return typeof this._target == "function" ? this._target() : this._target;
32
32
  }
33
- label(t, e) {
34
- const n = this._scopedLabels?.[t] || this._label;
35
- let i = null;
33
+ label(e, t) {
34
+ const n = this._scopedLabels?.[e] || this._label;
35
+ let r = null;
36
36
  if (typeof n == "function") {
37
- const r = e ?? this._context;
38
- i = n(typeof r == "function" ? r() : r);
39
- } else i = n;
40
- return i;
37
+ const i = t ?? this._context;
38
+ r = n(typeof i == "function" ? i() : i);
39
+ } else r = n;
40
+ return r;
41
41
  }
42
- description(t) {
43
- return this._resolve(this._description, t);
42
+ description(e) {
43
+ return this._resolve(this._description, e);
44
44
  }
45
- tags(t) {
46
- return this._resolve(this._tags, t);
45
+ tags(e) {
46
+ return this._resolve(this._tags, e);
47
47
  }
48
- icon(t) {
49
- return this._resolve(this._icon, t);
48
+ icon(e) {
49
+ return this._resolve(this._icon, e);
50
50
  }
51
51
  shortcut() {
52
52
  return this._resolve(this._shortcut);
@@ -60,199 +60,201 @@ class ue {
60
60
  context() {
61
61
  return typeof this._context == "function" ? this._context() : this._context;
62
62
  }
63
- async execute(t, e) {
63
+ async execute(e, t) {
64
64
  if (!this.disabled() && this._callback) {
65
65
  try {
66
66
  let n = !0;
67
- if (e?.beforeExecute && (n = e?.beforeExecute(this, t)), await Promise.resolve(n) === !1) return !1;
68
- const i = this._callback.bind(this)(t, this);
69
- if (await Promise.resolve(i) === !1) return !1;
70
- e?.onExecute?.(this, t), this._notifyExecute(t);
67
+ if (t?.beforeExecute && (n = t?.beforeExecute(this, e)), await Promise.resolve(n) === !1) return !1;
68
+ const r = this._callback.bind(this)(e, this);
69
+ if (await Promise.resolve(r) === !1) return !1;
70
+ t?.onExecute?.(this, e), this._notifyExecute(e);
71
71
  } catch (n) {
72
- return console.warn(n), e?.onError(this, n, t), this._notifyError(t, n), !1;
72
+ return console.warn(n), t?.onError(this, n, e), this._notifyError(e, n), !1;
73
73
  }
74
74
  return !0;
75
75
  }
76
76
  }
77
- addPropertyListener(t, e = !1) {
78
- if (!t) throw new Error("listener must be specified");
77
+ addPropertyListener(e, t = !1) {
78
+ if (!e) throw new Error("listener must be specified");
79
79
  const n = this._listenersProperties;
80
- return n.add(t), e && t({}, this), () => {
81
- n.delete(t);
80
+ return n.add(e), t && e({}, this), () => {
81
+ n.delete(e);
82
82
  };
83
83
  }
84
- addExecuteListener(t) {
85
- if (!t) throw new Error("listener must be specified");
86
- const e = this._listenersExecute;
87
- return e.add(t), function() {
88
- e.delete(t);
84
+ addExecuteListener(e) {
85
+ if (!e) throw new Error("listener must be specified");
86
+ const t = this._listenersExecute;
87
+ return t.add(e), function() {
88
+ t.delete(e);
89
89
  };
90
90
  }
91
- _notifyExecute(t) {
92
- const e = this;
91
+ _notifyExecute(e) {
92
+ const t = this;
93
93
  this._listenersExecute.forEach((n) => {
94
- n.onExecute(e, t);
94
+ n.onExecute(t, e);
95
95
  });
96
96
  }
97
- _notifyError(t, e) {
97
+ _notifyError(e, t) {
98
98
  const n = this;
99
- this._listenersExecute.forEach((i) => {
100
- i.onError?.(n, t, e);
99
+ this._listenersExecute.forEach((r) => {
100
+ r.onError?.(n, e, t);
101
101
  });
102
102
  }
103
- updateCallback(t) {
104
- return this._callback = t || null, this;
103
+ updateCallback(e) {
104
+ return this._callback = e || null, this;
105
105
  }
106
- update(t) {
107
- if (!t) return;
108
- const e = this._applyProps(t);
109
- return Object.keys(e).length > 0 && this._notifyPropertyChange(e), this;
106
+ update(e) {
107
+ if (!e) return;
108
+ const t = this._applyProps(e);
109
+ return Object.keys(t).length > 0 && this._notifyPropertyChange(t), this;
110
110
  }
111
- _notifyPropertyChange(t) {
112
- const e = this;
111
+ _notifyPropertyChange(e) {
112
+ const t = this;
113
113
  this._listenersProperties.forEach((n) => {
114
- n(t, e);
114
+ n(e, t);
115
115
  });
116
116
  }
117
- _applyProps(t) {
118
- let e = {}, n = this;
119
- return Object.keys(t).forEach((i) => {
120
- let r = t[i];
121
- n["_" + i] !== r && (n["_" + i] = e[i] = r);
122
- }), e;
117
+ _applyProps(e) {
118
+ let t = {}, n = this;
119
+ return Object.keys(e).forEach((r) => {
120
+ let i = e[r];
121
+ n["_" + r] !== i && (n["_" + r] = t[r] = i);
122
+ }), t;
123
123
  }
124
124
  }
125
- class re extends ue {
125
+ class pt extends yt {
126
126
  }
127
- var et = typeof window < "u" ? window : { screen: {}, navigator: {} }, Tt = (et.matchMedia || function() {
127
+ var oe = typeof window < "u" ? window : { screen: {}, navigator: {} }, De = (oe.matchMedia || function() {
128
128
  return { matches: !1 };
129
- }).bind(et), Ve = !1, Sn = { get passive() {
130
- return Ve = !0;
131
- } }, Le = function() {
129
+ }).bind(oe), Gt = !1, Ln = { get passive() {
130
+ return Gt = !0;
131
+ } }, Pt = function() {
132
132
  };
133
- et.addEventListener && et.addEventListener("p", Le, Sn), et.removeEventListener && et.removeEventListener("p", Le, !1);
134
- var En = Ve, Ln = "PointerEvent" in et, ye = "ontouchstart" in et, je = ye || "TouchEvent" in et && Tt("(any-pointer: coarse)").matches, Me = (et.navigator.maxTouchPoints || 0) > 0 || je, Ue = et.navigator.userAgent || "", Mn = Tt("(pointer: coarse)").matches && /iPad|Macintosh/.test(Ue) && Math.min(et.screen.width || 0, et.screen.height || 0) >= 768, Xe = (Tt("(pointer: coarse)").matches || !Tt("(pointer: fine)").matches && ye) && !/Windows.*Firefox/.test(Ue), Cn = Tt("(any-pointer: fine)").matches || Tt("(any-hover: hover)").matches || Mn || !ye, he = !Me || !Cn && Xe ? Me ? "touchOnly" : "mouseOnly" : "hybrid", Tn = he === "mouseOnly" ? "mouse" : he === "touchOnly" || Xe ? "touch" : "mouse";
135
- const kn = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: he, primaryInput: Tn, supportsPassiveEvents: En, supportsPointerEvents: Ln, supportsTouchEvents: je }, Symbol.toStringTag, { value: "Module" })), Pn = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), Ye = {};
136
- function de() {
137
- return kn;
133
+ oe.addEventListener && oe.addEventListener("p", Pt, Ln), oe.removeEventListener && oe.removeEventListener("p", Pt, !1);
134
+ var Cn = Gt, Tn = "PointerEvent" in oe, Mt = "ontouchstart" in oe, qt = Mt || "TouchEvent" in oe && De("(any-pointer: coarse)").matches, Dt = (oe.navigator.maxTouchPoints || 0) > 0 || qt, Zt = oe.navigator.userAgent || "", kn = De("(pointer: coarse)").matches && /iPad|Macintosh/.test(Zt) && Math.min(oe.screen.width || 0, oe.screen.height || 0) >= 768, Jt = (De("(pointer: coarse)").matches || !De("(pointer: fine)").matches && Mt) && !/Windows.*Firefox/.test(Zt), Pn = De("(any-pointer: fine)").matches || De("(any-hover: hover)").matches || kn || !Mt, vt = !Dt || !Pn && Jt ? Dt ? "touchOnly" : "mouseOnly" : "hybrid", Dn = vt === "mouseOnly" ? "mouse" : vt === "touchOnly" || Jt ? "touch" : "mouse";
135
+ const An = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: vt, primaryInput: Dn, supportsPassiveEvents: Cn, supportsPointerEvents: Tn, supportsTouchEvents: qt }, Symbol.toStringTag, { value: "Module" })), zn = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), Qt = {};
136
+ function $e() {
137
+ return An;
138
138
  }
139
- const Ge = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : q.camelToPrettyCase(o), $o = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: Ye, boundPixel: function(o, t = !1, e = 0) {
140
- return o;
141
- }, createSyntheticEvent: (o) => {
142
- let t = !1, e = !1;
143
- return { nativeEvent: o, currentTarget: o.currentTarget, target: o.target, bubbles: o.bubbles, cancelable: o.cancelable, defaultPrevented: o.defaultPrevented, eventPhase: o.eventPhase, isTrusted: o.isTrusted, preventDefault: () => {
139
+ const en = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : ee.camelToPrettyCase(o), et = (o, e) => {
140
+ let t = !1, n = !1;
141
+ const r = { nativeEvent: o, currentTarget: e || o.currentTarget, target: o.target, bubbles: o.bubbles, cancelable: o.cancelable, defaultPrevented: o.defaultPrevented, eventPhase: o.eventPhase, isTrusted: o.isTrusted, preventDefault: () => {
144
142
  t = !0, o.preventDefault();
145
143
  }, isDefaultPrevented: () => t, stopPropagation: () => {
146
- e = !0, o.stopPropagation();
147
- }, isPropagationStopped: () => e, persist: () => {
144
+ n = !0, o.stopPropagation();
145
+ }, isPropagationStopped: () => n, persist: () => {
148
146
  }, timeStamp: o.timeStamp, type: o.type };
149
- }, detectIt: de, focusableNodeNames: Pn, toPrettyKeyCode: Ge }, Symbol.toStringTag, { value: "Module" }));
150
- class Ze {
151
- constructor(t, e) {
152
- this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = q.uuidV4(), this._target = t, this._groupKey = e ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(e, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
147
+ for (const i in o) i in r || typeof o[i] == "function" || (r[i] = o[i]);
148
+ return r;
149
+ }, Ro = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: Qt, boundPixel: function(o, e = !1, t = 0) {
150
+ return o;
151
+ }, createSyntheticEvent: et, detectIt: $e, focusableNodeNames: zn, toPrettyKeyCode: en }, Symbol.toStringTag, { value: "Module" }));
152
+ class tn {
153
+ constructor(e, t) {
154
+ this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = ee.uuidV4(), this._target = e, this._groupKey = t ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(t, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
153
155
  const n = this;
154
- this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (i, r) => {
155
- const c = n._root._listenersByKey, u = r.key(), l = c.get(u);
156
- l && n._notifyCommands(l, "onCommandChange", r);
156
+ this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (r, i) => {
157
+ const a = n._root._listenersByKey, u = i.key(), l = a.get(u);
158
+ l && n._notifyCommands(l, "onCommandChange", i);
157
159
  };
158
160
  }
159
- _getCommand(t) {
160
- return this._commandsByKey.get(t) || (this._parent?._getCommand(t) ?? null);
161
+ _getCommand(e) {
162
+ return this._commandsByKey.get(e) || (this._parent?._getCommand(e) ?? null);
161
163
  }
162
- getCommand(t, e = !1) {
164
+ getCommand(e, t = !1) {
163
165
  const n = this._root._focused;
164
- let i = n, r = n === this;
165
- for (; !r && i; ) i === this && (r = !0), i = i._parent;
166
- return (r ? n : this)._getCommand(t);
166
+ let r = n, i = n === this;
167
+ for (; !i && r; ) r === this && (i = !0), r = r._parent;
168
+ return (i ? n : this)._getCommand(e);
167
169
  }
168
- createChildGroup(t, e, n) {
169
- let i;
170
+ createChildGroup(e, t, n) {
171
+ let r;
170
172
  if (!n) {
171
173
  let u = this;
172
- for (; u && !i; ) {
173
- let l = u._nodes.get(e);
174
- l && (i = l), u = u._parent;
174
+ for (; u && !r; ) {
175
+ let l = u._nodes.get(t);
176
+ l && (r = l), u = u._parent;
175
177
  }
176
178
  }
177
- i || (i = new Ze(t, e), i._parent = this, i._root = this._root, i._unListenersByCommand = null, i._listenersByKey = null, i._commandsPropertyListener = null);
178
- const r = (u, l) => {
179
- !u.has(e) || n ? u.set(e, l) : n === void 0 && console.warn("commandGroup already registered", e);
179
+ r || (r = new tn(e, t), r._parent = this, r._root = this._root, r._unListenersByCommand = null, r._listenersByKey = null, r._commandsPropertyListener = null);
180
+ const i = (u, l) => {
181
+ !u.has(t) || n ? u.set(t, l) : n === void 0 && console.warn("commandGroup already registered", t);
180
182
  };
181
- r(this._root._nodes, i);
182
- let c = this._parent;
183
- for (; c; ) r(this._nodes, i), c = c._parent;
184
- return this._children.set(e, i), this._notify("onGroupChange"), i;
183
+ i(this._root._nodes, r);
184
+ let a = this._parent;
185
+ for (; a; ) i(this._nodes, r), a = a._parent;
186
+ return this._children.set(t, r), this._notify("onGroupChange"), r;
185
187
  }
186
188
  getKey() {
187
189
  return this._groupKey;
188
190
  }
189
- getGroup(t) {
190
- return this._nodes.get(t);
191
+ getGroup(e) {
192
+ return this._nodes.get(e);
191
193
  }
192
- _addCommands(t, e = void 0) {
193
- const n = this._commandsByKey, i = this._commandsByShortcut, r = this._root._commandsPropertyListener, c = this._root._unListenersByCommand;
194
- for (let u = 0; u < t.length; u++) {
195
- const l = t[u], s = l.key();
196
- if (n.has(s) && !e) {
197
- e === void 0 && console.warn("command already registered", s);
194
+ _addCommands(e, t = void 0) {
195
+ const n = this._commandsByKey, r = this._commandsByShortcut, i = this._root._commandsPropertyListener, a = this._root._unListenersByCommand;
196
+ for (let u = 0; u < e.length; u++) {
197
+ const l = e[u], s = l.key();
198
+ if (n.has(s) && !t) {
199
+ t === void 0 && console.warn("command already registered", s);
198
200
  continue;
199
201
  }
200
202
  n.set(s, l);
201
- let a = c.get(l);
202
- a && (a(), c.delete(l));
203
- const h = l.addPropertyListener(r);
204
- c.set(l, h);
203
+ let c = a.get(l);
204
+ c && (c(), a.delete(l));
205
+ const h = l.addPropertyListener(i);
206
+ a.set(l, h);
205
207
  const d = l.shortcut();
206
208
  if (!d) continue;
207
209
  const f = Array.isArray(d) ? d : [d];
208
- for (let _ = 0; _ < f.length; _++) {
209
- const p = Bt(f[_]), b = i.get(p);
210
- b && !e && e === void 0 && console.warn(`Shortcut already registered: ${p}, ${s}, ${b}.`), i.set(p, s);
210
+ for (let m = 0; m < f.length; m++) {
211
+ const p = Oe(f[m]), x = r.get(p);
212
+ x && !t && t === void 0 && console.warn(`Shortcut already registered: ${p}, ${s}, ${x}.`), r.set(p, s);
211
213
  }
212
214
  }
213
215
  }
214
216
  removeFromParent() {
215
217
  if (!this._parent) return;
216
- let t = this._parent, e = [];
218
+ let e = this._parent, t = [];
217
219
  const n = this._groupKey;
218
- for (; t; ) e.push(t._nodes), t._nodes.delete(n), t = t._parent;
219
- t = this._parent;
220
- const i = (r) => {
221
- r._children.forEach((c) => {
222
- for (let u = 0; u < e.length; u++) c._nodes.delete(e[u]);
223
- i(c);
220
+ for (; e; ) t.push(e._nodes), e._nodes.delete(n), e = e._parent;
221
+ e = this._parent;
222
+ const r = (i) => {
223
+ i._children.forEach((a) => {
224
+ for (let u = 0; u < t.length; u++) a._nodes.delete(t[u]);
225
+ r(a);
224
226
  });
225
227
  };
226
- i(this), this._parent = null, this._notify("onGroupChange");
228
+ r(this), this._parent = null, this._notify("onGroupChange");
227
229
  }
228
- addCommands(t, e) {
229
- this._addCommands(t, e), this._notify("onGroupChange");
230
+ addCommands(e, t) {
231
+ this._addCommands(e, t), this._notify("onGroupChange");
230
232
  }
231
233
  getActive() {
232
234
  return this._root._focused ?? this._root;
233
235
  }
234
- activate(t) {
235
- let e = this;
236
- if (t && (e = this._nodes.get(t), !e)) return void console.warn("group not found", t);
236
+ activate(e) {
237
+ let t = this;
238
+ if (e && (t = this._nodes.get(e), !t)) return void console.warn("group not found", e);
237
239
  let n = this._root._focused ?? this._root;
238
240
  for (; n; ) n = n._parent;
239
- this._root._focused !== e && (this._root._focused = e, this._notify("onGroupChange"), this._notify("onActiveChange"));
241
+ this._root._focused !== t && (this._root._focused = t, this._notify("onGroupChange"), this._notify("onActiveChange"));
240
242
  }
241
- findCommandByEvent(t) {
242
- const e = [];
243
- t.altKey && e.push(Y.Alt), t.shiftKey && e.push(Y.Shift), t.ctrlKey && e.push(Y.Ctrl), t.metaKey && e.push(Y.Meta);
244
- let n = Bt({ key: t.code, modifiers: e });
245
- const i = this._commandsByShortcut;
246
- let r = i.get(n);
247
- r || (n = Bt({ key: t.key, modifiers: e }), r = i.get(n)), !r && t.code.startsWith("Digit") && (n = Bt({ key: t.code.substring(5, t.code.length), modifiers: e }), r = this._commandsByShortcut.get(n)), !r && t.code.startsWith("Key") && (r = Bt({ key: t.code.substring(3, t.code.length), modifiers: e }), r = i.get(n));
248
- let c = null;
249
- return r && (c = this._commandsByKey.get(r), c && c.disabled() && (c = null), !c || c.target() && c.target().contains(t.target) || (c = null)), c || (this._parent?.findCommandByEvent(t) ?? null);
250
- }
251
- dispatchToFocusedCommand(t) {
252
- const e = this.getActive();
253
- if (!e || t.isDefaultPrevented()) return !1;
254
- const n = e.findCommandByEvent?.(t);
255
- return !!n && (n.execute(), t.preventDefault(), !0);
243
+ findCommandByEvent(e) {
244
+ const t = [];
245
+ e.altKey && t.push(Z.Alt), e.shiftKey && t.push(Z.Shift), e.ctrlKey && t.push(Z.Ctrl), e.metaKey && t.push(Z.Meta);
246
+ let n = Oe({ key: e.code, modifiers: t });
247
+ const r = this._commandsByShortcut;
248
+ let i = r.get(n);
249
+ i || (n = Oe({ key: e.key, modifiers: t }), i = r.get(n)), !i && e.code.startsWith("Digit") && (n = Oe({ key: e.code.substring(5, e.code.length), modifiers: t }), i = this._commandsByShortcut.get(n)), !i && e.code.startsWith("Key") && (i = Oe({ key: e.code.substring(3, e.code.length), modifiers: t }), i = r.get(n));
250
+ let a = null;
251
+ return i && (a = this._commandsByKey.get(i), a && a.disabled() && (a = null), !a || a.target() && a.target().contains(e.target) || (a = null)), a || (this._parent?.findCommandByEvent(e) ?? null);
252
+ }
253
+ dispatchToFocusedCommand(e) {
254
+ const t = this.getActive();
255
+ if (!t || e.isDefaultPrevented()) return !1;
256
+ const n = t.findCommandByEvent?.(e);
257
+ return !!n && (n.execute(), e.preventDefault(), !0);
256
258
  }
257
259
  getRoot() {
258
260
  return this._parent ? this._parent.getRoot() : this;
@@ -260,70 +262,70 @@ class Ze {
260
262
  getParent() {
261
263
  return this._parent;
262
264
  }
263
- addListener(t, e) {
264
- const n = this._listeners, i = e?.keys, r = this._root._listenersByKey;
265
- if (i && !t.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
266
- let c = null;
267
- if (i) for (let u = 0; u < i.length; u++) {
268
- const l = i[u];
265
+ addListener(e, t) {
266
+ const n = this._listeners, r = t?.keys, i = this._root._listenersByKey;
267
+ if (r && !e.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
268
+ let a = null;
269
+ if (r) for (let u = 0; u < r.length; u++) {
270
+ const l = r[u];
269
271
  if (!l) continue;
270
- let s = r.get(l);
271
- s || (s = /* @__PURE__ */ new Set(), r.set(l, s)), c || (c = []), c.push(s), s.add(t);
272
+ let s = i.get(l);
273
+ s || (s = /* @__PURE__ */ new Set(), i.set(l, s)), a || (a = []), a.push(s), s.add(e);
272
274
  }
273
- return n.add(t), () => {
274
- if (c) for (let u = 0; u < c.length; u++)
275
- c[u].delete(t);
276
- n.delete(t);
275
+ return n.add(e), () => {
276
+ if (a) for (let u = 0; u < a.length; u++)
277
+ a[u].delete(e);
278
+ n.delete(e);
277
279
  };
278
280
  }
279
- _notifyCommands(t, e, n) {
280
- const i = this;
281
+ _notifyCommands(e, t, n) {
282
+ const r = this;
281
283
  setTimeout(() => {
282
- t.forEach((r) => {
283
- r[e]?.(i, n);
284
+ e.forEach((i) => {
285
+ i[t]?.(r, n);
284
286
  });
285
287
  }, 0);
286
288
  }
287
- _notify(t, e) {
289
+ _notify(e, t) {
288
290
  const n = this;
289
291
  setTimeout(() => {
290
- n._listeners.forEach((i) => {
291
- i[t]?.(n, e);
292
- }), n._parent && n._parent._notify(t, e);
292
+ n._listeners.forEach((r) => {
293
+ r[e]?.(n, t);
294
+ }), n._parent && n._parent._notify(e, t);
293
295
  }, 0);
294
296
  }
295
297
  getAllCommands() {
296
- const t = [], e = this._groupKey;
298
+ const e = [], t = this._groupKey;
297
299
  return this._commandsByKey.forEach((n) => {
298
- t.push({ command: n, groupKey: e });
300
+ e.push({ command: n, groupKey: t });
299
301
  }), this._children.forEach((n) => {
300
- t.push(...n.getAllCommands());
301
- }), t;
302
+ e.push(...n.getAllCommands());
303
+ }), e;
302
304
  }
303
305
  }
304
- const Dn = q.getOS() === q.OSType.MacOS || q.getOS() === q.OSType.IOS ? "Cmd" : "Ctrl", An = q.getOS() === q.OSType.MacOS || q.getOS() === q.OSType.IOS ? "⌘" : "^", Bt = (o, t = !1) => {
305
- const e = {};
306
- for (let i = 0; o.modifiers && i < o.modifiers.length; i++) e[o.modifiers[i]] = !0;
306
+ const Bn = ee.getOS() === ee.OSType.MacOS || ee.getOS() === ee.OSType.IOS ? "Cmd" : "Ctrl", On = ee.getOS() === ee.OSType.MacOS || ee.getOS() === ee.OSType.IOS ? "⌘" : "^", Oe = (o, e = !1) => {
307
+ const t = {};
308
+ for (let r = 0; o.modifiers && r < o.modifiers.length; r++) t[o.modifiers[r]] = !0;
307
309
  let n = "";
308
- return (e?.[Y.Ctrl] || e?.[Y.Meta]) && (n += (n.length > 0 ? "+" : "") + (t ? An : Dn)), e?.[Y.Alt] && (n += t ? "⌥" : "Alt"), e?.[Y.Shift] && (n += (n.length > 0 ? "+" : "") + (t ? "⇧" : "Shift")), n += (n.length > 0 ? "+" : "") + Ge(o.key), n;
310
+ return (t?.[Z.Ctrl] || t?.[Z.Meta]) && (n += (n.length > 0 ? "+" : "") + (e ? On : Bn)), t?.[Z.Alt] && (n += e ? "⌥" : "Alt"), t?.[Z.Shift] && (n += (n.length > 0 ? "+" : "") + (e ? "⇧" : "Shift")), n += (n.length > 0 ? "+" : "") + en(o.key), n;
309
311
  };
310
- function Ko(o, t = null) {
311
- const e = O(t);
312
- e.current = t;
313
- const [n, i] = He((c) => c + 1, 0), r = I(() => Array.isArray(o) ? o : [o], [o]);
314
- return $(() => {
315
- if (!r || r.length === 0) return;
316
- const c = (s, a) => {
317
- e.current?.onChange?.(a), i();
312
+ function No(o, e = null) {
313
+ const t = I(e);
314
+ t.current = e;
315
+ const [n, r] = Ut((a) => a + 1, 0), i = K(() => Array.isArray(o) ? o : [o], [o]);
316
+ return H(() => {
317
+ if (!i || i.length === 0) return;
318
+ const a = (s, c) => {
319
+ t.current?.onChange?.(c), r();
318
320
  };
319
321
  let u = null;
320
- t && (u = { onExecute(s, a) {
321
- e.current?.onExecute?.(s, a);
322
- }, onError(s, a, h) {
323
- e.current?.onError?.(s, a, h);
322
+ e && (u = { onExecute(s, c) {
323
+ t.current?.onExecute?.(s, c);
324
+ }, onError(s, c, h) {
325
+ t.current?.onError?.(s, c, h);
324
326
  } });
325
327
  const l = /* @__PURE__ */ new Set();
326
- for (let s = 0; s < r.length; s++) l.add(r[s]?.addPropertyListener(q.debounce(c, 0), !0)), t && l.add(r[s]?.addExecuteListener(u));
328
+ for (let s = 0; s < i.length; s++) l.add(i[s]?.addPropertyListener(ee.debounce(a, 0), !0)), e && l.add(i[s]?.addExecuteListener(u));
327
329
  return () => {
328
330
  l.forEach((s) => {
329
331
  s?.();
@@ -331,538 +333,565 @@ function Ko(o, t = null) {
331
333
  };
332
334
  }, [o]), n;
333
335
  }
334
- const Vt = (o, t) => {
335
- if (!t || !o || t.length === 0) return q.EmptyArray;
336
- const e = t.length, n = new Array(e);
337
- for (let i = 0; i < e; i++) {
338
- const r = t[i], c = r ? o.getCommand(r) : null;
339
- n[i] = c;
336
+ const qe = (o, e) => {
337
+ if (!e || !o || e.length === 0) return ee.EmptyArray;
338
+ const t = e.length, n = new Array(t);
339
+ for (let r = 0; r < t; r++) {
340
+ const i = e[r], a = i ? o.getCommand(i) : null;
341
+ n[r] = a;
340
342
  }
341
343
  return n;
342
344
  };
343
- function Ro(o, t = null, e = null, n) {
344
- const i = O(e);
345
- i.current = e, t && !Array.isArray(t) && (t = [t]);
346
- const [r, c] = V(Vt(o, t)), u = n ? [...n, o] : [o];
347
- return $(() => {
345
+ function Ho(o, e = null, t = null, n) {
346
+ const r = I(t);
347
+ r.current = t, e && !Array.isArray(e) && (e = [e]);
348
+ const [i, a] = Y(qe(o, e)), u = n ? [...n, o] : [o];
349
+ return H(() => {
348
350
  const l = { onGroupChange: () => {
349
- const d = Vt(o, t);
350
- c(d), i.current?.onChange?.(this);
351
+ const d = qe(o, e);
352
+ a(d), r.current?.onChange?.(this);
351
353
  } };
352
354
  let s;
353
- t && t.length > 0 && (s = { keys: t }, l.onCommandChange = (d, f) => {
354
- i.current?.onChange?.(o), c(Vt(o, t));
355
+ e && e.length > 0 && (s = { keys: e }, l.onCommandChange = (d, f) => {
356
+ r.current?.onChange?.(o), a(qe(o, e));
355
357
  });
356
- const a = o?.addListener(l, s), h = Vt(o, t);
357
- return c(h), i.current?.onChange && i.current?.onChange(o), () => {
358
- a?.();
358
+ const c = o?.addListener(l, s), h = qe(o, e);
359
+ return a(h), r.current?.onChange && r.current?.onChange(o), () => {
360
+ c?.();
359
361
  };
360
- }, u), r;
362
+ }, u), i;
361
363
  }
362
- const No = { Toolbar: "toolbar", Menuitem: "menuitem" }, Ho = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bottom", LeftEnd: "left-end", LeftStart: "left-start", Left: "left", RightEnd: "right-end", RightStart: "right-start", Right: "right", TopEnd: "top-end", TopStart: "top-start", Top: "top" };
363
- function se(o, t) {
364
- if (typeof o == "function") return o(t);
365
- o && (o.current = t);
364
+ const Wo = { Toolbar: "toolbar", Menuitem: "menuitem" }, Vo = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bottom", LeftEnd: "left-end", LeftStart: "left-start", Left: "left", RightEnd: "right-end", RightStart: "right-start", Right: "right", TopEnd: "top-end", TopStart: "top-start", Top: "top" };
365
+ function ft(o, e) {
366
+ if (typeof o == "function") return o(e);
367
+ o && (o.current = e);
366
368
  }
367
- var It = parseInt(_n.split(".")[0], 10) >= 19 ? function(o) {
368
- return (t) => {
369
- const e = [];
369
+ var Ae = parseInt(vn.split(".")[0], 10) >= 19 ? function(o) {
370
+ return (e) => {
371
+ const t = [];
370
372
  for (const n of o) {
371
- const i = se(n, t), r = typeof i == "function";
372
- e.push(r ? i : () => se(n, null));
373
+ const r = ft(n, e), i = typeof r == "function";
374
+ t.push(i ? r : () => ft(n, null));
373
375
  }
374
376
  return () => {
375
- for (const n of e) n();
377
+ for (const n of t) n();
376
378
  };
377
379
  };
378
380
  } : function(o) {
379
- return (t) => {
380
- for (const e of o) se(e, t);
381
+ return (e) => {
382
+ for (const t of o) ft(t, e);
381
383
  };
382
384
  };
383
- const Wo = wt(kt((o, t) => {
384
- const { refFocusStart: e, ...n } = o, i = O(null), r = W(() => {
385
- if (e) return void e?.current?.focus();
386
- const c = i.current.parentElement.children;
385
+ const Fo = me(Ee((o, e) => {
386
+ const { refFocusStart: t, ...n } = o, r = I(null), i = U(() => {
387
+ if (t) return void t?.current?.focus();
388
+ const a = r.current.parentElement.children;
387
389
  let u = [];
388
- const l = c.length;
389
- for (let s = 0; s < l && c[s] !== i.current; s++) {
390
- const a = c[s], h = a.getAttribute("tabindex");
391
- h == null || h === "-1" || a.getAttribute("disabled") !== "true" && a.focus && u.push({ tabindex: parseInt(h), child: a });
390
+ const l = a.length;
391
+ for (let s = 0; s < l && a[s] !== r.current; s++) {
392
+ const c = a[s], h = c.getAttribute("tabindex");
393
+ h == null || h === "-1" || c.getAttribute("disabled") !== "true" && c.focus && u.push({ tabindex: parseInt(h), child: c });
392
394
  }
393
- u.length !== 0 && (u.sort(function(s, a) {
394
- return s.tabindex - a.tabindex;
395
+ u.length !== 0 && (u.sort(function(s, c) {
396
+ return s.tabindex - c.tabindex;
395
397
  }), u[0].child.focus());
396
- }, [e]);
397
- return T("div", { tabIndex: 0, ref: It([i, t]), onFocus: r, ...n });
398
+ }, [t]);
399
+ return P("div", { tabIndex: 0, ref: Ae([r, e]), onFocus: i, ...n });
398
400
  }));
399
- var zn = function() {
400
- }, qe = typeof window < "u", Bn = qe ? ge : $, Ce = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
401
- const vt = qe && window.ResizeObserver !== void 0 ? function() {
402
- var o = V(null), t = o[0], e = o[1], n = V(Ce), i = n[0], r = n[1], c = I(function() {
401
+ var In = function() {
402
+ }, nn = typeof window < "u", $n = nn ? Et : H, At = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
403
+ const Se = nn && window.ResizeObserver !== void 0 ? function() {
404
+ var o = Y(null), e = o[0], t = o[1], n = Y(At), r = n[0], i = n[1], a = K(function() {
403
405
  return new window.ResizeObserver(function(u) {
404
406
  if (u[0]) {
405
- var l = u[0].contentRect, s = l.x, a = l.y, h = l.width, d = l.height, f = l.top, _ = l.left, p = l.bottom, b = l.right;
406
- r({ x: s, y: a, width: h, height: d, top: f, left: _, bottom: p, right: b });
407
+ var l = u[0].contentRect, s = l.x, c = l.y, h = l.width, d = l.height, f = l.top, m = l.left, p = l.bottom, x = l.right;
408
+ i({ x: s, y: c, width: h, height: d, top: f, left: m, bottom: p, right: x });
407
409
  }
408
410
  });
409
411
  }, []);
410
- return Bn(function() {
411
- if (t) return c.observe(t), function() {
412
- c.disconnect();
412
+ return $n(function() {
413
+ if (e) return a.observe(e), function() {
414
+ a.disconnect();
413
415
  };
414
- }, [t]), [e, i];
416
+ }, [e]), [t, r];
415
417
  } : function() {
416
- return [zn, Ce];
417
- }, Fo = wt(kt((o, t) => {
418
- const { className: e, style: n, children: i, radius: r = 4, strokeWidth: c = 1, strokeColor: u = "grey", ...l } = o, [s, { width: a, height: h }] = vt(), d = O(null), f = (M, m = 0) => {
419
- const v = M / 2, y = h - v + m;
420
- return (function(A, E, k = !1) {
421
- if (E === 0) return A;
422
- function H(g, w, R) {
423
- let G = w.x - g.x, j = w.y - g.y, J = Math.sqrt(G * G + j * j);
424
- return S(g, w, Math.min(1, R / J));
418
+ return [In, At];
419
+ }, jo = me(Ee((o, e) => {
420
+ const { className: t, style: n, children: r, radius: i = 4, strokeWidth: a = 1, strokeColor: u = "grey", ...l } = o, [s, { width: c, height: h }] = Se(), d = I(null), f = (T, _ = 0) => {
421
+ const w = T / 2, y = h - w + _;
422
+ return (function(z, E, B = !1) {
423
+ if (E === 0) return z;
424
+ function $(g, L, R) {
425
+ let N = L.x - g.x, G = L.y - g.y, D = Math.sqrt(N * N + G * G);
426
+ return S(g, L, Math.min(1, R / D));
425
427
  }
426
- function S(g, w, R) {
427
- return { x: g.x + (w.x - g.x) * R, y: g.y + (w.y - g.y) * R };
428
+ function S(g, L, R) {
429
+ return { x: g.x + (L.x - g.x) * R, y: g.y + (L.y - g.y) * R };
428
430
  }
429
- function L(g, w) {
430
- g.length > 2 && (g[g.length - 2] = w.x, g[g.length - 1] = w.y);
431
+ function b(g, L) {
432
+ g.length > 2 && (g[g.length - 2] = L.x, g[g.length - 1] = L.y);
431
433
  }
432
- function z(g) {
434
+ function C(g) {
433
435
  return { x: parseFloat(g[g.length - 2]), y: parseFloat(g[g.length - 1]) };
434
436
  }
435
- let C = A.split(/[,\s]/).reduce(function(g, w) {
436
- let R = w.match("([a-zA-Z])(.+)");
437
- return R ? (g.push(R[1]), g.push(R[2])) : g.push(w), g;
438
- }, []).reduce(function(g, w) {
439
- return parseFloat(w) == w && g.length ? g[g.length - 1].push(w) : g.push([w]), g;
440
- }, []), D = [];
441
- if (C.length > 1) {
442
- let g = z(C[0]), w = null;
443
- C[C.length - 1][0] === "Z" && C[0].length > 2 && (w = ["L", g.x, g.y], C[C.length - 1] = w), D.push(C[0]);
444
- for (let R = 1; R < C.length; R++) {
445
- let G = D[D.length - 1], j = C[R], J = j === w ? C[1] : C[R + 1];
446
- if (J && G && G.length > 2 && j[0] === "L" && J.length > 2 && J[0] === "L") {
447
- let Z, F, ot = z(G), Q = z(j), bt = z(J);
448
- k ? (Z = S(Q, G.origPoint || ot, E), F = S(Q, J.origPoint || bt, E)) : (Z = H(Q, ot, E), F = H(Q, bt, E)), L(j, Z), j.origPoint = Q, D.push(j);
449
- let xt = S(Z, Q, 0.5), St = S(Q, F, 0.5), pt = ["C", xt.x, xt.y, St.x, St.y, F.x, F.y];
450
- pt.origPoint = Q, D.push(pt);
451
- } else D.push(j);
437
+ let M = z.split(/[,\s]/).reduce(function(g, L) {
438
+ let R = L.match("([a-zA-Z])(.+)");
439
+ return R ? (g.push(R[1]), g.push(R[2])) : g.push(L), g;
440
+ }, []).reduce(function(g, L) {
441
+ return parseFloat(L) == L && g.length ? g[g.length - 1].push(L) : g.push([L]), g;
442
+ }, []), O = [];
443
+ if (M.length > 1) {
444
+ let g = C(M[0]), L = null;
445
+ M[M.length - 1][0] === "Z" && M[0].length > 2 && (L = ["L", g.x, g.y], M[M.length - 1] = L), O.push(M[0]);
446
+ for (let R = 1; R < M.length; R++) {
447
+ let N = O[O.length - 1], G = M[R], D = G === L ? M[1] : M[R + 1];
448
+ if (D && N && N.length > 2 && G[0] === "L" && D.length > 2 && D[0] === "L") {
449
+ let F, W, X = C(N), J = C(G), Me = C(D);
450
+ B ? (F = S(J, N.origPoint || X, E), W = S(J, D.origPoint || Me, E)) : (F = $(J, X, E), W = $(J, Me, E)), b(G, F), G.origPoint = J, O.push(G);
451
+ let _e = S(F, J, 0.5), Le = S(J, W, 0.5), ge = ["C", _e.x, _e.y, Le.x, Le.y, W.x, W.y];
452
+ ge.origPoint = J, O.push(ge);
453
+ } else O.push(G);
452
454
  }
453
- if (w) {
454
- let R = z(D[D.length - 1]);
455
- D.push(["Z"]), L(D[0], R);
455
+ if (L) {
456
+ let R = C(O[O.length - 1]);
457
+ O.push(["Z"]), b(O[0], R);
456
458
  }
457
- } else D = C;
458
- return D.reduce(function(g, w) {
459
- return g + w.join(" ") + " ";
459
+ } else O = M;
460
+ return O.reduce(function(g, L) {
461
+ return g + L.join(" ") + " ";
460
462
  }, "");
461
- })(`${`M 0 ${v} L ${r - 0.5} ${v} L ${r - 0.5} ${y} L ${2 * r} ${y}`} ${`L ${a - 2 * r} ${y}`} ${`M ${a - 2 * r} ${y} L ${a - r} ${y} L ${a - r} ${v} L ${a} ${v}`}`, r);
462
- }, _ = I(() => f(c), [a, h, r, c]), p = I(() => {
463
- if (r === 0) return;
464
- const M = r / 2;
465
- return f(r) + `L ${a} 0 L 0 0 L 0 ${M}`;
466
- }, [_, r, c]), b = I(() => ({ style: { clipPath: `path('${p}')` } }), [p]);
467
- return Mt("div", { className: e, style: { display: "flex", flexDirection: "row", ...n }, ...l, ref: It([d, s, t]), children: [rt.isValidElement(i) ? rt.cloneElement(i, b) : T(Ct, {}), T("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: a, height: h, viewBox: `0 0 ${a} ${h}`, children: T("path", { d: _, stroke: u, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: c }) })] });
468
- })), Te = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
469
- class On extends mn {
470
- setOverrides(t) {
471
- super.setOverrides(t);
463
+ })(`${`M 0 ${w} L ${i - 0.5} ${w} L ${i - 0.5} ${y} L ${2 * i} ${y}`} ${`L ${c - 2 * i} ${y}`} ${`M ${c - 2 * i} ${y} L ${c - i} ${y} L ${c - i} ${w} L ${c} ${w}`}`, i);
464
+ }, m = K(() => f(a), [c, h, i, a]), p = K(() => {
465
+ if (i === 0) return;
466
+ const T = i / 2;
467
+ return f(i) + `L ${c} 0 L 0 0 L 0 ${T}`;
468
+ }, [m, i, a]), x = K(() => ({ style: { clipPath: `path('${p}')` } }), [p]);
469
+ return pe("div", { className: t, style: { display: "flex", flexDirection: "row", ...n }, ...l, ref: Ae([d, s, e]), children: [ae.isValidElement(r) ? ae.cloneElement(r, x) : P(fe, {}), P("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: c, height: h, viewBox: `0 0 ${c} ${h}`, children: P("path", { d: m, stroke: u, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: a }) })] });
470
+ })), zt = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
471
+ class Kn extends yn {
472
+ setOverrides(e) {
473
+ super.setOverrides(e);
472
474
  }
473
475
  getDelegate() {
474
476
  return this._overrides;
475
477
  }
476
- showMessage(t, e) {
478
+ showMessage(e, t) {
477
479
  const n = this.getDelegate();
478
- if (n?.showMessage) return n.showMessage(t, e);
479
- e?.type !== Te.Warning ? e?.type !== Te.Error ? yt.log(t) : yt.error(t) : yt.warn(t);
480
+ if (n?.showMessage) return n.showMessage(e, t);
481
+ t?.type !== zt.Warning ? t?.type !== zt.Error ? be.log(e) : be.error(e) : be.warn(e);
480
482
  }
481
- showBusy(t, e) {
483
+ showBusy(e, t) {
482
484
  const n = this.getDelegate();
483
- return n?.showBusy ? n.showBusy(t, e) : new Promise((i) => {
484
- i(() => {
485
+ return n?.showBusy ? n.showBusy(e, t) : new Promise((r) => {
486
+ r(() => {
485
487
  });
486
488
  });
487
489
  }
488
- showWindow(t, e) {
490
+ showWindow(e, t) {
489
491
  const n = this.getDelegate();
490
- if (n?.showWindow) return n.showWindow(t, e);
492
+ if (n?.showWindow) return n.showWindow(e, t);
491
493
  }
492
- showError(t) {
493
- const e = this.getDelegate();
494
- e?.showError ? e.showError(t) : yt.error(t);
494
+ showError(e) {
495
+ const t = this.getDelegate();
496
+ t?.showError ? t.showError(e) : be.error(e);
495
497
  }
496
- showOptions(t) {
497
- const e = this.getDelegate();
498
- return e?.showOptions ? e.showOptions(t) : Promise.resolve("");
498
+ showOptions(e) {
499
+ const t = this.getDelegate();
500
+ return t?.showOptions ? t.showOptions(e) : Promise.resolve("");
499
501
  }
500
- showInput(t) {
501
- const e = this.getDelegate();
502
- return e?.showInput ? e.showInput(t) : Promise.resolve({ input: "", option: "" });
502
+ showInput(e) {
503
+ const t = this.getDelegate();
504
+ return t?.showInput ? t.showInput(e) : Promise.resolve({ input: "", option: "" });
503
505
  }
504
506
  }
505
- const Je = We(new On()), Vo = ({ children: o, notifier: t }) => (rt.useEffect(() => {
506
- const e = yt.getOverrides();
507
- return yt.setOverrides(t), () => {
508
- yt.setOverrides(e);
507
+ const on = Xt(new Kn()), Uo = ({ children: o, notifier: e }) => (ae.useEffect(() => {
508
+ const t = be.getOverrides();
509
+ return be.setOverrides(e), () => {
510
+ be.setOverrides(t);
509
511
  };
510
- }, [t]), rt.createElement(Je.Provider, { value: t }, o)), Jt = () => Fe(Je), In = 3, $n = 0.5, Kn = 50, le = (o) => ({ x: o.x, y: o.y, width: o.width, height: o.height, top: o.top, left: o.left, right: o.right, bottom: o.bottom });
511
- function jo(o = {}) {
512
- const { threshold: t = $n, stillnessThreshold: e = In, maxHierarchyDepth: n = Kn } = o, [i, r] = vt(), c = O(null), [u, l] = He((_) => _ + 1, 0), s = O(void 0), a = O({ x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0 }), h = W((_) => {
513
- c.current = _, typeof i == "function" && i(_);
514
- }, [i]), [d, f] = V(r);
515
- return $(() => {
516
- r && !d && f(r);
517
- }, [r, d]), $(() => {
518
- const _ = c.current;
519
- if (!_) return;
520
- let p = !1, b = 0;
521
- const M = () => {
522
- if (!_) return;
523
- const E = _.getBoundingClientRect(), k = a.current;
524
- Math.abs(E.x - k.x) > t || Math.abs(E.y - k.y) > t || Math.abs(E.width - k.width) > t || Math.abs(E.height - k.height) > t ? (p || (p = !0, f(le(E)), l()), b = 0) : b++, p && b >= e && (p = !1, f(le(E)), l()), a.current = le(E), s.current = requestAnimationFrame(M);
512
+ }, [e]), ae.createElement(on.Provider, { value: e }, o)), it = () => Yt(on), Rn = 3, Nn = 0.5, Hn = 50, mt = (o) => ({ x: o.x, y: o.y, width: o.width, height: o.height, top: o.top, left: o.left, right: o.right, bottom: o.bottom });
513
+ function Wn(o = {}) {
514
+ const { threshold: e = Nn, stillnessThreshold: t = Rn, maxHierarchyDepth: n = Hn } = o, [r, i] = Se(), a = I(null), [u, l] = Ut((m) => m + 1, 0), s = I(void 0), c = I({ x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0 }), h = U((m) => {
515
+ a.current = m, typeof r == "function" && r(m);
516
+ }, [r]), [d, f] = Y(i);
517
+ return H(() => {
518
+ i && !d && f(i);
519
+ }, [i, d]), H(() => {
520
+ const m = a.current;
521
+ if (!m) return;
522
+ let p = !1, x = 0;
523
+ const T = () => {
524
+ if (!m) return;
525
+ const E = m.getBoundingClientRect(), B = c.current;
526
+ Math.abs(E.x - B.x) > e || Math.abs(E.y - B.y) > e || Math.abs(E.width - B.width) > e || Math.abs(E.height - B.height) > e ? (p || (p = !0, f(mt(E)), l()), x = 0) : x++, p && x >= t && (p = !1, f(mt(E)), l()), c.current = mt(E), s.current = requestAnimationFrame(T);
525
527
  };
526
- s.current = requestAnimationFrame(M);
527
- const m = (E) => {
528
+ s.current = requestAnimationFrame(T);
529
+ const _ = (E) => {
528
530
  p = !0, l();
529
- }, v = (E) => {
530
- p = !1, b = e, l();
531
+ }, w = (E) => {
532
+ p = !1, x = t, l();
531
533
  };
532
- let y = _;
533
- const A = [];
534
- for (; y && y !== document.documentElement && (y.addEventListener("animationstart", m, !0), y.addEventListener("animationend", v, !0), y.addEventListener("transitionstart", m, !0), y.addEventListener("transitionend", v, !0), A.push(y), y = y.parentElement, !(A.length > n)); ) ;
534
+ let y = m;
535
+ const z = [];
536
+ for (; y && y !== document.documentElement && (y.addEventListener("animationstart", _, !0), y.addEventListener("animationend", w, !0), y.addEventListener("transitionstart", _, !0), y.addEventListener("transitionend", w, !0), z.push(y), y = y.parentElement, !(z.length > n)); ) ;
535
537
  return () => {
536
- s.current && cancelAnimationFrame(s.current), A.forEach((E) => {
537
- E.removeEventListener("animationstart", m, !0), E.removeEventListener("animationend", v, !0), E.removeEventListener("transitionstart", m, !0), E.removeEventListener("transitionend", v, !0);
538
+ s.current && cancelAnimationFrame(s.current), z.forEach((E) => {
539
+ E.removeEventListener("animationstart", _, !0), E.removeEventListener("animationend", w, !0), E.removeEventListener("transitionstart", _, !0), E.removeEventListener("transitionend", w, !0);
538
540
  });
539
541
  };
540
- }, [u, r, t, e, n]), [h, d];
542
+ }, [u, i, e, t, n]), [h, d];
541
543
  }
542
- const P = (o, t) => {
543
- const e = W((...r) => o?.(...r), t), n = O(null);
544
- n.current = e;
545
- const i = W((...r) => n.current?.(...r), []);
546
- if (n.current) return i;
544
+ const k = (o, e) => {
545
+ const t = U((...i) => o?.(...i), e), n = I(null);
546
+ n.current = t;
547
+ const r = U((...i) => n.current?.(...i), []);
548
+ if (n.current) return r;
547
549
  };
548
- function Uo(o) {
549
- const [t, e] = V(typeof window < "u" ? window.devicePixelRatio : 1), n = O(null);
550
- return $(() => {
550
+ function Xo(o) {
551
+ const [e, t] = Y(typeof window < "u" ? window.devicePixelRatio : 1), n = I(null);
552
+ return H(() => {
551
553
  if (!(typeof window < "u" && "matchMedia" in window)) return;
552
- const i = () => {
553
- const r = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
554
- r.addEventListener("change", i, { once: !0, passive: !0 }), e(window.devicePixelRatio), n.current = { mediaMatcher: r, listener: i };
554
+ const r = () => {
555
+ const i = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
556
+ i.addEventListener("change", r, { once: !0, passive: !0 }), t(window.devicePixelRatio), n.current = { mediaMatcher: i, listener: r };
555
557
  };
556
- return i(), () => {
558
+ return r(), () => {
557
559
  n.current && n.current.mediaMatcher.removeEventListener("change", n.current.listener);
558
560
  };
559
- }, [o]), t;
561
+ }, [o]), e;
560
562
  }
561
- function Xo(o) {
563
+ function Yo(o) {
562
564
  if (typeof window > "u") return 1;
563
- const { defaultDpr: t = 1, maxDpr: e = 3, round: n = !0 } = o || {}, i = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : t;
564
- return Math.min(Math.max(1, n ? Math.floor(i) : i), e);
565
+ const { defaultDpr: e = 1, maxDpr: t = 3, round: n = !0 } = o || {}, r = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : e;
566
+ return Math.min(Math.max(1, n ? Math.floor(r) : r), t);
565
567
  }
566
- function Yo(o, t, e) {
567
- const n = P(t, [t]);
568
- $(() => {
569
- const i = (r) => {
570
- o.current && !o.current.contains(r.target) && n(r);
568
+ function Go(o, e, t) {
569
+ const n = k(e, [e]);
570
+ H(() => {
571
+ const r = (i) => {
572
+ o.current && !o.current.contains(i.target) && n(i);
571
573
  };
572
- return e && e.mouseEvents === !1 || (document.addEventListener("mousedown", i), document.addEventListener("touchstart", i)), e && e.focusEvents === !1 || document.addEventListener("focus", i), () => {
573
- document.removeEventListener("mousedown", i), document.removeEventListener("touchstart", i), document.removeEventListener("focus", i);
574
+ return t && t.mouseEvents === !1 || (document.addEventListener("mousedown", r), document.addEventListener("touchstart", r)), t && t.focusEvents === !1 || document.addEventListener("focus", r), () => {
575
+ document.removeEventListener("mousedown", r), document.removeEventListener("touchstart", r), document.removeEventListener("focus", r);
574
576
  };
575
577
  }, [o]);
576
578
  }
577
- function Rn(o) {
579
+ let Ze = 0;
580
+ function Vn() {
581
+ const [o, e] = Y(!!document.fullscreenElement), t = U(() => {
582
+ const n = document.fullscreenElement;
583
+ return n ? n.querySelector(".fullscreen-portal-root") || n : document.body;
584
+ }, []);
585
+ return H(() => {
586
+ function n() {
587
+ const r = document.fullscreenElement;
588
+ if (e(!!r), !r) return;
589
+ let i = r.querySelector(".fullscreen-portal-root");
590
+ i || (i = document.createElement("div"), i.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", r.appendChild(i));
591
+ }
592
+ return Ze++, n(), document.addEventListener("fullscreenchange", n), () => {
593
+ document.removeEventListener("fullscreenchange", n), Ze--, Ze <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((r) => {
594
+ r.parentNode && r.parentNode.removeChild(r);
595
+ }), Ze = 0);
596
+ };
597
+ }, []), { getPortalContainer: t, isFullscreen: o };
598
+ }
599
+ function rn(o) {
578
600
  if (!o) throw new Error("must have a PointerHandlerOptions");
579
- const { onPointerDown: t, onPointerUp: e, onPointerMoveOrWait: n, processTouch: i = !1, consumeTouch: r = !0 } = o, c = P(t, [t]), u = P(e, [e]), l = P(n, [n]), s = O(!1), a = o?.timerInitial ?? 230, h = o?.timerContinuous ?? a / 2, d = O(null), f = O(null), _ = O(null), p = O(null), b = W(() => {
601
+ const { onPointerDown: e, onPointerUp: t, onPointerMoveOrWait: n, processTouch: r = !1, consumeTouch: i = !0 } = o, a = k(e, [e]), u = k(t, [t]), l = k(n, [n]), s = I(!1), c = o?.timerInitial ?? 230, h = o?.timerContinuous ?? c / 2, d = I(null), f = I(null), m = I(null), p = I(null), x = U(() => {
580
602
  p.current && (clearTimeout(p.current), p.current = null);
581
- }, []), M = W((L) => {
603
+ }, []), T = U((b) => {
582
604
  p.current = setTimeout(() => {
583
605
  window.requestAnimationFrame(() => {
584
- s.current !== !1 && l?.(f.current, _.current, d.current);
585
- }), M(h);
586
- }, L ?? a);
606
+ if (s.current === !1) return;
607
+ const C = f.current, M = d.current, O = et(C, M.currentTarget);
608
+ l?.(O, m.current, M);
609
+ }), T(h);
610
+ }, b ?? c);
587
611
  }, []);
588
- $(() => () => b(), []);
589
- const m = i ? "pointer" : "mouse", v = W((L) => {
590
- L.stopPropagation(), L.stopImmediatePropagation(), L.preventDefault();
591
- }, []), y = P((L) => {
592
- document.removeEventListener(`${m}move`, k), document.removeEventListener(`${m}up`, y), document.removeEventListener("keydown", H), document.removeEventListener("keyup", S), document.removeEventListener("touchstart", v, { capture: !0 }), document.removeEventListener("touchmove", v, { capture: !0 }), window.removeEventListener("blur", A), b(), window.requestAnimationFrame(() => {
593
- s.current !== !1 && (s.current = !1, u?.(L, _.current, d.current), _.current = null);
612
+ H(() => () => x(), []);
613
+ const _ = r ? "pointer" : "mouse", w = U((b) => {
614
+ b.stopPropagation(), b.stopImmediatePropagation(), b.preventDefault();
615
+ }, []), y = k((b) => {
616
+ document.removeEventListener(`${_}move`, B), document.removeEventListener(`${_}up`, y), document.removeEventListener("keydown", $), document.removeEventListener("keyup", S), document.removeEventListener("touchstart", w, { capture: !0 }), document.removeEventListener("touchmove", w, { capture: !0 }), window.removeEventListener("blur", z), x(), window.requestAnimationFrame(() => {
617
+ if (s.current === !1) return;
618
+ s.current = !1;
619
+ const C = b, M = d.current, O = et(C, M.currentTarget);
620
+ u?.(O, m.current, M), m.current = null;
594
621
  });
595
- }, []), A = W(() => {
622
+ }, []), z = U(() => {
596
623
  s.current !== !1 && (s.current = !1, y(f.current));
597
- }, []), E = P(() => {
598
- b(), M(h), window.requestAnimationFrame(() => {
599
- s.current !== !1 && l?.(f.current, _.current, d.current);
624
+ }, []), E = k(() => {
625
+ x(), T(h), window.requestAnimationFrame(() => {
626
+ if (s.current === !1) return;
627
+ const b = f.current, C = d.current, M = et(b, C.currentTarget);
628
+ l?.(M, m.current, C);
600
629
  });
601
- }, [h]), k = P((L) => {
602
- f.current = L, E();
603
- }, []), H = P((L) => {
604
- _.current = { ctrlKey: L.ctrlKey, shiftKey: L.shiftKey, altKey: L.altKey, metaKey: L.metaKey }, E();
605
- }, []), S = P((L) => {
606
- _.current = { ctrlKey: L.ctrlKey, shiftKey: L.shiftKey, altKey: L.altKey, metaKey: L.metaKey }, E();
630
+ }, [h]), B = k((b) => {
631
+ f.current = b, E();
632
+ }, []), $ = k((b) => {
633
+ m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey }, E();
634
+ }, []), S = k((b) => {
635
+ m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey }, E();
607
636
  }, [h]);
608
- return P((L) => {
609
- L.isDefaultPrevented() || (_.current = { ctrlKey: L.ctrlKey, shiftKey: L.shiftKey, altKey: L.altKey, metaKey: L.metaKey }, c(L, _.current) !== !1 && (d.current = L, f.current = L.nativeEvent, document.addEventListener(`${m}up`, y, { passive: !1 }), document.addEventListener(`${m}move`, k, { passive: !1 }), document.addEventListener("keydown", H, { passive: !1 }), document.addEventListener("keyup", S, { passive: !1 }), window.addEventListener("blur", A, { passive: !0 }), i && r && (document.addEventListener("touchstart", v, { passive: !1, capture: !0 }), document.addEventListener("touchmove", v, { passive: !1, capture: !0 })), s.current = !0, M(a)));
610
- }, [a, i]);
637
+ return k((b) => {
638
+ b.isDefaultPrevented() || (m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey }, a(b, m.current) !== !1 && (d.current = b, f.current = b.nativeEvent, document.addEventListener(`${_}up`, y, { passive: !1 }), document.addEventListener(`${_}move`, B, { passive: !1 }), document.addEventListener("keydown", $, { passive: !1 }), document.addEventListener("keyup", S, { passive: !1 }), window.addEventListener("blur", z, { passive: !0 }), r && i && (document.addEventListener("touchstart", w, { passive: !1, capture: !0 }), document.addEventListener("touchmove", w, { passive: !1, capture: !0 })), s.current = !0, T(c)));
639
+ }, [c, r]);
611
640
  }
612
- function Go(o, t) {
613
- return Rn({ onPointerDown: o, onPointerMoveOrWait: (e, n, i) => {
614
- o?.(i);
615
- }, ...t });
641
+ function qo(o, e) {
642
+ return rn({ onPointerDown: o, onPointerMoveOrWait: (t, n, r) => {
643
+ o?.(r);
644
+ }, ...e });
616
645
  }
617
- const Nn = ({ initValue: o, useHookBody: t, applyStateChange: e }) => {
618
- const n = O(o);
619
- if (typeof t != "function") throw new Error("function expected as hook body parameter. got " + typeof t);
620
- const i = t();
621
- return ge(() => {
622
- n.current !== i && (n.current = i, e(i));
623
- }, [e, i]), null;
624
- }, pe = (o) => {
646
+ const Fn = ({ initValue: o, useHookBody: e, applyStateChange: t }) => {
647
+ const n = I(o);
648
+ if (typeof e != "function") throw new Error("function expected as hook body parameter. got " + typeof e);
649
+ const r = e();
650
+ return Et(() => {
651
+ n.current !== r && (n.current = r, t(r));
652
+ }, [t, r]), null;
653
+ }, wt = (o) => {
625
654
  console && console.warn && console.warn(o);
626
- }, ae = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
627
- let Hn = 1, fe = !1, Qe = !1;
628
- const Yt = [], Lt = [], qt = () => {
629
- Lt.forEach((o) => o());
630
- }, Wn = ({ automaticContainerInternalUseOnly: o }) => {
631
- const [t, e] = V([]), n = O([]);
632
- return n.current = t, o || fe !== !1 || (Qe = !0), $(() => {
633
- let i = !0;
634
- function r() {
635
- if (i) return Lt[0] !== r ? (o || fe !== !0 || pe("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void e((c) => [])) : void e([...Yt]);
655
+ }, _t = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
656
+ let jn = 1, bt = !1, sn = !1;
657
+ const tt = [], Pe = [], rt = () => {
658
+ Pe.forEach((o) => o());
659
+ }, Un = ({ automaticContainerInternalUseOnly: o }) => {
660
+ const [e, t] = Y([]), n = I([]);
661
+ return n.current = e, o || bt !== !1 || (sn = !0), H(() => {
662
+ let r = !0;
663
+ function i() {
664
+ if (r) return Pe[0] !== i ? (o || bt !== !0 || wt("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void t((a) => [])) : void t([...tt]);
636
665
  }
637
- return Lt.push(r), qt(), () => {
638
- i = !1, n.current?.length > 0 && pe("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Lt.splice(Lt.indexOf(r), 1), qt();
666
+ return Pe.push(i), rt(), () => {
667
+ r = !1, n.current?.length > 0 && wt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Pe.splice(Pe.indexOf(i), 1), rt();
639
668
  };
640
- }, [o]), T(Ct, { children: t.map(({ hook: i, key: r }) => gn(Nn, { ...i, key: r })) });
641
- }, Fn = (o) => {
642
- const t = Hn++;
643
- return Yt.push({ hook: o, key: t }), Lt.length === 0 && Qe === !1 && (fe = !0, ((e) => {
644
- if (ae.document && ae.document.createElement) {
645
- const n = ae.document.createElement("div");
646
- wn(n).render(T(e, { automaticContainerInternalUseOnly: !0 }));
647
- } else pe("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
648
- })(Wn)), qt(), () => {
649
- Yt.splice(Yt.findIndex((e) => e.key === t), 1), qt();
669
+ }, [o]), P(fe, { children: e.map(({ hook: r, key: i }) => wn(Fn, { ...r, key: i })) });
670
+ }, Xn = (o) => {
671
+ const e = jn++;
672
+ return tt.push({ hook: o, key: e }), Pe.length === 0 && sn === !1 && (bt = !0, ((t) => {
673
+ if (_t.document && _t.document.createElement) {
674
+ const n = _t.document.createElement("div");
675
+ Sn(n).render(P(t, { automaticContainerInternalUseOnly: !0 }));
676
+ } else wt("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
677
+ })(Un)), rt(), () => {
678
+ tt.splice(tt.findIndex((t) => t.key === e), 1), rt();
650
679
  };
651
680
  };
652
- let me = null;
653
- me || (me = (o, t, e = {}) => {
654
- let n, i, r = !1, c = !1, u = [], { unmountIfNoConsumers: l = !1 } = e;
681
+ let xt = null;
682
+ xt || (xt = (o, e, t = {}) => {
683
+ let n, r, i = !1, a = !1, u = [], { unmountIfNoConsumers: l = !1 } = t;
655
684
  const s = (h) => {
656
- i = h, bn(() => u.forEach((d) => d(h)));
657
- }, a = () => (c || (i = typeof o == "function" ? o() : o, c = !0), i);
685
+ r = h, En(() => u.forEach((d) => d(h)));
686
+ }, c = () => (a || (r = typeof o == "function" ? o() : o, a = !0), r);
658
687
  return () => {
659
- const [h, d] = V(a);
660
- return $(() => (r || (r = !0, n = Fn({ initValue: o, useHookBody: t, applyStateChange: s })), u.push(d), i !== h && d(i), () => {
661
- u.splice(u.indexOf(d), 1), u.length === 0 && l && (n(), r = !1);
688
+ const [h, d] = Y(c);
689
+ return H(() => (i || (i = !0, n = Xn({ initValue: o, useHookBody: e, applyStateChange: s })), u.push(d), r !== h && d(r), () => {
690
+ u.splice(u.indexOf(d), 1), u.length === 0 && l && (n(), i = !1);
662
691
  }), []), h;
663
692
  };
664
693
  });
665
- const tn = me;
666
- let en = () => {
694
+ const ln = xt;
695
+ let an = () => {
667
696
  console.warn("You must call useEditMode before setting its state.");
668
697
  };
669
- const Vn = tn(null, () => {
670
- const [o, t] = V(null);
671
- return en = t, o;
698
+ const Yn = ln(null, () => {
699
+ const [o, e] = Y(null);
700
+ return an = e, o;
672
701
  }), Zo = () => {
673
- const o = Vn();
674
- return I(() => ({ setMode: (t) => {
675
- en((e) => (typeof t == "function" && (t = t(e)), t?.onModeChange?.(t ?? null), t));
702
+ const o = Yn();
703
+ return K(() => ({ setMode: (e) => {
704
+ an((t) => (typeof e == "function" && (e = e(t)), e?.onModeChange?.(e ?? null), e));
676
705
  }, getMode: () => o }), [o]);
677
- }, jn = tn({ setClipboard: (o) => {
706
+ }, Gn = ln({ setClipboard: (o) => {
678
707
  throw new Error("This is only available via the useClipboard.");
679
- }, getClipboard: () => Zt.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
680
- const [o, t] = V(Zt.Global);
681
- return { setClipboard: (e) => t(e), getClipboard: () => o, refNativeCopy: O(null), refNativeLastKey: O(null) };
682
- }), qo = (o) => {
683
- const { source: t, target: e, onPaste: n, onClipboardUpdate: i, commands: r } = o, c = Jt(), u = P(i, [i]), l = P(n, [n]), { getClipboard: s, refNativeCopy: a } = jn(), h = s();
684
- I(() => {
685
- const m = t?.element, v = e?.element ?? t?.element;
686
- if (!r) return;
687
- const y = [new re("cut", m, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [Y.Ctrl] } }), new re("copy", m, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", icon: "copy", shortcut: { key: "C", modifiers: [Y.Ctrl] } }), new re("paste", v, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste.yellow", shortcut: [{ key: "V", modifiers: [Y.Ctrl] }, { key: "F8", modifiers: [Y.Ctrl] }] })];
688
- r?.addCommands(y, !0);
689
- }, [r]);
690
- const d = P(async (m) => {
691
- if (!t?.element) return;
692
- let v = null;
708
+ }, getClipboard: () => ot.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
709
+ const [o, e] = Y(ot.Global);
710
+ return { setClipboard: (t) => e(t), getClipboard: () => o, refNativeCopy: I(null), refNativeLastKey: I(null) };
711
+ }), Jo = (o) => {
712
+ const { source: e, target: t, onPaste: n, onClipboardUpdate: r, commands: i } = o, a = it(), u = k(r, [r]), l = k(n, [n]), { getClipboard: s, refNativeCopy: c } = Gn(), h = s();
713
+ K(() => {
714
+ const _ = e?.element, w = t?.element ?? e?.element;
715
+ if (!i) return;
716
+ const y = [new pt("cut", _, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [Z.Ctrl] } }), new pt("copy", _, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", icon: "copy", shortcut: { key: "C", modifiers: [Z.Ctrl] } }), new pt("paste", w, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste.yellow", shortcut: [{ key: "V", modifiers: [Z.Ctrl] }, { key: "F8", modifiers: [Z.Ctrl] }] })];
717
+ i?.addCommands(y, !0);
718
+ }, [i]);
719
+ const d = k(async (_) => {
720
+ if (!e?.element) return;
721
+ let w = null;
693
722
  try {
694
- v = t.doCopy?.(m), typeof v == "string" ? await h.writeText(v) : await h.writeReference(v);
723
+ w = e.doCopy?.(_), typeof w == "string" ? await h.writeText(w) : await h.writeReference(w);
695
724
  } catch (y) {
696
725
  throw y;
697
726
  }
698
- }, [t, c]), f = P(async (m) => {
699
- const v = t?.element?.();
700
- if (v) {
701
- a.current = { sourceElement: v, args: m };
727
+ }, [e, a]), f = k(async (_) => {
728
+ const w = e?.element?.();
729
+ if (w) {
730
+ c.current = { sourceElement: w, args: _ };
702
731
  try {
703
- await d(m);
732
+ await d(_);
704
733
  } catch (y) {
705
- c.showError?.(y);
734
+ a.showError?.(y);
706
735
  }
707
736
  }
708
- }, [t?.element, c]), _ = W(() => {
737
+ }, [e?.element, a]), m = U(() => {
709
738
  f({ isCut: !0 });
710
- }, []), p = P(async (m, v, y) => {
739
+ }, []), p = k(async (_, w, y) => {
711
740
  try {
712
- if (await m.doPaste(v, y) === !1) return;
713
- l?.(v, y);
714
- } catch (A) {
715
- c.showError?.(A);
741
+ if (await _.doPaste(w, y) === !1) return;
742
+ l?.(w, y);
743
+ } catch (z) {
744
+ a.showError?.(z);
716
745
  }
717
- }, [l]), b = P(async (m, v, y) => {
718
- const A = e?.element?.();
719
- if (A && await q.whenFocus(A), !m && !v) return;
720
- const E = await c.showBusy?.("Pasting...");
721
- if (v) try {
722
- return await p(e, v, y), void E?.();
746
+ }, [l]), x = k(async (_, w, y) => {
747
+ const z = t?.element?.();
748
+ if (z && await ee.whenFocus(z), !_ && !w) return;
749
+ const E = await a.showBusy?.("Pasting...");
750
+ if (w) try {
751
+ return await p(t, w, y), void E?.();
723
752
  } catch (S) {
724
- E?.(), c.showError?.(S);
753
+ E?.(), a.showError?.(S);
725
754
  }
726
- let k, H = e.importFromExternal;
727
- H || (H = (S, L) => ({ getItemType: () => "text", toText: () => m.text, isClipboardItem: !0 }));
755
+ let B, $ = t.importFromExternal;
756
+ $ || ($ = (S, b) => ({ getItemType: () => "text", toText: () => _.text, isClipboardItem: !0 }));
728
757
  try {
729
- k = await H(m, { isCut: !1 });
758
+ B = await $(_, { isCut: !1 });
730
759
  } catch (S) {
731
- E?.(), c.showError?.(S);
760
+ E?.(), a.showError?.(S);
732
761
  }
733
- if (k) try {
734
- const S = await Promise.resolve(k);
735
- await p(e, S, y), E?.();
762
+ if (B) try {
763
+ const S = await Promise.resolve(B);
764
+ await p(t, S, y), E?.();
736
765
  } catch (S) {
737
- E?.(), c.showError?.(S);
766
+ E?.(), a.showError?.(S);
738
767
  }
739
768
  else E?.();
740
- }, [p, e, c]), M = P(async (m) => {
741
- if (e?.element) try {
742
- const v = await h.readReference();
743
- if (v) return void await b(null, v, m);
769
+ }, [p, t, a]), T = k(async (_) => {
770
+ if (t?.element) try {
771
+ const w = await h.readReference();
772
+ if (w) return void await x(null, w, _);
744
773
  const y = [];
745
- y[0] = await oe.readStringFromClipboard(h, ie.plain), y[1] = await oe.readHTMLFromClipboard(h, ie.html), y[2] = await oe.readBlobFromClipboard(h, ie.png);
746
- const A = { text: y[0] ?? null, html: y[1] ?? null, image: y[2] ?? null };
747
- await b(A, null, m);
748
- } catch (v) {
749
- if (v?.message === "Document is not focused.") return;
750
- c.showError?.(v);
774
+ y[0] = await ht.readStringFromClipboard(h, dt.plain), y[1] = await ht.readHTMLFromClipboard(h, dt.html), y[2] = await ht.readBlobFromClipboard(h, dt.png);
775
+ const z = { text: y[0] ?? null, html: y[1] ?? null, image: y[2] ?? null };
776
+ await x(z, null, _);
777
+ } catch (w) {
778
+ if (w?.message === "Document is not focused.") return;
779
+ a.showError?.(w);
751
780
  }
752
- }, [b, e?.element, c]);
753
- return P(async (m) => {
754
- }, [t?.element]), P(async (m) => {
755
- }, [e?.element, b, c]), $(() => {
781
+ }, [x, t?.element, a]);
782
+ return k(async (_) => {
783
+ }, [e?.element]), k(async (_) => {
784
+ }, [t?.element, x, a]), H(() => {
756
785
  if (!h) return;
757
- const m = async (A) => {
786
+ const _ = async (z) => {
758
787
  const E = await h.readReference();
759
788
  u?.(E);
760
- }, v = (A) => {
761
- c.showMessage?.(Zt.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
762
- }, y = (A) => {
763
- c.showMessage?.(Zt.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
789
+ }, w = (z) => {
790
+ a.showMessage?.(ot.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
791
+ }, y = (z) => {
792
+ a.showMessage?.(ot.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
764
793
  };
765
- return h.addEventListener("clipboardchange", m), h.addEventListener("clipboarderrorread", v), h.addEventListener("clipboarderrorwrite", y), () => {
766
- h.removeEventListener("clipboardchange", m), h.removeEventListener("clipboarderrorread", v), h.removeEventListener("clipboarderrorwrite", y);
794
+ return h.addEventListener("clipboardchange", _), h.addEventListener("clipboarderrorread", w), h.addEventListener("clipboarderrorwrite", y), () => {
795
+ h.removeEventListener("clipboardchange", _), h.removeEventListener("clipboarderrorread", w), h.removeEventListener("clipboarderrorwrite", y);
767
796
  };
768
- }, [h, c]), $(() => {
769
- }, [d, b, t, e]), $(() => {
770
- r?.getCommand("cut")?.updateCallback(_).update({ disabled: !t || !e }), r?.getCommand("copy")?.updateCallback(f).update({ disabled: !t }), r?.getCommand("paste")?.updateCallback(M).update({ disabled: !e });
771
- }, [t, e, r]), { paste: M, copy: f, clipboard: h };
797
+ }, [h, a]), H(() => {
798
+ }, [d, x, e, t]), H(() => {
799
+ i?.getCommand("cut")?.updateCallback(m).update({ disabled: !e || !t }), i?.getCommand("copy")?.updateCallback(f).update({ disabled: !e }), i?.getCommand("paste")?.updateCallback(T).update({ disabled: !t });
800
+ }, [e, t, i]), { paste: T, copy: f, clipboard: h };
772
801
  };
773
- function Jo(o, t = !0) {
774
- const e = O(o);
775
- $(() => {
776
- if (t) {
777
- const n = Object.entries(o).reduce((i, [r, c]) => (e.current[r] !== c && (i[r] = [e.current[r], c]), i), {});
802
+ function Qo(o, e = !0) {
803
+ const t = I(o);
804
+ H(() => {
805
+ if (e) {
806
+ const n = Object.entries(o).reduce((r, [i, a]) => (t.current[i] !== a && (r[i] = [t.current[i], a]), r), {});
778
807
  Object.keys(n).length > 0 && console.log("Changed props:", n);
779
808
  }
780
- e.current = o;
809
+ t.current = o;
781
810
  });
782
811
  }
783
- let ce = !1, Un = 0;
784
- var Xn = typeof document < "u" ? ge : $;
785
- const ke = () => "sheetxl-ui-" + Un++, Pe = rt.useId, Qo = Pe ?? function() {
786
- const [o, t] = rt.useState(() => ce ? ke() : void 0);
787
- return Xn(() => {
788
- o == null && t(ke());
789
- }, []), rt.useEffect(() => {
790
- ce || (ce = !0);
812
+ let gt = !1, qn = 0;
813
+ var Zn = typeof document < "u" ? Et : H;
814
+ const Bt = () => "sheetxl-ui-" + qn++, Ot = ae.useId, er = Ot ?? function() {
815
+ const [o, e] = ae.useState(() => gt ? Bt() : void 0);
816
+ return Zn(() => {
817
+ o == null && e(Bt());
818
+ }, []), ae.useEffect(() => {
819
+ gt || (gt = !0);
791
820
  }, []), o;
792
- }, Yn = [];
793
- function ve(o, t, e = Yn) {
794
- const n = O(null);
795
- return yn(o, () => {
821
+ }, Jn = [];
822
+ function Lt(o, e, t = Jn) {
823
+ const n = I(null);
824
+ return bn(o, () => {
796
825
  if (!n.current) return;
797
- const i = n.current, r = t?.();
798
- if (!r || typeof r != "object") throw new Error("attributes must return a plain object of values");
799
- const c = Object.keys(r), u = c.length;
826
+ const r = n.current, i = e?.();
827
+ if (!i || typeof i != "object") throw new Error("attributes must return a plain object of values");
828
+ const a = Object.keys(i), u = a.length;
800
829
  for (let l = 0; l < u; l++) {
801
- const s = c[l], a = r[s];
802
- Object.defineProperty(i, s, { value: a, writable: !0, configurable: !0, enumerable: !0 });
830
+ const s = a[l], c = i[s];
831
+ Object.defineProperty(r, s, { value: c, writable: !0, configurable: !0, enumerable: !0 });
803
832
  }
804
- return i;
805
- }, e), n;
833
+ return r;
834
+ }, t), n;
806
835
  }
807
- const De = "Undo the last action.", Ae = "Repeat the last action or undo the redo.", Gn = (o) => `Redo ${o}`, ti = ({ manager: o, commands: t, disabled: e }) => {
808
- const n = Jt(), i = P((c) => {
836
+ const It = "Undo the last action.", $t = "Repeat the last action or undo the redo.", Qn = (o) => `Redo ${o}`, tr = ({ manager: o, commands: e, disabled: t }) => {
837
+ const n = it(), r = k((a) => {
809
838
  try {
810
- o?.undo(c);
839
+ o?.undo(a);
811
840
  } catch (u) {
812
841
  n.error(u);
813
842
  }
814
- }, [o]), r = P((c) => {
843
+ }, [o]), i = k((a) => {
815
844
  try {
816
- o?.redo(c);
845
+ o?.redo(a);
817
846
  } catch (u) {
818
847
  n.error(u);
819
848
  }
820
849
  }, [o]);
821
- return I(() => {
822
- if (!t) return;
823
- const c = { contains: (l) => !0, focus() {
824
- } }, u = [new ue("undo", c, { label: "Undo", description: De, shortcut: { key: "z", modifiers: [Y.Ctrl] }, disabled: !0 }, i), new ue("redo", c, { label: "Redo", description: Ae, shortcut: [{ key: "y", modifiers: [Y.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [Y.Alt] }], disabled: !0 }, r)];
825
- t?.addCommands(u, !0);
826
- }, [t]), $(() => {
827
- if (!t) return;
828
- const c = () => {
850
+ return K(() => {
851
+ if (!e) return;
852
+ const a = { contains: (l) => !0, focus() {
853
+ } }, u = [new yt("undo", a, { label: "Undo", description: It, shortcut: { key: "z", modifiers: [Z.Ctrl] }, disabled: !0 }, r), new yt("redo", a, { label: "Redo", description: $t, shortcut: [{ key: "y", modifiers: [Z.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [Z.Alt] }], disabled: !0 }, i)];
854
+ e?.addCommands(u, !0);
855
+ }, [e]), H(() => {
856
+ if (!e) return;
857
+ const a = () => {
829
858
  const l = o?.getTopUndoDescription(), s = {};
830
- var a;
831
- t.getCommand("undo").update({ disabled: e || !o || !o.hasUndo(), description: l ? (a = l, `Undo ${a}`) : De, state: s, context: { undoManager: o } });
859
+ var c;
860
+ e.getCommand("undo").update({ disabled: t || !o || !o.hasUndo(), description: l ? (c = l, `Undo ${c}`) : It, state: s, context: { undoManager: o } });
832
861
  const h = o?.getTopRedoDescription();
833
- t.getCommand("redo").update({ disabled: e || !o || !o.hasRedo(), description: h ? Gn(h) : Ae, state: s, context: { undoManager: o } });
862
+ e.getCommand("redo").update({ disabled: t || !o || !o.hasRedo(), description: h ? Qn(h) : $t, state: s, context: { undoManager: o } });
834
863
  };
835
- if (c(), !o) return;
864
+ if (a(), !o) return;
836
865
  const u = o.addListener({ onStackChange() {
837
- c();
866
+ a();
838
867
  } });
839
868
  return () => u?.();
840
- }, [o, t, e]), { undo: i, redo: r };
869
+ }, [o, e, t]), { undo: r, redo: i };
841
870
  };
842
- class Zn extends vn {
871
+ class eo extends xn {
843
872
  static getDerivedStateFromError() {
844
873
  return { hasError: !0 };
845
874
  }
846
- componentDidCatch(t) {
847
- this.props.onError?.(t);
875
+ componentDidCatch(e) {
876
+ this.props.onError?.(e);
848
877
  }
849
878
  render() {
850
879
  return this.props.children;
851
880
  }
852
881
  }
853
- const ei = ({ children: o }) => {
854
- const t = Jt(), e = W((n) => {
855
- t.showError(n);
856
- }, [t]);
857
- return T(Zn, { onError: e, children: o });
882
+ const nr = ({ children: o }) => {
883
+ const e = it(), t = U((n) => {
884
+ e.showError(n);
885
+ }, [e]);
886
+ return P(eo, { onError: t, children: o });
858
887
  };
859
- class qn {
860
- constructor(t) {
861
- this.notifier = t, this.handleUnhandledRejection = (e) => {
862
- const n = e.reason;
888
+ class to {
889
+ constructor(e) {
890
+ this.notifier = e, this.handleUnhandledRejection = (t) => {
891
+ const n = t.reason;
863
892
  n instanceof DOMException && n.name === "AbortError" || this.notifier.showError(n);
864
- }, this.handleGlobalError = (e) => {
865
- this.notifier.showError(e.error);
893
+ }, this.handleGlobalError = (t) => {
894
+ this.notifier.showError(t.error);
866
895
  }, this.setupGlobalHandlers();
867
896
  }
868
897
  setupGlobalHandlers() {
@@ -872,294 +901,294 @@ class qn {
872
901
  window.removeEventListener("unhandledrejection", this.handleUnhandledRejection), window.removeEventListener("error", this.handleGlobalError);
873
902
  }
874
903
  }
875
- const ni = ({ children: o }) => {
876
- const t = Jt();
877
- return $(() => {
878
- const e = new qn(t);
904
+ const or = ({ children: o }) => {
905
+ const e = it();
906
+ return H(() => {
907
+ const t = new to(e);
879
908
  return () => {
880
- e.cleanup();
909
+ t.cleanup();
881
910
  };
882
- }, [t]), T(Ct, { children: o });
883
- }, oi = () => null;
884
- function nn(o) {
885
- var t, e, n = "";
911
+ }, [e]), P(fe, { children: o });
912
+ }, rr = () => null;
913
+ function cn(o) {
914
+ var e, t, n = "";
886
915
  if (typeof o == "string" || typeof o == "number") n += o;
887
916
  else if (typeof o == "object") if (Array.isArray(o)) {
888
- var i = o.length;
889
- for (t = 0; t < i; t++) o[t] && (e = nn(o[t])) && (n && (n += " "), n += e);
890
- } else for (e in o) o[e] && (n && (n += " "), n += e);
917
+ var r = o.length;
918
+ for (e = 0; e < r; e++) o[e] && (t = cn(o[e])) && (n && (n += " "), n += t);
919
+ } else for (t in o) o[t] && (n && (n += " "), n += t);
891
920
  return n;
892
921
  }
893
- function lt() {
894
- for (var o, t, e = 0, n = "", i = arguments.length; e < i; e++) (o = arguments[e]) && (t = nn(o)) && (n && (n += " "), n += t);
922
+ function le() {
923
+ for (var o, e, t = 0, n = "", r = arguments.length; t < r; t++) (o = arguments[t]) && (e = cn(o)) && (n && (n += " "), n += e);
895
924
  return n;
896
925
  }
897
- const Jn = {}, Qn = (o) => {
898
- const { onPointerDown: t, style: e, splitDirection: n, paddingBefore: i = 0, paddingAfter: r = 0, disabled: c, key: u, hitAreaProps: l = Jn, ...s } = o, a = n === "row", { style: h, className: d, ...f } = l;
899
- return T("div", { style: { ...e, position: "relative" }, ...s, children: T("div", { className: lt("hit-box", d), style: { left: (a ? -i : 0) + "px", width: `calc(100% + ${a ? i + r : 0}px)`, top: (a ? 0 : -i) + "px", height: `calc(100% + ${a ? 0 : i + r}px)`, position: "absolute", ...h }, onPointerDown: c ? void 0 : t, ...f }) }, u);
900
- }, jt = {}, gt = (o, t, e = !0) => o === null ? null : o.pixels !== null ? e ? o.pixels : t - o.pixels : (e ? o.percent : 100 - o.percent) / 100 * t, Ut = (o, t = !0) => o?.percent ? `${t ? o.percent : 100 - o.percent}%` : o?.pixels ? `${o.pixels}px` : void 0, ht = (o, t) => {
926
+ const no = {}, oo = (o) => {
927
+ const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: r = 0, paddingAfter: i = 0, disabled: a, key: u, hitAreaProps: l = no, ...s } = o, c = n === "row", { style: h, className: d, ...f } = l;
928
+ return P("div", { style: { ...t, position: "relative" }, ...s, children: P("div", { className: le("hit-box", d), style: { left: (c ? -r : 0) + "px", width: `calc(100% + ${c ? r + i : 0}px)`, top: (c ? 0 : -r) + "px", height: `calc(100% + ${c ? 0 : r + i}px)`, position: "absolute", ...h }, onPointerDown: a ? void 0 : e, ...f }) }, u);
929
+ }, Je = {}, we = (o, e, t = !0) => o === null ? null : o.pixels !== null ? t ? o.pixels : e - o.pixels : (t ? o.percent : 100 - o.percent) / 100 * e, Qe = (o, e = !0) => o?.percent ? `${e ? o.percent : 100 - o.percent}%` : o?.pixels ? `${o.pixels}px` : void 0, he = (o, e) => {
901
930
  if (o == null) return null;
902
- const e = { percent: null, pixels: null };
903
- let n = t;
904
- return typeof o == "string" && ((o = o.trim().toLowerCase()).endsWith("px") ? (o = o.substring(0, o.length - 2), n = !1) : o.endsWith("%") && (o = o.substring(0, o.length - 1), n = !0), o = parseFloat(o)), n ? e.percent = o : e.pixels = o, Object.freeze(e);
905
- }, to = wt(kt((o, t) => {
906
- const { elementBefore: e, elementAfter: n, splitDirection: i = "row", fixedPane: r = null, position: c, onPositionChange: u, minBefore: l, maxBefore: s, minAfter: a, maxAfter: h, children: d, className: f, style: _, disabled: p = !1, onDragStart: b, onDragResize: M, onDragFinish: m, resizerProps: v = jt, paneProps: y = jt, paneBeforeProps: A = jt, paneAfterProps: E = jt, createResizer: k = Qn } = o;
931
+ const t = { percent: null, pixels: null };
932
+ let n = e;
933
+ return typeof o == "string" && ((o = o.trim().toLowerCase()).endsWith("px") ? (o = o.substring(0, o.length - 2), n = !1) : o.endsWith("%") && (o = o.substring(0, o.length - 1), n = !0), o = parseFloat(o)), n ? t.percent = o : t.pixels = o, Object.freeze(t);
934
+ }, ro = me(Ee((o, e) => {
935
+ const { elementBefore: t, elementAfter: n, splitDirection: r = "row", fixedPane: i = null, position: a, onPositionChange: u, minBefore: l, maxBefore: s, minAfter: c, maxAfter: h, children: d, className: f, style: m, disabled: p = !1, onDragStart: x, onDragResize: T, onDragFinish: _, resizerProps: w = Je, paneProps: y = Je, paneBeforeProps: z = Je, paneAfterProps: E = Je, createResizer: B = oo } = o;
907
936
  if (d) throw new Error("Use elementBefore and elementAfter instead of children.");
908
- const H = I(() => rt.isValidElement(n) && rt.isValidElement(e), [n, e]), S = I(() => {
909
- let B = null;
910
- r && (r === "before" ? B = 0 : r === "after" && (B = 1));
911
- const N = B === null;
912
- return { fixedPaneOffset: B, isPercent: N, minBefore: ht(l, N), maxBefore: ht(s, N), minAfter: ht(a, N), maxAfter: ht(h, N) };
913
- }, [l, s, a, h]), L = P(u, [u]), [z, C] = V(() => ht(c, r === null));
914
- $(() => {
915
- C(ht(c, r === null));
916
- }, [c, r]);
917
- const [D, { width: g, height: w }] = vt(), [R, { width: G, height: j }] = vt(), J = i === "row" ? G : j, Z = i === "row" ? g : w, F = I(() => ((B, N, tt, X) => {
918
- const ct = [null, null], it = [null, null];
919
- if (B || (B = { percent: X.fixedPaneOffset === null ? 50 : null, pixels: X.fixedPaneOffset === null ? null : 0 }), N === 0) return B?.pixels != null ? X.fixedPaneOffset !== 1 ? (ct[0] = B?.pixels, it[1] = 100) : (ct[1] = B?.pixels - tt, it[0] = 100) : B?.percent != null && (X.fixedPaneOffset !== 1 ? (it[0] = B?.percent, it[1] = 100 - B?.percent) : (it[1] = B?.percent, it[0] = 100 - B?.percent)), { percents: it, pixels: ct, minBefore: Ut(X.minBefore, !0), maxBefore: Ut(X.maxBefore, !0), minAfter: Ut(X.minAfter), maxAfter: Ut(X.maxAfter) };
920
- let ut = gt(B, N, X.fixedPaneOffset !== 1), nt = N - tt, xe = gt(X.minBefore, nt, !0) ?? 0, pn = gt(X.maxBefore, nt, !0) ?? nt, Ft = 0, ne = 0, Se = 0, Ee = nt;
921
- Ft = (gt(X.maxAfter, N, !1) ?? tt) - tt, ne = gt(X.minAfter, N, !1) ?? N, Se = Math.max(xe, Ft), Ee = Math.min(pn, ne), ut = Math.max(Se, Math.min(ut, Ee)), ne = Math.min(nt - ut, gt(X.maxAfter, nt - ut, !0) ?? nt), Ft = Math.min(nt - ut, gt(X.minAfter, nt - ut, !0) ?? nt), ct[0] = ut, ct[1] = nt - ct[0];
922
- const fn = Math.max(0, Math.min(100, ut / nt * 100));
923
- return it[0] = fn, it[1] = 100 - it[0], { percents: it, pixels: ct, minBefore: `${xe}px`, minAfter: `${Ft}px`, maxBefore: `${ct[0]}px`, maxAfter: `${ct[1]}px` };
924
- })(z, Z, J, S), [S, z, Z, J, i]), [ot, Q] = V(!1), bt = P(b, [b]), xt = P(M, [M]), St = P(m, [m]), pt = O(null), Kt = O(null), Rt = O(null), { style: Nt, className: Pt, ...ft } = y, Et = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...Nt }, { className: st, style: Dt, ...Qt } = A, { className: te, style: At, ...x } = E, K = { flex: "1 1 100%", width: "100%", ..._, flexDirection: i, display: "flex" }, { className: U, style: mt, onPointerDown: _t, ...zt } = v, ee = P((B) => {
925
- const N = ht(B, r === null);
926
- C(N);
927
- }, [r]), Ht = P((B) => {
928
- if (p || !ot) return;
929
- const N = be.current?.getBoundingClientRect();
930
- let tt = 0;
931
- tt = i === "row" ? (B.clientX ?? B.touches?.[0]?.clientX) - N.x : (B.clientY ?? B.touches?.[0]?.clientY) - N.y, tt = Math.max(0, Math.min(Z, tt)), S.fixedPaneOffset === 1 && (tt = Z - tt), c && z.pixels === tt || C({ pixels: tt, percent: null }), xt?.(tt), B.stopPropagation(), B.preventDefault();
932
- }, [S, i, p, ot, z, Z]), we = P((B) => {
933
- if (document.removeEventListener("pointermove", Ht), document.removeEventListener("touchmove", Ht), document.removeEventListener("pointerup", we), !!ot && (Q(!1), !!z)) {
934
- if (St(z.pixels), !ht(c, r === null) || z.pixels !== c) {
935
- const N = { ...z };
936
- N.percent === null && (N.percent = N.pixels / Z * 100), L(N);
937
+ const $ = K(() => ae.isValidElement(n) && ae.isValidElement(t), [n, t]), S = K(() => {
938
+ let A = null;
939
+ i && (i === "before" ? A = 0 : i === "after" && (A = 1));
940
+ const j = A === null;
941
+ return { fixedPaneOffset: A, isPercent: j, minBefore: he(l, j), maxBefore: he(s, j), minAfter: he(c, j), maxAfter: he(h, j) };
942
+ }, [l, s, c, h]), b = k(u, [u]), [C, M] = Y(() => he(a, i === null));
943
+ H(() => {
944
+ M(he(a, i === null));
945
+ }, [a, i]);
946
+ const [O, { width: g, height: L }] = Se(), [R, { width: N, height: G }] = Se(), D = r === "row" ? N : G, F = r === "row" ? g : L, W = K(() => ((A, j, ne, q) => {
947
+ const ce = [null, null], se = [null, null];
948
+ if (A || (A = { percent: q.fixedPaneOffset === null ? 50 : null, pixels: q.fixedPaneOffset === null ? null : 0 }), j === 0) return A?.pixels != null ? q.fixedPaneOffset !== 1 ? (ce[0] = A?.pixels, se[1] = 100) : (ce[1] = A?.pixels - ne, se[0] = 100) : A?.percent != null && (q.fixedPaneOffset !== 1 ? (se[0] = A?.percent, se[1] = 100 - A?.percent) : (se[1] = A?.percent, se[0] = 100 - A?.percent)), { percents: se, pixels: ce, minBefore: Qe(q.minBefore, !0), maxBefore: Qe(q.maxBefore, !0), minAfter: Qe(q.minAfter), maxAfter: Qe(q.maxAfter) };
949
+ let ue = we(A, j, q.fixedPaneOffset !== 1), re = j - ne, Ct = we(q.minBefore, re, !0) ?? 0, _n = we(q.maxBefore, re, !0) ?? re, Ge = 0, ut = 0, Tt = 0, kt = re;
950
+ Ge = (we(q.maxAfter, j, !1) ?? ne) - ne, ut = we(q.minAfter, j, !1) ?? j, Tt = Math.max(Ct, Ge), kt = Math.min(_n, ut), ue = Math.max(Tt, Math.min(ue, kt)), ut = Math.min(re - ue, we(q.maxAfter, re - ue, !0) ?? re), Ge = Math.min(re - ue, we(q.minAfter, re - ue, !0) ?? re), ce[0] = ue, ce[1] = re - ce[0];
951
+ const gn = Math.max(0, Math.min(100, ue / re * 100));
952
+ return se[0] = gn, se[1] = 100 - se[0], { percents: se, pixels: ce, minBefore: `${Ct}px`, minAfter: `${Ge}px`, maxBefore: `${ce[0]}px`, maxAfter: `${ce[1]}px` };
953
+ })(C, F, D, S), [S, C, F, D, r]), [X, J] = Y(!1), Me = k(x, [x]), _e = k(T, [T]), Le = k(_, [_]), ge = I(null), st = I(null), Re = I(null), { style: lt, className: Ne, ...He } = y, We = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...lt }, { className: at, style: Ve, ...Fe } = z, { className: je, style: Ue, ...Ce } = E, ze = { flex: "1 1 100%", width: "100%", ...m, flexDirection: r, display: "flex" }, { className: ie, style: Te, onPointerDown: Xe, ...Ye } = w, Be = k((A) => {
954
+ const j = he(A, i === null);
955
+ M(j);
956
+ }, [i]), v = k((A) => {
957
+ if (p || !X) return;
958
+ const j = ye.current?.getBoundingClientRect();
959
+ let ne = 0;
960
+ ne = r === "row" ? (A.clientX ?? A.touches?.[0]?.clientX) - j.x : (A.clientY ?? A.touches?.[0]?.clientY) - j.y, ne = Math.max(0, Math.min(F, ne)), S.fixedPaneOffset === 1 && (ne = F - ne), a && C.pixels === ne || M({ pixels: ne, percent: null }), _e?.(ne), A.stopPropagation(), A.preventDefault();
961
+ }, [S, r, p, X, C, F]), V = k((A) => {
962
+ if (document.removeEventListener("pointermove", v), document.removeEventListener("touchmove", v), document.removeEventListener("pointerup", V), !!X && (J(!1), !!C)) {
963
+ if (Le(C.pixels), !he(a, i === null) || C.pixels !== a) {
964
+ const j = { ...C };
965
+ j.percent === null && (j.percent = j.pixels / F * 100), b(j);
937
966
  }
938
- B.stopPropagation(), B.preventDefault();
967
+ A.stopPropagation(), A.preventDefault();
939
968
  }
940
- }, [z, ot, c, r, Z]), cn = P((B) => {
941
- _t?.(B), B.defaultPrevented || p || ot || (Q(!0), bt(), document.addEventListener("pointermove", Ht, { passive: !1 }), document.addEventListener("touchmove", Ht, { passive: !1 }), document.addEventListener("pointerup", we, { passive: !1 }));
942
- }, [_t]), be = ve(t, () => ({ setPosition: ee, isSplitPane: () => !0 }), []), un = I(() => H ? k?.({ key: "resizer", ref: It([R, Kt]), className: lt("resizer", U), onPointerDownCapture: cn, style: { cursor: p ? void 0 : i === "row" ? "ew-resize" : "ns-resize", minWidth: i === "row" ? "2px" : void 0, minHeight: i !== "row" ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...mt }, splitDirection: i, disabled: p, ...zt }) : null, [H, U, zt, i, mt, p]), Wt = i === "row" ? "Width" : "Height", hn = I(() => {
943
- if (!e) return null;
944
- const B = { ...Et, ...Dt, flex: S.fixedPaneOffset === 0 && F?.pixels[0] !== null ? `0 0 ${Math.round(F?.pixels[0])}px` : `1 1 ${Math.round(F?.percents[0] ?? 100)}%`, [`min${Wt}`]: F?.minBefore, [`max${Wt}`]: n ? F?.maxBefore : "100%" };
945
- return T("div", { ref: pt, className: lt("before", Pt, st), style: B, ...ft, ...Qt, children: e }, "before");
946
- }, [e, y, A, S, F]), dn = I(() => {
969
+ }, [C, X, a, i, F]), Q = k((A) => {
970
+ Xe?.(A), A.defaultPrevented || p || X || (J(!0), Me(), document.addEventListener("pointermove", v, { passive: !1 }), document.addEventListener("touchmove", v, { passive: !1 }), document.addEventListener("pointerup", V, { passive: !1 }));
971
+ }, [Xe]), ye = Lt(e, () => ({ setPosition: Be, isSplitPane: () => !0 }), []), ke = K(() => $ ? B?.({ key: "resizer", ref: Ae([R, st]), className: le("resizer", ie), onPointerDownCapture: Q, style: { cursor: p ? void 0 : r === "row" ? "ew-resize" : "ns-resize", minWidth: r === "row" ? "2px" : void 0, minHeight: r !== "row" ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...Te }, splitDirection: r, disabled: p, ...Ye }) : null, [$, ie, Ye, r, Te, p]), ve = r === "row" ? "Width" : "Height", ct = K(() => {
972
+ if (!t) return null;
973
+ const A = { ...We, ...Ve, flex: S.fixedPaneOffset === 0 && W?.pixels[0] !== null ? `0 0 ${Math.round(W?.pixels[0])}px` : `1 1 ${Math.round(W?.percents[0] ?? 100)}%`, [`min${ve}`]: W?.minBefore, [`max${ve}`]: n ? W?.maxBefore : "100%" };
974
+ return P("div", { ref: ge, className: le("before", Ne, at), style: A, ...He, ...Fe, children: t }, "before");
975
+ }, [t, y, z, S, W]), mn = K(() => {
947
976
  if (!n) return null;
948
- const B = { ...Et, ...At, flex: S.fixedPaneOffset === 1 && F?.pixels[1] !== null ? `0 0 ${Math.round(F?.pixels[1])}px` : `1 1 ${Math.round(F?.percents[1] ?? 100)}%`, [`min${Wt}`]: F?.minAfter, [`max${Wt}`]: e ? F?.maxAfter : "100%" };
949
- return T("div", { ref: Rt, className: lt("after", Pt, te), style: B, ...ft, ...x, children: n }, "after");
950
- }, [n, y, E, S, F]);
951
- return Mt("div", { ref: It([D, be]), className: lt("splitPane", i === "row" ? "vertical" : "horizontal", { dragging: ot }, f), style: K, children: [hn, un, dn] });
977
+ const A = { ...We, ...Ue, flex: S.fixedPaneOffset === 1 && W?.pixels[1] !== null ? `0 0 ${Math.round(W?.pixels[1])}px` : `1 1 ${Math.round(W?.percents[1] ?? 100)}%`, [`min${ve}`]: W?.minAfter, [`max${ve}`]: t ? W?.maxAfter : "100%" };
978
+ return P("div", { ref: Re, className: le("after", Ne, je), style: A, ...He, ...Ce, children: n }, "after");
979
+ }, [n, y, E, S, W]);
980
+ return pe("div", { ref: Ae([O, ye]), className: le("splitPane", r === "row" ? "vertical" : "horizontal", { dragging: X }, f), style: ze, children: [ct, ke, mn] });
952
981
  }));
953
- function eo(o) {
982
+ function io(o) {
954
983
  if (typeof o == "function") return o;
955
984
  if (typeof o == "string") {
956
- const t = o.trim();
957
- if (t.startsWith("data:image/svg+xml")) {
958
- const e = (function(n) {
959
- const i = /^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());
960
- if (!i) return null;
961
- const r = i[1] || "", c = i[2] || "";
985
+ const e = o.trim();
986
+ if (e.startsWith("data:image/svg+xml")) {
987
+ const t = (function(n) {
988
+ const r = /^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());
989
+ if (!r) return null;
990
+ const i = r[1] || "", a = r[2] || "";
962
991
  try {
963
- if (/;base64/i.test(r)) {
992
+ if (/;base64/i.test(i)) {
964
993
  if (typeof atob < "u") {
965
- const u = atob(c), l = u.length;
994
+ const u = atob(a), l = u.length;
966
995
  if (typeof TextDecoder < "u") {
967
- const a = new Uint8Array(l);
968
- for (let h = 0; h < l; h++) a[h] = u.charCodeAt(h);
969
- return new TextDecoder("utf-8").decode(a);
996
+ const c = new Uint8Array(l);
997
+ for (let h = 0; h < l; h++) c[h] = u.charCodeAt(h);
998
+ return new TextDecoder("utf-8").decode(c);
970
999
  }
971
1000
  let s = "";
972
- for (let a = 0; a < l; a++)
973
- s += `%${u.charCodeAt(a).toString(16).padStart(2, "0")}`;
1001
+ for (let c = 0; c < l; c++)
1002
+ s += `%${u.charCodeAt(c).toString(16).padStart(2, "0")}`;
974
1003
  return decodeURIComponent(s);
975
1004
  }
976
- return (globalThis.Buffer ? globalThis.Buffer.from(c, "base64") : require("buffer").Buffer.from(c, "base64")).toString("utf-8");
1005
+ return (globalThis.Buffer ? globalThis.Buffer.from(a, "base64") : require("buffer").Buffer.from(a, "base64")).toString("utf-8");
977
1006
  }
978
1007
  try {
979
- return decodeURIComponent(c);
1008
+ return decodeURIComponent(a);
980
1009
  } catch {
981
- return c;
1010
+ return a;
982
1011
  }
983
1012
  } catch {
984
1013
  return null;
985
1014
  }
986
- })(t);
987
- if (e) return Oe(e);
1015
+ })(e);
1016
+ if (t) return Nt(t);
988
1017
  }
989
- if (t.startsWith("<")) {
990
- if (/^<\s*svg\b/i.test(t)) return Oe(t);
991
- if (/^<\s*path\b/i.test(t)) {
992
- const e = ze(t);
993
- if (e) return { paths: [{ d: e }] };
1018
+ if (e.startsWith("<")) {
1019
+ if (/^<\s*svg\b/i.test(e)) return Nt(e);
1020
+ if (/^<\s*path\b/i.test(e)) {
1021
+ const t = Kt(e);
1022
+ if (t) return { paths: [{ d: t }] };
994
1023
  }
995
- return { paths: [{ d: t }] };
1024
+ return { paths: [{ d: e }] };
996
1025
  }
997
- return { paths: [{ d: t }] };
1026
+ return { paths: [{ d: e }] };
998
1027
  }
999
1028
  if (Array.isArray(o)) {
1000
- const t = [];
1001
- for (const e of o) if (typeof e == "string") {
1002
- const n = String(e).trim();
1029
+ const e = [];
1030
+ for (const t of o) if (typeof t == "string") {
1031
+ const n = String(t).trim();
1003
1032
  if (n.startsWith("<path")) {
1004
- const i = ze(n);
1005
- i && t.push({ d: i });
1006
- } else t.push({ d: n });
1007
- } else e && typeof e == "object" && "d" in e && typeof e.d == "string" && t.push({ ...e });
1008
- return { paths: t };
1033
+ const r = Kt(n);
1034
+ r && e.push({ d: r });
1035
+ } else e.push({ d: n });
1036
+ } else t && typeof t == "object" && "d" in t && typeof t.d == "string" && e.push({ ...t });
1037
+ return { paths: e };
1009
1038
  }
1010
1039
  return o;
1011
1040
  }
1012
- function ze(o) {
1013
- const t = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(o);
1014
- return t ? t[1] ?? t[2] ?? null : null;
1041
+ function Kt(o) {
1042
+ const e = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(o);
1043
+ return e ? e[1] ?? e[2] ?? null : null;
1015
1044
  }
1016
- function Be(o) {
1017
- if ("svg" in o) return { ...o, svg: eo(o.svg) };
1045
+ function Rt(o) {
1046
+ if ("svg" in o) return { ...o, svg: io(o.svg) };
1018
1047
  if ("url" in o) {
1019
- const t = typeof o.url == "string" ? { src: o.url } : o.url;
1020
- return { ...o, url: t };
1048
+ const e = typeof o.url == "string" ? { src: o.url } : o.url;
1049
+ return { ...o, url: e };
1021
1050
  }
1022
1051
  if ("emoji" in o) {
1023
- const t = typeof o.emoji == "string" ? o.emoji : o.emoji.text;
1024
- return { ...o, emoji: t };
1052
+ const e = typeof o.emoji == "string" ? o.emoji : o.emoji.text;
1053
+ return { ...o, emoji: e };
1025
1054
  }
1026
1055
  return o;
1027
1056
  }
1028
- function Oe(o) {
1057
+ function Nt(o) {
1029
1058
  try {
1030
1059
  if (typeof DOMParser < "u") {
1031
- const c = new DOMParser().parseFromString(o, "image/svg+xml"), u = c.querySelector("svg"), l = u?.getAttribute("viewBox") ?? void 0, s = [];
1032
- return c.querySelectorAll("path").forEach((a) => {
1033
- const h = a.getAttribute("d");
1060
+ const a = new DOMParser().parseFromString(o, "image/svg+xml"), u = a.querySelector("svg"), l = u?.getAttribute("viewBox") ?? void 0, s = [];
1061
+ return a.querySelectorAll("path").forEach((c) => {
1062
+ const h = c.getAttribute("d");
1034
1063
  if (!h) return;
1035
- const d = { d: h }, f = a.getAttribute("class");
1064
+ const d = { d: h }, f = c.getAttribute("class");
1036
1065
  f && (d.className = f);
1037
- const _ = a.getAttribute("fill");
1038
- _ && _ !== "none" && (d.fill = _);
1039
- const p = a.getAttribute("stroke");
1066
+ const m = c.getAttribute("fill");
1067
+ m && m !== "none" && (d.fill = m);
1068
+ const p = c.getAttribute("stroke");
1040
1069
  p && (d.stroke = p);
1041
- const b = a.getAttribute("opacity");
1042
- b && (d.opacity = Number(b));
1043
- const M = a.getAttribute("fill-rule");
1044
- M && (d.fillRule = M);
1045
- const m = a.getAttribute("clip-rule");
1046
- m && (d.clipRule = m), s.push(d);
1070
+ const x = c.getAttribute("opacity");
1071
+ x && (d.opacity = Number(x));
1072
+ const T = c.getAttribute("fill-rule");
1073
+ T && (d.fillRule = T);
1074
+ const _ = c.getAttribute("clip-rule");
1075
+ _ && (d.clipRule = _), s.push(d);
1047
1076
  }), { viewBox: l, paths: s };
1048
1077
  }
1049
1078
  } catch {
1050
1079
  }
1051
- const t = o.match(/viewBox="([^"]+)"/i), e = t ? t[1] : void 0, n = [], i = /<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;
1052
- let r;
1053
- for (; r = i.exec(o); ) n.push({ d: r[1] });
1054
- return { viewBox: e, paths: n };
1080
+ const e = o.match(/viewBox="([^"]+)"/i), t = e ? e[1] : void 0, n = [], r = /<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;
1081
+ let i;
1082
+ for (; i = r.exec(o); ) n.push({ d: i[1] });
1083
+ return { viewBox: t, paths: n };
1055
1084
  }
1056
- function Ie(o) {
1057
- const t = {};
1058
- for (const [r, c] of Object.entries(o.icons)) t[r] = Be(c);
1059
- const e = { label: o.meta?.label ?? "Unnamed", version: o.meta?.version ?? "1.0.0", license: o.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: o.meta?.extends ?? [] };
1060
- e.extends.includes("base") || e.extends.push("base");
1061
- const n = { meta: e, icons: t }, i = o.overrides;
1062
- if (i) {
1063
- const r = {};
1064
- for (const [c, u] of Object.entries(i)) {
1085
+ function Ht(o) {
1086
+ const e = {};
1087
+ for (const [i, a] of Object.entries(o.icons)) e[i] = Rt(a);
1088
+ const t = { label: o.meta?.label ?? "Unnamed", version: o.meta?.version ?? "1.0.0", license: o.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: o.meta?.extends ?? [] };
1089
+ t.extends.includes("base") || t.extends.push("base");
1090
+ const n = { meta: t, icons: e }, r = o.overrides;
1091
+ if (r) {
1092
+ const i = {};
1093
+ for (const [a, u] of Object.entries(r)) {
1065
1094
  const l = {};
1066
- for (const [s, a] of Object.entries(u)) l[s] = Be(a);
1067
- r[c] = l;
1095
+ for (const [s, c] of Object.entries(u)) l[s] = Rt(c);
1096
+ i[a] = l;
1068
1097
  }
1069
- n.__overrides = r;
1098
+ n.__overrides = i;
1070
1099
  }
1071
1100
  return n;
1072
1101
  }
1073
- function no() {
1074
- const o = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
1075
- let e = "base", n = /* @__PURE__ */ new Map();
1076
- async function i(l) {
1077
- const s = o.get(l ?? e);
1102
+ function so() {
1103
+ const o = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
1104
+ let t = "base", n = /* @__PURE__ */ new Map();
1105
+ async function r(l) {
1106
+ const s = o.get(l ?? t);
1078
1107
  if (!s) throw new Error(`Icon pack not registered: ${l}`);
1079
1108
  if (!s.pack) {
1080
1109
  if (!s.loading) {
1081
1110
  if (!s.loader) throw new Error(`No loader for icon pack: ${l}`);
1082
- s.loading = s.loader().then((a) => {
1083
- const h = a && typeof a == "object" && "default" in a ? a.default : a;
1084
- s.pack = Ie(h);
1085
- }).catch((a) => {
1086
- throw s.loading = void 0, a;
1111
+ s.loading = s.loader().then((c) => {
1112
+ const h = c && typeof c == "object" && "default" in c ? c.default : c;
1113
+ s.pack = Ht(h);
1114
+ }).catch((c) => {
1115
+ throw s.loading = void 0, c;
1087
1116
  });
1088
1117
  }
1089
1118
  await s.loading;
1090
1119
  }
1091
1120
  }
1092
- function r(l) {
1121
+ function i(l) {
1093
1122
  const s = l.indexOf(":");
1094
1123
  return s > 0 ? { ns: l.slice(0, s), key: l.slice(s + 1) } : { key: l };
1095
1124
  }
1096
- function c(l, s) {
1097
- const a = [l, ...o.get(l)?.pack?.meta.extends ?? []];
1098
- for (const h of a) {
1125
+ function a(l, s) {
1126
+ const c = [l, ...o.get(l)?.pack?.meta.extends ?? []];
1127
+ for (const h of c) {
1099
1128
  const d = o.get(h);
1100
1129
  if (!d?.pack) continue;
1101
- const { icons: f } = d.pack, _ = f[t.get(h)?.get(s) ?? s] ?? f[s];
1102
- if (_) return { glyph: _, pack: d.pack, packKey: h };
1130
+ const { icons: f } = d.pack, m = f[e.get(h)?.get(s) ?? s] ?? f[s];
1131
+ if (m) return { glyph: m, pack: d.pack, packKey: h };
1103
1132
  }
1104
1133
  return null;
1105
1134
  }
1106
1135
  function u(l, s) {
1107
- const a = s?.packKey ?? e;
1108
- if (s?.packKey) return c(s.packKey, l);
1136
+ const c = s?.packKey ?? t;
1137
+ if (s?.packKey) return a(s.packKey, l);
1109
1138
  if (!l) return null;
1110
- const { ns: h, key: d } = r(l);
1139
+ const { ns: h, key: d } = i(l);
1111
1140
  if (h) {
1112
1141
  const f = o.get(h)?.pack;
1113
1142
  if (f) {
1114
- if (o.get(e)?.pack) {
1115
- const p = f.__overrides, b = p?.[e]?.[d];
1116
- if (b) return { glyph: b, pack: f, packKey: h };
1143
+ if (o.get(t)?.pack) {
1144
+ const p = f.__overrides, x = p?.[t]?.[d];
1145
+ if (x) return { glyph: x, pack: f, packKey: h };
1117
1146
  }
1118
- const _ = c(h, d);
1119
- if (_) return _;
1147
+ const m = a(h, d);
1148
+ if (m) return m;
1120
1149
  }
1121
1150
  return null;
1122
1151
  }
1123
- return c(a, l);
1152
+ return a(c, l);
1124
1153
  }
1125
1154
  return { register: function(l, s) {
1126
- const a = o.get(l) ?? {};
1127
- typeof s == "function" ? a.loader = s : a.pack = Ie(s), o.set(l, a), e || (e = l);
1128
- }, prefetch: async function(l = e) {
1155
+ const c = o.get(l) ?? {};
1156
+ typeof s == "function" ? c.loader = s : c.pack = Ht(s), o.set(l, c), t || (t = l);
1157
+ }, prefetch: async function(l = t) {
1129
1158
  const s = Array.isArray(l) ? l : [l];
1130
- await Promise.all(s.map(i));
1159
+ await Promise.all(s.map(r));
1131
1160
  }, setActive: function(l) {
1132
- e = l;
1161
+ t = l;
1133
1162
  for (const s of n.keys()) try {
1134
1163
  s(l);
1135
1164
  } catch {
1136
1165
  }
1137
1166
  }, getActive: function() {
1138
- return e;
1167
+ return t;
1139
1168
  }, resolve: async function(l, s) {
1140
- let a = u(l, s);
1141
- if (a) return a;
1142
- const h = s?.packKey ?? e, { ns: d } = r(l);
1169
+ let c = u(l, s);
1170
+ if (c) return c;
1171
+ const h = s?.packKey ?? t, { ns: d } = i(l);
1143
1172
  if (s?.packKey) {
1144
- if (await i(h), a = u(l, s), a) return a;
1173
+ if (await r(h), c = u(l, s), c) return c;
1145
1174
  const f = o.get(h)?.pack?.meta?.extends ?? [];
1146
- if (f.length && (await Promise.all(f.map(i)), a = u(l, s), a)) return a;
1175
+ if (f.length && (await Promise.all(f.map(r)), c = u(l, s), c)) return c;
1147
1176
  } else if (d) {
1148
- if (await i(d), a = u(l, s), a) return a;
1177
+ if (await r(d), c = u(l, s), c) return c;
1149
1178
  const f = o.get(d)?.pack?.meta?.extends ?? [];
1150
- if (f.length && (await Promise.all(f.map(i)), a = u(l, s), a)) return a;
1179
+ if (f.length && (await Promise.all(f.map(r)), c = u(l, s), c)) return c;
1151
1180
  } else {
1152
- if (await i(h), a = u(l, s), a) return a;
1181
+ if (await r(h), c = u(l, s), c) return c;
1153
1182
  const f = o.get(h)?.pack?.meta?.extends ?? [];
1154
- if (f.length && (await Promise.all(f.map(i)), a = u(l, s), a)) return a;
1183
+ if (f.length && (await Promise.all(f.map(r)), c = u(l, s), c)) return c;
1155
1184
  }
1156
1185
  return null;
1157
- }, registerAlias: function(l, s, a) {
1158
- t.has(l) || t.set(l, /* @__PURE__ */ new Map()), t.get(l).set(s, a);
1186
+ }, registerAlias: function(l, s, c) {
1187
+ e.has(l) || e.set(l, /* @__PURE__ */ new Map()), e.get(l).set(s, c);
1159
1188
  }, has: function(l, s) {
1160
1189
  return !!u(l, s);
1161
1190
  }, getPack: function(l) {
1162
- return o.get(l ?? e)?.pack;
1191
+ return o.get(l ?? t)?.pack;
1163
1192
  }, hasPack: function(l) {
1164
1193
  return !!o.get(l)?.pack;
1165
1194
  }, listPacks: function() {
@@ -1170,390 +1199,400 @@ function no() {
1170
1199
  }, addActiveListener: function(l) {
1171
1200
  const s = n.get(l);
1172
1201
  if (s) return s;
1173
- const a = () => {
1202
+ const c = () => {
1174
1203
  n.delete(l);
1175
1204
  };
1176
- return n.set(l, a), a;
1205
+ return n.set(l, c), c;
1177
1206
  } };
1178
1207
  }
1179
- to.displayName = "SplitPane";
1180
- const Gt = no();
1181
- Gt.register("base", () => import("./BGxm64YWS34jS1Mw.mjs"));
1182
- const $e = (o) => T("svg", { ...o, children: T("path", {}) }), oo = { Icon: "_Icon_1ld90_10" }, io = wt((o) => {
1183
- const { iconKey: t, packKey: e, className: n, style: i, role: r, title: c, size: u, ariaHidden: l, sourceProps: s, children: a, ...h } = o, [d, f] = rt.useState(null);
1184
- rt.useEffect(() => {
1185
- let C = !0, D = e, g = t;
1208
+ ro.displayName = "SplitPane";
1209
+ const nt = so();
1210
+ nt.register("base", () => import("./Bjn3Ya_2XTU4VReT.mjs"));
1211
+ const Wt = (o) => P("svg", { ...o, children: P("path", {}) }), lo = { Icon: "_Icon_17dpm_10" }, ao = me((o) => {
1212
+ const { iconKey: e, packKey: t, className: n, style: r, role: i, title: a, size: u, ariaHidden: l, sourceProps: s, children: c, ...h } = o, [d, f] = ae.useState(null);
1213
+ ae.useEffect(() => {
1214
+ let M = !0, O = t, g = e;
1186
1215
  if (!g) {
1187
- const w = Gt.getPack(D);
1188
- return void f({ glyph: w ? { svg: q.EmptyArray } : void 0, pack: w ?? void 0, packKey: D ?? Gt.getActive() });
1216
+ const L = nt.getPack(O);
1217
+ return void f({ glyph: L ? { svg: ee.EmptyArray } : void 0, pack: L ?? void 0, packKey: O ?? nt.getActive() });
1189
1218
  }
1190
1219
  if (g.includes(":")) {
1191
- const [w, R] = g.split(":");
1192
- D = w, g = R;
1220
+ const [L, R] = g.split(":");
1221
+ O = L, g = R;
1193
1222
  }
1194
- return Gt.resolve(g, { packKey: D }).then((w) => {
1195
- C && f(w);
1223
+ return nt.resolve(g, { packKey: O }).then((L) => {
1224
+ M && f(L);
1196
1225
  }), () => {
1197
- C = !1;
1226
+ M = !1;
1198
1227
  };
1199
- }, [t, e]);
1200
- const _ = d?.pack, p = d?.glyph, b = d?.packKey;
1201
- let M = p ? p.svg : void 0;
1202
- const m = p && !M ? p.url : void 0, v = !p || M || m ? void 0 : p.emoji, y = u != null ? typeof u == "number" ? `${u}px` : u : void 0, A = I(() => [oo.Icon, "icon", n].filter(Boolean).join(" "), [n]), E = I(() => {
1203
- const C = { ...i };
1204
- return C["--icon-size"] = y, C;
1205
- }, [i, y]), k = r ?? (c ? "img" : "presentation"), H = l ?? (!c || void 0), S = (C) => T("span", { className: A, style: E, role: k, "aria-hidden": H, title: c, "data-icon-glyph": t, "data-icon-pack": b, ...h, children: C });
1206
- if (a) return S(a);
1207
- if (v) return S(T("span", { children: typeof v == "string" ? v : v.text }));
1208
- if (m) return S(T("img", { src: m.src, alt: c ?? "" }));
1228
+ }, [e, t]);
1229
+ const m = d?.pack, p = d?.glyph, x = d?.packKey;
1230
+ let T = p ? p.svg : void 0;
1231
+ const _ = p && !T ? p.url : void 0, w = !p || T || _ ? void 0 : p.emoji, y = u != null ? typeof u == "number" ? `${u}px` : u : void 0, z = K(() => [lo.Icon, "icon", n].filter(Boolean).join(" "), [n]), E = K(() => {
1232
+ const M = { ...r };
1233
+ return M["--icon-size"] = y, M;
1234
+ }, [r, y]), B = i ?? (a ? "img" : "presentation"), $ = l ?? (!a || void 0), S = (M) => P("span", { className: z, style: E, role: B, "aria-hidden": $, title: a, "data-icon-glyph": e, "data-icon-pack": x, ...h, children: M });
1235
+ if (c) return S(c);
1236
+ if (w) return S(P("span", { children: typeof w == "string" ? w : w.text }));
1237
+ if (_) return S(P("img", { src: _.src, alt: a ?? "" }));
1209
1238
  if (p && "react" in p) {
1210
- const C = p.react, D = { className: A, style: E, role: k, "aria-hidden": H, title: c, ...h, ...s };
1211
- return S(T(C, { ...D }));
1212
- }
1213
- const L = { viewBox: M?.viewBox ?? _?.meta.defaultViewBox ?? "0 0 24 24" };
1214
- if (typeof M == "function")
1215
- return S(M(L) ?? T($e, { ...L }));
1216
- if (!M) return S(T($e, { ...L }));
1217
- const z = M.paths;
1218
- return S(T("svg", { ...L, children: z ? z.map((C, D) => T("path", { d: C.d, className: C.className, fill: C.fill, stroke: C.stroke, opacity: C.opacity, fillRule: C.fillRule, clipRule: C.clipRule }, D)) : null }));
1239
+ const M = p.react, O = { className: z, style: E, role: B, "aria-hidden": $, title: a, ...h, ...s };
1240
+ return S(P(M, { ...O }));
1241
+ }
1242
+ const b = { viewBox: T?.viewBox ?? m?.meta.defaultViewBox ?? "0 0 24 24" };
1243
+ if (typeof T == "function")
1244
+ return S(T(b) ?? P(Wt, { ...b }));
1245
+ if (!T) return S(P(Wt, { ...b }));
1246
+ const C = T.paths;
1247
+ return S(P("svg", { ...b, children: C ? C.map((M, O) => P("path", { d: M.d, className: M.className, fill: M.fill, stroke: M.stroke, opacity: M.opacity, fillRule: M.fillRule, clipRule: M.clipRule }, O)) : null }));
1219
1248
  });
1220
- function ii(o) {
1221
- const { isWalking: t = !1, themedType: e = "info", speed: n = 120, dashGap: i = 3, dashLength: r = 5, iconKey: c, packKey: u, style: l, className: s, ...a } = o, h = I(() => {
1222
- if (!t) return;
1223
- const f = { "--walk-duration": `${n * (i + r)}ms`, "--walk-dash-length": `${r}px`, "--walk-dash-gap": `${i}px` };
1224
- return e && e !== "accent" && (f["--icon-accent"] = `var(--icon-${e})`), f;
1225
- }, [t, n, i, r, e]), d = I(() => t ? s + " walking" : s, [t, s]);
1226
- return T(io, { iconKey: c, packKey: u, className: d, style: { ...l, ...h }, ...a });
1249
+ function ir(o) {
1250
+ const { isWalking: e = !1, themedType: t = "info", speed: n = 120, dashGap: r = 3, dashLength: i = 5, iconKey: a, packKey: u, style: l, className: s, ...c } = o, h = K(() => {
1251
+ if (!e) return;
1252
+ const f = { "--walk-duration": `${n * (r + i)}ms`, "--walk-dash-length": `${i}px`, "--walk-dash-gap": `${r}px` };
1253
+ return t && t !== "accent" && (f["--icon-accent"] = `var(--icon-${t})`), f;
1254
+ }, [e, n, r, i, t]), d = K(() => e ? s + " walking" : s, [e, s]);
1255
+ return P(ao, { iconKey: a, packKey: u, className: d, style: { ...l, ...h }, ...c });
1227
1256
  }
1228
- class _e {
1257
+ class St {
1229
1258
  constructor() {
1230
1259
  this.store = /* @__PURE__ */ new Map();
1231
1260
  }
1232
- async getItem(t) {
1233
- return this.store.get(t) ?? null;
1261
+ async getItem(e) {
1262
+ return this.store.get(e) ?? null;
1234
1263
  }
1235
- async setItem(t, e) {
1236
- this.store.set(t, e);
1264
+ async setItem(e, t) {
1265
+ this.store.set(e, t);
1237
1266
  }
1238
- async removeItem(t) {
1239
- this.store.delete(t);
1267
+ async removeItem(e) {
1268
+ this.store.delete(e);
1240
1269
  }
1241
1270
  }
1242
- const on = We(null), rn = { parse: (o) => o ? JSON.parse(o) : null, stringify: JSON.stringify }, ro = { store: new _e(), namespace: "", serializer: rn, debounceMs: 0, crossTabSync: !1, notify: () => {
1271
+ const un = Xt(null), hn = { parse: (o) => o ? JSON.parse(o) : null, stringify: JSON.stringify }, co = { store: new St(), namespace: "", serializer: hn, debounceMs: 0, crossTabSync: !1, notify: () => {
1243
1272
  }, subscribeKey: () => () => {
1244
1273
  } };
1245
- function ri(o, t, e = so) {
1246
- const { store: n, namespace: i, serializer: r, debounceMs: c, subscribeKey: u } = Fe(on) || ro, l = e.serializer ?? r ?? rn, s = I(() => `${i}:${o}`, [i, o]), a = O(null), h = `${s}::v`, [d, f] = V(() => {
1274
+ function sr(o, e, t = uo) {
1275
+ const { store: n, namespace: r, serializer: i, debounceMs: a, subscribeKey: u } = Yt(un) || co, l = t.serializer ?? i ?? hn, s = K(() => `${r}:${o}`, [r, o]), c = I(null), h = `${s}::v`, [d, f] = Y(() => {
1247
1276
  let p;
1248
1277
  try {
1249
- if (typeof window < "u" && "localStorage" in window && s.startsWith(i)) {
1250
- const b = window.localStorage?.getItem(s) ?? null;
1251
- b != null && (p = l.parse(b));
1278
+ if (typeof window < "u" && "localStorage" in window && s.startsWith(r)) {
1279
+ const x = window.localStorage?.getItem(s) ?? null;
1280
+ x != null && (p = l.parse(x));
1252
1281
  }
1253
1282
  } catch {
1254
1283
  }
1255
1284
  if (p === void 0) {
1256
- const b = t;
1257
- return typeof b == "function" ? b() : b;
1285
+ const x = e;
1286
+ return typeof x == "function" ? x() : x;
1258
1287
  }
1259
1288
  return p;
1260
1289
  });
1261
- $(() => {
1290
+ H(() => {
1262
1291
  let p = !0;
1263
1292
  return (async () => {
1264
- const [b, M] = await Promise.all([n.getItem(s), n.getItem(h)]);
1265
- let m;
1293
+ const [x, T] = await Promise.all([n.getItem(s), n.getItem(h)]);
1294
+ let _;
1266
1295
  try {
1267
- m = b == null ? void 0 : l.parse(b);
1296
+ _ = x == null ? void 0 : l.parse(x);
1268
1297
  } catch {
1269
1298
  }
1270
- const v = M == null ? void 0 : Number.parseInt(M, 10);
1271
- m === void 0 ? !e.lazy && t !== void 0 && (m = typeof t == "function" ? t() : t, await n.setItem(s, l.stringify(m)), e.version != null && await n.setItem(h, String(e.version))) : e.version != null && v !== void 0 && v !== e.version && e.migrate && (m = e.migrate(m, v), await n.setItem(s, l.stringify(m)), await n.setItem(h, String(e.version))), p && m !== void 0 && f(m);
1299
+ const w = T == null ? void 0 : Number.parseInt(T, 10);
1300
+ _ === void 0 ? !t.lazy && e !== void 0 && (_ = typeof e == "function" ? e() : e, await n.setItem(s, l.stringify(_)), t.version != null && await n.setItem(h, String(t.version))) : t.version != null && w !== void 0 && w !== t.version && t.migrate && (_ = t.migrate(_, w), await n.setItem(s, l.stringify(_)), await n.setItem(h, String(t.version))), p && _ !== void 0 && f(_);
1272
1301
  })(), () => {
1273
1302
  p = !1;
1274
1303
  };
1275
- }, [n, s, h, e.version, e.migrate, e.lazy]), $(() => u(o, async () => {
1304
+ }, [n, s, h, t.version, t.migrate, t.lazy]), H(() => u(o, async () => {
1276
1305
  const p = await n.getItem(s);
1277
1306
  if (p != null) try {
1278
1307
  f(l.parse(p));
1279
1308
  } catch {
1280
1309
  }
1281
1310
  }), [n, s, u, o]);
1282
- const _ = async (p) => {
1283
- await n.setItem(s, l.stringify(p)), e.version != null && await n.setItem(h, String(e.version));
1311
+ const m = async (p) => {
1312
+ await n.setItem(s, l.stringify(p)), t.version != null && await n.setItem(h, String(t.version));
1284
1313
  };
1285
1314
  return [d, (p) => {
1286
- f((b) => {
1287
- const M = typeof p == "function" ? p(b) : p;
1288
- return a.current && clearTimeout(a.current), c > 0 ? a.current = setTimeout(() => {
1289
- _(M);
1290
- }, c) : _(M), M;
1315
+ f((x) => {
1316
+ const T = typeof p == "function" ? p(x) : p;
1317
+ return c.current && clearTimeout(c.current), a > 0 ? c.current = setTimeout(() => {
1318
+ m(T);
1319
+ }, a) : m(T), T;
1291
1320
  });
1292
1321
  }, () => {
1293
- if (a.current && clearTimeout(a.current), n.removeItem(s), n.removeItem(h), t !== void 0) {
1294
- const p = typeof t == "function" ? t() : t;
1322
+ if (c.current && clearTimeout(c.current), n.removeItem(s), n.removeItem(h), e !== void 0) {
1323
+ const p = typeof e == "function" ? e() : e;
1295
1324
  f(p);
1296
1325
  } else f(void 0);
1297
1326
  }];
1298
1327
  }
1299
- const so = {};
1300
- function si(o) {
1301
- const { store: t, namespace: e = "", serializer: n = lo, debounceMs: i = 0, crossTabSync: r = !0, children: c } = o, u = I(() => typeof window > "u" ? new _e() : t ?? new _e(), [t]), l = O(/* @__PURE__ */ new Map()), s = I(() => ({ store: u, namespace: e, serializer: n, debounceMs: i, crossTabSync: r, notify(a) {
1302
- const h = l.current.get(a);
1328
+ const uo = {};
1329
+ function lr(o) {
1330
+ const { store: e, namespace: t = "", serializer: n = ho, debounceMs: r = 0, crossTabSync: i = !0, children: a } = o, u = K(() => typeof window > "u" ? new St() : e ?? new St(), [e]), l = I(/* @__PURE__ */ new Map()), s = K(() => ({ store: u, namespace: t, serializer: n, debounceMs: r, crossTabSync: i, notify(c) {
1331
+ const h = l.current.get(c);
1303
1332
  h && h.forEach((d) => d());
1304
- }, subscribeKey(a, h) {
1305
- const d = l.current, f = d.get(a) ?? /* @__PURE__ */ new Set();
1306
- return f.add(h), d.set(a, f), () => {
1307
- const _ = d.get(a);
1308
- _ && (_.delete(h), _.size === 0 && d.delete(a));
1333
+ }, subscribeKey(c, h) {
1334
+ const d = l.current, f = d.get(c) ?? /* @__PURE__ */ new Set();
1335
+ return f.add(h), d.set(c, f), () => {
1336
+ const m = d.get(c);
1337
+ m && (m.delete(h), m.size === 0 && d.delete(c));
1309
1338
  };
1310
- } }), [u, e, n, i, r]);
1311
- return $(() => {
1312
- if (s.crossTabSync && s.store.subscribe) return s.store.subscribe((a) => {
1313
- if (!a.startsWith(s.namespace + ":")) return;
1314
- const h = a.slice(s.namespace.length + 1);
1339
+ } }), [u, t, n, r, i]);
1340
+ return H(() => {
1341
+ if (s.crossTabSync && s.store.subscribe) return s.store.subscribe((c) => {
1342
+ if (!c.startsWith(s.namespace + ":")) return;
1343
+ const h = c.slice(s.namespace.length + 1);
1315
1344
  s.notify(h);
1316
1345
  });
1317
- }, [s]), T(on.Provider, { value: s, children: c });
1346
+ }, [s]), P(un.Provider, { value: s, children: a });
1318
1347
  }
1319
- const lo = { parse: (o) => o == null ? null : JSON.parse(o), stringify: JSON.stringify };
1320
- class li {
1321
- constructor(t = window.localStorage) {
1322
- this.storage = t;
1348
+ const ho = { parse: (o) => o == null ? null : JSON.parse(o), stringify: JSON.stringify };
1349
+ class ar {
1350
+ constructor(e = window.localStorage) {
1351
+ this.storage = e;
1323
1352
  }
1324
- async getItem(t) {
1353
+ async getItem(e) {
1325
1354
  try {
1326
- return this.storage.getItem(t);
1355
+ return this.storage.getItem(e);
1327
1356
  } catch {
1328
1357
  return null;
1329
1358
  }
1330
1359
  }
1331
- async setItem(t, e) {
1360
+ async setItem(e, t) {
1332
1361
  try {
1333
- this.storage.setItem(t, e);
1362
+ this.storage.setItem(e, t);
1334
1363
  } catch {
1335
1364
  }
1336
1365
  }
1337
- async removeItem(t) {
1366
+ async removeItem(e) {
1338
1367
  try {
1339
- this.storage.removeItem(t);
1368
+ this.storage.removeItem(e);
1340
1369
  } catch {
1341
1370
  }
1342
1371
  }
1343
- subscribe(t) {
1344
- const e = (n) => {
1345
- n.storageArea === this.storage && n.key && t(n.key);
1372
+ subscribe(e) {
1373
+ const t = (n) => {
1374
+ n.storageArea === this.storage && n.key && e(n.key);
1346
1375
  };
1347
- return window.addEventListener("storage", e), () => window.removeEventListener("storage", e);
1376
+ return window.addEventListener("storage", t), () => window.removeEventListener("storage", t);
1348
1377
  }
1349
1378
  }
1350
- const at = { Horizontal: "horizontal", Vertical: "vertical" }, ao = "_scrollbar_1v478_17", co = "_vsb-track_1v478_27", uo = "_vsb-thumb_1v478_39", sn = "_scrollbar-button_1v478_80", ln = "M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z", an = "M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z", ho = { transform: "rotate(180deg)" }, po = (o) => {
1351
- const { style: t, orientation: e = at.Vertical, disabled: n, ...i } = o, r = e === at.Vertical ? ln : an;
1352
- return T("button", { style: t, className: lt(sn, e, "scroll-button"), disabled: n, ...i, children: T("svg", { width: "9", height: "9", viewBox: "0 0 9 9", children: T("path", { d: r }) }) });
1353
- }, fo = (o) => {
1354
- const { style: t, orientation: e = at.Vertical, disabled: n, ...i } = o, r = e === at.Vertical ? ln : an;
1355
- return T("button", { style: t, className: lt(sn, e, "scroll-button"), disabled: n, ...i, children: T("svg", { width: "9", height: "9", viewBox: "0 0 9 9", style: ho, children: T("path", { d: r }) }) });
1356
- }, ai = (o) => {
1357
- const { style: t, orientation: e = at.Vertical, ...n } = o, i = e === at.Vertical;
1358
- return T("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...t }, className: `scrollbar-button ${i ? "vertical" : "horizontal"} edge`, ...n, children: T("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: i ? "rotate(90) " : "", children: T("path", { style: { transition: "opacity 240ms ease 0s", opacity: o.disabled ? 0 : 1 }, d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }) }) });
1359
- };
1360
- let Xt = 0;
1361
- function ci() {
1362
- const [o, t] = V(!!document.fullscreenElement), e = W(() => {
1363
- const n = document.fullscreenElement;
1364
- return n ? n.querySelector(".fullscreen-portal-root") || n : document.body;
1365
- }, []);
1366
- return $(() => {
1367
- function n() {
1368
- const i = document.fullscreenElement;
1369
- if (t(!!i), !i) return;
1370
- let r = i.querySelector(".fullscreen-portal-root");
1371
- r || (r = document.createElement("div"), r.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", i.appendChild(r));
1372
- }
1373
- return Xt++, n(), document.addEventListener("fullscreenchange", n), () => {
1374
- document.removeEventListener("fullscreenchange", n), Xt--, Xt <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((i) => {
1375
- i.parentNode && i.parentNode.removeChild(i);
1376
- }), Xt = 0);
1377
- };
1378
- }, []), { getPortalContainer: e, isFullscreen: o };
1379
- }
1380
- const mo = 24, _o = wt(kt((o, t) => {
1381
- const { offset: e = 0, totalSize: n = 0, viewportSize: i = 0, style: r, className: c, orientation: u = at.Vertical, onScrollOffset: l, onScroll: s, showCustomScrollButtons: a = !0, scrollButtonIncrement: h = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: f = 120, minThumbSize: _ = mo, maxThumbSize: p, createScrollStartButton: b = po, createScrollEndButton: M = fo, usePortal: m = !1, ...v } = o;
1382
- P(s, [s]);
1383
- const [y, A] = V({ offset: 0, length: 0 }), E = O(-1), k = u === at.Vertical, [H, { width: S, height: L }] = vt(), z = k ? L : S, C = P((x, K, U) => {
1384
- if (K === 0 || U === 0) return void A({ offset: 0, length: _ });
1385
- const mt = U / z, _t = K / mt, zt = Math.min(Math.max(_, _t), Math.min(z, p ?? Number.MAX_SAFE_INTEGER)), ee = x / mt;
1386
- return { offset: Math.min(Math.max(0, ee), z - zt), length: zt };
1387
- }, [z, _, p]), D = P((x) => {
1388
- const K = n / z, U = Math.round(x * K);
1389
- A(C(U, i, n)), l?.(U, i, n), E.current = x;
1390
- }, [l, i, n, z, y]), g = P((x) => {
1391
- A(C(x, i, n)), l?.(x, i, n), E.current = x;
1392
- }, [l, i, n]);
1393
- $(() => {
1394
- E.current !== e && z !== 0 && (E.current = -1, A(C(e, i, n)));
1395
- }, [e]), $(() => {
1396
- z !== 0 && A(C(e, i, n));
1397
- }, [i, n, k, z]);
1398
- const w = Math.max(0, n - i), [R, G] = V(!1), j = O(0), J = O(0), Z = ve(t, () => ({ isScrollbar: () => !0 }), []), F = P((x) => {
1399
- x.currentTarget.setPointerCapture(x.pointerId), G(!0), j.current = k ? x.clientY : x.clientX, J.current = y.offset, x.preventDefault(), x.stopPropagation();
1400
- }, [k, y]), ot = P((x) => {
1401
- if (!R) return;
1402
- const K = (k ? x.clientY : x.clientX) - j.current, U = J.current + K;
1403
- D(U);
1404
- }, [R, k]), Q = P((x) => {
1379
+ const te = { Horizontal: "horizontal", Vertical: "vertical" }, xe = { scrollbar: "_scrollbar_15caq_24", track: "_track_15caq_34", thumb: "_thumb_15caq_46", "scrollbar-button": "_scrollbar-button_15caq_86", "touch-thumb": "_touch-thumb_15caq_121" }, dn = "M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z", pn = "M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z", po = { transform: "rotate(180deg)" }, fo = (o) => {
1380
+ const { style: e, orientation: t = te.Vertical, disabled: n, ...r } = o, i = t === te.Vertical ? dn : pn;
1381
+ return P("button", { style: e, className: le(xe["scrollbar-button"], t, "scroll-button"), disabled: n, ...r, children: P("svg", { width: "9", height: "9", viewBox: "0 0 9 9", children: P("path", { d: i }) }) });
1382
+ }, mo = (o) => {
1383
+ const { style: e, orientation: t = te.Vertical, disabled: n, ...r } = o, i = t === te.Vertical ? dn : pn;
1384
+ return P("button", { style: e, className: le(xe["scrollbar-button"], t, "scroll-button"), disabled: n, ...r, children: P("svg", { width: "9", height: "9", viewBox: "0 0 9 9", style: po, children: P("path", { d: i }) }) });
1385
+ }, cr = (o) => {
1386
+ const { style: e, orientation: t = te.Vertical, ...n } = o, r = t === te.Vertical;
1387
+ return P("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...e }, className: `scrollbar-button ${r ? "vertical" : "horizontal"} edge`, ...n, children: P("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: r ? "rotate(90) " : "", children: P("path", { style: { transition: "opacity 240ms ease 0s", opacity: o.disabled ? 0 : 1 }, d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }) }) });
1388
+ }, _o = $e().supportsTouchEvents, fn = me(Ee((o, e) => {
1389
+ const { borderColor: t = "var(--sxl-app-color-primary, rgb(33, 115, 70))", backgroundColor: n = "var(--sxl-app-color-background, white)", fillColor: r = "var(--sxl-app-color-grey, grey)", borderWidth: i = 3, size: a = 22, style: u, className: l, onPointerDown: s, onPointerMove: c, onPointerUp: h, orientation: d = te.Vertical, offset: f = 0, currentTouchAnchor: m, elementParent: p, elementRoot: x, key: T, ..._ } = o;
1390
+ if (!_o) return null;
1391
+ const w = k(s, [s]), y = k(c, [c]), z = k(h, [h]), E = d === te.Vertical, [B, $] = Y(!1), S = rn(K(() => ({ processTouch: !0, consumeTouch: !0, onPointerDown: (D, F) => {
1392
+ $(!0), w?.(D), D.preventDefault(), D.stopPropagation();
1393
+ }, onPointerMoveOrWait: (D, F, W) => {
1394
+ y?.(D);
1395
+ }, onPointerUp: (D, F, W) => {
1396
+ $(!1), z?.(W), D.preventDefault(), D.stopPropagation();
1397
+ } }), [])), b = K(() => {
1398
+ const D = a / 2 + i / 2 + 6;
1399
+ return { x: E ? -D : f + a, y: E ? f + a : -D, width: 0, height: 0 };
1400
+ }, [E, f, a]), [C, { y: M, x: O }] = Wn(), g = I(null), { getPortalContainer: L, isFullscreen: R } = Vn(), [N, G] = Y(null);
1401
+ return H(() => {
1402
+ const D = g.current?.getBoundingClientRect();
1403
+ if (!D) return void G(null);
1404
+ let F = 0, W = 0, X = p;
1405
+ for (; X; ) F += X.scrollLeft, W += X.scrollTop, X = x && X === x.parentElement ? null : X.parentElement;
1406
+ G(Mn(P("div", { className: le("touch-thumb", xe["touch-thumb"], l, xe, { dragging: B }), ref: e, style: { left: F + (D?.x ?? 0) - (a + i) / 2, top: W + (D?.y ?? 0) - (a + i) / 2, width: E ? a : 1.8 * a, height: E ? 1.8 * a : a, borderWidth: `${i}px`, boxShadow: B ? `${n} 0px 0px 0px 1.5px` : void 0, borderStyle: "solid", borderColor: t, backgroundColor: n, opacity: m ? 0 : void 0, transitionDuration: "160ms", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${r}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center center", ...u }, tabIndex: -1, onPointerDown: S, ..._ }), x ?? L(), T));
1407
+ }, [M, B, t, n, r, O, b?.x, b?.y, b?.width, b?.height, l, m, n, a, i, t, p, R, T]), b ? pe(fe, { children: [P("div", { ref: Ae([C, g]), style: { position: "absolute", left: b.x, top: b.y, opacity: 0 } }), N] }) : null;
1408
+ }));
1409
+ fn.displayName = "TouchThumbHandle";
1410
+ const go = 24, yo = me(Ee((o, e) => {
1411
+ const { offset: t = 0, totalSize: n = 0, viewportSize: r = 0, style: i, className: a, orientation: u = te.Vertical, onScrollOffset: l, onScroll: s, showCustomScrollButtons: c, scrollButtonIncrement: h = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: f = 120, minThumbSize: m = go, maxThumbSize: p, createScrollStartButton: x = fo, createScrollEndButton: T = mo, touchThumbProps: _, thumbProps: w, onMouseDown: y, ...z } = o, E = $e().primaryInput === "touch", B = c ?? !E;
1412
+ k(s, [s]);
1413
+ const [$, S] = Y({ offset: 0, length: 0 }), b = I(-1), C = u === te.Vertical, [M, { width: O, height: g }] = Se(), L = C ? g : O, R = k((v, V, Q) => {
1414
+ if (V === 0 || Q === 0) return void S({ offset: 0, length: m });
1415
+ const ye = Q / L, ke = V / ye, ve = Math.min(Math.max(m, ke), Math.min(L, p ?? Number.MAX_SAFE_INTEGER)), ct = v / ye;
1416
+ return { offset: Math.min(Math.max(0, ct), L - ve), length: ve };
1417
+ }, [L, m, p]), N = k((v) => {
1418
+ const V = n / L, Q = Math.round(v * V);
1419
+ S(R(Q, r, n)), l?.(Q, r, n), b.current = v;
1420
+ }, [l, r, n, L, $]), G = k((v) => {
1421
+ S(R(v, r, n)), l?.(v, r, n), b.current = v;
1422
+ }, [l, r, n]);
1423
+ H(() => {
1424
+ b.current !== t && L !== 0 && (b.current = -1, S(R(t, r, n)));
1425
+ }, [t]), H(() => {
1426
+ L !== 0 && S(R(t, r, n));
1427
+ }, [r, n, C, L]);
1428
+ const D = Math.max(0, n - r), [F, W] = Y(!1), X = I(0), J = I(0), Me = Lt(e, () => ({ isScrollbar: () => !0 }), []), _e = k((v) => {
1429
+ W(!0), X.current = C ? v.clientY : v.clientX, J.current = $.offset;
1430
+ }, [C, $]), Le = k((v) => {
1431
+ v.currentTarget.setPointerCapture(v.pointerId), _e(v), v.stopPropagation();
1432
+ }, [y]), ge = k((v) => {
1433
+ if (!F) return;
1434
+ const V = (C ? v.clientY : v.clientX) - X.current, Q = J.current + V;
1435
+ N(Q);
1436
+ }, [F, C]), st = k((v) => {
1437
+ ge(v);
1438
+ }, []), Re = k((v) => {
1439
+ W(!1);
1440
+ }, []), lt = k((v) => {
1405
1441
  try {
1406
- x.currentTarget.releasePointerCapture(x.pointerId);
1442
+ v.currentTarget.releasePointerCapture(v.pointerId);
1407
1443
  } catch {
1408
1444
  }
1409
- G(!1);
1410
- }, []), bt = P((x) => {
1411
- if (!x.currentTarget) return;
1412
- const K = x.currentTarget.getBoundingClientRect(), U = k ? x.clientY - K.top : x.clientX - K.left;
1413
- D(U);
1414
- }, [k, y, i, n]), xt = P((x) => {
1415
- const K = Math.max(1, Math.floor(0.9 * i));
1416
- k ? (x.key === "ArrowDown" && D(Math.min(w, e + 1)), x.key === "ArrowUp" && D(Math.max(0, e - 1)), x.key === "PageDown" && D(Math.min(w, e + K)), x.key === "PageUp" && D(Math.max(0, e - K)), x.key === "Home" && D(0), x.key === "End" && D(w)) : (x.key === "ArrowRight" && D(Math.min(w, e + 1)), x.key === "ArrowLeft" && D(Math.max(0, e - 1)), x.key === "PageDown" && D(Math.min(w, e + K)), x.key === "PageUp" && D(Math.max(0, e - K)), x.key === "Home" && D(0), x.key === "End" && D(w));
1417
- }, [k, i, n, e, w]), St = O(null), pt = I(() => T("div", { className: lt(uo), ref: St, role: "slider", "aria-label": k ? "Rows" : "Columns", "aria-orientation": k ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": w, "aria-valuenow": e, tabIndex: 0, style: { position: m ? "fixed" : "relative", [k ? "height" : "width"]: `${y.length}px`, [k ? "width" : "height"]: "100%", transform: k ? `translateY(${y.offset}px)` : `translateX(${y.offset}px)`, [k ? "minHeight" : "minWidth"]: `${_}px` }, onPointerDown: F, onPointerMove: ot, onPointerUp: Q }), [y, _, w, e, k, !1]), [Kt, Rt] = V(null), Nt = P(() => {
1418
- let x;
1419
- x = typeof h == "function" ? h(e, i, n) : e - h;
1420
- const K = Math.max(0, x);
1421
- return g(K), Rt(K), K;
1422
- }, [h, e, i, n]), Pt = P(() => {
1423
- let x;
1424
- x = typeof h == "function" ? h(e, i, n) : e + h;
1425
- const K = Math.min(w, x);
1426
- return g(K), Rt(K), K;
1427
- }, [h, e, w, i, n]), ft = O(null), Et = O(null), st = W(() => {
1428
- ft.current && (clearTimeout(ft.current), ft.current = null, Et.current = null);
1429
- }, []), Dt = W((x, K, U, mt = d) => {
1430
- Et.current = x, ft.current = setTimeout(() => {
1431
- const _t = U ? Nt() : Pt();
1432
- _t !== Et.current ? Dt(_t, !1, U, f) : st();
1433
- }, K ? 0 : mt);
1434
- }, [Nt, Pt, st]);
1435
- $(() => () => st(), [st]);
1436
- const Qt = I(() => {
1437
- if (!a) return null;
1438
- const x = { orientation: u, disabled: e <= 0, onMouseUp: st, onMouseLeave: st, onMouseDown: () => Dt(e, !0, !0) };
1439
- return b?.(x);
1440
- }, [a, u, e, Kt]), te = I(() => {
1441
- if (!a) return null;
1442
- const x = { orientation: u, disabled: e >= w, onMouseUp: st, onMouseLeave: st, onMouseDown: () => Dt(e, !0, !1) };
1443
- return M?.(x);
1444
- }, [a, u, e, w, Kt]), At = k ? "vertical" : "horizontal";
1445
- return Mt("div", { ref: It([Z, t]), className: lt(c, ao, At, { dragging: R }), style: r, ...v, children: [Qt, T("div", { ref: H, role: "scrollbar", "aria-orientation": At, "aria-valuemin": 0, "aria-valuemax": w, "aria-valuenow": e, tabIndex: 0, className: lt(co, "track", At), onPointerDown: bt, onKeyDown: xt, children: m ? null : pt }), m ? xn(pt, document.body) : null, te] });
1445
+ Re(v);
1446
+ }, []), Ne = k((v) => {
1447
+ if (!v.currentTarget) return;
1448
+ const V = v.currentTarget.getBoundingClientRect(), Q = C ? v.clientY - V.top : v.clientX - V.left;
1449
+ N(Q);
1450
+ }, [C, $, r, n]), He = k((v) => {
1451
+ const V = Math.max(1, Math.floor(0.9 * r));
1452
+ C ? (v.key === "ArrowDown" && N(Math.min(D, t + 1)), v.key === "ArrowUp" && N(Math.max(0, t - 1)), v.key === "PageDown" && N(Math.min(D, t + V)), v.key === "PageUp" && N(Math.max(0, t - V)), v.key === "Home" && N(0), v.key === "End" && N(D)) : (v.key === "ArrowRight" && N(Math.min(D, t + 1)), v.key === "ArrowLeft" && N(Math.max(0, t - 1)), v.key === "PageDown" && N(Math.min(D, t + V)), v.key === "PageUp" && N(Math.max(0, t - V)), v.key === "Home" && N(0), v.key === "End" && N(D));
1453
+ }, [C, r, n, t, D]), We = I(null), at = K(() => {
1454
+ const v = P("div", { ...w, className: le(xe.thumb), ref: We, role: "slider", "aria-label": C ? "Rows" : "Columns", "aria-orientation": C ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": D, "aria-valuenow": t, tabIndex: 0, style: { ...w?.style, position: "relative", [C ? "height" : "width"]: `${$.length}px`, [C ? "width" : "height"]: "100%", transform: C ? `translateY(${$.offset}px)` : `translateX(${$.offset}px)`, [C ? "minHeight" : "minWidth"]: `${m}px` }, onMouseDown: y, onPointerDown: Le, onPointerMove: st, onPointerUp: lt });
1455
+ return E ? pe(fe, { children: [v, P(fn, { ..._, offset: $.offset, orientation: C ? te.Vertical : te.Horizontal, onPointerDown: _e, onPointerMove: ge, onPointerUp: Re })] }) : v;
1456
+ }, [$, m, D, t, C, E, y, _, w]), [Ve, Fe] = Y(null), je = k(() => {
1457
+ let v;
1458
+ v = typeof h == "function" ? h(t, r, n) : t - h;
1459
+ const V = Math.max(0, v);
1460
+ return G(V), Fe(V), V;
1461
+ }, [h, t, r, n]), Ue = k(() => {
1462
+ let v;
1463
+ v = typeof h == "function" ? h(t, r, n) : t + h;
1464
+ const V = Math.min(D, v);
1465
+ return G(V), Fe(V), V;
1466
+ }, [h, t, D, r, n]), Ce = I(null), ze = I(null), ie = U(() => {
1467
+ Ce.current && (clearTimeout(Ce.current), Ce.current = null, ze.current = null);
1468
+ }, []), Te = U((v, V, Q, ye = d) => {
1469
+ ze.current = v, Ce.current = setTimeout(() => {
1470
+ const ke = Q ? je() : Ue();
1471
+ ke !== ze.current ? Te(ke, !1, Q, f) : ie();
1472
+ }, V ? 0 : ye);
1473
+ }, [je, Ue, ie]);
1474
+ H(() => () => ie(), [ie]);
1475
+ const Xe = K(() => {
1476
+ if (!B) return null;
1477
+ const v = { orientation: u, disabled: t <= 0, onMouseUp: ie, onMouseLeave: ie, onMouseDown: () => Te(t, !0, !0) };
1478
+ return x?.(v);
1479
+ }, [B, u, t, Ve]), Ye = K(() => {
1480
+ if (!B) return null;
1481
+ const v = { orientation: u, disabled: t >= D, onMouseUp: ie, onMouseLeave: ie, onMouseDown: () => Te(t, !0, !1) };
1482
+ return T?.(v);
1483
+ }, [B, u, t, D, Ve]), Be = C ? "vertical" : "horizontal";
1484
+ return pe("div", { ref: Ae([Me, e]), className: le(a, xe.scrollbar, Be, { dragging: F, "has-touch-thumb": E }), style: i, ...z, children: [Xe, P("div", { ref: M, role: "scrollbar", "aria-orientation": Be, "aria-valuemin": 0, "aria-valuemax": D, "aria-valuenow": t, tabIndex: 0, className: le(xe.track, "track", Be), onMouseDown: y, onPointerDown: Ne, onKeyDown: He, children: at }), Ye] });
1446
1485
  }));
1447
- let Ke = Date.now, Re = 1e3, dt = {}, go = 1;
1448
- const Ot = (o) => {
1449
- let t = dt[o] !== null;
1450
- return t && (dt[o] = null), t;
1451
- }, Ne = (o, t, e, n = 0, i) => {
1452
- let r = Ke(), c = r, u = 0, l = 0, s = 0, a = go++;
1453
- if (a % 20 == 0) {
1486
+ let Vt = Date.now, Ft = 1e3, de = {}, vo = 1;
1487
+ const Ie = (o) => {
1488
+ let e = de[o] !== null;
1489
+ return e && (de[o] = null), e;
1490
+ }, jt = (o, e, t, n = 0, r) => {
1491
+ let i = Vt(), a = i, u = 0, l = 0, s = 0, c = vo++;
1492
+ if (c % 20 == 0) {
1454
1493
  const d = {};
1455
- for (let f in dt) d[f] = !0;
1456
- dt = d;
1494
+ for (let f in de) d[f] = !0;
1495
+ de = d;
1457
1496
  }
1458
1497
  const h = function(d) {
1459
- let f = d !== !0, _ = Ke(), p = !0;
1498
+ let f = d !== !0, m = Vt(), p = !0;
1460
1499
  try {
1461
- p = (!t || t(a)) ?? !0;
1500
+ p = (!e || e(c)) ?? !0;
1462
1501
  } catch {
1463
1502
  p = !1;
1464
1503
  }
1465
- if (!dt[a] || !p) return dt[a] = null, void e?.(60 - l / ((_ - r) / Re), a, !1);
1504
+ if (!de[c] || !p) return de[c] = null, void t?.(60 - l / ((m - i) / Ft), c, !1);
1466
1505
  if (f) {
1467
- s = Math.round((_ - c) / 16.666666666666668) - 1;
1468
- for (let m = 0; m < Math.min(s, 4); m++) h(!0), l++;
1506
+ s = Math.round((m - a) / 16.666666666666668) - 1;
1507
+ for (let _ = 0; _ < Math.min(s, 4); _++) h(!0), l++;
1469
1508
  }
1470
- n && (u = (_ - r) / n, u > 1 && (u = 1));
1471
- let b = i ? i(u) : u, M = !1;
1509
+ n && (u = (m - i) / n, u > 1 && (u = 1));
1510
+ let x = r ? r(u) : u, T = !1;
1472
1511
  try {
1473
- M = o(b, _, f);
1512
+ T = o(x, m, f);
1474
1513
  } catch {
1475
- M = !1;
1514
+ T = !1;
1476
1515
  }
1477
- M !== !1 && u !== 1 || !f ? f && (c = _, requestAnimationFrame(h)) : (dt[a] = null, e?.(60 - l / ((_ - r) / Re), a, u === 1 || n == null));
1516
+ T !== !1 && u !== 1 || !f ? f && (a = m, requestAnimationFrame(h)) : (de[c] = null, t?.(60 - l / ((m - i) / Ft), c, u === 1 || n == null));
1478
1517
  };
1479
- return dt[a] = !0, requestAnimationFrame(h), a;
1480
- }, yo = function(o) {
1518
+ return de[c] = !0, requestAnimationFrame(h), c;
1519
+ }, wo = function(o) {
1481
1520
  return Math.pow(o - 1, 3) + 1;
1482
- }, vo = function(o) {
1521
+ }, bo = function(o) {
1483
1522
  return (o /= 0.5) < 1 ? 0.5 * Math.pow(o, 3) : 0.5 * (Math.pow(o - 2, 3) + 2);
1484
1523
  };
1485
- class wo {
1486
- constructor(t, e) {
1487
- this.__isSingleTouch = !1, this.__isTracking = !1, this.__didDecelerationComplete = !1, this.__isGesturing = !1, this.__isDragging = !1, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = !1, this.__lastScale = 1, this.__enableScrollX = !0, this.__enableScrollY = !0, this.__clientLeft = 0, this.__clientTop = 0, this.__clientWidth = 0, this.__clientHeight = 0, this.__contentWidth = 0, this.__contentHeight = 0, this.__snapWidth = 100, this.__snapHeight = 100, this.__zoomLevel = 1, this.__scrollLeft = 0, this.__scrollTop = 0, this.__maxScrollLeft = 0, this.__maxScrollTop = 0, this.__scheduledLeft = 0, this.__scheduledTop = 0, this.__scheduledZoom = 0, this.__lastTouchLeft = 0, this.__lastTouchTop = 0, this.__lastTouchMove = 0, this.__positions = [], this.__initialTouchLeft = 0, this.__initialTouchTop = 0, this.__zoomLevelStart = 1, this.__minDecelerationScrollLeft = null, this.__minDecelerationScrollTop = null, this.__maxDecelerationScrollLeft = null, this.__maxDecelerationScrollTop = null, this.__decelerationVelocityX = null, this.__decelerationVelocityY = 0, this.__callback = t, this.options = { scrollingX: !0, scrollingY: !0, animating: !0, animationDuration: 250, bouncing: !0, locking: !0, paging: !1, snapping: !1, zooming: !1, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: void 0, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08, ...e };
1524
+ class xo {
1525
+ constructor(e, t) {
1526
+ this.__isSingleTouch = !1, this.__isTracking = !1, this.__didDecelerationComplete = !1, this.__isGesturing = !1, this.__isDragging = !1, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = !1, this.__lastScale = 1, this.__enableScrollX = !0, this.__enableScrollY = !0, this.__clientLeft = 0, this.__clientTop = 0, this.__clientWidth = 0, this.__clientHeight = 0, this.__contentWidth = 0, this.__contentHeight = 0, this.__snapWidth = 100, this.__snapHeight = 100, this.__zoomLevel = 1, this.__scrollLeft = 0, this.__scrollTop = 0, this.__maxScrollLeft = 0, this.__maxScrollTop = 0, this.__scheduledLeft = 0, this.__scheduledTop = 0, this.__scheduledZoom = 0, this.__lastTouchLeft = 0, this.__lastTouchTop = 0, this.__lastTouchMove = 0, this.__positions = [], this.__initialTouchLeft = 0, this.__initialTouchTop = 0, this.__zoomLevelStart = 1, this.__minDecelerationScrollLeft = null, this.__minDecelerationScrollTop = null, this.__maxDecelerationScrollLeft = null, this.__maxDecelerationScrollTop = null, this.__decelerationVelocityX = null, this.__decelerationVelocityY = 0, this.__callback = e, this.options = { scrollingX: !0, scrollingY: !0, animating: !0, animationDuration: 250, bouncing: !0, locking: !0, paging: !1, snapping: !1, zooming: !1, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: void 0, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08, ...t };
1488
1527
  }
1489
- setDimensions(t, e, n, i) {
1490
- t !== null && (this.__clientWidth = t), e !== null && (this.__clientHeight = e), n !== null && (this.__contentWidth = n), i !== null && (this.__contentHeight = i), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, !0);
1528
+ setDimensions(e, t, n, r) {
1529
+ e !== null && (this.__clientWidth = e), t !== null && (this.__clientHeight = t), n !== null && (this.__contentWidth = n), r !== null && (this.__contentHeight = r), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, !0);
1491
1530
  }
1492
- setPosition(t, e) {
1493
- this.__clientLeft = t || 0, this.__clientTop = e || 0;
1531
+ setPosition(e, t) {
1532
+ this.__clientLeft = e || 0, this.__clientTop = t || 0;
1494
1533
  }
1495
- setSnapSize(t, e) {
1496
- this.__snapWidth = t, this.__snapHeight = e;
1534
+ setSnapSize(e, t) {
1535
+ this.__snapWidth = e, this.__snapHeight = t;
1497
1536
  }
1498
1537
  getValues() {
1499
1538
  return { left: this.__scrollLeft, top: this.__scrollTop, right: this.__scrollLeft + this.__clientWidth / this.__zoomLevel, bottom: this.__scrollTop + this.__clientHeight / this.__zoomLevel, zoom: this.__zoomLevel };
1500
1539
  }
1501
- getPoint(t, e) {
1540
+ getPoint(e, t) {
1502
1541
  const n = this.getValues();
1503
- return { left: t / n.zoom, top: e / n.zoom };
1542
+ return { left: e / n.zoom, top: t / n.zoom };
1504
1543
  }
1505
1544
  getScrollMax() {
1506
1545
  return { left: this.__maxScrollLeft, top: this.__maxScrollTop };
1507
1546
  }
1508
- zoomTo(t, e = !1, n, i, r) {
1547
+ zoomTo(e, t = !1, n, r, i) {
1509
1548
  if (!this.options.zooming) throw new Error("Zooming is not enabled!");
1510
- r && (this.__zoomComplete = r), this.__isDecelerating && (Ot(this.__isDecelerating), this.__isDecelerating = 0);
1511
- const c = this.__zoomLevel;
1512
- n === void 0 && (n = this.__clientWidth / 2), i === void 0 && (i = this.__clientHeight / 2), t = Math.max(Math.min(t, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(t);
1513
- const u = t / c;
1514
- let l = u * (this.__scrollLeft + n) - n, s = u * (this.__scrollTop + i) - i;
1515
- l > this.__maxScrollLeft ? l = this.__maxScrollLeft : l < 0 && (l = 0), s > this.__maxScrollTop ? s = this.__maxScrollTop : s < 0 && (s = 0), this.__publish(l, s, t, e);
1516
- }
1517
- zoomBy(t, e = !1, n = 0, i = 0, r) {
1518
- this.zoomTo(this.__zoomLevel * t, e, n, i, r);
1519
- }
1520
- scrollTo(t, e, n = !1, i = 1) {
1521
- if (this.__isDecelerating && (Ot(this.__isDecelerating), this.__isDecelerating = 0), i !== void 0 && i !== this.__zoomLevel) {
1549
+ i && (this.__zoomComplete = i), this.__isDecelerating && (Ie(this.__isDecelerating), this.__isDecelerating = 0);
1550
+ const a = this.__zoomLevel;
1551
+ n === void 0 && (n = this.__clientWidth / 2), r === void 0 && (r = this.__clientHeight / 2), e = Math.max(Math.min(e, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(e);
1552
+ const u = e / a;
1553
+ let l = u * (this.__scrollLeft + n) - n, s = u * (this.__scrollTop + r) - r;
1554
+ l > this.__maxScrollLeft ? l = this.__maxScrollLeft : l < 0 && (l = 0), s > this.__maxScrollTop ? s = this.__maxScrollTop : s < 0 && (s = 0), this.__publish(l, s, e, t);
1555
+ }
1556
+ zoomBy(e, t = !1, n = 0, r = 0, i) {
1557
+ this.zoomTo(this.__zoomLevel * e, t, n, r, i);
1558
+ }
1559
+ scrollTo(e, t, n = !1, r = 1) {
1560
+ if (this.__isDecelerating && (Ie(this.__isDecelerating), this.__isDecelerating = 0), r !== void 0 && r !== this.__zoomLevel) {
1522
1561
  if (!this.options.zooming) throw new Error("Zooming is not enabled!");
1523
- t *= i, e *= i, this.__computeScrollMax(i);
1524
- } else i = this.__zoomLevel;
1525
- this.options.scrollingX ? this.options.paging ? t = Math.round(t / this.__clientWidth) * this.__clientWidth : this.options.snapping && (t = Math.round(t / this.__snapWidth) * this.__snapWidth) : t = this.__scrollLeft, this.options.scrollingY ? this.options.paging ? e = Math.round(e / this.__clientHeight) * this.__clientHeight : this.options.snapping && (e = Math.round(e / this.__snapHeight) * this.__snapHeight) : e = this.__scrollTop, t = Math.max(Math.min(this.__maxScrollLeft, t), 0), e = Math.max(Math.min(this.__maxScrollTop, e), 0), t === this.__scrollLeft && e === this.__scrollTop && (n = !1), this.__publish(t, e, i, n);
1562
+ e *= r, t *= r, this.__computeScrollMax(r);
1563
+ } else r = this.__zoomLevel;
1564
+ this.options.scrollingX ? this.options.paging ? e = Math.round(e / this.__clientWidth) * this.__clientWidth : this.options.snapping && (e = Math.round(e / this.__snapWidth) * this.__snapWidth) : e = this.__scrollLeft, this.options.scrollingY ? this.options.paging ? t = Math.round(t / this.__clientHeight) * this.__clientHeight : this.options.snapping && (t = Math.round(t / this.__snapHeight) * this.__snapHeight) : t = this.__scrollTop, e = Math.max(Math.min(this.__maxScrollLeft, e), 0), t = Math.max(Math.min(this.__maxScrollTop, t), 0), e === this.__scrollLeft && t === this.__scrollTop && (n = !1), this.__publish(e, t, r, n);
1526
1565
  }
1527
- scrollBy(t = 0, e = 0, n = !1) {
1528
- const i = this.__isAnimating ? this.__scheduledLeft : this.__scrollLeft, r = this.__isAnimating ? this.__scheduledTop : this.__scrollTop;
1529
- this.scrollTo(i + (t || 0), r + (e || 0), n);
1566
+ scrollBy(e = 0, t = 0, n = !1) {
1567
+ const r = this.__isAnimating ? this.__scheduledLeft : this.__scrollLeft, i = this.__isAnimating ? this.__scheduledTop : this.__scrollTop;
1568
+ this.scrollTo(r + (e || 0), i + (t || 0), n);
1530
1569
  }
1531
- doMouseZoom(t, e, n, i) {
1532
- const r = t > 0 ? 0.97 : 1.03;
1533
- return this.zoomTo(this.__zoomLevel * r, !1, n - this.__clientLeft, i - this.__clientTop);
1570
+ doMouseZoom(e, t, n, r) {
1571
+ const i = e > 0 ? 0.97 : 1.03;
1572
+ return this.zoomTo(this.__zoomLevel * i, !1, n - this.__clientLeft, r - this.__clientTop);
1534
1573
  }
1535
- doTouchStart(t, e) {
1536
- if (t.length === void 0) throw new Error("Invalid touch list: " + t);
1537
- if (e instanceof Date && (e = e.valueOf()), typeof e != "number") throw new Error("Invalid timestamp value: " + e);
1538
- let n, i;
1539
- this.__interruptedAnimation = !0, this.__isDecelerating && (Ot(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = !0), this.__isAnimating && (Ot(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = !0);
1540
- let r = t.length === 1;
1541
- r ? (n = t[0].pageX, i = t[0].pageY) : (n = Math.abs(t[0].pageX + t[1].pageX) / 2, i = Math.abs(t[0].pageY + t[1].pageY) / 2), this.__initialTouchLeft = n, this.__initialTouchTop = i, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n, this.__lastTouchTop = i, this.__lastTouchMove = e, this.__lastScale = 1, this.__enableScrollX = !r && this.options.scrollingX, this.__enableScrollY = !r && this.options.scrollingY, this.__isTracking = !0, this.__didDecelerationComplete = !1, this.__isDragging = !r, this.__isSingleTouch = r, this.__positions = [];
1574
+ doTouchStart(e, t) {
1575
+ if (e.length === void 0) throw new Error("Invalid touch list: " + e);
1576
+ if (t instanceof Date && (t = t.valueOf()), typeof t != "number") throw new Error("Invalid timestamp value: " + t);
1577
+ let n, r;
1578
+ this.__interruptedAnimation = !0, this.__isDecelerating && (Ie(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = !0), this.__isAnimating && (Ie(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = !0);
1579
+ let i = e.length === 1;
1580
+ i ? (n = e[0].pageX, r = e[0].pageY) : (n = Math.abs(e[0].pageX + e[1].pageX) / 2, r = Math.abs(e[0].pageY + e[1].pageY) / 2), this.__initialTouchLeft = n, this.__initialTouchTop = r, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n, this.__lastTouchTop = r, this.__lastTouchMove = t, this.__lastScale = 1, this.__enableScrollX = !i && this.options.scrollingX, this.__enableScrollY = !i && this.options.scrollingY, this.__isTracking = !0, this.__didDecelerationComplete = !1, this.__isDragging = !i, this.__isSingleTouch = i, this.__positions = [];
1542
1581
  }
1543
- doTouchMove(t, e, n = 1) {
1544
- if (t.length === void 0) throw new Error("Invalid touch list: " + t);
1545
- if (e instanceof Date && (e = e.valueOf()), typeof e != "number") throw new Error("Invalid timestamp value: " + e);
1582
+ doTouchMove(e, t, n = 1) {
1583
+ if (e.length === void 0) throw new Error("Invalid touch list: " + e);
1584
+ if (t instanceof Date && (t = t.valueOf()), typeof t != "number") throw new Error("Invalid timestamp value: " + t);
1546
1585
  if (!this.__isTracking) return;
1547
- let i, r;
1548
- t.length === 2 ? (i = Math.abs(t[0].pageX + t[1].pageX) / 2, r = Math.abs(t[0].pageY + t[1].pageY) / 2) : (i = t[0].pageX, r = t[0].pageY);
1549
- let c = this.__positions;
1586
+ let r, i;
1587
+ e.length === 2 ? (r = Math.abs(e[0].pageX + e[1].pageX) / 2, i = Math.abs(e[0].pageY + e[1].pageY) / 2) : (r = e[0].pageX, i = e[0].pageY);
1588
+ let a = this.__positions;
1550
1589
  if (this.__isDragging) {
1551
- let u = i - this.__lastTouchLeft, l = r - this.__lastTouchTop, s = this.__scrollLeft, a = this.__scrollTop, h = this.__zoomLevel;
1590
+ let u = r - this.__lastTouchLeft, l = i - this.__lastTouchTop, s = this.__scrollLeft, c = this.__scrollTop, h = this.__zoomLevel;
1552
1591
  if (n !== void 0 && this.options.zooming) {
1553
1592
  let d = h;
1554
1593
  if (h = h / this.__lastScale * n, h = Math.max(Math.min(h, this.options.maxZoom), this.options.minZoom), d !== h) {
1555
- let f = i - this.__clientLeft, _ = r - this.__clientTop;
1556
- s = (f + s) * h / d - f, a = (_ + a) * h / d - _, this.__computeScrollMax(h);
1594
+ let f = r - this.__clientLeft, m = i - this.__clientTop;
1595
+ s = (f + s) * h / d - f, c = (m + c) * h / d - m, this.__computeScrollMax(h);
1557
1596
  }
1558
1597
  }
1559
1598
  if (this.__enableScrollX) {
@@ -1562,206 +1601,206 @@ class wo {
1562
1601
  (s > d || s < 0) && (this.options.bouncing ? s += u / 2 * this.options.speedMultiplier : s = s > d ? d : 0);
1563
1602
  }
1564
1603
  if (this.__enableScrollY) {
1565
- a -= l * this.options.speedMultiplier;
1604
+ c -= l * this.options.speedMultiplier;
1566
1605
  const d = this.__maxScrollTop;
1567
- (a > d || a < 0) && (this.options.bouncing ? a += l / 2 * this.options.speedMultiplier : a = a > d ? d : 0);
1606
+ (c > d || c < 0) && (this.options.bouncing ? c += l / 2 * this.options.speedMultiplier : c = c > d ? d : 0);
1568
1607
  }
1569
- c.length > 60 && c.splice(0, 30), c.push(s, a, e), this.__publish(s, a, h);
1608
+ a.length > 60 && a.splice(0, 30), a.push(s, c, t), this.__publish(s, c, h);
1570
1609
  } else {
1571
- let u = this.options.locking ? 3 : 0, l = 5, s = Math.abs(i - this.__initialTouchLeft), a = Math.abs(r - this.__initialTouchTop);
1572
- this.__enableScrollX = this.options.scrollingX && s >= u, this.__enableScrollY = this.options.scrollingY && a >= u, c.push(this.__scrollLeft, this.__scrollTop, e), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (s >= l || a >= l), this.__isDragging && (this.__interruptedAnimation = !1);
1610
+ let u = this.options.locking ? 3 : 0, l = 5, s = Math.abs(r - this.__initialTouchLeft), c = Math.abs(i - this.__initialTouchTop);
1611
+ this.__enableScrollX = this.options.scrollingX && s >= u, this.__enableScrollY = this.options.scrollingY && c >= u, a.push(this.__scrollLeft, this.__scrollTop, t), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (s >= l || c >= l), this.__isDragging && (this.__interruptedAnimation = !1);
1573
1612
  }
1574
- this.__lastTouchLeft = i, this.__lastTouchTop = r, this.__lastTouchMove = e, this.__lastScale = n;
1613
+ this.__lastTouchLeft = r, this.__lastTouchTop = i, this.__lastTouchMove = t, this.__lastScale = n;
1575
1614
  }
1576
- doTouchEnd(t) {
1577
- if (t instanceof Date && (t = t.valueOf()), typeof t != "number") throw new Error("Invalid timestamp value: " + t);
1615
+ doTouchEnd(e) {
1616
+ if (e instanceof Date && (e = e.valueOf()), typeof e != "number") throw new Error("Invalid timestamp value: " + e);
1578
1617
  if (this.__isTracking) {
1579
- if (this.__isTracking = !1, this.__isDragging) if (this.__isDragging = !1, this.__isSingleTouch && this.options.animating && t - this.__lastTouchMove <= 100) {
1580
- let e = this.__positions, n = e.length - 1, i = n;
1581
- for (let r = n; r > 0 && e[r] > this.__lastTouchMove - 100; r -= 3) i = r;
1582
- if (i !== n) {
1583
- const r = e[n] - e[i], c = this.__scrollLeft - e[i - 2], u = this.__scrollTop - e[i - 1];
1584
- this.__decelerationVelocityX = c / r * (1e3 / 60), this.__decelerationVelocityY = u / r * (1e3 / 60);
1618
+ if (this.__isTracking = !1, this.__isDragging) if (this.__isDragging = !1, this.__isSingleTouch && this.options.animating && e - this.__lastTouchMove <= 100) {
1619
+ let t = this.__positions, n = t.length - 1, r = n;
1620
+ for (let i = n; i > 0 && t[i] > this.__lastTouchMove - 100; i -= 3) r = i;
1621
+ if (r !== n) {
1622
+ const i = t[n] - t[r], a = this.__scrollLeft - t[r - 2], u = this.__scrollTop - t[r - 1];
1623
+ this.__decelerationVelocityX = a / i * (1e3 / 60), this.__decelerationVelocityY = u / i * (1e3 / 60);
1585
1624
  const l = this.options.paging || this.options.snapping ? 4 : 1;
1586
- (Math.abs(this.__decelerationVelocityX) > l || Math.abs(this.__decelerationVelocityY) > l) && this.__startDeceleration(t);
1625
+ (Math.abs(this.__decelerationVelocityX) > l || Math.abs(this.__decelerationVelocityY) > l) && this.__startDeceleration(e);
1587
1626
  } else this.options.scrollingComplete?.();
1588
- } else t - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
1627
+ } else e - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
1589
1628
  this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, !0, this.__zoomLevel)), this.__positions.length = 0;
1590
1629
  }
1591
1630
  }
1592
- __publish(t, e, n, i = !1) {
1593
- const r = this.__isAnimating;
1594
- if (r && (Ot(r), this.__isAnimating = 0), i && this.options.animating) {
1595
- this.__scheduledLeft = t, this.__scheduledTop = e, this.__scheduledZoom = n;
1596
- const c = this.__scrollLeft, u = this.__scrollTop, l = this.__zoomLevel, s = t - c, a = e - u, h = n - l, d = function(p, b, M) {
1597
- M && (this.__scrollLeft = c + s * p, this.__scrollTop = u + a * p, this.__zoomLevel = l + h * p, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
1631
+ __publish(e, t, n, r = !1) {
1632
+ const i = this.__isAnimating;
1633
+ if (i && (Ie(i), this.__isAnimating = 0), r && this.options.animating) {
1634
+ this.__scheduledLeft = e, this.__scheduledTop = t, this.__scheduledZoom = n;
1635
+ const a = this.__scrollLeft, u = this.__scrollTop, l = this.__zoomLevel, s = e - a, c = t - u, h = n - l, d = function(p, x, T) {
1636
+ T && (this.__scrollLeft = a + s * p, this.__scrollTop = u + c * p, this.__zoomLevel = l + h * p, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
1598
1637
  }.bind(this), f = function(p) {
1599
1638
  return this.__isAnimating === p;
1600
- }.bind(this), _ = function(p, b, M) {
1601
- b === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete || M) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
1639
+ }.bind(this), m = function(p, x, T) {
1640
+ x === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete || T) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
1602
1641
  }.bind(this);
1603
- this.__isAnimating = Ne(d, f, _, this.options.animationDuration, r ? yo : vo);
1604
- } else this.__scheduledLeft = this.__scrollLeft = t, this.__scheduledTop = this.__scrollTop = e, this.__scheduledZoom = this.__zoomLevel = n, this.__callback && this.__callback(t, e, n), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
1642
+ this.__isAnimating = jt(d, f, m, this.options.animationDuration, i ? wo : bo);
1643
+ } else this.__scheduledLeft = this.__scrollLeft = e, this.__scheduledTop = this.__scrollTop = t, this.__scheduledZoom = this.__zoomLevel = n, this.__callback && this.__callback(e, t, n), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
1605
1644
  }
1606
- __computeScrollMax(t = this.__zoomLevel) {
1607
- this.__maxScrollLeft = Math.max(this.__contentWidth * t - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * t - this.__clientHeight, 0);
1645
+ __computeScrollMax(e = this.__zoomLevel) {
1646
+ this.__maxScrollLeft = Math.max(this.__contentWidth * e - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * e - this.__clientHeight, 0);
1608
1647
  }
1609
- __startDeceleration(t) {
1648
+ __startDeceleration(e) {
1610
1649
  if (this.options.paging) {
1611
- const c = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), u = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), l = this.__clientWidth, s = this.__clientHeight;
1612
- this.__minDecelerationScrollLeft = Math.floor(c / l) * l, this.__minDecelerationScrollTop = Math.floor(u / s) * s, this.__maxDecelerationScrollLeft = Math.ceil(c / l) * l, this.__maxDecelerationScrollTop = Math.ceil(u / s) * s;
1650
+ const a = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), u = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), l = this.__clientWidth, s = this.__clientHeight;
1651
+ this.__minDecelerationScrollLeft = Math.floor(a / l) * l, this.__minDecelerationScrollTop = Math.floor(u / s) * s, this.__maxDecelerationScrollLeft = Math.ceil(a / l) * l, this.__maxDecelerationScrollTop = Math.ceil(u / s) * s;
1613
1652
  } else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
1614
- const e = function(c, u, l) {
1653
+ const t = function(a, u, l) {
1615
1654
  this.__stepThroughDeceleration(l);
1616
- }.bind(this), n = this.options.snapping ? 4 : 0.1, i = function() {
1617
- const c = Math.abs(this.__decelerationVelocityX) >= n || Math.abs(this.__decelerationVelocityY) >= n;
1618
- return c || (this.__didDecelerationComplete = !0), c;
1619
- }.bind(this), r = function(c, u, l) {
1655
+ }.bind(this), n = this.options.snapping ? 4 : 0.1, r = function() {
1656
+ const a = Math.abs(this.__decelerationVelocityX) >= n || Math.abs(this.__decelerationVelocityY) >= n;
1657
+ return a || (this.__didDecelerationComplete = !0), a;
1658
+ }.bind(this), i = function(a, u, l) {
1620
1659
  this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
1621
1660
  }.bind(this);
1622
- this.__isDecelerating = Ne(e, i, r);
1661
+ this.__isDecelerating = jt(t, r, i);
1623
1662
  }
1624
- __stepThroughDeceleration(t) {
1625
- let e = this.__scrollLeft + this.__decelerationVelocityX, n = this.__scrollTop + this.__decelerationVelocityY;
1663
+ __stepThroughDeceleration(e) {
1664
+ let t = this.__scrollLeft + this.__decelerationVelocityX, n = this.__scrollTop + this.__decelerationVelocityY;
1626
1665
  if (!this.options.bouncing) {
1627
- const i = Math.max(Math.min(this.__maxDecelerationScrollLeft, e), this.__minDecelerationScrollLeft);
1628
- i !== e && (e = i, this.__decelerationVelocityX = 0);
1629
- const r = Math.max(Math.min(this.__maxDecelerationScrollTop, n), this.__minDecelerationScrollTop);
1630
- r !== n && (n = r, this.__decelerationVelocityY = 0);
1666
+ const r = Math.max(Math.min(this.__maxDecelerationScrollLeft, t), this.__minDecelerationScrollLeft);
1667
+ r !== t && (t = r, this.__decelerationVelocityX = 0);
1668
+ const i = Math.max(Math.min(this.__maxDecelerationScrollTop, n), this.__minDecelerationScrollTop);
1669
+ i !== n && (n = i, this.__decelerationVelocityY = 0);
1631
1670
  }
1632
- if (t ? this.__publish(e, n, this.__zoomLevel) : (this.__scrollLeft = e, this.__scrollTop = n), !this.options.paging && (this.__decelerationVelocityX *= 0.95, this.__decelerationVelocityY *= 0.95), this.options.bouncing) {
1633
- let i = 0, r = 0, c = this.options.penetrationDeceleration, u = this.options.penetrationAcceleration;
1634
- e < this.__minDecelerationScrollLeft ? i = this.__minDecelerationScrollLeft - e : e > this.__maxDecelerationScrollLeft && (i = this.__maxDecelerationScrollLeft - e), n < this.__minDecelerationScrollTop ? r = this.__minDecelerationScrollTop - n : n > this.__maxDecelerationScrollTop && (r = this.__maxDecelerationScrollTop - n), i !== 0 && (i * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += i * c : this.__decelerationVelocityX = i * u), r !== 0 && (r * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += r * c : this.__decelerationVelocityY = r * u);
1671
+ if (e ? this.__publish(t, n, this.__zoomLevel) : (this.__scrollLeft = t, this.__scrollTop = n), !this.options.paging && (this.__decelerationVelocityX *= 0.95, this.__decelerationVelocityY *= 0.95), this.options.bouncing) {
1672
+ let r = 0, i = 0, a = this.options.penetrationDeceleration, u = this.options.penetrationAcceleration;
1673
+ t < this.__minDecelerationScrollLeft ? r = this.__minDecelerationScrollLeft - t : t > this.__maxDecelerationScrollLeft && (r = this.__maxDecelerationScrollLeft - t), n < this.__minDecelerationScrollTop ? i = this.__minDecelerationScrollTop - n : n > this.__maxDecelerationScrollTop && (i = this.__maxDecelerationScrollTop - n), r !== 0 && (r * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += r * a : this.__decelerationVelocityX = r * u), i !== 0 && (i * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += i * a : this.__decelerationVelocityY = i * u);
1635
1674
  }
1636
1675
  }
1637
1676
  }
1638
- const $t = (o, t) => T(_o, { ...o, ref: t }), ui = Object.freeze(Object.defineProperty({ __proto__: null, defaultCreateScrollbar: $t, getScrollTo: (o, t, e, n, i = 0) => {
1639
- for (let r = 0; r < e.length; r++) {
1640
- const c = e[r].getBoundingClientRect();
1641
- let u = c.left - t, l = u + c.width;
1677
+ const Ke = (o, e) => P(yo, { ...o, ref: e }), ur = Object.freeze(Object.defineProperty({ __proto__: null, defaultCreateScrollbar: Ke, getScrollTo: (o, e, t, n, r = 0) => {
1678
+ for (let i = 0; i < t.length; i++) {
1679
+ const a = t[i].getBoundingClientRect();
1680
+ let u = a.left - e, l = u + a.width;
1642
1681
  if (n) {
1643
1682
  if (u < o && l >= o) return u;
1644
1683
  } else if (Math.ceil(l) > Math.ceil(o) + 2) return l;
1645
1684
  }
1646
- return i;
1647
- } }, Symbol.toStringTag, { value: "Module" })), bo = ({ width: o, height: t }) => T("div", { className: "corner", style: { minWidth: `${o}px`, width: `${o}px`, minHeight: `${t}px`, height: `${t}px` } }), xo = wt(kt((o, t) => {
1648
- const { children: e, viewport: n, onScrollViewport: i, showHorizontalScrollbar: r = !0, showVerticalScrollbar: c = !0, createScrollCorner: u = bo, createHorizontalScrollbar: l = $t, createVerticalScrollbar: s = $t, style: a, touchElement: h, disableTouch: d, ...f } = o, _ = r && l, p = c && s, b = P(i, [i]), M = ve(t, () => ({ isScrollPane: () => !0 }), []), m = O(null);
1649
- $(() => {
1650
- m.current && (m.current.__scrollTop === n?.top && m.current.__scrollLeft === n?.left || m.current.__isDecelerating || m.current?.scrollTo(n?.left, n?.top, !1));
1685
+ return r;
1686
+ } }, Symbol.toStringTag, { value: "Module" })), So = ({ width: o, height: e }) => P("div", { className: "corner", style: { minWidth: `${o}px`, width: `${o}px`, minHeight: `${e}px`, height: `${e}px` } }), Eo = me(Ee((o, e) => {
1687
+ const { children: t, viewport: n, onScrollViewport: r, showHorizontalScrollbar: i = !0, showVerticalScrollbar: a = !0, createScrollCorner: u = So, createHorizontalScrollbar: l = Ke, createVerticalScrollbar: s = Ke, style: c, touchElement: h, disableTouch: d, ...f } = o, m = i && l, p = a && s, x = k(r, [r]), T = Lt(e, () => ({ isScrollPane: () => !0 }), []), _ = I(null);
1688
+ H(() => {
1689
+ _.current && (_.current.__scrollTop === n?.top && _.current.__scrollLeft === n?.left || _.current.__isDecelerating || _.current?.scrollTo(n?.left, n?.top, !1));
1651
1690
  }, [n?.left, n?.top, h]);
1652
- const v = W((g, w) => {
1653
- b?.({ left: g, top: w });
1654
- }, []), y = W((g) => {
1655
- m.current?.doTouchStart(g.touches, g.timeStamp);
1656
- }, []), A = W((g) => {
1657
- g.preventDefault(), m.current?.doTouchMove(g.touches, g.timeStamp);
1658
- }, []), E = W((g) => {
1659
- m.current?.doTouchEnd(g.timeStamp);
1660
- }, []), k = W(({ containerWidth: g, containerHeight: w, totalWidth: R, totalHeight: G }) => {
1661
- m.current.setDimensions(g, w, R, G);
1691
+ const w = U((g, L) => {
1692
+ x?.({ left: g, top: L });
1693
+ }, []), y = U((g) => {
1694
+ _.current?.doTouchStart(g.touches, g.timeStamp);
1695
+ }, []), z = U((g) => {
1696
+ g.preventDefault(), _.current?.doTouchMove(g.touches, g.timeStamp);
1697
+ }, []), E = U((g) => {
1698
+ _.current?.doTouchEnd(g.timeStamp);
1699
+ }, []), B = U(({ containerWidth: g, containerHeight: L, totalWidth: R, totalHeight: N }) => {
1700
+ _.current.setDimensions(g, L, R, N);
1662
1701
  }, []);
1663
- $(() => {
1664
- const g = h ?? M.current;
1665
- if (!d && de().supportsTouchEvents && g && n) {
1666
- if (!m.current) {
1667
- const w = { scrollingX: !0, scrollingY: !0, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
1668
- m.current = new wo(v, w);
1702
+ H(() => {
1703
+ const g = h ?? T.current;
1704
+ if (!d && $e().supportsTouchEvents && g && n) {
1705
+ if (!_.current) {
1706
+ const L = { scrollingX: !0, scrollingY: !0, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
1707
+ _.current = new xo(w, L);
1669
1708
  }
1670
- de().supportsTouchEvents && (g.addEventListener("touchstart", y), g.addEventListener("touchend", E), g.addEventListener("touchmove", A)), k({ containerWidth: n?.width, containerHeight: n?.height, totalWidth: n?.totalWidth, totalHeight: n?.totalHeight });
1709
+ $e().supportsTouchEvents && (g.addEventListener("touchstart", y), g.addEventListener("touchend", E), g.addEventListener("touchmove", z)), B({ containerWidth: n?.width, containerHeight: n?.height, totalWidth: n?.totalWidth, totalHeight: n?.totalHeight });
1671
1710
  }
1672
1711
  return () => {
1673
- g?.removeEventListener("touchstart", y), g?.removeEventListener("touchend", E), g?.removeEventListener("touchmove", A);
1712
+ g?.removeEventListener("touchstart", y), g?.removeEventListener("touchend", E), g?.removeEventListener("touchmove", z);
1674
1713
  };
1675
1714
  }, [n?.width, n?.height, n?.totalWidth, n?.totalHeight, d, h]);
1676
- const [H, { width: S }] = vt(), [L, { height: z }] = vt(), C = I(() => {
1715
+ const [$, { width: S }] = Se(), [b, { height: C }] = Se(), M = K(() => {
1677
1716
  if (!p) return null;
1678
- const g = s({ orientation: at.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (w) => {
1679
- b?.({ top: w });
1717
+ const g = s({ orientation: te.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (L) => {
1718
+ x?.({ top: L });
1680
1719
  } });
1681
- return T("div", { style: { display: "flex", flex: "0" }, ref: H, children: g });
1682
- }, [s, n?.top, n?.height, n?.totalHeight]), D = I(() => {
1683
- if (!_) return null;
1684
- const g = l({ orientation: at.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (w) => {
1685
- b?.({ left: w });
1720
+ return P("div", { style: { display: "flex", flex: "0" }, ref: $, children: g });
1721
+ }, [s, n?.top, n?.height, n?.totalHeight]), O = K(() => {
1722
+ if (!m) return null;
1723
+ const g = l({ orientation: te.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (L) => {
1724
+ x?.({ left: L });
1686
1725
  } });
1687
- return Mt("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [T("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${S}px)` }, children: T("div", { ref: L, className: "sizer", children: g }) }), p ? u({ width: S, height: z }) : T(Ct, {})] });
1688
- }, [l, n?.left, n?.width, n?.totalWidth, p, u, S, z]);
1689
- return T("div", { style: { position: "relative", display: "flex", minWidth: p ? `${S}px` : void 0, minHeight: _ ? `${z}px` : void 0, ...a }, ...f, ref: M, children: Mt("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [Mt("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [T("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: e }), p ? C : T(Ct, {})] }), _ ? D : T(Ct, {})] }) });
1726
+ return pe("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [P("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${S}px)` }, children: P("div", { ref: b, className: "sizer", children: g }) }), p ? u({ width: S, height: C }) : P(fe, {})] });
1727
+ }, [l, n?.left, n?.width, n?.totalWidth, p, u, S, C]);
1728
+ return P("div", { style: { position: "relative", display: "flex", minWidth: p ? `${S}px` : void 0, minHeight: m ? `${C}px` : void 0, ...c }, ...f, ref: T, children: pe("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [pe("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [P("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: t }), p ? M : P(fe, {})] }), m ? O : P(fe, {})] }) });
1690
1729
  }));
1691
- xo.displayName = "ScrollPane";
1692
- const So = 300, Eo = 100, Lo = 1e6, Mo = 100, Co = 50, To = wt(kt((o, t) => {
1693
- const { offset: e = 0, viewportSize: n = 0, totalSize: i = 0, minSize: r = 0, endGap: c = So, endScrollIncrement: u = Eo, style: l = Ye, onMouseDown: s, onScrollOffset: a, onScroll: h, scaleLimit: d = Lo, scaleFactor: f = Mo, precisionFactor: _ = Co, createScrollbar: p = $t, ...b } = o;
1730
+ Eo.displayName = "ScrollPane";
1731
+ const Mo = 300, Lo = 100, Co = 1e6, To = 100, ko = 50, Po = me(Ee((o, e) => {
1732
+ const { offset: t = 0, viewportSize: n = 0, totalSize: r = 0, minSize: i = 0, endGap: a = Mo, endScrollIncrement: u = Lo, style: l = Qt, onMouseDown: s, onScrollOffset: c, onScroll: h, scaleLimit: d = Co, scaleFactor: f = To, precisionFactor: m = ko, createScrollbar: p = Ke, ...x } = o;
1694
1733
  h && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
1695
- const M = P(s, [s]), [m, v] = V(!1), y = I(() => {
1696
- const S = d === 0 ? i : Math.min(i ?? 0, Math.max(r ?? 0, (e ?? 0) + (n ?? 0)) + (c ?? 0)), L = d !== 0 && S > d ? f : 1, z = L / _, C = Math.ceil(S / L);
1697
- return { offset: Math.ceil(e / L), totalSize: C, viewportSize: Math.ceil(n / L), scaledOffset: e, scaledTotalSize: i, scaledViewportSize: n, factor: L, precision: z };
1698
- }, [e, i, n, m, r, c, u]), A = P((S, L, z) => {
1699
- const C = y.offset;
1700
- Math.abs(S - C) < y.precision && (S = C), a?.(S * y.factor, C, y.viewportSize);
1701
- }, [a, y]), E = W((S) => {
1702
- }, []), k = W((S) => {
1703
- document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", k), v(!1);
1704
- }, []), H = W((S) => {
1705
- v(!0), M?.(S), document.addEventListener("mousemove", E, { passive: !0 }), document.addEventListener("mouseup", k, { passive: !0 });
1706
- }, [E, k]);
1707
- return $t({ style: l, ...b, offset: y.offset, totalSize: y.totalSize, viewportSize: y.viewportSize, onMouseDown: H, onScrollOffset: A }, t);
1734
+ const T = k(s, [s]), [_, w] = Y(!1), y = K(() => {
1735
+ const S = d === 0 ? r : Math.min(r ?? 0, Math.max(i ?? 0, (t ?? 0) + (n ?? 0)) + (a ?? 0)), b = d !== 0 && S > d ? f : 1, C = b / m, M = Math.ceil(S / b);
1736
+ return { offset: Math.ceil(t / b), totalSize: M, viewportSize: Math.ceil(n / b), scaledOffset: t, scaledTotalSize: r, scaledViewportSize: n, factor: b, precision: C };
1737
+ }, [t, r, n, _, i, a, u]), z = k((S, b, C) => {
1738
+ const M = y.offset;
1739
+ Math.abs(S - M) < y.precision && (S = M), c?.(S * y.factor, M, y.viewportSize);
1740
+ }, [c, y]), E = U((S) => {
1741
+ }, []), B = U((S) => {
1742
+ document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", B), w(!1);
1743
+ }, []), $ = U((S) => {
1744
+ w(!0), T?.(S), document.addEventListener("mousemove", E, { passive: !0 }), document.addEventListener("mouseup", B, { passive: !0 });
1745
+ }, [E, B]);
1746
+ return Ke({ style: l, ...x, offset: y.offset, totalSize: y.totalSize, viewportSize: y.viewportSize, onMouseDown: $, onScrollOffset: z }, e);
1708
1747
  }));
1709
- To.displayName = "VirtualScrollbar";
1748
+ Po.displayName = "VirtualScrollbar";
1710
1749
  export {
1711
- ue as Command,
1712
- No as CommandButtonType,
1713
- Ze as CommandGroup,
1714
- Gt as DefaultDynamicIconService,
1715
- On as DefaultReactNotifier,
1716
- io as DynamicIcon,
1717
- oi as ErrorTestPanel,
1718
- Wo as FocusKeyNavigation,
1719
- Bo as HorizontalAlignment,
1720
- _e as InMemoryStore,
1721
- Oo as KeyCodes,
1722
- Y as KeyModifiers,
1723
- li as LocalStorageStore,
1724
- Io as MouseButtonCodes,
1725
- Vo as NotifierProvider,
1726
- Te as NotifierType,
1727
- si as PersistenceStateProvider,
1728
- ei as ReactErrorBoundary,
1729
- $o as ReactUtils,
1730
- Fo as RoundedTab,
1731
- xo as ScrollPane,
1732
- ui as ScrollUtils,
1733
- _o as Scrollbar,
1734
- at as ScrollbarOrientation,
1735
- re as SimpleCommand,
1736
- to as SplitPane,
1737
- Qn as SplitPaneResizer,
1738
- Ho as ToolTipPlacement,
1739
- ni as UncaughtErrorBoundary,
1740
- To as VirtualScrollbar,
1741
- ii as WalkingIcon,
1742
- no as createDynamicIconService,
1743
- bo as defaultCreateScrollCorner,
1744
- ai as defaultCreateScrollEdgeButton,
1745
- fo as defaultCreateScrollEndButton,
1746
- po as defaultCreateScrollStartButton,
1747
- Xo as getDevicePixelRatio,
1748
- Bt as toShortcutString,
1749
- jo as useAnimatedMeasure,
1750
- P as useCallbackRef,
1751
- Ko as useCommand,
1752
- Ro as useCommands,
1753
- qo as useCopyPaste,
1754
- Uo as useDevicePixelRatio,
1750
+ yt as Command,
1751
+ Wo as CommandButtonType,
1752
+ tn as CommandGroup,
1753
+ nt as DefaultDynamicIconService,
1754
+ Kn as DefaultReactNotifier,
1755
+ ao as DynamicIcon,
1756
+ rr as ErrorTestPanel,
1757
+ Fo as FocusKeyNavigation,
1758
+ Io as HorizontalAlignment,
1759
+ St as InMemoryStore,
1760
+ $o as KeyCodes,
1761
+ Z as KeyModifiers,
1762
+ ar as LocalStorageStore,
1763
+ Ko as MouseButtonCodes,
1764
+ Uo as NotifierProvider,
1765
+ zt as NotifierType,
1766
+ lr as PersistenceStateProvider,
1767
+ nr as ReactErrorBoundary,
1768
+ Ro as ReactUtils,
1769
+ jo as RoundedTab,
1770
+ Eo as ScrollPane,
1771
+ ur as ScrollUtils,
1772
+ yo as Scrollbar,
1773
+ te as ScrollbarOrientation,
1774
+ pt as SimpleCommand,
1775
+ ro as SplitPane,
1776
+ oo as SplitPaneResizer,
1777
+ Vo as ToolTipPlacement,
1778
+ or as UncaughtErrorBoundary,
1779
+ Po as VirtualScrollbar,
1780
+ ir as WalkingIcon,
1781
+ so as createDynamicIconService,
1782
+ So as defaultCreateScrollCorner,
1783
+ cr as defaultCreateScrollEdgeButton,
1784
+ mo as defaultCreateScrollEndButton,
1785
+ fo as defaultCreateScrollStartButton,
1786
+ Yo as getDevicePixelRatio,
1787
+ Oe as toShortcutString,
1788
+ Wn as useAnimatedMeasure,
1789
+ k as useCallbackRef,
1790
+ No as useCommand,
1791
+ Ho as useCommands,
1792
+ Jo as useCopyPaste,
1793
+ Xo as useDevicePixelRatio,
1755
1794
  Zo as useEditMode,
1756
- ci as useFullscreenPortal,
1757
- jn as useGlobalClipboard,
1758
- Qo as useId,
1759
- ve as useImperativeElement,
1760
- Go as useMouseDownAndHoldListener,
1761
- Jt as useNotifier,
1762
- Yo as useOnClickOrFocusAway,
1763
- ri as usePersistenceState,
1764
- Rn as useSynchronizedPointerHandler,
1765
- Jo as useTraceUpdate,
1766
- ti as useUndoManager
1795
+ Vn as useFullscreenPortal,
1796
+ Gn as useGlobalClipboard,
1797
+ er as useId,
1798
+ Lt as useImperativeElement,
1799
+ qo as useMouseDownAndHoldListener,
1800
+ it as useNotifier,
1801
+ Go as useOnClickOrFocusAway,
1802
+ sr as usePersistenceState,
1803
+ rn as useSynchronizedPointerHandler,
1804
+ Qo as useTraceUpdate,
1805
+ tr as useUndoManager
1767
1806
  };