@sheetxl/grid-react 0.3.18 → 0.3.19

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,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/grid-react - Grid - Advanced data grid component for React - v0.3.18
2
+ * @license @sheetxl/grid-react - Grid - Advanced data grid component for React - v0.3.19
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -12,7 +12,7 @@ import { mergeRefs as m } from "react-merge-refs";
12
12
  import { createRoot as x } from "react-dom/client";
13
13
  import { unstable_batchedUpdates as y, createPortal as v } from "react-dom";
14
14
  import b from "tiny-invariant";
15
- const S = "up", E = "down", _ = "left", I = "right", C = "tl", M = "t", T = "l", k = "c", R = "text/html", P = "text/plain", O = "image/png", L = Object.freeze({ left: 0, top: 0 }), D = Object.freeze({ left: 0, top: 0, bottom: 0, right: 0 }), z = Object.freeze({ x: 0, y: 0, width: 0, height: 0 });
15
+ const S = "up", _ = "down", E = "left", I = "right", C = "tl", M = "t", T = "l", k = "c", R = "text/html", P = "text/plain", O = "image/png", L = Object.freeze({ left: 0, top: 0 }), D = Object.freeze({ left: 0, top: 0, bottom: 0, right: 0 }), z = Object.freeze({ x: 0, y: 0, width: 0, height: 0 });
16
16
  Object.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: z, EmptyRect: D, EmptyTopLeft: L }, Symbol.toStringTag, { value: "Module" }));
17
17
  const A = "column", $ = "row", B = Object.freeze({ colIndex: 0, rowIndex: 0 }), F = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), j = (e5, t2) => e5.colStart === t2.colStart ? e5.rowStart - t2.rowStart : e5.colStart - t2.colStart, V = (e5, t2) => e5.rowStart === t2.rowStart ? e5.colStart - t2.colStart : e5.rowStart - t2.rowStart, W = (e5, t2) => e5.rowEnd === t2.rowEnd ? t2.colEnd - e5.colEnd : t2.rowEnd - e5.rowEnd, H = (e5, t2) => e5.colEnd === t2.colEnd ? t2.rowEnd - e5.rowEnd : t2.colEnd - e5.colEnd, N = (e5, t2) => e5.colIndex === t2.colIndex ? e5.rowIndex - t2.rowIndex : e5.colIndex - t2.colIndex, U = (e5, t2) => e5.rowIndex === t2.rowIndex ? e5.colIndex - t2.colIndex : e5.rowIndex - t2.rowIndex, K = (e5 = $, t2 = false) => t2 ? e5 !== A ? W : H : e5 !== A ? V : j, q = (e5, t2) => e5 === t2 || !(!e5 || !t2) && e5.rowIndex === t2.rowIndex && e5.colIndex === t2.colIndex, Y = (e5, t2) => e5 === t2 || !(!e5 || !t2) && e5.rowStart === t2.rowStart && e5.rowEnd === t2.rowEnd && e5.colStart === t2.colStart && e5.colEnd === t2.colEnd, X = (e5, t2) => !(!e5 || !t2 || e5.colStart > t2.colEnd || t2.colStart > e5.colEnd || e5.rowStart > t2.rowEnd || t2.rowStart > e5.rowEnd), G = (e5, t2) => {
18
18
  if (e5 === t2) return true;
@@ -180,15 +180,15 @@ const de = Object.freeze([]), ue = Object.freeze({}), he = (e5) => e5, fe = () =
180
180
  null === xe(e5[l2], t2?.[l2], n2) && (r2 = true, delete e5[l2]);
181
181
  }
182
182
  return r2 && 0 === Object.keys(e5).length ? null : void 0;
183
- }, ye = "object" == typeof performance && "function" == typeof performance.now ? () => performance.now() : () => Date.now(), ve = (e5) => null == e5, be = (e5, t2) => !(t2.left > e5.right || t2.right < e5.left || t2.top > e5.bottom || t2.bottom < e5.top), Se = !("undefined" == typeof window || !window.document || !window.document.createElement), Ee = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, _e = () => {
184
- if (Ie()) return Ee.Node;
183
+ }, ye = "object" == typeof performance && "function" == typeof performance.now ? () => performance.now() : () => Date.now(), ve = (e5) => null == e5, be = (e5, t2) => !(t2.left > e5.right || t2.right < e5.left || t2.top > e5.bottom || t2.bottom < e5.top), Se = !("undefined" == typeof window || !window.document || !window.document.createElement), _e = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, Ee = () => {
184
+ if (Ie()) return _e.Node;
185
185
  const e5 = void 0 !== globalThis.navigator && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";
186
- return e5 ? /(win32|win64|windows|wince)/i.test(e5) ? Ee.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(e5) ? Ee.MacOS : /(iphone|ipad|ipod)/i.test(e5) ? Ee.IOS : /android/.test(e5) ? Ee.Android : /linux/.test(e5) ? Ee.Linux : /^((?!chrome|android|).)*safari/i.test(e5) ? Ee.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(e5) ? Ee.Firefox : Ee.Unknown : Ee.Unknown;
186
+ return e5 ? /(win32|win64|windows|wince)/i.test(e5) ? _e.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(e5) ? _e.MacOS : /(iphone|ipad|ipod)/i.test(e5) ? _e.IOS : /android/.test(e5) ? _e.Android : /linux/.test(e5) ? _e.Linux : /^((?!chrome|android|).)*safari/i.test(e5) ? _e.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(e5) ? _e.Firefox : _e.Unknown : _e.Unknown;
187
187
  };
188
188
  function Ie() {
189
189
  return "undefined" != typeof process && "node" === process.release?.name || ("undefined" != typeof process && process.browser, false);
190
190
  }
