logic-atlas 0.25.0 → 0.26.0
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/CITATION.cff +2 -2
- package/README.md +8 -4
- package/dist/case.js +1 -1
- package/dist/chunks/{CasePage-R2k_0lls.js → CasePage-CbCDu1FO.js} +3 -3
- package/dist/chunks/{CasePage-R2k_0lls.js.map → CasePage-CbCDu1FO.js.map} +1 -1
- package/dist/chunks/{CausalPlayground-Cd7Sok3F.js → CausalPlayground-D93D0ceE.js} +5 -5
- package/dist/chunks/{CausalPlayground-Cd7Sok3F.js.map → CausalPlayground-D93D0ceE.js.map} +1 -1
- package/dist/chunks/{CiteBlock-irdT1sjg.js → CiteBlock-DMFqM7ZM.js} +2 -2
- package/dist/chunks/{CiteBlock-irdT1sjg.js.map → CiteBlock-DMFqM7ZM.js.map} +1 -1
- package/dist/chunks/{ConservativeExtension-BX4EtG16.js → ConservativeExtension-Cofe92ak.js} +2 -2
- package/dist/chunks/{ConservativeExtension-BX4EtG16.js.map → ConservativeExtension-Cofe92ak.js.map} +1 -1
- package/dist/chunks/{ExportMenu-B5HoqaQl.js → ExportMenu-DaLZ5rBJ.js} +3 -3
- package/dist/chunks/{ExportMenu-B5HoqaQl.js.map → ExportMenu-DaLZ5rBJ.js.map} +1 -1
- package/dist/chunks/{GraphBox-Tg3kDWNT.js → GraphBox-DjjoWUU0.js} +3 -3
- package/dist/chunks/{GraphBox-Tg3kDWNT.js.map → GraphBox-DjjoWUU0.js.map} +1 -1
- package/dist/chunks/{IdentifyPanel-BVmZsWGN.js → IdentifyPanel-CoPC-Okk.js} +3 -3
- package/dist/chunks/{IdentifyPanel-BVmZsWGN.js.map → IdentifyPanel-CoPC-Okk.js.map} +1 -1
- package/dist/chunks/{ModelEditor-oAvvVqX5.js → ModelEditor-A6kk6Si5.js} +2 -2
- package/dist/chunks/{ModelEditor-oAvvVqX5.js.map → ModelEditor-A6kk6Si5.js.map} +1 -1
- package/dist/chunks/{ProbabilityPanel-8-cC68rq.js → ProbabilityPanel-DKTFYU-j.js} +5 -5
- package/dist/chunks/{ProbabilityPanel-8-cC68rq.js.map → ProbabilityPanel-DKTFYU-j.js.map} +1 -1
- package/dist/chunks/{RulesPanel-Cr6R9xCK.js → RulesPanel-B6X9O0he.js} +3 -3
- package/dist/chunks/{RulesPanel-Cr6R9xCK.js.map → RulesPanel-B6X9O0he.js.map} +1 -1
- package/dist/chunks/SignalGraph-CWPf_sG8.js +1412 -0
- package/dist/chunks/SignalGraph-CWPf_sG8.js.map +1 -0
- package/dist/chunks/{SliderList-BrILQCA4.js → SliderList-DmDURTeF.js} +2 -2
- package/dist/chunks/{SliderList-BrILQCA4.js.map → SliderList-DmDURTeF.js.map} +1 -1
- package/dist/chunks/{WorldLanes-kxYTRnB5.js → WorldLanes-DDtJZqcA.js} +2 -2
- package/dist/chunks/{WorldLanes-kxYTRnB5.js.map → WorldLanes-DDtJZqcA.js.map} +1 -1
- package/dist/chunks/{cite-B6emUIEW.js → cite-QzNc24r2.js} +2 -2
- package/dist/chunks/{cite-B6emUIEW.js.map → cite-QzNc24r2.js.map} +1 -1
- package/dist/chunks/{export-image-IsI6PVd9.js → export-image-BBHOXOis.js} +3 -3
- package/dist/chunks/{export-image-IsI6PVd9.js.map → export-image-BBHOXOis.js.map} +1 -1
- package/dist/cite.js +1 -1
- package/dist/editor.js +1 -1
- package/dist/extension.js +1 -1
- package/dist/ground-cases.js +767 -0
- package/dist/ground-cases.js.map +1 -0
- package/dist/ground.css +2 -0
- package/dist/ground.js +3829 -0
- package/dist/ground.js.map +1 -0
- package/dist/identify.js +1 -1
- package/dist/index.js +8 -8
- package/dist/lanes.js +1 -1
- package/dist/playground.js +1 -1
- package/dist/probability.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/ground/cases/index.d.ts +7 -0
- package/dist/types/ground/components/DiscernibilityPanel.d.ts +35 -0
- package/dist/types/ground/components/GroundChecker.d.ts +16 -0
- package/dist/types/ground/components/ProposalTable.d.ts +20 -0
- package/dist/types/ground/components/StructureView.d.ts +21 -0
- package/dist/types/ground/components/case-text.d.ts +32 -0
- package/dist/types/ground/components/parts.d.ts +59 -0
- package/dist/types/ground/components/structure-layout.d.ts +59 -0
- package/dist/types/ground/components/use-premises.d.ts +21 -0
- package/dist/types/ground/data/analyze.d.ts +41 -0
- package/dist/types/ground/data/case.d.ts +52 -0
- package/dist/types/ground/data/load.d.ts +30 -0
- package/dist/types/ground/data/presets.d.ts +32 -0
- package/dist/types/ground/data/schema.d.ts +303 -0
- package/dist/types/ground/engine/closure.d.ts +34 -0
- package/dist/types/ground/engine/discern.d.ts +84 -0
- package/dist/types/ground/engine/errors.d.ts +142 -0
- package/dist/types/ground/engine/evaluate.d.ts +25 -0
- package/dist/types/ground/engine/facts.d.ts +61 -0
- package/dist/types/ground/engine/formula.d.ts +100 -0
- package/dist/types/ground/engine/index.d.ts +26 -0
- package/dist/types/ground/engine/premises.d.ts +58 -0
- package/dist/types/ground/engine/print.d.ts +29 -0
- package/dist/types/ground/engine/proposals.d.ts +56 -0
- package/dist/types/ground/engine/resolve.d.ts +46 -0
- package/dist/types/ground/engine/syntax.d.ts +55 -0
- package/dist/types/ground/i18n/en.d.ts +2 -0
- package/dist/types/ground/i18n/messages.d.ts +14 -0
- package/dist/types/ground/i18n/zh.d.ts +95 -0
- package/dist/types/ground/index.d.ts +22 -0
- package/dist/types/logic/structure.d.ts +72 -0
- package/package.json +12 -3
- package/dist/chunks/SignalGraph-yoGcj7jf.js +0 -1405
- package/dist/chunks/SignalGraph-yoGcj7jf.js.map +0 -1
|
@@ -0,0 +1,1412 @@
|
|
|
1
|
+
import { at as e, b as t, gt as n, vt as r, y as i } from "./engine-CO00-1sC.js";
|
|
2
|
+
import { l as a } from "./messages-ZiFmPfDY.js";
|
|
3
|
+
import { $ as o, S as s, W as c, Y as l, _ as u, b as d, c as f, d as p, et as m, f as h, ft as g, g as ee, h as _, i as v, it as y, l as te, m as ne, o as re, ot as ie, p as b, s as ae, u as x, v as S, x as C, y as w } from "./doc-case-YauWsu0F.js";
|
|
4
|
+
import { d as T } from "./parts-8cUsl2jJ.js";
|
|
5
|
+
import { useId as oe, useRef as se, useState as E } from "react";
|
|
6
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
7
|
+
function A(e, n, r, a, o) {
|
|
8
|
+
if (e.prior === void 0) throw Error(`${e.data.id}: dsep needs probabilities`);
|
|
9
|
+
let [s, c] = n, l = [...Object.keys(a), ...Object.keys(o)], u = i(e.model, s, c, Object.keys(r), l), d = t(e.model, e.prior, s, c, r, a, o), f = (e) => `${e.from}>${e.to}`, p = new Set(u.paths.filter((e) => e.open).flatMap((e) => e.edges.map(f)));
|
|
10
|
+
return {
|
|
11
|
+
result: u,
|
|
12
|
+
delta: d,
|
|
13
|
+
marks: {
|
|
14
|
+
open: p,
|
|
15
|
+
blocked: new Set(u.paths.filter((e) => !e.open).flatMap((e) => e.edges.map(f)).filter((e) => !p.has(e))),
|
|
16
|
+
ends: [s, c],
|
|
17
|
+
paths: u.paths
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function j(e) {
|
|
22
|
+
return Number.isNaN(e) ? "—" : e < 1e-12 ? "0.000" : o(e, 4).replace(/(\.\d\d\d*?)0+$/, "$1");
|
|
23
|
+
}
|
|
24
|
+
function ce(e) {
|
|
25
|
+
return e.nodes.reduce((t, n, r) => r === 0 ? n : `${t}${e.edges[r - 1].from === e.nodes[r - 1] ? "→" : "←"}${n}`, "");
|
|
26
|
+
}
|
|
27
|
+
function M(e, t) {
|
|
28
|
+
let n = e.dsep;
|
|
29
|
+
if (!t.open) return t.kind === "collider" ? n.colliderUnknown(t.blockedBy ?? "") : n.middleKnown(t.blockedBy ?? "");
|
|
30
|
+
let r = t.opened ?? [];
|
|
31
|
+
return r.length === 0 ? t.nodes.length === 2 ? n.adjacent : n.middlesUnknown : e.list(r.map((e) => e.by === e.collider ? n.colliderKnown(e.collider) : n.descendantKnown(e.collider, e.by)));
|
|
32
|
+
}
|
|
33
|
+
function le(e) {
|
|
34
|
+
return e.nodes.reduce((t, n, r) => r === 0 ? n : `${t} ${e.edges[r - 1].from === e.nodes[r - 1] ? "→" : "←"} ${n}`, "");
|
|
35
|
+
}
|
|
36
|
+
function ue(e, t) {
|
|
37
|
+
let n = e.edgeTip, r = le(t);
|
|
38
|
+
if (!t.open) {
|
|
39
|
+
let e = t.blockedBy ?? "";
|
|
40
|
+
if (t.kind === "collider") return n.pathBlocked(r, e, n.colliderUnknown(e, t.descendants ?? []));
|
|
41
|
+
let i = t.nodes.indexOf(e), a = i > 0 && t.edges[i - 1].from === e && t.edges[i].from === e;
|
|
42
|
+
return n.pathBlocked(r, e, a ? n.forkKnown(e) : n.chainKnown(e));
|
|
43
|
+
}
|
|
44
|
+
if (t.nodes.length === 2) return n.pathOpen(r, n.adjacent);
|
|
45
|
+
let i = t.opened ?? [], a = new Set(i.map((e) => e.collider)), o = t.nodes.slice(1, -1).filter((e) => !a.has(e)), s = [...i.map((e) => e.by === e.collider ? n.colliderKnown(e.collider) : n.descendantKnown(e.collider, e.by)), ...o.length === 0 ? [] : [n.middlesUnknown(o)]];
|
|
46
|
+
return n.pathOpen(r, e.list(s));
|
|
47
|
+
}
|
|
48
|
+
function de(e, t, n, r) {
|
|
49
|
+
let i = t.paths.filter((e) => e.open === (r === "open") && e.edges.some((e) => `${e.from}>${e.to}` === n)), a = i.slice(0, 2).map((t) => ue(e, t)), o = i.length > 2 ? [...a, e.edgeTip.more(i.length)] : a;
|
|
50
|
+
return r === "open" ? e.edgeTip.open(o) : e.edgeTip.blocked(o);
|
|
51
|
+
}
|
|
52
|
+
// src/components/shared/focus-visible.ts
|
|
53
|
+
function N(e) {
|
|
54
|
+
try {
|
|
55
|
+
return e.matches(":focus-visible");
|
|
56
|
+
} catch {
|
|
57
|
+
return !0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// src/components/graph/signal-shapes.ts
|
|
61
|
+
var fe = .25;
|
|
62
|
+
function pe(e = 2) {
|
|
63
|
+
return C(`0.${"0".repeat(e)}`, 16) + 4;
|
|
64
|
+
}
|
|
65
|
+
function me(e, t, r, i, a) {
|
|
66
|
+
return i === void 0 ? a === void 0 ? {
|
|
67
|
+
prefix: `${e.nodeReadout.unknown} `,
|
|
68
|
+
text: y(r ?? NaN, t),
|
|
69
|
+
settled: !1
|
|
70
|
+
} : {
|
|
71
|
+
prefix: "",
|
|
72
|
+
text: e.nodeReadout.observed(n(a)),
|
|
73
|
+
settled: !0
|
|
74
|
+
} : {
|
|
75
|
+
prefix: "",
|
|
76
|
+
text: e.nodeReadout.intervened(n(i)),
|
|
77
|
+
settled: !0
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function he(e, t) {
|
|
81
|
+
return (e.prefix === "" ? 0 : C(e.prefix, 11)) + (e.settled ? C(e.text, 14) + 4 : pe(t));
|
|
82
|
+
}
|
|
83
|
+
function P(e, t, n, r, i = 0, a = !1) {
|
|
84
|
+
let o = e + 12, s = a ? n.lines : void 0, c = s === void 0 ? o : o + 17, l = w(i, o, "middle", s === void 0 ? n.width : Math.max(...s), 14), u = [{
|
|
85
|
+
...l,
|
|
86
|
+
y1: l.y1 + c - o
|
|
87
|
+
}], d = c, f = c, p = i, m = c, h = c, g = c;
|
|
88
|
+
if (r.kind === "none" && (r.noteW !== void 0 || r.note2W !== void 0)) f = g + 17, h = r.noteW === void 0 ? f : f + 18, r.noteW !== void 0 && u.push(w(i, f, "middle", r.noteW, 12)), r.note2W !== void 0 && u.push(w(i, h, "middle", r.note2W + 8, 14));
|
|
89
|
+
else if (r.kind === "number") d = g + 22, f = d + 19, u.push(w(i, d, "middle", r.numberW ?? pe(), 16)), r.noteW !== void 0 && u.push(w(i, f, "middle", r.noteW, 12));
|
|
90
|
+
else if (r.kind === "bars") {
|
|
91
|
+
let e = g + 10;
|
|
92
|
+
p = i - r.width / 2, m = e + 24, f = m + 11 + 16, u.push(ee(p, e, r.width, 41)), u.push(w(p - 5, e + 8, "end", r.maxW, 11)), r.noteW !== void 0 && u.push(w(i, f, "middle", r.noteW, 12));
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
side: t,
|
|
96
|
+
cx: i,
|
|
97
|
+
wrapped: s !== void 0,
|
|
98
|
+
labelY: o,
|
|
99
|
+
label2Y: c,
|
|
100
|
+
numberY: d,
|
|
101
|
+
noteY: f,
|
|
102
|
+
note2Y: h,
|
|
103
|
+
x0: p,
|
|
104
|
+
baseline: m,
|
|
105
|
+
boxes: u
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function ge(e, t, n) {
|
|
109
|
+
let r = typeof t == "number" ? { width: t } : t, i = (t) => {
|
|
110
|
+
let i = P(0, "below", r, n, 0, t), a = Math.max(...i.boxes.map((e) => e.y1)), o = Math.min(...i.boxes.map((e) => e.x0)), s = Math.max(...i.boxes.map((e) => e.x1)), c = e + 12, l = -e - 10 - a, u = -Math.max(8, a / 2), d = e + 10 - o, f = -e - 10 - s, p = e + 4;
|
|
111
|
+
return {
|
|
112
|
+
sides: [
|
|
113
|
+
P(c, "below", r, n, 0, t),
|
|
114
|
+
P(l, "above", r, n, 0, t),
|
|
115
|
+
P(u, "right", r, n, d, t),
|
|
116
|
+
P(u, "left", r, n, f, t)
|
|
117
|
+
],
|
|
118
|
+
corners: [
|
|
119
|
+
P(p, "below-right", r, n, p - o, t),
|
|
120
|
+
P(p, "below-left", r, n, -p - s, t),
|
|
121
|
+
P(-p - a, "above-right", r, n, p - o, t),
|
|
122
|
+
P(-p - a, "above-left", r, n, -p - s, t)
|
|
123
|
+
]
|
|
124
|
+
};
|
|
125
|
+
}, a = i(!1), o = [...a.sides, ...a.corners];
|
|
126
|
+
if (r.lines === void 0) return o;
|
|
127
|
+
let s = i(!0), c = [...s.sides, ...s.corners];
|
|
128
|
+
return o.flatMap((e, t) => [e, c[t]]);
|
|
129
|
+
}
|
|
130
|
+
function _e(e, t, n) {
|
|
131
|
+
let r = Math.min(...e.boxes.map((e) => e.y0)), i = Math.max(...e.boxes.map((e) => e.y1)), a = e.boxes[0], o = (e, t, r) => ({
|
|
132
|
+
x: e,
|
|
133
|
+
y: t,
|
|
134
|
+
anchor: r,
|
|
135
|
+
box: w(e, t, r, n, 12)
|
|
136
|
+
}), s = e.side === "below" || e.side.startsWith("below-") || e.side === "right" || e.side === "left", c = s ? o(e.cx, i + 13, "middle") : o(e.cx, r - 5, "middle"), l = s ? o(0, -t - 8, "middle") : o(0, t + 17, "middle");
|
|
137
|
+
return [
|
|
138
|
+
c,
|
|
139
|
+
o(a.x1 + 6, e.labelY, "start"),
|
|
140
|
+
o(a.x0 - 6, e.labelY, "end"),
|
|
141
|
+
o(t + 8, 4, "start"),
|
|
142
|
+
o(-t - 8, 4, "end"),
|
|
143
|
+
l
|
|
144
|
+
];
|
|
145
|
+
}
|
|
146
|
+
function F(e) {
|
|
147
|
+
return Math.round(e / fe) * fe;
|
|
148
|
+
}
|
|
149
|
+
function ve(e, t) {
|
|
150
|
+
let n = t.x - e.x, r = t.y - e.y, i = Math.hypot(n, r) || 1;
|
|
151
|
+
return {
|
|
152
|
+
ux: n / i,
|
|
153
|
+
uy: r / i,
|
|
154
|
+
d: i
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function ye(e) {
|
|
158
|
+
let t = 2 * Math.PI * e, n = t / Math.max(6, Math.round(t / 11));
|
|
159
|
+
return `${(n * .6).toFixed(2)} ${(n * .4).toFixed(2)}`;
|
|
160
|
+
}
|
|
161
|
+
var be = 4.5;
|
|
162
|
+
function I(e, t, n) {
|
|
163
|
+
let r = Math.hypot(t, n) || 1, i = t / r, a = n / r, o = e.x - 9 * i, s = e.y - 9 * a;
|
|
164
|
+
return `M${e.x} ${e.y}L${o - 3.6 * a} ${s + 3.6 * i}L${o + 3.6 * a} ${s - 3.6 * i}z`;
|
|
165
|
+
}
|
|
166
|
+
function L(e) {
|
|
167
|
+
let t = e + 8;
|
|
168
|
+
return `M${-t} ${-t + 14}v-14h14M${t - 14} ${-t}h14v14M${t} ${t - 14}v14h-14M${-t + 14} ${t}h-14v-14`;
|
|
169
|
+
}
|
|
170
|
+
// src/components/graph/BarChart.tsx
|
|
171
|
+
function xe({ id: e, labels: t, dist: n, block: r, barText: i }) {
|
|
172
|
+
let o = a(), s = g(), c = d(t, 11), l = (n ?? []).filter((e) => !Number.isNaN(e)), u = l.length === 0 ? NaN : Math.max(...l);
|
|
173
|
+
return /* @__PURE__ */ k("g", {
|
|
174
|
+
className: "ca-bars",
|
|
175
|
+
"data-bars": e,
|
|
176
|
+
transform: `translate(${r.x0} ${r.baseline})`,
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ O("line", {
|
|
179
|
+
x1: 0,
|
|
180
|
+
x2: c.width,
|
|
181
|
+
y1: 0,
|
|
182
|
+
y2: 0,
|
|
183
|
+
className: "ca-hair"
|
|
184
|
+
}),
|
|
185
|
+
!Number.isNaN(u) && /* @__PURE__ */ O("text", {
|
|
186
|
+
x: -5,
|
|
187
|
+
y: -16,
|
|
188
|
+
textAnchor: "end",
|
|
189
|
+
className: "ca-mono ca-svg-tiny ca-fill-muted",
|
|
190
|
+
"data-max": u.toFixed(4),
|
|
191
|
+
children: o.barMax(y(u, s))
|
|
192
|
+
}),
|
|
193
|
+
t.map((e, r) => {
|
|
194
|
+
let a = n?.[r], o = a !== void 0 && !Number.isNaN(a), s = o && u > 0 && a > 0 ? Math.max(1, a / u * 24) : 0, l = r * c.pitch + c.pitch / 2, d = r === 0 || r === t.length - 1;
|
|
195
|
+
return /* @__PURE__ */ k("g", {
|
|
196
|
+
"data-bar": e,
|
|
197
|
+
"data-p": o ? a.toFixed(4) : "",
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ O("title", { children: i(r) }),
|
|
200
|
+
/* @__PURE__ */ O("rect", {
|
|
201
|
+
x: l - c.barW / 2,
|
|
202
|
+
y: -s,
|
|
203
|
+
width: c.barW,
|
|
204
|
+
height: s,
|
|
205
|
+
className: "ca-fill-fg"
|
|
206
|
+
}),
|
|
207
|
+
(c.labelsFit || d) && /* @__PURE__ */ O("text", {
|
|
208
|
+
x: l,
|
|
209
|
+
y: 13,
|
|
210
|
+
textAnchor: "middle",
|
|
211
|
+
className: "ca-mono ca-svg-tiny ca-fill-muted",
|
|
212
|
+
children: e
|
|
213
|
+
})
|
|
214
|
+
]
|
|
215
|
+
}, e);
|
|
216
|
+
})
|
|
217
|
+
]
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
// src/components/graph/signal-geometry.ts
|
|
221
|
+
function Se(e, t) {
|
|
222
|
+
if ([...t].some((e) => (e.codePointAt(0) ?? 0) > 11903)) return;
|
|
223
|
+
let n = t.split(" ").filter((e) => e !== ""), r, i = Infinity;
|
|
224
|
+
for (let t = 1; t < n.length; t++) {
|
|
225
|
+
if (/^[A-Za-z]{1,3}\.$/.test(n[t - 1])) continue;
|
|
226
|
+
let a = n.slice(0, t).join(" "), o = n.slice(t).join(" "), s = Math.max(C(m(e, a), 14), C(o, 14));
|
|
227
|
+
s < i && (r = [a, o], i = s);
|
|
228
|
+
}
|
|
229
|
+
return r;
|
|
230
|
+
}
|
|
231
|
+
var R = [
|
|
232
|
+
[-.55, -.55],
|
|
233
|
+
[-.55, .55],
|
|
234
|
+
[0, -.7],
|
|
235
|
+
[-.7, 0],
|
|
236
|
+
[.55, -.55],
|
|
237
|
+
[.55, .55],
|
|
238
|
+
[0, .7],
|
|
239
|
+
[.7, 0]
|
|
240
|
+
];
|
|
241
|
+
function z(e, t, n, r, i, a, o) {
|
|
242
|
+
let s = n.filter((e) => t.includes(e));
|
|
243
|
+
if (s.length === 0) return r;
|
|
244
|
+
let c = (e) => ({
|
|
245
|
+
x: e.col * i,
|
|
246
|
+
y: e.row * a
|
|
247
|
+
}), l = h(e.model.edges, t).filter((e) => !n.includes(e.from)), d = (e, t, n) => Math.hypot(e.x - t.x, e.y - t.y) < n, f = (e, t) => ({
|
|
248
|
+
x0: e.x - t,
|
|
249
|
+
y0: e.y - t,
|
|
250
|
+
x1: e.x + t,
|
|
251
|
+
y1: e.y + t
|
|
252
|
+
});
|
|
253
|
+
for (let t of s) {
|
|
254
|
+
let n = e.model.edges.find((e) => e.from === t)?.to, i = n === void 0 ? void 0 : r.get(n);
|
|
255
|
+
if (n === void 0 || i === void 0) throw Error(`logic-atlas: ${e.data.id}: switch ${t} points into no drawn variable`);
|
|
256
|
+
let a = c(i), s = (e) => {
|
|
257
|
+
let t = c(e);
|
|
258
|
+
for (let [e, i] of r) {
|
|
259
|
+
if (e === n) continue;
|
|
260
|
+
let r = c(i);
|
|
261
|
+
if (d(t, r, 2 * o + 8) || u(t, a, f(r, o + 4))) return !1;
|
|
262
|
+
}
|
|
263
|
+
return l.every((e) => {
|
|
264
|
+
let n = r.get(e.from), i = r.get(e.to);
|
|
265
|
+
return n === void 0 || i === void 0 || !u(c(n), c(i), f(t, 19));
|
|
266
|
+
});
|
|
267
|
+
}, p = R.map(([e, t]) => ({
|
|
268
|
+
col: i.col + e,
|
|
269
|
+
row: i.row + t
|
|
270
|
+
}));
|
|
271
|
+
r.set(t, p.find(s) ?? p[0]);
|
|
272
|
+
}
|
|
273
|
+
return r;
|
|
274
|
+
}
|
|
275
|
+
function Ce(t, i) {
|
|
276
|
+
let { c: a, shown: o, values: s, original: c, probs: g, probe: T = {}, dists: oe, probNotes: se, interventions: E, tagText: D, stochastic: O, removedEdges: k, witness: A, observedValues: j, evidence: ce, holdNotes: M, defaults: le, paths: ue, clamped: de, switches: N = [], compact: fe, drag: pe, digits: P = 2 } = t, F = g !== void 0, { r: ye, col: be, row: I } = f(F, fe), L = t.structural === !0 ? 19 : ye, xe = fe ? 60 : 96, R = z(a, o, N, te(a, o.filter((e) => !N.includes(e))), be, I, L), Ce = [...R.values()], B = Math.min(...Ce.map((e) => e.col)), we = Math.max(...Ce.map((e) => e.col)), V = Math.min(...Ce.map((e) => e.row)), Te = Math.max(...Ce.map((e) => e.row)), Ee = xe * 2 + (we - B) * be, De = A !== void 0 && Object.keys(A).length > 0, Oe = (t) => F && e(a.model, t).domain.kind === "finite", ke = 144 + (Te - V) * I + (De ? 40 : 0), H = /* @__PURE__ */ new Map();
|
|
277
|
+
for (let [e, t] of R) {
|
|
278
|
+
let n = pe?.id === e ? pe : void 0;
|
|
279
|
+
H.set(e, {
|
|
280
|
+
x: xe + (t.col - B) * be + (n?.dx ?? 0),
|
|
281
|
+
y: 72 + (t.row - V) * I + (n?.dy ?? 0)
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
let Ae = new Set(k.map((e) => `${e.from}>${e.to}`)), U = h(a.model.edges, o), W = (e) => ie(a.model, e, i.locale), G = (e) => {
|
|
285
|
+
let t = H.get(e.from), n = H.get(e.to);
|
|
286
|
+
if (t === void 0 || n === void 0) return;
|
|
287
|
+
let { ux: r, uy: i } = ve(t, n), o = N.includes(e.from) ? 9 / Math.max(Math.abs(r), Math.abs(i)) : L, s = `${e.from}>${e.to}`, c = Ae.has(s) ? "cut" : ae(a.model, e.from, e.to) === "inhibit" ? "inhibit" : "plain", l = c === "inhibit" ? L + 7 : L + 2;
|
|
288
|
+
return {
|
|
289
|
+
kind: c,
|
|
290
|
+
key: s,
|
|
291
|
+
a: t,
|
|
292
|
+
b: n,
|
|
293
|
+
ux: r,
|
|
294
|
+
uy: i,
|
|
295
|
+
x1: t.x + o * r,
|
|
296
|
+
y1: t.y + o * i,
|
|
297
|
+
x2: n.x - l * r,
|
|
298
|
+
y2: n.y - l * i
|
|
299
|
+
};
|
|
300
|
+
}, K = (e) => {
|
|
301
|
+
let t = E[e], a = O[e], o = j[e];
|
|
302
|
+
if (t === void 0 && a === void 0 && (o === void 0 || ce) || A !== void 0 && e in A) return;
|
|
303
|
+
let s = c?.[e], l = M && t !== void 0 && s !== void 0 && r(t, s), u = t === void 0 ? a === void 0 ? `${e}=${n(o)}` : `P(${e}=1)=${y(a, P)}` : D?.[e] ?? (l ? i.witness.resetTag(e, n(t)) : `${e}←${n(t)}`), d = C(u, 12) + 18, f = (R.get(e)?.col ?? 0) === we;
|
|
304
|
+
return {
|
|
305
|
+
text: u,
|
|
306
|
+
left: f,
|
|
307
|
+
reset: l,
|
|
308
|
+
seen: t === void 0 && a === void 0,
|
|
309
|
+
box: ee(f ? -L - 12 - d : L + 12, -L - 10, d, 22)
|
|
310
|
+
};
|
|
311
|
+
}, je = (e) => {
|
|
312
|
+
if (!M || A === void 0 || !(e in A)) return;
|
|
313
|
+
if (F) return i.witness.heldPlain;
|
|
314
|
+
let t = c?.[e], a = s?.[e] ?? A[e];
|
|
315
|
+
return t === void 0 || r(t, a) ? i.witness.heldActual : i.witness.held(n(a), n(t));
|
|
316
|
+
}, Me = (e) => {
|
|
317
|
+
let t = le?.[e], a = s?.[e];
|
|
318
|
+
if (!(F || t === void 0 || a === void 0 || r(a, t))) return i.normality.deviant(n(t));
|
|
319
|
+
}, Ne = [], q = /* @__PURE__ */ new Map(), Pe = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), Fe = /* @__PURE__ */ new Map(), Ie = [], Le = [];
|
|
320
|
+
for (let e of o) {
|
|
321
|
+
let t = H.get(e);
|
|
322
|
+
if (t === void 0) continue;
|
|
323
|
+
Ie.push(b(t.x, t.y, (N.includes(e) ? 9 : L) + 3));
|
|
324
|
+
let n = K(e);
|
|
325
|
+
n !== void 0 && (Ie.push(S(n.box, t.x, t.y)), Le.push(S(n.box, t.x, t.y)));
|
|
326
|
+
}
|
|
327
|
+
let Y = (e, t) => Ae.has(`${e}>${t}`) || t in E || t in O || de.includes(t), Re = p(x(a, o).filter((e) => !Y(e.via, e.a) && !Y(e.via, e.b)), H, U, L, Le), ze = Re.map((e) => v(e.start, e.control, e.end, 12)), Be = [], X = [], Ve = (e, t, n, r) => {
|
|
328
|
+
let i = {
|
|
329
|
+
x: e.x + r * t,
|
|
330
|
+
y: e.y + r * n
|
|
331
|
+
}, a = {
|
|
332
|
+
x: e.x - 10 * t,
|
|
333
|
+
y: e.y - 10 * n
|
|
334
|
+
};
|
|
335
|
+
X.push({
|
|
336
|
+
x0: Math.min(i.x, a.x) - 5,
|
|
337
|
+
y0: Math.min(i.y, a.y) - 5,
|
|
338
|
+
x1: Math.max(i.x, a.x) + 5,
|
|
339
|
+
y1: Math.max(i.y, a.y) + 5
|
|
340
|
+
});
|
|
341
|
+
};
|
|
342
|
+
for (let e of U) {
|
|
343
|
+
let t = G(e);
|
|
344
|
+
if (t === void 0) continue;
|
|
345
|
+
let { x1: n, y1: r, x2: i, y2: a, ux: o, uy: s } = t;
|
|
346
|
+
if (t.kind === "cut") {
|
|
347
|
+
let e = (n + i) / 2, t = (r + a) / 2;
|
|
348
|
+
Be.push([{
|
|
349
|
+
x: n,
|
|
350
|
+
y: r
|
|
351
|
+
}, {
|
|
352
|
+
x: e - 10 * o,
|
|
353
|
+
y: t - 10 * s
|
|
354
|
+
}], [{
|
|
355
|
+
x: e + 10 * o,
|
|
356
|
+
y: t + 10 * s
|
|
357
|
+
}, {
|
|
358
|
+
x: i,
|
|
359
|
+
y: a
|
|
360
|
+
}]);
|
|
361
|
+
} else Be.push([{
|
|
362
|
+
x: n,
|
|
363
|
+
y: r
|
|
364
|
+
}, {
|
|
365
|
+
x: i,
|
|
366
|
+
y: a
|
|
367
|
+
}]), Ve({
|
|
368
|
+
x: i,
|
|
369
|
+
y: a
|
|
370
|
+
}, o, s, t.kind === "inhibit" ? 10 : 0);
|
|
371
|
+
}
|
|
372
|
+
for (let e of Re) {
|
|
373
|
+
let t = v(e.start, e.control, e.end, 40);
|
|
374
|
+
for (let e = 0; e + 1 < t.length; e++) Be.push([t[e], t[e + 1]]);
|
|
375
|
+
for (let [t, n] of [[e.start, e.control], [e.end, e.control]]) {
|
|
376
|
+
let { ux: e, uy: r } = ve(n, t);
|
|
377
|
+
Ve(t, e, r, 0);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
let He = (e) => {
|
|
381
|
+
let t = {
|
|
382
|
+
x0: e.x0 - 1,
|
|
383
|
+
y0: e.y0 - 1,
|
|
384
|
+
x1: e.x1 + 1,
|
|
385
|
+
y1: e.y1 + 1
|
|
386
|
+
};
|
|
387
|
+
return Be.filter(([e, n]) => u(e, n, t)).length + X.filter((e) => _(t, e, 0)).length;
|
|
388
|
+
}, Ue = (e) => N.includes(e) ? 9 : L, We = (e, t) => {
|
|
389
|
+
let n = {
|
|
390
|
+
x0: Math.min(...t.map((e) => e.x0)),
|
|
391
|
+
y0: Math.min(...t.map((e) => e.y0)),
|
|
392
|
+
x1: Math.max(...t.map((e) => e.x1)),
|
|
393
|
+
y1: Math.max(...t.map((e) => e.y1))
|
|
394
|
+
}, r = (e, t) => Math.hypot(Math.max(n.x0 - e.x, 0, e.x - n.x1), Math.max(n.y0 - e.y, 0, e.y - n.y1)) - t, i = r(H.get(e) ?? {
|
|
395
|
+
x: 0,
|
|
396
|
+
y: 0
|
|
397
|
+
}, Ue(e));
|
|
398
|
+
return o.some((t) => {
|
|
399
|
+
let n = H.get(t);
|
|
400
|
+
return t !== e && n !== void 0 && r(n, Ue(t)) < i + 12;
|
|
401
|
+
});
|
|
402
|
+
}, Ge = (e, t, n) => {
|
|
403
|
+
let r = H.get(e) ?? {
|
|
404
|
+
x: 0,
|
|
405
|
+
y: 0
|
|
406
|
+
}, i = 0, a = 0, o = 0;
|
|
407
|
+
t.boxes.forEach((e, t) => {
|
|
408
|
+
let s = S(e, r.x, r.y), c = He(s);
|
|
409
|
+
t === 0 ? a += c : o += c;
|
|
410
|
+
for (let e of Ie) _(s, e, 0) && (i += 1);
|
|
411
|
+
for (let e of n) _(s, e, 10) && (i += 1);
|
|
412
|
+
});
|
|
413
|
+
let s = t.boxes.map((e) => S(e, r.x, r.y));
|
|
414
|
+
We(e, s) && (i += 1);
|
|
415
|
+
let c = Math.max(0, -Math.min(...s.map((e) => e.x0))) + Math.max(0, Math.max(...s.map((e) => e.x1)) - Ee) + Math.max(0, -Math.min(...s.map((e) => e.y0))) + Math.max(0, Math.max(...s.map((e) => e.y1)) - ke);
|
|
416
|
+
return [
|
|
417
|
+
i,
|
|
418
|
+
a,
|
|
419
|
+
o,
|
|
420
|
+
Math.floor(c / 48) + +!!t.side.includes("-")
|
|
421
|
+
];
|
|
422
|
+
}, Ke = (e) => e[0] === 0 && e[1] === 0 && e[2] === 0, qe = /* @__PURE__ */ new Map(), Je = /* @__PURE__ */ new Map();
|
|
423
|
+
for (let l of o) {
|
|
424
|
+
let o = H.get(l);
|
|
425
|
+
if (o === void 0) continue;
|
|
426
|
+
let u = e(a.model, l), f = F ? me(i, P, g?.[l], E[l], ce ? void 0 : j[l]) : void 0, p = c?.[l], h = s?.[l], ee = M && !F && p !== void 0 && h !== void 0 && !r(p, h) ? i.was(n(p)) : void 0, _ = je(l) ?? ee ?? (f?.settled === !0 && !ce ? void 0 : se?.[l]), v = _ === void 0 ? void 0 : C(_, 12), te = Me(l), ne = {
|
|
427
|
+
kind: "none",
|
|
428
|
+
noteW: v,
|
|
429
|
+
note2W: te === void 0 ? void 0 : C(te, 11)
|
|
430
|
+
};
|
|
431
|
+
if (Oe(l) && u.domain.kind === "finite") {
|
|
432
|
+
let e = (oe?.[l] ?? []).filter((e) => !Number.isNaN(e)), t = e.length === 0 ? 0 : C(i.barMax(y(Math.max(...e), P)), 11);
|
|
433
|
+
ne = {
|
|
434
|
+
kind: "bars",
|
|
435
|
+
width: d(u.domain.values.map(n), 11).width,
|
|
436
|
+
maxW: t,
|
|
437
|
+
noteW: v
|
|
438
|
+
};
|
|
439
|
+
} else F ? ne = {
|
|
440
|
+
kind: "number",
|
|
441
|
+
noteW: v,
|
|
442
|
+
numberW: he(f ?? me(i, P, void 0, void 0, void 0), P)
|
|
443
|
+
} : l in T && (ne = {
|
|
444
|
+
kind: "number",
|
|
445
|
+
noteW: v,
|
|
446
|
+
numberW: he(me(i, P, T[l], void 0, void 0), P)
|
|
447
|
+
});
|
|
448
|
+
let re = N.includes(l), ie = C(re ? l : m(l, W(l)), 14), b = re ? void 0 : Se(l, W(l)), ae = b === void 0 ? void 0 : [C(m(l, b[0]), 14), C(b[1], 14)], x = ge(re ? 9 : L + (t.hedge?.fPrime.includes(l) === !0 ? 16 : t.hedge?.f.includes(l) === !0 ? 9 : 0), {
|
|
449
|
+
width: ie,
|
|
450
|
+
lines: ae
|
|
451
|
+
}, ne);
|
|
452
|
+
Pe.set(l, x);
|
|
453
|
+
let w = x.map((e) => Ge(l, e, Ne)), D = 0;
|
|
454
|
+
if (!Ke(w[0])) for (let e = 1; e < x.length; e++) (w[e].map((e, t) => e - w[D][t]).find((e) => e !== 0) ?? 0) < 0 && (D = e);
|
|
455
|
+
let O = x[D];
|
|
456
|
+
q.set(l, O), b !== void 0 && qe.set(l, b), ee !== void 0 && v !== void 0 && je(l) === void 0 && Je.set(l, {
|
|
457
|
+
text: ee,
|
|
458
|
+
w: v
|
|
459
|
+
});
|
|
460
|
+
for (let e of O.boxes) Ne.push(S(e, o.x, o.y));
|
|
461
|
+
}
|
|
462
|
+
let Ye = /* @__PURE__ */ new Map();
|
|
463
|
+
for (let e of o) {
|
|
464
|
+
let t = H.get(e);
|
|
465
|
+
t === void 0 || N.includes(e) || Ye.set(Math.round(t.x), [...Ye.get(Math.round(t.x)) ?? [], e]);
|
|
466
|
+
}
|
|
467
|
+
for (let e of Ye.values()) {
|
|
468
|
+
if (e.length < 3 || new Set(e.map((e) => q.get(e)?.side)).size === 1) continue;
|
|
469
|
+
let t = o.filter((t) => !e.includes(t)).flatMap((e) => {
|
|
470
|
+
let t = H.get(e);
|
|
471
|
+
return t === void 0 ? [] : (q.get(e)?.boxes ?? []).map((e) => S(e, t.x, t.y));
|
|
472
|
+
}), n;
|
|
473
|
+
for (let [r, i] of [
|
|
474
|
+
"below",
|
|
475
|
+
"above",
|
|
476
|
+
"right",
|
|
477
|
+
"left"
|
|
478
|
+
].flatMap((e) => [[e, !1], [e, !0]])) {
|
|
479
|
+
let a = [...t], o = /* @__PURE__ */ new Map(), s = 0;
|
|
480
|
+
for (let t of e) {
|
|
481
|
+
let e = H.get(t) ?? {
|
|
482
|
+
x: 0,
|
|
483
|
+
y: 0
|
|
484
|
+
}, n = (Pe.get(t) ?? []).filter((e) => e.side === r), c = n.find((e) => e.wrapped === i) ?? n[0];
|
|
485
|
+
if (c === void 0 || !Ke(Ge(t, c, a))) break;
|
|
486
|
+
o.set(t, c), s += Ge(t, c, a)[3], a.push(...c.boxes.map((t) => S(t, e.x, e.y)));
|
|
487
|
+
}
|
|
488
|
+
o.size === e.length && (n === void 0 || s < n.past) && (n = {
|
|
489
|
+
chosen: o,
|
|
490
|
+
past: s
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
for (let [e, t] of n?.chosen ?? []) q.set(e, t);
|
|
494
|
+
}
|
|
495
|
+
Ne.length = 0;
|
|
496
|
+
for (let e of o) {
|
|
497
|
+
let t = H.get(e), n = q.get(e);
|
|
498
|
+
if (t === void 0 || n === void 0) continue;
|
|
499
|
+
for (let e of n.boxes) Ne.push(S(e, t.x, t.y));
|
|
500
|
+
let r = qe.get(e);
|
|
501
|
+
n.wrapped && r !== void 0 && J.set(e, r);
|
|
502
|
+
let i = Je.get(e);
|
|
503
|
+
i !== void 0 && Fe.set(e, {
|
|
504
|
+
text: i.text,
|
|
505
|
+
x: n.cx,
|
|
506
|
+
y: n.noteY,
|
|
507
|
+
anchor: "middle",
|
|
508
|
+
box: w(n.cx, n.noteY, "middle", i.w, 12)
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
if (!M && !F) {
|
|
512
|
+
let e = o.flatMap((e) => {
|
|
513
|
+
let t = H.get(e), n = K(e);
|
|
514
|
+
return t === void 0 || n === void 0 ? [] : [S(n.box, t.x, t.y)];
|
|
515
|
+
}), t = [...Ne, ...e], a = o.flatMap((e) => {
|
|
516
|
+
let t = H.get(e);
|
|
517
|
+
return t === void 0 ? [] : [b(t.x, t.y, (N.includes(e) ? 9 : L) + 3)];
|
|
518
|
+
}), l = (e) => U.some((t) => {
|
|
519
|
+
let n = H.get(t.from), r = H.get(t.to);
|
|
520
|
+
return n !== void 0 && r !== void 0 && u(n, r, e);
|
|
521
|
+
}) || ze.some((t) => t.some((n, r) => r + 1 < t.length && u(n, t[r + 1], e)));
|
|
522
|
+
for (let e of o) {
|
|
523
|
+
let o = H.get(e), u = q.get(e), d = c?.[e], f = s?.[e];
|
|
524
|
+
if (o === void 0 || u === void 0 || d === void 0 || f === void 0 || r(d, f)) continue;
|
|
525
|
+
let p = i.was(n(d)), m = _e(u, L, C(p, 12)).map((e) => ({
|
|
526
|
+
...e,
|
|
527
|
+
abs: S(e.box, o.x, o.y)
|
|
528
|
+
})), h = m.filter(({ abs: e }) => !t.some((t) => _(e, t)) && !a.some((t) => _(e, t, 0))), g = h.find(({ abs: e }) => !l(e)) ?? h[0] ?? m[0];
|
|
529
|
+
Fe.set(e, {
|
|
530
|
+
text: p,
|
|
531
|
+
x: g.x,
|
|
532
|
+
y: g.y,
|
|
533
|
+
anchor: g.anchor,
|
|
534
|
+
box: g.box
|
|
535
|
+
}), t.push(g.abs), Ne.push(g.abs);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
let Xe = (e) => o.some((t) => {
|
|
539
|
+
let n = H.get(t);
|
|
540
|
+
if (!n) return !1;
|
|
541
|
+
if (N.includes(t)) return _(e, b(n.x, n.y, 9), 0);
|
|
542
|
+
let r = Math.max(e.x0 - n.x, 0, n.x - e.x1), i = Math.max(e.y0 - n.y, 0, n.y - e.y1);
|
|
543
|
+
return r * r + i * i <= L * L;
|
|
544
|
+
}), Ze = [...Ne];
|
|
545
|
+
for (let e of o) {
|
|
546
|
+
let t = H.get(e);
|
|
547
|
+
if (t === void 0) continue;
|
|
548
|
+
let n = [b(0, 0, (N.includes(e) ? 9 : L) + 6)], r = K(e);
|
|
549
|
+
r !== void 0 && n.push(r.box);
|
|
550
|
+
for (let e of n) Ze.push(S(e, t.x, t.y));
|
|
551
|
+
}
|
|
552
|
+
let Qe = C(i.arc.label, 12), $e = Re.map((e) => {
|
|
553
|
+
let t = v(e.start, e.control, e.end, 40), n = [];
|
|
554
|
+
for (let r of [1, -1]) for (let i of [
|
|
555
|
+
20,
|
|
556
|
+
16,
|
|
557
|
+
24,
|
|
558
|
+
12,
|
|
559
|
+
28
|
|
560
|
+
]) {
|
|
561
|
+
let a = t[i], o = e.bulge.x * r, s = e.bulge.y * r, c = 8 + Qe / 2 * Math.abs(o) + Math.abs(s) * 7, l = a.x + o * c, u = a.y + s * c + 4;
|
|
562
|
+
n.push({
|
|
563
|
+
x: l,
|
|
564
|
+
y: u,
|
|
565
|
+
anchor: "middle",
|
|
566
|
+
box: w(l, u, "middle", Qe, 12)
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
let r = n.filter((e) => U.every((t) => {
|
|
570
|
+
let n = H.get(t.from), r = H.get(t.to);
|
|
571
|
+
return n === void 0 || r === void 0 || !u(n, r, e.box);
|
|
572
|
+
})), i = ne(r.length > 0 ? r : n, Ze);
|
|
573
|
+
return Ze.push(i.box), {
|
|
574
|
+
plan: e,
|
|
575
|
+
curve: t,
|
|
576
|
+
label: i
|
|
577
|
+
};
|
|
578
|
+
});
|
|
579
|
+
for (let { curve: e } of $e) for (let t = 0; t + 1 < e.length; t += 2) {
|
|
580
|
+
let [n, r] = [e[t], e[Math.min(t + 2, e.length - 1)]];
|
|
581
|
+
Ze.push({
|
|
582
|
+
x0: Math.min(n.x, r.x) - 2,
|
|
583
|
+
y0: Math.min(n.y, r.y) - 2,
|
|
584
|
+
x1: Math.max(n.x, r.x) + 2,
|
|
585
|
+
y1: Math.max(n.y, r.y) + 2
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
let Z = 0, Q = ke, $ = 0, et = Ee;
|
|
589
|
+
for (let e of o) {
|
|
590
|
+
let t = H.get(e), n = q.get(e);
|
|
591
|
+
if (t !== void 0 && n !== void 0) for (let e of n.boxes) Z = Math.min(Z, t.y + e.y0 - 8), Q = Math.max(Q, t.y + e.y1 + 12), $ = Math.min($, t.x + e.x0 - 8), et = Math.max(et, t.x + e.x1 + 8);
|
|
592
|
+
}
|
|
593
|
+
for (let [e, t] of Fe) {
|
|
594
|
+
let n = H.get(e);
|
|
595
|
+
n !== void 0 && (Z = Math.min(Z, n.y + t.box.y0 - 8), Q = Math.max(Q, n.y + t.box.y1 + 12), $ = Math.min($, n.x + t.box.x0 - 8), et = Math.max(et, n.x + t.box.x1 + 8));
|
|
596
|
+
}
|
|
597
|
+
for (let { curve: e, label: t } of $e) {
|
|
598
|
+
for (let t of e) Z = Math.min(Z, t.y - 8), Q = Math.max(Q, t.y + 12), $ = Math.min($, t.x - 8), et = Math.max(et, t.x + 8);
|
|
599
|
+
Z = Math.min(Z, t.box.y0 - 6), Q = Math.max(Q, t.box.y1 + 8), $ = Math.min($, t.box.x0 - 8), et = Math.max(et, t.box.x1 + 8);
|
|
600
|
+
}
|
|
601
|
+
Z = Math.floor(Z), $ = Math.floor($);
|
|
602
|
+
let tt = (e) => (Ze.push(e.box), e), nt = [];
|
|
603
|
+
for (let e of U) {
|
|
604
|
+
let t = G(e);
|
|
605
|
+
if (t === void 0) continue;
|
|
606
|
+
let { a: n, b: r, ux: a, uy: o, x1: c, y1: l, x2: d, y2: f, key: p } = t;
|
|
607
|
+
if (t.kind === "cut") {
|
|
608
|
+
let e = (c + d) / 2, t = (l + f) / 2, n = -o, r = a, s = (e, t) => `M${e - 10 * n - 3 * a} ${t - 10 * r - 3 * o}L${e + 10 * n + 3 * a} ${t + 10 * r + 3 * o}`, m = [];
|
|
609
|
+
for (let n of [18, 28]) for (let r of [1, -1]) {
|
|
610
|
+
let s = e + r * n * o, c = t - r * n * a + 4, l = r * o > .3 ? "start" : r * o < -.3 ? "end" : "middle";
|
|
611
|
+
m.push({
|
|
612
|
+
x: s,
|
|
613
|
+
y: c,
|
|
614
|
+
anchor: l,
|
|
615
|
+
box: w(s, c, l, C(i.cut, 12), 12)
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
let h = m.filter((e) => U.every((t) => {
|
|
619
|
+
let n = H.get(t.from), r = H.get(t.to);
|
|
620
|
+
return Ae.has(`${t.from}>${t.to}`) || n === void 0 || r === void 0 || !u(n, r, e.box);
|
|
621
|
+
})), g = tt(ne(h.length > 0 ? h : m, Ze));
|
|
622
|
+
nt.push({
|
|
623
|
+
kind: "cut",
|
|
624
|
+
key: p,
|
|
625
|
+
x1: c,
|
|
626
|
+
y1: l,
|
|
627
|
+
x2: d,
|
|
628
|
+
y2: f,
|
|
629
|
+
mx: e,
|
|
630
|
+
my: t,
|
|
631
|
+
ux: a,
|
|
632
|
+
uy: o,
|
|
633
|
+
slash: s(e - 4 * a, t - 4 * o) + s(e + 4 * a, t + 4 * o),
|
|
634
|
+
label: g
|
|
635
|
+
});
|
|
636
|
+
continue;
|
|
637
|
+
}
|
|
638
|
+
let m = re(s, e.from), h = ue?.open.has(p) === !0 ? "open" : ue?.blocked.has(p) === !0 ? "blocked" : void 0, g = `${m ? "ca-stroke-live" : "ca-stroke-idle"}${h === void 0 ? "" : ` ca-path-${h}`}`;
|
|
639
|
+
if (t.kind === "inhibit") {
|
|
640
|
+
let t = `¬${e.from}`, i = C(t, 12) + 12, s = U.filter((e) => `${e.from}>${e.to}` !== p), ee = (e) => s.filter((t) => {
|
|
641
|
+
let n = H.get(t.from), r = H.get(t.to);
|
|
642
|
+
return n !== void 0 && r !== void 0 && u(n, r, e);
|
|
643
|
+
}).length, v, y = Infinity;
|
|
644
|
+
for (let e of [
|
|
645
|
+
.5,
|
|
646
|
+
.42,
|
|
647
|
+
.58,
|
|
648
|
+
.35,
|
|
649
|
+
.65,
|
|
650
|
+
.28,
|
|
651
|
+
.72,
|
|
652
|
+
.22,
|
|
653
|
+
.78
|
|
654
|
+
]) {
|
|
655
|
+
let t = n.x + (r.x - n.x) * e, a = n.y + (r.y - n.y) * e, o = {
|
|
656
|
+
x0: t - i / 2,
|
|
657
|
+
y0: a - 9,
|
|
658
|
+
x1: t + i / 2,
|
|
659
|
+
y1: a + 9
|
|
660
|
+
};
|
|
661
|
+
if (Xe(o)) continue;
|
|
662
|
+
let s = Ze.filter((e) => _(o, e)).length * 10 + ee(o);
|
|
663
|
+
if (s < y && (v = {
|
|
664
|
+
x: t,
|
|
665
|
+
y: a + 4,
|
|
666
|
+
anchor: "middle",
|
|
667
|
+
box: o
|
|
668
|
+
}, y = s), s === 0) break;
|
|
669
|
+
}
|
|
670
|
+
if (v === void 0) {
|
|
671
|
+
let e = (n.x + r.x) / 2, t = (n.y + r.y) / 2;
|
|
672
|
+
v = {
|
|
673
|
+
x: e,
|
|
674
|
+
y: t + 4,
|
|
675
|
+
anchor: "middle",
|
|
676
|
+
box: {
|
|
677
|
+
x0: e - i / 2,
|
|
678
|
+
y0: t - 9,
|
|
679
|
+
x1: e + i / 2,
|
|
680
|
+
y1: t + 9
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
let te = tt(v);
|
|
685
|
+
nt.push({
|
|
686
|
+
kind: "inhibit",
|
|
687
|
+
key: p,
|
|
688
|
+
x1: c,
|
|
689
|
+
y1: l,
|
|
690
|
+
x2: d,
|
|
691
|
+
y2: f,
|
|
692
|
+
ux: a,
|
|
693
|
+
uy: o,
|
|
694
|
+
live: m,
|
|
695
|
+
onPath: h,
|
|
696
|
+
cls: g,
|
|
697
|
+
text: t,
|
|
698
|
+
label: te
|
|
699
|
+
});
|
|
700
|
+
} else nt.push({
|
|
701
|
+
kind: "plain",
|
|
702
|
+
key: p,
|
|
703
|
+
x1: c,
|
|
704
|
+
y1: l,
|
|
705
|
+
x2: d,
|
|
706
|
+
y2: f,
|
|
707
|
+
live: m,
|
|
708
|
+
onPath: h,
|
|
709
|
+
cls: g
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
let rt;
|
|
713
|
+
if (A !== void 0 && Object.keys(A).length > 0) {
|
|
714
|
+
let e = Object.keys(A).map((e) => H.get(e)).filter((e) => e !== void 0);
|
|
715
|
+
if (e.length > 0) {
|
|
716
|
+
let t = L + 14, n = M ? Object.keys(A).flatMap((e) => {
|
|
717
|
+
let t = H.get(e);
|
|
718
|
+
return t === void 0 ? [] : (q.get(e)?.boxes ?? []).map((e) => S(e, t.x, t.y));
|
|
719
|
+
}) : [], r = Math.min(...e.map((e) => e.x - t - 20), ...n.map((e) => e.x0 - 5)), a = Math.min(...e.map((e) => e.y - t), ...n.map((e) => e.y0 - 5));
|
|
720
|
+
rt = {
|
|
721
|
+
x: r,
|
|
722
|
+
y: a,
|
|
723
|
+
w: Math.max(...e.map((e) => e.x + t + 20), ...n.map((e) => e.x1 + 5)) - r,
|
|
724
|
+
h: Math.max(...e.map((e) => e.y + L + (M ? 10 : 34)), ...n.map((e) => e.y1 + 5)) - a,
|
|
725
|
+
text: i.witnessHold(l(A))
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
let it = /* @__PURE__ */ new Map(), at = /* @__PURE__ */ new Map(), ot = /* @__PURE__ */ new Map();
|
|
730
|
+
for (let e of o) {
|
|
731
|
+
let t = K(e);
|
|
732
|
+
t !== void 0 && it.set(e, t);
|
|
733
|
+
let n = je(e);
|
|
734
|
+
n !== void 0 && at.set(e, n);
|
|
735
|
+
let r = Me(e);
|
|
736
|
+
r !== void 0 && ot.set(e, r);
|
|
737
|
+
}
|
|
738
|
+
return {
|
|
739
|
+
prob: F,
|
|
740
|
+
r: L,
|
|
741
|
+
col: be,
|
|
742
|
+
row: I,
|
|
743
|
+
pos: H,
|
|
744
|
+
blocks: q,
|
|
745
|
+
labelOptions: Pe,
|
|
746
|
+
labelLines: J,
|
|
747
|
+
tags: it,
|
|
748
|
+
holdNotes: at,
|
|
749
|
+
deviantNotes: ot,
|
|
750
|
+
wasNotes: Fe,
|
|
751
|
+
edges: nt,
|
|
752
|
+
arcs: $e,
|
|
753
|
+
hull: rt,
|
|
754
|
+
left: $,
|
|
755
|
+
top: Z,
|
|
756
|
+
width: Math.ceil(et - $),
|
|
757
|
+
height: Math.ceil(Q - Z)
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
// src/components/graph/use-node-gestures.ts
|
|
761
|
+
var B = {
|
|
762
|
+
ArrowLeft: [-.5, 0],
|
|
763
|
+
ArrowRight: [.5, 0],
|
|
764
|
+
ArrowUp: [0, -.5],
|
|
765
|
+
ArrowDown: [0, .5]
|
|
766
|
+
};
|
|
767
|
+
function we(e, t) {
|
|
768
|
+
let [n, r] = E(void 0), i = se(0), a = (t) => {
|
|
769
|
+
let n = e.current?.getScreenCTM?.();
|
|
770
|
+
if (n == null) return {
|
|
771
|
+
x: t.clientX,
|
|
772
|
+
y: t.clientY
|
|
773
|
+
};
|
|
774
|
+
let r = n.inverse();
|
|
775
|
+
return {
|
|
776
|
+
x: r.a * t.clientX + r.c * t.clientY + r.e,
|
|
777
|
+
y: r.b * t.clientX + r.d * t.clientY + r.f
|
|
778
|
+
};
|
|
779
|
+
}, o = (e, n) => {
|
|
780
|
+
if (t === void 0 || n.button !== 0) return;
|
|
781
|
+
let i = a(n);
|
|
782
|
+
r({
|
|
783
|
+
id: e,
|
|
784
|
+
pointer: n.pointerId,
|
|
785
|
+
x0: i.x,
|
|
786
|
+
y0: i.y,
|
|
787
|
+
dx: 0,
|
|
788
|
+
dy: 0,
|
|
789
|
+
moved: !1
|
|
790
|
+
});
|
|
791
|
+
};
|
|
792
|
+
return {
|
|
793
|
+
drag: n,
|
|
794
|
+
moveDrag: (t) => {
|
|
795
|
+
if (n === void 0 || t.pointerId !== n.pointer) return;
|
|
796
|
+
let i = a(t), o = i.x - n.x0, s = i.y - n.y0, c = n.moved || Math.hypot(o, s) > 4;
|
|
797
|
+
c && !n.moved && e.current?.setPointerCapture?.(t.pointerId), r({
|
|
798
|
+
...n,
|
|
799
|
+
dx: o,
|
|
800
|
+
dy: s,
|
|
801
|
+
moved: c
|
|
802
|
+
});
|
|
803
|
+
},
|
|
804
|
+
endDrag: (e, a, o) => {
|
|
805
|
+
if (n === void 0 || e.pointerId !== n.pointer || (r(void 0), !n.moved)) return;
|
|
806
|
+
i.current = Date.now() + 400;
|
|
807
|
+
let s = F(n.dx / a), c = F(n.dy / o);
|
|
808
|
+
(s !== 0 || c !== 0) && t?.(n.id, s, c);
|
|
809
|
+
},
|
|
810
|
+
cancelDrag: () => r(void 0),
|
|
811
|
+
nodeHandlers: (e, n) => ({
|
|
812
|
+
onClick: () => {
|
|
813
|
+
Date.now() < i.current || n();
|
|
814
|
+
},
|
|
815
|
+
onKeyDown: (r) => {
|
|
816
|
+
if (r.key === "Enter" || r.key === " ") {
|
|
817
|
+
r.preventDefault(), n();
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
let i = B[r.key];
|
|
821
|
+
t !== void 0 && i !== void 0 && (r.preventDefault(), t(e, i[0], i[1]));
|
|
822
|
+
},
|
|
823
|
+
onPointerDown: (t) => o(e, t)
|
|
824
|
+
})
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
// src/components/graph/SignalGraph.tsx
|
|
828
|
+
function V(t) {
|
|
829
|
+
let { c: i, shown: o, structural: l = !1, hedge: u, values: d, original: f, probs: p, probe: h = {}, dists: ee, probNotes: _, observed: v = [], interventions: te, tagText: ne, stochastic: re = {}, removedEdges: b, witness: ae, onMove: x, observedValues: S = {}, evidence: w = !1, holdNotes: E = !1, defaults: A, paths: j, clamped: ce = [], testClamped: M = [], switches: le = [], nodeNotes: ue = {}, onPick: fe, pickable: pe, pickHint: he, fresh: P = [], onOpen: ge, observable: _e = !1, open: F, lit: ve = [], onHover: Se, edgeTip: R, onEdgeTip: z } = t, B = a(), V = g(), Te = oe().replace(/[^a-zA-Z0-9_-]/g, ""), Ee = se(null), { drag: De, moveDrag: Oe, endDrag: ke, cancelDrag: H, nodeHandlers: Ae } = we(Ee, x), U = (e) => Se === void 0 ? {} : {
|
|
830
|
+
onPointerEnter: (t) => t.pointerType !== "touch" && Se(e),
|
|
831
|
+
onPointerLeave: (e) => e.pointerType !== "touch" && Se(void 0),
|
|
832
|
+
onFocus: (t) => N(t.currentTarget) && Se(e),
|
|
833
|
+
onBlur: () => Se(void 0)
|
|
834
|
+
}, W = Ce({
|
|
835
|
+
c: i,
|
|
836
|
+
shown: o,
|
|
837
|
+
structural: l,
|
|
838
|
+
values: d,
|
|
839
|
+
original: f,
|
|
840
|
+
probs: p,
|
|
841
|
+
probe: h,
|
|
842
|
+
dists: ee,
|
|
843
|
+
probNotes: _,
|
|
844
|
+
observedValues: S,
|
|
845
|
+
evidence: w,
|
|
846
|
+
interventions: te,
|
|
847
|
+
tagText: ne,
|
|
848
|
+
stochastic: re,
|
|
849
|
+
removedEdges: b,
|
|
850
|
+
witness: ae,
|
|
851
|
+
hedge: u,
|
|
852
|
+
holdNotes: E,
|
|
853
|
+
defaults: A,
|
|
854
|
+
paths: j,
|
|
855
|
+
clamped: [...ce, ...M],
|
|
856
|
+
switches: le,
|
|
857
|
+
compact: t.compact === !0,
|
|
858
|
+
drag: De,
|
|
859
|
+
digits: V
|
|
860
|
+
}, B), { prob: G, r: K, col: je, row: Me, pos: Ne, blocks: q, arcs: Pe, hull: J, left: Fe, top: Ie, width: Le, height: Y } = W, Re = (t) => G && e(i.model, t).domain.kind === "finite", ze = (e) => ie(i.model, e, B.locale), Be = se("mouse"), X = (e, t) => t === void 0 || z === void 0 ? {} : {
|
|
861
|
+
tabIndex: 0,
|
|
862
|
+
role: "img",
|
|
863
|
+
"aria-label": t,
|
|
864
|
+
"data-tip": R === e ? "open" : void 0,
|
|
865
|
+
onPointerEnter: (n) => n.pointerType !== "touch" && z({
|
|
866
|
+
key: e,
|
|
867
|
+
text: t
|
|
868
|
+
}),
|
|
869
|
+
onPointerLeave: (e) => e.pointerType !== "touch" && z(void 0),
|
|
870
|
+
onPointerDown: (e) => {
|
|
871
|
+
Be.current = e.pointerType;
|
|
872
|
+
},
|
|
873
|
+
onFocus: (n) => N(n.currentTarget) && z({
|
|
874
|
+
key: e,
|
|
875
|
+
text: t
|
|
876
|
+
}),
|
|
877
|
+
onBlur: () => z(void 0),
|
|
878
|
+
onClick: () => z(Be.current === "touch" && R === e ? void 0 : {
|
|
879
|
+
key: e,
|
|
880
|
+
text: t
|
|
881
|
+
})
|
|
882
|
+
}, Ve = (e, t) => t === void 0 || j === void 0 ? void 0 : de(B, j, e, t), He = (e, t, n, r, i, a) => a === void 0 || z === void 0 ? null : /* @__PURE__ */ O("line", {
|
|
883
|
+
x1: t,
|
|
884
|
+
y1: n,
|
|
885
|
+
x2: r,
|
|
886
|
+
y2: i,
|
|
887
|
+
className: "ca-edge-hit"
|
|
888
|
+
}, `${e}-hit`), Ue = (e) => u?.f.includes(e) === !0, We = (e) => e.cx === 0 ? void 0 : e.cx, Ge = W.edges.map((e) => {
|
|
889
|
+
if (e.kind === "cut") {
|
|
890
|
+
let { key: t, x1: n, y1: r, x2: i, y2: a, mx: o, my: s, ux: c, uy: l, label: u } = e, [d = "", f = ""] = e.key.split(">"), p = B.edgeTip.cut(d, f);
|
|
891
|
+
return /* @__PURE__ */ k("g", {
|
|
892
|
+
className: "ca-edge ca-edge-cut",
|
|
893
|
+
"data-edge": t,
|
|
894
|
+
"data-state": "cut",
|
|
895
|
+
...X(t, p),
|
|
896
|
+
children: [
|
|
897
|
+
He(t, n, r, i, a, p),
|
|
898
|
+
/* @__PURE__ */ O("line", {
|
|
899
|
+
x1: n,
|
|
900
|
+
y1: r,
|
|
901
|
+
x2: o - 10 * c,
|
|
902
|
+
y2: s - 10 * l,
|
|
903
|
+
className: "ca-stroke-cut"
|
|
904
|
+
}),
|
|
905
|
+
/* @__PURE__ */ O("line", {
|
|
906
|
+
x1: o + 10 * c,
|
|
907
|
+
y1: s + 10 * l,
|
|
908
|
+
x2: i,
|
|
909
|
+
y2: a,
|
|
910
|
+
className: "ca-stroke-cut"
|
|
911
|
+
}),
|
|
912
|
+
/* @__PURE__ */ O("path", {
|
|
913
|
+
d: e.slash,
|
|
914
|
+
className: "ca-stroke-slash"
|
|
915
|
+
}),
|
|
916
|
+
/* @__PURE__ */ O("text", {
|
|
917
|
+
x: u.x,
|
|
918
|
+
y: u.y,
|
|
919
|
+
className: "ca-svg-small ca-svg-bold",
|
|
920
|
+
textAnchor: u.anchor,
|
|
921
|
+
children: B.cut
|
|
922
|
+
})
|
|
923
|
+
]
|
|
924
|
+
}, t);
|
|
925
|
+
}
|
|
926
|
+
let { key: t, x1: n, y1: r, x2: i, y2: a, live: o, onPath: c, cls: l } = e;
|
|
927
|
+
if (e.kind === "inhibit") {
|
|
928
|
+
let { ux: u, uy: d, text: f, label: p } = e, m = Ve(t, c);
|
|
929
|
+
return /* @__PURE__ */ k("g", {
|
|
930
|
+
className: "ca-edge",
|
|
931
|
+
"data-edge": t,
|
|
932
|
+
"data-state": o ? "live" : "idle",
|
|
933
|
+
"data-path": c,
|
|
934
|
+
...X(t, m),
|
|
935
|
+
children: [
|
|
936
|
+
He(t, n, r, i, a, m),
|
|
937
|
+
/* @__PURE__ */ O("line", {
|
|
938
|
+
x1: n,
|
|
939
|
+
y1: r,
|
|
940
|
+
x2: i,
|
|
941
|
+
y2: a,
|
|
942
|
+
className: l
|
|
943
|
+
}),
|
|
944
|
+
/* @__PURE__ */ O("circle", {
|
|
945
|
+
cx: i + 5 * u,
|
|
946
|
+
cy: a + 5 * d,
|
|
947
|
+
r: 5,
|
|
948
|
+
className: `ca-inhibit ${o ? "is-live" : ""}`
|
|
949
|
+
}),
|
|
950
|
+
/* @__PURE__ */ O("rect", {
|
|
951
|
+
x: p.box.x0,
|
|
952
|
+
y: p.box.y0,
|
|
953
|
+
width: p.box.x1 - p.box.x0,
|
|
954
|
+
height: p.box.y1 - p.box.y0,
|
|
955
|
+
rx: (p.box.y1 - p.box.y0) / 2,
|
|
956
|
+
className: `ca-inhibit-chip ${o ? "is-live" : ""}`
|
|
957
|
+
}),
|
|
958
|
+
/* @__PURE__ */ O("text", {
|
|
959
|
+
x: p.x,
|
|
960
|
+
y: p.y,
|
|
961
|
+
textAnchor: "middle",
|
|
962
|
+
className: `ca-svg-small ca-svg-bold ca-mono ${o ? "" : "ca-fill-muted"}`,
|
|
963
|
+
children: s(f)
|
|
964
|
+
})
|
|
965
|
+
]
|
|
966
|
+
}, t);
|
|
967
|
+
}
|
|
968
|
+
let u = Ve(t, c), d = t.split(">").every(Ue);
|
|
969
|
+
return /* @__PURE__ */ k("g", {
|
|
970
|
+
className: "ca-edge",
|
|
971
|
+
"data-edge": t,
|
|
972
|
+
"data-state": o ? "live" : "idle",
|
|
973
|
+
"data-path": c,
|
|
974
|
+
"data-hedge-edge": d ? "" : void 0,
|
|
975
|
+
...X(t, u),
|
|
976
|
+
children: [He(t, n, r, i, a, u), /* @__PURE__ */ O("line", {
|
|
977
|
+
x1: n,
|
|
978
|
+
y1: r,
|
|
979
|
+
x2: i,
|
|
980
|
+
y2: a,
|
|
981
|
+
className: l,
|
|
982
|
+
markerEnd: `url(#${Te}-${d ? "hedge" : c === "open" ? "open" : o ? "live" : "idle"})`
|
|
983
|
+
})]
|
|
984
|
+
}, t);
|
|
985
|
+
}), Ke = Pe.map(({ plan: e, label: t }) => {
|
|
986
|
+
let n = `${e.via}:${e.a}-${e.b}`, r = [`${e.via}>${e.a}`, `${e.via}>${e.b}`], a = r.every((e) => j?.open.has(e) === !0) ? "open" : r.every((e) => j?.open.has(e) === !0 || j?.blocked.has(e) === !0) ? "blocked" : void 0, o = `ca-stroke-arc${a === void 0 ? "" : ` ca-path-${a}`}`, s = t.box;
|
|
987
|
+
return /* @__PURE__ */ k("g", {
|
|
988
|
+
className: "ca-arc",
|
|
989
|
+
"data-arc": n,
|
|
990
|
+
"data-path": a,
|
|
991
|
+
"data-hedge-edge": Ue(e.a) && Ue(e.b) ? "" : void 0,
|
|
992
|
+
children: [
|
|
993
|
+
/* @__PURE__ */ O("path", {
|
|
994
|
+
d: `M${e.start.x} ${e.start.y}Q${e.control.x} ${e.control.y} ${e.end.x} ${e.end.y}`,
|
|
995
|
+
className: o
|
|
996
|
+
}),
|
|
997
|
+
/* @__PURE__ */ O("path", {
|
|
998
|
+
d: I(e.start, e.start.x - e.control.x, e.start.y - e.control.y),
|
|
999
|
+
className: "ca-arc-head ca-fill-fg"
|
|
1000
|
+
}),
|
|
1001
|
+
/* @__PURE__ */ O("path", {
|
|
1002
|
+
d: I(e.end, e.end.x - e.control.x, e.end.y - e.control.y),
|
|
1003
|
+
className: "ca-arc-head ca-fill-fg"
|
|
1004
|
+
}),
|
|
1005
|
+
/* @__PURE__ */ O("text", {
|
|
1006
|
+
x: t.x,
|
|
1007
|
+
y: t.y,
|
|
1008
|
+
textAnchor: "middle",
|
|
1009
|
+
className: "ca-svg-small ca-fill-muted",
|
|
1010
|
+
"aria-hidden": "true",
|
|
1011
|
+
children: B.arc.label
|
|
1012
|
+
}),
|
|
1013
|
+
/* @__PURE__ */ O("foreignObject", {
|
|
1014
|
+
className: "ca-arc-tip-box",
|
|
1015
|
+
x: s.x0,
|
|
1016
|
+
y: s.y0,
|
|
1017
|
+
width: s.x1 - s.x0,
|
|
1018
|
+
height: s.y1 - s.y0,
|
|
1019
|
+
children: /* @__PURE__ */ O(T, {
|
|
1020
|
+
tip: l ? B.identify.arc : /* @__PURE__ */ O(c, {
|
|
1021
|
+
text: B.arc.tip(e.via, e.a, e.b),
|
|
1022
|
+
ids: i.model.byId
|
|
1023
|
+
}),
|
|
1024
|
+
className: "ca-arc-tip",
|
|
1025
|
+
children: /* @__PURE__ */ O("span", {
|
|
1026
|
+
className: "ca-arc-hit",
|
|
1027
|
+
children: B.arc.label
|
|
1028
|
+
})
|
|
1029
|
+
})
|
|
1030
|
+
})
|
|
1031
|
+
]
|
|
1032
|
+
}, n);
|
|
1033
|
+
}), qe = o.map((t) => {
|
|
1034
|
+
let a = Ne.get(t), o = q.get(t);
|
|
1035
|
+
if (a === void 0 || o === void 0) return null;
|
|
1036
|
+
if (le.includes(t)) {
|
|
1037
|
+
let e = B.withHint(m(t, ze(t)), ue[t] ?? "");
|
|
1038
|
+
return /* @__PURE__ */ k("g", {
|
|
1039
|
+
className: `ca-node ca-switch${ge === void 0 ? "" : " is-interactive"}`,
|
|
1040
|
+
"data-node": t,
|
|
1041
|
+
"data-switch": "true",
|
|
1042
|
+
"data-block": o.side,
|
|
1043
|
+
transform: `translate(${a.x} ${a.y})`,
|
|
1044
|
+
...ge === void 0 ? {
|
|
1045
|
+
role: "img",
|
|
1046
|
+
"aria-label": e
|
|
1047
|
+
} : {
|
|
1048
|
+
role: "button",
|
|
1049
|
+
tabIndex: 0,
|
|
1050
|
+
"aria-haspopup": "dialog",
|
|
1051
|
+
"aria-expanded": F === t,
|
|
1052
|
+
"aria-label": B.withHint(e, B.nodeHint("switch", !1)),
|
|
1053
|
+
...Ae(t, () => ge(t))
|
|
1054
|
+
},
|
|
1055
|
+
...U(t),
|
|
1056
|
+
children: [
|
|
1057
|
+
/* @__PURE__ */ O("circle", {
|
|
1058
|
+
r: 21,
|
|
1059
|
+
className: "ca-focus-ring"
|
|
1060
|
+
}),
|
|
1061
|
+
F === t && /* @__PURE__ */ O("circle", {
|
|
1062
|
+
r: 21,
|
|
1063
|
+
className: "ca-open-ring"
|
|
1064
|
+
}),
|
|
1065
|
+
v.includes(t) && /* @__PURE__ */ O("rect", {
|
|
1066
|
+
x: -13,
|
|
1067
|
+
y: -13,
|
|
1068
|
+
width: 26,
|
|
1069
|
+
height: 26,
|
|
1070
|
+
className: "ca-ring"
|
|
1071
|
+
}),
|
|
1072
|
+
j?.ends.includes(t) === !0 && /* @__PURE__ */ O("circle", {
|
|
1073
|
+
r: 17 + (v.includes(t) ? 4 : 0),
|
|
1074
|
+
className: "ca-dsep-ring",
|
|
1075
|
+
"data-dsep-end": t
|
|
1076
|
+
}),
|
|
1077
|
+
/* @__PURE__ */ O("rect", {
|
|
1078
|
+
x: -9,
|
|
1079
|
+
y: -9,
|
|
1080
|
+
width: 18,
|
|
1081
|
+
height: 18,
|
|
1082
|
+
className: "ca-switch-box"
|
|
1083
|
+
}),
|
|
1084
|
+
/* @__PURE__ */ O("text", {
|
|
1085
|
+
x: We(o),
|
|
1086
|
+
y: o.labelY,
|
|
1087
|
+
textAnchor: "middle",
|
|
1088
|
+
className: "ca-svg-label",
|
|
1089
|
+
children: /* @__PURE__ */ O("tspan", {
|
|
1090
|
+
className: "ca-mono ca-svg-bold",
|
|
1091
|
+
children: s(t)
|
|
1092
|
+
})
|
|
1093
|
+
})
|
|
1094
|
+
]
|
|
1095
|
+
}, t);
|
|
1096
|
+
}
|
|
1097
|
+
let c = e(i.model, t), g = d?.[t], ie = te[t], b = re[t], T = ie !== void 0 || b !== void 0, oe = ae !== void 0 && t in ae, se = c.domain.kind === "boolean", E = !G && g === !0, A = g === void 0 ? "" : n(g), de = f?.[t], N = !G && de !== void 0 && g !== void 0 && !r(de, g), I = ze(t), Se = m(t, I), R = p?.[t], z = Re(t) && c.domain.kind === "finite" ? c.domain.values : void 0, Ce = ee?.[t], we = (e) => `P(${t}=${n((z ?? [])[e])})=${y(Ce?.[e] ?? NaN, V)}`, Ee = G ? z === void 0 ? `P(${t}=1) ${y(R ?? NaN, V)}` : z.map((e, t) => we(t)).join(", ") : t in h ? `P(${t}=1) ${y(h[t], V)}` : B.nodeValue(A), De = t in h && !G ? me(B, V, h[t], void 0, void 0) : me(B, V, R, ie, w ? void 0 : S[t]), Oe = ie === void 0 ? b === void 0 ? void 0 : `P(${t}=1)=${y(b, V)}` : ne?.[t] ?? n(ie), ke = S[t], H = B.withHint(B.nodeAria(Se, Ee, Oe, N ? n(de) : void 0, ke === void 0 ? void 0 : n(ke)), ue[t] ?? ""), je = fe === void 0 && ge !== void 0 && (c.kind === "endogenous" || _e), Me = fe !== void 0 && (pe === void 0 || pe.includes(t)), Pe = je || x !== void 0 || Me, J = () => {
|
|
1098
|
+
fe === void 0 ? ge?.(t) : Me && fe(t);
|
|
1099
|
+
}, Fe = Me ? "pick" : je ? _e ? c.kind === "exogenous" ? "observe" : "observeOrDo" : "do" : void 0, Ie = Me && he !== void 0 ? B.withHint(he, x === void 0 ? "" : B.nodeHint(void 0, !0)) : B.nodeHint(Fe, x !== void 0), Le = c.kind === "exogenous", Y = Le ? K - be : K, Be = G && R !== void 0 && !Number.isNaN(R) ? 2 * Y * R : 0, X = W.tags.get(t), Ve = W.holdNotes.get(t), He = W.labelLines.get(t), Ge = W.deviantNotes.get(t), Ke = W.wasNotes.get(t);
|
|
1100
|
+
return /* @__PURE__ */ k("g", {
|
|
1101
|
+
className: `ca-node${Pe ? " is-interactive" : ""}${x === void 0 ? "" : " is-movable"}`,
|
|
1102
|
+
"data-node": t,
|
|
1103
|
+
"data-value": A,
|
|
1104
|
+
"data-intervened": T ? "true" : "false",
|
|
1105
|
+
"data-observed": ke === void 0 ? void 0 : n(ke),
|
|
1106
|
+
"data-do-p": b === void 0 ? void 0 : b.toFixed(2),
|
|
1107
|
+
"data-block": o.side,
|
|
1108
|
+
transform: `translate(${a.x} ${a.y})`,
|
|
1109
|
+
...Pe ? {
|
|
1110
|
+
role: "button",
|
|
1111
|
+
tabIndex: 0,
|
|
1112
|
+
"aria-haspopup": je ? "dialog" : void 0,
|
|
1113
|
+
"aria-expanded": je ? F === t : void 0,
|
|
1114
|
+
"aria-label": B.withHint(H, Ie),
|
|
1115
|
+
...Ae(t, J)
|
|
1116
|
+
} : {
|
|
1117
|
+
role: "img",
|
|
1118
|
+
"aria-label": H
|
|
1119
|
+
},
|
|
1120
|
+
...U(t),
|
|
1121
|
+
children: [
|
|
1122
|
+
Ue(t) && /* @__PURE__ */ O("circle", {
|
|
1123
|
+
r: K + 9,
|
|
1124
|
+
className: "ca-hedge-ring",
|
|
1125
|
+
"data-hedge": "f",
|
|
1126
|
+
"data-member": t
|
|
1127
|
+
}),
|
|
1128
|
+
u?.fPrime.includes(t) === !0 && /* @__PURE__ */ O("circle", {
|
|
1129
|
+
r: K + 16,
|
|
1130
|
+
className: "ca-hedge-inner",
|
|
1131
|
+
"data-hedge": "f-prime",
|
|
1132
|
+
"data-member": t
|
|
1133
|
+
}),
|
|
1134
|
+
ve.includes(t) && /* @__PURE__ */ O("circle", {
|
|
1135
|
+
r: K + 14,
|
|
1136
|
+
className: "ca-lit-ring",
|
|
1137
|
+
"data-lit": t
|
|
1138
|
+
}),
|
|
1139
|
+
P.includes(t) && /* @__PURE__ */ O("circle", {
|
|
1140
|
+
r: K + 7,
|
|
1141
|
+
className: "ca-new-ring",
|
|
1142
|
+
"data-new": t
|
|
1143
|
+
}),
|
|
1144
|
+
/* @__PURE__ */ O("circle", {
|
|
1145
|
+
r: K + 12,
|
|
1146
|
+
className: "ca-focus-ring"
|
|
1147
|
+
}),
|
|
1148
|
+
F === t && /* @__PURE__ */ O("circle", {
|
|
1149
|
+
r: K + 12,
|
|
1150
|
+
className: "ca-open-ring"
|
|
1151
|
+
}),
|
|
1152
|
+
v.includes(t) && /* @__PURE__ */ O("circle", {
|
|
1153
|
+
r: K + 5,
|
|
1154
|
+
className: "ca-ring"
|
|
1155
|
+
}),
|
|
1156
|
+
j?.ends.includes(t) === !0 && /* @__PURE__ */ O("circle", {
|
|
1157
|
+
r: K + 9,
|
|
1158
|
+
className: "ca-dsep-ring",
|
|
1159
|
+
"data-dsep-end": t
|
|
1160
|
+
}),
|
|
1161
|
+
G ? /* @__PURE__ */ k(D, { children: [
|
|
1162
|
+
/* @__PURE__ */ O("clipPath", {
|
|
1163
|
+
id: `${Te}-cp-${t}`,
|
|
1164
|
+
children: /* @__PURE__ */ O("circle", { r: Y })
|
|
1165
|
+
}),
|
|
1166
|
+
/* @__PURE__ */ O("circle", {
|
|
1167
|
+
r: K,
|
|
1168
|
+
className: "ca-fill-bg"
|
|
1169
|
+
}),
|
|
1170
|
+
z === void 0 && /* @__PURE__ */ O("rect", {
|
|
1171
|
+
x: -Y,
|
|
1172
|
+
y: Y - Be,
|
|
1173
|
+
width: 2 * Y,
|
|
1174
|
+
height: Be,
|
|
1175
|
+
className: "ca-fill-fg",
|
|
1176
|
+
clipPath: `url(#${Te}-cp-${t})`,
|
|
1177
|
+
"data-level": R === void 0 ? "" : R.toFixed(4)
|
|
1178
|
+
}),
|
|
1179
|
+
/* @__PURE__ */ O("circle", {
|
|
1180
|
+
r: K,
|
|
1181
|
+
className: `ca-node-outline${Le ? " ca-exo" : ""}`,
|
|
1182
|
+
strokeDasharray: Le ? ye(K) : void 0
|
|
1183
|
+
})
|
|
1184
|
+
] }) : /* @__PURE__ */ k(D, { children: [Le ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("circle", {
|
|
1185
|
+
r: K,
|
|
1186
|
+
className: "ca-node-off ca-exo",
|
|
1187
|
+
strokeDasharray: ye(K)
|
|
1188
|
+
}), E && /* @__PURE__ */ O("circle", {
|
|
1189
|
+
r: Y,
|
|
1190
|
+
className: "ca-fill-fg ca-exo-core"
|
|
1191
|
+
})] }) : /* @__PURE__ */ O("circle", {
|
|
1192
|
+
r: K,
|
|
1193
|
+
className: E ? "ca-node-on" : "ca-node-off"
|
|
1194
|
+
}), /* @__PURE__ */ O("text", {
|
|
1195
|
+
y: se ? 7.5 : 5,
|
|
1196
|
+
textAnchor: "middle",
|
|
1197
|
+
className: `ca-mono ca-svg-bold ${E ? "ca-fill-bg-text" : ""}`,
|
|
1198
|
+
fontSize: l ? 14 : se || A.length <= 2 ? 21 : 13,
|
|
1199
|
+
children: l ? s(t) : A
|
|
1200
|
+
})] }),
|
|
1201
|
+
!T && M.includes(t) && /* @__PURE__ */ O("path", {
|
|
1202
|
+
d: L(K),
|
|
1203
|
+
className: "ca-stroke-clamp ca-clamp-test",
|
|
1204
|
+
"data-clamp": "test"
|
|
1205
|
+
}),
|
|
1206
|
+
(T && !oe || !T && ce.includes(t)) && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("path", {
|
|
1207
|
+
d: L(K),
|
|
1208
|
+
className: X?.reset ? "ca-stroke-reset" : "ca-stroke-clamp"
|
|
1209
|
+
}), T && X !== void 0 && /* @__PURE__ */ k("g", {
|
|
1210
|
+
transform: `translate(${X.box.x0} ${X.box.y0})`,
|
|
1211
|
+
children: [/* @__PURE__ */ O("rect", {
|
|
1212
|
+
width: X.box.x1 - X.box.x0,
|
|
1213
|
+
height: 22,
|
|
1214
|
+
className: X.reset ? "ca-fill-reset" : "ca-fill-accent"
|
|
1215
|
+
}), /* @__PURE__ */ O("text", {
|
|
1216
|
+
x: (X.box.x1 - X.box.x0) / 2,
|
|
1217
|
+
y: 15.5,
|
|
1218
|
+
textAnchor: "middle",
|
|
1219
|
+
className: "ca-mono ca-svg-small ca-svg-bold ca-fill-on-accent",
|
|
1220
|
+
children: s(X.text)
|
|
1221
|
+
})]
|
|
1222
|
+
})] }),
|
|
1223
|
+
!T && X !== void 0 && X.seen && /* @__PURE__ */ k("g", {
|
|
1224
|
+
transform: `translate(${X.box.x0} ${X.box.y0})`,
|
|
1225
|
+
className: "ca-seen-tag",
|
|
1226
|
+
children: [/* @__PURE__ */ O("rect", {
|
|
1227
|
+
width: X.box.x1 - X.box.x0,
|
|
1228
|
+
height: 22,
|
|
1229
|
+
className: "ca-seen-tag-box"
|
|
1230
|
+
}), /* @__PURE__ */ O("text", {
|
|
1231
|
+
x: (X.box.x1 - X.box.x0) / 2,
|
|
1232
|
+
y: 15.5,
|
|
1233
|
+
textAnchor: "middle",
|
|
1234
|
+
className: "ca-mono ca-svg-small ca-svg-bold",
|
|
1235
|
+
children: s(X.text)
|
|
1236
|
+
})]
|
|
1237
|
+
}),
|
|
1238
|
+
Ve === void 0 ? Ke !== void 0 && /* @__PURE__ */ O("text", {
|
|
1239
|
+
x: Ke.x,
|
|
1240
|
+
y: Ke.y,
|
|
1241
|
+
textAnchor: Ke.anchor,
|
|
1242
|
+
className: "ca-svg-small ca-fill-muted",
|
|
1243
|
+
children: Ke.text
|
|
1244
|
+
}) : /* @__PURE__ */ O("text", {
|
|
1245
|
+
x: We(o),
|
|
1246
|
+
y: o.noteY,
|
|
1247
|
+
textAnchor: "middle",
|
|
1248
|
+
className: "ca-svg-small ca-svg-bold ca-fill-amber",
|
|
1249
|
+
"data-held": t,
|
|
1250
|
+
children: Ve
|
|
1251
|
+
}),
|
|
1252
|
+
Ge !== void 0 && /* @__PURE__ */ k("g", {
|
|
1253
|
+
className: "ca-deviant",
|
|
1254
|
+
"data-deviant": t,
|
|
1255
|
+
children: [/* @__PURE__ */ O("rect", {
|
|
1256
|
+
x: o.cx - (C(Ge ?? "", 11) + 8) / 2,
|
|
1257
|
+
y: o.note2Y - 11,
|
|
1258
|
+
width: C(Ge ?? "", 11) + 8,
|
|
1259
|
+
height: 15,
|
|
1260
|
+
className: "ca-deviant-box"
|
|
1261
|
+
}), /* @__PURE__ */ O("text", {
|
|
1262
|
+
x: We(o),
|
|
1263
|
+
y: o.note2Y,
|
|
1264
|
+
textAnchor: "middle",
|
|
1265
|
+
className: "ca-svg-tiny ca-svg-bold",
|
|
1266
|
+
children: Ge
|
|
1267
|
+
})]
|
|
1268
|
+
}),
|
|
1269
|
+
/* @__PURE__ */ k("text", {
|
|
1270
|
+
x: We(o),
|
|
1271
|
+
y: o.labelY,
|
|
1272
|
+
textAnchor: "middle",
|
|
1273
|
+
className: "ca-svg-label",
|
|
1274
|
+
children: [!l && /* @__PURE__ */ O("tspan", {
|
|
1275
|
+
className: "ca-mono ca-svg-bold",
|
|
1276
|
+
children: s(t)
|
|
1277
|
+
}), He === void 0 ? I === "" ? null : l ? I : ` ${I}` : /* @__PURE__ */ k(D, { children: [l ? He[0] : ` ${He[0]}`, /* @__PURE__ */ O("tspan", {
|
|
1278
|
+
x: o.cx,
|
|
1279
|
+
y: o.label2Y,
|
|
1280
|
+
children: He[1]
|
|
1281
|
+
})] })]
|
|
1282
|
+
}),
|
|
1283
|
+
z === void 0 ? (G || t in h) && /* @__PURE__ */ k("text", {
|
|
1284
|
+
x: We(o),
|
|
1285
|
+
y: o.numberY,
|
|
1286
|
+
textAnchor: "middle",
|
|
1287
|
+
className: "ca-mono ca-svg-num",
|
|
1288
|
+
children: [De.prefix !== "" && /* @__PURE__ */ O("tspan", {
|
|
1289
|
+
className: "ca-svg-small ca-fill-muted",
|
|
1290
|
+
children: De.prefix
|
|
1291
|
+
}), /* @__PURE__ */ O("tspan", {
|
|
1292
|
+
"data-readout": t,
|
|
1293
|
+
fontSize: De.settled ? 14 : void 0,
|
|
1294
|
+
children: De.text
|
|
1295
|
+
})]
|
|
1296
|
+
}) : /* @__PURE__ */ O(xe, {
|
|
1297
|
+
id: t,
|
|
1298
|
+
labels: z.map(n),
|
|
1299
|
+
dist: Ce,
|
|
1300
|
+
block: o,
|
|
1301
|
+
barText: we
|
|
1302
|
+
}),
|
|
1303
|
+
G && (!De.settled || w) && _?.[t] !== void 0 && Ve === void 0 && /* @__PURE__ */ O("text", {
|
|
1304
|
+
x: We(o),
|
|
1305
|
+
y: o.noteY,
|
|
1306
|
+
textAnchor: "middle",
|
|
1307
|
+
className: "ca-svg-small ca-fill-muted",
|
|
1308
|
+
"data-note": t,
|
|
1309
|
+
children: _[t]
|
|
1310
|
+
})
|
|
1311
|
+
]
|
|
1312
|
+
}, t);
|
|
1313
|
+
});
|
|
1314
|
+
return /* @__PURE__ */ k("svg", {
|
|
1315
|
+
ref: Ee,
|
|
1316
|
+
onPointerMove: x === void 0 ? void 0 : Oe,
|
|
1317
|
+
onPointerUp: x === void 0 ? void 0 : (e) => ke(e, je, Me),
|
|
1318
|
+
onPointerCancel: x === void 0 ? void 0 : H,
|
|
1319
|
+
className: "ca-graph",
|
|
1320
|
+
viewBox: `${Fe} ${Ie} ${Le} ${Y}`,
|
|
1321
|
+
width: Le,
|
|
1322
|
+
height: Y,
|
|
1323
|
+
role: "group",
|
|
1324
|
+
"aria-label": t.title,
|
|
1325
|
+
"data-mode": G ? "probability" : "value",
|
|
1326
|
+
children: [
|
|
1327
|
+
/* @__PURE__ */ k("defs", { children: [
|
|
1328
|
+
/* @__PURE__ */ O("marker", {
|
|
1329
|
+
id: `${Te}-live`,
|
|
1330
|
+
viewBox: "0 0 10 10",
|
|
1331
|
+
refX: "9",
|
|
1332
|
+
refY: "5",
|
|
1333
|
+
markerWidth: "6.5",
|
|
1334
|
+
markerHeight: "6.5",
|
|
1335
|
+
orient: "auto",
|
|
1336
|
+
children: /* @__PURE__ */ O("path", {
|
|
1337
|
+
d: "M0 0.5L10 5L0 9.5z",
|
|
1338
|
+
className: "ca-fill-fg"
|
|
1339
|
+
})
|
|
1340
|
+
}),
|
|
1341
|
+
/* @__PURE__ */ O("marker", {
|
|
1342
|
+
id: `${Te}-open`,
|
|
1343
|
+
viewBox: "0 0 10 10",
|
|
1344
|
+
refX: "9",
|
|
1345
|
+
refY: "5",
|
|
1346
|
+
markerWidth: "6.5",
|
|
1347
|
+
markerHeight: "6.5",
|
|
1348
|
+
orient: "auto",
|
|
1349
|
+
children: /* @__PURE__ */ O("path", {
|
|
1350
|
+
d: "M0 0.5L10 5L0 9.5z",
|
|
1351
|
+
className: "ca-fill-accent"
|
|
1352
|
+
})
|
|
1353
|
+
}),
|
|
1354
|
+
u !== void 0 && /* @__PURE__ */ O("marker", {
|
|
1355
|
+
id: `${Te}-hedge`,
|
|
1356
|
+
viewBox: "0 0 10 10",
|
|
1357
|
+
refX: "9",
|
|
1358
|
+
refY: "5",
|
|
1359
|
+
markerWidth: "6.5",
|
|
1360
|
+
markerHeight: "6.5",
|
|
1361
|
+
orient: "auto",
|
|
1362
|
+
children: /* @__PURE__ */ O("path", {
|
|
1363
|
+
d: "M0 0.5L10 5L0 9.5z",
|
|
1364
|
+
className: "ca-hedge-arrow"
|
|
1365
|
+
})
|
|
1366
|
+
}),
|
|
1367
|
+
/* @__PURE__ */ O("marker", {
|
|
1368
|
+
id: `${Te}-idle`,
|
|
1369
|
+
viewBox: "0 0 10 10",
|
|
1370
|
+
refX: "9",
|
|
1371
|
+
refY: "5",
|
|
1372
|
+
markerWidth: "8",
|
|
1373
|
+
markerHeight: "8",
|
|
1374
|
+
orient: "auto",
|
|
1375
|
+
children: /* @__PURE__ */ O("path", {
|
|
1376
|
+
d: "M0 0.5L10 5L0 9.5z",
|
|
1377
|
+
className: "ca-fill-idle"
|
|
1378
|
+
})
|
|
1379
|
+
})
|
|
1380
|
+
] }),
|
|
1381
|
+
J !== void 0 && /* @__PURE__ */ k("g", {
|
|
1382
|
+
className: "ca-witness",
|
|
1383
|
+
"data-witness": Object.keys(ae ?? {}).join(","),
|
|
1384
|
+
children: [/* @__PURE__ */ O("rect", {
|
|
1385
|
+
x: J.x,
|
|
1386
|
+
y: J.y,
|
|
1387
|
+
width: J.w,
|
|
1388
|
+
height: J.h,
|
|
1389
|
+
className: "ca-hull"
|
|
1390
|
+
}), !E && /* @__PURE__ */ k("g", {
|
|
1391
|
+
transform: `translate(${J.x} ${J.y + J.h + 6})`,
|
|
1392
|
+
children: [/* @__PURE__ */ O("rect", {
|
|
1393
|
+
width: C(J.text, 12) + 18,
|
|
1394
|
+
height: 22,
|
|
1395
|
+
className: "ca-amber-tag"
|
|
1396
|
+
}), /* @__PURE__ */ O("text", {
|
|
1397
|
+
x: 8,
|
|
1398
|
+
y: 15.5,
|
|
1399
|
+
className: "ca-svg-small ca-svg-bold ca-fill-amber",
|
|
1400
|
+
children: s(J.text)
|
|
1401
|
+
})]
|
|
1402
|
+
})]
|
|
1403
|
+
}),
|
|
1404
|
+
Ge,
|
|
1405
|
+
Ke,
|
|
1406
|
+
qe
|
|
1407
|
+
]
|
|
1408
|
+
});
|
|
1409
|
+
}
|
|
1410
|
+
export { M as a, A as i, N as n, ce as o, j as r, V as t };
|
|
1411
|
+
|
|
1412
|
+
//# sourceMappingURL=SignalGraph-CWPf_sG8.js.map
|