@umriss-ui/calculation 0.5.3 → 0.6.1
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/CHANGELOG.md +43 -0
- package/README.md +12 -4
- package/dist/calculation.css +1 -1
- package/dist/calculation.js +389 -368
- package/dist/index.d.ts +9 -1
- package/docs/llms-full.md +614 -49
- package/package.json +4 -4
package/dist/calculation.js
CHANGED
|
@@ -1,232 +1,242 @@
|
|
|
1
1
|
import "./calculation.css";
|
|
2
|
-
import { jsx as g, jsxs as
|
|
3
|
-
import { Children as
|
|
4
|
-
import { assess as Re, verdictWeight as
|
|
5
|
-
function
|
|
2
|
+
import { jsx as g, jsxs as P } from "react/jsx-runtime";
|
|
3
|
+
import { Children as qe, isValidElement as z, Fragment as xe, useId as ke, useState as re, useRef as Me, useCallback as Te, useLayoutEffect as Ee, useEffect as Ae } from "react";
|
|
4
|
+
import { assess as Re, verdictWeight as se, useFormats as Ne, useWording as Oe, VisuallyHidden as Ie, AngleGlyph as Pe, Badge as le, useFreshness as je, Tooltip as De } from "@umriss-ui/core";
|
|
5
|
+
function Be(t) {
|
|
6
6
|
return t.decimals !== void 0 ? t.decimals : t.format === "percent" ? 1 : t.given ? void 0 : 2;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return e === void 0 ? t : Math.sign(t) * Number(Math.abs(t).toFixed(e));
|
|
8
|
+
function Le(t, e) {
|
|
9
|
+
return e === void 0 ? t : Math.sign(t) * Number(Math.abs(t).toFixed(e)) || 0;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
11
|
+
function ae(t, e) {
|
|
12
|
+
return Le(t.format === "percent" ? e * 100 : e, Be(t));
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
function ve(t, e,
|
|
16
|
-
const [
|
|
14
|
+
const We = (t, e) => t.format === "percent" ? e / 100 : e;
|
|
15
|
+
function ve(t, e, p) {
|
|
16
|
+
const [r, ...l] = e;
|
|
17
17
|
switch (t) {
|
|
18
18
|
case "sum":
|
|
19
|
-
return
|
|
19
|
+
return e.reduce((a, i, N) => p[N] ? a - i : a + i, 0);
|
|
20
20
|
case "difference":
|
|
21
|
-
return l.reduce((
|
|
21
|
+
return l.reduce((a, i) => a - i, r);
|
|
22
22
|
case "product":
|
|
23
|
-
return l.reduce((
|
|
23
|
+
return l.reduce((a, i) => a * i, r);
|
|
24
24
|
case "quotient":
|
|
25
|
-
return
|
|
25
|
+
return r / l[0];
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const ge = (t, e) => e === void 0 || t !== void 0 &&
|
|
29
|
-
function
|
|
30
|
-
const e = /* @__PURE__ */ new Map(),
|
|
31
|
-
var
|
|
32
|
-
const l = e.get(
|
|
28
|
+
const ge = (t, e) => e === void 0 || t !== void 0 && se(t) >= se(e) ? t : e;
|
|
29
|
+
function Fe(t) {
|
|
30
|
+
const e = /* @__PURE__ */ new Map(), p = (r) => {
|
|
31
|
+
var c, m, $;
|
|
32
|
+
const l = e.get(r);
|
|
33
33
|
if (l) return l;
|
|
34
|
-
const
|
|
35
|
-
let i = null,
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
typeof
|
|
34
|
+
const a = t.quantities.get(r);
|
|
35
|
+
let i = null, N, f = !1, b;
|
|
36
|
+
if (a.given) {
|
|
37
|
+
const o = a.given.value;
|
|
38
|
+
typeof o == "number" && Number.isFinite(o) ? i = o : N = { kind: "missing", label: a.label };
|
|
39
39
|
} else {
|
|
40
|
-
const
|
|
41
|
-
for (const { operand:
|
|
42
|
-
const
|
|
43
|
-
|
|
40
|
+
const o = a.operands.map((y) => ({ operand: y, ...p(y.key) }));
|
|
41
|
+
for (const { operand: y, verdict: M, worst: q } of o) {
|
|
42
|
+
const x = y.reference ? M : ge(M, q);
|
|
43
|
+
b = ge(b, x);
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
48
|
-
const
|
|
49
|
-
i = ve(
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
N = (c = o.find((y) => y.absence)) == null ? void 0 : c.absence;
|
|
46
|
+
const _ = o[1];
|
|
47
|
+
if (!N && a.operator === "quotient" && _.value === 0 && (N = { kind: "zero", label: t.quantities.get(_.operand.key).label }), !N) {
|
|
48
|
+
const y = a.operands.map((q) => q.negated === !0);
|
|
49
|
+
i = ve(a.operator, o.map((q) => q.value), y);
|
|
50
|
+
const M = ve(
|
|
51
|
+
a.operator,
|
|
52
|
+
o.map((q) => We(t.quantities.get(q.operand.key), q.shown)),
|
|
53
|
+
y
|
|
54
54
|
);
|
|
55
|
-
|
|
55
|
+
f = ae(a, M) !== ae(a, i);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const j = { target: a.target, limits: a.limits }, U = a.target !== void 0 || (((m = a.limits) == null ? void 0 : m.length) ?? 0) > 0 ? Re(i, j) : void 0, D = ((($ = a.limits) == null ? void 0 : $.length) ?? 0) > 0 ? U.verdict : i === null ? "unknown" : void 0, E = {
|
|
59
59
|
value: i,
|
|
60
|
-
absence:
|
|
61
|
-
shown: i === null ? null :
|
|
62
|
-
approximate:
|
|
60
|
+
absence: N,
|
|
61
|
+
shown: i === null ? null : ae(a, i),
|
|
62
|
+
approximate: f,
|
|
63
63
|
assessment: U,
|
|
64
|
-
verdict:
|
|
65
|
-
worst:
|
|
64
|
+
verdict: D,
|
|
65
|
+
worst: b
|
|
66
66
|
};
|
|
67
|
-
return e.set(
|
|
67
|
+
return e.set(r, E), E;
|
|
68
68
|
};
|
|
69
|
-
for (const
|
|
69
|
+
for (const r of t.quantities.keys()) p(r);
|
|
70
70
|
return e;
|
|
71
71
|
}
|
|
72
|
-
const
|
|
73
|
-
[
|
|
74
|
-
[
|
|
72
|
+
const Ue = () => null, Qe = () => null, ze = () => null, Ve = () => null, Ge = () => null, be = () => null, He = () => null, Ke = () => null, Ye = () => null, Je = () => null, Ze = () => null, ce = () => null, Xe = /* @__PURE__ */ new Map([
|
|
73
|
+
[Qe, "sum"],
|
|
74
|
+
[ze, "difference"],
|
|
75
75
|
[Ve, "product"],
|
|
76
|
-
[
|
|
76
|
+
[Ge, "quotient"]
|
|
77
77
|
]), $e = {
|
|
78
78
|
sum: "Sum",
|
|
79
79
|
difference: "Difference",
|
|
80
80
|
product: "Product",
|
|
81
81
|
quotient: "Quotient"
|
|
82
|
-
},
|
|
83
|
-
[
|
|
84
|
-
[
|
|
85
|
-
[
|
|
86
|
-
[
|
|
87
|
-
]),
|
|
82
|
+
}, ue = /* @__PURE__ */ new Map([
|
|
83
|
+
[Ke, { name: "Plus", operator: "sum" }],
|
|
84
|
+
[Ye, { name: "Minus", operator: "sum", negated: !0 }],
|
|
85
|
+
[Je, { name: "Times", operator: "product" }],
|
|
86
|
+
[Ze, { name: "DividedBy", operator: "quotient" }]
|
|
87
|
+
]), de = "<Given>, <Sum>, <Difference>, <Product>, <Quotient> or <Chain>", _e = "a calculation with metrics only adds and subtracts - <Sum>, <Difference>, <Plus>, <Minus>.", et = ["unit", "format", "decimals"];
|
|
88
88
|
function w(t) {
|
|
89
89
|
throw new Error(`@umriss-ui/calculation: ${t}`);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
return
|
|
93
|
-
(e) =>
|
|
91
|
+
function ee(t) {
|
|
92
|
+
return qe.toArray(t).flatMap(
|
|
93
|
+
(e) => z(e) && e.type === xe ? ee(e.props.children) : [e]
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
if (!
|
|
96
|
+
function ne(t) {
|
|
97
|
+
if (!z(t)) return JSON.stringify(t);
|
|
98
98
|
const e = t.type;
|
|
99
99
|
return typeof e == "string" ? `<${e}>` : `<${e.displayName ?? e.name ?? "anonymous"}>`;
|
|
100
100
|
}
|
|
101
|
-
const
|
|
102
|
-
function
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
101
|
+
const pe = (t, e, p) => `${t}/${z(e) && e.key || p}`;
|
|
102
|
+
function tt(t, e) {
|
|
103
|
+
const p = ee(t);
|
|
104
|
+
if (p.length !== 1 && w(`<Calculation> takes exactly one child, the result; it was given ${p.length}.`), e !== void 0) {
|
|
105
105
|
e.length === 0 && w("<Calculation>: metrics is empty; leave it out for a calculation with one number per quantity.");
|
|
106
|
-
const
|
|
107
|
-
for (const { id:
|
|
108
|
-
|
|
106
|
+
const c = /* @__PURE__ */ new Set();
|
|
107
|
+
for (const { id: m } of e)
|
|
108
|
+
c.has(m) && w(`<Calculation>: the metric id "${m}" is used twice.`), c.add(m);
|
|
109
109
|
}
|
|
110
|
-
const
|
|
111
|
-
const $ = typeof
|
|
110
|
+
const r = e == null ? void 0 : e.map((c) => `"${c.id}"`).join(", "), l = (c, m) => {
|
|
111
|
+
const $ = typeof c == "object" && c !== null;
|
|
112
112
|
if (e === void 0) {
|
|
113
|
-
$ && w(`${
|
|
113
|
+
$ && w(`${m}: value is an object by metric, but the calculation has no metrics.`);
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
$ || w(`${
|
|
117
|
-
for (const { id:
|
|
118
|
-
|
|
119
|
-
for (const
|
|
120
|
-
e.some((
|
|
121
|
-
},
|
|
122
|
-
const { id:
|
|
116
|
+
$ || w(`${m}: with metrics, value is an object with a number for each metric - ${r}.`);
|
|
117
|
+
for (const { id: o } of e)
|
|
118
|
+
o in c || w(`${m}: value has no number for the metric "${o}"; write null where it is absent. The metrics: ${r}.`);
|
|
119
|
+
for (const o of Object.keys(c))
|
|
120
|
+
e.some((_) => _.id === o) || w(`${m}: value has a number for "${o}", which is no metric. The metrics: ${r}.`);
|
|
121
|
+
}, a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), N = [], f = (c, m, $) => {
|
|
122
|
+
const { id: o, ..._ } = m;
|
|
123
123
|
if (e !== void 0) {
|
|
124
|
-
for (const
|
|
125
|
-
|
|
126
|
-
(
|
|
124
|
+
for (const M of et)
|
|
125
|
+
m[M] !== void 0 && w(`${$}: ${M} belongs to the metric once the calculation has metrics, not to a quantity.`);
|
|
126
|
+
(m.target !== void 0 || m.limits !== void 0) && w(`${$}: target and limits are not assessed in a calculation with metrics.`);
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
return
|
|
131
|
-
},
|
|
132
|
-
if (
|
|
133
|
-
const
|
|
134
|
-
return
|
|
128
|
+
o !== void 0 && (i.has(o) && w(`${$}: the id "${o}" is used twice.`), i.set(o, c));
|
|
129
|
+
const y = { ..._, key: c, id: o, operands: [] };
|
|
130
|
+
return a.set(c, y), y;
|
|
131
|
+
}, b = (c, m, $) => {
|
|
132
|
+
if (z(c) && c.type === be) {
|
|
133
|
+
const o = { key: "", reference: !0 };
|
|
134
|
+
return N.push({ operand: o, to: c.props.to, where: $ }), o;
|
|
135
135
|
}
|
|
136
|
-
return { key:
|
|
137
|
-
},
|
|
138
|
-
if ((!
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
`${$}: ${
|
|
136
|
+
return { key: j(c, m, $), reference: !1 };
|
|
137
|
+
}, j = (c, m, $) => {
|
|
138
|
+
if ((!z(c) || c.type === be || ue.has(c.type) || c.type === ce) && w(`${$}: ${ne(c)} cannot stand here; a quantity must be ${de}.`), c.type === He) return U(c.props.children, m, $);
|
|
139
|
+
const o = Xe.get(c.type);
|
|
140
|
+
c.type !== Ue && o === void 0 && w(
|
|
141
|
+
`${$}: ${ne(c)} is not an element of the calculation. A calculation reads its children's props and cannot look inside a component of your own; write ${de} or <Ref> directly, or return them from .map.`
|
|
142
142
|
);
|
|
143
|
-
const { children:
|
|
144
|
-
e !== void 0 && (
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
147
|
-
return l(
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
return (
|
|
151
|
-
`${
|
|
152
|
-
),
|
|
153
|
-
}, U = (
|
|
154
|
-
const
|
|
155
|
-
(
|
|
156
|
-
let
|
|
157
|
-
return
|
|
158
|
-
const
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
|
|
143
|
+
const { children: _, value: y, source: M, asOf: q, ages: x, ...B } = c.props, h = `${$} › ${B.label}`;
|
|
144
|
+
e !== void 0 && (o === "product" || o === "quotient") && w(`${h}: <${$e[o]}> - ${_e}`);
|
|
145
|
+
const O = f(m, B, h);
|
|
146
|
+
if (o === void 0)
|
|
147
|
+
return l(y, h), O.given = { value: y, source: M, asOf: q, ages: x }, m;
|
|
148
|
+
O.operator = o;
|
|
149
|
+
const n = ee(_), s = n.length;
|
|
150
|
+
return (o === "quotient" ? s !== 2 : o !== "sum" && s < 2) && w(
|
|
151
|
+
`${h}: <${$e[o]}> takes ${o === "quotient" ? "exactly two operands" : "two or more operands"}; it was given ${s}.`
|
|
152
|
+
), O.operands = n.map((u, C) => b(u, pe(m, u, C), h)), m;
|
|
153
|
+
}, U = (c, m, $) => {
|
|
154
|
+
const o = `${$} › <Chain>`, [_, ...y] = ee(c);
|
|
155
|
+
(_ === void 0 || z(_) && (ue.has(_.type) || _.type === ce)) && w(`${o}: a chain starts with a quantity that has no operator - ${de} or <Ref>.`);
|
|
156
|
+
let M = b(_, pe(m, _, 0), o), q = ne(_), x = [], B;
|
|
157
|
+
return y.forEach((h, O) => {
|
|
158
|
+
const n = pe(m, h, O + 1);
|
|
159
|
+
if (z(h) && h.type === ce) {
|
|
160
|
+
const I = h.props, G = `${o} › ${I.label}`;
|
|
161
|
+
x.length === 0 && w(`${G}: an <Interim> needs an operand since the named value before it, ${q}.`);
|
|
162
|
+
const J = f(n, I, G);
|
|
163
|
+
J.interim = !0, J.operator = x[0].line.operator, J.operands = [M, ...x.map((te) => te.operand)], M = { key: n, reference: !1, previous: !0 }, q = `<Interim label="${I.label}">`, x = [], B = n;
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
(
|
|
170
|
-
`${
|
|
166
|
+
const s = z(h) ? ue.get(h.type) : void 0;
|
|
167
|
+
s === void 0 && w(`${o}: ${ne(h)} needs an operator in a chain - <Plus>, <Minus>, <Times> or <DividedBy> - or is an <Interim>.`), e !== void 0 && s.operator !== "sum" && w(`${o}: <${s.name}> - ${_e}`);
|
|
168
|
+
const u = s.operator !== "sum", C = x.find((I) => I.line.operator !== "sum");
|
|
169
|
+
(u && x.length > 0 || C) && w(
|
|
170
|
+
`${o}: <${(C ?? { line: s }).line.name}> stands alone between two named values - directly after the first quantity or an <Interim>, and directly before an <Interim>.`
|
|
171
171
|
);
|
|
172
|
-
const { children:
|
|
173
|
-
if (
|
|
174
|
-
(
|
|
175
|
-
const
|
|
176
|
-
|
|
172
|
+
const { children: d, ...T } = h.props, A = ee(d), k = () => w(`${o}: <${s.name}> takes either a label and a value, or exactly one quantity as its child.`);
|
|
173
|
+
if (A.length > 0) {
|
|
174
|
+
(A.length > 1 || Object.values(T).some((G) => G !== void 0)) && k();
|
|
175
|
+
const I = b(A[0], n, o);
|
|
176
|
+
I.negated = s.negated, x.push({ operand: I, line: s });
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
|
-
|
|
180
|
-
const { value:
|
|
181
|
-
l(
|
|
182
|
-
}), (
|
|
183
|
-
},
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
179
|
+
T.label === void 0 && k();
|
|
180
|
+
const { value: R, source: V, asOf: Q, ages: L, ...W } = T, K = `${o} › ${T.label}`, Y = f(n, { ...W, label: T.label }, K);
|
|
181
|
+
l(R, K), Y.given = { value: R, source: V, asOf: Q, ages: L }, x.push({ operand: { key: n, reference: !1, negated: s.negated }, line: s });
|
|
182
|
+
}), (x.length > 0 || B === void 0) && w(`${o}: a chain ends with an <Interim>, which names its value.`), B;
|
|
183
|
+
}, D = j(p[0], "0", "<Calculation>"), E = a.get(D);
|
|
184
|
+
(E.emphasis !== void 0 || E.rule !== void 0) && w(`<Calculation> › ${E.label}: emphasis and rule do not stand on the Result, which is already the heaviest line.`);
|
|
185
|
+
for (const { operand: c, to: m, where: $ } of N) {
|
|
186
|
+
const o = i.get(m);
|
|
187
|
+
if (o === void 0) {
|
|
188
|
+
const _ = [...i.keys()].map((y) => `"${y}"`).join(", ");
|
|
189
|
+
w(`${$}: <Ref to="${m}"> names no quantity. ${_ ? `The ids that exist: ${_}.` : "No quantity has an id."}`);
|
|
189
190
|
}
|
|
190
|
-
|
|
191
|
+
c.key = o;
|
|
191
192
|
}
|
|
192
|
-
return
|
|
193
|
+
return at(a), { result: D, quantities: a, metrics: e };
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
+
function nt(t) {
|
|
195
196
|
return t.metrics ? t.metrics.map((e) => {
|
|
196
|
-
const
|
|
197
|
-
for (const [
|
|
198
|
-
const
|
|
199
|
-
|
|
197
|
+
const p = /* @__PURE__ */ new Map();
|
|
198
|
+
for (const [r, l] of t.quantities) {
|
|
199
|
+
const a = l.given && { ...l.given, value: l.given.value[e.id] };
|
|
200
|
+
p.set(r, { ...l, unit: e.unit, decimals: e.decimals, given: a });
|
|
200
201
|
}
|
|
201
|
-
return { result: t.result, quantities:
|
|
202
|
+
return { result: t.result, quantities: p };
|
|
202
203
|
}) : [t];
|
|
203
204
|
}
|
|
204
|
-
function
|
|
205
|
-
const e = /* @__PURE__ */ new Set(),
|
|
205
|
+
function at(t) {
|
|
206
|
+
const e = /* @__PURE__ */ new Set(), p = [], r = (l) => {
|
|
206
207
|
if (e.has(l)) return;
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
const i = [...
|
|
208
|
+
const a = p.indexOf(l);
|
|
209
|
+
if (a !== -1) {
|
|
210
|
+
const i = [...p.slice(a), l].map((N) => t.get(N).label);
|
|
210
211
|
w(`the calculation goes round in a circle through references: ${i.join(" → ")}.`);
|
|
211
212
|
}
|
|
212
|
-
|
|
213
|
-
for (const i of t.get(l).operands)
|
|
214
|
-
|
|
213
|
+
p.push(l);
|
|
214
|
+
for (const i of t.get(l).operands) r(i.key);
|
|
215
|
+
p.pop(), e.add(l);
|
|
215
216
|
};
|
|
216
|
-
for (const l of t.keys())
|
|
217
|
+
for (const l of t.keys()) r(l);
|
|
217
218
|
}
|
|
218
|
-
const ye = 4
|
|
219
|
+
const ye = 4;
|
|
220
|
+
function ot(t, e, p) {
|
|
221
|
+
const r = t.operands[e];
|
|
222
|
+
if (r.previous) return;
|
|
223
|
+
const l = t.operator, a = e === 0;
|
|
224
|
+
if (l !== "sum" && l !== "difference") return a ? void 0 : { operator: l, negated: !1 };
|
|
225
|
+
const i = l === "difference" ? !a : r.negated === !0, N = new Set(p.filter((b) => b !== null && b !== 0).map(Math.sign)), f = N.size === 1 ? { operator: "sum", negated: i !== N.has(-1), unsigned: !0 } : { operator: "sum", negated: i };
|
|
226
|
+
return a && !f.negated ? void 0 : f;
|
|
227
|
+
}
|
|
228
|
+
const st = {
|
|
219
229
|
sum: "calculationSumSymbol",
|
|
220
230
|
difference: "calculationDifferenceSymbol",
|
|
221
231
|
product: "calculationProductSymbol",
|
|
222
232
|
quotient: "calculationQuotientSymbol"
|
|
223
|
-
},
|
|
233
|
+
}, it = {
|
|
224
234
|
sum: "calculationSumWord",
|
|
225
235
|
difference: "calculationDifferenceWord",
|
|
226
236
|
product: "calculationProductWord",
|
|
227
237
|
quotient: "calculationQuotientWord"
|
|
228
238
|
};
|
|
229
|
-
function
|
|
239
|
+
function oe(t, e) {
|
|
230
240
|
switch (t) {
|
|
231
241
|
case "alarm":
|
|
232
242
|
return e.verdictAlarm;
|
|
@@ -238,300 +248,311 @@ function ne(t, e) {
|
|
|
238
248
|
return e.verdictOk;
|
|
239
249
|
}
|
|
240
250
|
}
|
|
241
|
-
function
|
|
242
|
-
const
|
|
243
|
-
return
|
|
251
|
+
function ie(t, e, p) {
|
|
252
|
+
const r = t.negated ? "difference" : t.operator;
|
|
253
|
+
return p[(e ? it : st)[r]];
|
|
244
254
|
}
|
|
245
|
-
function
|
|
255
|
+
function rt(t, e) {
|
|
246
256
|
return t.kind === "missing" ? e.calculationMissing(t.label) : e.calculationDivisionByZero(t.label);
|
|
247
257
|
}
|
|
248
|
-
function
|
|
249
|
-
const l = t.format === "percent" ?
|
|
250
|
-
return l ? `${
|
|
258
|
+
function we(t, e, p, r) {
|
|
259
|
+
const l = t.format === "percent" ? r : t.unit, a = p.number(e, t.decimals);
|
|
260
|
+
return l ? `${a} ${l}` : a;
|
|
251
261
|
}
|
|
252
|
-
function
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
262
|
+
function lt(t, e, p, r, l, a, i, N = () => {
|
|
263
|
+
}) {
|
|
264
|
+
const f = t.quantities.get(p), b = e.get(p), j = (h, O) => h.shown !== null && (O != null && O.unsigned) ? Math.abs(h.shown) : h.shown, U = (h, O, n, s) => {
|
|
265
|
+
const u = j(O, s);
|
|
266
|
+
return u === null ? n ? a.verdictUnknown : a.statAbsentValue : we(h, u, l, n ? a.calculationPercent : "%");
|
|
267
|
+
}, D = (h) => {
|
|
268
|
+
if (r || !f.operator) return {};
|
|
269
|
+
if (f.operands.length === 0) return { names: a.calculationNoOperands };
|
|
270
|
+
if (!h && f.operands.length > ye)
|
|
271
|
+
return { names: a.calculationOperandCount(f.operands.length) };
|
|
272
|
+
const O = (n) => f.operands.map((s, u) => {
|
|
273
|
+
const C = t.quantities.get(s.key), d = N(u);
|
|
274
|
+
return d ? `${ie(d, h, a)} ${n(C, d)}` : n(C);
|
|
260
275
|
}).join(" ");
|
|
261
276
|
return {
|
|
262
|
-
names:
|
|
263
|
-
numbers:
|
|
277
|
+
names: O((n) => n.label),
|
|
278
|
+
numbers: O((n, s) => U(n, e.get(n.key), h, s))
|
|
264
279
|
};
|
|
265
|
-
},
|
|
266
|
-
var
|
|
267
|
-
const
|
|
268
|
-
if (
|
|
269
|
-
const
|
|
270
|
-
return
|
|
271
|
-
},
|
|
272
|
-
(i ? `${
|
|
273
|
-
b.verdict !== void 0 && b.verdict !== "unknown" ?
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
].filter(Boolean).join(", "),
|
|
277
|
-
return { amount: b
|
|
280
|
+
}, E = (h) => {
|
|
281
|
+
var s;
|
|
282
|
+
const O = (s = b.assessment) == null ? void 0 : s.deviation;
|
|
283
|
+
if (O === void 0 || f.target === void 0) return;
|
|
284
|
+
const n = we(f, ae(f, f.target), l, h ? a.calculationPercent : "%");
|
|
285
|
+
return O > 0 ? a.calculationAboveTarget(n) : O < 0 ? a.calculationBelowTarget(n) : a.calculationOnTarget(n);
|
|
286
|
+
}, c = D(!1).names, m = c === void 0 || f.operands.length === 0 || f.operands.length > ye ? c : `= ${c}`, $ = D(!0), o = b.absence ? rt(b.absence, a) : void 0, _ = ` ${a.calculationEquals} `, y = b.approximate ? `${a.calculationApproximately} ${U(f, b, !0, i)}` : U(f, b, !0, i), q = [
|
|
287
|
+
(i ? `${ie(i, !0, a)} ` : "") + f.label + _ + [$.names, $.numbers, y].filter(Boolean).join(`,${_}`),
|
|
288
|
+
b.verdict !== void 0 && b.verdict !== "unknown" ? oe(b.verdict, a) : void 0,
|
|
289
|
+
E(!0),
|
|
290
|
+
o
|
|
291
|
+
].filter(Boolean).join(", "), x = b.shown === null ? void 0 : f.format === "percent" ? "%" : f.unit, B = (h) => h === null ? a.statAbsentValue : l.number(h, f.decimals);
|
|
292
|
+
return { amount: B(j(b, i)), ownAmount: B(b.shown), unit: x, names: m, target: E(!1), reason: o, sentence: q, spokenNames: $.names, spokenNumber: y };
|
|
278
293
|
}
|
|
279
|
-
function
|
|
280
|
-
const
|
|
281
|
-
(
|
|
294
|
+
function ct(t, e, p, r, l) {
|
|
295
|
+
const a = l ? `${ie(l, !0, r)} ` : "", i = e[0].spokenNames, N = a + t + (i === void 0 ? "" : ` ${r.calculationEquals} ${i}`), f = p.map(
|
|
296
|
+
(b, j) => [`${b.label} ${e[j].spokenNumber}`, e[j].reason].filter(Boolean).join(", ")
|
|
282
297
|
);
|
|
283
|
-
return `${
|
|
298
|
+
return `${N}: ${f.join("; ")}`;
|
|
284
299
|
}
|
|
285
|
-
const
|
|
286
|
-
frame:
|
|
287
|
-
calculation:
|
|
288
|
-
disclosure:
|
|
289
|
-
list:
|
|
290
|
-
item:
|
|
291
|
-
derivation:
|
|
292
|
-
line:
|
|
293
|
-
labelCell:
|
|
294
|
-
names:
|
|
295
|
-
operator:
|
|
296
|
-
amount:
|
|
297
|
-
unit:
|
|
298
|
-
assessment:
|
|
299
|
-
label:
|
|
300
|
-
approximate:
|
|
301
|
-
target:
|
|
302
|
-
worst:
|
|
303
|
-
head:
|
|
304
|
-
headCell:
|
|
305
|
-
headUnit:
|
|
306
|
-
notes:
|
|
307
|
-
freshness:
|
|
308
|
-
headLabel:
|
|
309
|
-
},
|
|
310
|
-
function
|
|
311
|
-
const
|
|
312
|
-
return /* @__PURE__ */
|
|
313
|
-
|
|
314
|
-
l.age !== null && ` · ${
|
|
300
|
+
const ut = "_frame_18d3p_24 _text_r8i8z_23", dt = "_calculation_18d3p_46", pt = "_disclosure_18d3p_60", ft = "_list_18d3p_64", mt = "_item_18d3p_65", ht = "_derivation_18d3p_66", vt = "_line_18d3p_116", gt = "_labelCell_18d3p_158", bt = "_names_18d3p_159", $t = "_operator_18d3p_160", _t = "_amount_18d3p_161", yt = "_unit_18d3p_162", wt = "_assessment_18d3p_163", Nt = "_label_18d3p_158", Ot = "_approximate_18d3p_281", St = "_target_18d3p_309", Ct = "_worst_18d3p_310", qt = "_head_18d3p_433", xt = "_headCell_18d3p_440", kt = "_headUnit_18d3p_453", Mt = "_notes_18d3p_460", Tt = "_freshness_18d3p_474", Et = "_headLabel_18d3p_504", v = {
|
|
301
|
+
frame: ut,
|
|
302
|
+
calculation: dt,
|
|
303
|
+
disclosure: pt,
|
|
304
|
+
list: ft,
|
|
305
|
+
item: mt,
|
|
306
|
+
derivation: ht,
|
|
307
|
+
line: vt,
|
|
308
|
+
labelCell: gt,
|
|
309
|
+
names: bt,
|
|
310
|
+
operator: $t,
|
|
311
|
+
amount: _t,
|
|
312
|
+
unit: yt,
|
|
313
|
+
assessment: wt,
|
|
314
|
+
label: Nt,
|
|
315
|
+
approximate: Ot,
|
|
316
|
+
target: St,
|
|
317
|
+
worst: Ct,
|
|
318
|
+
head: qt,
|
|
319
|
+
headCell: xt,
|
|
320
|
+
headUnit: kt,
|
|
321
|
+
notes: Mt,
|
|
322
|
+
freshness: Tt,
|
|
323
|
+
headLabel: Et
|
|
324
|
+
}, At = 10, X = (t) => 4 + 2 * t, Rt = (t) => 5 + 2 * t, It = { ok: "success", unknown: "neutral", warning: "warning", alarm: "danger" }, Pt = (...t) => t.filter(Boolean).join(" ");
|
|
325
|
+
function jt({ asOf: t, ages: e }) {
|
|
326
|
+
const p = Ne(), r = Oe(), l = je(t, e), a = l.freshness === "lost" ? r.freshnessDisconnected : l.freshness === "stale" ? r.freshnessStale : r.freshnessFresh;
|
|
327
|
+
return /* @__PURE__ */ P("span", { className: v.freshness, "data-freshness": l.freshness, children: [
|
|
328
|
+
a,
|
|
329
|
+
l.age !== null && ` · ${p.relative(l.age)}`
|
|
315
330
|
] });
|
|
316
331
|
}
|
|
317
|
-
function
|
|
318
|
-
const
|
|
319
|
-
const
|
|
320
|
-
if (!
|
|
321
|
-
|
|
332
|
+
function Wt({ children: t, className: e, style: p, metrics: r, ...l }) {
|
|
333
|
+
const a = Ne(), i = Oe(), N = ke(), f = tt(t, r), b = nt(f).map((n) => ({ view: n, results: Fe(n) })), [j, U] = re(() => /* @__PURE__ */ new Set()), [D, E] = re(null), c = Me(null), [m, $] = re(!1), o = (r == null ? void 0 : r.length) ?? 0, _ = Te(() => {
|
|
334
|
+
const n = c.current, s = n && o > 0 ? getComputedStyle(n.firstElementChild).gridTemplateColumns.split(" ").map(parseFloat) : [], u = X(o) - 1;
|
|
335
|
+
if (!n || s.length <= u || s.some((k) => !Number.isFinite(k))) {
|
|
336
|
+
$(!1);
|
|
322
337
|
return;
|
|
323
338
|
}
|
|
324
|
-
const
|
|
325
|
-
let
|
|
326
|
-
const
|
|
327
|
-
for (const k of
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
if (
|
|
331
|
-
const
|
|
332
|
-
|
|
339
|
+
const C = s.slice(2, u).reduce((k, R) => k + R, 0);
|
|
340
|
+
let d = 0;
|
|
341
|
+
const T = document.createRange();
|
|
342
|
+
for (const k of n.querySelectorAll(`.${v.label}`)) {
|
|
343
|
+
T.selectNodeContents(k);
|
|
344
|
+
const R = [...T.getClientRects()].reduce((L, W) => L + W.width, 0);
|
|
345
|
+
if (R === 0) continue;
|
|
346
|
+
const V = k.parentElement, Q = k.getBoundingClientRect().left - V.getBoundingClientRect().left;
|
|
347
|
+
d = Math.max(d, Q + R + parseFloat(getComputedStyle(V).paddingRight));
|
|
333
348
|
}
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
}, [
|
|
337
|
-
|
|
338
|
-
const
|
|
339
|
-
if (!
|
|
340
|
-
const
|
|
341
|
-
return
|
|
342
|
-
}, [
|
|
343
|
-
const
|
|
344
|
-
const
|
|
345
|
-
return
|
|
346
|
-
}),
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
349
|
+
const A = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
350
|
+
$(n.clientWidth - C < Math.min(d, At * A));
|
|
351
|
+
}, [o]);
|
|
352
|
+
Ee(() => _()), Ae(() => {
|
|
353
|
+
const n = c.current;
|
|
354
|
+
if (!n || o === 0) return;
|
|
355
|
+
const s = new ResizeObserver(() => _());
|
|
356
|
+
return s.observe(n), () => s.disconnect();
|
|
357
|
+
}, [_, o]);
|
|
358
|
+
const y = (n) => U((s) => {
|
|
359
|
+
const u = new Set(s);
|
|
360
|
+
return u.delete(n) || u.add(n), u;
|
|
361
|
+
}), M = (n, s) => ot(
|
|
362
|
+
n,
|
|
363
|
+
s,
|
|
364
|
+
b.map(({ results: u }) => u.get(n.operands[s].key).shown)
|
|
365
|
+
);
|
|
366
|
+
let q = !1;
|
|
367
|
+
const x = (n, s) => n.map(({ own: u, text: C }, d) => [
|
|
368
|
+
/* @__PURE__ */ P(
|
|
350
369
|
"span",
|
|
351
370
|
{
|
|
352
|
-
className:
|
|
371
|
+
className: v.amount,
|
|
353
372
|
"aria-hidden": "true",
|
|
354
|
-
"data-verdict":
|
|
355
|
-
"data-later":
|
|
356
|
-
style:
|
|
373
|
+
"data-verdict": u.verdict,
|
|
374
|
+
"data-later": d > 0 ? "" : void 0,
|
|
375
|
+
style: r ? { "--column": X(d) } : void 0,
|
|
357
376
|
children: [
|
|
358
|
-
|
|
359
|
-
|
|
377
|
+
u.approximate && /* @__PURE__ */ g(De, { content: i.calculationApproximateNote, children: /* @__PURE__ */ g("span", { className: v.approximate, children: "≈" }) }),
|
|
378
|
+
s ? C.ownAmount : C.amount
|
|
360
379
|
]
|
|
361
380
|
},
|
|
362
|
-
`amount-${
|
|
381
|
+
`amount-${d}`
|
|
363
382
|
),
|
|
364
383
|
/* @__PURE__ */ g(
|
|
365
384
|
"span",
|
|
366
385
|
{
|
|
367
|
-
className:
|
|
386
|
+
className: v.unit,
|
|
368
387
|
"aria-hidden": "true",
|
|
369
|
-
style:
|
|
370
|
-
"data-last":
|
|
371
|
-
children:
|
|
388
|
+
style: r ? { "--column": Rt(d) } : void 0,
|
|
389
|
+
"data-last": r && d === n.length - 1 ? "" : void 0,
|
|
390
|
+
children: r && !s ? void 0 : C.unit
|
|
372
391
|
},
|
|
373
|
-
`unit-${
|
|
392
|
+
`unit-${d}`
|
|
374
393
|
)
|
|
375
|
-
]),
|
|
376
|
-
const
|
|
377
|
-
own: H.get(
|
|
378
|
-
text:
|
|
379
|
-
})), { own:
|
|
380
|
-
|
|
381
|
-
const
|
|
382
|
-
(
|
|
383
|
-
) : [],
|
|
384
|
-
!
|
|
394
|
+
]), B = (n, s) => D === null ? void 0 : n === D ? "use" : s === D ? "operand" : void 0, h = (n, s, u, C) => {
|
|
395
|
+
const d = f.quantities.get(n), T = b.map(({ view: S, results: H }) => ({
|
|
396
|
+
own: H.get(n),
|
|
397
|
+
text: lt(S, H, n, s, a, i, u.position, (Ce) => M(d, Ce))
|
|
398
|
+
})), { own: A, text: k } = T[0], R = d.operator !== void 0 && !s, V = n === f.result && !s, Q = R && d.operands.length > 0 && (d.interim ? u.flat : V), L = R && !Q && d.operands.length > 0, W = L && j.has(n);
|
|
399
|
+
q || (q = L);
|
|
400
|
+
const K = `${N}-${n}`, Y = { depth: Q ? u.depth : u.depth + 1, flat: !1, parent: n }, I = R ? d.operands.find((S) => S.previous) : void 0, G = I && u.flat ? h(I.key, !1, { ...u, parent: n, position: void 0 }, `${C}-c`) : [], J = I && !u.flat ? h(I.key, !1, { ...Y, flat: !0 }, `${C}-c`) : [], te = R ? d.operands.map(
|
|
401
|
+
(S, H) => S.previous ? null : h(S.key, S.reference, { ...Y, position: M(d, H) }, `${C}-${H}`)
|
|
402
|
+
) : [], Z = L && !W && A.worst !== void 0 && se(A.worst) > se(A.verdict ?? "ok") ? A.worst : void 0, F = s ? void 0 : d.given, Se = u.position ? ie(u.position, !1, i) : void 0, fe = [
|
|
403
|
+
!s && d.explanation !== void 0 && /* @__PURE__ */ g("span", { children: d.explanation }, "explanation"),
|
|
385
404
|
(F == null ? void 0 : F.source) !== void 0 && /* @__PURE__ */ g("span", { children: i.calculationSource(F.source) }, "source"),
|
|
386
|
-
(F == null ? void 0 : F.asOf) !== void 0 && (F.ages !== void 0 ? /* @__PURE__ */ g(
|
|
387
|
-
!
|
|
388
|
-
].filter(Boolean), me =
|
|
405
|
+
(F == null ? void 0 : F.asOf) !== void 0 && (F.ages !== void 0 ? /* @__PURE__ */ g(jt, { asOf: F.asOf, ages: F.ages }, "asOf") : /* @__PURE__ */ g("span", { children: i.asOfAgo(a.dateTime(new Date(F.asOf), !1)) }, "asOf")),
|
|
406
|
+
!s && d.aside !== void 0 && /* @__PURE__ */ g("span", { children: d.aside }, "aside")
|
|
407
|
+
].filter(Boolean), me = V ? "result" : d.interim && !s && u.flat ? "interim" : void 0, he = /* @__PURE__ */ P(
|
|
389
408
|
"div",
|
|
390
409
|
{
|
|
391
|
-
className:
|
|
392
|
-
style: { "--depth":
|
|
393
|
-
"data-inner":
|
|
410
|
+
className: v.line,
|
|
411
|
+
style: { "--depth": u.depth },
|
|
412
|
+
"data-inner": u.depth > 0 ? "" : void 0,
|
|
394
413
|
"data-kind": me,
|
|
395
|
-
"data-foldable":
|
|
396
|
-
"data-reference":
|
|
397
|
-
"data-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
414
|
+
"data-foldable": L ? "" : void 0,
|
|
415
|
+
"data-reference": s ? "" : void 0,
|
|
416
|
+
"data-emphasis": s ? void 0 : d.emphasis,
|
|
417
|
+
"data-rule": !s && d.rule ? "" : void 0,
|
|
418
|
+
"data-mark": B(n, u.parent),
|
|
419
|
+
onPointerEnter: () => E(n),
|
|
420
|
+
onPointerLeave: () => E(null),
|
|
421
|
+
onFocus: () => E(n),
|
|
422
|
+
onBlur: () => E(null),
|
|
423
|
+
onClick: L ? () => {
|
|
424
|
+
var S;
|
|
425
|
+
(S = window.getSelection()) != null && S.toString() || y(n);
|
|
405
426
|
} : void 0,
|
|
406
427
|
children: [
|
|
407
|
-
/* @__PURE__ */ g(
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
428
|
+
/* @__PURE__ */ g(Ie, { children: [
|
|
429
|
+
r ? ct(d.label, T.map((S) => S.text), r, i, u.position) : k.sentence,
|
|
430
|
+
T.some((S) => S.own.approximate) && i.calculationApproximateNote,
|
|
431
|
+
Z !== void 0 && i.calculationWorstInside(oe(Z, i))
|
|
411
432
|
].filter(Boolean).join(". ") }),
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
|
|
433
|
+
/* @__PURE__ */ P("span", { className: v.labelCell, children: [
|
|
434
|
+
L ? /* @__PURE__ */ g(
|
|
414
435
|
"button",
|
|
415
436
|
{
|
|
416
437
|
type: "button",
|
|
417
|
-
className:
|
|
418
|
-
"aria-expanded":
|
|
419
|
-
"aria-controls":
|
|
420
|
-
"aria-label": (
|
|
421
|
-
children: /* @__PURE__ */ g(
|
|
438
|
+
className: v.disclosure,
|
|
439
|
+
"aria-expanded": W,
|
|
440
|
+
"aria-controls": K,
|
|
441
|
+
"aria-label": (W ? i.calculationHideDerivation : i.calculationShowDerivation)(d.label),
|
|
442
|
+
children: /* @__PURE__ */ g(Pe, { "data-open": W ? "" : void 0 })
|
|
422
443
|
}
|
|
423
|
-
) : /* @__PURE__ */ g("span", { className:
|
|
424
|
-
/* @__PURE__ */ g("span", { className:
|
|
444
|
+
) : /* @__PURE__ */ g("span", { className: v.disclosure, "aria-hidden": "true" }),
|
|
445
|
+
/* @__PURE__ */ g("span", { className: v.label, "aria-hidden": "true", children: d.label })
|
|
425
446
|
] }),
|
|
426
|
-
/* @__PURE__ */ g("span", { className:
|
|
427
|
-
/* @__PURE__ */ g("span", { className:
|
|
428
|
-
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
|
|
447
|
+
/* @__PURE__ */ g("span", { className: v.names, "aria-hidden": "true", children: R && !Q && !W ? k.names : void 0 }),
|
|
448
|
+
/* @__PURE__ */ g("span", { className: v.operator, "aria-hidden": "true", children: Se }),
|
|
449
|
+
x(T, me !== void 0),
|
|
450
|
+
/* @__PURE__ */ P("span", { className: v.assessment, "aria-hidden": "true", children: [
|
|
451
|
+
r ? (
|
|
431
452
|
/* Short: which metric. The sentence carries the full reason. */
|
|
432
|
-
|
|
433
|
-
(
|
|
453
|
+
r.map(
|
|
454
|
+
(S, H) => T[H].own.absence && /* @__PURE__ */ g(le, { children: i.calculationMissing(S.unit ?? S.label) }, S.id)
|
|
434
455
|
)
|
|
435
|
-
) : k.reason !== void 0 ? /* @__PURE__ */ g(
|
|
436
|
-
k.target !== void 0 && /* @__PURE__ */ g("span", { className:
|
|
437
|
-
|
|
456
|
+
) : k.reason !== void 0 ? /* @__PURE__ */ g(le, { children: k.reason }) : A.verdict !== void 0 && /* @__PURE__ */ g(le, { tone: It[A.verdict], children: oe(A.verdict, i) }),
|
|
457
|
+
k.target !== void 0 && /* @__PURE__ */ g("span", { className: v.target, children: k.target }),
|
|
458
|
+
Z !== void 0 && /* @__PURE__ */ g("span", { className: v.worst, "data-verdict": Z, children: i.calculationWorstInside(oe(Z, i)) })
|
|
438
459
|
] }),
|
|
439
|
-
|
|
460
|
+
fe.length > 0 && /* A click here - on a link in the aside, on a sparkline - is the
|
|
440
461
|
caller's, not a fold. */
|
|
441
|
-
/* @__PURE__ */ g("span", { className:
|
|
462
|
+
/* @__PURE__ */ g("span", { className: v.notes, onClick: (S) => S.stopPropagation(), children: fe })
|
|
442
463
|
]
|
|
443
464
|
}
|
|
444
465
|
);
|
|
445
|
-
return
|
|
446
|
-
...
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
/* @__PURE__ */ g("ul", { className:
|
|
466
|
+
return Q ? [
|
|
467
|
+
...G,
|
|
468
|
+
/* @__PURE__ */ P("li", { className: v.item, children: [
|
|
469
|
+
/* @__PURE__ */ g("ul", { className: v.list, children: te }),
|
|
449
470
|
he
|
|
450
|
-
] },
|
|
471
|
+
] }, C)
|
|
451
472
|
] : [
|
|
452
|
-
...
|
|
453
|
-
/* @__PURE__ */
|
|
473
|
+
...G,
|
|
474
|
+
/* @__PURE__ */ P("li", { className: v.item, "data-open": W ? "" : void 0, style: { "--depth": u.depth }, children: [
|
|
454
475
|
he,
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
/* @__PURE__ */ g("li", { className:
|
|
476
|
+
L && /* @__PURE__ */ P("ul", { id: K, className: v.derivation, hidden: !W, children: [
|
|
477
|
+
J,
|
|
478
|
+
te,
|
|
479
|
+
/* @__PURE__ */ g("li", { className: v.item, "aria-hidden": "true", children: /* @__PURE__ */ P(
|
|
459
480
|
"div",
|
|
460
481
|
{
|
|
461
|
-
className:
|
|
462
|
-
style: { "--depth":
|
|
482
|
+
className: v.line,
|
|
483
|
+
style: { "--depth": Y.depth },
|
|
463
484
|
"data-inner": "",
|
|
464
485
|
"data-closing": "",
|
|
465
|
-
"data-mark":
|
|
486
|
+
"data-mark": D === n ? "use" : void 0,
|
|
466
487
|
children: [
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
-
/* @__PURE__ */ g("span", { className:
|
|
469
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ P("span", { className: v.labelCell, children: [
|
|
489
|
+
/* @__PURE__ */ g("span", { className: v.disclosure }),
|
|
490
|
+
/* @__PURE__ */ P("span", { className: v.label, children: [
|
|
470
491
|
"= ",
|
|
471
|
-
|
|
492
|
+
d.label
|
|
472
493
|
] })
|
|
473
494
|
] }),
|
|
474
|
-
/* @__PURE__ */ g("span", { className:
|
|
475
|
-
/* @__PURE__ */ g("span", { className:
|
|
476
|
-
|
|
495
|
+
/* @__PURE__ */ g("span", { className: v.names }),
|
|
496
|
+
/* @__PURE__ */ g("span", { className: v.operator }),
|
|
497
|
+
x(T, !0)
|
|
477
498
|
]
|
|
478
499
|
}
|
|
479
500
|
) })
|
|
480
501
|
] })
|
|
481
|
-
] },
|
|
502
|
+
] }, C)
|
|
482
503
|
];
|
|
483
|
-
},
|
|
504
|
+
}, O = h(f.result, !1, { depth: 0, flat: !0, parent: null }, "r");
|
|
484
505
|
return (
|
|
485
506
|
/* The frame is the surface and the container the layout measures itself
|
|
486
507
|
against; the list inside it is the statement. */
|
|
487
508
|
/* @__PURE__ */ g(
|
|
488
509
|
"div",
|
|
489
510
|
{
|
|
490
|
-
ref:
|
|
491
|
-
className:
|
|
492
|
-
style:
|
|
493
|
-
"--figure-tracks": Array(
|
|
494
|
-
"--figures-end":
|
|
495
|
-
"--assessment-column":
|
|
496
|
-
...
|
|
497
|
-
} :
|
|
498
|
-
"data-still":
|
|
499
|
-
"data-metrics":
|
|
500
|
-
"data-two-lines":
|
|
501
|
-
children: /* @__PURE__ */
|
|
502
|
-
|
|
511
|
+
ref: c,
|
|
512
|
+
className: Pt(v.frame, e),
|
|
513
|
+
style: r ? {
|
|
514
|
+
"--figure-tracks": Array(o * 2).fill("auto").join(" "),
|
|
515
|
+
"--figures-end": X(o),
|
|
516
|
+
"--assessment-column": X(o),
|
|
517
|
+
...p
|
|
518
|
+
} : p,
|
|
519
|
+
"data-still": q ? void 0 : "",
|
|
520
|
+
"data-metrics": r ? o : void 0,
|
|
521
|
+
"data-two-lines": m ? "" : void 0,
|
|
522
|
+
children: /* @__PURE__ */ P("ul", { className: v.calculation, ...l, children: [
|
|
523
|
+
r && /* The head names each metric and its unit above its column. Every
|
|
503
524
|
row's sentence names them too, so the head is for the eye. */
|
|
504
|
-
/* @__PURE__ */ g("li", { className:
|
|
525
|
+
/* @__PURE__ */ g("li", { className: v.item, "aria-hidden": "true", children: /* @__PURE__ */ g("div", { className: v.head, children: r.map((n, s) => /* @__PURE__ */ P(
|
|
505
526
|
"span",
|
|
506
527
|
{
|
|
507
|
-
className:
|
|
508
|
-
"data-unit":
|
|
509
|
-
style: { "--column":
|
|
528
|
+
className: v.headCell,
|
|
529
|
+
"data-unit": n.unit === void 0 ? void 0 : "",
|
|
530
|
+
style: { "--column": X(s) },
|
|
510
531
|
children: [
|
|
511
|
-
/* @__PURE__ */ g("span", { className:
|
|
512
|
-
|
|
532
|
+
/* @__PURE__ */ g("span", { className: v.headLabel, children: n.label }),
|
|
533
|
+
n.unit !== void 0 && /* @__PURE__ */ g("span", { className: v.headUnit, children: n.unit })
|
|
513
534
|
]
|
|
514
535
|
},
|
|
515
|
-
|
|
536
|
+
n.id
|
|
516
537
|
)) }) }),
|
|
517
|
-
|
|
538
|
+
O
|
|
518
539
|
] })
|
|
519
540
|
}
|
|
520
541
|
)
|
|
521
542
|
);
|
|
522
543
|
}
|
|
523
544
|
export {
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
545
|
+
Wt as Calculation,
|
|
546
|
+
He as Chain,
|
|
547
|
+
ze as Difference,
|
|
548
|
+
Ze as DividedBy,
|
|
549
|
+
Ue as Given,
|
|
550
|
+
ce as Interim,
|
|
551
|
+
Ye as Minus,
|
|
552
|
+
Ke as Plus,
|
|
532
553
|
Ve as Product,
|
|
533
|
-
|
|
554
|
+
Ge as Quotient,
|
|
534
555
|
be as Ref,
|
|
535
|
-
|
|
536
|
-
|
|
556
|
+
Qe as Sum,
|
|
557
|
+
Je as Times
|
|
537
558
|
};
|