191
- const Ce = (e5, t2 = false) => (document.hasFocus() || t2) && (e5 === document.activeElement || e5?.contains(document.activeElement)), Me = Object.freeze(Object.defineProperty({ __proto__: null, EmptyArray: de, EmptyObject: ue, OSType: Ee, arrayMove: function(e5, t2, n2) {
191
+ const Ce = (e5, t2 = false) => (document.hasFocus() || t2) && (e5 === document.activeElement || e5?.contains(document.activeElement)), Me = Object.freeze(Object.defineProperty({ __proto__: null, EmptyArray: de, EmptyObject: ue, OSType: _e, arrayMove: function(e5, t2, n2) {
192
192
  const o2 = e5.slice();
193
193
  return o2.splice(n2 < 0 ? o2.length + n2 : n2, 0, o2.splice(t2, 1)[0]), o2;
194
194
  }, asNumber: (e5) => {
@@ -301,7 +301,7 @@ const Ce = (e5, t2 = false) => (document.hasFocus() || t2) && (e5 === document.a
301
301
  o2 = r2;
302
302
  }
303
303
  return o2 ?? null;
304
- }, getOS: _e, hasFocus: Ce, isDefined: (e5) => !(null == e5), isEmpty: (e5) => null == e5 || "" === e5, isEqualArrays: pe, isEqualBounds: (e5, t2) => e5 === t2 || !(e5 && !t2 || t2 && !e5) && e5.x === t2.x && e5.y === t2.y && e5.width === t2.width && e5.height === t2.height, isEqualObjectKeys: (e5, t2) => {
304
+ }, getOS: Ee, hasFocus: Ce, isDefined: (e5) => !(null == e5), isEmpty: (e5) => null == e5 || "" === e5, isEqualArrays: pe, isEqualBounds: (e5, t2) => e5 === t2 || !(e5 && !t2 || t2 && !e5) && e5.x === t2.x && e5.y === t2.y && e5.width === t2.width && e5.height === t2.height, isEqualObjectKeys: (e5, t2) => {
305
305
  if (e5 === t2) return true;
306
306
  if (e5 && !t2 || t2 && !e5) return false;
307
307
  const n2 = Object.keys(e5);
@@ -530,12 +530,12 @@ Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: Re,
530
530
  }
531
531
  return s2;
532
532
  };
533
- const Ae = "The Safari browser does not support advanced copy and paste.\nCopy and paste will be limited to within the browser tab.\n\nPlease use Chrome or Edge if external copy and paste is required.", $e = "You do not have permissions to access the clipboard.\nAll copy and paste operations will be limited to the browser tab.", Be = { Safari: "The Safari browser does not support advanced copy and paste.\nCopy and paste will be limited to within the browser tab.\n\nPlease use Chrome or Edge if external copy and paste is required.", Perms: $e, PermsWrite: _e() === Ee.Safari ? Ae : $e, PermsRead: _e() === Ee.Safari ? Ae : $e }, Fe = async () => new Promise((e5) => {
533
+ const Ae = "The Safari browser does not support advanced copy and paste.\nCopy and paste will be limited to within the browser tab.\n\nPlease use Chrome or Edge if external copy and paste is required.", $e = "You do not have permissions to access the clipboard.\nAll copy and paste operations will be limited to the browser tab.", Be = { Safari: "The Safari browser does not support advanced copy and paste.\nCopy and paste will be limited to within the browser tab.\n\nPlease use Chrome or Edge if external copy and paste is required.", Perms: $e, PermsWrite: Ee() === _e.Safari ? Ae : $e, PermsRead: Ee() === _e.Safari ? Ae : $e }, Fe = async () => new Promise((e5) => {
534
534
  document.hasFocus() ? e5() : globalThis.addEventListener?.("focus", () => {
535
535
  e5();
536
536
  }, { once: true }), document.activeElement.focus?.();
537
537
  }), je = async (e5, t2, n2) => {
538
- if (_e() === Ee.Safari) return await n2(new Error(Be.Safari));
538
+ if (Ee() === _e.Safari) return await n2(new Error(Be.Safari));
539
539
  try {
540
540
  const o2 = async (e6) => {
541
541
  try {
@@ -633,7 +633,7 @@ const We = async (e5, t2 = R) => new Promise(async (n2, o2) => {
633
633
  return false;
634
634
  }
635
635
  };
636
- class Xe {
636
+ let Xe = class {
637
637
  constructor(e5) {
638
638
  if (void 0 === e5?.nativeClipboard || true === e5?.nativeClipboard) try {
639
639
  this._nativeClipboard = globalThis?.navigator.clipboard;
@@ -652,7 +652,7 @@ class Xe {
652
652
  const t2 = await He(this._nativeClipboard, R);
653
653
  return !this._state || (Ye(this._state.uuid, t2) || this.clear(), true);
654
654
  }, async (e5) => {
655
- "denied" === e5?.message || e5.message?.includes("Document is not focused") || _e() === Ee.Safari || console.warn("Unable to detect clipboard changes: ", e5);
655
+ "denied" === e5?.message || e5.message?.includes("Document is not focused") || Ee() === _e.Safari || console.warn("Unable to detect clipboard changes: ", e5);
656
656
  });
657
657
  }
658
658
  _init() {
@@ -806,7 +806,7 @@ class Xe {
806
806
  close() {
807
807
  globalThis.removeEventListener?.("focus", this._onFocus), globalThis.removeEventListener?.("blur", this._onBlur);
808
808
  }
809
- }
809
+ };
810
810
  var Ge;
811
811
  (Ge = Xe || (Xe = {})).ErrorMessages = Be, Ge.Global = new Ge();
812
812
  var Ze = "undefined" != typeof window ? window : { screen: {}, navigator: {} }, Je = (Ze.matchMedia || function() {
@@ -817,7 +817,7 @@ var Ze = "undefined" != typeof window ? window : { screen: {}, navigator: {} },
817
817
  };
818
818
  Ze.addEventListener && Ze.addEventListener("p", tt, et), Ze.removeEventListener && Ze.removeEventListener("p", tt, false);
819
819
  var nt = Qe, ot = "PointerEvent" in Ze, rt = "ontouchstart" in Ze, it = rt || "TouchEvent" in Ze && Je("(any-pointer: coarse)").matches, lt = (Ze.navigator.maxTouchPoints || 0) > 0 || it, st = Ze.navigator.userAgent || "", ct = Je("(pointer: coarse)").matches && /iPad|Macintosh/.test(st) && Math.min(Ze.screen.width || 0, Ze.screen.height || 0) >= 768, at = (Je("(pointer: coarse)").matches || !Je("(pointer: fine)").matches && rt) && !/Windows.*Firefox/.test(st), dt = Je("(any-pointer: fine)").matches || Je("(any-hover: hover)").matches || ct || !rt, ut = !lt || !dt && at ? lt ? "touchOnly" : "mouseOnly" : "hybrid", ht = "mouseOnly" === ut ? "mouse" : "touchOnly" === ut || at ? "touch" : "mouse";
820
- const ft = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: ut, primaryInput: ht, supportsPassiveEvents: nt, supportsPointerEvents: ot, supportsTouchEvents: it }, Symbol.toStringTag, { value: "Module" })), pt = { Left: "left", Right: "right", Center: "center" }, gt = "shift", wt = "alt", mt = "ctrl", xt = 9, yt = 13, vt = 27, bt = 37, St = 38, Et = 39, _t = 40, It = 113, Ct = 3, Mt = { Horizontal: "horizontal", Vertical: "vertical" }, Tt = (e5, t2) => {
820
+ const ft = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: ut, primaryInput: ht, supportsPassiveEvents: nt, supportsPointerEvents: ot, supportsTouchEvents: it }, Symbol.toStringTag, { value: "Module" })), pt = { Left: "left", Right: "right", Center: "center" }, gt = "shift", wt = "alt", mt = "ctrl", xt = 9, yt = 13, vt = 27, bt = 37, St = 38, _t = 39, Et = 40, It = 113, Ct = 3, Mt = { Horizontal: "horizontal", Vertical: "vertical" }, Tt = (e5, t2) => {
821
821
  const n2 = i((...t3) => e5?.(...t3), t2), o2 = l(null);
822
822
  o2.current = n2;
823
823
  const r2 = i((...e6) => o2.current?.(...e6), []);
@@ -840,7 +840,7 @@ const ft = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: ut
840
840
  };
841
841
  Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: Pt }, Symbol.toStringTag, { value: "Module" }));
842
842
  const Ot = r(a((n2, o2) => {
843
- const { offset: r2 = 0, totalSize: c2 = 0, viewportSize: a2 = 0, style: u2, className: f2, orientation: p2 = Mt.Vertical, onScrollOffset: m2, onScroll: x2, showCustomScrollButtons: y2 = false, scrollButtonIncrement: v2 = 200, scrollButtonInitialRepeatDelay: b2 = 260, scrollButtonAdditionalRepeatDelay: S2 = 120, createScrollStartButton: E2 = kt, createScrollEndButton: _2 = Rt, ...I2 } = n2, C2 = Tt(x2, [x2]), M2 = l(null), [T2, { width: k2, height: R2 }] = w(), [P2, { width: O2, height: L2 }] = w(), D2 = p2 === Mt.Vertical, z2 = D2 ? "top" : "left", A2 = D2 ? "scrollTop" : "scrollLeft", $2 = D2 ? R2 : k2, B2 = D2 ? L2 : O2, [F2, j2] = h(null);
843
+ const { offset: r2 = 0, totalSize: c2 = 0, viewportSize: a2 = 0, style: u2, className: f2, orientation: p2 = Mt.Vertical, onScrollOffset: m2, onScroll: x2, showCustomScrollButtons: y2 = false, scrollButtonIncrement: v2 = 200, scrollButtonInitialRepeatDelay: b2 = 260, scrollButtonAdditionalRepeatDelay: S2 = 120, createScrollStartButton: _2 = kt, createScrollEndButton: E2 = Rt, ...I2 } = n2, C2 = Tt(x2, [x2]), M2 = l(null), [T2, { width: k2, height: R2 }] = w(), [P2, { width: O2, height: L2 }] = w(), D2 = p2 === Mt.Vertical, z2 = D2 ? "top" : "left", A2 = D2 ? "scrollTop" : "scrollLeft", $2 = D2 ? R2 : k2, B2 = D2 ? L2 : O2, [F2, j2] = h(null);
844
844
  s(() => {
845
845
  null !== F2 && M2.current && M2.current.scrollTo({ behavior: "smooth", [z2]: F2 });
846
846
  }, [F2, D2]);
@@ -873,11 +873,11 @@ const Ot = r(a((n2, o2) => {
873
873
  const X2 = r2, G2 = d(() => {
874
874
  if (!y2) return null;
875
875
  const e5 = { orientation: p2, disabled: Math.floor(X2) <= 0 || 0 === Math.floor(B2 - $2), onMouseUp: q2, onMouseLeave: q2, onMouseDown: () => Y2(X2, true, true) };
876
- return E2?.(e5);
876
+ return _2?.(e5);
877
877
  }, [y2, p2, X2, F2, B2, $2]), Z2 = d(() => {
878
878
  if (!y2) return null;
879
879
  const e5 = { orientation: p2, disabled: Math.floor(B2 - $2) <= Math.ceil(X2), onMouseUp: q2, onMouseLeave: q2, onMouseDown: () => Y2(X2, true, false) };
880
- return _2?.(e5);
880
+ return E2?.(e5);
881
881
  }, [y2, p2, X2, F2, B2, $2]);
882
882
  return t("div", { ref: o2, style: { display: "flex", flex: "1", flexDirection: D2 ? "column" : "row", padding: "0", ...u2 }, className: g("_sheetxl-scrollbar_eblx4_6", f2), ...I2, children: [G2, e("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: D2 ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: T2, children: e("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: D2 ? "scroll" : "hidden", overflowX: D2 ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: N2, ref: M2, children: e("div", { ref: P2, style: { position: "absolute", height: D2 ? c2 - a2 + (R2 ?? 0) : 1, width: D2 ? 1 : c2 - a2 + (k2 ?? 0) }, className: "scrollbar-viewport" }) }) }), Z2] });
883
883
  }));
@@ -887,168 +887,201 @@ const At = (e5) => {
887
887
  let t2 = null !== Dt[e5];
888
888
  return t2 && (Dt[e5] = null), t2;
889
889
  }, $t = (e5, t2, n2, o2 = 0, r2) => {
890
- let i2 = Lt(), l2 = i2, s2 = 0, c2 = 0, a2 = zt++;
891
- if (a2 % 20 == 0) {
890
+ let i2 = Lt(), l2 = i2, s2 = 0, c2 = 0, a2 = 0, d2 = zt++;
891
+ if (d2 % 20 == 0) {
892
892
  const e6 = {};
893
893
  for (let t3 in Dt) e6[t3] = true;
894
894
  Dt = e6;
895
895
  }
896
- const d2 = function(u2) {
897
- const h2 = true !== u2, f2 = Lt();
898
- if (!Dt[a2] || t2 && !t2(a2)) return Dt[a2] = null, void n2(60 - c2 / ((f2 - i2) / 1e3), a2, false);
899
- if (h2) {
900
- const e6 = Math.round((f2 - l2) / 16.666666666666668) - 1;
901
- for (let t3 = 0; t3 < Math.min(e6, 4); t3++) d2(true), c2++;
896
+ const u2 = function(h2) {
897
+ let f2 = true !== h2, p2 = Lt(), g2 = true;
898
+ try {
899
+ g2 = (!t2 || t2(d2)) ?? true;
900
+ } catch (e6) {
901
+ g2 = false;
902
902
  }
903
- o2 && (s2 = (f2 - i2) / o2, s2 > 1 && (s2 = 1));
904
- const p2 = r2 ? r2(s2) : s2;
905
- false !== e5(p2, f2, h2) && 1 !== s2 || !h2 ? h2 && (l2 = f2, requestAnimationFrame(d2)) : (Dt[a2] = null, n2(60 - c2 / ((f2 - i2) / 1e3), a2, 1 === s2 || void 0 === o2));
903
+ if (!Dt[d2] || !g2) return Dt[d2] = null, void n2?.(60 - c2 / ((p2 - i2) / 1e3), d2, false);
904
+ if (f2) {
905
+ a2 = Math.round((p2 - l2) / 16.666666666666668) - 1;
906
+ for (let e6 = 0; e6 < Math.min(a2, 4); e6++) u2(true), c2++;
907
+ }
908
+ o2 && (s2 = (p2 - i2) / o2, s2 > 1 && (s2 = 1));
909
+ let w2 = r2 ? r2(s2) : s2, m2 = false;
910
+ try {
911
+ m2 = e5(w2, p2, f2);
912
+ } catch (e6) {
913
+ m2 = false;
914
+ }
915
+ false !== m2 && 1 !== s2 || !f2 ? f2 && (l2 = p2, requestAnimationFrame(u2)) : (Dt[d2] = null, n2?.(60 - c2 / ((p2 - i2) / 1e3), d2, 1 === s2 || null == o2));
906
916
  };
907
- return Dt[a2] = true, requestAnimationFrame(d2), a2;
908
- };
909
- var Bt = function() {
910
- }, Ft = function(e5) {
917
+ return Dt[d2] = true, requestAnimationFrame(u2), d2;
918
+ }, Bt = function(e5) {
911
919
  return Math.pow(e5 - 1, 3) + 1;
912
- }, jt = function(e5) {
920
+ }, Ft = function(e5) {
913
921
  return (e5 /= 0.5) < 1 ? 0.5 * Math.pow(e5, 3) : 0.5 * (Math.pow(e5 - 2, 3) + 2);
914
- }, Vt = function(e5, t2) {
915
- for (var n2 in this.__callback = e5, this.options = { scrollingX: true, scrollingY: true, animating: true, animationDuration: 250, bouncing: true, locking: true, paging: false, snapping: false, zooming: false, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: Bt, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08 }, t2) this.options[n2] = t2[n2];
916
922
  };
917
- Vt.prototype = { __isSingleTouch: false, __isTracking: false, __didDecelerationComplete: false, __isGesturing: false, __isDragging: false, __isDecelerating: false, __isAnimating: false, __clientLeft: 0, __clientTop: 0, __clientWidth: 0, __clientHeight: 0, __contentWidth: 0, __contentHeight: 0, __snapWidth: 100, __snapHeight: 100, __zoomLevel: 1, __scrollLeft: 0, __scrollTop: 0, __maxScrollLeft: 0, __maxScrollTop: 0, __scheduledLeft: 0, __scheduledTop: 0, __scheduledZoom: 0, __lastTouchLeft: null, __lastTouchTop: null, __lastTouchMove: null, __positions: null, __minDecelerationScrollLeft: null, __minDecelerationScrollTop: null, __maxDecelerationScrollLeft: null, __maxDecelerationScrollTop: null, __decelerationVelocityX: null, __decelerationVelocityY: null, setDimensions: function(e5, t2, n2, o2) {
918
- null !== e5 && (this.__clientWidth = e5), null !== t2 && (this.__clientHeight = t2), null !== n2 && (this.__contentWidth = n2), null !== o2 && (this.__contentHeight = o2), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true);
919
- }, setPosition: function(e5, t2) {
920
- this.__clientLeft = e5 || 0, this.__clientTop = t2 || 0;
921
- }, setSnapSize: function(e5, t2) {
922
- this.__snapWidth = e5, this.__snapHeight = t2;
923
- }, getValues: function() {
924
- return { left: this.__scrollLeft, top: this.__scrollTop, right: this.__scrollLeft + this.__clientWidth / this.__zoomLevel, bottom: this.__scrollTop + this.__clientHeight / this.__zoomLevel, zoom: this.__zoomLevel };
925
- }, getPoint: function(e5, t2) {
926
- var n2 = this.getValues();
927
- return { left: e5 / n2.zoom, top: t2 / n2.zoom };
928
- }, getScrollMax: function() {
929
- return { left: this.__maxScrollLeft, top: this.__maxScrollTop };
930
- }, zoomTo: function(e5, t2, n2, o2, r2) {
931
- if (!this.options.zooming) throw new Error("Zooming is not enabled!");
932
- r2 && (this.__zoomComplete = r2), this.__isDecelerating && (At(this.__isDecelerating), this.__isDecelerating = false);
933
- var i2 = this.__zoomLevel;
934
- void 0 === n2 && (n2 = this.__clientWidth / 2), void 0 === o2 && (o2 = this.__clientHeight / 2), e5 = Math.max(Math.min(e5, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(e5);
935
- var l2 = e5 / i2, s2 = l2 * (this.__scrollLeft + n2) - n2, c2 = l2 * (this.__scrollTop + o2) - o2;
936
- s2 > this.__maxScrollLeft ? s2 = this.__maxScrollLeft : s2 < 0 && (s2 = 0), c2 > this.__maxScrollTop ? c2 = this.__maxScrollTop : c2 < 0 && (c2 = 0), this.__publish(s2, c2, e5, t2);
937
- }, zoomBy: function(e5, t2, n2, o2, r2) {
938
- this.zoomTo(this.__zoomLevel * e5, t2, n2, o2, r2);
939
- }, scrollTo: function(e5, t2, n2, o2) {
940
- if (this.__isDecelerating && (At(this.__isDecelerating), this.__isDecelerating = false), void 0 !== o2 && o2 !== this.__zoomLevel) {
923
+ class jt {
924
+ constructor(e5, t2) {
925
+ this.__isSingleTouch = false, this.__isTracking = false, this.__didDecelerationComplete = false, this.__isGesturing = false, this.__isDragging = false, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = false, this.__lastScale = 1, this.__enableScrollX = true, this.__enableScrollY = true, 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 = e5, this.options = { scrollingX: true, scrollingY: true, animating: true, animationDuration: 250, bouncing: true, locking: true, paging: false, snapping: false, zooming: false, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: void 0, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08, ...t2 };
926
+ }
927
+ setDimensions(e5, t2, n2, o2) {
928
+ null !== e5 && (this.__clientWidth = e5), null !== t2 && (this.__clientHeight = t2), null !== n2 && (this.__contentWidth = n2), null !== o2 && (this.__contentHeight = o2), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true);
929
+ }
930
+ setPosition(e5, t2) {
931
+ this.__clientLeft = e5 || 0, this.__clientTop = t2 || 0;
932
+ }
933
+ setSnapSize(e5, t2) {
934
+ this.__snapWidth = e5, this.__snapHeight = t2;
935
+ }
936
+ getValues() {
937
+ return { left: this.__scrollLeft, top: this.__scrollTop, right: this.__scrollLeft + this.__clientWidth / this.__zoomLevel, bottom: this.__scrollTop + this.__clientHeight / this.__zoomLevel, zoom: this.__zoomLevel };
938
+ }
939
+ getPoint(e5, t2) {
940
+ const n2 = this.getValues();
941
+ return { left: e5 / n2.zoom, top: t2 / n2.zoom };
942
+ }
943
+ getScrollMax() {
944
+ return { left: this.__maxScrollLeft, top: this.__maxScrollTop };
945
+ }
946
+ zoomTo(e5, t2 = false, n2, o2, r2) {
941
947
  if (!this.options.zooming) throw new Error("Zooming is not enabled!");
942
- e5 *= o2, t2 *= o2, this.__computeScrollMax(o2);
943
- } else o2 = this.__zoomLevel;
944
- this.options.scrollingX ? this.options.paging ? e5 = Math.round(e5 / this.__clientWidth) * this.__clientWidth : this.options.snapping && (e5 = Math.round(e5 / this.__snapWidth) * this.__snapWidth) : e5 = this.__scrollLeft, this.options.scrollingY ? this.options.paging ? t2 = Math.round(t2 / this.__clientHeight) * this.__clientHeight : this.options.snapping && (t2 = Math.round(t2 / this.__snapHeight) * this.__snapHeight) : t2 = this.__scrollTop, e5 = Math.max(Math.min(this.__maxScrollLeft, e5), 0), t2 = Math.max(Math.min(this.__maxScrollTop, t2), 0), e5 === this.__scrollLeft && t2 === this.__scrollTop && (n2 = false), this.__publish(e5, t2, o2, n2);
945
- }, scrollBy: function(e5, t2, n2) {
946
- var o2 = this.__isAnimating ? this.__scheduledLeft : this.__scrollLeft, r2 = this.__isAnimating ? this.__scheduledTop : this.__scrollTop;
947
- this.scrollTo(o2 + (e5 || 0), r2 + (t2 || 0), n2);
948
- }, doMouseZoom: function(e5, t2, n2, o2) {
949
- var r2 = e5 > 0 ? 0.97 : 1.03;
950
- return this.zoomTo(this.__zoomLevel * r2, false, n2 - this.__clientLeft, o2 - this.__clientTop);
951
- }, doTouchStart: function(e5, t2) {
952
- if (void 0 === e5.length) throw new Error("Invalid touch list: " + e5);
953
- if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
954
- var n2, o2;
955
- this.__interruptedAnimation = true, this.__isDecelerating && (At(this.__isDecelerating), this.__isDecelerating = false, this.__interruptedAnimation = true), this.__isAnimating && (At(this.__isAnimating), this.__isAnimating = false, this.__interruptedAnimation = true);
956
- var r2 = 1 === e5.length;
957
- r2 ? (n2 = e5[0].pageX, o2 = e5[0].pageY) : (n2 = Math.abs(e5[0].pageX + e5[1].pageX) / 2, o2 = Math.abs(e5[0].pageY + e5[1].pageY) / 2), this.__initialTouchLeft = n2, this.__initialTouchTop = o2, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n2, this.__lastTouchTop = o2, this.__lastTouchMove = t2, this.__lastScale = 1, this.__enableScrollX = !r2 && this.options.scrollingX, this.__enableScrollY = !r2 && this.options.scrollingY, this.__isTracking = true, this.__didDecelerationComplete = false, this.__isDragging = !r2, this.__isSingleTouch = r2, this.__positions = [];
958
- }, doTouchMove: function(e5, t2, n2) {
959
- if (void 0 === e5.length) throw new Error("Invalid touch list: " + e5);
960
- if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
961
- if (this.__isTracking) {
962
- var o2, r2;
948
+ r2 && (this.__zoomComplete = r2), this.__isDecelerating && (At(this.__isDecelerating), this.__isDecelerating = 0);
949
+ const i2 = this.__zoomLevel;
950
+ void 0 === n2 && (n2 = this.__clientWidth / 2), void 0 === o2 && (o2 = this.__clientHeight / 2), e5 = Math.max(Math.min(e5, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(e5);
951
+ const l2 = e5 / i2;
952
+ let s2 = l2 * (this.__scrollLeft + n2) - n2, c2 = l2 * (this.__scrollTop + o2) - o2;
953
+ s2 > this.__maxScrollLeft ? s2 = this.__maxScrollLeft : s2 < 0 && (s2 = 0), c2 > this.__maxScrollTop ? c2 = this.__maxScrollTop : c2 < 0 && (c2 = 0), this.__publish(s2, c2, e5, t2);
954
+ }
955
+ zoomBy(e5, t2 = false, n2 = 0, o2 = 0, r2) {
956
+ this.zoomTo(this.__zoomLevel * e5, t2, n2, o2, r2);
957
+ }
958
+ scrollTo(e5, t2, n2 = false, o2 = 1) {
959
+ if (this.__isDecelerating && (At(this.__isDecelerating), this.__isDecelerating = 0), void 0 !== o2 && o2 !== this.__zoomLevel) {
960
+ if (!this.options.zooming) throw new Error("Zooming is not enabled!");
961
+ e5 *= o2, t2 *= o2, this.__computeScrollMax(o2);
962
+ } else o2 = this.__zoomLevel;
963
+ this.options.scrollingX ? this.options.paging ? e5 = Math.round(e5 / this.__clientWidth) * this.__clientWidth : this.options.snapping && (e5 = Math.round(e5 / this.__snapWidth) * this.__snapWidth) : e5 = this.__scrollLeft, this.options.scrollingY ? this.options.paging ? t2 = Math.round(t2 / this.__clientHeight) * this.__clientHeight : this.options.snapping && (t2 = Math.round(t2 / this.__snapHeight) * this.__snapHeight) : t2 = this.__scrollTop, e5 = Math.max(Math.min(this.__maxScrollLeft, e5), 0), t2 = Math.max(Math.min(this.__maxScrollTop, t2), 0), e5 === this.__scrollLeft && t2 === this.__scrollTop && (n2 = false), this.__publish(e5, t2, o2, n2);
964
+ }
965
+ scrollBy(e5 = 0, t2 = 0, n2 = false) {
966
+ const o2 = this.__isAnimating ? this.__scheduledLeft : this.__scrollLeft, r2 = this.__isAnimating ? this.__scheduledTop : this.__scrollTop;
967
+ this.scrollTo(o2 + (e5 || 0), r2 + (t2 || 0), n2);
968
+ }
969
+ doMouseZoom(e5, t2, n2, o2) {
970
+ const r2 = e5 > 0 ? 0.97 : 1.03;
971
+ return this.zoomTo(this.__zoomLevel * r2, false, n2 - this.__clientLeft, o2 - this.__clientTop);
972
+ }
973
+ doTouchStart(e5, t2) {
974
+ if (void 0 === e5.length) throw new Error("Invalid touch list: " + e5);
975
+ if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
976
+ let n2, o2;
977
+ this.__interruptedAnimation = true, this.__isDecelerating && (At(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = true), this.__isAnimating && (At(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = true);
978
+ let r2 = 1 === e5.length;
979
+ r2 ? (n2 = e5[0].pageX, o2 = e5[0].pageY) : (n2 = Math.abs(e5[0].pageX + e5[1].pageX) / 2, o2 = Math.abs(e5[0].pageY + e5[1].pageY) / 2), this.__initialTouchLeft = n2, this.__initialTouchTop = o2, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n2, this.__lastTouchTop = o2, this.__lastTouchMove = t2, this.__lastScale = 1, this.__enableScrollX = !r2 && this.options.scrollingX, this.__enableScrollY = !r2 && this.options.scrollingY, this.__isTracking = true, this.__didDecelerationComplete = false, this.__isDragging = !r2, this.__isSingleTouch = r2, this.__positions = [];
980
+ }
981
+ doTouchMove(e5, t2, n2 = 1) {
982
+ if (void 0 === e5.length) throw new Error("Invalid touch list: " + e5);
983
+ if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
984
+ if (!this.__isTracking) return;
985
+ let o2, r2;
963
986
  2 === e5.length ? (o2 = Math.abs(e5[0].pageX + e5[1].pageX) / 2, r2 = Math.abs(e5[0].pageY + e5[1].pageY) / 2) : (o2 = e5[0].pageX, r2 = e5[0].pageY);
964
- var i2 = this.__positions;
987
+ let i2 = this.__positions;
965
988
  if (this.__isDragging) {
966
- var l2 = o2 - this.__lastTouchLeft, s2 = r2 - this.__lastTouchTop, c2 = this.__scrollLeft, a2 = this.__scrollTop, d2 = this.__zoomLevel;
989
+ let e6 = o2 - this.__lastTouchLeft, l2 = r2 - this.__lastTouchTop, s2 = this.__scrollLeft, c2 = this.__scrollTop, a2 = this.__zoomLevel;
967
990
  if (void 0 !== n2 && this.options.zooming) {
968
- var u2 = d2;
969
- if (d2 = d2 / this.__lastScale * n2, u2 !== (d2 = Math.max(Math.min(d2, this.options.maxZoom), this.options.minZoom))) {
970
- var h2 = o2 - this.__clientLeft, f2 = r2 - this.__clientTop;
971
- c2 = (h2 + c2) * d2 / u2 - h2, a2 = (f2 + a2) * d2 / u2 - f2, this.__computeScrollMax(d2);
991
+ let e7 = a2;
992
+ if (a2 = a2 / this.__lastScale * n2, a2 = Math.max(Math.min(a2, this.options.maxZoom), this.options.minZoom), e7 !== a2) {
993
+ let t3 = o2 - this.__clientLeft, n3 = r2 - this.__clientTop;
994
+ s2 = (t3 + s2) * a2 / e7 - t3, c2 = (n3 + c2) * a2 / e7 - n3, this.__computeScrollMax(a2);
972
995
  }
973
996
  }
974
997
  if (this.__enableScrollX) {
975
- c2 -= l2 * this.options.speedMultiplier;
976
- var p2 = this.__maxScrollLeft;
977
- (c2 > p2 || c2 < 0) && (this.options.bouncing ? c2 += l2 / 2 * this.options.speedMultiplier : c2 = c2 > p2 ? p2 : 0);
998
+ s2 -= e6 * this.options.speedMultiplier;
999
+ let t3 = this.__maxScrollLeft;
1000
+ (s2 > t3 || s2 < 0) && (this.options.bouncing ? s2 += e6 / 2 * this.options.speedMultiplier : s2 = s2 > t3 ? t3 : 0);
978
1001
  }
979
1002
  if (this.__enableScrollY) {
980
- a2 -= s2 * this.options.speedMultiplier;
981
- var g2 = this.__maxScrollTop;
982
- (a2 > g2 || a2 < 0) && (this.options.bouncing ? a2 += s2 / 2 * this.options.speedMultiplier : a2 = a2 > g2 ? g2 : 0);
1003
+ c2 -= l2 * this.options.speedMultiplier;
1004
+ const e7 = this.__maxScrollTop;
1005
+ (c2 > e7 || c2 < 0) && (this.options.bouncing ? c2 += l2 / 2 * this.options.speedMultiplier : c2 = c2 > e7 ? e7 : 0);
983
1006
  }
984
- i2.length > 60 && i2.splice(0, 30), i2.push(c2, a2, t2), this.__publish(c2, a2, d2);
1007
+ i2.length > 60 && i2.splice(0, 30), i2.push(s2, c2, t2), this.__publish(s2, c2, a2);
985
1008
  } else {
986
- var w2 = this.options.locking ? 3 : 0, m2 = Math.abs(o2 - this.__initialTouchLeft), x2 = Math.abs(r2 - this.__initialTouchTop);
987
- this.__enableScrollX = this.options.scrollingX && m2 >= w2, this.__enableScrollY = this.options.scrollingY && x2 >= w2, i2.push(this.__scrollLeft, this.__scrollTop, t2), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (m2 >= 5 || x2 >= 5), this.__isDragging && (this.__interruptedAnimation = false);
1009
+ let e6 = this.options.locking ? 3 : 0, n3 = 5, l2 = Math.abs(o2 - this.__initialTouchLeft), s2 = Math.abs(r2 - this.__initialTouchTop);
1010
+ this.__enableScrollX = this.options.scrollingX && l2 >= e6, this.__enableScrollY = this.options.scrollingY && s2 >= e6, i2.push(this.__scrollLeft, this.__scrollTop, t2), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (l2 >= n3 || s2 >= n3), this.__isDragging && (this.__interruptedAnimation = false);
988
1011
  }
989
1012
  this.__lastTouchLeft = o2, this.__lastTouchTop = r2, this.__lastTouchMove = t2, this.__lastScale = n2;
990
1013
  }
991
- }, doTouchEnd: function(e5) {
992
- if (e5 instanceof Date && (e5 = e5.valueOf()), "number" != typeof e5) throw new Error("Invalid timestamp value: " + e5);
993
- if (this.__isTracking) {
994
- if (this.__isTracking = false, this.__isDragging) if (this.__isDragging = false, this.__isSingleTouch && this.options.animating && e5 - this.__lastTouchMove <= 100) {
995
- for (var t2 = this.__positions, n2 = t2.length - 1, o2 = n2, r2 = n2; r2 > 0 && t2[r2] > this.__lastTouchMove - 100; r2 -= 3) o2 = r2;
996
- if (o2 !== n2) {
997
- var i2 = t2[n2] - t2[o2], l2 = this.__scrollLeft - t2[o2 - 2], s2 = this.__scrollTop - t2[o2 - 1];
998
- this.__decelerationVelocityX = l2 / i2 * (1e3 / 60), this.__decelerationVelocityY = s2 / i2 * (1e3 / 60);
999
- var c2 = this.options.paging || this.options.snapping ? 4 : 1;
1000
- (Math.abs(this.__decelerationVelocityX) > c2 || Math.abs(this.__decelerationVelocityY) > c2) && this.__startDeceleration(e5);
1001
- } else this.options.scrollingComplete();
1002
- } else e5 - this.__lastTouchMove > 100 && this.options.scrollingComplete();
1003
- this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true, this.__zoomLevel)), this.__positions.length = 0;
1004
- }
1005
- }, __publish: function(e5, t2, n2, o2) {
1006
- var r2 = this.__isAnimating;
1007
- if (r2 && (At(r2), this.__isAnimating = false), o2 && this.options.animating) {
1008
- this.__scheduledLeft = e5, this.__scheduledTop = t2, this.__scheduledZoom = n2;
1009
- var i2 = this.__scrollLeft, l2 = this.__scrollTop, s2 = this.__zoomLevel, c2 = e5 - i2, a2 = t2 - l2, d2 = n2 - s2, u2 = function(e6, t3, n3) {
1010
- n3 && (this.__scrollLeft = i2 + c2 * e6, this.__scrollTop = l2 + a2 * e6, this.__zoomLevel = s2 + d2 * e6, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
1011
- }.bind(this), h2 = function(e6) {
1012
- return this.__isAnimating === e6;
1013
- }.bind(this), f2 = function(e6, t3, n3) {
1014
- t3 === this.__isAnimating && (this.__isAnimating = false), (this.__didDecelerationComplete || n3) && this.options.scrollingComplete(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
1014
+ doTouchEnd(e5) {
1015
+ if (e5 instanceof Date && (e5 = e5.valueOf()), "number" != typeof e5) throw new Error("Invalid timestamp value: " + e5);
1016
+ if (this.__isTracking) {
1017
+ if (this.__isTracking = false, this.__isDragging) if (this.__isDragging = false, this.__isSingleTouch && this.options.animating && e5 - this.__lastTouchMove <= 100) {
1018
+ let t2 = this.__positions, n2 = t2.length - 1, o2 = n2;
1019
+ for (let e6 = n2; e6 > 0 && t2[e6] > this.__lastTouchMove - 100; e6 -= 3) o2 = e6;
1020
+ if (o2 !== n2) {
1021
+ const r2 = t2[n2] - t2[o2], i2 = this.__scrollLeft - t2[o2 - 2], l2 = this.__scrollTop - t2[o2 - 1];
1022
+ this.__decelerationVelocityX = i2 / r2 * (1e3 / 60), this.__decelerationVelocityY = l2 / r2 * (1e3 / 60);
1023
+ const s2 = this.options.paging || this.options.snapping ? 4 : 1;
1024
+ (Math.abs(this.__decelerationVelocityX) > s2 || Math.abs(this.__decelerationVelocityY) > s2) && this.__startDeceleration(e5);
1025
+ } else this.options.scrollingComplete?.();
1026
+ } else e5 - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
1027
+ this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true, this.__zoomLevel)), this.__positions.length = 0;
1028
+ }
1029
+ }
1030
+ __publish(e5, t2, n2, o2 = false) {
1031
+ const r2 = this.__isAnimating;
1032
+ if (r2 && (At(r2), this.__isAnimating = 0), o2 && this.options.animating) {
1033
+ this.__scheduledLeft = e5, this.__scheduledTop = t2, this.__scheduledZoom = n2;
1034
+ const o3 = this.__scrollLeft, i2 = this.__scrollTop, l2 = this.__zoomLevel, s2 = e5 - o3, c2 = t2 - i2, a2 = n2 - l2, d2 = function(e6, t3, n3) {
1035
+ n3 && (this.__scrollLeft = o3 + s2 * e6, this.__scrollTop = i2 + c2 * e6, this.__zoomLevel = l2 + a2 * e6, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
1036
+ }.bind(this), u2 = function(e6) {
1037
+ return this.__isAnimating === e6;
1038
+ }.bind(this), h2 = function(e6, t3, n3) {
1039
+ t3 === this.__isAnimating && (this.__isAnimating = false), (this.__didDecelerationComplete || n3) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
1040
+ }.bind(this);
1041
+ this.__isAnimating = $t(d2, u2, h2, this.options.animationDuration, r2 ? Bt : Ft);
1042
+ } else this.__scheduledLeft = this.__scrollLeft = e5, this.__scheduledTop = this.__scrollTop = t2, this.__scheduledZoom = this.__zoomLevel = n2, this.__callback && this.__callback(e5, t2, n2), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
1043
+ }
1044
+ __computeScrollMax(e5 = this.__zoomLevel) {
1045
+ this.__maxScrollLeft = Math.max(this.__contentWidth * e5 - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * e5 - this.__clientHeight, 0);
1046
+ }
1047
+ __startDeceleration(e5) {
1048
+ if (this.options.paging) {
1049
+ const e6 = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), t3 = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), n3 = this.__clientWidth, o3 = this.__clientHeight;
1050
+ this.__minDecelerationScrollLeft = Math.floor(e6 / n3) * n3, this.__minDecelerationScrollTop = Math.floor(t3 / o3) * o3, this.__maxDecelerationScrollLeft = Math.ceil(e6 / n3) * n3, this.__maxDecelerationScrollTop = Math.ceil(t3 / o3) * o3;
1051
+ } else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
1052
+ const t2 = function(e6, t3, n3) {
1053
+ this.__stepThroughDeceleration(n3);
1054
+ }.bind(this), n2 = this.options.snapping ? 4 : 0.1, o2 = function() {
1055
+ const e6 = Math.abs(this.__decelerationVelocityX) >= n2 || Math.abs(this.__decelerationVelocityY) >= n2;
1056
+ return e6 || (this.__didDecelerationComplete = true), e6;
1057
+ }.bind(this), r2 = function(e6, t3, n3) {
1058
+ this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
1015
1059
  }.bind(this);
1016
- this.__isAnimating = $t(u2, h2, f2, this.options.animationDuration, r2 ? Ft : jt);
1017
- } else this.__scheduledLeft = this.__scrollLeft = e5, this.__scheduledTop = this.__scrollTop = t2, this.__scheduledZoom = this.__zoomLevel = n2, this.__callback && this.__callback(e5, t2, n2), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
1018
- }, __computeScrollMax: function(e5) {
1019
- void 0 === e5 && (e5 = this.__zoomLevel), this.__maxScrollLeft = Math.max(this.__contentWidth * e5 - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * e5 - this.__clientHeight, 0);
1020
- }, __startDeceleration: function(e5) {
1021
- if (this.options.paging) {
1022
- var t2 = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), n2 = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), o2 = this.__clientWidth, r2 = this.__clientHeight;
1023
- this.__minDecelerationScrollLeft = Math.floor(t2 / o2) * o2, this.__minDecelerationScrollTop = Math.floor(n2 / r2) * r2, this.__maxDecelerationScrollLeft = Math.ceil(t2 / o2) * o2, this.__maxDecelerationScrollTop = Math.ceil(n2 / r2) * r2;
1024
- } else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
1025
- var i2 = function(e6, t3, n3) {
1026
- this.__stepThroughDeceleration(n3);
1027
- }.bind(this), l2 = this.options.snapping ? 4 : 0.1, s2 = function() {
1028
- var e6 = Math.abs(this.__decelerationVelocityX) >= l2 || Math.abs(this.__decelerationVelocityY) >= l2;
1029
- return e6 || (this.__didDecelerationComplete = true), e6;
1030
- }.bind(this), c2 = function(e6, t3, n3) {
1031
- this.__isDecelerating = false, this.__didDecelerationComplete && this.options.scrollingComplete(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
1032
- }.bind(this);
1033
- this.__isDecelerating = $t(i2, s2, c2);
1034
- }, __stepThroughDeceleration: function(e5) {
1035
- var t2 = this.__scrollLeft + this.__decelerationVelocityX, n2 = this.__scrollTop + this.__decelerationVelocityY;
1036
- if (!this.options.bouncing) {
1037
- var o2 = Math.max(Math.min(this.__maxDecelerationScrollLeft, t2), this.__minDecelerationScrollLeft);
1038
- o2 !== t2 && (t2 = o2, this.__decelerationVelocityX = 0);
1039
- var r2 = Math.max(Math.min(this.__maxDecelerationScrollTop, n2), this.__minDecelerationScrollTop);
1040
- r2 !== n2 && (n2 = r2, this.__decelerationVelocityY = 0);
1041
- }
1042
- if (e5 ? this.__publish(t2, n2, this.__zoomLevel) : (this.__scrollLeft = t2, this.__scrollTop = n2), this.options.paging || (this.__decelerationVelocityX *= 0.95, this.__decelerationVelocityY *= 0.95), this.options.bouncing) {
1043
- var i2 = 0, l2 = 0, s2 = this.options.penetrationDeceleration, c2 = this.options.penetrationAcceleration;
1044
- t2 < this.__minDecelerationScrollLeft ? i2 = this.__minDecelerationScrollLeft - t2 : t2 > this.__maxDecelerationScrollLeft && (i2 = this.__maxDecelerationScrollLeft - t2), n2 < this.__minDecelerationScrollTop ? l2 = this.__minDecelerationScrollTop - n2 : n2 > this.__maxDecelerationScrollTop && (l2 = this.__maxDecelerationScrollTop - n2), 0 !== i2 && (i2 * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += i2 * s2 : this.__decelerationVelocityX = i2 * c2), 0 !== l2 && (l2 * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += l2 * s2 : this.__decelerationVelocityY = l2 * c2);
1045
- }
1046
- } };
1047
- const Wt = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), Ht = {};
1048
- function Nt() {
1060
+ this.__isDecelerating = $t(t2, o2, r2);
1061
+ }
1062
+ __stepThroughDeceleration(e5) {
1063
+ let t2 = this.__scrollLeft + this.__decelerationVelocityX, n2 = this.__scrollTop + this.__decelerationVelocityY;
1064
+ if (!this.options.bouncing) {
1065
+ const e6 = Math.max(Math.min(this.__maxDecelerationScrollLeft, t2), this.__minDecelerationScrollLeft);
1066
+ e6 !== t2 && (t2 = e6, this.__decelerationVelocityX = 0);
1067
+ const o2 = Math.max(Math.min(this.__maxDecelerationScrollTop, n2), this.__minDecelerationScrollTop);
1068
+ o2 !== n2 && (n2 = o2, this.__decelerationVelocityY = 0);
1069
+ }
1070
+ if (e5 ? this.__publish(t2, n2, this.__zoomLevel) : (this.__scrollLeft = t2, this.__scrollTop = n2), !this.options.paging) {
1071
+ const e6 = 0.95;
1072
+ this.__decelerationVelocityX *= e6, this.__decelerationVelocityY *= e6;
1073
+ }
1074
+ if (this.options.bouncing) {
1075
+ let e6 = 0, o2 = 0, r2 = this.options.penetrationDeceleration, i2 = this.options.penetrationAcceleration;
1076
+ t2 < this.__minDecelerationScrollLeft ? e6 = this.__minDecelerationScrollLeft - t2 : t2 > this.__maxDecelerationScrollLeft && (e6 = this.__maxDecelerationScrollLeft - t2), n2 < this.__minDecelerationScrollTop ? o2 = this.__minDecelerationScrollTop - n2 : n2 > this.__maxDecelerationScrollTop && (o2 = this.__maxDecelerationScrollTop - n2), 0 !== e6 && (e6 * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += e6 * r2 : this.__decelerationVelocityX = e6 * i2), 0 !== o2 && (o2 * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += o2 * r2 : this.__decelerationVelocityY = o2 * i2);
1077
+ }
1078
+ }
1079
+ }
1080
+ const Vt = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), Wt = {};
1081
+ function Ht() {
1049
1082
  return ft;
1050
1083
  }
1051
- const Ut = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: Ht, boundPixel: function(e5, t2 = false, n2 = 0) {
1084
+ const Nt = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: Wt, boundPixel: function(e5, t2 = false, n2 = 0) {
1052
1085
  return e5;
1053
1086
  }, createSyntheticEvent: (e5) => {
1054
1087
  let t2 = false, n2 = false;
@@ -1058,8 +1091,8 @@ const Ut = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProper
1058
1091
  n2 = true, e5.stopPropagation();
1059
1092
  }, isPropagationStopped: () => n2, persist: () => {
1060
1093
  }, timeStamp: e5.timeStamp, type: e5.type };
1061
- }, detectIt: Nt, focusableNodeNames: Wt, toPrettyKeyCode: (e5) => "BracketLeft" === e5 ? "[" : "BracketRight" === e5 ? "]" : Me.camelToPrettyCase(e5) }, Symbol.toStringTag, { value: "Module" })), Kt = [];
1062
- function qt(e5, t2, n2 = Kt) {
1094
+ }, detectIt: Ht, focusableNodeNames: Vt, toPrettyKeyCode: (e5) => "BracketLeft" === e5 ? "[" : "BracketRight" === e5 ? "]" : Me.camelToPrettyCase(e5) }, Symbol.toStringTag, { value: "Module" })), Ut = [];
1095
+ function Kt(e5, t2, n2 = Ut) {
1063
1096
  const o2 = l(null);
1064
1097
  return c(e5, () => {
1065
1098
  if (!o2.current) return;
@@ -1073,30 +1106,30 @@ function qt(e5, t2, n2 = Kt) {
1073
1106
  return e6;
1074
1107
  }, n2), o2;
1075
1108
  }
1076
- const Yt = (t2) => e(Ot, { ...t2 }), Xt = ({ width: t2, height: n2 }) => e("div", { className: "corner", style: { minWidth: `${t2}px`, width: `${t2}px`, minHeight: `${n2}px`, height: `${n2}px` } }), Gt = r(a((o2, r2) => {
1077
- const { children: c2, viewport: a2, onScrollViewport: u2, showHorizontalScrollbar: h2 = true, showVerticalScrollbar: f2 = true, createScrollCorner: p2 = Xt, createHorizontalScrollbar: g2 = Yt, createVerticalScrollbar: m2 = Yt, style: x2, touchElement: y2, disableTouch: v2, ...b2 } = o2, S2 = Tt(u2, [u2]), E2 = qt(r2, () => ({ isScrollPane: () => true }), []), _2 = l(null);
1109
+ const qt = (t2) => e(Ot, { ...t2 }), Yt = ({ width: t2, height: n2 }) => e("div", { className: "corner", style: { minWidth: `${t2}px`, width: `${t2}px`, minHeight: `${n2}px`, height: `${n2}px` } }), Xt = r(a((o2, r2) => {
1110
+ const { children: c2, viewport: a2, onScrollViewport: u2, showHorizontalScrollbar: h2 = true, showVerticalScrollbar: f2 = true, createScrollCorner: p2 = Yt, createHorizontalScrollbar: g2 = qt, createVerticalScrollbar: m2 = qt, style: x2, touchElement: y2, disableTouch: v2, ...b2 } = o2, S2 = Tt(u2, [u2]), _2 = Kt(r2, () => ({ isScrollPane: () => true }), []), E2 = l(null);
1078
1111
  s(() => {
1079
- _2.current && (_2.current.__scrollTop === a2?.top && _2.current.__scrollLeft !== !a2?.left || _2.current?.scrollTo(a2?.left, a2?.top, false));
1112
+ E2.current && (E2.current.__scrollTop === a2?.top && E2.current.__scrollLeft === a2?.left || E2.current.__isDecelerating || E2.current?.scrollTo(a2?.left, a2?.top, false));
1080
1113
  }, [a2?.left, a2?.top, y2]);
1081
1114
  const I2 = i((e5, t2) => {
1082
1115
  S2?.({ left: e5, top: t2 });
1083
1116
  }, []), C2 = i((e5) => {
1084
- _2.current?.doTouchStart(e5.touches, e5.timeStamp);
1117
+ E2.current?.doTouchStart(e5.touches, e5.timeStamp);
1085
1118
  }, []), M2 = i((e5) => {
1086
- e5.preventDefault(), _2.current?.doTouchMove(e5.touches, e5.timeStamp);
1119
+ e5.preventDefault(), E2.current?.doTouchMove(e5.touches, e5.timeStamp);
1087
1120
  }, []), T2 = i((e5) => {
1088
- _2.current?.doTouchEnd(e5.timeStamp);
1121
+ E2.current?.doTouchEnd(e5.timeStamp);
1089
1122
  }, []), k2 = i(({ containerWidth: e5, containerHeight: t2, totalWidth: n2, totalHeight: o3 }) => {
1090
- _2.current.setDimensions(e5, t2, n2, o3);
1123
+ E2.current.setDimensions(e5, t2, n2, o3);
1091
1124
  }, []);
1092
1125
  s(() => {
1093
- const e5 = y2 ?? E2.current;
1094
- if (!v2 && Nt().supportsTouchEvents && e5 && a2) {
1095
- if (!_2.current) {
1126
+ const e5 = y2 ?? _2.current;
1127
+ if (!v2 && Ht().supportsTouchEvents && e5 && a2) {
1128
+ if (!E2.current) {
1096
1129
  const e6 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
1097
- _2.current = new Vt(I2, e6);
1130
+ E2.current = new jt(I2, e6);
1098
1131
  }
1099
- Nt().supportsTouchEvents && (e5.addEventListener("touchstart", C2), e5.addEventListener("touchend", T2), e5.addEventListener("touchmove", M2)), k2({ containerWidth: a2?.width, containerHeight: a2?.height, totalWidth: a2?.totalWidth, totalHeight: a2?.totalHeight });
1132
+ Ht().supportsTouchEvents && (e5.addEventListener("touchstart", C2), e5.addEventListener("touchend", T2), e5.addEventListener("touchmove", M2)), k2({ containerWidth: a2?.width, containerHeight: a2?.height, totalWidth: a2?.totalWidth, totalHeight: a2?.totalHeight });
1100
1133
  }
1101
1134
  return () => {
1102
1135
  e5?.removeEventListener("touchstart", C2), e5?.removeEventListener("touchend", T2), e5?.removeEventListener("touchmove", M2);
@@ -1111,15 +1144,15 @@ const Yt = (t2) => e(Ot, { ...t2 }), Xt = ({ width: t2, height: n2 }) => e("div"
1111
1144
  const o3 = g2({ orientation: Mt.Horizontal, offset: a2?.left, viewportSize: a2?.width, totalSize: a2?.totalWidth, onScrollOffset: (e5) => S2?.({ left: e5 }) });
1112
1145
  return t("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [e("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${P2}px)` }, children: e("div", { ref: O2, className: "sizer", children: o3 }) }), f2 ? p2({ width: P2, height: L2 }) : e(n, {})] });
1113
1146
  }, [g2, a2?.left, a2?.width, a2?.totalWidth, f2, p2, P2, L2]);
1114
- return e("div", { style: { position: "relative", display: "flex", minWidth: f2 ? `${P2}px` : void 0, minHeight: h2 ? `${L2}px` : void 0, ...x2 }, ...b2, ref: E2, children: t("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [t("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [e("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: c2 }), f2 ? D2 : e(n, {})] }), h2 ? z2 : e(n, {})] }) });
1147
+ return e("div", { style: { position: "relative", display: "flex", minWidth: f2 ? `${P2}px` : void 0, minHeight: h2 ? `${L2}px` : void 0, ...x2 }, ...b2, ref: _2, children: t("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [t("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [e("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: c2 }), f2 ? D2 : e(n, {})] }), h2 ? z2 : e(n, {})] }) });
1115
1148
  }));
1116
- Gt.displayName = "ScrollPane";
1117
- const Zt = () => {
1149
+ Xt.displayName = "ScrollPane";
1150
+ const Gt = () => {
1118
1151
  const e5 = document.fullscreenElement;
1119
1152
  return e5 ? e5.querySelector(".fullscreen-portal-root") || e5 : document.body;
1120
1153
  };
1121
- let Jt = 0;
1122
- function Qt() {
1154
+ let Zt = 0;
1155
+ function Jt() {
1123
1156
  return s(() => {
1124
1157
  function e5() {
1125
1158
  const e6 = document.fullscreenElement;
@@ -1127,24 +1160,24 @@ function Qt() {
1127
1160
  let t2 = e6.querySelector(".fullscreen-portal-root");
1128
1161
  t2 || (t2 = document.createElement("div"), t2.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", e6.appendChild(t2));
1129
1162
  }
1130
- return Jt++, e5(), document.addEventListener("fullscreenchange", e5), () => {
1131
- document.removeEventListener("fullscreenchange", e5), Jt--, Jt <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((e6) => {
1163
+ return Zt++, e5(), document.addEventListener("fullscreenchange", e5), () => {
1164
+ document.removeEventListener("fullscreenchange", e5), Zt--, Zt <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((e6) => {
1132
1165
  e6.parentNode && e6.parentNode.removeChild(e6);
1133
- }), Jt = 0);
1166
+ }), Zt = 0);
1134
1167
  };
1135
- }, []), { getPortalContainer: Zt };
1168
+ }, []), { getPortalContainer: Gt };
1136
1169
  }
1137
- const en = 100, tn = 100, nn = 1e6, on = 100, rn = 50;
1170
+ const Qt = 100, en = 100, tn = 1e6, nn = 100, on = 50;
1138
1171
  r(a((t2, n2) => {
1139
- const { offset: o2 = 0, viewportSize: r2 = 0, totalSize: s2 = 0, minSize: c2 = 0, endGap: a2 = en, endScrollIncrement: d2 = tn, style: f2 = Ht, onMouseDown: p2, onScrollOffset: g2, onScroll: w2, scaleLimit: m2 = nn, scaleFactor: x2 = on, precisionFactor: y2 = rn, ...v2 } = t2;
1172
+ const { offset: o2 = 0, viewportSize: r2 = 0, totalSize: s2 = 0, minSize: c2 = 0, endGap: a2 = Qt, endScrollIncrement: d2 = en, style: f2 = Wt, onMouseDown: p2, onScrollOffset: g2, onScroll: w2, scaleLimit: m2 = tn, scaleFactor: x2 = nn, precisionFactor: y2 = on, ...v2 } = t2;
1140
1173
  w2 && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
1141
- const b2 = Tt(p2, [p2]), S2 = () => ({ offset: o2, totalSize: 0 === m2 ? s2 : Math.min(s2 ?? 0, Math.max(c2 ?? 0, (o2 ?? 0) + (r2 ?? 0)) + (a2 ?? 0)) }), [E2, _2] = h(S2), I2 = 0 !== m2 && E2.totalSize > m2 ? x2 : 1, C2 = I2 / y2, M2 = Math.ceil(E2.totalSize / I2), T2 = Math.ceil(E2.offset / I2), k2 = Math.ceil(r2 / I2), R2 = i((e5) => {
1174
+ const b2 = Tt(p2, [p2]), S2 = () => ({ offset: o2, totalSize: 0 === m2 ? s2 : Math.min(s2 ?? 0, Math.max(c2 ?? 0, (o2 ?? 0) + (r2 ?? 0)) + (a2 ?? 0)) }), [_2, E2] = h(S2), I2 = 0 !== m2 && _2.totalSize > m2 ? x2 : 1, C2 = I2 / y2, M2 = Math.ceil(_2.totalSize / I2), T2 = Math.ceil(_2.offset / I2), k2 = Math.ceil(r2 / I2), R2 = i((e5) => {
1142
1175
  }, []), [P2, O2] = h(false), L2 = l(null);
1143
1176
  u(() => {
1144
1177
  if (!P2) {
1145
1178
  L2.current = { propTotalSize: s2, propViewportSize: r2, propOffset: o2 };
1146
1179
  const e5 = S2();
1147
- _2(e5);
1180
+ E2(e5);
1148
1181
  }
1149
1182
  }, [s2, r2, o2, P2, c2, a2, d2]);
1150
1183
  const D2 = Tt((e5, t3, n3) => {
@@ -1218,23 +1251,23 @@ r(a((t2, n2) => {
1218
1251
  return e7 + t4.join(" ") + " ";
1219
1252
  }, "");
1220
1253
  }(`M 0 ${n2} L ${u2 - 0.5} ${n2} L ${u2 - 0.5} ${o2} L ${2 * u2} ${o2} L ${x2 - 2 * u2} ${o2} M ${x2 - 2 * u2} ${o2} L ${x2 - u2} ${o2} L ${x2 - u2} ${n2} L ${x2} ${n2}`, u2);
1221
- }, S2 = d(() => b2(h2), [x2, y2, u2, h2]), E2 = d(() => {
1254
+ }, S2 = d(() => b2(h2), [x2, y2, u2, h2]), _2 = d(() => {
1222
1255
  if (0 === u2) return;
1223
1256
  const e5 = u2 / 2;
1224
1257
  return b2(u2) + `L ${x2} 0 L 0 0 L 0 ${e5}`;
1225
- }, [S2, u2, h2]), _2 = d(() => ({ style: { clipPath: `path('${E2}')` } }), [E2]);
1226
- return t("div", { className: s2, style: { display: "flex", flexDirection: "row", ...c2 }, ...p2, ref: m([v2, g2, i2]), children: [o.isValidElement(a2) ? o.cloneElement(a2, _2) : e(n, {}), e("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: x2, height: y2, viewBox: `0 0 ${x2} ${y2}`, children: e("path", { d: S2, stroke: f2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: h2 }) })] });
1258
+ }, [S2, u2, h2]), E2 = d(() => ({ style: { clipPath: `path('${_2}')` } }), [_2]);
1259
+ return t("div", { className: s2, style: { display: "flex", flexDirection: "row", ...c2 }, ...p2, ref: m([v2, g2, i2]), children: [o.isValidElement(a2) ? o.cloneElement(a2, E2) : e(n, {}), e("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: x2, height: y2, viewBox: `0 0 ${x2} ${y2}`, children: e("path", { d: S2, stroke: f2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: h2 }) })] });
1227
1260
  }));
1228
- const ln = {}, sn = (t2) => {
1229
- const { onPointerDown: n2, style: o2, splitDirection: r2, paddingBefore: i2 = 0, paddingAfter: l2 = 0, disabled: s2, key: c2, hitAreaProps: a2 = ln, ...d2 } = t2, u2 = "row" === r2, { style: h2, className: f2, ...p2 } = a2;
1261
+ const rn = {}, ln = (t2) => {
1262
+ const { onPointerDown: n2, style: o2, splitDirection: r2, paddingBefore: i2 = 0, paddingAfter: l2 = 0, disabled: s2, key: c2, hitAreaProps: a2 = rn, ...d2 } = t2, u2 = "row" === r2, { style: h2, className: f2, ...p2 } = a2;
1230
1263
  return e("div", { style: { ...o2, position: "relative" }, ...d2, children: e("div", { className: g("hit-box", f2), style: { left: (u2 ? -i2 : 0) + "px", width: `calc(100% + ${u2 ? i2 + l2 : 0}px)`, top: (u2 ? 0 : -i2) + "px", height: `calc(100% + ${u2 ? 0 : i2 + l2}px)`, position: "absolute", ...h2 }, onPointerDown: s2 ? void 0 : n2, ...p2 }) }, c2);
1231
- }, cn = {}, an = (e5, t2, n2 = true) => null === e5 ? null : null !== e5.pixels ? n2 ? e5.pixels : t2 - e5.pixels : (n2 ? e5.percent : 100 - e5.percent) / 100 * t2, dn = (e5, t2 = true) => e5?.percent ? `${t2 ? e5.percent : 100 - e5.percent}%` : e5?.pixels ? `${e5.pixels}px` : void 0, un = (e5, t2) => {
1264
+ }, sn = {}, cn = (e5, t2, n2 = true) => null === e5 ? null : null !== e5.pixels ? n2 ? e5.pixels : t2 - e5.pixels : (n2 ? e5.percent : 100 - e5.percent) / 100 * t2, an = (e5, t2 = true) => e5?.percent ? `${t2 ? e5.percent : 100 - e5.percent}%` : e5?.pixels ? `${e5.pixels}px` : void 0, dn = (e5, t2) => {
1232
1265
  if (null == e5) return null;
1233
1266
  const n2 = { percent: null, pixels: null };
1234
1267
  let o2 = t2;
1235
1268
  return "string" == typeof e5 && ((e5 = e5.trim().toLowerCase()).endsWith("px") ? (e5 = e5.substring(0, e5.length - 2), o2 = false) : e5.endsWith("%") && (e5 = e5.substring(0, e5.length - 1), o2 = true), e5 = parseFloat(e5)), o2 ? n2.percent = e5 : n2.pixels = e5, Object.freeze(n2);
1236
1269
  };
1237
- function hn(e5) {
1270
+ function un(e5) {
1238
1271
  if (!e5) throw new Error("must have a PointerHandlerOptions");
1239
1272
  const { onPointerDown: t2, onPointerUp: n2, onPointerMoveOrWait: o2, processTouch: r2 = false, consumeTouch: c2 = true } = e5, a2 = Tt(t2, [t2]), d2 = Tt(n2, [n2]), u2 = Tt(o2, [o2]), h2 = l(false), f2 = e5?.timerInitial ?? 230, p2 = e5?.timerContinuous ?? f2 / 2, g2 = l(null), w2 = l(null), m2 = l(null), x2 = l(null), y2 = i(() => {
1240
1273
  x2.current && (clearTimeout(x2.current), x2.current = null);
@@ -1248,12 +1281,12 @@ function hn(e5) {
1248
1281
  s(() => () => y2(), []);
1249
1282
  const b2 = r2 ? "pointer" : "mouse", S2 = i((e6) => {
1250
1283
  e6.stopPropagation(), e6.stopImmediatePropagation(), e6.preventDefault();
1251
- }, []), E2 = Tt((e6) => {
1252
- document.removeEventListener(`${b2}move`, C2), document.removeEventListener(`${b2}up`, E2), document.removeEventListener("keydown", M2), document.removeEventListener("keyup", T2), document.removeEventListener("touchstart", S2, { capture: true }), document.removeEventListener("touchmove", S2, { capture: true }), window.removeEventListener("blur", _2), y2(), window.requestAnimationFrame(() => {
1284
+ }, []), _2 = Tt((e6) => {
1285
+ document.removeEventListener(`${b2}move`, C2), document.removeEventListener(`${b2}up`, _2), document.removeEventListener("keydown", M2), document.removeEventListener("keyup", T2), document.removeEventListener("touchstart", S2, { capture: true }), document.removeEventListener("touchmove", S2, { capture: true }), window.removeEventListener("blur", E2), y2(), window.requestAnimationFrame(() => {
1253
1286
  false !== h2.current && (h2.current = false, d2?.(e6, m2.current, g2.current), m2.current = null);
1254
1287
  });
1255
- }, []), _2 = i(() => {
1256
- false !== h2.current && (h2.current = false, E2(w2.current));
1288
+ }, []), E2 = i(() => {
1289
+ false !== h2.current && (h2.current = false, _2(w2.current));
1257
1290
  }, []), I2 = Tt(() => {
1258
1291
  y2(), v2(p2), window.requestAnimationFrame(() => {
1259
1292
  false !== h2.current && u2?.(w2.current, m2.current, g2.current);
@@ -1266,30 +1299,30 @@ function hn(e5) {
1266
1299
  m2.current = { ctrlKey: e6.ctrlKey, shiftKey: e6.shiftKey, altKey: e6.altKey, metaKey: e6.metaKey }, I2();
1267
1300
  }, [p2]);
1268
1301
  return Tt((e6) => {
1269
- e6.isDefaultPrevented() || (m2.current = { ctrlKey: e6.ctrlKey, shiftKey: e6.shiftKey, altKey: e6.altKey, metaKey: e6.metaKey }, false !== a2(e6, m2.current) && (g2.current = e6, w2.current = e6.nativeEvent, document.addEventListener(`${b2}up`, E2, { passive: false }), document.addEventListener(`${b2}move`, C2, { passive: false }), document.addEventListener("keydown", M2, { passive: false }), document.addEventListener("keyup", T2, { passive: false }), window.addEventListener("blur", _2, { passive: true }), r2 && c2 && (document.addEventListener("touchstart", S2, { passive: false, capture: true }), document.addEventListener("touchmove", S2, { passive: false, capture: true })), h2.current = true, v2(f2)));
1302
+ e6.isDefaultPrevented() || (m2.current = { ctrlKey: e6.ctrlKey, shiftKey: e6.shiftKey, altKey: e6.altKey, metaKey: e6.metaKey }, false !== a2(e6, m2.current) && (g2.current = e6, w2.current = e6.nativeEvent, document.addEventListener(`${b2}up`, _2, { passive: false }), document.addEventListener(`${b2}move`, C2, { passive: false }), document.addEventListener("keydown", M2, { passive: false }), document.addEventListener("keyup", T2, { passive: false }), window.addEventListener("blur", E2, { passive: true }), r2 && c2 && (document.addEventListener("touchstart", S2, { passive: false, capture: true }), document.addEventListener("touchmove", S2, { passive: false, capture: true })), h2.current = true, v2(f2)));
1270
1303
  }, [f2, r2]);
1271
1304
  }
1272
1305
  r(a((n2, r2) => {
1273
- const { elementBefore: i2, elementAfter: c2, splitDirection: a2 = "row", fixedPane: u2 = null, position: f2, onPositionChange: p2, minBefore: x2, maxBefore: y2, minAfter: v2, maxAfter: b2, children: S2, className: E2, style: _2, disabled: I2 = false, onDragStart: C2, onDragResize: M2, onDragFinish: T2, resizerProps: k2 = cn, paneProps: R2 = cn, paneBeforeProps: P2 = cn, paneAfterProps: O2 = cn, createResizer: L2 = sn } = n2;
1306
+ const { elementBefore: i2, elementAfter: c2, splitDirection: a2 = "row", fixedPane: u2 = null, position: f2, onPositionChange: p2, minBefore: x2, maxBefore: y2, minAfter: v2, maxAfter: b2, children: S2, className: _2, style: E2, disabled: I2 = false, onDragStart: C2, onDragResize: M2, onDragFinish: T2, resizerProps: k2 = sn, paneProps: R2 = sn, paneBeforeProps: P2 = sn, paneAfterProps: O2 = sn, createResizer: L2 = ln } = n2;
1274
1307
  if (S2) throw new Error("Use elementBefore and elementAfter instead of children.");
1275
1308
  const D2 = d(() => o.isValidElement(c2) && o.isValidElement(i2), [c2, i2]), z2 = d(() => {
1276
1309
  let e5 = null;
1277
1310
  u2 && ("before" === u2 ? e5 = 0 : "after" === u2 && (e5 = 1));
1278
1311
  const t2 = null === e5;
1279
- return { fixedPaneOffset: e5, isPercent: t2, minBefore: un(x2, t2), maxBefore: un(y2, t2), minAfter: un(v2, t2), maxAfter: un(b2, t2) };
1280
- }, [x2, y2, v2, b2]), A2 = Tt(p2, [p2]), [$2, B2] = h(() => un(f2, null === u2));
1312
+ return { fixedPaneOffset: e5, isPercent: t2, minBefore: dn(x2, t2), maxBefore: dn(y2, t2), minAfter: dn(v2, t2), maxAfter: dn(b2, t2) };
1313
+ }, [x2, y2, v2, b2]), A2 = Tt(p2, [p2]), [$2, B2] = h(() => dn(f2, null === u2));
1281
1314
  s(() => {
1282
- B2(un(f2, null === u2));
1315
+ B2(dn(f2, null === u2));
1283
1316
  }, [f2, u2]);
1284
1317
  const [F2, { width: j2, height: V2 }] = w(), [W2, { width: H2, height: N2 }] = w(), U2 = "row" === a2 ? H2 : N2, K2 = "row" === a2 ? j2 : V2, q2 = d(() => ((e5, t2, n3, o2) => {
1285
1318
  const r3 = [null, null], i3 = [null, null];
1286
- if (e5 || (e5 = { percent: null === o2.fixedPaneOffset ? 50 : null, pixels: null === o2.fixedPaneOffset ? null : 0 }), 0 === t2) return null != e5?.pixels ? 1 !== o2.fixedPaneOffset ? (r3[0] = e5?.pixels, i3[1] = 100) : (r3[1] = e5?.pixels - n3, i3[0] = 100) : null != e5?.percent && (1 !== o2.fixedPaneOffset ? (i3[0] = e5?.percent, i3[1] = 100 - e5?.percent) : (i3[1] = e5?.percent, i3[0] = 100 - e5?.percent)), { percents: i3, pixels: r3, minBefore: dn(o2.minBefore, true), maxBefore: dn(o2.maxBefore, true), minAfter: dn(o2.minAfter), maxAfter: dn(o2.maxAfter) };
1287
- let l2 = an(e5, t2, 1 !== o2.fixedPaneOffset), s2 = t2 - n3, c3 = an(o2.minBefore, s2, true) ?? 0, a3 = an(o2.maxBefore, s2, true) ?? s2, d2 = 0, u3 = 0, h2 = 0, f3 = s2;
1288
- d2 = (an(o2.maxAfter, t2, false) ?? n3) - n3, u3 = an(o2.minAfter, t2, false) ?? t2, h2 = Math.max(c3, d2), f3 = Math.min(a3, u3), l2 = Math.max(h2, Math.min(l2, f3)), u3 = Math.min(s2 - l2, an(o2.maxAfter, s2 - l2, true) ?? s2), d2 = Math.min(s2 - l2, an(o2.minAfter, s2 - l2, true) ?? s2), r3[0] = l2, r3[1] = s2 - r3[0];
1319
+ if (e5 || (e5 = { percent: null === o2.fixedPaneOffset ? 50 : null, pixels: null === o2.fixedPaneOffset ? null : 0 }), 0 === t2) return null != e5?.pixels ? 1 !== o2.fixedPaneOffset ? (r3[0] = e5?.pixels, i3[1] = 100) : (r3[1] = e5?.pixels - n3, i3[0] = 100) : null != e5?.percent && (1 !== o2.fixedPaneOffset ? (i3[0] = e5?.percent, i3[1] = 100 - e5?.percent) : (i3[1] = e5?.percent, i3[0] = 100 - e5?.percent)), { percents: i3, pixels: r3, minBefore: an(o2.minBefore, true), maxBefore: an(o2.maxBefore, true), minAfter: an(o2.minAfter), maxAfter: an(o2.maxAfter) };
1320
+ let l2 = cn(e5, t2, 1 !== o2.fixedPaneOffset), s2 = t2 - n3, c3 = cn(o2.minBefore, s2, true) ?? 0, a3 = cn(o2.maxBefore, s2, true) ?? s2, d2 = 0, u3 = 0, h2 = 0, f3 = s2;
1321
+ d2 = (cn(o2.maxAfter, t2, false) ?? n3) - n3, u3 = cn(o2.minAfter, t2, false) ?? t2, h2 = Math.max(c3, d2), f3 = Math.min(a3, u3), l2 = Math.max(h2, Math.min(l2, f3)), u3 = Math.min(s2 - l2, cn(o2.maxAfter, s2 - l2, true) ?? s2), d2 = Math.min(s2 - l2, cn(o2.minAfter, s2 - l2, true) ?? s2), r3[0] = l2, r3[1] = s2 - r3[0];
1289
1322
  const p3 = Math.max(0, Math.min(100, l2 / s2 * 100));
1290
1323
  return i3[0] = p3, i3[1] = 100 - i3[0], { percents: i3, pixels: r3, minBefore: `${c3}px`, minAfter: `${d2}px`, maxBefore: `${r3[0]}px`, maxAfter: `${r3[1]}px` };
1291
- })($2, K2, U2, z2), [z2, $2, K2, U2, a2]), [Y2, X2] = h(false), G2 = Tt(C2, [C2]), Z2 = Tt(M2, [M2]), J2 = Tt(T2, [T2]), Q2 = l(null), ee2 = l(null), te2 = l(null), { style: ne2, className: oe2, ...re2 } = R2, ie2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ...ne2 }, { className: le2, style: se2, ...ce2 } = P2, { className: ae2, style: de2, ...ue2 } = O2, he2 = { flex: "1 1 100%", width: "100%", ..._2, flexDirection: a2, display: "flex" }, { className: fe2, style: pe2, onPointerDown: ge2, ...we2 } = k2, me2 = Tt((e5) => {
1292
- const t2 = un(e5, null === u2);
1324
+ })($2, K2, U2, z2), [z2, $2, K2, U2, a2]), [Y2, X2] = h(false), G2 = Tt(C2, [C2]), Z2 = Tt(M2, [M2]), J2 = Tt(T2, [T2]), Q2 = l(null), ee2 = l(null), te2 = l(null), { style: ne2, className: oe2, ...re2 } = R2, ie2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ...ne2 }, { className: le2, style: se2, ...ce2 } = P2, { className: ae2, style: de2, ...ue2 } = O2, he2 = { flex: "1 1 100%", width: "100%", ...E2, flexDirection: a2, display: "flex" }, { className: fe2, style: pe2, onPointerDown: ge2, ...we2 } = k2, me2 = Tt((e5) => {
1325
+ const t2 = dn(e5, null === u2);
1293
1326
  B2(t2);
1294
1327
  }, [u2]), xe2 = Tt((e5) => {
1295
1328
  if (I2 || !Y2) return;
@@ -1298,7 +1331,7 @@ r(a((n2, r2) => {
1298
1331
  n3 = "row" === a2 ? (e5.clientX ?? e5.touches?.[0]?.clientX) - t2.x : (e5.clientY ?? e5.touches?.[0]?.clientY) - t2.y, n3 = Math.max(0, Math.min(K2, n3)), 1 === z2.fixedPaneOffset && (n3 = K2 - n3), f2 && $2.pixels === n3 || B2({ pixels: n3, percent: null }), Z2?.(n3), e5.stopPropagation(), e5.preventDefault();
1299
1332
  }, [z2, a2, I2, Y2, $2, K2]), ye2 = Tt((e5) => {
1300
1333
  if (document.removeEventListener("pointermove", xe2), document.removeEventListener("touchmove", xe2), document.removeEventListener("pointerup", ye2), Y2 && (X2(false), $2)) {
1301
- if (J2($2.pixels), !un(f2, null === u2) || $2.pixels !== f2) {
1334
+ if (J2($2.pixels), !dn(f2, null === u2) || $2.pixels !== f2) {
1302
1335
  const e6 = { ...$2 };
1303
1336
  null === e6.percent && (e6.percent = e6.pixels / K2 * 100), A2(e6);
1304
1337
  }
@@ -1306,34 +1339,34 @@ r(a((n2, r2) => {
1306
1339
  }
1307
1340
  }, [$2, Y2, f2, u2, K2]), ve2 = Tt((e5) => {
1308
1341
  ge2?.(e5), e5.defaultPrevented || I2 || Y2 || (X2(true), G2(), document.addEventListener("pointermove", xe2, { passive: false }), document.addEventListener("touchmove", xe2, { passive: false }), document.addEventListener("pointerup", ye2, { passive: false }));
1309
- }, [ge2]), be2 = qt(r2, () => ({ setPosition: me2, isSplitPane: () => true }), []), Se2 = d(() => D2 ? L2?.({ key: "resizer", ref: m([W2, ee2]), className: g("resizer", fe2), onPointerDownCapture: ve2, style: { cursor: I2 ? void 0 : "row" === a2 ? "ew-resize" : "ns-resize", minWidth: "row" === a2 ? "2px" : void 0, minHeight: "row" !== a2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...pe2 }, splitDirection: a2, disabled: I2, ...we2 }) : null, [D2, fe2, we2, a2, pe2, I2]), Ee2 = "row" === a2 ? "Width" : "Height", _e2 = { ...ie2, ...se2, flex: 0 === z2.fixedPaneOffset && null !== q2?.pixels[0] ? `0 0 ${Math.round(q2?.pixels[0])}px` : `1 1 ${Math.round(q2?.percents[0] ?? 100)}%`, [`min${Ee2}`]: q2?.minBefore, [`max${Ee2}`]: c2 ? q2?.maxBefore : "100%" }, Ie2 = { ...ie2, ...de2, flex: 1 === z2.fixedPaneOffset && null !== q2?.pixels[1] ? `0 0 ${Math.round(q2?.pixels[1])}px` : `1 1 ${Math.round(q2?.percents[1] ?? 100)}%`, [`min${Ee2}`]: q2?.minAfter, [`max${Ee2}`]: i2 ? q2?.maxAfter : "100%" }, Ce2 = d(() => i2 ? e("div", { ref: Q2, className: g("before", oe2, le2), style: _e2, ...re2, ...ce2, children: i2 }, "before") : null, [i2, R2, P2, z2, q2]), Me2 = d(() => c2 ? e("div", { ref: te2, className: g("after", oe2, ae2), style: Ie2, ...re2, ...ue2, children: c2 }, "after") : null, [c2, R2, O2, z2, q2]);
1310
- return t("div", { ref: m([F2, be2]), className: g("splitPane", "row" === a2 ? "vertical" : "horizontal", { dragging: Y2 }, E2), style: he2, children: [Ce2, Se2, Me2] });
1342
+ }, [ge2]), be2 = Kt(r2, () => ({ setPosition: me2, isSplitPane: () => true }), []), Se2 = d(() => D2 ? L2?.({ key: "resizer", ref: m([W2, ee2]), className: g("resizer", fe2), onPointerDownCapture: ve2, style: { cursor: I2 ? void 0 : "row" === a2 ? "ew-resize" : "ns-resize", minWidth: "row" === a2 ? "2px" : void 0, minHeight: "row" !== a2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...pe2 }, splitDirection: a2, disabled: I2, ...we2 }) : null, [D2, fe2, we2, a2, pe2, I2]), _e2 = "row" === a2 ? "Width" : "Height", Ee2 = { ...ie2, ...se2, flex: 0 === z2.fixedPaneOffset && null !== q2?.pixels[0] ? `0 0 ${Math.round(q2?.pixels[0])}px` : `1 1 ${Math.round(q2?.percents[0] ?? 100)}%`, [`min${_e2}`]: q2?.minBefore, [`max${_e2}`]: c2 ? q2?.maxBefore : "100%" }, Ie2 = { ...ie2, ...de2, flex: 1 === z2.fixedPaneOffset && null !== q2?.pixels[1] ? `0 0 ${Math.round(q2?.pixels[1])}px` : `1 1 ${Math.round(q2?.percents[1] ?? 100)}%`, [`min${_e2}`]: q2?.minAfter, [`max${_e2}`]: i2 ? q2?.maxAfter : "100%" }, Ce2 = d(() => i2 ? e("div", { ref: Q2, className: g("before", oe2, le2), style: Ee2, ...re2, ...ce2, children: i2 }, "before") : null, [i2, R2, P2, z2, q2]), Me2 = d(() => c2 ? e("div", { ref: te2, className: g("after", oe2, ae2), style: Ie2, ...re2, ...ue2, children: c2 }, "after") : null, [c2, R2, O2, z2, q2]);
1343
+ return t("div", { ref: m([F2, be2]), className: g("splitPane", "row" === a2 ? "vertical" : "horizontal", { dragging: Y2 }, _2), style: he2, children: [Ce2, Se2, Me2] });
1311
1344
  }));
1312
- const fn = ({ initValue: e5, useHookBody: t2, applyStateChange: n2 }) => {
1345
+ const hn = ({ initValue: e5, useHookBody: t2, applyStateChange: n2 }) => {
1313
1346
  const o2 = l(e5);
1314
1347
  if ("function" != typeof t2) throw new Error("function expected as hook body parameter. got " + typeof t2);
1315
1348
  const r2 = t2();
1316
1349
  return u(() => {
1317
1350
  o2.current !== r2 && (o2.current = r2, n2(r2));
1318
1351
  }, [n2, r2]), null;
1319
- }, pn = (e5) => {
1352
+ }, fn = (e5) => {
1320
1353
  console && console.warn && console.warn(e5);
1321
- }, gn = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
1322
- let wn = 1, mn = false, xn = false;
1323
- const yn = [], vn = [], bn = () => {
1324
- vn.forEach((e5) => e5());
1325
- }, Sn = ({ automaticContainerInternalUseOnly: t2 }) => {
1354
+ }, pn = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
1355
+ let gn = 1, wn = false, mn = false;
1356
+ const xn = [], yn = [], vn = () => {
1357
+ yn.forEach((e5) => e5());
1358
+ }, bn = ({ automaticContainerInternalUseOnly: t2 }) => {
1326
1359
  const [o2, r2] = h([]), i2 = l([]);
1327
- return i2.current = o2, t2 || false !== mn || (xn = true), s(() => {
1360
+ return i2.current = o2, t2 || false !== wn || (mn = true), s(() => {
1328
1361
  let e5 = true;
1329
1362
  function n2() {
1330
- if (e5) return vn[0] !== n2 ? (t2 || true !== mn || pn("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void r2((e6) => [])) : void r2([...yn]);
1363
+ if (e5) return yn[0] !== n2 ? (t2 || true !== wn || fn("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void r2((e6) => [])) : void r2([...xn]);
1331
1364
  }
1332
- return vn.push(n2), bn(), () => {
1333
- e5 = false, i2.current?.length > 0 && pn("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), vn.splice(vn.indexOf(n2), 1), bn();
1365
+ return yn.push(n2), vn(), () => {
1366
+ e5 = false, i2.current?.length > 0 && fn("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), yn.splice(yn.indexOf(n2), 1), vn();
1334
1367
  };
1335
- }, [t2]), e(n, { children: o2.map(({ hook: e5, key: t3 }) => f(fn, { ...e5, key: t3 })) });
1336
- }, En = (t2, n2, o2 = {}) => {
1368
+ }, [t2]), e(n, { children: o2.map(({ hook: e5, key: t3 }) => f(hn, { ...e5, key: t3 })) });
1369
+ }, Sn = (t2, n2, o2 = {}) => {
1337
1370
  let r2, i2, l2 = false, c2 = false, a2 = [], { unmountIfNoConsumers: d2 = false } = o2;
1338
1371
  const u2 = (e5) => {
1339
1372
  i2 = e5, y(() => a2.forEach((t3) => t3(e5)));
@@ -1341,21 +1374,21 @@ const yn = [], vn = [], bn = () => {
1341
1374
  return () => {
1342
1375
  const [o3, c3] = h(f2);
1343
1376
  return s(() => (l2 || (l2 = true, r2 = ((t3) => {
1344
- const n3 = wn++;
1345
- return yn.push({ hook: t3, key: n3 }), 0 === vn.length && false === xn && (mn = true, ((t4) => {
1346
- if (gn.document && gn.document.createElement) {
1347
- const n4 = gn.document.createElement("div");
1377
+ const n3 = gn++;
1378
+ return xn.push({ hook: t3, key: n3 }), 0 === yn.length && false === mn && (wn = true, ((t4) => {
1379
+ if (pn.document && pn.document.createElement) {
1380
+ const n4 = pn.document.createElement("div");
1348
1381
  x(n4).render(e(t4, { automaticContainerInternalUseOnly: true }));
1349
- } else pn("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
1350
- })(Sn)), bn(), () => {
1351
- yn.splice(yn.findIndex((e5) => e5.key === n3), 1), bn();
1382
+ } else fn("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
1383
+ })(bn)), vn(), () => {
1384
+ xn.splice(xn.findIndex((e5) => e5.key === n3), 1), vn();
1352
1385
  };
1353
1386
  })({ initValue: t2, useHookBody: n2, applyStateChange: u2 })), a2.push(c3), i2 !== o3 && c3(i2), () => {
1354
1387
  a2.splice(a2.indexOf(c3), 1), 0 === a2.length && d2 && (r2(), l2 = false);
1355
1388
  }), []), o3;
1356
1389
  };
1357
1390
  };
1358
- En(null, () => {
1391
+ Sn(null, () => {
1359
1392
  const [e5, t2] = h(null);
1360
1393
  return e5;
1361
1394
  });
@@ -1470,24 +1503,24 @@ class _n {
1470
1503
  }), t2;
1471
1504
  }
1472
1505
  }
1473
- class In extends _n {
1506
+ class En extends _n {
1474
1507
  }
1475
- Me.getOS() === Me.OSType.MacOS || (Me.getOS(), Me.OSType.IOS), Me.getOS() === Me.OSType.MacOS || (Me.getOS(), Me.OSType.IOS), En({ setClipboard: (e5) => {
1508
+ Me.getOS() === Me.OSType.MacOS || (Me.getOS(), Me.OSType.IOS), Me.getOS() === Me.OSType.MacOS || (Me.getOS(), Me.OSType.IOS), Sn({ setClipboard: (e5) => {
1476
1509
  throw new Error("This is only available via the useClipboard.");
1477
1510
  }, getClipboard: () => Xe.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
1478
1511
  const [e5, t2] = h(Xe.Global);
1479
1512
  return { setClipboard: (e6) => t2(e6), getClipboard: () => e5, refNativeCopy: l(null), refNativeLastKey: l(null) };
1480
1513
  });
1481
- let Cn = false, Mn = 0;
1482
- var Tn = "undefined" != typeof document ? u : s;
1483
- const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null != Rn ? Rn : function() {
1484
- const [e5, t2] = o.useState(() => Cn ? kn() : void 0);
1485
- return Tn(() => {
1486
- null == e5 && t2(kn());
1514
+ let In = false, Cn = 0;
1515
+ var Mn = "undefined" != typeof document ? u : s;
1516
+ const Tn = () => "sheetxl-ui-" + Cn++, kn = o["useId".toString()], Rn = null != kn ? kn : function() {
1517
+ const [e5, t2] = o.useState(() => In ? Tn() : void 0);
1518
+ return Mn(() => {
1519
+ null == e5 && t2(Tn());
1487
1520
  }, []), o.useEffect(() => {
1488
- Cn || (Cn = true);
1521
+ In || (In = true);
1489
1522
  }, []), e5;
1490
- }, On = ({ itemType: e5, index: t2, itemSize: n2, instanceProps: o2, scale: r2 = 1 }) => {
1523
+ }, Pn = ({ itemType: e5, index: t2, itemSize: n2, instanceProps: o2, scale: r2 = 1 }) => {
1491
1524
  let i2, l2, s2;
1492
1525
  "column" === e5 ? (i2 = o2.columnMetadataMap, l2 = o2.lastMeasuredColumnIndex, s2 = o2.recalcColumnIndices) : (i2 = o2.rowMetadataMap, l2 = o2.lastMeasuredRowIndex, s2 = o2.recalcRowIndices);
1493
1526
  const c2 = s2.length > 0;
@@ -1504,28 +1537,28 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1504
1537
  "column" === e5 ? o2.lastMeasuredColumnIndex = t2 : o2.lastMeasuredRowIndex = t2;
1505
1538
  }
1506
1539
  return i2[t2], i2[t2];
1507
- }, Ln = ({ itemType: e5, itemSize: t2, itemCount: n2, instanceProps: o2, offset: r2, scale: i2 }) => {
1540
+ }, On = ({ itemType: e5, itemSize: t2, itemCount: n2, instanceProps: o2, offset: r2, scale: i2 }) => {
1508
1541
  let l2, s2;
1509
1542
  "column" === e5 ? (l2 = o2.columnMetadataMap, s2 = o2.lastMeasuredColumnIndex) : (l2 = o2.rowMetadataMap, s2 = o2.lastMeasuredRowIndex);
1510
1543
  let c2 = 0;
1511
- return c2 = (s2 > 0 ? l2[s2].offset : 0) >= r2 ? Dn({ itemType: e5, itemSize: t2, instanceProps: o2, high: s2, low: 0, offset: r2, scale: i2 }) : zn({ itemType: e5, itemSize: t2, itemCount: n2, instanceProps: o2, index: Math.max(0, s2), offset: r2, scale: i2 }), c2 = Math.min(c2, n2), c2;
1512
- }, Dn = ({ itemType: e5, itemSize: t2, instanceProps: n2, high: o2, low: r2, offset: i2, scale: l2 }) => {
1544
+ return c2 = (s2 > 0 ? l2[s2].offset : 0) >= r2 ? Ln({ itemType: e5, itemSize: t2, instanceProps: o2, high: s2, low: 0, offset: r2, scale: i2 }) : Dn({ itemType: e5, itemSize: t2, itemCount: n2, instanceProps: o2, index: Math.max(0, s2), offset: r2, scale: i2 }), c2 = Math.min(c2, n2), c2;
1545
+ }, Ln = ({ itemType: e5, itemSize: t2, instanceProps: n2, high: o2, low: r2, offset: i2, scale: l2 }) => {
1513
1546
  for (; r2 <= o2; ) {
1514
- const s2 = r2 + Math.floor((o2 - r2) / 2), c2 = On({ itemType: e5, itemSize: t2, index: s2, instanceProps: n2, scale: l2 }).offset;
1547
+ const s2 = r2 + Math.floor((o2 - r2) / 2), c2 = Pn({ itemType: e5, itemSize: t2, index: s2, instanceProps: n2, scale: l2 }).offset;
1515
1548
  if (c2 === i2) return s2;
1516
1549
  c2 < i2 ? r2 = s2 + 1 : c2 > i2 && (o2 = s2 - 1);
1517
1550
  }
1518
1551
  return r2 > 0 ? r2 - 1 : 0;
1519
- }, zn = ({ itemType: e5, itemSize: t2, itemCount: n2, instanceProps: o2, index: r2, offset: i2, scale: l2 }) => {
1552
+ }, Dn = ({ itemType: e5, itemSize: t2, itemCount: n2, instanceProps: o2, index: r2, offset: i2, scale: l2 }) => {
1520
1553
  let s2 = 1;
1521
- for (; r2 < n2 && On({ itemType: e5, itemSize: t2, index: r2, instanceProps: o2, scale: l2 }).offset < i2; ) r2 += s2, s2 *= 2;
1522
- return Dn({ itemType: e5, itemSize: t2, instanceProps: o2, high: Math.min(r2, n2 - 1), low: Math.floor(r2 / 2), offset: i2, scale: l2 });
1523
- }, An = (e5) => {
1524
- const { rowCount: t2, columnCount: n2, defaultRowHeight: o2, getRowHeight: r2, defaultColumnWidth: i2, getColumnWidth: c2 } = e5 || {}, a2 = l({ columnMetadataMap: {}, rowMetadataMap: {}, lastMeasuredColumnIndex: -1, lastMeasuredRowIndex: -1, recalcColumnIndices: [], recalcRowIndices: [] }), d2 = Tt((e6) => Ln({ itemType: "row", itemCount: t2, itemSize: r2 ?? (() => o2 ?? 20), instanceProps: a2.current, offset: e6 }), [t2, r2, o2]), u2 = Tt((e6) => -1 === e6 ? 0 : On({ itemType: "row", index: e6, itemSize: r2 ?? (() => o2 ?? 20), instanceProps: a2.current }).offset, [r2, o2]), f2 = Tt((e6) => On({ itemType: "row", index: e6, itemSize: r2 ?? (() => o2 ?? 20), instanceProps: a2.current }).size, [r2, o2]), g2 = Tt((e6) => Ln({ itemType: "column", itemCount: n2, itemSize: c2 ?? (() => i2 ?? 75), instanceProps: a2.current, offset: e6 }), [n2, c2, i2]), w2 = Tt((e6) => -1 === e6 ? 0 : On({ itemType: "column", index: e6, itemSize: c2 ?? (() => i2 ?? 75), instanceProps: a2.current }).offset, [c2, i2]), m2 = Tt((e6) => On({ itemType: "column", index: e6, itemSize: c2 ?? (() => i2 ?? 75), instanceProps: a2.current }).size, [c2, i2]), [x2, y2] = p((e6) => e6 + 1, 0), v2 = () => ({ getRowOffset: u2, getColOffset: w2, getRowIndex: d2, getColIndex: g2 }), [b2, S2] = h(() => e5 ? v2() : null);
1554
+ for (; r2 < n2 && Pn({ itemType: e5, itemSize: t2, index: r2, instanceProps: o2, scale: l2 }).offset < i2; ) r2 += s2, s2 *= 2;
1555
+ return Ln({ itemType: e5, itemSize: t2, instanceProps: o2, high: Math.min(r2, n2 - 1), low: Math.floor(r2 / 2), offset: i2, scale: l2 });
1556
+ }, zn = (e5) => {
1557
+ const { rowCount: t2, columnCount: n2, defaultRowHeight: o2, getRowHeight: r2, defaultColumnWidth: i2, getColumnWidth: c2 } = e5 || {}, a2 = l({ columnMetadataMap: {}, rowMetadataMap: {}, lastMeasuredColumnIndex: -1, lastMeasuredRowIndex: -1, recalcColumnIndices: [], recalcRowIndices: [] }), d2 = Tt((e6) => On({ itemType: "row", itemCount: t2, itemSize: r2 ?? (() => o2 ?? 20), instanceProps: a2.current, offset: e6 }), [t2, r2, o2]), u2 = Tt((e6) => -1 === e6 ? 0 : Pn({ itemType: "row", index: e6, itemSize: r2 ?? (() => o2 ?? 20), instanceProps: a2.current }).offset, [r2, o2]), f2 = Tt((e6) => Pn({ itemType: "row", index: e6, itemSize: r2 ?? (() => o2 ?? 20), instanceProps: a2.current }).size, [r2, o2]), g2 = Tt((e6) => On({ itemType: "column", itemCount: n2, itemSize: c2 ?? (() => i2 ?? 75), instanceProps: a2.current, offset: e6 }), [n2, c2, i2]), w2 = Tt((e6) => -1 === e6 ? 0 : Pn({ itemType: "column", index: e6, itemSize: c2 ?? (() => i2 ?? 75), instanceProps: a2.current }).offset, [c2, i2]), m2 = Tt((e6) => Pn({ itemType: "column", index: e6, itemSize: c2 ?? (() => i2 ?? 75), instanceProps: a2.current }).size, [c2, i2]), [x2, y2] = p((e6) => e6 + 1, 0), v2 = () => ({ getRowOffset: u2, getColOffset: w2, getRowIndex: d2, getColIndex: g2 }), [b2, S2] = h(() => e5 ? v2() : null);
1525
1558
  return s(() => {
1526
1559
  S2(e5 ? v2() : null);
1527
1560
  }, [x2, t2, n2, i2, o2, f2, m2]), b2;
1528
- }, $n = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ~`!@#$%^&*()-_=+[{]};:'\",<.>/?|\\", Bn = (e5) => {
1561
+ }, An = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ~`!@#$%^&*()-_=+[{]};:'\",<.>/?|\\", $n = (e5) => {
1529
1562
  if (!e5) return null;
1530
1563
  if ("start" === e5.eventType) return { type: e5.eventType };
1531
1564
  if ("submit" === e5.eventType) return { type: e5.eventType };
@@ -1537,8 +1570,8 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1537
1570
  return e5.activeCoords && (t2.activeCoords = e5.activeCoords), t2;
1538
1571
  }
1539
1572
  return { type: e5.eventType ?? "unknown" };
1540
- }, Fn = (e5) => true, jn = (e5) => !!e5 && (!(e5.ctrlKey || e5.metaKey || e5.altKey || e5.isComposing) && (!(e5.shiftKey || "F2" !== e5.key && " " !== e5.key && "Backspace" !== e5.key) || (!e5.shiftKey || " " !== e5.key) && -1 !== $n.indexOf(e5.key))), Vn = (e5) => !!e5 && ("dblclick" === e5.type && { editMode: true }), Wn = (t2) => {
1541
- const { session: n2, refLatestCoords: o2, handleSubmitEdit: r2, handleCancelEdit: c2, cellBounds: a2, isInBounds: d2, getCellEditor: u2, propsEditor: f2, borderStrokeFill: p2 = "rgb(33, 115, 70)", borderStrokeWidth: g2 = 2, alignment: w2 = pt.Left, style: m2, ...x2 } = t2, y2 = l(null), v2 = l(null), [b2, S2] = h(false), E2 = n2.coords, _2 = i(async (e5) => {
1573
+ }, Bn = (e5) => true, Fn = (e5) => !!e5 && (!(e5.ctrlKey || e5.metaKey || e5.altKey || e5.isComposing) && (!(e5.shiftKey || "F2" !== e5.key && " " !== e5.key && "Backspace" !== e5.key) || (!e5.shiftKey || " " !== e5.key) && -1 !== An.indexOf(e5.key))), jn = (e5) => !!e5 && ("dblclick" === e5.type && { editMode: true }), Vn = (t2) => {
1574
+ const { session: n2, refLatestCoords: o2, handleSubmitEdit: r2, handleCancelEdit: c2, cellBounds: a2, isInBounds: d2, getCellEditor: u2, propsEditor: f2, borderStrokeFill: p2 = "rgb(33, 115, 70)", borderStrokeWidth: g2 = 2, alignment: w2 = pt.Left, style: m2, ...x2 } = t2, y2 = l(null), v2 = l(null), [b2, S2] = h(false), _2 = n2.coords, E2 = i(async (e5) => {
1542
1575
  const t3 = y2.current?.getBoundingClientRect();
1543
1576
  if (t3) {
1544
1577
  if ("keyboard" === e5.eventType) {
@@ -1552,9 +1585,9 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1552
1585
  const e5 = v2.current;
1553
1586
  S2(true), v2.current.startEdit?.(n2.startEvent);
1554
1587
  return (async () => {
1555
- n2.editorRefs.push(e5), n2.editorRefsDispatchEditorEvent.push(_2);
1588
+ n2.editorRefs.push(e5), n2.editorRefsDispatchEditorEvent.push(E2);
1556
1589
  const t3 = [...n2.events];
1557
- for (let e6 = 0; e6 < t3.length; e6++) await _2(t3[e6]);
1590
+ for (let e6 = 0; e6 < t3.length; e6++) await E2(t3[e6]);
1558
1591
  n2.onMount(e5);
1559
1592
  })(), () => {
1560
1593
  const t3 = n2.editorRefs.indexOf(e5);
@@ -1563,10 +1596,10 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1563
1596
  }, []);
1564
1597
  const I2 = i(() => r2(n2), []), C2 = i(() => {
1565
1598
  c2(n2);
1566
- }, []), M2 = o2.current && ne.isEqualCells(o2.current, E2), T2 = d2 && M2 && b2, k2 = u2({ autoFocus: !!n2.startEvent?.autoFocus, ...f2, onSubmitEdit: I2, onCancelEdit: C2, ref: v2 }, E2), R2 = a2.x + Ut.boundPixel(-g2 / 2), P2 = Ut.boundPixel(a2.width + g2 / 2, true);
1567
- return e("div", { tabIndex: 0, ref: y2, style: { background: void 0, ...m2, opacity: T2 ? m2?.opacity ?? 1 : 0, pointerEvents: "auto", position: "absolute", boxSizing: "border-box", top: `${a2.y + Ut.boundPixel(-g2 / 2)}px`, height: Ut.boundPixel(a2.height + g2 / 2, true), left: `${R2}px`, width: P2 }, ...x2, children: e("div", { className: "editor-container", style: { position: "absolute", boxSizing: "border-box", left: `${Ut.boundPixel(1)}px`, top: `${Ut.boundPixel(1)}px`, width: Ut.boundPixel(a2.width - 2, true), height: Ut.boundPixel(a2.height - 2, true), outline: `${g2}px ${p2} solid`, boxShadow: "rgba(60,64,67,.35) 2px 2px 6px 3px", maxHeight: "100%", overflow: "hidden", display: "flex" }, children: k2 }) });
1568
- }, Hn = (t2) => {
1569
- const { view: n2, canEdit: o2 = Fn, getCellEditor: r2, onBeforeStartEdit: c2, onStartEdit: a2, onSubmitEdit: d2, onCancelEdit: f2, onDoneEdit: g2, isEditorStartKeyEvent: w2 = jn, isEditorStartPointerEvent: m2 = Vn, containerProps: x2, borderStrokeFill: y2, borderStrokeWidth: v2 = 2, getRangeCoords: b2 = null, activeCoords: S2, alignment: E2 = pt.Left } = t2, [_2, I2] = h(false), [C2, M2] = h(void 0), T2 = Tt((e5, t3, n3, o3, r3, i2) => {
1599
+ }, []), M2 = o2.current && ne.isEqualCells(o2.current, _2), T2 = d2 && M2 && b2, k2 = u2({ autoFocus: !!n2.startEvent?.autoFocus, ...f2, onSubmitEdit: I2, onCancelEdit: C2, ref: v2 }, _2), R2 = a2.x + Nt.boundPixel(-g2 / 2), P2 = Nt.boundPixel(a2.width + g2 / 2, true);
1600
+ return e("div", { tabIndex: 0, ref: y2, style: { background: void 0, ...m2, opacity: T2 ? m2?.opacity ?? 1 : 0, pointerEvents: "auto", position: "absolute", boxSizing: "border-box", top: `${a2.y + Nt.boundPixel(-g2 / 2)}px`, height: Nt.boundPixel(a2.height + g2 / 2, true), left: `${R2}px`, width: P2 }, ...x2, children: e("div", { className: "editor-container", style: { position: "absolute", boxSizing: "border-box", left: `${Nt.boundPixel(1)}px`, top: `${Nt.boundPixel(1)}px`, width: Nt.boundPixel(a2.width - 2, true), height: Nt.boundPixel(a2.height - 2, true), outline: `${g2}px ${p2} solid`, boxShadow: "rgba(60,64,67,.35) 2px 2px 6px 3px", maxHeight: "100%", overflow: "hidden", display: "flex" }, children: k2 }) });
1601
+ }, Wn = (t2) => {
1602
+ const { view: n2, canEdit: o2 = Bn, getCellEditor: r2, onBeforeStartEdit: c2, onStartEdit: a2, onSubmitEdit: d2, onCancelEdit: f2, onDoneEdit: g2, isEditorStartKeyEvent: w2 = Fn, isEditorStartPointerEvent: m2 = jn, containerProps: x2, borderStrokeFill: y2, borderStrokeWidth: v2 = 2, getRangeCoords: b2 = null, activeCoords: S2, alignment: _2 = pt.Left } = t2, [E2, I2] = h(false), [C2, M2] = h(void 0), T2 = Tt((e5, t3, n3, o3, r3, i2) => {
1570
1603
  if (!t3) return null;
1571
1604
  const l2 = r3?.(t3, e5), s2 = e5.getRangeCoordsBounds(l2), c3 = e5.toClipBounds(s2), a3 = s2, d3 = e5.getZoom();
1572
1605
  if (!c3) return null;
@@ -1583,7 +1616,7 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1583
1616
  u2.height = a3.height, void 0 !== o3 && (u2.height = Math.max(o3 + 1, a3.height));
1584
1617
  const { width: f3, height: p2 } = e5.getViewportSize();
1585
1618
  return { x: u2.x ?? 0, y: u2.y ?? 0, height: Math.min(p2 - u2.y, u2.height) + 1, width: Math.min(f3 - u2.x, u2.width) + 1 };
1586
- }, [E2]), k2 = Tt(o2, [o2]), R2 = i(() => {
1619
+ }, [_2]), k2 = Tt(o2, [o2]), R2 = i(() => {
1587
1620
  n2?.getStage()?.focus();
1588
1621
  }, [n2]), P2 = l(null), O2 = Tt((e5) => {
1589
1622
  c2?.(e5), H2(), I2(true), P2.current = null;
@@ -1649,11 +1682,11 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1649
1682
  };
1650
1683
  if (j2.current.length <= 0 && !$2.current) return;
1651
1684
  const t3 = j2.current[0];
1652
- Bn(t3), ((e6) => {
1685
+ $n(t3), ((e6) => {
1653
1686
  const t4 = [], n3 = e6?.length ?? 0;
1654
1687
  for (let o4 = 0; o4 < n3; o4++) {
1655
1688
  const n4 = e6[o4];
1656
- t4.push(Bn(n4));
1689
+ t4.push($n(n4));
1657
1690
  }
1658
1691
  })(j2.current), $2.current, $2.current;
1659
1692
  let o3 = $2.current;
@@ -1674,9 +1707,9 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1674
1707
  let e6 = false;
1675
1708
  switch (n3.which) {
1676
1709
  case bt:
1677
- case Et:
1678
- case St:
1679
1710
  case _t:
1711
+ case St:
1712
+ case Et:
1680
1713
  case yt:
1681
1714
  case xt:
1682
1715
  e6 = true;
@@ -1744,19 +1777,19 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1744
1777
  return { overlay: Tt((t3) => {
1745
1778
  if (!$2.current || $2.current.isEditorClosed) return $2.current, null;
1746
1779
  $2.current.coords;
1747
- let n3 = T2(t3, $2.current.coords, Y2, X2, b2, E2), o3 = true;
1780
+ let n3 = T2(t3, $2.current.coords, Y2, X2, b2, _2), o3 = true;
1748
1781
  n3 && 0 !== n3.width && 0 !== n3.height || (n3 = { x: 0, y: 0, width: Y2, height: Y2 }, o3 = false);
1749
1782
  const r3 = t3.getZoom(), i2 = { containerBounds: { x: 0, y: 0, width: n3.width / r3, height: n3.height / r3 }, setNaturalDimensions: M2, zoom: r3 };
1750
- return e(Wn, { session: $2.current, refLatestCoords: F2, handleSubmitEdit: z2, handleCancelEdit: D2, cellBounds: n3, borderStrokeWidth: v2, borderStrokeFill: y2, isInBounds: o3, getCellEditor: G2, propsEditor: i2, alignment: E2, ...x2 }, "editor:" + $2.current.uuid);
1751
- }, [r2, b2, V2, Y2, X2, E2, v2, y2]), startEdit: i((e5) => {
1783
+ return e(Vn, { session: $2.current, refLatestCoords: F2, handleSubmitEdit: z2, handleCancelEdit: D2, cellBounds: n3, borderStrokeWidth: v2, borderStrokeFill: y2, isInBounds: o3, getCellEditor: G2, propsEditor: i2, alignment: _2, ...x2 }, "editor:" + $2.current.uuid);
1784
+ }, [r2, b2, V2, Y2, X2, _2, v2, y2]), startEdit: i((e5) => {
1752
1785
  H2({ eventType: "start", startEvent: e5 });
1753
1786
  }, []), submitEdit: i(() => {
1754
1787
  H2({ eventType: "submit" });
1755
1788
  }, []), cancelEdit: i(() => {
1756
1789
  H2({ eventType: "cancel" });
1757
- }, []), onKeyboardEvent: q2, onPointerEvent: U2, onKeyboardEventNative: K2, onPointerEventNative: N2, isEditing: _2 };
1758
- }, Nn = ({ gridRef: e5, gridMainRef: t2, orientation: n2 = $, headerCount: o2, selectionPolicy: r2 = "multiple", newSelectionMode: s2 = "clear", alwaysScrollToActiveCoords: c2 = true, onDragStart: a2, onDragEnd: u2, pointerDownInterceptor: h2, pointerMoveInterceptor: f2, onPointerUp: p2, newSelection: g2, modifySelection: w2, appendSelection: m2, clearSelections: x2 }) => {
1759
- const y2 = o2 ?? ((n2 === $ ? e5.current?.rowCount : e5.current?.columnCount) || 0), v2 = l(null), b2 = l(null), S2 = l(false), E2 = l(null), _2 = i((e6) => n2 === A ? { rowIndex: 0, colIndex: e6.colIndex } : { rowIndex: e6.rowIndex, colIndex: 0 }, [n2]), I2 = i((e6) => n2 === A ? { rowIndex: t2.current ? t2.current.rowCount - 1 : 0, colIndex: e6.colIndex } : { rowIndex: e6.rowIndex, colIndex: t2.current ? t2.current.columnCount - 1 : 0 }, [n2]), C2 = (e6) => {
1790
+ }, []), onKeyboardEvent: q2, onPointerEvent: U2, onKeyboardEventNative: K2, onPointerEventNative: N2, isEditing: E2 };
1791
+ }, Hn = ({ gridRef: e5, gridMainRef: t2, orientation: n2 = $, headerCount: o2, selectionPolicy: r2 = "multiple", newSelectionMode: s2 = "clear", alwaysScrollToActiveCoords: c2 = true, onDragStart: a2, onDragEnd: u2, pointerDownInterceptor: h2, pointerMoveInterceptor: f2, onPointerUp: p2, newSelection: g2, modifySelection: w2, appendSelection: m2, clearSelections: x2 }) => {
1792
+ const y2 = o2 ?? ((n2 === $ ? e5.current?.rowCount : e5.current?.columnCount) || 0), v2 = l(null), b2 = l(null), S2 = l(false), _2 = l(null), E2 = i((e6) => n2 === A ? { rowIndex: 0, colIndex: e6.colIndex } : { rowIndex: e6.rowIndex, colIndex: 0 }, [n2]), I2 = i((e6) => n2 === A ? { rowIndex: t2.current ? t2.current.rowCount - 1 : 0, colIndex: e6.colIndex } : { rowIndex: e6.rowIndex, colIndex: t2.current ? t2.current.columnCount - 1 : 0 }, [n2]), C2 = (e6) => {
1760
1793
  b2.current = I2(e6), w2(b2.current, v2.current);
1761
1794
  }, M2 = i((o3, r3) => {
1762
1795
  if (!e5.current) return;
@@ -1778,33 +1811,33 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1778
1811
  if (i2) C2(r3);
1779
1812
  else {
1780
1813
  if (l2) return ((e6, t3 = e6, n3) => {
1781
- v2.current = _2(e6), b2.current = I2(t3), m2(v2.current, b2.current, n3);
1814
+ v2.current = E2(e6), b2.current = I2(t3), m2(v2.current, b2.current, n3);
1782
1815
  })(r3, r3, a3), void (c2 && T2(a3, true));
1783
1816
  ((e6, t3 = e6, n3) => {
1784
- v2.current = _2(e6), b2.current = I2(t3), g2(v2.current, b2.current, n3);
1817
+ v2.current = E2(e6), b2.current = I2(t3), g2(v2.current, b2.current, n3);
1785
1818
  })(r3, r3, a3), C2(r3), c2 && T2(a3, true);
1786
1819
  }
1787
1820
  }, onPointerMoveOrWait: Me.throttle((t3) => {
1788
1821
  if (!S2.current || !e5?.current) return;
1789
1822
  const n3 = M2(t3.clientX, t3.clientY);
1790
1823
  if (n3 && false !== f2?.(t3, n3)) {
1791
- if (ne.isEqualCells(E2.current, n3)) return x2();
1824
+ if (ne.isEqualCells(_2.current, n3)) return x2();
1792
1825
  C2(n3), T2(n3);
1793
1826
  }
1794
1827
  }, 60), onPointerUp: (e6) => {
1795
1828
  S2.current = false, k2?.(), p2?.(e6);
1796
1829
  }, processTouch: true, consumeTouch: true }), [r2, c2, y2, s2, x2, h2, p2]);
1797
- return { onPointerDown: Tt(hn(P2), []), getCellCoordsFromClient: M2 };
1798
- }, Un = (e5, t2, n2) => {
1830
+ return { onPointerDown: Tt(un(P2), []), getCellCoordsFromClient: M2 };
1831
+ }, Nn = (e5, t2, n2) => {
1799
1832
  if (!e5) return t2;
1800
1833
  let o2 = t2;
1801
- const r2 = n2 === I || n2 === E;
1834
+ const r2 = n2 === I || n2 === _;
1802
1835
  for (; ; ) {
1803
1836
  const t3 = e5(o2, !r2);
1804
1837
  if (0 === t3) return o2;
1805
1838
  r2 ? o2 += t3 : o2 -= t3;
1806
1839
  }
1807
- }, Kn = (e5, t2, n2) => {
1840
+ }, Un = (e5, t2, n2) => {
1808
1841
  const o2 = [];
1809
1842
  let r2 = t2;
1810
1843
  for (; r2 <= n2; ) {
@@ -1812,75 +1845,75 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1812
1845
  0 === t3 ? (o2.push(r2), r2++) : r2 += t3;
1813
1846
  }
1814
1847
  return o2;
1815
- }, qn = (e5, t2, n2, o2, r2, i2) => {
1848
+ }, Kn = (e5, t2, n2, o2, r2, i2) => {
1816
1849
  if (!t2) return i2;
1817
1850
  let { rowIndex: l2, colIndex: s2 } = e5;
1818
1851
  switch (o2) {
1819
- case E: {
1820
- l2 = Un(n2, Math.min(l2 + 1, i2), o2);
1852
+ case _: {
1853
+ l2 = Nn(n2, Math.min(l2 + 1, i2), o2);
1821
1854
  let e6 = t2({ rowIndex: l2, colIndex: s2 });
1822
- for (; !e6 && l2 < i2; ) l2 = Un(n2, Math.min(++l2, i2), o2), e6 = t2({ rowIndex: l2, colIndex: s2 });
1855
+ for (; !e6 && l2 < i2; ) l2 = Nn(n2, Math.min(++l2, i2), o2), e6 = t2({ rowIndex: l2, colIndex: s2 });
1823
1856
  return l2;
1824
1857
  }
1825
1858
  case S: {
1826
- l2 = Un(n2, Math.max(l2 - 1, i2), o2);
1859
+ l2 = Nn(n2, Math.max(l2 - 1, i2), o2);
1827
1860
  let e6 = t2({ rowIndex: l2, colIndex: s2 });
1828
- for (; !e6 && l2 > i2; ) l2 = Un(n2, Math.max(--l2, i2), o2), e6 = t2({ rowIndex: l2, colIndex: s2 });
1861
+ for (; !e6 && l2 > i2; ) l2 = Nn(n2, Math.max(--l2, i2), o2), e6 = t2({ rowIndex: l2, colIndex: s2 });
1829
1862
  return l2;
1830
1863
  }
1831
1864
  case I: {
1832
- s2 = Un(n2, Math.min(s2 + 1, i2), o2);
1865
+ s2 = Nn(n2, Math.min(s2 + 1, i2), o2);
1833
1866
  let e6 = t2({ rowIndex: l2, colIndex: s2 });
1834
- for (; !e6 && s2 < i2; ) s2 = Un(n2, Math.min(++s2, i2), o2), e6 = t2({ rowIndex: l2, colIndex: s2 });
1867
+ for (; !e6 && s2 < i2; ) s2 = Nn(n2, Math.min(++s2, i2), o2), e6 = t2({ rowIndex: l2, colIndex: s2 });
1835
1868
  return s2;
1836
1869
  }
1837
- case _: {
1838
- s2 = Un(n2, Math.max(s2 - 1, i2), o2);
1870
+ case E: {
1871
+ s2 = Nn(n2, Math.max(s2 - 1, i2), o2);
1839
1872
  let e6 = t2({ rowIndex: l2, colIndex: s2 });
1840
- for (; !e6 && s2 > i2; ) s2 = Un(n2, Math.max(--s2, i2), o2), e6 = t2({ rowIndex: l2, colIndex: s2 });
1873
+ for (; !e6 && s2 > i2; ) s2 = Nn(n2, Math.max(--s2, i2), o2), e6 = t2({ rowIndex: l2, colIndex: s2 });
1841
1874
  return s2;
1842
1875
  }
1843
1876
  default:
1844
1877
  return i2;
1845
1878
  }
1846
- }, Yn = (e5, t2 = () => true, n2, o2, r2, i2) => {
1879
+ }, qn = (e5, t2 = () => true, n2, o2, r2, i2) => {
1847
1880
  let { rowIndex: l2, colIndex: s2 } = e5;
1848
1881
  switch (o2) {
1849
- case E: {
1850
- l2 = Un(n2, Math.min(l2 + 1, i2), o2);
1882
+ case _: {
1883
+ l2 = Nn(n2, Math.min(l2 + 1, i2), o2);
1851
1884
  let e6 = t2?.({ rowIndex: l2, colIndex: s2 });
1852
- for (; e6 && l2 < i2; ) l2 = Un(n2, Math.min(++l2, i2), o2), e6 = t2?.({ rowIndex: l2, colIndex: s2 });
1885
+ for (; e6 && l2 < i2; ) l2 = Nn(n2, Math.min(++l2, i2), o2), e6 = t2?.({ rowIndex: l2, colIndex: s2 });
1853
1886
  return t2?.({ rowIndex: l2, colIndex: s2 }) ? l2 : l2 - 1;
1854
1887
  }
1855
1888
  case S: {
1856
- l2 = Un(n2, Math.max(l2 - 1, i2), o2);
1889
+ l2 = Nn(n2, Math.max(l2 - 1, i2), o2);
1857
1890
  let e6 = t2?.({ rowIndex: l2, colIndex: s2 });
1858
- for (; e6 && l2 > i2; ) l2 = Un(n2, Math.max(--l2, i2), o2), e6 = t2?.({ rowIndex: l2, colIndex: s2 });
1891
+ for (; e6 && l2 > i2; ) l2 = Nn(n2, Math.max(--l2, i2), o2), e6 = t2?.({ rowIndex: l2, colIndex: s2 });
1859
1892
  return t2?.({ rowIndex: l2, colIndex: s2 }) ? l2 : l2 + 1;
1860
1893
  }
1861
1894
  case I: {
1862
- s2 = Un(n2, Math.min(s2 + 1, i2), o2);
1895
+ s2 = Nn(n2, Math.min(s2 + 1, i2), o2);
1863
1896
  let e6 = t2?.({ rowIndex: l2, colIndex: s2 });
1864
- for (; e6 && s2 < i2; ) s2 = Un(n2, Math.min(++s2, i2), o2), e6 = t2?.({ rowIndex: l2, colIndex: s2 });
1897
+ for (; e6 && s2 < i2; ) s2 = Nn(n2, Math.min(++s2, i2), o2), e6 = t2?.({ rowIndex: l2, colIndex: s2 });
1865
1898
  return t2?.({ rowIndex: l2, colIndex: s2 }) ? s2 : s2 - 1;
1866
1899
  }
1867
- case _: {
1868
- s2 = Un(n2, Math.max(s2 - 1, i2), o2);
1900
+ case E: {
1901
+ s2 = Nn(n2, Math.max(s2 - 1, i2), o2);
1869
1902
  let e6 = t2?.({ rowIndex: l2, colIndex: s2 });
1870
- for (; e6 && s2 > i2; ) s2 = Un(n2, Math.max(--s2, i2), o2), e6 = t2?.({ rowIndex: l2, colIndex: s2 });
1903
+ for (; e6 && s2 > i2; ) s2 = Nn(n2, Math.max(--s2, i2), o2), e6 = t2?.({ rowIndex: l2, colIndex: s2 });
1871
1904
  return t2?.({ rowIndex: l2, colIndex: s2 }) ? s2 : s2 + 1;
1872
1905
  }
1873
1906
  default:
1874
1907
  return null;
1875
1908
  }
1876
- }, Xn = (e5, t2, n2, o2, r2, i2) => {
1909
+ }, Yn = (e5, t2, n2, o2, r2, i2) => {
1877
1910
  if (!t2) return i2;
1878
1911
  let l2, { rowIndex: s2, colIndex: c2 } = e5;
1879
- o2 === E ? l2 = { rowIndex: s2 + 1, colIndex: c2 } : o2 === S ? l2 = { rowIndex: s2 - 1, colIndex: c2 } : o2 === I ? l2 = { rowIndex: s2, colIndex: c2 + 1 } : o2 === _ && (l2 = { rowIndex: s2, colIndex: c2 - 1 });
1912
+ o2 === _ ? l2 = { rowIndex: s2 + 1, colIndex: c2 } : o2 === S ? l2 = { rowIndex: s2 - 1, colIndex: c2 } : o2 === I ? l2 = { rowIndex: s2, colIndex: c2 + 1 } : o2 === E && (l2 = { rowIndex: s2, colIndex: c2 - 1 });
1880
1913
  const a2 = t2(e5), d2 = t2(l2);
1881
1914
  var u2, h2;
1882
- return (h2 = d2, !(u2 = a2) && !h2 || !u2 && h2 || u2 && !h2 ? qn : Yn)(e5, t2, n2, o2, false, i2) ?? i2;
1883
- }, Gn = (e5, t2) => `${e5}:${t2}`, Zn = (e5, t2, n2, o2, r2, i2) => {
1915
+ return (h2 = d2, !(u2 = a2) && !h2 || !u2 && h2 || u2 && !h2 ? Kn : qn)(e5, t2, n2, o2, false, i2) ?? i2;
1916
+ }, Xn = (e5, t2) => `${e5}:${t2}`, Gn = (e5, t2, n2, o2, r2, i2) => {
1884
1917
  if (n2 - t2 >= r2 - o2) return o2;
1885
1918
  let l2 = o2;
1886
1919
  if ("nearest" === e5 && (o2 - t2 > 0 ? e5 = "start" : n2 - r2 > 0 && (e5 = "end")), "start" === e5) l2 = t2;
@@ -1889,23 +1922,23 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1889
1922
  l2 = t2 + (n2 - t2) / 2 - (r2 - o2) / 2;
1890
1923
  }
1891
1924
  return Math.max(0, Math.min(l2, i2 - (r2 - o2)));
1892
- }, Jn = (e5, t2, n2, o2) => (console.log("todo: implement convertToVisibleRanges"), e5), Qn = (e5, t2 = I, n2, o2, r2, i2 = null) => {
1925
+ }, Zn = (e5, t2, n2, o2) => (console.log("todo: implement convertToVisibleRanges"), e5), Jn = (e5, t2 = I, n2, o2, r2, i2 = null) => {
1893
1926
  if (i2 && ne.isEqualSelectionCoords(i2, e5)) return e5;
1894
1927
  const l2 = e5.ranges[e5.rangeIndex];
1895
1928
  if (!ne.isRangesIntersect({ rowStart: e5.cell.rowIndex, colStart: e5.cell.colIndex, rowEnd: e5.cell.rowIndex, colEnd: e5.cell.colIndex }, l2)) return e5;
1896
1929
  let s2 = { ...e5.cell }, c2 = e5.rangeIndex;
1897
1930
  switch (t2) {
1898
1931
  case I:
1899
- s2.colIndex = Un(r2, s2.colIndex + 1, t2);
1900
- break;
1901
- case _:
1902
- s2.colIndex = Un(r2, s2.colIndex - 1, t2);
1932
+ s2.colIndex = Nn(r2, s2.colIndex + 1, t2);
1903
1933
  break;
1904
1934
  case E:
1905
- s2.rowIndex = Un(o2, s2.rowIndex + 1, t2);
1935
+ s2.colIndex = Nn(r2, s2.colIndex - 1, t2);
1936
+ break;
1937
+ case _:
1938
+ s2.rowIndex = Nn(o2, s2.rowIndex + 1, t2);
1906
1939
  break;
1907
1940
  case S:
1908
- s2.rowIndex = Un(o2, s2.rowIndex - 1, t2);
1941
+ s2.rowIndex = Nn(o2, s2.rowIndex - 1, t2);
1909
1942
  }
1910
1943
  const a2 = (t3) => {
1911
1944
  if (t3) {
@@ -1919,23 +1952,23 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1919
1952
  }
1920
1953
  };
1921
1954
  if (t2 === I && s2.colIndex > l2.colEnd && s2.rowIndex === l2.rowEnd) a2(true);
1922
- else if (t2 === _ && s2.colIndex < l2.colStart && s2.rowIndex === l2.rowStart) a2(false);
1923
- else if (t2 === E && s2.colIndex === l2.colEnd && s2.rowIndex > l2.rowEnd) a2(true);
1955
+ else if (t2 === E && s2.colIndex < l2.colStart && s2.rowIndex === l2.rowStart) a2(false);
1956
+ else if (t2 === _ && s2.colIndex === l2.colEnd && s2.rowIndex > l2.rowEnd) a2(true);
1924
1957
  else if (t2 === S && s2.colIndex === l2.colStart && s2.rowIndex < l2.rowStart) a2(false);
1925
1958
  else {
1926
1959
  let e6 = s2.rowIndex, n3 = s2.colIndex;
1927
1960
  switch (t2) {
1928
1961
  case I:
1929
- n3 > l2.colEnd && (e6 = Un(o2, e6 + 1, t2), n3 = l2.colStart, e6 > l2.rowEnd && (e6 = l2.rowStart));
1930
- break;
1931
- case _:
1932
- n3 < l2.colStart && (e6 = Un(o2, e6 - 1, t2), n3 = l2.colEnd, e6 < l2.rowStart && (e6 = l2.rowEnd));
1962
+ n3 > l2.colEnd && (e6 = Nn(o2, e6 + 1, t2), n3 = l2.colStart, e6 > l2.rowEnd && (e6 = l2.rowStart));
1933
1963
  break;
1934
1964
  case E:
1935
- e6 > l2.rowEnd && (n3 = Un(r2, n3 + 1, t2), e6 = l2.rowStart, n3 > l2.colEnd && (n3 = l2.colStart));
1965
+ n3 < l2.colStart && (e6 = Nn(o2, e6 - 1, t2), n3 = l2.colEnd, e6 < l2.rowStart && (e6 = l2.rowEnd));
1966
+ break;
1967
+ case _:
1968
+ e6 > l2.rowEnd && (n3 = Nn(r2, n3 + 1, t2), e6 = l2.rowStart, n3 > l2.colEnd && (n3 = l2.colStart));
1936
1969
  break;
1937
1970
  case S:
1938
- e6 < l2.rowStart && (n3 = Un(r2, n3 - 1, t2), e6 = l2.rowEnd, n3 < l2.colStart && (n3 = l2.colEnd));
1971
+ e6 < l2.rowStart && (n3 = Nn(r2, n3 - 1, t2), e6 = l2.rowEnd, n3 < l2.colStart && (n3 = l2.colEnd));
1939
1972
  }
1940
1973
  s2 = { rowIndex: e6, colIndex: n3 };
1941
1974
  }
@@ -1944,28 +1977,28 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1944
1977
  const e6 = ne.intersectRanges(d2, l2);
1945
1978
  e6 && (d2 = e6);
1946
1979
  }
1947
- let u2 = { rowStart: Un(o2, d2.rowStart, E), colStart: Un(r2, d2.colStart, I), rowEnd: Un(o2, d2.rowEnd, S), colEnd: Un(r2, d2.colEnd, _) };
1980
+ let u2 = { rowStart: Nn(o2, d2.rowStart, _), colStart: Nn(r2, d2.colStart, I), rowEnd: Nn(o2, d2.rowEnd, S), colEnd: Nn(r2, d2.colEnd, E) };
1948
1981
  if (u2.rowStart !== s2.rowIndex || u2.colStart !== s2.colIndex) {
1949
1982
  switch (t2) {
1950
1983
  case I:
1951
1984
  e5.ranges[c2].colStart === u2.colStart && e5.ranges[c2].colEnd === u2.colEnd && (s2.rowIndex = u2.rowEnd), s2.colIndex = u2.colEnd;
1952
1985
  break;
1953
- case _:
1986
+ case E:
1954
1987
  e5.ranges[c2].colStart === u2.colStart && e5.ranges[c2].colEnd === u2.colEnd && (s2.rowIndex = u2.rowStart), s2.rowIndex === u2.rowStart ? s2.colIndex = u2.colStart + 1 : s2.colIndex = u2.colStart;
1955
1988
  break;
1956
- case E:
1989
+ case _:
1957
1990
  e5.ranges[c2].rowStart === u2.rowStart && e5.ranges[c2].rowEnd === u2.rowEnd && (s2.colIndex = u2.colEnd), s2.rowIndex = u2.rowEnd;
1958
1991
  break;
1959
1992
  case S:
1960
1993
  e5.ranges[c2].rowStart === u2.rowStart && e5.ranges[c2].rowEnd === u2.rowEnd && (s2.colIndex = u2.colStart), s2.colIndex === u2.colStart ? s2.rowIndex = u2.rowStart + 1 : s2.rowIndex = u2.rowStart;
1961
1994
  }
1962
- return Qn({ cell: s2, ranges: e5.ranges, rangeIndex: c2 }, t2, n2, o2, r2, i2 ?? e5);
1995
+ return Jn({ cell: s2, ranges: e5.ranges, rangeIndex: c2 }, t2, n2, o2, r2, i2 ?? e5);
1963
1996
  }
1964
1997
  return { ranges: e5.ranges, cell: s2, rangeIndex: c2 };
1965
- }, eo = (e5, t2) => {
1998
+ }, Qn = (e5, t2) => {
1966
1999
  let n2, o2 = 0, r2 = 0;
1967
- return t2.colStart < e5.colStart ? (n2 = _, o2 = e5.colStart - t2.colStart, r2 = t2.colStart) : t2.colEnd > e5.colEnd ? (n2 = I, o2 = t2.colEnd - e5.colEnd, r2 = t2.colEnd) : t2.rowStart < e5.rowStart ? (n2 = S, o2 = e5.rowStart - t2.rowStart, r2 = t2.rowStart) : t2.rowEnd > e5.rowEnd && (n2 = E, o2 = t2.rowEnd - e5.rowEnd, r2 = t2.rowEnd), { direction: n2, amount: o2, index: r2 };
1968
- }, to = (e5, t2 = false, n2, o2) => {
2000
+ return t2.colStart < e5.colStart ? (n2 = E, o2 = e5.colStart - t2.colStart, r2 = t2.colStart) : t2.colEnd > e5.colEnd ? (n2 = I, o2 = t2.colEnd - e5.colEnd, r2 = t2.colEnd) : t2.rowStart < e5.rowStart ? (n2 = S, o2 = e5.rowStart - t2.rowStart, r2 = t2.rowStart) : t2.rowEnd > e5.rowEnd && (n2 = _, o2 = t2.rowEnd - e5.rowEnd, r2 = t2.rowEnd), { direction: n2, amount: o2, index: r2 };
2001
+ }, eo = (e5, t2 = false, n2, o2) => {
1969
2002
  if (!n2) return 0;
1970
2003
  const r2 = !t2, i2 = r2 ? 1 : -1;
1971
2004
  let l2 = n2(r2 ? e5 : e5 + 1), s2 = n2(r2 ? e5 + 1 : e5), c2 = e5 + (r2 ? 2 : -1), a2 = 0;
@@ -1974,7 +2007,7 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1974
2007
  l2 = s2, s2 = n2(c2), c2 += i2, a2++;
1975
2008
  }
1976
2009
  return a2;
1977
- }, no = (e5, t2, n2, o2, r2) => {
2010
+ }, to = (e5, t2, n2, o2, r2) => {
1978
2011
  const i2 = {};
1979
2012
  let l2 = null, s2 = null;
1980
2013
  for (let c2 = 0; c2 <= n2.length && n2[c2] <= r2; c2++) {
@@ -1984,27 +2017,27 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
1984
2017
  l2 = r3 + 1, s2 = d2, i2[r3] = Object.freeze({ offset: a2, size: d2 - a2, spanIndex: c2 });
1985
2018
  }
1986
2019
  return Object.freeze(i2);
1987
- }, oo = (e5, t2, n2) => {
2020
+ }, no = (e5, t2, n2) => {
1988
2021
  const o2 = e5.getColOffset(t2.colStart) + (n2?.left ?? 0), r2 = e5.getRowOffset(t2.rowStart) + (n2?.top ?? 0);
1989
2022
  return { x: o2, y: r2, width: e5.getColOffset(t2.colEnd + 1) + (n2?.right ?? 0) - (n2?.left ?? 0) - o2, height: e5.getRowOffset(t2.rowEnd + 1) + (n2?.bottom ?? 0) - (n2?.top ?? 0) - r2 };
1990
- }, ro = (e5, t2, n2) => !!n2 && (!(e5 < n2.x || e5 > n2.x + n2.width) && !(t2 < n2.y || t2 > n2.y + n2.height)), io = (e5, t2 = true) => `M ${Ut.boundPixel(e5.left)} ${Ut.boundPixel(e5.top)} L ${Ut.boundPixel(e5.right, true)} ${Ut.boundPixel(e5.top)} L ${Ut.boundPixel(e5.right, true)} ${Ut.boundPixel(e5.bottom, true)} L ${Ut.boundPixel(e5.left)} ${Ut.boundPixel(e5.bottom, true)} L ${Ut.boundPixel(e5.left)} ${Ut.boundPixel(e5.top)} ${t2 ? "Z" : ""}`, lo = (t2) => {
2023
+ }, oo = (e5, t2, n2) => !!n2 && (!(e5 < n2.x || e5 > n2.x + n2.width) && !(t2 < n2.y || t2 > n2.y + n2.height)), ro = (e5, t2 = true) => `M ${Nt.boundPixel(e5.left)} ${Nt.boundPixel(e5.top)} L ${Nt.boundPixel(e5.right, true)} ${Nt.boundPixel(e5.top)} L ${Nt.boundPixel(e5.right, true)} ${Nt.boundPixel(e5.bottom, true)} L ${Nt.boundPixel(e5.left)} ${Nt.boundPixel(e5.bottom, true)} L ${Nt.boundPixel(e5.left)} ${Nt.boundPixel(e5.top)} ${t2 ? "Z" : ""}`, io = (t2) => {
1991
2024
  const { linePoints: n2, bounds: o2, pathProps: r2, style: i2, ...l2 } = t2;
1992
- return e("svg", { width: `${Ut.boundPixel(o2.width, true)}`, height: `${Ut.boundPixel(o2.height, true)}`, viewBox: `0 0 ${Ut.boundPixel(o2.width, true)} ${Ut.boundPixel(o2.height, true)}`, style: { position: "absolute", left: `${Ut.boundPixel(o2.x)}px`, top: `${Ut.boundPixel(o2.y)}px`, width: `${Ut.boundPixel(o2.width, true)}px`, height: `${Ut.boundPixel(o2.height, true)}px`, pointerEvents: "none", transitionTimingFunction: "linear", transitionDelay: "0", transitionProperty: "left, top, width, height", willChange: "left, top, width, height, stroke-dashoffset", ...i2 }, ...l2, children: e("path", { d: `M ${Ut.boundPixel(n2[0])} ${Ut.boundPixel(n2[1])} L ${Ut.boundPixel(n2[2])} ${Ut.boundPixel(n2[3])}`, fill: "none", vectorEffect: "non-scaling-stroke", stroke: "black", ...r2 }) });
1993
- }, so = (n2) => {
2025
+ return e("svg", { width: `${Nt.boundPixel(o2.width, true)}`, height: `${Nt.boundPixel(o2.height, true)}`, viewBox: `0 0 ${Nt.boundPixel(o2.width, true)} ${Nt.boundPixel(o2.height, true)}`, style: { position: "absolute", left: `${Nt.boundPixel(o2.x)}px`, top: `${Nt.boundPixel(o2.y)}px`, width: `${Nt.boundPixel(o2.width, true)}px`, height: `${Nt.boundPixel(o2.height, true)}px`, pointerEvents: "none", transitionTimingFunction: "linear", transitionDelay: "0", transitionProperty: "left, top, width, height", willChange: "left, top, width, height, stroke-dashoffset", ...i2 }, ...l2, children: e("path", { d: `M ${Nt.boundPixel(n2[0])} ${Nt.boundPixel(n2[1])} L ${Nt.boundPixel(n2[2])} ${Nt.boundPixel(n2[3])}`, fill: "none", vectorEffect: "non-scaling-stroke", stroke: "black", ...r2 }) });
2026
+ }, lo = (n2) => {
1994
2027
  const { x: o2 = 0, y: r2 = 0, width: i2 = 0, height: l2 = 0, fill: s2, stroke: c2, strokeWidth: a2 = 0, strokeDasharray: d2, strokeDashoffset: u2, clipPath: h2, pathBounds: f2, pathProps: p2, style: g2, ...w2 } = n2, m2 = r2, x2 = o2, y2 = i2, v2 = l2;
1995
2028
  let b2 = null;
1996
2029
  if (s2) {
1997
- let t2 = io({ top: 0, left: 0, bottom: v2, right: y2 });
1998
- f2 && (t2 = t2 + " " + io({ top: f2.y - m2, left: f2.x - x2, bottom: f2.height + f2.y - m2, right: f2.width + f2.x - x2 })), b2 = [e("path", { d: t2, fill: s2, stroke: "none", fillRule: "evenodd" }, "fill")];
2030
+ let t2 = ro({ top: 0, left: 0, bottom: v2, right: y2 });
2031
+ f2 && (t2 = t2 + " " + ro({ top: f2.y - m2, left: f2.x - x2, bottom: f2.height + f2.y - m2, right: f2.width + f2.x - x2 })), b2 = [e("path", { d: t2, fill: s2, stroke: "none", fillRule: "evenodd" }, "fill")];
1999
2032
  }
2000
- return t("svg", { width: `${Ut.boundPixel(i2, true)}`, height: `${Ut.boundPixel(l2, true)}`, viewBox: `0 0 ${Ut.boundPixel(i2, true)} ${Ut.boundPixel(l2, true)}`, preserveAspectRatio: "none", style: { position: "absolute", left: `${Ut.boundPixel(o2)}px`, top: `${Ut.boundPixel(r2)}px`, pointerEvents: "none", transitionDuration: "0ms", transitionTimingFunction: "linear", transitionDelay: "0", transitionProperty: "left, top, width, height", willChange: "left, top, width, height, stroke-dashoffset", boxShadow: "rgb(60 64 67 / 5%) 0px 1px 4px 2px, rgb(255 255 255 / 15%) 0px 0px 2px 1px", overflow: "visible", ...g2 }, ...w2, children: [b2, e("path", { d: io({ top: 0, left: 0, right: y2, bottom: v2 }), fill: "none", strokeDasharray: d2, strokeDashoffset: u2, stroke: c2, vectorEffect: "non-scaling-stroke", strokeWidth: a2, ...p2 })] });
2001
- }, co = (t2) => {
2033
+ return t("svg", { width: `${Nt.boundPixel(i2, true)}`, height: `${Nt.boundPixel(l2, true)}`, viewBox: `0 0 ${Nt.boundPixel(i2, true)} ${Nt.boundPixel(l2, true)}`, preserveAspectRatio: "none", style: { position: "absolute", left: `${Nt.boundPixel(o2)}px`, top: `${Nt.boundPixel(r2)}px`, pointerEvents: "none", transitionDuration: "0ms", transitionTimingFunction: "linear", transitionDelay: "0", transitionProperty: "left, top, width, height", willChange: "left, top, width, height, stroke-dashoffset", boxShadow: "rgb(60 64 67 / 5%) 0px 1px 4px 2px, rgb(255 255 255 / 15%) 0px 0px 2px 1px", overflow: "visible", ...g2 }, ...w2, children: [b2, e("path", { d: ro({ top: 0, left: 0, right: y2, bottom: v2 }), fill: "none", strokeDasharray: d2, strokeDashoffset: u2, stroke: c2, vectorEffect: "non-scaling-stroke", strokeWidth: a2, ...p2 })] });
2034
+ }, so = (t2) => {
2002
2035
  const { key: n2, ...o2 } = t2;
2003
- return e(ao, { ...o2 }, n2);
2004
- }, ao = r((t2) => {
2036
+ return e(co, { ...o2 }, n2);
2037
+ }, co = r((t2) => {
2005
2038
  const { stroke: n2, fill: o2, x: r2 = 0, y: i2 = 0, width: l2 = 0, height: c2 = 0, style: a2, isAnimatedStroke: d2, animatedStrokeProps: u2, range: h2, cell: f2, ...p2 } = t2, g2 = d2 || !!u2, w2 = { name: "walking-offset", dashGap: 2, speed: 50, dashLength: 8, ...u2 };
2006
2039
  let m2 = w2.dashGap + w2.dashLength;
2007
- const x2 = w2.speed * m2, y2 = Pn().replaceAll(":", ""), v2 = `${w2.name}-${y2}`;
2040
+ const x2 = w2.speed * m2, y2 = Rn().replaceAll(":", ""), v2 = `${w2.name}-${y2}`;
2008
2041
  let b2;
2009
2042
  return s(() => {
2010
2043
  if (!g2) return;
@@ -2017,10 +2050,10 @@ const kn = () => "sheetxl-ui-" + Mn++, Rn = o["useId".toString()], Pn = null !=
2017
2050
  return t3.sheet.insertRule(e5, 0), () => {
2018
2051
  document.head.removeChild(t3);
2019
2052
  };
2020
- }, [g2]), g2 && (b2 = { strokeDasharray: `${w2.dashLength}px ${w2.dashGap}px`, strokeDashoffset: `${m2}px`, animation: `${v2} ${x2}ms linear infinite`, willChange: "stroke-dashoffset" }), e(so, { x: r2, y: i2, width: l2, height: c2, stroke: n2, fill: o2, shapeRendering: "crispEdges", style: { ...b2, ...a2 }, ...p2 });
2053
+ }, [g2]), g2 && (b2 = { strokeDasharray: `${w2.dashLength}px ${w2.dashGap}px`, strokeDashoffset: `${m2}px`, animation: `${v2} ${x2}ms linear infinite`, willChange: "stroke-dashoffset" }), e(lo, { x: r2, y: i2, width: l2, height: c2, stroke: n2, fill: o2, shapeRendering: "crispEdges", style: { ...b2, ...a2 }, ...p2 });
2021
2054
  });
2022
- ao.displayName = "Selection";
2023
- const uo = r(a((t2, n2) => {
2055
+ co.displayName = "Selection";
2056
+ const ao = r(a((t2, n2) => {
2024
2057
  const { x: o2 = 0, y: r2 = 0, borderWidth: i2 = 1, size: l2 = 6, borderStroke: s2, corner: c2, style: a2, className: d2, background: u2, ...h2 } = t2;
2025
2058
  if (0 === o2 || 0 === r2) return null;
2026
2059
  let f2 = true, p2 = true, w2 = true, m2 = true;
@@ -2039,9 +2072,9 @@ const uo = r(a((t2, n2) => {
2039
2072
  }
2040
2073
  return e("div", { className: g("fill-handle", d2), style: { position: "absolute", left: o2 - (l2 + (f2 ? i2 : 0)) / 2, top: r2 - (l2 + (p2 ? i2 : 0)) / 2, width: l2, height: l2, borderLeft: f2 ? `${i2}px ${s2}` : void 0, borderTop: p2 ? `${i2}px ${s2}` : void 0, borderRight: w2 ? `${i2}px ${s2}` : void 0, borderBottom: m2 ? `${i2}px ${s2}` : void 0, background: u2, cursor: "crosshair", pointerEvents: "all", transitionDuration: "0ms", transitionTimingFunction: "linear", transitionDelay: "0", transitionProperty: "left, top", willChange: "left, top", ...a2 }, tabIndex: -1, ...h2 });
2041
2074
  }));
2042
- uo.displayName = "FillHandle";
2043
- const ho = r(a((o2, r2) => {
2044
- const { range: i2, view: c2, anchor: a2, borderStroke: u2 = "rgb(33, 115, 70)", background: f2 = "white", borderWidth: p2 = 1.5, size: x2 = 22, style: y2, className: b2, selectionTouchPointerHandler: S2, onTouchSelectStart: E2, onTouchSelectEnd: _2, currentTouchAnchor: I2, scrollableElement: C2, scrollableRoot: M2 = document.body, ...T2 } = o2, k2 = Tt(E2, [E2]), R2 = Tt(_2, [_2]), { bounds: P2, coordsPivot: O2, key: L2 } = d(() => {
2075
+ ao.displayName = "FillHandle";
2076
+ const uo = r(a((o2, r2) => {
2077
+ const { range: i2, view: c2, anchor: a2, borderStroke: u2 = "rgb(33, 115, 70)", background: f2 = "white", borderWidth: p2 = 1.5, size: x2 = 22, style: y2, className: b2, selectionTouchPointerHandler: S2, onTouchSelectStart: _2, onTouchSelectEnd: E2, currentTouchAnchor: I2, scrollableElement: C2, scrollableRoot: M2 = document.body, ...T2 } = o2, k2 = Tt(_2, [_2]), R2 = Tt(E2, [E2]), { bounds: P2, coordsPivot: O2, key: L2 } = d(() => {
2045
2078
  if (!i2 || !c2) return null;
2046
2079
  let e5 = null, t2 = null;
2047
2080
  switch (a2) {
@@ -2083,7 +2116,7 @@ const ho = r(a((o2, r2) => {
2083
2116
  }
2084
2117
  const h2 = c2.toClipBounds(n2, 0);
2085
2118
  return !h2 || h2.width <= 0 || h2.height <= 0 || n2.x < 0 || n2.y < 0 || n2.x > d2 || n2.y > u3 ? { bounds: null, coordsAnchor: null, coordsPivot: null, key: null } : { bounds: n2, coordsAnchor: null, coordsPivot: e5, key: "touchSelect-" + c2.getAnchor() + "-" + a2 };
2086
- }, [i2, c2, a2]), D2 = l(null), z2 = hn(d(() => {
2119
+ }, [i2, c2, a2]), D2 = l(null), z2 = un(d(() => {
2087
2120
  const e5 = (e6) => "t" === a2 || "b" === a2 ? { ...e6, colIndex: void 0 } : "l" === a2 || "r" === a2 ? { ...e6, rowIndex: void 0 } : e6;
2088
2121
  return { processTouch: true, consumeTouch: true, onPointerDown: (t2, n2) => {
2089
2122
  const o3 = e5(c2.getCellCoordsFromClient(t2.clientX, t2.clientY));
@@ -2092,7 +2125,7 @@ const ho = r(a((o2, r2) => {
2092
2125
  const r3 = e5(c2.getCellCoordsFromClient(t2.clientX, t2.clientY));
2093
2126
  return S2.onSelectionPointerMoveOrWait(t2, n2, o3, c2, r3, D2.current?.coordsPivot, true, true);
2094
2127
  }, onPointerUp: (e6, t2, n2) => (D2.current = null, R2?.(a2), S2.onPointerUp(e6, t2, n2)) };
2095
- }, [S2, i2, c2, a2])), [A2, { y: $2, x: B2 }] = w(), F2 = l(null), { getPortalContainer: j2 } = Qt(), [V2, W2] = h(null);
2128
+ }, [S2, i2, c2, a2])), [A2, { y: $2, x: B2 }] = w(), F2 = l(null), { getPortalContainer: j2 } = Jt(), [V2, W2] = h(null);
2096
2129
  return s(() => {
2097
2130
  const t2 = F2.current?.getBoundingClientRect();
2098
2131
  if (!t2 || !P2) return void W2(null);
@@ -2101,20 +2134,20 @@ const ho = r(a((o2, r2) => {
2101
2134
  W2(v(e("div", { className: g("touch-select-handle", b2), ref: r2, style: { position: "absolute", left: n2 + (t2?.x ?? 0) - (x2 + p2) / 2, top: o3 + (t2?.y ?? 0) - (x2 + p2) / 2, width: x2, height: x2, borderWidth: `${p2}px`, border: u2, borderRadius: "50%", background: f2, boxShadow: `0 0 0 1.5px ${f2}`, cursor: "grab", pointerEvents: "all", opacity: I2 ? 0 : 1, transitionDuration: "160ms", transitionProperty: "opacity", ...y2 }, tabIndex: -1, onPointerDown: z2, ...T2 }), M2 ?? j2(), L2));
2102
2135
  }, [$2, B2, P2?.x, P2?.y, P2?.width, P2?.height, b2, I2, f2, x2, p2, u2, C2]), P2 ? t(n, { children: [e("div", { ref: m([A2, F2]), style: { position: "absolute", left: P2.x, top: P2.y, opacity: 0 } }), V2] }) : null;
2103
2136
  }));
2104
- ho.displayName = "TouchSelectHandle";
2105
- const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd: 0 }), go = Object.freeze({ colIndex: 0, rowIndex: 0 }), wo = Object.freeze([]), mo = (e5) => {
2137
+ uo.displayName = "TouchSelectHandle";
2138
+ const ho = -10, fo = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd: 0 }), po = Object.freeze({ colIndex: 0, rowIndex: 0 }), go = Object.freeze([]), wo = (e5) => {
2106
2139
  if (e5 && e5.cell && e5.ranges && e5.rangeIndex > -1 && e5.rangeIndex <= e5.ranges.length) return e5;
2107
- const t2 = { cell: null, ranges: e5?.ranges ?? wo };
2108
- return t2.rangeIndex = e5?.rangeIndex ?? t2.ranges.length - 1, t2.cell = e5?.cell, !t2.cell && t2.ranges.length > 0 && (t2.cell = { rowIndex: t2.ranges[t2.rangeIndex].rowStart, colIndex: t2.ranges[t2.rangeIndex].colStart }), t2.cell || (t2.cell = go), ne.isEqualSelectionCoords(t2, e5) ? e5 : t2;
2109
- }, xo = (e5, t2, n2) => {
2140
+ const t2 = { cell: null, ranges: e5?.ranges ?? go };
2141
+ return t2.rangeIndex = e5?.rangeIndex ?? t2.ranges.length - 1, t2.cell = e5?.cell, !t2.cell && t2.ranges.length > 0 && (t2.cell = { rowIndex: t2.ranges[t2.rangeIndex].rowStart, colIndex: t2.ranges[t2.rangeIndex].colStart }), t2.cell || (t2.cell = po), ne.isEqualSelectionCoords(t2, e5) ? e5 : t2;
2142
+ }, mo = (e5, t2, n2) => {
2110
2143
  const o2 = e5.getVisibleRangeCoords(), r2 = e5.getScrollOrientation();
2111
2144
  !r2.horizontal && (t2.colIndex > o2.colEnd || t2.colIndex < o2.colStart) && (t2 = { ...t2, colIndex: t2.colIndex > o2.colEnd ? o2.colEnd + 1 : o2.colEnd - 1 }, e5 = n2.current.getViewFromLocation(k)), !r2.vertical && (t2.rowIndex > o2.rowEnd || t2.rowIndex < o2.rowStart) && (t2 = { ...t2, rowIndex: t2.rowIndex > o2.rowEnd ? o2.rowEnd + 1 : o2.rowEnd - 1 }, e5 = n2.current.getViewFromLocation(k)), e5.scrollCellCoordsIntoView(t2);
2112
- }, yo = () => false, vo = ({ gridRef: t2, commands: n2, layout: o2, selection: r2, onSelectionChange: c2, onSelectionDragStart: a2, onSelectionDragEnd: p2, selectionPolicy: g2 = "multiple", newSelectionMode: w2 = "clear", allowDeselectSelection: m2 = true, onFillPreview: x2, onFillCancel: y2, onFillDone: v2, onFill: b2, disableFillDrag: R2 = !b2, fillHandleBorderColor: P2 = "white", hiddenRowsAt: O2, hiddenColumnsAt: L2, isContentfulCell: D2, contentfulCellFinder: z2 = Xn, getDataCoords: A2, alwaysScrollToActiveCoords: $2 = false, selectionBounds: B2, pointerDownInterceptor: F2, pointerMoveInterceptor: j2, mergedRanges: V2, canSelectionSpanMergedCells: W2 = yo, onMoveDragStart: H2, onMoveDragUpdate: N2, onMoveDragEnd: U2, onMoveDragDone: K2, selectionRenderer: q2 = co, disableMoveDrag: Y2 = !U2, getCellCoordsAsRangeCoords: X2 = ne.cellToRange, moveDragHitSize: G2 = 6, moveDragOutlineSize: Z2 = 4, selectionBackgroundColor: J2 = "rgba(16, 124, 65, 0.1)", selectionBorderColor: Q2 = "rgb(33, 115, 70)", selectionRemoveBorderColor: ee2 = "rgb(255, 0, 0)", selectionRemoveBackgroundColor: te2 = "rgba(250, 10, 10, 0.1)", disableTouchSelection: oe2 = false, touchSelectHandleProps: re2 }) => {
2113
- const ie2 = i(() => ({ top: B2?.top ?? 0, left: B2?.left ?? 0, bottom: t2.current?.rowCount - 1 || 0, right: t2.current?.columnCount - 1 || 0 }), []), le2 = Tt(b2, [b2]), se2 = Tt(x2, [x2]), ce2 = Tt(y2, [y2]), ae2 = Tt(v2, [v2]), de2 = Tt(D2, [D2]), ue2 = Tt(q2, [q2]), he2 = Tt((e5, t3 = false) => to(e5, t3, o2.getRowOffset, t3 ? ie2().bottom : ie2().top), [o2?.getRowOffset]), fe2 = Tt(O2 ?? he2, [O2]), pe2 = Tt((e5, t3 = false) => to(e5, t3, o2.getColOffset, t3 ? ie2().right : ie2().left), [o2?.getColOffset]), ge2 = Tt(L2 ?? pe2, [L2]), [we2, me2] = h(() => mo(r2)), xe2 = d(() => mo(we2), [we2]), ye2 = l(xe2), ve2 = l(true);
2145
+ }, xo = () => false, yo = ({ gridRef: t2, commands: n2, layout: o2, selection: r2, onSelectionChange: c2, onSelectionDragStart: a2, onSelectionDragEnd: p2, selectionPolicy: g2 = "multiple", newSelectionMode: w2 = "clear", allowDeselectSelection: m2 = true, onFillPreview: x2, onFillCancel: y2, onFillDone: v2, onFill: b2, disableFillDrag: R2 = !b2, fillHandleBorderColor: P2 = "white", hiddenRowsAt: O2, hiddenColumnsAt: L2, isContentfulCell: D2, contentfulCellFinder: z2 = Yn, getDataCoords: A2, alwaysScrollToActiveCoords: $2 = false, selectionBounds: B2, pointerDownInterceptor: F2, pointerMoveInterceptor: j2, mergedRanges: V2, canSelectionSpanMergedCells: W2 = xo, onMoveDragStart: H2, onMoveDragUpdate: N2, onMoveDragEnd: U2, onMoveDragDone: K2, selectionRenderer: q2 = so, disableMoveDrag: Y2 = !U2, getCellCoordsAsRangeCoords: X2 = ne.cellToRange, moveDragHitSize: G2 = 6, moveDragOutlineSize: Z2 = 4, selectionBackgroundColor: J2 = "rgba(16, 124, 65, 0.1)", selectionBorderColor: Q2 = "rgb(33, 115, 70)", selectionRemoveBorderColor: ee2 = "rgb(255, 0, 0)", selectionRemoveBackgroundColor: te2 = "rgba(250, 10, 10, 0.1)", disableTouchSelection: oe2 = false, touchSelectHandleProps: re2 }) => {
2146
+ const ie2 = i(() => ({ top: B2?.top ?? 0, left: B2?.left ?? 0, bottom: t2.current?.rowCount - 1 || 0, right: t2.current?.columnCount - 1 || 0 }), []), le2 = Tt(b2, [b2]), se2 = Tt(x2, [x2]), ce2 = Tt(y2, [y2]), ae2 = Tt(v2, [v2]), de2 = Tt(D2, [D2]), ue2 = Tt(q2, [q2]), he2 = Tt((e5, t3 = false) => eo(e5, t3, o2.getRowOffset, t3 ? ie2().bottom : ie2().top), [o2?.getRowOffset]), fe2 = Tt(O2 ?? he2, [O2]), pe2 = Tt((e5, t3 = false) => eo(e5, t3, o2.getColOffset, t3 ? ie2().right : ie2().left), [o2?.getColOffset]), ge2 = Tt(L2 ?? pe2, [L2]), [we2, me2] = h(() => wo(r2)), xe2 = d(() => wo(we2), [we2]), ye2 = l(xe2), ve2 = l(true);
2114
2147
  u(Me.throttle(() => {
2115
2148
  me2((e5) => {
2116
2149
  ve2.current = true;
2117
- const t3 = mo(r2);
2150
+ const t3 = wo(r2);
2118
2151
  return ne.isEqualSelectionCoords(t3, e5) ? e5 : t3;
2119
2152
  });
2120
2153
  }, 0), [r2]), u(() => {
@@ -2124,8 +2157,8 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2124
2157
  }, [xe2]);
2125
2158
  const be2 = i((e5) => {
2126
2159
  me2((t3) => {
2127
- ve2.current = false, t3 = mo(t3);
2128
- let n3 = "function" == typeof e5 ? e5(t3.ranges) : e5 ?? wo;
2160
+ ve2.current = false, t3 = wo(t3);
2161
+ let n3 = "function" == typeof e5 ? e5(t3.ranges) : e5 ?? go;
2129
2162
  if (ne.isEqualRangesArrays(n3, t3.ranges)) return t3;
2130
2163
  let o3 = Math.max(n3.length ? 0 : -1, Math.min(t3.rangeIndex, n3.length - 1)), r3 = t3.cell;
2131
2164
  -1 === o3 || ne.isCellWithinRange(r3, n3[o3]) || (r3 = { rowIndex: n3[o3].rowStart, colIndex: n3[o3].colStart }), 1 === n3.length && ne.isSingleCell(n3[0]) && ne.isCellWithinRange(r3, n3[0]) && (n3 = [], o3 = -1);
@@ -2134,8 +2167,8 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2134
2167
  });
2135
2168
  }, []), Se2 = Tt((e5) => {
2136
2169
  me2((t3) => {
2137
- ve2.current = false, t3 = mo(t3);
2138
- const n3 = e5 ?? go, o3 = X2(n3);
2170
+ ve2.current = false, t3 = wo(t3);
2171
+ const n3 = e5 ?? po, o3 = X2(n3);
2139
2172
  if (!ne.isSingleCell(o3) && 0 === t3.ranges.length) return { ranges: [o3], rangeIndex: 0, cell: n3 };
2140
2173
  if (ne.isEqualCells(n3, t3.cell)) return t3;
2141
2174
  let r3 = t3.ranges, i2 = t3.rangeIndex;
@@ -2143,7 +2176,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2143
2176
  const l2 = { ranges: r3, rangeIndex: i2, cell: n3 };
2144
2177
  return ne.isEqualSelectionCoords(l2, t3) ? t3 : l2;
2145
2178
  });
2146
- }, [X2]), [Ee2, _e2] = h(null), [Ie2, Ce2] = h(null), Te2 = l(null), [ke2, Re2] = h(null), Pe2 = l(null), Oe2 = l(null), [Le2, De2] = h(null), ze2 = l(null), Ae2 = l(null), $e2 = l(V2);
2179
+ }, [X2]), [_e2, Ee2] = h(null), [Ie2, Ce2] = h(null), Te2 = l(null), [ke2, Re2] = h(null), Pe2 = l(null), Oe2 = l(null), [Le2, De2] = h(null), ze2 = l(null), Ae2 = l(null), $e2 = l(V2);
2147
2180
  s(() => {
2148
2181
  $e2.current = V2;
2149
2182
  }, [V2]);
@@ -2180,7 +2213,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2180
2213
  "clear" === w2 ? (ze2.current = i2, Ue2()) : "modify" === w2 ? We2(r3) : Ne2(r3), Se2(i2);
2181
2214
  }, []), Ne2 = i((e5, t3 = e5, n3) => {
2182
2215
  "multiple" !== g2 || !e5 || Fe2(e5) || Fe2(t3) || me2((o3) => {
2183
- ve2.current = false, o3 = mo(o3);
2216
+ ve2.current = false, o3 = wo(o3);
2184
2217
  const r3 = je2(e5, t3);
2185
2218
  if (!r3) return o3;
2186
2219
  let i2 = o3.ranges.length > 0 ? [...o3.ranges] : [je2(o3.cell, o3.cell)];
@@ -2189,8 +2222,8 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2189
2222
  return ne.isEqualSelectionCoords(l2, o3) ? o3 : l2;
2190
2223
  });
2191
2224
  }, []), Ue2 = () => {
2192
- be2(wo);
2193
- }, Ke2 = "touch" === Ut.detectIt().primaryInput, qe2 = l(null), Ye2 = l(null), Xe2 = l(null), Ge2 = d(() => ({ onPointerDown: (e5) => {
2225
+ be2(go);
2226
+ }, Ke2 = "touch" === Nt.detectIt().primaryInput, qe2 = l(null), Ye2 = l(null), Xe2 = l(null), Ge2 = d(() => ({ onPointerDown: (e5) => {
2194
2227
  if (!t2 || !t2.current) return false;
2195
2228
  const n3 = e5.nativeEvent, o3 = t2.current.getViewFromClient(n3.clientX, n3.clientY);
2196
2229
  if ("touch" === n3.pointerType || "touchstart" === n3.type) return Ye2.current = { topLeft: o3.getScrollTopLeft(), point: { x: n3.clientX, y: n3.clientY } }, true;
@@ -2232,7 +2265,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2232
2265
  const o4 = je2(t3, n4);
2233
2266
  Oe2.current = o4, Re2(o4);
2234
2267
  } else We2(i2);
2235
- Xe2.current = n3, xo(r3, i2, t2);
2268
+ Xe2.current = n3, mo(r3, i2, t2);
2236
2269
  }
2237
2270
  }, 60), onPointerUp: (e5) => {
2238
2271
  if (qe2.current = null, "touch" === e5.pointerType || "touchend" === e5.type) {
@@ -2253,7 +2286,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2253
2286
  if (!Pe2.current) return;
2254
2287
  const n3 = Oe2.current;
2255
2288
  Pe2.current = null, Oe2.current = null, Re2(null), me2((e6) => {
2256
- if (ve2.current = false, 0 === (e6 = mo(e6)).ranges.length) return e6;
2289
+ if (ve2.current = false, 0 === (e6 = wo(e6)).ranges.length) return e6;
2257
2290
  let t3 = [], o3 = -1, r3 = e6.cell;
2258
2291
  for (let i3 = 0; i3 < e6.ranges.length; i3++) {
2259
2292
  const l2 = e6.ranges[i3];
@@ -2269,7 +2302,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2269
2302
  const i2 = { cell: r3, rangeIndex: o3, ranges: t3 };
2270
2303
  return ne.isEqualSelectionCoords(i2, e6) ? e6 : i2;
2271
2304
  });
2272
- }, processTouch: true, consumeTouch: false }), [xe2, g2, m2, $2, w2]), Ze2 = Tt(hn(Ge2), []), Je2 = d(() => ({ onSelectionPointerDown: (e5, n3, o3, r3, i2 = xe2.cell, l2 = $2, s2 = e5.nativeEvent.shiftKey, c3 = false) => {
2305
+ }, processTouch: true, consumeTouch: false }), [xe2, g2, m2, $2, w2]), Ze2 = Tt(un(Ge2), []), Je2 = d(() => ({ onSelectionPointerDown: (e5, n3, o3, r3, i2 = xe2.cell, l2 = $2, s2 = e5.nativeEvent.shiftKey, c3 = false) => {
2273
2306
  if (!t2 || !t2.current) return false;
2274
2307
  e5.stopPropagation(), e5.preventDefault(), e5.nativeEvent.stopImmediatePropagation();
2275
2308
  const d2 = o3 ?? t2.current.getViewFromClient(e5.nativeEvent.clientX, e5.nativeEvent.clientY), u2 = r3 ?? d2.getCellCoordsFromClient(e5.nativeEvent.clientX, e5.nativeEvent.clientY);
@@ -2309,7 +2342,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2309
2342
  const o4 = je2(t3, n4);
2310
2343
  Oe2.current = o4, Re2(o4);
2311
2344
  } else We2(u2, l2, c3);
2312
- s2 && xo(d2, u2, t2);
2345
+ s2 && mo(d2, u2, t2);
2313
2346
  }
2314
2347
  }, onPointerUp: (e5) => {
2315
2348
  qe2.current = null, e5.stopPropagation(), e5.preventDefault(), e5.stopImmediatePropagation();
@@ -2321,7 +2354,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2321
2354
  if (!Pe2.current) return;
2322
2355
  const t3 = Oe2.current;
2323
2356
  Pe2.current = null, Oe2.current = null, Re2(null), me2((e6) => {
2324
- if (ve2.current = false, 0 === (e6 = mo(e6)).ranges.length) return e6;
2357
+ if (ve2.current = false, 0 === (e6 = wo(e6)).ranges.length) return e6;
2325
2358
  let n3 = [], o3 = -1, r3 = e6.cell;
2326
2359
  for (let i3 = 0; i3 < e6.ranges.length; i3++) {
2327
2360
  const l2 = e6.ranges[i3];
@@ -2346,10 +2379,10 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2346
2379
  case S:
2347
2380
  s2 = { rowIndex: n4.rowIndex === t3.rowStart ? t3.rowEnd : t3.rowStart, colIndex: t3.colEnd }, l2 = { rowIndex: n4.rowIndex === t3.rowStart ? t3.rowStart : t3.rowEnd, colIndex: t3.colStart };
2348
2381
  break;
2349
- case E:
2382
+ case _:
2350
2383
  s2 = { rowIndex: n4.rowIndex === t3.rowEnd ? t3.rowStart : t3.rowEnd, colIndex: t3.colEnd }, l2 = { rowIndex: n4.rowIndex === t3.rowEnd ? t3.rowEnd : t3.rowStart, colIndex: t3.colStart };
2351
2384
  break;
2352
- case _:
2385
+ case E:
2353
2386
  s2 = { rowIndex: t3.rowEnd, colIndex: n4.colIndex === t3.colStart ? t3.colEnd : t3.colStart }, l2 = { rowIndex: t3.rowStart, colIndex: n4.colIndex === t3.colStart ? t3.colStart : t3.colEnd };
2354
2387
  break;
2355
2388
  case I:
@@ -2361,35 +2394,35 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2361
2394
  const u2 = ie2();
2362
2395
  if (Ae2.current) switch (e5) {
2363
2396
  case S:
2364
- case E:
2397
+ case _:
2365
2398
  Ae2.current.colIndex >= c3.colStart && Ae2.current.colIndex <= c3.colEnd && (d2 = Ae2.current.colIndex);
2366
2399
  break;
2367
- case _:
2400
+ case E:
2368
2401
  case I:
2369
2402
  Ae2.current.rowIndex >= c3.rowStart && Ae2.current.rowIndex <= c3.rowEnd && (a3 = Ae2.current.rowIndex);
2370
2403
  }
2371
2404
  if (!i2) {
2372
2405
  switch (e5) {
2373
2406
  case S:
2374
- a3 = Un(fe2, Math.max(c3.rowStart - 1, u2.top), e5);
2375
- break;
2376
- case E:
2377
- a3 = Un(fe2, Math.min(c3.rowEnd + 1, u2.bottom), e5);
2407
+ a3 = Nn(fe2, Math.max(c3.rowStart - 1, u2.top), e5);
2378
2408
  break;
2379
2409
  case _:
2380
- d2 = Un(ge2, Math.max(c3.colStart - 1, u2.left), e5);
2410
+ a3 = Nn(fe2, Math.min(c3.rowEnd + 1, u2.bottom), e5);
2411
+ break;
2412
+ case E:
2413
+ d2 = Nn(ge2, Math.max(c3.colStart - 1, u2.left), e5);
2381
2414
  break;
2382
2415
  case I:
2383
- d2 = Un(ge2, Math.min(c3.colEnd + 1, u2.right), e5);
2416
+ d2 = Nn(ge2, Math.min(c3.colEnd + 1, u2.right), e5);
2384
2417
  }
2385
2418
  if (r3) switch (e5) {
2386
2419
  case S:
2387
2420
  a3 = z2({ ...s2, colIndex: xe2.cell.colIndex }, de2, fe2, e5, false, Math.max(u2.top, fe2(u2.top, false)));
2388
2421
  break;
2389
- case E:
2422
+ case _:
2390
2423
  a3 = z2({ ...s2, colIndex: xe2.cell.colIndex }, de2, fe2, e5, false, Math.min(u2.bottom, u2.bottom - fe2(u2.bottom, true)));
2391
2424
  break;
2392
- case _:
2425
+ case E:
2393
2426
  d2 = z2({ ...s2, rowIndex: xe2.cell.rowIndex }, de2, ge2, e5, false, Math.max(u2.left, ge2(u2.left, false)));
2394
2427
  break;
2395
2428
  case I:
@@ -2403,10 +2436,10 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2403
2436
  case S:
2404
2437
  n4 = o2.getRowOffset(a3 + 1), a3 = Math.max(u2.top, o2.getRowIndex(n4 - i2)), h2 = { top: o2.getRowOffset(a3 + 1) - (n4 - t2.current.getScrollPosition().top) };
2405
2438
  break;
2406
- case E:
2439
+ case _:
2407
2440
  n4 = o2.getRowOffset(a3), a3 = Math.min(u2.bottom, o2.getRowIndex(n4 + i2)), h2 = { top: o2.getRowOffset(a3) - (n4 - t2.current.getScrollPosition().top) };
2408
2441
  break;
2409
- case _:
2442
+ case E:
2410
2443
  n4 = o2.getColOffset(d2 + 1), d2 = Math.max(u2.left, o2.getColIndex(n4 - i2)), h2 = { left: o2.getColOffset(d2 + 1) - (n4 - t2.current.getScrollPosition().left) };
2411
2444
  break;
2412
2445
  case I:
@@ -2420,18 +2453,18 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2420
2453
  else {
2421
2454
  if (n3 && ze2.current) {
2422
2455
  const t3 = ie2();
2423
- if (e5 === I && ze2.current.colIndex === t3.left || e5 === _ && ze2.current.colIndex === t3.right || e5 === S && ze2.current.rowIndex === t3.bottom || e5 === E && ze2.current.rowIndex === t3.top) return;
2456
+ if (e5 === I && ze2.current.colIndex === t3.left || e5 === E && ze2.current.colIndex === t3.right || e5 === S && ze2.current.rowIndex === t3.bottom || e5 === _ && ze2.current.rowIndex === t3.top) return;
2424
2457
  }
2425
- e5 === _ || e5 === I ? Be2({ colIndex: f2.colIndex }) : e5 !== S && e5 !== E || Be2({ rowIndex: f2.rowIndex });
2458
+ e5 === E || e5 === I ? Be2({ colIndex: f2.colIndex }) : e5 !== S && e5 !== _ || Be2({ rowIndex: f2.rowIndex });
2426
2459
  }
2427
2460
  }, [xe2, X2]), et2 = Tt((e5) => {
2428
2461
  if (!t2.current) return;
2429
2462
  if (0 === xe2.ranges.length) return void Qe2(e5);
2430
2463
  const n3 = X2(xe2.cell);
2431
2464
  if (ne.isEqualRangesArrays([n3], xe2.ranges)) return void Qe2(e5);
2432
- const o3 = Qn(xe2, e5, X2, fe2, ge2);
2465
+ const o3 = Jn(xe2, e5, X2, fe2, ge2);
2433
2466
  me2((e6) => {
2434
- ve2.current = false, e6 = mo(e6);
2467
+ ve2.current = false, e6 = wo(e6);
2435
2468
  const t3 = { ...e6, cell: o3.cell, rangeIndex: o3.rangeIndex };
2436
2469
  return ne.isEqualSelectionCoords(t3, e6) ? e6 : t3;
2437
2470
  }), o3.cell && Be2(o3.cell);
@@ -2464,62 +2497,62 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2464
2497
  }, [A2]), dt2 = Tt((e5) => {
2465
2498
  if (!t2.current) return;
2466
2499
  if (xe2.ranges.length <= 1) return;
2467
- const n3 = e5 === _ || e5 === S;
2500
+ const n3 = e5 === E || e5 === S;
2468
2501
  let o3 = xe2.rangeIndex + (n3 ? -1 : 1);
2469
2502
  o3 < 0 ? o3 = xe2.ranges.length - 1 : o3 > xe2.ranges.length - 1 && (o3 = 0);
2470
- const r3 = xe2.ranges[o3], i2 = Qn({ cell: { rowIndex: r3.rowEnd, colIndex: r3.colEnd }, rangeIndex: 0, ranges: [r3] }, I, X2, fe2, ge2);
2503
+ const r3 = xe2.ranges[o3], i2 = Jn({ cell: { rowIndex: r3.rowEnd, colIndex: r3.colEnd }, rangeIndex: 0, ranges: [r3] }, I, X2, fe2, ge2);
2471
2504
  me2((e6) => {
2472
- ve2.current = false, e6 = mo(e6);
2505
+ ve2.current = false, e6 = wo(e6);
2473
2506
  const t3 = { ...e6, cell: i2.cell, rangeIndex: o3 };
2474
2507
  return ne.isEqualSelectionCoords(t3, e6) ? e6 : t3;
2475
2508
  }), i2.cell && Be2(i2.cell);
2476
2509
  }, [xe2, X2]), ut2 = Tt(() => {
2477
- const e5 = Jn(xe2);
2510
+ const e5 = Zn(xe2);
2478
2511
  me2((t3) => {
2479
- ve2.current = false, t3 = mo(t3);
2512
+ ve2.current = false, t3 = wo(t3);
2480
2513
  const n3 = { ...t3, visibleSelection: e5 };
2481
2514
  return ne.isEqualSelectionCoords(n3, t3) ? t3 : n3;
2482
2515
  }), e5.cell && Be2(e5.cell);
2483
2516
  }, [xe2, X2]), ht2 = Tt(() => {
2484
2517
  if (!t2.current) return;
2485
2518
  if (0 === xe2.ranges.length) return;
2486
- const e5 = xe2.cell, n3 = xe2.ranges[xe2.rangeIndex], o3 = Jn({ cell: e5, rangeIndex: 0, ranges: [n3] }), r3 = o3.ranges[o3.rangeIndex];
2519
+ const e5 = xe2.cell, n3 = xe2.ranges[xe2.rangeIndex], o3 = Zn({ cell: e5, rangeIndex: 0, ranges: [n3] }), r3 = o3.ranges[o3.rangeIndex];
2487
2520
  let i2;
2488
2521
  i2 = r3.rowStart === e5.rowIndex && r3.colStart === e5.colIndex ? { rowIndex: r3.rowStart, colIndex: r3.colEnd } : r3.rowStart === e5.rowIndex && r3.colEnd === e5.colIndex ? { rowIndex: r3.rowEnd, colIndex: r3.colStart } : r3.rowEnd === e5.rowIndex && r3.colStart === e5.colIndex ? { rowIndex: r3.rowEnd, colIndex: r3.colEnd } : { rowIndex: r3.rowStart, colIndex: r3.colStart }, me2((e6) => {
2489
- e6 = mo(e6);
2522
+ e6 = wo(e6);
2490
2523
  const t3 = { ...e6, cell: i2 };
2491
2524
  return ne.isEqualSelectionCoords(t3, e6) ? e6 : t3;
2492
2525
  }), i2 && Be2(i2);
2493
2526
  }, [xe2, X2]), ft2 = i((e5 = false) => {
2494
- Qe2(E, e5, false, t2.current.getDimensions().containerHeight);
2527
+ Qe2(_, e5, false, t2.current.getDimensions().containerHeight);
2495
2528
  }, []), pt2 = i((e5 = false) => {
2496
2529
  Qe2(S, e5, false, t2.current.getDimensions().containerHeight);
2497
2530
  }, []), xt2 = i((e5 = false) => {
2498
2531
  Qe2(I, e5, false, t2.current.getDimensions().containerWidth);
2499
2532
  }, []), yt2 = i((e5 = false) => {
2500
- Qe2(_, e5, false, t2.current.getDimensions().containerWidth);
2533
+ Qe2(E, e5, false, t2.current.getDimensions().containerWidth);
2501
2534
  }, []), vt2 = i(() => {
2502
- et2(_);
2535
+ et2(E);
2503
2536
  }, []), bt2 = i(() => {
2504
2537
  et2(I);
2505
2538
  }, []), St2 = i(() => {
2506
2539
  et2(S);
2507
- }, []), Et2 = i(() => {
2508
- et2(E);
2509
2540
  }, []), _t2 = i(() => {
2510
- dt2(_);
2541
+ et2(_);
2542
+ }, []), Et2 = i(() => {
2543
+ dt2(E);
2511
2544
  }, []), It2 = i(() => {
2512
2545
  dt2(I);
2513
2546
  }, []), Mt2 = i(() => {
2514
2547
  ht2();
2515
2548
  }, []), kt2 = i(() => {
2516
- Qe2(_, false, false);
2549
+ Qe2(E, false, false);
2517
2550
  }, []), Rt2 = i(() => {
2518
- Qe2(_, true, false);
2551
+ Qe2(E, true, false);
2519
2552
  }, []), Pt2 = i(() => {
2520
- Qe2(_, false, true);
2553
+ Qe2(E, false, true);
2521
2554
  }, []), Ot2 = i(() => {
2522
- Qe2(_, true, true);
2555
+ Qe2(E, true, true);
2523
2556
  }, []), Lt2 = i(() => {
2524
2557
  Qe2(I, false, false);
2525
2558
  }, []), Dt2 = i(() => {
@@ -2537,13 +2570,13 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2537
2570
  }, []), jt2 = i(() => {
2538
2571
  Qe2(S, true, true);
2539
2572
  }, []), Vt2 = i(() => {
2540
- Qe2(E, false, false);
2573
+ Qe2(_, false, false);
2541
2574
  }, []), Wt2 = i(() => {
2542
- Qe2(E, true, false);
2575
+ Qe2(_, true, false);
2543
2576
  }, []), Ht2 = i(() => {
2544
- Qe2(E, false, true);
2545
- }, []), Nt2 = i(() => {
2546
- Qe2(E, true, true);
2577
+ Qe2(_, false, true);
2578
+ }, []), Ut2 = i(() => {
2579
+ Qe2(_, true, true);
2547
2580
  }, []), Kt2 = i(() => {
2548
2581
  be2((e5) => e5.slice(0, -1));
2549
2582
  }, []), qt2 = d(() => {
@@ -2565,7 +2598,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2565
2598
  if (!t3) return;
2566
2599
  let r3 = null;
2567
2600
  if (r3 = n3.length > 0 ? n3[n3.length - 1] : X2(o3), r3.colEnd >= r3.colStart && r3.rowEnd >= r3.rowStart) {
2568
- const n4 = eo(r3, t3);
2601
+ const n4 = Qn(r3, t3);
2569
2602
  let o4 = e5 ? le2 : se2;
2570
2603
  try {
2571
2604
  o4?.(r3, t3, n4.direction);
@@ -2578,7 +2611,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2578
2611
  }, [X2]), Gt2 = l(null), Zt2 = d(() => ({ onPointerDown: (e5, n3) => {
2579
2612
  if (Xe2.current = n3, !t2 || !t2.current) return false;
2580
2613
  const o3 = t2.current.getViewFromClient(e5.nativeEvent.clientX, e5.nativeEvent.clientY), r3 = o3?.getCellCoordsFromClient(e5.nativeEvent.clientX, e5.nativeEvent.clientY);
2581
- r3 && (e5.stopPropagation(), _e2("crosshair"), Gt2.current = { anchor: o3.getAnchor(), coords: r3 });
2614
+ r3 && (e5.stopPropagation(), Ee2("crosshair"), Gt2.current = { anchor: o3.getAnchor(), coords: r3 });
2582
2615
  }, onPointerMoveOrWait: (e5, n3) => {
2583
2616
  if (R2 || !t2?.current || !ye2.current || !Gt2.current) return;
2584
2617
  const o3 = Gt2.current.anchor;
@@ -2590,15 +2623,15 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2590
2623
  if (!s2) return;
2591
2624
  const c3 = l2.length > 0, a3 = c3 ? l2[l2.length - 1] : X2(ye2.current.cell);
2592
2625
  if (!s2) return;
2593
- const d2 = s2.rowStart < a3.rowStart ? S : s2.rowEnd > a3.rowEnd ? E : s2.colEnd > a3.colEnd ? I : _, u2 = ie2();
2594
- d2 === _ && (s2 = { ...a3, colStart: Math.max(u2.left, s2.colStart) }), d2 === S && (s2 = { ...a3, rowStart: Math.max(u2.top, s2.rowStart) }), d2 === I && (s2 = { ...a3, colEnd: Math.min(u2.right, s2.colEnd) }), d2 === E && (s2 = { ...a3, rowEnd: Math.min(u2.bottom, s2.rowEnd) });
2595
- const h2 = eo(a3, s2);
2626
+ const d2 = s2.rowStart < a3.rowStart ? S : s2.rowEnd > a3.rowEnd ? _ : s2.colEnd > a3.colEnd ? I : E, u2 = ie2();
2627
+ d2 === E && (s2 = { ...a3, colStart: Math.max(u2.left, s2.colStart) }), d2 === S && (s2 = { ...a3, rowStart: Math.max(u2.top, s2.rowStart) }), d2 === I && (s2 = { ...a3, colEnd: Math.min(u2.right, s2.colEnd) }), d2 === _ && (s2 = { ...a3, rowEnd: Math.min(u2.bottom, s2.rowEnd) });
2628
+ const h2 = Qn(a3, s2);
2596
2629
  if (!W2?.(a3)) {
2597
2630
  let e6;
2598
2631
  "function" == typeof $e2.current ? e6 = $e2.current(a3) : V2 && (e6 = V2), s2 = ((e7, t3, n4, o4, r4, i3) => {
2599
2632
  const l3 = { ...t3 };
2600
2633
  if (0 === n4.length) return l3;
2601
- if (r4 === _) {
2634
+ if (r4 === E) {
2602
2635
  const t4 = e7.colEnd + 1 - e7.colStart;
2603
2636
  l3.colStart = e7.colStart - Math.ceil(i3 / t4) * t4, l3.colStart < o4.left && (l3.colStart = l3.colStart + Math.ceil((o4.left - l3.colStart) / t4) * t4);
2604
2637
  } else if (r4 === I) {
@@ -2607,7 +2640,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2607
2640
  } else if (r4 === S) {
2608
2641
  const t4 = e7.rowEnd + 1 - e7.rowStart;
2609
2642
  l3.rowStart = e7.rowStart - Math.ceil(i3 / t4) * t4, l3.rowStart < o4.top && (l3.rowStart = l3.rowStart + Math.ceil((o4.top - l3.rowStart) / t4) * t4);
2610
- } else if (r4 === E) {
2643
+ } else if (r4 === _) {
2611
2644
  const t4 = e7.rowEnd + 1 - e7.rowStart;
2612
2645
  l3.rowEnd = e7.rowEnd + Math.ceil(i3 / t4) * t4, l3.rowEnd > o4.bottom && (l3.rowEnd = l3.rowEnd - Math.ceil((o4.bottom - l3.rowEnd) / t4) * t4);
2613
2646
  }
@@ -2624,17 +2657,17 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2624
2657
  }
2625
2658
  Xt2(false);
2626
2659
  }
2627
- Xe2.current = n3, xo(r3, i2, t2);
2660
+ Xe2.current = n3, mo(r3, i2, t2);
2628
2661
  }, onPointerUp: (e5, n3) => {
2629
2662
  Xe2.current = n3, Promise.resolve(Xt2(true)).finally(() => {
2630
- ae2?.(), Ce2(null), Te2.current = null, Gt2.current = null, _e2(null), t2.current?.focus();
2663
+ ae2?.(), Ce2(null), Te2.current = null, Gt2.current = null, Ee2(null), t2.current?.focus();
2631
2664
  });
2632
- } }), [X2]), Jt2 = hn(Zt2), Qt2 = d(() => ({ onPointerDown: Jt2 }), [Jt2]), [en2, tn2] = h(null), nn2 = l(null), on2 = d(() => ({ onPointerDown: (e5, n3) => {
2665
+ } }), [X2]), Jt2 = un(Zt2), Qt2 = d(() => ({ onPointerDown: Jt2 }), [Jt2]), [en2, tn2] = h(null), nn2 = l(null), on2 = d(() => ({ onPointerDown: (e5, n3) => {
2633
2666
  if (Xe2.current = n3, !t2 || !t2.current) return false;
2634
2667
  const o3 = t2.current.getViewFromClient(e5.nativeEvent.clientX, e5.nativeEvent.clientY), r3 = o3?.getCellCoordsFromClient(e5.nativeEvent.clientX, e5.nativeEvent.clientY);
2635
2668
  if (!r3) return;
2636
2669
  if (false === F2?.(e5, r3, xe2)) return false;
2637
- e5.stopPropagation(), _e2("default");
2670
+ e5.stopPropagation(), Ee2("default");
2638
2671
  const i2 = o3.getRelativePointFromClient(0, 0), l2 = ye2.current?.ranges[ye2.current?.ranges.length - 1] ?? ne.cellToRange(ye2.current?.cell), s2 = o3.toClipBounds(o3.getRangeCoordsBounds(l2)), c3 = { x: 0, y: 0 };
2639
2672
  s2.x - i2.x > e5.nativeEvent.clientX ? c3.x = e5.nativeEvent.clientX - (s2.x - i2.x) : e5.nativeEvent.clientX >= s2.x - i2.x + s2.width && (c3.x = Math.max(0, e5.nativeEvent.clientX - (s2.x - i2.x + s2.width)) + 1), s2.y - i2.y > e5.nativeEvent.clientY ? c3.y = e5.nativeEvent.clientY - (s2.y - i2.y) : e5.nativeEvent.clientY >= s2.y - i2.y + s2.height && (c3.y = Math.max(0, e5.nativeEvent.clientY - (s2.y - i2.y + s2.height)) + 1), H2?.(l2, e5.nativeEvent, n3), nn2.current = { range: l2, anchor: o3.getAnchor(), cell: r3, isMoving: false, extrusion: c3 };
2640
2673
  }, onPointerMoveOrWait: (e5, n3, o3) => {
@@ -2645,57 +2678,57 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2645
2678
  let c3 = t2.current.getViewFromLocation(l2), a3 = c3.getCellCoordsFromClient(e5.clientX - s2.x, e5.clientY - s2.y, true);
2646
2679
  if (!a3) return;
2647
2680
  const d2 = nn2.current.cell, u2 = nn2.current.range, h2 = ie2(), f2 = u2.colEnd - u2.colStart + 1, p3 = Math.min(Math.max(0, d2.colIndex - u2.colStart), f2 - 1), g3 = Math.min(h2.right - f2 + 1, Math.max(h2.left, a3.colIndex - p3)), w3 = u2.rowEnd - u2.rowStart + 1, m3 = Math.min(Math.max(0, d2.rowIndex - u2.rowStart), w3 - 1), x3 = Math.min(h2.bottom - w3 + 1, Math.max(h2.top, a3.rowIndex - m3)), y3 = { colStart: g3, colEnd: g3 + f2 - 1, rowStart: x3, rowEnd: x3 + w3 - 1 };
2648
- ne.isEqualRanges(en2, y3) && !((e6) => !e6 || !Xe2.current || Xe2.current.ctrlKey !== e6.ctrlKey || Xe2.current.shiftKey !== e6.shiftKey || Xe2.current.altKey !== e6.altKey || Xe2.current.metaKey !== e6.metaKey)(e5) || (tn2(y3), N2?.(y3, e5, n3)), Xe2.current = n3, xo(c3, a3, t2);
2681
+ ne.isEqualRanges(en2, y3) && !((e6) => !e6 || !Xe2.current || Xe2.current.ctrlKey !== e6.ctrlKey || Xe2.current.shiftKey !== e6.shiftKey || Xe2.current.altKey !== e6.altKey || Xe2.current.metaKey !== e6.metaKey)(e5) || (tn2(y3), N2?.(y3, e5, n3)), Xe2.current = n3, mo(c3, a3, t2);
2649
2682
  }, onPointerUp: (e5, n3) => {
2650
2683
  Xe2.current = n3;
2651
2684
  const o3 = () => {
2652
- tn2(null), nn2.current = null, _e2(null), t2.current?.focus();
2685
+ tn2(null), nn2.current = null, Ee2(null), t2.current?.focus();
2653
2686
  };
2654
2687
  if (!nn2.current) return void o3();
2655
2688
  const r3 = nn2.current.range, i2 = en2;
2656
2689
  U2?.(r3, e5, n3), Promise.resolve(r3 && i2 && K2?.(r3, i2, e5, n3)).finally(() => {
2657
2690
  o3();
2658
2691
  });
2659
- } }), [en2]), rn2 = hn(on2), ln2 = d(() => ({ onPointerDown: rn2 }), [rn2]), sn2 = l(null), cn2 = d(() => {
2692
+ } }), [en2]), rn2 = un(on2), ln2 = d(() => ({ onPointerDown: rn2 }), [rn2]), sn2 = l(null), cn2 = d(() => {
2660
2693
  const e5 = ne.isEqualSelectionCoords(xe2, sn2.current) ? sn2.current : xe2;
2661
2694
  return sn2.current = e5, e5;
2662
2695
  }, [xe2]), an2 = i((n3) => {
2663
2696
  let o3 = null, r3 = "br";
2664
2697
  const i2 = [], l2 = { stroke: P2, fill: J2, strokeWidth: 0.5 }, s2 = (e5, t3, o4) => {
2665
- const r4 = n3.toClipBounds(n3.getRangeCoordsBounds(e5), fo);
2698
+ const r4 = n3.toClipBounds(n3.getRangeCoordsBounds(e5), ho);
2666
2699
  if (!r4) return;
2667
2700
  r4.x = r4.width > 0 ? r4.x : r4.x - l2.strokeWidth / 2, r4.y = r4.height > 0 ? r4.y : r4.y - l2.strokeWidth / 2, r4.width = Math.max(r4.width, l2.strokeWidth), r4.height = Math.max(r4.height, l2.strokeWidth);
2668
2701
  const i3 = { key: `selection-fill-${t3}`, range: e5, ...r4, ...l2 };
2669
2702
  if (o4) {
2670
2703
  const e6 = n3.getCellCoordsAsRangeCoords(o4);
2671
- i3.cell = o4, i3.pathBounds = n3.toClipBounds(n3.getRangeCoordsBounds(e6), fo), i3.pathBounds && (i3.pathBounds.width <= 0 || i3.pathBounds.height <= 0) && (delete i3.pathBounds, delete i3.cell);
2704
+ i3.cell = o4, i3.pathBounds = n3.toClipBounds(n3.getRangeCoordsBounds(e6), ho), i3.pathBounds && (i3.pathBounds.width <= 0 || i3.pathBounds.height <= 0) && (delete i3.pathBounds, delete i3.cell);
2672
2705
  }
2673
2706
  return ue2(i3);
2674
2707
  };
2675
- let c3 = xe2 ? mo(xe2) : null;
2676
- const a3 = c3?.cell ? n3.getCellCoordsAsRangeCoords(c3?.cell) : po;
2708
+ let c3 = xe2 ? wo(xe2) : null;
2709
+ const a3 = c3?.cell ? n3.getCellCoordsAsRangeCoords(c3?.cell) : fo;
2677
2710
  !c3 || c3.ranges && 0 !== c3.ranges.length || (c3 = { ranges: [a3], rangeIndex: 0, cell: c3.cell });
2678
2711
  for (let e5 = 0; c3 && e5 < c3.ranges.length; e5++) {
2679
2712
  const t3 = c3.ranges[e5], l3 = s2(t3, e5, e5 === c3.rangeIndex ? c3.cell : null);
2680
2713
  l3 && i2.push(l3);
2681
- const a4 = 2, d3 = 0.5, u3 = n3.toClipBounds(n3.getRangeCoordsBounds(t3, { top: 0, left: 0, right: 0, bottom: 0 }), fo);
2714
+ const a4 = 2, d3 = 0.5, u3 = n3.toClipBounds(n3.getRangeCoordsBounds(t3, { top: 0, left: 0, right: 0, bottom: 0 }), ho);
2682
2715
  if (u3) {
2683
2716
  const n4 = (c3.ranges.length, 4);
2684
2717
  i2.push(ue2({ range: t3, key: `selection-inside-edge-${e5}`, x: u3.x - 1, y: u3.y - 1, width: Math.max(u3.width + 1, 0), height: Math.max(u3.height + 1, 0), style: { overflow: "hidden" }, stroke: P2, strokeWidth: n4 }));
2685
2718
  }
2686
2719
  if (1 === c3.ranges.length) {
2687
- const o4 = n3.toClipBounds(n3.getRangeCoordsBounds(t3), fo);
2720
+ const o4 = n3.toClipBounds(n3.getRangeCoordsBounds(t3), ho);
2688
2721
  if (o4) {
2689
2722
  Y2 || i2.push(ue2({ range: t3, key: `move-selection-hit-box-${e5}`, x: o4.width > 1 ? o4.x : o4.x - (G2 / 2 + 1), y: o4.height > 1 ? o4.y : o4.y - (G2 / 2 + 1), width: Math.max(o4.width + 2, 1), height: Math.max(o4.height + 2, 1), stroke: "transparent", style: { boxShadow: "none" }, pathProps: { cursor: en2 ? void 0 : "move", pointerEvents: "stroke" }, strokeWidth: G2, ...ln2 }));
2690
2723
  const n4 = a4;
2691
2724
  i2.push(ue2({ range: t3, key: `selection-single-${e5}`, x: o4.x - n4 / 2, y: o4.y - n4 / 2, width: Math.max(o4.width + n4 / 2, 1), height: Math.max(o4.height + n4 / 2, 1), stroke: Q2, strokeWidth: n4 }));
2692
2725
  }
2693
2726
  } else {
2694
- const o4 = n3.toClipBounds(n3.getRangeCoordsBounds(t3, { top: -1, left: -1, right: -2, bottom: -2 }), fo);
2727
+ const o4 = n3.toClipBounds(n3.getRangeCoordsBounds(t3, { top: -1, left: -1, right: -2, bottom: -2 }), ho);
2695
2728
  o4 && i2.push(ue2({ range: t3, key: `selection-multi-${e5}`, x: o4.width > 1 ? o4.x : o4.x - d3 / 2, y: o4.height > 1 ? o4.y : o4.y - d3 / 2, width: Math.max(o4.width, d3) + 1, height: Math.max(o4.height, d3) + 1, stroke: Q2, style: { overflow: "hidden" }, strokeWidth: 2 }));
2696
2729
  }
2697
2730
  if (c3.ranges.length > 1 && e5 === c3.rangeIndex) {
2698
- const o4 = n3.getCellCoordsAsRangeCoords(c3.cell), r4 = n3.toClipBounds(n3.getRangeCoordsBounds(o4, { top: 1, left: 1, right: -1, bottom: -1 }), fo);
2731
+ const o4 = n3.getCellCoordsAsRangeCoords(c3.cell), r4 = n3.toClipBounds(n3.getRangeCoordsBounds(o4, { top: 1, left: 1, right: -1, bottom: -1 }), ho);
2699
2732
  r4 && i2.push(ue2({ range: t3, key: `selection-anchor-${e5}`, x: r4.x, y: r4.y, width: Math.max(r4.width, d3), height: Math.max(r4.height, d3), stroke: Q2, style: { overflow: "hidden" }, strokeWidth: 2 }));
2700
2733
  }
2701
2734
  if (e5 === c3.ranges.length - 1) {
@@ -2703,18 +2736,18 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2703
2736
  const e6 = t3.rowStart === ie2().top && t3.rowEnd === ie2().bottom, i3 = t3.colStart === ie2().left && t3.colEnd === ie2().right, l4 = n3.getRangeCoordsBounds(t3);
2704
2737
  let s3 = null;
2705
2738
  if (e6 || i3) {
2706
- if (s3 = n3.toClipBounds(l4, fo), Object.keys(n3.allViews()).length > 1) {
2739
+ if (s3 = n3.toClipBounds(l4, ho), Object.keys(n3.allViews()).length > 1) {
2707
2740
  const o4 = n3.getVisibleRangeCoords(), r4 = n3.allViews()[C], l5 = n3.allViews()[M], c4 = n3.allViews()[T], a5 = n3.getAnchor();
2708
2741
  (i3 && (a5 === M && r4 || a5 === k && c4 || !ne.isCellWithinRange({ colIndex: t3.colStart, rowIndex: t3.rowEnd }, o4) && !ne.isCellWithinRange({ colIndex: t3.colStart, rowIndex: t3.rowEnd + 1 }, o4)) || e6 && (a5 === T && r4 || a5 === k && l5 || !ne.isCellWithinRange({ colIndex: t3.colEnd, rowIndex: t3.rowStart }, o4) && !ne.isCellWithinRange({ colIndex: t3.colEnd + 1, rowIndex: t3.rowStart }, o4))) && (s3 = null);
2709
2742
  }
2710
- } else s3 = n3.toClipBounds(l4, fo);
2743
+ } else s3 = n3.toClipBounds(l4, ho);
2711
2744
  if (!s3 || 0 === s3.width || 0 === s3.height) continue;
2712
2745
  o3 = { x: s3.x + s3.width + 1, y: s3.y + s3.height + 1 }, 0 === s3.width || 0 === s3.height || t3.rowStart === ie2().top && t3.colStart === ie2().left && t3.rowEnd === ie2().bottom && t3.colEnd === ie2().right || (e6 ? (o3.y = a4, r3 = "tr") : i3 && (o3.x = a4, r3 = "bl"));
2713
2746
  }
2714
2747
  }
2715
2748
  let d2 = null;
2716
2749
  if (ke2) {
2717
- const e5 = n3.toClipBounds(n3.getRangeCoordsBounds(ke2, { top: 0, left: 0, right: 0, bottom: 0 }), fo);
2750
+ const e5 = n3.toClipBounds(n3.getRangeCoordsBounds(ke2, { top: 0, left: 0, right: 0, bottom: 0 }), ho);
2718
2751
  if (e5) {
2719
2752
  const t3 = 2;
2720
2753
  d2 = ue2({ ...l2, range: ke2, key: "remove-selection", x: e5.x, y: e5.y, width: e5.width, height: e5.height, strokeWidth: t3, stroke: ee2, fill: te2 });
@@ -2722,49 +2755,49 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2722
2755
  }
2723
2756
  let u2 = null;
2724
2757
  if (Ie2) {
2725
- const e5 = n3.toClipBounds(n3.getRangeCoordsBounds(Ie2, { top: 0, left: 0, right: 0, bottom: 0 }), fo);
2758
+ const e5 = n3.toClipBounds(n3.getRangeCoordsBounds(Ie2, { top: 0, left: 0, right: 0, bottom: 0 }), ho);
2726
2759
  if (e5) {
2727
2760
  const t3 = 2;
2728
2761
  u2 = ue2({ range: Ie2, key: "selection-fill-outline", x: e5.x - t3 / 2, y: e5.y - t3 / 2, width: e5.width + t3 / 2, height: e5.height + t3 / 2, strokeWidth: t3, stroke: Q2, strokeDasharray: "3 2" });
2729
2762
  }
2730
2763
  }
2731
2764
  let h2 = null;
2732
- !R2 && o3 && !en2 && (h2 = f(uo, { ...o3, corner: r3, size: 7.5, borderStroke: `${P2} solid`, style: { borderRadius: 1 }, background: Q2, ...Qt2, key: "fillHandle" }));
2765
+ !R2 && o3 && !en2 && (h2 = f(ao, { ...o3, corner: r3, size: 7.5, borderStroke: `${P2} solid`, style: { borderRadius: 1 }, background: Q2, ...Qt2, key: "fillHandle" }));
2733
2766
  const p3 = [...i2];
2734
2767
  if (d2 && p3.push(d2), u2 && p3.push(u2), h2 && p3.push(h2), !oe2 && Ke2 && 1 === c3?.ranges.length && c3.ranges[c3.ranges.length - 1]) {
2735
2768
  const o4 = c3.ranges[c3.ranges.length - 1], r4 = o4.rowStart === ie2().top && o4.rowEnd === ie2().bottom, i3 = o4.colStart === ie2().left && o4.colEnd === ie2().right, l3 = { view: n3, range: o4, borderStroke: `${Q2} solid`, background: P2, selectionTouchPointerHandler: Je2, ...re2, onTouchSelectStart: (e5) => De2(e5), onTouchSelectEnd: () => De2(null), currentTouchAnchor: Le2 };
2736
- p3.push(e(ho, { anchor: i3 ? "b" : r4 ? "r" : "br", scrollableElement: t2.current, ...l3 }, "touch-select-handle-after")), p3.push(e(ho, { anchor: i3 ? "t" : r4 ? "l" : "tl", scrollableElement: t2.current, ...l3 }, "touch-select-handle-before"));
2769
+ p3.push(e(uo, { anchor: i3 ? "b" : r4 ? "r" : "br", scrollableElement: t2.current, ...l3 }, "touch-select-handle-after")), p3.push(e(uo, { anchor: i3 ? "t" : r4 ? "l" : "tl", scrollableElement: t2.current, ...l3 }, "touch-select-handle-before"));
2737
2770
  }
2738
2771
  if (en2) {
2739
- const e5 = n3.toClipBounds(n3.getRangeCoordsBounds(en2, { top: 1, left: 1, right: 1, bottom: 1 }), fo);
2772
+ const e5 = n3.toClipBounds(n3.getRangeCoordsBounds(en2, { top: 1, left: 1, right: 1, bottom: 1 }), ho);
2740
2773
  e5 && p3.push(ue2({ range: en2, key: "selection-move-outline", x: e5.x - Z2 / 2, y: e5.y - Z2 / 2, width: Math.max(e5.width + Z2 / 2, 1), height: Math.max(e5.height + Z2 / 2, 1), stroke: Q2, style: { boxShadow: "none", transitionDuration: "70ms", transitionTimingFunction: "ease-in", transitionProperty: "left, top, width, height", willChange: "left, top, width, height" }, strokeWidth: Z2 }));
2741
2774
  }
2742
2775
  return e("div", { children: p3 }, "selection");
2743
2776
  }, [cn2, ke2, R2, Ie2, Y2, en2, ie2, P2, Q2, J2, ee2, te2, oe2, re2, Le2]), dn2 = d(() => {
2744
2777
  const e5 = () => t2.current;
2745
- return [new In("moveToPageDown", e5, { label: "Page Down", description: "Shift viewport down one page.", shortcut: [{ key: "PageDown" }] }, () => ft2(false)), new In("selectToPageDown", e5, { label: "Select To Page Down", description: "Shift viewport and select down one page.", shortcut: [{ key: "PageDown", modifiers: [gt] }] }, () => ft2(true)), new In("moveToPageRight", e5, { label: "Page Right", description: "Shift viewport right one page.", shortcut: [{ key: "PageDown", modifiers: [wt] }] }, () => xt2(false)), new In("selectToPageRight", e5, { label: "Page Right", description: "Shift viewport right one page.", shortcut: [{ key: "PageDown", modifiers: [wt, gt] }] }, () => xt2(true)), new In("moveToPageUp", e5, { label: "Page Up", description: "Shift viewport up one page.", shortcut: [{ key: "PageUp" }] }, () => pt2(false)), new In("selectToPageUp", e5, { label: "Page Up", description: "Shift viewport up one page.", shortcut: [{ key: "PageUp", modifiers: [gt] }] }, () => pt2(true)), new In("moveToPageLeft", e5, { label: "Page Left", description: "Shift viewport left one page.", shortcut: [{ key: "PageUp", modifiers: [wt] }] }, () => yt2(false)), new In("selectToPageLeft", e5, { label: "Page Left", description: "Shift viewport left one page.", shortcut: [{ key: "PageUp", modifiers: [wt, gt] }] }, () => yt2(true)), new In("selectColumn", e5, { label: "Select Column", description: "Select the columns for the selected cells.", shortcut: { key: "Space", modifiers: [mt] } }, tt2), new In("selectRow", e5, { label: "Select Row", description: "Select the rows for the selected cells.", shortcut: { key: "Space", modifiers: [gt] } }, nt2), new In("selectToColumnStart", e5, { label: "Select To Column Start", description: "Select the columns to the beginning of the sheet." }, () => rt2(true)), new In("selectToColumnEnd", e5, { label: "Select To Column End", description: "Select the columns to the end of the sheet." }, () => it2(true)), new In("moveToRowStart", e5, { label: "Move to Row Home", description: "Move to the beginning of the row.", shortcut: [{ key: "Home" }] }, () => lt2(false)), new In("selectToRowStart", e5, { label: "Select to Row Home", description: "Select to the beginning of the row.", shortcut: [{ key: "Home", modifiers: [gt] }] }, () => lt2(true)), new In("moveToSheetStart", e5, { label: "Move to Sheet Home", description: "Move to the beginning of the sheet.", shortcut: [{ key: "Home", modifiers: [mt] }] }, () => st2(false)), new In("selectToSheetStart", e5, { label: "Select to Sheet Home", description: "Select to the beginning of the sheet.", shortcut: [{ key: "Home", modifiers: [mt, gt] }] }, () => st2(true)), new In("moveToRowEnd", e5, { label: "Move to Row End", description: "Move to the end of the row.", shortcut: [{ key: "End" }] }, () => ct2(false)), new In("selectToRowEnd", e5, { label: "Select to Row End", description: "Select to the end of the row.", shortcut: [{ key: "End", modifiers: [gt] }] }, () => ct2(true)), new In("moveToSheetEnd", e5, { label: "Move to Sheet End", description: "Move to the end of the sheet.", shortcut: [{ key: "End", modifiers: [mt] }] }, () => at2(false)), new In("selectToSheetEnd", e5, { label: "Select to Sheet End", description: "Select to the end of the sheet.", shortcut: [{ key: "End", modifiers: [mt, gt] }] }, () => at2(true)), new In("scrollToActiveCoords", e5, { label: "Scroll to Active Cell", description: "Scroll to the Active Cell.", shortcut: { key: "Backspace", modifiers: [mt] } }, ot2), new In("scrollToActiveCoordsClearSelection", e5, { label: "Scroll to Active Cell", description: "Scroll to the Active Cell and clear selection.", shortcut: { key: "Backspace", modifiers: [gt] } }, () => {
2778
+ return [new En("moveToPageDown", e5, { label: "Page Down", description: "Shift viewport down one page.", shortcut: [{ key: "PageDown" }] }, () => ft2(false)), new En("selectToPageDown", e5, { label: "Select To Page Down", description: "Shift viewport and select down one page.", shortcut: [{ key: "PageDown", modifiers: [gt] }] }, () => ft2(true)), new En("moveToPageRight", e5, { label: "Page Right", description: "Shift viewport right one page.", shortcut: [{ key: "PageDown", modifiers: [wt] }] }, () => xt2(false)), new En("selectToPageRight", e5, { label: "Page Right", description: "Shift viewport right one page.", shortcut: [{ key: "PageDown", modifiers: [wt, gt] }] }, () => xt2(true)), new En("moveToPageUp", e5, { label: "Page Up", description: "Shift viewport up one page.", shortcut: [{ key: "PageUp" }] }, () => pt2(false)), new En("selectToPageUp", e5, { label: "Page Up", description: "Shift viewport up one page.", shortcut: [{ key: "PageUp", modifiers: [gt] }] }, () => pt2(true)), new En("moveToPageLeft", e5, { label: "Page Left", description: "Shift viewport left one page.", shortcut: [{ key: "PageUp", modifiers: [wt] }] }, () => yt2(false)), new En("selectToPageLeft", e5, { label: "Page Left", description: "Shift viewport left one page.", shortcut: [{ key: "PageUp", modifiers: [wt, gt] }] }, () => yt2(true)), new En("selectColumn", e5, { label: "Select Column", description: "Select the columns for the selected cells.", shortcut: { key: "Space", modifiers: [mt] } }, tt2), new En("selectRow", e5, { label: "Select Row", description: "Select the rows for the selected cells.", shortcut: { key: "Space", modifiers: [gt] } }, nt2), new En("selectToColumnStart", e5, { label: "Select To Column Start", description: "Select the columns to the beginning of the sheet." }, () => rt2(true)), new En("selectToColumnEnd", e5, { label: "Select To Column End", description: "Select the columns to the end of the sheet." }, () => it2(true)), new En("moveToRowStart", e5, { label: "Move to Row Home", description: "Move to the beginning of the row.", shortcut: [{ key: "Home" }] }, () => lt2(false)), new En("selectToRowStart", e5, { label: "Select to Row Home", description: "Select to the beginning of the row.", shortcut: [{ key: "Home", modifiers: [gt] }] }, () => lt2(true)), new En("moveToSheetStart", e5, { label: "Move to Sheet Home", description: "Move to the beginning of the sheet.", shortcut: [{ key: "Home", modifiers: [mt] }] }, () => st2(false)), new En("selectToSheetStart", e5, { label: "Select to Sheet Home", description: "Select to the beginning of the sheet.", shortcut: [{ key: "Home", modifiers: [mt, gt] }] }, () => st2(true)), new En("moveToRowEnd", e5, { label: "Move to Row End", description: "Move to the end of the row.", shortcut: [{ key: "End" }] }, () => ct2(false)), new En("selectToRowEnd", e5, { label: "Select to Row End", description: "Select to the end of the row.", shortcut: [{ key: "End", modifiers: [gt] }] }, () => ct2(true)), new En("moveToSheetEnd", e5, { label: "Move to Sheet End", description: "Move to the end of the sheet.", shortcut: [{ key: "End", modifiers: [mt] }] }, () => at2(false)), new En("selectToSheetEnd", e5, { label: "Select to Sheet End", description: "Select to the end of the sheet.", shortcut: [{ key: "End", modifiers: [mt, gt] }] }, () => at2(true)), new En("scrollToActiveCoords", e5, { label: "Scroll to Active Cell", description: "Scroll to the Active Cell.", shortcut: { key: "Backspace", modifiers: [mt] } }, ot2), new En("scrollToActiveCoordsClearSelection", e5, { label: "Scroll to Active Cell", description: "Scroll to the Active Cell and clear selection.", shortcut: { key: "Backspace", modifiers: [gt] } }, () => {
2746
2779
  Ue2(), Yt2(xe2.cell, true);
2747
- }), new In("traverseSelectionRight", e5, { label: "Traverse Right", description: "Traverse the selection moving rightward.", shortcut: { key: "Tab" } }, bt2), new In("traverseSelectionLeft", e5, { label: "Traverse Left", description: "Traverse the selection moving leftward.", shortcut: { key: "Tab", modifiers: [gt] } }, vt2), new In("traverseSelectionDown", e5, { label: "Traverse Down", description: "Traverse the selection moving downward.", shortcut: [{ key: "Enter" }, { key: "NumpadEnter" }] }, Et2), new In("traverseSelectionUp", e5, { label: "Traverse Up", description: "Traverse the selection moving upward.", shortcut: [{ key: "Enter", modifiers: [gt] }, { key: "NumpadEnter", modifiers: [gt] }] }, St2), new In("moveLeft", e5, { label: "Move Left", description: "Move active cell to the left.", shortcut: [{ key: "ArrowLeft" }] }, kt2), new In("selectLeft", e5, { label: "Select Left", description: "Extend selection left.", shortcut: [{ key: "ArrowLeft", modifiers: [gt] }] }, Rt2), new In("moveContentfulLeft", e5, { label: "Move Left Contentful", description: "Move left to the next cell with content.", shortcut: [{ key: "ArrowLeft", modifiers: [mt] }] }, Pt2), new In("selectContentfulLeft", e5, { label: "Select Left Contentful", description: "Extend selection left to the next cell with content.", shortcut: [{ key: "ArrowLeft", modifiers: [mt, gt] }] }, Ot2), new In("moveRight", e5, { label: "Move Right", description: "Move active cell to the right.", shortcut: [{ key: "ArrowRight" }] }, Lt2), new In("selectRight", e5, { label: "Select Right", description: "Extend selection right.", shortcut: [{ key: "ArrowRight", modifiers: [gt] }] }, Dt2), new In("moveContentfulRight", e5, { label: "Move Right Contentful", description: "Move right to the next cell with content.", shortcut: [{ key: "ArrowRight", modifiers: [mt] }] }, zt2), new In("selectContentfulRight", e5, { label: "Select Right Contentful", description: "Extend selection right to the next cell with content.", shortcut: [{ key: "ArrowRight", modifiers: [mt, gt] }] }, At2), new In("moveUp", e5, { label: "Move Up", description: "Move active cell to the up.", shortcut: [{ key: "ArrowUp" }] }, $t2), new In("selectUp", e5, { label: "Select Up", description: "Extend selection up.", shortcut: [{ key: "ArrowUp", modifiers: [gt] }] }, Bt2), new In("moveContentfulUp", e5, { label: "Move Up Contentful", description: "Move up to the next cell with content.", shortcut: [{ key: "ArrowUp", modifiers: [mt] }] }, Ft2), new In("selectContentfulUp", e5, { label: "Select Up Contentful", description: "Extend selection up to the next cell with content.", shortcut: [{ key: "ArrowUp", modifiers: [mt, gt] }] }, jt2), new In("moveDown", e5, { label: "Move Down", description: "Move active cell to the down.", shortcut: [{ key: "ArrowDown" }] }, Vt2), new In("selectDown", e5, { label: "Select Down", description: "Extend selection down.", shortcut: [{ key: "ArrowDown", modifiers: [gt] }] }, Wt2), new In("moveContentfulDown", e5, { label: "Move Down Contentful", description: "Move down to the next cell with content.", shortcut: [{ key: "ArrowDown", modifiers: [mt] }] }, Ht2), new In("selectContentfulDown", e5, { label: "Select Down Contentful", description: "Extend selection down to the next cell with content.", shortcut: [{ key: "ArrowDown", modifiers: [mt, gt] }] }, Nt2), new In("selectVisible", e5, { label: "Select Visible", description: "Select visible cells only.", shortcut: { key: ";", modifiers: [wt] } }, ut2), new In("traverseSelectionPreviousRange", e5, { label: "Traverse Previous Range", description: "Traverse the selection to the previous range.", shortcut: { key: "ArrowLeft", modifiers: [mt, wt] } }, _t2), new In("traverseSelectionNextRange", e5, { label: "Traverse Next Range", description: "Traverse the selection to the next range.", shortcut: { key: "ArrowRight", modifiers: [mt, wt] } }, It2), new In("traverseSelectionCorners", e5, { label: "Traverse Corners", description: "Traverse the selection through the corners of the selected range.", shortcut: { key: ".", modifiers: [mt] } }, Mt2)];
2780
+ }), new En("traverseSelectionRight", e5, { label: "Traverse Right", description: "Traverse the selection moving rightward.", shortcut: { key: "Tab" } }, bt2), new En("traverseSelectionLeft", e5, { label: "Traverse Left", description: "Traverse the selection moving leftward.", shortcut: { key: "Tab", modifiers: [gt] } }, vt2), new En("traverseSelectionDown", e5, { label: "Traverse Down", description: "Traverse the selection moving downward.", shortcut: [{ key: "Enter" }, { key: "NumpadEnter" }] }, _t2), new En("traverseSelectionUp", e5, { label: "Traverse Up", description: "Traverse the selection moving upward.", shortcut: [{ key: "Enter", modifiers: [gt] }, { key: "NumpadEnter", modifiers: [gt] }] }, St2), new En("moveLeft", e5, { label: "Move Left", description: "Move active cell to the left.", shortcut: [{ key: "ArrowLeft" }] }, kt2), new En("selectLeft", e5, { label: "Select Left", description: "Extend selection left.", shortcut: [{ key: "ArrowLeft", modifiers: [gt] }] }, Rt2), new En("moveContentfulLeft", e5, { label: "Move Left Contentful", description: "Move left to the next cell with content.", shortcut: [{ key: "ArrowLeft", modifiers: [mt] }] }, Pt2), new En("selectContentfulLeft", e5, { label: "Select Left Contentful", description: "Extend selection left to the next cell with content.", shortcut: [{ key: "ArrowLeft", modifiers: [mt, gt] }] }, Ot2), new En("moveRight", e5, { label: "Move Right", description: "Move active cell to the right.", shortcut: [{ key: "ArrowRight" }] }, Lt2), new En("selectRight", e5, { label: "Select Right", description: "Extend selection right.", shortcut: [{ key: "ArrowRight", modifiers: [gt] }] }, Dt2), new En("moveContentfulRight", e5, { label: "Move Right Contentful", description: "Move right to the next cell with content.", shortcut: [{ key: "ArrowRight", modifiers: [mt] }] }, zt2), new En("selectContentfulRight", e5, { label: "Select Right Contentful", description: "Extend selection right to the next cell with content.", shortcut: [{ key: "ArrowRight", modifiers: [mt, gt] }] }, At2), new En("moveUp", e5, { label: "Move Up", description: "Move active cell to the up.", shortcut: [{ key: "ArrowUp" }] }, $t2), new En("selectUp", e5, { label: "Select Up", description: "Extend selection up.", shortcut: [{ key: "ArrowUp", modifiers: [gt] }] }, Bt2), new En("moveContentfulUp", e5, { label: "Move Up Contentful", description: "Move up to the next cell with content.", shortcut: [{ key: "ArrowUp", modifiers: [mt] }] }, Ft2), new En("selectContentfulUp", e5, { label: "Select Up Contentful", description: "Extend selection up to the next cell with content.", shortcut: [{ key: "ArrowUp", modifiers: [mt, gt] }] }, jt2), new En("moveDown", e5, { label: "Move Down", description: "Move active cell to the down.", shortcut: [{ key: "ArrowDown" }] }, Vt2), new En("selectDown", e5, { label: "Select Down", description: "Extend selection down.", shortcut: [{ key: "ArrowDown", modifiers: [gt] }] }, Wt2), new En("moveContentfulDown", e5, { label: "Move Down Contentful", description: "Move down to the next cell with content.", shortcut: [{ key: "ArrowDown", modifiers: [mt] }] }, Ht2), new En("selectContentfulDown", e5, { label: "Select Down Contentful", description: "Extend selection down to the next cell with content.", shortcut: [{ key: "ArrowDown", modifiers: [mt, gt] }] }, Ut2), new En("selectVisible", e5, { label: "Select Visible", description: "Select visible cells only.", shortcut: { key: ";", modifiers: [wt] } }, ut2), new En("traverseSelectionPreviousRange", e5, { label: "Traverse Previous Range", description: "Traverse the selection to the previous range.", shortcut: { key: "ArrowLeft", modifiers: [mt, wt] } }, Et2), new En("traverseSelectionNextRange", e5, { label: "Traverse Next Range", description: "Traverse the selection to the next range.", shortcut: { key: "ArrowRight", modifiers: [mt, wt] } }, It2), new En("traverseSelectionCorners", e5, { label: "Traverse Corners", description: "Traverse the selection through the corners of the selected range.", shortcut: { key: ".", modifiers: [mt] } }, Mt2)];
2748
2781
  }, []);
2749
2782
  return d(() => {
2750
2783
  n2?.addCommands(dn2, true);
2751
- }, [n2]), { selection: cn2, setSelectionCell: Yt2, setSelectionRanges: be2, overlay: an2, cursor: Ee2, onPointerDown: Ze2, clearLastSelection: Kt2, newSelection: He2, modifySelection: We2, appendSelection: Ne2, clearSelections: Ue2, isEntire: qt2, navigate: Qe2, navigateSelection: et2 };
2752
- }, bo = { "sheetxl-grid": "_sheetxl-grid_h9wwa_7" }, So = Object.freeze({ top: 0, left: 0 }), Eo = Object.freeze({ bottom: -4, right: -4 }), _o = Object.freeze({ horizontal: true, vertical: true }), Io = [C, M, T, k], Co = 150, Mo = 3e3, To = {}, ko = r(a((o2, r2) => {
2753
- const { width: c2, height: a2, rowCount: w2 = 1, columnCount: m2 = 1, defaultRowHeight: x2, defaultColumnWidth: y2, getRowHeight: v2, getColumnWidth: R2, layout: P2, onViewportScroll: O2, onImmediateScroll: L2, showGridLines: D2 = true, gridLineColor: z2 = "rgb(224, 224, 224)", gridLineRowsProps: A2, gridLineColumnsProps: $2, clipCells: B2 = true, cursor: F2, freezeLeft: j2 = 0, freezeTop: V2 = 0, freezeLeftProps: W2, freezeTopProps: H2, cellRenderer: N2, onViewportChange: U2, onFirstRender: K2, overlayRenderer: q2, overlayProps: Y2, overlays: X2, overlaysProps: G2, allowOverlaysOverflow: Z2 = false, stageProps: J2, stageWrapper: Q2 = null, hiddenRowsAt: ee2, hiddenColumnsAt: te2, hiddenCellAt: oe2, getVisibleCells: re2, zoom: ie2 = 1, enableMouseWheel: le2 = true, onWheelScroll: se2, getCellCoordsAsRangeCoords: ce2 = ne.cellToRange, scrollPoint: ae2 = So, style: de2 = {}, ...ue2 } = o2;
2784
+ }, [n2]), { selection: cn2, setSelectionCell: Yt2, setSelectionRanges: be2, overlay: an2, cursor: _e2, onPointerDown: Ze2, clearLastSelection: Kt2, newSelection: He2, modifySelection: We2, appendSelection: Ne2, clearSelections: Ue2, isEntire: qt2, navigate: Qe2, navigateSelection: et2 };
2785
+ }, vo = { "sheetxl-grid": "_sheetxl-grid_h9wwa_7" }, bo = Object.freeze({ top: 0, left: 0 }), So = Object.freeze({ bottom: -4, right: -4 }), _o = Object.freeze({ horizontal: true, vertical: true }), Eo = [C, M, T, k], Io = 150, Co = 3e3, Mo = {}, To = r(a((o2, r2) => {
2786
+ const { width: c2, height: a2, rowCount: w2 = 1, columnCount: m2 = 1, defaultRowHeight: x2, defaultColumnWidth: y2, getRowHeight: v2, getColumnWidth: R2, layout: P2, onViewportScroll: O2, onImmediateScroll: L2, showGridLines: D2 = true, gridLineColor: z2 = "rgb(224, 224, 224)", gridLineRowsProps: A2, gridLineColumnsProps: $2, clipCells: B2 = true, cursor: F2, freezeLeft: j2 = 0, freezeTop: V2 = 0, freezeLeftProps: W2, freezeTopProps: H2, cellRenderer: N2, onViewportChange: U2, onFirstRender: K2, overlayRenderer: q2, overlayProps: Y2, overlays: X2, overlaysProps: G2, allowOverlaysOverflow: Z2 = false, stageProps: J2, stageWrapper: Q2 = null, hiddenRowsAt: ee2, hiddenColumnsAt: te2, hiddenCellAt: oe2, getVisibleCells: re2, zoom: ie2 = 1, enableMouseWheel: le2 = true, onWheelScroll: se2, getCellCoordsAsRangeCoords: ce2 = ne.cellToRange, scrollPoint: ae2 = bo, style: de2 = {}, ...ue2 } = o2;
2754
2787
  b(N2, "No cellRenderer specified. This is probably not what you wanted"), b(!o2?.children, "Grid does not support children elements");
2755
- const he2 = Tt(L2, [L2]), fe2 = Tt(U2, [U2]), pe2 = Tt(O2, [O2]), ge2 = Tt(se2, [se2]), we2 = Tt(K2, [K2]), me2 = l(null), xe2 = l(null), ye2 = l(null), [ve2, be2] = p((e5) => e5 + 1, 0), [Se2, Ee2] = h({ left: ae2?.left ?? 0, top: ae2?.top ?? 0, horizontalScrollDirection: null, verticalScrollDirection: null }), _e2 = l(null), Ie2 = l(Se2), { top: Ce2, left: Te2, verticalScrollDirection: ke2, horizontalScrollDirection: Re2 } = Se2, Pe2 = l(false), Oe2 = An({ rowCount: w2, columnCount: m2, defaultRowHeight: x2, defaultColumnWidth: y2, getRowHeight: v2, getColumnWidth: R2 }), Le2 = l(null), De2 = d(() => {
2788
+ const he2 = Tt(L2, [L2]), fe2 = Tt(U2, [U2]), pe2 = Tt(O2, [O2]), ge2 = Tt(se2, [se2]), we2 = Tt(K2, [K2]), me2 = l(null), xe2 = l(null), ye2 = l(null), [ve2, be2] = p((e5) => e5 + 1, 0), [Se2, _e2] = h({ left: ae2?.left ?? 0, top: ae2?.top ?? 0, horizontalScrollDirection: null, verticalScrollDirection: null }), Ee2 = l(null), Ie2 = l(Se2), { top: Ce2, left: Te2, verticalScrollDirection: ke2, horizontalScrollDirection: Re2 } = Se2, Pe2 = l(false), Oe2 = zn({ rowCount: w2, columnCount: m2, defaultRowHeight: x2, defaultColumnWidth: y2, getRowHeight: v2, getColumnWidth: R2 }), Le2 = l(null), De2 = d(() => {
2756
2789
  const e5 = P2 || Oe2;
2757
2790
  return Le2.current = null, { getColOffset: (t2) => e5.getColOffset(t2) * ie2, getColIndex: (t2) => e5.getColIndex(t2 / ie2), getRowOffset: (t2) => e5.getRowOffset(t2) * ie2, getRowIndex: (t2) => e5.getRowIndex(t2 / ie2) };
2758
2791
  }, [Oe2, P2, ie2]), ze2 = (e5, t2, n2) => {
2759
2792
  const o3 = (t2?.left ?? 0) + 0, r3 = (t2?.top ?? 0) + 0;
2760
2793
  return { getColOffset: (t3) => e5.getColOffset(t3) - o3, getColIndex: (t3) => e5.getColIndex(t3 + o3), getRowOffset: (t3) => e5.getRowOffset(t3) - r3, getRowIndex: (t3) => e5.getRowIndex(t3 + r3) };
2761
- }, Ae2 = i((e5, t2 = false) => to(e5, t2, De2.getRowOffset, t2 ? 0 : w2), [w2, De2?.getRowOffset]), $e2 = Tt(ee2 ?? Ae2, [ee2]), Be2 = i((e5, t2 = false) => to(e5, t2, De2.getColOffset, t2 ? m2 : 0), [m2, De2?.getColOffset]), Fe2 = Tt(te2 ?? Be2, [te2]), je2 = d(() => Math.min(c2 ?? 800, De2.getColOffset(m2)), [De2.getColOffset, m2, c2]), Ve2 = d(() => Math.min(a2 ?? 600, De2.getRowOffset(w2)), [De2.getRowOffset, w2, a2]), We2 = i((e5) => {
2794
+ }, Ae2 = i((e5, t2 = false) => eo(e5, t2, De2.getRowOffset, t2 ? 0 : w2), [w2, De2?.getRowOffset]), $e2 = Tt(ee2 ?? Ae2, [ee2]), Be2 = i((e5, t2 = false) => eo(e5, t2, De2.getColOffset, t2 ? m2 : 0), [m2, De2?.getColOffset]), Fe2 = Tt(te2 ?? Be2, [te2]), je2 = d(() => Math.min(c2 ?? 800, De2.getColOffset(m2)), [De2.getColOffset, m2, c2]), Ve2 = d(() => Math.min(a2 ?? 600, De2.getRowOffset(w2)), [De2.getRowOffset, w2, a2]), We2 = i((e5) => {
2762
2795
  Me.canUseDOM && setTimeout(() => {
2763
2796
  me2.current?.focus({ preventScroll: true, ...e5 });
2764
2797
  }, 0);
2765
2798
  }, []), He2 = i((e5) => me2.current?.contains(e5) || xe2.current?.contains(e5), []);
2766
2799
  s(() => {
2767
- Pe2.current && (_e2.current && _e2.current.left !== Ie2.current?.left && _e2.current.top !== Ie2.current?.top || (_e2.current = null, pe2?.({ left: Te2, top: Ce2 })));
2800
+ Pe2.current && (Ee2.current && Ee2.current.left !== Ie2.current?.left && Ee2.current.top !== Ie2.current?.top || (Ee2.current = null, pe2?.({ left: Te2, top: Ce2 })));
2768
2801
  }, [Te2, Ce2]);
2769
2802
  const Ne2 = Tt(() => ({ top: Ce2, left: Te2 }), [Ce2, Te2]), Ue2 = d(() => {
2770
2803
  const e5 = [];
@@ -2774,11 +2807,11 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2774
2807
  if (t2 > 0) {
2775
2808
  const l3 = ze2(De2, { top: n2 + De2.getRowOffset(0) }), s3 = De2.getRowIndex(o3), c4 = De2.getRowIndex(r3 - 1);
2776
2809
  let a4;
2777
- e5[1] = { minIndex: s3, maxIndex: c4, minCoord: 0, maxCoord: t2 - 1, minBounds: 0, maxBounds: i2, visibleIndices: () => a4 || (a4 = Object.freeze(Kn($e2, s3, c4)), a4), layout: l3, maxVirtualBounds: r3, scrollOffset: n2, freezeOffset: n2 };
2810
+ e5[1] = { minIndex: s3, maxIndex: c4, minCoord: 0, maxCoord: t2 - 1, minBounds: 0, maxBounds: i2, visibleIndices: () => a4 || (a4 = Object.freeze(Un($e2, s3, c4)), a4), layout: l3, maxVirtualBounds: r3, scrollOffset: n2, freezeOffset: n2 };
2778
2811
  }
2779
2812
  const l2 = Math.max(0, Ve2 - i2), s2 = ze2(De2, { top: Ce2 + i2 }), c3 = s2.getRowIndex(0), a3 = s2.getRowIndex(l2);
2780
2813
  let d2;
2781
- return e5[0] = { minIndex: c3, maxIndex: a3, minCoord: t2, maxCoord: w2 - 1, minBounds: i2, maxBounds: l2, visibleIndices: () => d2 || (d2 = Object.freeze(Kn($e2, c3, a3)), d2), layout: s2, maxVirtualBounds: De2.getRowOffset(w2), scrollOffset: Ce2, freezeOffset: (t2 > 0 ? De2.getRowOffset(t2) : 0) - n2 }, e5;
2814
+ return e5[0] = { minIndex: c3, maxIndex: a3, minCoord: t2, maxCoord: w2 - 1, minBounds: i2, maxBounds: l2, visibleIndices: () => d2 || (d2 = Object.freeze(Un($e2, c3, a3)), d2), layout: s2, maxVirtualBounds: De2.getRowOffset(w2), scrollOffset: Ce2, freezeOffset: (t2 > 0 ? De2.getRowOffset(t2) : 0) - n2 }, e5;
2782
2815
  }, [De2.getRowIndex, De2.getRowOffset, $e2, Ve2, w2, V2, Ce2, ie2]), Ke2 = d(() => {
2783
2816
  const e5 = [];
2784
2817
  let t2 = 0, n2 = 0;
@@ -2787,11 +2820,11 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2787
2820
  if (t2 > 0) {
2788
2821
  const l3 = ze2(De2, { left: n2 + De2.getColOffset(0) }), s3 = De2.getColIndex(o3), c4 = De2.getColIndex(r3 - 1);
2789
2822
  let a4;
2790
- e5[1] = { minIndex: s3, maxIndex: c4, minCoord: 0, maxCoord: t2 - 1, minBounds: 0, maxBounds: i2, visibleIndices: () => a4 || (a4 = Object.freeze(Kn(Fe2, s3, c4)), a4), layout: l3, maxVirtualBounds: r3, scrollOffset: n2, freezeOffset: n2 };
2823
+ e5[1] = { minIndex: s3, maxIndex: c4, minCoord: 0, maxCoord: t2 - 1, minBounds: 0, maxBounds: i2, visibleIndices: () => a4 || (a4 = Object.freeze(Un(Fe2, s3, c4)), a4), layout: l3, maxVirtualBounds: r3, scrollOffset: n2, freezeOffset: n2 };
2791
2824
  }
2792
2825
  const l2 = Math.max(0, je2 - i2), s2 = ze2(De2, { left: Te2 + i2 }), c3 = s2.getColIndex(0), a3 = s2.getColIndex(l2);
2793
2826
  let d2;
2794
- return e5[0] = { minIndex: c3, maxIndex: a3, minCoord: t2, maxCoord: m2 - 1, minBounds: i2, maxBounds: l2, visibleIndices: () => d2 || (d2 = Object.freeze(Kn(Fe2, c3, a3)), d2), layout: s2, maxVirtualBounds: De2.getColOffset(m2), scrollOffset: Te2, freezeOffset: (t2 > 0 ? De2.getColOffset(t2) : 0) - n2 }, e5;
2827
+ return e5[0] = { minIndex: c3, maxIndex: a3, minCoord: t2, maxCoord: m2 - 1, minBounds: i2, maxBounds: l2, visibleIndices: () => d2 || (d2 = Object.freeze(Un(Fe2, c3, a3)), d2), layout: s2, maxVirtualBounds: De2.getColOffset(m2), scrollOffset: Te2, freezeOffset: (t2 > 0 ? De2.getColOffset(t2) : 0) - n2 }, e5;
2795
2828
  }, [De2.getColIndex, De2.getColOffset, Fe2, je2, m2, j2, Te2, ie2]), qe2 = l({}), Ye2 = l([]), Xe2 = d(() => {
2796
2829
  let e5 = {};
2797
2830
  const t2 = (t3, n3, o3, r3, i2) => {
@@ -2799,7 +2832,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2799
2832
  if (t3 >= Ke2.length || n3 >= Ue2.length) return null;
2800
2833
  const s2 = { rowStart: Ue2[n3].minIndex, colStart: Ke2[t3].minIndex, rowEnd: Ue2[n3].maxIndex, colEnd: Ke2[t3].maxIndex };
2801
2834
  if (s2.rowStart > s2.rowEnd || s2.colStart > s2.colEnd) return null;
2802
- const c3 = { getColIndex: (e6) => Ke2[t3].layout.getColIndex(e6), getColOffset: (e6) => Ke2[t3].layout.getColOffset(e6), getRowIndex: (e6) => Ue2[n3].layout.getRowIndex(e6), getRowOffset: (e6) => Ue2[n3].layout.getRowOffset(e6) }, a3 = Object.freeze({ left: i2?.left ?? 0, top: i2?.top ?? 0, right: i2?.right ?? 0, bottom: i2?.bottom ?? 0 }), d2 = Object.freeze({ x: Ke2[t3].minBounds, y: Ue2[n3].minBounds, width: Ke2[t3].maxBounds, height: Ue2[n3].maxBounds }), u2 = (e6, t4) => oo(c3, e6 ?? s2, t4), h2 = { width: Ke2[t3].maxVirtualBounds, height: Ue2[n3].maxVirtualBounds }, f2 = { left: Ke2[t3].scrollOffset, top: Ue2[n3].scrollOffset }, p2 = { left: Ke2[t3].freezeOffset, top: Ue2[n3].freezeOffset }, g2 = { width: je2, height: Ve2 };
2835
+ const c3 = { getColIndex: (e6) => Ke2[t3].layout.getColIndex(e6), getColOffset: (e6) => Ke2[t3].layout.getColOffset(e6), getRowIndex: (e6) => Ue2[n3].layout.getRowIndex(e6), getRowOffset: (e6) => Ue2[n3].layout.getRowOffset(e6) }, a3 = Object.freeze({ left: i2?.left ?? 0, top: i2?.top ?? 0, right: i2?.right ?? 0, bottom: i2?.bottom ?? 0 }), d2 = Object.freeze({ x: Ke2[t3].minBounds, y: Ue2[n3].minBounds, width: Ke2[t3].maxBounds, height: Ue2[n3].maxBounds }), u2 = (e6, t4) => no(c3, e6 ?? s2, t4), h2 = { width: Ke2[t3].maxVirtualBounds, height: Ue2[n3].maxVirtualBounds }, f2 = { left: Ke2[t3].scrollOffset, top: Ue2[n3].scrollOffset }, p2 = { left: Ke2[t3].freezeOffset, top: Ue2[n3].freezeOffset }, g2 = { width: je2, height: Ve2 };
2803
2836
  let w3 = null, m3 = null;
2804
2837
  const x3 = (p2.top + (r3.vertical ? f2.top : 0)) / ie2, y3 = (p2.left + (r3.horizontal ? f2.left : 0)) / ie2;
2805
2838
  return { getStage: () => me2.current ?? null, getVisibleRangeCoords: () => s2, toClipBounds: (e6, t4) => {
@@ -2812,7 +2845,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2812
2845
  }, toViewBounds: (e6) => 0 === y3 && 0 === x3 && 1 === ie2 ? e6 : { x: (e6.x - y3) * ie2, y: (e6.y - x3) * ie2, width: e6.width * ie2, height: e6.height * ie2 }, toAbsoluteBounds: (e6) => 0 === y3 && 0 === x3 && 1 === ie2 ? e6 : { x: e6.x / ie2 + y3, y: e6.y / ie2 + x3, width: e6.width / ie2, height: e6.height / ie2 }, getRelativePointFromClient: (e6, t4) => {
2813
2846
  const n4 = tt2(e6, t4);
2814
2847
  return { x: n4.x - d2.x, y: n4.y - d2.y };
2815
- }, getLayout: () => c3, getCellCoordsAsRangeCoords: ce2, getVisibleColumns: () => Ke2[t3].visibleIndices(), getVisibleRows: () => Ue2[n3].visibleIndices(), getVisibleColumnOffsets: () => (w3 || (w3 = no(Ke2[t3].layout, true, Ke2[t3].visibleIndices(), s2.colStart, s2.colEnd)), w3), getVisibleRowOffsets: () => (m3 || (m3 = no(Ue2[n3].layout, false, Ue2[n3].visibleIndices(), s2.rowStart, s2.rowEnd)), m3), getTotalRangeCoords: () => ({ colStart: Ke2[t3].minCoord, colEnd: Ke2[t3].maxCoord, rowStart: Ue2[n3].minCoord, rowEnd: Ue2[n3].maxCoord }), getRangeCoordsBounds: u2, scrollCellCoordsIntoView: (e6, t4) => ut2(e6, t4, o3), getCellCoordsFromClient: (e6, t4, n4 = false) => {
2848
+ }, getLayout: () => c3, getCellCoordsAsRangeCoords: ce2, getVisibleColumns: () => Ke2[t3].visibleIndices(), getVisibleRows: () => Ue2[n3].visibleIndices(), getVisibleColumnOffsets: () => (w3 || (w3 = to(Ke2[t3].layout, true, Ke2[t3].visibleIndices(), s2.colStart, s2.colEnd)), w3), getVisibleRowOffsets: () => (m3 || (m3 = to(Ue2[n3].layout, false, Ue2[n3].visibleIndices(), s2.rowStart, s2.rowEnd)), m3), getTotalRangeCoords: () => ({ colStart: Ke2[t3].minCoord, colEnd: Ke2[t3].maxCoord, rowStart: Ue2[n3].minCoord, rowEnd: Ue2[n3].maxCoord }), getRangeCoordsBounds: u2, scrollCellCoordsIntoView: (e6, t4) => ut2(e6, t4, o3), getCellCoordsFromClient: (e6, t4, n4 = false) => {
2816
2849
  const o4 = tt2(e6, t4);
2817
2850
  if (!o4) return null;
2818
2851
  const r4 = c3.getColIndex(o4.x - d2.x), i3 = { rowIndex: c3.getRowIndex(o4.y - d2.y), colIndex: r4 };
@@ -2821,7 +2854,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2821
2854
  return { rowIndex: l3.rowStart, colIndex: l3.colStart };
2822
2855
  }, getZoom: () => ie2, getAnchor: () => o3, getBounds: () => d2, getInsets: () => a3, getTotalSize: () => h2, getViewportSize: () => g2, getScrollTopLeft: () => f2, getFreezeTopLeft: () => p2, getScrollOrientation: () => l2, allViews: () => e5 };
2823
2856
  };
2824
- let n2 = e5[k] = t2(0, 0, k, _o, Eo);
2857
+ let n2 = e5[k] = t2(0, 0, k, _o, So);
2825
2858
  return n2 && (e5[k] = n2), n2 = t2(0, 1, M, { horizontal: true }), n2 && (e5[M] = n2), n2 = t2(1, 0, T, { vertical: true }), n2 && (e5[T] = n2), n2 = t2(1, 1, C, {}), n2 && (e5[C] = n2), qe2.current = null, e5 = Object.freeze(e5);
2826
2859
  }, [Ue2, Ke2, ce2]), Ge2 = Object.keys(Xe2), Ze2 = Ke2[0]?.maxVirtualBounds ?? 0, Je2 = Ue2[0]?.maxVirtualBounds ?? 0, Qe2 = d(() => ({ left: Ke2[1] ? Ke2[1].layout.getColOffset(Ke2[1].maxIndex + 1) : 0, top: Ue2[1] ? Ue2[1].layout.getRowOffset(Ue2[1].maxIndex + 1) : 0 }), [Xe2]);
2827
2860
  s(() => {
@@ -2832,7 +2865,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2832
2865
  }, [Xe2]);
2833
2866
  const et2 = Tt(() => ({ containerWidth: je2, containerHeight: Ve2, totalWidth: Ze2, totalHeight: Je2 }), [je2, Ve2, De2]);
2834
2867
  s(() => {
2835
- !_e2.current && Pe2.current && fe2({ top: Ce2, left: Te2, width: je2, height: Ve2, totalWidth: Ze2, totalHeight: Je2 });
2868
+ !Ee2.current && Pe2.current && fe2({ top: Ce2, left: Te2, width: je2, height: Ve2, totalWidth: Ze2, totalHeight: Je2 });
2836
2869
  }, [Ce2, Te2, Ze2, Je2]), s(() => {
2837
2870
  Pe2.current && fe2({ top: Ce2, left: Te2, width: je2, height: Ve2, totalWidth: Ze2, totalHeight: Je2 });
2838
2871
  }, [je2, Ve2]);
@@ -2846,16 +2879,16 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2846
2879
  if (!n2) return null;
2847
2880
  const { x: o3, y: r3 } = n2;
2848
2881
  let i2 = null;
2849
- const l2 = Io;
2882
+ const l2 = Eo;
2850
2883
  for (let e6 = 0; !i2 && e6 < l2.length; e6++) {
2851
2884
  const t3 = Xe2[l2[e6]];
2852
- t3 && ro(o3, r3, t3.getBounds()) && (i2 = t3);
2885
+ t3 && oo(o3, r3, t3.getBounds()) && (i2 = t3);
2853
2886
  }
2854
2887
  return i2 || (i2 = Xe2[k]), i2;
2855
2888
  }, [Xe2, ce2]), rt2 = Tt(() => Xe2[k].getVisibleRangeCoords(), [Xe2[k]]), it2 = l(null), lt2 = i(() => {
2856
2889
  null !== it2.current && Me.cancelTimeout(it2.current), it2.current = Me.requestTimeout(st2, 150);
2857
2890
  }, []), st2 = i(() => {
2858
- it2.current = null, Ee2((e5) => {
2891
+ it2.current = null, _e2((e5) => {
2859
2892
  const t2 = { ...e5, verticalScrollDirection: null, horizontalScrollDirection: null };
2860
2893
  return Ie2.current = t2, t2;
2861
2894
  });
@@ -2863,17 +2896,17 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2863
2896
  const t2 = e5?.left ?? e5?.[0], n2 = e5?.top ?? e5?.[1], o3 = void 0 !== t2 ? Math.min(Ze2 - je2, Math.max(Ke2?.[1]?.scrollOffset ?? 0, t2)) : Ie2.current.left, r3 = void 0 !== n2 ? Math.min(Je2 - Ve2, Math.max(Ue2?.[1]?.scrollOffset ?? 0, n2)) : Ie2.current.top;
2864
2897
  if (Ie2.current.left === o3 && Ie2.current.top === r3) return;
2865
2898
  let i2 = null, l2 = null;
2866
- Ie2.current.left > o3 ? i2 = _ : Ie2.current.left < o3 && (i2 = I), Ie2.current.top > r3 ? l2 = S : Ie2.current.top < r3 && (l2 = E), Me.throttle(() => {
2867
- Ee2((e6) => {
2899
+ Ie2.current.left > o3 ? i2 = E : Ie2.current.left < o3 && (i2 = I), Ie2.current.top > r3 ? l2 = S : Ie2.current.top < r3 && (l2 = _), Me.throttle(() => {
2900
+ _e2((e6) => {
2868
2901
  const t3 = { ...e6, left: o3, top: r3, horizontalScrollDirection: i2, verticalScrollDirection: l2 };
2869
2902
  return Ie2.current = t3, t3;
2870
2903
  });
2871
- }, 17)(), _e2.current?.top === r3 && _e2.current?.left === o3 || (_e2.current = { left: o3, top: r3 }, he2({ left: o3, top: r3 }), fe2({ left: o3, top: r3, width: je2, height: Ve2, totalWidth: Ze2, totalHeight: Je2 })), lt2();
2904
+ }, 17)(), Ee2.current?.top === r3 && Ee2.current?.left === o3 || (Ee2.current = { left: o3, top: r3 }, he2({ left: o3, top: r3 }), fe2({ left: o3, top: r3, width: je2, height: Ve2, totalWidth: Ze2, totalHeight: Je2 })), lt2();
2872
2905
  }, [Ze2, Je2, Ue2, Ke2]);
2873
2906
  s(() => {
2874
- _e2.current || ct2({ left: Te2, top: Ce2 });
2907
+ Ee2.current || ct2({ left: Te2, top: Ce2 });
2875
2908
  }, [Ze2, je2, Je2, Ve2]), u(() => {
2876
- _e2.current = { left: ae2?.left, top: ae2?.top }, ct2(_e2.current);
2909
+ Ee2.current = { left: ae2?.left, top: ae2?.top }, ct2(Ee2.current);
2877
2910
  }, [ae2?.left, ae2?.top]);
2878
2911
  const at2 = Tt((e5) => {
2879
2912
  const t2 = e5?.left ?? e5?.[0], n2 = e5?.top ?? e5?.[1], o3 = e5?.behavior ?? "auto", r3 = { left: Ie2.current.left + (t2 ?? 0), top: Ie2.current.top + (n2 ?? 0) };
@@ -2881,7 +2914,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2881
2914
  }, [Ze2, je2, Je2, Ve2]), dt2 = i((e5) => {
2882
2915
  let t2 = null;
2883
2916
  if (Object.keys(Xe2).length > 1) {
2884
- const n2 = Io;
2917
+ const n2 = Eo;
2885
2918
  for (let o3 = 0; !t2 && o3 < n2.length; o3++) {
2886
2919
  const r3 = Xe2[n2[o3]];
2887
2920
  r3 && ne.isCellWithinRange(e5, r3.getVisibleRangeCoords()) && (t2 = r3);
@@ -2896,7 +2929,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2896
2929
  t3("Invalid view");
2897
2930
  });
2898
2931
  } else r3 = dt2(o3);
2899
- const i2 = ce2(o3), l2 = r3.getLayout(), s2 = l2.getColOffset(i2.colStart), c3 = l2.getRowOffset(i2.rowStart), a3 = l2.getColOffset(i2.colEnd + 1), d2 = l2.getRowOffset(i2.rowEnd + 1), u2 = r3.getBounds(), h2 = r3.getTotalSize(), f2 = r3.getScrollTopLeft(), p2 = ((e6, t3, n3 = true) => (n3 = true === n3 ? { block: "start", inline: "end" } : false === n3 ? { block: "end", inline: "end" } : { block: "end", inline: "end", ...n3 }, { left: Zn(n3.inline, e6.x, e6.x + e6.width, t3.left, t3.left + t3.width, t3.totalWidth), top: Zn(n3.block, e6.y, e6.y + e6.height, t3.top, t3.top + t3.height, t3.totalHeight) }))({ x: s2 + f2.left, y: c3 + f2.top, width: a3 - s2, height: d2 - c3 }, { left: f2.left, top: f2.top, width: u2.width, height: u2.height, totalWidth: h2.width, totalHeight: h2.height }, t2), g2 = { ...p2 };
2932
+ const i2 = ce2(o3), l2 = r3.getLayout(), s2 = l2.getColOffset(i2.colStart), c3 = l2.getRowOffset(i2.rowStart), a3 = l2.getColOffset(i2.colEnd + 1), d2 = l2.getRowOffset(i2.rowEnd + 1), u2 = r3.getBounds(), h2 = r3.getTotalSize(), f2 = r3.getScrollTopLeft(), p2 = ((e6, t3, n3 = true) => (n3 = true === n3 ? { block: "start", inline: "end" } : false === n3 ? { block: "end", inline: "end" } : { block: "end", inline: "end", ...n3 }, { left: Gn(n3.inline, e6.x, e6.x + e6.width, t3.left, t3.left + t3.width, t3.totalWidth), top: Gn(n3.block, e6.y, e6.y + e6.height, t3.top, t3.top + t3.height, t3.totalHeight) }))({ x: s2 + f2.left, y: c3 + f2.top, width: a3 - s2, height: d2 - c3 }, { left: f2.left, top: f2.top, width: u2.width, height: u2.height, totalWidth: h2.width, totalHeight: h2.height }, t2), g2 = { ...p2 };
2900
2933
  g2.left > Te2 ? g2.left += 20 : g2.left < Te2 && (g2.left -= 0), g2.top > Ce2 ? g2.top += 20 : g2.top < Ce2 && (g2.top -= 0);
2901
2934
  const w3 = r3.getScrollOrientation();
2902
2935
  return w3.horizontal && void 0 !== e5.colIndex || delete g2.left, w3.vertical && void 0 !== e5.rowIndex || delete g2.top, new Promise((e6, t3) => {
@@ -2924,10 +2957,10 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2924
2957
  u(() => {
2925
2958
  ft2();
2926
2959
  }, [N2]);
2927
- const pt2 = qt(r2, () => ({ stage: me2.current, focus: We2, contains: He2, invalidate: ft2, scrollTo: ct2, scrollBy: at2, scrollCellCoordsIntoView: ut2, getScrollPosition: Ne2, getDimensions: et2, getViewport: rt2, handleWheel: ht2, rowCount: w2, columnCount: m2, getLayout: () => De2, getRelativePointFromClient: tt2, getViewFromClient: ot2, getViewFromCellCoords: dt2, getViewFromLocation: nt2, onViewChangeOnce: (e5) => {
2960
+ const pt2 = Kt(r2, () => ({ stage: me2.current, focus: We2, contains: He2, invalidate: ft2, scrollTo: ct2, scrollBy: at2, scrollCellCoordsIntoView: ut2, getScrollPosition: Ne2, getDimensions: et2, getViewport: rt2, handleWheel: ht2, rowCount: w2, columnCount: m2, getLayout: () => De2, getRelativePointFromClient: tt2, getViewFromClient: ot2, getViewFromCellCoords: dt2, getViewFromLocation: nt2, onViewChangeOnce: (e5) => {
2928
2961
  Ye2.current.push(e5);
2929
2962
  } }), [w2, m2, Xe2]);
2930
- s(() => (le2 && pt2.current?.addEventListener("wheel", ht2, { passive: false }), Pe2.current = true, _e2.current = null, () => {
2963
+ s(() => (le2 && pt2.current?.addEventListener("wheel", ht2, { passive: false }), Pe2.current = true, Ee2.current = null, () => {
2931
2964
  pt2.current?.removeEventListener("wheel", ht2);
2932
2965
  }), [le2]);
2933
2966
  const gt2 = l([]), wt2 = (t2, n2) => {
@@ -2961,15 +2994,15 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2961
2994
  d2.push(o4);
2962
2995
  }
2963
2996
  }
2964
- const u2 = t2.getVisibleColumnOffsets(), h2 = t2.getVisibleRowOffsets(), f2 = t2.getScrollTopLeft(), p2 = t2.getFreezeTopLeft(), g2 = f2.left + p2.left, w3 = f2.top + p2.top, m3 = Math.trunc(g2 / Mo), x3 = Math.trunc(w3 / Mo), y3 = {}, v3 = (e5, t3, n3, o4, r4) => {
2965
- const i3 = `view:${e5.getAnchor()}:cell:${Gn(t3.rowIndex, t3.colIndex)}`, c4 = o4.x, a4 = o4.y, d3 = Math.trunc((g2 + c4) / Mo) - m3, u3 = Math.trunc((w3 + a4) / Mo) - x3;
2997
+ const u2 = t2.getVisibleColumnOffsets(), h2 = t2.getVisibleRowOffsets(), f2 = t2.getScrollTopLeft(), p2 = t2.getFreezeTopLeft(), g2 = f2.left + p2.left, w3 = f2.top + p2.top, m3 = Math.trunc(g2 / Co), x3 = Math.trunc(w3 / Co), y3 = {}, v3 = (e5, t3, n3, o4, r4) => {
2998
+ const i3 = `view:${e5.getAnchor()}:cell:${Xn(t3.rowIndex, t3.colIndex)}`, c4 = o4.x, a4 = o4.y, d3 = Math.trunc((g2 + c4) / Co) - m3, u3 = Math.trunc((w3 + a4) / Co) - x3;
2966
2999
  y3[u3] || (y3[u3] = {});
2967
3000
  let h3 = y3[u3][d3];
2968
3001
  h3 || (h3 = y3[u3][d3] = []);
2969
3002
  let f3 = l2?.get(i3);
2970
3003
  if (!f3) {
2971
- const l3 = (g2 + c4) % Mo, s3 = (w3 + a4) % Mo;
2972
- f3 = N2({ key: i3, coords: t3, bounds: o4, zoom: ie2, range: n3, view: e5, value: r4, style: { left: Ut.boundPixel(l3), top: Ut.boundPixel(s3), width: Ut.boundPixel(o4.width, true), height: Ut.boundPixel(o4.height, true) } });
3004
+ const l3 = (g2 + c4) % Co, s3 = (w3 + a4) % Co;
3005
+ f3 = N2({ key: i3, coords: t3, bounds: o4, zoom: ie2, range: n3, view: e5, value: r4, style: { left: Nt.boundPixel(l3), top: Nt.boundPixel(s3), width: Nt.boundPixel(o4.width, true), height: Nt.boundPixel(o4.height, true) } });
2973
3006
  }
2974
3007
  s2?.set(i3, f3), h3.push(f3);
2975
3008
  };
@@ -2983,28 +3016,28 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
2983
3016
  const f3 = l3.rowIndex, p3 = l3.colIndex, g3 = h2[f3], w4 = u2[p3];
2984
3017
  let m4 = null;
2985
3018
  g3 && w4 && (m4 = { x: w4.offset, y: g3.offset, width: w4.size, height: g3.size });
2986
- const x4 = Gn(s3.rowStart, s3.colStart);
3019
+ const x4 = Xn(s3.rowStart, s3.colStart);
2987
3020
  if (a4) {
2988
3021
  if (i2.has(x4)) continue;
2989
3022
  i2.add(x4), s3.rowEnd - s3.rowStart > 0 && o3.push(s3), s3.colEnd - s3.colStart > 0 && r3.push(s3);
2990
3023
  }
2991
- if (a4 && (m4 = oo(t2.getLayout(), s3)), !m4) {
3024
+ if (a4 && (m4 = no(t2.getLayout(), s3)), !m4) {
2992
3025
  console.warn("no bounds for cell", x4);
2993
3026
  continue;
2994
3027
  }
2995
3028
  const y4 = n3?.value;
2996
3029
  v3(t2, l3, s3, m4, y4);
2997
3030
  }
2998
- const b2 = g2 % Mo, S2 = w3 % Mo, E2 = Object.keys(y3);
2999
- for (let o4 = 0; o4 < E2.length; o4++) {
3000
- const r4 = y3[E2[o4]];
3031
+ const b2 = g2 % Co, S2 = w3 % Co, _2 = Object.keys(y3);
3032
+ for (let o4 = 0; o4 < _2.length; o4++) {
3033
+ const r4 = y3[_2[o4]];
3001
3034
  if (!r4) continue;
3002
3035
  const i3 = Object.keys(r4);
3003
3036
  for (let l3 = 0; l3 < i3.length; l3++) {
3004
3037
  const s3 = r4[i3[l3]];
3005
3038
  if (!s3) continue;
3006
- const c4 = parseInt(E2[o4]), a4 = parseInt(i3[l3]), d3 = c4 + x3, u3 = a4 + m3, h3 = `view:${t2.getAnchor()}:segment:${u3}:${d3}`;
3007
- n2.push(e("div", { className: "cell-container", style: { transform: `translate(${Ut.boundPixel(a4 * Mo - b2, true)}px, ${Ut.boundPixel(c4 * Mo - S2, true)}px)`, willChange: "transform" }, children: s3 }, h3));
3039
+ const c4 = parseInt(_2[o4]), a4 = parseInt(i3[l3]), d3 = c4 + x3, u3 = a4 + m3, h3 = `view:${t2.getAnchor()}:segment:${u3}:${d3}`;
3040
+ n2.push(e("div", { className: "cell-container", style: { transform: `translate(${Nt.boundPixel(a4 * Co - b2, true)}px, ${Nt.boundPixel(c4 * Co - S2, true)}px)`, willChange: "transform" }, children: s3 }, h3));
3008
3041
  }
3009
3042
  }
3010
3043
  }, yt2 = d(() => {
@@ -3035,7 +3068,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
3035
3068
  for (let t3 = 0; t3 < c3.length + 1; t3++) {
3036
3069
  let n4 = w3, i4 = s2;
3037
3070
  const l3 = c3[t3];
3038
- t3 < c3.length && (i4 = Math.min(s2, p2.getColOffset(l3.colStart)), w3 = Math.min(s2, p2.getColOffset(l3.colEnd + 1))), r3.push(f("path", { d: `M ${Ut.boundPixel(n4)} ${Ut.boundPixel(g2, false, o3)} L ${Ut.boundPixel(i4)} ${Ut.boundPixel(g2, false, o3)}`, stroke: z2, strokeWidth: 1, vectorEffect: "non-scaling-stroke", ...A2, key: e5 + u2 + ":" + t3 }));
3071
+ t3 < c3.length && (i4 = Math.min(s2, p2.getColOffset(l3.colStart)), w3 = Math.min(s2, p2.getColOffset(l3.colEnd + 1))), r3.push(f("path", { d: `M ${Nt.boundPixel(n4)} ${Nt.boundPixel(g2, false, o3)} L ${Nt.boundPixel(i4)} ${Nt.boundPixel(g2, false, o3)}`, stroke: z2, strokeWidth: 1, vectorEffect: "non-scaling-stroke", ...A2, key: e5 + u2 + ":" + t3 }));
3039
3072
  }
3040
3073
  for (let e6 = c3.length - 1; e6 >= 0; e6--) c3[e6].rowEnd <= n3[i3 + 1] && c3.splice(e6, 1);
3041
3074
  }
@@ -3061,7 +3094,7 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
3061
3094
  const s3 = a3[t3];
3062
3095
  t3 < a3.length && (l3 = Math.min(c3, p2.getRowOffset(s3.rowStart)), w3 = Math.min(c3, p2.getRowOffset(s3.rowEnd + 1)));
3063
3096
  let d3 = z2;
3064
- r3.push(e("path", { d: `M ${Ut.boundPixel(g2, false, o3)} ${Ut.boundPixel(i4)} L ${Ut.boundPixel(g2, false, o3)} ${Ut.boundPixel(l3)}`, stroke: d3, strokeWidth: 1, vectorEffect: "non-scaling-stroke", ...$2 }, n3 + h2 + ":" + t3));
3097
+ r3.push(e("path", { d: `M ${Nt.boundPixel(g2, false, o3)} ${Nt.boundPixel(i4)} L ${Nt.boundPixel(g2, false, o3)} ${Nt.boundPixel(l3)}`, stroke: d3, strokeWidth: 1, vectorEffect: "non-scaling-stroke", ...$2 }, n3 + h2 + ":" + t3));
3065
3098
  }
3066
3099
  for (let e5 = a3.length - 1; e5 >= 0; e5--) a3[e5].colEnd <= l2[i3 + 1] && a3.splice(e5, 1);
3067
3100
  }
@@ -3076,15 +3109,15 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
3076
3109
  n2[r3] = e("svg", { width: `${c3}`, height: `${a3}`, viewBox: `0 0 ${c3} ${a3}`, preserveAspectRatio: "none", shapeRendering: "crispEdges", style: { position: "absolute" }, children: l2 });
3077
3110
  }
3078
3111
  return n2;
3079
- }, St2 = d(() => true === D2 || true === D2?.horizontal ? bt2(true) : null, [ve2, D2, Ue2, V2, j2, z2, A2, w2, m2, je2, Ze2, yt2]), Et2 = d(() => true === D2 || true === D2?.vertical ? bt2(false) : null, [ve2, D2, Ke2, V2, j2, z2, $2, w2, m2, Ve2, Je2, yt2]), _t2 = d(() => 0 === Qe2.left ? null : e(lo, { linePoints: [0, 0, 0, Ve2 + 1], bounds: { x: Qe2.left, y: 0, width: 1, height: Ve2 + 1 }, ...W2 }), [ve2, Qe2.left, Ve2, W2]), It2 = d(() => 0 === Qe2.top ? null : e(lo, { linePoints: [0, 0, je2 + 1, 0], bounds: { x: 0, y: Qe2.top, width: je2 + 1, height: 1 }, ...H2 }), [ve2, Qe2.top, je2, H2]), Ct2 = d(() => {
3112
+ }, St2 = d(() => true === D2 || true === D2?.horizontal ? bt2(true) : null, [ve2, D2, Ue2, V2, j2, z2, A2, w2, m2, je2, Ze2, yt2]), _t2 = d(() => true === D2 || true === D2?.vertical ? bt2(false) : null, [ve2, D2, Ke2, V2, j2, z2, $2, w2, m2, Ve2, Je2, yt2]), Et2 = d(() => 0 === Qe2.left ? null : e(io, { linePoints: [0, 0, 0, Ve2 + 1], bounds: { x: Qe2.left, y: 0, width: 1, height: Ve2 + 1 }, ...W2 }), [ve2, Qe2.left, Ve2, W2]), It2 = d(() => 0 === Qe2.top ? null : e(io, { linePoints: [0, 0, je2 + 1, 0], bounds: { x: 0, y: Qe2.top, width: je2 + 1, height: 1 }, ...H2 }), [ve2, Qe2.top, je2, H2]), Ct2 = d(() => {
3080
3113
  const o3 = [], r3 = (e5) => {
3081
3114
  if (!e5 || !Xe2[e5]) return;
3082
3115
  const n2 = Xe2[e5].getBounds();
3083
- return t("div", { style: { position: "absolute", pointerEvents: "none", left: n2.x, top: n2.y, width: n2.width, height: n2.height, clip: `rect(0, ${n2.width + 1}px, ${n2.height + 1}px, 0)` }, className: `view view-${e5}`, children: [St2?.[e5], Et2?.[e5], yt2?.[e5].cells] }, `view:${e5}`);
3116
+ return t("div", { style: { position: "absolute", pointerEvents: "none", left: n2.x, top: n2.y, width: n2.width, height: n2.height, clip: `rect(0, ${n2.width + 1}px, ${n2.height + 1}px, 0)` }, className: `view view-${e5}`, children: [St2?.[e5], _t2?.[e5], yt2?.[e5].cells] }, `view:${e5}`);
3084
3117
  };
3085
3118
  for (let e5 = 0; e5 < Ge2.length; e5++) o3.push(r3(Ge2[e5]));
3086
3119
  return e(n, { children: o3 });
3087
- }, [Xe2, St2, Et2, yt2]), Mt2 = d(() => {
3120
+ }, [Xe2, St2, _t2, yt2]), Mt2 = d(() => {
3088
3121
  if (!r2) return;
3089
3122
  const e5 = (e6, t2, n3, o4) => {
3090
3123
  if (!o4 || 0 === o4.length) return;
@@ -3092,13 +3125,13 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
3092
3125
  for (let i3 = 0; i3 < o4.length; i3++) {
3093
3126
  const l3 = o4[i3];
3094
3127
  let s3 = e6?.get(l3);
3095
- s3 !== To && (s3 = l3(n3) ?? To), t2.set(l3, s3), s3 && s3 !== To && r3.push(s3);
3128
+ s3 !== Mo && (s3 = l3(n3) ?? Mo), t2.set(l3, s3), s3 && s3 !== Mo && r3.push(s3);
3096
3129
  }
3097
3130
  return r3;
3098
3131
  }, n2 = (n3, o4, r3) => {
3099
3132
  if (!r3) return;
3100
3133
  const i3 = r3.getBounds(), l3 = r3.getInsets(), s3 = r3.getAnchor();
3101
- return t("div", { className: g("view", `view-${s3}`, bo.view), style: { position: "absolute", pointerEvents: "none", left: i3.x - l3.left, top: i3.y - l3.top, width: i3.width - (l3.left + l3.right), height: i3.height - (l3.top + l3.bottom), clipPath: Z2 ? "inset(-2px)" : "inset(0px)" }, children: [e5(n3, o4, r3, X2), mt2?.[s3].overlays] }, `view:${s3}`);
3134
+ return t("div", { className: g("view", `view-${s3}`, vo.view), style: { position: "absolute", pointerEvents: "none", left: i3.x - l3.left, top: i3.y - l3.top, width: i3.width - (l3.left + l3.right), height: i3.height - (l3.top + l3.bottom), clipPath: Z2 ? "inset(-2px)" : "inset(0px)" }, children: [e5(n3, o4, r3, X2), mt2?.[s3].overlays] }, `view:${s3}`);
3102
3135
  }, o3 = qe2.current, i2 = {}, l2 = [], s2 = Object.keys(Xe2);
3103
3136
  for (let e6 = 0; e6 < s2.length; e6++) {
3104
3137
  const t2 = s2[e6], r3 = o3?.[t2], c3 = i2[t2] = /* @__PURE__ */ new Map();
@@ -3111,52 +3144,52 @@ const fo = -10, po = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
3111
3144
  }, [je2, Ve2, Ct2, J2, Q2]), Rt2 = l(false);
3112
3145
  return s(() => {
3113
3146
  !Rt2.current && yt2 && (Rt2.current = true, we2?.(pt2.current));
3114
- }, [yt2]), t("div", { className: g("sheetxl-grid", bo["sheetxl-grid"]), style: { overflow: "visible", cursor: F2, maxWidth: je2, maxHeight: Ve2, width: je2, height: Ve2, ...de2 }, ref: pt2, children: [kt2, t("div", { className: g("sheetxl-overlays"), ref: xe2, ...G2, children: [Mt2, _t2, It2] })] });
3147
+ }, [yt2]), t("div", { className: g("sheetxl-grid", vo["sheetxl-grid"]), style: { overflow: "visible", cursor: F2, maxWidth: je2, maxHeight: Ve2, width: je2, height: Ve2, ...de2 }, ref: pt2, children: [kt2, t("div", { className: g("sheetxl-overlays"), ref: xe2, ...G2, children: [Mt2, Et2, It2] })] });
3115
3148
  }));
3116
- ko.displayName = "BaseGrid";
3117
- const Ro = r(a((t2, n2) => {
3149
+ To.displayName = "BaseGrid";
3150
+ const ko = r(a((t2, n2) => {
3118
3151
  const { width: o2, height: r2, style: i2 = {}, className: l2, ...s2 } = t2, [c2, { width: a2, height: d2 }] = w();
3119
- return e("div", { className: l2, style: { ...i2 }, children: e("div", { style: { position: "relative", top: "0px", left: "0px", width: "100%", height: "100%", maxWidth: "100%", maxHeight: "100%", boxSizing: "content-box" }, ref: c2, children: e(ko, { ref: n2, width: o2 ?? a2, height: r2 ?? d2, ...s2 }) }) });
3152
+ return e("div", { className: l2, style: { ...i2 }, children: e("div", { style: { position: "relative", top: "0px", left: "0px", width: "100%", height: "100%", maxWidth: "100%", maxHeight: "100%", boxSizing: "content-box" }, ref: c2, children: e(To, { ref: n2, width: o2 ?? a2, height: r2 ?? d2, ...s2 }) }) });
3120
3153
  }));
3121
- Ro.displayName = "Grid";
3122
- const Po = r(a((t2, n2) => {
3154
+ ko.displayName = "Grid";
3155
+ const Ro = r(a((t2, n2) => {
3123
3156
  const { showVerticalScrollbar: o2, showHorizontalScrollbar: r2, createHorizontalScrollbar: s2, createVerticalScrollbar: a2, createScrollCorner: d2, viewport: u2, onScrollViewport: f2, style: p2 = {}, className: g2, onScroll: w2, ...m2 } = t2, [x2, y2] = h(null), v2 = l(null), S2 = l(null);
3124
3157
  b(!u2, "Viewport can not be specified"), c(n2, () => S2.current && v2.current ? Object.assign(S2.current, v2.current) : null);
3125
- const E2 = i((e5) => {
3158
+ const _2 = i((e5) => {
3126
3159
  S2.current?.scrollTo(e5), f2?.(e5);
3127
3160
  }, []);
3128
- return e(Gt, { className: g2, style: p2, ref: v2, showVerticalScrollbar: o2, showHorizontalScrollbar: r2, createHorizontalScrollbar: s2, createVerticalScrollbar: a2, createScrollCorner: d2, viewport: x2, onScrollViewport: E2, children: e(Ro, { style: { width: "100%", height: "100%" }, ...m2, onViewportChange: (e5) => y2(e5), ref: S2 }) });
3161
+ return e(Xt, { className: g2, style: p2, ref: v2, showVerticalScrollbar: o2, showHorizontalScrollbar: r2, createHorizontalScrollbar: s2, createVerticalScrollbar: a2, createScrollCorner: d2, viewport: x2, onScrollViewport: _2, children: e(ko, { style: { width: "100%", height: "100%" }, ...m2, onViewportChange: (e5) => y2(e5), ref: S2 }) });
3129
3162
  }));
3130
- Po.displayName = "ScrollableGrid";
3131
- const Oo = () => false, Lo = r((t2) => {
3132
- const { index: n2, value: o2, zoom: r2, zoomScale: i2 = 100, headerText: s2 = (e5) => `${e5}`, headerStyle: c2, headerStyleSelect: a2 = c2, headerStyleSelectAll: d2 = a2, headerStyleHover: u2 = d2, verticalPadding: f2 = 0, horizontalPadding: p2 = 0, isSelected: g2 = Oo, isSelectedAll: w2 = Oo, coords: m2, bounds: x2, range: y2, orientation: v2, view: b2, style: S2, ...E2 } = t2, _2 = i2 / 100, I2 = l(null), [C2, M2] = h(false), T2 = g2?.(n2) || false, k2 = w2?.(n2) || false ? d2 : T2 ? a2 : c2;
3163
+ Ro.displayName = "ScrollableGrid";
3164
+ const Po = () => false, Oo = r((t2) => {
3165
+ const { index: n2, value: o2, zoom: r2, zoomScale: i2 = 100, headerText: s2 = (e5) => `${e5}`, headerStyle: c2, headerStyleSelect: a2 = c2, headerStyleSelectAll: d2 = a2, headerStyleHover: u2 = d2, verticalPadding: f2 = 0, horizontalPadding: p2 = 0, isSelected: g2 = Po, isSelectedAll: w2 = Po, coords: m2, bounds: x2, range: y2, orientation: v2, view: b2, style: S2, ..._2 } = t2, E2 = i2 / 100, I2 = l(null), [C2, M2] = h(false), T2 = g2?.(n2) || false, k2 = w2?.(n2) || false ? d2 : T2 ? a2 : c2;
3133
3166
  let R2 = k2;
3134
3167
  if (C2) {
3135
3168
  let e5 = u2;
3136
3169
  "function" == typeof u2 && (e5 = u2(k2)), R2 = Me.mergeContentful(k2, e5);
3137
3170
  }
3138
- return e("div", { ref: I2, style: { background: R2.fill, color: R2.text?.fill, fontFamily: R2.text?.fontFamily ?? c2.text?.fontFamily, fontSize: 96 * (R2.text?.fontSize ?? 11) / 72 * _2, fontStyle: R2.text?.fontStyle, fontWeight: R2.text?.fontWeight, lineHeight: 1.2, display: "flex", justifyContent: "center", alignItems: "end", pointerEvents: "auto", paddingBottom: `${_2}px`, ...S2, left: S2.left - (v2 === A ? 1 : 0), top: S2.top - (v2 === $ ? 1 : 0), width: S2.width + 1, height: S2.height + 1, overflow: "hidden" }, ...E2, onMouseMove: (e5) => {
3139
- "touch" !== Ut.detectIt().primaryInput && 0 === e5.buttons && M2(true);
3171
+ return e("div", { ref: I2, style: { background: R2.fill, color: R2.text?.fill, fontFamily: R2.text?.fontFamily ?? c2.text?.fontFamily, fontSize: 96 * (R2.text?.fontSize ?? 11) / 72 * E2, fontStyle: R2.text?.fontStyle, fontWeight: R2.text?.fontWeight, lineHeight: 1.2, display: "flex", justifyContent: "center", alignItems: "end", pointerEvents: "auto", paddingBottom: `${E2}px`, ...S2, left: S2.left - (v2 === A ? 1 : 0), top: S2.top - (v2 === $ ? 1 : 0), width: S2.width + 1, height: S2.height + 1, overflow: "hidden" }, ..._2, onMouseMove: (e5) => {
3172
+ "touch" !== Nt.detectIt().primaryInput && 0 === e5.buttons && M2(true);
3140
3173
  }, onMouseOut: (e5) => {
3141
3174
  M2(false);
3142
3175
  }, children: s2(n2) });
3143
3176
  });
3144
- Lo.displayName = "HeaderRenderer";
3145
- const Do = "ew-resize", zo = "ns-resize", Ao = r(a((n2, o2) => {
3146
- const { orientation: r2, view: i2, index: l2, className: s2, style: c2, disabled: a2 = false, disabledResize: d2 = false, isNextHidden: u2, isHidden: h2, isSelected: f2, isSelectedAll: p2, showTouchDivider: w2, headerStyle: m2, headerStyleSelect: x2, headerStyleSelectAll: y2, headerStyleHover: v2, bounds: b2, onPointerDown: S2, onAutoFit: E2, ..._2 } = n2, I2 = r2 === A;
3177
+ Oo.displayName = "HeaderRenderer";
3178
+ const Lo = "ew-resize", Do = "ns-resize", zo = r(a((n2, o2) => {
3179
+ const { orientation: r2, view: i2, index: l2, className: s2, style: c2, disabled: a2 = false, disabledResize: d2 = false, isNextHidden: u2, isHidden: h2, isSelected: f2, isSelectedAll: p2, showTouchDivider: w2, headerStyle: m2, headerStyleSelect: x2, headerStyleSelectAll: y2, headerStyleHover: v2, bounds: b2, onPointerDown: S2, onAutoFit: _2, ...E2 } = n2, I2 = r2 === A;
3147
3180
  let C2 = m2;
3148
3181
  f2 && x2 && (C2 = x2), p2 && y2 && (C2 = y2);
3149
- const M2 = "touch" === Ut.detectIt().primaryInput;
3182
+ const M2 = "touch" === Nt.detectIt().primaryInput;
3150
3183
  let T2 = I2 ? 14 : 8, k2 = T2 / 2, R2 = 0;
3151
3184
  u2 && (R2 = -2), h2 && (R2 = 2), h2 && (T2 = T2 / 2 + R2, k2 = 2 * R2);
3152
3185
  let P2 = C2.dividerStrokeFill ?? C2.strokeFill;
3153
- return !(f2 || p2) && 0 === R2 && (P2 = `linear-gradient(${I2 ? 180 : 90}deg, ${C2.fill}, ${P2} 55%, ${P2} 100%)`), t("div", { className: g("header-divider", { disabled: a2 }, s2, `index-${l2}`), ref: o2, onPointerDown: M2 ? void 0 : S2, onDoubleClick: M2 ? void 0 : () => E2?.(), style: { top: (I2 ? 0 : -T2 / 2 + (R2 - 1)) + "px", left: (I2 ? -T2 / 2 + (R2 - 1) : 0) + "px", width: I2 ? T2 : "calc(100% + 1px)", height: I2 ? "calc(100% + 1px)" : T2, position: "absolute", overflow: "visible", pointerEvents: "all", cursor: a2 || d2 || M2 ? void 0 : I2 ? Do : zo, ...c2 }, ..._2, children: [e("div", { style: { position: "relative", top: `${I2 ? 0 : k2}px`, left: `${I2 ? k2 : 0}px`, width: I2 ? 1 : "100%", height: I2 ? "100%" : 1, background: P2 }, onDoubleClick: () => E2?.() }), w2 && M2 ? e("div", { style: { position: "absolute", cursor: "grab", zIndex: 1, borderRadius: "4px", right: I2 ? "-6px" : "2px", bottom: I2 ? "2px" : "-9px", height: "24px", width: I2 ? "24px" : "18px", maxHeight: I2 ? "calc(100% - 4px)" : void 0, maxWidth: I2 ? void 0 : "calc(100% - 4px)", background: C2.fill, border: `${y2.edgeStrokeFill} solid 1px`, boxShadow: `0.5px 0.5px 0px 0px ${m2.text.fill}`, display: "flex", alignItems: "center", justifyContent: "center" }, onPointerDown: S2, children: e("div", { style: { width: "6.4px", height: "12px", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${encodeURIComponent(x2.text.fill)}' 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", transform: I2 ? void 0 : "rotate(90deg)" } }) }) : null] });
3154
- })), $o = (t2, n2) => e(Ao, { ...t2, ref: n2 }), Bo = r(a((o2, r2) => {
3155
- const { orientation: i2, view: s2, index: c2, disabled: a2 = false, disabledResize: d2 = false, resizeThreshold: u2 = 1, dividerRenderer: f2 = $o, onDividerMouseDown: p2, onDividerResizeStart: w2, onDividerResize: m2, onDividerResizeEnd: x2, onDividerMouseUp: y2, onDividerAutoFit: b2, onPointerDown: S2, ...E2 } = o2, _2 = Tt(S2, [S2]), I2 = Tt(b2, [b2]), C2 = i2 === A;
3186
+ return !(f2 || p2) && 0 === R2 && (P2 = `linear-gradient(${I2 ? 180 : 90}deg, ${C2.fill}, ${P2} 55%, ${P2} 100%)`), t("div", { className: g("header-divider", { disabled: a2 }, s2, `index-${l2}`), ref: o2, onPointerDown: M2 ? void 0 : S2, onDoubleClick: M2 ? void 0 : () => _2?.(), style: { top: (I2 ? 0 : -T2 / 2 + (R2 - 1)) + "px", left: (I2 ? -T2 / 2 + (R2 - 1) : 0) + "px", width: I2 ? T2 : "calc(100% + 1px)", height: I2 ? "calc(100% + 1px)" : T2, position: "absolute", overflow: "visible", pointerEvents: "all", cursor: a2 || d2 || M2 ? void 0 : I2 ? Lo : Do, ...c2 }, ...E2, children: [e("div", { style: { position: "relative", top: `${I2 ? 0 : k2}px`, left: `${I2 ? k2 : 0}px`, width: I2 ? 1 : "100%", height: I2 ? "100%" : 1, background: P2 }, onDoubleClick: () => _2?.() }), w2 && M2 ? e("div", { style: { position: "absolute", cursor: "grab", zIndex: 1, borderRadius: "4px", right: I2 ? "-6px" : "2px", bottom: I2 ? "2px" : "-9px", height: "24px", width: I2 ? "24px" : "18px", maxHeight: I2 ? "calc(100% - 4px)" : void 0, maxWidth: I2 ? void 0 : "calc(100% - 4px)", background: C2.fill, border: `${y2.edgeStrokeFill} solid 1px`, boxShadow: `0.5px 0.5px 0px 0px ${m2.text.fill}`, display: "flex", alignItems: "center", justifyContent: "center" }, onPointerDown: S2, children: e("div", { style: { width: "6.4px", height: "12px", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${encodeURIComponent(x2.text.fill)}' 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", transform: I2 ? void 0 : "rotate(90deg)" } }) }) : null] });
3187
+ })), Ao = (t2, n2) => e(zo, { ...t2, ref: n2 }), $o = r(a((o2, r2) => {
3188
+ const { orientation: i2, view: s2, index: c2, disabled: a2 = false, disabledResize: d2 = false, resizeThreshold: u2 = 1, dividerRenderer: f2 = Ao, onDividerMouseDown: p2, onDividerResizeStart: w2, onDividerResize: m2, onDividerResizeEnd: x2, onDividerMouseUp: y2, onDividerAutoFit: b2, onPointerDown: S2, ..._2 } = o2, E2 = Tt(S2, [S2]), I2 = Tt(b2, [b2]), C2 = i2 === A;
3156
3189
  let M2 = C2 ? s2.getVisibleColumns() : s2.getVisibleRows(), T2 = null;
3157
- M2.length > 0 && (C2 ? T2 = s2.getRangeCoordsBounds({ rowStart: 0, rowEnd: 0, colStart: M2[0], colEnd: M2[M2.length - 1] }) : s2.getRangeCoordsBounds({ rowStart: M2[0], rowEnd: M2[M2.length - 1], colStart: 0, colEnd: 0 }), T2 = s2.toClipBounds(T2, fo));
3158
- const k2 = l(null), [R2, P2] = h(null), O2 = (e5, t2) => C2 ? e5.clientX - t2.clientX : e5.clientY - t2.clientY, L2 = s2.getLayout(), D2 = C2 ? L2.getColOffset(c2 + 1) : L2.getRowOffset(c2 + 1), z2 = hn({ processTouch: true, onPointerDown: (e5) => {
3159
- if (_2?.(e5), !a2 && !d2) {
3190
+ M2.length > 0 && (C2 ? T2 = s2.getRangeCoordsBounds({ rowStart: 0, rowEnd: 0, colStart: M2[0], colEnd: M2[M2.length - 1] }) : s2.getRangeCoordsBounds({ rowStart: M2[0], rowEnd: M2[M2.length - 1], colStart: 0, colEnd: 0 }), T2 = s2.toClipBounds(T2, ho));
3191
+ const k2 = l(null), [R2, P2] = h(null), O2 = (e5, t2) => C2 ? e5.clientX - t2.clientX : e5.clientY - t2.clientY, L2 = s2.getLayout(), D2 = C2 ? L2.getColOffset(c2 + 1) : L2.getRowOffset(c2 + 1), z2 = un({ processTouch: true, onPointerDown: (e5) => {
3192
+ if (E2?.(e5), !a2 && !d2) {
3160
3193
  const e6 = C2 ? L2.getColOffset(c2) : L2.getRowOffset(c2), t2 = D2 - e6;
3161
3194
  k2.current = { isResizing: false, startSize: t2, index: c2, view: s2, orientation: i2, onDividerMouseDown: p2, onDividerResizeStart: w2, onDividerResize: m2, onDividerResizeEnd: x2, onDividerMouseUp: y2 }, P2(k2.current), p2?.(c2, t2);
3162
3195
  }
@@ -3174,13 +3207,13 @@ const Do = "ew-resize", zo = "ns-resize", Ao = r(a((n2, o2) => {
3174
3207
  I2?.(c2);
3175
3208
  }, [c2]);
3176
3209
  if (!T2) return;
3177
- const B2 = f2({ bounds: T2, orientation: i2, view: s2, index: c2, disabled: a2, disabledResize: d2, onAutoFit: $2, onPointerDown: z2, ...E2 }, r2);
3210
+ const B2 = f2({ bounds: T2, orientation: i2, view: s2, index: c2, disabled: a2, disabledResize: d2, onAutoFit: $2, onPointerDown: z2, ..._2 }, r2);
3178
3211
  if (!B2) return;
3179
- const { getPortalContainer: F2 } = Qt();
3212
+ const { getPortalContainer: F2 } = Jt();
3180
3213
  let j2 = null;
3181
- return R2 && R2.isResizing && R2.index === c2 && (j2 = v(e("div", { style: { position: "absolute", cursor: C2 ? Do : zo, left: 0, top: 0, width: "100%", height: "100%" } }), F2(), "divider:" + c2)), t(n, { children: [j2, e("div", { className: g("header-divider-anchor"), style: { position: "absolute", pointerEvents: "auto", top: `${C2 ? T2.y : D2}px`, left: `${C2 ? D2 : T2.x}px`, width: (C2 ? 0 : T2.width - 1) + "px", height: (C2 ? T2.height - 1 : 0) + "px", display: "flex" }, tabIndex: -1, children: B2 })] });
3214
+ return R2 && R2.isResizing && R2.index === c2 && (j2 = v(e("div", { style: { position: "absolute", cursor: C2 ? Lo : Do, left: 0, top: 0, width: "100%", height: "100%" } }), F2(), "divider:" + c2)), t(n, { children: [j2, e("div", { className: g("header-divider-anchor"), style: { position: "absolute", pointerEvents: "auto", top: `${C2 ? T2.y : D2}px`, left: `${C2 ? D2 : T2.x}px`, width: (C2 ? 0 : T2.width - 1) + "px", height: (C2 ? T2.height - 1 : 0) + "px", display: "flex" }, tabIndex: -1, children: B2 })] });
3182
3215
  }));
3183
- class Fo {
3216
+ class Bo {
3184
3217
  naturalDimensions(e5, t2 = {}) {
3185
3218
  const n2 = document.createElement("div");
3186
3219
  let o2 = t2?.lineHeight ?? "1";
@@ -3197,8 +3230,8 @@ class Fo {
3197
3230
  return r2.remove(), { width: l2.width, height: l2.height, maxLineHeight: 1.2 * (t2.paintableText?.fontSize || 1056 / 72) };
3198
3231
  }
3199
3232
  }
3200
- const jo = (e5 = void 0) => Object.freeze({ clean: e5, dirty: void 0, editMode: false }), Vo = jo(), Wo = r(a((t2, n2) => {
3201
- const { editState: o2 = Vo, defaultTextStyle: r2, onStartEdit: c2, onChangeEdit: a2, onSubmitEdit: f2, onCancelEdit: p2, onDoneEdit: g2, containerBounds: w2, setNaturalDimensions: m2, onNavigate: x2, textProperties: y2, style: v2, autoFocus: b2, ...C2 } = t2, M2 = l(null), { width: T2 = 0 } = w2 ?? {}, [k2, R2] = h(() => o2);
3233
+ const Fo = (e5 = void 0) => Object.freeze({ clean: e5, dirty: void 0, editMode: false }), jo = Fo(), Vo = r(a((t2, n2) => {
3234
+ const { editState: o2 = jo, defaultTextStyle: r2, onStartEdit: c2, onChangeEdit: a2, onSubmitEdit: f2, onCancelEdit: p2, onDoneEdit: g2, containerBounds: w2, setNaturalDimensions: m2, onNavigate: x2, textProperties: y2, style: v2, autoFocus: b2, ...C2 } = t2, M2 = l(null), { width: T2 = 0 } = w2 ?? {}, [k2, R2] = h(() => o2);
3202
3235
  s(() => {
3203
3236
  R2(o2);
3204
3237
  }, [o2]);
@@ -3206,7 +3239,7 @@ const jo = (e5 = void 0) => Object.freeze({ clean: e5, dirty: void 0, editMode:
3206
3239
  let j2 = 2;
3207
3240
  const V2 = 96 * A2 / 72, W2 = 1.2 * V2;
3208
3241
  "right" === O2 && (j2 += 1);
3209
- const H2 = d(() => new Fo().naturalDimensions(F2, { maxWidth: "wrap" === D2 ? T2 - j2 : void 0, lineHeight: `${W2}px`, paintableText: { fontStyle: B2, wrap: D2, letterSpacing: -0.25 } }), [F2, D2, j2, V2, z2, $2, B2, m2, T2]), N2 = i(() => H2.maxLineHeight ? H2.maxLineHeight + "px" : "1.2", [H2]), [U2, K2] = h(N2);
3242
+ const H2 = d(() => new Bo().naturalDimensions(F2, { maxWidth: "wrap" === D2 ? T2 - j2 : void 0, lineHeight: `${W2}px`, paintableText: { fontStyle: B2, wrap: D2, letterSpacing: -0.25 } }), [F2, D2, j2, V2, z2, $2, B2, m2, T2]), N2 = i(() => H2.maxLineHeight ? H2.maxLineHeight + "px" : "1.2", [H2]), [U2, K2] = h(N2);
3210
3243
  u(() => {
3211
3244
  K2(N2());
3212
3245
  }, [w2, H2]), u(() => {
@@ -3230,28 +3263,28 @@ const jo = (e5 = void 0) => Object.freeze({ clean: e5, dirty: void 0, editMode:
3230
3263
  R2(o2), p2?.(), g2?.();
3231
3264
  }, [p2, o2]), J2 = Tt((e5) => {
3232
3265
  if (!M2.current) return;
3233
- if (e5.isDefaultPrevented(), !(e5.isTrusted || e5.nativeEvent.ctrlKey || e5.nativeEvent.metaKey || e5.nativeEvent.altKey || e5.nativeEvent.isComposing) && -1 !== $n.indexOf(e5.nativeEvent.key)) {
3266
+ if (e5.isDefaultPrevented(), !(e5.isTrusted || e5.nativeEvent.ctrlKey || e5.nativeEvent.metaKey || e5.nativeEvent.altKey || e5.nativeEvent.isComposing) && -1 !== An.indexOf(e5.nativeEvent.key)) {
3234
3267
  const t4 = { ...k2 };
3235
3268
  return t4.dirty = "Backspace" === e5.nativeEvent.key ? "" : (t4.dirty ?? "") + e5.key, R2(t4), q2?.(t4), void e5.preventDefault();
3236
3269
  }
3237
3270
  const t3 = e5.nativeEvent.shiftKey;
3238
3271
  if (e5.which === vt) return e5.preventDefault(), void Z2();
3239
3272
  if (e5.which === It) return X2(true), void e5.preventDefault();
3240
- if (e5.which === yt && (e5.preventDefault(), G2() && x2?.(t3 ? S : E)), e5.which === xt) return e5.preventDefault(), void (G2() && x2?.(t3 ? _ : I));
3273
+ if (e5.which === yt && (e5.preventDefault(), G2() && x2?.(t3 ? S : _)), e5.which === xt) return e5.preventDefault(), void (G2() && x2?.(t3 ? E : I));
3241
3274
  if (!k2.editMode) {
3242
3275
  let t4 = null;
3243
3276
  switch (e5.which) {
3244
3277
  case bt:
3245
- t4 = _;
3278
+ t4 = E;
3246
3279
  break;
3247
- case Et:
3280
+ case _t:
3248
3281
  t4 = I;
3249
3282
  break;
3250
3283
  case St:
3251
3284
  t4 = S;
3252
3285
  break;
3253
- case _t:
3254
- t4 = E;
3286
+ case Et:
3287
+ t4 = _;
3255
3288
  }
3256
3289
  if (t4) return void G2();
3257
3290
  }
@@ -3259,7 +3292,7 @@ const jo = (e5 = void 0) => Object.freeze({ clean: e5, dirty: void 0, editMode:
3259
3292
  s(() => {
3260
3293
  ee2(false);
3261
3294
  }, []);
3262
- const te2 = qt(n2, () => ({ startEdit(e5) {
3295
+ const te2 = Kt(n2, () => ({ startEdit(e5) {
3263
3296
  let t3 = e5?.initialSelection;
3264
3297
  if (!t3) {
3265
3298
  const e6 = M2.current.value.length ?? 0;
@@ -3280,32 +3313,32 @@ const jo = (e5 = void 0) => Object.freeze({ clean: e5, dirty: void 0, editMode:
3280
3313
  }, onMouseDown: (e5) => {
3281
3314
  X2(true);
3282
3315
  }, onKeyDown: J2 }) });
3283
- })), Ho = r((t2) => {
3316
+ })), Wo = r((t2) => {
3284
3317
  const { value: n2, view: o2, bounds: r2, range: i2, zoom: l2, children: s2, style: c2, ...a2 } = t2;
3285
3318
  return e("div", { style: { padding: "2px 4px", fontFamily: "Calibri", letterSpacing: -0.25, lineHeight: 1.2, fontSize: c2?.fontSize || 1056 / 72, ...c2 }, ...a2, children: n2 });
3286
3319
  });
3287
3320
  export {
3288
- ko as BaseGrid,
3289
- Wo as DefaultCellEditor,
3290
- Ho as DefaultCellRenderer,
3291
- Ao as DefaultHeaderDivider,
3292
- uo as FillHandle,
3293
- Ro as Grid,
3294
- Bo as HeaderDivider,
3295
- Lo as HeaderRenderer,
3296
- Co as RESET_SCROLL_EVENTS_DEBOUNCE_INTERVAL,
3297
- fo as SELECTION_CLIP_INSETS,
3298
- $n as STANDARD_KEY_CHARS,
3299
- lo as SVGLine,
3300
- so as SVGRect,
3301
- Po as ScrollableGrid,
3302
- ao as Selection,
3303
- ho as TouchSelectHandle,
3304
- co as defaultSelectionRenderer,
3305
- jo as getDefaultStringEditState,
3306
- mo as safeSelectionCoords,
3307
- An as useCellLayout,
3308
- Nn as useHeaderSelection,
3309
- Hn as useKeyboardEditorOverlay,
3310
- vo as useSelection
3321
+ To as BaseGrid,
3322
+ Vo as DefaultCellEditor,
3323
+ Wo as DefaultCellRenderer,
3324
+ zo as DefaultHeaderDivider,
3325
+ ao as FillHandle,
3326
+ ko as Grid,
3327
+ $o as HeaderDivider,
3328
+ Oo as HeaderRenderer,
3329
+ Io as RESET_SCROLL_EVENTS_DEBOUNCE_INTERVAL,
3330
+ ho as SELECTION_CLIP_INSETS,
3331
+ An as STANDARD_KEY_CHARS,
3332
+ io as SVGLine,
3333
+ lo as SVGRect,
3334
+ Ro as ScrollableGrid,
3335
+ co as Selection,
3336
+ uo as TouchSelectHandle,
3337
+ so as defaultSelectionRenderer,
3338
+ Fo as getDefaultStringEditState,
3339
+ wo as safeSelectionCoords,
3340
+ zn as useCellLayout,
3341
+ Hn as useHeaderSelection,
3342
+ Wn as useKeyboardEditorOverlay,
3343
+ yo as useSelection
3311
3344
  };