@groupviz/react 2.1.3 → 2.1.4
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/index.js +866 -862
- package/index.js.map +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createContext as e, createElement as t, memo as n, useCallback as r, useContext as i, useEffect as a, useId as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
2
2
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
3
3
|
import m from "katex";
|
|
4
|
-
import { COLOR_PALETTE as h, FACE_COLOR_PALETTE as g, buildCosetViewData as _, buildUndirectedEdgeKeys as v, cayleyCircleLayout as y,
|
|
5
|
-
import { Canvas as
|
|
6
|
-
import { Html as
|
|
4
|
+
import { COLOR_PALETTE as h, FACE_COLOR_PALETTE as g, buildCosetViewData as _, buildUndirectedEdgeKeys as v, cayleyCircleLayout as y, circleLayoutRadius as b, compute3DPositions as x, computeCayleyActionEdges as S, computeCycleCandidates as C, computeElementRotation as w, computeFixedPoints as T, computeLatticeLayout as E, computeShape2DPositions as D, computeSubgroupLattice as O, cosetStripLayout as k, cycleGraphLayout as A, elementOrder as j, factorizeOrder as M, findAllSubgroups as N, findMinimalGenerators as P, getDefaultLayout3D as F, getDefaultShape2D as I, getGroupCenter as L, getHomomorphismProperties as R, getSemidirectProductMeta as ee, getSymmetryType as te, isTooLarge as z, latticeFitScale as ne, latticeLodTier as B, latticeSlotScreenSize as V, mergeLatticeByConjugacy as re, resolveElement as H, semidirectFactorMap as ie, semidirectFixedPoints as U, subgroupFaces as W, subgroupSetKey as G, subgroupStructureSymbol as K, verifyHomomorphism as q } from "@groupviz/core";
|
|
5
|
+
import { Canvas as ae, useFrame as oe, useThree as se } from "@react-three/fiber";
|
|
6
|
+
import { Html as ce, OrbitControls as le } from "@react-three/drei";
|
|
7
7
|
import * as J from "three";
|
|
8
8
|
//#region src/components/Canvas/SceneThemeRoot.tsx
|
|
9
|
-
function
|
|
9
|
+
function Y({ theme: e, children: t, style: n, className: r }) {
|
|
10
10
|
return e ? /* @__PURE__ */ f("div", {
|
|
11
11
|
"data-theme": e,
|
|
12
12
|
className: r,
|
|
@@ -111,18 +111,18 @@ var ue = {
|
|
|
111
111
|
"⟩": "\\rangle",
|
|
112
112
|
"⁻": "^{-1}"
|
|
113
113
|
};
|
|
114
|
-
function
|
|
114
|
+
function X(e) {
|
|
115
115
|
let t = "";
|
|
116
116
|
for (let n = 0; n < e.length; n++) {
|
|
117
117
|
let r = e[n], i = n + 1 < e.length ? e[n + 1] : "";
|
|
118
118
|
if (pe[r]) {
|
|
119
119
|
let e = pe[r];
|
|
120
|
-
t += e,
|
|
120
|
+
t += e, Z(e) && me(i) && (t += " ");
|
|
121
121
|
continue;
|
|
122
122
|
}
|
|
123
123
|
if (fe[r]) {
|
|
124
124
|
let e = fe[r];
|
|
125
|
-
t += e,
|
|
125
|
+
t += e, Z(e) && me(i) && (t += " ");
|
|
126
126
|
continue;
|
|
127
127
|
}
|
|
128
128
|
if (ue[r]) {
|
|
@@ -143,7 +143,7 @@ function Y(e) {
|
|
|
143
143
|
}
|
|
144
144
|
return t;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Z(e) {
|
|
147
147
|
if (!e.startsWith("\\") || e.length < 2) return !1;
|
|
148
148
|
for (let t = 1; t < e.length; t++) {
|
|
149
149
|
let n = e[t];
|
|
@@ -151,10 +151,10 @@ function me(e) {
|
|
|
151
151
|
}
|
|
152
152
|
return !0;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function me(e) {
|
|
155
155
|
return e ? e >= "a" && e <= "z" || e >= "A" && e <= "Z" : !1;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function Q(e, t = !1) {
|
|
158
158
|
try {
|
|
159
159
|
return m.renderToString(e, {
|
|
160
160
|
displayMode: t,
|
|
@@ -168,13 +168,13 @@ function Z(e, t = !1) {
|
|
|
168
168
|
}
|
|
169
169
|
//#endregion
|
|
170
170
|
//#region src/components/Canvas/SetView.tsx
|
|
171
|
-
function
|
|
172
|
-
return /* @__PURE__ */ f(
|
|
171
|
+
function he(e) {
|
|
172
|
+
return /* @__PURE__ */ f(Y, {
|
|
173
173
|
theme: e.theme,
|
|
174
|
-
children: /* @__PURE__ */ f(
|
|
174
|
+
children: /* @__PURE__ */ f(ve, { ...e })
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
-
var
|
|
177
|
+
var ge = [
|
|
178
178
|
"#ff6b6b",
|
|
179
179
|
"#4ecdc4",
|
|
180
180
|
"#ffd93d",
|
|
@@ -192,7 +192,7 @@ var he = [
|
|
|
192
192
|
"#0ea5e9",
|
|
193
193
|
"#22c55e"
|
|
194
194
|
];
|
|
195
|
-
function
|
|
195
|
+
function _e(e, t, n, r, i, a, o = !0) {
|
|
196
196
|
let s = e.cosetMemberLabels, c = Math.min(s.length, 12), l = Math.min(10, Math.max(4, Math.floor(t / (Math.max(3, Math.sqrt(c)) * 1.8)))), u = t * .72, m = e.cosetInternalLayout && e.cosetInternalLayout.length >= c, h = (n) => {
|
|
197
197
|
if (m) {
|
|
198
198
|
let t = e.cosetInternalLayout[n];
|
|
@@ -213,7 +213,7 @@ function ge(e, t, n, r, i, a, o = !0) {
|
|
|
213
213
|
cx: t.x,
|
|
214
214
|
cy: t.y,
|
|
215
215
|
r: l,
|
|
216
|
-
fill:
|
|
216
|
+
fill: ge[e % ge.length],
|
|
217
217
|
stroke: "var(--node-stroke)",
|
|
218
218
|
strokeWidth: .8
|
|
219
219
|
}, e));
|
|
@@ -293,7 +293,7 @@ function ge(e, t, n, r, i, a, o = !0) {
|
|
|
293
293
|
})
|
|
294
294
|
] });
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function ve({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r, subsets: i, selfInverseElementId: a, cosetElementMap: o, cosetHighlightSet: s, cosetColors: l, onSelect: u, onHover: m, noGroupText: h, nodeRadius: g, gap: _, columns: v, showLabels: y, largeGroupThreshold: b = 60 }) {
|
|
297
297
|
let x = c(() => {
|
|
298
298
|
let e = /* @__PURE__ */ new Map();
|
|
299
299
|
return i?.forEach((t) => t.elementIds.forEach((n) => {
|
|
@@ -301,7 +301,7 @@ function _e({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
301
301
|
})), e;
|
|
302
302
|
}, [i]), S = c(() => {
|
|
303
303
|
let t = /* @__PURE__ */ new Map();
|
|
304
|
-
return e?.elements.forEach((e) => t.set(e.id,
|
|
304
|
+
return e?.elements.forEach((e) => t.set(e.id, Q(X(e.label)))), t;
|
|
305
305
|
}, [e]), C = l ?? [];
|
|
306
306
|
if (!e) return /* @__PURE__ */ f("div", {
|
|
307
307
|
className: "view-empty",
|
|
@@ -355,7 +355,7 @@ function _e({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
355
355
|
onMouseLeave: () => m?.(null, null),
|
|
356
356
|
style: { cursor: "pointer" },
|
|
357
357
|
children: [
|
|
358
|
-
T ?
|
|
358
|
+
T ? _e(e, E, c, _, v, b, !0) : /* @__PURE__ */ p(d, { children: [
|
|
359
359
|
/* @__PURE__ */ f("circle", {
|
|
360
360
|
r: E,
|
|
361
361
|
fill: _,
|
|
@@ -433,13 +433,13 @@ function _e({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
433
433
|
}
|
|
434
434
|
//#endregion
|
|
435
435
|
//#region src/components/Canvas/CycleView.tsx
|
|
436
|
-
function
|
|
437
|
-
return /* @__PURE__ */ f(
|
|
436
|
+
function ye(e) {
|
|
437
|
+
return /* @__PURE__ */ f(Y, {
|
|
438
438
|
theme: e.theme,
|
|
439
|
-
children: /* @__PURE__ */ f(
|
|
439
|
+
children: /* @__PURE__ */ f(Se, { ...e })
|
|
440
440
|
});
|
|
441
441
|
}
|
|
442
|
-
var
|
|
442
|
+
var be = 0, xe = [
|
|
443
443
|
"#ff6b6b",
|
|
444
444
|
"#4ecdc4",
|
|
445
445
|
"#ffd93d",
|
|
@@ -448,25 +448,25 @@ var ye = 0, be = [
|
|
|
448
448
|
"#3498db",
|
|
449
449
|
"#e67e22"
|
|
450
450
|
];
|
|
451
|
-
function
|
|
452
|
-
let [
|
|
453
|
-
key:
|
|
451
|
+
function Se({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i, showMaximalCycles: a = !0, nodeRadius: o = 24, showLabels: s = !0, showCycleLabels: l = !0, locked: d = !1, subsets: m, selfInverseElementId: h, cosetElementMap: g, cosetHighlightSet: _, cosetColors: v, getNodePosition: y, onNodePositionChange: x, onSelect: S, onHover: C, noGroupText: w, largeGroupThreshold: T = 60 }) {
|
|
452
|
+
let [E] = u(() => `cyv${++be}`), D = e ? `${e.symbol}|${e.order}|${a}` : "", [O, k] = u({
|
|
453
|
+
key: D,
|
|
454
454
|
map: /* @__PURE__ */ new Map()
|
|
455
455
|
});
|
|
456
|
-
|
|
457
|
-
key:
|
|
456
|
+
O.key !== D && k({
|
|
457
|
+
key: D,
|
|
458
458
|
map: /* @__PURE__ */ new Map()
|
|
459
459
|
});
|
|
460
|
-
let
|
|
461
|
-
|
|
462
|
-
if (n.key !==
|
|
460
|
+
let j = c(() => O.key === D ? O.map : /* @__PURE__ */ new Map(), [O, D]), M = r((e, t) => {
|
|
461
|
+
k((n) => {
|
|
462
|
+
if (n.key !== D) return n;
|
|
463
463
|
let r = new Map(n.map);
|
|
464
464
|
return r.set(e, t), {
|
|
465
465
|
key: n.key,
|
|
466
466
|
map: r
|
|
467
467
|
};
|
|
468
468
|
});
|
|
469
|
-
}, [
|
|
469
|
+
}, [D]), N = c(() => {
|
|
470
470
|
if (!e) return [];
|
|
471
471
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
472
472
|
for (let r of e.elements) {
|
|
@@ -493,50 +493,54 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
493
493
|
return [...n].every((e) => r.has(e));
|
|
494
494
|
});
|
|
495
495
|
}).sort((e, t) => e.order - t.order) : t.sort((e, t) => e.order - t.order);
|
|
496
|
-
}, [e, a]),
|
|
496
|
+
}, [e, a]), P = c(() => !e || !a || N.length === 0 ? null : A(e.elements, N.map((e) => ({ elementIds: e.elements.map((e) => e.id) })), i.width, i.height, e.identity.id), [
|
|
497
497
|
e,
|
|
498
498
|
a,
|
|
499
|
-
|
|
499
|
+
N,
|
|
500
500
|
i.width,
|
|
501
501
|
i.height
|
|
502
|
-
]),
|
|
502
|
+
]), F = c(() => {
|
|
503
503
|
let e = /* @__PURE__ */ new Map();
|
|
504
504
|
return m?.forEach((t) => t.elementIds.forEach((n) => {
|
|
505
505
|
e.has(n) || e.set(n, t);
|
|
506
506
|
})), e;
|
|
507
|
-
}, [m]),
|
|
507
|
+
}, [m]), I = v ?? [], L = c(() => {
|
|
508
508
|
let t = /* @__PURE__ */ new Map();
|
|
509
|
-
return e?.elements.forEach((e) => t.set(e.id,
|
|
509
|
+
return e?.elements.forEach((e) => t.set(e.id, Q(X(e.label)))), t;
|
|
510
510
|
}, [e]);
|
|
511
511
|
if (!e) return /* @__PURE__ */ f("div", {
|
|
512
512
|
className: "view-empty",
|
|
513
|
-
children: /* @__PURE__ */ f("p", { children:
|
|
513
|
+
children: /* @__PURE__ */ f("p", { children: w ?? "" })
|
|
514
514
|
});
|
|
515
|
-
let
|
|
516
|
-
if (!
|
|
515
|
+
let R = e.order > T, ee = (e, t) => {
|
|
516
|
+
if (!R) return !0;
|
|
517
517
|
let r = e * n.scale + n.x, a = t * n.scale + n.y, s = o * n.scale * 1.5;
|
|
518
518
|
return r + s > 0 && r - s < i.width && a + s > 0 && a - s < i.height;
|
|
519
|
-
},
|
|
519
|
+
}, te = i.width / 2, z = i.height / 2, ne = b(i.width, i.height, e.order, o, {
|
|
520
|
+
widthFactor: .32,
|
|
521
|
+
base: 160,
|
|
522
|
+
growth: 16
|
|
523
|
+
}), B = (t) => {
|
|
520
524
|
let n = y?.(t);
|
|
521
525
|
if (n) return n;
|
|
522
|
-
let r =
|
|
526
|
+
let r = j.get(t);
|
|
523
527
|
if (r) return r;
|
|
524
|
-
if (
|
|
525
|
-
let e =
|
|
528
|
+
if (P) {
|
|
529
|
+
let e = P.get(t);
|
|
526
530
|
if (e) return e;
|
|
527
531
|
}
|
|
528
532
|
let i = e.elements.findIndex((e) => e.id === t) * 2 * Math.PI / e.order - Math.PI / 2;
|
|
529
533
|
return {
|
|
530
|
-
x:
|
|
531
|
-
y:
|
|
534
|
+
x: te + ne * Math.cos(i),
|
|
535
|
+
y: z + ne * Math.sin(i)
|
|
532
536
|
};
|
|
533
537
|
};
|
|
534
538
|
return /* @__PURE__ */ p("svg", {
|
|
535
539
|
viewBox: `0 0 ${i.width} ${i.height}`,
|
|
536
540
|
className: "view-svg",
|
|
537
541
|
style: { userSelect: "none" },
|
|
538
|
-
children: [!
|
|
539
|
-
id: `${
|
|
542
|
+
children: [!R && /* @__PURE__ */ f("defs", { children: /* @__PURE__ */ f("filter", {
|
|
543
|
+
id: `${E}-node-shadow`,
|
|
540
544
|
x: "-30%",
|
|
541
545
|
y: "-30%",
|
|
542
546
|
width: "160%",
|
|
@@ -550,10 +554,10 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
550
554
|
})
|
|
551
555
|
}) }), /* @__PURE__ */ p("g", {
|
|
552
556
|
transform: `translate(${n.x}, ${n.y}) scale(${n.scale})`,
|
|
553
|
-
children: [
|
|
554
|
-
let r = e.elements.map((e) =>
|
|
557
|
+
children: [N.map((e, n) => {
|
|
558
|
+
let r = e.elements.map((e) => B(e.id));
|
|
555
559
|
if (r.length < 2) return null;
|
|
556
|
-
let i = r.map((e, t) => t === 0 ? `M ${e.x} ${e.y}` : `L ${e.x} ${e.y}`).join(" ") + " Z", o = t.size > 0 && e.elements.some((e) => t.has(e.id)), s =
|
|
560
|
+
let i = r.map((e, t) => t === 0 ? `M ${e.x} ${e.y}` : `L ${e.x} ${e.y}`).join(" ") + " Z", o = t.size > 0 && e.elements.some((e) => t.has(e.id)), s = xe[n % xe.length];
|
|
557
561
|
if (a) {
|
|
558
562
|
if (r.length === 2) return /* @__PURE__ */ f("line", {
|
|
559
563
|
x1: r[0].x,
|
|
@@ -588,7 +592,7 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
588
592
|
})] }, n);
|
|
589
593
|
}
|
|
590
594
|
if (!l) return null;
|
|
591
|
-
let c =
|
|
595
|
+
let c = xe[n % xe.length], u = r.reduce((e, t) => e + t.x, 0) / r.length, d = r.reduce((e, t) => e + t.y, 0) / r.length;
|
|
592
596
|
return /* @__PURE__ */ p("g", { children: [
|
|
593
597
|
/* @__PURE__ */ f("path", {
|
|
594
598
|
d: i,
|
|
@@ -621,13 +625,13 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
621
625
|
})
|
|
622
626
|
] }, n);
|
|
623
627
|
}), e.elements.map((e) => {
|
|
624
|
-
let r =
|
|
625
|
-
if (!
|
|
626
|
-
let a = t.has(e.id), c =
|
|
627
|
-
return a ? (m = "var(--node-fill-selected)", v = "#ffd93d", y = 3) : u && l !== void 0 &&
|
|
628
|
+
let r = B(e.id);
|
|
629
|
+
if (!ee(r.x, r.y)) return null;
|
|
630
|
+
let a = t.has(e.id), c = F.get(e.id), l = g?.get(e.id), u = l !== void 0 && (_?.has(l) ?? !1), m = "var(--node-fill)", v = "var(--node-stroke)", y = 2.5;
|
|
631
|
+
return a ? (m = "var(--node-fill-selected)", v = "#ffd93d", y = 3) : u && l !== void 0 && I[l] ? (m = I[l] + "33", v = I[l], y = 3) : c && (m = c.color + "33", v = c.color, y = 2.5), /* @__PURE__ */ p("g", {
|
|
628
632
|
transform: `translate(${r.x}, ${r.y})`,
|
|
629
633
|
onClick: (t) => {
|
|
630
|
-
t.stopPropagation(),
|
|
634
|
+
t.stopPropagation(), S?.(e.id, t.ctrlKey || t.metaKey);
|
|
631
635
|
},
|
|
632
636
|
onMouseDown: (t) => {
|
|
633
637
|
if (d || t.button !== 0) return;
|
|
@@ -636,9 +640,9 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
636
640
|
if (!r) return;
|
|
637
641
|
let a = r.getBoundingClientRect();
|
|
638
642
|
if (a.width === 0 || a.height === 0) return;
|
|
639
|
-
let o = i.width / a.width, s = i.height / a.height, c = (t.clientX - a.left) * o, l = (t.clientY - a.top) * s, u =
|
|
643
|
+
let o = i.width / a.width, s = i.height / a.height, c = (t.clientX - a.left) * o, l = (t.clientY - a.top) * s, u = B(e.id), f = (t) => {
|
|
640
644
|
let r = (t.clientX - a.left) * o, i = (t.clientY - a.top) * s, d = u.x + (r - c) / n.scale, f = u.y + (i - l) / n.scale;
|
|
641
|
-
|
|
645
|
+
x ? x(e.id, d, f) : M(e.id, {
|
|
642
646
|
x: d,
|
|
643
647
|
y: f
|
|
644
648
|
});
|
|
@@ -647,11 +651,11 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
647
651
|
};
|
|
648
652
|
window.addEventListener("mousemove", f), window.addEventListener("mouseup", p);
|
|
649
653
|
},
|
|
650
|
-
onMouseEnter: () =>
|
|
654
|
+
onMouseEnter: () => C?.(e, {
|
|
651
655
|
x: r.x * n.scale + n.x,
|
|
652
656
|
y: r.y * n.scale + n.y
|
|
653
657
|
}),
|
|
654
|
-
onMouseLeave: () =>
|
|
658
|
+
onMouseLeave: () => C?.(null, null),
|
|
655
659
|
style: { cursor: "grab" },
|
|
656
660
|
children: [
|
|
657
661
|
/* @__PURE__ */ f("circle", {
|
|
@@ -659,19 +663,19 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
659
663
|
fill: m,
|
|
660
664
|
stroke: v,
|
|
661
665
|
strokeWidth: y,
|
|
662
|
-
filter:
|
|
666
|
+
filter: R ? void 0 : `url(#${E}-node-shadow)`
|
|
663
667
|
}),
|
|
664
668
|
c && /* @__PURE__ */ f("circle", {
|
|
665
669
|
r: o,
|
|
666
670
|
fill: `${c.color}22`,
|
|
667
671
|
stroke: "none"
|
|
668
672
|
}),
|
|
669
|
-
u && l !== void 0 &&
|
|
673
|
+
u && l !== void 0 && I[l] && /* @__PURE__ */ f("circle", {
|
|
670
674
|
r: o,
|
|
671
|
-
fill: `${
|
|
675
|
+
fill: `${I[l]}22`,
|
|
672
676
|
stroke: "none"
|
|
673
677
|
}),
|
|
674
|
-
s && (!
|
|
678
|
+
s && (!R || a || t.size === 0) && /* @__PURE__ */ f("foreignObject", {
|
|
675
679
|
x: -o,
|
|
676
680
|
y: -15,
|
|
677
681
|
width: o * 2,
|
|
@@ -688,9 +692,9 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
688
692
|
width: "100%",
|
|
689
693
|
height: "100%",
|
|
690
694
|
color: "var(--node-text)",
|
|
691
|
-
fontSize:
|
|
695
|
+
fontSize: R ? "10px" : "14px"
|
|
692
696
|
},
|
|
693
|
-
dangerouslySetInnerHTML: { __html:
|
|
697
|
+
dangerouslySetInnerHTML: { __html: L.get(e.id) ?? "" }
|
|
694
698
|
})
|
|
695
699
|
}),
|
|
696
700
|
h === e.id && /* @__PURE__ */ p("g", { children: [/* @__PURE__ */ f("circle", {
|
|
@@ -720,37 +724,37 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
720
724
|
}
|
|
721
725
|
//#endregion
|
|
722
726
|
//#region src/utils/elementRef.ts
|
|
723
|
-
var
|
|
724
|
-
function
|
|
727
|
+
var Ce = /* @__PURE__ */ new Set();
|
|
728
|
+
function we(e, t, n) {
|
|
725
729
|
let r = H(e, t);
|
|
726
730
|
if (r) return r;
|
|
727
731
|
if (!e || t == null || t === "") return null;
|
|
728
732
|
let i = `${n}|${e.symbol}|${t}`;
|
|
729
|
-
return
|
|
733
|
+
return Ce.has(i) || (Ce.add(i), console.warn(`[groupviz] ${n}: 元素引用 ${JSON.stringify(t)} 在群 ${e?.symbol ?? "?"} 中解析不到(已试 id / label / value / 循环记号四种写法),该项已忽略。`)), null;
|
|
730
734
|
}
|
|
731
|
-
function
|
|
735
|
+
function Te(e, t, n) {
|
|
732
736
|
if (!t) return [];
|
|
733
737
|
let r = [], i = /* @__PURE__ */ new Set();
|
|
734
738
|
for (let a of t) {
|
|
735
|
-
let t =
|
|
739
|
+
let t = we(e, a, n);
|
|
736
740
|
!t || i.has(t.id) || (i.add(t.id), r.push(t.id));
|
|
737
741
|
}
|
|
738
742
|
return r;
|
|
739
743
|
}
|
|
740
744
|
//#endregion
|
|
741
745
|
//#region src/context/cayleyActions.ts
|
|
742
|
-
function
|
|
746
|
+
function Ee(e) {
|
|
743
747
|
return e.generators.map((t, n) => ({
|
|
744
748
|
elementId: t.apply(e.identity)?.id || e.elements[0]?.id || e.identity.id,
|
|
745
749
|
enabled: !0,
|
|
746
750
|
color: h[n % h.length]
|
|
747
751
|
}));
|
|
748
752
|
}
|
|
749
|
-
function
|
|
750
|
-
if (!t) return
|
|
753
|
+
function De(e, t) {
|
|
754
|
+
if (!t) return Ee(e);
|
|
751
755
|
let n = [], r = /* @__PURE__ */ new Set();
|
|
752
756
|
for (let i of t) {
|
|
753
|
-
let t =
|
|
757
|
+
let t = we(e, i.elementId, "CayleyView.actions[].elementId");
|
|
754
758
|
!t || r.has(t.id) || (r.add(t.id), n.push({
|
|
755
759
|
elementId: t.id,
|
|
756
760
|
enabled: i.enabled !== !1,
|
|
@@ -761,14 +765,14 @@ function Ee(e, t) {
|
|
|
761
765
|
}
|
|
762
766
|
//#endregion
|
|
763
767
|
//#region src/components/Canvas/CayleyView.tsx
|
|
764
|
-
function
|
|
765
|
-
return /* @__PURE__ */ f(
|
|
768
|
+
function Oe(e) {
|
|
769
|
+
return /* @__PURE__ */ f(Y, {
|
|
766
770
|
theme: e.theme,
|
|
767
|
-
children: /* @__PURE__ */ f(
|
|
771
|
+
children: /* @__PURE__ */ f(je, { ...e })
|
|
768
772
|
});
|
|
769
773
|
}
|
|
770
|
-
var
|
|
771
|
-
function
|
|
774
|
+
var ke = 0;
|
|
775
|
+
function Ae(e, t, n, r, i, a) {
|
|
772
776
|
let o = t.get(e.fromId), s = t.get(e.toId);
|
|
773
777
|
if (!o || !s) return null;
|
|
774
778
|
let c = s.x - o.x, l = s.y - o.y, u = Math.sqrt(c * c + l * l);
|
|
@@ -799,100 +803,100 @@ function ke(e, t, n, r, i, a) {
|
|
|
799
803
|
opacity: .9
|
|
800
804
|
}, `${e.fromId}-${e.toId}-${e.actionElementId}`);
|
|
801
805
|
}
|
|
802
|
-
function
|
|
803
|
-
let [
|
|
804
|
-
key:
|
|
806
|
+
function je({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i, shape2D: a, multiplyType: o, actions: s, nodeRadius: l, showLabels: d, locked: m = !1, onSelect: h, onHover: g, hoveredElementId: _, noGroupText: v, largeGroupThreshold: x = 60 }) {
|
|
807
|
+
let [C] = u(() => `cv${++ke}`), w = e?.order ?? 0, T = e ? a ?? I(e) : "circular", E = o ?? "right", O = l ?? 28, k = w > x, A = c(() => e ? De(e, s) : [], [e, s]), j = e ? `${e.symbol}|${e.order}|${T}` : "", [M, N] = u({
|
|
808
|
+
key: j,
|
|
805
809
|
map: /* @__PURE__ */ new Map()
|
|
806
810
|
});
|
|
807
|
-
|
|
808
|
-
key:
|
|
811
|
+
M.key !== j && N({
|
|
812
|
+
key: j,
|
|
809
813
|
map: /* @__PURE__ */ new Map()
|
|
810
814
|
});
|
|
811
|
-
let
|
|
812
|
-
|
|
813
|
-
if (n.key !==
|
|
815
|
+
let P = c(() => M.key === j ? M.map : /* @__PURE__ */ new Map(), [M, j]), F = r((e, t) => {
|
|
816
|
+
N((n) => {
|
|
817
|
+
if (n.key !== j) return n;
|
|
814
818
|
let r = new Map(n.map);
|
|
815
819
|
return r.set(e, t), {
|
|
816
820
|
key: n.key,
|
|
817
821
|
map: r
|
|
818
822
|
};
|
|
819
823
|
});
|
|
820
|
-
}, [
|
|
824
|
+
}, [j]), L = i.width / 2, R = i.height / 2, te = b(i.width, i.height, w, O), z = c(() => e ? D(e, T, i.width, i.height) : null, [
|
|
821
825
|
e,
|
|
822
|
-
|
|
826
|
+
T,
|
|
823
827
|
i.width,
|
|
824
828
|
i.height
|
|
825
|
-
]),
|
|
829
|
+
]), ne = c(() => !e || w === 0 ? /* @__PURE__ */ new Map() : y(e, L, R, te), [
|
|
826
830
|
e,
|
|
827
|
-
I,
|
|
828
831
|
L,
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
+
R,
|
|
833
|
+
te,
|
|
834
|
+
w
|
|
835
|
+
]), B = c(() => e ? ee(e) : null, [e]), V = c(() => {
|
|
832
836
|
let t = /* @__PURE__ */ new Map();
|
|
833
|
-
if (!e || !
|
|
834
|
-
let n =
|
|
835
|
-
return n ?
|
|
836
|
-
}, [e,
|
|
837
|
+
if (!e || !B) return t;
|
|
838
|
+
let n = ie(e, B);
|
|
839
|
+
return n ? U(e, B, n) : t;
|
|
840
|
+
}, [e, B]), re = c(() => A.filter((e) => e.enabled), [A]), H = c(() => {
|
|
837
841
|
let e = /* @__PURE__ */ new Map();
|
|
838
|
-
return
|
|
839
|
-
}, [
|
|
842
|
+
return re.forEach((t, n) => e.set(t.elementId, n)), e;
|
|
843
|
+
}, [re]), W = c(() => e ? S(e, A, E) : [], [
|
|
840
844
|
e,
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
]),
|
|
845
|
+
A,
|
|
846
|
+
E
|
|
847
|
+
]), G = r((e) => {
|
|
844
848
|
let t;
|
|
845
|
-
if (
|
|
846
|
-
let n =
|
|
849
|
+
if (z) {
|
|
850
|
+
let n = z.get(e);
|
|
847
851
|
if (!n) return {
|
|
848
|
-
x:
|
|
849
|
-
y:
|
|
852
|
+
x: L,
|
|
853
|
+
y: R
|
|
850
854
|
};
|
|
851
855
|
t = n;
|
|
852
856
|
} else {
|
|
853
|
-
let n =
|
|
857
|
+
let n = ne.get(e);
|
|
854
858
|
if (!n) return {
|
|
855
|
-
x:
|
|
856
|
-
y:
|
|
859
|
+
x: L,
|
|
860
|
+
y: R
|
|
857
861
|
};
|
|
858
862
|
t = n;
|
|
859
863
|
}
|
|
860
|
-
let n =
|
|
864
|
+
let n = P.get(e);
|
|
861
865
|
return n && (Math.abs(n.x - t.x) > 1 || Math.abs(n.y - t.y) > 1) ? n : t;
|
|
862
866
|
}, [
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
]),
|
|
867
|
+
z,
|
|
868
|
+
ne,
|
|
869
|
+
P,
|
|
870
|
+
L,
|
|
871
|
+
R
|
|
872
|
+
]), K = c(() => {
|
|
869
873
|
let t = /* @__PURE__ */ new Map();
|
|
870
|
-
return e && e.elements.forEach((e) => t.set(e.id,
|
|
871
|
-
}, [e,
|
|
874
|
+
return e && e.elements.forEach((e) => t.set(e.id, G(e.id))), t;
|
|
875
|
+
}, [e, G]), q = c(() => {
|
|
872
876
|
let t = /* @__PURE__ */ new Map();
|
|
873
|
-
return e && e.elements.forEach((e) => t.set(e.id,
|
|
874
|
-
}, [e]),
|
|
877
|
+
return e && e.elements.forEach((e) => t.set(e.id, Q(X(e.label)))), t;
|
|
878
|
+
}, [e]), ae = c(() => t.size, [t]), oe = c(() => e ? W.map((e) => Ae(e, K, O, H, !1, C)) : null, [
|
|
875
879
|
W,
|
|
876
|
-
|
|
880
|
+
K,
|
|
877
881
|
H,
|
|
878
|
-
|
|
882
|
+
O,
|
|
879
883
|
e,
|
|
880
|
-
|
|
881
|
-
]),
|
|
884
|
+
C
|
|
885
|
+
]), se = c(() => !e || t.size === 0 ? null : W.filter((e) => t.has(e.fromId) || t.has(e.toId)).map((e) => Ae(e, K, O, H, !0, C)), [
|
|
882
886
|
W,
|
|
883
887
|
t,
|
|
884
|
-
|
|
888
|
+
K,
|
|
885
889
|
H,
|
|
886
|
-
|
|
890
|
+
O,
|
|
887
891
|
e,
|
|
888
|
-
|
|
889
|
-
]),
|
|
890
|
-
let t =
|
|
891
|
-
x:
|
|
892
|
-
y:
|
|
893
|
-
}, r = t.x * n.scale + n.x, a = t.y * n.scale + n.y, o =
|
|
894
|
-
if (!(!
|
|
895
|
-
let s =
|
|
892
|
+
C
|
|
893
|
+
]), ce = c(() => e ? e.elements.map((e) => {
|
|
894
|
+
let t = K.get(e.id) || {
|
|
895
|
+
x: L,
|
|
896
|
+
y: R
|
|
897
|
+
}, r = t.x * n.scale + n.x, a = t.y * n.scale + n.y, o = O * n.scale * 1.5;
|
|
898
|
+
if (!(!k || r + o > 0 && r - o < i.width && a + o > 0 && a - o < i.height)) return null;
|
|
899
|
+
let s = T === "rewiring" && !!B && V.get(e.id) === !0, c = "var(--node-fill)", l = "var(--node-stroke)", u = 2.5;
|
|
896
900
|
return s && (c = "var(--accent-teal)22", l = "var(--accent-teal)", u = 3), /* @__PURE__ */ p("g", {
|
|
897
901
|
transform: `translate(${t.x}, ${t.y})`,
|
|
898
902
|
onClick: (t) => {
|
|
@@ -905,8 +909,8 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
905
909
|
if (!r) return;
|
|
906
910
|
let a = r.getBoundingClientRect();
|
|
907
911
|
if (a.width === 0 || a.height === 0) return;
|
|
908
|
-
let o = i.width / a.width, s = i.height / a.height, c = (t.clientX - a.left) * o, l = (t.clientY - a.top) * s, u =
|
|
909
|
-
d &&
|
|
912
|
+
let o = i.width / a.width, s = i.height / a.height, c = (t.clientX - a.left) * o, l = (t.clientY - a.top) * s, u = G(e.id), d = null, f = { current: 0 }, p = () => {
|
|
913
|
+
d && F(e.id, d);
|
|
910
914
|
}, h = (e) => {
|
|
911
915
|
let t = (e.clientX - a.left) * o, r = (e.clientY - a.top) * s;
|
|
912
916
|
d = {
|
|
@@ -928,24 +932,24 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
928
932
|
style: { cursor: "grab" },
|
|
929
933
|
children: [
|
|
930
934
|
/* @__PURE__ */ f("circle", {
|
|
931
|
-
r:
|
|
935
|
+
r: O,
|
|
932
936
|
fill: c,
|
|
933
937
|
stroke: l,
|
|
934
938
|
strokeWidth: u,
|
|
935
|
-
filter:
|
|
939
|
+
filter: k ? void 0 : `url(#${C}-node-shadow)`
|
|
936
940
|
}),
|
|
937
941
|
e.id === _ && /* @__PURE__ */ f("circle", {
|
|
938
|
-
r:
|
|
942
|
+
r: O + 5,
|
|
939
943
|
fill: "none",
|
|
940
944
|
stroke: "#4ecdc4",
|
|
941
945
|
strokeWidth: 3.5,
|
|
942
946
|
opacity: .95,
|
|
943
947
|
style: { filter: "drop-shadow(0 0 4px rgba(78,205,196,0.7))" }
|
|
944
948
|
}),
|
|
945
|
-
d !== !1 && (!
|
|
946
|
-
x: -
|
|
949
|
+
d !== !1 && (!k || ae === 0) && /* @__PURE__ */ f("foreignObject", {
|
|
950
|
+
x: -O,
|
|
947
951
|
y: -16,
|
|
948
|
-
width:
|
|
952
|
+
width: O * 2,
|
|
949
953
|
height: 32,
|
|
950
954
|
style: {
|
|
951
955
|
pointerEvents: "none",
|
|
@@ -959,53 +963,53 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
959
963
|
width: "100%",
|
|
960
964
|
height: "100%",
|
|
961
965
|
color: s ? "var(--accent-teal)" : "var(--node-text)",
|
|
962
|
-
fontSize:
|
|
966
|
+
fontSize: k ? "10px" : "15px",
|
|
963
967
|
fontWeight: s ? 700 : 400
|
|
964
968
|
},
|
|
965
|
-
dangerouslySetInnerHTML: { __html:
|
|
969
|
+
dangerouslySetInnerHTML: { __html: q.get(e.id) ?? "" }
|
|
966
970
|
})
|
|
967
971
|
})
|
|
968
972
|
]
|
|
969
973
|
}, e.id);
|
|
970
974
|
}) : null, [
|
|
971
975
|
e,
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
D,
|
|
976
|
+
K,
|
|
977
|
+
ae,
|
|
978
|
+
B,
|
|
979
|
+
V,
|
|
977
980
|
O,
|
|
981
|
+
k,
|
|
978
982
|
n,
|
|
979
983
|
i,
|
|
980
|
-
I,
|
|
981
984
|
L,
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
+
R,
|
|
986
|
+
q,
|
|
987
|
+
T,
|
|
988
|
+
G,
|
|
985
989
|
h,
|
|
986
990
|
g,
|
|
987
|
-
|
|
991
|
+
C,
|
|
988
992
|
d,
|
|
989
|
-
|
|
993
|
+
F,
|
|
990
994
|
m,
|
|
991
995
|
_
|
|
992
|
-
]),
|
|
993
|
-
let t =
|
|
994
|
-
x:
|
|
995
|
-
y:
|
|
996
|
-
}, r = t.x * n.scale + n.x, a = t.y * n.scale + n.y, o =
|
|
997
|
-
return
|
|
996
|
+
]), le = c(() => !e || t.size === 0 ? null : [...t].map((e) => {
|
|
997
|
+
let t = K.get(e) || {
|
|
998
|
+
x: L,
|
|
999
|
+
y: R
|
|
1000
|
+
}, r = t.x * n.scale + n.x, a = t.y * n.scale + n.y, o = O * n.scale * 1.5;
|
|
1001
|
+
return k && !(r + o > 0 && r - o < i.width && a + o > 0 && a - o < i.height) ? null : /* @__PURE__ */ p("g", {
|
|
998
1002
|
transform: `translate(${t.x}, ${t.y})`,
|
|
999
1003
|
children: [/* @__PURE__ */ f("circle", {
|
|
1000
|
-
r:
|
|
1004
|
+
r: O + 3,
|
|
1001
1005
|
fill: "none",
|
|
1002
1006
|
stroke: "#ffd93d",
|
|
1003
1007
|
strokeWidth: 3,
|
|
1004
1008
|
opacity: .95
|
|
1005
|
-
}),
|
|
1006
|
-
x: -
|
|
1009
|
+
}), k && /* @__PURE__ */ f("foreignObject", {
|
|
1010
|
+
x: -O,
|
|
1007
1011
|
y: -16,
|
|
1008
|
-
width:
|
|
1012
|
+
width: O * 2,
|
|
1009
1013
|
height: 32,
|
|
1010
1014
|
style: {
|
|
1011
1015
|
pointerEvents: "none",
|
|
@@ -1021,28 +1025,28 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
1021
1025
|
color: "var(--node-text)",
|
|
1022
1026
|
fontSize: "10px"
|
|
1023
1027
|
},
|
|
1024
|
-
dangerouslySetInnerHTML: { __html:
|
|
1028
|
+
dangerouslySetInnerHTML: { __html: q.get(e) ?? "" }
|
|
1025
1029
|
})
|
|
1026
1030
|
})]
|
|
1027
1031
|
}, `selected-${e}`);
|
|
1028
1032
|
}), [
|
|
1029
1033
|
e,
|
|
1030
1034
|
t,
|
|
1031
|
-
|
|
1032
|
-
|
|
1035
|
+
K,
|
|
1036
|
+
O,
|
|
1033
1037
|
n,
|
|
1034
1038
|
i,
|
|
1035
|
-
|
|
1036
|
-
I,
|
|
1039
|
+
k,
|
|
1037
1040
|
L,
|
|
1038
|
-
|
|
1041
|
+
R,
|
|
1042
|
+
q
|
|
1039
1043
|
]);
|
|
1040
1044
|
return e ? /* @__PURE__ */ p("svg", {
|
|
1041
1045
|
viewBox: `0 0 ${i.width} ${i.height}`,
|
|
1042
1046
|
className: "view-svg",
|
|
1043
1047
|
style: { userSelect: "none" },
|
|
1044
1048
|
children: [/* @__PURE__ */ p("defs", { children: [/* @__PURE__ */ f("filter", {
|
|
1045
|
-
id: `${
|
|
1049
|
+
id: `${C}-node-shadow`,
|
|
1046
1050
|
x: "-30%",
|
|
1047
1051
|
y: "-30%",
|
|
1048
1052
|
width: "160%",
|
|
@@ -1054,8 +1058,8 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
1054
1058
|
floodColor: "#000000",
|
|
1055
1059
|
floodOpacity: "0.25"
|
|
1056
1060
|
})
|
|
1057
|
-
}),
|
|
1058
|
-
id: `${
|
|
1061
|
+
}), re.map((e, t) => /* @__PURE__ */ f("marker", {
|
|
1062
|
+
id: `${C}-arrow-${t}`,
|
|
1059
1063
|
markerWidth: 10,
|
|
1060
1064
|
markerHeight: 10,
|
|
1061
1065
|
refX: 9,
|
|
@@ -1069,10 +1073,10 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
1069
1073
|
}, t))] }), /* @__PURE__ */ p("g", {
|
|
1070
1074
|
transform: `translate(${n.x}, ${n.y}) scale(${n.scale})`,
|
|
1071
1075
|
children: [
|
|
1072
|
-
ae,
|
|
1073
1076
|
oe,
|
|
1074
1077
|
se,
|
|
1075
|
-
ce
|
|
1078
|
+
ce,
|
|
1079
|
+
le
|
|
1076
1080
|
]
|
|
1077
1081
|
})]
|
|
1078
1082
|
}) : /* @__PURE__ */ f("div", {
|
|
@@ -1080,7 +1084,7 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
1080
1084
|
children: /* @__PURE__ */ f("p", { children: v ?? "" })
|
|
1081
1085
|
});
|
|
1082
1086
|
}
|
|
1083
|
-
var
|
|
1087
|
+
var Me = {
|
|
1084
1088
|
zh: {
|
|
1085
1089
|
"app.title": "GroupViz - 群论可视化",
|
|
1086
1090
|
"app.header": "GroupViz - 群论可视化",
|
|
@@ -1090,7 +1094,7 @@ var je = {
|
|
|
1090
1094
|
"theme.viewWindowDark": "视图窗口切换为浅色",
|
|
1091
1095
|
"theme.viewWindowLight": "视图窗口切换为深色",
|
|
1092
1096
|
"welcome.subtitle": "群论可视化平台",
|
|
1093
|
-
"welcome.version": "v2.1.
|
|
1097
|
+
"welcome.version": "v2.1.4",
|
|
1094
1098
|
"welcome.tagline": "探索抽象代数的对称之美 — 交互式群论可视化与学习工具",
|
|
1095
1099
|
"welcome.enter": "进入应用",
|
|
1096
1100
|
"welcome.section.done": "已实现",
|
|
@@ -1719,7 +1723,7 @@ var je = {
|
|
|
1719
1723
|
"theme.viewWindowDark": "View windows: switch to light",
|
|
1720
1724
|
"theme.viewWindowLight": "View windows: switch to dark",
|
|
1721
1725
|
"welcome.subtitle": "Group Theory Visualization Platform",
|
|
1722
|
-
"welcome.version": "v2.1.
|
|
1726
|
+
"welcome.version": "v2.1.4",
|
|
1723
1727
|
"welcome.tagline": "Explore the beauty of symmetry in abstract algebra — Interactive group theory visualization & learning tool",
|
|
1724
1728
|
"welcome.enter": "Enter",
|
|
1725
1729
|
"welcome.section.done": "Implemented",
|
|
@@ -2340,33 +2344,33 @@ var je = {
|
|
|
2340
2344
|
"theme.switchToDark": "Switch to Dark Mode"
|
|
2341
2345
|
}
|
|
2342
2346
|
};
|
|
2343
|
-
function
|
|
2347
|
+
function $() {
|
|
2344
2348
|
if (typeof window > "u") return "zh";
|
|
2345
2349
|
let e = localStorage.getItem("groupviz-lang");
|
|
2346
2350
|
return e === "en" || e === "zh" ? e : ((navigator.language || "").startsWith("zh"), "zh");
|
|
2347
2351
|
}
|
|
2348
2352
|
//#endregion
|
|
2349
2353
|
//#region src/i18n/I18nContext.tsx
|
|
2350
|
-
function
|
|
2351
|
-
let n =
|
|
2354
|
+
function Ne(e, t) {
|
|
2355
|
+
let n = Me.zh[e] ?? Me.en[e] ?? e;
|
|
2352
2356
|
if (t) for (let [e, r] of Object.entries(t)) n = n.replace(RegExp(`\\{${e}\\}`, "g"), String(r));
|
|
2353
2357
|
return n;
|
|
2354
2358
|
}
|
|
2355
|
-
var
|
|
2359
|
+
var Pe = e({
|
|
2356
2360
|
lang: "zh",
|
|
2357
2361
|
setLang: () => {},
|
|
2358
|
-
t:
|
|
2362
|
+
t: Ne
|
|
2359
2363
|
});
|
|
2360
|
-
function
|
|
2361
|
-
let [i, a] = u(() => t ??
|
|
2364
|
+
function Fe({ children: e, lang: t, persist: n = !0 }) {
|
|
2365
|
+
let [i, a] = u(() => t ?? $()), o = r((e) => {
|
|
2362
2366
|
a(e), n && localStorage.setItem("groupviz-lang", e);
|
|
2363
2367
|
}, [n]), s = r((e, t) => {
|
|
2364
|
-
let n =
|
|
2365
|
-
if (n === void 0 && (n =
|
|
2368
|
+
let n = Me[i][e];
|
|
2369
|
+
if (n === void 0 && (n = Me.en[e]), n === void 0) return console.warn(`Missing translation key: "${e}" for lang "${i}"`), e;
|
|
2366
2370
|
if (t) for (let [e, r] of Object.entries(t)) n = n.replace(RegExp(`\\{${e}\\}`, "g"), String(r));
|
|
2367
2371
|
return n;
|
|
2368
2372
|
}, [i]);
|
|
2369
|
-
return /* @__PURE__ */ f(
|
|
2373
|
+
return /* @__PURE__ */ f(Pe.Provider, {
|
|
2370
2374
|
value: {
|
|
2371
2375
|
lang: i,
|
|
2372
2376
|
setLang: o,
|
|
@@ -2377,41 +2381,41 @@ function Pe({ children: e, lang: t, persist: n = !0 }) {
|
|
|
2377
2381
|
}
|
|
2378
2382
|
//#endregion
|
|
2379
2383
|
//#region src/i18n/useTranslation.ts
|
|
2380
|
-
function
|
|
2381
|
-
return i(
|
|
2384
|
+
function Ie() {
|
|
2385
|
+
return i(Pe);
|
|
2382
2386
|
}
|
|
2383
2387
|
//#endregion
|
|
2384
2388
|
//#region src/components/Canvas/CosetStripScene.tsx
|
|
2385
|
-
var
|
|
2386
|
-
function
|
|
2389
|
+
var Le = /* @__PURE__ */ new Set();
|
|
2390
|
+
function Re(e, t) {
|
|
2387
2391
|
let n = `${e.symbol}|${[...t].sort().join(",")}`;
|
|
2388
|
-
|
|
2392
|
+
Le.has(n) || (Le.add(n), console.warn(`[groupviz] CosetStripScene.subgroup: 元素集合 [${n.split("|")[1]}] 在群 ${e.symbol} 中不构成子群(不含单位元或乘法不封闭),陪集视图显示空态。`));
|
|
2389
2393
|
}
|
|
2390
|
-
function
|
|
2391
|
-
return /* @__PURE__ */ f(
|
|
2394
|
+
function ze(e) {
|
|
2395
|
+
return /* @__PURE__ */ f(Y, {
|
|
2392
2396
|
theme: e.theme,
|
|
2393
|
-
children: /* @__PURE__ */ f(
|
|
2397
|
+
children: /* @__PURE__ */ f(Be, { ...e })
|
|
2394
2398
|
});
|
|
2395
2399
|
}
|
|
2396
|
-
function
|
|
2397
|
-
let { t: T } =
|
|
2398
|
-
if (i || !e || !
|
|
2399
|
-
let n =
|
|
2400
|
+
function Be({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r, cosetElementMap: i, cosetColors: a, cosetHighlightSet: s, subsets: l, showLabels: u = !0, showSubgroupCayley: d = !0, onSelect: m, onHover: g, noGroupText: v, noCosetsText: b, subgroup: x, cosetType: C = "left", highlightAllCosets: w = !1 }) {
|
|
2401
|
+
let { t: T } = Ie(), E = o(), D = `${E}-cs-node-shadow`, O = (e) => `${E}-cs-cayley-arrow-${e}`, A = c(() => {
|
|
2402
|
+
if (i || !e || !x || x.length === 0) return null;
|
|
2403
|
+
let n = Te(e, x, "CosetStripScene.subgroup");
|
|
2400
2404
|
if (n.length === 0) return null;
|
|
2401
2405
|
let r = _(e, n, {
|
|
2402
2406
|
side: C,
|
|
2403
2407
|
highlightAll: w,
|
|
2404
2408
|
selected: t ?? []
|
|
2405
2409
|
});
|
|
2406
|
-
return r ||
|
|
2410
|
+
return r || Re(e, n), r;
|
|
2407
2411
|
}, [
|
|
2408
2412
|
i,
|
|
2409
2413
|
e,
|
|
2410
|
-
|
|
2414
|
+
x,
|
|
2411
2415
|
C,
|
|
2412
2416
|
w,
|
|
2413
2417
|
t
|
|
2414
|
-
]), j = i ?? A?.cosetElementMap, M = a ?? A?.cosetColors,
|
|
2418
|
+
]), j = i ?? A?.cosetElementMap, M = a ?? A?.cosetColors, N = s ?? A?.cosetHighlightSet, F = c(() => {
|
|
2415
2419
|
let e = /* @__PURE__ */ new Map();
|
|
2416
2420
|
return (l ?? []).forEach((t) => t.elementIds.forEach((n) => {
|
|
2417
2421
|
e.has(n) || e.set(n, t);
|
|
@@ -2429,7 +2433,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2429
2433
|
r,
|
|
2430
2434
|
topPad: 2 * r + 64
|
|
2431
2435
|
};
|
|
2432
|
-
}, [e, j]), L = c(() => !e || !j || j.size === 0 ? null :
|
|
2436
|
+
}, [e, j]), L = c(() => !e || !j || j.size === 0 ? null : k(e, r.width, r.height, void 0, j, new Set(j.values()).size, M, I && d ? I.topPad : void 0), [
|
|
2433
2437
|
e,
|
|
2434
2438
|
r.width,
|
|
2435
2439
|
r.height,
|
|
@@ -2444,7 +2448,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2444
2448
|
let n = [];
|
|
2445
2449
|
for (let [e, r] of j) r === t && n.push(e);
|
|
2446
2450
|
if (n.length < 2 || n.length > 12) return null;
|
|
2447
|
-
let r = new Set(n), i = e.elements.filter((e) => r.has(e.id)), a =
|
|
2451
|
+
let r = new Set(n), i = e.elements.filter((e) => r.has(e.id)), a = P(i, e);
|
|
2448
2452
|
if (a.length === 0) return null;
|
|
2449
2453
|
let o = /* @__PURE__ */ new Map();
|
|
2450
2454
|
return {
|
|
@@ -2452,7 +2456,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2452
2456
|
hElements: i,
|
|
2453
2457
|
hGenerators: a,
|
|
2454
2458
|
genIndex: o,
|
|
2455
|
-
edges:
|
|
2459
|
+
edges: S(e, a.map((e, t) => (o.set(e.id, t), {
|
|
2456
2460
|
elementId: e.id,
|
|
2457
2461
|
enabled: !0,
|
|
2458
2462
|
color: h[t % h.length]
|
|
@@ -2462,11 +2466,11 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2462
2466
|
e,
|
|
2463
2467
|
j,
|
|
2464
2468
|
d
|
|
2465
|
-
]),
|
|
2469
|
+
]), ee = c(() => {
|
|
2466
2470
|
if (!e) return 28;
|
|
2467
2471
|
let t = Math.max(...e.elements.map((e) => e.label.length));
|
|
2468
2472
|
return t > 15 ? 20 : t > 8 ? 24 : 28;
|
|
2469
|
-
}, [e]),
|
|
2473
|
+
}, [e]), te = !e, z = (e, t) => {
|
|
2470
2474
|
g && g(e, t);
|
|
2471
2475
|
};
|
|
2472
2476
|
return /* @__PURE__ */ p("svg", {
|
|
@@ -2487,7 +2491,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2487
2491
|
floodOpacity: "0.25"
|
|
2488
2492
|
})
|
|
2489
2493
|
}), R && R.hGenerators.map((e, t) => /* @__PURE__ */ f("marker", {
|
|
2490
|
-
id:
|
|
2494
|
+
id: O(t),
|
|
2491
2495
|
markerWidth: 13,
|
|
2492
2496
|
markerHeight: 13,
|
|
2493
2497
|
refX: 10,
|
|
@@ -2558,7 +2562,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2558
2562
|
stroke: e.color,
|
|
2559
2563
|
strokeWidth: 2.2,
|
|
2560
2564
|
opacity: .9,
|
|
2561
|
-
markerEnd: e.isBidirectional ? void 0 : `url(#${
|
|
2565
|
+
markerEnd: e.isBidirectional ? void 0 : `url(#${O(r)})`
|
|
2562
2566
|
}, `${e.fromId}-${e.toId}-${e.actionElementId}`);
|
|
2563
2567
|
}),
|
|
2564
2568
|
R.hElements.map((t) => {
|
|
@@ -2589,7 +2593,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2589
2593
|
color: "var(--node-text)",
|
|
2590
2594
|
fontSize: `${o}px`
|
|
2591
2595
|
},
|
|
2592
|
-
dangerouslySetInnerHTML: { __html:
|
|
2596
|
+
dangerouslySetInnerHTML: { __html: Q(X(t.label)) }
|
|
2593
2597
|
})
|
|
2594
2598
|
})]
|
|
2595
2599
|
}, `h-cayley-${t.id}`) : null;
|
|
@@ -2612,7 +2616,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2612
2616
|
L && e && e.elements.map((e) => {
|
|
2613
2617
|
let r = L.positions.get(e.id);
|
|
2614
2618
|
if (!r) return null;
|
|
2615
|
-
let i = t?.has(e.id) ?? !1, a = F.get(e.id), o = j?.get(e.id), s = o !== void 0 && (
|
|
2619
|
+
let i = t?.has(e.id) ?? !1, a = F.get(e.id), o = j?.get(e.id), s = o !== void 0 && (N?.has(o) ?? !1), c = "var(--node-fill)", l = "var(--node-stroke)", d = 2.5;
|
|
2616
2620
|
return i ? (c = "var(--node-fill-selected)", l = "#ffd93d", d = 3) : s && o !== void 0 && M ? (c = M[o] + "33", l = M[o], d = 3) : a && (c = a.color + "33", l = a.color, d = 2.5), /* @__PURE__ */ p("g", {
|
|
2617
2621
|
"data-coset-node": e.id,
|
|
2618
2622
|
transform: `translate(${r.x}, ${r.y})`,
|
|
@@ -2621,35 +2625,35 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2621
2625
|
},
|
|
2622
2626
|
onMouseEnter: () => {
|
|
2623
2627
|
let t = n?.scale ?? 1;
|
|
2624
|
-
|
|
2628
|
+
z(e, {
|
|
2625
2629
|
x: r.x * t + (n?.x ?? 0),
|
|
2626
2630
|
y: r.y * t + (n?.y ?? 0)
|
|
2627
2631
|
});
|
|
2628
2632
|
},
|
|
2629
|
-
onMouseLeave: () =>
|
|
2633
|
+
onMouseLeave: () => z(null),
|
|
2630
2634
|
style: { cursor: "pointer" },
|
|
2631
2635
|
children: [
|
|
2632
2636
|
/* @__PURE__ */ f("circle", {
|
|
2633
|
-
r:
|
|
2637
|
+
r: ee,
|
|
2634
2638
|
fill: c,
|
|
2635
2639
|
stroke: l,
|
|
2636
2640
|
strokeWidth: d,
|
|
2637
2641
|
filter: "url(#${shadowId})"
|
|
2638
2642
|
}),
|
|
2639
2643
|
a && /* @__PURE__ */ f("circle", {
|
|
2640
|
-
r:
|
|
2644
|
+
r: ee,
|
|
2641
2645
|
fill: `${a.color}22`,
|
|
2642
2646
|
stroke: "none"
|
|
2643
2647
|
}),
|
|
2644
2648
|
s && o !== void 0 && M && /* @__PURE__ */ f("circle", {
|
|
2645
|
-
r:
|
|
2649
|
+
r: ee,
|
|
2646
2650
|
fill: `${M[o]}22`,
|
|
2647
2651
|
stroke: "none"
|
|
2648
2652
|
}),
|
|
2649
2653
|
u && /* @__PURE__ */ f("foreignObject", {
|
|
2650
|
-
x: -
|
|
2654
|
+
x: -ee,
|
|
2651
2655
|
y: -16,
|
|
2652
|
-
width:
|
|
2656
|
+
width: ee * 2,
|
|
2653
2657
|
height: 32,
|
|
2654
2658
|
style: {
|
|
2655
2659
|
pointerEvents: "none",
|
|
@@ -2665,13 +2669,13 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2665
2669
|
color: "var(--node-text)",
|
|
2666
2670
|
fontSize: e.label.length <= 4 ? "15px" : e.label.length <= 6 ? "13px" : "10px"
|
|
2667
2671
|
},
|
|
2668
|
-
dangerouslySetInnerHTML: { __html:
|
|
2672
|
+
dangerouslySetInnerHTML: { __html: Q(X(e.label)) }
|
|
2669
2673
|
})
|
|
2670
2674
|
})
|
|
2671
2675
|
]
|
|
2672
2676
|
}, e.id);
|
|
2673
2677
|
}),
|
|
2674
|
-
|
|
2678
|
+
te && /* @__PURE__ */ f("text", {
|
|
2675
2679
|
x: r.width / 2,
|
|
2676
2680
|
y: r.height / 2,
|
|
2677
2681
|
textAnchor: "middle",
|
|
@@ -2693,13 +2697,13 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2693
2697
|
}
|
|
2694
2698
|
//#endregion
|
|
2695
2699
|
//#region src/utils/download.ts
|
|
2696
|
-
function
|
|
2700
|
+
function Ve(e, t) {
|
|
2697
2701
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
2698
2702
|
r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), setTimeout(() => URL.revokeObjectURL(n), 1e3);
|
|
2699
2703
|
}
|
|
2700
2704
|
//#endregion
|
|
2701
2705
|
//#region src/components/Canvas/TableView.tsx
|
|
2702
|
-
var
|
|
2706
|
+
var He = [
|
|
2703
2707
|
"#ff6b6b",
|
|
2704
2708
|
"#4ecdc4",
|
|
2705
2709
|
"#ffd93d",
|
|
@@ -2715,15 +2719,15 @@ var Ve = [
|
|
|
2715
2719
|
"#3071a9",
|
|
2716
2720
|
"#d35400",
|
|
2717
2721
|
"#c0392b"
|
|
2718
|
-
],
|
|
2719
|
-
function
|
|
2720
|
-
return /* @__PURE__ */ f(
|
|
2722
|
+
], Ue = 60, We = 80;
|
|
2723
|
+
function Ge(e) {
|
|
2724
|
+
return /* @__PURE__ */ f(Y, {
|
|
2721
2725
|
theme: e.theme,
|
|
2722
|
-
children: /* @__PURE__ */ f(
|
|
2726
|
+
children: /* @__PURE__ */ f(Xe, { ...e })
|
|
2723
2727
|
});
|
|
2724
2728
|
}
|
|
2725
|
-
var
|
|
2726
|
-
function
|
|
2729
|
+
var Ke = /* @__PURE__ */ new Map(), qe = [];
|
|
2730
|
+
function Je(e, t) {
|
|
2727
2731
|
let n = e.order, r = new Set([t.get(e.identity.id) ?? 0]), i = Math.max(r.size, Math.min(n, 6 + Math.floor(Math.random() * 7))), a = [];
|
|
2728
2732
|
for (let e = 0; e < n; e++) r.has(e) || a.push(e);
|
|
2729
2733
|
for (; r.size < i && a.length > 0;) {
|
|
@@ -2732,7 +2736,7 @@ function qe(e, t) {
|
|
|
2732
2736
|
}
|
|
2733
2737
|
return [...r].sort((e, t) => e - t);
|
|
2734
2738
|
}
|
|
2735
|
-
function
|
|
2739
|
+
function Ye(e, t, n) {
|
|
2736
2740
|
let r = /* @__PURE__ */ new Map(), i = (e, t) => {
|
|
2737
2741
|
let n = [...e].sort((e, t) => e - t).join(",");
|
|
2738
2742
|
r.has(n) || r.set(n, {
|
|
@@ -2769,7 +2773,7 @@ function Je(e, t, n) {
|
|
|
2769
2773
|
i(a, `⟨${e.label}⟩`);
|
|
2770
2774
|
}
|
|
2771
2775
|
}
|
|
2772
|
-
if (e.order <= 60) for (let n of
|
|
2776
|
+
if (e.order <= 60) for (let n of N(e)) {
|
|
2773
2777
|
if (n.order < 2 || n.order > 16) continue;
|
|
2774
2778
|
let e = [], r = !0;
|
|
2775
2779
|
for (let i of n.elements) {
|
|
@@ -2787,24 +2791,24 @@ function Je(e, t, n) {
|
|
|
2787
2791
|
let c = [...r.values()], l = c.filter((e) => e.order >= 6 && e.order <= 12), u = l.length > 0 ? l : c;
|
|
2788
2792
|
return u.length === 0 ? null : u[Math.floor(Math.random() * u.length)];
|
|
2789
2793
|
}
|
|
2790
|
-
function
|
|
2791
|
-
let { t: A } =
|
|
2794
|
+
function Xe({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i, subsets: o, cosetElementMap: s, cosetColors: m, cosetData: h, cosetType: g, showAllCosets: _, forceShowLargeGroup: v, onForceShowLargeGroup: y, strategy: b, cellSize: x, showHeatmap: S = !1, onStrategyChange: C, onLayoutSize: w, onSelect: T, onHover: E, noGroupText: D, maxTableOrder: O, maxHeatmapOrder: k }) {
|
|
2795
|
+
let { t: A } = Ie(), j = o ?? qe, M = s ?? Ke, N = h ?? null, P = g ?? "left", F = _ ?? !1, I = e ? e.order > 16 : !1, [L, R] = u(() => b ?? "subgroup"), [ee, te] = u(0), [ne, B] = u(!1), [V, re] = u(!1), [H, ie] = u(1), [U, W] = u(!1), [G, K] = u({
|
|
2792
2796
|
l: 0,
|
|
2793
2797
|
t: 0
|
|
2794
2798
|
}), [q, ae] = u({
|
|
2795
2799
|
w: 0,
|
|
2796
2800
|
h: 0
|
|
2797
|
-
}), oe = l(null), se = l(0), ce = l(null),
|
|
2798
|
-
y ? y(!0) :
|
|
2799
|
-
}, [y]), [
|
|
2800
|
-
b !==
|
|
2801
|
-
let
|
|
2801
|
+
}), oe = l(null), se = l(0), ce = l(null), le = l(null), [J, Y] = u(!1), ue = v ?? J, de = r(() => {
|
|
2802
|
+
y ? y(!0) : Y(!0);
|
|
2803
|
+
}, [y]), [fe, pe] = u(b);
|
|
2804
|
+
b !== fe && (pe(b), b !== void 0 && R(b));
|
|
2805
|
+
let X = r((e) => {
|
|
2802
2806
|
R(e), C?.(e);
|
|
2803
|
-
}, [C]),
|
|
2807
|
+
}, [C]), Z = c(() => {
|
|
2804
2808
|
if (!e) return /* @__PURE__ */ new Map();
|
|
2805
2809
|
let t = /* @__PURE__ */ new Map();
|
|
2806
2810
|
return e.elements.forEach((e, n) => t.set(e.id, n)), t;
|
|
2807
|
-
}, [e]),
|
|
2811
|
+
}, [e]), me = c(() => {
|
|
2808
2812
|
if (!e) return /* @__PURE__ */ new Map();
|
|
2809
2813
|
let t = /* @__PURE__ */ new Map();
|
|
2810
2814
|
return e.elements.forEach((e, n) => t.set(e.label, n)), t;
|
|
@@ -2824,18 +2828,18 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2824
2828
|
}
|
|
2825
2829
|
return i;
|
|
2826
2830
|
}, [e]), he = (e) => {
|
|
2827
|
-
let t =
|
|
2828
|
-
return t === void 0 ? "#ccc" :
|
|
2831
|
+
let t = me.get(e);
|
|
2832
|
+
return t === void 0 ? "#ccc" : He[t % He.length];
|
|
2829
2833
|
}, ge = c(() => {
|
|
2830
2834
|
let e = /* @__PURE__ */ new Set();
|
|
2831
2835
|
return t.forEach((t) => {
|
|
2832
|
-
let n =
|
|
2836
|
+
let n = Z.get(t);
|
|
2833
2837
|
n !== void 0 && e.add(n);
|
|
2834
2838
|
}), e;
|
|
2835
|
-
}, [t,
|
|
2839
|
+
}, [t, Z]), _e = c(() => e ? j.filter((e) => e.isSubgroup).map((e) => {
|
|
2836
2840
|
let t = /* @__PURE__ */ new Set();
|
|
2837
2841
|
return e.elementIds.forEach((e) => {
|
|
2838
|
-
let n =
|
|
2842
|
+
let n = Z.get(e);
|
|
2839
2843
|
n !== void 0 && t.add(n);
|
|
2840
2844
|
}), {
|
|
2841
2845
|
color: e.color,
|
|
@@ -2843,26 +2847,26 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2843
2847
|
};
|
|
2844
2848
|
}) : [], [
|
|
2845
2849
|
j,
|
|
2846
|
-
|
|
2850
|
+
Z,
|
|
2847
2851
|
e
|
|
2848
2852
|
]), ve = c(() => {
|
|
2849
2853
|
let e = /* @__PURE__ */ new Set();
|
|
2850
2854
|
for (let t of j) if (!t.isSubgroup) for (let n of t.elementIds) {
|
|
2851
|
-
let t =
|
|
2855
|
+
let t = Z.get(n);
|
|
2852
2856
|
t !== void 0 && e.add(t);
|
|
2853
2857
|
}
|
|
2854
2858
|
return e;
|
|
2855
|
-
}, [j,
|
|
2859
|
+
}, [j, Z]), ye = c(() => {
|
|
2856
2860
|
let e = /* @__PURE__ */ new Map();
|
|
2857
2861
|
for (let t of j) for (let n of t.elementIds) {
|
|
2858
|
-
let r =
|
|
2862
|
+
let r = Z.get(n);
|
|
2859
2863
|
r !== void 0 && (e.has(r) || e.set(r, {
|
|
2860
2864
|
color: t.color,
|
|
2861
2865
|
isSubgroup: t.isSubgroup
|
|
2862
2866
|
}));
|
|
2863
2867
|
}
|
|
2864
2868
|
return e;
|
|
2865
|
-
}, [j,
|
|
2869
|
+
}, [j, Z]), be = c(() => {
|
|
2866
2870
|
if (!e) return /* @__PURE__ */ new Map();
|
|
2867
2871
|
let t = /* @__PURE__ */ new Map();
|
|
2868
2872
|
for (let e of _e) for (let n of e.indices) for (let r of e.indices) t.set(`${n},${r}`, e.color);
|
|
@@ -2871,14 +2875,14 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2871
2875
|
let t = /* @__PURE__ */ new Set();
|
|
2872
2876
|
if (!e || !N) return t;
|
|
2873
2877
|
for (let e of N.subgroup.elements) {
|
|
2874
|
-
let n =
|
|
2878
|
+
let n = Z.get(e.id);
|
|
2875
2879
|
n !== void 0 && t.add(n);
|
|
2876
2880
|
}
|
|
2877
2881
|
return t;
|
|
2878
2882
|
}, [
|
|
2879
2883
|
e,
|
|
2880
2884
|
N,
|
|
2881
|
-
|
|
2885
|
+
Z
|
|
2882
2886
|
]), Se = c(() => {
|
|
2883
2887
|
if (!e || !N) return /* @__PURE__ */ new Set();
|
|
2884
2888
|
if (F) {
|
|
@@ -2911,18 +2915,18 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2911
2915
|
let e = /* @__PURE__ */ new Set();
|
|
2912
2916
|
for (let t of _e) for (let n of t.indices) e.add(n);
|
|
2913
2917
|
return e;
|
|
2914
|
-
}, [_e]), Te = c(() => !e || !I || L !== "subgroup" ? null :
|
|
2918
|
+
}, [_e]), Te = c(() => !e || !I || L !== "subgroup" ? null : Ye(e, Z, j), [
|
|
2915
2919
|
e,
|
|
2916
2920
|
I,
|
|
2917
2921
|
L,
|
|
2918
2922
|
j,
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
]), Ee = c(() => !e || !I ? [] :
|
|
2923
|
+
Z,
|
|
2924
|
+
ee
|
|
2925
|
+
]), Ee = c(() => !e || !I ? [] : Je(e, Z), [
|
|
2922
2926
|
e,
|
|
2923
2927
|
I,
|
|
2924
|
-
|
|
2925
|
-
|
|
2928
|
+
Z,
|
|
2929
|
+
ee
|
|
2926
2930
|
]), De = c(() => e ? !I || L === "full" ? e.elements.map((e, t) => t) : L === "random" ? Ee : Te ? Te.indices : Ee : [], [
|
|
2927
2931
|
e,
|
|
2928
2932
|
I,
|
|
@@ -2930,8 +2934,8 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2930
2934
|
Te,
|
|
2931
2935
|
Ee
|
|
2932
2936
|
]), Oe = c(() => {
|
|
2933
|
-
if (!e || !Q || !(S && L === "full" && e.order >
|
|
2934
|
-
let t = e.order, n = Math.min(
|
|
2937
|
+
if (!e || !Q || !(S && L === "full" && e.order > Ue)) return null;
|
|
2938
|
+
let t = e.order, n = Math.min(We, t), r = [];
|
|
2935
2939
|
for (let e = 0; e < n; e++) {
|
|
2936
2940
|
let i = Math.floor(e * t / n), a = Math.floor((e + 1) * t / n), o = Array(n);
|
|
2937
2941
|
for (let e = 0; e < n; e++) {
|
|
@@ -2939,11 +2943,11 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2939
2943
|
for (let e = i; e < a; e++) {
|
|
2940
2944
|
let t = Q[e];
|
|
2941
2945
|
for (let e = r; e < s; e++) {
|
|
2942
|
-
let n =
|
|
2946
|
+
let n = Z.get(t[e].id) ?? 0;
|
|
2943
2947
|
c.set(n, (c.get(n) ?? 0) + 1);
|
|
2944
2948
|
}
|
|
2945
2949
|
}
|
|
2946
|
-
let l =
|
|
2950
|
+
let l = Z.get(Q[i][r].id) ?? 0, u = -1;
|
|
2947
2951
|
for (let [e, t] of c) t > u && (u = t, l = e);
|
|
2948
2952
|
o[e] = l;
|
|
2949
2953
|
}
|
|
@@ -2953,10 +2957,10 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2953
2957
|
}, [
|
|
2954
2958
|
e,
|
|
2955
2959
|
Q,
|
|
2956
|
-
|
|
2960
|
+
Z,
|
|
2957
2961
|
S,
|
|
2958
2962
|
L
|
|
2959
|
-
]), ke = x ?? 50, Ae = S && e !== null && (!I || L === "full"), je = Oe ? Oe.length : De.length, Me = Math.max(4, Math.floor((Math.min(n.width, n.height) - 60) / Math.max(1, je))), $ = Ae ? Math.min(ke, Me) : ke, Ne = e ?
|
|
2963
|
+
]), ke = x ?? 50, Ae = S && e !== null && (!I || L === "full"), je = Oe ? Oe.length : De.length, Me = Math.max(4, Math.floor((Math.min(n.width, n.height) - 60) / Math.max(1, je))), $ = Ae ? Math.min(ke, Me) : ke, Ne = e ? z(e.order, S ? "heatmap" : "table", S ? k : O) && !ue : !1, Pe = !S && I && L === "full" && !!e && e.order > 30 && !V;
|
|
2960
2964
|
a(() => {
|
|
2961
2965
|
if (!e || !Q) {
|
|
2962
2966
|
w?.(null);
|
|
@@ -2982,61 +2986,61 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2982
2986
|
w,
|
|
2983
2987
|
S
|
|
2984
2988
|
]);
|
|
2985
|
-
let
|
|
2986
|
-
|
|
2987
|
-
}, [
|
|
2989
|
+
let Fe = r(() => {
|
|
2990
|
+
re(!1), X("subgroup");
|
|
2991
|
+
}, [X]);
|
|
2988
2992
|
a(() => {
|
|
2989
2993
|
if (!V) return;
|
|
2990
2994
|
let e = (e) => {
|
|
2991
|
-
e.key === "Escape" &&
|
|
2995
|
+
e.key === "Escape" && Fe();
|
|
2992
2996
|
};
|
|
2993
2997
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2994
|
-
}, [V,
|
|
2998
|
+
}, [V, Fe]), a(() => {
|
|
2995
2999
|
if (V) {
|
|
2996
3000
|
let e = oe.current;
|
|
2997
3001
|
e && (e.scrollLeft = 0, e.scrollTop = 0);
|
|
2998
3002
|
}
|
|
2999
3003
|
}, [V]);
|
|
3000
3004
|
let Le = () => {
|
|
3001
|
-
|
|
3005
|
+
ie(1), re(!0);
|
|
3002
3006
|
}, Re = (t) => {
|
|
3003
3007
|
if (t === L) {
|
|
3004
|
-
|
|
3008
|
+
te((e) => e + 1);
|
|
3005
3009
|
return;
|
|
3006
3010
|
}
|
|
3007
3011
|
if (t === "full") {
|
|
3008
3012
|
if (!S && e && e.order > 30) {
|
|
3009
|
-
|
|
3013
|
+
B(!0);
|
|
3010
3014
|
return;
|
|
3011
3015
|
}
|
|
3012
|
-
|
|
3016
|
+
X("full");
|
|
3013
3017
|
return;
|
|
3014
3018
|
}
|
|
3015
|
-
|
|
3019
|
+
X(t);
|
|
3016
3020
|
}, ze = () => {
|
|
3017
|
-
|
|
3018
|
-
},
|
|
3021
|
+
B(!1), Le();
|
|
3022
|
+
}, Be = r((e, t, n) => {
|
|
3019
3023
|
let r = oe.current;
|
|
3020
3024
|
if (!r) return;
|
|
3021
|
-
let i = r.getBoundingClientRect(), a = t ?? i.width / 2, o = n ?? i.height / 2, s = (r.scrollLeft + a) /
|
|
3022
|
-
|
|
3025
|
+
let i = r.getBoundingClientRect(), a = t ?? i.width / 2, o = n ?? i.height / 2, s = (r.scrollLeft + a) / H, c = (r.scrollTop + o) / H, l = Math.min(6, Math.max(.25, H * e));
|
|
3026
|
+
ie(l), requestAnimationFrame(() => {
|
|
3023
3027
|
r.scrollLeft = s * l - a, r.scrollTop = c * l - o;
|
|
3024
3028
|
});
|
|
3025
|
-
}, [
|
|
3026
|
-
|
|
3029
|
+
}, [H]), Ge = (e) => {
|
|
3030
|
+
Be(e / 100 / H);
|
|
3027
3031
|
}, Xe = (e) => {
|
|
3028
3032
|
let t = oe.current;
|
|
3029
|
-
t && (
|
|
3033
|
+
t && (le.current = {
|
|
3030
3034
|
x: e.clientX,
|
|
3031
3035
|
y: e.clientY,
|
|
3032
3036
|
sl: t.scrollLeft,
|
|
3033
3037
|
st: t.scrollTop
|
|
3034
|
-
},
|
|
3038
|
+
}, W(!0), t.setPointerCapture(e.pointerId));
|
|
3035
3039
|
}, Ze = (e) => {
|
|
3036
|
-
let t = oe.current, n =
|
|
3040
|
+
let t = oe.current, n = le.current;
|
|
3037
3041
|
!t || !n || (t.scrollLeft = n.sl - (e.clientX - n.x), t.scrollTop = n.st - (e.clientY - n.y));
|
|
3038
3042
|
}, Qe = () => {
|
|
3039
|
-
|
|
3043
|
+
le.current = null, W(!1);
|
|
3040
3044
|
}, $e = r(() => {
|
|
3041
3045
|
let e = oe.current;
|
|
3042
3046
|
!e || se.current || (se.current = requestAnimationFrame(() => {
|
|
@@ -3064,17 +3068,17 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3064
3068
|
let t = ce.current;
|
|
3065
3069
|
if (!t || !e) return;
|
|
3066
3070
|
let n = t.cloneNode(!0), r = (t.getAttribute("viewBox") || "0 0 800 600").trim().split(/\s+/).map(Number);
|
|
3067
|
-
n.setAttribute("width", String(r[2] || 800)), n.setAttribute("height", String(r[3] || 600)), n.removeAttribute("style"),
|
|
3071
|
+
n.setAttribute("width", String(r[2] || 800)), n.setAttribute("height", String(r[3] || 600)), n.removeAttribute("style"), Ve(new Blob([new XMLSerializer().serializeToString(n)], { type: "image/svg+xml;charset=utf-8" }), `table_${e.symbol.replace(/[^A-Za-z0-9]+/g, "_")}_${e.order}x${e.order}.svg`);
|
|
3068
3072
|
};
|
|
3069
3073
|
if (!e || !Q) return /* @__PURE__ */ f("div", {
|
|
3070
3074
|
className: "view-empty",
|
|
3071
3075
|
children: /* @__PURE__ */ f("p", { children: D ?? A("canvas.noGroup") })
|
|
3072
3076
|
});
|
|
3073
|
-
if (
|
|
3077
|
+
if (z(e.order, "table", O) && !ue) return /* @__PURE__ */ p("div", {
|
|
3074
3078
|
className: "large-group-warning",
|
|
3075
3079
|
children: [/* @__PURE__ */ f("p", { children: A("canvas.orderTooLarge", { n: e.order }) }), /* @__PURE__ */ f("button", {
|
|
3076
3080
|
className: "panel-btn",
|
|
3077
|
-
onClick:
|
|
3081
|
+
onClick: de,
|
|
3078
3082
|
children: A("canvas.show")
|
|
3079
3083
|
})]
|
|
3080
3084
|
});
|
|
@@ -3128,7 +3132,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3128
3132
|
transform: `translate(${i.x}, ${i.y}) scale(${i.scale}) translate(${ot}, ${st})`,
|
|
3129
3133
|
children: [
|
|
3130
3134
|
!S && De.map((e, t) => {
|
|
3131
|
-
let n = tt[e], r = ge.has(e), i = ye.get(e), a = we.has(e), o = N !== null, s = Se.has(n.id), c = M.get(n.id), l = s && c !== void 0, u =
|
|
3135
|
+
let n = tt[e], r = ge.has(e), i = ye.get(e), a = we.has(e), o = N !== null, s = Se.has(n.id), c = M.get(n.id), l = s && c !== void 0, u = He[e % He.length], d = null;
|
|
3132
3136
|
return !o && r ? d = "#ffd93d33" : l ? d = (m ?? [])[c] + "33" : !o && a && i && (d = i.color + "33"), !o && r && (u = "#ffd93d"), /* @__PURE__ */ p("g", {
|
|
3133
3137
|
transform: `translate(0, ${t * ke})`,
|
|
3134
3138
|
onClick: () => T?.(n.id, !0),
|
|
@@ -3154,7 +3158,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3154
3158
|
}, n.id);
|
|
3155
3159
|
}),
|
|
3156
3160
|
!S && De.map((e, t) => {
|
|
3157
|
-
let n = tt[e], r = ge.has(e), i = ye.get(e), a = we.has(e), o = N !== null, s = Ce.has(n.id), c = M.get(n.id), l = s && c !== void 0, u =
|
|
3161
|
+
let n = tt[e], r = ge.has(e), i = ye.get(e), a = we.has(e), o = N !== null, s = Ce.has(n.id), c = M.get(n.id), l = s && c !== void 0, u = He[e % He.length], d = null;
|
|
3158
3162
|
return !o && r ? d = "#ffd93d33" : l ? d = (m ?? [])[c] + "33" : !o && a && i && (d = i.color + "33"), !o && r && (u = "#ffd93d"), /* @__PURE__ */ p("g", {
|
|
3159
3163
|
onClick: () => T?.(n.id, !0),
|
|
3160
3164
|
style: { cursor: "pointer" },
|
|
@@ -3179,7 +3183,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3179
3183
|
}, `head-${n.id}`);
|
|
3180
3184
|
}),
|
|
3181
3185
|
Oe && Oe.map((e, t) => e.map((e, n) => {
|
|
3182
|
-
let r =
|
|
3186
|
+
let r = He[e % He.length], i = $ <= 8 ? .5 : $ <= 20 ? 1 : 2, a = $ <= 8 ? 1 : $ <= 20 ? 2 : 3;
|
|
3183
3187
|
return /* @__PURE__ */ f("g", {
|
|
3184
3188
|
transform: `translate(${n * $}, ${t * $})`,
|
|
3185
3189
|
children: /* @__PURE__ */ f("rect", {
|
|
@@ -3193,7 +3197,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3193
3197
|
}, `agg-${t}-${n}`);
|
|
3194
3198
|
})),
|
|
3195
3199
|
!Oe && De.map((t, n) => De.map((r, i) => {
|
|
3196
|
-
let a = tt[t], o = tt[r], s = Q[t][r], c = he(s.label), l = ge.has(t), u = ge.has(r), d = `${t},${r}`, h = be.get(d), g =
|
|
3200
|
+
let a = tt[t], o = tt[r], s = Q[t][r], c = he(s.label), l = ge.has(t), u = ge.has(r), d = `${t},${r}`, h = be.get(d), g = Z.get(e.identity.id) ?? -1, _ = g >= 0 && t === g && ve.has(r), v = g >= 0 && r === g && ve.has(t), y = xe.has(r), b = xe.has(t), x = N !== null, C = Se.has(a.id), w = Ce.has(o.id), D = P === "left" && C && y || P === "right" && w && b;
|
|
3197
3201
|
if (S) {
|
|
3198
3202
|
let e = $ <= 8 ? .5 : $ <= 20 ? 1 : 2, t = $ <= 8 ? 1 : $ <= 20 ? 2 : 3, r = c, d = "rgba(0,0,0,0.18)", p = $ <= 8 ? .2 : .5;
|
|
3199
3203
|
if (D) {
|
|
@@ -3283,7 +3287,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3283
3287
|
})
|
|
3284
3288
|
]
|
|
3285
3289
|
}),
|
|
3286
|
-
|
|
3290
|
+
ne && /* @__PURE__ */ f("div", {
|
|
3287
3291
|
className: "table-confirm-overlay",
|
|
3288
3292
|
children: /* @__PURE__ */ p("div", {
|
|
3289
3293
|
className: "table-confirm-modal",
|
|
@@ -3300,7 +3304,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3300
3304
|
className: "table-confirm-actions",
|
|
3301
3305
|
children: [/* @__PURE__ */ f("button", {
|
|
3302
3306
|
className: "panel-btn",
|
|
3303
|
-
onClick: () =>
|
|
3307
|
+
onClick: () => B(!1),
|
|
3304
3308
|
children: A("table.confirmCancel")
|
|
3305
3309
|
}), /* @__PURE__ */ f("button", {
|
|
3306
3310
|
className: "panel-btn",
|
|
@@ -3327,19 +3331,19 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3327
3331
|
/* @__PURE__ */ f("button", {
|
|
3328
3332
|
className: "table-fs-btn",
|
|
3329
3333
|
title: A("table.fullZoomOut"),
|
|
3330
|
-
onClick: () =>
|
|
3334
|
+
onClick: () => Be(1 / 1.25),
|
|
3331
3335
|
children: "−"
|
|
3332
3336
|
}),
|
|
3333
3337
|
/* @__PURE__ */ f("button", {
|
|
3334
3338
|
className: "table-fs-btn",
|
|
3335
3339
|
title: A("table.fullZoomIn"),
|
|
3336
|
-
onClick: () =>
|
|
3340
|
+
onClick: () => Be(1.25),
|
|
3337
3341
|
children: "+"
|
|
3338
3342
|
}),
|
|
3339
3343
|
/* @__PURE__ */ f("button", {
|
|
3340
3344
|
className: "table-fs-btn",
|
|
3341
3345
|
title: A("table.fullZoomReset"),
|
|
3342
|
-
onClick: () =>
|
|
3346
|
+
onClick: () => Be(1 / H),
|
|
3343
3347
|
children: "⟳"
|
|
3344
3348
|
}),
|
|
3345
3349
|
/* @__PURE__ */ f("input", {
|
|
@@ -3348,9 +3352,9 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3348
3352
|
min: 25,
|
|
3349
3353
|
max: 600,
|
|
3350
3354
|
step: 1,
|
|
3351
|
-
value: Math.round(
|
|
3355
|
+
value: Math.round(H * 100),
|
|
3352
3356
|
"aria-label": A("table.zoomSlider"),
|
|
3353
|
-
onChange: (e) =>
|
|
3357
|
+
onChange: (e) => Ge(Number(e.target.value))
|
|
3354
3358
|
}),
|
|
3355
3359
|
/* @__PURE__ */ f("button", {
|
|
3356
3360
|
className: "panel-btn",
|
|
@@ -3359,13 +3363,13 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3359
3363
|
}),
|
|
3360
3364
|
/* @__PURE__ */ f("button", {
|
|
3361
3365
|
className: "panel-btn",
|
|
3362
|
-
onClick:
|
|
3366
|
+
onClick: Fe,
|
|
3363
3367
|
children: A("table.fullExit")
|
|
3364
3368
|
})
|
|
3365
3369
|
]
|
|
3366
3370
|
})]
|
|
3367
3371
|
}), /* @__PURE__ */ f("div", {
|
|
3368
|
-
className: `table-fullscreen-body${
|
|
3372
|
+
className: `table-fullscreen-body${U ? " dragging" : ""}`,
|
|
3369
3373
|
ref: oe,
|
|
3370
3374
|
onScroll: $e,
|
|
3371
3375
|
onPointerDown: Xe,
|
|
@@ -3373,14 +3377,14 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3373
3377
|
onPointerUp: Qe,
|
|
3374
3378
|
onPointerLeave: Qe,
|
|
3375
3379
|
children: (() => {
|
|
3376
|
-
let t = e.order, n = t * 32 + 44 + 16, r = t * 32 + 26 + 34, i =
|
|
3380
|
+
let t = e.order, n = t * 32 + 44 + 16, r = t * 32 + 26 + 34, i = Z.get(e.identity.id) ?? -1, a = q.w || 960, o = q.h || 600, s = G.l / H, c = G.t / H, l = a / H, u = o / H, d = Math.max(0, Math.floor((s - 44) / 32) - 3), h = Math.min(t - 1, Math.ceil((s + l - 44) / 32) + 3), g = Math.max(0, Math.floor((c - 26) / 32) - 3), _ = Math.min(t - 1, Math.ceil((c + u - 26) / 32) + 3), v = Array.from({ length: _ - g + 1 }, (e, t) => g + t), y = Array.from({ length: h - d + 1 }, (e, t) => d + t);
|
|
3377
3381
|
return /* @__PURE__ */ p("svg", {
|
|
3378
3382
|
ref: ce,
|
|
3379
3383
|
className: "table-fullscreen-svg",
|
|
3380
3384
|
viewBox: `0 0 ${n} ${r}`,
|
|
3381
3385
|
style: {
|
|
3382
|
-
width: n *
|
|
3383
|
-
height: r *
|
|
3386
|
+
width: n * H,
|
|
3387
|
+
height: r * H
|
|
3384
3388
|
},
|
|
3385
3389
|
children: [/* @__PURE__ */ p("g", {
|
|
3386
3390
|
transform: `translate(${S ? 8 : 44}, ${S ? 8 : 26})`,
|
|
@@ -3391,7 +3395,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3391
3395
|
x: -6,
|
|
3392
3396
|
y: e * 32 + 32 / 2 + 4,
|
|
3393
3397
|
textAnchor: "end",
|
|
3394
|
-
fill:
|
|
3398
|
+
fill: He[e % He.length],
|
|
3395
3399
|
fontSize: 11,
|
|
3396
3400
|
fontFamily: "serif",
|
|
3397
3401
|
children: t.label
|
|
@@ -3403,7 +3407,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3403
3407
|
x: e * 32 + 32 / 2,
|
|
3404
3408
|
y: -6,
|
|
3405
3409
|
textAnchor: "middle",
|
|
3406
|
-
fill:
|
|
3410
|
+
fill: He[e % He.length],
|
|
3407
3411
|
fontSize: 11,
|
|
3408
3412
|
fontFamily: "serif",
|
|
3409
3413
|
children: t.label
|
|
@@ -3472,15 +3476,15 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3472
3476
|
}
|
|
3473
3477
|
//#endregion
|
|
3474
3478
|
//#region src/components/Canvas/ActionScene.tsx
|
|
3475
|
-
var
|
|
3476
|
-
function
|
|
3479
|
+
var Ze = 28, Qe = 26, $e = 90, et = 100, tt = 30, nt = 10, rt = tt + 10, it = 8, at = 8, ot = 18, st = 14, ct = "#ffd93d", lt = 44;
|
|
3480
|
+
function ut(e) {
|
|
3477
3481
|
return e <= 1 ? 52 : Math.max(52, Math.ceil(110 / Math.sin(Math.PI / e)));
|
|
3478
3482
|
}
|
|
3479
|
-
function
|
|
3483
|
+
function dt(e, t, n, r = 10) {
|
|
3480
3484
|
let i = n - Math.PI / 6, a = n + Math.PI / 6;
|
|
3481
3485
|
return `${e},${t} ${e - Math.cos(i) * r},${t - Math.sin(i) * r} ${e - Math.cos(a) * r},${t - Math.sin(a) * r}`;
|
|
3482
3486
|
}
|
|
3483
|
-
function
|
|
3487
|
+
function ft({ sx: e, sy: t, ex: n, ey: r, color: i, width: a = 2.2, dashed: o, dir: s = 1, opacity: c = .85, headSize: l = 12, nodeR: u = 0, offset: d = 0, tFrom: m, onClick: h, onDrop: g, highlight: _ }) {
|
|
3484
3488
|
let v = n - e, y = r - t, b = Math.sqrt(v * v + y * y) || 1, x = v / b, S = y / b, C = Math.min(l * 1.25, Math.max(12, b * .25)), w = Math.min(l, C), T = m ? m.x : -S, E = m ? m.y : x, D = e + x * u + T * d, O = t + S * u + E * d, k = n - x * (u + C) + T * d, A = r - S * (u + C) + E * d, j = (D + k) / 2, M = (O + A) / 2, N = Math.atan2(A - M, k - j), P = `M${D},${O} Q${j},${M} ${k},${A}`;
|
|
3485
3489
|
return /* @__PURE__ */ p("g", { children: [
|
|
3486
3490
|
/* @__PURE__ */ f("path", {
|
|
@@ -3493,7 +3497,7 @@ function dt({ sx: e, sy: t, ex: n, ey: r, color: i, width: a = 2.2, dashed: o, d
|
|
|
3493
3497
|
strokeLinecap: "round"
|
|
3494
3498
|
}),
|
|
3495
3499
|
/* @__PURE__ */ f("polygon", {
|
|
3496
|
-
points:
|
|
3500
|
+
points: dt(k, A, N, w),
|
|
3497
3501
|
fill: i,
|
|
3498
3502
|
stroke: i,
|
|
3499
3503
|
strokeWidth: .5,
|
|
@@ -3502,7 +3506,7 @@ function dt({ sx: e, sy: t, ex: n, ey: r, color: i, width: a = 2.2, dashed: o, d
|
|
|
3502
3506
|
_ && /* @__PURE__ */ f("path", {
|
|
3503
3507
|
d: P,
|
|
3504
3508
|
fill: "none",
|
|
3505
|
-
stroke:
|
|
3509
|
+
stroke: ct,
|
|
3506
3510
|
strokeWidth: 6.5,
|
|
3507
3511
|
strokeDasharray: o ? "8 5" : void 0,
|
|
3508
3512
|
strokeOpacity: .95,
|
|
@@ -3530,8 +3534,8 @@ function dt({ sx: e, sy: t, ex: n, ey: r, color: i, width: a = 2.2, dashed: o, d
|
|
|
3530
3534
|
})
|
|
3531
3535
|
] });
|
|
3532
3536
|
}
|
|
3533
|
-
function
|
|
3534
|
-
let m = r ? "var(--node-fill-selected)" : "var(--node-fill)", h = r ?
|
|
3537
|
+
function pt({ x: e, y: t, label: n, isSelected: r, isFixed: i, nodeR: a = Ze, onClick: o, onPointerDown: s, showNumber: c, onHoverIn: l, onHoverOut: u, testId: d }) {
|
|
3538
|
+
let m = r ? "var(--node-fill-selected)" : "var(--node-fill)", h = r ? ct : "var(--node-stroke)";
|
|
3535
3539
|
return /* @__PURE__ */ p("g", {
|
|
3536
3540
|
transform: `translate(${e}, ${t})`,
|
|
3537
3541
|
onClick: (e) => {
|
|
@@ -3554,7 +3558,7 @@ function ft({ x: e, y: t, label: n, isSelected: r, isFixed: i, nodeR: a = Xe, on
|
|
|
3554
3558
|
x: a - 2,
|
|
3555
3559
|
y: -(a + 2),
|
|
3556
3560
|
textAnchor: "middle",
|
|
3557
|
-
fill:
|
|
3561
|
+
fill: ct,
|
|
3558
3562
|
fontSize: 13,
|
|
3559
3563
|
fontWeight: "bold",
|
|
3560
3564
|
children: "★"
|
|
@@ -3592,7 +3596,7 @@ function ft({ x: e, y: t, label: n, isSelected: r, isFixed: i, nodeR: a = Xe, on
|
|
|
3592
3596
|
]
|
|
3593
3597
|
});
|
|
3594
3598
|
}
|
|
3595
|
-
function
|
|
3599
|
+
function mt({ label: e, color: t, symbol: n, isSelected: r, onClick: i, onHover: a, onPointerDown: o }) {
|
|
3596
3600
|
return /* @__PURE__ */ p("g", {
|
|
3597
3601
|
onClick: (e) => {
|
|
3598
3602
|
e.stopPropagation(), i();
|
|
@@ -3605,17 +3609,17 @@ function pt({ label: e, color: t, symbol: n, isSelected: r, onClick: i, onHover:
|
|
|
3605
3609
|
touchAction: "none"
|
|
3606
3610
|
},
|
|
3607
3611
|
children: [/* @__PURE__ */ f("rect", {
|
|
3608
|
-
width:
|
|
3609
|
-
height:
|
|
3612
|
+
width: et,
|
|
3613
|
+
height: tt,
|
|
3610
3614
|
rx: 6,
|
|
3611
3615
|
fill: r ? "var(--node-fill-selected)" : "var(--node-fill)",
|
|
3612
|
-
stroke: r ?
|
|
3616
|
+
stroke: r ? ct : t || "var(--node-stroke)",
|
|
3613
3617
|
strokeWidth: r ? 2.5 : 1.5
|
|
3614
3618
|
}), /* @__PURE__ */ f("foreignObject", {
|
|
3615
3619
|
x: 0,
|
|
3616
3620
|
y: 0,
|
|
3617
|
-
width:
|
|
3618
|
-
height:
|
|
3621
|
+
width: et,
|
|
3622
|
+
height: tt,
|
|
3619
3623
|
style: {
|
|
3620
3624
|
pointerEvents: "none",
|
|
3621
3625
|
userSelect: "none"
|
|
@@ -3637,27 +3641,27 @@ function pt({ label: e, color: t, symbol: n, isSelected: r, onClick: i, onHover:
|
|
|
3637
3641
|
})]
|
|
3638
3642
|
});
|
|
3639
3643
|
}
|
|
3640
|
-
var
|
|
3641
|
-
function
|
|
3644
|
+
var ht = "#f59e0b";
|
|
3645
|
+
function gt(e, t, n, r) {
|
|
3642
3646
|
let i = 1 - r;
|
|
3643
3647
|
return {
|
|
3644
3648
|
x: i * i * e.x + 2 * i * r * t.x + r * r * n.x,
|
|
3645
3649
|
y: i * i * e.y + 2 * i * r * t.y + r * r * n.y
|
|
3646
3650
|
};
|
|
3647
3651
|
}
|
|
3648
|
-
function
|
|
3652
|
+
function _t(e, t, n) {
|
|
3649
3653
|
let r = t.x - e.x, i = t.y - e.y, a = Math.sqrt(r * r + i * i) || 1, o = -i / a, s = r / a, c = {
|
|
3650
3654
|
x: (e.x + t.x) / 2 + o * 8,
|
|
3651
3655
|
y: (e.y + t.y) / 2 + s * 8
|
|
3652
3656
|
}, l = Infinity;
|
|
3653
3657
|
for (let r = 0; r <= 20; r++) {
|
|
3654
|
-
let i =
|
|
3658
|
+
let i = gt(e, c, t, r / 20);
|
|
3655
3659
|
l = Math.min(l, Math.hypot(i.x - n.x, i.y - n.y));
|
|
3656
3660
|
}
|
|
3657
3661
|
return l;
|
|
3658
3662
|
}
|
|
3659
|
-
function
|
|
3660
|
-
let { t: m } =
|
|
3663
|
+
function vt({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArrow: o, onBindArrow: s, onRemoveArrow: c, onReplaceGenArrows: d }) {
|
|
3664
|
+
let { t: m } = Ie(), [h, g] = u(null), [_, v] = u(null), [y, b] = u(null), [x, S] = u(null), w = l(null), T = l(!1), E = l(null), D = l(null), O = l(!1), k = l(null), A = r, j = Math.max(220, A * 22), M = t / 2, N = n / 2 + 40, P = (e) => {
|
|
3661
3665
|
let t = e / A * 2 * Math.PI - Math.PI / 2;
|
|
3662
3666
|
return {
|
|
3663
3667
|
x: M + Math.cos(t) * j,
|
|
@@ -3692,14 +3696,14 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3692
3696
|
let r = null, a = 48;
|
|
3693
3697
|
i.forEach((e, t) => {
|
|
3694
3698
|
if (e.generatorId !== null) return;
|
|
3695
|
-
let i =
|
|
3699
|
+
let i = _t(P(e.from), P(e.to), n);
|
|
3696
3700
|
i < a && (a = i, r = t);
|
|
3697
3701
|
}), k.current = r, b(r), v((e) => e && {
|
|
3698
3702
|
...e,
|
|
3699
3703
|
x: n.x,
|
|
3700
3704
|
y: n.y
|
|
3701
3705
|
});
|
|
3702
|
-
},
|
|
3706
|
+
}, ee = () => {
|
|
3703
3707
|
if (!E.current) return;
|
|
3704
3708
|
let e = k.current, t = O.current, n = E.current.symbol;
|
|
3705
3709
|
if (E.current = null, D.current = null, k.current = null, v(null), b(null), t && e !== null) {
|
|
@@ -3709,7 +3713,7 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3709
3713
|
window.setTimeout(() => {
|
|
3710
3714
|
O.current = !1;
|
|
3711
3715
|
}, 0);
|
|
3712
|
-
},
|
|
3716
|
+
}, te = (e, t) => {
|
|
3713
3717
|
if (e.button !== 0 || w.current) return;
|
|
3714
3718
|
let n = e.currentTarget.ownerSVGElement;
|
|
3715
3719
|
if (!n) return;
|
|
@@ -3721,13 +3725,13 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3721
3725
|
snap: null,
|
|
3722
3726
|
justStarted: !0,
|
|
3723
3727
|
justPicked: !1
|
|
3724
|
-
},
|
|
3728
|
+
}, S({
|
|
3725
3729
|
from: t,
|
|
3726
3730
|
x: r.x,
|
|
3727
3731
|
y: r.y,
|
|
3728
3732
|
snap: null
|
|
3729
3733
|
});
|
|
3730
|
-
},
|
|
3734
|
+
}, z = (e) => {
|
|
3731
3735
|
let t = w.current;
|
|
3732
3736
|
if (!t) return;
|
|
3733
3737
|
let n = e.currentTarget.ownerSVGElement;
|
|
@@ -3737,7 +3741,7 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3737
3741
|
let i = null;
|
|
3738
3742
|
for (let e = 0; e < A; e++) {
|
|
3739
3743
|
let t = P(e);
|
|
3740
|
-
if (Math.hypot(r.x - t.x, r.y - t.y) <
|
|
3744
|
+
if (Math.hypot(r.x - t.x, r.y - t.y) < lt) {
|
|
3741
3745
|
i = e;
|
|
3742
3746
|
break;
|
|
3743
3747
|
}
|
|
@@ -3745,19 +3749,19 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3745
3749
|
w.current = {
|
|
3746
3750
|
...t,
|
|
3747
3751
|
snap: i
|
|
3748
|
-
},
|
|
3752
|
+
}, S((e) => e && {
|
|
3749
3753
|
...e,
|
|
3750
3754
|
x: r.x,
|
|
3751
3755
|
y: r.y,
|
|
3752
3756
|
snap: i
|
|
3753
3757
|
});
|
|
3754
|
-
},
|
|
3755
|
-
o(e, t, h), w.current = null,
|
|
3756
|
-
},
|
|
3758
|
+
}, ne = (e, t) => {
|
|
3759
|
+
o(e, t, h), w.current = null, S(null);
|
|
3760
|
+
}, B = () => {
|
|
3757
3761
|
let e = w.current;
|
|
3758
3762
|
if (e) {
|
|
3759
3763
|
if (T.current) {
|
|
3760
|
-
w.current = null,
|
|
3764
|
+
w.current = null, S(null), e.snap !== null && e.snap !== e.from && o(e.from, e.snap, h);
|
|
3761
3765
|
return;
|
|
3762
3766
|
}
|
|
3763
3767
|
e.justStarted && (w.current = {
|
|
@@ -3766,12 +3770,12 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3766
3770
|
justPicked: !0
|
|
3767
3771
|
});
|
|
3768
3772
|
}
|
|
3769
|
-
}, V = e.generators.length,
|
|
3770
|
-
transform: `translate(60, ${
|
|
3773
|
+
}, V = e.generators.length, re = N - (V - 1) / 2 * rt, H = e.generators.map((e, t) => /* @__PURE__ */ f("g", {
|
|
3774
|
+
transform: `translate(60, ${re + t * rt})`,
|
|
3771
3775
|
onPointerMove: R,
|
|
3772
|
-
onPointerUp:
|
|
3773
|
-
children: /* @__PURE__ */ f(
|
|
3774
|
-
label:
|
|
3776
|
+
onPointerUp: ee,
|
|
3777
|
+
children: /* @__PURE__ */ f(mt, {
|
|
3778
|
+
label: Q(X(e.symbol)),
|
|
3775
3779
|
color: e.color,
|
|
3776
3780
|
symbol: e.symbol,
|
|
3777
3781
|
isSelected: h === e.symbol,
|
|
@@ -3780,22 +3784,22 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3780
3784
|
},
|
|
3781
3785
|
onPointerDown: L
|
|
3782
3786
|
})
|
|
3783
|
-
}, `genchip-${t}`)),
|
|
3787
|
+
}, `genchip-${t}`)), ie = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map();
|
|
3784
3788
|
i.forEach((e, t) => {
|
|
3785
3789
|
if (e.from === e.to) return;
|
|
3786
|
-
let n = `${Math.min(e.from, e.to)}|${Math.max(e.from, e.to)}`, r = e.from < e.to ? `${n}f` : `${n}b`, i =
|
|
3787
|
-
|
|
3790
|
+
let n = `${Math.min(e.from, e.to)}|${Math.max(e.from, e.to)}`, r = e.from < e.to ? `${n}f` : `${n}b`, i = ie.get(r) ?? 0;
|
|
3791
|
+
ie.set(r, i + 1), U.set(t, i);
|
|
3788
3792
|
});
|
|
3789
|
-
let
|
|
3793
|
+
let W = /* @__PURE__ */ new Map();
|
|
3790
3794
|
i.forEach((e, t) => {
|
|
3791
3795
|
if (e.from !== e.to) return;
|
|
3792
|
-
let n =
|
|
3793
|
-
n ? n.push(t) :
|
|
3796
|
+
let n = W.get(e.from);
|
|
3797
|
+
n ? n.push(t) : W.set(e.from, [t]);
|
|
3794
3798
|
});
|
|
3795
3799
|
let G = /* @__PURE__ */ new Map();
|
|
3796
|
-
|
|
3800
|
+
W.forEach((e) => e.forEach((e, t) => G.set(e, t)));
|
|
3797
3801
|
let K = i.map((e, t) => {
|
|
3798
|
-
let n = P(e.from), r = P(e.to), i = e.generatorId === null, a = e.generatorId === null ?
|
|
3802
|
+
let n = P(e.from), r = P(e.to), i = e.generatorId === null, a = e.generatorId === null ? ht : F(e.generatorId), o = () => {
|
|
3799
3803
|
O.current || (i ? h ? s(e.from, e.to, h) : c(e.from, null, e.to) : c(e.from, e.generatorId));
|
|
3800
3804
|
};
|
|
3801
3805
|
if (e.from === e.to) {
|
|
@@ -3832,8 +3836,8 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3832
3836
|
]
|
|
3833
3837
|
}, `loop-${e.generatorId ?? "u"}-${e.from}`);
|
|
3834
3838
|
}
|
|
3835
|
-
let l = 8 + (
|
|
3836
|
-
return /* @__PURE__ */ f(
|
|
3839
|
+
let l = 8 + (U.get(t) ?? 0) * 18;
|
|
3840
|
+
return /* @__PURE__ */ f(ft, {
|
|
3837
3841
|
sx: n.x,
|
|
3838
3842
|
sy: n.y,
|
|
3839
3843
|
ex: r.x,
|
|
@@ -3848,10 +3852,10 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3848
3852
|
highlight: y === t,
|
|
3849
3853
|
onClick: o
|
|
3850
3854
|
}, `${e.from}-${t}`);
|
|
3851
|
-
}), q =
|
|
3855
|
+
}), q = re + V * rt + 16, ae = C(h === null ? i.filter((e) => e.generatorId === null) : i.some((e) => e.generatorId === h) ? i.filter((e) => e.generatorId === h) : i.filter((e) => e.generatorId === null), A);
|
|
3852
3856
|
return /* @__PURE__ */ p("g", {
|
|
3853
|
-
onPointerMove:
|
|
3854
|
-
onPointerUp:
|
|
3857
|
+
onPointerMove: z,
|
|
3858
|
+
onPointerUp: B,
|
|
3855
3859
|
children: [
|
|
3856
3860
|
/* @__PURE__ */ f("rect", {
|
|
3857
3861
|
x: 0,
|
|
@@ -3860,10 +3864,10 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3860
3864
|
height: n,
|
|
3861
3865
|
fill: "transparent",
|
|
3862
3866
|
onClick: () => {
|
|
3863
|
-
w.current = null,
|
|
3867
|
+
w.current = null, S(null);
|
|
3864
3868
|
}
|
|
3865
3869
|
}),
|
|
3866
|
-
|
|
3870
|
+
H,
|
|
3867
3871
|
ae.length > 0 && /* @__PURE__ */ f("foreignObject", {
|
|
3868
3872
|
x: 0,
|
|
3869
3873
|
y: 24,
|
|
@@ -3923,19 +3927,19 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3923
3927
|
children: m("action.genSelectHint")
|
|
3924
3928
|
}),
|
|
3925
3929
|
K,
|
|
3926
|
-
x && /* @__PURE__ */ f(
|
|
3930
|
+
x && /* @__PURE__ */ f(ft, {
|
|
3927
3931
|
sx: P(x.from).x,
|
|
3928
3932
|
sy: P(x.from).y,
|
|
3929
3933
|
ex: x.snap === null ? x.x : P(x.snap).x,
|
|
3930
3934
|
ey: x.snap === null ? x.y : P(x.snap).y,
|
|
3931
|
-
color:
|
|
3935
|
+
color: ct,
|
|
3932
3936
|
width: 3,
|
|
3933
3937
|
headSize: 13,
|
|
3934
3938
|
nodeR: 20,
|
|
3935
3939
|
dashed: !0,
|
|
3936
3940
|
opacity: .9
|
|
3937
3941
|
}),
|
|
3938
|
-
Array.from({ length: A }, (e, t) => /* @__PURE__ */ f(
|
|
3942
|
+
Array.from({ length: A }, (e, t) => /* @__PURE__ */ f(pt, {
|
|
3939
3943
|
x: P(t).x,
|
|
3940
3944
|
y: P(t).y,
|
|
3941
3945
|
label: "",
|
|
@@ -3944,7 +3948,7 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3944
3948
|
isFixed: !1,
|
|
3945
3949
|
nodeR: 20,
|
|
3946
3950
|
testId: `action-edit-node-${t + 1}`,
|
|
3947
|
-
onPointerDown: (e) =>
|
|
3951
|
+
onPointerDown: (e) => te(e, t),
|
|
3948
3952
|
onClick: () => {
|
|
3949
3953
|
let e = w.current;
|
|
3950
3954
|
if (e) {
|
|
@@ -3955,7 +3959,7 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3955
3959
|
};
|
|
3956
3960
|
return;
|
|
3957
3961
|
}
|
|
3958
|
-
|
|
3962
|
+
ne(e.from, t);
|
|
3959
3963
|
}
|
|
3960
3964
|
}
|
|
3961
3965
|
}, t)),
|
|
@@ -3965,10 +3969,10 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3965
3969
|
style: { pointerEvents: "none" },
|
|
3966
3970
|
children: [
|
|
3967
3971
|
/* @__PURE__ */ f("rect", {
|
|
3968
|
-
x:
|
|
3969
|
-
y: -
|
|
3970
|
-
width:
|
|
3971
|
-
height:
|
|
3972
|
+
x: -et / 2,
|
|
3973
|
+
y: -tt / 2,
|
|
3974
|
+
width: et,
|
|
3975
|
+
height: tt,
|
|
3972
3976
|
rx: 6,
|
|
3973
3977
|
fill: F(_.symbol),
|
|
3974
3978
|
fillOpacity: .35,
|
|
@@ -3987,9 +3991,9 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3987
3991
|
}),
|
|
3988
3992
|
/* @__PURE__ */ f("text", {
|
|
3989
3993
|
x: 0,
|
|
3990
|
-
y:
|
|
3994
|
+
y: tt / 2 + 16,
|
|
3991
3995
|
textAnchor: "middle",
|
|
3992
|
-
fill:
|
|
3996
|
+
fill: ct,
|
|
3993
3997
|
fontSize: 13,
|
|
3994
3998
|
style: { pointerEvents: "none" },
|
|
3995
3999
|
children: m("action.dropHint")
|
|
@@ -4015,24 +4019,24 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
4015
4019
|
]
|
|
4016
4020
|
});
|
|
4017
4021
|
}
|
|
4018
|
-
function
|
|
4019
|
-
let n = e.orbits.map((e) => 2 * (
|
|
4022
|
+
function yt(e, t = !0) {
|
|
4023
|
+
let n = e.orbits.map((e) => 2 * (ut(e.elements.length) + Ze + Qe)), r = n.reduce((e, t) => e + t, 0) + $e * Math.max(0, e.orbits.length - 1), i = 0;
|
|
4020
4024
|
t && e.orbits.forEach((e) => {
|
|
4021
4025
|
let t = e.elements.length;
|
|
4022
|
-
i +=
|
|
4026
|
+
i += ot + Math.ceil(t / it) * rt + 2 * at + st;
|
|
4023
4027
|
});
|
|
4024
|
-
let a = t ? i -
|
|
4028
|
+
let a = t ? i - st : 0, o = (t ? 12 : 42) + a + 30, s = Math.max(0, ...n), c = o + 60 + s + 60, l = Math.max(r + 2 * $e, 320);
|
|
4025
4029
|
return {
|
|
4026
4030
|
width: Math.ceil(l),
|
|
4027
4031
|
height: Math.ceil(c)
|
|
4028
4032
|
};
|
|
4029
4033
|
}
|
|
4030
|
-
function
|
|
4031
|
-
let { t: y } =
|
|
4034
|
+
function bt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedElementChange: i, hoveredElement: a, onHoverElementChange: o, onSetElementSelect: s, showLabels: l, onHover: u, legendHover: m, onLegendHover: h, viewBoxOverride: g, canvasTransform: _, viewBoxSize: v }) {
|
|
4035
|
+
let { t: y } = Ie(), b = g?.width ?? v.width, x = g?.height ?? v.height, { n: S, perms: C, orbits: w, orbitOf: E } = t, D = c(() => new Set(T(C, S)), [C, S]), O = n === "conjugation", k = O || n === "regular", A = !!a, j = Math.min(v.width / Math.max(b, 1), v.height / Math.max(x, 1)), M = (v.width - b * j) / 2, N = (v.height - x * j) / 2, P = (e) => ({
|
|
4032
4036
|
x: (e.x * _.scale + _.x) * j + M,
|
|
4033
4037
|
y: (e.y * _.scale + _.y) * j + N
|
|
4034
|
-
}), F =
|
|
4035
|
-
transform: `translate(${
|
|
4038
|
+
}), F = w.map((e) => 2 * (ut(e.elements.length) + Ze + Qe)), I = F.reduce((e, t) => e + t, 0) + $e * (w.length - 1), L = w.map((e) => 2 * (ut(e.elements.length) + Ze + Qe)), R = Math.max(0, ...L), ee = b - 40 - e.generators.length * 110, te = e.generators.map((e, t) => /* @__PURE__ */ p("g", {
|
|
4039
|
+
transform: `translate(${ee + t * 110}, 0)`,
|
|
4036
4040
|
onMouseEnter: () => h(e.symbol),
|
|
4037
4041
|
onMouseLeave: () => h(null),
|
|
4038
4042
|
style: { cursor: "pointer" },
|
|
@@ -4048,25 +4052,25 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4048
4052
|
fontSize: 14,
|
|
4049
4053
|
children: e.symbol
|
|
4050
4054
|
})]
|
|
4051
|
-
}, `legend-${t}`)),
|
|
4052
|
-
|
|
4053
|
-
let t = e.elements.length, n = Math.min(
|
|
4054
|
-
|
|
4055
|
+
}, `legend-${t}`)), z = [], ne = [];
|
|
4056
|
+
w.forEach((e) => {
|
|
4057
|
+
let t = e.elements.length, n = Math.min(it, t);
|
|
4058
|
+
z.push(n * et + (n - 1) * nt + 2 * at), ne.push(ot + Math.ceil(t / it) * rt + 2 * at);
|
|
4055
4059
|
});
|
|
4056
|
-
let
|
|
4057
|
-
let n =
|
|
4058
|
-
return
|
|
4059
|
-
}),
|
|
4060
|
-
for (let e = 0; e <
|
|
4061
|
-
let t =
|
|
4062
|
-
|
|
4060
|
+
let B = 0, V = w.map((e, t) => {
|
|
4061
|
+
let n = B;
|
|
4062
|
+
return B += ne[t] + st, n;
|
|
4063
|
+
}), re = l ? B - st : 0, H = (l ? 12 : 42) + re + 30, ie = H + 60 + R, U = Math.max(30, (x - ie) / 2), W = [], G = Math.max(0, (b - I) / 2);
|
|
4064
|
+
for (let e = 0; e < w.length; e++) {
|
|
4065
|
+
let t = ut(w[e].elements.length);
|
|
4066
|
+
W.push({
|
|
4063
4067
|
x: G + F[e] / 2,
|
|
4064
|
-
y:
|
|
4068
|
+
y: U + H + 60 + R / 2,
|
|
4065
4069
|
r: t
|
|
4066
|
-
}), G += F[e] +
|
|
4070
|
+
}), G += F[e] + $e;
|
|
4067
4071
|
}
|
|
4068
4072
|
let K = (e) => {
|
|
4069
|
-
let t = E[e], n =
|
|
4073
|
+
let t = E[e], n = W[t], r = w[t].elements.indexOf(e) / w[t].elements.length * 2 * Math.PI - Math.PI / 2;
|
|
4070
4074
|
return {
|
|
4071
4075
|
x: n.x + Math.cos(r) * n.r,
|
|
4072
4076
|
y: n.y + Math.sin(r) * n.r
|
|
@@ -4092,11 +4096,11 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4092
4096
|
}
|
|
4093
4097
|
let se = [];
|
|
4094
4098
|
for (let { key: t, rec: n } of oe) {
|
|
4095
|
-
let { x: r, y: i, gi: a } = n, o = e.generators[a], s = ae.get(t), c = s.indexOf(n), l = s.length, u = K(r), d = K(i), p = Math.sqrt((d.x - u.x) ** 2 + (d.y - u.y) ** 2) || 1, h = Math.max(10, Math.min(16, p * .06)), g = (c - (l - 1) / 2) * h, _ =
|
|
4099
|
+
let { x: r, y: i, gi: a } = n, o = e.generators[a], s = ae.get(t), c = s.indexOf(n), l = s.length, u = K(r), d = K(i), p = Math.sqrt((d.x - u.x) ** 2 + (d.y - u.y) ** 2) || 1, h = Math.max(10, Math.min(16, p * .06)), g = (c - (l - 1) / 2) * h, _ = W[E[r]], v = K(s[0].x), y = Math.atan2(v.y - _.y, v.x - _.x), b = {
|
|
4096
4100
|
x: -Math.sin(y),
|
|
4097
4101
|
y: Math.cos(y)
|
|
4098
4102
|
}, x = m !== null && m === o.symbol, S = A || m !== null && !x;
|
|
4099
|
-
se.push(/* @__PURE__ */ f(
|
|
4103
|
+
se.push(/* @__PURE__ */ f(ft, {
|
|
4100
4104
|
sx: u.x,
|
|
4101
4105
|
sy: u.y,
|
|
4102
4106
|
ex: d.x,
|
|
@@ -4104,7 +4108,7 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4104
4108
|
color: S ? "var(--node-stroke)" : o.color || "var(--node-stroke)",
|
|
4105
4109
|
width: S ? 1.2 : x ? 3.4 : 3,
|
|
4106
4110
|
headSize: 18,
|
|
4107
|
-
nodeR:
|
|
4111
|
+
nodeR: Ze,
|
|
4108
4112
|
offset: g,
|
|
4109
4113
|
tFrom: b,
|
|
4110
4114
|
dashed: S,
|
|
@@ -4118,35 +4122,35 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4118
4122
|
let t = K(e);
|
|
4119
4123
|
ce.push(/* @__PURE__ */ f("circle", {
|
|
4120
4124
|
cx: t.x,
|
|
4121
|
-
cy: t.y -
|
|
4125
|
+
cy: t.y - Ze - 6,
|
|
4122
4126
|
r: 5,
|
|
4123
4127
|
fill: "none",
|
|
4124
|
-
stroke:
|
|
4128
|
+
stroke: ct,
|
|
4125
4129
|
strokeWidth: 1.5
|
|
4126
4130
|
}, `loop-${e}`));
|
|
4127
4131
|
continue;
|
|
4128
4132
|
}
|
|
4129
4133
|
let n = K(e), r = K(t);
|
|
4130
|
-
ce.push(/* @__PURE__ */ f(
|
|
4134
|
+
ce.push(/* @__PURE__ */ f(ft, {
|
|
4131
4135
|
sx: n.x,
|
|
4132
4136
|
sy: n.y,
|
|
4133
4137
|
ex: r.x,
|
|
4134
4138
|
ey: r.y,
|
|
4135
|
-
color:
|
|
4139
|
+
color: ct,
|
|
4136
4140
|
width: 3,
|
|
4137
4141
|
headSize: 18,
|
|
4138
|
-
nodeR:
|
|
4142
|
+
nodeR: Ze,
|
|
4139
4143
|
opacity: .95,
|
|
4140
4144
|
dir: e < t ? 1 : -1
|
|
4141
4145
|
}, `h-${e}`));
|
|
4142
4146
|
}
|
|
4143
|
-
let
|
|
4144
|
-
return
|
|
4145
|
-
let l = (b -
|
|
4146
|
-
let l = Math.floor(c /
|
|
4147
|
+
let le = r === null ? -1 : E[r], J = [];
|
|
4148
|
+
return w.forEach((n, c) => {
|
|
4149
|
+
let l = (b - z[c]) / 2, u = U + 12 + V[c], d = n.elements.map((n, c) => {
|
|
4150
|
+
let l = Math.floor(c / it), u = c % it, d = k ? e.elements[n] : null, p = d ? Q(X(d.label)) : t.setLabels?.[n] ? Q(X(t.setLabels[n])) : String(n + 1);
|
|
4147
4151
|
return /* @__PURE__ */ f("g", {
|
|
4148
|
-
transform: `translate(${
|
|
4149
|
-
children: /* @__PURE__ */ f(
|
|
4152
|
+
transform: `translate(${at + u * (et + nt)}, ${ot + at + l * rt})`,
|
|
4153
|
+
children: /* @__PURE__ */ f(mt, {
|
|
4150
4154
|
label: p,
|
|
4151
4155
|
isSelected: d ? a === d.id : r === n,
|
|
4152
4156
|
onClick: d ? () => s?.(d.id) : () => {
|
|
@@ -4157,12 +4161,12 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4157
4161
|
})
|
|
4158
4162
|
}, d ? d.id : `s-${n}`);
|
|
4159
4163
|
});
|
|
4160
|
-
|
|
4164
|
+
J.push(/* @__PURE__ */ p("g", {
|
|
4161
4165
|
transform: `translate(${l}, ${u})`,
|
|
4162
4166
|
children: [
|
|
4163
4167
|
/* @__PURE__ */ f("rect", {
|
|
4164
|
-
width:
|
|
4165
|
-
height:
|
|
4168
|
+
width: z[c],
|
|
4169
|
+
height: ne[c],
|
|
4166
4170
|
rx: 8,
|
|
4167
4171
|
fill: "var(--node-fill)",
|
|
4168
4172
|
fillOpacity: .15,
|
|
@@ -4171,8 +4175,8 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4171
4175
|
strokeDasharray: "3 3"
|
|
4172
4176
|
}),
|
|
4173
4177
|
/* @__PURE__ */ f("text", {
|
|
4174
|
-
x:
|
|
4175
|
-
y:
|
|
4178
|
+
x: at + 2,
|
|
4179
|
+
y: ot - 4,
|
|
4176
4180
|
fill: "var(--text-secondary)",
|
|
4177
4181
|
fontSize: 13,
|
|
4178
4182
|
children: y("action.orbitGroup", { size: String(n.elements.length) })
|
|
@@ -4181,26 +4185,26 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4181
4185
|
]
|
|
4182
4186
|
}, `grp-${c}`));
|
|
4183
4187
|
}), /* @__PURE__ */ p(d, { children: [
|
|
4184
|
-
|
|
4185
|
-
l &&
|
|
4186
|
-
|
|
4188
|
+
te,
|
|
4189
|
+
l && J,
|
|
4190
|
+
W.map((e, t) => /* @__PURE__ */ f("circle", {
|
|
4187
4191
|
cx: e.x,
|
|
4188
4192
|
cy: e.y,
|
|
4189
|
-
r: e.r +
|
|
4193
|
+
r: e.r + Ze + 14,
|
|
4190
4194
|
fill: "none",
|
|
4191
|
-
stroke:
|
|
4192
|
-
strokeWidth:
|
|
4193
|
-
strokeOpacity:
|
|
4194
|
-
strokeDasharray:
|
|
4195
|
+
stroke: le === t ? ct : "var(--node-stroke)",
|
|
4196
|
+
strokeWidth: le === t ? 3 : 1,
|
|
4197
|
+
strokeOpacity: le === t ? .9 : .25,
|
|
4198
|
+
strokeDasharray: le === t ? void 0 : "4 6"
|
|
4195
4199
|
}, `glow-${t}`)),
|
|
4196
4200
|
se,
|
|
4197
4201
|
ce,
|
|
4198
4202
|
Array.from({ length: S }, (n, a) => {
|
|
4199
4203
|
let s = K(a), c = k ? e.elements[a] : null, d = !!c && !!u;
|
|
4200
|
-
return /* @__PURE__ */ f(
|
|
4204
|
+
return /* @__PURE__ */ f(pt, {
|
|
4201
4205
|
x: s.x,
|
|
4202
4206
|
y: s.y,
|
|
4203
|
-
label: l && k ?
|
|
4207
|
+
label: l && k ? Q(X(e.elements[a].label)) : l && t.setLabels?.[a] ? Q(X(t.setLabels[a])) : "",
|
|
4204
4208
|
showNumber: k || t.setLabels ? void 0 : a + 1,
|
|
4205
4209
|
isSelected: r === a,
|
|
4206
4210
|
isFixed: D.has(a),
|
|
@@ -4216,25 +4220,25 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4216
4220
|
})
|
|
4217
4221
|
] });
|
|
4218
4222
|
}
|
|
4219
|
-
function
|
|
4220
|
-
return /* @__PURE__ */ f(
|
|
4223
|
+
function xt(e) {
|
|
4224
|
+
return /* @__PURE__ */ f(Y, {
|
|
4221
4225
|
theme: e.theme,
|
|
4222
|
-
children: /* @__PURE__ */ f(
|
|
4226
|
+
children: /* @__PURE__ */ f(wt, { ...e })
|
|
4223
4227
|
});
|
|
4224
4228
|
}
|
|
4225
|
-
var
|
|
4229
|
+
var St = {
|
|
4226
4230
|
x: 0,
|
|
4227
4231
|
y: 0,
|
|
4228
4232
|
scale: 1
|
|
4229
|
-
},
|
|
4233
|
+
}, Ct = {
|
|
4230
4234
|
width: 2e3,
|
|
4231
4235
|
height: 2e3
|
|
4232
4236
|
};
|
|
4233
|
-
function
|
|
4234
|
-
let { t: T } =
|
|
4237
|
+
function wt({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = null, arrows: a = [], error: o = null, onAddArrow: s, onBindArrow: c, onRemoveArrow: l, onReplaceGenArrows: m, selectedElement: h = null, onSelectedElementChange: g, hoveredElement: _ = null, onHoverElementChange: v, onSetElementSelect: y, showLabels: b = !0, onHover: x, canvasTransform: S = St, viewBoxSize: C = Ct, prime: w = null }) {
|
|
4238
|
+
let { t: T } = Ie(), [E, D] = u(null), O = t === "conjugation", k = O || t === "regular", A = _ ? e.elements.find((e) => e.id === _) ?? null : null, j = !!n && !r, M = !!x, N = M ? O ? "g·x = g·x·g⁻¹" : t === "regular" ? "g·x = g·x" : "" : O ? T("action.viewTitle.conjugation") : t === "sylow" ? T("action.viewTitle.sylow", { p: w ?? "" }) : T(t === "regular" ? "action.viewTitle.regular" : t === "coset" ? "action.viewTitle.coset" : "action.viewTitle.custom"), P = A ? T("action.hoverElEdges", { el: A.label }) : E ? T("action.hoverGenEdges", { gen: E }) : T(h === null ? "action.edgeBlurb" : "action.selHint"), F = A || E ? ct : "var(--text-secondary)", I = n && !r ? yt(n, b) : null, L = Math.max(220, (i ?? 1) * 22), R = Math.max(900, 2 * L + 520), ee = r ? {
|
|
4235
4239
|
width: 1200,
|
|
4236
4240
|
height: R
|
|
4237
|
-
} : I ?? C,
|
|
4241
|
+
} : I ?? C, te = n && h !== null ? (n.stabilizers.get(h) ?? []).map((t) => e.elements.find((e) => e.id === t)).filter((e) => !!e) : [], z = n && h !== null ? k ? Q(X(e.elements[h]?.label ?? "")) : n.setLabels?.[h] ? Q(X(n.setLabels[h])) : String(h + 1) : "", ne = !!n && !r && h !== null && te.length > 0;
|
|
4238
4242
|
return /* @__PURE__ */ p(d, { children: [
|
|
4239
4243
|
j && N !== "" && /* @__PURE__ */ p("div", {
|
|
4240
4244
|
style: {
|
|
@@ -4269,7 +4273,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4269
4273
|
})]
|
|
4270
4274
|
}),
|
|
4271
4275
|
/* @__PURE__ */ p("svg", {
|
|
4272
|
-
viewBox: `0 0 ${
|
|
4276
|
+
viewBox: `0 0 ${ee.width} ${ee.height}`,
|
|
4273
4277
|
className: "view-svg",
|
|
4274
4278
|
style: { userSelect: "none" },
|
|
4275
4279
|
children: [/* @__PURE__ */ f("defs", { children: /* @__PURE__ */ f("filter", {
|
|
@@ -4287,7 +4291,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4287
4291
|
})
|
|
4288
4292
|
}) }), /* @__PURE__ */ f("g", {
|
|
4289
4293
|
transform: r ? void 0 : `translate(${S.x}, ${S.y}) scale(${S.scale})`,
|
|
4290
|
-
children: r ? /* @__PURE__ */ f(
|
|
4294
|
+
children: r ? /* @__PURE__ */ f(vt, {
|
|
4291
4295
|
group: e,
|
|
4292
4296
|
vw: 1200,
|
|
4293
4297
|
vh: R,
|
|
@@ -4298,7 +4302,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4298
4302
|
onBindArrow: c ?? (() => {}),
|
|
4299
4303
|
onRemoveArrow: l ?? (() => {}),
|
|
4300
4304
|
onReplaceGenArrows: m ?? (() => {})
|
|
4301
|
-
}) : n ? /* @__PURE__ */ f(
|
|
4305
|
+
}) : n ? /* @__PURE__ */ f(bt, {
|
|
4302
4306
|
group: e,
|
|
4303
4307
|
computation: n,
|
|
4304
4308
|
kind: t,
|
|
@@ -4324,7 +4328,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4324
4328
|
})
|
|
4325
4329
|
})]
|
|
4326
4330
|
}),
|
|
4327
|
-
|
|
4331
|
+
ne && /* @__PURE__ */ p("div", {
|
|
4328
4332
|
style: {
|
|
4329
4333
|
position: "absolute",
|
|
4330
4334
|
bottom: 8,
|
|
@@ -4352,14 +4356,14 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4352
4356
|
color: "var(--text-primary)"
|
|
4353
4357
|
},
|
|
4354
4358
|
children: [
|
|
4355
|
-
/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: T("action.stabilizerFor", { el:
|
|
4359
|
+
/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: T("action.stabilizerFor", { el: z }) } }),
|
|
4356
4360
|
" ",
|
|
4357
4361
|
/* @__PURE__ */ p("span", {
|
|
4358
4362
|
style: {
|
|
4359
4363
|
color: "var(--text-secondary)",
|
|
4360
4364
|
fontWeight: 400
|
|
4361
4365
|
},
|
|
4362
|
-
children: ["|G_x| = ",
|
|
4366
|
+
children: ["|G_x| = ", te.length]
|
|
4363
4367
|
})
|
|
4364
4368
|
]
|
|
4365
4369
|
}), /* @__PURE__ */ f("button", {
|
|
@@ -4386,7 +4390,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4386
4390
|
maxHeight: 160,
|
|
4387
4391
|
overflowY: "auto"
|
|
4388
4392
|
},
|
|
4389
|
-
children:
|
|
4393
|
+
children: te.map((e) => /* @__PURE__ */ f("span", {
|
|
4390
4394
|
style: {
|
|
4391
4395
|
padding: "2px 8px",
|
|
4392
4396
|
borderRadius: 10,
|
|
@@ -4396,7 +4400,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4396
4400
|
color: "var(--text-primary)",
|
|
4397
4401
|
whiteSpace: "nowrap"
|
|
4398
4402
|
},
|
|
4399
|
-
dangerouslySetInnerHTML: { __html:
|
|
4403
|
+
dangerouslySetInnerHTML: { __html: Q(X(e.label)) }
|
|
4400
4404
|
}, e.id))
|
|
4401
4405
|
})]
|
|
4402
4406
|
})
|
|
@@ -4404,7 +4408,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4404
4408
|
}
|
|
4405
4409
|
//#endregion
|
|
4406
4410
|
//#region src/components/Canvas/HomomorphismScene.tsx
|
|
4407
|
-
var
|
|
4411
|
+
var Tt = [
|
|
4408
4412
|
"#4ecdc4",
|
|
4409
4413
|
"#a78bfa",
|
|
4410
4414
|
"#ffd93d",
|
|
@@ -4420,12 +4424,12 @@ var wt = [
|
|
|
4420
4424
|
"#22c55e",
|
|
4421
4425
|
"#a855f7",
|
|
4422
4426
|
"#06b6d4"
|
|
4423
|
-
],
|
|
4424
|
-
function
|
|
4427
|
+
], Et = "#ff6b6b", Dt = "#4ecdc4";
|
|
4428
|
+
function Ot(e, t, n, r) {
|
|
4425
4429
|
let i = Math.abs(n - e) * .3;
|
|
4426
4430
|
return `M ${e} ${t} C ${e + i} ${t}, ${n - i} ${r}, ${n} ${r}`;
|
|
4427
4431
|
}
|
|
4428
|
-
function
|
|
4432
|
+
function kt(e) {
|
|
4429
4433
|
let t = [];
|
|
4430
4434
|
for (let n of e.generators) {
|
|
4431
4435
|
let r = e.elements.find((e) => e.label === n.symbol || e.label === n.name);
|
|
@@ -4437,19 +4441,19 @@ function Ot(e) {
|
|
|
4437
4441
|
}
|
|
4438
4442
|
return t;
|
|
4439
4443
|
}
|
|
4440
|
-
function
|
|
4441
|
-
return /* @__PURE__ */ f(
|
|
4444
|
+
function At(e) {
|
|
4445
|
+
return /* @__PURE__ */ f(Y, {
|
|
4442
4446
|
theme: e.theme,
|
|
4443
|
-
children: /* @__PURE__ */ f(
|
|
4447
|
+
children: /* @__PURE__ */ f(jt, { ...e })
|
|
4444
4448
|
});
|
|
4445
4449
|
}
|
|
4446
|
-
function
|
|
4447
|
-
let { t: v } =
|
|
4450
|
+
function jt({ source: e, target: t, mapping: n, result: i, name: a, theoremMode: o = !1, onTheoremModeChange: s, theoremAnimation: m, showLabels: g = !0, onHover: _ }) {
|
|
4451
|
+
let { t: v } = Ie(), b = l(null), [x, C] = u(null), [w, T] = u(null), [E, D] = u(null), O = c(() => i === void 0 ? !e || !t || n.size === 0 ? null : q(e, t, n) : i, [
|
|
4448
4452
|
e,
|
|
4449
4453
|
t,
|
|
4450
4454
|
n,
|
|
4451
4455
|
i
|
|
4452
|
-
]), k = O?.kernel || [], A = O?.image || [], j = O?.isHomomorphism ?
|
|
4456
|
+
]), k = O?.kernel || [], A = O?.image || [], j = O?.isHomomorphism ? R(e, t, O) : null, M = new Set(k), N = new Set(A), P = E || x, F = P ? n.get(P) : w, I = c(() => {
|
|
4453
4457
|
if (!F || P) return /* @__PURE__ */ new Set();
|
|
4454
4458
|
let e = /* @__PURE__ */ new Set();
|
|
4455
4459
|
return n.forEach((t, n) => {
|
|
@@ -4459,20 +4463,20 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4459
4463
|
F,
|
|
4460
4464
|
P,
|
|
4461
4465
|
n
|
|
4462
|
-
]),
|
|
4466
|
+
]), L = r((e) => {
|
|
4463
4467
|
D((t) => t === e ? null : e);
|
|
4464
|
-
}, []),
|
|
4468
|
+
}, []), ee = c(() => {
|
|
4465
4469
|
if (!e) return [];
|
|
4466
|
-
let t =
|
|
4467
|
-
return t.length === 0 ? [] :
|
|
4470
|
+
let t = kt(e);
|
|
4471
|
+
return t.length === 0 ? [] : S(e, t.map((e, t) => ({
|
|
4468
4472
|
elementId: e.id,
|
|
4469
4473
|
enabled: !0,
|
|
4470
4474
|
color: h[t % h.length]
|
|
4471
4475
|
})), "right");
|
|
4472
|
-
}, [e]),
|
|
4476
|
+
}, [e]), te = c(() => {
|
|
4473
4477
|
if (!t) return [];
|
|
4474
|
-
let e =
|
|
4475
|
-
return e.length === 0 ? [] :
|
|
4478
|
+
let e = kt(t);
|
|
4479
|
+
return e.length === 0 ? [] : S(t, e.map((e, t) => ({
|
|
4476
4480
|
elementId: e.id,
|
|
4477
4481
|
enabled: !0,
|
|
4478
4482
|
color: h[t % h.length]
|
|
@@ -4520,8 +4524,8 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4520
4524
|
children: m
|
|
4521
4525
|
})]
|
|
4522
4526
|
});
|
|
4523
|
-
let
|
|
4524
|
-
function
|
|
4527
|
+
let z = Math.min(140, Math.max(65, e.order * 4.5)), ne = Math.min(140, Math.max(65, t.order * 4.5)), B = y(e, 170, 240, z), V = y(t, 630, 240, ne);
|
|
4528
|
+
function re(e, t, n, r, i, a = 1.5, o = .5, s = !1, c = !1, l = 0) {
|
|
4525
4529
|
let u = e.get(t), d = e.get(n);
|
|
4526
4530
|
if (!u || !d || s) return null;
|
|
4527
4531
|
let p = d.x - u.x, m = d.y - u.y, h = Math.sqrt(p * p + m * m);
|
|
@@ -4544,7 +4548,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4544
4548
|
opacity: o
|
|
4545
4549
|
}, i);
|
|
4546
4550
|
}
|
|
4547
|
-
function
|
|
4551
|
+
function H(e) {
|
|
4548
4552
|
let t = /* @__PURE__ */ new Map();
|
|
4549
4553
|
e.forEach((e, n) => {
|
|
4550
4554
|
let r = [e.fromId, e.toId].sort(), i = `${r[0]}|${r[1]}`, a = t.get(i);
|
|
@@ -4559,16 +4563,16 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4559
4563
|
});
|
|
4560
4564
|
}), n;
|
|
4561
4565
|
}
|
|
4562
|
-
let
|
|
4566
|
+
let ie = [];
|
|
4563
4567
|
return n.forEach((e, n) => {
|
|
4564
|
-
let r =
|
|
4568
|
+
let r = B.get(n), i = V.get(e);
|
|
4565
4569
|
if (!r || !i) return;
|
|
4566
|
-
let a = M.has(n), o = t.elements.findIndex((t) => t.id === e), s = a ?
|
|
4567
|
-
|
|
4570
|
+
let a = M.has(n), o = t.elements.findIndex((t) => t.id === e), s = a ? Et : Tt[o >= 0 ? o % Tt.length : 0], c = P === n || F === e;
|
|
4571
|
+
ie.push({
|
|
4568
4572
|
srcId: n,
|
|
4569
4573
|
tgtId: e,
|
|
4570
4574
|
color: s,
|
|
4571
|
-
pathD:
|
|
4575
|
+
pathD: Ot(r.x, r.y, i.x, i.y),
|
|
4572
4576
|
isKernel: a,
|
|
4573
4577
|
isHighlighted: !!c
|
|
4574
4578
|
});
|
|
@@ -4603,7 +4607,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4603
4607
|
color: "var(--text-primary)",
|
|
4604
4608
|
lineHeight: "28px"
|
|
4605
4609
|
},
|
|
4606
|
-
dangerouslySetInnerHTML: { __html:
|
|
4610
|
+
dangerouslySetInnerHTML: { __html: Q(X(a || `${e.symbol} → ${t.symbol}`)) }
|
|
4607
4611
|
})
|
|
4608
4612
|
}),
|
|
4609
4613
|
/* @__PURE__ */ f("foreignObject", {
|
|
@@ -4619,7 +4623,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4619
4623
|
color: "var(--text-primary)",
|
|
4620
4624
|
lineHeight: "22px"
|
|
4621
4625
|
},
|
|
4622
|
-
dangerouslySetInnerHTML: { __html: `${
|
|
4626
|
+
dangerouslySetInnerHTML: { __html: `${Q(X(e.symbol))} <span style="color:var(--text-muted);font-weight:400">(|G|=${e.order})</span>` }
|
|
4623
4627
|
})
|
|
4624
4628
|
}),
|
|
4625
4629
|
/* @__PURE__ */ f("foreignObject", {
|
|
@@ -4635,25 +4639,25 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4635
4639
|
color: "var(--text-primary)",
|
|
4636
4640
|
lineHeight: "22px"
|
|
4637
4641
|
},
|
|
4638
|
-
dangerouslySetInnerHTML: { __html: `${
|
|
4642
|
+
dangerouslySetInnerHTML: { __html: `${Q(X(t.symbol))} <span style="color:var(--text-muted);font-weight:400">(|H|=${t.order})</span>` }
|
|
4639
4643
|
})
|
|
4640
4644
|
}),
|
|
4641
4645
|
(() => {
|
|
4642
|
-
let e =
|
|
4643
|
-
return
|
|
4646
|
+
let e = H(ee);
|
|
4647
|
+
return ee.map((t, n) => re(B, t.fromId, t.toId, t.color, `gce-${n}`, 1.8, .7, t.isSelfLoop, t.isBidirectional, e[n]));
|
|
4644
4648
|
})(),
|
|
4645
4649
|
(() => {
|
|
4646
|
-
let e =
|
|
4647
|
-
return
|
|
4650
|
+
let e = H(te);
|
|
4651
|
+
return te.map((t, n) => re(V, t.fromId, t.toId, t.color, `hce-${n}`, 1.4, .65, t.isSelfLoop, t.isBidirectional, e[n]));
|
|
4648
4652
|
})(),
|
|
4649
|
-
|
|
4653
|
+
ie.filter((e) => !e.isHighlighted).map((e, t) => /* @__PURE__ */ f("path", {
|
|
4650
4654
|
d: e.pathD,
|
|
4651
4655
|
stroke: e.color,
|
|
4652
4656
|
strokeWidth: e.isKernel ? 2 : 1,
|
|
4653
4657
|
strokeOpacity: e.isKernel ? .45 : .28,
|
|
4654
4658
|
fill: "none"
|
|
4655
4659
|
}, `nl-${t}`)),
|
|
4656
|
-
|
|
4660
|
+
ie.filter((e) => e.isHighlighted).map((e, t) => /* @__PURE__ */ f("path", {
|
|
4657
4661
|
d: e.pathD,
|
|
4658
4662
|
stroke: e.color,
|
|
4659
4663
|
strokeWidth: 2.5,
|
|
@@ -4662,13 +4666,13 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4662
4666
|
style: { filter: "drop-shadow(0 0 4px currentColor)" }
|
|
4663
4667
|
}, `hl-${t}`)),
|
|
4664
4668
|
e.elements.map((e) => {
|
|
4665
|
-
let r =
|
|
4669
|
+
let r = B.get(e.id);
|
|
4666
4670
|
if (!r) return null;
|
|
4667
4671
|
let i = M.has(e.id), a = n.has(e.id), o = P === e.id || I.has(e.id), s = E === e.id, c = P && !o, l = "var(--node-fill)";
|
|
4668
|
-
if (i) l =
|
|
4672
|
+
if (i) l = Et;
|
|
4669
4673
|
else if (a) {
|
|
4670
4674
|
let r = n.get(e.id), i = t.elements.findIndex((e) => e.id === r);
|
|
4671
|
-
i >= 0 && (l =
|
|
4675
|
+
i >= 0 && (l = Tt[i % Tt.length]);
|
|
4672
4676
|
}
|
|
4673
4677
|
return /* @__PURE__ */ p("g", {
|
|
4674
4678
|
"data-homo-source-node": !0,
|
|
@@ -4683,7 +4687,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4683
4687
|
onMouseLeave: () => {
|
|
4684
4688
|
C(null), _?.(null, null);
|
|
4685
4689
|
},
|
|
4686
|
-
onClick: () =>
|
|
4690
|
+
onClick: () => L(e.id),
|
|
4687
4691
|
style: { cursor: "pointer" },
|
|
4688
4692
|
children: [
|
|
4689
4693
|
o && /* @__PURE__ */ f("circle", {
|
|
@@ -4691,7 +4695,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4691
4695
|
cy: r.y,
|
|
4692
4696
|
r: 18,
|
|
4693
4697
|
fill: "none",
|
|
4694
|
-
stroke: i ?
|
|
4698
|
+
stroke: i ? Et : "var(--accent-teal)",
|
|
4695
4699
|
strokeWidth: 2,
|
|
4696
4700
|
opacity: .6,
|
|
4697
4701
|
style: { filter: "drop-shadow(0 0 6px currentColor)" }
|
|
@@ -4701,7 +4705,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4701
4705
|
cy: r.y,
|
|
4702
4706
|
r: a ? 13 : 8,
|
|
4703
4707
|
fill: l,
|
|
4704
|
-
stroke: i ?
|
|
4708
|
+
stroke: i ? Et : "var(--border-color)",
|
|
4705
4709
|
strokeWidth: i ? 2 : 1,
|
|
4706
4710
|
opacity: c ? .3 : 1
|
|
4707
4711
|
}),
|
|
@@ -4724,11 +4728,11 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4724
4728
|
style: {
|
|
4725
4729
|
fontSize: "8px",
|
|
4726
4730
|
textAlign: "center",
|
|
4727
|
-
color: i ?
|
|
4731
|
+
color: i ? Et : c ? "var(--text-muted)" : "var(--text-primary)",
|
|
4728
4732
|
fontWeight: i || o ? 700 : 400,
|
|
4729
4733
|
pointerEvents: "none"
|
|
4730
4734
|
},
|
|
4731
|
-
dangerouslySetInnerHTML: { __html:
|
|
4735
|
+
dangerouslySetInnerHTML: { __html: Q(e.label) }
|
|
4732
4736
|
})
|
|
4733
4737
|
})
|
|
4734
4738
|
]
|
|
@@ -4758,7 +4762,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4758
4762
|
cy: t.y,
|
|
4759
4763
|
r: 18,
|
|
4760
4764
|
fill: "none",
|
|
4761
|
-
stroke:
|
|
4765
|
+
stroke: Dt,
|
|
4762
4766
|
strokeWidth: 2,
|
|
4763
4767
|
opacity: .6,
|
|
4764
4768
|
style: { filter: "drop-shadow(0 0 8px currentColor)" }
|
|
@@ -4767,8 +4771,8 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4767
4771
|
cx: t.x,
|
|
4768
4772
|
cy: t.y,
|
|
4769
4773
|
r: n ? 13 : 8,
|
|
4770
|
-
fill: n ?
|
|
4771
|
-
stroke: n ?
|
|
4774
|
+
fill: n ? Dt : "var(--node-fill)",
|
|
4775
|
+
stroke: n ? Dt : "var(--border-color)",
|
|
4772
4776
|
strokeWidth: n ? 2 : 1,
|
|
4773
4777
|
opacity: i ? .3 : 1
|
|
4774
4778
|
}),
|
|
@@ -4790,11 +4794,11 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4790
4794
|
style: {
|
|
4791
4795
|
fontSize: "8px",
|
|
4792
4796
|
textAlign: "center",
|
|
4793
|
-
color: n ?
|
|
4797
|
+
color: n ? Dt : i ? "var(--text-muted)" : "var(--text-primary)",
|
|
4794
4798
|
fontWeight: n || r ? 700 : 400,
|
|
4795
4799
|
pointerEvents: "none"
|
|
4796
4800
|
},
|
|
4797
|
-
dangerouslySetInnerHTML: { __html:
|
|
4801
|
+
dangerouslySetInnerHTML: { __html: Q(e.label) }
|
|
4798
4802
|
})
|
|
4799
4803
|
})
|
|
4800
4804
|
]
|
|
@@ -4817,7 +4821,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4817
4821
|
y: 0,
|
|
4818
4822
|
textAnchor: "middle",
|
|
4819
4823
|
fontSize: "9",
|
|
4820
|
-
fill: j.isInjective ? "var(--accent-teal)" :
|
|
4824
|
+
fill: j.isInjective ? "var(--accent-teal)" : Et,
|
|
4821
4825
|
children: j.isInjective ? v("homo.injective") : v("homo.notInjective")
|
|
4822
4826
|
}),
|
|
4823
4827
|
/* @__PURE__ */ f("rect", {
|
|
@@ -4866,7 +4870,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4866
4870
|
y: 0,
|
|
4867
4871
|
textAnchor: "middle",
|
|
4868
4872
|
fontSize: "9",
|
|
4869
|
-
fill: j.isSurjective ? "var(--accent-teal)" :
|
|
4873
|
+
fill: j.isSurjective ? "var(--accent-teal)" : Et,
|
|
4870
4874
|
children: j.isSurjective ? v("homo.surjective") : v("homo.notSurjective")
|
|
4871
4875
|
}),
|
|
4872
4876
|
j.isIsomorphism && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("rect", {
|
|
@@ -4893,7 +4897,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4893
4897
|
y: 0,
|
|
4894
4898
|
textAnchor: "middle",
|
|
4895
4899
|
fontSize: "10",
|
|
4896
|
-
fill:
|
|
4900
|
+
fill: Et,
|
|
4897
4901
|
fontWeight: "bold",
|
|
4898
4902
|
children: ["✗ ", v("homo.invalid")]
|
|
4899
4903
|
}),
|
|
@@ -4913,7 +4917,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4913
4917
|
}
|
|
4914
4918
|
//#endregion
|
|
4915
4919
|
//#region src/components/Canvas/SymmetryViewScene.tsx
|
|
4916
|
-
function
|
|
4920
|
+
function Mt(e, t) {
|
|
4917
4921
|
let n = [], r = [];
|
|
4918
4922
|
for (let i = 0; i < e; i++) {
|
|
4919
4923
|
let a = 2 * Math.PI * i / e - Math.PI / 2;
|
|
@@ -4925,7 +4929,7 @@ function jt(e, t) {
|
|
|
4925
4929
|
directed: !0
|
|
4926
4930
|
};
|
|
4927
4931
|
}
|
|
4928
|
-
function
|
|
4932
|
+
function Nt(e, t) {
|
|
4929
4933
|
let n = [], r = [];
|
|
4930
4934
|
for (let i = 0; i < e; i++) {
|
|
4931
4935
|
let a = 2 * Math.PI * i / e - Math.PI / 2;
|
|
@@ -4936,7 +4940,7 @@ function Mt(e, t) {
|
|
|
4936
4940
|
edges: r
|
|
4937
4941
|
};
|
|
4938
4942
|
}
|
|
4939
|
-
function
|
|
4943
|
+
function Pt(e) {
|
|
4940
4944
|
let t = e / Math.sqrt(3), n = [
|
|
4941
4945
|
new J.Vector3(1, 1, 1).multiplyScalar(t),
|
|
4942
4946
|
new J.Vector3(1, -1, -1).multiplyScalar(t),
|
|
@@ -4949,7 +4953,7 @@ function Nt(e) {
|
|
|
4949
4953
|
edges: r
|
|
4950
4954
|
};
|
|
4951
4955
|
}
|
|
4952
|
-
function
|
|
4956
|
+
function Ft(e) {
|
|
4953
4957
|
let t = e / Math.sqrt(3), n = [-1, 1], r = [];
|
|
4954
4958
|
for (let e of n) for (let i of n) for (let a of n) r.push(new J.Vector3(e * t, i * t, a * t));
|
|
4955
4959
|
let i = [];
|
|
@@ -4963,7 +4967,7 @@ function Pt(e) {
|
|
|
4963
4967
|
edges: i
|
|
4964
4968
|
};
|
|
4965
4969
|
}
|
|
4966
|
-
function
|
|
4970
|
+
function It(e) {
|
|
4967
4971
|
let t = (1 + Math.sqrt(5)) / 2, n = [
|
|
4968
4972
|
[
|
|
4969
4973
|
0,
|
|
@@ -5032,8 +5036,8 @@ function Ft(e) {
|
|
|
5032
5036
|
edges: a
|
|
5033
5037
|
};
|
|
5034
5038
|
}
|
|
5035
|
-
var
|
|
5036
|
-
function
|
|
5039
|
+
var Lt = /* @__PURE__ */ new Map();
|
|
5040
|
+
function Rt(e) {
|
|
5037
5041
|
let t = e * 1, n = e * .55;
|
|
5038
5042
|
return {
|
|
5039
5043
|
vertices: [
|
|
@@ -5050,7 +5054,7 @@ function Lt(e) {
|
|
|
5050
5054
|
]
|
|
5051
5055
|
};
|
|
5052
5056
|
}
|
|
5053
|
-
function
|
|
5057
|
+
function zt(e) {
|
|
5054
5058
|
let t = [
|
|
5055
5059
|
new J.Vector3(e, 0, 0),
|
|
5056
5060
|
new J.Vector3(-e, 0, 0),
|
|
@@ -5065,7 +5069,7 @@ function Rt(e) {
|
|
|
5065
5069
|
edges: n
|
|
5066
5070
|
};
|
|
5067
5071
|
}
|
|
5068
|
-
function
|
|
5072
|
+
function Bt(e) {
|
|
5069
5073
|
let t = (1 + Math.sqrt(5)) / 2, n = 1 / t, r = t, i = [];
|
|
5070
5074
|
for (let e of [-1, 1]) for (let t of [-1, 1]) for (let n of [-1, 1]) i.push([
|
|
5071
5075
|
e * 1,
|
|
@@ -5094,11 +5098,11 @@ function zt(e) {
|
|
|
5094
5098
|
edges: l
|
|
5095
5099
|
};
|
|
5096
5100
|
}
|
|
5097
|
-
function
|
|
5101
|
+
function Vt(e, t) {
|
|
5098
5102
|
return `hsl(${e / t * 360}, 70%, 60%)`;
|
|
5099
5103
|
}
|
|
5100
|
-
function
|
|
5101
|
-
let t = `${e.vertices.length}:${e.edges.map((e) => e.join("-")).join("|")}`, n =
|
|
5104
|
+
function Ht(e) {
|
|
5105
|
+
let t = `${e.vertices.length}:${e.edges.map((e) => e.join("-")).join("|")}`, n = Lt.get(t);
|
|
5102
5106
|
if (n) return n;
|
|
5103
5107
|
let r = /* @__PURE__ */ new Map();
|
|
5104
5108
|
for (let t = 0; t < e.vertices.length; t++) r.set(t, []);
|
|
@@ -5128,9 +5132,9 @@ function Vt(e) {
|
|
|
5128
5132
|
}
|
|
5129
5133
|
}
|
|
5130
5134
|
}
|
|
5131
|
-
return
|
|
5135
|
+
return Lt.set(t, a), a;
|
|
5132
5136
|
}
|
|
5133
|
-
function
|
|
5137
|
+
function Ut(e) {
|
|
5134
5138
|
let t = e.vertices[0].length() / Math.sqrt(3);
|
|
5135
5139
|
return [
|
|
5136
5140
|
new J.Vector3(t, 0, 0),
|
|
@@ -5141,13 +5145,13 @@ function Ht(e) {
|
|
|
5141
5145
|
new J.Vector3(0, 0, -t)
|
|
5142
5146
|
];
|
|
5143
5147
|
}
|
|
5144
|
-
function
|
|
5148
|
+
function Wt(e, t) {
|
|
5145
5149
|
let n = [];
|
|
5146
5150
|
if (t.length > 0 && e.vertices.length <= 12) {
|
|
5147
5151
|
for (let [r, i, a] of t) n.push(e.vertices[r].clone().add(e.vertices[i]).add(e.vertices[a]).multiplyScalar(1 / 3));
|
|
5148
5152
|
return n;
|
|
5149
5153
|
}
|
|
5150
|
-
if (e.vertices.length === 8) return
|
|
5154
|
+
if (e.vertices.length === 8) return Ut(e);
|
|
5151
5155
|
if (e.vertices.length >= 20) {
|
|
5152
5156
|
let t = /* @__PURE__ */ new Map();
|
|
5153
5157
|
for (let n = 0; n < e.vertices.length; n++) t.set(n, /* @__PURE__ */ new Set());
|
|
@@ -5182,29 +5186,29 @@ function Ut(e, t) {
|
|
|
5182
5186
|
}
|
|
5183
5187
|
return [];
|
|
5184
5188
|
}
|
|
5185
|
-
function
|
|
5186
|
-
return
|
|
5189
|
+
function Gt(e, t) {
|
|
5190
|
+
return w(e, t);
|
|
5187
5191
|
}
|
|
5188
|
-
function
|
|
5189
|
-
let v = t ??
|
|
5192
|
+
function Kt({ group: e, symmetryType: t, dark: n = !1, variant: r = !1, showAction: i = !1, actionElementId: a = null, rotateSpeed: o = 1, showFigureTitle: s = !0, locked: l = !1, onHint: u, hintOnIdle: d = !0, replaySignal: m = 0, theme: h, lockCameraOnAction: g = !1, onAnimationEnd: _ }) {
|
|
5193
|
+
let v = t ?? te(e), y = h ? h === "dark" : n, b = c(() => {
|
|
5190
5194
|
switch (v) {
|
|
5191
|
-
case "cyclic": return
|
|
5195
|
+
case "cyclic": return Mt(e.order, 4);
|
|
5192
5196
|
case "dihedral": {
|
|
5193
5197
|
let t = e.order / 2;
|
|
5194
|
-
return
|
|
5198
|
+
return Nt(Math.round(t), 4);
|
|
5195
5199
|
}
|
|
5196
|
-
case "tetrahedron": return
|
|
5197
|
-
case "cube": return r ?
|
|
5198
|
-
case "icosahedron": return r ?
|
|
5199
|
-
case "rectangle": return
|
|
5200
|
-
default: return
|
|
5200
|
+
case "tetrahedron": return Pt(4);
|
|
5201
|
+
case "cube": return r ? zt(4) : Ft(4);
|
|
5202
|
+
case "icosahedron": return r ? Bt(4) : It(4);
|
|
5203
|
+
case "rectangle": return Rt(4);
|
|
5204
|
+
default: return Mt(1, 4);
|
|
5201
5205
|
}
|
|
5202
5206
|
}, [
|
|
5203
5207
|
e,
|
|
5204
5208
|
v,
|
|
5205
5209
|
r
|
|
5206
5210
|
]);
|
|
5207
|
-
if (v === "unsupported") return /* @__PURE__ */ f(
|
|
5211
|
+
if (v === "unsupported") return /* @__PURE__ */ f(Zt, { group: e });
|
|
5208
5212
|
let x = y ? "#0a0a1a" : "#f4f4f7";
|
|
5209
5213
|
return /* @__PURE__ */ f("div", {
|
|
5210
5214
|
style: {
|
|
@@ -5212,7 +5216,7 @@ function Gt({ group: e, symmetryType: t, dark: n = !1, variant: r = !1, showActi
|
|
|
5212
5216
|
height: "100%",
|
|
5213
5217
|
background: x
|
|
5214
5218
|
},
|
|
5215
|
-
children: /* @__PURE__ */ p(
|
|
5219
|
+
children: /* @__PURE__ */ p(ae, {
|
|
5216
5220
|
camera: {
|
|
5217
5221
|
position: [
|
|
5218
5222
|
0,
|
|
@@ -5231,7 +5235,7 @@ function Gt({ group: e, symmetryType: t, dark: n = !1, variant: r = !1, showActi
|
|
|
5231
5235
|
children: [/* @__PURE__ */ f("color", {
|
|
5232
5236
|
attach: "background",
|
|
5233
5237
|
args: [x]
|
|
5234
|
-
}), /* @__PURE__ */ f(
|
|
5238
|
+
}), /* @__PURE__ */ f(Xt, {
|
|
5235
5239
|
group: e,
|
|
5236
5240
|
symmetryType: v,
|
|
5237
5241
|
data: b,
|
|
@@ -5251,7 +5255,7 @@ function Gt({ group: e, symmetryType: t, dark: n = !1, variant: r = !1, showActi
|
|
|
5251
5255
|
})
|
|
5252
5256
|
});
|
|
5253
5257
|
}
|
|
5254
|
-
function
|
|
5258
|
+
function qt(e, t, n, r, i) {
|
|
5255
5259
|
let o = l({
|
|
5256
5260
|
target: null,
|
|
5257
5261
|
t: 2,
|
|
@@ -5269,7 +5273,7 @@ function Kt(e, t, n, r, i) {
|
|
|
5269
5273
|
}, [e, n]), a(() => {
|
|
5270
5274
|
let e = o.current;
|
|
5271
5275
|
!r || !e.target || (e.t = 0, e.phase = "reset", e.settled = !1, n("reset"));
|
|
5272
|
-
}, [r]),
|
|
5276
|
+
}, [r]), oe((e, t) => {
|
|
5273
5277
|
let r = o.current;
|
|
5274
5278
|
if (!(!r.target || r.t > 1.5)) {
|
|
5275
5279
|
if (r.t += t * r.speed, r.phase === "reset") if (r.t >= .5) r.phase = "rotating", r.t = .5, n("rotating");
|
|
@@ -5281,16 +5285,16 @@ function Kt(e, t, n, r, i) {
|
|
|
5281
5285
|
}
|
|
5282
5286
|
}), o;
|
|
5283
5287
|
}
|
|
5284
|
-
function
|
|
5288
|
+
function Jt({ data: e, symmetryType: t, isDirected: n, animState: r }) {
|
|
5285
5289
|
let [i] = u(() => new J.Group());
|
|
5286
5290
|
return a(() => {
|
|
5287
5291
|
for (; i.children.length > 0;) i.remove(i.children[0]);
|
|
5288
5292
|
if (e.vertices.forEach((t, n) => {
|
|
5289
5293
|
let r = new J.Mesh(new J.SphereGeometry(.28, 16, 16), new J.MeshStandardMaterial({
|
|
5290
|
-
color:
|
|
5294
|
+
color: Vt(n, e.vertices.length),
|
|
5291
5295
|
roughness: .3,
|
|
5292
5296
|
metalness: .1,
|
|
5293
|
-
emissive:
|
|
5297
|
+
emissive: Vt(n, e.vertices.length),
|
|
5294
5298
|
emissiveIntensity: .3
|
|
5295
5299
|
}));
|
|
5296
5300
|
r.position.copy(t), i.add(r);
|
|
@@ -5309,7 +5313,7 @@ function qt({ data: e, symmetryType: t, isDirected: n, animState: r }) {
|
|
|
5309
5313
|
"cube",
|
|
5310
5314
|
"icosahedron"
|
|
5311
5315
|
].includes(t)) {
|
|
5312
|
-
let n = t === "cube" ? "#ff9944" : t === "tetrahedron" ? "#44cc88" : "#cc66ff", r =
|
|
5316
|
+
let n = t === "cube" ? "#ff9944" : t === "tetrahedron" ? "#44cc88" : "#cc66ff", r = Ht(e);
|
|
5313
5317
|
if (r.length > 0) {
|
|
5314
5318
|
let t = [], a = [];
|
|
5315
5319
|
for (let [n, i, o] of r) {
|
|
@@ -5331,11 +5335,11 @@ function qt({ data: e, symmetryType: t, isDirected: n, animState: r }) {
|
|
|
5331
5335
|
t,
|
|
5332
5336
|
n,
|
|
5333
5337
|
i
|
|
5334
|
-
]),
|
|
5338
|
+
]), oe(() => {
|
|
5335
5339
|
i.quaternion.copy(r.current.currentQuat);
|
|
5336
5340
|
}), /* @__PURE__ */ f("primitive", { object: i });
|
|
5337
5341
|
}
|
|
5338
|
-
function
|
|
5342
|
+
function Yt({ from: e, to: t, intersections: n }) {
|
|
5339
5343
|
let r = c(() => e.clone().add(t).multiplyScalar(.5), [e, t]), i = c(() => t.clone().sub(e).normalize(), [e, t]), a = c(() => t.distanceTo(e), [e, t]), o = c(() => {
|
|
5340
5344
|
let e = new J.Quaternion();
|
|
5341
5345
|
return e.setFromUnitVectors(new J.Vector3(0, 1, 0), i), e;
|
|
@@ -5386,23 +5390,23 @@ function Jt({ from: e, to: t, intersections: n }) {
|
|
|
5386
5390
|
}, t))
|
|
5387
5391
|
] });
|
|
5388
5392
|
}
|
|
5389
|
-
function
|
|
5390
|
-
let { t: x } =
|
|
5393
|
+
function Xt({ group: e, symmetryType: t, data: n, variant: r, showAction: i, actionElementId: o, rotateSpeed: s, showFigureTitle: l, dark: m, locked: h, onHint: g, hintOnIdle: _, replaySignal: v, lockCameraOnAction: y, onAnimationEnd: b }) {
|
|
5394
|
+
let { t: x } = Ie(), [S, C] = u("rest"), w = c(() => {
|
|
5391
5395
|
if (!i || !o || !n) return null;
|
|
5392
|
-
let t =
|
|
5396
|
+
let t = we(e, o, "SymmetryViewScene.actionElementId");
|
|
5393
5397
|
if (!t) return null;
|
|
5394
|
-
let r =
|
|
5398
|
+
let r = Gt(e, t);
|
|
5395
5399
|
return !r || r.angleRad === 0 ? null : r;
|
|
5396
5400
|
}, [
|
|
5397
5401
|
i,
|
|
5398
5402
|
o,
|
|
5399
5403
|
e,
|
|
5400
5404
|
n
|
|
5401
|
-
]), T =
|
|
5405
|
+
]), T = qt(c(() => {
|
|
5402
5406
|
if (!w || w.angleRad === 0) return null;
|
|
5403
5407
|
let e = new J.Quaternion();
|
|
5404
5408
|
return e.setFromAxisAngle(new J.Vector3(...w.axis), w.angleRad), e;
|
|
5405
|
-
}, [w]), s, C, v, b), E = c(() => i && o ?
|
|
5409
|
+
}, [w]), s, C, v, b), E = c(() => i && o ? we(e, o, "SymmetryViewScene.actionElementId") : null, [
|
|
5406
5410
|
i,
|
|
5407
5411
|
o,
|
|
5408
5412
|
e
|
|
@@ -5452,7 +5456,7 @@ function Yt({ group: e, symmetryType: t, data: n, variant: r, showAction: i, act
|
|
|
5452
5456
|
kind: "edge"
|
|
5453
5457
|
});
|
|
5454
5458
|
}
|
|
5455
|
-
let r =
|
|
5459
|
+
let r = Wt(n, Ht(n));
|
|
5456
5460
|
for (let n of r) {
|
|
5457
5461
|
let r = n.dot(e), i = e.clone().multiplyScalar(r);
|
|
5458
5462
|
n.distanceTo(i) < .25 && t.push({
|
|
@@ -5497,7 +5501,7 @@ function Yt({ group: e, symmetryType: t, data: n, variant: r, showAction: i, act
|
|
|
5497
5501
|
],
|
|
5498
5502
|
intensity: .5
|
|
5499
5503
|
}),
|
|
5500
|
-
l && /* @__PURE__ */ f(
|
|
5504
|
+
l && /* @__PURE__ */ f(ce, {
|
|
5501
5505
|
position: [
|
|
5502
5506
|
0,
|
|
5503
5507
|
A + 1.5,
|
|
@@ -5516,10 +5520,10 @@ function Yt({ group: e, symmetryType: t, data: n, variant: r, showAction: i, act
|
|
|
5516
5520
|
userSelect: "none",
|
|
5517
5521
|
pointerEvents: "none"
|
|
5518
5522
|
},
|
|
5519
|
-
dangerouslySetInnerHTML: { __html:
|
|
5523
|
+
dangerouslySetInnerHTML: { __html: Q(X(e.name)) }
|
|
5520
5524
|
})
|
|
5521
5525
|
}),
|
|
5522
|
-
l && /* @__PURE__ */ f(
|
|
5526
|
+
l && /* @__PURE__ */ f(ce, {
|
|
5523
5527
|
position: [
|
|
5524
5528
|
0,
|
|
5525
5529
|
A + 2.2,
|
|
@@ -5537,15 +5541,15 @@ function Yt({ group: e, symmetryType: t, data: n, variant: r, showAction: i, act
|
|
|
5537
5541
|
userSelect: "none",
|
|
5538
5542
|
pointerEvents: "none"
|
|
5539
5543
|
},
|
|
5540
|
-
dangerouslySetInnerHTML: { __html:
|
|
5544
|
+
dangerouslySetInnerHTML: { __html: Q(t === "cyclic" ? x("symmetry.geo.cyclicText", { n: e.order }) : t === "dihedral" ? x("symmetry.geo.dihedralText", { n: e.order / 2 }) : x(t === "cube" ? r ? "symmetry.geo.octahedron" : "symmetry.geo.cube" : t === "icosahedron" ? r ? "symmetry.geo.dodecahedron" : "symmetry.geo.icosahedron" : "symmetry.geo." + t)) }
|
|
5541
5545
|
})
|
|
5542
5546
|
}),
|
|
5543
|
-
M && /* @__PURE__ */ f(
|
|
5547
|
+
M && /* @__PURE__ */ f(Yt, {
|
|
5544
5548
|
from: F,
|
|
5545
5549
|
to: P,
|
|
5546
5550
|
intersections: I
|
|
5547
5551
|
}),
|
|
5548
|
-
/* @__PURE__ */ f(
|
|
5552
|
+
/* @__PURE__ */ f(Jt, {
|
|
5549
5553
|
data: n,
|
|
5550
5554
|
symmetryType: t,
|
|
5551
5555
|
isDirected: k,
|
|
@@ -5583,7 +5587,7 @@ function Yt({ group: e, symmetryType: t, data: n, variant: r, showAction: i, act
|
|
|
5583
5587
|
depthWrite: !1
|
|
5584
5588
|
})]
|
|
5585
5589
|
}),
|
|
5586
|
-
/* @__PURE__ */ f(
|
|
5590
|
+
/* @__PURE__ */ f(le, {
|
|
5587
5591
|
enableDamping: !1,
|
|
5588
5592
|
minDistance: 2,
|
|
5589
5593
|
maxDistance: 20,
|
|
@@ -5593,8 +5597,8 @@ function Yt({ group: e, symmetryType: t, data: n, variant: r, showAction: i, act
|
|
|
5593
5597
|
})
|
|
5594
5598
|
] }) : null;
|
|
5595
5599
|
}
|
|
5596
|
-
function
|
|
5597
|
-
let { t } =
|
|
5600
|
+
function Zt({ group: e }) {
|
|
5601
|
+
let { t } = Ie();
|
|
5598
5602
|
return /* @__PURE__ */ p("div", {
|
|
5599
5603
|
style: {
|
|
5600
5604
|
width: "100%",
|
|
@@ -5612,7 +5616,7 @@ function Xt({ group: e }) {
|
|
|
5612
5616
|
fontSize: "18px",
|
|
5613
5617
|
marginBottom: "8px"
|
|
5614
5618
|
},
|
|
5615
|
-
children: /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
5619
|
+
children: /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(X(e.name)) } })
|
|
5616
5620
|
}),
|
|
5617
5621
|
/* @__PURE__ */ f("p", {
|
|
5618
5622
|
style: {
|
|
@@ -5634,7 +5638,7 @@ function Xt({ group: e }) {
|
|
|
5634
5638
|
}
|
|
5635
5639
|
//#endregion
|
|
5636
5640
|
//#region src/theme/ThemeContext.tsx
|
|
5637
|
-
var
|
|
5641
|
+
var Qt = e({
|
|
5638
5642
|
theme: "dark",
|
|
5639
5643
|
toggleTheme: () => {},
|
|
5640
5644
|
viewWindowTheme: "dark",
|
|
@@ -5642,25 +5646,25 @@ var Zt = e({
|
|
|
5642
5646
|
});
|
|
5643
5647
|
//#endregion
|
|
5644
5648
|
//#region src/theme/useTheme.ts
|
|
5645
|
-
function
|
|
5646
|
-
return i(
|
|
5649
|
+
function $t() {
|
|
5650
|
+
return i(Qt);
|
|
5647
5651
|
}
|
|
5648
5652
|
//#endregion
|
|
5649
5653
|
//#region src/utils/cayley3dControls.ts
|
|
5650
|
-
var
|
|
5651
|
-
function en(e) {
|
|
5652
|
-
$t = e;
|
|
5653
|
-
}
|
|
5654
|
+
var en = null;
|
|
5654
5655
|
function tn(e) {
|
|
5655
|
-
|
|
5656
|
+
en = e;
|
|
5657
|
+
}
|
|
5658
|
+
function nn(e) {
|
|
5659
|
+
en === e && (en = null);
|
|
5656
5660
|
}
|
|
5657
5661
|
//#endregion
|
|
5658
5662
|
//#region src/components/Canvas/Cayley3DScene.tsx
|
|
5659
|
-
function
|
|
5663
|
+
function rn(e, t, n) {
|
|
5660
5664
|
return n ? `hsl(${e / t * 360}, 60%, 55%)` : `hsl(${e * 137.508 % 360}, 65%, 55%)`;
|
|
5661
5665
|
}
|
|
5662
|
-
var
|
|
5663
|
-
let g = c(() =>
|
|
5666
|
+
var an = n(function({ position: e, label: t, color: n, isSelected: r, isHovered: i, subsetColor: a, element: o, nodeScale: s, showLabel: l, isDark: u, onSelectElement: d, onPointerEnter: m, onPointerLeave: h }) {
|
|
5667
|
+
let g = c(() => Q(X(t)), [t]), _ = r || i, v = _ ? 24 : 12;
|
|
5664
5668
|
return /* @__PURE__ */ p("group", {
|
|
5665
5669
|
position: e,
|
|
5666
5670
|
children: [
|
|
@@ -5700,7 +5704,7 @@ var rn = n(function({ position: e, label: t, color: n, isSelected: r, isHovered:
|
|
|
5700
5704
|
transparent: !0,
|
|
5701
5705
|
opacity: .3
|
|
5702
5706
|
})] }),
|
|
5703
|
-
l && _ && /* @__PURE__ */ f(
|
|
5707
|
+
l && _ && /* @__PURE__ */ f(ce, {
|
|
5704
5708
|
distanceFactor: 12,
|
|
5705
5709
|
center: !0,
|
|
5706
5710
|
style: {
|
|
@@ -5725,7 +5729,7 @@ var rn = n(function({ position: e, label: t, color: n, isSelected: r, isHovered:
|
|
|
5725
5729
|
})
|
|
5726
5730
|
]
|
|
5727
5731
|
});
|
|
5728
|
-
}),
|
|
5732
|
+
}), on = n(function({ start: e, end: t, color: n, isHighlighted: r }) {
|
|
5729
5733
|
let i = l(null), o = new J.Vector3().subVectors(t, e), s = o.length();
|
|
5730
5734
|
o.normalize();
|
|
5731
5735
|
let c = new J.Vector3().addVectors(e, t).multiplyScalar(.5), u = r ? .08 : .05;
|
|
@@ -5750,7 +5754,7 @@ var rn = n(function({ position: e, label: t, color: n, isSelected: r, isHovered:
|
|
|
5750
5754
|
roughness: .4
|
|
5751
5755
|
})]
|
|
5752
5756
|
});
|
|
5753
|
-
}),
|
|
5757
|
+
}), sn = n(function({ position: e, direction: t, color: n, isHighlighted: r }) {
|
|
5754
5758
|
return /* @__PURE__ */ p("mesh", {
|
|
5755
5759
|
position: e,
|
|
5756
5760
|
quaternion: c(() => {
|
|
@@ -5769,7 +5773,7 @@ var rn = n(function({ position: e, label: t, color: n, isSelected: r, isHovered:
|
|
|
5769
5773
|
roughness: .4
|
|
5770
5774
|
})]
|
|
5771
5775
|
});
|
|
5772
|
-
}),
|
|
5776
|
+
}), cn = n(function({ start: e, end: t, color: n, isHighlighted: r, isSelfLoop: i, isBidirectional: a, showArrow: o }) {
|
|
5773
5777
|
if (i) return /* @__PURE__ */ p("group", {
|
|
5774
5778
|
position: e,
|
|
5775
5779
|
children: [/* @__PURE__ */ p("mesh", {
|
|
@@ -5814,29 +5818,29 @@ var rn = n(function({ position: e, label: t, color: n, isSelected: r, isHovered:
|
|
|
5814
5818
|
})]
|
|
5815
5819
|
});
|
|
5816
5820
|
let s = new J.Vector3().subVectors(t, e);
|
|
5817
|
-
return s.normalize(), /* @__PURE__ */ p("group", { children: [/* @__PURE__ */ f(
|
|
5821
|
+
return s.normalize(), /* @__PURE__ */ p("group", { children: [/* @__PURE__ */ f(on, {
|
|
5818
5822
|
start: e,
|
|
5819
5823
|
end: t,
|
|
5820
5824
|
color: n,
|
|
5821
5825
|
isHighlighted: r
|
|
5822
|
-
}), o && !a && /* @__PURE__ */ f(
|
|
5826
|
+
}), o && !a && /* @__PURE__ */ f(sn, {
|
|
5823
5827
|
position: t.clone().addScaledVector(s, -.66),
|
|
5824
5828
|
direction: s,
|
|
5825
5829
|
color: n,
|
|
5826
5830
|
isHighlighted: r
|
|
5827
5831
|
})] });
|
|
5828
|
-
}),
|
|
5829
|
-
function
|
|
5830
|
-
let { t: T } =
|
|
5832
|
+
}), ln = () => {};
|
|
5833
|
+
function un({ group: e, selectedElements: t, onSelectElement: n, actions: i, multiplyType: o, layout3D: s, nodeScale: m, autoRotate: h, showLabels: _, locked: y = !1, subsetHighlights: b = [], theme: C = "dark", faceFill: w }) {
|
|
5834
|
+
let { t: T } = Ie(), { gl: E, camera: D, scene: O } = se(), k = c(() => De(e, i), [e, i]), A = o ?? "right", j = s ?? F(e), M = m ?? 1, N = _ !== !1, P = n ?? ln, [I, L] = u(!1), R = h ?? I, [ee, te] = u(null), z = l({
|
|
5831
5835
|
theta: 0,
|
|
5832
5836
|
phi: Math.acos(3 / Math.sqrt(153)),
|
|
5833
5837
|
radius: Math.sqrt(153),
|
|
5834
5838
|
target: new J.Vector3(0, 0, 0),
|
|
5835
5839
|
initialized: !1
|
|
5836
|
-
}),
|
|
5840
|
+
}), ne = l({
|
|
5837
5841
|
x: 0,
|
|
5838
5842
|
y: 0
|
|
5839
|
-
}),
|
|
5843
|
+
}), B = l({
|
|
5840
5844
|
active: !1,
|
|
5841
5845
|
lastX: 0,
|
|
5842
5846
|
lastY: 0,
|
|
@@ -5852,11 +5856,11 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
5852
5856
|
target: new J.Vector3(),
|
|
5853
5857
|
renderer: null,
|
|
5854
5858
|
ecam: null
|
|
5855
|
-
}),
|
|
5856
|
-
let e =
|
|
5859
|
+
}), re = r(() => {
|
|
5860
|
+
let e = ne.current, t = Math.hypot(e.x, e.y);
|
|
5857
5861
|
return (t >= 8 ? .35 + Math.min(.65, t / 360) : 1) * 2 * Math.PI;
|
|
5858
|
-
}, []),
|
|
5859
|
-
if (!
|
|
5862
|
+
}, []), H = e.order > 100, ie = c(() => {
|
|
5863
|
+
if (!H) return new Set(e.elements.map((e) => e.id));
|
|
5860
5864
|
let n = new Set([e.identity.id]);
|
|
5861
5865
|
for (let e of k.filter((e) => e.enabled).slice(0, 4)) n.add(e.elementId);
|
|
5862
5866
|
for (let e of t) n.add(e);
|
|
@@ -5866,12 +5870,12 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
5866
5870
|
e,
|
|
5867
5871
|
k,
|
|
5868
5872
|
t,
|
|
5869
|
-
|
|
5870
|
-
]),
|
|
5873
|
+
H
|
|
5874
|
+
]), U = c(() => S(e, k, A), [
|
|
5871
5875
|
e,
|
|
5872
5876
|
k,
|
|
5873
5877
|
A
|
|
5874
|
-
]), G = c(() =>
|
|
5878
|
+
]), G = c(() => x(e, j).map((e) => new J.Vector3(e[0], e[1], e[2])), [e, j]), K = c(() => {
|
|
5875
5879
|
let e = new J.Vector3(0, 0, 0);
|
|
5876
5880
|
if (G.length === 0) return {
|
|
5877
5881
|
center: e,
|
|
@@ -5895,24 +5899,24 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
5895
5899
|
maxRadius: Math.max(30, t * 3),
|
|
5896
5900
|
target: K.center.clone()
|
|
5897
5901
|
};
|
|
5898
|
-
}, [K, D]),
|
|
5902
|
+
}, [K, D]), ae = l(q);
|
|
5899
5903
|
a(() => {
|
|
5900
|
-
|
|
5904
|
+
ae.current = q;
|
|
5901
5905
|
});
|
|
5902
|
-
let le = `${e.symbol}|${e.order}`,
|
|
5903
|
-
let e =
|
|
5906
|
+
let le = `${e.symbol}|${e.order}`, Y = r(() => {
|
|
5907
|
+
let e = z.current, t = ae.current;
|
|
5904
5908
|
e.theta = t.theta, e.phi = t.phi, e.radius = t.radius, e.target.copy(t.target);
|
|
5905
5909
|
}, []);
|
|
5906
5910
|
a(() => {
|
|
5907
|
-
|
|
5911
|
+
Y();
|
|
5908
5912
|
}, [
|
|
5909
5913
|
le,
|
|
5910
5914
|
j,
|
|
5911
|
-
|
|
5915
|
+
Y
|
|
5912
5916
|
]), a(() => {
|
|
5913
5917
|
if (y) return;
|
|
5914
5918
|
let e = E.domElement, t = (t) => {
|
|
5915
|
-
|
|
5919
|
+
B.current = {
|
|
5916
5920
|
active: !0,
|
|
5917
5921
|
lastX: t.clientX,
|
|
5918
5922
|
lastY: t.clientY,
|
|
@@ -5921,24 +5925,24 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
5921
5925
|
button: t.button
|
|
5922
5926
|
}, e.setPointerCapture?.(t.pointerId);
|
|
5923
5927
|
}, n = (e) => {
|
|
5924
|
-
let t =
|
|
5928
|
+
let t = B.current;
|
|
5925
5929
|
if (!t.active) return;
|
|
5926
5930
|
let n = e.clientX - t.lastX, r = e.clientY - t.lastY;
|
|
5927
5931
|
t.lastX = e.clientX, t.lastY = e.clientY, t.x += n, t.y += r;
|
|
5928
|
-
let i =
|
|
5932
|
+
let i = z.current;
|
|
5929
5933
|
if (t.button === 2) {
|
|
5930
5934
|
let e = new J.Vector3().setFromMatrixColumn(D.matrix, 0), t = new J.Vector3().setFromMatrixColumn(D.matrix, 1);
|
|
5931
5935
|
i.target.addScaledVector(e, -n * i.radius * .0012).addScaledVector(t, r * i.radius * .0012);
|
|
5932
5936
|
} else i.theta -= n * .006, i.phi -= r * .006;
|
|
5933
5937
|
}, r = (t) => {
|
|
5934
|
-
let n =
|
|
5935
|
-
n.active = !1, Math.hypot(n.x, n.y) >= 8 && (
|
|
5938
|
+
let n = B.current;
|
|
5939
|
+
n.active = !1, Math.hypot(n.x, n.y) >= 8 && (ne.current = {
|
|
5936
5940
|
x: n.x,
|
|
5937
5941
|
y: n.y
|
|
5938
5942
|
}), e.releasePointerCapture?.(t.pointerId);
|
|
5939
5943
|
}, i = (e) => {
|
|
5940
5944
|
e.preventDefault();
|
|
5941
|
-
let t =
|
|
5945
|
+
let t = z.current;
|
|
5942
5946
|
t.radius = Math.min(q.maxRadius, Math.max(q.minRadius, t.radius * .95 ** (-e.deltaY / 100)));
|
|
5943
5947
|
};
|
|
5944
5948
|
return e.addEventListener("pointerdown", t), e.addEventListener("pointermove", n), e.addEventListener("pointerup", r), e.addEventListener("pointercancel", r), e.addEventListener("wheel", i, { passive: !1 }), () => {
|
|
@@ -5950,25 +5954,25 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
5950
5954
|
q,
|
|
5951
5955
|
y
|
|
5952
5956
|
]);
|
|
5953
|
-
let
|
|
5954
|
-
let r =
|
|
5957
|
+
let ue = (e, t, n) => {
|
|
5958
|
+
let r = ne.current, i = Math.hypot(r.x, r.y);
|
|
5955
5959
|
i >= 8 ? (e.theta -= r.x / i * t * n, e.phi -= r.y / i * t * n) : e.theta -= t * n;
|
|
5956
|
-
},
|
|
5960
|
+
}, de = r((e) => {
|
|
5957
5961
|
let t = Math.sin(e.phi);
|
|
5958
5962
|
D.position.set(e.target.x + e.radius * t * Math.sin(e.theta), e.target.y + e.radius * Math.cos(e.phi), e.target.z + e.radius * t * Math.cos(e.theta)), D.up.set(0, t >= 0 ? 1 : -1, 0), D.lookAt(e.target);
|
|
5959
5963
|
}, [D]);
|
|
5960
|
-
|
|
5961
|
-
let n =
|
|
5962
|
-
n.initialized ||= (n.theta = q.theta, n.phi = q.phi, n.radius = q.radius, n.target.copy(q.target), !0), R &&
|
|
5964
|
+
oe((e, t) => {
|
|
5965
|
+
let n = z.current;
|
|
5966
|
+
n.initialized ||= (n.theta = q.theta, n.phi = q.phi, n.radius = q.radius, n.target.copy(q.target), !0), R && ue(n, re(), t), de(n);
|
|
5963
5967
|
}), a(() => {
|
|
5964
|
-
let e = E.domElement, t = () =>
|
|
5968
|
+
let e = E.domElement, t = () => Y();
|
|
5965
5969
|
return e.addEventListener("dblclick", t), () => e.removeEventListener("dblclick", t);
|
|
5966
|
-
}, [E,
|
|
5970
|
+
}, [E, Y]), a(() => {
|
|
5967
5971
|
if (!E.domElement.closest(".canvas-viewport")) return;
|
|
5968
5972
|
let e = {
|
|
5969
5973
|
isReady: () => !0,
|
|
5970
5974
|
snapshotOrbit: () => {
|
|
5971
|
-
let e =
|
|
5975
|
+
let e = z.current;
|
|
5972
5976
|
return {
|
|
5973
5977
|
theta: e.theta,
|
|
5974
5978
|
phi: e.phi,
|
|
@@ -5976,9 +5980,9 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
5976
5980
|
target: e.target.clone()
|
|
5977
5981
|
};
|
|
5978
5982
|
},
|
|
5979
|
-
displayAngVel: () =>
|
|
5983
|
+
displayAngVel: () => re(),
|
|
5980
5984
|
beginRotation: (e) => {
|
|
5981
|
-
let t =
|
|
5985
|
+
let t = z.current, n = new J.WebGLRenderer({
|
|
5982
5986
|
antialias: !1,
|
|
5983
5987
|
preserveDrawingBuffer: !0
|
|
5984
5988
|
});
|
|
@@ -6000,7 +6004,7 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6000
6004
|
frameAt: (e, t) => {
|
|
6001
6005
|
let n = V.current;
|
|
6002
6006
|
if (!n.active || !n.renderer || !n.ecam) return null;
|
|
6003
|
-
let r = n.radPerSec * e * t / 1e3, i =
|
|
6007
|
+
let r = n.radPerSec * e * t / 1e3, i = ne.current, a = Math.hypot(i.x, i.y), o, s;
|
|
6004
6008
|
a >= 8 ? (o = n.baseTheta - i.x / a * r, s = n.basePhi - i.y / a * r) : (o = n.baseTheta - r, s = n.basePhi);
|
|
6005
6009
|
let c = Math.sin(s);
|
|
6006
6010
|
return n.ecam.position.set(n.target.x + n.radius * c * Math.sin(o), n.target.y + n.radius * Math.cos(s), n.target.z + n.radius * c * Math.cos(o)), n.ecam.up.set(0, c >= 0 ? 1 : -1, 0), n.ecam.lookAt(n.target), n.renderer.render(O, n.ecam), n.renderer.domElement;
|
|
@@ -6010,21 +6014,21 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6010
6014
|
e.active = !1, e.renderer?.dispose(), e.renderer = null, e.ecam = null;
|
|
6011
6015
|
}
|
|
6012
6016
|
};
|
|
6013
|
-
return
|
|
6017
|
+
return tn(e), () => nn(e);
|
|
6014
6018
|
}, [
|
|
6015
6019
|
E,
|
|
6016
6020
|
O,
|
|
6017
6021
|
D,
|
|
6018
|
-
|
|
6022
|
+
re
|
|
6019
6023
|
]);
|
|
6020
|
-
let
|
|
6024
|
+
let fe = c(() => {
|
|
6021
6025
|
let t = /* @__PURE__ */ new Map();
|
|
6022
6026
|
for (let n of e.elements) t.set(n.id, n);
|
|
6023
6027
|
return t;
|
|
6024
|
-
}, [e]),
|
|
6028
|
+
}, [e]), pe = w?.enabled === !1 ? 0 : w?.opacity ?? .45, Z = c(() => {
|
|
6025
6029
|
let t = w?.subgroup;
|
|
6026
|
-
if (
|
|
6027
|
-
let n = v(
|
|
6030
|
+
if (pe <= 0 || !t || t.length === 0) return [];
|
|
6031
|
+
let n = v(U.map((e) => [e.fromIdx, e.toIdx])), r = W(e, t, G.map((e) => [
|
|
6028
6032
|
e.x,
|
|
6029
6033
|
e.y,
|
|
6030
6034
|
e.z
|
|
@@ -6052,28 +6056,28 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6052
6056
|
}, [
|
|
6053
6057
|
e,
|
|
6054
6058
|
w,
|
|
6055
|
-
|
|
6059
|
+
U,
|
|
6056
6060
|
G,
|
|
6057
|
-
|
|
6061
|
+
pe
|
|
6058
6062
|
]);
|
|
6059
6063
|
a(() => () => {
|
|
6060
|
-
for (let e of
|
|
6061
|
-
}, [
|
|
6062
|
-
let
|
|
6064
|
+
for (let e of Z) e.geometry.dispose();
|
|
6065
|
+
}, [Z]);
|
|
6066
|
+
let me = c(() => {
|
|
6063
6067
|
let e = /* @__PURE__ */ new Map();
|
|
6064
6068
|
for (let t of k) {
|
|
6065
|
-
let n =
|
|
6069
|
+
let n = fe.get(t.elementId);
|
|
6066
6070
|
n && e.set(t.elementId, n.label);
|
|
6067
6071
|
}
|
|
6068
6072
|
return e;
|
|
6069
|
-
}, [k,
|
|
6073
|
+
}, [k, fe]), he = c(() => {
|
|
6070
6074
|
let e = /* @__PURE__ */ new Map();
|
|
6071
|
-
for (let t of
|
|
6075
|
+
for (let t of b) for (let n of t.elementIds) e.has(n) || e.set(n, t);
|
|
6072
6076
|
return e;
|
|
6073
|
-
}, [
|
|
6074
|
-
let t = /* @__PURE__ */ new Map(), n =
|
|
6075
|
-
for (let r of
|
|
6076
|
-
if (
|
|
6077
|
+
}, [b]), ge = c(() => {
|
|
6078
|
+
let t = /* @__PURE__ */ new Map(), n = H ? Math.max(60, e.order * 2) : Infinity;
|
|
6079
|
+
for (let r of U) {
|
|
6080
|
+
if (H && !ie.has(r.fromId) && !ie.has(r.toId)) continue;
|
|
6077
6081
|
let i = `${Math.min(r.fromIdx, r.toIdx)}|${Math.max(r.fromIdx, r.toIdx)}|${r.actionElementId}`;
|
|
6078
6082
|
if (t.has(i) || t.set(i, {
|
|
6079
6083
|
fromIdx: r.fromIdx,
|
|
@@ -6084,7 +6088,7 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6084
6088
|
toPos: G[r.toIdx],
|
|
6085
6089
|
gen: {
|
|
6086
6090
|
name: r.actionElementId,
|
|
6087
|
-
symbol:
|
|
6091
|
+
symbol: fe.get(r.actionElementId)?.label || "",
|
|
6088
6092
|
color: r.color,
|
|
6089
6093
|
apply: () => e.elements[0],
|
|
6090
6094
|
inverse: {}
|
|
@@ -6095,12 +6099,12 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6095
6099
|
}
|
|
6096
6100
|
return t;
|
|
6097
6101
|
}, [
|
|
6098
|
-
|
|
6102
|
+
U,
|
|
6099
6103
|
G,
|
|
6100
6104
|
e,
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6105
|
+
H,
|
|
6106
|
+
ie,
|
|
6107
|
+
fe
|
|
6104
6108
|
]);
|
|
6105
6109
|
return /* @__PURE__ */ p(d, { children: [
|
|
6106
6110
|
/* @__PURE__ */ f("ambientLight", { intensity: .3 }),
|
|
@@ -6131,7 +6135,7 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6131
6135
|
intensity: .3,
|
|
6132
6136
|
color: "#ffffff"
|
|
6133
6137
|
}),
|
|
6134
|
-
/* @__PURE__ */ f(
|
|
6138
|
+
/* @__PURE__ */ f(ce, {
|
|
6135
6139
|
fullscreen: !0,
|
|
6136
6140
|
position: [
|
|
6137
6141
|
0,
|
|
@@ -6163,7 +6167,7 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6163
6167
|
},
|
|
6164
6168
|
children: [/* @__PURE__ */ f("span", {
|
|
6165
6169
|
style: { fontWeight: "bold" },
|
|
6166
|
-
dangerouslySetInnerHTML: { __html:
|
|
6170
|
+
dangerouslySetInnerHTML: { __html: Q(X(e.symbol)) }
|
|
6167
6171
|
}), /* @__PURE__ */ p("span", {
|
|
6168
6172
|
style: {
|
|
6169
6173
|
marginLeft: 8,
|
|
@@ -6189,7 +6193,7 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6189
6193
|
children: R ? "❚❚" : "▶"
|
|
6190
6194
|
}),
|
|
6191
6195
|
/* @__PURE__ */ f("button", {
|
|
6192
|
-
onClick:
|
|
6196
|
+
onClick: Y,
|
|
6193
6197
|
title: T("cayley3d.resetView"),
|
|
6194
6198
|
"aria-label": T("cayley3d.resetView"),
|
|
6195
6199
|
style: {
|
|
@@ -6207,7 +6211,7 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6207
6211
|
]
|
|
6208
6212
|
})
|
|
6209
6213
|
}),
|
|
6210
|
-
k.length > 0 && /* @__PURE__ */ f(
|
|
6214
|
+
k.length > 0 && /* @__PURE__ */ f(ce, {
|
|
6211
6215
|
fullscreen: !0,
|
|
6212
6216
|
position: [
|
|
6213
6217
|
0,
|
|
@@ -6236,7 +6240,7 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6236
6240
|
},
|
|
6237
6241
|
children: T(A === "right" ? "cayley3d.multiplyRight" : "cayley3d.multiplyLeft")
|
|
6238
6242
|
}), k.filter((e) => e.enabled).map((e) => {
|
|
6239
|
-
let t =
|
|
6243
|
+
let t = me.get(e.elementId) || e.elementId;
|
|
6240
6244
|
return /* @__PURE__ */ p("div", {
|
|
6241
6245
|
style: {
|
|
6242
6246
|
display: "flex",
|
|
@@ -6250,60 +6254,60 @@ function ln({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6250
6254
|
height: 3,
|
|
6251
6255
|
background: e.color,
|
|
6252
6256
|
borderRadius: 2
|
|
6253
|
-
} }), /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
6257
|
+
} }), /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(X(t)) } })]
|
|
6254
6258
|
}, e.elementId);
|
|
6255
6259
|
})]
|
|
6256
6260
|
})
|
|
6257
6261
|
}),
|
|
6258
|
-
|
|
6262
|
+
Z.map((e) => /* @__PURE__ */ f("mesh", {
|
|
6259
6263
|
geometry: e.geometry,
|
|
6260
6264
|
renderOrder: -2,
|
|
6261
6265
|
children: /* @__PURE__ */ f("meshBasicMaterial", {
|
|
6262
6266
|
color: e.color,
|
|
6263
6267
|
transparent: !0,
|
|
6264
|
-
opacity:
|
|
6268
|
+
opacity: pe,
|
|
6265
6269
|
side: J.DoubleSide,
|
|
6266
6270
|
depthWrite: !1
|
|
6267
6271
|
})
|
|
6268
6272
|
}, e.key)),
|
|
6269
6273
|
Array.from(ge.values()).map((e) => {
|
|
6270
|
-
let n =
|
|
6274
|
+
let n = fe.get(e.fromId), r = fe.get(e.toId);
|
|
6271
6275
|
if (!n || !r) return null;
|
|
6272
6276
|
let i = t.has(n.id) || t.has(r.id);
|
|
6273
|
-
return /* @__PURE__ */ f(
|
|
6277
|
+
return /* @__PURE__ */ f(cn, {
|
|
6274
6278
|
start: e.fromPos,
|
|
6275
6279
|
end: e.toPos,
|
|
6276
6280
|
color: e.gen.color,
|
|
6277
6281
|
isHighlighted: i,
|
|
6278
6282
|
isSelfLoop: e.isSelfLoop,
|
|
6279
6283
|
isBidirectional: e.isBidirectional,
|
|
6280
|
-
showArrow: !
|
|
6284
|
+
showArrow: !H
|
|
6281
6285
|
}, `edge-${e.fromIdx}-${e.toIdx}`);
|
|
6282
6286
|
}),
|
|
6283
6287
|
G.map((n, r) => {
|
|
6284
6288
|
let i = e.elements[r];
|
|
6285
|
-
if (
|
|
6289
|
+
if (H && !ie.has(i.id)) return null;
|
|
6286
6290
|
let a = t.has(i.id), o = he.get(i.id);
|
|
6287
|
-
return /* @__PURE__ */ f(
|
|
6291
|
+
return /* @__PURE__ */ f(an, {
|
|
6288
6292
|
position: n,
|
|
6289
6293
|
label: i.label,
|
|
6290
|
-
color:
|
|
6294
|
+
color: rn(r, e.order, e.isAbelian),
|
|
6291
6295
|
isSelected: a,
|
|
6292
|
-
isHovered:
|
|
6296
|
+
isHovered: ee?.id === i.id,
|
|
6293
6297
|
subsetColor: o ? o.color : null,
|
|
6294
6298
|
element: i,
|
|
6295
6299
|
nodeScale: M,
|
|
6296
6300
|
showLabel: N,
|
|
6297
6301
|
isDark: C === "dark",
|
|
6298
|
-
onSelectElement:
|
|
6299
|
-
onPointerEnter:
|
|
6300
|
-
onPointerLeave:
|
|
6302
|
+
onSelectElement: P,
|
|
6303
|
+
onPointerEnter: te,
|
|
6304
|
+
onPointerLeave: te
|
|
6301
6305
|
}, i.id);
|
|
6302
6306
|
})
|
|
6303
6307
|
] });
|
|
6304
6308
|
}
|
|
6305
|
-
function
|
|
6306
|
-
let { group: t, theme: n } = e, { t: r } =
|
|
6309
|
+
function dn(e) {
|
|
6310
|
+
let { group: t, theme: n } = e, { t: r } = Ie(), { theme: i } = $t(), a = n ?? i;
|
|
6307
6311
|
if (!t) return /* @__PURE__ */ f("div", {
|
|
6308
6312
|
className: "view-empty",
|
|
6309
6313
|
children: /* @__PURE__ */ f("p", { children: r("canvas.noGroup") })
|
|
@@ -6315,7 +6319,7 @@ function un(e) {
|
|
|
6315
6319
|
height: "100%",
|
|
6316
6320
|
background: o
|
|
6317
6321
|
},
|
|
6318
|
-
children: /* @__PURE__ */ p(
|
|
6322
|
+
children: /* @__PURE__ */ p(ae, {
|
|
6319
6323
|
camera: {
|
|
6320
6324
|
position: [
|
|
6321
6325
|
0,
|
|
@@ -6338,7 +6342,7 @@ function un(e) {
|
|
|
6338
6342
|
children: [/* @__PURE__ */ f("color", {
|
|
6339
6343
|
attach: "background",
|
|
6340
6344
|
args: [o]
|
|
6341
|
-
}), /* @__PURE__ */ f(
|
|
6345
|
+
}), /* @__PURE__ */ f(un, {
|
|
6342
6346
|
...e,
|
|
6343
6347
|
group: t,
|
|
6344
6348
|
theme: a
|
|
@@ -6348,7 +6352,7 @@ function un(e) {
|
|
|
6348
6352
|
}
|
|
6349
6353
|
//#endregion
|
|
6350
6354
|
//#region src/components/Canvas/SublatticeScene.tsx
|
|
6351
|
-
var
|
|
6355
|
+
var fn = {
|
|
6352
6356
|
derived: {
|
|
6353
6357
|
light: "#b8860b",
|
|
6354
6358
|
dark: "#ffd93d"
|
|
@@ -6365,15 +6369,15 @@ var dn = {
|
|
|
6365
6369
|
light: "#7c3aed",
|
|
6366
6370
|
dark: "#c084fc"
|
|
6367
6371
|
}
|
|
6368
|
-
},
|
|
6372
|
+
}, pn = {
|
|
6369
6373
|
w: 104,
|
|
6370
6374
|
h: 28,
|
|
6371
6375
|
font: 13
|
|
6372
|
-
},
|
|
6373
|
-
function
|
|
6376
|
+
}, mn = 8, hn = 11;
|
|
6377
|
+
function gn(e, t, n) {
|
|
6374
6378
|
return Math.min(e / Math.max(t, 1e-4), n);
|
|
6375
6379
|
}
|
|
6376
|
-
function
|
|
6380
|
+
function _n(e) {
|
|
6377
6381
|
return e === "light" ? {
|
|
6378
6382
|
edge: "#a9adbc",
|
|
6379
6383
|
edgeOpacity: .95,
|
|
@@ -6426,12 +6430,12 @@ function gn(e) {
|
|
|
6426
6430
|
seriesBadgeText: "#111"
|
|
6427
6431
|
};
|
|
6428
6432
|
}
|
|
6429
|
-
function
|
|
6433
|
+
function vn(e, t) {
|
|
6430
6434
|
let n = Array.from({ length: e }, () => []);
|
|
6431
6435
|
for (let r of t) r.from >= 0 && r.from < e && r.to >= 0 && r.to < e && (n[r.from].push(r.to), n[r.to].push(r.from));
|
|
6432
6436
|
return n;
|
|
6433
6437
|
}
|
|
6434
|
-
function
|
|
6438
|
+
function yn(e, t, n) {
|
|
6435
6439
|
if (t === n) return [t];
|
|
6436
6440
|
let r = /* @__PURE__ */ new Set(), i = [[t]];
|
|
6437
6441
|
for (; i.length > 0;) {
|
|
@@ -6444,9 +6448,9 @@ function vn(e, t, n) {
|
|
|
6444
6448
|
}
|
|
6445
6449
|
return null;
|
|
6446
6450
|
}
|
|
6447
|
-
function
|
|
6448
|
-
let { t: i } =
|
|
6449
|
-
let r = t.length === 1 ? "\\langle e \\rangle" : t.length === e.order ?
|
|
6451
|
+
function bn({ group: e, series: t, color: n, theme: r }) {
|
|
6452
|
+
let { t: i } = Ie(), { theme: a } = $t(), o = r ?? a, { type: s, terms: c, factors: l, solvable: u, nilpotent: m, chainCount: h, truncated: g, loading: _ } = t, v = c ? c.map((t, n) => {
|
|
6453
|
+
let r = t.length === 1 ? "\\langle e \\rangle" : t.length === e.order ? X(e.symbol) : `N_{${n}}`;
|
|
6450
6454
|
return (n === 0 ? "" : " \\trianglerighteq ") + r;
|
|
6451
6455
|
}).join("") : "", y = c ? c.map((e, t) => `|N_{${t}}| = ${e.length}`).join(",\\;") : "", b = l ? l.map((e, t) => `N_{${t}}/N_{${t + 1}} \\cong ${e.label}`).join(",\\;") : "", x = l ? [...l].sort((e, t) => e.order - t.order || e.label.localeCompare(t.label)).map((e) => e.label).join(", ") : "", S = o === "light" ? "#15803d" : "#4ade80", C = o === "light" ? "#0369a1" : "#38bdf8";
|
|
6452
6456
|
return /* @__PURE__ */ f("div", {
|
|
@@ -6473,7 +6477,7 @@ function yn({ group: e, series: t, color: n, theme: r }) {
|
|
|
6473
6477
|
color: n ?? void 0
|
|
6474
6478
|
},
|
|
6475
6479
|
children: i(`series.${s}`)
|
|
6476
|
-
}), /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
6480
|
+
}), /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(v) } })]
|
|
6477
6481
|
}),
|
|
6478
6482
|
/* @__PURE__ */ f("div", {
|
|
6479
6483
|
style: {
|
|
@@ -6485,7 +6489,7 @@ function yn({ group: e, series: t, color: n, theme: r }) {
|
|
|
6485
6489
|
},
|
|
6486
6490
|
children: /* @__PURE__ */ f("span", {
|
|
6487
6491
|
style: { color: "var(--text-muted)" },
|
|
6488
|
-
dangerouslySetInnerHTML: { __html:
|
|
6492
|
+
dangerouslySetInnerHTML: { __html: Q(y) }
|
|
6489
6493
|
})
|
|
6490
6494
|
}),
|
|
6491
6495
|
l && l.length > 0 && /* @__PURE__ */ f("div", {
|
|
@@ -6496,7 +6500,7 @@ function yn({ group: e, series: t, color: n, theme: r }) {
|
|
|
6496
6500
|
gap: "4px 14px",
|
|
6497
6501
|
marginTop: 3
|
|
6498
6502
|
},
|
|
6499
|
-
children: /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
6503
|
+
children: /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(b) } })
|
|
6500
6504
|
}),
|
|
6501
6505
|
/* @__PURE__ */ p("div", {
|
|
6502
6506
|
style: {
|
|
@@ -6554,13 +6558,13 @@ function yn({ group: e, series: t, color: n, theme: r }) {
|
|
|
6554
6558
|
})
|
|
6555
6559
|
});
|
|
6556
6560
|
}
|
|
6557
|
-
function
|
|
6558
|
-
let { t: S } =
|
|
6561
|
+
function xn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelDetail: i = "auto", mergeConjugates: a = !1, nodeScale: o = 1, showSeriesPanel: d = !0, series: m = null, centerIds: h, subsets: g, activeNodeIdx: _, onActivateNode: v, noGroupText: y, theme: b, maxEnumerateOrder: x = 60 }) {
|
|
6562
|
+
let { t: S } = Ie(), { theme: C } = $t(), w = b ?? C, T = c(() => _n(w), [w]), D = l(null), [k, A] = u({
|
|
6559
6563
|
width: 0,
|
|
6560
6564
|
height: 0
|
|
6561
6565
|
});
|
|
6562
6566
|
s(() => {
|
|
6563
|
-
let e =
|
|
6567
|
+
let e = D.current;
|
|
6564
6568
|
if (!e) return;
|
|
6565
6569
|
let t = () => {
|
|
6566
6570
|
let t = e.getBoundingClientRect();
|
|
@@ -6573,15 +6577,15 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6573
6577
|
let n = new ResizeObserver(t);
|
|
6574
6578
|
return n.observe(e), () => n.disconnect();
|
|
6575
6579
|
}, [e?.symbol]);
|
|
6576
|
-
let
|
|
6580
|
+
let j = r?.width ?? k.width, N = r?.height ?? k.height, P = n ?? {
|
|
6577
6581
|
x: 0,
|
|
6578
6582
|
y: 0,
|
|
6579
6583
|
scale: 1
|
|
6580
|
-
}, F = c(() => t === void 0 ? !e || e.order > x ? null :
|
|
6584
|
+
}, F = c(() => t === void 0 ? !e || e.order > x ? null : O(e) : t, [
|
|
6581
6585
|
e,
|
|
6582
6586
|
t,
|
|
6583
6587
|
x
|
|
6584
|
-
]), { viewNodes:
|
|
6588
|
+
]), { viewNodes: I, viewEdges: R, mergedOf: ee, mergeUnavailable: te } = c(() => {
|
|
6585
6589
|
if (!F) return {
|
|
6586
6590
|
viewNodes: [],
|
|
6587
6591
|
viewEdges: [],
|
|
@@ -6595,7 +6599,7 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6595
6599
|
mergeUnavailable: !1
|
|
6596
6600
|
};
|
|
6597
6601
|
if (!a || !e) return t;
|
|
6598
|
-
let n =
|
|
6602
|
+
let n = re(e, F.nodes, F.edges);
|
|
6599
6603
|
return n ? {
|
|
6600
6604
|
viewNodes: n.nodes,
|
|
6601
6605
|
viewEdges: n.edges,
|
|
@@ -6609,125 +6613,125 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6609
6613
|
F,
|
|
6610
6614
|
a,
|
|
6611
6615
|
e
|
|
6612
|
-
]),
|
|
6613
|
-
|
|
6616
|
+
]), z = c(() => E(I, R, { nodeScale: o }), [
|
|
6617
|
+
I,
|
|
6614
6618
|
R,
|
|
6615
6619
|
o
|
|
6616
|
-
]), { eff:
|
|
6617
|
-
let e =
|
|
6620
|
+
]), { eff: H, slotScreenWidth: ie, tier: U, edgeWidth: W } = c(() => {
|
|
6621
|
+
let e = ne(j, N, z.viewW, z.viewH), t = e * P.scale, { slotScreenWidth: n, rowScreenHeight: r } = V(z.slotW, z.rowH, e, P.scale), a = i === "auto" ? B(n, r) : i;
|
|
6618
6622
|
return {
|
|
6619
6623
|
fit: e,
|
|
6620
6624
|
eff: t,
|
|
6621
6625
|
slotScreenWidth: n,
|
|
6622
6626
|
rowScreenHeight: r,
|
|
6623
6627
|
tier: a,
|
|
6624
|
-
edgeWidth: a === "full" ?
|
|
6628
|
+
edgeWidth: a === "full" ? T.edgeWidth : gn(1.7, t, z.nodeRx * .1)
|
|
6625
6629
|
};
|
|
6626
6630
|
}, [
|
|
6627
|
-
|
|
6631
|
+
j,
|
|
6628
6632
|
N,
|
|
6629
|
-
|
|
6633
|
+
z,
|
|
6630
6634
|
P.scale,
|
|
6631
6635
|
i,
|
|
6632
|
-
|
|
6636
|
+
T
|
|
6633
6637
|
]), { fullIdx: q, trivialIdx: ae } = c(() => {
|
|
6634
6638
|
let t = e?.order ?? 0;
|
|
6635
6639
|
return {
|
|
6636
|
-
fullIdx:
|
|
6637
|
-
trivialIdx:
|
|
6640
|
+
fullIdx: I.findIndex((e) => e.order === t),
|
|
6641
|
+
trivialIdx: I.findIndex((e) => e.order === 1)
|
|
6638
6642
|
};
|
|
6639
|
-
}, [
|
|
6643
|
+
}, [I, e]), oe = c(() => h ? new Set(h) : !e || e.order > x ? null : new Set(L(e).map((e) => e.id)), [
|
|
6640
6644
|
e,
|
|
6641
6645
|
h,
|
|
6642
6646
|
x
|
|
6643
|
-
]), se = c(() => !oe || oe.size === 0 ? -1 :
|
|
6647
|
+
]), se = c(() => !oe || oe.size === 0 ? -1 : I.findIndex((e) => e.elementIds.length === oe.size ? e.elementIds.every((e) => oe.has(e)) : !1), [I, oe]), ce = c(() => {
|
|
6644
6648
|
let t = /* @__PURE__ */ new Map();
|
|
6645
6649
|
if (!e) return t;
|
|
6646
|
-
for (let { prime: n, exponent: r } of
|
|
6650
|
+
for (let { prime: n, exponent: r } of M(e.order)) {
|
|
6647
6651
|
let e = 1;
|
|
6648
6652
|
for (let t = 0; t < r; t++) e *= n;
|
|
6649
6653
|
t.set(e, n);
|
|
6650
6654
|
}
|
|
6651
6655
|
return t;
|
|
6652
|
-
}, [e]), [
|
|
6653
|
-
if (
|
|
6654
|
-
let e = /* @__PURE__ */ new Set(), t = q >= 0 ?
|
|
6656
|
+
}, [e]), [le, J] = u(null), Y = _ ?? le, [ue, de] = u(null), fe = c(() => vn(I.length, R), [I, R]), pe = c(() => {
|
|
6657
|
+
if (Y === null || I.length === 0) return /* @__PURE__ */ new Set();
|
|
6658
|
+
let e = /* @__PURE__ */ new Set(), t = q >= 0 ? yn(fe, Y, q) : null, n = ae >= 0 ? yn(fe, Y, ae) : null;
|
|
6655
6659
|
return t && t.forEach((t) => e.add(t)), n && n.forEach((t) => e.add(t)), e;
|
|
6656
6660
|
}, [
|
|
6657
|
-
|
|
6658
|
-
|
|
6661
|
+
Y,
|
|
6662
|
+
fe,
|
|
6659
6663
|
q,
|
|
6660
6664
|
ae,
|
|
6661
|
-
|
|
6662
|
-
]),
|
|
6665
|
+
I
|
|
6666
|
+
]), Z = c(() => {
|
|
6663
6667
|
let e = /* @__PURE__ */ new Set();
|
|
6664
|
-
if (
|
|
6668
|
+
if (pe.size === 0) return e;
|
|
6665
6669
|
for (let t = 0; t < R.length; t++) {
|
|
6666
6670
|
let n = R[t];
|
|
6667
|
-
|
|
6671
|
+
pe.has(n.from) && pe.has(n.to) && e.add(t);
|
|
6668
6672
|
}
|
|
6669
6673
|
return e;
|
|
6670
|
-
}, [
|
|
6674
|
+
}, [pe, R]), me = c(() => {
|
|
6671
6675
|
if (!m) return null;
|
|
6672
|
-
let e =
|
|
6676
|
+
let e = fn[m.type];
|
|
6673
6677
|
return w === "light" ? e.light : e.dark;
|
|
6674
6678
|
}, [m, w]), he = c(() => {
|
|
6675
6679
|
let e = /* @__PURE__ */ new Map();
|
|
6676
6680
|
return F && F.nodes.forEach((t, n) => {
|
|
6677
|
-
let r =
|
|
6678
|
-
e.has(r) || e.set(r,
|
|
6681
|
+
let r = G(t.elementIds);
|
|
6682
|
+
e.has(r) || e.set(r, ee ? ee[n] : n);
|
|
6679
6683
|
}), e;
|
|
6680
|
-
}, [F,
|
|
6684
|
+
}, [F, ee]), ge = c(() => {
|
|
6681
6685
|
let e = /* @__PURE__ */ new Map();
|
|
6682
6686
|
return m?.terms && m.terms.forEach((t, n) => {
|
|
6683
|
-
let r = he.get(
|
|
6687
|
+
let r = he.get(G(t.map((e) => e.id)));
|
|
6684
6688
|
r !== void 0 && !e.has(r) && e.set(r, n);
|
|
6685
6689
|
}), e;
|
|
6686
6690
|
}, [m, he]), _e = c(() => new Set(ge.keys()), [ge]), ve = c(() => {
|
|
6687
|
-
let e =
|
|
6691
|
+
let e = U === "compact" ? gn(pn.h / 2, H, z.nodeRy * .9) : U === "dots" ? gn(mn, H, z.nodeRx * .42) : z.nodeRy;
|
|
6688
6692
|
return R.map((t, n) => {
|
|
6689
|
-
let r =
|
|
6693
|
+
let r = z.positions[t.from], i = z.positions[t.to];
|
|
6690
6694
|
if (!r || !i) return null;
|
|
6691
|
-
let a =
|
|
6695
|
+
let a = Z.has(n);
|
|
6692
6696
|
return /* @__PURE__ */ f("line", {
|
|
6693
6697
|
x1: r.x,
|
|
6694
6698
|
y1: r.y + e,
|
|
6695
6699
|
x2: i.x,
|
|
6696
6700
|
y2: i.y - e,
|
|
6697
|
-
stroke: a ?
|
|
6698
|
-
strokeWidth: a ? Math.max(
|
|
6699
|
-
opacity: a ? 1 :
|
|
6701
|
+
stroke: a ? T.pathEdge : T.edge,
|
|
6702
|
+
strokeWidth: a ? Math.max(T.pathEdgeWidth, W) : W,
|
|
6703
|
+
opacity: a ? 1 : U === "dots" ? .75 : T.edgeOpacity
|
|
6700
6704
|
}, `edge-${n}`);
|
|
6701
6705
|
});
|
|
6702
6706
|
}, [
|
|
6703
6707
|
R,
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6708
|
+
z,
|
|
6709
|
+
Z,
|
|
6710
|
+
T,
|
|
6711
|
+
U,
|
|
6707
6712
|
W,
|
|
6708
|
-
|
|
6709
|
-
U
|
|
6713
|
+
H
|
|
6710
6714
|
]), ye = c(() => (g ?? []).map((e) => ({
|
|
6711
6715
|
color: e.color,
|
|
6712
6716
|
set: new Set(e.elementIds)
|
|
6713
|
-
})), [g]), be = c(() =>
|
|
6714
|
-
let r =
|
|
6717
|
+
})), [g]), be = c(() => I.map((t, n) => {
|
|
6718
|
+
let r = z.positions[n];
|
|
6715
6719
|
if (!r) return null;
|
|
6716
|
-
let i = t.orbitSize ?? 1, a =
|
|
6717
|
-
a && !(d !== void 0 &&
|
|
6720
|
+
let i = t.orbitSize ?? 1, a = pe.has(n), o = Y === n, s = t.order === 1, c = t.order === (e?.order ?? 0), l = n === se, u = t.order > 1 ? ce.get(t.order) : void 0, d = ge.get(n), h = !!m?.terms && d === void 0 && !_e.has(n), g = T.nodeFill, _ = t.isNormal ? T.nodeStrokeNormal : T.nodeStroke, y = 2.5, b = T.nodeText;
|
|
6721
|
+
a && !(d !== void 0 && me) && (g = T.pathFill, _ = T.pathStroke, y = 4, b = T.pathText), o && (g = T.activeFill, y = 4), l && !a && (g = T.centerFill, _ = T.centerStroke), s && !a && (g = T.trivialFill, _ = T.trivialStroke, y = 2), c && !a && (g = T.fullFill, _ = T.fullStroke), d !== void 0 && me && (_ = me, y = U === "full" ? 4 : Math.max(gn(3, H, z.nodeRx * .1), W));
|
|
6718
6722
|
let x = ye.find((e) => t.elementIds.every((t) => e.set.has(t))), C = {
|
|
6719
6723
|
onMouseDown: (e) => e.stopPropagation(),
|
|
6720
6724
|
onClick: (e) => {
|
|
6721
|
-
e.stopPropagation(),
|
|
6725
|
+
e.stopPropagation(), Y === n ? (J(null), v?.(null, null)) : (J(n), v?.(n, t));
|
|
6722
6726
|
},
|
|
6723
|
-
onMouseEnter: () =>
|
|
6724
|
-
onMouseLeave: () =>
|
|
6727
|
+
onMouseEnter: () => de(n),
|
|
6728
|
+
onMouseLeave: () => de((e) => e === n ? null : e)
|
|
6725
6729
|
}, w = {
|
|
6726
6730
|
cursor: "pointer",
|
|
6727
6731
|
opacity: h ? .22 : 1
|
|
6728
6732
|
};
|
|
6729
|
-
if (
|
|
6730
|
-
let e =
|
|
6733
|
+
if (U === "dots") {
|
|
6734
|
+
let e = gn(mn, H, z.nodeRx * .42), m = d !== void 0 && me ? me : l ? T.centerStroke : u === void 0 ? c ? T.fullStroke : s ? T.trivialStroke : t.isNormal ? T.nodeStrokeNormal : T.dotPlain : T.sylowText;
|
|
6731
6735
|
return /* @__PURE__ */ p("g", {
|
|
6732
6736
|
transform: `translate(${r.x}, ${r.y})`,
|
|
6733
6737
|
style: w,
|
|
@@ -6737,7 +6741,7 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6737
6741
|
/* @__PURE__ */ f("circle", {
|
|
6738
6742
|
cx: 0,
|
|
6739
6743
|
cy: 0,
|
|
6740
|
-
r:
|
|
6744
|
+
r: gn(14, H, z.nodeRx),
|
|
6741
6745
|
fill: "transparent",
|
|
6742
6746
|
stroke: "none"
|
|
6743
6747
|
}),
|
|
@@ -6745,16 +6749,16 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6745
6749
|
cx: 0,
|
|
6746
6750
|
cy: 0,
|
|
6747
6751
|
r: e,
|
|
6748
|
-
fill: a ?
|
|
6749
|
-
stroke: a ?
|
|
6750
|
-
strokeWidth: a || o ?
|
|
6752
|
+
fill: a ? T.pathFill : m,
|
|
6753
|
+
stroke: a ? T.pathStroke : m,
|
|
6754
|
+
strokeWidth: a || o ? gn(2.5, H, e) : 0
|
|
6751
6755
|
}),
|
|
6752
6756
|
i > 1 && /* @__PURE__ */ p("text", {
|
|
6753
|
-
x: e +
|
|
6754
|
-
y:
|
|
6757
|
+
x: e + gn(3, H, z.nodeRx * .2),
|
|
6758
|
+
y: gn(-3, H, z.nodeRy * .5),
|
|
6755
6759
|
textAnchor: "start",
|
|
6756
|
-
fill:
|
|
6757
|
-
fontSize: hn
|
|
6760
|
+
fill: T.nodeSubText,
|
|
6761
|
+
fontSize: gn(hn, H, z.nodeRx * .6),
|
|
6758
6762
|
fontFamily: "monospace",
|
|
6759
6763
|
style: {
|
|
6760
6764
|
pointerEvents: "none",
|
|
@@ -6765,8 +6769,8 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6765
6769
|
]
|
|
6766
6770
|
}, t.id);
|
|
6767
6771
|
}
|
|
6768
|
-
if (
|
|
6769
|
-
let u =
|
|
6772
|
+
if (U === "compact") {
|
|
6773
|
+
let u = gn(pn.w / 2, H, z.nodeRx * .94), m = gn(pn.h / 2, H, z.nodeRy * .9), h = gn(pn.font, H, z.nodeRx * .5);
|
|
6770
6774
|
return /* @__PURE__ */ p("g", {
|
|
6771
6775
|
transform: `translate(${r.x}, ${r.y})`,
|
|
6772
6776
|
style: w,
|
|
@@ -6811,7 +6815,7 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6811
6815
|
x: u - h * .35,
|
|
6812
6816
|
y: h * .36,
|
|
6813
6817
|
textAnchor: "end",
|
|
6814
|
-
fill:
|
|
6818
|
+
fill: T.nodeSubText,
|
|
6815
6819
|
fontSize: h * .85,
|
|
6816
6820
|
fontFamily: "monospace",
|
|
6817
6821
|
style: {
|
|
@@ -6839,14 +6843,14 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6839
6843
|
color: b,
|
|
6840
6844
|
fontSize: h
|
|
6841
6845
|
},
|
|
6842
|
-
dangerouslySetInnerHTML: { __html:
|
|
6846
|
+
dangerouslySetInnerHTML: { __html: Q(X(e.symbol)) }
|
|
6843
6847
|
})
|
|
6844
6848
|
}),
|
|
6845
|
-
d !== void 0 &&
|
|
6849
|
+
d !== void 0 && me && /* @__PURE__ */ f("circle", {
|
|
6846
6850
|
cx: -u + m * .55,
|
|
6847
6851
|
cy: 0,
|
|
6848
6852
|
r: m * .3,
|
|
6849
|
-
fill:
|
|
6853
|
+
fill: me,
|
|
6850
6854
|
stroke: "none",
|
|
6851
6855
|
style: { pointerEvents: "none" }
|
|
6852
6856
|
}),
|
|
@@ -6854,14 +6858,14 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6854
6858
|
cx: u - m * .55,
|
|
6855
6859
|
cy: 0,
|
|
6856
6860
|
r: m * .3,
|
|
6857
|
-
fill:
|
|
6861
|
+
fill: T.centerStroke,
|
|
6858
6862
|
stroke: "none",
|
|
6859
6863
|
style: { pointerEvents: "none" }
|
|
6860
6864
|
})
|
|
6861
6865
|
]
|
|
6862
6866
|
}, t.id);
|
|
6863
6867
|
}
|
|
6864
|
-
let
|
|
6868
|
+
let E = z.nodeRx, D = z.nodeRy;
|
|
6865
6869
|
return /* @__PURE__ */ p("g", {
|
|
6866
6870
|
transform: `translate(${r.x}, ${r.y})`,
|
|
6867
6871
|
style: w,
|
|
@@ -6869,9 +6873,9 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6869
6873
|
...C,
|
|
6870
6874
|
children: [
|
|
6871
6875
|
/* @__PURE__ */ f("rect", {
|
|
6872
|
-
x: -
|
|
6876
|
+
x: -E,
|
|
6873
6877
|
y: -D,
|
|
6874
|
-
width:
|
|
6878
|
+
width: E * 2,
|
|
6875
6879
|
height: D * 2,
|
|
6876
6880
|
rx: 12,
|
|
6877
6881
|
ry: 12,
|
|
@@ -6880,9 +6884,9 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6880
6884
|
strokeWidth: y
|
|
6881
6885
|
}),
|
|
6882
6886
|
x && !a && /* @__PURE__ */ f("rect", {
|
|
6883
|
-
x: -
|
|
6887
|
+
x: -E,
|
|
6884
6888
|
y: -D,
|
|
6885
|
-
width:
|
|
6889
|
+
width: E * 2,
|
|
6886
6890
|
height: D * 2,
|
|
6887
6891
|
rx: 12,
|
|
6888
6892
|
ry: 12,
|
|
@@ -6903,10 +6907,10 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6903
6907
|
children: s ? "⟨e⟩" : c ? "" : i > 1 ? `|H|=${t.order} ×${i}` : `|H|=${t.order}`
|
|
6904
6908
|
}),
|
|
6905
6909
|
l && /* @__PURE__ */ f("text", {
|
|
6906
|
-
x:
|
|
6910
|
+
x: E - 6,
|
|
6907
6911
|
y: -D + 12,
|
|
6908
6912
|
textAnchor: "end",
|
|
6909
|
-
fill:
|
|
6913
|
+
fill: T.centerStroke,
|
|
6910
6914
|
fontSize: 10,
|
|
6911
6915
|
fontWeight: "bold",
|
|
6912
6916
|
fontFamily: "monospace",
|
|
@@ -6917,10 +6921,10 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6917
6921
|
children: "Z(G)"
|
|
6918
6922
|
}),
|
|
6919
6923
|
u !== void 0 && /* @__PURE__ */ f("text", {
|
|
6920
|
-
x: -
|
|
6924
|
+
x: -E + 6,
|
|
6921
6925
|
y: -D + 12,
|
|
6922
6926
|
textAnchor: "start",
|
|
6923
|
-
fill:
|
|
6927
|
+
fill: T.sylowText,
|
|
6924
6928
|
fontSize: 10,
|
|
6925
6929
|
fontWeight: "bold",
|
|
6926
6930
|
fontFamily: "monospace",
|
|
@@ -6930,29 +6934,29 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6930
6934
|
},
|
|
6931
6935
|
children: S("lattice.sylow", { p: String(u) })
|
|
6932
6936
|
}),
|
|
6933
|
-
d !== void 0 &&
|
|
6937
|
+
d !== void 0 && me && /* @__PURE__ */ p("g", {
|
|
6934
6938
|
style: { pointerEvents: "none" },
|
|
6935
6939
|
children: [/* @__PURE__ */ f("circle", {
|
|
6936
|
-
cx: -
|
|
6940
|
+
cx: -E + 12,
|
|
6937
6941
|
cy: D - 12,
|
|
6938
6942
|
r: 9,
|
|
6939
|
-
fill:
|
|
6943
|
+
fill: me,
|
|
6940
6944
|
stroke: "none"
|
|
6941
6945
|
}), /* @__PURE__ */ f("text", {
|
|
6942
|
-
x: -
|
|
6946
|
+
x: -E + 12,
|
|
6943
6947
|
y: D - 8,
|
|
6944
6948
|
textAnchor: "middle",
|
|
6945
6949
|
fontSize: "10",
|
|
6946
6950
|
fontWeight: "bold",
|
|
6947
|
-
fill:
|
|
6951
|
+
fill: T.seriesBadgeText,
|
|
6948
6952
|
fontFamily: "monospace",
|
|
6949
6953
|
children: d
|
|
6950
6954
|
})]
|
|
6951
6955
|
}),
|
|
6952
6956
|
c && e && /* @__PURE__ */ f("foreignObject", {
|
|
6953
|
-
x: -
|
|
6957
|
+
x: -E + 6,
|
|
6954
6958
|
y: -D + 2,
|
|
6955
|
-
width:
|
|
6959
|
+
width: E * 2 - 12,
|
|
6956
6960
|
height: D * 2 - 4,
|
|
6957
6961
|
style: {
|
|
6958
6962
|
pointerEvents: "none",
|
|
@@ -6968,13 +6972,13 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6968
6972
|
color: b,
|
|
6969
6973
|
fontSize: "15px"
|
|
6970
6974
|
},
|
|
6971
|
-
dangerouslySetInnerHTML: { __html:
|
|
6975
|
+
dangerouslySetInnerHTML: { __html: Q(X(e.symbol)) }
|
|
6972
6976
|
})
|
|
6973
6977
|
}),
|
|
6974
6978
|
/* @__PURE__ */ f("text", {
|
|
6975
6979
|
y: 13,
|
|
6976
6980
|
textAnchor: "middle",
|
|
6977
|
-
fill: a ?
|
|
6981
|
+
fill: a ? T.pathSubText : t.isNormal ? T.nodeStrokeNormal : T.nodeSubText,
|
|
6978
6982
|
fontSize: "11px",
|
|
6979
6983
|
fontFamily: "monospace",
|
|
6980
6984
|
style: {
|
|
@@ -6986,29 +6990,29 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6986
6990
|
]
|
|
6987
6991
|
}, t.id);
|
|
6988
6992
|
}), [
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
+
I,
|
|
6994
|
+
z,
|
|
6995
|
+
pe,
|
|
6996
|
+
Y,
|
|
6993
6997
|
e,
|
|
6994
6998
|
se,
|
|
6995
6999
|
ce,
|
|
6996
7000
|
ge,
|
|
6997
7001
|
m,
|
|
6998
7002
|
_e,
|
|
6999
|
-
|
|
7000
|
-
|
|
7003
|
+
me,
|
|
7004
|
+
T,
|
|
7001
7005
|
ye,
|
|
7002
7006
|
S,
|
|
7003
|
-
W,
|
|
7004
7007
|
U,
|
|
7005
|
-
|
|
7008
|
+
H,
|
|
7009
|
+
W,
|
|
7006
7010
|
v
|
|
7007
7011
|
]), xe = c(() => {
|
|
7008
|
-
if (!
|
|
7012
|
+
if (!me) return null;
|
|
7009
7013
|
let e = [...ge.entries()].sort((e, t) => e[1] - t[1]), t = [];
|
|
7010
7014
|
for (let n = 0; n + 1 < e.length; n++) {
|
|
7011
|
-
let r =
|
|
7015
|
+
let r = z.positions[e[n][0]], i = z.positions[e[n + 1][0]];
|
|
7012
7016
|
r && i && t.push({
|
|
7013
7017
|
from: r,
|
|
7014
7018
|
to: i
|
|
@@ -7016,39 +7020,39 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7016
7020
|
}
|
|
7017
7021
|
return t;
|
|
7018
7022
|
}, [
|
|
7019
|
-
|
|
7023
|
+
me,
|
|
7020
7024
|
ge,
|
|
7021
|
-
|
|
7022
|
-
]), Se =
|
|
7025
|
+
z
|
|
7026
|
+
]), Se = ue ?? Y, Ce = Se === null ? null : I[Se] ?? null, we = c(() => !e || !Ce || Ce.order === e.order ? null : K(e, Ce.elementIds), [e, Ce]), Te = Ce, Ee = Se === null ? void 0 : ge.get(Se), De = c(() => {
|
|
7023
7027
|
if (!e || !Ce || Se === null) return null;
|
|
7024
|
-
let t =
|
|
7028
|
+
let t = z.positions[Se];
|
|
7025
7029
|
if (!t) return null;
|
|
7026
|
-
let n =
|
|
7027
|
-
c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
7028
|
-
style: { color:
|
|
7030
|
+
let n = z.nodeRy, r = 12 / H, i = 6 / H, a = 280 / H, o = 18 / H, s = 8 / H, c = [];
|
|
7031
|
+
c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(`|H| = ${Ce.order}`) } }, "order")), we && c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(`\\cong ${we}`) } }, "sym")), Ce.isNormal && Ce.order !== e.order && c.push(/* @__PURE__ */ f("span", {
|
|
7032
|
+
style: { color: T.nodeStrokeNormal },
|
|
7029
7033
|
children: `◁ ${S("badge.normal")}`
|
|
7030
|
-
}, "normal")), c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
7034
|
+
}, "normal")), c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(`[G:H] = ${Math.round(e.order / Ce.order)}`) } }, "idx")), (Te?.orbitSize ?? 1) > 1 && c.push(/* @__PURE__ */ p("span", {
|
|
7031
7035
|
style: { color: "var(--text-muted)" },
|
|
7032
7036
|
children: [
|
|
7033
7037
|
S("lattice.orbitMembers", { n: String(Te.orbitSize) }),
|
|
7034
7038
|
" · ",
|
|
7035
|
-
/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
7039
|
+
/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(`|N_G(H)| = ${Te.normalizerOrder}`) } })
|
|
7036
7040
|
]
|
|
7037
|
-
}, "orbit")), Ce.label && Ce.label !== `${Ce.order}` && c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
7038
|
-
style: { color:
|
|
7041
|
+
}, "orbit")), Ce.label && Ce.label !== `${Ce.order}` && c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(X(Ce.label)) } }, "label")), Ee !== void 0 && m && c.push(/* @__PURE__ */ f("span", {
|
|
7042
|
+
style: { color: me ?? void 0 },
|
|
7039
7043
|
children: `N_${Ee} · ${S(`series.${m.type}`)}`
|
|
7040
7044
|
}, "term"));
|
|
7041
7045
|
let l = o * c.length + i * 2, u = t.y - n - s - l, d = t.y + n + s, h = u, g = "down";
|
|
7042
|
-
(u < 0 || d + l >
|
|
7043
|
-
let _ = t.x - a / 2, v = Math.min(Math.max(_, 0), Math.max(
|
|
7046
|
+
(u < 0 || d + l > z.viewH) && (u >= z.viewH - (d + l) ? (h = Math.max(u, 0), g = "down") : (h = Math.min(d, z.viewH - l), g = "up"));
|
|
7047
|
+
let _ = t.x - a / 2, v = Math.min(Math.max(_, 0), Math.max(z.viewW - a, 0)), y = Math.min(Math.max(t.x, v + r), v + a - r), b = g === "down" ? h + l : h, x = g === "down" ? h : h + l;
|
|
7044
7048
|
return /* @__PURE__ */ p("g", {
|
|
7045
7049
|
style: { pointerEvents: "none" },
|
|
7046
7050
|
"data-testid": "lattice-bubble",
|
|
7047
7051
|
children: [/* @__PURE__ */ f("polygon", {
|
|
7048
|
-
points: `${y - 6 /
|
|
7052
|
+
points: `${y - 6 / H},${x} ${y + 6 / H},${x} ${y},${b}`,
|
|
7049
7053
|
fill: "var(--bg-panel)",
|
|
7050
7054
|
stroke: "var(--border-primary)",
|
|
7051
|
-
strokeWidth: 1 /
|
|
7055
|
+
strokeWidth: 1 / H
|
|
7052
7056
|
}), /* @__PURE__ */ f("foreignObject", {
|
|
7053
7057
|
x: v,
|
|
7054
7058
|
y: h,
|
|
@@ -7061,21 +7065,21 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7061
7065
|
height: "100%",
|
|
7062
7066
|
padding: `${i}px ${r}px`,
|
|
7063
7067
|
border: "1px solid var(--border-primary)",
|
|
7064
|
-
borderRadius: `${6 /
|
|
7068
|
+
borderRadius: `${6 / H}px`,
|
|
7065
7069
|
background: "var(--bg-panel)",
|
|
7066
7070
|
color: "var(--text-primary)",
|
|
7067
|
-
fontSize: `${13 /
|
|
7071
|
+
fontSize: `${13 / H}px`,
|
|
7068
7072
|
lineHeight: 1.4,
|
|
7069
7073
|
boxShadow: "0 2px 8px rgba(0,0,0,0.25)",
|
|
7070
7074
|
display: "flex",
|
|
7071
7075
|
flexDirection: "column",
|
|
7072
|
-
gap: `${2 /
|
|
7076
|
+
gap: `${2 / H}px`
|
|
7073
7077
|
},
|
|
7074
7078
|
children: c.map((e, t) => /* @__PURE__ */ f("span", {
|
|
7075
7079
|
style: {
|
|
7076
7080
|
display: "inline-flex",
|
|
7077
7081
|
alignItems: "center",
|
|
7078
|
-
gap: `${8 /
|
|
7082
|
+
gap: `${8 / H}px`
|
|
7079
7083
|
},
|
|
7080
7084
|
children: e
|
|
7081
7085
|
}, t))
|
|
@@ -7088,21 +7092,21 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7088
7092
|
Te,
|
|
7089
7093
|
Ee,
|
|
7090
7094
|
we,
|
|
7095
|
+
z,
|
|
7091
7096
|
H,
|
|
7092
|
-
U,
|
|
7093
7097
|
e,
|
|
7094
7098
|
m,
|
|
7095
|
-
|
|
7099
|
+
me,
|
|
7096
7100
|
S,
|
|
7097
|
-
|
|
7101
|
+
T.nodeStrokeNormal
|
|
7098
7102
|
]);
|
|
7099
|
-
return !e || !F ||
|
|
7103
|
+
return !e || !F || I.length === 0 ? /* @__PURE__ */ f("div", {
|
|
7100
7104
|
className: "view-empty",
|
|
7101
7105
|
children: /* @__PURE__ */ f("p", { children: y ?? S(e ? "lattice.backendOnly" : "canvas.noGroup") })
|
|
7102
7106
|
}) : /* @__PURE__ */ p("div", {
|
|
7103
7107
|
className: "sublattice-view-wrap",
|
|
7104
|
-
"data-lattice-tier":
|
|
7105
|
-
"data-lattice-slot-width": Math.round(
|
|
7108
|
+
"data-lattice-tier": U,
|
|
7109
|
+
"data-lattice-slot-width": Math.round(ie),
|
|
7106
7110
|
style: {
|
|
7107
7111
|
height: "100%",
|
|
7108
7112
|
display: "flex",
|
|
@@ -7116,8 +7120,8 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7116
7120
|
position: "relative"
|
|
7117
7121
|
},
|
|
7118
7122
|
children: /* @__PURE__ */ f("svg", {
|
|
7119
|
-
ref:
|
|
7120
|
-
viewBox: `0 0 ${
|
|
7123
|
+
ref: D,
|
|
7124
|
+
viewBox: `0 0 ${z.viewW} ${z.viewH}`,
|
|
7121
7125
|
className: "view-svg",
|
|
7122
7126
|
style: {
|
|
7123
7127
|
position: "absolute",
|
|
@@ -7136,8 +7140,8 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7136
7140
|
y1: e.from.y,
|
|
7137
7141
|
x2: e.to.x,
|
|
7138
7142
|
y2: e.to.y,
|
|
7139
|
-
stroke:
|
|
7140
|
-
strokeWidth:
|
|
7143
|
+
stroke: me,
|
|
7144
|
+
strokeWidth: U === "full" ? 4 : Math.max(gn(4, H, z.nodeRx * .1), W),
|
|
7141
7145
|
strokeLinecap: "round",
|
|
7142
7146
|
opacity: .85
|
|
7143
7147
|
}, `series-line-${t}`)),
|
|
@@ -7147,7 +7151,7 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7147
7151
|
})
|
|
7148
7152
|
})
|
|
7149
7153
|
}),
|
|
7150
|
-
|
|
7154
|
+
te && /* @__PURE__ */ f("div", {
|
|
7151
7155
|
"data-testid": "lattice-merge-hint",
|
|
7152
7156
|
style: {
|
|
7153
7157
|
padding: "2px 10px",
|
|
@@ -7157,10 +7161,10 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7157
7161
|
},
|
|
7158
7162
|
children: S("lattice.mergeTooLarge")
|
|
7159
7163
|
}),
|
|
7160
|
-
d && m && /* @__PURE__ */ f(
|
|
7164
|
+
d && m && /* @__PURE__ */ f(bn, {
|
|
7161
7165
|
group: e,
|
|
7162
7166
|
series: m,
|
|
7163
|
-
color:
|
|
7167
|
+
color: me,
|
|
7164
7168
|
theme: w
|
|
7165
7169
|
})
|
|
7166
7170
|
]
|
|
@@ -7168,19 +7172,19 @@ function bn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7168
7172
|
}
|
|
7169
7173
|
//#endregion
|
|
7170
7174
|
//#region src/components/Canvas/SceneWindow.tsx
|
|
7171
|
-
var
|
|
7175
|
+
var Sn = 32, Cn = 220, wn = 160, Tn = 208, En = 8, Dn = 5e3, On = {
|
|
7172
7176
|
x: 12,
|
|
7173
7177
|
y: 12
|
|
7174
|
-
},
|
|
7178
|
+
}, kn = {
|
|
7175
7179
|
width: 440,
|
|
7176
7180
|
height: 320
|
|
7177
|
-
},
|
|
7181
|
+
}, An = {
|
|
7178
7182
|
locked: !1,
|
|
7179
7183
|
showInfo: !1,
|
|
7180
7184
|
resizable: !0,
|
|
7181
7185
|
viewportFixed: !1,
|
|
7182
7186
|
showControls: !0
|
|
7183
|
-
},
|
|
7187
|
+
}, jn = {
|
|
7184
7188
|
n: "ns-resize",
|
|
7185
7189
|
s: "ns-resize",
|
|
7186
7190
|
e: "ew-resize",
|
|
@@ -7189,7 +7193,7 @@ var xn = 32, Sn = 220, Cn = 160, wn = 208, Tn = 8, En = 5e3, Dn = {
|
|
|
7189
7193
|
sw: "nesw-resize",
|
|
7190
7194
|
nw: "nwse-resize",
|
|
7191
7195
|
se: "nwse-resize"
|
|
7192
|
-
},
|
|
7196
|
+
}, Mn = [
|
|
7193
7197
|
"n",
|
|
7194
7198
|
"s",
|
|
7195
7199
|
"e",
|
|
@@ -7198,7 +7202,7 @@ var xn = 32, Sn = 220, Cn = 160, wn = 208, Tn = 8, En = 5e3, Dn = {
|
|
|
7198
7202
|
"nw",
|
|
7199
7203
|
"se",
|
|
7200
7204
|
"sw"
|
|
7201
|
-
],
|
|
7205
|
+
], Nn = {
|
|
7202
7206
|
dark: {
|
|
7203
7207
|
tbarBg: "#131c2b",
|
|
7204
7208
|
tbarBorder: "#24324a",
|
|
@@ -7222,7 +7226,7 @@ var xn = 32, Sn = 220, Cn = 160, wn = 208, Tn = 8, En = 5e3, Dn = {
|
|
|
7222
7226
|
accent: "#0e7490"
|
|
7223
7227
|
}
|
|
7224
7228
|
};
|
|
7225
|
-
function
|
|
7229
|
+
function Pn(e, t) {
|
|
7226
7230
|
try {
|
|
7227
7231
|
let n = localStorage.getItem(`gv-sw-${e}`);
|
|
7228
7232
|
return n ? t(JSON.parse(n)) : null;
|
|
@@ -7230,19 +7234,19 @@ function Nn(e, t) {
|
|
|
7230
7234
|
return null;
|
|
7231
7235
|
}
|
|
7232
7236
|
}
|
|
7233
|
-
function
|
|
7237
|
+
function Fn(e, t) {
|
|
7234
7238
|
try {
|
|
7235
7239
|
localStorage.setItem(`gv-sw-${e}`, JSON.stringify(t));
|
|
7236
7240
|
} catch {}
|
|
7237
7241
|
}
|
|
7238
|
-
function
|
|
7242
|
+
function In(e, t) {
|
|
7239
7243
|
return t ? {
|
|
7240
7244
|
...e,
|
|
7241
7245
|
...t
|
|
7242
7246
|
} : e;
|
|
7243
7247
|
}
|
|
7244
|
-
function
|
|
7245
|
-
return !e || !t ? null :
|
|
7248
|
+
function Ln(e, t = !0) {
|
|
7249
|
+
return !e || !t ? null : Pn(e, (e) => {
|
|
7246
7250
|
let t = e.pos, n = e.size, r = e.config;
|
|
7247
7251
|
return {
|
|
7248
7252
|
pos: t && typeof t.x == "number" && typeof t.y == "number" ? {
|
|
@@ -7250,35 +7254,35 @@ function In(e, t = !0) {
|
|
|
7250
7254
|
y: t.y
|
|
7251
7255
|
} : void 0,
|
|
7252
7256
|
size: n && typeof n.width == "number" && typeof n.height == "number" ? {
|
|
7253
|
-
width: Math.max(
|
|
7254
|
-
height: Math.max(
|
|
7257
|
+
width: Math.max(Cn, n.width),
|
|
7258
|
+
height: Math.max(wn, n.height)
|
|
7255
7259
|
} : void 0,
|
|
7256
7260
|
cfg: r && typeof r == "object" ? r : void 0
|
|
7257
7261
|
};
|
|
7258
7262
|
});
|
|
7259
7263
|
}
|
|
7260
|
-
var
|
|
7261
|
-
function
|
|
7262
|
-
let _ =
|
|
7264
|
+
var Rn = {};
|
|
7265
|
+
function zn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabilities: o, config: s, onConfigChange: c, storageKey: l, defaultPosition: d, defaultSize: m, onClose: h, children: g }) {
|
|
7266
|
+
let _ = Nn[n], v = !!l && o?.persist !== !1, [y, b] = u(() => {
|
|
7263
7267
|
let e = {
|
|
7264
|
-
...
|
|
7265
|
-
...s ??
|
|
7266
|
-
}, t =
|
|
7267
|
-
return t?.cfg ?
|
|
7268
|
+
...An,
|
|
7269
|
+
...s ?? Rn
|
|
7270
|
+
}, t = Ln(l, v);
|
|
7271
|
+
return t?.cfg ? In(e, t.cfg) : e;
|
|
7268
7272
|
}), x = r((e) => {
|
|
7269
7273
|
b((t) => {
|
|
7270
|
-
let n =
|
|
7274
|
+
let n = In(t, e);
|
|
7271
7275
|
return c?.(n), n;
|
|
7272
7276
|
});
|
|
7273
7277
|
}, [c]), [S, C] = u(() => {
|
|
7274
|
-
let e =
|
|
7278
|
+
let e = Ln(l, v);
|
|
7275
7279
|
return {
|
|
7276
|
-
pos: e?.pos ?? d ??
|
|
7277
|
-
size: e?.size ?? m ??
|
|
7280
|
+
pos: e?.pos ?? d ?? On,
|
|
7281
|
+
size: e?.size ?? m ?? kn
|
|
7278
7282
|
};
|
|
7279
7283
|
}), { pos: w, size: T } = S;
|
|
7280
7284
|
a(() => {
|
|
7281
|
-
v &&
|
|
7285
|
+
v && Fn(l, {
|
|
7282
7286
|
pos: w,
|
|
7283
7287
|
size: T,
|
|
7284
7288
|
config: y
|
|
@@ -7290,7 +7294,7 @@ function Rn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7290
7294
|
l,
|
|
7291
7295
|
v
|
|
7292
7296
|
]);
|
|
7293
|
-
let [E, D] = u(() => ++
|
|
7297
|
+
let [E, D] = u(() => ++Dn), O = r(() => D(++Dn), []), [k, A] = u(!1), j = r((e) => {
|
|
7294
7298
|
if (y.locked || e.target.closest("button")) return;
|
|
7295
7299
|
e.preventDefault(), O();
|
|
7296
7300
|
let t = {
|
|
@@ -7330,7 +7334,7 @@ function Rn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7330
7334
|
width: n.ow,
|
|
7331
7335
|
height: n.oh
|
|
7332
7336
|
};
|
|
7333
|
-
e.includes("e") && (s = Math.max(
|
|
7337
|
+
e.includes("e") && (s = Math.max(Cn, n.ow + r)), e.includes("s") && (c = Math.max(wn, n.oh + i)), e.includes("w") && (s = Math.max(Cn, n.ow - r), a = n.ox + (n.ow - s)), e.includes("n") && (c = Math.max(wn, n.oh - i), o = n.oy + (n.oh - c)), C({
|
|
7334
7338
|
pos: {
|
|
7335
7339
|
x: a,
|
|
7336
7340
|
y: o
|
|
@@ -7370,7 +7374,7 @@ function Rn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7370
7374
|
params: !0,
|
|
7371
7375
|
close: !0,
|
|
7372
7376
|
persist: !0,
|
|
7373
|
-
...o ??
|
|
7377
|
+
...o ?? Rn
|
|
7374
7378
|
}, P = y.showControls !== !1, F = e ?? (t ? t.symbol : "View"), I = y.showInfo && t ? `${t.symbol} · |G|=${t.order} · ${t.name ?? ""}` : "", L = {
|
|
7375
7379
|
background: "none",
|
|
7376
7380
|
border: "none",
|
|
@@ -7408,7 +7412,7 @@ function Rn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7408
7412
|
alignItems: "center",
|
|
7409
7413
|
justifyContent: "space-between",
|
|
7410
7414
|
padding: "0 6px 0 10px",
|
|
7411
|
-
height:
|
|
7415
|
+
height: Sn,
|
|
7412
7416
|
background: _.tbarBg,
|
|
7413
7417
|
borderBottom: `1px solid ${_.tbarBorder}`,
|
|
7414
7418
|
cursor: N.drag && !y.locked ? "grab" : "default",
|
|
@@ -7475,15 +7479,15 @@ function Rn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7475
7479
|
}), /* @__PURE__ */ p("div", {
|
|
7476
7480
|
style: {
|
|
7477
7481
|
position: "relative",
|
|
7478
|
-
height: T.height - (N.titlebar && P ?
|
|
7482
|
+
height: T.height - (N.titlebar && P ? Sn : 0),
|
|
7479
7483
|
overflow: "hidden",
|
|
7480
7484
|
background: _.contentBg
|
|
7481
7485
|
},
|
|
7482
|
-
children: [g, N.resize && y.resizable !== !1 &&
|
|
7486
|
+
children: [g, N.resize && y.resizable !== !1 && Mn.map((e) => {
|
|
7483
7487
|
let t = {
|
|
7484
7488
|
position: "absolute",
|
|
7485
7489
|
zIndex: 10,
|
|
7486
|
-
cursor:
|
|
7490
|
+
cursor: jn[e],
|
|
7487
7491
|
background: "transparent"
|
|
7488
7492
|
}, n = (() => {
|
|
7489
7493
|
switch (e) {
|
|
@@ -7549,9 +7553,9 @@ function Rn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7549
7553
|
}), k && N.params && /* @__PURE__ */ p("div", {
|
|
7550
7554
|
style: {
|
|
7551
7555
|
position: y.viewportFixed ? "fixed" : "absolute",
|
|
7552
|
-
left: T.width +
|
|
7556
|
+
left: T.width + En,
|
|
7553
7557
|
top: 0,
|
|
7554
|
-
width:
|
|
7558
|
+
width: Tn,
|
|
7555
7559
|
maxHeight: T.height,
|
|
7556
7560
|
overflowY: "auto",
|
|
7557
7561
|
zIndex: E + 1,
|
|
@@ -7657,9 +7661,9 @@ function Rn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7657
7661
|
}
|
|
7658
7662
|
//#endregion
|
|
7659
7663
|
//#region src/components/Canvas/SceneHoverBubble.tsx
|
|
7660
|
-
function
|
|
7664
|
+
function Bn({ element: e, anchor: t, theme: n = "dark", group: r, offset: i }) {
|
|
7661
7665
|
if (!e || !t) return null;
|
|
7662
|
-
let a = i?.x ?? 0, o = i?.y ?? -14, s = r ?
|
|
7666
|
+
let a = i?.x ?? 0, o = i?.y ?? -14, s = r ? j(r, e) : null;
|
|
7663
7667
|
return /* @__PURE__ */ f("div", {
|
|
7664
7668
|
"data-theme": n,
|
|
7665
7669
|
style: {
|
|
@@ -7705,18 +7709,18 @@ function zn({ element: e, anchor: t, theme: n = "dark", group: r, offset: i }) {
|
|
|
7705
7709
|
}
|
|
7706
7710
|
//#endregion
|
|
7707
7711
|
//#region src/hooks/useSceneState.ts
|
|
7708
|
-
var
|
|
7712
|
+
var Vn = {
|
|
7709
7713
|
x: 0,
|
|
7710
7714
|
y: 0,
|
|
7711
7715
|
scale: 1
|
|
7712
|
-
},
|
|
7716
|
+
}, Hn = {
|
|
7713
7717
|
width: 800,
|
|
7714
7718
|
height: 600
|
|
7715
|
-
},
|
|
7716
|
-
function
|
|
7717
|
-
let { initialTransform: i, locked: o = !1, enableZoom: s = !0, enablePan: d = !0, minScale: f =
|
|
7719
|
+
}, Un = .25, Wn = 8;
|
|
7720
|
+
function Gn(e, n = {}) {
|
|
7721
|
+
let { initialTransform: i, locked: o = !1, enableZoom: s = !0, enablePan: d = !0, minScale: f = Un, maxScale: p = Wn, selectedElements: m, onSelectionChange: h, fallbackViewBoxSize: g, hostStyle: _, theme: v = "dark", renderHoverBubble: y } = n, b = l(null), x = r((e) => {
|
|
7718
7722
|
b.current = e;
|
|
7719
|
-
}, []), S = r(() => b.current, []), [C, w] = u(g ??
|
|
7723
|
+
}, []), S = r(() => b.current, []), [C, w] = u(g ?? Hn);
|
|
7720
7724
|
a(() => {
|
|
7721
7725
|
let e = b.current;
|
|
7722
7726
|
if (!e) return;
|
|
@@ -7731,9 +7735,9 @@ function Wn(e, n = {}) {
|
|
|
7731
7735
|
let n = new ResizeObserver(t);
|
|
7732
7736
|
return n.observe(e), () => n.disconnect();
|
|
7733
7737
|
}, []);
|
|
7734
|
-
let [T, E] = u(i ??
|
|
7738
|
+
let [T, E] = u(i ?? Vn), D = l(T), O = r((e) => {
|
|
7735
7739
|
D.current = e, E(e);
|
|
7736
|
-
}, []), k = r(() => O(i ??
|
|
7740
|
+
}, []), k = r(() => O(i ?? Vn), [O, i]), A = r((e, t) => {
|
|
7737
7741
|
let n = b.current, r = n?.getBoundingClientRect();
|
|
7738
7742
|
if (!r) return {
|
|
7739
7743
|
x: 0,
|
|
@@ -7794,7 +7798,7 @@ function Wn(e, n = {}) {
|
|
|
7794
7798
|
ox: D.current.x,
|
|
7795
7799
|
oy: D.current.y
|
|
7796
7800
|
}, F(!0));
|
|
7797
|
-
}, [I]),
|
|
7801
|
+
}, [I]), ee = r((e) => {
|
|
7798
7802
|
if (!N.current.active) return;
|
|
7799
7803
|
let t = N.current;
|
|
7800
7804
|
O({
|
|
@@ -7806,7 +7810,7 @@ function Wn(e, n = {}) {
|
|
|
7806
7810
|
a(() => {
|
|
7807
7811
|
if (P) return globalThis.addEventListener("mouseup", L), () => globalThis.removeEventListener("mouseup", L);
|
|
7808
7812
|
}, [P, L]);
|
|
7809
|
-
let
|
|
7813
|
+
let te = c(() => ({
|
|
7810
7814
|
ref: x,
|
|
7811
7815
|
style: {
|
|
7812
7816
|
position: "relative",
|
|
@@ -7818,7 +7822,7 @@ function Wn(e, n = {}) {
|
|
|
7818
7822
|
..._
|
|
7819
7823
|
},
|
|
7820
7824
|
onMouseDown: R,
|
|
7821
|
-
onMouseMove:
|
|
7825
|
+
onMouseMove: ee,
|
|
7822
7826
|
onMouseUp: L,
|
|
7823
7827
|
onMouseLeave: L
|
|
7824
7828
|
}), [
|
|
@@ -7827,44 +7831,44 @@ function Wn(e, n = {}) {
|
|
|
7827
7831
|
I,
|
|
7828
7832
|
P,
|
|
7829
7833
|
R,
|
|
7830
|
-
|
|
7834
|
+
ee,
|
|
7831
7835
|
L
|
|
7832
|
-
]), [
|
|
7833
|
-
m ||
|
|
7834
|
-
}, [m, h]),
|
|
7835
|
-
V(typeof e == "function" ? e(m ??
|
|
7836
|
+
]), [z, ne] = u(() => /* @__PURE__ */ new Set()), B = m ?? z, V = r((e) => {
|
|
7837
|
+
m || ne(e), h?.(e);
|
|
7838
|
+
}, [m, h]), re = r((e) => {
|
|
7839
|
+
V(typeof e == "function" ? e(m ?? z) : e);
|
|
7836
7840
|
}, [
|
|
7837
7841
|
m,
|
|
7838
|
-
|
|
7842
|
+
z,
|
|
7839
7843
|
V
|
|
7840
|
-
]),
|
|
7841
|
-
let n = m ??
|
|
7844
|
+
]), H = r((e, t = !1) => {
|
|
7845
|
+
let n = m ?? z;
|
|
7842
7846
|
if (t) {
|
|
7843
7847
|
let t = new Set(n);
|
|
7844
7848
|
t.has(e) ? t.delete(e) : t.add(e), V(t);
|
|
7845
7849
|
} else V(new Set([e]));
|
|
7846
7850
|
}, [
|
|
7847
7851
|
m,
|
|
7848
|
-
|
|
7852
|
+
z,
|
|
7849
7853
|
V
|
|
7850
|
-
]),
|
|
7851
|
-
if (
|
|
7854
|
+
]), ie = r(() => V(/* @__PURE__ */ new Set()), [V]), [U, W] = u(null), [G, K] = u(null), q = r((e, t) => {
|
|
7855
|
+
if (W(e), !e || !t) {
|
|
7852
7856
|
K(null);
|
|
7853
7857
|
return;
|
|
7854
7858
|
}
|
|
7855
7859
|
K(t);
|
|
7856
|
-
}, []), ae = c(() =>
|
|
7857
|
-
element:
|
|
7860
|
+
}, []), ae = c(() => U ? y ? y(U, G) : t(Bn, {
|
|
7861
|
+
element: U,
|
|
7858
7862
|
anchor: G,
|
|
7859
7863
|
theme: v,
|
|
7860
7864
|
group: e ?? null
|
|
7861
7865
|
}) : null, [
|
|
7862
|
-
|
|
7866
|
+
U,
|
|
7863
7867
|
G,
|
|
7864
7868
|
y,
|
|
7865
7869
|
v,
|
|
7866
7870
|
e
|
|
7867
|
-
]), [oe, se] = u(() => /* @__PURE__ */ new Map()), ce = r((e) => oe.get(e), [oe]),
|
|
7871
|
+
]), [oe, se] = u(() => /* @__PURE__ */ new Map()), ce = r((e) => oe.get(e), [oe]), le = r((e, t, n) => {
|
|
7868
7872
|
se((r) => {
|
|
7869
7873
|
let i = new Map(r);
|
|
7870
7874
|
return i.set(e, {
|
|
@@ -7872,42 +7876,42 @@ function Wn(e, n = {}) {
|
|
|
7872
7876
|
y: n
|
|
7873
7877
|
}), i;
|
|
7874
7878
|
});
|
|
7875
|
-
}, []),
|
|
7876
|
-
return
|
|
7877
|
-
hostProps:
|
|
7879
|
+
}, []), J = r(() => se(/* @__PURE__ */ new Map()), []), [Y, ue] = u(e);
|
|
7880
|
+
return Y !== e && (ue(e), W(null), K(null), se(/* @__PURE__ */ new Map()), m || ne(/* @__PURE__ */ new Set())), {
|
|
7881
|
+
hostProps: te,
|
|
7878
7882
|
viewBoxSize: C,
|
|
7879
7883
|
getHostElement: S,
|
|
7880
7884
|
canvasTransform: T,
|
|
7881
7885
|
setCanvasTransform: O,
|
|
7882
|
-
selectedElements:
|
|
7883
|
-
setSelectedElements:
|
|
7884
|
-
select:
|
|
7885
|
-
clearSelection:
|
|
7886
|
-
hovered:
|
|
7886
|
+
selectedElements: B,
|
|
7887
|
+
setSelectedElements: re,
|
|
7888
|
+
select: H,
|
|
7889
|
+
clearSelection: ie,
|
|
7890
|
+
hovered: U,
|
|
7887
7891
|
hoverAnchor: G,
|
|
7888
7892
|
hoverBubble: ae,
|
|
7889
7893
|
sceneProps: c(() => ({
|
|
7890
|
-
selectedElements:
|
|
7894
|
+
selectedElements: B,
|
|
7891
7895
|
canvasTransform: T,
|
|
7892
7896
|
viewBoxSize: C,
|
|
7893
|
-
onSelect:
|
|
7897
|
+
onSelect: H,
|
|
7894
7898
|
onHover: q
|
|
7895
7899
|
}), [
|
|
7896
|
-
|
|
7900
|
+
B,
|
|
7897
7901
|
T,
|
|
7898
7902
|
C,
|
|
7899
|
-
|
|
7903
|
+
H,
|
|
7900
7904
|
q
|
|
7901
7905
|
]),
|
|
7902
7906
|
resetTransform: k,
|
|
7903
7907
|
zoomBy: M,
|
|
7904
7908
|
locked: o,
|
|
7905
7909
|
getNodePosition: ce,
|
|
7906
|
-
onNodePositionChange:
|
|
7907
|
-
resetNodePositions:
|
|
7910
|
+
onNodePositionChange: le,
|
|
7911
|
+
resetNodePositions: J
|
|
7908
7912
|
};
|
|
7909
7913
|
}
|
|
7910
7914
|
//#endregion
|
|
7911
|
-
export {
|
|
7915
|
+
export { xt as ActionScene, dn as Cayley3DScene, Oe as CayleyView, ze as CosetStripScene, ye as CycleView, At as HomomorphismScene, Fe as I18nProvider, Bn as SceneHoverBubble, Y as SceneThemeRoot, zn as SceneWindow, he as SetView, xn as SublatticeScene, Kt as SymmetryViewScene, Ge as TableView, Gn as useSceneState, Ie as useTranslation };
|
|
7912
7916
|
|
|
7913
7917
|
//# sourceMappingURL=index.js.map
|