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