@industry-theme/xterm-terminal-panel 0.5.15 → 0.5.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +0 -1931
- package/dist/index.js +56 -3347
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1900,3298 +1900,7 @@ var TerminalPanel = ({
|
|
|
1900
1900
|
};
|
|
1901
1901
|
// src/panels/TabbedTerminalPanel.tsx
|
|
1902
1902
|
import { useTheme as useTheme6 } from "@principal-ade/industry-theme";
|
|
1903
|
-
|
|
1904
|
-
// node_modules/@principal-ade/panels/dist/index.esm.js
|
|
1905
|
-
import { jsx as e, jsxs as t, Fragment as n } from "react/jsx-runtime";
|
|
1906
|
-
import r, { useState as o, useRef as l, useCallback as i, useEffect as a, createContext as s, useContext as c, forwardRef as d, useImperativeHandle as u, useMemo as p, useLayoutEffect as h, memo as g, useReducer as v } from "react";
|
|
1907
|
-
|
|
1908
|
-
// node_modules/react-resizable-panels/dist/react-resizable-panels.js
|
|
1909
|
-
import { jsx as ie } from "react/jsx-runtime";
|
|
1910
|
-
import { useState as re, useCallback as ne, useId as pt, useLayoutEffect as Be, useEffect as de, useRef as T, createContext as ht, useImperativeHandle as We, useMemo as Ue, useSyncExternalStore as Ke, useContext as mt } from "react";
|
|
1911
|
-
"use client";
|
|
1912
|
-
function gt(e, t) {
|
|
1913
|
-
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
1914
|
-
return t * o;
|
|
1915
|
-
}
|
|
1916
|
-
function St(e, t) {
|
|
1917
|
-
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
1918
|
-
return t * o;
|
|
1919
|
-
}
|
|
1920
|
-
function yt(e) {
|
|
1921
|
-
return e / 100 * window.innerHeight;
|
|
1922
|
-
}
|
|
1923
|
-
function vt(e) {
|
|
1924
|
-
return e / 100 * window.innerWidth;
|
|
1925
|
-
}
|
|
1926
|
-
function zt(e) {
|
|
1927
|
-
switch (typeof e) {
|
|
1928
|
-
case "number":
|
|
1929
|
-
return [e, "px"];
|
|
1930
|
-
case "string": {
|
|
1931
|
-
const t = parseFloat(e);
|
|
1932
|
-
return e.endsWith("%") ? [t, "%"] : e.endsWith("px") ? [t, "px"] : e.endsWith("rem") ? [t, "rem"] : e.endsWith("em") ? [t, "em"] : e.endsWith("vh") ? [t, "vh"] : e.endsWith("vw") ? [t, "vw"] : [t, "%"];
|
|
1933
|
-
}
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
|
-
function te({
|
|
1937
|
-
groupSize: e,
|
|
1938
|
-
panelElement: t,
|
|
1939
|
-
styleProp: n
|
|
1940
|
-
}) {
|
|
1941
|
-
let o;
|
|
1942
|
-
const [i, s] = zt(n);
|
|
1943
|
-
switch (s) {
|
|
1944
|
-
case "%": {
|
|
1945
|
-
o = i / 100 * e;
|
|
1946
|
-
break;
|
|
1947
|
-
}
|
|
1948
|
-
case "px": {
|
|
1949
|
-
o = i;
|
|
1950
|
-
break;
|
|
1951
|
-
}
|
|
1952
|
-
case "rem": {
|
|
1953
|
-
o = St(t, i);
|
|
1954
|
-
break;
|
|
1955
|
-
}
|
|
1956
|
-
case "em": {
|
|
1957
|
-
o = gt(t, i);
|
|
1958
|
-
break;
|
|
1959
|
-
}
|
|
1960
|
-
case "vh": {
|
|
1961
|
-
o = yt(i);
|
|
1962
|
-
break;
|
|
1963
|
-
}
|
|
1964
|
-
case "vw": {
|
|
1965
|
-
o = vt(i);
|
|
1966
|
-
break;
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
return o;
|
|
1970
|
-
}
|
|
1971
|
-
function D(e) {
|
|
1972
|
-
return parseFloat(e.toFixed(3));
|
|
1973
|
-
}
|
|
1974
|
-
function Q({
|
|
1975
|
-
group: e
|
|
1976
|
-
}) {
|
|
1977
|
-
const { orientation: t, panels: n } = e;
|
|
1978
|
-
return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
|
|
1979
|
-
}
|
|
1980
|
-
function ge(e) {
|
|
1981
|
-
const { panels: t } = e, n = Q({ group: e });
|
|
1982
|
-
return n === 0 ? t.map((o) => ({
|
|
1983
|
-
groupResizeBehavior: o.panelConstraints.groupResizeBehavior,
|
|
1984
|
-
collapsedSize: 0,
|
|
1985
|
-
collapsible: o.panelConstraints.collapsible === true,
|
|
1986
|
-
defaultSize: undefined,
|
|
1987
|
-
disabled: o.panelConstraints.disabled,
|
|
1988
|
-
minSize: 0,
|
|
1989
|
-
maxSize: 100,
|
|
1990
|
-
panelId: o.id
|
|
1991
|
-
})) : t.map((o) => {
|
|
1992
|
-
const { element: i, panelConstraints: s } = o;
|
|
1993
|
-
let l = 0;
|
|
1994
|
-
if (s.collapsedSize !== undefined) {
|
|
1995
|
-
const c = te({
|
|
1996
|
-
groupSize: n,
|
|
1997
|
-
panelElement: i,
|
|
1998
|
-
styleProp: s.collapsedSize
|
|
1999
|
-
});
|
|
2000
|
-
l = D(c / n * 100);
|
|
2001
|
-
}
|
|
2002
|
-
let r;
|
|
2003
|
-
if (s.defaultSize !== undefined) {
|
|
2004
|
-
const c = te({
|
|
2005
|
-
groupSize: n,
|
|
2006
|
-
panelElement: i,
|
|
2007
|
-
styleProp: s.defaultSize
|
|
2008
|
-
});
|
|
2009
|
-
r = D(c / n * 100);
|
|
2010
|
-
}
|
|
2011
|
-
let a = 0;
|
|
2012
|
-
if (s.minSize !== undefined) {
|
|
2013
|
-
const c = te({
|
|
2014
|
-
groupSize: n,
|
|
2015
|
-
panelElement: i,
|
|
2016
|
-
styleProp: s.minSize
|
|
2017
|
-
});
|
|
2018
|
-
a = D(c / n * 100);
|
|
2019
|
-
}
|
|
2020
|
-
let u = 100;
|
|
2021
|
-
if (s.maxSize !== undefined) {
|
|
2022
|
-
const c = te({
|
|
2023
|
-
groupSize: n,
|
|
2024
|
-
panelElement: i,
|
|
2025
|
-
styleProp: s.maxSize
|
|
2026
|
-
});
|
|
2027
|
-
u = D(c / n * 100);
|
|
2028
|
-
}
|
|
2029
|
-
return {
|
|
2030
|
-
groupResizeBehavior: s.groupResizeBehavior,
|
|
2031
|
-
collapsedSize: l,
|
|
2032
|
-
collapsible: s.collapsible === true,
|
|
2033
|
-
defaultSize: r,
|
|
2034
|
-
disabled: s.disabled,
|
|
2035
|
-
minSize: a,
|
|
2036
|
-
maxSize: u,
|
|
2037
|
-
panelId: o.id
|
|
2038
|
-
};
|
|
2039
|
-
});
|
|
2040
|
-
}
|
|
2041
|
-
function L(e, t = "Assertion error") {
|
|
2042
|
-
if (!e)
|
|
2043
|
-
throw Error(t);
|
|
2044
|
-
}
|
|
2045
|
-
function Se(e, t) {
|
|
2046
|
-
return Array.from(t).sort(e === "horizontal" ? bt : xt);
|
|
2047
|
-
}
|
|
2048
|
-
function bt(e, t) {
|
|
2049
|
-
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
2050
|
-
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
2051
|
-
}
|
|
2052
|
-
function xt(e, t) {
|
|
2053
|
-
const n = e.element.offsetTop - t.element.offsetTop;
|
|
2054
|
-
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
2055
|
-
}
|
|
2056
|
-
function Xe(e) {
|
|
2057
|
-
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
2058
|
-
}
|
|
2059
|
-
function qe(e, t) {
|
|
2060
|
-
return {
|
|
2061
|
-
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(Math.abs(e.x - t.left), Math.abs(e.x - t.right)),
|
|
2062
|
-
y: e.y >= t.top && e.y <= t.bottom ? 0 : Math.min(Math.abs(e.y - t.top), Math.abs(e.y - t.bottom))
|
|
2063
|
-
};
|
|
2064
|
-
}
|
|
2065
|
-
function wt({
|
|
2066
|
-
orientation: e,
|
|
2067
|
-
rects: t,
|
|
2068
|
-
targetRect: n
|
|
2069
|
-
}) {
|
|
2070
|
-
const o = {
|
|
2071
|
-
x: n.x + n.width / 2,
|
|
2072
|
-
y: n.y + n.height / 2
|
|
2073
|
-
};
|
|
2074
|
-
let i, s = Number.MAX_VALUE;
|
|
2075
|
-
for (const l of t) {
|
|
2076
|
-
const { x: r, y: a } = qe(o, l), u = e === "horizontal" ? r : a;
|
|
2077
|
-
u < s && (s = u, i = l);
|
|
2078
|
-
}
|
|
2079
|
-
return L(i, "No rect found"), i;
|
|
2080
|
-
}
|
|
2081
|
-
var ue;
|
|
2082
|
-
function Pt() {
|
|
2083
|
-
return ue === undefined && (typeof matchMedia == "function" ? ue = !!matchMedia("(pointer:coarse)").matches : ue = false), ue;
|
|
2084
|
-
}
|
|
2085
|
-
function Ye(e) {
|
|
2086
|
-
const { element: t, orientation: n, panels: o, separators: i } = e, s = Se(n, Array.from(t.children).filter(Xe).map((x) => ({ element: x }))).map(({ element: x }) => x), l = [];
|
|
2087
|
-
let r = false, a = false, u = -1, c = -1, m = 0, d, v = [];
|
|
2088
|
-
{
|
|
2089
|
-
let x = -1;
|
|
2090
|
-
for (const f of s)
|
|
2091
|
-
f.hasAttribute("data-panel") && (x++, f.ariaDisabled === null && (m++, u === -1 && (u = x), c = x));
|
|
2092
|
-
}
|
|
2093
|
-
if (m > 1) {
|
|
2094
|
-
let x = -1;
|
|
2095
|
-
for (const f of s)
|
|
2096
|
-
if (f.hasAttribute("data-panel")) {
|
|
2097
|
-
x++;
|
|
2098
|
-
const h = o.find((g) => g.element === f);
|
|
2099
|
-
if (h) {
|
|
2100
|
-
if (d) {
|
|
2101
|
-
const g = d.element.getBoundingClientRect(), y = f.getBoundingClientRect();
|
|
2102
|
-
let z;
|
|
2103
|
-
if (a) {
|
|
2104
|
-
const S = n === "horizontal" ? new DOMRect(g.right, g.top, 0, g.height) : new DOMRect(g.left, g.bottom, g.width, 0), p = n === "horizontal" ? new DOMRect(y.left, y.top, 0, y.height) : new DOMRect(y.left, y.top, y.width, 0);
|
|
2105
|
-
switch (v.length) {
|
|
2106
|
-
case 0: {
|
|
2107
|
-
z = [
|
|
2108
|
-
S,
|
|
2109
|
-
p
|
|
2110
|
-
];
|
|
2111
|
-
break;
|
|
2112
|
-
}
|
|
2113
|
-
case 1: {
|
|
2114
|
-
const P = v[0], R = wt({
|
|
2115
|
-
orientation: n,
|
|
2116
|
-
rects: [g, y],
|
|
2117
|
-
targetRect: P.element.getBoundingClientRect()
|
|
2118
|
-
});
|
|
2119
|
-
z = [
|
|
2120
|
-
P,
|
|
2121
|
-
R === g ? p : S
|
|
2122
|
-
];
|
|
2123
|
-
break;
|
|
2124
|
-
}
|
|
2125
|
-
default: {
|
|
2126
|
-
z = v;
|
|
2127
|
-
break;
|
|
2128
|
-
}
|
|
2129
|
-
}
|
|
2130
|
-
} else
|
|
2131
|
-
v.length ? z = v : z = [
|
|
2132
|
-
n === "horizontal" ? new DOMRect(g.right, y.top, y.left - g.right, y.height) : new DOMRect(y.left, g.bottom, y.width, y.top - g.bottom)
|
|
2133
|
-
];
|
|
2134
|
-
for (const S of z) {
|
|
2135
|
-
let p = "width" in S ? S : S.element.getBoundingClientRect();
|
|
2136
|
-
const P = Pt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
2137
|
-
if (p.width < P) {
|
|
2138
|
-
const C = P - p.width;
|
|
2139
|
-
p = new DOMRect(p.x - C / 2, p.y, p.width + C, p.height);
|
|
2140
|
-
}
|
|
2141
|
-
if (p.height < P) {
|
|
2142
|
-
const C = P - p.height;
|
|
2143
|
-
p = new DOMRect(p.x, p.y - C / 2, p.width, p.height + C);
|
|
2144
|
-
}
|
|
2145
|
-
const R = x <= u || x > c;
|
|
2146
|
-
!r && !R && l.push({
|
|
2147
|
-
group: e,
|
|
2148
|
-
groupSize: Q({ group: e }),
|
|
2149
|
-
panels: [d, h],
|
|
2150
|
-
separator: "width" in S ? undefined : S,
|
|
2151
|
-
rect: p
|
|
2152
|
-
}), r = false;
|
|
2153
|
-
}
|
|
2154
|
-
}
|
|
2155
|
-
a = false, d = h, v = [];
|
|
2156
|
-
}
|
|
2157
|
-
} else if (f.hasAttribute("data-separator")) {
|
|
2158
|
-
f.ariaDisabled !== null && (r = true);
|
|
2159
|
-
const h = i.find((g) => g.element === f);
|
|
2160
|
-
h ? v.push(h) : (d = undefined, v = []);
|
|
2161
|
-
} else
|
|
2162
|
-
a = true;
|
|
2163
|
-
}
|
|
2164
|
-
return l;
|
|
2165
|
-
}
|
|
2166
|
-
|
|
2167
|
-
class Je {
|
|
2168
|
-
#e = {};
|
|
2169
|
-
addListener(t, n) {
|
|
2170
|
-
const o = this.#e[t];
|
|
2171
|
-
return o === undefined ? this.#e[t] = [n] : o.includes(n) || o.push(n), () => {
|
|
2172
|
-
this.removeListener(t, n);
|
|
2173
|
-
};
|
|
2174
|
-
}
|
|
2175
|
-
emit(t, n) {
|
|
2176
|
-
const o = this.#e[t];
|
|
2177
|
-
if (o !== undefined)
|
|
2178
|
-
if (o.length === 1)
|
|
2179
|
-
o[0].call(null, n);
|
|
2180
|
-
else {
|
|
2181
|
-
let i = false, s = null;
|
|
2182
|
-
const l = Array.from(o);
|
|
2183
|
-
for (let r = 0;r < l.length; r++) {
|
|
2184
|
-
const a = l[r];
|
|
2185
|
-
try {
|
|
2186
|
-
a.call(null, n);
|
|
2187
|
-
} catch (u) {
|
|
2188
|
-
s === null && (i = true, s = u);
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
if (i)
|
|
2192
|
-
throw s;
|
|
2193
|
-
}
|
|
2194
|
-
}
|
|
2195
|
-
removeAllListeners() {
|
|
2196
|
-
this.#e = {};
|
|
2197
|
-
}
|
|
2198
|
-
removeListener(t, n) {
|
|
2199
|
-
const o = this.#e[t];
|
|
2200
|
-
if (o !== undefined) {
|
|
2201
|
-
const i = o.indexOf(n);
|
|
2202
|
-
i >= 0 && o.splice(i, 1);
|
|
2203
|
-
}
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
var A = /* @__PURE__ */ new Map;
|
|
2207
|
-
var Ze = new Je;
|
|
2208
|
-
function Lt(e) {
|
|
2209
|
-
A = new Map(A), A.delete(e);
|
|
2210
|
-
}
|
|
2211
|
-
function Me(e, t) {
|
|
2212
|
-
for (const [n] of A)
|
|
2213
|
-
if (n.id === e)
|
|
2214
|
-
return n;
|
|
2215
|
-
}
|
|
2216
|
-
function $(e, t) {
|
|
2217
|
-
for (const [n, o] of A)
|
|
2218
|
-
if (n.id === e)
|
|
2219
|
-
return o;
|
|
2220
|
-
if (t)
|
|
2221
|
-
throw Error(`Could not find data for Group with id ${e}`);
|
|
2222
|
-
}
|
|
2223
|
-
function U() {
|
|
2224
|
-
return A;
|
|
2225
|
-
}
|
|
2226
|
-
function ye(e, t) {
|
|
2227
|
-
return Ze.addListener("groupChange", (n) => {
|
|
2228
|
-
n.group.id === e && t(n);
|
|
2229
|
-
});
|
|
2230
|
-
}
|
|
2231
|
-
function _(e, t) {
|
|
2232
|
-
const n = A.get(e);
|
|
2233
|
-
A = new Map(A), A.set(e, t), Ze.emit("groupChange", {
|
|
2234
|
-
group: e,
|
|
2235
|
-
prev: n,
|
|
2236
|
-
next: t
|
|
2237
|
-
});
|
|
2238
|
-
}
|
|
2239
|
-
function Ct(e, t, n) {
|
|
2240
|
-
let o, i = {
|
|
2241
|
-
x: 1 / 0,
|
|
2242
|
-
y: 1 / 0
|
|
2243
|
-
};
|
|
2244
|
-
for (const s of t) {
|
|
2245
|
-
const l = qe(n, s.rect);
|
|
2246
|
-
switch (e) {
|
|
2247
|
-
case "horizontal": {
|
|
2248
|
-
l.x <= i.x && (o = s, i = l);
|
|
2249
|
-
break;
|
|
2250
|
-
}
|
|
2251
|
-
case "vertical": {
|
|
2252
|
-
l.y <= i.y && (o = s, i = l);
|
|
2253
|
-
break;
|
|
2254
|
-
}
|
|
2255
|
-
}
|
|
2256
|
-
}
|
|
2257
|
-
return o ? {
|
|
2258
|
-
distance: i,
|
|
2259
|
-
hitRegion: o
|
|
2260
|
-
} : undefined;
|
|
2261
|
-
}
|
|
2262
|
-
function Rt(e) {
|
|
2263
|
-
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
2264
|
-
}
|
|
2265
|
-
function Mt(e, t) {
|
|
2266
|
-
if (e === t)
|
|
2267
|
-
throw new Error("Cannot compare node with itself");
|
|
2268
|
-
const n = {
|
|
2269
|
-
a: ke(e),
|
|
2270
|
-
b: ke(t)
|
|
2271
|
-
};
|
|
2272
|
-
let o;
|
|
2273
|
-
for (;n.a.at(-1) === n.b.at(-1); )
|
|
2274
|
-
o = n.a.pop(), n.b.pop();
|
|
2275
|
-
L(o, "Stacking order can only be calculated for elements with a common ancestor");
|
|
2276
|
-
const i = {
|
|
2277
|
-
a: Ie(Ee(n.a)),
|
|
2278
|
-
b: Ie(Ee(n.b))
|
|
2279
|
-
};
|
|
2280
|
-
if (i.a === i.b) {
|
|
2281
|
-
const s = o.childNodes, l = {
|
|
2282
|
-
a: n.a.at(-1),
|
|
2283
|
-
b: n.b.at(-1)
|
|
2284
|
-
};
|
|
2285
|
-
let r = s.length;
|
|
2286
|
-
for (;r--; ) {
|
|
2287
|
-
const a = s[r];
|
|
2288
|
-
if (a === l.a)
|
|
2289
|
-
return 1;
|
|
2290
|
-
if (a === l.b)
|
|
2291
|
-
return -1;
|
|
2292
|
-
}
|
|
2293
|
-
}
|
|
2294
|
-
return Math.sign(i.a - i.b);
|
|
2295
|
-
}
|
|
2296
|
-
var Et = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
2297
|
-
function It(e) {
|
|
2298
|
-
const t = getComputedStyle(Qe(e) ?? e).display;
|
|
2299
|
-
return t === "flex" || t === "inline-flex";
|
|
2300
|
-
}
|
|
2301
|
-
function kt(e) {
|
|
2302
|
-
const t = getComputedStyle(e);
|
|
2303
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || It(e)) || +t.opacity < 1 || ("transform" in t) && t.transform !== "none" || ("webkitTransform" in t) && t.webkitTransform !== "none" || ("mixBlendMode" in t) && t.mixBlendMode !== "normal" || ("filter" in t) && t.filter !== "none" || ("webkitFilter" in t) && t.webkitFilter !== "none" || ("isolation" in t) && t.isolation === "isolate" || Et.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
2304
|
-
}
|
|
2305
|
-
function Ee(e) {
|
|
2306
|
-
let t = e.length;
|
|
2307
|
-
for (;t--; ) {
|
|
2308
|
-
const n = e[t];
|
|
2309
|
-
if (L(n, "Missing node"), kt(n))
|
|
2310
|
-
return n;
|
|
2311
|
-
}
|
|
2312
|
-
return null;
|
|
2313
|
-
}
|
|
2314
|
-
function Ie(e) {
|
|
2315
|
-
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
2316
|
-
}
|
|
2317
|
-
function ke(e) {
|
|
2318
|
-
const t = [];
|
|
2319
|
-
for (;e; )
|
|
2320
|
-
t.push(e), e = Qe(e);
|
|
2321
|
-
return t;
|
|
2322
|
-
}
|
|
2323
|
-
function Qe(e) {
|
|
2324
|
-
const { parentNode: t } = e;
|
|
2325
|
-
return Rt(t) ? t.host : t;
|
|
2326
|
-
}
|
|
2327
|
-
function Dt(e, t) {
|
|
2328
|
-
return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
|
|
2329
|
-
}
|
|
2330
|
-
function Tt({
|
|
2331
|
-
groupElement: e,
|
|
2332
|
-
hitRegion: t,
|
|
2333
|
-
pointerEventTarget: n
|
|
2334
|
-
}) {
|
|
2335
|
-
if (!Xe(n) || n.contains(e) || e.contains(n))
|
|
2336
|
-
return true;
|
|
2337
|
-
if (Mt(n, e) > 0) {
|
|
2338
|
-
let o = n;
|
|
2339
|
-
for (;o; ) {
|
|
2340
|
-
if (o.contains(e))
|
|
2341
|
-
return true;
|
|
2342
|
-
if (Dt(o.getBoundingClientRect(), t))
|
|
2343
|
-
return false;
|
|
2344
|
-
o = o.parentElement;
|
|
2345
|
-
}
|
|
2346
|
-
}
|
|
2347
|
-
return true;
|
|
2348
|
-
}
|
|
2349
|
-
function ve(e, t) {
|
|
2350
|
-
const n = [];
|
|
2351
|
-
return t.forEach((o, i) => {
|
|
2352
|
-
if (i.disabled)
|
|
2353
|
-
return;
|
|
2354
|
-
const s = Ye(i), l = Ct(i.orientation, s, {
|
|
2355
|
-
x: e.clientX,
|
|
2356
|
-
y: e.clientY
|
|
2357
|
-
});
|
|
2358
|
-
l && l.distance.x <= 0 && l.distance.y <= 0 && Tt({
|
|
2359
|
-
groupElement: i.element,
|
|
2360
|
-
hitRegion: l.hitRegion.rect,
|
|
2361
|
-
pointerEventTarget: e.target
|
|
2362
|
-
}) && n.push(l.hitRegion);
|
|
2363
|
-
}), n;
|
|
2364
|
-
}
|
|
2365
|
-
function Ot(e, t) {
|
|
2366
|
-
if (e.length !== t.length)
|
|
2367
|
-
return false;
|
|
2368
|
-
for (let n = 0;n < e.length; n++)
|
|
2369
|
-
if (e[n] != t[n])
|
|
2370
|
-
return false;
|
|
2371
|
-
return true;
|
|
2372
|
-
}
|
|
2373
|
-
function I(e, t, n = 0) {
|
|
2374
|
-
return Math.abs(D(e) - D(t)) <= n;
|
|
2375
|
-
}
|
|
2376
|
-
function G(e, t) {
|
|
2377
|
-
return I(e, t) ? 0 : e > t ? 1 : -1;
|
|
2378
|
-
}
|
|
2379
|
-
function Y({
|
|
2380
|
-
overrideDisabledPanels: e,
|
|
2381
|
-
panelConstraints: t,
|
|
2382
|
-
prevSize: n,
|
|
2383
|
-
size: o
|
|
2384
|
-
}) {
|
|
2385
|
-
const {
|
|
2386
|
-
collapsedSize: i = 0,
|
|
2387
|
-
collapsible: s,
|
|
2388
|
-
disabled: l,
|
|
2389
|
-
maxSize: r = 100,
|
|
2390
|
-
minSize: a = 0
|
|
2391
|
-
} = t;
|
|
2392
|
-
if (l && !e)
|
|
2393
|
-
return n;
|
|
2394
|
-
if (G(o, a) < 0)
|
|
2395
|
-
if (s) {
|
|
2396
|
-
const u = (i + a) / 2;
|
|
2397
|
-
G(o, u) < 0 ? o = i : o = a;
|
|
2398
|
-
} else
|
|
2399
|
-
o = a;
|
|
2400
|
-
return o = Math.min(r, o), o = D(o), o;
|
|
2401
|
-
}
|
|
2402
|
-
function se({
|
|
2403
|
-
delta: e,
|
|
2404
|
-
initialLayout: t,
|
|
2405
|
-
panelConstraints: n,
|
|
2406
|
-
pivotIndices: o,
|
|
2407
|
-
prevLayout: i,
|
|
2408
|
-
trigger: s
|
|
2409
|
-
}) {
|
|
2410
|
-
if (I(e, 0))
|
|
2411
|
-
return t;
|
|
2412
|
-
const l = s === "imperative-api", r = Object.values(t), a = Object.values(i), u = [...r], [c, m] = o;
|
|
2413
|
-
L(c != null, "Invalid first pivot index"), L(m != null, "Invalid second pivot index");
|
|
2414
|
-
let d = 0;
|
|
2415
|
-
switch (s) {
|
|
2416
|
-
case "keyboard": {
|
|
2417
|
-
{
|
|
2418
|
-
const f = e < 0 ? m : c, h = n[f];
|
|
2419
|
-
L(h, `Panel constraints not found for index ${f}`);
|
|
2420
|
-
const {
|
|
2421
|
-
collapsedSize: g = 0,
|
|
2422
|
-
collapsible: y,
|
|
2423
|
-
minSize: z = 0
|
|
2424
|
-
} = h;
|
|
2425
|
-
if (y) {
|
|
2426
|
-
const S = r[f];
|
|
2427
|
-
if (L(S != null, `Previous layout not found for panel index ${f}`), I(S, g)) {
|
|
2428
|
-
const p = z - S;
|
|
2429
|
-
G(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
}
|
|
2433
|
-
{
|
|
2434
|
-
const f = e < 0 ? c : m, h = n[f];
|
|
2435
|
-
L(h, `No panel constraints found for index ${f}`);
|
|
2436
|
-
const {
|
|
2437
|
-
collapsedSize: g = 0,
|
|
2438
|
-
collapsible: y,
|
|
2439
|
-
minSize: z = 0
|
|
2440
|
-
} = h;
|
|
2441
|
-
if (y) {
|
|
2442
|
-
const S = r[f];
|
|
2443
|
-
if (L(S != null, `Previous layout not found for panel index ${f}`), I(S, z)) {
|
|
2444
|
-
const p = S - g;
|
|
2445
|
-
G(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
|
|
2446
|
-
}
|
|
2447
|
-
}
|
|
2448
|
-
}
|
|
2449
|
-
break;
|
|
2450
|
-
}
|
|
2451
|
-
default: {
|
|
2452
|
-
const f = e < 0 ? m : c, h = n[f];
|
|
2453
|
-
L(h, `Panel constraints not found for index ${f}`);
|
|
2454
|
-
const g = r[f], { collapsible: y, collapsedSize: z, minSize: S } = h;
|
|
2455
|
-
if (y && G(g, S) < 0)
|
|
2456
|
-
if (e > 0) {
|
|
2457
|
-
const p = S - z, P = p / 2, R = g + e;
|
|
2458
|
-
G(R, S) < 0 && (e = G(e, P) <= 0 ? 0 : p);
|
|
2459
|
-
} else {
|
|
2460
|
-
const p = S - z, P = 100 - p / 2, R = g - e;
|
|
2461
|
-
G(R, S) < 0 && (e = G(100 + e, P) > 0 ? 0 : -p);
|
|
2462
|
-
}
|
|
2463
|
-
break;
|
|
2464
|
-
}
|
|
2465
|
-
}
|
|
2466
|
-
{
|
|
2467
|
-
const f = e < 0 ? 1 : -1;
|
|
2468
|
-
let h = e < 0 ? m : c, g = 0;
|
|
2469
|
-
for (;; ) {
|
|
2470
|
-
const z = r[h];
|
|
2471
|
-
L(z != null, `Previous layout not found for panel index ${h}`);
|
|
2472
|
-
const p = Y({
|
|
2473
|
-
overrideDisabledPanels: l,
|
|
2474
|
-
panelConstraints: n[h],
|
|
2475
|
-
prevSize: z,
|
|
2476
|
-
size: 100
|
|
2477
|
-
}) - z;
|
|
2478
|
-
if (g += p, h += f, h < 0 || h >= n.length)
|
|
2479
|
-
break;
|
|
2480
|
-
}
|
|
2481
|
-
const y = Math.min(Math.abs(e), Math.abs(g));
|
|
2482
|
-
e = e < 0 ? 0 - y : y;
|
|
2483
|
-
}
|
|
2484
|
-
{
|
|
2485
|
-
let h = e < 0 ? c : m;
|
|
2486
|
-
for (;h >= 0 && h < n.length; ) {
|
|
2487
|
-
const g = Math.abs(e) - Math.abs(d), y = r[h];
|
|
2488
|
-
L(y != null, `Previous layout not found for panel index ${h}`);
|
|
2489
|
-
const z = y - g, S = Y({
|
|
2490
|
-
overrideDisabledPanels: l,
|
|
2491
|
-
panelConstraints: n[h],
|
|
2492
|
-
prevSize: y,
|
|
2493
|
-
size: z
|
|
2494
|
-
});
|
|
2495
|
-
if (!I(y, S) && (d += y - S, u[h] = S, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), undefined, {
|
|
2496
|
-
numeric: true
|
|
2497
|
-
}) >= 0))
|
|
2498
|
-
break;
|
|
2499
|
-
e < 0 ? h-- : h++;
|
|
2500
|
-
}
|
|
2501
|
-
}
|
|
2502
|
-
if (Ot(a, u))
|
|
2503
|
-
return i;
|
|
2504
|
-
{
|
|
2505
|
-
const f = e < 0 ? m : c, h = r[f];
|
|
2506
|
-
L(h != null, `Previous layout not found for panel index ${f}`);
|
|
2507
|
-
const g = h + d, y = Y({
|
|
2508
|
-
overrideDisabledPanels: l,
|
|
2509
|
-
panelConstraints: n[f],
|
|
2510
|
-
prevSize: h,
|
|
2511
|
-
size: g
|
|
2512
|
-
});
|
|
2513
|
-
if (u[f] = y, !I(y, g)) {
|
|
2514
|
-
let z = g - y, p = e < 0 ? m : c;
|
|
2515
|
-
for (;p >= 0 && p < n.length; ) {
|
|
2516
|
-
const P = u[p];
|
|
2517
|
-
L(P != null, `Previous layout not found for panel index ${p}`);
|
|
2518
|
-
const R = P + z, C = Y({
|
|
2519
|
-
overrideDisabledPanels: l,
|
|
2520
|
-
panelConstraints: n[p],
|
|
2521
|
-
prevSize: P,
|
|
2522
|
-
size: R
|
|
2523
|
-
});
|
|
2524
|
-
if (I(P, C) || (z -= C - P, u[p] = C), I(z, 0))
|
|
2525
|
-
break;
|
|
2526
|
-
e > 0 ? p-- : p++;
|
|
2527
|
-
}
|
|
2528
|
-
}
|
|
2529
|
-
}
|
|
2530
|
-
const v = Object.values(u).reduce((f, h) => h + f, 0);
|
|
2531
|
-
if (!I(v, 100, 0.1))
|
|
2532
|
-
return i;
|
|
2533
|
-
const x = Object.keys(i);
|
|
2534
|
-
return u.reduce((f, h, g) => (f[x[g]] = h, f), {});
|
|
2535
|
-
}
|
|
2536
|
-
function j(e, t) {
|
|
2537
|
-
if (Object.keys(e).length !== Object.keys(t).length)
|
|
2538
|
-
return false;
|
|
2539
|
-
for (const n in e)
|
|
2540
|
-
if (t[n] === undefined || G(e[n], t[n]) !== 0)
|
|
2541
|
-
return false;
|
|
2542
|
-
return true;
|
|
2543
|
-
}
|
|
2544
|
-
function B({
|
|
2545
|
-
layout: e,
|
|
2546
|
-
panelConstraints: t
|
|
2547
|
-
}) {
|
|
2548
|
-
const n = Object.values(e), o = [...n], i = o.reduce((r, a) => r + a, 0);
|
|
2549
|
-
if (o.length !== t.length)
|
|
2550
|
-
throw Error(`Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`);
|
|
2551
|
-
if (!I(i, 100) && o.length > 0)
|
|
2552
|
-
for (let r = 0;r < t.length; r++) {
|
|
2553
|
-
const a = o[r];
|
|
2554
|
-
L(a != null, `No layout data found for index ${r}`);
|
|
2555
|
-
const u = 100 / i * a;
|
|
2556
|
-
o[r] = u;
|
|
2557
|
-
}
|
|
2558
|
-
let s = 0;
|
|
2559
|
-
for (let r = 0;r < t.length; r++) {
|
|
2560
|
-
const a = n[r];
|
|
2561
|
-
L(a != null, `No layout data found for index ${r}`);
|
|
2562
|
-
const u = o[r];
|
|
2563
|
-
L(u != null, `No layout data found for index ${r}`);
|
|
2564
|
-
const c = Y({
|
|
2565
|
-
overrideDisabledPanels: true,
|
|
2566
|
-
panelConstraints: t[r],
|
|
2567
|
-
prevSize: a,
|
|
2568
|
-
size: u
|
|
2569
|
-
});
|
|
2570
|
-
u != c && (s += u - c, o[r] = c);
|
|
2571
|
-
}
|
|
2572
|
-
if (!I(s, 0))
|
|
2573
|
-
for (let r = 0;r < t.length; r++) {
|
|
2574
|
-
const a = o[r];
|
|
2575
|
-
L(a != null, `No layout data found for index ${r}`);
|
|
2576
|
-
const u = a + s, c = Y({
|
|
2577
|
-
overrideDisabledPanels: true,
|
|
2578
|
-
panelConstraints: t[r],
|
|
2579
|
-
prevSize: a,
|
|
2580
|
-
size: u
|
|
2581
|
-
});
|
|
2582
|
-
if (a !== c && (s -= c - a, o[r] = c, I(s, 0)))
|
|
2583
|
-
break;
|
|
2584
|
-
}
|
|
2585
|
-
const l = Object.keys(e);
|
|
2586
|
-
return o.reduce((r, a, u) => (r[l[u]] = a, r), {});
|
|
2587
|
-
}
|
|
2588
|
-
function et({
|
|
2589
|
-
groupId: e,
|
|
2590
|
-
panelId: t
|
|
2591
|
-
}) {
|
|
2592
|
-
const n = () => {
|
|
2593
|
-
const r = U();
|
|
2594
|
-
for (const [
|
|
2595
|
-
a,
|
|
2596
|
-
{
|
|
2597
|
-
defaultLayoutDeferred: u,
|
|
2598
|
-
derivedPanelConstraints: c,
|
|
2599
|
-
layout: m,
|
|
2600
|
-
groupSize: d,
|
|
2601
|
-
separatorToPanels: v
|
|
2602
|
-
}
|
|
2603
|
-
] of r)
|
|
2604
|
-
if (a.id === e)
|
|
2605
|
-
return {
|
|
2606
|
-
defaultLayoutDeferred: u,
|
|
2607
|
-
derivedPanelConstraints: c,
|
|
2608
|
-
group: a,
|
|
2609
|
-
groupSize: d,
|
|
2610
|
-
layout: m,
|
|
2611
|
-
separatorToPanels: v
|
|
2612
|
-
};
|
|
2613
|
-
throw Error(`Group ${e} not found`);
|
|
2614
|
-
}, o = () => {
|
|
2615
|
-
const r = n().derivedPanelConstraints.find((a) => a.panelId === t);
|
|
2616
|
-
if (r !== undefined)
|
|
2617
|
-
return r;
|
|
2618
|
-
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
2619
|
-
}, i = () => {
|
|
2620
|
-
const r = n().group.panels.find((a) => a.id === t);
|
|
2621
|
-
if (r !== undefined)
|
|
2622
|
-
return r;
|
|
2623
|
-
throw Error(`Layout not found for Panel ${t}`);
|
|
2624
|
-
}, s = () => {
|
|
2625
|
-
const r = n().layout[t];
|
|
2626
|
-
if (r !== undefined)
|
|
2627
|
-
return r;
|
|
2628
|
-
throw Error(`Layout not found for Panel ${t}`);
|
|
2629
|
-
}, l = (r) => {
|
|
2630
|
-
const a = s();
|
|
2631
|
-
if (r === a)
|
|
2632
|
-
return;
|
|
2633
|
-
const {
|
|
2634
|
-
defaultLayoutDeferred: u,
|
|
2635
|
-
derivedPanelConstraints: c,
|
|
2636
|
-
group: m,
|
|
2637
|
-
groupSize: d,
|
|
2638
|
-
layout: v,
|
|
2639
|
-
separatorToPanels: x
|
|
2640
|
-
} = n(), f = m.panels.findIndex((z) => z.id === t), h = f === m.panels.length - 1, g = se({
|
|
2641
|
-
delta: h ? a - r : r - a,
|
|
2642
|
-
initialLayout: v,
|
|
2643
|
-
panelConstraints: c,
|
|
2644
|
-
pivotIndices: h ? [f - 1, f] : [f, f + 1],
|
|
2645
|
-
prevLayout: v,
|
|
2646
|
-
trigger: "imperative-api"
|
|
2647
|
-
}), y = B({
|
|
2648
|
-
layout: g,
|
|
2649
|
-
panelConstraints: c
|
|
2650
|
-
});
|
|
2651
|
-
j(v, y) || _(m, {
|
|
2652
|
-
defaultLayoutDeferred: u,
|
|
2653
|
-
derivedPanelConstraints: c,
|
|
2654
|
-
groupSize: d,
|
|
2655
|
-
layout: y,
|
|
2656
|
-
separatorToPanels: x
|
|
2657
|
-
});
|
|
2658
|
-
};
|
|
2659
|
-
return {
|
|
2660
|
-
collapse: () => {
|
|
2661
|
-
const { collapsible: r, collapsedSize: a } = o(), { mutableValues: u } = i(), c = s();
|
|
2662
|
-
r && c !== a && (u.expandToSize = c, l(a));
|
|
2663
|
-
},
|
|
2664
|
-
expand: () => {
|
|
2665
|
-
const { collapsible: r, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), m = s();
|
|
2666
|
-
if (r && m === a) {
|
|
2667
|
-
let d = c.expandToSize ?? u;
|
|
2668
|
-
d === 0 && (d = 1), l(d);
|
|
2669
|
-
}
|
|
2670
|
-
},
|
|
2671
|
-
getSize: () => {
|
|
2672
|
-
const { group: r } = n(), a = s(), { element: u } = i(), c = r.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
2673
|
-
return {
|
|
2674
|
-
asPercentage: a,
|
|
2675
|
-
inPixels: c
|
|
2676
|
-
};
|
|
2677
|
-
},
|
|
2678
|
-
isCollapsed: () => {
|
|
2679
|
-
const { collapsible: r, collapsedSize: a } = o(), u = s();
|
|
2680
|
-
return r && I(a, u);
|
|
2681
|
-
},
|
|
2682
|
-
resize: (r) => {
|
|
2683
|
-
const { group: a } = n(), { element: u } = i(), c = Q({ group: a }), m = te({
|
|
2684
|
-
groupSize: c,
|
|
2685
|
-
panelElement: u,
|
|
2686
|
-
styleProp: r
|
|
2687
|
-
}), d = D(m / c * 100);
|
|
2688
|
-
l(d);
|
|
2689
|
-
}
|
|
2690
|
-
};
|
|
2691
|
-
}
|
|
2692
|
-
function De(e) {
|
|
2693
|
-
if (e.defaultPrevented)
|
|
2694
|
-
return;
|
|
2695
|
-
const t = U();
|
|
2696
|
-
ve(e, t).forEach((o) => {
|
|
2697
|
-
if (o.separator) {
|
|
2698
|
-
const i = o.panels.find((s) => s.panelConstraints.defaultSize !== undefined);
|
|
2699
|
-
if (i) {
|
|
2700
|
-
const s = i.panelConstraints.defaultSize, l = et({
|
|
2701
|
-
groupId: o.group.id,
|
|
2702
|
-
panelId: i.id
|
|
2703
|
-
});
|
|
2704
|
-
l && s !== undefined && (l.resize(s), e.preventDefault());
|
|
2705
|
-
}
|
|
2706
|
-
}
|
|
2707
|
-
});
|
|
2708
|
-
}
|
|
2709
|
-
function fe(e) {
|
|
2710
|
-
const t = U();
|
|
2711
|
-
for (const [n] of t)
|
|
2712
|
-
if (n.separators.some((o) => o.element === e))
|
|
2713
|
-
return n;
|
|
2714
|
-
throw Error("Could not find parent Group for separator element");
|
|
2715
|
-
}
|
|
2716
|
-
function tt({
|
|
2717
|
-
groupId: e
|
|
2718
|
-
}) {
|
|
2719
|
-
const t = () => {
|
|
2720
|
-
const n = U();
|
|
2721
|
-
for (const [o, i] of n)
|
|
2722
|
-
if (o.id === e)
|
|
2723
|
-
return { group: o, ...i };
|
|
2724
|
-
throw Error(`Could not find Group with id "${e}"`);
|
|
2725
|
-
};
|
|
2726
|
-
return {
|
|
2727
|
-
getLayout() {
|
|
2728
|
-
const { defaultLayoutDeferred: n, layout: o } = t();
|
|
2729
|
-
return n ? {} : o;
|
|
2730
|
-
},
|
|
2731
|
-
setLayout(n) {
|
|
2732
|
-
const {
|
|
2733
|
-
defaultLayoutDeferred: o,
|
|
2734
|
-
derivedPanelConstraints: i,
|
|
2735
|
-
group: s,
|
|
2736
|
-
groupSize: l,
|
|
2737
|
-
layout: r,
|
|
2738
|
-
separatorToPanels: a
|
|
2739
|
-
} = t(), u = B({
|
|
2740
|
-
layout: n,
|
|
2741
|
-
panelConstraints: i
|
|
2742
|
-
});
|
|
2743
|
-
return o ? r : (j(r, u) || _(s, {
|
|
2744
|
-
defaultLayoutDeferred: o,
|
|
2745
|
-
derivedPanelConstraints: i,
|
|
2746
|
-
groupSize: l,
|
|
2747
|
-
layout: u,
|
|
2748
|
-
separatorToPanels: a
|
|
2749
|
-
}), u);
|
|
2750
|
-
}
|
|
2751
|
-
};
|
|
2752
|
-
}
|
|
2753
|
-
function V(e, t) {
|
|
2754
|
-
const n = fe(e), o = $(n.id, true), i = n.separators.find((m) => m.element === e);
|
|
2755
|
-
L(i, "Matching separator not found");
|
|
2756
|
-
const s = o.separatorToPanels.get(i);
|
|
2757
|
-
L(s, "Matching panels not found");
|
|
2758
|
-
const l = s.map((m) => n.panels.indexOf(m)), a = tt({ groupId: n.id }).getLayout(), u = se({
|
|
2759
|
-
delta: t,
|
|
2760
|
-
initialLayout: a,
|
|
2761
|
-
panelConstraints: o.derivedPanelConstraints,
|
|
2762
|
-
pivotIndices: l,
|
|
2763
|
-
prevLayout: a,
|
|
2764
|
-
trigger: "keyboard"
|
|
2765
|
-
}), c = B({
|
|
2766
|
-
layout: u,
|
|
2767
|
-
panelConstraints: o.derivedPanelConstraints
|
|
2768
|
-
});
|
|
2769
|
-
j(a, c) || _(n, {
|
|
2770
|
-
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
2771
|
-
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
2772
|
-
groupSize: o.groupSize,
|
|
2773
|
-
layout: c,
|
|
2774
|
-
separatorToPanels: o.separatorToPanels
|
|
2775
|
-
});
|
|
2776
|
-
}
|
|
2777
|
-
function Te(e) {
|
|
2778
|
-
if (e.defaultPrevented)
|
|
2779
|
-
return;
|
|
2780
|
-
const t = e.currentTarget, n = fe(t);
|
|
2781
|
-
if (!n.disabled)
|
|
2782
|
-
switch (e.key) {
|
|
2783
|
-
case "ArrowDown": {
|
|
2784
|
-
e.preventDefault(), n.orientation === "vertical" && V(t, 5);
|
|
2785
|
-
break;
|
|
2786
|
-
}
|
|
2787
|
-
case "ArrowLeft": {
|
|
2788
|
-
e.preventDefault(), n.orientation === "horizontal" && V(t, -5);
|
|
2789
|
-
break;
|
|
2790
|
-
}
|
|
2791
|
-
case "ArrowRight": {
|
|
2792
|
-
e.preventDefault(), n.orientation === "horizontal" && V(t, 5);
|
|
2793
|
-
break;
|
|
2794
|
-
}
|
|
2795
|
-
case "ArrowUp": {
|
|
2796
|
-
e.preventDefault(), n.orientation === "vertical" && V(t, -5);
|
|
2797
|
-
break;
|
|
2798
|
-
}
|
|
2799
|
-
case "End": {
|
|
2800
|
-
e.preventDefault(), V(t, 100);
|
|
2801
|
-
break;
|
|
2802
|
-
}
|
|
2803
|
-
case "Enter": {
|
|
2804
|
-
e.preventDefault();
|
|
2805
|
-
const o = fe(t), i = $(o.id, true), { derivedPanelConstraints: s, layout: l, separatorToPanels: r } = i, a = o.separators.find((d) => d.element === t);
|
|
2806
|
-
L(a, "Matching separator not found");
|
|
2807
|
-
const u = r.get(a);
|
|
2808
|
-
L(u, "Matching panels not found");
|
|
2809
|
-
const c = u[0], m = s.find((d) => d.panelId === c.id);
|
|
2810
|
-
if (L(m, "Panel metadata not found"), m.collapsible) {
|
|
2811
|
-
const d = l[c.id], v = m.collapsedSize === d ? o.mutableState.expandedPanelSizes[c.id] ?? m.minSize : m.collapsedSize;
|
|
2812
|
-
V(t, v - d);
|
|
2813
|
-
}
|
|
2814
|
-
break;
|
|
2815
|
-
}
|
|
2816
|
-
case "F6": {
|
|
2817
|
-
e.preventDefault();
|
|
2818
|
-
const i = fe(t).separators.map((a) => a.element), s = Array.from(i).findIndex((a) => a === e.currentTarget);
|
|
2819
|
-
L(s !== null, "Index not found");
|
|
2820
|
-
const l = e.shiftKey ? s > 0 ? s - 1 : i.length - 1 : s + 1 < i.length ? s + 1 : 0;
|
|
2821
|
-
i[l].focus({
|
|
2822
|
-
preventScroll: true
|
|
2823
|
-
});
|
|
2824
|
-
break;
|
|
2825
|
-
}
|
|
2826
|
-
case "Home": {
|
|
2827
|
-
e.preventDefault(), V(t, -100);
|
|
2828
|
-
break;
|
|
2829
|
-
}
|
|
2830
|
-
}
|
|
2831
|
-
}
|
|
2832
|
-
var J = {
|
|
2833
|
-
cursorFlags: 0,
|
|
2834
|
-
state: "inactive"
|
|
2835
|
-
};
|
|
2836
|
-
var ze = new Je;
|
|
2837
|
-
function W() {
|
|
2838
|
-
return J;
|
|
2839
|
-
}
|
|
2840
|
-
function Gt(e) {
|
|
2841
|
-
return ze.addListener("change", e);
|
|
2842
|
-
}
|
|
2843
|
-
function At(e) {
|
|
2844
|
-
const t = J, n = { ...J };
|
|
2845
|
-
n.cursorFlags = e, J = n, ze.emit("change", {
|
|
2846
|
-
prev: t,
|
|
2847
|
-
next: n
|
|
2848
|
-
});
|
|
2849
|
-
}
|
|
2850
|
-
function Z(e) {
|
|
2851
|
-
const t = J;
|
|
2852
|
-
J = e, ze.emit("change", {
|
|
2853
|
-
prev: t,
|
|
2854
|
-
next: e
|
|
2855
|
-
});
|
|
2856
|
-
}
|
|
2857
|
-
function Oe(e) {
|
|
2858
|
-
if (e.defaultPrevented)
|
|
2859
|
-
return;
|
|
2860
|
-
if (e.pointerType === "mouse" && e.button > 0)
|
|
2861
|
-
return;
|
|
2862
|
-
const t = U(), n = ve(e, t), o = /* @__PURE__ */ new Map;
|
|
2863
|
-
let i = false;
|
|
2864
|
-
n.forEach((s) => {
|
|
2865
|
-
s.separator && (i || (i = true, s.separator.element.focus({
|
|
2866
|
-
preventScroll: true
|
|
2867
|
-
})));
|
|
2868
|
-
const l = t.get(s.group);
|
|
2869
|
-
l && o.set(s.group, l.layout);
|
|
2870
|
-
}), Z({
|
|
2871
|
-
cursorFlags: 0,
|
|
2872
|
-
hitRegions: n,
|
|
2873
|
-
initialLayoutMap: o,
|
|
2874
|
-
pointerDownAtPoint: { x: e.clientX, y: e.clientY },
|
|
2875
|
-
state: "active"
|
|
2876
|
-
}), n.length && e.preventDefault();
|
|
2877
|
-
}
|
|
2878
|
-
var Nt = (e) => e;
|
|
2879
|
-
var he = () => {};
|
|
2880
|
-
var nt = 1;
|
|
2881
|
-
var ot = 2;
|
|
2882
|
-
var it = 4;
|
|
2883
|
-
var rt = 8;
|
|
2884
|
-
var Ge = 3;
|
|
2885
|
-
var Ae = 12;
|
|
2886
|
-
var ce;
|
|
2887
|
-
function Ne() {
|
|
2888
|
-
return ce === undefined && (ce = false, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (ce = true)), ce;
|
|
2889
|
-
}
|
|
2890
|
-
function _t({
|
|
2891
|
-
cursorFlags: e,
|
|
2892
|
-
groups: t,
|
|
2893
|
-
state: n
|
|
2894
|
-
}) {
|
|
2895
|
-
let o = 0, i = 0;
|
|
2896
|
-
switch (n) {
|
|
2897
|
-
case "active":
|
|
2898
|
-
case "hover":
|
|
2899
|
-
t.forEach((s) => {
|
|
2900
|
-
if (!s.mutableState.disableCursor)
|
|
2901
|
-
switch (s.orientation) {
|
|
2902
|
-
case "horizontal": {
|
|
2903
|
-
o++;
|
|
2904
|
-
break;
|
|
2905
|
-
}
|
|
2906
|
-
case "vertical": {
|
|
2907
|
-
i++;
|
|
2908
|
-
break;
|
|
2909
|
-
}
|
|
2910
|
-
}
|
|
2911
|
-
});
|
|
2912
|
-
}
|
|
2913
|
-
if (!(o === 0 && i === 0)) {
|
|
2914
|
-
switch (n) {
|
|
2915
|
-
case "active": {
|
|
2916
|
-
if (e && Ne()) {
|
|
2917
|
-
const s = (e & nt) !== 0, l = (e & ot) !== 0, r = (e & it) !== 0, a = (e & rt) !== 0;
|
|
2918
|
-
if (s)
|
|
2919
|
-
return r ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
2920
|
-
if (l)
|
|
2921
|
-
return r ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
2922
|
-
if (r)
|
|
2923
|
-
return "s-resize";
|
|
2924
|
-
if (a)
|
|
2925
|
-
return "n-resize";
|
|
2926
|
-
}
|
|
2927
|
-
break;
|
|
2928
|
-
}
|
|
2929
|
-
}
|
|
2930
|
-
return Ne() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
2931
|
-
}
|
|
2932
|
-
}
|
|
2933
|
-
var _e = /* @__PURE__ */ new WeakMap;
|
|
2934
|
-
function be(e) {
|
|
2935
|
-
if (e.defaultView === null || e.defaultView === undefined)
|
|
2936
|
-
return;
|
|
2937
|
-
let { prevStyle: t, styleSheet: n } = _e.get(e) ?? {};
|
|
2938
|
-
n === undefined && (n = new e.defaultView.CSSStyleSheet, e.adoptedStyleSheets && e.adoptedStyleSheets.push(n));
|
|
2939
|
-
const o = W();
|
|
2940
|
-
switch (o.state) {
|
|
2941
|
-
case "active":
|
|
2942
|
-
case "hover": {
|
|
2943
|
-
const i = _t({
|
|
2944
|
-
cursorFlags: o.cursorFlags,
|
|
2945
|
-
groups: o.hitRegions.map((l) => l.group),
|
|
2946
|
-
state: o.state
|
|
2947
|
-
}), s = `*, *:hover {cursor: ${i} !important; }`;
|
|
2948
|
-
if (t === s)
|
|
2949
|
-
return;
|
|
2950
|
-
t = s, i ? n.cssRules.length === 0 ? n.insertRule(s) : n.replaceSync(s) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
2951
|
-
break;
|
|
2952
|
-
}
|
|
2953
|
-
case "inactive": {
|
|
2954
|
-
t = undefined, n.cssRules.length === 1 && n.deleteRule(0);
|
|
2955
|
-
break;
|
|
2956
|
-
}
|
|
2957
|
-
}
|
|
2958
|
-
_e.set(e, {
|
|
2959
|
-
prevStyle: t,
|
|
2960
|
-
styleSheet: n
|
|
2961
|
-
});
|
|
2962
|
-
}
|
|
2963
|
-
function st({
|
|
2964
|
-
document: e,
|
|
2965
|
-
event: t,
|
|
2966
|
-
hitRegions: n,
|
|
2967
|
-
initialLayoutMap: o,
|
|
2968
|
-
mountedGroups: i,
|
|
2969
|
-
pointerDownAtPoint: s,
|
|
2970
|
-
prevCursorFlags: l
|
|
2971
|
-
}) {
|
|
2972
|
-
let r = 0;
|
|
2973
|
-
n.forEach((u) => {
|
|
2974
|
-
const { group: c, groupSize: m } = u, { orientation: d, panels: v } = c, { disableCursor: x } = c.mutableState;
|
|
2975
|
-
let f = 0;
|
|
2976
|
-
s ? d === "horizontal" ? f = (t.clientX - s.x) / m * 100 : f = (t.clientY - s.y) / m * 100 : d === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
|
|
2977
|
-
const h = o.get(c), g = i.get(c);
|
|
2978
|
-
if (!h || !g)
|
|
2979
|
-
return;
|
|
2980
|
-
const {
|
|
2981
|
-
defaultLayoutDeferred: y,
|
|
2982
|
-
derivedPanelConstraints: z,
|
|
2983
|
-
groupSize: S,
|
|
2984
|
-
layout: p,
|
|
2985
|
-
separatorToPanels: P
|
|
2986
|
-
} = g;
|
|
2987
|
-
if (z && p && P) {
|
|
2988
|
-
const R = se({
|
|
2989
|
-
delta: f,
|
|
2990
|
-
initialLayout: h,
|
|
2991
|
-
panelConstraints: z,
|
|
2992
|
-
pivotIndices: u.panels.map((C) => v.indexOf(C)),
|
|
2993
|
-
prevLayout: p,
|
|
2994
|
-
trigger: "mouse-or-touch"
|
|
2995
|
-
});
|
|
2996
|
-
if (j(R, p)) {
|
|
2997
|
-
if (f !== 0 && !x)
|
|
2998
|
-
switch (d) {
|
|
2999
|
-
case "horizontal": {
|
|
3000
|
-
r |= f < 0 ? nt : ot;
|
|
3001
|
-
break;
|
|
3002
|
-
}
|
|
3003
|
-
case "vertical": {
|
|
3004
|
-
r |= f < 0 ? it : rt;
|
|
3005
|
-
break;
|
|
3006
|
-
}
|
|
3007
|
-
}
|
|
3008
|
-
} else
|
|
3009
|
-
_(u.group, {
|
|
3010
|
-
defaultLayoutDeferred: y,
|
|
3011
|
-
derivedPanelConstraints: z,
|
|
3012
|
-
groupSize: S,
|
|
3013
|
-
layout: R,
|
|
3014
|
-
separatorToPanels: P
|
|
3015
|
-
});
|
|
3016
|
-
}
|
|
3017
|
-
});
|
|
3018
|
-
let a = 0;
|
|
3019
|
-
t.movementX === 0 ? a |= l & Ge : a |= r & Ge, t.movementY === 0 ? a |= l & Ae : a |= r & Ae, At(a), be(e);
|
|
3020
|
-
}
|
|
3021
|
-
function Fe(e) {
|
|
3022
|
-
const t = U(), n = W();
|
|
3023
|
-
switch (n.state) {
|
|
3024
|
-
case "active":
|
|
3025
|
-
st({
|
|
3026
|
-
document: e.currentTarget,
|
|
3027
|
-
event: e,
|
|
3028
|
-
hitRegions: n.hitRegions,
|
|
3029
|
-
initialLayoutMap: n.initialLayoutMap,
|
|
3030
|
-
mountedGroups: t,
|
|
3031
|
-
prevCursorFlags: n.cursorFlags
|
|
3032
|
-
});
|
|
3033
|
-
}
|
|
3034
|
-
}
|
|
3035
|
-
function $e(e) {
|
|
3036
|
-
if (e.defaultPrevented)
|
|
3037
|
-
return;
|
|
3038
|
-
const t = W(), n = U();
|
|
3039
|
-
switch (t.state) {
|
|
3040
|
-
case "active": {
|
|
3041
|
-
if (e.buttons === 0) {
|
|
3042
|
-
Z({
|
|
3043
|
-
cursorFlags: 0,
|
|
3044
|
-
state: "inactive"
|
|
3045
|
-
}), t.hitRegions.forEach((o) => {
|
|
3046
|
-
const i = $(o.group.id, true);
|
|
3047
|
-
_(o.group, i);
|
|
3048
|
-
});
|
|
3049
|
-
return;
|
|
3050
|
-
}
|
|
3051
|
-
for (const o of t.hitRegions)
|
|
3052
|
-
if (o.separator) {
|
|
3053
|
-
const { element: i } = o.separator;
|
|
3054
|
-
i.hasPointerCapture?.(e.pointerId) || i.setPointerCapture?.(e.pointerId);
|
|
3055
|
-
}
|
|
3056
|
-
st({
|
|
3057
|
-
document: e.currentTarget,
|
|
3058
|
-
event: e,
|
|
3059
|
-
hitRegions: t.hitRegions,
|
|
3060
|
-
initialLayoutMap: t.initialLayoutMap,
|
|
3061
|
-
mountedGroups: n,
|
|
3062
|
-
pointerDownAtPoint: t.pointerDownAtPoint,
|
|
3063
|
-
prevCursorFlags: t.cursorFlags
|
|
3064
|
-
});
|
|
3065
|
-
break;
|
|
3066
|
-
}
|
|
3067
|
-
default: {
|
|
3068
|
-
const o = ve(e, n);
|
|
3069
|
-
o.length === 0 ? t.state !== "inactive" && Z({
|
|
3070
|
-
cursorFlags: 0,
|
|
3071
|
-
state: "inactive"
|
|
3072
|
-
}) : Z({
|
|
3073
|
-
cursorFlags: 0,
|
|
3074
|
-
hitRegions: o,
|
|
3075
|
-
state: "hover"
|
|
3076
|
-
}), be(e.currentTarget);
|
|
3077
|
-
break;
|
|
3078
|
-
}
|
|
3079
|
-
}
|
|
3080
|
-
}
|
|
3081
|
-
function He(e) {
|
|
3082
|
-
if (e.relatedTarget instanceof HTMLIFrameElement)
|
|
3083
|
-
switch (W().state) {
|
|
3084
|
-
case "hover":
|
|
3085
|
-
Z({
|
|
3086
|
-
cursorFlags: 0,
|
|
3087
|
-
state: "inactive"
|
|
3088
|
-
});
|
|
3089
|
-
}
|
|
3090
|
-
}
|
|
3091
|
-
function Ve(e) {
|
|
3092
|
-
if (e.defaultPrevented)
|
|
3093
|
-
return;
|
|
3094
|
-
if (e.pointerType === "mouse" && e.button > 0)
|
|
3095
|
-
return;
|
|
3096
|
-
const t = W();
|
|
3097
|
-
switch (t.state) {
|
|
3098
|
-
case "active":
|
|
3099
|
-
Z({
|
|
3100
|
-
cursorFlags: 0,
|
|
3101
|
-
state: "inactive"
|
|
3102
|
-
}), t.hitRegions.length > 0 && (be(e.currentTarget), t.hitRegions.forEach((n) => {
|
|
3103
|
-
const o = $(n.group.id, true);
|
|
3104
|
-
_(n.group, o);
|
|
3105
|
-
}), e.preventDefault());
|
|
3106
|
-
}
|
|
3107
|
-
}
|
|
3108
|
-
function je(e) {
|
|
3109
|
-
let t = 0, n = 0;
|
|
3110
|
-
const o = {};
|
|
3111
|
-
for (const s of e)
|
|
3112
|
-
if (s.defaultSize !== undefined) {
|
|
3113
|
-
t++;
|
|
3114
|
-
const l = D(s.defaultSize);
|
|
3115
|
-
n += l, o[s.panelId] = l;
|
|
3116
|
-
} else
|
|
3117
|
-
o[s.panelId] = undefined;
|
|
3118
|
-
const i = e.length - t;
|
|
3119
|
-
if (i !== 0) {
|
|
3120
|
-
const s = D((100 - n) / i);
|
|
3121
|
-
for (const l of e)
|
|
3122
|
-
l.defaultSize === undefined && (o[l.panelId] = s);
|
|
3123
|
-
}
|
|
3124
|
-
return o;
|
|
3125
|
-
}
|
|
3126
|
-
function Ft(e, t, n) {
|
|
3127
|
-
if (!n[0])
|
|
3128
|
-
return;
|
|
3129
|
-
const i = e.panels.find((u) => u.element === t);
|
|
3130
|
-
if (!i || !i.onResize)
|
|
3131
|
-
return;
|
|
3132
|
-
const s = Q({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
|
|
3133
|
-
asPercentage: D(l / s * 100),
|
|
3134
|
-
inPixels: l
|
|
3135
|
-
};
|
|
3136
|
-
i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
|
|
3137
|
-
}
|
|
3138
|
-
function $t(e, t) {
|
|
3139
|
-
if (Object.keys(e).length !== Object.keys(t).length)
|
|
3140
|
-
return false;
|
|
3141
|
-
for (const o in e)
|
|
3142
|
-
if (e[o] !== t[o])
|
|
3143
|
-
return false;
|
|
3144
|
-
return true;
|
|
3145
|
-
}
|
|
3146
|
-
function Ht({
|
|
3147
|
-
group: e,
|
|
3148
|
-
nextGroupSize: t,
|
|
3149
|
-
prevGroupSize: n,
|
|
3150
|
-
prevLayout: o
|
|
3151
|
-
}) {
|
|
3152
|
-
if (n <= 0 || t <= 0 || n === t)
|
|
3153
|
-
return o;
|
|
3154
|
-
let i = 0, s = 0, l = false;
|
|
3155
|
-
const r = /* @__PURE__ */ new Map, a = [];
|
|
3156
|
-
for (const m of e.panels) {
|
|
3157
|
-
const d = o[m.id] ?? 0;
|
|
3158
|
-
switch (m.panelConstraints.groupResizeBehavior) {
|
|
3159
|
-
case "preserve-pixel-size": {
|
|
3160
|
-
l = true;
|
|
3161
|
-
const v = d / 100 * n, x = D(v / t * 100);
|
|
3162
|
-
r.set(m.id, x), i += x;
|
|
3163
|
-
break;
|
|
3164
|
-
}
|
|
3165
|
-
case "preserve-relative-size":
|
|
3166
|
-
default: {
|
|
3167
|
-
a.push(m.id), s += d;
|
|
3168
|
-
break;
|
|
3169
|
-
}
|
|
3170
|
-
}
|
|
3171
|
-
}
|
|
3172
|
-
if (!l || a.length === 0)
|
|
3173
|
-
return o;
|
|
3174
|
-
const u = 100 - i, c = { ...o };
|
|
3175
|
-
if (r.forEach((m, d) => {
|
|
3176
|
-
c[d] = m;
|
|
3177
|
-
}), s > 0)
|
|
3178
|
-
for (const m of a) {
|
|
3179
|
-
const d = o[m] ?? 0;
|
|
3180
|
-
c[m] = D(d / s * u);
|
|
3181
|
-
}
|
|
3182
|
-
else {
|
|
3183
|
-
const m = D(u / a.length);
|
|
3184
|
-
for (const d of a)
|
|
3185
|
-
c[d] = m;
|
|
3186
|
-
}
|
|
3187
|
-
return c;
|
|
3188
|
-
}
|
|
3189
|
-
function Vt(e, t) {
|
|
3190
|
-
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
3191
|
-
if (n.length !== o.length)
|
|
3192
|
-
return false;
|
|
3193
|
-
for (const i of n)
|
|
3194
|
-
if (!o.includes(i))
|
|
3195
|
-
return false;
|
|
3196
|
-
return true;
|
|
3197
|
-
}
|
|
3198
|
-
var q = /* @__PURE__ */ new Map;
|
|
3199
|
-
function jt(e) {
|
|
3200
|
-
let t = true;
|
|
3201
|
-
L(e.element.ownerDocument.defaultView, "Cannot register an unmounted Group");
|
|
3202
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set, i = /* @__PURE__ */ new Set, s = new n((f) => {
|
|
3203
|
-
for (const h of f) {
|
|
3204
|
-
const { borderBoxSize: g, target: y } = h;
|
|
3205
|
-
if (y === e.element) {
|
|
3206
|
-
if (t) {
|
|
3207
|
-
const z = Q({ group: e });
|
|
3208
|
-
if (z === 0)
|
|
3209
|
-
return;
|
|
3210
|
-
const S = $(e.id);
|
|
3211
|
-
if (!S)
|
|
3212
|
-
return;
|
|
3213
|
-
const p = ge(e), P = S.defaultLayoutDeferred ? je(p) : S.layout, R = Ht({
|
|
3214
|
-
group: e,
|
|
3215
|
-
nextGroupSize: z,
|
|
3216
|
-
prevGroupSize: S.groupSize,
|
|
3217
|
-
prevLayout: P
|
|
3218
|
-
}), C = B({
|
|
3219
|
-
layout: R,
|
|
3220
|
-
panelConstraints: p
|
|
3221
|
-
});
|
|
3222
|
-
if (!S.defaultLayoutDeferred && j(S.layout, C) && $t(S.derivedPanelConstraints, p) && S.groupSize === z)
|
|
3223
|
-
return;
|
|
3224
|
-
_(e, {
|
|
3225
|
-
defaultLayoutDeferred: false,
|
|
3226
|
-
derivedPanelConstraints: p,
|
|
3227
|
-
groupSize: z,
|
|
3228
|
-
layout: C,
|
|
3229
|
-
separatorToPanels: S.separatorToPanels
|
|
3230
|
-
});
|
|
3231
|
-
}
|
|
3232
|
-
} else
|
|
3233
|
-
Ft(e, y, g);
|
|
3234
|
-
}
|
|
3235
|
-
});
|
|
3236
|
-
s.observe(e.element), e.panels.forEach((f) => {
|
|
3237
|
-
L(!o.has(f.id), `Panel ids must be unique; id "${f.id}" was used more than once`), o.add(f.id), f.onResize && s.observe(f.element);
|
|
3238
|
-
});
|
|
3239
|
-
const l = Q({ group: e }), r = ge(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
3240
|
-
let u = e.mutableState.defaultLayout;
|
|
3241
|
-
u && (Vt(e.panels, u) || (u = undefined));
|
|
3242
|
-
const c = e.mutableState.layouts[a] ?? u ?? je(r), m = B({
|
|
3243
|
-
layout: c,
|
|
3244
|
-
panelConstraints: r
|
|
3245
|
-
}), d = e.element.ownerDocument;
|
|
3246
|
-
q.set(d, (q.get(d) ?? 0) + 1);
|
|
3247
|
-
const v = /* @__PURE__ */ new Map;
|
|
3248
|
-
return Ye(e).forEach((f) => {
|
|
3249
|
-
f.separator && v.set(f.separator, f.panels);
|
|
3250
|
-
}), _(e, {
|
|
3251
|
-
defaultLayoutDeferred: l === 0,
|
|
3252
|
-
derivedPanelConstraints: r,
|
|
3253
|
-
groupSize: l,
|
|
3254
|
-
layout: m,
|
|
3255
|
-
separatorToPanels: v
|
|
3256
|
-
}), e.separators.forEach((f) => {
|
|
3257
|
-
L(!i.has(f.id), `Separator ids must be unique; id "${f.id}" was used more than once`), i.add(f.id), f.element.addEventListener("keydown", Te);
|
|
3258
|
-
}), q.get(d) === 1 && (d.addEventListener("dblclick", De, true), d.addEventListener("pointerdown", Oe, true), d.addEventListener("pointerleave", Fe), d.addEventListener("pointermove", $e), d.addEventListener("pointerout", He), d.addEventListener("pointerup", Ve, true)), function() {
|
|
3259
|
-
t = false, q.set(d, Math.max(0, (q.get(d) ?? 0) - 1)), Lt(e), e.separators.forEach((h) => {
|
|
3260
|
-
h.element.removeEventListener("keydown", Te);
|
|
3261
|
-
}), q.get(d) || (d.removeEventListener("dblclick", De, true), d.removeEventListener("pointerdown", Oe, true), d.removeEventListener("pointerleave", Fe), d.removeEventListener("pointermove", $e), d.removeEventListener("pointerout", He), d.removeEventListener("pointerup", Ve, true)), s.disconnect();
|
|
3262
|
-
};
|
|
3263
|
-
}
|
|
3264
|
-
function Bt() {
|
|
3265
|
-
const [e, t] = re({}), n = ne(() => t({}), []);
|
|
3266
|
-
return [e, n];
|
|
3267
|
-
}
|
|
3268
|
-
function xe(e) {
|
|
3269
|
-
const t = pt();
|
|
3270
|
-
return `${e ?? t}`;
|
|
3271
|
-
}
|
|
3272
|
-
var K = typeof window < "u" ? Be : de;
|
|
3273
|
-
function oe(e) {
|
|
3274
|
-
const t = T(e);
|
|
3275
|
-
return K(() => {
|
|
3276
|
-
t.current = e;
|
|
3277
|
-
}, [e]), ne((...n) => t.current?.(...n), [t]);
|
|
3278
|
-
}
|
|
3279
|
-
function we(...e) {
|
|
3280
|
-
return oe((t) => {
|
|
3281
|
-
e.forEach((n) => {
|
|
3282
|
-
if (n)
|
|
3283
|
-
switch (typeof n) {
|
|
3284
|
-
case "function": {
|
|
3285
|
-
n(t);
|
|
3286
|
-
break;
|
|
3287
|
-
}
|
|
3288
|
-
case "object": {
|
|
3289
|
-
n.current = t;
|
|
3290
|
-
break;
|
|
3291
|
-
}
|
|
3292
|
-
}
|
|
3293
|
-
});
|
|
3294
|
-
});
|
|
3295
|
-
}
|
|
3296
|
-
function Pe(e) {
|
|
3297
|
-
const t = T({ ...e });
|
|
3298
|
-
return K(() => {
|
|
3299
|
-
for (const n in e)
|
|
3300
|
-
t.current[n] = e[n];
|
|
3301
|
-
}, [e]), t.current;
|
|
3302
|
-
}
|
|
3303
|
-
var at = ht(null);
|
|
3304
|
-
function Wt(e, t) {
|
|
3305
|
-
const n = T({
|
|
3306
|
-
getLayout: () => ({}),
|
|
3307
|
-
setLayout: Nt
|
|
3308
|
-
});
|
|
3309
|
-
We(t, () => n.current, []), K(() => {
|
|
3310
|
-
Object.assign(n.current, tt({ groupId: e }));
|
|
3311
|
-
});
|
|
3312
|
-
}
|
|
3313
|
-
function Ut({
|
|
3314
|
-
children: e,
|
|
3315
|
-
className: t,
|
|
3316
|
-
defaultLayout: n,
|
|
3317
|
-
disableCursor: o,
|
|
3318
|
-
disabled: i,
|
|
3319
|
-
elementRef: s,
|
|
3320
|
-
groupRef: l,
|
|
3321
|
-
id: r,
|
|
3322
|
-
onLayoutChange: a,
|
|
3323
|
-
onLayoutChanged: u,
|
|
3324
|
-
orientation: c = "horizontal",
|
|
3325
|
-
resizeTargetMinimumSize: m = {
|
|
3326
|
-
coarse: 20,
|
|
3327
|
-
fine: 10
|
|
3328
|
-
},
|
|
3329
|
-
style: d,
|
|
3330
|
-
...v
|
|
3331
|
-
}) {
|
|
3332
|
-
const x = T({
|
|
3333
|
-
onLayoutChange: {},
|
|
3334
|
-
onLayoutChanged: {}
|
|
3335
|
-
}), f = oe((b) => {
|
|
3336
|
-
j(x.current.onLayoutChange, b) || (x.current.onLayoutChange = b, a?.(b));
|
|
3337
|
-
}), h = oe((b) => {
|
|
3338
|
-
j(x.current.onLayoutChanged, b) || (x.current.onLayoutChanged = b, u?.(b));
|
|
3339
|
-
}), g = xe(r), y = T(null), [z, S] = Bt(), p = T({
|
|
3340
|
-
lastExpandedPanelSizes: {},
|
|
3341
|
-
layouts: {},
|
|
3342
|
-
panels: [],
|
|
3343
|
-
resizeTargetMinimumSize: m,
|
|
3344
|
-
separators: []
|
|
3345
|
-
}), P = we(y, s);
|
|
3346
|
-
Wt(g, l);
|
|
3347
|
-
const R = oe((b, w) => {
|
|
3348
|
-
const E = W(), M = Me(b), k = $(b);
|
|
3349
|
-
if (k) {
|
|
3350
|
-
let O = false;
|
|
3351
|
-
switch (E.state) {
|
|
3352
|
-
case "active": {
|
|
3353
|
-
O = E.hitRegions.some((H) => H.group === M);
|
|
3354
|
-
break;
|
|
3355
|
-
}
|
|
3356
|
-
}
|
|
3357
|
-
return {
|
|
3358
|
-
flexGrow: k.layout[w] ?? 1,
|
|
3359
|
-
pointerEvents: O ? "none" : undefined
|
|
3360
|
-
};
|
|
3361
|
-
}
|
|
3362
|
-
return {
|
|
3363
|
-
flexGrow: n?.[w] ?? 1
|
|
3364
|
-
};
|
|
3365
|
-
}), C = Pe({
|
|
3366
|
-
defaultLayout: n,
|
|
3367
|
-
disableCursor: o
|
|
3368
|
-
}), X2 = Ue(() => ({
|
|
3369
|
-
get disableCursor() {
|
|
3370
|
-
return !!C.disableCursor;
|
|
3371
|
-
},
|
|
3372
|
-
getPanelStyles: R,
|
|
3373
|
-
id: g,
|
|
3374
|
-
orientation: c,
|
|
3375
|
-
registerPanel: (b) => {
|
|
3376
|
-
const w = p.current;
|
|
3377
|
-
return w.panels = Se(c, [
|
|
3378
|
-
...w.panels,
|
|
3379
|
-
b
|
|
3380
|
-
]), S(), () => {
|
|
3381
|
-
w.panels = w.panels.filter((E) => E !== b), S();
|
|
3382
|
-
};
|
|
3383
|
-
},
|
|
3384
|
-
registerSeparator: (b) => {
|
|
3385
|
-
const w = p.current;
|
|
3386
|
-
return w.separators = Se(c, [
|
|
3387
|
-
...w.separators,
|
|
3388
|
-
b
|
|
3389
|
-
]), S(), () => {
|
|
3390
|
-
w.separators = w.separators.filter((E) => E !== b), S();
|
|
3391
|
-
};
|
|
3392
|
-
},
|
|
3393
|
-
togglePanelDisabled: (b, w) => {
|
|
3394
|
-
const M = p.current.panels.find((H) => H.id === b);
|
|
3395
|
-
M && (M.panelConstraints.disabled = w);
|
|
3396
|
-
const k = Me(g), O = $(g);
|
|
3397
|
-
k && O && _(k, {
|
|
3398
|
-
...O,
|
|
3399
|
-
derivedPanelConstraints: ge(k)
|
|
3400
|
-
});
|
|
3401
|
-
},
|
|
3402
|
-
toggleSeparatorDisabled: (b, w) => {
|
|
3403
|
-
const M = p.current.separators.find((k) => k.id === b);
|
|
3404
|
-
M && (M.disabled = w);
|
|
3405
|
-
}
|
|
3406
|
-
}), [R, g, S, c, C]), F = T(null);
|
|
3407
|
-
return K(() => {
|
|
3408
|
-
const b = y.current;
|
|
3409
|
-
if (b === null)
|
|
3410
|
-
return;
|
|
3411
|
-
const w = p.current;
|
|
3412
|
-
let E;
|
|
3413
|
-
if (C.defaultLayout !== undefined && Object.keys(C.defaultLayout).length === w.panels.length) {
|
|
3414
|
-
E = {};
|
|
3415
|
-
for (const ee of w.panels) {
|
|
3416
|
-
const ae = C.defaultLayout[ee.id];
|
|
3417
|
-
ae !== undefined && (E[ee.id] = ae);
|
|
3418
|
-
}
|
|
3419
|
-
}
|
|
3420
|
-
const M = {
|
|
3421
|
-
disabled: !!i,
|
|
3422
|
-
element: b,
|
|
3423
|
-
id: g,
|
|
3424
|
-
mutableState: {
|
|
3425
|
-
defaultLayout: E,
|
|
3426
|
-
disableCursor: !!C.disableCursor,
|
|
3427
|
-
expandedPanelSizes: p.current.lastExpandedPanelSizes,
|
|
3428
|
-
layouts: p.current.layouts
|
|
3429
|
-
},
|
|
3430
|
-
orientation: c,
|
|
3431
|
-
panels: w.panels,
|
|
3432
|
-
resizeTargetMinimumSize: w.resizeTargetMinimumSize,
|
|
3433
|
-
separators: w.separators
|
|
3434
|
-
};
|
|
3435
|
-
F.current = M;
|
|
3436
|
-
const k = jt(M), { defaultLayoutDeferred: O, derivedPanelConstraints: H, layout: Ce } = $(M.id, true);
|
|
3437
|
-
!O && H.length > 0 && (f(Ce), h(Ce));
|
|
3438
|
-
const lt = ye(g, (ee) => {
|
|
3439
|
-
const { defaultLayoutDeferred: ae, derivedPanelConstraints: Re, layout: le } = ee.next;
|
|
3440
|
-
if (ae || Re.length === 0)
|
|
3441
|
-
return;
|
|
3442
|
-
const ut = M.panels.map(({ id: N }) => N).join(",");
|
|
3443
|
-
M.mutableState.layouts[ut] = le, Re.forEach((N) => {
|
|
3444
|
-
if (N.collapsible) {
|
|
3445
|
-
const { layout: pe } = ee.prev ?? {};
|
|
3446
|
-
if (pe) {
|
|
3447
|
-
const ft = I(N.collapsedSize, le[N.panelId]), dt = I(N.collapsedSize, pe[N.panelId]);
|
|
3448
|
-
ft && !dt && (M.mutableState.expandedPanelSizes[N.panelId] = pe[N.panelId]);
|
|
3449
|
-
}
|
|
3450
|
-
}
|
|
3451
|
-
});
|
|
3452
|
-
const ct = W().state !== "active";
|
|
3453
|
-
f(le), ct && h(le);
|
|
3454
|
-
});
|
|
3455
|
-
return () => {
|
|
3456
|
-
F.current = null, k(), lt();
|
|
3457
|
-
};
|
|
3458
|
-
}, [
|
|
3459
|
-
i,
|
|
3460
|
-
g,
|
|
3461
|
-
h,
|
|
3462
|
-
f,
|
|
3463
|
-
c,
|
|
3464
|
-
z,
|
|
3465
|
-
C
|
|
3466
|
-
]), de(() => {
|
|
3467
|
-
const b = F.current;
|
|
3468
|
-
b && (b.mutableState.defaultLayout = n, b.mutableState.disableCursor = !!o);
|
|
3469
|
-
}), /* @__PURE__ */ ie(at.Provider, { value: X2, children: /* @__PURE__ */ ie("div", {
|
|
3470
|
-
...v,
|
|
3471
|
-
className: t,
|
|
3472
|
-
"data-group": true,
|
|
3473
|
-
"data-testid": g,
|
|
3474
|
-
id: g,
|
|
3475
|
-
ref: P,
|
|
3476
|
-
style: {
|
|
3477
|
-
height: "100%",
|
|
3478
|
-
width: "100%",
|
|
3479
|
-
overflow: "hidden",
|
|
3480
|
-
...d,
|
|
3481
|
-
display: "flex",
|
|
3482
|
-
flexDirection: c === "horizontal" ? "row" : "column",
|
|
3483
|
-
flexWrap: "nowrap",
|
|
3484
|
-
touchAction: c === "horizontal" ? "pan-y" : "pan-x"
|
|
3485
|
-
},
|
|
3486
|
-
children: e
|
|
3487
|
-
}) });
|
|
3488
|
-
}
|
|
3489
|
-
Ut.displayName = "Group";
|
|
3490
|
-
function Le() {
|
|
3491
|
-
const e = mt(at);
|
|
3492
|
-
return L(e, "Group Context not found; did you render a Panel or Separator outside of a Group?"), e;
|
|
3493
|
-
}
|
|
3494
|
-
function Xt(e, t) {
|
|
3495
|
-
const { id: n } = Le(), o = T({
|
|
3496
|
-
collapse: he,
|
|
3497
|
-
expand: he,
|
|
3498
|
-
getSize: () => ({
|
|
3499
|
-
asPercentage: 0,
|
|
3500
|
-
inPixels: 0
|
|
3501
|
-
}),
|
|
3502
|
-
isCollapsed: () => false,
|
|
3503
|
-
resize: he
|
|
3504
|
-
});
|
|
3505
|
-
We(t, () => o.current, []), K(() => {
|
|
3506
|
-
Object.assign(o.current, et({ groupId: n, panelId: e }));
|
|
3507
|
-
});
|
|
3508
|
-
}
|
|
3509
|
-
function qt({
|
|
3510
|
-
children: e,
|
|
3511
|
-
className: t,
|
|
3512
|
-
collapsedSize: n = "0%",
|
|
3513
|
-
collapsible: o = false,
|
|
3514
|
-
defaultSize: i,
|
|
3515
|
-
disabled: s,
|
|
3516
|
-
elementRef: l,
|
|
3517
|
-
groupResizeBehavior: r = "preserve-relative-size",
|
|
3518
|
-
id: a,
|
|
3519
|
-
maxSize: u = "100%",
|
|
3520
|
-
minSize: c = "0%",
|
|
3521
|
-
onResize: m,
|
|
3522
|
-
panelRef: d,
|
|
3523
|
-
style: v,
|
|
3524
|
-
...x
|
|
3525
|
-
}) {
|
|
3526
|
-
const f = !!a, h = xe(a), g = Pe({
|
|
3527
|
-
disabled: s
|
|
3528
|
-
}), y = T(null), z = we(y, l), {
|
|
3529
|
-
getPanelStyles: S,
|
|
3530
|
-
id: p,
|
|
3531
|
-
orientation: P,
|
|
3532
|
-
registerPanel: R,
|
|
3533
|
-
togglePanelDisabled: C
|
|
3534
|
-
} = Le(), X2 = m !== null, F = oe((w, E, M) => {
|
|
3535
|
-
m?.(w, a, M);
|
|
3536
|
-
});
|
|
3537
|
-
K(() => {
|
|
3538
|
-
const w = y.current;
|
|
3539
|
-
if (w !== null) {
|
|
3540
|
-
const E = {
|
|
3541
|
-
element: w,
|
|
3542
|
-
id: h,
|
|
3543
|
-
idIsStable: f,
|
|
3544
|
-
mutableValues: {
|
|
3545
|
-
expandToSize: undefined,
|
|
3546
|
-
prevSize: undefined
|
|
3547
|
-
},
|
|
3548
|
-
onResize: X2 ? F : undefined,
|
|
3549
|
-
panelConstraints: {
|
|
3550
|
-
groupResizeBehavior: r,
|
|
3551
|
-
collapsedSize: n,
|
|
3552
|
-
collapsible: o,
|
|
3553
|
-
defaultSize: i,
|
|
3554
|
-
disabled: g.disabled,
|
|
3555
|
-
maxSize: u,
|
|
3556
|
-
minSize: c
|
|
3557
|
-
}
|
|
3558
|
-
};
|
|
3559
|
-
return R(E);
|
|
3560
|
-
}
|
|
3561
|
-
}, [
|
|
3562
|
-
r,
|
|
3563
|
-
n,
|
|
3564
|
-
o,
|
|
3565
|
-
i,
|
|
3566
|
-
X2,
|
|
3567
|
-
h,
|
|
3568
|
-
f,
|
|
3569
|
-
u,
|
|
3570
|
-
c,
|
|
3571
|
-
F,
|
|
3572
|
-
R,
|
|
3573
|
-
g
|
|
3574
|
-
]), de(() => {
|
|
3575
|
-
C(h, !!s);
|
|
3576
|
-
}, [s, h, C]), Xt(h, d);
|
|
3577
|
-
const b = Ke((w) => ye(p, w), () => JSON.stringify(S(p, h)), () => JSON.stringify(S(p, h)));
|
|
3578
|
-
return /* @__PURE__ */ ie("div", {
|
|
3579
|
-
...x,
|
|
3580
|
-
"aria-disabled": s || undefined,
|
|
3581
|
-
"data-panel": true,
|
|
3582
|
-
"data-testid": h,
|
|
3583
|
-
id: h,
|
|
3584
|
-
ref: z,
|
|
3585
|
-
style: {
|
|
3586
|
-
...Yt,
|
|
3587
|
-
display: "flex",
|
|
3588
|
-
flexBasis: 0,
|
|
3589
|
-
flexShrink: 1,
|
|
3590
|
-
overflow: "visible",
|
|
3591
|
-
...JSON.parse(b)
|
|
3592
|
-
},
|
|
3593
|
-
children: /* @__PURE__ */ ie("div", {
|
|
3594
|
-
className: t,
|
|
3595
|
-
style: {
|
|
3596
|
-
maxHeight: "100%",
|
|
3597
|
-
maxWidth: "100%",
|
|
3598
|
-
flexGrow: 1,
|
|
3599
|
-
overflow: "auto",
|
|
3600
|
-
...v,
|
|
3601
|
-
touchAction: P === "horizontal" ? "pan-y" : "pan-x"
|
|
3602
|
-
},
|
|
3603
|
-
children: e
|
|
3604
|
-
})
|
|
3605
|
-
});
|
|
3606
|
-
}
|
|
3607
|
-
qt.displayName = "Panel";
|
|
3608
|
-
var Yt = {
|
|
3609
|
-
minHeight: 0,
|
|
3610
|
-
maxHeight: "100%",
|
|
3611
|
-
height: "auto",
|
|
3612
|
-
minWidth: 0,
|
|
3613
|
-
maxWidth: "100%",
|
|
3614
|
-
width: "auto",
|
|
3615
|
-
border: "none",
|
|
3616
|
-
borderWidth: 0,
|
|
3617
|
-
padding: 0,
|
|
3618
|
-
margin: 0
|
|
3619
|
-
};
|
|
3620
|
-
function Jt({
|
|
3621
|
-
layout: e,
|
|
3622
|
-
panelConstraints: t,
|
|
3623
|
-
panelId: n,
|
|
3624
|
-
panelIndex: o
|
|
3625
|
-
}) {
|
|
3626
|
-
let i, s;
|
|
3627
|
-
const l = e[n], r = t.find((a) => a.panelId === n);
|
|
3628
|
-
if (r) {
|
|
3629
|
-
const a = r.maxSize, u = r.collapsible ? r.collapsedSize : r.minSize, c = [o, o + 1];
|
|
3630
|
-
s = B({
|
|
3631
|
-
layout: se({
|
|
3632
|
-
delta: u - l,
|
|
3633
|
-
initialLayout: e,
|
|
3634
|
-
panelConstraints: t,
|
|
3635
|
-
pivotIndices: c,
|
|
3636
|
-
prevLayout: e
|
|
3637
|
-
}),
|
|
3638
|
-
panelConstraints: t
|
|
3639
|
-
})[n], i = B({
|
|
3640
|
-
layout: se({
|
|
3641
|
-
delta: a - l,
|
|
3642
|
-
initialLayout: e,
|
|
3643
|
-
panelConstraints: t,
|
|
3644
|
-
pivotIndices: c,
|
|
3645
|
-
prevLayout: e
|
|
3646
|
-
}),
|
|
3647
|
-
panelConstraints: t
|
|
3648
|
-
})[n];
|
|
3649
|
-
}
|
|
3650
|
-
return {
|
|
3651
|
-
valueControls: n,
|
|
3652
|
-
valueMax: i,
|
|
3653
|
-
valueMin: s,
|
|
3654
|
-
valueNow: l
|
|
3655
|
-
};
|
|
3656
|
-
}
|
|
3657
|
-
function Zt({
|
|
3658
|
-
children: e,
|
|
3659
|
-
className: t,
|
|
3660
|
-
disabled: n,
|
|
3661
|
-
elementRef: o,
|
|
3662
|
-
id: i,
|
|
3663
|
-
style: s,
|
|
3664
|
-
...l
|
|
3665
|
-
}) {
|
|
3666
|
-
const r = xe(i), a = Pe({
|
|
3667
|
-
disabled: n
|
|
3668
|
-
}), [u, c] = re({}), [m, d] = re("inactive"), v = T(null), x = we(v, o), {
|
|
3669
|
-
disableCursor: f,
|
|
3670
|
-
id: h,
|
|
3671
|
-
orientation: g,
|
|
3672
|
-
registerSeparator: y,
|
|
3673
|
-
toggleSeparatorDisabled: z
|
|
3674
|
-
} = Le(), S = g === "horizontal" ? "vertical" : "horizontal";
|
|
3675
|
-
K(() => {
|
|
3676
|
-
const P = v.current;
|
|
3677
|
-
if (P !== null) {
|
|
3678
|
-
const R = {
|
|
3679
|
-
disabled: a.disabled,
|
|
3680
|
-
element: P,
|
|
3681
|
-
id: r
|
|
3682
|
-
}, C = y(R), X2 = Gt((b) => {
|
|
3683
|
-
d(b.next.state !== "inactive" && b.next.hitRegions.some((w) => w.separator === R) ? b.next.state : "inactive");
|
|
3684
|
-
}), F = ye(h, (b) => {
|
|
3685
|
-
const { derivedPanelConstraints: w, layout: E, separatorToPanels: M } = b.next, k = M.get(R);
|
|
3686
|
-
if (k) {
|
|
3687
|
-
const O = k[0], H = k.indexOf(O);
|
|
3688
|
-
c(Jt({
|
|
3689
|
-
layout: E,
|
|
3690
|
-
panelConstraints: w,
|
|
3691
|
-
panelId: O.id,
|
|
3692
|
-
panelIndex: H
|
|
3693
|
-
}));
|
|
3694
|
-
}
|
|
3695
|
-
});
|
|
3696
|
-
return () => {
|
|
3697
|
-
X2(), F(), C();
|
|
3698
|
-
};
|
|
3699
|
-
}
|
|
3700
|
-
}, [h, r, y, a]), de(() => {
|
|
3701
|
-
z(r, !!n);
|
|
3702
|
-
}, [n, r, z]);
|
|
3703
|
-
let p;
|
|
3704
|
-
return n && !f && (p = "not-allowed"), /* @__PURE__ */ ie("div", {
|
|
3705
|
-
...l,
|
|
3706
|
-
"aria-controls": u.valueControls,
|
|
3707
|
-
"aria-disabled": n || undefined,
|
|
3708
|
-
"aria-orientation": S,
|
|
3709
|
-
"aria-valuemax": u.valueMax,
|
|
3710
|
-
"aria-valuemin": u.valueMin,
|
|
3711
|
-
"aria-valuenow": u.valueNow,
|
|
3712
|
-
children: e,
|
|
3713
|
-
className: t,
|
|
3714
|
-
"data-separator": n ? "disabled" : m,
|
|
3715
|
-
"data-testid": r,
|
|
3716
|
-
id: r,
|
|
3717
|
-
ref: x,
|
|
3718
|
-
role: "separator",
|
|
3719
|
-
style: {
|
|
3720
|
-
flexBasis: "auto",
|
|
3721
|
-
cursor: p,
|
|
3722
|
-
...s,
|
|
3723
|
-
flexGrow: 0,
|
|
3724
|
-
flexShrink: 0,
|
|
3725
|
-
touchAction: "none"
|
|
3726
|
-
},
|
|
3727
|
-
tabIndex: n ? undefined : 0
|
|
3728
|
-
});
|
|
3729
|
-
}
|
|
3730
|
-
Zt.displayName = "Separator";
|
|
3731
|
-
|
|
3732
|
-
// node_modules/@principal-ade/panels/dist/index.esm.js
|
|
3733
|
-
import { unstable_batchedUpdates as y, createPortal as w } from "react-dom";
|
|
3734
|
-
import { useTheme as x } from "@principal-ade/industry-theme";
|
|
3735
|
-
function C(e2) {
|
|
3736
|
-
return { "--panel-background": e2.colors.background, "--panel-border": e2.colors.border, "--panel-handle": e2.colors.backgroundSecondary, "--panel-handle-hover": e2.colors.backgroundHover, "--panel-handle-active": e2.colors.primary, "--panel-button-bg": e2.colors.surface, "--panel-button-hover": e2.colors.backgroundHover, "--panel-button-border": e2.colors.border, "--panel-button-icon": e2.colors.textSecondary, "--panel-accent-bg": e2.colors.primary + "15" };
|
|
3737
|
-
}
|
|
3738
|
-
function N(e2) {
|
|
3739
|
-
return { "--tab-list-bg": e2.colors.backgroundSecondary, "--tab-border": e2.colors.border, "--tab-bg": e2.colors.surface, "--tab-bg-hover": e2.colors.backgroundHover, "--tab-bg-active": e2.colors.primary, "--tab-text": e2.colors.textSecondary, "--tab-text-hover": e2.colors.text, "--tab-text-active": e2.colors.background, "--tab-icon-color": e2.colors.textTertiary, "--tab-icon-active": e2.colors.background, "--tab-border-hover": e2.colors.textSecondary, "--tab-border-active": e2.colors.primary, "--tab-focus": e2.colors.primary, "--tab-content-bg": e2.colors.background, "--tab-empty-text": e2.colors.textMuted, "--tab-font-family": e2.fonts.body, "--tab-font-size": "11px", "--tab-font-weight": String(e2.fontWeights.medium), "--mobile-tab-text-active": e2.colors.primary, "--mobile-tab-icon-active": e2.colors.primary };
|
|
3740
|
-
}
|
|
3741
|
-
var D2 = ({ primaryContent: t2, secondaryContent: n2, collapsedHeader: r2, collapsed: o2 = true, onCollapsedChange: l2, ratio: i2 = 0.3, onRatioChange: a2, maxRatio: s2 = 0.8, collapsedHeight: c2 = 28, hideHeader: d2 = false, theme: u2, className: p2 = "", style: h2, animationDuration: g2 = 200, onCollapseStart: v2, onCollapseComplete: m, onExpandStart: f, onExpandComplete: b }) => {
|
|
3742
|
-
const y2 = C(u2);
|
|
3743
|
-
return n2 ? /* @__PURE__ */ e(R, { primaryContent: t2, secondaryContent: n2, collapsedHeader: r2 ?? { title: "Content" }, collapsed: o2, onCollapsedChange: l2 ?? (() => {}), ratio: i2, onRatioChange: a2 ?? (() => {}), maxRatio: s2, collapsedHeight: c2, hideHeader: d2, theme: u2, className: p2, style: h2, animationDuration: g2, onCollapseStart: v2, onCollapseComplete: m, onExpandStart: f, onExpandComplete: b }) : /* @__PURE__ */ e("div", { className: `collapsible-split-pane ${p2}`, style: { ...y2, ...h2 }, children: /* @__PURE__ */ e("div", { className: "csp-primary-content-full", children: t2 }) });
|
|
3744
|
-
};
|
|
3745
|
-
var R = ({ primaryContent: n2, secondaryContent: r2, collapsedHeader: s2, collapsed: c2, onCollapsedChange: d2, ratio: u2, onRatioChange: p2, maxRatio: h2 = 0.8, collapsedHeight: g2 = 28, hideHeader: v2 = false, theme: y2, className: w2 = "", style: x2, animationDuration: N2 = 200, onCollapseStart: S, onCollapseComplete: E, onExpandStart: D3, onExpandComplete: R2 }) => {
|
|
3746
|
-
const [z, k] = o(false), [L2, M] = o(false), P = l(null), A2 = l(undefined), T2 = l(undefined), $2 = l(u2), B2 = l(false), O = l(c2), F = (e2) => 100 * e2;
|
|
3747
|
-
a(() => {
|
|
3748
|
-
O.current = c2;
|
|
3749
|
-
}, [c2]), a(() => {
|
|
3750
|
-
!c2 && u2 > 0 && ($2.current = u2);
|
|
3751
|
-
}, [c2, u2]);
|
|
3752
|
-
const I2 = i((e2, t2, n3) => {
|
|
3753
|
-
if (!P.current)
|
|
3754
|
-
return;
|
|
3755
|
-
A2.current && cancelAnimationFrame(A2.current), T2.current = performance.now();
|
|
3756
|
-
const r3 = (o2) => {
|
|
3757
|
-
if (!T2.current || !P.current)
|
|
3758
|
-
return;
|
|
3759
|
-
const l2 = o2 - T2.current, i2 = Math.min(l2 / N2, 1), a2 = i2 < 0.5 ? 4 * i2 * i2 * i2 : 1 - Math.pow(-2 * i2 + 2, 3) / 2, s3 = e2 + (t2 - e2) * a2;
|
|
3760
|
-
P.current.resize(`${s3}%`), i2 < 1 ? A2.current = requestAnimationFrame(r3) : (P.current.resize(`${t2}%`), n3 && n3(), B2.current = false, k(false));
|
|
3761
|
-
};
|
|
3762
|
-
A2.current = requestAnimationFrame(r3);
|
|
3763
|
-
}, [N2]), H = i(() => {
|
|
3764
|
-
if (z || L2 || !P.current)
|
|
3765
|
-
return;
|
|
3766
|
-
u2 > 0 && ($2.current = u2), B2.current = true, k(true), S?.();
|
|
3767
|
-
const e2 = F(u2);
|
|
3768
|
-
I2(e2, 0, () => {
|
|
3769
|
-
O.current = true, d2(true), E?.();
|
|
3770
|
-
});
|
|
3771
|
-
}, [z, L2, u2, I2, d2, S, E]), W2 = i(() => {
|
|
3772
|
-
if (z || L2 || !P.current)
|
|
3773
|
-
return;
|
|
3774
|
-
B2.current = true, k(true), D3?.();
|
|
3775
|
-
const e2 = $2.current || u2 || 0.3, t2 = F(e2);
|
|
3776
|
-
I2(0, t2, () => {
|
|
3777
|
-
O.current = false, d2(false), p2(e2), R2?.();
|
|
3778
|
-
});
|
|
3779
|
-
}, [z, L2, u2, I2, d2, p2, D3, R2]), j2 = i(() => {
|
|
3780
|
-
c2 ? W2() : H();
|
|
3781
|
-
}, [c2, H, W2]), K2 = i((e2) => {
|
|
3782
|
-
if (B2.current)
|
|
3783
|
-
return;
|
|
3784
|
-
const t2 = e2.asPercentage / 100;
|
|
3785
|
-
t2 <= 0.01 && !O.current ? ($2.current = 0.4, O.current = true, d2(true)) : t2 > 0.01 && O.current && (O.current = false, d2(false)), O.current || p2(t2);
|
|
3786
|
-
}, [p2, d2]), q2 = i(() => {
|
|
3787
|
-
z || M(true);
|
|
3788
|
-
}, [z]), U2 = i(() => {
|
|
3789
|
-
M(false);
|
|
3790
|
-
}, []);
|
|
3791
|
-
a(() => {
|
|
3792
|
-
if (c2 && !z && P.current) {
|
|
3793
|
-
P.current.getSize().asPercentage > 0 && H();
|
|
3794
|
-
} else if (!c2 && !z && P.current) {
|
|
3795
|
-
P.current.getSize().asPercentage === 0 && W2();
|
|
3796
|
-
}
|
|
3797
|
-
}, [c2]), a(() => () => {
|
|
3798
|
-
A2.current && cancelAnimationFrame(A2.current);
|
|
3799
|
-
}, []);
|
|
3800
|
-
const X2 = C(y2), Y2 = ["csp-secondary-panel", z && !L2 ? "csp-animating" : "", c2 ? "csp-collapsed" : ""].filter(Boolean).join(" ");
|
|
3801
|
-
return t("div", { className: `collapsible-split-pane ${w2}`, style: { ...X2, ...x2 }, children: [
|
|
3802
|
-
!v2 && /* @__PURE__ */ t("div", { className: "csp-header " + (c2 ? "csp-header-collapsed" : ""), style: { height: g2, backgroundColor: y2.colors.backgroundSecondary, borderBottom: `1px solid ${y2.colors.border}` }, onClick: c2 ? j2 : undefined, role: c2 ? "button" : undefined, tabIndex: c2 ? 0 : undefined, onKeyDown: c2 ? (e2) => {
|
|
3803
|
-
e2.key !== "Enter" && e2.key !== " " || (e2.preventDefault(), j2());
|
|
3804
|
-
} : undefined, "aria-expanded": !c2, "aria-label": c2 ? `Expand ${s2.title}` : s2.title, children: [
|
|
3805
|
-
s2.icon && /* @__PURE__ */ e("span", { className: "csp-header-icon", style: { color: y2.colors.textSecondary }, children: s2.icon }),
|
|
3806
|
-
/* @__PURE__ */ e("span", { className: "csp-header-title", style: { color: y2.colors.text, fontFamily: y2.fonts.body, fontSize: y2.fontSizes[1], fontWeight: y2.fontWeights.medium }, children: s2.title }),
|
|
3807
|
-
/* @__PURE__ */ e("button", { className: "csp-header-toggle", style: { color: y2.colors.textSecondary }, onClick: (e2) => {
|
|
3808
|
-
e2.stopPropagation(), j2();
|
|
3809
|
-
}, "aria-label": c2 ? `Expand ${s2.title}` : `Collapse ${s2.title}`, children: /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: /* @__PURE__ */ e("path", { d: c2 ? "M3 5L6 8L9 5" : "M3 7L6 4L9 7" }) }) })
|
|
3810
|
-
] }),
|
|
3811
|
-
/* @__PURE__ */ e("div", { className: "csp-content-area", children: /* @__PURE__ */ t(Ut, { orientation: "vertical", onLayoutChange: q2, onLayoutChanged: U2, children: [
|
|
3812
|
-
/* @__PURE__ */ e(qt, { panelRef: P, defaultSize: c2 ? "0%" : `${F(u2)}%`, minSize: "0%", maxSize: `${F(h2)}%`, onResize: K2, className: Y2, children: /* @__PURE__ */ e("div", { className: "csp-secondary-body", children: r2 }) }),
|
|
3813
|
-
/* @__PURE__ */ e(Zt, { className: "csp-resize-handle", children: /* @__PURE__ */ e("div", { className: "csp-resize-handle-bar" }) }),
|
|
3814
|
-
/* @__PURE__ */ e(qt, { className: "csp-primary-panel", minSize: "20%", children: /* @__PURE__ */ e("div", { className: "csp-panel-content", children: n2 }) })
|
|
3815
|
-
] }) })
|
|
3816
|
-
] });
|
|
3817
|
-
};
|
|
3818
|
-
var z = ({ panelIds: r2, panels: l2, config: i2 = {}, className: s2 = "", theme: c2 }) => {
|
|
3819
|
-
const { defaultActiveTab: d2 = 0, tabPosition: u2 = "top", centered: p2 = true, hideTabList: h2 = false, activeTabIndex: g2, onTabChange: v2 } = i2, [m, f] = o(d2), b = g2 !== undefined, y2 = b ? g2 : m;
|
|
3820
|
-
a(() => {
|
|
3821
|
-
b || f(d2);
|
|
3822
|
-
}, [d2, b]);
|
|
3823
|
-
const w2 = N(c2), x2 = r2.map((e2) => l2.find((t2) => t2.id === e2)).filter((e2) => e2 !== undefined), C2 = Math.min(y2, x2.length - 1), S = x2[C2];
|
|
3824
|
-
if (x2.length === 0)
|
|
3825
|
-
return e("div", { className: "tab-group-empty", children: "No panels available" });
|
|
3826
|
-
const E = /* @__PURE__ */ e("div", { className: "tab-list " + (u2 === "top" || u2 === "bottom" || p2 ? "centered" : ""), role: "tablist", children: x2.map((r3, o2) => /* @__PURE__ */ e("button", { role: "tab", "aria-selected": o2 === C2, "aria-controls": `tabpanel-${r3.id}`, id: `tab-${r3.id}`, className: "tab-button " + (o2 === C2 ? "active" : ""), onClick: () => ((e2) => {
|
|
3827
|
-
b || f(e2), v2?.(e2);
|
|
3828
|
-
})(o2), title: r3.icon ? r3.label : undefined, children: r3.icon ? /* @__PURE__ */ t(n, { children: [
|
|
3829
|
-
/* @__PURE__ */ e("span", { className: "tab-icon", children: r3.icon }),
|
|
3830
|
-
/* @__PURE__ */ e("span", { className: "tab-label", children: r3.label })
|
|
3831
|
-
] }) : r3.label }, r3.id)) }), D3 = S ? /* @__PURE__ */ e("div", { className: "tab-content", role: "tabpanel", id: `tabpanel-${S.id}`, "aria-labelledby": `tab-${S.id}`, children: S.content }) : null;
|
|
3832
|
-
return t("div", { className: `tab-group tab-position-${u2} ${s2}`, style: w2, children: [!h2 && (u2 === "top" || u2 === "left") && E, D3, !h2 && (u2 === "bottom" || u2 === "right") && E] });
|
|
3833
|
-
};
|
|
3834
|
-
var k = { x: 0, y: 0, width: 0, height: 0 };
|
|
3835
|
-
var L2 = s(null);
|
|
3836
|
-
var M = ({ slot: t2, children: n2 }) => {
|
|
3837
|
-
const r2 = l(null), [s2, c2] = o(k), d2 = i(() => {
|
|
3838
|
-
if (r2.current) {
|
|
3839
|
-
const e2 = r2.current.getBoundingClientRect();
|
|
3840
|
-
c2({ x: e2.left, y: e2.top, width: e2.width, height: e2.height });
|
|
3841
|
-
}
|
|
3842
|
-
}, []);
|
|
3843
|
-
a(() => {
|
|
3844
|
-
const e2 = r2.current;
|
|
3845
|
-
if (!e2)
|
|
3846
|
-
return;
|
|
3847
|
-
d2();
|
|
3848
|
-
const t3 = new ResizeObserver(() => {
|
|
3849
|
-
d2();
|
|
3850
|
-
});
|
|
3851
|
-
return t3.observe(e2), window.addEventListener("resize", d2), window.addEventListener("scroll", d2, true), () => {
|
|
3852
|
-
t3.disconnect(), window.removeEventListener("resize", d2), window.removeEventListener("scroll", d2, true);
|
|
3853
|
-
};
|
|
3854
|
-
}, [d2]);
|
|
3855
|
-
const u2 = { slot: t2, bounds: s2 };
|
|
3856
|
-
return e(L2.Provider, { value: u2, children: /* @__PURE__ */ e("div", { ref: r2, className: "panel-bounds-container", style: { width: "100%", height: "100%", minWidth: 0 }, children: n2 }) });
|
|
3857
|
-
};
|
|
3858
|
-
var T2 = d(({ panels: n2, layout: r2, slotDataAttributes: a2 = {}, collapsiblePanels: s2 = { left: true, middle: false, right: true }, defaultSizes: c2 = { left: 20, middle: 60, right: 20 }, className: d2 = "", collapsed: p2 = { left: false, middle: false, right: false }, style: h2, showCollapseButtons: g2 = false, animationDuration: v2 = 300, animationEasing: y2 = "cubic-bezier(0.4, 0, 0.2, 1)", theme: w2, onLeftCollapseStart: x2, onLeftCollapseComplete: N2, onLeftExpandStart: S, onLeftExpandComplete: E, onMiddleCollapseStart: D3, onMiddleCollapseComplete: R2, onMiddleExpandStart: k2, onMiddleExpandComplete: L3, onRightCollapseStart: P, onRightCollapseComplete: A2, onRightExpandStart: T3, onRightExpandComplete: $2, onPanelResize: B2 }, O) => {
|
|
3859
|
-
const F = r2.left !== null && r2.left !== undefined, I2 = r2.middle !== null && r2.middle !== undefined, H = r2.right !== null && r2.right !== undefined, W2 = [F, I2, H].filter(Boolean).length, j2 = { left: F ? c2?.left ?? (W2 === 2 ? 50 : W2 === 3 ? 20 : 100) : 0, middle: I2 ? c2?.middle ?? (W2 === 2 ? 50 : W2 === 3 ? 60 : 100) : 0, right: H ? c2?.right ?? (W2 === 2 ? 50 : W2 === 3 ? 20 : 100) : 0 }, [K2, q2] = o(p2.left || !F), [U2, X2] = o(p2.middle || !I2), [Y2, V2] = o(p2.right || !H), [J2, G2] = o(false), _2 = i((e2) => {
|
|
3860
|
-
if (!e2)
|
|
3861
|
-
return null;
|
|
3862
|
-
const t2 = n2.find((t3) => t3.id === e2);
|
|
3863
|
-
return t2?.content || null;
|
|
3864
|
-
}, [n2]), Q2 = i((t2) => {
|
|
3865
|
-
if (t2 === null)
|
|
3866
|
-
return null;
|
|
3867
|
-
if (typeof t2 == "object" && "type" in t2) {
|
|
3868
|
-
const r3 = t2;
|
|
3869
|
-
return r3.type === "tabs" ? /* @__PURE__ */ e(z, { panelIds: r3.panels, panels: n2, config: r3.config, theme: w2 }) : null;
|
|
3870
|
-
}
|
|
3871
|
-
return _2(t2);
|
|
3872
|
-
}, [n2, _2, w2]), Z2 = Q2(r2.left ?? null), ee = Q2(r2.middle ?? null), te2 = Q2(r2.right ?? null), [ne2, re2] = o(p2.left || !F ? 0 : j2.left), [oe2, le] = o(p2.middle || !I2 ? 0 : j2.middle), [ie2, ae] = o(p2.right || !H ? 0 : j2.right), [se2, ce2] = o(j2.left), [de2, ue2] = o(j2.middle), [pe, he2] = o(j2.right), ge2 = l(null), ve2 = l(null), me = l(null), fe2 = l(null);
|
|
3873
|
-
u(O, () => ({ setLayout: (e2) => {
|
|
3874
|
-
ge2.current && ge2.current.setLayout(e2);
|
|
3875
|
-
}, getLayout: () => ({ left: ne2, middle: oe2, right: ie2 }) }), [ne2, oe2, ie2]);
|
|
3876
|
-
const be2 = i(() => {
|
|
3877
|
-
!J2 && s2.left && (x2?.(), ve2.current?.collapse(), q2(true), N2?.());
|
|
3878
|
-
}, [J2, s2.left, x2, N2]), ye2 = i(() => {
|
|
3879
|
-
!J2 && s2.left && (S?.(), ve2.current?.expand(), q2(false), E?.());
|
|
3880
|
-
}, [J2, s2.left, S, E]), we2 = i(() => {
|
|
3881
|
-
!J2 && s2.right && (P?.(), fe2.current?.collapse(), V2(true), A2?.());
|
|
3882
|
-
}, [J2, s2.right, P, A2]), xe2 = i(() => {
|
|
3883
|
-
!J2 && s2.right && (T3?.(), fe2.current?.expand(), V2(false), $2?.());
|
|
3884
|
-
}, [J2, s2.right, T3, $2]), Ce = i(() => {
|
|
3885
|
-
K2 ? ye2() : be2();
|
|
3886
|
-
}, [K2, be2, ye2]), Ne2 = i(() => {
|
|
3887
|
-
Y2 ? xe2() : we2();
|
|
3888
|
-
}, [Y2, we2, xe2]), Se2 = i((e2) => {
|
|
3889
|
-
const t2 = e2.asPercentage;
|
|
3890
|
-
re2(t2), t2 > 0 ? (ce2(t2), q2(false)) : q2(true);
|
|
3891
|
-
}, []), Ee2 = i((e2) => {
|
|
3892
|
-
const t2 = e2.asPercentage;
|
|
3893
|
-
le(t2), t2 > 0 ? (ue2(t2), X2(false)) : X2(true);
|
|
3894
|
-
}, []), De2 = i((e2) => {
|
|
3895
|
-
const t2 = e2.asPercentage;
|
|
3896
|
-
ae(t2), t2 > 0 ? (he2(t2), V2(false)) : V2(true);
|
|
3897
|
-
}, []), Re = i(() => {
|
|
3898
|
-
if (B2) {
|
|
3899
|
-
B2({ left: K2 ? se2 : ne2, middle: U2 ? de2 : oe2, right: Y2 ? pe : ie2 });
|
|
3900
|
-
}
|
|
3901
|
-
}, [ne2, oe2, ie2, K2, U2, Y2, se2, de2, pe, B2]), ze2 = i(() => {
|
|
3902
|
-
G2(true);
|
|
3903
|
-
}, []), ke2 = i(() => {
|
|
3904
|
-
G2(false), Re();
|
|
3905
|
-
}, [Re]), Le2 = (e2) => {
|
|
3906
|
-
let t2 = "three-panel-item";
|
|
3907
|
-
return e2 === "left" ? !s2.left && F || (t2 += " collapsible-panel", K2 && (t2 += " collapsed")) : e2 === "middle" ? (t2 += " middle-panel", !s2.middle && I2 || (t2 += " collapsible-panel", U2 && (t2 += " collapsed"))) : e2 === "right" && (!s2.right && H || (t2 += " collapsible-panel", Y2 && (t2 += " collapsed"))), t2;
|
|
3908
|
-
}, Me2 = C(w2);
|
|
3909
|
-
return e("div", { className: `three-panel-layout ${d2} ${J2 ? "is-dragging" : ""}`, style: { ...Me2, ...h2, "--panel-transition-duration": `${v2}ms`, "--panel-transition-easing": y2 }, children: /* @__PURE__ */ t(Ut, { groupRef: ge2, orientation: "horizontal", onLayoutChange: ze2, onLayoutChanged: ke2, children: [
|
|
3910
|
-
/* @__PURE__ */ e(qt, { id: "left", panelRef: ve2, collapsible: s2.left || !F, defaultSize: p2.left || !F ? "0%" : `${j2.left}%`, minSize: "0%", collapsedSize: "0%", onResize: Se2, className: Le2("left"), ...a2.left || {}, children: /* @__PURE__ */ e("div", { className: "panel-content-wrapper", style: { opacity: K2 ? 0 : 1 }, children: /* @__PURE__ */ e(M, { slot: "left", children: Z2 }) }) }),
|
|
3911
|
-
/* @__PURE__ */ e(Zt, { className: "resize-handle left-handle " + (!K2 && F && I2 ? "" : "collapsed"), disabled: K2 || !F || !I2, children: g2 && s2.left && /* @__PURE__ */ e("div", { className: "handle-bar", children: /* @__PURE__ */ e("button", { onClick: Ce, className: "collapse-toggle", "aria-label": K2 ? "Expand left panel" : "Collapse left panel", children: K2 ? "▸" : "◂" }) }) }),
|
|
3912
|
-
/* @__PURE__ */ e(qt, { id: "middle", panelRef: me, collapsible: s2.middle || !I2, defaultSize: p2.middle || !I2 ? "0%" : `${j2.middle}%`, minSize: "0%", collapsedSize: "0%", onResize: Ee2, className: Le2("middle"), ...a2.middle || {}, children: /* @__PURE__ */ e("div", { className: "panel-content-wrapper", style: { opacity: U2 ? 0 : 1 }, children: /* @__PURE__ */ e(M, { slot: "middle", children: ee }) }) }),
|
|
3913
|
-
/* @__PURE__ */ e(Zt, { className: "resize-handle right-handle " + (Y2 || !H || !I2 && !F ? "collapsed" : ""), disabled: Y2 || !H || !I2 && !F, children: g2 && s2.right && /* @__PURE__ */ e("div", { className: "handle-bar", children: /* @__PURE__ */ e("button", { onClick: Ne2, className: "collapse-toggle", "aria-label": Y2 ? "Expand right panel" : "Collapse right panel", children: Y2 ? "◂" : "▸" }) }) }),
|
|
3914
|
-
/* @__PURE__ */ e(qt, { id: "right", panelRef: fe2, collapsible: s2.right || !H, defaultSize: p2.right || !H ? "0%" : `${j2.right}%`, minSize: "0%", collapsedSize: "0%", onResize: De2, className: Le2("right"), ...a2.right || {}, children: /* @__PURE__ */ e("div", { className: "panel-content-wrapper", style: { opacity: Y2 ? 0 : 1 }, children: /* @__PURE__ */ e(M, { slot: "right", children: te2 }) }) })
|
|
3915
|
-
] }) });
|
|
3916
|
-
});
|
|
3917
|
-
T2.displayName = "ConfigurablePanelLayout";
|
|
3918
|
-
var $2 = d(({ panels: o2, className: i2 = "", style: s2, theme: c2, minPanelWidth: d2 = 350, idealPanelWidth: p2 = 0.333, showSeparator: h2 = false, onPanelChange: g2, preventKeyboardScroll: v2 = true, disableSwipe: m = false }, f) => {
|
|
3919
|
-
const b = l(null), y2 = l(false), w2 = l(null), x2 = C(c2);
|
|
3920
|
-
u(f, () => ({ scrollToPanel: (e2) => {
|
|
3921
|
-
if (!b.current)
|
|
3922
|
-
return;
|
|
3923
|
-
const t2 = b.current, n2 = t2.children[e2];
|
|
3924
|
-
if (n2) {
|
|
3925
|
-
y2.current = true, w2.current && clearTimeout(w2.current);
|
|
3926
|
-
const e3 = n2.offsetLeft;
|
|
3927
|
-
t2.scrollTo({ left: e3, behavior: "smooth" }), w2.current = setTimeout(() => {
|
|
3928
|
-
y2.current = false;
|
|
3929
|
-
}, 500);
|
|
3930
|
-
}
|
|
3931
|
-
}, getCurrentPanel: () => {
|
|
3932
|
-
if (!b.current || b.current.children.length === 0)
|
|
3933
|
-
return 0;
|
|
3934
|
-
const e2 = b.current, t2 = e2.getBoundingClientRect().left;
|
|
3935
|
-
let n2 = 0, r2 = 1 / 0;
|
|
3936
|
-
for (let o3 = 0;o3 < e2.children.length; o3++) {
|
|
3937
|
-
const l2 = e2.children[o3].getBoundingClientRect(), i3 = Math.abs(l2.left - t2);
|
|
3938
|
-
i3 < r2 && (r2 = i3, n2 = o3);
|
|
3939
|
-
}
|
|
3940
|
-
return n2;
|
|
3941
|
-
} }));
|
|
3942
|
-
a(() => {
|
|
3943
|
-
if (!v2 || !b.current)
|
|
3944
|
-
return;
|
|
3945
|
-
const e2 = b.current, t2 = (e3) => {
|
|
3946
|
-
const t3 = e3.target;
|
|
3947
|
-
if (t3.tagName === "INPUT" || t3.tagName === "TEXTAREA" || t3.tagName === "SELECT" || t3.isContentEditable || t3.closest(".xterm") !== null || t3.closest('[contenteditable="true"]') !== null)
|
|
3948
|
-
return;
|
|
3949
|
-
[" ", "Space", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown"].includes(e3.key) && e3.preventDefault();
|
|
3950
|
-
};
|
|
3951
|
-
return e2.addEventListener("keydown", t2), () => {
|
|
3952
|
-
e2.removeEventListener("keydown", t2);
|
|
3953
|
-
};
|
|
3954
|
-
}, [v2]), a(() => () => {
|
|
3955
|
-
w2.current && clearTimeout(w2.current);
|
|
3956
|
-
}, []);
|
|
3957
|
-
const N2 = o2.length, S = 2 * d2;
|
|
3958
|
-
let E;
|
|
3959
|
-
E = N2 === 1 || N2 === 2 ? "100%" : `max(${d2}px, ${100 * p2}%)`;
|
|
3960
|
-
const D3 = r.useId().replace(/:/g, "_");
|
|
3961
|
-
return t(n, { children: [
|
|
3962
|
-
N2 === 2 && /* @__PURE__ */ e("style", { children: `
|
|
3963
|
-
.snap-carousel-container[data-carousel-id="${D3}"][data-panel-count="2"] .snap-carousel-panel {
|
|
3964
|
-
width: 100%;
|
|
3965
|
-
}
|
|
3966
|
-
@container (min-width: ${S}px) {
|
|
3967
|
-
.snap-carousel-container[data-carousel-id="${D3}"][data-panel-count="2"] .snap-carousel-panel {
|
|
3968
|
-
width: 50%;
|
|
3969
|
-
}
|
|
3970
|
-
}
|
|
3971
|
-
` }),
|
|
3972
|
-
/* @__PURE__ */ e("div", { ref: b, className: `snap-carousel-container ${m ? "swipe-disabled" : ""} ${i2}`, style: { ...x2, ...s2, "--snap-carousel-min-width": `${d2}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": E, "--snap-carousel-panel-count": N2, "--snap-carousel-two-panel-threshold": `${S}px` }, onScroll: (e2) => {
|
|
3973
|
-
if (!g2 || !b.current || b.current.children.length === 0)
|
|
3974
|
-
return;
|
|
3975
|
-
if (y2.current)
|
|
3976
|
-
return;
|
|
3977
|
-
const t2 = b.current, n2 = t2.getBoundingClientRect().left;
|
|
3978
|
-
let r2 = 0, o3 = 1 / 0;
|
|
3979
|
-
for (let l2 = 0;l2 < t2.children.length; l2++) {
|
|
3980
|
-
const e3 = t2.children[l2].getBoundingClientRect(), i3 = Math.abs(e3.left - n2);
|
|
3981
|
-
i3 < o3 && (o3 = i3, r2 = l2);
|
|
3982
|
-
}
|
|
3983
|
-
g2(r2);
|
|
3984
|
-
}, "data-panel-count": N2, "data-carousel-id": D3, children: o2.map((t2, n2) => /* @__PURE__ */ e("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
|
|
3985
|
-
] });
|
|
3986
|
-
});
|
|
3987
|
-
$2.displayName = "SnapCarousel";
|
|
3988
|
-
var F = typeof window != "undefined" && window.document !== undefined && window.document.createElement !== undefined;
|
|
3989
|
-
function I2(e2) {
|
|
3990
|
-
const t2 = Object.prototype.toString.call(e2);
|
|
3991
|
-
return t2 === "[object Window]" || t2 === "[object global]";
|
|
3992
|
-
}
|
|
3993
|
-
function H(e2) {
|
|
3994
|
-
return "nodeType" in e2;
|
|
3995
|
-
}
|
|
3996
|
-
function W2(e2) {
|
|
3997
|
-
var t2, n2;
|
|
3998
|
-
return e2 ? I2(e2) ? e2 : H(e2) && (t2 = (n2 = e2.ownerDocument) == null ? undefined : n2.defaultView) != null ? t2 : window : window;
|
|
3999
|
-
}
|
|
4000
|
-
function j2(e2) {
|
|
4001
|
-
const { Document: t2 } = W2(e2);
|
|
4002
|
-
return e2 instanceof t2;
|
|
4003
|
-
}
|
|
4004
|
-
function K2(e2) {
|
|
4005
|
-
return !I2(e2) && e2 instanceof W2(e2).HTMLElement;
|
|
4006
|
-
}
|
|
4007
|
-
function q2(e2) {
|
|
4008
|
-
return e2 instanceof W2(e2).SVGElement;
|
|
4009
|
-
}
|
|
4010
|
-
function U2(e2) {
|
|
4011
|
-
return e2 ? I2(e2) ? e2.document : H(e2) ? j2(e2) ? e2 : K2(e2) || q2(e2) ? e2.ownerDocument : document : document : document;
|
|
4012
|
-
}
|
|
4013
|
-
var X2 = F ? h : a;
|
|
4014
|
-
function Y2(e2) {
|
|
4015
|
-
const t2 = l(e2);
|
|
4016
|
-
return X2(() => {
|
|
4017
|
-
t2.current = e2;
|
|
4018
|
-
}), i(function() {
|
|
4019
|
-
for (var e3 = arguments.length, n2 = new Array(e3), r2 = 0;r2 < e3; r2++)
|
|
4020
|
-
n2[r2] = arguments[r2];
|
|
4021
|
-
return t2.current == null ? undefined : t2.current(...n2);
|
|
4022
|
-
}, []);
|
|
4023
|
-
}
|
|
4024
|
-
function V2(e2, t2) {
|
|
4025
|
-
t2 === undefined && (t2 = [e2]);
|
|
4026
|
-
const n2 = l(e2);
|
|
4027
|
-
return X2(() => {
|
|
4028
|
-
n2.current !== e2 && (n2.current = e2);
|
|
4029
|
-
}, t2), n2;
|
|
4030
|
-
}
|
|
4031
|
-
function J2(e2, t2) {
|
|
4032
|
-
const n2 = l();
|
|
4033
|
-
return p(() => {
|
|
4034
|
-
const t3 = e2(n2.current);
|
|
4035
|
-
return n2.current = t3, t3;
|
|
4036
|
-
}, [...t2]);
|
|
4037
|
-
}
|
|
4038
|
-
function G2(e2) {
|
|
4039
|
-
const t2 = Y2(e2), n2 = l(null), r2 = i((e3) => {
|
|
4040
|
-
e3 !== n2.current && (t2 == null || t2(e3, n2.current)), n2.current = e3;
|
|
4041
|
-
}, []);
|
|
4042
|
-
return [n2, r2];
|
|
4043
|
-
}
|
|
4044
|
-
function _2(e2) {
|
|
4045
|
-
const t2 = l();
|
|
4046
|
-
return a(() => {
|
|
4047
|
-
t2.current = e2;
|
|
4048
|
-
}, [e2]), t2.current;
|
|
4049
|
-
}
|
|
4050
|
-
var Q2 = {};
|
|
4051
|
-
function Z2(e2, t2) {
|
|
4052
|
-
return p(() => {
|
|
4053
|
-
if (t2)
|
|
4054
|
-
return t2;
|
|
4055
|
-
const n2 = Q2[e2] == null ? 0 : Q2[e2] + 1;
|
|
4056
|
-
return Q2[e2] = n2, e2 + "-" + n2;
|
|
4057
|
-
}, [e2, t2]);
|
|
4058
|
-
}
|
|
4059
|
-
function ee(e2) {
|
|
4060
|
-
return function(t2) {
|
|
4061
|
-
for (var n2 = arguments.length, r2 = new Array(n2 > 1 ? n2 - 1 : 0), o2 = 1;o2 < n2; o2++)
|
|
4062
|
-
r2[o2 - 1] = arguments[o2];
|
|
4063
|
-
return r2.reduce((t3, n3) => {
|
|
4064
|
-
const r3 = Object.entries(n3);
|
|
4065
|
-
for (const [o3, l2] of r3) {
|
|
4066
|
-
const n4 = t3[o3];
|
|
4067
|
-
n4 != null && (t3[o3] = n4 + e2 * l2);
|
|
4068
|
-
}
|
|
4069
|
-
return t3;
|
|
4070
|
-
}, { ...t2 });
|
|
4071
|
-
};
|
|
4072
|
-
}
|
|
4073
|
-
var te2 = /* @__PURE__ */ ee(1);
|
|
4074
|
-
var ne2 = /* @__PURE__ */ ee(-1);
|
|
4075
|
-
function re2(e2) {
|
|
4076
|
-
if (!e2)
|
|
4077
|
-
return false;
|
|
4078
|
-
const { KeyboardEvent: t2 } = W2(e2.target);
|
|
4079
|
-
return t2 && e2 instanceof t2;
|
|
4080
|
-
}
|
|
4081
|
-
function oe2(e2) {
|
|
4082
|
-
if (function(e3) {
|
|
4083
|
-
if (!e3)
|
|
4084
|
-
return false;
|
|
4085
|
-
const { TouchEvent: t2 } = W2(e3.target);
|
|
4086
|
-
return t2 && e3 instanceof t2;
|
|
4087
|
-
}(e2)) {
|
|
4088
|
-
if (e2.touches && e2.touches.length) {
|
|
4089
|
-
const { clientX: t2, clientY: n2 } = e2.touches[0];
|
|
4090
|
-
return { x: t2, y: n2 };
|
|
4091
|
-
}
|
|
4092
|
-
if (e2.changedTouches && e2.changedTouches.length) {
|
|
4093
|
-
const { clientX: t2, clientY: n2 } = e2.changedTouches[0];
|
|
4094
|
-
return { x: t2, y: n2 };
|
|
4095
|
-
}
|
|
4096
|
-
}
|
|
4097
|
-
return function(e3) {
|
|
4098
|
-
return "clientX" in e3 && "clientY" in e3;
|
|
4099
|
-
}(e2) ? { x: e2.clientX, y: e2.clientY } : null;
|
|
4100
|
-
}
|
|
4101
|
-
var le = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
|
|
4102
|
-
function ie2(e2) {
|
|
4103
|
-
return e2.matches(le) ? e2 : e2.querySelector(le);
|
|
4104
|
-
}
|
|
4105
|
-
var ae = { display: "none" };
|
|
4106
|
-
function se2(e2) {
|
|
4107
|
-
let { id: t2, value: n2 } = e2;
|
|
4108
|
-
return r.createElement("div", { id: t2, style: ae }, n2);
|
|
4109
|
-
}
|
|
4110
|
-
function ce2(e2) {
|
|
4111
|
-
let { id: t2, announcement: n2, ariaLiveType: o2 = "assertive" } = e2;
|
|
4112
|
-
return r.createElement("div", { id: t2, style: { position: "fixed", top: 0, left: 0, width: 1, height: 1, margin: -1, border: 0, padding: 0, overflow: "hidden", clip: "rect(0 0 0 0)", clipPath: "inset(100%)", whiteSpace: "nowrap" }, role: "status", "aria-live": o2, "aria-atomic": true }, n2);
|
|
4113
|
-
}
|
|
4114
|
-
var de2 = /* @__PURE__ */ s(null);
|
|
4115
|
-
var ue2 = { draggable: `
|
|
4116
|
-
To pick up a draggable item, press the space bar.
|
|
4117
|
-
While dragging, use the arrow keys to move the item.
|
|
4118
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
4119
|
-
` };
|
|
4120
|
-
var pe = { onDragStart(e2) {
|
|
4121
|
-
let { active: t2 } = e2;
|
|
4122
|
-
return "Picked up draggable item " + t2.id + ".";
|
|
4123
|
-
}, onDragOver(e2) {
|
|
4124
|
-
let { active: t2, over: n2 } = e2;
|
|
4125
|
-
return n2 ? "Draggable item " + t2.id + " was moved over droppable area " + n2.id + "." : "Draggable item " + t2.id + " is no longer over a droppable area.";
|
|
4126
|
-
}, onDragEnd(e2) {
|
|
4127
|
-
let { active: t2, over: n2 } = e2;
|
|
4128
|
-
return n2 ? "Draggable item " + t2.id + " was dropped over droppable area " + n2.id : "Draggable item " + t2.id + " was dropped.";
|
|
4129
|
-
}, onDragCancel(e2) {
|
|
4130
|
-
let { active: t2 } = e2;
|
|
4131
|
-
return "Dragging was cancelled. Draggable item " + t2.id + " was dropped.";
|
|
4132
|
-
} };
|
|
4133
|
-
function he2(e2) {
|
|
4134
|
-
let { announcements: t2 = pe, container: n2, hiddenTextDescribedById: l2, screenReaderInstructions: s2 = ue2 } = e2;
|
|
4135
|
-
const { announce: d2, announcement: u2 } = function() {
|
|
4136
|
-
const [e3, t3] = o("");
|
|
4137
|
-
return { announce: i((e4) => {
|
|
4138
|
-
e4 != null && t3(e4);
|
|
4139
|
-
}, []), announcement: e3 };
|
|
4140
|
-
}(), h2 = Z2("DndLiveRegion"), [g2, v2] = o(false);
|
|
4141
|
-
if (a(() => {
|
|
4142
|
-
v2(true);
|
|
4143
|
-
}, []), function(e3) {
|
|
4144
|
-
const t3 = c(de2);
|
|
4145
|
-
a(() => {
|
|
4146
|
-
if (!t3)
|
|
4147
|
-
throw new Error("useDndMonitor must be used within a children of <DndContext>");
|
|
4148
|
-
return t3(e3);
|
|
4149
|
-
}, [e3, t3]);
|
|
4150
|
-
}(p(() => ({ onDragStart(e3) {
|
|
4151
|
-
let { active: n3 } = e3;
|
|
4152
|
-
d2(t2.onDragStart({ active: n3 }));
|
|
4153
|
-
}, onDragMove(e3) {
|
|
4154
|
-
let { active: n3, over: r2 } = e3;
|
|
4155
|
-
t2.onDragMove && d2(t2.onDragMove({ active: n3, over: r2 }));
|
|
4156
|
-
}, onDragOver(e3) {
|
|
4157
|
-
let { active: n3, over: r2 } = e3;
|
|
4158
|
-
d2(t2.onDragOver({ active: n3, over: r2 }));
|
|
4159
|
-
}, onDragEnd(e3) {
|
|
4160
|
-
let { active: n3, over: r2 } = e3;
|
|
4161
|
-
d2(t2.onDragEnd({ active: n3, over: r2 }));
|
|
4162
|
-
}, onDragCancel(e3) {
|
|
4163
|
-
let { active: n3, over: r2 } = e3;
|
|
4164
|
-
d2(t2.onDragCancel({ active: n3, over: r2 }));
|
|
4165
|
-
} }), [d2, t2])), !g2)
|
|
4166
|
-
return null;
|
|
4167
|
-
const m = r.createElement(r.Fragment, null, r.createElement(se2, { id: l2, value: s2.draggable }), r.createElement(ce2, { id: h2, announcement: u2 }));
|
|
4168
|
-
return n2 ? w(m, n2) : m;
|
|
4169
|
-
}
|
|
4170
|
-
var ge2;
|
|
4171
|
-
var ve2;
|
|
4172
|
-
function me() {}
|
|
4173
|
-
(ve2 = ge2 || (ge2 = {})).DragStart = "dragStart", ve2.DragMove = "dragMove", ve2.DragEnd = "dragEnd", ve2.DragCancel = "dragCancel", ve2.DragOver = "dragOver", ve2.RegisterDroppable = "registerDroppable", ve2.SetDroppableDisabled = "setDroppableDisabled", ve2.UnregisterDroppable = "unregisterDroppable";
|
|
4174
|
-
var fe2 = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
|
|
4175
|
-
function be2(e2, t2) {
|
|
4176
|
-
return Math.sqrt(Math.pow(e2.x - t2.x, 2) + Math.pow(e2.y - t2.y, 2));
|
|
4177
|
-
}
|
|
4178
|
-
function ye2(e2, t2) {
|
|
4179
|
-
let { data: { value: n2 } } = e2, { data: { value: r2 } } = t2;
|
|
4180
|
-
return n2 - r2;
|
|
4181
|
-
}
|
|
4182
|
-
function we2(e2, t2) {
|
|
4183
|
-
let { data: { value: n2 } } = e2, { data: { value: r2 } } = t2;
|
|
4184
|
-
return r2 - n2;
|
|
4185
|
-
}
|
|
4186
|
-
function xe2(e2, t2, n2) {
|
|
4187
|
-
return t2 === undefined && (t2 = e2.left), n2 === undefined && (n2 = e2.top), { x: t2 + 0.5 * e2.width, y: n2 + 0.5 * e2.height };
|
|
4188
|
-
}
|
|
4189
|
-
var Ce = (e2) => {
|
|
4190
|
-
let { collisionRect: t2, droppableRects: n2, droppableContainers: r2 } = e2;
|
|
4191
|
-
const o2 = xe2(t2, t2.left, t2.top), l2 = [];
|
|
4192
|
-
for (const i2 of r2) {
|
|
4193
|
-
const { id: e3 } = i2, t3 = n2.get(e3);
|
|
4194
|
-
if (t3) {
|
|
4195
|
-
const n3 = be2(xe2(t3), o2);
|
|
4196
|
-
l2.push({ id: e3, data: { droppableContainer: i2, value: n3 } });
|
|
4197
|
-
}
|
|
4198
|
-
}
|
|
4199
|
-
return l2.sort(ye2);
|
|
4200
|
-
};
|
|
4201
|
-
function Ne2(e2, t2) {
|
|
4202
|
-
const n2 = Math.max(t2.top, e2.top), r2 = Math.max(t2.left, e2.left), o2 = Math.min(t2.left + t2.width, e2.left + e2.width), l2 = Math.min(t2.top + t2.height, e2.top + e2.height), i2 = o2 - r2, a2 = l2 - n2;
|
|
4203
|
-
if (r2 < o2 && n2 < l2) {
|
|
4204
|
-
const n3 = t2.width * t2.height, r3 = e2.width * e2.height, o3 = i2 * a2;
|
|
4205
|
-
return Number((o3 / (n3 + r3 - o3)).toFixed(4));
|
|
4206
|
-
}
|
|
4207
|
-
return 0;
|
|
4208
|
-
}
|
|
4209
|
-
var Se2 = (e2) => {
|
|
4210
|
-
let { collisionRect: t2, droppableRects: n2, droppableContainers: r2 } = e2;
|
|
4211
|
-
const o2 = [];
|
|
4212
|
-
for (const l2 of r2) {
|
|
4213
|
-
const { id: e3 } = l2, r3 = n2.get(e3);
|
|
4214
|
-
if (r3) {
|
|
4215
|
-
const n3 = Ne2(r3, t2);
|
|
4216
|
-
n3 > 0 && o2.push({ id: e3, data: { droppableContainer: l2, value: n3 } });
|
|
4217
|
-
}
|
|
4218
|
-
}
|
|
4219
|
-
return o2.sort(we2);
|
|
4220
|
-
};
|
|
4221
|
-
function Ee2(e2, t2) {
|
|
4222
|
-
return e2 && t2 ? { x: e2.left - t2.left, y: e2.top - t2.top } : fe2;
|
|
4223
|
-
}
|
|
4224
|
-
function De2(e2) {
|
|
4225
|
-
return function(t2) {
|
|
4226
|
-
for (var n2 = arguments.length, r2 = new Array(n2 > 1 ? n2 - 1 : 0), o2 = 1;o2 < n2; o2++)
|
|
4227
|
-
r2[o2 - 1] = arguments[o2];
|
|
4228
|
-
return r2.reduce((t3, n3) => ({ ...t3, top: t3.top + e2 * n3.y, bottom: t3.bottom + e2 * n3.y, left: t3.left + e2 * n3.x, right: t3.right + e2 * n3.x }), { ...t2 });
|
|
4229
|
-
};
|
|
4230
|
-
}
|
|
4231
|
-
var Re = /* @__PURE__ */ De2(1);
|
|
4232
|
-
var ze2 = { ignoreTransform: false };
|
|
4233
|
-
function ke2(e2, t2) {
|
|
4234
|
-
t2 === undefined && (t2 = ze2);
|
|
4235
|
-
let n2 = e2.getBoundingClientRect();
|
|
4236
|
-
if (t2.ignoreTransform) {
|
|
4237
|
-
const { transform: t3, transformOrigin: r3 } = W2(e2).getComputedStyle(e2);
|
|
4238
|
-
t3 && (n2 = function(e3, t4, n3) {
|
|
4239
|
-
const r4 = function(e4) {
|
|
4240
|
-
if (e4.startsWith("matrix3d(")) {
|
|
4241
|
-
const t5 = e4.slice(9, -1).split(/, /);
|
|
4242
|
-
return { x: +t5[12], y: +t5[13], scaleX: +t5[0], scaleY: +t5[5] };
|
|
4243
|
-
}
|
|
4244
|
-
if (e4.startsWith("matrix(")) {
|
|
4245
|
-
const t5 = e4.slice(7, -1).split(/, /);
|
|
4246
|
-
return { x: +t5[4], y: +t5[5], scaleX: +t5[0], scaleY: +t5[3] };
|
|
4247
|
-
}
|
|
4248
|
-
return null;
|
|
4249
|
-
}(t4);
|
|
4250
|
-
if (!r4)
|
|
4251
|
-
return e3;
|
|
4252
|
-
const { scaleX: o3, scaleY: l3, x: i3, y: a3 } = r4, s3 = e3.left - i3 - (1 - o3) * parseFloat(n3), c2 = e3.top - a3 - (1 - l3) * parseFloat(n3.slice(n3.indexOf(" ") + 1)), d2 = o3 ? e3.width / o3 : e3.width, u2 = l3 ? e3.height / l3 : e3.height;
|
|
4253
|
-
return { width: d2, height: u2, top: c2, right: s3 + d2, bottom: c2 + u2, left: s3 };
|
|
4254
|
-
}(n2, t3, r3));
|
|
4255
|
-
}
|
|
4256
|
-
const { top: r2, left: o2, width: l2, height: i2, bottom: a2, right: s2 } = n2;
|
|
4257
|
-
return { top: r2, left: o2, width: l2, height: i2, bottom: a2, right: s2 };
|
|
4258
|
-
}
|
|
4259
|
-
function Le2(e2) {
|
|
4260
|
-
return ke2(e2, { ignoreTransform: true });
|
|
4261
|
-
}
|
|
4262
|
-
function Me2(e2, t2) {
|
|
4263
|
-
const n2 = [];
|
|
4264
|
-
return e2 ? function r(o2) {
|
|
4265
|
-
if (t2 != null && n2.length >= t2)
|
|
4266
|
-
return n2;
|
|
4267
|
-
if (!o2)
|
|
4268
|
-
return n2;
|
|
4269
|
-
if (j2(o2) && o2.scrollingElement != null && !n2.includes(o2.scrollingElement))
|
|
4270
|
-
return n2.push(o2.scrollingElement), n2;
|
|
4271
|
-
if (!K2(o2) || q2(o2))
|
|
4272
|
-
return n2;
|
|
4273
|
-
if (n2.includes(o2))
|
|
4274
|
-
return n2;
|
|
4275
|
-
const l2 = W2(e2).getComputedStyle(o2);
|
|
4276
|
-
return o2 !== e2 && function(e3, t3) {
|
|
4277
|
-
t3 === undefined && (t3 = W2(e3).getComputedStyle(e3));
|
|
4278
|
-
const n3 = /(auto|scroll|overlay)/;
|
|
4279
|
-
return ["overflow", "overflowX", "overflowY"].some((e4) => {
|
|
4280
|
-
const r2 = t3[e4];
|
|
4281
|
-
return typeof r2 == "string" && n3.test(r2);
|
|
4282
|
-
});
|
|
4283
|
-
}(o2, l2) && n2.push(o2), function(e3, t3) {
|
|
4284
|
-
return t3 === undefined && (t3 = W2(e3).getComputedStyle(e3)), t3.position === "fixed";
|
|
4285
|
-
}(o2, l2) ? n2 : r(o2.parentNode);
|
|
4286
|
-
}(e2) : n2;
|
|
4287
|
-
}
|
|
4288
|
-
function Pe2(e2) {
|
|
4289
|
-
const [t2] = Me2(e2, 1);
|
|
4290
|
-
return t2 != null ? t2 : null;
|
|
4291
|
-
}
|
|
4292
|
-
function Ae2(e2) {
|
|
4293
|
-
return F && e2 ? I2(e2) ? e2 : H(e2) ? j2(e2) || e2 === U2(e2).scrollingElement ? window : K2(e2) ? e2 : null : null : null;
|
|
4294
|
-
}
|
|
4295
|
-
function Te2(e2) {
|
|
4296
|
-
return I2(e2) ? e2.scrollX : e2.scrollLeft;
|
|
4297
|
-
}
|
|
4298
|
-
function $e2(e2) {
|
|
4299
|
-
return I2(e2) ? e2.scrollY : e2.scrollTop;
|
|
4300
|
-
}
|
|
4301
|
-
function Be2(e2) {
|
|
4302
|
-
return { x: Te2(e2), y: $e2(e2) };
|
|
4303
|
-
}
|
|
4304
|
-
var Oe2;
|
|
4305
|
-
var Fe2;
|
|
4306
|
-
function Ie2(e2) {
|
|
4307
|
-
return !(!F || !e2) && e2 === document.scrollingElement;
|
|
4308
|
-
}
|
|
4309
|
-
function He2(e2) {
|
|
4310
|
-
const t2 = { x: 0, y: 0 }, n2 = Ie2(e2) ? { height: window.innerHeight, width: window.innerWidth } : { height: e2.clientHeight, width: e2.clientWidth }, r2 = { x: e2.scrollWidth - n2.width, y: e2.scrollHeight - n2.height };
|
|
4311
|
-
return { isTop: e2.scrollTop <= t2.y, isLeft: e2.scrollLeft <= t2.x, isBottom: e2.scrollTop >= r2.y, isRight: e2.scrollLeft >= r2.x, maxScroll: r2, minScroll: t2 };
|
|
4312
|
-
}
|
|
4313
|
-
(Fe2 = Oe2 || (Oe2 = {}))[Fe2.Forward = 1] = "Forward", Fe2[Fe2.Backward = -1] = "Backward";
|
|
4314
|
-
var We2 = { x: 0.2, y: 0.2 };
|
|
4315
|
-
function je2(e2, t2, n2, r2, o2) {
|
|
4316
|
-
let { top: l2, left: i2, right: a2, bottom: s2 } = n2;
|
|
4317
|
-
r2 === undefined && (r2 = 10), o2 === undefined && (o2 = We2);
|
|
4318
|
-
const { isTop: c2, isBottom: d2, isLeft: u2, isRight: p2 } = He2(e2), h2 = { x: 0, y: 0 }, g2 = { x: 0, y: 0 }, v2 = t2.height * o2.y, m = t2.width * o2.x;
|
|
4319
|
-
return !c2 && l2 <= t2.top + v2 ? (h2.y = Oe2.Backward, g2.y = r2 * Math.abs((t2.top + v2 - l2) / v2)) : !d2 && s2 >= t2.bottom - v2 && (h2.y = Oe2.Forward, g2.y = r2 * Math.abs((t2.bottom - v2 - s2) / v2)), !p2 && a2 >= t2.right - m ? (h2.x = Oe2.Forward, g2.x = r2 * Math.abs((t2.right - m - a2) / m)) : !u2 && i2 <= t2.left + m && (h2.x = Oe2.Backward, g2.x = r2 * Math.abs((t2.left + m - i2) / m)), { direction: h2, speed: g2 };
|
|
4320
|
-
}
|
|
4321
|
-
function Ke2(e2) {
|
|
4322
|
-
if (e2 === document.scrollingElement) {
|
|
4323
|
-
const { innerWidth: e3, innerHeight: t3 } = window;
|
|
4324
|
-
return { top: 0, left: 0, right: e3, bottom: t3, width: e3, height: t3 };
|
|
4325
|
-
}
|
|
4326
|
-
const { top: t2, left: n2, right: r2, bottom: o2 } = e2.getBoundingClientRect();
|
|
4327
|
-
return { top: t2, left: n2, right: r2, bottom: o2, width: e2.clientWidth, height: e2.clientHeight };
|
|
4328
|
-
}
|
|
4329
|
-
function qe2(e2) {
|
|
4330
|
-
return e2.reduce((e3, t2) => te2(e3, Be2(t2)), fe2);
|
|
4331
|
-
}
|
|
4332
|
-
var Ue2 = [["x", ["left", "right"], function(e2) {
|
|
4333
|
-
return e2.reduce((e3, t2) => e3 + Te2(t2), 0);
|
|
4334
|
-
}], ["y", ["top", "bottom"], function(e2) {
|
|
4335
|
-
return e2.reduce((e3, t2) => e3 + $e2(t2), 0);
|
|
4336
|
-
}]];
|
|
4337
|
-
|
|
4338
|
-
class Xe2 {
|
|
4339
|
-
constructor(e2, t2) {
|
|
4340
|
-
this.rect = undefined, this.width = undefined, this.height = undefined, this.top = undefined, this.bottom = undefined, this.right = undefined, this.left = undefined;
|
|
4341
|
-
const n2 = Me2(t2), r2 = qe2(n2);
|
|
4342
|
-
this.rect = { ...e2 }, this.width = e2.width, this.height = e2.height;
|
|
4343
|
-
for (const [o2, l2, i2] of Ue2)
|
|
4344
|
-
for (const e3 of l2)
|
|
4345
|
-
Object.defineProperty(this, e3, { get: () => {
|
|
4346
|
-
const t3 = i2(n2), l3 = r2[o2] - t3;
|
|
4347
|
-
return this.rect[e3] + l3;
|
|
4348
|
-
}, enumerable: true });
|
|
4349
|
-
Object.defineProperty(this, "rect", { enumerable: false });
|
|
4350
|
-
}
|
|
4351
|
-
}
|
|
4352
|
-
|
|
4353
|
-
class Ye2 {
|
|
4354
|
-
constructor(e2) {
|
|
4355
|
-
this.target = undefined, this.listeners = [], this.removeAll = () => {
|
|
4356
|
-
this.listeners.forEach((e3) => {
|
|
4357
|
-
var t2;
|
|
4358
|
-
return (t2 = this.target) == null ? undefined : t2.removeEventListener(...e3);
|
|
4359
|
-
});
|
|
4360
|
-
}, this.target = e2;
|
|
4361
|
-
}
|
|
4362
|
-
add(e2, t2, n2) {
|
|
4363
|
-
var r2;
|
|
4364
|
-
(r2 = this.target) == null || r2.addEventListener(e2, t2, n2), this.listeners.push([e2, t2, n2]);
|
|
4365
|
-
}
|
|
4366
|
-
}
|
|
4367
|
-
function Ve2(e2, t2) {
|
|
4368
|
-
const n2 = Math.abs(e2.x), r2 = Math.abs(e2.y);
|
|
4369
|
-
return typeof t2 == "number" ? Math.sqrt(n2 ** 2 + r2 ** 2) > t2 : ("x" in t2) && ("y" in t2) ? n2 > t2.x && r2 > t2.y : ("x" in t2) ? n2 > t2.x : ("y" in t2) && r2 > t2.y;
|
|
4370
|
-
}
|
|
4371
|
-
var Je2;
|
|
4372
|
-
var Ge2;
|
|
4373
|
-
var _e2;
|
|
4374
|
-
var Qe2;
|
|
4375
|
-
function Ze2(e2) {
|
|
4376
|
-
e2.preventDefault();
|
|
4377
|
-
}
|
|
4378
|
-
function et2(e2) {
|
|
4379
|
-
e2.stopPropagation();
|
|
4380
|
-
}
|
|
4381
|
-
(Ge2 = Je2 || (Je2 = {})).Click = "click", Ge2.DragStart = "dragstart", Ge2.Keydown = "keydown", Ge2.ContextMenu = "contextmenu", Ge2.Resize = "resize", Ge2.SelectionChange = "selectionchange", Ge2.VisibilityChange = "visibilitychange", (Qe2 = _e2 || (_e2 = {})).Space = "Space", Qe2.Down = "ArrowDown", Qe2.Right = "ArrowRight", Qe2.Left = "ArrowLeft", Qe2.Up = "ArrowUp", Qe2.Esc = "Escape", Qe2.Enter = "Enter", Qe2.Tab = "Tab";
|
|
4382
|
-
var tt2 = { start: [_e2.Space, _e2.Enter], cancel: [_e2.Esc], end: [_e2.Space, _e2.Enter, _e2.Tab] };
|
|
4383
|
-
var nt2 = (e2, t2) => {
|
|
4384
|
-
let { currentCoordinates: n2 } = t2;
|
|
4385
|
-
switch (e2.code) {
|
|
4386
|
-
case _e2.Right:
|
|
4387
|
-
return { ...n2, x: n2.x + 25 };
|
|
4388
|
-
case _e2.Left:
|
|
4389
|
-
return { ...n2, x: n2.x - 25 };
|
|
4390
|
-
case _e2.Down:
|
|
4391
|
-
return { ...n2, y: n2.y + 25 };
|
|
4392
|
-
case _e2.Up:
|
|
4393
|
-
return { ...n2, y: n2.y - 25 };
|
|
4394
|
-
}
|
|
4395
|
-
};
|
|
4396
|
-
|
|
4397
|
-
class rt2 {
|
|
4398
|
-
constructor(e2) {
|
|
4399
|
-
this.props = undefined, this.autoScrollEnabled = false, this.referenceCoordinates = undefined, this.listeners = undefined, this.windowListeners = undefined, this.props = e2;
|
|
4400
|
-
const { event: { target: t2 } } = e2;
|
|
4401
|
-
this.props = e2, this.listeners = new Ye2(U2(t2)), this.windowListeners = new Ye2(W2(t2)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
|
|
4402
|
-
}
|
|
4403
|
-
attach() {
|
|
4404
|
-
this.handleStart(), this.windowListeners.add(Je2.Resize, this.handleCancel), this.windowListeners.add(Je2.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Je2.Keydown, this.handleKeyDown));
|
|
4405
|
-
}
|
|
4406
|
-
handleStart() {
|
|
4407
|
-
const { activeNode: e2, onStart: t2 } = this.props, n2 = e2.node.current;
|
|
4408
|
-
n2 && function(e3, t3) {
|
|
4409
|
-
if (t3 === undefined && (t3 = ke2), !e3)
|
|
4410
|
-
return;
|
|
4411
|
-
const { top: n3, left: r2, bottom: o2, right: l2 } = t3(e3);
|
|
4412
|
-
Pe2(e3) && (o2 <= 0 || l2 <= 0 || n3 >= window.innerHeight || r2 >= window.innerWidth) && e3.scrollIntoView({ block: "center", inline: "center" });
|
|
4413
|
-
}(n2), t2(fe2);
|
|
4414
|
-
}
|
|
4415
|
-
handleKeyDown(e2) {
|
|
4416
|
-
if (re2(e2)) {
|
|
4417
|
-
const { active: t2, context: n2, options: r2 } = this.props, { keyboardCodes: o2 = tt2, coordinateGetter: l2 = nt2, scrollBehavior: i2 = "smooth" } = r2, { code: a2 } = e2;
|
|
4418
|
-
if (o2.end.includes(a2))
|
|
4419
|
-
return void this.handleEnd(e2);
|
|
4420
|
-
if (o2.cancel.includes(a2))
|
|
4421
|
-
return void this.handleCancel(e2);
|
|
4422
|
-
const { collisionRect: s2 } = n2.current, c2 = s2 ? { x: s2.left, y: s2.top } : fe2;
|
|
4423
|
-
this.referenceCoordinates || (this.referenceCoordinates = c2);
|
|
4424
|
-
const d2 = l2(e2, { active: t2, context: n2.current, currentCoordinates: c2 });
|
|
4425
|
-
if (d2) {
|
|
4426
|
-
const t3 = ne2(d2, c2), r3 = { x: 0, y: 0 }, { scrollableAncestors: o3 } = n2.current;
|
|
4427
|
-
for (const n3 of o3) {
|
|
4428
|
-
const o4 = e2.code, { isTop: l3, isRight: a3, isLeft: s3, isBottom: c3, maxScroll: u2, minScroll: p2 } = He2(n3), h2 = Ke2(n3), g2 = { x: Math.min(o4 === _e2.Right ? h2.right - h2.width / 2 : h2.right, Math.max(o4 === _e2.Right ? h2.left : h2.left + h2.width / 2, d2.x)), y: Math.min(o4 === _e2.Down ? h2.bottom - h2.height / 2 : h2.bottom, Math.max(o4 === _e2.Down ? h2.top : h2.top + h2.height / 2, d2.y)) }, v2 = o4 === _e2.Right && !a3 || o4 === _e2.Left && !s3, m = o4 === _e2.Down && !c3 || o4 === _e2.Up && !l3;
|
|
4429
|
-
if (v2 && g2.x !== d2.x) {
|
|
4430
|
-
const e3 = n3.scrollLeft + t3.x, l4 = o4 === _e2.Right && e3 <= u2.x || o4 === _e2.Left && e3 >= p2.x;
|
|
4431
|
-
if (l4 && !t3.y)
|
|
4432
|
-
return void n3.scrollTo({ left: e3, behavior: i2 });
|
|
4433
|
-
r3.x = l4 ? n3.scrollLeft - e3 : o4 === _e2.Right ? n3.scrollLeft - u2.x : n3.scrollLeft - p2.x, r3.x && n3.scrollBy({ left: -r3.x, behavior: i2 });
|
|
4434
|
-
break;
|
|
4435
|
-
}
|
|
4436
|
-
if (m && g2.y !== d2.y) {
|
|
4437
|
-
const e3 = n3.scrollTop + t3.y, l4 = o4 === _e2.Down && e3 <= u2.y || o4 === _e2.Up && e3 >= p2.y;
|
|
4438
|
-
if (l4 && !t3.x)
|
|
4439
|
-
return void n3.scrollTo({ top: e3, behavior: i2 });
|
|
4440
|
-
r3.y = l4 ? n3.scrollTop - e3 : o4 === _e2.Down ? n3.scrollTop - u2.y : n3.scrollTop - p2.y, r3.y && n3.scrollBy({ top: -r3.y, behavior: i2 });
|
|
4441
|
-
break;
|
|
4442
|
-
}
|
|
4443
|
-
}
|
|
4444
|
-
this.handleMove(e2, te2(ne2(d2, this.referenceCoordinates), r3));
|
|
4445
|
-
}
|
|
4446
|
-
}
|
|
4447
|
-
}
|
|
4448
|
-
handleMove(e2, t2) {
|
|
4449
|
-
const { onMove: n2 } = this.props;
|
|
4450
|
-
e2.preventDefault(), n2(t2);
|
|
4451
|
-
}
|
|
4452
|
-
handleEnd(e2) {
|
|
4453
|
-
const { onEnd: t2 } = this.props;
|
|
4454
|
-
e2.preventDefault(), this.detach(), t2();
|
|
4455
|
-
}
|
|
4456
|
-
handleCancel(e2) {
|
|
4457
|
-
const { onCancel: t2 } = this.props;
|
|
4458
|
-
e2.preventDefault(), this.detach(), t2();
|
|
4459
|
-
}
|
|
4460
|
-
detach() {
|
|
4461
|
-
this.listeners.removeAll(), this.windowListeners.removeAll();
|
|
4462
|
-
}
|
|
4463
|
-
}
|
|
4464
|
-
function ot2(e2) {
|
|
4465
|
-
return Boolean(e2 && "distance" in e2);
|
|
4466
|
-
}
|
|
4467
|
-
function lt(e2) {
|
|
4468
|
-
return Boolean(e2 && "delay" in e2);
|
|
4469
|
-
}
|
|
4470
|
-
rt2.activators = [{ eventName: "onKeyDown", handler: (e2, t2, n2) => {
|
|
4471
|
-
let { keyboardCodes: r2 = tt2, onActivation: o2 } = t2, { active: l2 } = n2;
|
|
4472
|
-
const { code: i2 } = e2.nativeEvent;
|
|
4473
|
-
if (r2.start.includes(i2)) {
|
|
4474
|
-
const t3 = l2.activatorNode.current;
|
|
4475
|
-
return (!t3 || e2.target === t3) && (e2.preventDefault(), o2 == null || o2({ event: e2.nativeEvent }), true);
|
|
4476
|
-
}
|
|
4477
|
-
return false;
|
|
4478
|
-
} }];
|
|
4479
|
-
|
|
4480
|
-
class it2 {
|
|
4481
|
-
constructor(e2, t2, n2) {
|
|
4482
|
-
var r2;
|
|
4483
|
-
n2 === undefined && (n2 = function(e3) {
|
|
4484
|
-
const { EventTarget: t3 } = W2(e3);
|
|
4485
|
-
return e3 instanceof t3 ? e3 : U2(e3);
|
|
4486
|
-
}(e2.event.target)), this.props = undefined, this.events = undefined, this.autoScrollEnabled = true, this.document = undefined, this.activated = false, this.initialCoordinates = undefined, this.timeoutId = null, this.listeners = undefined, this.documentListeners = undefined, this.windowListeners = undefined, this.props = e2, this.events = t2;
|
|
4487
|
-
const { event: o2 } = e2, { target: l2 } = o2;
|
|
4488
|
-
this.props = e2, this.events = t2, this.document = U2(l2), this.documentListeners = new Ye2(this.document), this.listeners = new Ye2(n2), this.windowListeners = new Ye2(W2(l2)), this.initialCoordinates = (r2 = oe2(o2)) != null ? r2 : fe2, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
|
|
4489
|
-
}
|
|
4490
|
-
attach() {
|
|
4491
|
-
const { events: e2, props: { options: { activationConstraint: t2, bypassActivationConstraint: n2 } } } = this;
|
|
4492
|
-
if (this.listeners.add(e2.move.name, this.handleMove, { passive: false }), this.listeners.add(e2.end.name, this.handleEnd), e2.cancel && this.listeners.add(e2.cancel.name, this.handleCancel), this.windowListeners.add(Je2.Resize, this.handleCancel), this.windowListeners.add(Je2.DragStart, Ze2), this.windowListeners.add(Je2.VisibilityChange, this.handleCancel), this.windowListeners.add(Je2.ContextMenu, Ze2), this.documentListeners.add(Je2.Keydown, this.handleKeydown), t2) {
|
|
4493
|
-
if (n2 != null && n2({ event: this.props.event, activeNode: this.props.activeNode, options: this.props.options }))
|
|
4494
|
-
return this.handleStart();
|
|
4495
|
-
if (lt(t2))
|
|
4496
|
-
return this.timeoutId = setTimeout(this.handleStart, t2.delay), void this.handlePending(t2);
|
|
4497
|
-
if (ot2(t2))
|
|
4498
|
-
return void this.handlePending(t2);
|
|
4499
|
-
}
|
|
4500
|
-
this.handleStart();
|
|
4501
|
-
}
|
|
4502
|
-
detach() {
|
|
4503
|
-
this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
|
|
4504
|
-
}
|
|
4505
|
-
handlePending(e2, t2) {
|
|
4506
|
-
const { active: n2, onPending: r2 } = this.props;
|
|
4507
|
-
r2(n2, e2, this.initialCoordinates, t2);
|
|
4508
|
-
}
|
|
4509
|
-
handleStart() {
|
|
4510
|
-
const { initialCoordinates: e2 } = this, { onStart: t2 } = this.props;
|
|
4511
|
-
e2 && (this.activated = true, this.documentListeners.add(Je2.Click, et2, { capture: true }), this.removeTextSelection(), this.documentListeners.add(Je2.SelectionChange, this.removeTextSelection), t2(e2));
|
|
4512
|
-
}
|
|
4513
|
-
handleMove(e2) {
|
|
4514
|
-
var t2;
|
|
4515
|
-
const { activated: n2, initialCoordinates: r2, props: o2 } = this, { onMove: l2, options: { activationConstraint: i2 } } = o2;
|
|
4516
|
-
if (!r2)
|
|
4517
|
-
return;
|
|
4518
|
-
const a2 = (t2 = oe2(e2)) != null ? t2 : fe2, s2 = ne2(r2, a2);
|
|
4519
|
-
if (!n2 && i2) {
|
|
4520
|
-
if (ot2(i2)) {
|
|
4521
|
-
if (i2.tolerance != null && Ve2(s2, i2.tolerance))
|
|
4522
|
-
return this.handleCancel();
|
|
4523
|
-
if (Ve2(s2, i2.distance))
|
|
4524
|
-
return this.handleStart();
|
|
4525
|
-
}
|
|
4526
|
-
return lt(i2) && Ve2(s2, i2.tolerance) ? this.handleCancel() : void this.handlePending(i2, s2);
|
|
4527
|
-
}
|
|
4528
|
-
e2.cancelable && e2.preventDefault(), l2(a2);
|
|
4529
|
-
}
|
|
4530
|
-
handleEnd() {
|
|
4531
|
-
const { onAbort: e2, onEnd: t2 } = this.props;
|
|
4532
|
-
this.detach(), this.activated || e2(this.props.active), t2();
|
|
4533
|
-
}
|
|
4534
|
-
handleCancel() {
|
|
4535
|
-
const { onAbort: e2, onCancel: t2 } = this.props;
|
|
4536
|
-
this.detach(), this.activated || e2(this.props.active), t2();
|
|
4537
|
-
}
|
|
4538
|
-
handleKeydown(e2) {
|
|
4539
|
-
e2.code === _e2.Esc && this.handleCancel();
|
|
4540
|
-
}
|
|
4541
|
-
removeTextSelection() {
|
|
4542
|
-
var e2;
|
|
4543
|
-
(e2 = this.document.getSelection()) == null || e2.removeAllRanges();
|
|
4544
|
-
}
|
|
4545
|
-
}
|
|
4546
|
-
var at2 = { cancel: { name: "pointercancel" }, move: { name: "pointermove" }, end: { name: "pointerup" } };
|
|
4547
|
-
|
|
4548
|
-
class st2 extends it2 {
|
|
4549
|
-
constructor(e2) {
|
|
4550
|
-
const { event: t2 } = e2, n2 = U2(t2.target);
|
|
4551
|
-
super(e2, at2, n2);
|
|
4552
|
-
}
|
|
4553
|
-
}
|
|
4554
|
-
st2.activators = [{ eventName: "onPointerDown", handler: (e2, t2) => {
|
|
4555
|
-
let { nativeEvent: n2 } = e2, { onActivation: r2 } = t2;
|
|
4556
|
-
return !(!n2.isPrimary || n2.button !== 0) && (r2 == null || r2({ event: n2 }), true);
|
|
4557
|
-
} }];
|
|
4558
|
-
var ct = { move: { name: "mousemove" }, end: { name: "mouseup" } };
|
|
4559
|
-
var dt;
|
|
4560
|
-
var ut;
|
|
4561
|
-
(ut = dt || (dt = {}))[ut.RightClick = 2] = "RightClick";
|
|
4562
|
-
(class extends it2 {
|
|
4563
|
-
constructor(e2) {
|
|
4564
|
-
super(e2, ct, U2(e2.event.target));
|
|
4565
|
-
}
|
|
4566
|
-
}).activators = [{ eventName: "onMouseDown", handler: (e2, t2) => {
|
|
4567
|
-
let { nativeEvent: n2 } = e2, { onActivation: r2 } = t2;
|
|
4568
|
-
return n2.button !== dt.RightClick && (r2 == null || r2({ event: n2 }), true);
|
|
4569
|
-
} }];
|
|
4570
|
-
var pt2 = { cancel: { name: "touchcancel" }, move: { name: "touchmove" }, end: { name: "touchend" } };
|
|
4571
|
-
var ht2;
|
|
4572
|
-
var gt2;
|
|
4573
|
-
var vt2;
|
|
4574
|
-
var mt2;
|
|
4575
|
-
function ft(e2) {
|
|
4576
|
-
let { acceleration: t2, activator: n2 = ht2.Pointer, canScroll: r2, draggingRect: o2, enabled: s2, interval: c2 = 5, order: d2 = vt2.TreeOrder, pointerCoordinates: u2, scrollableAncestors: h2, scrollableAncestorRects: g2, delta: v2, threshold: m } = e2;
|
|
4577
|
-
const f = function(e3) {
|
|
4578
|
-
let { delta: t3, disabled: n3 } = e3;
|
|
4579
|
-
const r3 = _2(t3);
|
|
4580
|
-
return J2((e4) => {
|
|
4581
|
-
if (n3 || !r3 || !e4)
|
|
4582
|
-
return bt2;
|
|
4583
|
-
const o3 = { x: Math.sign(t3.x - r3.x), y: Math.sign(t3.y - r3.y) };
|
|
4584
|
-
return { x: { [Oe2.Backward]: e4.x[Oe2.Backward] || o3.x === -1, [Oe2.Forward]: e4.x[Oe2.Forward] || o3.x === 1 }, y: { [Oe2.Backward]: e4.y[Oe2.Backward] || o3.y === -1, [Oe2.Forward]: e4.y[Oe2.Forward] || o3.y === 1 } };
|
|
4585
|
-
}, [n3, t3, r3]);
|
|
4586
|
-
}({ delta: v2, disabled: !s2 }), [b, y2] = function() {
|
|
4587
|
-
const e3 = l(null);
|
|
4588
|
-
return [i((t3, n3) => {
|
|
4589
|
-
e3.current = setInterval(t3, n3);
|
|
4590
|
-
}, []), i(() => {
|
|
4591
|
-
e3.current !== null && (clearInterval(e3.current), e3.current = null);
|
|
4592
|
-
}, [])];
|
|
4593
|
-
}(), w2 = l({ x: 0, y: 0 }), x2 = l({ x: 0, y: 0 }), C2 = p(() => {
|
|
4594
|
-
switch (n2) {
|
|
4595
|
-
case ht2.Pointer:
|
|
4596
|
-
return u2 ? { top: u2.y, bottom: u2.y, left: u2.x, right: u2.x } : null;
|
|
4597
|
-
case ht2.DraggableRect:
|
|
4598
|
-
return o2;
|
|
4599
|
-
}
|
|
4600
|
-
}, [n2, o2, u2]), N2 = l(null), S = i(() => {
|
|
4601
|
-
const e3 = N2.current;
|
|
4602
|
-
if (!e3)
|
|
4603
|
-
return;
|
|
4604
|
-
const t3 = w2.current.x * x2.current.x, n3 = w2.current.y * x2.current.y;
|
|
4605
|
-
e3.scrollBy(t3, n3);
|
|
4606
|
-
}, []), E = p(() => d2 === vt2.TreeOrder ? [...h2].reverse() : h2, [d2, h2]);
|
|
4607
|
-
a(() => {
|
|
4608
|
-
if (s2 && h2.length && C2) {
|
|
4609
|
-
for (const e3 of E) {
|
|
4610
|
-
if ((r2 == null ? undefined : r2(e3)) === false)
|
|
4611
|
-
continue;
|
|
4612
|
-
const n3 = h2.indexOf(e3), o3 = g2[n3];
|
|
4613
|
-
if (!o3)
|
|
4614
|
-
continue;
|
|
4615
|
-
const { direction: l2, speed: i2 } = je2(e3, o3, C2, t2, m);
|
|
4616
|
-
for (const e4 of ["x", "y"])
|
|
4617
|
-
f[e4][l2[e4]] || (i2[e4] = 0, l2[e4] = 0);
|
|
4618
|
-
if (i2.x > 0 || i2.y > 0)
|
|
4619
|
-
return y2(), N2.current = e3, b(S, c2), w2.current = i2, void (x2.current = l2);
|
|
4620
|
-
}
|
|
4621
|
-
w2.current = { x: 0, y: 0 }, x2.current = { x: 0, y: 0 }, y2();
|
|
4622
|
-
} else
|
|
4623
|
-
y2();
|
|
4624
|
-
}, [t2, S, r2, y2, s2, c2, JSON.stringify(C2), JSON.stringify(f), b, h2, E, g2, JSON.stringify(m)]);
|
|
4625
|
-
}
|
|
4626
|
-
(class extends it2 {
|
|
4627
|
-
constructor(e2) {
|
|
4628
|
-
super(e2, pt2);
|
|
4629
|
-
}
|
|
4630
|
-
static setup() {
|
|
4631
|
-
return window.addEventListener(pt2.move.name, e2, { capture: false, passive: false }), function() {
|
|
4632
|
-
window.removeEventListener(pt2.move.name, e2);
|
|
4633
|
-
};
|
|
4634
|
-
function e2() {}
|
|
4635
|
-
}
|
|
4636
|
-
}).activators = [{ eventName: "onTouchStart", handler: (e2, t2) => {
|
|
4637
|
-
let { nativeEvent: n2 } = e2, { onActivation: r2 } = t2;
|
|
4638
|
-
const { touches: o2 } = n2;
|
|
4639
|
-
return !(o2.length > 1) && (r2 == null || r2({ event: n2 }), true);
|
|
4640
|
-
} }], (gt2 = ht2 || (ht2 = {}))[gt2.Pointer = 0] = "Pointer", gt2[gt2.DraggableRect = 1] = "DraggableRect", (mt2 = vt2 || (vt2 = {}))[mt2.TreeOrder = 0] = "TreeOrder", mt2[mt2.ReversedTreeOrder = 1] = "ReversedTreeOrder";
|
|
4641
|
-
var bt2 = { x: { [Oe2.Backward]: false, [Oe2.Forward]: false }, y: { [Oe2.Backward]: false, [Oe2.Forward]: false } };
|
|
4642
|
-
var yt2;
|
|
4643
|
-
var wt2;
|
|
4644
|
-
var xt2;
|
|
4645
|
-
(wt2 = yt2 || (yt2 = {}))[wt2.Always = 0] = "Always", wt2[wt2.BeforeDragging = 1] = "BeforeDragging", wt2[wt2.WhileDragging = 2] = "WhileDragging", (xt2 || (xt2 = {})).Optimized = "optimized";
|
|
4646
|
-
var Ct2 = /* @__PURE__ */ new Map;
|
|
4647
|
-
function Nt2(e2, t2) {
|
|
4648
|
-
return J2((n2) => e2 ? n2 || (typeof t2 == "function" ? t2(e2) : e2) : null, [t2, e2]);
|
|
4649
|
-
}
|
|
4650
|
-
function St2(e2) {
|
|
4651
|
-
let { callback: t2, disabled: n2 } = e2;
|
|
4652
|
-
const r2 = Y2(t2), o2 = p(() => {
|
|
4653
|
-
if (n2 || typeof window == "undefined" || window.ResizeObserver === undefined)
|
|
4654
|
-
return;
|
|
4655
|
-
const { ResizeObserver: e3 } = window;
|
|
4656
|
-
return new e3(r2);
|
|
4657
|
-
}, [n2]);
|
|
4658
|
-
return a(() => () => o2 == null ? undefined : o2.disconnect(), [o2]), o2;
|
|
4659
|
-
}
|
|
4660
|
-
function Et2(e2) {
|
|
4661
|
-
return new Xe2(ke2(e2), e2);
|
|
4662
|
-
}
|
|
4663
|
-
function Dt2(e2, t2, n2) {
|
|
4664
|
-
t2 === undefined && (t2 = Et2);
|
|
4665
|
-
const [r2, l2] = o(null);
|
|
4666
|
-
function i2() {
|
|
4667
|
-
l2((r3) => {
|
|
4668
|
-
if (!e2)
|
|
4669
|
-
return null;
|
|
4670
|
-
var o2;
|
|
4671
|
-
if (e2.isConnected === false)
|
|
4672
|
-
return (o2 = r3 != null ? r3 : n2) != null ? o2 : null;
|
|
4673
|
-
const l3 = t2(e2);
|
|
4674
|
-
return JSON.stringify(r3) === JSON.stringify(l3) ? r3 : l3;
|
|
4675
|
-
});
|
|
4676
|
-
}
|
|
4677
|
-
const s2 = function(e3) {
|
|
4678
|
-
let { callback: t3, disabled: n3 } = e3;
|
|
4679
|
-
const r3 = Y2(t3), o2 = p(() => {
|
|
4680
|
-
if (n3 || typeof window == "undefined" || window.MutationObserver === undefined)
|
|
4681
|
-
return;
|
|
4682
|
-
const { MutationObserver: e4 } = window;
|
|
4683
|
-
return new e4(r3);
|
|
4684
|
-
}, [r3, n3]);
|
|
4685
|
-
return a(() => () => o2 == null ? undefined : o2.disconnect(), [o2]), o2;
|
|
4686
|
-
}({ callback(t3) {
|
|
4687
|
-
if (e2)
|
|
4688
|
-
for (const n3 of t3) {
|
|
4689
|
-
const { type: t4, target: r3 } = n3;
|
|
4690
|
-
if (t4 === "childList" && r3 instanceof HTMLElement && r3.contains(e2)) {
|
|
4691
|
-
i2();
|
|
4692
|
-
break;
|
|
4693
|
-
}
|
|
4694
|
-
}
|
|
4695
|
-
} }), c2 = St2({ callback: i2 });
|
|
4696
|
-
return X2(() => {
|
|
4697
|
-
i2(), e2 ? (c2 == null || c2.observe(e2), s2 == null || s2.observe(document.body, { childList: true, subtree: true })) : (c2 == null || c2.disconnect(), s2 == null || s2.disconnect());
|
|
4698
|
-
}, [e2]), r2;
|
|
4699
|
-
}
|
|
4700
|
-
var Rt2 = [];
|
|
4701
|
-
function zt2(e2, t2) {
|
|
4702
|
-
t2 === undefined && (t2 = []);
|
|
4703
|
-
const n2 = l(null);
|
|
4704
|
-
return a(() => {
|
|
4705
|
-
n2.current = null;
|
|
4706
|
-
}, t2), a(() => {
|
|
4707
|
-
const t3 = e2 !== fe2;
|
|
4708
|
-
t3 && !n2.current && (n2.current = e2), !t3 && n2.current && (n2.current = null);
|
|
4709
|
-
}, [e2]), n2.current ? ne2(e2, n2.current) : fe2;
|
|
4710
|
-
}
|
|
4711
|
-
function kt2(e2) {
|
|
4712
|
-
return p(() => e2 ? function(e3) {
|
|
4713
|
-
const { innerWidth: t2, innerHeight: n2 } = e3;
|
|
4714
|
-
return { top: 0, left: 0, right: t2, bottom: n2, width: t2, height: n2 };
|
|
4715
|
-
}(e2) : null, [e2]);
|
|
4716
|
-
}
|
|
4717
|
-
var Lt2 = [];
|
|
4718
|
-
function Mt2(e2) {
|
|
4719
|
-
let { measure: t2 } = e2;
|
|
4720
|
-
const [n2, r2] = o(null), l2 = St2({ callback: i((e3) => {
|
|
4721
|
-
for (const { target: n3 } of e3)
|
|
4722
|
-
if (K2(n3)) {
|
|
4723
|
-
r2((e4) => {
|
|
4724
|
-
const r3 = t2(n3);
|
|
4725
|
-
return e4 ? { ...e4, width: r3.width, height: r3.height } : r3;
|
|
4726
|
-
});
|
|
4727
|
-
break;
|
|
4728
|
-
}
|
|
4729
|
-
}, [t2]) }), a2 = i((e3) => {
|
|
4730
|
-
const n3 = function(e4) {
|
|
4731
|
-
if (!e4)
|
|
4732
|
-
return null;
|
|
4733
|
-
if (e4.children.length > 1)
|
|
4734
|
-
return e4;
|
|
4735
|
-
const t3 = e4.children[0];
|
|
4736
|
-
return K2(t3) ? t3 : e4;
|
|
4737
|
-
}(e3);
|
|
4738
|
-
l2 == null || l2.disconnect(), n3 && (l2 == null || l2.observe(n3)), r2(n3 ? t2(n3) : null);
|
|
4739
|
-
}, [t2, l2]), [s2, c2] = G2(a2);
|
|
4740
|
-
return p(() => ({ nodeRef: s2, rect: n2, setRef: c2 }), [n2, s2, c2]);
|
|
4741
|
-
}
|
|
4742
|
-
var Pt2 = [{ sensor: st2, options: {} }, { sensor: rt2, options: {} }];
|
|
4743
|
-
var At2 = { current: {} };
|
|
4744
|
-
var Tt2 = { draggable: { measure: Le2 }, droppable: { measure: Le2, strategy: yt2.WhileDragging, frequency: xt2.Optimized }, dragOverlay: { measure: ke2 } };
|
|
4745
|
-
|
|
4746
|
-
class $t2 extends Map {
|
|
4747
|
-
get(e2) {
|
|
4748
|
-
var t2;
|
|
4749
|
-
return e2 != null && (t2 = super.get(e2)) != null ? t2 : undefined;
|
|
4750
|
-
}
|
|
4751
|
-
toArray() {
|
|
4752
|
-
return Array.from(this.values());
|
|
4753
|
-
}
|
|
4754
|
-
getEnabled() {
|
|
4755
|
-
return this.toArray().filter((e2) => {
|
|
4756
|
-
let { disabled: t2 } = e2;
|
|
4757
|
-
return !t2;
|
|
4758
|
-
});
|
|
4759
|
-
}
|
|
4760
|
-
getNodeFor(e2) {
|
|
4761
|
-
var t2, n2;
|
|
4762
|
-
return (t2 = (n2 = this.get(e2)) == null ? undefined : n2.node.current) != null ? t2 : undefined;
|
|
4763
|
-
}
|
|
4764
|
-
}
|
|
4765
|
-
var Bt2 = { activatorEvent: null, active: null, activeNode: null, activeNodeRect: null, collisions: null, containerNodeRect: null, draggableNodes: /* @__PURE__ */ new Map, droppableRects: /* @__PURE__ */ new Map, droppableContainers: /* @__PURE__ */ new $t2, over: null, dragOverlay: { nodeRef: { current: null }, rect: null, setRef: me }, scrollableAncestors: [], scrollableAncestorRects: [], measuringConfiguration: Tt2, measureDroppableContainers: me, windowRect: null, measuringScheduled: false };
|
|
4766
|
-
var Ot2 = /* @__PURE__ */ s({ activatorEvent: null, activators: [], active: null, activeNodeRect: null, ariaDescribedById: { draggable: "" }, dispatch: me, draggableNodes: /* @__PURE__ */ new Map, over: null, measureDroppableContainers: me });
|
|
4767
|
-
var Ft2 = /* @__PURE__ */ s(Bt2);
|
|
4768
|
-
function It2() {
|
|
4769
|
-
return { draggable: { active: null, initialCoordinates: { x: 0, y: 0 }, nodes: /* @__PURE__ */ new Map, translate: { x: 0, y: 0 } }, droppable: { containers: new $t2 } };
|
|
4770
|
-
}
|
|
4771
|
-
function Ht2(e2, t2) {
|
|
4772
|
-
switch (t2.type) {
|
|
4773
|
-
case ge2.DragStart:
|
|
4774
|
-
return { ...e2, draggable: { ...e2.draggable, initialCoordinates: t2.initialCoordinates, active: t2.active } };
|
|
4775
|
-
case ge2.DragMove:
|
|
4776
|
-
return e2.draggable.active == null ? e2 : { ...e2, draggable: { ...e2.draggable, translate: { x: t2.coordinates.x - e2.draggable.initialCoordinates.x, y: t2.coordinates.y - e2.draggable.initialCoordinates.y } } };
|
|
4777
|
-
case ge2.DragEnd:
|
|
4778
|
-
case ge2.DragCancel:
|
|
4779
|
-
return { ...e2, draggable: { ...e2.draggable, active: null, initialCoordinates: { x: 0, y: 0 }, translate: { x: 0, y: 0 } } };
|
|
4780
|
-
case ge2.RegisterDroppable: {
|
|
4781
|
-
const { element: n2 } = t2, { id: r2 } = n2, o2 = new $t2(e2.droppable.containers);
|
|
4782
|
-
return o2.set(r2, n2), { ...e2, droppable: { ...e2.droppable, containers: o2 } };
|
|
4783
|
-
}
|
|
4784
|
-
case ge2.SetDroppableDisabled: {
|
|
4785
|
-
const { id: n2, key: r2, disabled: o2 } = t2, l2 = e2.droppable.containers.get(n2);
|
|
4786
|
-
if (!l2 || r2 !== l2.key)
|
|
4787
|
-
return e2;
|
|
4788
|
-
const i2 = new $t2(e2.droppable.containers);
|
|
4789
|
-
return i2.set(n2, { ...l2, disabled: o2 }), { ...e2, droppable: { ...e2.droppable, containers: i2 } };
|
|
4790
|
-
}
|
|
4791
|
-
case ge2.UnregisterDroppable: {
|
|
4792
|
-
const { id: n2, key: r2 } = t2, o2 = e2.droppable.containers.get(n2);
|
|
4793
|
-
if (!o2 || r2 !== o2.key)
|
|
4794
|
-
return e2;
|
|
4795
|
-
const l2 = new $t2(e2.droppable.containers);
|
|
4796
|
-
return l2.delete(n2), { ...e2, droppable: { ...e2.droppable, containers: l2 } };
|
|
4797
|
-
}
|
|
4798
|
-
default:
|
|
4799
|
-
return e2;
|
|
4800
|
-
}
|
|
4801
|
-
}
|
|
4802
|
-
function Wt2(e2) {
|
|
4803
|
-
let { disabled: t2 } = e2;
|
|
4804
|
-
const { active: n2, activatorEvent: r2, draggableNodes: o2 } = c(Ot2), l2 = _2(r2), i2 = _2(n2 == null ? undefined : n2.id);
|
|
4805
|
-
return a(() => {
|
|
4806
|
-
if (!t2 && !r2 && l2 && i2 != null) {
|
|
4807
|
-
if (!re2(l2))
|
|
4808
|
-
return;
|
|
4809
|
-
if (document.activeElement === l2.target)
|
|
4810
|
-
return;
|
|
4811
|
-
const e3 = o2.get(i2);
|
|
4812
|
-
if (!e3)
|
|
4813
|
-
return;
|
|
4814
|
-
const { activatorNode: t3, node: n3 } = e3;
|
|
4815
|
-
if (!t3.current && !n3.current)
|
|
4816
|
-
return;
|
|
4817
|
-
requestAnimationFrame(() => {
|
|
4818
|
-
for (const e4 of [t3.current, n3.current]) {
|
|
4819
|
-
if (!e4)
|
|
4820
|
-
continue;
|
|
4821
|
-
const t4 = ie2(e4);
|
|
4822
|
-
if (t4) {
|
|
4823
|
-
t4.focus();
|
|
4824
|
-
break;
|
|
4825
|
-
}
|
|
4826
|
-
}
|
|
4827
|
-
});
|
|
4828
|
-
}
|
|
4829
|
-
}, [r2, t2, o2, i2, l2]), null;
|
|
4830
|
-
}
|
|
4831
|
-
var jt2 = /* @__PURE__ */ s({ ...fe2, scaleX: 1, scaleY: 1 });
|
|
4832
|
-
var Kt;
|
|
4833
|
-
var qt2;
|
|
4834
|
-
(qt2 = Kt || (Kt = {}))[qt2.Uninitialized = 0] = "Uninitialized", qt2[qt2.Initializing = 1] = "Initializing", qt2[qt2.Initialized = 2] = "Initialized";
|
|
4835
|
-
var Ut2 = /* @__PURE__ */ g(function(e2) {
|
|
4836
|
-
var t2, n2, s2, c2;
|
|
4837
|
-
let { id: d2, accessibility: u2, autoScroll: h2 = true, children: g2, sensors: m = Pt2, collisionDetection: f = Se2, measuring: b, modifiers: w2, ...x2 } = e2;
|
|
4838
|
-
const C2 = v(Ht2, undefined, It2), [N2, S] = C2, [E, D3] = function() {
|
|
4839
|
-
const [e3] = o(() => /* @__PURE__ */ new Set), t3 = i((t4) => (e3.add(t4), () => e3.delete(t4)), [e3]);
|
|
4840
|
-
return [i((t4) => {
|
|
4841
|
-
let { type: n3, event: r2 } = t4;
|
|
4842
|
-
e3.forEach((e4) => {
|
|
4843
|
-
var t5;
|
|
4844
|
-
return (t5 = e4[n3]) == null ? undefined : t5.call(e4, r2);
|
|
4845
|
-
});
|
|
4846
|
-
}, [e3]), t3];
|
|
4847
|
-
}(), [R2, z2] = o(Kt.Uninitialized), k2 = R2 === Kt.Initialized, { draggable: { active: L3, nodes: M2, translate: P }, droppable: { containers: A2 } } = N2, T3 = L3 != null ? M2.get(L3) : null, $3 = l({ initial: null, translated: null }), B2 = p(() => {
|
|
4848
|
-
var e3;
|
|
4849
|
-
return L3 != null ? { id: L3, data: (e3 = T3 == null ? undefined : T3.data) != null ? e3 : At2, rect: $3 } : null;
|
|
4850
|
-
}, [L3, T3]), O = l(null), [I3, H2] = o(null), [j3, K3] = o(null), q3 = V2(x2, Object.values(x2)), U3 = Z2("DndDescribedBy", d2), Y3 = p(() => A2.getEnabled(), [A2]), G3 = p(() => ({ draggable: { ...Tt2.draggable, ..._3 == null ? undefined : _3.draggable }, droppable: { ...Tt2.droppable, ..._3 == null ? undefined : _3.droppable }, dragOverlay: { ...Tt2.dragOverlay, ..._3 == null ? undefined : _3.dragOverlay } }), [(_3 = b) == null ? undefined : _3.draggable, _3 == null ? undefined : _3.droppable, _3 == null ? undefined : _3.dragOverlay]);
|
|
4851
|
-
var _3;
|
|
4852
|
-
const { droppableRects: Q3, measureDroppableContainers: ee2, measuringScheduled: ne3 } = function(e3, t3) {
|
|
4853
|
-
let { dragging: n3, dependencies: r2, config: s3 } = t3;
|
|
4854
|
-
const [c3, d3] = o(null), { frequency: u3, measure: p2, strategy: h3 } = s3, g3 = l(e3), v2 = function() {
|
|
4855
|
-
switch (h3) {
|
|
4856
|
-
case yt2.Always:
|
|
4857
|
-
return false;
|
|
4858
|
-
case yt2.BeforeDragging:
|
|
4859
|
-
return n3;
|
|
4860
|
-
default:
|
|
4861
|
-
return !n3;
|
|
4862
|
-
}
|
|
4863
|
-
}(), m2 = V2(v2), f2 = i(function(e4) {
|
|
4864
|
-
e4 === undefined && (e4 = []), m2.current || d3((t4) => t4 === null ? e4 : t4.concat(e4.filter((e5) => !t4.includes(e5))));
|
|
4865
|
-
}, [m2]), b2 = l(null), y2 = J2((t4) => {
|
|
4866
|
-
if (v2 && !n3)
|
|
4867
|
-
return Ct2;
|
|
4868
|
-
if (!t4 || t4 === Ct2 || g3.current !== e3 || c3 != null) {
|
|
4869
|
-
const t5 = /* @__PURE__ */ new Map;
|
|
4870
|
-
for (let n4 of e3) {
|
|
4871
|
-
if (!n4)
|
|
4872
|
-
continue;
|
|
4873
|
-
if (c3 && c3.length > 0 && !c3.includes(n4.id) && n4.rect.current) {
|
|
4874
|
-
t5.set(n4.id, n4.rect.current);
|
|
4875
|
-
continue;
|
|
4876
|
-
}
|
|
4877
|
-
const e4 = n4.node.current, r3 = e4 ? new Xe2(p2(e4), e4) : null;
|
|
4878
|
-
n4.rect.current = r3, r3 && t5.set(n4.id, r3);
|
|
4879
|
-
}
|
|
4880
|
-
return t5;
|
|
4881
|
-
}
|
|
4882
|
-
return t4;
|
|
4883
|
-
}, [e3, c3, n3, v2, p2]);
|
|
4884
|
-
return a(() => {
|
|
4885
|
-
g3.current = e3;
|
|
4886
|
-
}, [e3]), a(() => {
|
|
4887
|
-
v2 || f2();
|
|
4888
|
-
}, [n3, v2]), a(() => {
|
|
4889
|
-
c3 && c3.length > 0 && d3(null);
|
|
4890
|
-
}, [JSON.stringify(c3)]), a(() => {
|
|
4891
|
-
v2 || typeof u3 != "number" || b2.current !== null || (b2.current = setTimeout(() => {
|
|
4892
|
-
f2(), b2.current = null;
|
|
4893
|
-
}, u3));
|
|
4894
|
-
}, [u3, v2, f2, ...r2]), { droppableRects: y2, measureDroppableContainers: f2, measuringScheduled: c3 != null };
|
|
4895
|
-
}(Y3, { dragging: k2, dependencies: [P.x, P.y], config: G3.droppable }), re3 = function(e3, t3) {
|
|
4896
|
-
const n3 = t3 != null ? e3.get(t3) : undefined, r2 = n3 ? n3.node.current : null;
|
|
4897
|
-
return J2((e4) => {
|
|
4898
|
-
var n4;
|
|
4899
|
-
return t3 == null ? null : (n4 = r2 != null ? r2 : e4) != null ? n4 : null;
|
|
4900
|
-
}, [r2, t3]);
|
|
4901
|
-
}(M2, L3), le2 = p(() => j3 ? oe2(j3) : null, [j3]), ie3 = function() {
|
|
4902
|
-
const e3 = (I3 == null ? undefined : I3.autoScrollEnabled) === false, t3 = typeof h2 == "object" ? h2.enabled === false : h2 === false, n3 = k2 && !e3 && !t3;
|
|
4903
|
-
if (typeof h2 == "object")
|
|
4904
|
-
return { ...h2, enabled: n3 };
|
|
4905
|
-
return { enabled: n3 };
|
|
4906
|
-
}(), ae2 = function(e3, t3) {
|
|
4907
|
-
return Nt2(e3, t3);
|
|
4908
|
-
}(re3, G3.draggable.measure);
|
|
4909
|
-
(function(e3) {
|
|
4910
|
-
let { activeNode: t3, measure: n3, initialRect: r2, config: o2 = true } = e3;
|
|
4911
|
-
const i2 = l(false), { x: a2, y: s3 } = typeof o2 == "boolean" ? { x: o2, y: o2 } : o2;
|
|
4912
|
-
X2(() => {
|
|
4913
|
-
if (!a2 && !s3 || !t3)
|
|
4914
|
-
return void (i2.current = false);
|
|
4915
|
-
if (i2.current || !r2)
|
|
4916
|
-
return;
|
|
4917
|
-
const e4 = t3 == null ? undefined : t3.node.current;
|
|
4918
|
-
if (!e4 || e4.isConnected === false)
|
|
4919
|
-
return;
|
|
4920
|
-
const o3 = Ee2(n3(e4), r2);
|
|
4921
|
-
if (a2 || (o3.x = 0), s3 || (o3.y = 0), i2.current = true, Math.abs(o3.x) > 0 || Math.abs(o3.y) > 0) {
|
|
4922
|
-
const t4 = Pe2(e4);
|
|
4923
|
-
t4 && t4.scrollBy({ top: o3.y, left: o3.x });
|
|
4924
|
-
}
|
|
4925
|
-
}, [t3, a2, s3, r2, n3]);
|
|
4926
|
-
})({ activeNode: L3 != null ? M2.get(L3) : null, config: ie3.layoutShiftCompensation, initialRect: ae2, measure: G3.draggable.measure });
|
|
4927
|
-
const se3 = Dt2(re3, G3.draggable.measure, ae2), ce3 = Dt2(re3 ? re3.parentElement : null), ue3 = l({ activatorEvent: null, active: null, activeNode: re3, collisionRect: null, collisions: null, droppableRects: Q3, draggableNodes: M2, draggingNode: null, draggingNodeRect: null, droppableContainers: A2, over: null, scrollableAncestors: [], scrollAdjustedTranslate: null }), pe2 = A2.getNodeFor((t2 = ue3.current.over) == null ? undefined : t2.id), ve3 = Mt2({ measure: G3.dragOverlay.measure }), me2 = (n2 = ve3.nodeRef.current) != null ? n2 : re3, be3 = k2 ? (s2 = ve3.rect) != null ? s2 : se3 : null, ye3 = Boolean(ve3.nodeRef.current && ve3.rect), we3 = Ee2(xe3 = ye3 ? null : se3, Nt2(xe3));
|
|
4928
|
-
var xe3;
|
|
4929
|
-
const Ce2 = kt2(me2 ? W2(me2) : null), Ne3 = function(e3) {
|
|
4930
|
-
const t3 = l(e3), n3 = J2((n4) => e3 ? n4 && n4 !== Rt2 && e3 && t3.current && e3.parentNode === t3.current.parentNode ? n4 : Me2(e3) : Rt2, [e3]);
|
|
4931
|
-
return a(() => {
|
|
4932
|
-
t3.current = e3;
|
|
4933
|
-
}, [e3]), n3;
|
|
4934
|
-
}(k2 ? pe2 != null ? pe2 : re3 : null), De3 = function(e3, t3) {
|
|
4935
|
-
t3 === undefined && (t3 = ke2);
|
|
4936
|
-
const [n3] = e3, r2 = kt2(n3 ? W2(n3) : null), [l2, i2] = o(Lt2);
|
|
4937
|
-
function a2() {
|
|
4938
|
-
i2(() => e3.length ? e3.map((e4) => Ie2(e4) ? r2 : new Xe2(t3(e4), e4)) : Lt2);
|
|
4939
|
-
}
|
|
4940
|
-
const s3 = St2({ callback: a2 });
|
|
4941
|
-
return X2(() => {
|
|
4942
|
-
s3 == null || s3.disconnect(), a2(), e3.forEach((e4) => s3 == null ? undefined : s3.observe(e4));
|
|
4943
|
-
}, [e3]), l2;
|
|
4944
|
-
}(Ne3), ze3 = function(e3, t3) {
|
|
4945
|
-
let { transform: n3, ...r2 } = t3;
|
|
4946
|
-
return e3 != null && e3.length ? e3.reduce((e4, t4) => t4({ transform: e4, ...r2 }), n3) : n3;
|
|
4947
|
-
}(w2, { transform: { x: P.x - we3.x, y: P.y - we3.y, scaleX: 1, scaleY: 1 }, activatorEvent: j3, active: B2, activeNodeRect: se3, containerNodeRect: ce3, draggingNodeRect: be3, over: ue3.current.over, overlayNodeRect: ve3.rect, scrollableAncestors: Ne3, scrollableAncestorRects: De3, windowRect: Ce2 }), Le3 = le2 ? te2(le2, P) : null, Te3 = function(e3) {
|
|
4948
|
-
const [t3, n3] = o(null), r2 = l(e3), s3 = i((e4) => {
|
|
4949
|
-
const t4 = Ae2(e4.target);
|
|
4950
|
-
t4 && n3((e5) => e5 ? (e5.set(t4, Be2(t4)), new Map(e5)) : null);
|
|
4951
|
-
}, []);
|
|
4952
|
-
return a(() => {
|
|
4953
|
-
const t4 = r2.current;
|
|
4954
|
-
if (e3 !== t4) {
|
|
4955
|
-
o2(t4);
|
|
4956
|
-
const l2 = e3.map((e4) => {
|
|
4957
|
-
const t5 = Ae2(e4);
|
|
4958
|
-
return t5 ? (t5.addEventListener("scroll", s3, { passive: true }), [t5, Be2(t5)]) : null;
|
|
4959
|
-
}).filter((e4) => e4 != null);
|
|
4960
|
-
n3(l2.length ? new Map(l2) : null), r2.current = e3;
|
|
4961
|
-
}
|
|
4962
|
-
return () => {
|
|
4963
|
-
o2(e3), o2(t4);
|
|
4964
|
-
};
|
|
4965
|
-
function o2(e4) {
|
|
4966
|
-
e4.forEach((e5) => {
|
|
4967
|
-
const t5 = Ae2(e5);
|
|
4968
|
-
t5 == null || t5.removeEventListener("scroll", s3);
|
|
4969
|
-
});
|
|
4970
|
-
}
|
|
4971
|
-
}, [s3, e3]), p(() => e3.length ? t3 ? Array.from(t3.values()).reduce((e4, t4) => te2(e4, t4), fe2) : qe2(e3) : fe2, [e3, t3]);
|
|
4972
|
-
}(Ne3), $e3 = zt2(Te3), Oe3 = zt2(Te3, [se3]), Fe3 = te2(ze3, $e3), He3 = be3 ? Re(be3, ze3) : null, We3 = B2 && He3 ? f({ active: B2, collisionRect: He3, droppableRects: Q3, droppableContainers: Y3, pointerCoordinates: Le3 }) : null, je3 = function(e3, t3) {
|
|
4973
|
-
if (!e3 || e3.length === 0)
|
|
4974
|
-
return null;
|
|
4975
|
-
const [n3] = e3;
|
|
4976
|
-
return n3[t3];
|
|
4977
|
-
}(We3, "id"), [Ke3, Ue3] = o(null), Ye3 = function(e3, t3, n3) {
|
|
4978
|
-
return { ...e3, scaleX: t3 && n3 ? t3.width / n3.width : 1, scaleY: t3 && n3 ? t3.height / n3.height : 1 };
|
|
4979
|
-
}(ye3 ? ze3 : te2(ze3, Oe3), (c2 = Ke3 == null ? undefined : Ke3.rect) != null ? c2 : null, se3), Ve3 = l(null), Je3 = i((e3, t3) => {
|
|
4980
|
-
let { sensor: n3, options: r2 } = t3;
|
|
4981
|
-
if (O.current == null)
|
|
4982
|
-
return;
|
|
4983
|
-
const o2 = M2.get(O.current);
|
|
4984
|
-
if (!o2)
|
|
4985
|
-
return;
|
|
4986
|
-
const l2 = e3.nativeEvent, i2 = new n3({ active: O.current, activeNode: o2, event: l2, options: r2, context: ue3, onAbort(e4) {
|
|
4987
|
-
if (!M2.get(e4))
|
|
4988
|
-
return;
|
|
4989
|
-
const { onDragAbort: t4 } = q3.current, n4 = { id: e4 };
|
|
4990
|
-
t4 == null || t4(n4), E({ type: "onDragAbort", event: n4 });
|
|
4991
|
-
}, onPending(e4, t4, n4, r3) {
|
|
4992
|
-
if (!M2.get(e4))
|
|
4993
|
-
return;
|
|
4994
|
-
const { onDragPending: o3 } = q3.current, l3 = { id: e4, constraint: t4, initialCoordinates: n4, offset: r3 };
|
|
4995
|
-
o3 == null || o3(l3), E({ type: "onDragPending", event: l3 });
|
|
4996
|
-
}, onStart(e4) {
|
|
4997
|
-
const t4 = O.current;
|
|
4998
|
-
if (t4 == null)
|
|
4999
|
-
return;
|
|
5000
|
-
const n4 = M2.get(t4);
|
|
5001
|
-
if (!n4)
|
|
5002
|
-
return;
|
|
5003
|
-
const { onDragStart: r3 } = q3.current, o3 = { activatorEvent: l2, active: { id: t4, data: n4.data, rect: $3 } };
|
|
5004
|
-
y(() => {
|
|
5005
|
-
r3 == null || r3(o3), z2(Kt.Initializing), S({ type: ge2.DragStart, initialCoordinates: e4, active: t4 }), E({ type: "onDragStart", event: o3 }), H2(Ve3.current), K3(l2);
|
|
5006
|
-
});
|
|
5007
|
-
}, onMove(e4) {
|
|
5008
|
-
S({ type: ge2.DragMove, coordinates: e4 });
|
|
5009
|
-
}, onEnd: a2(ge2.DragEnd), onCancel: a2(ge2.DragCancel) });
|
|
5010
|
-
function a2(e4) {
|
|
5011
|
-
return async function() {
|
|
5012
|
-
const { active: t4, collisions: n4, over: r3, scrollAdjustedTranslate: o3 } = ue3.current;
|
|
5013
|
-
let i3 = null;
|
|
5014
|
-
if (t4 && o3) {
|
|
5015
|
-
const { cancelDrop: a3 } = q3.current;
|
|
5016
|
-
if (i3 = { activatorEvent: l2, active: t4, collisions: n4, delta: o3, over: r3 }, e4 === ge2.DragEnd && typeof a3 == "function") {
|
|
5017
|
-
await Promise.resolve(a3(i3)) && (e4 = ge2.DragCancel);
|
|
5018
|
-
}
|
|
5019
|
-
}
|
|
5020
|
-
O.current = null, y(() => {
|
|
5021
|
-
S({ type: e4 }), z2(Kt.Uninitialized), Ue3(null), H2(null), K3(null), Ve3.current = null;
|
|
5022
|
-
const t5 = e4 === ge2.DragEnd ? "onDragEnd" : "onDragCancel";
|
|
5023
|
-
if (i3) {
|
|
5024
|
-
const e5 = q3.current[t5];
|
|
5025
|
-
e5 == null || e5(i3), E({ type: t5, event: i3 });
|
|
5026
|
-
}
|
|
5027
|
-
});
|
|
5028
|
-
};
|
|
5029
|
-
}
|
|
5030
|
-
Ve3.current = i2;
|
|
5031
|
-
}, [M2]), Ge3 = function(e3, t3) {
|
|
5032
|
-
return p(() => e3.reduce((e4, n3) => {
|
|
5033
|
-
const { sensor: r2 } = n3;
|
|
5034
|
-
return [...e4, ...r2.activators.map((e5) => ({ eventName: e5.eventName, handler: t3(e5.handler, n3) }))];
|
|
5035
|
-
}, []), [e3, t3]);
|
|
5036
|
-
}(m, i((e3, t3) => (n3, r2) => {
|
|
5037
|
-
const o2 = n3.nativeEvent, l2 = M2.get(r2);
|
|
5038
|
-
if (O.current !== null || !l2 || o2.dndKit || o2.defaultPrevented)
|
|
5039
|
-
return;
|
|
5040
|
-
const i2 = { active: l2 };
|
|
5041
|
-
e3(n3, t3.options, i2) === true && (o2.dndKit = { capturedBy: t3.sensor }, O.current = r2, Je3(n3, t3));
|
|
5042
|
-
}, [M2, Je3]));
|
|
5043
|
-
(function(e3) {
|
|
5044
|
-
a(() => {
|
|
5045
|
-
if (!F)
|
|
5046
|
-
return;
|
|
5047
|
-
const t3 = e3.map((e4) => {
|
|
5048
|
-
let { sensor: t4 } = e4;
|
|
5049
|
-
return t4.setup == null ? undefined : t4.setup();
|
|
5050
|
-
});
|
|
5051
|
-
return () => {
|
|
5052
|
-
for (const e4 of t3)
|
|
5053
|
-
e4 == null || e4();
|
|
5054
|
-
};
|
|
5055
|
-
}, e3.map((e4) => {
|
|
5056
|
-
let { sensor: t3 } = e4;
|
|
5057
|
-
return t3;
|
|
5058
|
-
}));
|
|
5059
|
-
})(m), X2(() => {
|
|
5060
|
-
se3 && R2 === Kt.Initializing && z2(Kt.Initialized);
|
|
5061
|
-
}, [se3, R2]), a(() => {
|
|
5062
|
-
const { onDragMove: e3 } = q3.current, { active: t3, activatorEvent: n3, collisions: r2, over: o2 } = ue3.current;
|
|
5063
|
-
if (!t3 || !n3)
|
|
5064
|
-
return;
|
|
5065
|
-
const l2 = { active: t3, activatorEvent: n3, collisions: r2, delta: { x: Fe3.x, y: Fe3.y }, over: o2 };
|
|
5066
|
-
y(() => {
|
|
5067
|
-
e3 == null || e3(l2), E({ type: "onDragMove", event: l2 });
|
|
5068
|
-
});
|
|
5069
|
-
}, [Fe3.x, Fe3.y]), a(() => {
|
|
5070
|
-
const { active: e3, activatorEvent: t3, collisions: n3, droppableContainers: r2, scrollAdjustedTranslate: o2 } = ue3.current;
|
|
5071
|
-
if (!e3 || O.current == null || !t3 || !o2)
|
|
5072
|
-
return;
|
|
5073
|
-
const { onDragOver: l2 } = q3.current, i2 = r2.get(je3), a2 = i2 && i2.rect.current ? { id: i2.id, rect: i2.rect.current, data: i2.data, disabled: i2.disabled } : null, s3 = { active: e3, activatorEvent: t3, collisions: n3, delta: { x: o2.x, y: o2.y }, over: a2 };
|
|
5074
|
-
y(() => {
|
|
5075
|
-
Ue3(a2), l2 == null || l2(s3), E({ type: "onDragOver", event: s3 });
|
|
5076
|
-
});
|
|
5077
|
-
}, [je3]), X2(() => {
|
|
5078
|
-
ue3.current = { activatorEvent: j3, active: B2, activeNode: re3, collisionRect: He3, collisions: We3, droppableRects: Q3, draggableNodes: M2, draggingNode: me2, draggingNodeRect: be3, droppableContainers: A2, over: Ke3, scrollableAncestors: Ne3, scrollAdjustedTranslate: Fe3 }, $3.current = { initial: be3, translated: He3 };
|
|
5079
|
-
}, [B2, re3, We3, He3, M2, me2, be3, Q3, A2, Ke3, Ne3, Fe3]), ft({ ...ie3, delta: P, draggingRect: He3, pointerCoordinates: Le3, scrollableAncestors: Ne3, scrollableAncestorRects: De3 });
|
|
5080
|
-
const _e3 = p(() => ({ active: B2, activeNode: re3, activeNodeRect: se3, activatorEvent: j3, collisions: We3, containerNodeRect: ce3, dragOverlay: ve3, draggableNodes: M2, droppableContainers: A2, droppableRects: Q3, over: Ke3, measureDroppableContainers: ee2, scrollableAncestors: Ne3, scrollableAncestorRects: De3, measuringConfiguration: G3, measuringScheduled: ne3, windowRect: Ce2 }), [B2, re3, se3, j3, We3, ce3, ve3, M2, A2, Q3, Ke3, ee2, Ne3, De3, G3, ne3, Ce2]), Qe3 = p(() => ({ activatorEvent: j3, activators: Ge3, active: B2, activeNodeRect: se3, ariaDescribedById: { draggable: U3 }, dispatch: S, draggableNodes: M2, over: Ke3, measureDroppableContainers: ee2 }), [j3, Ge3, B2, se3, S, U3, M2, Ke3, ee2]);
|
|
5081
|
-
return r.createElement(de2.Provider, { value: D3 }, r.createElement(Ot2.Provider, { value: Qe3 }, r.createElement(Ft2.Provider, { value: _e3 }, r.createElement(jt2.Provider, { value: Ye3 }, g2)), r.createElement(Wt2, { disabled: (u2 == null ? undefined : u2.restoreFocus) === false })), r.createElement(he2, { ...u2, hiddenTextDescribedById: U3 }));
|
|
5082
|
-
});
|
|
5083
|
-
var Xt2 = /* @__PURE__ */ s(null);
|
|
5084
|
-
var Yt2 = "button";
|
|
5085
|
-
function Vt2(e2) {
|
|
5086
|
-
let { id: t2, data: n2, disabled: r2 = false, attributes: o2 } = e2;
|
|
5087
|
-
const l2 = Z2("Draggable"), { activators: i2, activatorEvent: a2, active: s2, activeNodeRect: d2, ariaDescribedById: u2, draggableNodes: h2, over: g2 } = c(Ot2), { role: v2 = Yt2, roleDescription: m = "draggable", tabIndex: f = 0 } = o2 != null ? o2 : {}, b = (s2 == null ? undefined : s2.id) === t2, y2 = c(b ? jt2 : Xt2), [w2, x2] = G2(), [C2, N2] = G2(), S = function(e3, t3) {
|
|
5088
|
-
return p(() => e3.reduce((e4, n3) => {
|
|
5089
|
-
let { eventName: r3, handler: o3 } = n3;
|
|
5090
|
-
return e4[r3] = (e5) => {
|
|
5091
|
-
o3(e5, t3);
|
|
5092
|
-
}, e4;
|
|
5093
|
-
}, {}), [e3, t3]);
|
|
5094
|
-
}(i2, t2), E = V2(n2);
|
|
5095
|
-
X2(() => (h2.set(t2, { id: t2, key: l2, node: w2, activatorNode: C2, data: E }), () => {
|
|
5096
|
-
const e3 = h2.get(t2);
|
|
5097
|
-
e3 && e3.key === l2 && h2.delete(t2);
|
|
5098
|
-
}), [h2, t2]);
|
|
5099
|
-
return { active: s2, activatorEvent: a2, activeNodeRect: d2, attributes: p(() => ({ role: v2, tabIndex: f, "aria-disabled": r2, "aria-pressed": !(!b || v2 !== Yt2) || undefined, "aria-roledescription": m, "aria-describedby": u2.draggable }), [r2, v2, f, b, m, u2.draggable]), isDragging: b, listeners: r2 ? undefined : S, node: w2, over: g2, setNodeRef: x2, setActivatorNodeRef: N2, transform: y2 };
|
|
5100
|
-
}
|
|
5101
|
-
var Jt2 = { timeout: 25 };
|
|
5102
|
-
var Gt2 = ({ slotPosition: n2, isEditing: r2, isDragging: o2, children: s2 }) => {
|
|
5103
|
-
const { attributes: d2, listeners: u2, setNodeRef: p2, transform: h2 } = Vt2({ id: `slot-${n2}`, data: { slotPosition: n2 }, disabled: !r2 }), { setNodeRef: g2, isOver: v2 } = function(e2) {
|
|
5104
|
-
let { data: t2, disabled: n3 = false, id: r3, resizeObserverConfig: o3 } = e2;
|
|
5105
|
-
const s3 = Z2("Droppable"), { active: d3, dispatch: u3, over: p3, measureDroppableContainers: h3 } = c(Ot2), g3 = l({ disabled: n3 }), v3 = l(false), m2 = l(null), f2 = l(null), { disabled: b, updateMeasurementsFor: y2, timeout: w2 } = { ...Jt2, ...o3 }, x2 = V2(y2 != null ? y2 : r3), C2 = St2({ callback: i(() => {
|
|
5106
|
-
v3.current ? (f2.current != null && clearTimeout(f2.current), f2.current = setTimeout(() => {
|
|
5107
|
-
h3(Array.isArray(x2.current) ? x2.current : [x2.current]), f2.current = null;
|
|
5108
|
-
}, w2)) : v3.current = true;
|
|
5109
|
-
}, [w2]), disabled: b || !d3 }), N2 = i((e3, t3) => {
|
|
5110
|
-
C2 && (t3 && (C2.unobserve(t3), v3.current = false), e3 && C2.observe(e3));
|
|
5111
|
-
}, [C2]), [S, E] = G2(N2), D3 = V2(t2);
|
|
5112
|
-
return a(() => {
|
|
5113
|
-
C2 && S.current && (C2.disconnect(), v3.current = false, C2.observe(S.current));
|
|
5114
|
-
}, [S, C2]), a(() => (u3({ type: ge2.RegisterDroppable, element: { id: r3, key: s3, disabled: n3, node: S, rect: m2, data: D3 } }), () => u3({ type: ge2.UnregisterDroppable, key: s3, id: r3 })), [r3]), a(() => {
|
|
5115
|
-
n3 !== g3.current.disabled && (u3({ type: ge2.SetDroppableDisabled, id: r3, key: s3, disabled: n3 }), g3.current.disabled = n3);
|
|
5116
|
-
}, [r3, s3, n3, u3]), { active: d3, rect: m2, isOver: (p3 == null ? undefined : p3.id) === r3, node: S, over: p3, setNodeRef: E };
|
|
5117
|
-
}({ id: `drop-${n2}`, data: { slotPosition: n2 } }), m = { position: "relative", height: "100%", width: "100%", transform: h2 ? `translate3d(${h2.x}px, ${h2.y}px, 0)` : undefined }, f = i((e2) => {
|
|
5118
|
-
p2(e2), g2(e2);
|
|
5119
|
-
}, [p2, g2]);
|
|
5120
|
-
return t("div", { ref: f, style: m, className: `slot-with-overlay ${r2 ? "edit-mode" : ""} ${o2 ? "dragging" : ""} ${v2 ? "drag-over" : ""}`, children: [s2, r2 && /* @__PURE__ */ t("div", { className: "slot-edit-overlay", ...d2, ...u2, children: [
|
|
5121
|
-
/* @__PURE__ */ e("div", { className: "drag-indicator", children: "⋮⋮" }),
|
|
5122
|
-
/* @__PURE__ */ e("div", { className: "slot-position-label", children: n2.toUpperCase() })
|
|
5123
|
-
] })] });
|
|
5124
|
-
};
|
|
5125
|
-
var _t2 = d(({ isEditMode: n2, onLayoutChange: r2, panels: l2, layout: s2, ...c2 }, d2) => {
|
|
5126
|
-
const [u2, h2] = o(null), [g2, v2] = o({ x: 0, y: 0 }), m = function() {
|
|
5127
|
-
for (var e2 = arguments.length, t2 = new Array(e2), n3 = 0;n3 < e2; n3++)
|
|
5128
|
-
t2[n3] = arguments[n3];
|
|
5129
|
-
return p(() => [...t2].filter((e3) => e3 != null), [...t2]);
|
|
5130
|
-
}(p(() => ({ sensor: f, options: b != null ? b : {} }), [f = st2, b = { activationConstraint: { distance: 8 } }]));
|
|
5131
|
-
var f, b;
|
|
5132
|
-
const y2 = i((e2) => {
|
|
5133
|
-
const t2 = e2.active.id;
|
|
5134
|
-
if (t2.startsWith("slot-")) {
|
|
5135
|
-
const e3 = t2.replace("slot-", "");
|
|
5136
|
-
h2(e3), v2({ x: 0, y: 0 });
|
|
5137
|
-
}
|
|
5138
|
-
}, []), w2 = i((e2) => {
|
|
5139
|
-
const { delta: t2 } = e2;
|
|
5140
|
-
v2({ x: t2.x, y: t2.y });
|
|
5141
|
-
}, []), x2 = i((e2) => {
|
|
5142
|
-
const { active: t2, over: n3 } = e2;
|
|
5143
|
-
if (h2(null), v2({ x: 0, y: 0 }), !n3)
|
|
5144
|
-
return;
|
|
5145
|
-
const o2 = t2.id, l3 = n3.id, i2 = o2.replace("slot-", ""), a2 = l3.replace("drop-", "");
|
|
5146
|
-
if (i2 === a2)
|
|
5147
|
-
return;
|
|
5148
|
-
const c3 = { ...s2 }, d3 = c3[i2];
|
|
5149
|
-
c3[i2] = c3[a2], c3[a2] = d3, r2 && r2(c3);
|
|
5150
|
-
}, [s2, r2]);
|
|
5151
|
-
a(() => {
|
|
5152
|
-
if (!u2 || !n2)
|
|
5153
|
-
return;
|
|
5154
|
-
const e2 = document.querySelector(`[data-slot="${u2}"]`);
|
|
5155
|
-
return e2 && (e2.setAttribute("data-dragging", "true"), e2.style.setProperty("transform", `scale(0.95) translate(${g2.x}px, ${g2.y}px)`, "important"), e2.style.setProperty("z-index", "1000", "important"), e2.style.setProperty("transition", "none", "important"), e2.style.setProperty("opacity", "0.95", "important"), e2.style.setProperty("box-shadow", "0 12px 24px rgba(0, 0, 0, 0.25)", "important")), () => {
|
|
5156
|
-
e2 && (e2.removeAttribute("data-dragging"), e2.style.removeProperty("transform"), e2.style.removeProperty("z-index"), e2.style.removeProperty("transition"), e2.style.removeProperty("opacity"), e2.style.removeProperty("box-shadow"));
|
|
5157
|
-
};
|
|
5158
|
-
}, [u2, g2, n2]);
|
|
5159
|
-
return e(Ut2, { sensors: m, collisionDetection: Ce, onDragStart: y2, onDragMove: w2, onDragEnd: x2, children: /* @__PURE__ */ t("div", { className: "editable-panel-layout " + (n2 ? "edit-mode-active" : ""), children: [
|
|
5160
|
-
/* @__PURE__ */ e(T2, { ref: d2, ...c2, panels: l2, layout: s2, slotDataAttributes: { left: { "data-slot": "left", "data-edit-mode": n2 ? "true" : "false" }, middle: { "data-slot": "middle", "data-edit-mode": n2 ? "true" : "false" }, right: { "data-slot": "right", "data-edit-mode": n2 ? "true" : "false" } } }),
|
|
5161
|
-
n2 && /* @__PURE__ */ e(Qt, { layout: s2, activeSlot: u2, onDragStart: () => {}, onDragEnd: () => {} })
|
|
5162
|
-
] }) });
|
|
5163
|
-
});
|
|
5164
|
-
_t2.displayName = "EditableConfigurablePanelLayout";
|
|
5165
|
-
var Qt = ({ layout: t2, activeSlot: n2 }) => {
|
|
5166
|
-
const [l2, i2] = o(/* @__PURE__ */ new Map);
|
|
5167
|
-
return r.useEffect(() => {
|
|
5168
|
-
const e2 = () => {
|
|
5169
|
-
const e3 = /* @__PURE__ */ new Map;
|
|
5170
|
-
["left", "middle", "right"].forEach((t4) => {
|
|
5171
|
-
const n3 = document.querySelector(`[data-slot="${t4}"]`);
|
|
5172
|
-
if (n3) {
|
|
5173
|
-
const r2 = n3.getBoundingClientRect();
|
|
5174
|
-
e3.set(t4, r2);
|
|
5175
|
-
}
|
|
5176
|
-
}), i2(e3);
|
|
5177
|
-
};
|
|
5178
|
-
e2(), window.addEventListener("resize", e2);
|
|
5179
|
-
const t3 = setInterval(e2, 100);
|
|
5180
|
-
return () => {
|
|
5181
|
-
window.removeEventListener("resize", e2), clearInterval(t3);
|
|
5182
|
-
};
|
|
5183
|
-
}, [t2]), /* @__PURE__ */ e("div", { style: { pointerEvents: "none", position: "absolute", top: 0, left: 0, right: 0, bottom: 0, zIndex: 999 }, children: ["left", "middle", "right"].map((r2) => {
|
|
5184
|
-
if (!t2[r2])
|
|
5185
|
-
return null;
|
|
5186
|
-
const o2 = l2.get(r2);
|
|
5187
|
-
if (!o2)
|
|
5188
|
-
return null;
|
|
5189
|
-
const i3 = n2 === r2;
|
|
5190
|
-
return e("div", { style: { position: "fixed", top: o2.top, left: o2.left, width: o2.width, height: o2.height, pointerEvents: "auto" }, children: /* @__PURE__ */ e(Gt2, { slotPosition: r2, isEditing: true, isDragging: i3, children: /* @__PURE__ */ e("div", { style: { height: "100%" } }) }) }, r2);
|
|
5191
|
-
}) });
|
|
5192
|
-
};
|
|
5193
|
-
|
|
5194
|
-
// src/panels/TabbedTerminalPanel.tsx
|
|
1903
|
+
import { CollapsibleSplitPane } from "@principal-ade/panels";
|
|
5195
1904
|
import { Terminal as TerminalIcon2, Lock as Lock2, Unlock as Unlock2, Box, Boxes, Paperclip } from "lucide-react";
|
|
5196
1905
|
import React3, {
|
|
5197
1906
|
useState as useState4,
|
|
@@ -5203,7 +1912,7 @@ import { jsx as jsx7, jsxs as jsxs6, Fragment as Fragment2 } from "react/jsx-run
|
|
|
5203
1912
|
var ActivityIndicator = ({ color, isAnimating }) => /* @__PURE__ */ jsxs6("div", {
|
|
5204
1913
|
style: { display: "flex", gap: 1, alignItems: "center", height: 12 },
|
|
5205
1914
|
children: [
|
|
5206
|
-
[0, 1, 2, 3, 4].map((
|
|
1915
|
+
[0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx7("div", {
|
|
5207
1916
|
style: {
|
|
5208
1917
|
width: 2,
|
|
5209
1918
|
height: 10,
|
|
@@ -5211,9 +1920,9 @@ var ActivityIndicator = ({ color, isAnimating }) => /* @__PURE__ */ jsxs6("div",
|
|
|
5211
1920
|
borderRadius: 1,
|
|
5212
1921
|
transformOrigin: "center",
|
|
5213
1922
|
transform: isAnimating ? undefined : "scaleY(0.4)",
|
|
5214
|
-
animation: isAnimating ? `waveSine 1.2s ease-in-out ${
|
|
1923
|
+
animation: isAnimating ? `waveSine 1.2s ease-in-out ${i * 0.1}s infinite` : "none"
|
|
5215
1924
|
}
|
|
5216
|
-
},
|
|
1925
|
+
}, i)),
|
|
5217
1926
|
/* @__PURE__ */ jsx7("style", {
|
|
5218
1927
|
children: `
|
|
5219
1928
|
@keyframes waveSine {
|
|
@@ -5622,7 +2331,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
5622
2331
|
];
|
|
5623
2332
|
const prevCustomTabs = prevTabs.filter((tab) => tab.contentType !== "terminal");
|
|
5624
2333
|
const customTabsChanged = prevCustomTabs.length !== customTabsFromProp.length || !customTabsFromProp.every((tab) => {
|
|
5625
|
-
const prev = prevCustomTabs.find((
|
|
2334
|
+
const prev = prevCustomTabs.find((p) => p.id === tab.id);
|
|
5626
2335
|
if (!prev)
|
|
5627
2336
|
return false;
|
|
5628
2337
|
return JSON.stringify(tab) === JSON.stringify(prev);
|
|
@@ -5659,7 +2368,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
5659
2368
|
...tab,
|
|
5660
2369
|
label: tab.contentType === "terminal" ? getOwnedTabLabel(index, tab.directory) : tab.label
|
|
5661
2370
|
}));
|
|
5662
|
-
const sortedForeignTabs = [...foreignTabs].sort((
|
|
2371
|
+
const sortedForeignTabs = [...foreignTabs].sort((a, b) => a.label.localeCompare(b.label));
|
|
5663
2372
|
return [...labeledOwnedTabs, ...sortedForeignTabs];
|
|
5664
2373
|
}, [ownedTabs, foreignTabs, getOwnedTabLabel]);
|
|
5665
2374
|
const genericTabs = React3.useMemo(() => {
|
|
@@ -5766,7 +2475,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
5766
2475
|
setForeignTabs(foreignTabsList);
|
|
5767
2476
|
setSessionIds((prev) => {
|
|
5768
2477
|
const updated = new Map(prev);
|
|
5769
|
-
newSessionIds.forEach((
|
|
2478
|
+
newSessionIds.forEach((v, k) => updated.set(k, v));
|
|
5770
2479
|
return updated;
|
|
5771
2480
|
});
|
|
5772
2481
|
} catch (err) {
|
|
@@ -5775,7 +2484,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
5775
2484
|
}, [terminalContext, actions]);
|
|
5776
2485
|
const clearForeignTabs = useCallback5(() => {
|
|
5777
2486
|
setForeignTabs((prevForeign) => {
|
|
5778
|
-
const foreignTabIds = new Set(prevForeign.map((
|
|
2487
|
+
const foreignTabIds = new Set(prevForeign.map((t) => t.id));
|
|
5779
2488
|
setSessionIds((prev) => {
|
|
5780
2489
|
const updated = new Map(prev);
|
|
5781
2490
|
foreignTabIds.forEach((id) => updated.delete(id));
|
|
@@ -5877,7 +2586,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
5877
2586
|
return newMap;
|
|
5878
2587
|
});
|
|
5879
2588
|
const findNextActiveTab = (allTabs) => {
|
|
5880
|
-
const remaining = allTabs.filter((
|
|
2589
|
+
const remaining = allTabs.filter((t) => t.id !== tabId);
|
|
5881
2590
|
if (activeTabId === tabId && remaining.length > 0) {
|
|
5882
2591
|
const newActive = remaining[remaining.length - 1];
|
|
5883
2592
|
return newActive.id;
|
|
@@ -5886,7 +2595,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
5886
2595
|
};
|
|
5887
2596
|
if (isForeign) {
|
|
5888
2597
|
setForeignTabs((prevTabs) => {
|
|
5889
|
-
const newTabs = prevTabs.filter((
|
|
2598
|
+
const newTabs = prevTabs.filter((t) => t.id !== tabId);
|
|
5890
2599
|
const nextActiveId = findNextActiveTab([...ownedTabs, ...newTabs]);
|
|
5891
2600
|
if (nextActiveId !== activeTabId) {
|
|
5892
2601
|
setActiveTabId(nextActiveId);
|
|
@@ -5895,7 +2604,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
5895
2604
|
});
|
|
5896
2605
|
} else {
|
|
5897
2606
|
setOwnedTabs((prevTabs) => {
|
|
5898
|
-
const newTabs = prevTabs.filter((
|
|
2607
|
+
const newTabs = prevTabs.filter((t) => t.id !== tabId);
|
|
5899
2608
|
const nextActiveId = findNextActiveTab([...newTabs, ...foreignTabs]);
|
|
5900
2609
|
if (nextActiveId !== activeTabId) {
|
|
5901
2610
|
setActiveTabId(nextActiveId);
|
|
@@ -5951,8 +2660,8 @@ var TabbedTerminalPanelInner = ({
|
|
|
5951
2660
|
return /* @__PURE__ */ jsxs6(Fragment2, {
|
|
5952
2661
|
children: [
|
|
5953
2662
|
/* @__PURE__ */ jsx7("button", {
|
|
5954
|
-
onClick: (
|
|
5955
|
-
|
|
2663
|
+
onClick: (e) => {
|
|
2664
|
+
e.stopPropagation();
|
|
5956
2665
|
handleToggleScrollLock();
|
|
5957
2666
|
},
|
|
5958
2667
|
style: {
|
|
@@ -5968,11 +2677,11 @@ var TabbedTerminalPanelInner = ({
|
|
|
5968
2677
|
color: scrollPosition.isScrollLocked ? theme.colors.success : theme.colors.warning,
|
|
5969
2678
|
padding: 0
|
|
5970
2679
|
},
|
|
5971
|
-
onMouseEnter: (
|
|
5972
|
-
|
|
2680
|
+
onMouseEnter: (e) => {
|
|
2681
|
+
e.currentTarget.style.backgroundColor = theme.colors.backgroundTertiary;
|
|
5973
2682
|
},
|
|
5974
|
-
onMouseLeave: (
|
|
5975
|
-
|
|
2683
|
+
onMouseLeave: (e) => {
|
|
2684
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
5976
2685
|
},
|
|
5977
2686
|
title: scrollPosition.isScrollLocked ? "Scroll locked" : "Scroll unlocked",
|
|
5978
2687
|
children: scrollPosition.isScrollLocked ? /* @__PURE__ */ jsx7(Lock2, {
|
|
@@ -6039,7 +2748,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
6039
2748
|
const handleCollapsedChange = hasAssociation ? (collapsed) => onAssociationCollapsedChange?.(tab.id, collapsed) : (collapsed) => {
|
|
6040
2749
|
setLocalCollapsedStates((prev) => new Map(prev).set(tab.id, collapsed));
|
|
6041
2750
|
};
|
|
6042
|
-
return /* @__PURE__ */ jsx7(
|
|
2751
|
+
return /* @__PURE__ */ jsx7(CollapsibleSplitPane, {
|
|
6043
2752
|
style: { height: "100%" },
|
|
6044
2753
|
primaryContent: terminalContent,
|
|
6045
2754
|
secondaryContent,
|
|
@@ -6072,44 +2781,44 @@ var TabbedTerminalPanelInner = ({
|
|
|
6072
2781
|
localCollapsedStates
|
|
6073
2782
|
]);
|
|
6074
2783
|
const handleTabDrop = useCallback5((draggedTabId, targetTabId) => {
|
|
6075
|
-
const draggedTab = tabs.find((
|
|
6076
|
-
const targetTab = tabs.find((
|
|
2784
|
+
const draggedTab = tabs.find((t) => t.id === draggedTabId);
|
|
2785
|
+
const targetTab = tabs.find((t) => t.id === targetTabId);
|
|
6077
2786
|
if (targetTab?.contentType === "terminal" && draggedTab?.contentType !== "terminal") {
|
|
6078
2787
|
onTabAssociate?.(targetTabId, draggedTabId);
|
|
6079
2788
|
setActiveTabId(targetTabId);
|
|
6080
2789
|
}
|
|
6081
2790
|
}, [tabs, onTabAssociate, setActiveTabId]);
|
|
6082
2791
|
const canDropOnTab = useCallback5((draggedTabId, targetTabId) => {
|
|
6083
|
-
const draggedTab = tabs.find((
|
|
6084
|
-
const targetTab = tabs.find((
|
|
2792
|
+
const draggedTab = tabs.find((t) => t.id === draggedTabId);
|
|
2793
|
+
const targetTab = tabs.find((t) => t.id === targetTabId);
|
|
6085
2794
|
return targetTab?.contentType === "terminal" && draggedTab?.contentType !== "terminal";
|
|
6086
2795
|
}, [tabs]);
|
|
6087
2796
|
const [isDragOverContent, setIsDragOverContent] = useState4(false);
|
|
6088
|
-
const handleContentDragEnter = useCallback5((
|
|
6089
|
-
|
|
2797
|
+
const handleContentDragEnter = useCallback5((e) => {
|
|
2798
|
+
e.preventDefault();
|
|
6090
2799
|
if (activeTabId) {
|
|
6091
|
-
const activeTab = tabs.find((
|
|
2800
|
+
const activeTab = tabs.find((t) => t.id === activeTabId);
|
|
6092
2801
|
if (activeTab?.contentType === "terminal") {
|
|
6093
2802
|
setIsDragOverContent(true);
|
|
6094
2803
|
}
|
|
6095
2804
|
}
|
|
6096
2805
|
}, [activeTabId, tabs]);
|
|
6097
|
-
const handleContentDragLeave = useCallback5((
|
|
6098
|
-
const relatedTarget =
|
|
6099
|
-
if (!
|
|
2806
|
+
const handleContentDragLeave = useCallback5((e) => {
|
|
2807
|
+
const relatedTarget = e.relatedTarget;
|
|
2808
|
+
if (!e.currentTarget.contains(relatedTarget)) {
|
|
6100
2809
|
setIsDragOverContent(false);
|
|
6101
2810
|
}
|
|
6102
2811
|
}, []);
|
|
6103
|
-
const handleContentDrop = useCallback5((
|
|
6104
|
-
|
|
6105
|
-
|
|
2812
|
+
const handleContentDrop = useCallback5((e) => {
|
|
2813
|
+
e.preventDefault();
|
|
2814
|
+
e.stopPropagation();
|
|
6106
2815
|
setIsDragOverContent(false);
|
|
6107
|
-
const draggedTabId =
|
|
2816
|
+
const draggedTabId = e.dataTransfer.getData("application/x-tab-association");
|
|
6108
2817
|
if (!draggedTabId || !activeTabId) {
|
|
6109
2818
|
return;
|
|
6110
2819
|
}
|
|
6111
|
-
const draggedTab = tabs.find((
|
|
6112
|
-
const activeTab = tabs.find((
|
|
2820
|
+
const draggedTab = tabs.find((t) => t.id === draggedTabId);
|
|
2821
|
+
const activeTab = tabs.find((t) => t.id === activeTabId);
|
|
6113
2822
|
if (activeTab?.contentType === "terminal" && draggedTab?.contentType !== "terminal") {
|
|
6114
2823
|
onTabAssociate?.(activeTabId, draggedTabId);
|
|
6115
2824
|
setActiveTabId(activeTabId);
|
|
@@ -6145,14 +2854,14 @@ var TabbedTerminalPanelInner = ({
|
|
|
6145
2854
|
cursor: "pointer",
|
|
6146
2855
|
color: showAllTerminals ? theme.colors.primary : theme.colors.textSecondary
|
|
6147
2856
|
},
|
|
6148
|
-
onMouseEnter: (
|
|
2857
|
+
onMouseEnter: (e) => {
|
|
6149
2858
|
if (!showAllTerminals) {
|
|
6150
|
-
|
|
2859
|
+
e.currentTarget.style.backgroundColor = theme.colors.backgroundTertiary;
|
|
6151
2860
|
}
|
|
6152
2861
|
},
|
|
6153
|
-
onMouseLeave: (
|
|
2862
|
+
onMouseLeave: (e) => {
|
|
6154
2863
|
if (!showAllTerminals) {
|
|
6155
|
-
|
|
2864
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
6156
2865
|
}
|
|
6157
2866
|
},
|
|
6158
2867
|
title: showAllTerminals ? "Showing all terminals (click to filter by context)" : "Show all terminals",
|
|
@@ -6183,39 +2892,39 @@ var TabbedTerminalPanelInner = ({
|
|
|
6183
2892
|
outline: isDragOverContent ? `3px dashed ${theme.colors.primary}` : "none",
|
|
6184
2893
|
outlineOffset: "-3px"
|
|
6185
2894
|
},
|
|
6186
|
-
onDragEnterCapture: (
|
|
2895
|
+
onDragEnterCapture: (e) => {
|
|
6187
2896
|
if (!enableTabAssociationDrag)
|
|
6188
2897
|
return;
|
|
6189
|
-
if (!
|
|
2898
|
+
if (!e.dataTransfer.types.includes("application/x-tab-association"))
|
|
6190
2899
|
return;
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
handleContentDragEnter(
|
|
2900
|
+
e.preventDefault();
|
|
2901
|
+
e.stopPropagation();
|
|
2902
|
+
handleContentDragEnter(e);
|
|
6194
2903
|
},
|
|
6195
|
-
onDragOverCapture: (
|
|
2904
|
+
onDragOverCapture: (e) => {
|
|
6196
2905
|
if (!enableTabAssociationDrag)
|
|
6197
2906
|
return;
|
|
6198
|
-
if (!
|
|
2907
|
+
if (!e.dataTransfer.types.includes("application/x-tab-association"))
|
|
6199
2908
|
return;
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
2909
|
+
e.preventDefault();
|
|
2910
|
+
e.stopPropagation();
|
|
2911
|
+
e.dataTransfer.dropEffect = "move";
|
|
6203
2912
|
},
|
|
6204
|
-
onDragLeaveCapture: (
|
|
2913
|
+
onDragLeaveCapture: (e) => {
|
|
6205
2914
|
if (!enableTabAssociationDrag)
|
|
6206
2915
|
return;
|
|
6207
|
-
if (!
|
|
2916
|
+
if (!e.dataTransfer.types.includes("application/x-tab-association"))
|
|
6208
2917
|
return;
|
|
6209
|
-
handleContentDragLeave(
|
|
2918
|
+
handleContentDragLeave(e);
|
|
6210
2919
|
},
|
|
6211
|
-
onDropCapture: (
|
|
2920
|
+
onDropCapture: (e) => {
|
|
6212
2921
|
if (!enableTabAssociationDrag)
|
|
6213
2922
|
return;
|
|
6214
|
-
if (!
|
|
2923
|
+
if (!e.dataTransfer.types.includes("application/x-tab-association"))
|
|
6215
2924
|
return;
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
handleContentDrop(
|
|
2925
|
+
e.preventDefault();
|
|
2926
|
+
e.stopPropagation();
|
|
2927
|
+
handleContentDrop(e);
|
|
6219
2928
|
},
|
|
6220
2929
|
children: [
|
|
6221
2930
|
tabs.map((tab) => {
|