@sheetxl/utils-react 0.7.6 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/browser/cjs/{B9stfyU9EqTwUsA3.cjs → Do5J-zhfZVIT3kKP.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{CxY-6HIFmPob67ga.mjs → B27ko2fZev5DB4Gu.mjs} +1 -1
- package/browser/esm/index.mjs +1012 -962
- package/node/esm/{iqYVEUkNtlVZ_Hro.mjs → evajGyufL7MJX0Wg.mjs} +1 -1
- package/node/esm/index.mjs +1092 -1041
- package/package.json +2 -2
- package/types/index.d.ts +13 -0
package/node/esm/index.mjs
CHANGED
|
@@ -1,997 +1,671 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.8
|
|
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.
|
|
6
6
|
*/
|
|
7
|
-
import { jsx as
|
|
8
|
-
import o, { useCallback as i, useRef as r, memo as s, forwardRef as l, useState as a, useEffect as c, useMemo as h, useImperativeHandle as u,
|
|
9
|
-
import
|
|
10
|
-
import { useMeasure as
|
|
11
|
-
import { CommonUtils as
|
|
12
|
-
import * as
|
|
13
|
-
import { mergeRefs as
|
|
7
|
+
import { jsx as e, jsxs as t, Fragment as n } from "react/jsx-runtime";
|
|
8
|
+
import o, { useCallback as i, useRef as r, memo as s, forwardRef as l, useState as a, useEffect as c, useMemo as h, useImperativeHandle as u, createContext as d, useContext as p, useLayoutEffect as f, createElement as _, useReducer as m, Component as g } from "react";
|
|
9
|
+
import y from "clsx";
|
|
10
|
+
import { useMeasure as v } from "react-use";
|
|
11
|
+
import { CommonUtils as x, DefaultNotifier as w, Notifier as b, InternalClipboard as S, ClipboardUtils as L, MimeType as E } from "@sheetxl/utils";
|
|
12
|
+
import * as C from "detect-it";
|
|
13
|
+
import { mergeRefs as M } from "react-merge-refs";
|
|
14
14
|
import { createRoot as T } from "react-dom/client";
|
|
15
|
-
import { unstable_batchedUpdates as
|
|
16
|
-
const
|
|
17
|
-
const n2 = i((...
|
|
15
|
+
import { unstable_batchedUpdates as k } from "react-dom";
|
|
16
|
+
const D = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, P = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, A = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219 }, z = { Left: 1, Middle: 2, Right: 3 }, B = { Horizontal: "horizontal", Vertical: "vertical" }, $ = (e2, t2) => {
|
|
17
|
+
const n2 = i((...t3) => e2?.(...t3), t2), o2 = r(null);
|
|
18
18
|
o2.current = n2;
|
|
19
|
-
const s2 = i((...
|
|
19
|
+
const s2 = i((...e3) => o2.current?.(...e3), []);
|
|
20
20
|
if (o2.current) return s2;
|
|
21
|
-
},
|
|
22
|
-
const { style: n2, orientation: o2 =
|
|
23
|
-
return
|
|
24
|
-
},
|
|
25
|
-
const { style: n2, orientation: o2 =
|
|
26
|
-
return
|
|
27
|
-
},
|
|
28
|
-
const { style: n2, orientation: o2 =
|
|
29
|
-
return
|
|
30
|
-
},
|
|
21
|
+
}, O = (t2) => {
|
|
22
|
+
const { style: n2, orientation: o2 = B.Vertical, ...i2 } = t2, r2 = o2 === B.Vertical;
|
|
23
|
+
return e("div", { style: { paddingBottom: "0px", paddingRight: "0px", paddingLeft: r2 ? "0px" : "3px", paddingTop: r2 ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, ...i2, children: e("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} single-button start`, children: e("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: e("path", { d: r2 ? "m 3.7274761,0.68060577 1.11969,1.93863003 1.12075,1.93912 c 0.0895,0.155 0.12152,0.33658 0.0904,0.51283 -0.0311,0.17625 -0.12336,0.33591 -0.26054,0.45091 -0.13715,0.11495 -0.31044,0.17793 -0.4894,0.17781 H 0.83095614 c -0.20186,0 -0.39542,-0.0802 -0.53814,-0.2229 -0.14272,-0.14272 -0.22291,-0.33629 -0.22291,-0.53814 -3e-4,-0.13308 0.0347,-0.26385 0.10147,-0.379 l 1.11872996,-1.94066 1.11921,-1.93864003 c 0.13594,-0.23541 0.38717,-0.38047 0.65905,-0.38047 0.27188,0 0.52311,0.14506 0.65905,0.38047 z" : "m 0.75051,2.3424298 1.93863,-1.11969 1.93912,-1.12075 c 0.155,-0.0895 0.33658,-0.12152 0.51283,-0.0904 0.17625,0.0311 0.33591,0.12336 0.45091,0.26054 0.11495,0.13715 0.17793,0.31044 0.17781,0.4894 v 4.47742 c 0,0.20186 -0.0802,0.39542 -0.2229,0.53814 -0.14272,0.14272 -0.33629,0.22291 -0.53814,0.22291 -0.13308,3e-4 -0.26385,-0.0347 -0.379,-0.10147 L 2.68911,4.7797998 0.75047,3.6605898 C 0.51506,3.5246498 0.37,3.2734198 0.37,3.0015398 c 0,-0.27188 0.14506,-0.52311 0.38047,-0.65905 z" }) }) }) });
|
|
24
|
+
}, K = (t2) => {
|
|
25
|
+
const { style: n2, orientation: o2 = B.Vertical, ...i2 } = t2, r2 = o2 === B.Vertical;
|
|
26
|
+
return e("div", { style: { paddingLeft: "0px", paddingTop: "0px", paddingRight: r2 ? "0px" : "3px", paddingBottom: r2 ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, ...i2, children: e("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} single-button end`, children: e("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: e("path", { d: r2 ? "M 2.412334,5.319396 1.292644,3.3807659 0.17189405,1.4416459 c -0.0895,-0.155 -0.12152,-0.33658 -0.0904,-0.51282998 0.0311,-0.17625 0.12336,-0.33591 0.26054,-0.45091 0.13715,-0.11495 0.31044,-0.17793 0.4894,-0.17781 H 5.308854 c 0.20186,0 0.39542,0.0802 0.53814,0.2229 0.14272,0.14272 0.22291,0.33629 0.22291,0.53813998 3e-4,0.13308 -0.0347,0.26385 -0.10147,0.379 l -1.11873,1.94066 -1.11921,1.9386401 c -0.13594,0.23541 -0.38717,0.38047 -0.65905,0.38047 -0.27188,0 -0.52311,-0.14506 -0.65905,-0.38047 z" : "m 5.3893002,3.6575719 -1.9386301,1.11969 -1.93912,1.12075 c -0.155,0.0895 -0.33658,0.12152 -0.51282997,0.0904 -0.17625,-0.0311 -0.33591,-0.12336 -0.45091,-0.26054 -0.11495,-0.13715 -0.17793,-0.31044 -0.17781,-0.4894 V 0.76105195 c 0,-0.20186 0.0802,-0.39542 0.2229,-0.53814 C 0.73562013,0.08019195 0.92919013,1.9467784e-6 1.1310401,1.9467784e-6 1.2641201,-2.9805322e-4 1.3948901,0.03470195 1.5100401,0.10147195 l 1.94066,1.11872995 1.9386401,1.11921 c 0.23541,0.13594 0.38047,0.38717 0.38047,0.65905 0,0.27188 -0.14506,0.52311 -0.38047,0.65905 z" }) }) }) });
|
|
27
|
+
}, H = (t2) => {
|
|
28
|
+
const { style: n2, orientation: o2 = B.Vertical, ...i2 } = t2, r2 = o2 === B.Vertical;
|
|
29
|
+
return e("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...n2 }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} edge`, ...i2, children: e("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: r2 ? "rotate(90) " : "", children: e("path", { style: { transition: "opacity 240ms ease 0s", opacity: t2.disabled ? 0 : 1 }, d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }) }) });
|
|
30
|
+
}, R = (e2, t2, n2, o2, i2 = 0) => {
|
|
31
31
|
for (let i3 = 0; i3 < n2.length; i3++) {
|
|
32
32
|
const r2 = n2[i3].getBoundingClientRect();
|
|
33
|
-
let s2 = r2.left -
|
|
33
|
+
let s2 = r2.left - t2, l2 = s2 + r2.width;
|
|
34
34
|
if (o2) {
|
|
35
|
-
if (s2 <
|
|
36
|
-
} else if (Math.ceil(l2) > Math.ceil(
|
|
35
|
+
if (s2 < e2 && l2 >= e2) return s2;
|
|
36
|
+
} else if (Math.ceil(l2) > Math.ceil(e2) + 2) return l2;
|
|
37
37
|
}
|
|
38
38
|
return i2;
|
|
39
|
-
},
|
|
40
|
-
const { offset: s2 = 0, totalSize: l2 = 0, viewportSize: u2 = 0, style: d2, className: p2, orientation: f2 =
|
|
39
|
+
}, V = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: R }, Symbol.toStringTag, { value: "Module" })), N = "_sheetxl-scrollbar_eblx4_6", W = s(l((n2, o2) => {
|
|
40
|
+
const { offset: s2 = 0, totalSize: l2 = 0, viewportSize: u2 = 0, style: d2, className: p2, orientation: f2 = B.Vertical, onScrollOffset: _2, onScroll: m2, showCustomScrollButtons: g2 = false, scrollButtonIncrement: x2 = 200, scrollButtonInitialRepeatDelay: w2 = 260, scrollButtonAdditionalRepeatDelay: b2 = 120, createScrollStartButton: S2 = O, createScrollEndButton: L2 = K, ...E2 } = n2, C2 = $(m2, [m2]), M2 = r(null), [T2, { width: k2, height: D2 }] = v(), [P2, { width: A2, height: z2 }] = v(), H2 = f2 === B.Vertical, V2 = H2 ? "top" : "left", W2 = H2 ? "scrollTop" : "scrollLeft", I2 = H2 ? D2 : k2, j2 = H2 ? z2 : A2, [F2, Y2] = a(null);
|
|
41
41
|
c(() => {
|
|
42
|
-
null !== F2 &&
|
|
43
|
-
}, [F2,
|
|
44
|
-
const X2 = i((
|
|
45
|
-
if (!
|
|
46
|
-
const n3 =
|
|
42
|
+
null !== F2 && M2.current && M2.current.scrollTo({ behavior: "smooth", [V2]: F2 });
|
|
43
|
+
}, [F2, H2]);
|
|
44
|
+
const X2 = i((e2, t2 = false) => {
|
|
45
|
+
if (!M2.current) return 0;
|
|
46
|
+
const n3 = M2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = t2 ? 0 : R(e2, o3[V2], i2, true, Math.max(0, e2 - x2));
|
|
47
47
|
return Y2(r2), Math.max(0, r2);
|
|
48
|
-
}, []), U2 = i((
|
|
49
|
-
if (!
|
|
50
|
-
const n3 =
|
|
48
|
+
}, []), U2 = i((e2, t2 = false) => {
|
|
49
|
+
if (!M2.current) return 0;
|
|
50
|
+
const n3 = M2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = Math.ceil(j2 - I2), s3 = t2 ? r2 : R(e2, o3[V2], i2, false, Math.max(0, e2 + x2));
|
|
51
51
|
return Y2(s3), Math.min(r2, s3);
|
|
52
|
-
}, [j2,
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
_2(
|
|
52
|
+
}, [j2, I2]), G2 = r(null), Z2 = i((e2) => {
|
|
53
|
+
if (null !== G2.current) return void (G2.current = null);
|
|
54
|
+
const t2 = e2.target[W2];
|
|
55
|
+
_2(t2, u2, l2), C2?.(e2);
|
|
56
56
|
}, [_2, u2, l2, s2]);
|
|
57
57
|
c(() => {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
const e2 = G2.current;
|
|
59
|
+
if (s2 === e2) return;
|
|
60
|
+
M2.current[W2] !== s2 && (G2.current = s2, M2.current[W2] = s2);
|
|
61
|
+
}, [s2, W2]);
|
|
62
|
+
const q2 = r(null), J2 = r(null), Q2 = i(() => {
|
|
63
|
+
q2.current && (clearTimeout(q2.current), q2.current = null, J2.current = null);
|
|
64
|
+
}, []), ee2 = i((e2, t2, n3, o3 = w2) => {
|
|
65
|
+
J2.current = e2, q2.current = setTimeout(() => {
|
|
66
|
+
const t3 = n3 ? X2(J2.current || e2) : U2(J2.current || e2);
|
|
67
|
+
t3 !== J2.current ? ee2(t3, false, n3, b2) : Q2();
|
|
68
|
+
}, t2 ? 0 : o3);
|
|
68
69
|
}, [X2, U2, Q2]);
|
|
69
70
|
c(() => () => Q2(), [Q2]);
|
|
70
|
-
const
|
|
71
|
-
if (!
|
|
72
|
-
const
|
|
73
|
-
return S2?.(
|
|
74
|
-
}, [
|
|
75
|
-
if (!
|
|
76
|
-
const
|
|
77
|
-
return L2?.(
|
|
78
|
-
}, [
|
|
79
|
-
return
|
|
71
|
+
const te2 = h(() => {
|
|
72
|
+
if (!g2) return null;
|
|
73
|
+
const e2 = { orientation: f2, disabled: Math.floor(s2) <= 0 || 0 === Math.floor(j2 - I2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => ee2(s2, true, true) };
|
|
74
|
+
return S2?.(e2);
|
|
75
|
+
}, [g2, f2, s2, F2, j2, I2]), ne2 = h(() => {
|
|
76
|
+
if (!g2) return null;
|
|
77
|
+
const e2 = { orientation: f2, disabled: Math.floor(j2 - I2) <= Math.ceil(s2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => ee2(s2, true, false) };
|
|
78
|
+
return L2?.(e2);
|
|
79
|
+
}, [g2, f2, s2, F2, j2, I2]);
|
|
80
|
+
return t("div", { ref: o2, style: { display: "flex", flex: "1", flexDirection: H2 ? "column" : "row", padding: "0", ...d2 }, className: y(N, p2), ...E2, children: [te2, e("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: H2 ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: T2, children: e("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: H2 ? "scroll" : "hidden", overflowX: H2 ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: Z2, ref: M2, children: e("div", { ref: P2, style: { position: "absolute", height: H2 ? l2 - u2 + (D2 ?? 0) : 1, width: H2 ? 1 : l2 - u2 + (k2 ?? 0) }, className: "scrollbar-viewport" }) }) }), ne2] });
|
|
80
81
|
}));
|
|
81
82
|
W.displayName = "Scrollbar";
|
|
82
|
-
let I = Date.now,
|
|
83
|
-
const
|
|
84
|
-
let
|
|
85
|
-
return
|
|
86
|
-
},
|
|
87
|
-
let r2 = I(), s2 = r2, l2 = 0, a2 = 0, c2 = 0, h2 =
|
|
83
|
+
let I = Date.now, j = 1e3, F = {}, Y = 1;
|
|
84
|
+
const X = (e2) => {
|
|
85
|
+
let t2 = null !== F[e2];
|
|
86
|
+
return t2 && (F[e2] = null), t2;
|
|
87
|
+
}, U = (e2, t2, n2, o2 = 0, i2) => {
|
|
88
|
+
let r2 = I(), s2 = r2, l2 = 0, a2 = 0, c2 = 0, h2 = Y++;
|
|
88
89
|
if (h2 % 20 == 0) {
|
|
89
|
-
const
|
|
90
|
-
for (let
|
|
91
|
-
|
|
90
|
+
const e3 = {};
|
|
91
|
+
for (let t3 in F) e3[t3] = true;
|
|
92
|
+
F = e3;
|
|
92
93
|
}
|
|
93
94
|
const u2 = function(d2) {
|
|
94
95
|
let p2 = true !== d2, f2 = I(), _2 = true;
|
|
95
96
|
try {
|
|
96
|
-
_2 = (!
|
|
97
|
-
} catch (
|
|
97
|
+
_2 = (!t2 || t2(h2)) ?? true;
|
|
98
|
+
} catch (e3) {
|
|
98
99
|
_2 = false;
|
|
99
100
|
}
|
|
100
|
-
if (!
|
|
101
|
+
if (!F[h2] || !_2) return F[h2] = null, void n2?.(60 - a2 / ((f2 - r2) / j), h2, false);
|
|
101
102
|
if (p2) {
|
|
102
103
|
c2 = Math.round((f2 - s2) / 16.666666666666668) - 1;
|
|
103
|
-
for (let
|
|
104
|
+
for (let e3 = 0; e3 < Math.min(c2, 4); e3++) u2(true), a2++;
|
|
104
105
|
}
|
|
105
106
|
o2 && (l2 = (f2 - r2) / o2, l2 > 1 && (l2 = 1));
|
|
106
107
|
let m2 = i2 ? i2(l2) : l2, g2 = false;
|
|
107
108
|
try {
|
|
108
|
-
g2 =
|
|
109
|
-
} catch (
|
|
109
|
+
g2 = e2(m2, f2, p2);
|
|
110
|
+
} catch (e3) {
|
|
110
111
|
g2 = false;
|
|
111
112
|
}
|
|
112
|
-
false !== g2 && 1 !== l2 || !p2 ? p2 && (s2 = f2, requestAnimationFrame(u2)) : (
|
|
113
|
+
false !== g2 && 1 !== l2 || !p2 ? p2 && (s2 = f2, requestAnimationFrame(u2)) : (F[h2] = null, n2?.(60 - a2 / ((f2 - r2) / j), h2, 1 === l2 || null == o2));
|
|
113
114
|
};
|
|
114
|
-
return
|
|
115
|
-
},
|
|
116
|
-
return Math.pow(
|
|
117
|
-
}, Z = function(
|
|
118
|
-
return (
|
|
115
|
+
return F[h2] = true, requestAnimationFrame(u2), h2;
|
|
116
|
+
}, G = function(e2) {
|
|
117
|
+
return Math.pow(e2 - 1, 3) + 1;
|
|
118
|
+
}, Z = function(e2) {
|
|
119
|
+
return (e2 /= 0.5) < 1 ? 0.5 * Math.pow(e2, 3) : 0.5 * (Math.pow(e2 - 2, 3) + 2);
|
|
119
120
|
};
|
|
120
121
|
class q {
|
|
121
|
-
constructor(
|
|
122
|
-
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 =
|
|
122
|
+
constructor(e2, t2) {
|
|
123
|
+
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 = e2, 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 };
|
|
123
124
|
}
|
|
124
|
-
setDimensions(
|
|
125
|
-
null !==
|
|
125
|
+
setDimensions(e2, t2, n2, o2) {
|
|
126
|
+
null !== e2 && (this.__clientWidth = e2), null !== t2 && (this.__clientHeight = t2), null !== n2 && (this.__contentWidth = n2), null !== o2 && (this.__contentHeight = o2), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true);
|
|
126
127
|
}
|
|
127
|
-
setPosition(
|
|
128
|
-
this.__clientLeft =
|
|
128
|
+
setPosition(e2, t2) {
|
|
129
|
+
this.__clientLeft = e2 || 0, this.__clientTop = t2 || 0;
|
|
129
130
|
}
|
|
130
|
-
setSnapSize(
|
|
131
|
-
this.__snapWidth =
|
|
131
|
+
setSnapSize(e2, t2) {
|
|
132
|
+
this.__snapWidth = e2, this.__snapHeight = t2;
|
|
132
133
|
}
|
|
133
134
|
getValues() {
|
|
134
135
|
return { left: this.__scrollLeft, top: this.__scrollTop, right: this.__scrollLeft + this.__clientWidth / this.__zoomLevel, bottom: this.__scrollTop + this.__clientHeight / this.__zoomLevel, zoom: this.__zoomLevel };
|
|
135
136
|
}
|
|
136
|
-
getPoint(
|
|
137
|
+
getPoint(e2, t2) {
|
|
137
138
|
const n2 = this.getValues();
|
|
138
|
-
return { left:
|
|
139
|
+
return { left: e2 / n2.zoom, top: t2 / n2.zoom };
|
|
139
140
|
}
|
|
140
141
|
getScrollMax() {
|
|
141
142
|
return { left: this.__maxScrollLeft, top: this.__maxScrollTop };
|
|
142
143
|
}
|
|
143
|
-
zoomTo(
|
|
144
|
+
zoomTo(e2, t2 = false, n2, o2, i2) {
|
|
144
145
|
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
145
|
-
i2 && (this.__zoomComplete = i2), this.__isDecelerating && (
|
|
146
|
+
i2 && (this.__zoomComplete = i2), this.__isDecelerating && (X(this.__isDecelerating), this.__isDecelerating = 0);
|
|
146
147
|
const r2 = this.__zoomLevel;
|
|
147
|
-
void 0 === n2 && (n2 = this.__clientWidth / 2), void 0 === o2 && (o2 = this.__clientHeight / 2),
|
|
148
|
-
const s2 =
|
|
148
|
+
void 0 === n2 && (n2 = this.__clientWidth / 2), void 0 === o2 && (o2 = this.__clientHeight / 2), e2 = Math.max(Math.min(e2, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(e2);
|
|
149
|
+
const s2 = e2 / r2;
|
|
149
150
|
let l2 = s2 * (this.__scrollLeft + n2) - n2, a2 = s2 * (this.__scrollTop + o2) - o2;
|
|
150
|
-
l2 > this.__maxScrollLeft ? l2 = this.__maxScrollLeft : l2 < 0 && (l2 = 0), a2 > this.__maxScrollTop ? a2 = this.__maxScrollTop : a2 < 0 && (a2 = 0), this.__publish(l2, a2,
|
|
151
|
+
l2 > this.__maxScrollLeft ? l2 = this.__maxScrollLeft : l2 < 0 && (l2 = 0), a2 > this.__maxScrollTop ? a2 = this.__maxScrollTop : a2 < 0 && (a2 = 0), this.__publish(l2, a2, e2, t2);
|
|
151
152
|
}
|
|
152
|
-
zoomBy(
|
|
153
|
-
this.zoomTo(this.__zoomLevel *
|
|
153
|
+
zoomBy(e2, t2 = false, n2 = 0, o2 = 0, i2) {
|
|
154
|
+
this.zoomTo(this.__zoomLevel * e2, t2, n2, o2, i2);
|
|
154
155
|
}
|
|
155
|
-
scrollTo(
|
|
156
|
-
if (this.__isDecelerating && (
|
|
156
|
+
scrollTo(e2, t2, n2 = false, o2 = 1) {
|
|
157
|
+
if (this.__isDecelerating && (X(this.__isDecelerating), this.__isDecelerating = 0), void 0 !== o2 && o2 !== this.__zoomLevel) {
|
|
157
158
|
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
158
|
-
|
|
159
|
+
e2 *= o2, t2 *= o2, this.__computeScrollMax(o2);
|
|
159
160
|
} else o2 = this.__zoomLevel;
|
|
160
|
-
this.options.scrollingX ? this.options.paging ?
|
|
161
|
+
this.options.scrollingX ? this.options.paging ? e2 = Math.round(e2 / this.__clientWidth) * this.__clientWidth : this.options.snapping && (e2 = Math.round(e2 / this.__snapWidth) * this.__snapWidth) : e2 = 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, e2 = Math.max(Math.min(this.__maxScrollLeft, e2), 0), t2 = Math.max(Math.min(this.__maxScrollTop, t2), 0), e2 === this.__scrollLeft && t2 === this.__scrollTop && (n2 = false), this.__publish(e2, t2, o2, n2);
|
|
161
162
|
}
|
|
162
|
-
scrollBy(
|
|
163
|
+
scrollBy(e2 = 0, t2 = 0, n2 = false) {
|
|
163
164
|
const o2 = this.__isAnimating ? this.__scheduledLeft : this.__scrollLeft, i2 = this.__isAnimating ? this.__scheduledTop : this.__scrollTop;
|
|
164
|
-
this.scrollTo(o2 + (
|
|
165
|
+
this.scrollTo(o2 + (e2 || 0), i2 + (t2 || 0), n2);
|
|
165
166
|
}
|
|
166
|
-
doMouseZoom(
|
|
167
|
-
const i2 =
|
|
167
|
+
doMouseZoom(e2, t2, n2, o2) {
|
|
168
|
+
const i2 = e2 > 0 ? 0.97 : 1.03;
|
|
168
169
|
return this.zoomTo(this.__zoomLevel * i2, false, n2 - this.__clientLeft, o2 - this.__clientTop);
|
|
169
170
|
}
|
|
170
|
-
doTouchStart(
|
|
171
|
-
if (void 0 ===
|
|
172
|
-
if (
|
|
171
|
+
doTouchStart(e2, t2) {
|
|
172
|
+
if (void 0 === e2.length) throw new Error("Invalid touch list: " + e2);
|
|
173
|
+
if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
|
|
173
174
|
let n2, o2;
|
|
174
|
-
this.__interruptedAnimation = true, this.__isDecelerating && (
|
|
175
|
-
let i2 = 1 ===
|
|
176
|
-
i2 ? (n2 =
|
|
175
|
+
this.__interruptedAnimation = true, this.__isDecelerating && (X(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = true), this.__isAnimating && (X(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = true);
|
|
176
|
+
let i2 = 1 === e2.length;
|
|
177
|
+
i2 ? (n2 = e2[0].pageX, o2 = e2[0].pageY) : (n2 = Math.abs(e2[0].pageX + e2[1].pageX) / 2, o2 = Math.abs(e2[0].pageY + e2[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 = !i2 && this.options.scrollingX, this.__enableScrollY = !i2 && this.options.scrollingY, this.__isTracking = true, this.__didDecelerationComplete = false, this.__isDragging = !i2, this.__isSingleTouch = i2, this.__positions = [];
|
|
177
178
|
}
|
|
178
|
-
doTouchMove(
|
|
179
|
-
if (void 0 ===
|
|
180
|
-
if (
|
|
179
|
+
doTouchMove(e2, t2, n2 = 1) {
|
|
180
|
+
if (void 0 === e2.length) throw new Error("Invalid touch list: " + e2);
|
|
181
|
+
if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
|
|
181
182
|
if (!this.__isTracking) return;
|
|
182
183
|
let o2, i2;
|
|
183
|
-
2 ===
|
|
184
|
+
2 === e2.length ? (o2 = Math.abs(e2[0].pageX + e2[1].pageX) / 2, i2 = Math.abs(e2[0].pageY + e2[1].pageY) / 2) : (o2 = e2[0].pageX, i2 = e2[0].pageY);
|
|
184
185
|
let r2 = this.__positions;
|
|
185
186
|
if (this.__isDragging) {
|
|
186
|
-
let
|
|
187
|
+
let e3 = o2 - this.__lastTouchLeft, s2 = i2 - this.__lastTouchTop, l2 = this.__scrollLeft, a2 = this.__scrollTop, c2 = this.__zoomLevel;
|
|
187
188
|
if (void 0 !== n2 && this.options.zooming) {
|
|
188
|
-
let
|
|
189
|
-
if (c2 = c2 / this.__lastScale * n2, c2 = Math.max(Math.min(c2, this.options.maxZoom), this.options.minZoom),
|
|
190
|
-
let
|
|
191
|
-
l2 = (
|
|
189
|
+
let e4 = c2;
|
|
190
|
+
if (c2 = c2 / this.__lastScale * n2, c2 = Math.max(Math.min(c2, this.options.maxZoom), this.options.minZoom), e4 !== c2) {
|
|
191
|
+
let t3 = o2 - this.__clientLeft, n3 = i2 - this.__clientTop;
|
|
192
|
+
l2 = (t3 + l2) * c2 / e4 - t3, a2 = (n3 + a2) * c2 / e4 - n3, this.__computeScrollMax(c2);
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
if (this.__enableScrollX) {
|
|
195
|
-
l2 -=
|
|
196
|
-
let
|
|
197
|
-
(l2 >
|
|
196
|
+
l2 -= e3 * this.options.speedMultiplier;
|
|
197
|
+
let t3 = this.__maxScrollLeft;
|
|
198
|
+
(l2 > t3 || l2 < 0) && (this.options.bouncing ? l2 += e3 / 2 * this.options.speedMultiplier : l2 = l2 > t3 ? t3 : 0);
|
|
198
199
|
}
|
|
199
200
|
if (this.__enableScrollY) {
|
|
200
201
|
a2 -= s2 * this.options.speedMultiplier;
|
|
201
|
-
const
|
|
202
|
-
(a2 >
|
|
202
|
+
const e4 = this.__maxScrollTop;
|
|
203
|
+
(a2 > e4 || a2 < 0) && (this.options.bouncing ? a2 += s2 / 2 * this.options.speedMultiplier : a2 = a2 > e4 ? e4 : 0);
|
|
203
204
|
}
|
|
204
|
-
r2.length > 60 && r2.splice(0, 30), r2.push(l2, a2,
|
|
205
|
+
r2.length > 60 && r2.splice(0, 30), r2.push(l2, a2, t2), this.__publish(l2, a2, c2);
|
|
205
206
|
} else {
|
|
206
|
-
let
|
|
207
|
-
this.__enableScrollX = this.options.scrollingX && s2 >=
|
|
207
|
+
let e3 = this.options.locking ? 3 : 0, n3 = 5, s2 = Math.abs(o2 - this.__initialTouchLeft), l2 = Math.abs(i2 - this.__initialTouchTop);
|
|
208
|
+
this.__enableScrollX = this.options.scrollingX && s2 >= e3, this.__enableScrollY = this.options.scrollingY && l2 >= e3, r2.push(this.__scrollLeft, this.__scrollTop, t2), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (s2 >= n3 || l2 >= n3), this.__isDragging && (this.__interruptedAnimation = false);
|
|
208
209
|
}
|
|
209
|
-
this.__lastTouchLeft = o2, this.__lastTouchTop = i2, this.__lastTouchMove =
|
|
210
|
+
this.__lastTouchLeft = o2, this.__lastTouchTop = i2, this.__lastTouchMove = t2, this.__lastScale = n2;
|
|
210
211
|
}
|
|
211
|
-
doTouchEnd(
|
|
212
|
-
if (
|
|
212
|
+
doTouchEnd(e2) {
|
|
213
|
+
if (e2 instanceof Date && (e2 = e2.valueOf()), "number" != typeof e2) throw new Error("Invalid timestamp value: " + e2);
|
|
213
214
|
if (this.__isTracking) {
|
|
214
|
-
if (this.__isTracking = false, this.__isDragging) if (this.__isDragging = false, this.__isSingleTouch && this.options.animating &&
|
|
215
|
-
let
|
|
216
|
-
for (let
|
|
215
|
+
if (this.__isTracking = false, this.__isDragging) if (this.__isDragging = false, this.__isSingleTouch && this.options.animating && e2 - this.__lastTouchMove <= 100) {
|
|
216
|
+
let t2 = this.__positions, n2 = t2.length - 1, o2 = n2;
|
|
217
|
+
for (let e3 = n2; e3 > 0 && t2[e3] > this.__lastTouchMove - 100; e3 -= 3) o2 = e3;
|
|
217
218
|
if (o2 !== n2) {
|
|
218
|
-
const i2 =
|
|
219
|
+
const i2 = t2[n2] - t2[o2], r2 = this.__scrollLeft - t2[o2 - 2], s2 = this.__scrollTop - t2[o2 - 1];
|
|
219
220
|
this.__decelerationVelocityX = r2 / i2 * (1e3 / 60), this.__decelerationVelocityY = s2 / i2 * (1e3 / 60);
|
|
220
221
|
const l2 = this.options.paging || this.options.snapping ? 4 : 1;
|
|
221
|
-
(Math.abs(this.__decelerationVelocityX) > l2 || Math.abs(this.__decelerationVelocityY) > l2) && this.__startDeceleration(
|
|
222
|
+
(Math.abs(this.__decelerationVelocityX) > l2 || Math.abs(this.__decelerationVelocityY) > l2) && this.__startDeceleration(e2);
|
|
222
223
|
} else this.options.scrollingComplete?.();
|
|
223
|
-
} else
|
|
224
|
+
} else e2 - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
|
|
224
225
|
this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true, this.__zoomLevel)), this.__positions.length = 0;
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
|
-
__publish(
|
|
228
|
+
__publish(e2, t2, n2, o2 = false) {
|
|
228
229
|
const i2 = this.__isAnimating;
|
|
229
|
-
if (i2 && (
|
|
230
|
-
this.__scheduledLeft =
|
|
231
|
-
const o3 = this.__scrollLeft, r2 = this.__scrollTop, s2 = this.__zoomLevel, l2 =
|
|
232
|
-
n3 && (this.__scrollLeft = o3 + l2 *
|
|
233
|
-
}.bind(this), u2 = function(
|
|
234
|
-
return this.__isAnimating ===
|
|
235
|
-
}.bind(this), d2 = function(
|
|
236
|
-
|
|
230
|
+
if (i2 && (X(i2), this.__isAnimating = 0), o2 && this.options.animating) {
|
|
231
|
+
this.__scheduledLeft = e2, this.__scheduledTop = t2, this.__scheduledZoom = n2;
|
|
232
|
+
const o3 = this.__scrollLeft, r2 = this.__scrollTop, s2 = this.__zoomLevel, l2 = e2 - o3, a2 = t2 - r2, c2 = n2 - s2, h2 = function(e3, t3, n3) {
|
|
233
|
+
n3 && (this.__scrollLeft = o3 + l2 * e3, this.__scrollTop = r2 + a2 * e3, this.__zoomLevel = s2 + c2 * e3, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
|
|
234
|
+
}.bind(this), u2 = function(e3) {
|
|
235
|
+
return this.__isAnimating === e3;
|
|
236
|
+
}.bind(this), d2 = function(e3, t3, n3) {
|
|
237
|
+
t3 === this.__isAnimating && (this.__isAnimating = false), (this.__didDecelerationComplete || n3) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
237
238
|
}.bind(this);
|
|
238
|
-
this.__isAnimating =
|
|
239
|
-
} else this.__scheduledLeft = this.__scrollLeft =
|
|
239
|
+
this.__isAnimating = U(h2, u2, d2, this.options.animationDuration, i2 ? G : Z);
|
|
240
|
+
} else this.__scheduledLeft = this.__scrollLeft = e2, this.__scheduledTop = this.__scrollTop = t2, this.__scheduledZoom = this.__zoomLevel = n2, this.__callback && this.__callback(e2, t2, n2), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
240
241
|
}
|
|
241
|
-
__computeScrollMax(
|
|
242
|
-
this.__maxScrollLeft = Math.max(this.__contentWidth *
|
|
242
|
+
__computeScrollMax(e2 = this.__zoomLevel) {
|
|
243
|
+
this.__maxScrollLeft = Math.max(this.__contentWidth * e2 - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * e2 - this.__clientHeight, 0);
|
|
243
244
|
}
|
|
244
|
-
__startDeceleration(
|
|
245
|
+
__startDeceleration(e2) {
|
|
245
246
|
if (this.options.paging) {
|
|
246
|
-
const
|
|
247
|
-
this.__minDecelerationScrollLeft = Math.floor(
|
|
247
|
+
const e3 = 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;
|
|
248
|
+
this.__minDecelerationScrollLeft = Math.floor(e3 / n3) * n3, this.__minDecelerationScrollTop = Math.floor(t3 / o3) * o3, this.__maxDecelerationScrollLeft = Math.ceil(e3 / n3) * n3, this.__maxDecelerationScrollTop = Math.ceil(t3 / o3) * o3;
|
|
248
249
|
} else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
|
|
249
|
-
const
|
|
250
|
+
const t2 = function(e3, t3, n3) {
|
|
250
251
|
this.__stepThroughDeceleration(n3);
|
|
251
252
|
}.bind(this), n2 = this.options.snapping ? 4 : 0.1, o2 = function() {
|
|
252
|
-
const
|
|
253
|
-
return
|
|
254
|
-
}.bind(this), i2 = function(
|
|
253
|
+
const e3 = Math.abs(this.__decelerationVelocityX) >= n2 || Math.abs(this.__decelerationVelocityY) >= n2;
|
|
254
|
+
return e3 || (this.__didDecelerationComplete = true), e3;
|
|
255
|
+
}.bind(this), i2 = function(e3, t3, n3) {
|
|
255
256
|
this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
|
|
256
257
|
}.bind(this);
|
|
257
|
-
this.__isDecelerating =
|
|
258
|
+
this.__isDecelerating = U(t2, o2, i2);
|
|
258
259
|
}
|
|
259
|
-
__stepThroughDeceleration(
|
|
260
|
-
let
|
|
260
|
+
__stepThroughDeceleration(e2) {
|
|
261
|
+
let t2 = this.__scrollLeft + this.__decelerationVelocityX, n2 = this.__scrollTop + this.__decelerationVelocityY;
|
|
261
262
|
if (!this.options.bouncing) {
|
|
262
|
-
const
|
|
263
|
-
|
|
263
|
+
const e3 = Math.max(Math.min(this.__maxDecelerationScrollLeft, t2), this.__minDecelerationScrollLeft);
|
|
264
|
+
e3 !== t2 && (t2 = e3, this.__decelerationVelocityX = 0);
|
|
264
265
|
const o2 = Math.max(Math.min(this.__maxDecelerationScrollTop, n2), this.__minDecelerationScrollTop);
|
|
265
266
|
o2 !== n2 && (n2 = o2, this.__decelerationVelocityY = 0);
|
|
266
267
|
}
|
|
267
|
-
if (
|
|
268
|
-
const
|
|
269
|
-
this.__decelerationVelocityX *=
|
|
268
|
+
if (e2 ? this.__publish(t2, n2, this.__zoomLevel) : (this.__scrollLeft = t2, this.__scrollTop = n2), !this.options.paging) {
|
|
269
|
+
const e3 = 0.95;
|
|
270
|
+
this.__decelerationVelocityX *= e3, this.__decelerationVelocityY *= e3;
|
|
270
271
|
}
|
|
271
272
|
if (this.options.bouncing) {
|
|
272
|
-
let
|
|
273
|
-
|
|
273
|
+
let e3 = 0, o2 = 0, i2 = this.options.penetrationDeceleration, r2 = this.options.penetrationAcceleration;
|
|
274
|
+
t2 < this.__minDecelerationScrollLeft ? e3 = this.__minDecelerationScrollLeft - t2 : t2 > this.__maxDecelerationScrollLeft && (e3 = this.__maxDecelerationScrollLeft - t2), n2 < this.__minDecelerationScrollTop ? o2 = this.__minDecelerationScrollTop - n2 : n2 > this.__maxDecelerationScrollTop && (o2 = this.__maxDecelerationScrollTop - n2), 0 !== e3 && (e3 * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += e3 * i2 : this.__decelerationVelocityX = e3 * r2), 0 !== o2 && (o2 * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += o2 * i2 : this.__decelerationVelocityY = o2 * r2);
|
|
274
275
|
}
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
|
-
const
|
|
278
|
-
function
|
|
279
|
-
return
|
|
278
|
+
const J = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), Q = {};
|
|
279
|
+
function ee() {
|
|
280
|
+
return C;
|
|
280
281
|
}
|
|
281
|
-
const
|
|
282
|
-
return
|
|
283
|
-
}, createSyntheticEvent: (
|
|
284
|
-
let
|
|
285
|
-
return { nativeEvent:
|
|
286
|
-
|
|
287
|
-
}, isDefaultPrevented: () =>
|
|
288
|
-
n2 = true,
|
|
282
|
+
const te = (e2) => "BracketLeft" === e2 ? "[" : "BracketRight" === e2 ? "]" : x.camelToPrettyCase(e2), ne = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: Q, boundPixel: function(e2, t2 = false, n2 = 0) {
|
|
283
|
+
return e2;
|
|
284
|
+
}, createSyntheticEvent: (e2) => {
|
|
285
|
+
let t2 = false, n2 = false;
|
|
286
|
+
return { nativeEvent: e2, currentTarget: e2.currentTarget, target: e2.target, bubbles: e2.bubbles, cancelable: e2.cancelable, defaultPrevented: e2.defaultPrevented, eventPhase: e2.eventPhase, isTrusted: e2.isTrusted, preventDefault: () => {
|
|
287
|
+
t2 = true, e2.preventDefault();
|
|
288
|
+
}, isDefaultPrevented: () => t2, stopPropagation: () => {
|
|
289
|
+
n2 = true, e2.stopPropagation();
|
|
289
290
|
}, isPropagationStopped: () => n2, persist: () => {
|
|
290
|
-
}, timeStamp:
|
|
291
|
-
}, detectIt:
|
|
292
|
-
function
|
|
291
|
+
}, timeStamp: e2.timeStamp, type: e2.type };
|
|
292
|
+
}, detectIt: ee, focusableNodeNames: J, toPrettyKeyCode: te }, Symbol.toStringTag, { value: "Module" })), oe = [];
|
|
293
|
+
function ie(e2, t2, n2 = oe) {
|
|
293
294
|
const o2 = r(null);
|
|
294
|
-
return u(
|
|
295
|
+
return u(e2, () => {
|
|
295
296
|
if (!o2.current) return;
|
|
296
|
-
const
|
|
297
|
+
const e3 = o2.current, n3 = t2?.();
|
|
297
298
|
if (!n3 || "object" != typeof n3) throw new Error("attributes must return a plain object of values");
|
|
298
299
|
const i2 = Object.keys(n3), r2 = i2.length;
|
|
299
|
-
for (let
|
|
300
|
-
const o3 = i2[
|
|
301
|
-
Object.defineProperty(
|
|
300
|
+
for (let t3 = 0; t3 < r2; t3++) {
|
|
301
|
+
const o3 = i2[t3], r3 = n3[o3];
|
|
302
|
+
Object.defineProperty(e3, o3, { value: r3, writable: true, configurable: true, enumerable: true });
|
|
302
303
|
}
|
|
303
|
-
return
|
|
304
|
+
return e3;
|
|
304
305
|
}, n2), o2;
|
|
305
306
|
}
|
|
306
|
-
const
|
|
307
|
-
const { children: l2, viewport: a2, onScrollViewport: u2, showHorizontalScrollbar: d2 = true, showVerticalScrollbar: p2 = true, createScrollCorner: f2 =
|
|
307
|
+
const re = (t2) => e(W, { ...t2 }), se = ({ width: t2, height: n2 }) => e("div", { className: "corner", style: { minWidth: `${t2}px`, width: `${t2}px`, minHeight: `${n2}px`, height: `${n2}px` } }), le = s(l((o2, s2) => {
|
|
308
|
+
const { children: l2, viewport: a2, onScrollViewport: u2, showHorizontalScrollbar: d2 = true, showVerticalScrollbar: p2 = true, createScrollCorner: f2 = se, createHorizontalScrollbar: _2 = re, createVerticalScrollbar: m2 = re, style: g2, touchElement: y2, disableTouch: x2, ...w2 } = o2, b2 = $(u2, [u2]), S2 = ie(s2, () => ({ isScrollPane: () => true }), []), L2 = r(null);
|
|
308
309
|
c(() => {
|
|
309
310
|
L2.current && (L2.current.__scrollTop === a2?.top && L2.current.__scrollLeft === a2?.left || L2.current.__isDecelerating || L2.current?.scrollTo(a2?.left, a2?.top, false));
|
|
310
|
-
}, [a2?.left, a2?.top,
|
|
311
|
-
const E2 = i((
|
|
312
|
-
b2?.({ left:
|
|
313
|
-
}, []), C2 = i((
|
|
314
|
-
L2.current?.doTouchStart(
|
|
315
|
-
}, []),
|
|
316
|
-
|
|
317
|
-
}, []),
|
|
318
|
-
L2.current?.doTouchEnd(
|
|
319
|
-
}, []), k2 = i(({ containerWidth:
|
|
320
|
-
L2.current.setDimensions(
|
|
311
|
+
}, [a2?.left, a2?.top, y2]);
|
|
312
|
+
const E2 = i((e2, t2) => {
|
|
313
|
+
b2?.({ left: e2, top: t2 });
|
|
314
|
+
}, []), C2 = i((e2) => {
|
|
315
|
+
L2.current?.doTouchStart(e2.touches, e2.timeStamp);
|
|
316
|
+
}, []), M2 = i((e2) => {
|
|
317
|
+
e2.preventDefault(), L2.current?.doTouchMove(e2.touches, e2.timeStamp);
|
|
318
|
+
}, []), T2 = i((e2) => {
|
|
319
|
+
L2.current?.doTouchEnd(e2.timeStamp);
|
|
320
|
+
}, []), k2 = i(({ containerWidth: e2, containerHeight: t2, totalWidth: n2, totalHeight: o3 }) => {
|
|
321
|
+
L2.current.setDimensions(e2, t2, n2, o3);
|
|
321
322
|
}, []);
|
|
322
323
|
c(() => {
|
|
323
|
-
const
|
|
324
|
-
if (!x2 &&
|
|
324
|
+
const e2 = y2 ?? S2.current;
|
|
325
|
+
if (!x2 && ee().supportsTouchEvents && e2 && a2) {
|
|
325
326
|
if (!L2.current) {
|
|
326
|
-
const
|
|
327
|
-
L2.current = new q(E2,
|
|
327
|
+
const e3 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
|
|
328
|
+
L2.current = new q(E2, e3);
|
|
328
329
|
}
|
|
329
|
-
|
|
330
|
+
ee().supportsTouchEvents && (e2.addEventListener("touchstart", C2), e2.addEventListener("touchend", T2), e2.addEventListener("touchmove", M2)), k2({ containerWidth: a2?.width, containerHeight: a2?.height, totalWidth: a2?.totalWidth, totalHeight: a2?.totalHeight });
|
|
330
331
|
}
|
|
331
332
|
return () => {
|
|
332
|
-
|
|
333
|
+
e2?.removeEventListener("touchstart", C2), e2?.removeEventListener("touchend", T2), e2?.removeEventListener("touchmove", M2);
|
|
333
334
|
};
|
|
334
|
-
}, [a2?.width, a2?.height, a2?.totalWidth, a2?.totalHeight, x2,
|
|
335
|
-
const [D2, { width: P2 }] =
|
|
336
|
-
const
|
|
337
|
-
b2?.({ top:
|
|
335
|
+
}, [a2?.width, a2?.height, a2?.totalWidth, a2?.totalHeight, x2, y2]);
|
|
336
|
+
const [D2, { width: P2 }] = v(), [A2, { height: z2 }] = v(), O2 = h(() => {
|
|
337
|
+
const t2 = m2({ orientation: B.Vertical, offset: a2?.top, viewportSize: a2?.height, totalSize: a2?.totalHeight, onScrollOffset: (e2) => {
|
|
338
|
+
b2?.({ top: e2 });
|
|
338
339
|
} });
|
|
339
|
-
return
|
|
340
|
+
return e("div", { style: { display: "flex", flex: "0" }, ref: D2, children: t2 });
|
|
340
341
|
}, [m2, a2?.top, a2?.height, a2?.totalHeight]), K2 = h(() => {
|
|
341
|
-
const o3 = _2({ orientation:
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
342
|
+
const o3 = _2({ orientation: B.Horizontal, offset: a2?.left, viewportSize: a2?.width, totalSize: a2?.totalWidth, onScrollOffset: (e2) => {
|
|
343
|
+
b2?.({ left: e2 });
|
|
344
|
+
} });
|
|
345
|
+
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: A2, className: "sizer", children: o3 }) }), p2 ? f2({ width: P2, height: z2 }) : e(n, {})] });
|
|
346
|
+
}, [_2, a2?.left, a2?.width, a2?.totalWidth, p2, f2, P2, z2]);
|
|
347
|
+
return e("div", { style: { position: "relative", display: "flex", minWidth: p2 ? `${P2}px` : void 0, minHeight: d2 ? `${z2}px` : void 0, ...g2 }, ...w2, ref: S2, 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: l2 }), p2 ? O2 : e(n, {})] }), d2 ? K2 : e(n, {})] }) });
|
|
345
348
|
}));
|
|
346
|
-
|
|
347
|
-
let
|
|
348
|
-
function
|
|
349
|
-
const [
|
|
350
|
-
const
|
|
351
|
-
return
|
|
349
|
+
le.displayName = "ScrollPane";
|
|
350
|
+
let ae = 0;
|
|
351
|
+
function ce() {
|
|
352
|
+
const [e2, t2] = a(!!document.fullscreenElement), n2 = i(() => {
|
|
353
|
+
const e3 = document.fullscreenElement;
|
|
354
|
+
return e3 ? e3.querySelector(".fullscreen-portal-root") || e3 : document.body;
|
|
352
355
|
}, []);
|
|
353
356
|
return c(() => {
|
|
354
|
-
function
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
357
|
-
let n3 =
|
|
358
|
-
n3 || (n3 = document.createElement("div"), n3.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",
|
|
357
|
+
function e3() {
|
|
358
|
+
const e4 = document.fullscreenElement;
|
|
359
|
+
if (t2(!!e4), !e4) return;
|
|
360
|
+
let n3 = e4.querySelector(".fullscreen-portal-root");
|
|
361
|
+
n3 || (n3 = document.createElement("div"), n3.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", e4.appendChild(n3));
|
|
359
362
|
}
|
|
360
|
-
return
|
|
361
|
-
document.removeEventListener("fullscreenchange",
|
|
362
|
-
|
|
363
|
-
}),
|
|
363
|
+
return ae++, e3(), document.addEventListener("fullscreenchange", e3), () => {
|
|
364
|
+
document.removeEventListener("fullscreenchange", e3), ae--, ae <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((e4) => {
|
|
365
|
+
e4.parentNode && e4.parentNode.removeChild(e4);
|
|
366
|
+
}), ae = 0);
|
|
364
367
|
};
|
|
365
|
-
}, []), { getPortalContainer: n2, isFullscreen:
|
|
368
|
+
}, []), { getPortalContainer: n2, isFullscreen: e2 };
|
|
366
369
|
}
|
|
367
|
-
const
|
|
368
|
-
const { offset: o2 = 0, viewportSize: s2 = 0, totalSize: l2 = 0, minSize: c2 = 0, endGap:
|
|
370
|
+
const he = 100, ue = 100, de = 1e6, pe = 100, fe = 50, _e = s(l((t2, n2) => {
|
|
371
|
+
const { offset: o2 = 0, viewportSize: s2 = 0, totalSize: l2 = 0, minSize: c2 = 0, endGap: u2 = he, endScrollIncrement: d2 = ue, style: p2 = Q, onMouseDown: f2, onScrollOffset: _2, onScroll: m2, scaleLimit: g2 = de, scaleFactor: y2 = pe, precisionFactor: v2 = fe, ...x2 } = t2;
|
|
369
372
|
m2 && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
|
|
370
|
-
const w2 =
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}, [
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
w2?.(t2), A2(true), document.addEventListener("mousemove", D2, { passive: true }), document.addEventListener("mouseup", O2, { passive: true });
|
|
386
|
-
}, [D2, O2]);
|
|
387
|
-
return t(W, { ref: n2, style: { ...p2 }, ...x2, offset: M2, totalSize: T2, viewportSize: k2, onMouseDown: K2, onScrollOffset: $2 });
|
|
373
|
+
const w2 = $(f2, [f2]), [b2, S2] = a(false), L2 = r(null), E2 = h(() => {
|
|
374
|
+
const e2 = 0 === g2 ? l2 : Math.min(l2 ?? 0, Math.max(c2 ?? 0, (o2 ?? 0) + (s2 ?? 0)) + (u2 ?? 0)), t3 = 0 !== g2 && e2 > g2 ? y2 : 1, n3 = Math.ceil(e2 / t3), i2 = { offset: Math.ceil(o2 / t3), totalSize: n3, viewportSize: Math.ceil(s2 / t3), scaledOffset: o2, scaledTotalSize: l2, scaledViewportSize: s2 };
|
|
375
|
+
return L2.current = b2 ? null : i2, i2;
|
|
376
|
+
}, [o2, l2, s2, b2, c2, u2, d2]), C2 = 0 !== g2 && E2.totalSize > g2 ? y2 : 1, M2 = C2 / v2, T2 = $((e2, t3, n3) => {
|
|
377
|
+
const i2 = L2.current;
|
|
378
|
+
if (L2.current = null, i2 && i2.scaledTotalSize === l2 && i2.scaledViewportSize === s2 && i2.scaledOffset === o2) return;
|
|
379
|
+
const r2 = E2.offset;
|
|
380
|
+
Math.abs(e2 - r2) < M2 && (e2 = r2), _2?.(e2 * C2, r2, E2.viewportSize);
|
|
381
|
+
}, [_2, C2, M2, E2]), k2 = i((e2) => {
|
|
382
|
+
}, []), D2 = i((e2) => {
|
|
383
|
+
document.removeEventListener("mousemove", k2), document.removeEventListener("mouseup", D2), S2(false);
|
|
384
|
+
}, []), P2 = i((e2) => {
|
|
385
|
+
S2(true), w2?.(e2), document.addEventListener("mousemove", k2, { passive: true }), document.addEventListener("mouseup", D2, { passive: true });
|
|
386
|
+
}, [k2, D2]);
|
|
387
|
+
return e(W, { ref: n2, style: p2, ...x2, offset: E2.offset, totalSize: E2.totalSize, viewportSize: E2.viewportSize, onMouseDown: P2, onScrollOffset: T2 });
|
|
388
388
|
}));
|
|
389
|
-
|
|
390
|
-
const
|
|
391
|
-
const { refFocusStart: o2, ...s2 } =
|
|
389
|
+
_e.displayName = "VirtualScrollbar";
|
|
390
|
+
const me = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bottom", LeftEnd: "left-end", LeftStart: "left-start", Left: "left", RightEnd: "right-end", RightStart: "right-start", Right: "right", TopEnd: "top-end", TopStart: "top-start", Top: "top" }, ge = s(l((t2, n2) => {
|
|
391
|
+
const { refFocusStart: o2, ...s2 } = t2, l2 = r(null), a2 = i(() => {
|
|
392
392
|
if (o2) return void o2?.current?.focus();
|
|
393
|
-
const
|
|
394
|
-
let
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
if ("
|
|
399
|
-
|
|
400
|
-
i2.focus && e3.push({ tabindex: parseInt(o3), child: i2 });
|
|
393
|
+
const e2 = l2.current.parentElement.children;
|
|
394
|
+
let t3 = [];
|
|
395
|
+
const n3 = e2.length;
|
|
396
|
+
for (let o3 = 0; o3 < n3 && e2[o3] !== l2.current; o3++) {
|
|
397
|
+
const n4 = e2[o3], i2 = n4.getAttribute("tabindex");
|
|
398
|
+
if (null == i2 || "-1" === i2) continue;
|
|
399
|
+
"true" !== n4.getAttribute("disabled") && (n4.focus && t3.push({ tabindex: parseInt(i2), child: n4 }));
|
|
401
400
|
}
|
|
402
|
-
0 !==
|
|
403
|
-
return
|
|
404
|
-
}),
|
|
401
|
+
0 !== t3.length && (t3.sort(function(e3, t4) {
|
|
402
|
+
return e3.tabindex - t4.tabindex;
|
|
403
|
+
}), t3[0].child.focus());
|
|
405
404
|
}, [o2]);
|
|
406
|
-
return
|
|
405
|
+
return e("div", { tabIndex: 0, ref: M([l2, n2]), onFocus: a2, ...s2 });
|
|
407
406
|
}));
|
|
408
|
-
const
|
|
409
|
-
const { className: l2, style: a2, children: c2, radius: u2 = 4, strokeWidth: d2 = 1, strokeColor: p2 = "grey", ...f2 } = i2, [_2, { width: m2, height: g2 }] =
|
|
410
|
-
const n2 =
|
|
411
|
-
return (function(
|
|
412
|
-
if (0 ===
|
|
413
|
-
function o3(
|
|
414
|
-
let o4 =
|
|
415
|
-
return i3(
|
|
407
|
+
const ye = s(l((i2, s2) => {
|
|
408
|
+
const { className: l2, style: a2, children: c2, radius: u2 = 4, strokeWidth: d2 = 1, strokeColor: p2 = "grey", ...f2 } = i2, [_2, { width: m2, height: g2 }] = v(), y2 = r(null), x2 = (e2, t2 = 0) => {
|
|
409
|
+
const n2 = e2 / 2, o2 = g2 - n2 + t2;
|
|
410
|
+
return (function(e3, t3, n3 = false) {
|
|
411
|
+
if (0 === t3) return e3;
|
|
412
|
+
function o3(e4, t4, n4) {
|
|
413
|
+
let o4 = t4.x - e4.x, r3 = t4.y - e4.y, s4 = Math.sqrt(o4 * o4 + r3 * r3);
|
|
414
|
+
return i3(e4, t4, Math.min(1, n4 / s4));
|
|
416
415
|
}
|
|
417
|
-
function i3(
|
|
418
|
-
return { x:
|
|
416
|
+
function i3(e4, t4, n4) {
|
|
417
|
+
return { x: e4.x + (t4.x - e4.x) * n4, y: e4.y + (t4.y - e4.y) * n4 };
|
|
419
418
|
}
|
|
420
|
-
function r2(
|
|
421
|
-
|
|
419
|
+
function r2(e4, t4) {
|
|
420
|
+
e4.length > 2 && (e4[e4.length - 2] = t4.x, e4[e4.length - 1] = t4.y);
|
|
422
421
|
}
|
|
423
|
-
function s3(
|
|
424
|
-
return { x: parseFloat(
|
|
422
|
+
function s3(e4) {
|
|
423
|
+
return { x: parseFloat(e4[e4.length - 2]), y: parseFloat(e4[e4.length - 1]) };
|
|
425
424
|
}
|
|
426
|
-
let l3 =
|
|
427
|
-
let n4 =
|
|
428
|
-
return n4 ? (
|
|
429
|
-
}, []).reduce(function(
|
|
430
|
-
return parseFloat(
|
|
425
|
+
let l3 = e3.split(/[,\s]/).reduce(function(e4, t4) {
|
|
426
|
+
let n4 = t4.match("([a-zA-Z])(.+)");
|
|
427
|
+
return n4 ? (e4.push(n4[1]), e4.push(n4[2])) : e4.push(t4), e4;
|
|
428
|
+
}, []).reduce(function(e4, t4) {
|
|
429
|
+
return parseFloat(t4) == t4 && e4.length ? e4[e4.length - 1].push(t4) : e4.push([t4]), e4;
|
|
431
430
|
}, []), a3 = [];
|
|
432
431
|
if (l3.length > 1) {
|
|
433
|
-
let
|
|
434
|
-
"Z" === l3[l3.length - 1][0] && l3[0].length > 2 && (c3 = ["L",
|
|
435
|
-
for (let
|
|
436
|
-
let h2 = a3[a3.length - 1], u3 = l3[
|
|
432
|
+
let e4 = s3(l3[0]), c3 = null;
|
|
433
|
+
"Z" === l3[l3.length - 1][0] && l3[0].length > 2 && (c3 = ["L", e4.x, e4.y], l3[l3.length - 1] = c3), a3.push(l3[0]);
|
|
434
|
+
for (let e5 = 1; e5 < l3.length; e5++) {
|
|
435
|
+
let h2 = a3[a3.length - 1], u3 = l3[e5], d3 = u3 === c3 ? l3[1] : l3[e5 + 1];
|
|
437
436
|
if (d3 && h2 && h2.length > 2 && "L" === u3[0] && d3.length > 2 && "L" === d3[0]) {
|
|
438
|
-
let
|
|
439
|
-
n3 ? (
|
|
440
|
-
let _3 = i3(
|
|
437
|
+
let e6, l4, c4 = s3(h2), p3 = s3(u3), f3 = s3(d3);
|
|
438
|
+
n3 ? (e6 = i3(p3, h2.origPoint || c4, t3), l4 = i3(p3, d3.origPoint || f3, t3)) : (e6 = o3(p3, c4, t3), l4 = o3(p3, f3, t3)), r2(u3, e6), u3.origPoint = p3, a3.push(u3);
|
|
439
|
+
let _3 = i3(e6, p3, 0.5), m3 = i3(p3, l4, 0.5), g3 = ["C", _3.x, _3.y, m3.x, m3.y, l4.x, l4.y];
|
|
441
440
|
g3.origPoint = p3, a3.push(g3);
|
|
442
441
|
} else a3.push(u3);
|
|
443
442
|
}
|
|
444
443
|
if (c3) {
|
|
445
|
-
let
|
|
446
|
-
a3.push(["Z"]), r2(a3[0],
|
|
444
|
+
let e5 = s3(a3[a3.length - 1]);
|
|
445
|
+
a3.push(["Z"]), r2(a3[0], e5);
|
|
447
446
|
}
|
|
448
447
|
} else a3 = l3;
|
|
449
|
-
return a3.reduce(function(
|
|
450
|
-
return
|
|
448
|
+
return a3.reduce(function(e4, t4) {
|
|
449
|
+
return e4 + t4.join(" ") + " ";
|
|
451
450
|
}, "");
|
|
452
451
|
})(`${`M 0 ${n2} L ${u2 - 0.5} ${n2} L ${u2 - 0.5} ${o2} L ${2 * u2} ${o2}`} ${`L ${m2 - 2 * u2} ${o2}`} ${`M ${m2 - 2 * u2} ${o2} L ${m2 - u2} ${o2} L ${m2 - u2} ${n2} L ${m2} ${n2}`}`, u2);
|
|
453
452
|
}, w2 = h(() => x2(d2), [m2, g2, u2, d2]), b2 = h(() => {
|
|
454
453
|
if (0 === u2) return;
|
|
455
|
-
const
|
|
456
|
-
return x2(u2) + `L ${m2} 0 L 0 0 L 0 ${
|
|
454
|
+
const e2 = u2 / 2;
|
|
455
|
+
return x2(u2) + `L ${m2} 0 L 0 0 L 0 ${e2}`;
|
|
457
456
|
}, [w2, u2, d2]), S2 = h(() => ({ style: { clipPath: `path('${b2}')` } }), [b2]);
|
|
458
|
-
return
|
|
459
|
-
})),
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
if (null == t2) return null;
|
|
464
|
-
const n2 = { percent: null, pixels: null };
|
|
465
|
-
let o2 = e2;
|
|
466
|
-
return "string" == typeof t2 && ((t2 = t2.trim().toLowerCase()).endsWith("px") ? (t2 = t2.substring(0, t2.length - 2), o2 = false) : t2.endsWith("%") && (t2 = t2.substring(0, t2.length - 1), o2 = true), t2 = parseFloat(t2)), o2 ? n2.percent = t2 : n2.pixels = t2, Object.freeze(n2);
|
|
467
|
-
}, Lt = s(l((n2, i2) => {
|
|
468
|
-
const { elementBefore: s2, elementAfter: l2, splitDirection: u2 = "row", fixedPane: d2 = null, position: p2, onPositionChange: f2, minBefore: _2, maxBefore: m2, minAfter: v2, maxAfter: x2, children: w2, className: b2, style: S2, disabled: L2 = false, onDragStart: E2, onDragResize: T2, onDragFinish: M2, resizerProps: k2 = xt, paneProps: D2 = xt, paneBeforeProps: P2 = xt, paneAfterProps: A2 = xt, createResizer: z2 = vt } = n2;
|
|
469
|
-
if (w2) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
470
|
-
const $2 = h(() => o.isValidElement(l2) && o.isValidElement(s2), [l2, s2]), O2 = h(() => {
|
|
471
|
-
let t2 = null;
|
|
472
|
-
d2 && ("before" === d2 ? t2 = 0 : "after" === d2 && (t2 = 1));
|
|
473
|
-
const e2 = null === t2;
|
|
474
|
-
return { fixedPaneOffset: t2, isPercent: e2, minBefore: St(_2, e2), maxBefore: St(m2, e2), minAfter: St(v2, e2), maxAfter: St(x2, e2) };
|
|
475
|
-
}, [_2, m2, v2, x2]), K2 = B(f2, [f2]), [V2, N2] = a(() => St(p2, null === d2));
|
|
476
|
-
c(() => {
|
|
477
|
-
N2(St(p2, null === d2));
|
|
478
|
-
}, [p2, d2]);
|
|
479
|
-
const [H2, { width: W2, height: I2 }] = y(), [R2, { width: j2, height: F2 }] = y(), Y2 = "row" === u2 ? j2 : F2, X2 = "row" === u2 ? W2 : I2, U2 = h(() => ((t2, e2, n3, o2) => {
|
|
480
|
-
const i3 = [null, null], r2 = [null, null];
|
|
481
|
-
if (t2 || (t2 = { percent: null === o2.fixedPaneOffset ? 50 : null, pixels: null === o2.fixedPaneOffset ? null : 0 }), 0 === e2) return null != t2?.pixels ? 1 !== o2.fixedPaneOffset ? (i3[0] = t2?.pixels, r2[1] = 100) : (i3[1] = t2?.pixels - n3, r2[0] = 100) : null != t2?.percent && (1 !== o2.fixedPaneOffset ? (r2[0] = t2?.percent, r2[1] = 100 - t2?.percent) : (r2[1] = t2?.percent, r2[0] = 100 - t2?.percent)), { percents: r2, pixels: i3, minBefore: bt(o2.minBefore, true), maxBefore: bt(o2.maxBefore, true), minAfter: bt(o2.minAfter), maxAfter: bt(o2.maxAfter) };
|
|
482
|
-
let s3 = wt(t2, e2, 1 !== o2.fixedPaneOffset), l3 = e2 - n3, a2 = wt(o2.minBefore, l3, true) ?? 0, c2 = wt(o2.maxBefore, l3, true) ?? l3, h2 = 0, u3 = 0, d3 = 0, p3 = l3;
|
|
483
|
-
h2 = (wt(o2.maxAfter, e2, false) ?? n3) - n3, u3 = wt(o2.minAfter, e2, false) ?? e2, d3 = Math.max(a2, h2), p3 = Math.min(c2, u3), s3 = Math.max(d3, Math.min(s3, p3)), u3 = Math.min(l3 - s3, wt(o2.maxAfter, l3 - s3, true) ?? l3), h2 = Math.min(l3 - s3, wt(o2.minAfter, l3 - s3, true) ?? l3), i3[0] = s3, i3[1] = l3 - i3[0];
|
|
484
|
-
const f3 = Math.max(0, Math.min(100, s3 / l3 * 100));
|
|
485
|
-
return r2[0] = f3, r2[1] = 100 - r2[0], { percents: r2, pixels: i3, minBefore: `${a2}px`, minAfter: `${h2}px`, maxBefore: `${i3[0]}px`, maxAfter: `${i3[1]}px` };
|
|
486
|
-
})(V2, X2, Y2, O2), [O2, V2, X2, Y2, u2]), [Z2, q2] = a(false), G2 = B(E2, [E2]), J2 = B(T2, [T2]), Q2 = B(M2, [M2]), tt2 = r(null), et2 = r(null), nt2 = r(null), { style: it2, className: rt2, ...st2 } = D2, lt2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ...it2 }, { className: at2, style: ct2, ...ht2 } = P2, { className: ut2, style: dt2, ...pt2 } = A2, ft2 = { flex: "1 1 100%", width: "100%", ...S2, flexDirection: u2, display: "flex" }, { className: _t2, style: mt2, onPointerDown: gt2, ...yt2 } = k2, Lt2 = B((t2) => {
|
|
487
|
-
const e2 = St(t2, null === d2);
|
|
488
|
-
N2(e2);
|
|
489
|
-
}, [d2]), Et2 = B((t2) => {
|
|
490
|
-
if (L2 || !Z2) return;
|
|
491
|
-
const e2 = Mt2.current?.getBoundingClientRect();
|
|
492
|
-
let n3 = 0;
|
|
493
|
-
n3 = "row" === u2 ? (t2.clientX ?? t2.touches?.[0]?.clientX) - e2.x : (t2.clientY ?? t2.touches?.[0]?.clientY) - e2.y, n3 = Math.max(0, Math.min(X2, n3)), 1 === O2.fixedPaneOffset && (n3 = X2 - n3), p2 && V2.pixels === n3 || N2({ pixels: n3, percent: null }), J2?.(n3), t2.stopPropagation(), t2.preventDefault();
|
|
494
|
-
}, [O2, u2, L2, Z2, V2, X2]), Ct2 = B((t2) => {
|
|
495
|
-
if (document.removeEventListener("pointermove", Et2), document.removeEventListener("touchmove", Et2), document.removeEventListener("pointerup", Ct2), !Z2) return;
|
|
496
|
-
if (q2(false), !V2) return;
|
|
497
|
-
Q2(V2.pixels);
|
|
498
|
-
if (!St(p2, null === d2) || V2.pixels !== p2) {
|
|
499
|
-
const t3 = { ...V2 };
|
|
500
|
-
null === t3.percent && (t3.percent = t3.pixels / X2 * 100), K2(t3);
|
|
501
|
-
}
|
|
502
|
-
t2.stopPropagation(), t2.preventDefault();
|
|
503
|
-
}, [V2, Z2, p2, d2, X2]), Tt2 = B((t2) => {
|
|
504
|
-
gt2?.(t2), t2.defaultPrevented || L2 || Z2 || (q2(true), G2(), document.addEventListener("pointermove", Et2, { passive: false }), document.addEventListener("touchmove", Et2, { passive: false }), document.addEventListener("pointerup", Ct2, { passive: false }));
|
|
505
|
-
}, [gt2]), Mt2 = ot(i2, () => ({ setPosition: Lt2, isSplitPane: () => true }), []), kt2 = h(() => $2 ? z2?.({ key: "resizer", ref: C([R2, et2]), className: g("resizer", _t2), onPointerDownCapture: Tt2, style: { cursor: L2 ? void 0 : "row" === u2 ? "ew-resize" : "ns-resize", minWidth: "row" === u2 ? "2px" : void 0, minHeight: "row" !== u2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...mt2 }, splitDirection: u2, disabled: L2, ...yt2 }) : null, [$2, _t2, yt2, u2, mt2, L2]), Dt2 = "row" === u2 ? "Width" : "Height", Pt2 = { ...lt2, ...ct2, flex: 0 === O2.fixedPaneOffset && null !== U2?.pixels[0] ? `0 0 ${Math.round(U2?.pixels[0])}px` : `1 1 ${Math.round(U2?.percents[0] ?? 100)}%`, [`min${Dt2}`]: U2?.minBefore, [`max${Dt2}`]: l2 ? U2?.maxBefore : "100%" }, At2 = { ...lt2, ...dt2, flex: 1 === O2.fixedPaneOffset && null !== U2?.pixels[1] ? `0 0 ${Math.round(U2?.pixels[1])}px` : `1 1 ${Math.round(U2?.percents[1] ?? 100)}%`, [`min${Dt2}`]: U2?.minAfter, [`max${Dt2}`]: s2 ? U2?.maxAfter : "100%" }, zt2 = h(() => s2 ? t("div", { ref: tt2, className: g("before", rt2, at2), style: Pt2, ...st2, ...ht2, children: s2 }, "before") : null, [s2, D2, P2, O2, U2]), Bt2 = h(() => l2 ? t("div", { ref: nt2, className: g("after", rt2, ut2), style: At2, ...st2, ...pt2, children: l2 }, "after") : null, [l2, D2, A2, O2, U2]);
|
|
506
|
-
return e("div", { ref: C([H2, Mt2]), className: g("splitPane", "row" === u2 ? "vertical" : "horizontal", { dragging: Z2 }, b2), style: ft2, children: [zt2, kt2, Bt2] });
|
|
507
|
-
}));
|
|
508
|
-
function Et(t2) {
|
|
509
|
-
if ("function" == typeof t2) return t2;
|
|
510
|
-
if ("string" == typeof t2) {
|
|
511
|
-
const e2 = t2.trim();
|
|
512
|
-
if (e2.startsWith("data:image/svg+xml")) {
|
|
513
|
-
const t3 = (function(t4) {
|
|
514
|
-
const e3 = /^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(t4.trim());
|
|
515
|
-
if (!e3) return null;
|
|
516
|
-
const n2 = e3[1] || "", o2 = e3[2] || "";
|
|
517
|
-
try {
|
|
518
|
-
if (/;base64/i.test(n2)) {
|
|
519
|
-
if ("undefined" != typeof atob) {
|
|
520
|
-
const t5 = atob(o2);
|
|
521
|
-
if ("undefined" != typeof TextDecoder) {
|
|
522
|
-
const e5 = new Uint8Array(t5.length);
|
|
523
|
-
for (let n3 = 0; n3 < t5.length; n3++) e5[n3] = t5.charCodeAt(n3);
|
|
524
|
-
return new TextDecoder("utf-8").decode(e5);
|
|
525
|
-
}
|
|
526
|
-
let e4 = "";
|
|
527
|
-
for (let n3 = 0; n3 < t5.length; n3++) {
|
|
528
|
-
e4 += `%${t5.charCodeAt(n3).toString(16).padStart(2, "0")}`;
|
|
529
|
-
}
|
|
530
|
-
return decodeURIComponent(e4);
|
|
531
|
-
}
|
|
532
|
-
return (globalThis.Buffer ? globalThis.Buffer.from(o2, "base64") : require("buffer").Buffer.from(o2, "base64")).toString("utf-8");
|
|
533
|
-
}
|
|
534
|
-
try {
|
|
535
|
-
return decodeURIComponent(o2);
|
|
536
|
-
} catch {
|
|
537
|
-
return o2;
|
|
538
|
-
}
|
|
539
|
-
} catch {
|
|
540
|
-
return null;
|
|
541
|
-
}
|
|
542
|
-
})(e2);
|
|
543
|
-
if (t3) return Mt(t3);
|
|
544
|
-
}
|
|
545
|
-
if (e2.startsWith("<")) {
|
|
546
|
-
if (/^<\s*svg\b/i.test(e2)) return Mt(e2);
|
|
547
|
-
if (/^<\s*path\b/i.test(e2)) {
|
|
548
|
-
const t3 = Ct(e2);
|
|
549
|
-
if (t3) return { paths: [{ d: t3 }] };
|
|
550
|
-
}
|
|
551
|
-
return { paths: [{ d: e2 }] };
|
|
552
|
-
}
|
|
553
|
-
return { paths: [{ d: e2 }] };
|
|
554
|
-
}
|
|
555
|
-
if (Array.isArray(t2)) {
|
|
556
|
-
const e2 = [];
|
|
557
|
-
for (const n2 of t2) if ("string" == typeof n2) {
|
|
558
|
-
const t3 = String(n2).trim();
|
|
559
|
-
if (t3.startsWith("<path")) {
|
|
560
|
-
const n3 = Ct(t3);
|
|
561
|
-
n3 && e2.push({ d: n3 });
|
|
562
|
-
} else e2.push({ d: t3 });
|
|
563
|
-
} else n2 && "object" == typeof n2 && "d" in n2 && "string" == typeof n2.d && e2.push({ ...n2 });
|
|
564
|
-
return { paths: e2 };
|
|
565
|
-
}
|
|
566
|
-
return t2;
|
|
567
|
-
}
|
|
568
|
-
function Ct(t2) {
|
|
569
|
-
const e2 = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(t2);
|
|
570
|
-
return e2 ? e2[1] ?? e2[2] ?? null : null;
|
|
571
|
-
}
|
|
572
|
-
function Tt(t2) {
|
|
573
|
-
if ("svg" in t2) return { ...t2, svg: Et(t2.svg) };
|
|
574
|
-
if ("url" in t2) {
|
|
575
|
-
const e2 = "string" == typeof t2.url ? { src: t2.url } : t2.url;
|
|
576
|
-
return { ...t2, url: e2 };
|
|
577
|
-
}
|
|
578
|
-
if ("emoji" in t2) {
|
|
579
|
-
const e2 = "string" == typeof t2.emoji ? t2.emoji : t2.emoji.text;
|
|
580
|
-
return { ...t2, emoji: e2 };
|
|
581
|
-
}
|
|
582
|
-
return t2;
|
|
583
|
-
}
|
|
584
|
-
function Mt(t2) {
|
|
585
|
-
try {
|
|
586
|
-
if ("undefined" != typeof DOMParser) {
|
|
587
|
-
const e3 = new DOMParser().parseFromString(t2, "image/svg+xml"), n3 = e3.querySelector("svg"), o3 = n3?.getAttribute("viewBox") ?? void 0, i3 = [];
|
|
588
|
-
return e3.querySelectorAll("path").forEach((t3) => {
|
|
589
|
-
const e4 = t3.getAttribute("d");
|
|
590
|
-
if (!e4) return;
|
|
591
|
-
const n4 = { d: e4 }, o4 = t3.getAttribute("class");
|
|
592
|
-
o4 && (n4.className = o4);
|
|
593
|
-
const r3 = t3.getAttribute("fill");
|
|
594
|
-
r3 && "none" !== r3 && (n4.fill = r3);
|
|
595
|
-
const s2 = t3.getAttribute("stroke");
|
|
596
|
-
s2 && (n4.stroke = s2);
|
|
597
|
-
const l2 = t3.getAttribute("opacity");
|
|
598
|
-
l2 && (n4.opacity = Number(l2));
|
|
599
|
-
const a2 = t3.getAttribute("fill-rule");
|
|
600
|
-
a2 && (n4.fillRule = a2);
|
|
601
|
-
const c2 = t3.getAttribute("clip-rule");
|
|
602
|
-
c2 && (n4.clipRule = c2), i3.push(n4);
|
|
603
|
-
}), { viewBox: o3, paths: i3 };
|
|
604
|
-
}
|
|
605
|
-
} catch {
|
|
606
|
-
}
|
|
607
|
-
const e2 = t2.match(/viewBox="([^"]+)"/i), n2 = e2 ? e2[1] : void 0, o2 = [], i2 = /<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;
|
|
608
|
-
let r2;
|
|
609
|
-
for (; r2 = i2.exec(t2); ) o2.push({ d: r2[1] });
|
|
610
|
-
return { viewBox: n2, paths: o2 };
|
|
611
|
-
}
|
|
612
|
-
function kt(t2) {
|
|
613
|
-
const e2 = {};
|
|
614
|
-
for (const [n3, o3] of Object.entries(t2.icons)) e2[n3] = Tt(o3);
|
|
615
|
-
const n2 = { label: t2.meta?.label ?? "Unnamed", version: t2.meta?.version ?? "1.0.0", license: t2.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: t2.meta?.extends ?? [] };
|
|
616
|
-
n2.extends.includes("base") || n2.extends.push("base");
|
|
617
|
-
const o2 = { meta: n2, icons: e2 }, i2 = t2.overrides;
|
|
618
|
-
if (i2) {
|
|
619
|
-
const t3 = {};
|
|
620
|
-
for (const [e3, n3] of Object.entries(i2)) {
|
|
621
|
-
const o3 = {};
|
|
622
|
-
for (const [t4, e4] of Object.entries(n3)) o3[t4] = Tt(e4);
|
|
623
|
-
t3[e3] = o3;
|
|
624
|
-
}
|
|
625
|
-
o2.__overrides = t3;
|
|
626
|
-
}
|
|
627
|
-
return o2;
|
|
628
|
-
}
|
|
629
|
-
function Dt() {
|
|
630
|
-
const t2 = /* @__PURE__ */ new Map(), e2 = /* @__PURE__ */ new Map();
|
|
631
|
-
let n2 = "base", o2 = /* @__PURE__ */ new Map();
|
|
632
|
-
async function i2(e3) {
|
|
633
|
-
const o3 = t2.get(e3 ?? n2);
|
|
634
|
-
if (!o3) throw new Error(`Icon pack not registered: ${e3}`);
|
|
635
|
-
if (!o3.pack) {
|
|
636
|
-
if (!o3.loading) {
|
|
637
|
-
if (!o3.loader) throw new Error(`No loader for icon pack: ${e3}`);
|
|
638
|
-
o3.loading = o3.loader().then((t3) => {
|
|
639
|
-
const e4 = t3 && "object" == typeof t3 && "default" in t3 ? t3.default : t3;
|
|
640
|
-
o3.pack = kt(e4);
|
|
641
|
-
}).catch((t3) => {
|
|
642
|
-
throw o3.loading = void 0, t3;
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
await o3.loading;
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
function r2(t3) {
|
|
649
|
-
const e3 = t3.indexOf(":");
|
|
650
|
-
return e3 > 0 ? { ns: t3.slice(0, e3), key: t3.slice(e3 + 1) } : { key: t3 };
|
|
651
|
-
}
|
|
652
|
-
function s2(n3, o3) {
|
|
653
|
-
const i3 = [n3, ...t2.get(n3)?.pack?.meta.extends ?? []];
|
|
654
|
-
for (const n4 of i3) {
|
|
655
|
-
const i4 = t2.get(n4);
|
|
656
|
-
if (!i4?.pack) continue;
|
|
657
|
-
const { icons: r3 } = i4.pack, s3 = r3[e2.get(n4)?.get(o3) ?? o3] ?? r3[o3];
|
|
658
|
-
if (s3) return { glyph: s3, pack: i4.pack, packKey: n4 };
|
|
659
|
-
}
|
|
660
|
-
return null;
|
|
661
|
-
}
|
|
662
|
-
function l2(e3, o3) {
|
|
663
|
-
const i3 = o3?.packKey ?? n2;
|
|
664
|
-
if (o3?.packKey) return s2(o3.packKey, e3);
|
|
665
|
-
if (!e3) return null;
|
|
666
|
-
const { ns: l3, key: a2 } = r2(e3);
|
|
667
|
-
if (l3) {
|
|
668
|
-
const e4 = t2.get(l3)?.pack;
|
|
669
|
-
if (e4) {
|
|
670
|
-
if (!!t2.get(n2)?.pack) {
|
|
671
|
-
const t3 = e4.__overrides, o5 = t3?.[n2]?.[a2];
|
|
672
|
-
if (o5) return { glyph: o5, pack: e4, packKey: l3 };
|
|
673
|
-
}
|
|
674
|
-
const o4 = s2(l3, a2);
|
|
675
|
-
if (o4) return o4;
|
|
676
|
-
}
|
|
677
|
-
return null;
|
|
678
|
-
}
|
|
679
|
-
return s2(i3, e3);
|
|
680
|
-
}
|
|
681
|
-
return { register: function(e3, o3) {
|
|
682
|
-
const i3 = t2.get(e3) ?? {};
|
|
683
|
-
"function" == typeof o3 ? i3.loader = o3 : i3.pack = kt(o3), t2.set(e3, i3), n2 || (n2 = e3);
|
|
684
|
-
}, prefetch: async function(t3 = n2) {
|
|
685
|
-
const e3 = Array.isArray(t3) ? t3 : [t3];
|
|
686
|
-
await Promise.all(e3.map(i2));
|
|
687
|
-
}, setActive: function(t3) {
|
|
688
|
-
n2 = t3;
|
|
689
|
-
for (const e3 of o2.keys()) try {
|
|
690
|
-
e3(t3);
|
|
691
|
-
} catch (t4) {
|
|
692
|
-
}
|
|
693
|
-
}, getActive: function() {
|
|
694
|
-
return n2;
|
|
695
|
-
}, resolve: async function(e3, o3) {
|
|
696
|
-
let s3 = l2(e3, o3);
|
|
697
|
-
if (s3) return s3;
|
|
698
|
-
const a2 = o3?.packKey ?? n2, { ns: c2 } = r2(e3);
|
|
699
|
-
if (o3?.packKey) {
|
|
700
|
-
if (await i2(a2), s3 = l2(e3, o3), s3) return s3;
|
|
701
|
-
const n3 = t2.get(a2)?.pack?.meta?.extends ?? [];
|
|
702
|
-
if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(e3, o3), s3)) return s3;
|
|
703
|
-
} else if (c2) {
|
|
704
|
-
if (await i2(c2), s3 = l2(e3, o3), s3) return s3;
|
|
705
|
-
const n3 = t2.get(c2)?.pack?.meta?.extends ?? [];
|
|
706
|
-
if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(e3, o3), s3)) return s3;
|
|
707
|
-
} else {
|
|
708
|
-
if (await i2(a2), s3 = l2(e3, o3), s3) return s3;
|
|
709
|
-
const n3 = t2.get(a2)?.pack?.meta?.extends ?? [];
|
|
710
|
-
if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(e3, o3), s3)) return s3;
|
|
711
|
-
}
|
|
712
|
-
return null;
|
|
713
|
-
}, registerAlias: function(t3, n3, o3) {
|
|
714
|
-
e2.has(t3) || e2.set(t3, /* @__PURE__ */ new Map()), e2.get(t3).set(n3, o3);
|
|
715
|
-
}, has: function(t3, e3) {
|
|
716
|
-
return !!l2(t3, e3);
|
|
717
|
-
}, getPack: function(e3) {
|
|
718
|
-
return t2.get(e3 ?? n2)?.pack;
|
|
719
|
-
}, hasPack: function(e3) {
|
|
720
|
-
return !!t2.get(e3)?.pack;
|
|
721
|
-
}, listPacks: function() {
|
|
722
|
-
return Array.from(t2.keys());
|
|
723
|
-
}, listIcons: function(e3) {
|
|
724
|
-
const n3 = t2.get(e3)?.pack;
|
|
725
|
-
return n3 ? Object.keys(n3.icons) : [];
|
|
726
|
-
}, addActiveListener: function(t3) {
|
|
727
|
-
const e3 = o2.get(t3);
|
|
728
|
-
if (e3) return e3;
|
|
729
|
-
const n3 = () => {
|
|
730
|
-
o2.delete(t3);
|
|
731
|
-
};
|
|
732
|
-
return o2.set(t3, n3), n3;
|
|
733
|
-
} };
|
|
734
|
-
}
|
|
735
|
-
const Pt = Dt();
|
|
736
|
-
Pt.register("base", () => import("./iqYVEUkNtlVZ_Hro.mjs"));
|
|
737
|
-
const At = (e2) => t("svg", { ...e2, children: t("path", {}) }), zt = { Icon: "_Icon_1ipwo_10" }, Bt = s((e2) => {
|
|
738
|
-
const { iconKey: n2, packKey: i2, className: r2, style: s2, role: l2, title: a2, size: c2, ariaHidden: u2, sourceProps: d2, children: p2, ...f2 } = e2, [_2, m2] = o.useState(null);
|
|
739
|
-
o.useEffect(() => {
|
|
740
|
-
let t2 = true, e3 = i2, o2 = n2;
|
|
741
|
-
if (!o2) {
|
|
742
|
-
const t3 = Pt.getPack(e3);
|
|
743
|
-
return void m2({ glyph: t3 ? { svg: v.EmptyArray } : void 0, pack: t3 ?? void 0, packKey: e3 ?? Pt.getActive() });
|
|
744
|
-
}
|
|
745
|
-
if (o2.includes(":")) {
|
|
746
|
-
const [t3, n3] = o2.split(":");
|
|
747
|
-
e3 = t3, o2 = n3;
|
|
748
|
-
}
|
|
749
|
-
return Pt.resolve(o2, { packKey: e3 }).then((e4) => {
|
|
750
|
-
t2 && m2(e4);
|
|
751
|
-
}), () => {
|
|
752
|
-
t2 = false;
|
|
753
|
-
};
|
|
754
|
-
}, [n2, i2]);
|
|
755
|
-
const g2 = _2?.pack, y2 = _2?.glyph, x2 = _2?.packKey;
|
|
756
|
-
let w2 = y2 ? y2.svg : void 0;
|
|
757
|
-
const b2 = y2 && !w2 ? y2.url : void 0, S2 = !y2 || w2 || b2 ? void 0 : y2.emoji, L2 = null != c2 ? "number" == typeof c2 ? `${c2}px` : c2 : void 0, E2 = h(() => [zt.Icon, "icon", r2].filter(Boolean).join(" "), [r2]), C2 = h(() => {
|
|
758
|
-
const t2 = { ...s2 };
|
|
759
|
-
return t2["--icon-size"] = L2, t2;
|
|
760
|
-
}, [s2, L2]), T2 = l2 ?? (a2 ? "img" : "presentation"), M2 = u2 ?? (!a2 || void 0), k2 = (e3) => t("span", { className: E2, style: C2, role: T2, "aria-hidden": M2, title: a2, "data-icon-glyph": n2, "data-icon-pack": x2, ...f2, children: e3 });
|
|
761
|
-
if (p2) return k2(p2);
|
|
762
|
-
if (S2) return k2(t("span", { children: "string" == typeof S2 ? S2 : S2.text }));
|
|
763
|
-
if (b2) return k2(t("img", { src: b2.src, alt: a2 ?? "" }));
|
|
764
|
-
if (y2 && "react" in y2) {
|
|
765
|
-
const e3 = y2.react, n3 = { className: E2, style: C2, role: T2, "aria-hidden": M2, title: a2, ...f2, ...d2 };
|
|
766
|
-
return k2(t(e3, { ...n3 }));
|
|
767
|
-
}
|
|
768
|
-
const D2 = { viewBox: w2?.viewBox ?? g2?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
769
|
-
if ("function" == typeof w2) {
|
|
770
|
-
return k2(w2(D2) ?? t(At, { ...D2 }));
|
|
771
|
-
}
|
|
772
|
-
if (!w2) return k2(t(At, { ...D2 }));
|
|
773
|
-
const P2 = w2.paths;
|
|
774
|
-
return k2(t("svg", { ...D2, children: P2 ? P2.map((e3, n3) => t("path", { d: e3.d, className: e3.className, fill: e3.fill, stroke: e3.stroke, opacity: e3.opacity, fillRule: e3.fillRule, clipRule: e3.clipRule }, n3)) : null }));
|
|
775
|
-
});
|
|
776
|
-
function $t(e2) {
|
|
777
|
-
const { isWalking: n2 = false, themedType: o2 = "info", speed: i2 = 120, dashGap: r2 = 3, dashLength: s2 = 5, iconKey: l2, packKey: a2, style: c2, className: u2, ...d2 } = e2, p2 = h(() => {
|
|
778
|
-
if (!n2) return;
|
|
779
|
-
const t2 = { "--walk-duration": `${i2 * (r2 + s2)}ms`, "--walk-dash-length": `${s2}px`, "--walk-dash-gap": `${r2}px` };
|
|
780
|
-
return o2 && "accent" !== o2 && (t2["--icon-accent"] = `var(--icon-${o2})`), t2;
|
|
781
|
-
}, [n2, i2, r2, s2, o2]), f2 = h(() => n2 ? u2 + " walking" : u2, [n2, u2]);
|
|
782
|
-
return t(Bt, { iconKey: l2, packKey: a2, className: f2, style: { ...c2, ...p2 }, ...d2 });
|
|
783
|
-
}
|
|
784
|
-
const Ot = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
|
|
785
|
-
class Kt extends x {
|
|
786
|
-
setOverrides(t2) {
|
|
787
|
-
super.setOverrides(t2);
|
|
457
|
+
return t("div", { className: l2, style: { display: "flex", flexDirection: "row", ...a2 }, ...f2, ref: M([y2, _2, s2]), children: [o.isValidElement(c2) ? o.cloneElement(c2, S2) : e(n, {}), e("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: m2, height: g2, viewBox: `0 0 ${m2} ${g2}`, children: e("path", { d: w2, stroke: p2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: d2 }) })] });
|
|
458
|
+
})), ve = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
|
|
459
|
+
class xe extends w {
|
|
460
|
+
setOverrides(e2) {
|
|
461
|
+
super.setOverrides(e2);
|
|
788
462
|
}
|
|
789
463
|
getDelegate() {
|
|
790
464
|
return this._overrides;
|
|
791
465
|
}
|
|
792
|
-
showMessage(
|
|
466
|
+
showMessage(e2, t2) {
|
|
793
467
|
const n2 = this.getDelegate();
|
|
794
|
-
if (n2?.showMessage) return n2.showMessage(
|
|
795
|
-
|
|
468
|
+
if (n2?.showMessage) return n2.showMessage(e2, t2);
|
|
469
|
+
t2?.type !== ve.Warning ? t2?.type !== ve.Error ? b.log(e2) : b.error(e2) : b.warn(e2);
|
|
796
470
|
}
|
|
797
|
-
showBusy(
|
|
471
|
+
showBusy(e2, t2) {
|
|
798
472
|
const n2 = this.getDelegate();
|
|
799
|
-
return n2?.showBusy ? n2.showBusy(
|
|
800
|
-
|
|
473
|
+
return n2?.showBusy ? n2.showBusy(e2, t2) : new Promise((e3) => {
|
|
474
|
+
e3(() => {
|
|
801
475
|
});
|
|
802
476
|
});
|
|
803
477
|
}
|
|
804
|
-
showWindow(
|
|
478
|
+
showWindow(e2, t2, n2) {
|
|
805
479
|
const o2 = this.getDelegate();
|
|
806
|
-
if (o2?.showWindow) return o2.showWindow(
|
|
480
|
+
if (o2?.showWindow) return o2.showWindow(e2, t2, n2);
|
|
807
481
|
}
|
|
808
|
-
showError(
|
|
809
|
-
const
|
|
810
|
-
|
|
482
|
+
showError(e2) {
|
|
483
|
+
const t2 = this.getDelegate();
|
|
484
|
+
t2?.showError ? t2.showError(e2) : b.error(e2);
|
|
811
485
|
}
|
|
812
|
-
showOptions(
|
|
813
|
-
const
|
|
814
|
-
return
|
|
486
|
+
showOptions(e2) {
|
|
487
|
+
const t2 = this.getDelegate();
|
|
488
|
+
return t2?.showOptions ? t2.showOptions(e2) : Promise.resolve("");
|
|
815
489
|
}
|
|
816
|
-
showInputOptions(
|
|
817
|
-
const
|
|
818
|
-
return
|
|
490
|
+
showInputOptions(e2) {
|
|
491
|
+
const t2 = this.getDelegate();
|
|
492
|
+
return t2?.showInputOptions ? t2.showInputOptions(e2) : Promise.resolve({ input: "", option: "" });
|
|
819
493
|
}
|
|
820
494
|
}
|
|
821
|
-
const
|
|
822
|
-
const
|
|
823
|
-
return
|
|
824
|
-
|
|
495
|
+
const we = d(new xe()), be = ({ children: e2, notifier: t2 }) => (o.useEffect(() => {
|
|
496
|
+
const e3 = b.getOverrides();
|
|
497
|
+
return b.setOverrides(t2), () => {
|
|
498
|
+
b.setOverrides(e3);
|
|
825
499
|
};
|
|
826
|
-
}, [
|
|
827
|
-
function
|
|
828
|
-
const [
|
|
500
|
+
}, [t2]), o.createElement(we.Provider, { value: t2 }, e2)), Se = () => p(we);
|
|
501
|
+
function Le(e2) {
|
|
502
|
+
const [t2, n2] = a("undefined" != typeof window ? window.devicePixelRatio : 1), o2 = r(null);
|
|
829
503
|
return c(() => {
|
|
830
504
|
if (!("undefined" != typeof window && "matchMedia" in window)) return;
|
|
831
|
-
const
|
|
832
|
-
const
|
|
833
|
-
|
|
505
|
+
const e3 = () => {
|
|
506
|
+
const t3 = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
|
|
507
|
+
t3.addEventListener("change", e3, { once: true, passive: true }), n2(window.devicePixelRatio), o2.current = { mediaMatcher: t3, listener: e3 };
|
|
834
508
|
};
|
|
835
|
-
return
|
|
509
|
+
return e3(), () => {
|
|
836
510
|
o2.current && o2.current.mediaMatcher.removeEventListener("change", o2.current.listener);
|
|
837
511
|
};
|
|
838
|
-
}, [
|
|
512
|
+
}, [e2]), t2;
|
|
839
513
|
}
|
|
840
|
-
function
|
|
514
|
+
function Ee(e2) {
|
|
841
515
|
if ("undefined" == typeof window) return 1;
|
|
842
|
-
const { defaultDpr:
|
|
516
|
+
const { defaultDpr: t2 = 1, maxDpr: n2 = 3, round: o2 = true } = e2 || {}, i2 = "undefined" != typeof window && "number" == typeof window.devicePixelRatio ? window.devicePixelRatio : t2;
|
|
843
517
|
return Math.min(Math.max(1, o2 ? Math.floor(i2) : i2), n2);
|
|
844
518
|
}
|
|
845
|
-
function
|
|
846
|
-
const o2 =
|
|
519
|
+
function Ce(e2, t2, n2) {
|
|
520
|
+
const o2 = $(t2, [t2]);
|
|
847
521
|
c(() => {
|
|
848
|
-
const
|
|
849
|
-
|
|
522
|
+
const t3 = (t4) => {
|
|
523
|
+
e2.current && !e2.current.contains(t4.target) && o2(t4);
|
|
850
524
|
};
|
|
851
|
-
return n2 && false === n2.mouseEvents || (document.addEventListener("mousedown",
|
|
852
|
-
document.removeEventListener("mousedown",
|
|
525
|
+
return n2 && false === n2.mouseEvents || (document.addEventListener("mousedown", t3), document.addEventListener("touchstart", t3)), n2 && false === n2.focusEvents || document.addEventListener("focus", t3), () => {
|
|
526
|
+
document.removeEventListener("mousedown", t3), document.removeEventListener("touchstart", t3), document.removeEventListener("focus", t3);
|
|
853
527
|
};
|
|
854
|
-
}, [
|
|
528
|
+
}, [e2]);
|
|
855
529
|
}
|
|
856
|
-
function
|
|
857
|
-
if (!
|
|
858
|
-
const { onPointerDown:
|
|
530
|
+
function Me(e2) {
|
|
531
|
+
if (!e2) throw new Error("must have a PointerHandlerOptions");
|
|
532
|
+
const { onPointerDown: t2, onPointerUp: n2, onPointerMoveOrWait: o2, processTouch: s2 = false, consumeTouch: l2 = true } = e2, a2 = $(t2, [t2]), h2 = $(n2, [n2]), u2 = $(o2, [o2]), d2 = r(false), p2 = e2?.timerInitial ?? 230, f2 = e2?.timerContinuous ?? p2 / 2, _2 = r(null), m2 = r(null), g2 = r(null), y2 = r(null), v2 = i(() => {
|
|
859
533
|
y2.current && (clearTimeout(y2.current), y2.current = null);
|
|
860
|
-
}, []), x2 = i((
|
|
534
|
+
}, []), x2 = i((e3) => {
|
|
861
535
|
y2.current = setTimeout(() => {
|
|
862
536
|
window.requestAnimationFrame(() => {
|
|
863
537
|
false !== d2.current && u2?.(m2.current, g2.current, _2.current);
|
|
864
538
|
}), x2(f2);
|
|
865
|
-
},
|
|
539
|
+
}, e3 ?? p2);
|
|
866
540
|
}, []);
|
|
867
541
|
c(() => () => v2(), []);
|
|
868
|
-
const w2 = s2 ? "pointer" : "mouse", b2 = i((
|
|
869
|
-
|
|
870
|
-
}, []), S2 =
|
|
871
|
-
document.removeEventListener(`${w2}move`, C2), document.removeEventListener(`${w2}up`, S2), document.removeEventListener("keydown",
|
|
872
|
-
false !== d2.current && (d2.current = false, h2?.(
|
|
542
|
+
const w2 = s2 ? "pointer" : "mouse", b2 = i((e3) => {
|
|
543
|
+
e3.stopPropagation(), e3.stopImmediatePropagation(), e3.preventDefault();
|
|
544
|
+
}, []), S2 = $((e3) => {
|
|
545
|
+
document.removeEventListener(`${w2}move`, C2), document.removeEventListener(`${w2}up`, S2), document.removeEventListener("keydown", M2), document.removeEventListener("keyup", T2), document.removeEventListener("touchstart", b2, { capture: true }), document.removeEventListener("touchmove", b2, { capture: true }), window.removeEventListener("blur", L2), v2(), window.requestAnimationFrame(() => {
|
|
546
|
+
false !== d2.current && (d2.current = false, h2?.(e3, g2.current, _2.current), g2.current = null);
|
|
873
547
|
});
|
|
874
548
|
}, []), L2 = i(() => {
|
|
875
549
|
false !== d2.current && (d2.current = false, S2(m2.current));
|
|
876
|
-
}, []), E2 =
|
|
550
|
+
}, []), E2 = $(() => {
|
|
877
551
|
v2(), x2(f2), window.requestAnimationFrame(() => {
|
|
878
552
|
false !== d2.current && u2?.(m2.current, g2.current, _2.current);
|
|
879
553
|
});
|
|
880
|
-
}, [f2]), C2 =
|
|
881
|
-
m2.current =
|
|
882
|
-
}, []),
|
|
883
|
-
g2.current = { ctrlKey:
|
|
884
|
-
}, []),
|
|
885
|
-
g2.current = { ctrlKey:
|
|
554
|
+
}, [f2]), C2 = $((e3) => {
|
|
555
|
+
m2.current = e3, E2();
|
|
556
|
+
}, []), M2 = $((e3) => {
|
|
557
|
+
g2.current = { ctrlKey: e3.ctrlKey, shiftKey: e3.shiftKey, altKey: e3.altKey, metaKey: e3.metaKey }, E2();
|
|
558
|
+
}, []), T2 = $((e3) => {
|
|
559
|
+
g2.current = { ctrlKey: e3.ctrlKey, shiftKey: e3.shiftKey, altKey: e3.altKey, metaKey: e3.metaKey }, E2();
|
|
886
560
|
}, [f2]);
|
|
887
|
-
return
|
|
888
|
-
if (
|
|
889
|
-
g2.current = { ctrlKey:
|
|
890
|
-
false !== a2(
|
|
561
|
+
return $((e3) => {
|
|
562
|
+
if (e3.isDefaultPrevented()) return;
|
|
563
|
+
g2.current = { ctrlKey: e3.ctrlKey, shiftKey: e3.shiftKey, altKey: e3.altKey, metaKey: e3.metaKey };
|
|
564
|
+
false !== a2(e3, g2.current) && (_2.current = e3, m2.current = e3.nativeEvent, document.addEventListener(`${w2}up`, S2, { passive: false }), document.addEventListener(`${w2}move`, C2, { passive: false }), document.addEventListener("keydown", M2, { passive: false }), document.addEventListener("keyup", T2, { passive: false }), window.addEventListener("blur", L2, { passive: true }), s2 && l2 && (document.addEventListener("touchstart", b2, { passive: false, capture: true }), document.addEventListener("touchmove", b2, { passive: false, capture: true })), d2.current = true, x2(p2));
|
|
891
565
|
}, [p2, s2]);
|
|
892
566
|
}
|
|
893
|
-
function
|
|
894
|
-
return
|
|
895
|
-
|
|
896
|
-
}, ...
|
|
567
|
+
function Te(e2, t2) {
|
|
568
|
+
return Me({ onPointerDown: e2, onPointerMoveOrWait: (t3, n2, o2) => {
|
|
569
|
+
e2?.(o2);
|
|
570
|
+
}, ...t2 });
|
|
897
571
|
}
|
|
898
|
-
const
|
|
899
|
-
const o2 = r(
|
|
900
|
-
if ("function" != typeof
|
|
901
|
-
const i2 =
|
|
902
|
-
return
|
|
572
|
+
const ke = ({ initValue: e2, useHookBody: t2, applyStateChange: n2 }) => {
|
|
573
|
+
const o2 = r(e2);
|
|
574
|
+
if ("function" != typeof t2) throw new Error("function expected as hook body parameter. got " + typeof t2);
|
|
575
|
+
const i2 = t2();
|
|
576
|
+
return f(() => {
|
|
903
577
|
o2.current !== i2 && (o2.current = i2, n2(i2));
|
|
904
578
|
}, [n2, i2]), null;
|
|
905
|
-
},
|
|
906
|
-
console && console.warn && console.warn(
|
|
907
|
-
},
|
|
908
|
-
let
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
},
|
|
579
|
+
}, De = (e2) => {
|
|
580
|
+
console && console.warn && console.warn(e2);
|
|
581
|
+
}, Pe = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
|
|
582
|
+
let Ae = 1, ze = false, Be = false;
|
|
583
|
+
const $e = [], Oe = [], Ke = () => {
|
|
584
|
+
Oe.forEach((e2) => e2());
|
|
585
|
+
}, He = ({ automaticContainerInternalUseOnly: t2 }) => {
|
|
912
586
|
const [o2, i2] = a([]), s2 = r([]);
|
|
913
|
-
return s2.current = o2,
|
|
914
|
-
let
|
|
587
|
+
return s2.current = o2, t2 || false !== ze || (Be = true), c(() => {
|
|
588
|
+
let e2 = true;
|
|
915
589
|
function n2() {
|
|
916
|
-
if (
|
|
590
|
+
if (e2) return Oe[0] !== n2 ? (t2 || true !== ze || De("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void i2((e3) => [])) : void i2([...$e]);
|
|
917
591
|
}
|
|
918
|
-
return
|
|
919
|
-
|
|
592
|
+
return Oe.push(n2), Ke(), () => {
|
|
593
|
+
e2 = false, s2.current?.length > 0 && De("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Oe.splice(Oe.indexOf(n2), 1), Ke();
|
|
920
594
|
};
|
|
921
|
-
}, [
|
|
922
|
-
},
|
|
923
|
-
const n2 =
|
|
924
|
-
return
|
|
925
|
-
if (
|
|
926
|
-
const n3 =
|
|
927
|
-
T(n3).render(
|
|
928
|
-
} else
|
|
929
|
-
})(
|
|
930
|
-
|
|
595
|
+
}, [t2]), e(n, { children: o2.map(({ hook: e2, key: t3 }) => _(ke, { ...e2, key: t3 })) });
|
|
596
|
+
}, Re = (t2) => {
|
|
597
|
+
const n2 = Ae++;
|
|
598
|
+
return $e.push({ hook: t2, key: n2 }), 0 === Oe.length && false === Be && (ze = true, ((t3) => {
|
|
599
|
+
if (Pe.document && Pe.document.createElement) {
|
|
600
|
+
const n3 = Pe.document.createElement("div");
|
|
601
|
+
T(n3).render(e(t3, { automaticContainerInternalUseOnly: true }));
|
|
602
|
+
} else De("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
|
|
603
|
+
})(He)), Ke(), () => {
|
|
604
|
+
$e.splice($e.findIndex((e2) => e2.key === n2), 1), Ke();
|
|
931
605
|
};
|
|
932
606
|
};
|
|
933
|
-
let
|
|
934
|
-
|
|
607
|
+
let Ve = null;
|
|
608
|
+
Ve || (Ve = (e2, t2, n2 = {}) => {
|
|
935
609
|
let o2, i2, r2 = false, s2 = false, l2 = [], { unmountIfNoConsumers: h2 = false } = n2;
|
|
936
|
-
const u2 = (
|
|
937
|
-
i2 =
|
|
938
|
-
}, d2 = () => (s2 || (i2 = "function" == typeof
|
|
610
|
+
const u2 = (e3) => {
|
|
611
|
+
i2 = e3, k(() => l2.forEach((t3) => t3(e3)));
|
|
612
|
+
}, d2 = () => (s2 || (i2 = "function" == typeof e2 ? e2() : e2, s2 = true), i2);
|
|
939
613
|
return () => {
|
|
940
614
|
const [n3, s3] = a(d2);
|
|
941
|
-
return c(() => (r2 || (r2 = true, o2 =
|
|
615
|
+
return c(() => (r2 || (r2 = true, o2 = Re({ initValue: e2, useHookBody: t2, applyStateChange: u2 })), l2.push(s3), i2 !== n3 && s3(i2), () => {
|
|
942
616
|
l2.splice(l2.indexOf(s3), 1), 0 === l2.length && h2 && (o2(), r2 = false);
|
|
943
617
|
}), []), n3;
|
|
944
618
|
};
|
|
945
619
|
});
|
|
946
|
-
const
|
|
947
|
-
let
|
|
620
|
+
const Ne = Ve;
|
|
621
|
+
let We = () => {
|
|
948
622
|
console.warn("You must call useEditMode before setting its state.");
|
|
949
623
|
};
|
|
950
|
-
const
|
|
951
|
-
const [
|
|
952
|
-
return
|
|
953
|
-
}),
|
|
954
|
-
const
|
|
955
|
-
return h(() => ({ setMode: (
|
|
956
|
-
|
|
957
|
-
}, getMode: () =>
|
|
624
|
+
const Ie = Ne(null, () => {
|
|
625
|
+
const [e2, t2] = a(null);
|
|
626
|
+
return We = t2, e2;
|
|
627
|
+
}), je = () => {
|
|
628
|
+
const e2 = Ie();
|
|
629
|
+
return h(() => ({ setMode: (e3) => {
|
|
630
|
+
We((t2) => ("function" == typeof e3 && (e3 = e3(t2)), e3?.onModeChange?.(e3 ?? null), e3));
|
|
631
|
+
}, getMode: () => e2 }), [e2]);
|
|
958
632
|
};
|
|
959
|
-
class
|
|
960
|
-
constructor(
|
|
961
|
-
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key =
|
|
633
|
+
class Fe {
|
|
634
|
+
constructor(e2, t2, n2, o2) {
|
|
635
|
+
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = e2, this._target = t2, this._applyProps(n2 || {}), this._callback = o2, void 0 === o2 && (this._callback = () => {
|
|
962
636
|
console.log(`implement: ${this.label()} : ${this.description()}`);
|
|
963
637
|
});
|
|
964
638
|
}
|
|
965
639
|
key() {
|
|
966
640
|
return this._key;
|
|
967
641
|
}
|
|
968
|
-
_resolve(
|
|
969
|
-
if ("function" == typeof
|
|
970
|
-
const n2 =
|
|
971
|
-
return
|
|
642
|
+
_resolve(e2, t2) {
|
|
643
|
+
if ("function" == typeof e2) {
|
|
644
|
+
const n2 = t2 ?? this._context;
|
|
645
|
+
return e2("function" == typeof n2 ? n2() : n2);
|
|
972
646
|
}
|
|
973
|
-
return
|
|
647
|
+
return e2;
|
|
974
648
|
}
|
|
975
649
|
target() {
|
|
976
650
|
return "function" == typeof this._target ? this._target() : this._target;
|
|
977
651
|
}
|
|
978
|
-
label(
|
|
979
|
-
const n2 = this._scopedLabels?.[
|
|
652
|
+
label(e2, t2) {
|
|
653
|
+
const n2 = this._scopedLabels?.[e2] || this._label;
|
|
980
654
|
let o2 = null;
|
|
981
655
|
if ("function" == typeof n2) {
|
|
982
|
-
const
|
|
983
|
-
o2 = n2("function" == typeof
|
|
656
|
+
const e3 = t2 ?? this._context;
|
|
657
|
+
o2 = n2("function" == typeof e3 ? e3() : e3);
|
|
984
658
|
} else o2 = n2;
|
|
985
659
|
return o2;
|
|
986
660
|
}
|
|
987
|
-
description(
|
|
988
|
-
return this._resolve(this._description,
|
|
661
|
+
description(e2) {
|
|
662
|
+
return this._resolve(this._description, e2);
|
|
989
663
|
}
|
|
990
|
-
tags(
|
|
991
|
-
return this._resolve(this._tags,
|
|
664
|
+
tags(e2) {
|
|
665
|
+
return this._resolve(this._tags, e2);
|
|
992
666
|
}
|
|
993
|
-
icon(
|
|
994
|
-
return this._resolve(this._icon,
|
|
667
|
+
icon(e2) {
|
|
668
|
+
return this._resolve(this._icon, e2);
|
|
995
669
|
}
|
|
996
670
|
shortcut() {
|
|
997
671
|
return this._resolve(this._shortcut);
|
|
@@ -1005,120 +679,120 @@ class ae {
|
|
|
1005
679
|
context() {
|
|
1006
680
|
return "function" == typeof this._context ? this._context() : this._context;
|
|
1007
681
|
}
|
|
1008
|
-
async execute(
|
|
682
|
+
async execute(e2, t2) {
|
|
1009
683
|
if (!this.disabled() && this._callback) {
|
|
1010
684
|
try {
|
|
1011
685
|
let n2 = true;
|
|
1012
|
-
|
|
686
|
+
t2?.beforeExecute && (n2 = t2?.beforeExecute(this, e2));
|
|
1013
687
|
if (false === await Promise.resolve(n2)) return false;
|
|
1014
|
-
const o2 = this._callback.bind(this)(
|
|
688
|
+
const o2 = this._callback.bind(this)(e2, this);
|
|
1015
689
|
if (false === await Promise.resolve(o2)) return false;
|
|
1016
|
-
|
|
690
|
+
t2?.onExecute?.(this, e2), this._notifyExecute(e2);
|
|
1017
691
|
} catch (n2) {
|
|
1018
|
-
return console.warn(n2),
|
|
692
|
+
return console.warn(n2), t2?.onError(this, n2, e2), this._notifyError(e2, n2), false;
|
|
1019
693
|
}
|
|
1020
694
|
return true;
|
|
1021
695
|
}
|
|
1022
696
|
}
|
|
1023
|
-
addPropertyListener(
|
|
1024
|
-
if (!
|
|
697
|
+
addPropertyListener(e2, t2 = false) {
|
|
698
|
+
if (!e2) throw new Error("listener must be specified");
|
|
1025
699
|
const n2 = this._listenersProperties;
|
|
1026
|
-
return n2.add(
|
|
1027
|
-
n2.delete(
|
|
700
|
+
return n2.add(e2), t2 && e2({}, this), () => {
|
|
701
|
+
n2.delete(e2);
|
|
1028
702
|
};
|
|
1029
703
|
}
|
|
1030
|
-
addExecuteListener(
|
|
1031
|
-
if (!
|
|
1032
|
-
const
|
|
1033
|
-
return
|
|
1034
|
-
|
|
704
|
+
addExecuteListener(e2) {
|
|
705
|
+
if (!e2) throw new Error("listener must be specified");
|
|
706
|
+
const t2 = this._listenersExecute;
|
|
707
|
+
return t2.add(e2), function() {
|
|
708
|
+
t2.delete(e2);
|
|
1035
709
|
};
|
|
1036
710
|
}
|
|
1037
|
-
_notifyExecute(
|
|
1038
|
-
const
|
|
711
|
+
_notifyExecute(e2) {
|
|
712
|
+
const t2 = this;
|
|
1039
713
|
this._listenersExecute.forEach((n2) => {
|
|
1040
|
-
n2.onExecute(
|
|
714
|
+
n2.onExecute(t2, e2);
|
|
1041
715
|
});
|
|
1042
716
|
}
|
|
1043
|
-
_notifyError(
|
|
717
|
+
_notifyError(e2, t2) {
|
|
1044
718
|
const n2 = this;
|
|
1045
719
|
this._listenersExecute.forEach((o2) => {
|
|
1046
|
-
o2.onError?.(n2,
|
|
720
|
+
o2.onError?.(n2, e2, t2);
|
|
1047
721
|
});
|
|
1048
722
|
}
|
|
1049
|
-
updateCallback(
|
|
1050
|
-
return this._callback =
|
|
723
|
+
updateCallback(e2) {
|
|
724
|
+
return this._callback = e2 || null, this;
|
|
1051
725
|
}
|
|
1052
|
-
update(
|
|
1053
|
-
if (!
|
|
1054
|
-
const
|
|
1055
|
-
return Object.keys(
|
|
726
|
+
update(e2) {
|
|
727
|
+
if (!e2) return;
|
|
728
|
+
const t2 = this._applyProps(e2);
|
|
729
|
+
return Object.keys(t2).length > 0 && this._notifyPropertyChange(t2), this;
|
|
1056
730
|
}
|
|
1057
|
-
_notifyPropertyChange(
|
|
1058
|
-
const
|
|
731
|
+
_notifyPropertyChange(e2) {
|
|
732
|
+
const t2 = this;
|
|
1059
733
|
this._listenersProperties.forEach((n2) => {
|
|
1060
|
-
n2(
|
|
734
|
+
n2(e2, t2);
|
|
1061
735
|
});
|
|
1062
736
|
}
|
|
1063
|
-
_applyProps(
|
|
1064
|
-
let
|
|
1065
|
-
return Object.keys(
|
|
1066
|
-
let i2 =
|
|
1067
|
-
n2["_" + o2] !== i2 && (n2["_" + o2] =
|
|
1068
|
-
}),
|
|
737
|
+
_applyProps(e2) {
|
|
738
|
+
let t2 = {}, n2 = this;
|
|
739
|
+
return Object.keys(e2).forEach((o2) => {
|
|
740
|
+
let i2 = e2[o2];
|
|
741
|
+
n2["_" + o2] !== i2 && (n2["_" + o2] = t2[o2] = i2);
|
|
742
|
+
}), t2;
|
|
1069
743
|
}
|
|
1070
744
|
}
|
|
1071
|
-
class
|
|
745
|
+
class Ye extends Fe {
|
|
1072
746
|
}
|
|
1073
|
-
class
|
|
1074
|
-
constructor(
|
|
1075
|
-
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid =
|
|
747
|
+
class Xe {
|
|
748
|
+
constructor(e2, t2) {
|
|
749
|
+
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = x.uuidV4(), this._target = e2, this._groupKey = t2 ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(t2, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
|
|
1076
750
|
const n2 = this;
|
|
1077
|
-
this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (
|
|
1078
|
-
const o2 = n2._root._listenersByKey, i2 =
|
|
1079
|
-
r2 && n2._notifyCommands(r2, "onCommandChange",
|
|
751
|
+
this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (e3, t3) => {
|
|
752
|
+
const o2 = n2._root._listenersByKey, i2 = t3.key(), r2 = o2.get(i2);
|
|
753
|
+
r2 && n2._notifyCommands(r2, "onCommandChange", t3);
|
|
1080
754
|
};
|
|
1081
755
|
}
|
|
1082
|
-
_getCommand(
|
|
1083
|
-
const
|
|
1084
|
-
return
|
|
756
|
+
_getCommand(e2) {
|
|
757
|
+
const t2 = this._commandsByKey.get(e2);
|
|
758
|
+
return t2 || (this._parent?._getCommand(e2) ?? null);
|
|
1085
759
|
}
|
|
1086
|
-
getCommand(
|
|
760
|
+
getCommand(e2, t2 = false) {
|
|
1087
761
|
const n2 = this._root._focused;
|
|
1088
762
|
let o2 = n2, i2 = n2 === this;
|
|
1089
763
|
for (; !i2 && o2; ) o2 === this && (i2 = true), o2 = o2._parent;
|
|
1090
|
-
return (i2 ? n2 : this)._getCommand(
|
|
764
|
+
return (i2 ? n2 : this)._getCommand(e2);
|
|
1091
765
|
}
|
|
1092
|
-
createChildGroup(
|
|
766
|
+
createChildGroup(e2, t2, n2) {
|
|
1093
767
|
let o2;
|
|
1094
768
|
if (!n2) {
|
|
1095
|
-
let
|
|
1096
|
-
for (;
|
|
1097
|
-
let n3 =
|
|
1098
|
-
n3 && (o2 = n3),
|
|
769
|
+
let e3 = this;
|
|
770
|
+
for (; e3 && !o2; ) {
|
|
771
|
+
let n3 = e3._nodes.get(t2);
|
|
772
|
+
n3 && (o2 = n3), e3 = e3._parent;
|
|
1099
773
|
}
|
|
1100
774
|
}
|
|
1101
|
-
o2 || (o2 = new
|
|
1102
|
-
const i2 = (
|
|
1103
|
-
!
|
|
775
|
+
o2 || (o2 = new Xe(e2, t2), o2._parent = this, o2._root = this._root, o2._unListenersByCommand = null, o2._listenersByKey = null, o2._commandsPropertyListener = null);
|
|
776
|
+
const i2 = (e3, o3) => {
|
|
777
|
+
!e3.has(t2) || n2 ? e3.set(t2, o3) : void 0 === n2 && console.warn("commandGroup already registered", t2);
|
|
1104
778
|
};
|
|
1105
779
|
i2(this._root._nodes, o2);
|
|
1106
780
|
let r2 = this._parent;
|
|
1107
781
|
for (; r2; ) i2(this._nodes, o2), r2 = r2._parent;
|
|
1108
|
-
return this._children.set(
|
|
782
|
+
return this._children.set(t2, o2), this._notify("onGroupChange"), o2;
|
|
1109
783
|
}
|
|
1110
784
|
getKey() {
|
|
1111
785
|
return this._groupKey;
|
|
1112
786
|
}
|
|
1113
|
-
getGroup(
|
|
1114
|
-
return this._nodes.get(
|
|
787
|
+
getGroup(e2) {
|
|
788
|
+
return this._nodes.get(e2);
|
|
1115
789
|
}
|
|
1116
|
-
_addCommands(
|
|
790
|
+
_addCommands(e2, t2 = void 0) {
|
|
1117
791
|
const n2 = this._commandsByKey, o2 = this._commandsByShortcut, i2 = this._root._commandsPropertyListener, r2 = this._root._unListenersByCommand;
|
|
1118
|
-
for (let s2 = 0; s2 <
|
|
1119
|
-
const l2 =
|
|
1120
|
-
if (n2.has(a2) && !
|
|
1121
|
-
void 0 ===
|
|
792
|
+
for (let s2 = 0; s2 < e2.length; s2++) {
|
|
793
|
+
const l2 = e2[s2], a2 = l2.key();
|
|
794
|
+
if (n2.has(a2) && !t2) {
|
|
795
|
+
void 0 === t2 && console.warn("command already registered", a2);
|
|
1122
796
|
continue;
|
|
1123
797
|
}
|
|
1124
798
|
n2.set(a2, l2);
|
|
@@ -1129,55 +803,55 @@ class he {
|
|
|
1129
803
|
const u2 = l2.shortcut();
|
|
1130
804
|
if (!u2) continue;
|
|
1131
805
|
const d2 = Array.isArray(u2) ? u2 : [u2];
|
|
1132
|
-
for (let
|
|
1133
|
-
const n3 =
|
|
1134
|
-
i3 && !
|
|
806
|
+
for (let e3 = 0; e3 < d2.length; e3++) {
|
|
807
|
+
const n3 = Ze(d2[e3]), i3 = o2.get(n3);
|
|
808
|
+
i3 && !t2 && void 0 === t2 && console.warn(`Shortcut already registered: ${n3}, ${a2}, ${i3}.`), o2.set(n3, a2);
|
|
1135
809
|
}
|
|
1136
810
|
}
|
|
1137
811
|
}
|
|
1138
812
|
removeFromParent() {
|
|
1139
813
|
if (!this._parent) return;
|
|
1140
|
-
let
|
|
814
|
+
let e2 = this._parent, t2 = [];
|
|
1141
815
|
const n2 = this._groupKey;
|
|
1142
|
-
for (;
|
|
1143
|
-
|
|
1144
|
-
const o2 = (
|
|
1145
|
-
|
|
1146
|
-
for (let n3 = 0; n3 <
|
|
1147
|
-
o2(
|
|
816
|
+
for (; e2; ) t2.push(e2._nodes), e2._nodes.delete(n2), e2 = e2._parent;
|
|
817
|
+
e2 = this._parent;
|
|
818
|
+
const o2 = (e3) => {
|
|
819
|
+
e3._children.forEach((e4) => {
|
|
820
|
+
for (let n3 = 0; n3 < t2.length; n3++) e4._nodes.delete(t2[n3]);
|
|
821
|
+
o2(e4);
|
|
1148
822
|
});
|
|
1149
823
|
};
|
|
1150
824
|
o2(this), this._parent = null, this._notify("onGroupChange");
|
|
1151
825
|
}
|
|
1152
|
-
addCommands(
|
|
1153
|
-
this._addCommands(
|
|
826
|
+
addCommands(e2, t2) {
|
|
827
|
+
this._addCommands(e2, t2), this._notify("onGroupChange");
|
|
1154
828
|
}
|
|
1155
829
|
getActive() {
|
|
1156
830
|
return this._root._focused ?? this._root;
|
|
1157
831
|
}
|
|
1158
|
-
activate(
|
|
1159
|
-
let
|
|
1160
|
-
if (
|
|
832
|
+
activate(e2) {
|
|
833
|
+
let t2 = this;
|
|
834
|
+
if (e2 && (t2 = this._nodes.get(e2), !t2)) return void console.warn("group not found", e2);
|
|
1161
835
|
let n2 = this._root._focused ?? this._root;
|
|
1162
836
|
for (; n2; ) n2 = n2._parent;
|
|
1163
|
-
this._root._focused !==
|
|
837
|
+
this._root._focused !== t2 && (this._root._focused = t2, this._notify("onGroupChange"), this._notify("onActiveChange"));
|
|
1164
838
|
}
|
|
1165
|
-
findCommandByEvent(
|
|
1166
|
-
const
|
|
1167
|
-
|
|
1168
|
-
let n2 =
|
|
839
|
+
findCommandByEvent(e2) {
|
|
840
|
+
const t2 = [];
|
|
841
|
+
e2.altKey && t2.push(P.Alt), e2.shiftKey && t2.push(P.Shift), e2.ctrlKey && t2.push(P.Ctrl), e2.metaKey && t2.push(P.Meta);
|
|
842
|
+
let n2 = Ze({ key: e2.code, modifiers: t2 });
|
|
1169
843
|
const o2 = this._commandsByShortcut;
|
|
1170
844
|
let i2 = o2.get(n2);
|
|
1171
|
-
i2 || (n2 =
|
|
845
|
+
i2 || (n2 = Ze({ key: e2.key, modifiers: t2 }), i2 = o2.get(n2)), !i2 && e2.code.startsWith("Digit") && (n2 = Ze({ key: e2.code.substring(5, e2.code.length), modifiers: t2 }), i2 = this._commandsByShortcut.get(n2)), !i2 && e2.code.startsWith("Key") && (i2 = Ze({ key: e2.code.substring(3, e2.code.length), modifiers: t2 }), i2 = o2.get(n2));
|
|
1172
846
|
let r2 = null;
|
|
1173
|
-
return i2 && (r2 = this._commandsByKey.get(i2), r2 && r2.disabled() && (r2 = null), !r2 || r2.target() && r2.target().contains(
|
|
847
|
+
return i2 && (r2 = this._commandsByKey.get(i2), r2 && r2.disabled() && (r2 = null), !r2 || r2.target() && r2.target().contains(e2.target) || (r2 = null)), r2 || (this._parent?.findCommandByEvent(e2) ?? null);
|
|
1174
848
|
}
|
|
1175
|
-
dispatchToFocusedCommand(
|
|
1176
|
-
const
|
|
1177
|
-
if (!
|
|
1178
|
-
if (
|
|
1179
|
-
const n2 =
|
|
1180
|
-
return !!n2 && (n2.execute(),
|
|
849
|
+
dispatchToFocusedCommand(e2) {
|
|
850
|
+
const t2 = this.getActive();
|
|
851
|
+
if (!t2) return false;
|
|
852
|
+
if (e2.isDefaultPrevented()) return false;
|
|
853
|
+
const n2 = t2.findCommandByEvent?.(e2);
|
|
854
|
+
return !!n2 && (n2.execute(), e2.preventDefault(), true);
|
|
1181
855
|
}
|
|
1182
856
|
getRoot() {
|
|
1183
857
|
return this._parent ? this._parent.getRoot() : this;
|
|
@@ -1185,305 +859,682 @@ class he {
|
|
|
1185
859
|
getParent() {
|
|
1186
860
|
return this._parent;
|
|
1187
861
|
}
|
|
1188
|
-
addListener(
|
|
1189
|
-
const n2 = this._listeners, o2 =
|
|
1190
|
-
if (o2 && !
|
|
862
|
+
addListener(e2, t2) {
|
|
863
|
+
const n2 = this._listeners, o2 = t2?.keys, i2 = this._root._listenersByKey;
|
|
864
|
+
if (o2 && !e2.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
|
|
1191
865
|
let r2 = null;
|
|
1192
|
-
if (o2) for (let
|
|
1193
|
-
const n3 = o2[
|
|
866
|
+
if (o2) for (let t3 = 0; t3 < o2.length; t3++) {
|
|
867
|
+
const n3 = o2[t3];
|
|
1194
868
|
if (!n3) continue;
|
|
1195
869
|
let s2 = i2.get(n3);
|
|
1196
|
-
s2 || (s2 = /* @__PURE__ */ new Set(), i2.set(n3, s2)), r2 || (r2 = []), r2.push(s2), s2.add(
|
|
870
|
+
s2 || (s2 = /* @__PURE__ */ new Set(), i2.set(n3, s2)), r2 || (r2 = []), r2.push(s2), s2.add(e2);
|
|
1197
871
|
}
|
|
1198
|
-
return n2.add(
|
|
1199
|
-
if (r2) for (let
|
|
1200
|
-
r2[
|
|
872
|
+
return n2.add(e2), () => {
|
|
873
|
+
if (r2) for (let t3 = 0; t3 < r2.length; t3++) {
|
|
874
|
+
r2[t3].delete(e2);
|
|
1201
875
|
}
|
|
1202
|
-
n2.delete(
|
|
876
|
+
n2.delete(e2);
|
|
1203
877
|
};
|
|
1204
878
|
}
|
|
1205
|
-
_notifyCommands(
|
|
879
|
+
_notifyCommands(e2, t2, n2) {
|
|
1206
880
|
const o2 = this;
|
|
1207
881
|
setTimeout(() => {
|
|
1208
|
-
|
|
1209
|
-
|
|
882
|
+
e2.forEach((e3) => {
|
|
883
|
+
e3[t2]?.(o2, n2);
|
|
1210
884
|
});
|
|
1211
885
|
}, 0);
|
|
1212
886
|
}
|
|
1213
|
-
_notify(
|
|
887
|
+
_notify(e2, t2) {
|
|
1214
888
|
const n2 = this;
|
|
1215
889
|
setTimeout(() => {
|
|
1216
890
|
n2._listeners.forEach((o2) => {
|
|
1217
|
-
o2[
|
|
1218
|
-
}), n2._parent && n2._parent._notify(
|
|
891
|
+
o2[e2]?.(n2, t2);
|
|
892
|
+
}), n2._parent && n2._parent._notify(e2, t2);
|
|
1219
893
|
}, 0);
|
|
1220
894
|
}
|
|
1221
895
|
getAllCommands() {
|
|
1222
|
-
const
|
|
896
|
+
const e2 = [], t2 = this._groupKey;
|
|
1223
897
|
return this._commandsByKey.forEach((n2) => {
|
|
1224
|
-
|
|
1225
|
-
}), this._children.forEach((
|
|
1226
|
-
|
|
1227
|
-
}),
|
|
898
|
+
e2.push({ command: n2, groupKey: t2 });
|
|
899
|
+
}), this._children.forEach((t3) => {
|
|
900
|
+
e2.push(...t3.getAllCommands());
|
|
901
|
+
}), e2;
|
|
1228
902
|
}
|
|
1229
903
|
}
|
|
1230
|
-
const
|
|
904
|
+
const Ue = x.getOS() === x.OSType.MacOS || x.getOS() === x.OSType.IOS ? "Cmd" : "Ctrl", Ge = x.getOS() === x.OSType.MacOS || x.getOS() === x.OSType.IOS ? "⌘" : "^", Ze = (e2, t2 = false) => {
|
|
1231
905
|
const n2 = {};
|
|
1232
|
-
for (let
|
|
906
|
+
for (let t3 = 0; e2.modifiers && t3 < e2.modifiers.length; t3++) n2[e2.modifiers[t3]] = true;
|
|
1233
907
|
let o2 = "";
|
|
1234
|
-
return (n2?.[
|
|
908
|
+
return (n2?.[P.Ctrl] || n2?.[P.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (t2 ? Ge : Ue)), n2?.[P.Alt] && (o2 += t2 ? "⌥" : "Alt"), n2?.[P.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (t2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + te(e2.key), o2;
|
|
1235
909
|
};
|
|
1236
|
-
function
|
|
1237
|
-
const n2 = r(
|
|
1238
|
-
n2.current =
|
|
1239
|
-
const [o2, i2] = m((
|
|
910
|
+
function qe(e2, t2 = null) {
|
|
911
|
+
const n2 = r(t2);
|
|
912
|
+
n2.current = t2;
|
|
913
|
+
const [o2, i2] = m((e3) => e3 + 1, 0), s2 = h(() => Array.isArray(e2) ? e2 : [e2], [e2]);
|
|
1240
914
|
return c(() => {
|
|
1241
915
|
if (!s2 || 0 === s2.length) return;
|
|
1242
|
-
const
|
|
1243
|
-
n2.current?.onChange?.(
|
|
916
|
+
const e3 = (e4, t3) => {
|
|
917
|
+
n2.current?.onChange?.(t3), i2();
|
|
1244
918
|
};
|
|
1245
919
|
let o3 = null;
|
|
1246
|
-
|
|
1247
|
-
n2.current?.onExecute?.(
|
|
1248
|
-
}, onError(
|
|
1249
|
-
n2.current?.onError?.(
|
|
920
|
+
t2 && (o3 = { onExecute(e4, t3) {
|
|
921
|
+
n2.current?.onExecute?.(e4, t3);
|
|
922
|
+
}, onError(e4, t3, o4) {
|
|
923
|
+
n2.current?.onError?.(e4, t3, o4);
|
|
1250
924
|
} });
|
|
1251
925
|
const r2 = /* @__PURE__ */ new Set();
|
|
1252
|
-
for (let n3 = 0; n3 < s2.length; n3++) r2.add(s2[n3]?.addPropertyListener(
|
|
926
|
+
for (let n3 = 0; n3 < s2.length; n3++) r2.add(s2[n3]?.addPropertyListener(x.debounce(e3, 0), true)), t2 && r2.add(s2[n3]?.addExecuteListener(o3));
|
|
1253
927
|
return () => {
|
|
1254
|
-
r2.forEach((
|
|
1255
|
-
|
|
928
|
+
r2.forEach((e4) => {
|
|
929
|
+
e4?.();
|
|
1256
930
|
});
|
|
1257
931
|
};
|
|
1258
|
-
}, [
|
|
932
|
+
}, [e2]), o2;
|
|
1259
933
|
}
|
|
1260
|
-
const
|
|
1261
|
-
if (!
|
|
1262
|
-
const n2 =
|
|
934
|
+
const Je = (e2, t2) => {
|
|
935
|
+
if (!t2 || !e2 || 0 === t2.length) return x.EmptyArray;
|
|
936
|
+
const n2 = t2.length, o2 = new Array(n2);
|
|
1263
937
|
for (let i2 = 0; i2 < n2; i2++) {
|
|
1264
|
-
const n3 =
|
|
938
|
+
const n3 = t2[i2], r2 = n3 ? e2.getCommand(n3) : null;
|
|
1265
939
|
o2[i2] = r2;
|
|
1266
940
|
}
|
|
1267
941
|
return o2;
|
|
1268
942
|
};
|
|
1269
|
-
function
|
|
943
|
+
function Qe(e2, t2 = null, n2 = null, o2) {
|
|
1270
944
|
const i2 = r(n2);
|
|
1271
|
-
i2.current = n2,
|
|
1272
|
-
const [s2, l2] = a(
|
|
945
|
+
i2.current = n2, t2 && !Array.isArray(t2) && (t2 = [t2]);
|
|
946
|
+
const [s2, l2] = a(Je(e2, t2)), h2 = o2 ? [...o2, e2] : [e2];
|
|
1273
947
|
return c(() => {
|
|
1274
948
|
const n3 = { onGroupChange: () => {
|
|
1275
|
-
const n4 =
|
|
949
|
+
const n4 = Je(e2, t2);
|
|
1276
950
|
l2(n4), i2.current?.onChange?.(this);
|
|
1277
951
|
} };
|
|
1278
952
|
let o3;
|
|
1279
|
-
|
|
1280
|
-
i2.current?.onChange?.(
|
|
953
|
+
t2 && t2.length > 0 && (o3 = { keys: t2 }, n3.onCommandChange = (n4, o4) => {
|
|
954
|
+
i2.current?.onChange?.(e2), l2(Je(e2, t2));
|
|
1281
955
|
});
|
|
1282
|
-
const r2 =
|
|
1283
|
-
return l2(s3), i2.current?.onChange && i2.current?.onChange(
|
|
956
|
+
const r2 = e2?.addListener(n3, o3), s3 = Je(e2, t2);
|
|
957
|
+
return l2(s3), i2.current?.onChange && i2.current?.onChange(e2), () => {
|
|
1284
958
|
r2?.();
|
|
1285
959
|
};
|
|
1286
960
|
}, h2), s2;
|
|
1287
961
|
}
|
|
1288
|
-
const
|
|
962
|
+
const et = { Toolbar: "toolbar", Menuitem: "menuitem" }, tt = Ne({ setClipboard: (e2) => {
|
|
1289
963
|
throw new Error("This is only available via the useClipboard.");
|
|
1290
|
-
}, getClipboard: () =>
|
|
1291
|
-
const [
|
|
1292
|
-
return { setClipboard: (
|
|
1293
|
-
}),
|
|
1294
|
-
const { source:
|
|
964
|
+
}, getClipboard: () => S.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
|
|
965
|
+
const [e2, t2] = a(S.Global);
|
|
966
|
+
return { setClipboard: (e3) => t2(e3), getClipboard: () => e2, refNativeCopy: r(null), refNativeLastKey: r(null) };
|
|
967
|
+
}), nt = (e2) => {
|
|
968
|
+
const { source: t2, target: n2, onPaste: o2, onClipboardUpdate: r2, commands: s2 } = e2, l2 = Se(), a2 = $(r2, [r2]), u2 = $(o2, [o2]), { getClipboard: d2, refNativeCopy: p2 } = tt(), f2 = d2();
|
|
1295
969
|
h(() => {
|
|
1296
|
-
const
|
|
970
|
+
const e3 = t2?.element, o3 = n2?.element ?? t2?.element;
|
|
1297
971
|
if (!s2) return;
|
|
1298
|
-
const i2 = [new
|
|
972
|
+
const i2 = [new Ye("cut", e3, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [P.Ctrl] } }), new Ye("copy", e3, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", icon: "copy", shortcut: { key: "C", modifiers: [P.Ctrl] } }), new Ye("paste", o3, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste", shortcut: [{ key: "V", modifiers: [P.Ctrl] }, { key: "F8", modifiers: [P.Ctrl] }] })];
|
|
1299
973
|
s2?.addCommands(i2, true);
|
|
1300
974
|
}, [s2]);
|
|
1301
|
-
const _2 =
|
|
1302
|
-
if (!
|
|
975
|
+
const _2 = $(async (e3) => {
|
|
976
|
+
if (!t2?.element) return;
|
|
1303
977
|
let n3 = null;
|
|
1304
978
|
try {
|
|
1305
|
-
n3 =
|
|
1306
|
-
} catch (
|
|
1307
|
-
throw
|
|
979
|
+
n3 = t2.doCopy?.(e3), "string" == typeof n3 ? await f2.writeText(n3) : await f2.writeReference(n3);
|
|
980
|
+
} catch (e4) {
|
|
981
|
+
throw e4;
|
|
1308
982
|
}
|
|
1309
|
-
}, [
|
|
1310
|
-
const n3 =
|
|
983
|
+
}, [t2, l2]), m2 = $(async (e3) => {
|
|
984
|
+
const n3 = t2?.element?.();
|
|
1311
985
|
if (n3) {
|
|
1312
|
-
p2.current = { sourceElement: n3, args:
|
|
986
|
+
p2.current = { sourceElement: n3, args: e3 };
|
|
1313
987
|
try {
|
|
1314
|
-
await _2(
|
|
1315
|
-
} catch (
|
|
1316
|
-
l2.showError?.(
|
|
988
|
+
await _2(e3);
|
|
989
|
+
} catch (e4) {
|
|
990
|
+
l2.showError?.(e4);
|
|
1317
991
|
}
|
|
1318
992
|
}
|
|
1319
|
-
}, [
|
|
993
|
+
}, [t2?.element, l2]), g2 = i(() => {
|
|
1320
994
|
m2({ isCut: true });
|
|
1321
|
-
}, []), y2 =
|
|
995
|
+
}, []), y2 = $(async (e3, t3, n3) => {
|
|
1322
996
|
try {
|
|
1323
|
-
if (false === await
|
|
1324
|
-
u2?.(
|
|
1325
|
-
} catch (
|
|
1326
|
-
l2.showError?.(
|
|
997
|
+
if (false === await e3.doPaste(t3, n3)) return;
|
|
998
|
+
u2?.(t3, n3);
|
|
999
|
+
} catch (e4) {
|
|
1000
|
+
l2.showError?.(e4);
|
|
1327
1001
|
}
|
|
1328
|
-
}, [u2]),
|
|
1002
|
+
}, [u2]), v2 = $(async (e3, t3, o3) => {
|
|
1329
1003
|
const i2 = n2?.element?.();
|
|
1330
|
-
if (i2 && await
|
|
1004
|
+
if (i2 && await x.whenFocus(i2), !e3 && !t3) return;
|
|
1331
1005
|
const r3 = await l2.showBusy?.("Pasting...");
|
|
1332
|
-
if (
|
|
1333
|
-
return await y2(n2,
|
|
1334
|
-
} catch (
|
|
1335
|
-
r3?.(), l2.showError?.(
|
|
1006
|
+
if (t3) try {
|
|
1007
|
+
return await y2(n2, t3, o3), void r3?.();
|
|
1008
|
+
} catch (e4) {
|
|
1009
|
+
r3?.(), l2.showError?.(e4);
|
|
1336
1010
|
}
|
|
1337
1011
|
let s3, a3 = n2.importFromExternal;
|
|
1338
|
-
a3 || (a3 = (
|
|
1012
|
+
a3 || (a3 = (t4, n3) => ({ getItemType: () => "text", toText: () => e3.text, isClipboardItem: true }));
|
|
1339
1013
|
try {
|
|
1340
|
-
s3 = await a3(
|
|
1341
|
-
} catch (
|
|
1342
|
-
r3?.(), l2.showError?.(
|
|
1014
|
+
s3 = await a3(e3, { isCut: false });
|
|
1015
|
+
} catch (e4) {
|
|
1016
|
+
r3?.(), l2.showError?.(e4);
|
|
1343
1017
|
}
|
|
1344
1018
|
if (s3) try {
|
|
1345
|
-
const
|
|
1346
|
-
await y2(n2,
|
|
1347
|
-
} catch (
|
|
1348
|
-
r3?.(), l2.showError?.(
|
|
1019
|
+
const e4 = await Promise.resolve(s3);
|
|
1020
|
+
await y2(n2, e4, o3), r3?.();
|
|
1021
|
+
} catch (e4) {
|
|
1022
|
+
r3?.(), l2.showError?.(e4);
|
|
1349
1023
|
}
|
|
1350
1024
|
else r3?.();
|
|
1351
|
-
}, [y2, n2, l2]), w2 =
|
|
1025
|
+
}, [y2, n2, l2]), w2 = $(async (e3) => {
|
|
1352
1026
|
if (n2?.element) try {
|
|
1353
|
-
const
|
|
1354
|
-
if (
|
|
1027
|
+
const t3 = await f2.readReference();
|
|
1028
|
+
if (t3) return void await v2(null, t3, e3);
|
|
1355
1029
|
const n3 = [];
|
|
1356
|
-
n3[0] = await
|
|
1030
|
+
n3[0] = await L.readStringFromClipboard(f2, E.plain), n3[1] = await L.readHTMLFromClipboard(f2, E.html), n3[2] = await L.readBlobFromClipboard(f2, E.png);
|
|
1357
1031
|
const o3 = { text: n3[0] ?? null, html: n3[1] ?? null, image: n3[2] ?? null };
|
|
1358
|
-
await
|
|
1359
|
-
} catch (
|
|
1360
|
-
if ("Document is not focused." ===
|
|
1361
|
-
l2.showError?.(
|
|
1032
|
+
await v2(o3, null, e3);
|
|
1033
|
+
} catch (e4) {
|
|
1034
|
+
if ("Document is not focused." === e4?.message) return;
|
|
1035
|
+
l2.showError?.(e4);
|
|
1362
1036
|
}
|
|
1363
|
-
}, [
|
|
1364
|
-
return
|
|
1365
|
-
}, [
|
|
1366
|
-
}, [n2?.element,
|
|
1037
|
+
}, [v2, n2?.element, l2]);
|
|
1038
|
+
return $(async (e3) => {
|
|
1039
|
+
}, [t2?.element]), $(async (e3) => {
|
|
1040
|
+
}, [n2?.element, v2, l2]), c(() => {
|
|
1367
1041
|
if (!f2) return;
|
|
1368
|
-
const
|
|
1369
|
-
const
|
|
1370
|
-
a2?.(
|
|
1371
|
-
},
|
|
1372
|
-
l2.showMessage?.(
|
|
1373
|
-
}, n3 = (
|
|
1374
|
-
l2.showMessage?.(
|
|
1042
|
+
const e3 = async (e4) => {
|
|
1043
|
+
const t4 = await f2.readReference();
|
|
1044
|
+
a2?.(t4);
|
|
1045
|
+
}, t3 = (e4) => {
|
|
1046
|
+
l2.showMessage?.(S.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
|
|
1047
|
+
}, n3 = (e4) => {
|
|
1048
|
+
l2.showMessage?.(S.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
|
|
1375
1049
|
};
|
|
1376
|
-
return f2.addEventListener("clipboardchange",
|
|
1377
|
-
f2.removeEventListener("clipboardchange",
|
|
1050
|
+
return f2.addEventListener("clipboardchange", e3), f2.addEventListener("clipboarderrorread", t3), f2.addEventListener("clipboarderrorwrite", n3), () => {
|
|
1051
|
+
f2.removeEventListener("clipboardchange", e3), f2.removeEventListener("clipboarderrorread", t3), f2.removeEventListener("clipboarderrorwrite", n3);
|
|
1378
1052
|
};
|
|
1379
1053
|
}, [f2, l2]), c(() => {
|
|
1380
|
-
}, [_2,
|
|
1381
|
-
s2?.getCommand("cut")?.updateCallback(g2).update({ disabled: !
|
|
1382
|
-
}, [
|
|
1054
|
+
}, [_2, v2, t2, n2]), c(() => {
|
|
1055
|
+
s2?.getCommand("cut")?.updateCallback(g2).update({ disabled: !t2 || !n2 }), s2?.getCommand("copy")?.updateCallback(m2).update({ disabled: !t2 }), s2?.getCommand("paste")?.updateCallback(w2).update({ disabled: !n2 });
|
|
1056
|
+
}, [t2, n2, s2]), { paste: w2, copy: m2, clipboard: f2 };
|
|
1383
1057
|
};
|
|
1384
|
-
function
|
|
1385
|
-
const n2 = r(
|
|
1058
|
+
function ot(e2, t2 = true) {
|
|
1059
|
+
const n2 = r(e2);
|
|
1386
1060
|
c(() => {
|
|
1387
|
-
if (
|
|
1388
|
-
const
|
|
1389
|
-
Object.keys(
|
|
1061
|
+
if (t2) {
|
|
1062
|
+
const t3 = Object.entries(e2).reduce((e3, [t4, o2]) => (n2.current[t4] !== o2 && (e3[t4] = [n2.current[t4], o2]), e3), {});
|
|
1063
|
+
Object.keys(t3).length > 0 && console.log("Changed props:", t3);
|
|
1390
1064
|
}
|
|
1391
|
-
n2.current =
|
|
1065
|
+
n2.current = e2;
|
|
1392
1066
|
});
|
|
1393
1067
|
}
|
|
1394
|
-
let
|
|
1395
|
-
var
|
|
1396
|
-
const
|
|
1397
|
-
const
|
|
1398
|
-
const [
|
|
1399
|
-
return
|
|
1400
|
-
null ==
|
|
1068
|
+
let it = false, rt = 0;
|
|
1069
|
+
var st = "undefined" != typeof document ? f : c;
|
|
1070
|
+
const lt = () => "sheetxl-ui-" + rt++;
|
|
1071
|
+
const at = o["useId".toString()], ct = null != at ? at : function() {
|
|
1072
|
+
const [e2, t2] = o.useState(() => it ? lt() : void 0);
|
|
1073
|
+
return st(() => {
|
|
1074
|
+
null == e2 && t2(lt());
|
|
1401
1075
|
}, []), o.useEffect(() => {
|
|
1402
|
-
|
|
1403
|
-
}, []),
|
|
1404
|
-
},
|
|
1405
|
-
const o2 =
|
|
1076
|
+
it || (it = true);
|
|
1077
|
+
}, []), e2;
|
|
1078
|
+
}, ht = "Undo the last action.", ut = "Repeat the last action or undo the redo.", dt = (e2) => `Redo ${e2}`, pt = ({ manager: e2, commands: t2, disabled: n2 }) => {
|
|
1079
|
+
const o2 = Se(), i2 = $((t3) => {
|
|
1406
1080
|
try {
|
|
1407
|
-
|
|
1408
|
-
} catch (
|
|
1409
|
-
o2.error(
|
|
1081
|
+
e2?.undo(t3);
|
|
1082
|
+
} catch (e3) {
|
|
1083
|
+
o2.error(e3);
|
|
1410
1084
|
}
|
|
1411
|
-
}, [
|
|
1085
|
+
}, [e2]), r2 = $((t3) => {
|
|
1412
1086
|
try {
|
|
1413
|
-
|
|
1414
|
-
} catch (
|
|
1415
|
-
o2.error(
|
|
1087
|
+
e2?.redo(t3);
|
|
1088
|
+
} catch (e3) {
|
|
1089
|
+
o2.error(e3);
|
|
1416
1090
|
}
|
|
1417
|
-
}, [
|
|
1091
|
+
}, [e2]);
|
|
1418
1092
|
return h(() => {
|
|
1419
|
-
if (!
|
|
1420
|
-
const
|
|
1421
|
-
} }, n3 = [new
|
|
1422
|
-
|
|
1423
|
-
}, [
|
|
1424
|
-
if (!
|
|
1093
|
+
if (!t2) return;
|
|
1094
|
+
const e3 = { contains: (e4) => true, focus() {
|
|
1095
|
+
} }, n3 = [new Fe("undo", e3, { label: "Undo", description: ht, shortcut: { key: "z", modifiers: [P.Ctrl] }, disabled: true }, i2), new Fe("redo", e3, { label: "Redo", description: ut, shortcut: [{ key: "y", modifiers: [P.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [P.Alt] }], disabled: true }, r2)];
|
|
1096
|
+
t2?.addCommands(n3, true);
|
|
1097
|
+
}, [t2]), c(() => {
|
|
1098
|
+
if (!t2) return;
|
|
1425
1099
|
const o3 = () => {
|
|
1426
|
-
const o4 =
|
|
1100
|
+
const o4 = e2?.getTopUndoDescription(), i4 = {};
|
|
1427
1101
|
var r3;
|
|
1428
|
-
|
|
1429
|
-
const s2 =
|
|
1430
|
-
|
|
1102
|
+
t2.getCommand("undo").update({ disabled: n2 || !e2 || !e2.hasUndo(), description: o4 ? (r3 = o4, `Undo ${r3}`) : ht, state: i4, context: { undoManager: e2 } });
|
|
1103
|
+
const s2 = e2?.getTopRedoDescription();
|
|
1104
|
+
t2.getCommand("redo").update({ disabled: n2 || !e2 || !e2.hasRedo(), description: s2 ? dt(s2) : ut, state: i4, context: { undoManager: e2 } });
|
|
1431
1105
|
};
|
|
1432
|
-
if (o3(), !
|
|
1433
|
-
const i3 =
|
|
1106
|
+
if (o3(), !e2) return;
|
|
1107
|
+
const i3 = e2.addListener({ onStackChange() {
|
|
1434
1108
|
o3();
|
|
1435
1109
|
} });
|
|
1436
1110
|
return () => i3?.();
|
|
1437
|
-
}, [
|
|
1111
|
+
}, [e2, t2, n2]), { undo: i2, redo: r2 };
|
|
1438
1112
|
};
|
|
1113
|
+
class ft extends g {
|
|
1114
|
+
static getDerivedStateFromError() {
|
|
1115
|
+
return { hasError: true };
|
|
1116
|
+
}
|
|
1117
|
+
componentDidCatch(e2) {
|
|
1118
|
+
this.props.onError?.(e2);
|
|
1119
|
+
}
|
|
1120
|
+
render() {
|
|
1121
|
+
return this.props.children;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
const _t = ({ children: t2 }) => {
|
|
1125
|
+
const n2 = Se(), o2 = i((e2) => {
|
|
1126
|
+
n2.showError(e2);
|
|
1127
|
+
}, [n2]);
|
|
1128
|
+
return e(ft, { onError: o2, children: t2 });
|
|
1129
|
+
};
|
|
1130
|
+
class mt {
|
|
1131
|
+
constructor(e2) {
|
|
1132
|
+
this.notifier = e2, this.handleUnhandledRejection = (e3) => {
|
|
1133
|
+
const t2 = e3.reason;
|
|
1134
|
+
t2 instanceof DOMException && "AbortError" === t2.name || this.notifier.showError(t2);
|
|
1135
|
+
}, this.handleGlobalError = (e3) => {
|
|
1136
|
+
this.notifier.showError(e3.error);
|
|
1137
|
+
}, this.setupGlobalHandlers();
|
|
1138
|
+
}
|
|
1139
|
+
setupGlobalHandlers() {
|
|
1140
|
+
window.addEventListener("unhandledrejection", this.handleUnhandledRejection), window.addEventListener("error", this.handleGlobalError);
|
|
1141
|
+
}
|
|
1142
|
+
cleanup() {
|
|
1143
|
+
window.removeEventListener("unhandledrejection", this.handleUnhandledRejection), window.removeEventListener("error", this.handleGlobalError);
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
const gt = ({ children: t2 }) => {
|
|
1147
|
+
const o2 = Se();
|
|
1148
|
+
return c(() => {
|
|
1149
|
+
const e2 = new mt(o2);
|
|
1150
|
+
return () => {
|
|
1151
|
+
e2.cleanup();
|
|
1152
|
+
};
|
|
1153
|
+
}, [o2]), e(n, { children: t2 });
|
|
1154
|
+
}, yt = () => null, vt = {}, xt = (t2) => {
|
|
1155
|
+
const { onPointerDown: n2, style: o2, splitDirection: i2, paddingBefore: r2 = 0, paddingAfter: s2 = 0, disabled: l2, key: a2, hitAreaProps: c2 = vt, ...h2 } = t2, u2 = "row" === i2, { style: d2, className: p2, ...f2 } = c2;
|
|
1156
|
+
return e("div", { style: { ...o2, position: "relative" }, ...h2, children: e("div", { className: y("hit-box", p2), style: { left: (u2 ? -r2 : 0) + "px", width: `calc(100% + ${u2 ? r2 + s2 : 0}px)`, top: (u2 ? 0 : -r2) + "px", height: `calc(100% + ${u2 ? 0 : r2 + s2}px)`, position: "absolute", ...d2 }, onPointerDown: l2 ? void 0 : n2, ...f2 }) }, a2);
|
|
1157
|
+
}, wt = {}, bt = (e2, t2, n2 = true) => null === e2 ? null : null !== e2.pixels ? n2 ? e2.pixels : t2 - e2.pixels : (n2 ? e2.percent : 100 - e2.percent) / 100 * t2, St = (e2, t2 = true) => e2?.percent ? `${t2 ? e2.percent : 100 - e2.percent}%` : e2?.pixels ? `${e2.pixels}px` : void 0, Lt = (e2, t2) => {
|
|
1158
|
+
if (null == e2) return null;
|
|
1159
|
+
const n2 = { percent: null, pixels: null };
|
|
1160
|
+
let o2 = t2;
|
|
1161
|
+
return "string" == typeof e2 && ((e2 = e2.trim().toLowerCase()).endsWith("px") ? (e2 = e2.substring(0, e2.length - 2), o2 = false) : e2.endsWith("%") && (e2 = e2.substring(0, e2.length - 1), o2 = true), e2 = parseFloat(e2)), o2 ? n2.percent = e2 : n2.pixels = e2, Object.freeze(n2);
|
|
1162
|
+
}, Et = s(l((n2, i2) => {
|
|
1163
|
+
const { elementBefore: s2, elementAfter: l2, splitDirection: u2 = "row", fixedPane: d2 = null, position: p2, onPositionChange: f2, minBefore: _2, maxBefore: m2, minAfter: g2, maxAfter: x2, children: w2, className: b2, style: S2, disabled: L2 = false, onDragStart: E2, onDragResize: C2, onDragFinish: T2, resizerProps: k2 = wt, paneProps: D2 = wt, paneBeforeProps: P2 = wt, paneAfterProps: A2 = wt, createResizer: z2 = xt } = n2;
|
|
1164
|
+
if (w2) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
1165
|
+
const B2 = h(() => o.isValidElement(l2) && o.isValidElement(s2), [l2, s2]), O2 = h(() => {
|
|
1166
|
+
let e2 = null;
|
|
1167
|
+
d2 && ("before" === d2 ? e2 = 0 : "after" === d2 && (e2 = 1));
|
|
1168
|
+
const t2 = null === e2;
|
|
1169
|
+
return { fixedPaneOffset: e2, isPercent: t2, minBefore: Lt(_2, t2), maxBefore: Lt(m2, t2), minAfter: Lt(g2, t2), maxAfter: Lt(x2, t2) };
|
|
1170
|
+
}, [_2, m2, g2, x2]), K2 = $(f2, [f2]), [H2, R2] = a(() => Lt(p2, null === d2));
|
|
1171
|
+
c(() => {
|
|
1172
|
+
R2(Lt(p2, null === d2));
|
|
1173
|
+
}, [p2, d2]);
|
|
1174
|
+
const [V2, { width: N2, height: W2 }] = v(), [I2, { width: j2, height: F2 }] = v(), Y2 = "row" === u2 ? j2 : F2, X2 = "row" === u2 ? N2 : W2, U2 = h(() => ((e2, t2, n3, o2) => {
|
|
1175
|
+
const i3 = [null, null], r2 = [null, null];
|
|
1176
|
+
if (e2 || (e2 = { percent: null === o2.fixedPaneOffset ? 50 : null, pixels: null === o2.fixedPaneOffset ? null : 0 }), 0 === t2) return null != e2?.pixels ? 1 !== o2.fixedPaneOffset ? (i3[0] = e2?.pixels, r2[1] = 100) : (i3[1] = e2?.pixels - n3, r2[0] = 100) : null != e2?.percent && (1 !== o2.fixedPaneOffset ? (r2[0] = e2?.percent, r2[1] = 100 - e2?.percent) : (r2[1] = e2?.percent, r2[0] = 100 - e2?.percent)), { percents: r2, pixels: i3, minBefore: St(o2.minBefore, true), maxBefore: St(o2.maxBefore, true), minAfter: St(o2.minAfter), maxAfter: St(o2.maxAfter) };
|
|
1177
|
+
let s3 = bt(e2, t2, 1 !== o2.fixedPaneOffset), l3 = t2 - n3, a2 = bt(o2.minBefore, l3, true) ?? 0, c2 = bt(o2.maxBefore, l3, true) ?? l3, h2 = 0, u3 = 0, d3 = 0, p3 = l3;
|
|
1178
|
+
h2 = (bt(o2.maxAfter, t2, false) ?? n3) - n3, u3 = bt(o2.minAfter, t2, false) ?? t2, d3 = Math.max(a2, h2), p3 = Math.min(c2, u3), s3 = Math.max(d3, Math.min(s3, p3)), u3 = Math.min(l3 - s3, bt(o2.maxAfter, l3 - s3, true) ?? l3), h2 = Math.min(l3 - s3, bt(o2.minAfter, l3 - s3, true) ?? l3), i3[0] = s3, i3[1] = l3 - i3[0];
|
|
1179
|
+
const f3 = Math.max(0, Math.min(100, s3 / l3 * 100));
|
|
1180
|
+
return r2[0] = f3, r2[1] = 100 - r2[0], { percents: r2, pixels: i3, minBefore: `${a2}px`, minAfter: `${h2}px`, maxBefore: `${i3[0]}px`, maxAfter: `${i3[1]}px` };
|
|
1181
|
+
})(H2, X2, Y2, O2), [O2, H2, X2, Y2, u2]), [G2, Z2] = a(false), q2 = $(E2, [E2]), J2 = $(C2, [C2]), Q2 = $(T2, [T2]), ee2 = r(null), te2 = r(null), ne2 = r(null), { style: oe2, className: re2, ...se2 } = D2, le2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...oe2 }, { className: ae2, style: ce2, ...he2 } = P2, { className: ue2, style: de2, ...pe2 } = A2, fe2 = { flex: "1 1 100%", width: "100%", ...S2, flexDirection: u2, display: "flex" }, { className: _e2, style: me2, onPointerDown: ge2, ...ye2 } = k2, ve2 = $((e2) => {
|
|
1182
|
+
const t2 = Lt(e2, null === d2);
|
|
1183
|
+
R2(t2);
|
|
1184
|
+
}, [d2]), xe2 = $((e2) => {
|
|
1185
|
+
if (L2 || !G2) return;
|
|
1186
|
+
const t2 = Se2.current?.getBoundingClientRect();
|
|
1187
|
+
let n3 = 0;
|
|
1188
|
+
n3 = "row" === u2 ? (e2.clientX ?? e2.touches?.[0]?.clientX) - t2.x : (e2.clientY ?? e2.touches?.[0]?.clientY) - t2.y, n3 = Math.max(0, Math.min(X2, n3)), 1 === O2.fixedPaneOffset && (n3 = X2 - n3), p2 && H2.pixels === n3 || R2({ pixels: n3, percent: null }), J2?.(n3), e2.stopPropagation(), e2.preventDefault();
|
|
1189
|
+
}, [O2, u2, L2, G2, H2, X2]), we2 = $((e2) => {
|
|
1190
|
+
if (document.removeEventListener("pointermove", xe2), document.removeEventListener("touchmove", xe2), document.removeEventListener("pointerup", we2), !G2) return;
|
|
1191
|
+
if (Z2(false), !H2) return;
|
|
1192
|
+
Q2(H2.pixels);
|
|
1193
|
+
if (!Lt(p2, null === d2) || H2.pixels !== p2) {
|
|
1194
|
+
const e3 = { ...H2 };
|
|
1195
|
+
null === e3.percent && (e3.percent = e3.pixels / X2 * 100), K2(e3);
|
|
1196
|
+
}
|
|
1197
|
+
e2.stopPropagation(), e2.preventDefault();
|
|
1198
|
+
}, [H2, G2, p2, d2, X2]), be2 = $((e2) => {
|
|
1199
|
+
ge2?.(e2), e2.defaultPrevented || L2 || G2 || (Z2(true), q2(), document.addEventListener("pointermove", xe2, { passive: false }), document.addEventListener("touchmove", xe2, { passive: false }), document.addEventListener("pointerup", we2, { passive: false }));
|
|
1200
|
+
}, [ge2]), Se2 = ie(i2, () => ({ setPosition: ve2, isSplitPane: () => true }), []), Le2 = h(() => B2 ? z2?.({ key: "resizer", ref: M([I2, te2]), className: y("resizer", _e2), onPointerDownCapture: be2, style: { cursor: L2 ? void 0 : "row" === u2 ? "ew-resize" : "ns-resize", minWidth: "row" === u2 ? "2px" : void 0, minHeight: "row" !== u2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...me2 }, splitDirection: u2, disabled: L2, ...ye2 }) : null, [B2, _e2, ye2, u2, me2, L2]), Ee2 = "row" === u2 ? "Width" : "Height", Ce2 = h(() => {
|
|
1201
|
+
if (!s2) return null;
|
|
1202
|
+
const t2 = { ...le2, ...ce2, flex: 0 === O2.fixedPaneOffset && null !== U2?.pixels[0] ? `0 0 ${Math.round(U2?.pixels[0])}px` : `1 1 ${Math.round(U2?.percents[0] ?? 100)}%`, [`min${Ee2}`]: U2?.minBefore, [`max${Ee2}`]: l2 ? U2?.maxBefore : "100%" };
|
|
1203
|
+
return e("div", { ref: ee2, className: y("before", re2, ae2), style: t2, ...se2, ...he2, children: s2 }, "before");
|
|
1204
|
+
}, [s2, D2, P2, O2, U2]), Me2 = h(() => {
|
|
1205
|
+
if (!l2) return null;
|
|
1206
|
+
const t2 = { ...le2, ...de2, flex: 1 === O2.fixedPaneOffset && null !== U2?.pixels[1] ? `0 0 ${Math.round(U2?.pixels[1])}px` : `1 1 ${Math.round(U2?.percents[1] ?? 100)}%`, [`min${Ee2}`]: U2?.minAfter, [`max${Ee2}`]: s2 ? U2?.maxAfter : "100%" };
|
|
1207
|
+
return e("div", { ref: ne2, className: y("after", re2, ue2), style: t2, ...se2, ...pe2, children: l2 }, "after");
|
|
1208
|
+
}, [l2, D2, A2, O2, U2]);
|
|
1209
|
+
return t("div", { ref: M([V2, Se2]), className: y("splitPane", "row" === u2 ? "vertical" : "horizontal", { dragging: G2 }, b2), style: fe2, children: [Ce2, Le2, Me2] });
|
|
1210
|
+
}));
|
|
1211
|
+
function Ct(e2) {
|
|
1212
|
+
if ("function" == typeof e2) return e2;
|
|
1213
|
+
if ("string" == typeof e2) {
|
|
1214
|
+
const t2 = e2.trim();
|
|
1215
|
+
if (t2.startsWith("data:image/svg+xml")) {
|
|
1216
|
+
const e3 = (function(e4) {
|
|
1217
|
+
const t3 = /^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(e4.trim());
|
|
1218
|
+
if (!t3) return null;
|
|
1219
|
+
const n2 = t3[1] || "", o2 = t3[2] || "";
|
|
1220
|
+
try {
|
|
1221
|
+
if (/;base64/i.test(n2)) {
|
|
1222
|
+
if ("undefined" != typeof atob) {
|
|
1223
|
+
const e5 = atob(o2);
|
|
1224
|
+
if ("undefined" != typeof TextDecoder) {
|
|
1225
|
+
const t5 = new Uint8Array(e5.length);
|
|
1226
|
+
for (let n3 = 0; n3 < e5.length; n3++) t5[n3] = e5.charCodeAt(n3);
|
|
1227
|
+
return new TextDecoder("utf-8").decode(t5);
|
|
1228
|
+
}
|
|
1229
|
+
let t4 = "";
|
|
1230
|
+
for (let n3 = 0; n3 < e5.length; n3++) {
|
|
1231
|
+
t4 += `%${e5.charCodeAt(n3).toString(16).padStart(2, "0")}`;
|
|
1232
|
+
}
|
|
1233
|
+
return decodeURIComponent(t4);
|
|
1234
|
+
}
|
|
1235
|
+
return (globalThis.Buffer ? globalThis.Buffer.from(o2, "base64") : require("buffer").Buffer.from(o2, "base64")).toString("utf-8");
|
|
1236
|
+
}
|
|
1237
|
+
try {
|
|
1238
|
+
return decodeURIComponent(o2);
|
|
1239
|
+
} catch {
|
|
1240
|
+
return o2;
|
|
1241
|
+
}
|
|
1242
|
+
} catch {
|
|
1243
|
+
return null;
|
|
1244
|
+
}
|
|
1245
|
+
})(t2);
|
|
1246
|
+
if (e3) return kt(e3);
|
|
1247
|
+
}
|
|
1248
|
+
if (t2.startsWith("<")) {
|
|
1249
|
+
if (/^<\s*svg\b/i.test(t2)) return kt(t2);
|
|
1250
|
+
if (/^<\s*path\b/i.test(t2)) {
|
|
1251
|
+
const e3 = Mt(t2);
|
|
1252
|
+
if (e3) return { paths: [{ d: e3 }] };
|
|
1253
|
+
}
|
|
1254
|
+
return { paths: [{ d: t2 }] };
|
|
1255
|
+
}
|
|
1256
|
+
return { paths: [{ d: t2 }] };
|
|
1257
|
+
}
|
|
1258
|
+
if (Array.isArray(e2)) {
|
|
1259
|
+
const t2 = [];
|
|
1260
|
+
for (const n2 of e2) if ("string" == typeof n2) {
|
|
1261
|
+
const e3 = String(n2).trim();
|
|
1262
|
+
if (e3.startsWith("<path")) {
|
|
1263
|
+
const n3 = Mt(e3);
|
|
1264
|
+
n3 && t2.push({ d: n3 });
|
|
1265
|
+
} else t2.push({ d: e3 });
|
|
1266
|
+
} else n2 && "object" == typeof n2 && "d" in n2 && "string" == typeof n2.d && t2.push({ ...n2 });
|
|
1267
|
+
return { paths: t2 };
|
|
1268
|
+
}
|
|
1269
|
+
return e2;
|
|
1270
|
+
}
|
|
1271
|
+
function Mt(e2) {
|
|
1272
|
+
const t2 = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(e2);
|
|
1273
|
+
return t2 ? t2[1] ?? t2[2] ?? null : null;
|
|
1274
|
+
}
|
|
1275
|
+
function Tt(e2) {
|
|
1276
|
+
if ("svg" in e2) return { ...e2, svg: Ct(e2.svg) };
|
|
1277
|
+
if ("url" in e2) {
|
|
1278
|
+
const t2 = "string" == typeof e2.url ? { src: e2.url } : e2.url;
|
|
1279
|
+
return { ...e2, url: t2 };
|
|
1280
|
+
}
|
|
1281
|
+
if ("emoji" in e2) {
|
|
1282
|
+
const t2 = "string" == typeof e2.emoji ? e2.emoji : e2.emoji.text;
|
|
1283
|
+
return { ...e2, emoji: t2 };
|
|
1284
|
+
}
|
|
1285
|
+
return e2;
|
|
1286
|
+
}
|
|
1287
|
+
function kt(e2) {
|
|
1288
|
+
try {
|
|
1289
|
+
if ("undefined" != typeof DOMParser) {
|
|
1290
|
+
const t3 = new DOMParser().parseFromString(e2, "image/svg+xml"), n3 = t3.querySelector("svg"), o3 = n3?.getAttribute("viewBox") ?? void 0, i3 = [];
|
|
1291
|
+
return t3.querySelectorAll("path").forEach((e3) => {
|
|
1292
|
+
const t4 = e3.getAttribute("d");
|
|
1293
|
+
if (!t4) return;
|
|
1294
|
+
const n4 = { d: t4 }, o4 = e3.getAttribute("class");
|
|
1295
|
+
o4 && (n4.className = o4);
|
|
1296
|
+
const r3 = e3.getAttribute("fill");
|
|
1297
|
+
r3 && "none" !== r3 && (n4.fill = r3);
|
|
1298
|
+
const s2 = e3.getAttribute("stroke");
|
|
1299
|
+
s2 && (n4.stroke = s2);
|
|
1300
|
+
const l2 = e3.getAttribute("opacity");
|
|
1301
|
+
l2 && (n4.opacity = Number(l2));
|
|
1302
|
+
const a2 = e3.getAttribute("fill-rule");
|
|
1303
|
+
a2 && (n4.fillRule = a2);
|
|
1304
|
+
const c2 = e3.getAttribute("clip-rule");
|
|
1305
|
+
c2 && (n4.clipRule = c2), i3.push(n4);
|
|
1306
|
+
}), { viewBox: o3, paths: i3 };
|
|
1307
|
+
}
|
|
1308
|
+
} catch {
|
|
1309
|
+
}
|
|
1310
|
+
const t2 = e2.match(/viewBox="([^"]+)"/i), n2 = t2 ? t2[1] : void 0, o2 = [], i2 = /<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;
|
|
1311
|
+
let r2;
|
|
1312
|
+
for (; r2 = i2.exec(e2); ) o2.push({ d: r2[1] });
|
|
1313
|
+
return { viewBox: n2, paths: o2 };
|
|
1314
|
+
}
|
|
1315
|
+
function Dt(e2) {
|
|
1316
|
+
const t2 = {};
|
|
1317
|
+
for (const [n3, o3] of Object.entries(e2.icons)) t2[n3] = Tt(o3);
|
|
1318
|
+
const n2 = { label: e2.meta?.label ?? "Unnamed", version: e2.meta?.version ?? "1.0.0", license: e2.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: e2.meta?.extends ?? [] };
|
|
1319
|
+
n2.extends.includes("base") || n2.extends.push("base");
|
|
1320
|
+
const o2 = { meta: n2, icons: t2 }, i2 = e2.overrides;
|
|
1321
|
+
if (i2) {
|
|
1322
|
+
const e3 = {};
|
|
1323
|
+
for (const [t3, n3] of Object.entries(i2)) {
|
|
1324
|
+
const o3 = {};
|
|
1325
|
+
for (const [e4, t4] of Object.entries(n3)) o3[e4] = Tt(t4);
|
|
1326
|
+
e3[t3] = o3;
|
|
1327
|
+
}
|
|
1328
|
+
o2.__overrides = e3;
|
|
1329
|
+
}
|
|
1330
|
+
return o2;
|
|
1331
|
+
}
|
|
1332
|
+
function Pt() {
|
|
1333
|
+
const e2 = /* @__PURE__ */ new Map(), t2 = /* @__PURE__ */ new Map();
|
|
1334
|
+
let n2 = "base", o2 = /* @__PURE__ */ new Map();
|
|
1335
|
+
async function i2(t3) {
|
|
1336
|
+
const o3 = e2.get(t3 ?? n2);
|
|
1337
|
+
if (!o3) throw new Error(`Icon pack not registered: ${t3}`);
|
|
1338
|
+
if (!o3.pack) {
|
|
1339
|
+
if (!o3.loading) {
|
|
1340
|
+
if (!o3.loader) throw new Error(`No loader for icon pack: ${t3}`);
|
|
1341
|
+
o3.loading = o3.loader().then((e3) => {
|
|
1342
|
+
const t4 = e3 && "object" == typeof e3 && "default" in e3 ? e3.default : e3;
|
|
1343
|
+
o3.pack = Dt(t4);
|
|
1344
|
+
}).catch((e3) => {
|
|
1345
|
+
throw o3.loading = void 0, e3;
|
|
1346
|
+
});
|
|
1347
|
+
}
|
|
1348
|
+
await o3.loading;
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
function r2(e3) {
|
|
1352
|
+
const t3 = e3.indexOf(":");
|
|
1353
|
+
return t3 > 0 ? { ns: e3.slice(0, t3), key: e3.slice(t3 + 1) } : { key: e3 };
|
|
1354
|
+
}
|
|
1355
|
+
function s2(n3, o3) {
|
|
1356
|
+
const i3 = [n3, ...e2.get(n3)?.pack?.meta.extends ?? []];
|
|
1357
|
+
for (const n4 of i3) {
|
|
1358
|
+
const i4 = e2.get(n4);
|
|
1359
|
+
if (!i4?.pack) continue;
|
|
1360
|
+
const { icons: r3 } = i4.pack, s3 = r3[t2.get(n4)?.get(o3) ?? o3] ?? r3[o3];
|
|
1361
|
+
if (s3) return { glyph: s3, pack: i4.pack, packKey: n4 };
|
|
1362
|
+
}
|
|
1363
|
+
return null;
|
|
1364
|
+
}
|
|
1365
|
+
function l2(t3, o3) {
|
|
1366
|
+
const i3 = o3?.packKey ?? n2;
|
|
1367
|
+
if (o3?.packKey) return s2(o3.packKey, t3);
|
|
1368
|
+
if (!t3) return null;
|
|
1369
|
+
const { ns: l3, key: a2 } = r2(t3);
|
|
1370
|
+
if (l3) {
|
|
1371
|
+
const t4 = e2.get(l3)?.pack;
|
|
1372
|
+
if (t4) {
|
|
1373
|
+
if (!!e2.get(n2)?.pack) {
|
|
1374
|
+
const e3 = t4.__overrides, o5 = e3?.[n2]?.[a2];
|
|
1375
|
+
if (o5) return { glyph: o5, pack: t4, packKey: l3 };
|
|
1376
|
+
}
|
|
1377
|
+
const o4 = s2(l3, a2);
|
|
1378
|
+
if (o4) return o4;
|
|
1379
|
+
}
|
|
1380
|
+
return null;
|
|
1381
|
+
}
|
|
1382
|
+
return s2(i3, t3);
|
|
1383
|
+
}
|
|
1384
|
+
return { register: function(t3, o3) {
|
|
1385
|
+
const i3 = e2.get(t3) ?? {};
|
|
1386
|
+
"function" == typeof o3 ? i3.loader = o3 : i3.pack = Dt(o3), e2.set(t3, i3), n2 || (n2 = t3);
|
|
1387
|
+
}, prefetch: async function(e3 = n2) {
|
|
1388
|
+
const t3 = Array.isArray(e3) ? e3 : [e3];
|
|
1389
|
+
await Promise.all(t3.map(i2));
|
|
1390
|
+
}, setActive: function(e3) {
|
|
1391
|
+
n2 = e3;
|
|
1392
|
+
for (const t3 of o2.keys()) try {
|
|
1393
|
+
t3(e3);
|
|
1394
|
+
} catch (e4) {
|
|
1395
|
+
}
|
|
1396
|
+
}, getActive: function() {
|
|
1397
|
+
return n2;
|
|
1398
|
+
}, resolve: async function(t3, o3) {
|
|
1399
|
+
let s3 = l2(t3, o3);
|
|
1400
|
+
if (s3) return s3;
|
|
1401
|
+
const a2 = o3?.packKey ?? n2, { ns: c2 } = r2(t3);
|
|
1402
|
+
if (o3?.packKey) {
|
|
1403
|
+
if (await i2(a2), s3 = l2(t3, o3), s3) return s3;
|
|
1404
|
+
const n3 = e2.get(a2)?.pack?.meta?.extends ?? [];
|
|
1405
|
+
if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(t3, o3), s3)) return s3;
|
|
1406
|
+
} else if (c2) {
|
|
1407
|
+
if (await i2(c2), s3 = l2(t3, o3), s3) return s3;
|
|
1408
|
+
const n3 = e2.get(c2)?.pack?.meta?.extends ?? [];
|
|
1409
|
+
if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(t3, o3), s3)) return s3;
|
|
1410
|
+
} else {
|
|
1411
|
+
if (await i2(a2), s3 = l2(t3, o3), s3) return s3;
|
|
1412
|
+
const n3 = e2.get(a2)?.pack?.meta?.extends ?? [];
|
|
1413
|
+
if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(t3, o3), s3)) return s3;
|
|
1414
|
+
}
|
|
1415
|
+
return null;
|
|
1416
|
+
}, registerAlias: function(e3, n3, o3) {
|
|
1417
|
+
t2.has(e3) || t2.set(e3, /* @__PURE__ */ new Map()), t2.get(e3).set(n3, o3);
|
|
1418
|
+
}, has: function(e3, t3) {
|
|
1419
|
+
return !!l2(e3, t3);
|
|
1420
|
+
}, getPack: function(t3) {
|
|
1421
|
+
return e2.get(t3 ?? n2)?.pack;
|
|
1422
|
+
}, hasPack: function(t3) {
|
|
1423
|
+
return !!e2.get(t3)?.pack;
|
|
1424
|
+
}, listPacks: function() {
|
|
1425
|
+
return Array.from(e2.keys());
|
|
1426
|
+
}, listIcons: function(t3) {
|
|
1427
|
+
const n3 = e2.get(t3)?.pack;
|
|
1428
|
+
return n3 ? Object.keys(n3.icons) : [];
|
|
1429
|
+
}, addActiveListener: function(e3) {
|
|
1430
|
+
const t3 = o2.get(e3);
|
|
1431
|
+
if (t3) return t3;
|
|
1432
|
+
const n3 = () => {
|
|
1433
|
+
o2.delete(e3);
|
|
1434
|
+
};
|
|
1435
|
+
return o2.set(e3, n3), n3;
|
|
1436
|
+
} };
|
|
1437
|
+
}
|
|
1438
|
+
const At = Pt();
|
|
1439
|
+
At.register("base", () => import("./evajGyufL7MJX0Wg.mjs"));
|
|
1440
|
+
const zt = (t2) => e("svg", { ...t2, children: e("path", {}) }), Bt = { Icon: "_Icon_1ipwo_10" }, $t = s((t2) => {
|
|
1441
|
+
const { iconKey: n2, packKey: i2, className: r2, style: s2, role: l2, title: a2, size: c2, ariaHidden: u2, sourceProps: d2, children: p2, ...f2 } = t2, [_2, m2] = o.useState(null);
|
|
1442
|
+
o.useEffect(() => {
|
|
1443
|
+
let e2 = true, t3 = i2, o2 = n2;
|
|
1444
|
+
if (!o2) {
|
|
1445
|
+
const e3 = At.getPack(t3);
|
|
1446
|
+
return void m2({ glyph: e3 ? { svg: x.EmptyArray } : void 0, pack: e3 ?? void 0, packKey: t3 ?? At.getActive() });
|
|
1447
|
+
}
|
|
1448
|
+
if (o2.includes(":")) {
|
|
1449
|
+
const [e3, n3] = o2.split(":");
|
|
1450
|
+
t3 = e3, o2 = n3;
|
|
1451
|
+
}
|
|
1452
|
+
return At.resolve(o2, { packKey: t3 }).then((t4) => {
|
|
1453
|
+
e2 && m2(t4);
|
|
1454
|
+
}), () => {
|
|
1455
|
+
e2 = false;
|
|
1456
|
+
};
|
|
1457
|
+
}, [n2, i2]);
|
|
1458
|
+
const g2 = _2?.pack, y2 = _2?.glyph, v2 = _2?.packKey;
|
|
1459
|
+
let w2 = y2 ? y2.svg : void 0;
|
|
1460
|
+
const b2 = y2 && !w2 ? y2.url : void 0, S2 = !y2 || w2 || b2 ? void 0 : y2.emoji, L2 = null != c2 ? "number" == typeof c2 ? `${c2}px` : c2 : void 0, E2 = h(() => [Bt.Icon, "icon", r2].filter(Boolean).join(" "), [r2]), C2 = h(() => {
|
|
1461
|
+
const e2 = { ...s2 };
|
|
1462
|
+
return e2["--icon-size"] = L2, e2;
|
|
1463
|
+
}, [s2, L2]), M2 = l2 ?? (a2 ? "img" : "presentation"), T2 = u2 ?? (!a2 || void 0), k2 = (t3) => e("span", { className: E2, style: C2, role: M2, "aria-hidden": T2, title: a2, "data-icon-glyph": n2, "data-icon-pack": v2, ...f2, children: t3 });
|
|
1464
|
+
if (p2) return k2(p2);
|
|
1465
|
+
if (S2) return k2(e("span", { children: "string" == typeof S2 ? S2 : S2.text }));
|
|
1466
|
+
if (b2) return k2(e("img", { src: b2.src, alt: a2 ?? "" }));
|
|
1467
|
+
if (y2 && "react" in y2) {
|
|
1468
|
+
const t3 = y2.react, n3 = { className: E2, style: C2, role: M2, "aria-hidden": T2, title: a2, ...f2, ...d2 };
|
|
1469
|
+
return k2(e(t3, { ...n3 }));
|
|
1470
|
+
}
|
|
1471
|
+
const D2 = { viewBox: w2?.viewBox ?? g2?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
1472
|
+
if ("function" == typeof w2) {
|
|
1473
|
+
return k2(w2(D2) ?? e(zt, { ...D2 }));
|
|
1474
|
+
}
|
|
1475
|
+
if (!w2) return k2(e(zt, { ...D2 }));
|
|
1476
|
+
const P2 = w2.paths;
|
|
1477
|
+
return k2(e("svg", { ...D2, children: P2 ? P2.map((t3, n3) => e("path", { d: t3.d, className: t3.className, fill: t3.fill, stroke: t3.stroke, opacity: t3.opacity, fillRule: t3.fillRule, clipRule: t3.clipRule }, n3)) : null }));
|
|
1478
|
+
});
|
|
1479
|
+
function Ot(t2) {
|
|
1480
|
+
const { isWalking: n2 = false, themedType: o2 = "info", speed: i2 = 120, dashGap: r2 = 3, dashLength: s2 = 5, iconKey: l2, packKey: a2, style: c2, className: u2, ...d2 } = t2, p2 = h(() => {
|
|
1481
|
+
if (!n2) return;
|
|
1482
|
+
const e2 = { "--walk-duration": `${i2 * (r2 + s2)}ms`, "--walk-dash-length": `${s2}px`, "--walk-dash-gap": `${r2}px` };
|
|
1483
|
+
return o2 && "accent" !== o2 && (e2["--icon-accent"] = `var(--icon-${o2})`), e2;
|
|
1484
|
+
}, [n2, i2, r2, s2, o2]), f2 = h(() => n2 ? u2 + " walking" : u2, [n2, u2]);
|
|
1485
|
+
return e($t, { iconKey: l2, packKey: a2, className: f2, style: { ...c2, ...p2 }, ...d2 });
|
|
1486
|
+
}
|
|
1439
1487
|
export {
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1488
|
+
Fe as Command,
|
|
1489
|
+
et as CommandButtonType,
|
|
1490
|
+
Xe as CommandGroup,
|
|
1491
|
+
At as DefaultDynamicIconService,
|
|
1492
|
+
xe as DefaultReactNotifier,
|
|
1493
|
+
$t as DynamicIcon,
|
|
1494
|
+
yt as ErrorTestPanel,
|
|
1495
|
+
ge as FocusKeyNavigation,
|
|
1496
|
+
D as HorizontalAlignment,
|
|
1497
|
+
A as KeyCodes,
|
|
1498
|
+
P as KeyModifiers,
|
|
1499
|
+
z as MouseButtonCodes,
|
|
1500
|
+
be as NotifierProvider,
|
|
1501
|
+
ve as NotifierType,
|
|
1502
|
+
_t as ReactErrorBoundary,
|
|
1503
|
+
ne as ReactUtils,
|
|
1504
|
+
ye as RoundedTab,
|
|
1505
|
+
le as ScrollPane,
|
|
1506
|
+
V as ScrollUtils,
|
|
1457
1507
|
W as Scrollbar,
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1508
|
+
B as ScrollbarOrientation,
|
|
1509
|
+
Ye as SimpleCommand,
|
|
1510
|
+
Et as SplitPane,
|
|
1511
|
+
xt as SplitPaneResizer,
|
|
1512
|
+
me as ToolTipPlacement,
|
|
1513
|
+
gt as UncaughtErrorBoundary,
|
|
1514
|
+
_e as VirtualScrollbar,
|
|
1515
|
+
Ot as WalkingIcon,
|
|
1516
|
+
Pt as createDynamicIconService,
|
|
1517
|
+
se as defaultCreateScrollCorner,
|
|
1518
|
+
H as defaultCreateScrollEdgeButton,
|
|
1519
|
+
K as defaultCreateScrollEndButton,
|
|
1520
|
+
O as defaultCreateScrollStartButton,
|
|
1521
|
+
re as defaultCreateScrollbar,
|
|
1522
|
+
Ee as getDevicePixelRatio,
|
|
1523
|
+
Ze as toShortcutString,
|
|
1524
|
+
$ as useCallbackRef,
|
|
1525
|
+
qe as useCommand,
|
|
1526
|
+
Qe as useCommands,
|
|
1527
|
+
nt as useCopyPaste,
|
|
1528
|
+
Le as useDevicePixelRatio,
|
|
1529
|
+
je as useEditMode,
|
|
1530
|
+
ce as useFullscreenPortal,
|
|
1531
|
+
tt as useGlobalClipboard,
|
|
1532
|
+
ct as useId,
|
|
1533
|
+
ie as useImperativeElement,
|
|
1534
|
+
Te as useMouseDownAndHoldListener,
|
|
1535
|
+
Se as useNotifier,
|
|
1536
|
+
Ce as useOnClickOrFocusAway,
|
|
1537
|
+
Me as useSynchronizedPointerHandler,
|
|
1538
|
+
ot as useTraceUpdate,
|
|
1539
|
+
pt as useUndoManager
|
|
1489
1540
|
};
|